{"_id":"@balena/jellyfish-metrics","_rev":"4204-9f57b6062bf2175dd6bac224fadd9905","name":"@balena/jellyfish-metrics","dist-tags":{"latest":"2.10.0"},"versions":{"0.0.2-add-dependabot-249fd595ffcc9fe88b4ecf155a2ed861053e670e":{"name":"@balena/jellyfish-metrics","version":"0.0.2-add-dependabot-249fd595ffcc9fe88b4ecf155a2ed861053e670e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.2-add-dependabot-249fd595ffcc9fe88b4ecf155a2ed861053e670e","maintainers":[{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"dist":{"shasum":"72faf911f4e461b2dd05d7e48bf1c9509666ac7b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.2-add-dependabot-249fd595ffcc9fe88b4ecf155a2ed861053e670e.tgz","fileCount":9,"integrity":"sha512-4NJ6WmHcgPaFb5s9dQpptHonmtv4sVMHvReICDn5zBJBUgs6/MZkObnlkGohx/Cv8lFpA8mU3TmFr1hp2dZktQ==","signatures":[{"sig":"MEYCIQCN97aLY4dG5BAurlZD8wTnBgXwVYYUefJqCZuf2wU+swIhAOj8wZ9jpNGOYBj6iwoINOefk5zw9hDafOPa0QJG3Psu","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":44262,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBTIrCRA9TVsSAnZWagAASbEP/0I+n4m85IZpoWb0ebfy\nfvTV7bMgO1neTPH0EFjiOc3MWZ1aaO4zVyS3zK7jMAfL0+7rdQmDhZWbfPYP\nbxwXYlTmu2lAhshDzUh1SQsCSOege6HuQnjvy8r+szoMXyKizzX6c4N/BriK\nQF1G79WIUBPtXcDMPJTnaNmwsD/HnfFT+tXGKhpmZ1/rbdQnFo2Qi3dyjXhm\nQMvVaRH4qql5Xb6jLEdLiescj4vTqXW4A/kvmQ9pSXDhV20r3K0xCtKvNh+y\nuGmev50PMcs3jyVi8jnFrtA5kZPdDSqt4TL05BxII7U7ek0xfzf3L53bqQ0e\ntEcTGAdwT3+6c/K8b1b16zrrSbOpv+0coL/F2R8ZmK6vKFXM0jQQa6Vuqjnv\naPRnn/x/jCfB9oSiu/llMJ9Io8GFISnxsC3lInco93Uz8z7BWVUrtAb248a/\na1nWYypKUs/uSo0L7zeBeoIkw5Tc8l8FhRgxuzHRdjSetvbGqqWwRD38vZi1\nbyUc9A+4FdAiPuZWaXHJ9Cyqeg44gBn7mYEFELgHXNsoUJ+DsZB6h7Aqfip1\nUGLyD5038QVTV10YlYtiaLPNxYVg9nV6wthqB8snUccK9njsd2r+fCQApiuc\nSe8czxtRnJZHqKNjQz5fvYziNnNrz55v0u1wVN1i1FD5FTvtlrYHWxBq6jmp\nMLwk\r\n=kSPK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"249fd595ffcc9fe88b4ecf155a2ed861053e670e","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"http":"0.0.1-security","lodash":"^4.17.15","express":"^4.17.1","@balena/jellyfish-logger":"0.0.4","@balena/jellyfish-environment":"0.0.4","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.10.1","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^28.6.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.2-add-dependabot-249fd595ffcc9fe88b4ecf155a2ed861053e670e_1594176043481_0.8432904659851779","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.2":{"name":"@balena/jellyfish-metrics","version":"0.0.2","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.2","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"568c9352b7d7943e75c9ac1ec0345561f57bb216","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.2.tgz","fileCount":9,"integrity":"sha512-Ewhc0dQHdToTp/i0QwoYxfYHnYP4xpV0iz9fehdb+PEypU2I6S+SgJKlrFW+prsbfuC57ncHb9k4i0sU1JYbyQ==","signatures":[{"sig":"MEUCIQChs/ZhnnMZQlNM7iOJv5fF9QR0I/V0ZiSPdzXqkna20wIgNadOzX2Iqkx+L9WkIZlw5Cyn/khYIN2BdEnrsIT0fB0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":44206,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBTS0CRA9TVsSAnZWagAAW2AP+we7DV7AgipNj6ew3nbl\n3dTp8io7imRsKKerYKwfgJd1glgkWl7ZYgNJJ6oOajqM5FFNUi7PtJA7kplE\nUWorMieZ6RuIgu9qHJA+kJe1AcNTphVv1M1sUFzN4FnYOmeuqbLPSgUjdWXy\nvllj7rE2yV0uhU8Lo9uIRgJ77fqtemI7/yFcY/HV9T6oFj/3sp5JsooKO4XF\nwU02B8o5B0RtT3cn2Txngqu3Q3S2Mkd+xIxFB17Dh5YVedAWR0sc22usLgaP\nNvfbmUOT4jB49t5yu/MLAXx/6vQyKsQMCgK2n7k4xsWhdMGT69cKmqcKGrHb\nwaXx6GM//plvWWeQnFq+eAU4YhKQlGO+xc2/KlQxfbouZzblpGF4BibvuVFv\nY+FkZfh7qqlIlJzVms1E2hHQC4jVLSxtISFanTCkJ2yRxgjigZowEYS5p2y9\n/h85YysemOiYyzrIOYWxWV+Yg/VnVCCFrADp2/n4PzOdPYBGjk/5Gf0D/DfS\nwCdfmQkzEkerJwKhTRGoNowRPcHBn68vJkXvg9/+597vuuwf0REgxrxKzF3J\nwAJqmmrRrghdIgCz6BDAlv9o3QhjcjfpPn7c3t9cJdbLOIIsJ/h4vGW45YTG\nnW/Shqpwb1dFac0a8qTddrlMUYijPN7+kecB9u5StILhnkNfTJQpIumLgQeE\nnumT\r\n=i53R\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"bbfdd7480113ad2e32ad4cf9f77f2e8bf6efdd2e","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"http":"0.0.1-security","lodash":"^4.17.15","express":"^4.17.1","@balena/jellyfish-logger":"0.0.4","@balena/jellyfish-environment":"0.0.4","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.10.1","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^28.6.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.2_1594176692347_0.9392428587456825","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.3-add-dev-doc-5d8be802e99b3a7261ae62b50f815879d3e6c19a":{"name":"@balena/jellyfish-metrics","version":"0.0.3-add-dev-doc-5d8be802e99b3a7261ae62b50f815879d3e6c19a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.3-add-dev-doc-5d8be802e99b3a7261ae62b50f815879d3e6c19a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"ec298463755b890d465bd0d1f0d61b589ad4e560","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.3-add-dev-doc-5d8be802e99b3a7261ae62b50f815879d3e6c19a.tgz","fileCount":10,"integrity":"sha512-VzyZnhNxcSnH4d/dk4XR/AotcdXnLxjtonzl+4YwfY215G8MU0XRZC7+P+G30V3zLolqVk/LhAXmyrNUAKahAg==","signatures":[{"sig":"MEUCIQDEJQpqahewntCjdN9Vwnu4NghdbVYumIMKSgZI59EgwwIgHI0Qbz79dOaCiEPVVkjeVb7OLr9KRXvBu8qbNI5Xrws=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49880,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBWJNCRA9TVsSAnZWagAAgiwP/RqyBsNguoB3WgxWZNMH\nNVlZQtNvXzVXwCiFJULSCgRvbYdi3iQIjkgVAB/DYl09UqemESbhkbobuLaY\nhsBz6iG0oqjd0lo14W6sVc6nxnf94kPPHxi3MIbrEWPDyBVx0eduR6nQseMo\ni63iCPnf9AKIvq3x/iGrXdQIL7yvQjOJv7Kz1L6KXYhi9+OzvqpqeCNYzptb\ngRAbOJWvuv3QzDbdr8gWtNny4zRYV71v1Nk6PW3C5kXQbDwnMBlyYpr0bN4v\n/V3Sj9wHwl5hqpo58YU2kYznxHexEKj2T1zejGw91qEVkHtK6ENm0/8NsOmw\n7s3TTqNuaDVThKlHouUKFU/pd7p0TByxx4BQKXzGnBuo47nK7jLH60SYQHIE\nbcfOXmzwATbXgMlVGbDD+wS5H72LnW2Mogu+CbAKRlU7nDwQYAf1XA53UfRF\nuxpdkmVGITfAiKkdSmLxizT9Sy7u2TldFAiZ+Mj0jEIXKX7O0/ZniHAIr2z4\nAKlm+yzcv1TpY9zdsx6gDyFfi7RXWKv+6Wmjx5xoENHeCQArVlAMBheN3YPN\n0XsyrCPTGZRByHpCkNlqnPgoFD8FGeUqbVhYzxNplEfXLvOoupzVwSL6cY+A\nnakAK61k3ypyLccYhwL9/ltuqJkbB/4w6+kK554x53tYCDafuRYoy4gzu12u\n/byY\r\n=6huM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.toSeconds(ms)](#module_metrics.toSeconds) ⇒ <code>Number</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~actorFromContext(context)](#module_metrics..actorFromContext) ⇒ <code>String</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.toSeconds\"></a>\n\n### metrics.toSeconds(ms) ⇒ <code>Number</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Convert milliseconds to seconds  \n**Returns**: <code>Number</code> - seconds with fixed point notation of 4  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | milliseconds |\n\n**Example**  \n```js\nconst seconds = toSeconds(ms)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..actorFromContext\"></a>\n\n### metrics~actorFromContext(context) ⇒ <code>String</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = actorFromContext(context)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"5d8be802e99b3a7261ae62b50f815879d3e6c19a","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"http":"0.0.1-security","lodash":"^4.17.15","express":"^4.17.1","@balena/jellyfish-logger":"0.0.4","@balena/jellyfish-environment":"0.0.4","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^28.6.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.3-add-dev-doc-5d8be802e99b3a7261ae62b50f815879d3e6c19a_1594188365060_0.7017316191132235","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.3":{"name":"@balena/jellyfish-metrics","version":"0.0.3","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.3","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"fd5f9f66608a4e743d21bf859dabe8cb25b8771f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.3.tgz","fileCount":10,"integrity":"sha512-+hnR/s7IKVdqkLbPaTbX0oXxSCgrlnAQ0UfTOO7xM1wIJfi+/a2Gdi4gI7gvhF5cCg+2+DbVRTSga0hYP9LaSQ==","signatures":[{"sig":"MEYCIQDiFuE2pcqXJTIDd4s3wWwJI9YCn8kjfUqVwLAxB58RLgIhAJn8lelGGkXZkTJ/V8ylChc9+3vlAJEOszBSyATkoU+3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49827,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBWaZCRA9TVsSAnZWagAAvg4P/iWvTjDkMAPmE2D6ydp1\nY9rPyJBKVOfGBFAOdtwTRGWLnl5AZB6Z7iIEkw+e81OVTdqLvNIOS4qqb1J/\ne6GyKm3iWTlasNr+1Dx6rN7Dcne9YwJQCmItuRlIPe4wIAsfYltX3uhhixm5\ner8Nj7uZlkXyXMF7/ere66h7Mzf296DGuKn+6Xg+1ze4ew/RFa+noTAE/eUG\nypab8vxpmrOVseNdv8Aeh6Zfe4j5gLp6ZSpA/K3D6qq2yl9K83bFAjYrA+EY\n8FxrC3y0R9fNy4CRbhTL2zWbMdYkjmbn0CxawmBrrdnm8fA7ww/SOhg/a4Yj\nOjBNfOO6A47MfyD811TAwCx83MdXV47T4+kriLthjNAvFdY5q4wb6tXDRi2h\nN8sQ2UJJw085PegH3QF+1oemqpZZrat38tyBfla1bjS647Eluc4yQMNGAdx2\ni+76xBM7nbbyghyqTXwRjGXBF/3CjlEwhFNjzL2H+PvbNdjHzqJ/rXQHqNU3\nvSGk5ieAr0K7GhERMBdTcT7xhSUN3ubsVZJMCkGdGRj3pFWE1Dmi+bp6RRWR\nInHIlmuu4JndMs8d98K+Dplle5E0SnFKT1+BRDHkekFrlYZZ31l0jwKxQSZo\nmmDwz0w6pxQZ/RggpHkC9jwjysh5rVAVAWV3DdbgoFLqeectDP6dTuShbC0A\na6KS\r\n=obl2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"538fd6e037d291054cb4eeea0deb3291e5518311","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"http":"0.0.1-security","lodash":"^4.17.15","express":"^4.17.1","@balena/jellyfish-logger":"0.0.4","@balena/jellyfish-environment":"0.0.4","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.10.1","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^28.6.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.3_1594189464668_0.6586071458100817","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.4-remove-http-package-121e7d8517a5167276af44921d653781faa58690":{"name":"@balena/jellyfish-metrics","version":"0.0.4-remove-http-package-121e7d8517a5167276af44921d653781faa58690","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.4-remove-http-package-121e7d8517a5167276af44921d653781faa58690","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"3094f11e72c008ae8a752792dce36637615322ab","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.4-remove-http-package-121e7d8517a5167276af44921d653781faa58690.tgz","fileCount":10,"integrity":"sha512-cpPeCA/zdjW72NjeXbRkZo/s0u3dlDkq9hEvfXAeVyMLv9abFurkPexsb/GL5jt9nl6WqXgvcYnFOxvT6VETlg==","signatures":[{"sig":"MEUCIQD0Vrw3XYQi3Ud/Aj59eiNm7bPilEVL8GuRGKzjI73vfgIgELRi1TVbt9JFgjPUrPPs0HWWnzYdz+cxTNbkCLwhTbw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49934,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBW+2CRA9TVsSAnZWagAA1G8P/3N5OLyZs1r9yHdwIdRA\nJHvr+qs+ZlHHWngeYdNKyV7Mgd4O2d/PrVoa4Iusl8dZa8wBgAv5XKcaHdtP\nJI/QXaPwDdX27iHK/Z3cI/tr0pHuspRrQU8j3toEZSLCyaTIgJ9yC/UimIUI\nPJWTvx4r+NirICD6EcJi1T4d3D2sgznhd55clNJ/dL8NRuD3N/3BnYt97t5Z\nN5TZgYSJ7MnLjCdYb+ygc8io95/lwSDfqCMVsq5F3oAB/p9RBfw2oHNKSsBk\nzVPbBx5/I5CWsTEjiJ1pc3ylvvbDzn6hEzOGVDtAF814C66gpE3KSpZyJL38\n4B/ynMqZZLDogKEP43AyRh1Z8pPBOZvQHOc/sh8FJCV4mxGcnW3nUPUxUS7a\np7FgnIxOoBtuDD8+YBlpo9EDX6cCndO8mhgTyFjXzEN/RrH4bH7QeGtlG1sE\nXRCni14tHpmH8XqCFZl65gTl6GChLFMi5nN2WH5L4HzVI2LzjLF5UdLWPg3f\nNq9Hmk+fXBBqUSQw18YrkQvv/4vd86pGPqRKNfrLbJEeaPwy94w79sFaazax\nmq4ImzWTNjDOWC35IJc616oGx+cZ5Le6lxPuumWdvGUGGmtq6+qouMS2ojS8\n/9jh4cWtRAAoGstIdW3xnr+Fx/o/3TxaZOUBhCTG3c7yGtTmKj59/Ak6AArm\ntg2+\r\n=ZcsN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.toSeconds(ms)](#module_metrics.toSeconds) ⇒ <code>Number</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~actorFromContext(context)](#module_metrics..actorFromContext) ⇒ <code>String</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.toSeconds\"></a>\n\n### metrics.toSeconds(ms) ⇒ <code>Number</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Convert milliseconds to seconds  \n**Returns**: <code>Number</code> - seconds with fixed point notation of 4  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | milliseconds |\n\n**Example**  \n```js\nconst seconds = toSeconds(ms)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..actorFromContext\"></a>\n\n### metrics~actorFromContext(context) ⇒ <code>String</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = actorFromContext(context)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"121e7d8517a5167276af44921d653781faa58690","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.15","express":"^4.17.1","@balena/jellyfish-logger":"0.0.4","@balena/jellyfish-environment":"0.0.4","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^28.6.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.4-remove-http-package-121e7d8517a5167276af44921d653781faa58690_1594191797646_0.037454806975217636","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.4":{"name":"@balena/jellyfish-metrics","version":"0.0.4","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.4","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"b45b7120d416f5d87475683b725f93a7fda0b8ed","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.4.tgz","fileCount":10,"integrity":"sha512-TZk7XLIJ2BZZZejL0FOnKE1uB3XLDc63wyV/pJwPSnIjloZikgWdAUFrbDPm5GNdSkcw5fBWyX1Vy4oEsWgWkg==","signatures":[{"sig":"MEUCIHE3hYJOYv3A1xPdQG1iCxWV/6vpvFbwXWGgNblyK+SsAiEAgFG9b8kr7i+h03xMk3Ra2S0LLae1vs/34Y0JyZWS5Dw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49873,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBXC/CRA9TVsSAnZWagAAz20P/ifouZ/Xcyh1SRXWfN+l\nOpNKVARuHVBwjRK1qEXGkr9D7tC5pxyZAyaTSLPBHWxziBZnGP7FoD+8sP/J\n7CYeyz7A4hh/Wwa8OgJmvJyzbUW8scGH35AamJQddVnPh19keIGud+5ViV77\n2LJbQkG4aIivbZ8EZDwwguTKs8mXuO8n/ca3Oe4Vf35MOqJ8RxZKnrEkL1yk\nVdA7M8kDNbGw75DA4zwsCtOx/PUey/90ogAc7QlHweoqqJ9X29c4edkkPLND\n72OA2Vj1XhTnFWyWdGVKRr5BVIl4NN6e+FkP8rX0htmLB21PLyCuLJezxaGy\nX7MoAJQuUwEt8DYZu5I9QaD/4udfVS4jw9A/tJpOxDR37uwZz2JA/Bju4E+v\nOqLOuc6vnEg2oi9Q3admkQnVtV6GG3dz9uLMSTy3VyaAsPG7/Oz8Y1ZjUE6x\n64gG99iZD0nFhp62q2aavO0V/BUfbqeUjxQ+5JNHwXLYSQRJik+6GkIbWSOI\nhN7Zof1YwcSNcrtHbClXOYVH8I0nveYFdNSH48wBSgUBV/477KJErfv4SOGQ\nlbhT6IkibN2N4pNmAThVBBy+0g8NOv0szbg2UUiHiwHrpe6pePkfVwIl5zVO\nPEFVzqq+6iIUnRU0BPVnKn+6qPl37F4PjpNPWVlTvvJdkH1dEkfoxJ5T4gbz\nAqoO\r\n=8BVY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"a62133ca2c2ab2ab00f6de355ddaef4720fd076a","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.15","express":"^4.17.1","@balena/jellyfish-logger":"0.0.4","@balena/jellyfish-environment":"0.0.4","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.10.1","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^28.6.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.4_1594192063434_0.3745330874194719","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.5-dependabot-npm-and-yarn-eslint-plugin-jsdoc-29-1-0-4f9623d4840a462b7a1973731f3733f80279544c":{"name":"@balena/jellyfish-metrics","version":"0.0.5-dependabot-npm-and-yarn-eslint-plugin-jsdoc-29-1-0-4f9623d4840a462b7a1973731f3733f80279544c","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.5-dependabot-npm-and-yarn-eslint-plugin-jsdoc-29-1-0-4f9623d4840a462b7a1973731f3733f80279544c","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"c6c04c12b4f847183a622bf7919b2e8d91375f4c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.5-dependabot-npm-and-yarn-eslint-plugin-jsdoc-29-1-0-4f9623d4840a462b7a1973731f3733f80279544c.tgz","fileCount":10,"integrity":"sha512-bbezKwGoyofJ7CLQlLtqhW3sKJ/F5QBVirF6G+reR3SrYV1WrjuZVnY7rYQkblGR84TCtFNNhpcqMc2XubbJLg==","signatures":[{"sig":"MEUCIEixVIgKKh5N0LU/IuGecJixBwVUTBo3n3zgFEHw0HGyAiEA+yiIXtG7J3PdjNWBZprE31IPWu2/j9ODHmUaGemh4dE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":50066,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBbbZCRA9TVsSAnZWagAABxEP/jGf/2yP9gJDAtD2+S/L\nMc3o5GgmGLRYCcNB10t1wvd4TEDdsPt/bqxSMoCyVFA81zOzrgr6rtLvmi6J\n3dM2ZfXqVFJdtnKxr5hILlYUx9/F9d3RyDv1nhqMJbW+wn/CqYC6K2+Cw0NP\n3V0BSlfajDoIT2x7fW9LEte5xIwto4pGkJDzjPxpdudz9CDDL2Ao3HxOH0j0\nhzYPVt7U/WC8LeyOwoz8HWjqgMFiSsW65jfuwWY50YDgOaRASDheKJq3ObtM\nr55qdiD8Vbb8c2mOTsf2ytOrp0Zo1PQKDkvyfnx8Pq+q4Bbw14JRSHZrgDGu\nsb1ZOoG1vrR6mlTN9f35EPDtjOoMcjdA9pOP8XQnB3+7GS2p3eJKzyiJX/Zq\ns45soUAR7IV/xVdVEtFHU0nrAh9yTxCJKHf1L7dqj9udtNrS5Z4PO52MD1UZ\nZWwNv04O9TJa0Ct0Q2U8xniBJUi8HeSIah/V7sqU+82GfbEbW8vFUPUFkmvK\nXGzZPCUMruaHfWIFHykhCA2/rKBHerqp0Qm2BsyV017+zNq1W2yMas9Bkr5K\nxM12OUE92Esxmwj4j0XMIrSGW5E+Pqvcy+uJa56eNvr1SDv/K2paXEBGeg0L\n3JMDTkJNa5hyp5drotyAUAig6kw/1IFQRfJXulPFssfuznpbX34K0PyMKj2n\na3X0\r\n=O8T3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.toSeconds(ms)](#module_metrics.toSeconds) ⇒ <code>Number</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~actorFromContext(context)](#module_metrics..actorFromContext) ⇒ <code>String</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.toSeconds\"></a>\n\n### metrics.toSeconds(ms) ⇒ <code>Number</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Convert milliseconds to seconds  \n**Returns**: <code>Number</code> - seconds with fixed point notation of 4  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | milliseconds |\n\n**Example**  \n```js\nconst seconds = toSeconds(ms)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..actorFromContext\"></a>\n\n### metrics~actorFromContext(context) ⇒ <code>String</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = actorFromContext(context)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"4f9623d4840a462b7a1973731f3733f80279544c","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.15","express":"^4.17.1","@balena/jellyfish-logger":"0.0.4","@balena/jellyfish-environment":"0.0.4","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^29.1.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.5-dependabot-npm-and-yarn-eslint-plugin-jsdoc-29-1-0-4f9623d4840a462b7a1973731f3733f80279544c_1594210008610_0.24515260042484388","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.5-dependabot-npm-and-yarn-lodash-4-17-17-554a71073a41f4c0833a47e87b8060c4c88667ab":{"name":"@balena/jellyfish-metrics","version":"0.0.5-dependabot-npm-and-yarn-lodash-4-17-17-554a71073a41f4c0833a47e87b8060c4c88667ab","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.5-dependabot-npm-and-yarn-lodash-4-17-17-554a71073a41f4c0833a47e87b8060c4c88667ab","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"625afd727de427fce80276cf56461d575cf0a72d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.5-dependabot-npm-and-yarn-lodash-4-17-17-554a71073a41f4c0833a47e87b8060c4c88667ab.tgz","fileCount":10,"integrity":"sha512-FNxKWsTjYXPyDjyC5bNP2wTY05dvAivgujfNLGukXex22m9h+qXzxVNFFS/T1OJkiRJWZzTZbnflh1WWRq/MyA==","signatures":[{"sig":"MEQCID+dzTa7/YGi76RanMR2BAYEmfzYNSz1h74vCIX4Pyz3AiAxpOWGNVHv8b7Lv7sljKSj9rrfBOTi6T8NqRK0xEAP/A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":50043,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBblCCRA9TVsSAnZWagAAsY8QAIB6kA1qkN8WOtfd5Vqw\nPRj83zORdkDGDxGaHoufligvhfJQHU5YaB9D2CUredt0sE4qkuE9QJ+zcFMT\nSpbizdz0wBzYS6JOHBPVshjJE2LrWRaiP2Cx5hmqvdFtpDmtdCADKWVNa4Y9\nOnaNhiHHxb+EU/0TRg7GCymhl8G8VmZq2IGHaM/JpXN1KD8fkGtfDjTtF5jJ\nTtjW+GDCmuIbcXOFubIBSviC74j5mHcvXZL9tGuIauMJ6XVIwf0TrKBNCtyb\nFxjLpt38sIAGEhTHY7j6POCMvrFo+Bkxqmlond1pDeW/BPNteW+qaDXbqEjM\noaysZM9ukH0qwyHYqg8Vlvn/t3iaym5yI/2cGzi3WejLTHH+M0XpdHrVjB3j\nJkUwPzRDAdNMe9WH05zYDkWOapBG8opsOPk07nar06LHsReKjIk5S6lu2D89\nv1gXN/hanLb3UUfoJ6uhNgwPxvAFYR1/PAGQjHKfCs8D6I8a2JJ/vRGWSOfv\noWcVeXAdN7dfBWjovtkT5LpuhSdR9/238vYheV/4jC5x620NvQOhFv4AnAE/\n3IHjzifmijNTQdHg1BGAEjLeo997kEh+Hb3+HepLilLlnmplcUk8/5dqzUJy\nXcxUyLpp8MNyTVQteQ+5eoNI30p0G4HDj6B1MwAFlUB289tlHREt0qqRngWW\nfaQo\r\n=TTRx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.toSeconds(ms)](#module_metrics.toSeconds) ⇒ <code>Number</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~actorFromContext(context)](#module_metrics..actorFromContext) ⇒ <code>String</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.toSeconds\"></a>\n\n### metrics.toSeconds(ms) ⇒ <code>Number</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Convert milliseconds to seconds  \n**Returns**: <code>Number</code> - seconds with fixed point notation of 4  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | milliseconds |\n\n**Example**  \n```js\nconst seconds = toSeconds(ms)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..actorFromContext\"></a>\n\n### metrics~actorFromContext(context) ⇒ <code>String</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = actorFromContext(context)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"554a71073a41f4c0833a47e87b8060c4c88667ab","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.17","express":"^4.17.1","@balena/jellyfish-logger":"0.0.4","@balena/jellyfish-environment":"0.0.4","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^28.6.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.5-dependabot-npm-and-yarn-lodash-4-17-17-554a71073a41f4c0833a47e87b8060c4c88667ab_1594210626593_0.9071341556818671","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.5":{"name":"@balena/jellyfish-metrics","version":"0.0.5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.5","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"d2c8f84b256d61b2bf61fe31f91b814252258fb2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.5.tgz","fileCount":10,"integrity":"sha512-0ncN+7K8vJZOK+T+8fFNiBfsWtHT6BT5SOPuCnx2CLsmaHz3D7RzJ0WE5RpmxH0XYuz1jMP1HO+Ou+c1Qox4hw==","signatures":[{"sig":"MEYCIQDCjXXfSVMO2/rkmHiBECpl/MDvrqA6QyXk2wX4dxdnFQIhANdxungJIWSMVCrNzJAjR6udJOmwe1XWWX1gA9QuaWgc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49963,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBlPICRA9TVsSAnZWagAA76UP/RW9DYG05GpZP5w8pPx+\nUflxrWCodNdIdVHf533tJ/7MehdGa/BBDbfRCaUBSYe3FbKSxCKEVz5pHRdM\nfhTOY5jdl+/hN42kQQ2AgMfmYrLXMPAGZGf3g6TRN2zeU2fpGAjuGRq+G8Aj\nKBb3rmXgQ13e/Jb7nuisUHDeMgUmXagesNVDf73n8MVPETQsnvZqs1JFKHdA\npri/OwHS/GzcLYqw/FaC7rA09AeluKZ9lms3GPXbTai4A766tSKEv9hyHSU7\nKGxjHnZY3zPyBH/Ia/nEa3lNBnhrtxBriebOqk9z46JHbOvFZD6Up3tPvwR6\nt0OlRmj6neutTYTZnopB1+GVtEfev6OKkF3VAVflsoK7D+Og+cxmUXSd6EPJ\nuHVz8tDLYC+Lw4eHc4LdishSwHgdPUD6+9SqAgmzEOj8met+2M7jDbyE96Ct\nuvtudxeFf7HJxFSkf8BefECMfL8g+nG2MOPtAN0h2n9eav2i4UXIMQt16/ow\nuvpCKJz7AgOV/8GbCuCWYpgaPjqS69h3Q9RsKt6rHMu5JZ9dB4tZy5sMWril\nPGBceH4l2S/bWL5jm1XTh+rJfpp++yHUvIbbPM3DbEsnduDLZiVDhjPnfH3o\nRdVuFLnU3SAO/sMnQ14Kf+F3HiFD1CpGnacXExDWnmU1251eSfJDVk6MZ5GT\nVYWD\r\n=S0Jy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"2f4732c2752ecc8999d53f3fc5e96604f8304592","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.17","express":"^4.17.1","@balena/jellyfish-logger":"0.0.4","@balena/jellyfish-environment":"0.0.4","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.10.1","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^28.6.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.5_1594250183955_0.9986527415944981","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.6-dependabot-npm-and-yarn-eslint-plugin-jsdoc-29-1-0-cb86dbc6210c4be4f25118a76ce9b9d05573da17":{"name":"@balena/jellyfish-metrics","version":"0.0.6-dependabot-npm-and-yarn-eslint-plugin-jsdoc-29-1-0-cb86dbc6210c4be4f25118a76ce9b9d05573da17","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.6-dependabot-npm-and-yarn-eslint-plugin-jsdoc-29-1-0-cb86dbc6210c4be4f25118a76ce9b9d05573da17","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"3e8ac9df24b3c55276bf0c61006272c617914771","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.6-dependabot-npm-and-yarn-eslint-plugin-jsdoc-29-1-0-cb86dbc6210c4be4f25118a76ce9b9d05573da17.tgz","fileCount":10,"integrity":"sha512-tcoMoije4fNOEDXrSf/vGCkvh+HxCGUNA0FzHKXEl67VNgywBKxXwNRdnzQb5dD2K9lBYm8mfk8PbEbfdSbDjw==","signatures":[{"sig":"MEYCIQDyvI9gl9ktGO/0NhJ5NSntNj9L4Htk8Ydfv50LSz5TDgIhAN+8VKFHBO4S+AJIm9jzC+e5bKDSUCdy1Ri6OrHSTvdE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":50156,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBlRVCRA9TVsSAnZWagAAqzwP/2CI9xK0g6H76nS6PRLk\ng0K5eXrfYV6+yDKTcA0AdjSvL5Z4wNu5D4BrM1vZ8NH2kBjU/vxJ7+TzHV/D\nXdzr8VFoKKbdk0DIR6epNSXepXbt5eunS2/HcgZc7gQejKsJv2twFmBjv+hh\nU4FZ6wRi83Z8p10o5ixzTCS10b6Uvls8GDm80COGFBifWRbtIft8ZjM5jJMF\nG3W8YgqZ9385jeMikAaxm0/ODAVR7E6D3TCxePYDku/40F60kPA2tTRf5C5f\nJ/ugLXTzbG2RUT2+JmqeRy/6ruQ48aakllWMNgDM2twy6ZVGmsTA+Tv4UlCr\nR6W4EhDzEUj+KsScCziFNiakHC3p8GR8ohS5mdFdMrj9NpUIyu+hfjAvdosG\neVx4X9WHo0DmBV9n2yubOtUjjN13FO4S4g51ohQEhyQzy+1+VcQuTlBOrzpy\nS5NX255EIJONnfOjnOLapgstfYqXousi+8Y6A0EuArsqpx3ygm7XZzTG8Cbf\ncTtx0FUDHtlN50cBR1CSlgxhJXDrpcLAS8r9ztaUX4X5jLxqEdmaxQPIcDvR\n47VgIE34lJn2fS//kGcuwZtnbsUsjOM+0sqwZfCjI8sq25/d68UJqHCqnmDJ\naRwk0NqGVlDHxaOsPvbFyN6XOUUJvkEXgIg9Bllxxe+UZQZFUvYbh7/GAOoR\nJLT9\r\n=T3xH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.toSeconds(ms)](#module_metrics.toSeconds) ⇒ <code>Number</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~actorFromContext(context)](#module_metrics..actorFromContext) ⇒ <code>String</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.toSeconds\"></a>\n\n### metrics.toSeconds(ms) ⇒ <code>Number</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Convert milliseconds to seconds  \n**Returns**: <code>Number</code> - seconds with fixed point notation of 4  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | milliseconds |\n\n**Example**  \n```js\nconst seconds = toSeconds(ms)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..actorFromContext\"></a>\n\n### metrics~actorFromContext(context) ⇒ <code>String</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = actorFromContext(context)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"cb86dbc6210c4be4f25118a76ce9b9d05573da17","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.17","express":"^4.17.1","@balena/jellyfish-logger":"0.0.4","@balena/jellyfish-environment":"0.0.4","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^29.1.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.6-dependabot-npm-and-yarn-eslint-plugin-jsdoc-29-1-0-cb86dbc6210c4be4f25118a76ce9b9d05573da17_1594250324990_0.24801175228899153","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.6":{"name":"@balena/jellyfish-metrics","version":"0.0.6","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.6","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"d2953ba781fe6fe2d0403afbec532eb7d21b91b2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.6.tgz","fileCount":10,"integrity":"sha512-rrzkYWexNUPTlbQfjsHSEh9hGTZ15hLipVqKhl/O212jXYQgEbInCuy/hy2Y2uvxvId0WoGfBRIniTPRhnPvlg==","signatures":[{"sig":"MEYCIQCXC8hgpSjrtn0HSlsx0Dt7MXm5j7SwHwrVeLh4T+hoBAIhAK9U4uJFhezJI+Qa3n+2b614PwE0/y2enKByH1ripn8W","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":50064,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBlXkCRA9TVsSAnZWagAAliYP+wZb+h6M7GWp9HjdjM5n\npl6rk/BuSznUNxZgbbQXP9qIH7mWBU7Wrj3jpTz6AnjrNuWKH1RzWZA66Xq1\n/ALqOVMkvZpnNH0Yrc6T+WsZaRjfgaCZ1xR+OldMmd4Z1ENQhHS64uKpT1YF\no2xYMUM1FbrNIIKVpcGVjKkkz+6VXo9SaBsnFZN/zQc11j5+KQVnlX3+Mp1l\noQFcbL9DTmn7XGvdVxc/lQer85O3zqcq3vr+1zWI1L2FZdwc2GkTYAwd2Gj6\ne7f4d89lUy/iLontDzhPiryIhbK7AJJ9f5S8oDqYouWM6mAnhk8JM4VyI2Ay\nEDfhFL4NBirANAQs0xgiSbIJAeXDUpQuvq+wCVxh4ASiHJVIX306ToFSAAkT\nvAtDGb27TJi/NNUmfhZ3I4R1U4ElHVtXIkX5++ZwYFhRyfSS2L+jxhEmT1D1\nFVMoFK16q4p2kSTDbSubyJczlOlc2A5hk9aK0qxUcWzV8GPYjQ4YwuZd4egW\nV4jfmH/7m6iRC8TfGfIiT5JXZZWw2xJNo+flo3aoCoOxFTPYZ9ioze/gjRbH\nvf0pI5UKTCOvzbmfyvrjD5FN6oXdVuFtOnBP0lYoHWcisHVwTIs36zGykin3\n6o8ExjjenwL80izJnMw2sS3EW+sbf/ouDBBX974PcRH/SUwTikVB6iBwzmyA\ncUWC\r\n=vHiv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"0f4862bf224d1bb387c4f8e8e16ffa07386b3b42","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.17","express":"^4.17.1","@balena/jellyfish-logger":"0.0.4","@balena/jellyfish-environment":"0.0.4","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.10.1","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^29.1.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.6_1594250723933_0.4253140778978062","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.7-dependabot-npm-and-yarn-lodash-4-17-19-b06b07f9b5ffccde65a76bb1abec72723312a935":{"name":"@balena/jellyfish-metrics","version":"0.0.7-dependabot-npm-and-yarn-lodash-4-17-19-b06b07f9b5ffccde65a76bb1abec72723312a935","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.7-dependabot-npm-and-yarn-lodash-4-17-19-b06b07f9b5ffccde65a76bb1abec72723312a935","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"d99cc19d15d61ce7c8eea0b78ee8a044f1109409","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.7-dependabot-npm-and-yarn-lodash-4-17-19-b06b07f9b5ffccde65a76bb1abec72723312a935.tgz","fileCount":10,"integrity":"sha512-95QixcFNqxQPQsVpwzX0Ia5ZnECoU6a6QoMtSOmsWA7km3lkPXt2xkOsaykiRKRV/i6kkm0cwf9X8WEc2hnibw==","signatures":[{"sig":"MEUCIQDWJXieoOBpWr+WGnJiNq7DJTsWA/dWQKwpZMH7omAsiAIgCkwSaTnyJCELSxm7PfUvFURnHPCcdMh3+xYLZ/E6ddM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":50234,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBwgQCRA9TVsSAnZWagAA3b0P/3xWJPe5wZNxnQAh1xk9\nJTJDDAkpEDFZacEP8fW/xfvJtr77FkQ+4nhI063s7y+w4xKWXmce5ixvjbGg\nhKA6ISqpkmmT5z48yeMTm9abRyl/uKFFlaNP+3iQBsksZrhtXG4ioqhE7gjP\nD2Yj1VwN2ujMM01MBIjELc+lN6D+XrSlNXXb2MtV6X64roekf7zYMupysgjA\nOPuRVbjErBhMQi92yMgNRJdI/ApRdMzzPneHEQnL5oA6edpZcbXskm8xtt5S\n6HbCrfPbERb2SIdfW37+dfBzsbX1P+aG0LZr6DdKSbnSx3JFzgFsgZzINuBE\njvNBjU3DuflvFdI9E28AFL+khTgvMzDeZD5AnYFr145oiu7iJcQllEGn4ztB\nmMGvU8N4nXC3V4oxNFZs5Ko8Pct5UvmSOQBfHKq0dTZG6d9WKvUyP9fyWH+X\n5CB5f64qiewzz/05bWZ390QpUqY1rcZGCVA6FyO89Dqj38xVM74nB80PFXi+\n1ovXbkGUa+mm2lau9gYc47tvoDO2NIgz3b1ZWxNFjUs+AWs6Mq+0jFJ/sPX2\nTMZn5XBVJsM/pLRHJB9pEecbTso2oBWcFvnHD0Ayl7K9bDTsCHPeyh8EdMDL\nFu24mYC5Y9A6uk+5e0ebUVHJoDlQ9wimxv9JUrW1n4Nvunka6/P8Z+uvreEK\nU3k5\r\n=RnMj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.toSeconds(ms)](#module_metrics.toSeconds) ⇒ <code>Number</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~actorFromContext(context)](#module_metrics..actorFromContext) ⇒ <code>String</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.toSeconds\"></a>\n\n### metrics.toSeconds(ms) ⇒ <code>Number</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Convert milliseconds to seconds  \n**Returns**: <code>Number</code> - seconds with fixed point notation of 4  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | milliseconds |\n\n**Example**  \n```js\nconst seconds = toSeconds(ms)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..actorFromContext\"></a>\n\n### metrics~actorFromContext(context) ⇒ <code>String</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = actorFromContext(context)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"b06b07f9b5ffccde65a76bb1abec72723312a935","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.4","@balena/jellyfish-environment":"0.0.4","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^29.1.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.7-dependabot-npm-and-yarn-lodash-4-17-19-b06b07f9b5ffccde65a76bb1abec72723312a935_1594296335926_0.3541530014665799","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.7-dependabot-npm-and-yarn-eslint-plugin-jsdoc-29-1-3-6b8f153d429c0cebefd31918beb96f91723bb49d":{"name":"@balena/jellyfish-metrics","version":"0.0.7-dependabot-npm-and-yarn-eslint-plugin-jsdoc-29-1-3-6b8f153d429c0cebefd31918beb96f91723bb49d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.7-dependabot-npm-and-yarn-eslint-plugin-jsdoc-29-1-3-6b8f153d429c0cebefd31918beb96f91723bb49d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"fffc6f2521351b086249f9c77e87b771240995ef","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.7-dependabot-npm-and-yarn-eslint-plugin-jsdoc-29-1-3-6b8f153d429c0cebefd31918beb96f91723bb49d.tgz","fileCount":10,"integrity":"sha512-pBfgfkmpK0lRf+Wcufc4o/lMkrszxZur7FPtlLswlaszCzKjc4LCW5K7zsW0t/rU5jikO/l682ujPZwO9DHtkw==","signatures":[{"sig":"MEUCIQDDVBSeqjt+nRLAt/1DieKvpWGNtaE6nTuFwQ+KRZYBYQIgAVXXqYM+AmdMHG+NhcCFn3u/G4BTkvxszX9Rag7taNE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":50257,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfCFmECRA9TVsSAnZWagAAMBAP/jDjQ3Hxg7xY4S2vPRfX\nDZoEd5ePA3psia4FYmcnelq269+E9HpzAbrIfvJbAyBg2IlIdmWBlNLVgTnv\n2wDFgUAvelxIHlPOuEP/wxqL968x6C2ksSgryU0cGxwuRCsCfenC+BYrkX/m\nJDBl+MZ3b4K3zTwCrAUu/GzsEzh1bFaxm7MHsxyrYvi96rkCnPliDLGLPqGM\nk2MmIEEFlQbKRfLSwTOOX1C4MohoV2NDELGPwE3/CJj5OdjkzMXUMrvfAtib\nCu5z3Z6Z8JjRlS8sSaXkwvjgd6bfTD1LvQocSCGee04iX7okasCOsbnYfmpJ\nQ9QkEpupQy+FIfIJAZ2V7h3RawUkJZdC+c65jefBg2e1aImnKj6US78Pe/7Z\n+a/6xYSkDjpA80TdOaFFbgDZH2EQInD07j14q8DsdxbRTzVTBAkGmOD38bpI\nA9EvA9DwTm6/xcyyMmvs9Ps7jPtvH+SDc9FjkeZ7AonqLWMOuqtxrwPiDrCk\n/7xfbe30AHTIz4lge00yjB2kz0hISWb6gHxEp5tOsAgjSZ6Wyd3r/voZLkha\n/R6E83BEQP0pnNO7k5PCsZgsNNH4y4vaPpIzzShjIrhbg/pwHeYkpcC9wpcD\nbV28pFDa+E4DYgo25IRrnn7oI5rvpc6x5a6iuR+Gafvm5pjwXyMp9JlDwjOK\nuR7c\r\n=LmSg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.toSeconds(ms)](#module_metrics.toSeconds) ⇒ <code>Number</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~actorFromContext(context)](#module_metrics..actorFromContext) ⇒ <code>String</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.toSeconds\"></a>\n\n### metrics.toSeconds(ms) ⇒ <code>Number</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Convert milliseconds to seconds  \n**Returns**: <code>Number</code> - seconds with fixed point notation of 4  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | milliseconds |\n\n**Example**  \n```js\nconst seconds = toSeconds(ms)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..actorFromContext\"></a>\n\n### metrics~actorFromContext(context) ⇒ <code>String</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = actorFromContext(context)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"6b8f153d429c0cebefd31918beb96f91723bb49d","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.17","express":"^4.17.1","@balena/jellyfish-logger":"0.0.4","@balena/jellyfish-environment":"0.0.4","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^29.1.3","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.7-dependabot-npm-and-yarn-eslint-plugin-jsdoc-29-1-3-6b8f153d429c0cebefd31918beb96f91723bb49d_1594382724166_0.7717433359584229","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.7-dependabot-npm-and-yarn-eslint-plugin-jsdoc-29-2-0-606028bdd6362a9b4405d066a355328f6f7acf74":{"name":"@balena/jellyfish-metrics","version":"0.0.7-dependabot-npm-and-yarn-eslint-plugin-jsdoc-29-2-0-606028bdd6362a9b4405d066a355328f6f7acf74","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.7-dependabot-npm-and-yarn-eslint-plugin-jsdoc-29-2-0-606028bdd6362a9b4405d066a355328f6f7acf74","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"750153dd9d8ddcf3db81763165015365926ffce9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.7-dependabot-npm-and-yarn-eslint-plugin-jsdoc-29-2-0-606028bdd6362a9b4405d066a355328f6f7acf74.tgz","fileCount":10,"integrity":"sha512-s6nOjs/MkWy+ju4RwKV41+NWoBjHG6D3xPxMf6RO5l6tc+C+ighHoj0cYE9up2YIIkZQACtjlXBE4A1MX3ch/w==","signatures":[{"sig":"MEYCIQDg3ipbtN6ogWAdQl7znEztyia4iBR81HLBwMePWsN8cQIhAPJudf42M3QjXe455tsqDvYpKLyt7AKjk9a0/h/7oIbA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":50257,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDGtZCRA9TVsSAnZWagAAlk4P/3TrDtX3YTRiBBtPw3FO\n+z5C6DHZRjkcObsiNEqQeBEKGXbuwbqB3+baArEl269kV2KwpCLinkSINkp7\num6H+2egKhSYCAkOx23jfMxIXRT1awBMYm+V1jlDG7a/c6KE4Bd5NDnTTH9I\n3IERFcfxc+mnE7oZWO2wJA4I24B6i4E/lJturwsRSfz9yYqLsZDRO0+WU9BS\nXlxQjy4XBRtQqzQaZp6gW8RPHSEsm+l2xpnV5/4lhJbuwZ2QjCJdbMxe9W0L\nriFdsJ8+ldWtQW6VsdY0AvAPgEbJVF84r6WyU2vILkzofBNHB/Dq4RLkFoiI\n64cVffLNgzQratSVmDH+PMmBYUDEnXy8Ug4J19btdb1lkgBzdagtFq4JT9hm\nU50aZIhzy0pih9poRHIBuszYtiEQAoM37e5qUGa8QFGJFVJr0DqiUlx5HeRX\nZHj47tdpYYJ0YGasvYi19uAYEgsA7k/M6Gh+ck/RWrtDCedEEH5l5oNJ1o4C\ncrpBKHl7vXSVO3vsnU37ciuucBoP7jBYZ1RDHTeRRegM1HeoGI6Lvely0akP\n/tmcXB4rv3F3JfnOCpzjE8DNhHEmw95G67exLCBr0n084OD5LDy+Kg0lvb+U\n9+g1C9UfuvqVhgofbns3g0LTqljhnZvBMpzL8XrGPkUiFI7AWkZGlLpEduCB\nouhA\r\n=6JLY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.toSeconds(ms)](#module_metrics.toSeconds) ⇒ <code>Number</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~actorFromContext(context)](#module_metrics..actorFromContext) ⇒ <code>String</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.toSeconds\"></a>\n\n### metrics.toSeconds(ms) ⇒ <code>Number</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Convert milliseconds to seconds  \n**Returns**: <code>Number</code> - seconds with fixed point notation of 4  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | milliseconds |\n\n**Example**  \n```js\nconst seconds = toSeconds(ms)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..actorFromContext\"></a>\n\n### metrics~actorFromContext(context) ⇒ <code>String</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = actorFromContext(context)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"606028bdd6362a9b4405d066a355328f6f7acf74","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.17","express":"^4.17.1","@balena/jellyfish-logger":"0.0.4","@balena/jellyfish-environment":"0.0.4","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^29.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.7-dependabot-npm-and-yarn-eslint-plugin-jsdoc-29-2-0-606028bdd6362a9b4405d066a355328f6f7acf74_1594649433393_0.6540095613839099","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.7":{"name":"@balena/jellyfish-metrics","version":"0.0.7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.7","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"452c9c6f551e6c319bcc52974c35c88758da6cf3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.7.tgz","fileCount":10,"integrity":"sha512-BrJ9xeGMQyLL1GMq/gxk0/85yyDYrpCL9n9+2ONL8KgpjxiPqIL6Ihw9BedgryIbCpiObtXoNh9Y0LgUc7iusA==","signatures":[{"sig":"MEUCIQCP1JPr0XskJXR9Zo/xwyXpCFukcbTZkuh5DSZbrYfTOgIgOgGwQlhdB+lRVdZoeP+Y750AD0rkHs1KZfHOUrICd/c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":50165,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDG/ECRA9TVsSAnZWagAAoicP/3tmv2x8LLb1gjc6R/wJ\nBo1olyw9FrbOJAnt3Z1TpbVHfXCNJefiVsQCXO+DQ9T4dHZTfsYFOu3JlPoI\nWaPe49zoyXvaLRW9n6b3McAT347LrvYPAIIQ9fpr18HSNczoCmupoUrEFTzz\nx9/lNgQloB1vvO2kM+FYUZZ54HJE6nctPaezJCONPff2CQkczcDKNkr/Cjiq\nzdFRgRPtueoUNYhHtS9PjHsXrET70HEjGNt21LbmMW3ZuCz6OLyAl+yrE8FF\nf6vQNvjrsycbLxK7C7wQsG58tEAHjFkKThtbi102rf3twZeSw8L9nOSYQqQq\nyevYzTZYMrMJSnYPhch2nw4vVefwicDIZYl51S5m7oo3sEXoRb0w1whjXF8C\nhuYtCJskBvKGScVzR6WSTa7Q1T+KZYdAm36fMVkPPmZdh7dxQLi6Qy7+vH4O\nq1Tr90U4l/wRwlG/oHAcoPXxF7vMkFtwjuX6dNuUDgmfjjeZ+Y7X2f18jhmT\nArRf665GA0s3zTcwm+EhIJZ7UDbppNk7qcTHL/NPF79+juADrWNn8oh2JiJ9\nyTbBalNFFTbv182hwXFzdfWh3LkY8tndZ5/y19uIbrJGLstmEKQNqFnNyuyC\nLy1vfIdCdLPNsJLTCKNgtiqnxVUiYZoP5Du6tRMFhfiWU5IrMWy2jO45rCPR\nZzT0\r\n=H+qI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"6f9bc9e0e050bce6bd7a644d02703c7e4351ce83","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.17","express":"^4.17.1","@balena/jellyfish-logger":"0.0.4","@balena/jellyfish-environment":"0.0.4","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.10.1","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^29.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.7_1594650564093_0.9544918519200696","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.8-dependabot-npm-and-yarn-lodash-4-17-19-2570a2c21fcef5f40ad9be46c8b722bede82824f":{"name":"@balena/jellyfish-metrics","version":"0.0.8-dependabot-npm-and-yarn-lodash-4-17-19-2570a2c21fcef5f40ad9be46c8b722bede82824f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.8-dependabot-npm-and-yarn-lodash-4-17-19-2570a2c21fcef5f40ad9be46c8b722bede82824f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"d58b7252f9a0721f0913a9b1928ae657b5ca4383","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.8-dependabot-npm-and-yarn-lodash-4-17-19-2570a2c21fcef5f40ad9be46c8b722bede82824f.tgz","fileCount":10,"integrity":"sha512-WuRJmZGzXZ1fHCRHiu+uXRzornEpGH8+rlzNPoZbxoE2yeksb5Mb4TGxMoUAYZabwAe3VFl8bmee57rXDcKqiw==","signatures":[{"sig":"MEUCIBtHDuDPZL/Vbow389ndPnykh2Yj5VKUCFhMHNc8bQ1/AiEA9uKpj+lCGmfTQtMXaltuD3zd+7FK0NwT6dzhw3bE9oE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":50335,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDHBWCRA9TVsSAnZWagAAK58P/AuiQMJ1a8M/Enqhfwij\noU2F0aht5xQrtpa2Zebh+ezTHRnfLKXkUJ093M/cFdxQJzgCkOdrZgWTwy7H\nF4/mHweNtknPC+4R2G7oE6t6kcL7p0yZ7OsfOQOOimw3nnaKuBMVf8YXuVI9\n9CWYDHAAMd5QU1EsSKUa4+8PFzaYgugN0TQQWeOspvVqHCsE2WLj0gf7OygC\nPAzIJboAWtoTaJ4IAvULcHe0IVz1ay5LlsiiMa1uokmkvi5sSAR89heyWNaq\nqiWm94tRapFk9rrvjKGFcCy6lyTk2GzIcQlD/Wpg7wOcpbPEaBTS7WhzmQko\n2sqAhHa5jH2g8tMKluLPX698wk0yaco1rWbjtPKro1z64mN+p/15kaXrZCsS\n5hJ6vaYGtVnevGScSph1DGzV+OOFgD9vcWnhFbvgS8pjkjVHk9653XBfvUT8\nI53bMmQsILXi6mdrW1HiUiqBZxk/AqHTTypv4+f5yZK0sfSXjK7OnqiK01iW\nNXDRVyaXKpDPrcyxHeBhjxLD7nmiqwvIn1o+mTKlLOv130wvgj5nTSanx6Da\nwQftlZy6CVjrtJx7ykLaAuZji8i3GkRO8wkwkW5x1rlYBAcEBRMc6c6lUSgs\nxjPNnZ8wzKkTveyZu5m0+Kq7qMmJBewzTzTsXqO6zfVgYxOrLQzWPdGbRXFS\n44gX\r\n=1fEf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.toSeconds(ms)](#module_metrics.toSeconds) ⇒ <code>Number</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~actorFromContext(context)](#module_metrics..actorFromContext) ⇒ <code>String</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.toSeconds\"></a>\n\n### metrics.toSeconds(ms) ⇒ <code>Number</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Convert milliseconds to seconds  \n**Returns**: <code>Number</code> - seconds with fixed point notation of 4  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | milliseconds |\n\n**Example**  \n```js\nconst seconds = toSeconds(ms)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..actorFromContext\"></a>\n\n### metrics~actorFromContext(context) ⇒ <code>String</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = actorFromContext(context)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"2570a2c21fcef5f40ad9be46c8b722bede82824f","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.4","@balena/jellyfish-environment":"0.0.4","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^29.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.8-dependabot-npm-and-yarn-lodash-4-17-19-2570a2c21fcef5f40ad9be46c8b722bede82824f_1594650710106_0.7780942001181148","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.8":{"name":"@balena/jellyfish-metrics","version":"0.0.8","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.8","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"0d960c387887d20ef3ab171fa28f7c25ea4c5e95","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.8.tgz","fileCount":10,"integrity":"sha512-nq5t+f6jY5CEL3kLY2Qxz9bnu+/serExEhX3BziUSo6c24jADSMVv+FVV6GBEeLTridIIB2NWTP0mO4W2nEzDg==","signatures":[{"sig":"MEQCIDCIen/tVbFC7uLZi8d/Uf23hYD2jhJhIxs8r4RW80zPAiApYLOWcYARsDoOxc3tRX+y6pSx9hu3Rxuox8A1nS/cEw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":50255,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDHTjCRA9TVsSAnZWagAA0T4QAJASA5Rb/H3VVdMFeiyd\n1/yz8CCsaXaKuDlOYpof8LJgY0rpfvayhKmG9/tn5H8lhI3vDduQUjFBzk0y\n8L8UncnJNqUuHTM2TKd6JNdqu+JuESpXs/xPEeh3LdzmOd5pVPfZc9CpeVV5\nTqDF0yfdwDldUxbVAESjPXnj8Ve615GTfZeFg6Op/msSkRI0pmq8gvMXqM+e\nSiDpECz1+AGmzGbmWy62l6GycRrwdRBrZUf+rliVp2xWrxxXapB9gdTfb6+L\nquvVX0l6p1MV3H8MWoInc+NO0SRNdxf30FfvAxkdiG11RvqcRsohFqGSleP5\nSRgVxVqjTM6yBAEic+AsacWOWPR9kjYrLWiKzPLt3lFkkAdpdst6Mt6C0hTd\n0CXylLZST4kyUfgypvfmfxNvmx3RagxsIJAQlCi969S7QWarZf1WcXcuhc1a\nE9X8SWbzlAn33Fj4SN14TRcqfBWTm+UC0JtBYQhZWp/Ku59H50yITKwIwKDp\nuPqGO3bhNYcSmnkvVRkhqa3JhXNfCJ24s0cRNWDYyxjQQXbSWLb58FbEpo4o\n6jWMbkTBLDHhwUOmPlwD+TgTR4KRO//OdsaAVbDB/mlg6ajsB3iLgc44bcPc\n4dA1K8YnqH/v+UnmzgQPWrvub0NmbWN8Qv1gJzeGRBtwRFXPhFi4PJT73zVN\nPvug\r\n=5sZF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"d2ee5a6e46f2b846e6dd8487c88520626a942870","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.4","@balena/jellyfish-environment":"0.0.4","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.10.1","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^29.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.8_1594651874980_0.5114958312227886","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.9-add-endpoint-test-02b828efa05cd17d069c4c13d906c7a0e8513bc6":{"name":"@balena/jellyfish-metrics","version":"0.0.9-add-endpoint-test-02b828efa05cd17d069c4c13d906c7a0e8513bc6","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.9-add-endpoint-test-02b828efa05cd17d069c4c13d906c7a0e8513bc6","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"ef4cba728929e9c11ae99c3b8bea691106a12441","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.9-add-endpoint-test-02b828efa05cd17d069c4c13d906c7a0e8513bc6.tgz","fileCount":11,"integrity":"sha512-hWDH60bQGjwtmxIGcd1IDplAdHxEOZ2pRwZpT3ndDiOr6xH7fVFtwqxqvfwUKBrq/Wmb4vN8qd4edqOMvgi24Q==","signatures":[{"sig":"MEUCIQCiTNImQmLtrntgq64khitVCykOcNU/DVGA4Q0WouOP2AIgVILKLVlxP73U9Abogt9067nGG4cG/HSLMRv5+bfJghY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":51348,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDmf4CRA9TVsSAnZWagAAuZcP/2uziQBIUMagw8xsor+Z\nFrcBSaj8lFtGB7X4igy41IwniN9XIX1XPq13nZuZjRGLSyNZKL7qCsfHGHre\n+6tUV6MElms25b/pCf/SOhflHeFy/9xhJDpRlzWCIKEnC9VRFpykXMUznK23\nrkig4tw+/+duP3MWVJGOOAnrTVeFyAwPYiPo2rjLtnIx7lSTdsv/EqJ9P+rp\n0gDChUOfINnFMsHiGiTtUcV8nmYu3XvctIUkJtz4djsxDNuhvG4PWn2McXJm\ndyOFq14mqa+B99scRkXaimk3jVJjdXyI3dYpnbrFLvz1vtwGTpJWnGOquDiG\n1O1p+xnZq+lIfbyu5rnrMu8ji5oE/zs+DLP5ytAeQzbKJrN6JsZirDfYVXo9\nYSKwLsaW8JUgf5lBBTMrpvpWpzwtealmkk3TMR1uXkE0elnUXNtGQjlcDOpO\nHSjUvxfz/kndKYM50mdy8aL1pWFqVY85AfC13SvwPXbjOrL/c7ggAQUeaMen\nPa1coHTFAGAqtcOyiCVErf8dbBFApVVvmEmv4CWP6JZfabu8IdRTwJf2M5do\nP625YAlW6SyM9LyUYotLmVrQmIvS6iHKJQJXQhG5plHMasC03j5NqD6oK6dY\nXgDOAfXBUUhQZejwaympUISLlKw1vsDIwO81VnQ8QsgiRKKF2ppRi1EZFbGd\nJ6qp\r\n=tVJe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.toSeconds(ms)](#module_metrics.toSeconds) ⇒ <code>Number</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~actorFromContext(context)](#module_metrics..actorFromContext) ⇒ <code>String</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.toSeconds\"></a>\n\n### metrics.toSeconds(ms) ⇒ <code>Number</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Convert milliseconds to seconds  \n**Returns**: <code>Number</code> - seconds with fixed point notation of 4  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | milliseconds |\n\n**Example**  \n```js\nconst seconds = toSeconds(ms)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..actorFromContext\"></a>\n\n### metrics~actorFromContext(context) ⇒ <code>String</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = actorFromContext(context)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"02b828efa05cd17d069c4c13d906c7a0e8513bc6","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.4","@balena/jellyfish-environment":"0.0.4","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.4.0","bluebird":"^3.7.2","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^29.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.9-add-endpoint-test-02b828efa05cd17d069c4c13d906c7a0e8513bc6_1594779639964_0.9301899999875136","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.9-add-endpoint-test-a0f3b44d2f2c25c5c6992da457ca7108c4923cf8":{"name":"@balena/jellyfish-metrics","version":"0.0.9-add-endpoint-test-a0f3b44d2f2c25c5c6992da457ca7108c4923cf8","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.9-add-endpoint-test-a0f3b44d2f2c25c5c6992da457ca7108c4923cf8","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"f1382253ca4153c813df67f2fb3377e554cd44df","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.9-add-endpoint-test-a0f3b44d2f2c25c5c6992da457ca7108c4923cf8.tgz","fileCount":11,"integrity":"sha512-W4Kh5fSDYQp9tn+Rvn98qUKAvccmlEbyI77S2YPg6DYtfoqxlATlYhF4pmMiDWTcj5dZqiP11HxjmpaZsYalNg==","signatures":[{"sig":"MEUCIHYLIgMJORx6sWQ5xdZGLPUiWqCXFlBaCU/FY5dO091pAiEAlcydRFLeUMC9VdNJvfPi57P/mjWBdKRiF8MOBMOCb9Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":51472,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDn6KCRA9TVsSAnZWagAADZQP/1hScVOoHFq6ib2xCyNW\nDqTWGGhzCw7u+QPVkfZegKuTPmw5GEROwX9kHR/WYWDvOl5X4v5Bz/HM/IIm\n+YO5qoYUDrHpfy4dlFidP6xdC3pylfdnsfH3FxvV0a+SWpjrYe+5J9/fsL78\nxikKpzOm9OsUyXWOE6JNeUm6JI1QGJJFBMa9B4pNQ4P3DeVRDFczwP/to383\nDCMJIGQvYZnuUM7YrF4pYQCpH6yLsvK2XblUFwj8RCP4n4P+wOeZjpcKkzkb\nHJt/PO6aJ2hw6m23KGYKI6Erb888/KmJm5/l6eOKzcgiKuwUb+DMPOjA2iay\nCifku1ZDeqtbQARgmCIuL4K/0KV2okL+NQyU7WtdqrcZQlZX21noF2HUNzX7\nuNQx5oOTqSVKXYIngOHcd8ijOzmuA1Z6weCmMytbOTmqM/P+QzKMq5F0rpFo\nuETxzkB/UeUzyhRHYieUiZD25kTKkmhzTQc9V/Gu/7ZhzEHMF6/2Dp0sqWS/\nJjIh0dSzyVWRLn7crtqs3/wIAmTX5s2lDobk1odcyYxFD3OzcLCXGpH1MNor\nDwvFYTpFG7CL+Sr7wga/tVpa0QUqbCP39/TvjErIVIsDqgz/J/MvxkjgWZ31\nhiORs06PbfNhFityK+vs0yhve1tu5mMy5hUvORcpI3cOgH0SNxgeF48CDmA0\n/MwO\r\n=QJOD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.toSeconds(ms)](#module_metrics.toSeconds) ⇒ <code>Number</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~actorFromContext(context)](#module_metrics..actorFromContext) ⇒ <code>String</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.toSeconds\"></a>\n\n### metrics.toSeconds(ms) ⇒ <code>Number</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Convert milliseconds to seconds  \n**Returns**: <code>Number</code> - seconds with fixed point notation of 4  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | milliseconds |\n\n**Example**  \n```js\nconst seconds = toSeconds(ms)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..actorFromContext\"></a>\n\n### metrics~actorFromContext(context) ⇒ <code>String</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = actorFromContext(context)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"a0f3b44d2f2c25c5c6992da457ca7108c4923cf8","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.4","@balena/jellyfish-environment":"0.0.4","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^29.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.9-add-endpoint-test-a0f3b44d2f2c25c5c6992da457ca7108c4923cf8_1594785417915_0.43882838431466564","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.9":{"name":"@balena/jellyfish-metrics","version":"0.0.9","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.9","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"edcbb4f3f511bc011e4c80e1c9431507ec96310b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.9.tgz","fileCount":11,"integrity":"sha512-6flcz3Bu0SeR3XwTCeU0pTBqJxCf47MGrN/13UCz+eNPjdeS9LCReFvQQ8Q0ZCGmUDqLZabwz8K1ASqEjnzx/g==","signatures":[{"sig":"MEYCIQC82rFqihG8NBkBcWfnweEkqPlbRxPOPjJmxCvdCKtpHQIhAIsFhYaa4hfWUsFEcBpJ+Y1Vnlf72xOseMLBJQWCnpm3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":51413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDpwXCRA9TVsSAnZWagAA7vkP/i7WnuW65dkI8kWi7kQG\npQiXOklFu4LT3eyqBJE7m42y5xkTRwOGattjiBwhzO/KWV6DqyucMOVpNXvO\nIdTadE831hW41XV5SL3hgbvfYZMZ/HDvF/DCL49CbdTwOKXqBYAoDg/g8Qi4\nQjr02x5xYGRKjzyGyR8H9wlI4MFRTfeqn2SBFDBlxOf7l1Q7qpn7dkyyz8ni\nSv8IU38/LW46uS3ZRttRgLB1SC4pUFx6b1xdstDFrjmRExeFPA+S/kQY/GNS\nPaKoEVZW/I7Vdk1qZUm176jHDBHmX4FRA//LwJ5q5D1y1QMIio/amAOyEdLb\nshP9MTbU2Xk0y0oh6Ejwt1ByyxmgrXfyr1FVAbNu2nG+0p7Y8mEXwtpwzmIT\neDQIC9ToC3sTBCI0alHcexjnaqpDHe/OaYndubaRX49euUgbNmd9B4fyz+kz\nFtajAa32XoQgL17QZQT78TTObPkBOxgoFSL7VRbHCeCuif4g9B6KyVAwypN+\nVEedwI9ITIBFB0CSrvVh4DWCPRhtZbOW2odNW7aEbPFCuahgUetl50vTlev5\naD14v0rppEicirQqQ5aQu7q4jIvapXNcCcB2ohSf9NManEAbpUGludRKC/25\nDGueH7lxA3Pep6aVBZJORH5YTbllKpkba0XyrSAYOiDTDB13Eo/4y5BKmika\nunKE\r\n=kNvh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"cdac2deceeb3b6e114859a3ec8cc4b1828e5a97d","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.4","@balena/jellyfish-environment":"0.0.4","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^29.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.9_1594792983342_0.6208534170998274","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.10-add-missing-tests-67b984642b8c3695938a30c864f9a3ebe5b476b1":{"name":"@balena/jellyfish-metrics","version":"0.0.10-add-missing-tests-67b984642b8c3695938a30c864f9a3ebe5b476b1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.10-add-missing-tests-67b984642b8c3695938a30c864f9a3ebe5b476b1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"8ebfb87a6d3078513d0a1aaf94b5a703467b5bb6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.10-add-missing-tests-67b984642b8c3695938a30c864f9a3ebe5b476b1.tgz","fileCount":11,"integrity":"sha512-WvrfYAGsOmiy2f2VinU2d79n3neKVxYPDP5OFZc2UbQBC6ZAscJ8ntYQf0gyP9txIcpfwjP6RcjpBXNc4rOpww==","signatures":[{"sig":"MEYCIQDRYfkQA2/JRuHw6+9mD97fIHUaX7wImCNm1YIyPXn3rAIhANyJfFXKfJ7tvYeVRxSTBoR5EEcCZH5enywzldKL/Dwa","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":63048,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDs29CRA9TVsSAnZWagAAxEwP/0HLKFZ7nVu2IiW0YWuH\nUPa73mNez7naiHMTGcVJEEtvHy2TKJev8RwK1FtkASDtcnczQ/HsktkJu9Tz\nJmFKjlWf9ZCxbIdvrXeTSRn43GOPwf+uHc2j6VcuCnNCtqenlPnBq0S9wJVB\npFR7+t59buuxZFeMs8QdxDTAgUXvMAuUA9kFugmwCkWtM30qSxU4BOYynSVK\nLYU+qaCrOLsJDCwE1DzS3klYdFC1U2FXCRQmJahsdUvtPOWzy2L0X8XEaN90\nSYjGChBsofXTfNUqdcqc63k013np4ObVYoIe8PoA6J2jsvLWBYhX2eNXUMcc\nhYVumOEsK6a0taYFPTLxSVLONPGSBwys8rgQyG5jkaYEclKOfU6Hv/gymjfG\nCOXhmK84RiPLMV6rGQWUGlo47XkvER29/YCzEna0H6tSLKhbTEbITTQR3i9e\nDVh9lGe0/tzep7HlRDXNSha8FRW5F9vXRCaInA6ba3NoaR34ttwKh3Gmo8I4\nGqb+FhDNrVHCwV0D3SJUHY7ayH7CtppezUhppyUdTR3WeVIce0rcOcq5qqvO\nALsXP8aOr8VrlgW5SCMtBzBsk1KpAWGAgGJzBeXU7UFqih8HCO8sJ39bbm9D\nMO1WIb9sBXiKjkrlXUqZQitiPyCukKn0RyObsVMwrH4KrESUckw5dImlL8a+\n0X17\r\n=L9wQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.toSeconds(ms)](#module_metrics.toSeconds) ⇒ <code>Number</code>\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.toSeconds\"></a>\n\n### metrics.toSeconds(ms) ⇒ <code>Number</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Convert milliseconds to seconds  \n**Returns**: <code>Number</code> - seconds with fixed point notation of 4  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | milliseconds |\n\n**Example**  \n```js\nconst seconds = toSeconds(ms)\n```\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"67b984642b8c3695938a30c864f9a3ebe5b476b1","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.4","@balena/jellyfish-environment":"0.0.4","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^29.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.10-add-missing-tests-67b984642b8c3695938a30c864f9a3ebe5b476b1_1594805693300_0.04879265728889548","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.10-improve-descriptions-5bd715a454f09d6c7cad99f5bf47246b38bd6e98":{"name":"@balena/jellyfish-metrics","version":"0.0.10-improve-descriptions-5bd715a454f09d6c7cad99f5bf47246b38bd6e98","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.10-improve-descriptions-5bd715a454f09d6c7cad99f5bf47246b38bd6e98","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"f1e06598dd7447a48d5d6c2f00e8bf798cb2d2ff","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.10-improve-descriptions-5bd715a454f09d6c7cad99f5bf47246b38bd6e98.tgz","fileCount":14,"integrity":"sha512-2o7fF9atpacv5eEQGwN3sj84VyEetmJ9ukKWS/zXeLvWS9YetJT7tYe/PjrvWf/gjEZZtRj9Wsl7aSHh2R0AsA==","signatures":[{"sig":"MEYCIQDpyktbDi4//nNFQ9aRmhUQC1ABwprer9ueXsQmRyMuTwIhAM6bY2yJzmemn0TW9vh1Ans80PyswIejPy9R0roaICnN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":52962,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfD8mnCRA9TVsSAnZWagAAUuQP/2+3DhsuE90Qp94eLSrk\nsm7eCIEWe3JW388N9QE5TWtGfXTLk9+xeN9GufI/R7Np/agb1kP6TNkhLs+d\nHGHzV6cxKWDXwPTkJog46mWcTIIJZlX/BhA0crI3UBCT1esByIaAVf2A2mim\ncCi3SHKK7uqZnac6GKuIGbVXIXoo0COd/h1EEv/PDSwdcUpSC966K9h0ndt5\nonz1S7FX9K060xDJb0YnC25ENS2eNrRLqJawgk7QzOrARAv4TfQWhEh3hqiu\nAB9EnrCRr/4SXNF/56aEjdrJsj63GKpEKtwahkvwvm6mVKEBGa9g6yK37tfb\nVAjPif6nsfBGdBtK3n/MsarUQxzp7fBfAlRSM7E/8qlu92/zU8D1jnHMv3Qq\n/x2Bxjg4l76b40NEixVatnCfwuP7f3vINtXCtHooKlXCTLySDoVDWTBBczfd\nq25L5B6588RBKbDo0fci+ksTgrheFfJo9c1S8QRX11Eliq7dourmmGaxLi5e\nne89bZwux+/dM5VwaaXg1DyLxvteUVTV+c63fr2NlPP0P987BW/uFXabukgl\nczZ9S4MSDQi0K6isHiHFxKwi8b5wuQXnQo/euMNBVNJEUHaggRB4k18LogfZ\n8hcwHr7Gyp1Dw7i3NyjBjCUA+EUhXgveUnKw2I+4Qf6/2dn5oT3cueQK4b25\nf54L\r\n=jD7y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~actorFromContext(context)](#module_metrics..actorFromContext) ⇒ <code>String</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..actorFromContext\"></a>\n\n### metrics~actorFromContext(context) ⇒ <code>String</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = actorFromContext(context)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"5bd715a454f09d6c7cad99f5bf47246b38bd6e98","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.4","@balena/jellyfish-environment":"0.0.4","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^29.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.10-improve-descriptions-5bd715a454f09d6c7cad99f5bf47246b38bd6e98_1594870183047_0.18943921765035499","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.10":{"name":"@balena/jellyfish-metrics","version":"0.0.10","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.10","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"c14387207caf55b721974f6865e26f33cb99eb31","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.10.tgz","fileCount":14,"integrity":"sha512-LUYq8EfFHeu4FvCdHcCtpDO6BtmHMKV9/wrwLZ7KZyApcZjiqzzVP5lHX1HuYO4EHdJt5B2qh47H1GW9EBY5dQ==","signatures":[{"sig":"MEYCIQCNAJK3J3n3/CooM9OAGhEh4AOcwnr1BJLmqpug+Ilk4wIhAKLXJyf9Jh4G0D0yvK3odpHDjOrdPmxCmSTEnzup0oT6","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":52900,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfD8peCRA9TVsSAnZWagAA6SwP+gPvSgpiPdxIuCAjC1En\np+8cYX8VrvzvicmpsOVA9WdTb0ZjkQCC0bzn6lsrLKuY3s77n6JEGLEYnUtJ\n4HmPlGgw3xpMwezHi6U6mwv9eXZKALSrSNNLryWAkuAN/Gwtp7Ek2obOwOJs\n1tGCXHDaB7NJJ8mayZ0Ans91kgqUSeGg2ALcTJ9nf066onSeuF4qh+E27ybz\ngMHRK1nIExhjPZksRBtjojT6FdwUtsx3PKGRW2B5UYhHYfgLGCghXekcmNjr\ndLMvio4EONp3IcJMzMGMq4qxG6yezNxX3VYqPhru1A//k76eQRsQB+vgMFuM\nTRKcOxS64RQzokERhWwklMGSHY/zP375xt9eMvJterjkKDHxioZTkceGQqTv\ndrzcfUU9wKMn6/qYLrQ0ydOwqWb5ySYmMnr2OfHCYUFRtSh+hUhe/DSO0nnR\npdHsEjvk4pVeICaBeOQTJcFahBeI7fkdeLNqKOvYuB1lEBNDBefuAjHnvWPy\nEkaBELW/dGJ5U0RREEjWn1qT6eQ5XDVpkp3CC1kFouZLBYyZ+PRNTHJGlXH5\nbUofow+EFszbPfuo5g+6JbT3DKevspnX51KuArVfZTb8mhJed894qCzOU2d2\n9VwQlngMzPraCMXRzENKLzQzqrgCzlcEnvBZz6VNQvgEHTtr3CIXLRMh4mED\np60f\r\n=mqDN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"bbd60509dfba1e91aecd81c69ffde394bec3d045","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.4","@balena/jellyfish-environment":"0.0.4","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^29.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.10_1594870365701_0.5724547493721632","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.11-add-missing-tests-8198529952ba34540c8d502aa572c73a02b38093":{"name":"@balena/jellyfish-metrics","version":"0.0.11-add-missing-tests-8198529952ba34540c8d502aa572c73a02b38093","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.11-add-missing-tests-8198529952ba34540c8d502aa572c73a02b38093","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"6fba3180281c7a696fe3c6bb2ecf265926ce043f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.11-add-missing-tests-8198529952ba34540c8d502aa572c73a02b38093.tgz","fileCount":14,"integrity":"sha512-SB6fR2AdWs92wL+tmqFpZzdtPKhU28K1/n9g8TXNB74QIWdfxK2HoRO3CSOcw7bACG3I4IGHkdx+5X/FY/v57Q==","signatures":[{"sig":"MEYCIQDA3/s+Z0MYVPg2KSumOoNZ2GtyRArVeR5w3Q2T/AYotQIhANxaGJeFgn0L7CsMmzZkOAfkT5ciFE6bCRzHWNdsRKEM","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":71768,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfD9VXCRA9TVsSAnZWagAAvMwP/06FhCVDEgeHM90zgug9\nDlpR+yi7dbU6sY9UnKUMjnGJDK8jmD9fkJEWUryfQnOTASuLda+kZuIfERCQ\nXNi1MEVAxiPXFB8sQdwM+t18alF75iSB3XC42qcwvs1HfE4TmHAvswVCZ3aa\nqfn4jEcRcMH5A06DceLNb0SusDpNkKoQHn4jehCDBslL/2uXudbLFzTfHzan\nGXAZRW1wS/zt9qOeOaesHmzbG4FOtxWOs+jjAd+HCV+SIS6m0wUnvUHZqiGY\njkgK0eapQm9JELqoVoRusy594OyEGuWCZ3grSekR9UboMSGXHClom6apYbyK\nYjR7EDPi/Bm+NBPUCv0gdpgzVxcqX+zOeNgA8Z16DlxTiQAvipxVMw2FM+XA\nzPj/qfzqd7GwcTv+ModEp6cz7MAtpmZDx2K024KdQk56z3CR8bj53DXBW4Nl\nqmpOku60fPqBQ+nT+Fz3QhRgWoEHJMcvgw7QuR1VIfE4n+Uaw4NOwoCaUo5v\nRhBxGv4hGlCLMYCB6/IB9iAuJqZIca1itkDWsIn3xKAuWgEQnoyjRbop3I6u\nKQKEqema/e09icn9O8LhsrU1W1fouMAZoLwRJz6M2hUNbL2U5i7bygAbhAwf\nuBlArWB/8TZGP/MGPyBUbVUhsrUGmMIZjcEaVp6q0+lyvqhyPTPbXomdyCv2\nvB+W\r\n=UTHt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"8198529952ba34540c8d502aa572c73a02b38093","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.4","@balena/jellyfish-environment":"0.0.4","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^29.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.11-add-missing-tests-8198529952ba34540c8d502aa572c73a02b38093_1594873175358_0.25204448119520695","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.11-add-missing-tests-925eab515b2c4d57b48441c51f3221b766ad8df3":{"name":"@balena/jellyfish-metrics","version":"0.0.11-add-missing-tests-925eab515b2c4d57b48441c51f3221b766ad8df3","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.11-add-missing-tests-925eab515b2c4d57b48441c51f3221b766ad8df3","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"756205b117e234ee40b2f2909a9b13df19077730","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.11-add-missing-tests-925eab515b2c4d57b48441c51f3221b766ad8df3.tgz","fileCount":14,"integrity":"sha512-mEafmmGQ3u8R5IScv94kYf7k3PwsLDJk5zsoh8HONAelKxaLFiXrztoZlXROOf+GpvXxaalZdxJoeytwnqSQWQ==","signatures":[{"sig":"MEQCIDsIVMo7XwPk41yFZ3a2Y9c/XFv5OqW77t7lSr2nYmdsAiBwYV4mljACYrelA7hHbcNpkK8FbN5asMz4DXoz4pMrZQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":71774,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfD9cTCRA9TVsSAnZWagAAG70P/RF5ROxFMh3q0mEeA/0Y\nqFSZxNE99iY8e9sNsItFPmZzmVuz0OE71u2WyvXhSCPXSP0f4W8GuDVdU6iX\nios0XufzHBh98f1Xu0wbddgaSTdEehIIKuSFO87AgbqQCkNmNpeCflFsXLil\npgkhx3TeHqdTbssIfawxVXOhU7shcoIiXRtSFihmrn+/oi5L7tmLqqqDx/ad\nb6FSc2tYB9hTlLUUcNfb188/i/oBTVZd6STxk353IPjGeVGnYB4wvhmH7f07\nIbReCEasMAXP6GZQJh8F7Ls4JG4aNM0ETWe09QsQ32lnjdTqDZ1Lh7KfkiqL\nAd/BONeHzXiTm2XAFY6DsrwV7NkWUAtg28QtaUycu9TXPK9d7ezPj88SoaAl\nB7LZfvlTinZ+mVq2JvjeIDHuE63j85R/eSMeQlKXYDBo8lXPwGV29dXV60Rk\ntqitmw6cfgr2C5JjlCnaHoAWzzRJG9X+MmQzMh9EfEkBwbnmvq2ltVCT6sfI\npm2JQIqIPIa70qU7sqbY+2yUGO7ZaQzv5f6v4c/OWMIzuxcarYJBMhKQxhwK\nrhGVfIOEHKgITv4GuxX2zhFrjGucWWxwzpAl9laZbGB4ko4wkv5bbSGkCAoI\nGz+IrunVa9qYb9VBUN18Pu3p4IToPDNg/v8itaIell4hz9jvuNacsag//HH/\nPVpm\r\n=i2CW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"925eab515b2c4d57b48441c51f3221b766ad8df3","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.4","@balena/jellyfish-environment":"0.0.4","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^29.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.11-add-missing-tests-925eab515b2c4d57b48441c51f3221b766ad8df3_1594873619578_0.2359647142591721","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.11-add-missing-tests-96b0f6233378454cbd92781cee880a94fb403360":{"name":"@balena/jellyfish-metrics","version":"0.0.11-add-missing-tests-96b0f6233378454cbd92781cee880a94fb403360","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.11-add-missing-tests-96b0f6233378454cbd92781cee880a94fb403360","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"c018266b3beffd801e31a52501dae867cb9a7b73","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.11-add-missing-tests-96b0f6233378454cbd92781cee880a94fb403360.tgz","fileCount":14,"integrity":"sha512-Lio3FO+9QGO8ks3cIeqplX9X/MWF9XAPCzxA3GH/EMiScc7cjNcLcT8ZvER6CHmX6VxfFA5AN/gioKh/JuRLEg==","signatures":[{"sig":"MEUCIHtRuBNxznbg11iWrsR0EIGvwLhEBbOK9S5ZLx8d6kUfAiEAzxfAdhZ1DP4Q7Ucz1HxjxUa1ZtOwBygVqemdn+FRmF4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":71860,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfD9rhCRA9TVsSAnZWagAAE/gP/j/cLmAiM8jmArQQEHmr\nlAoIVx6R5gzpqRIfKNvUAfTPNAQBuP5lVGHf5RXCPxffEM+uAZ3MAjSjrQIJ\n2KRviO6pM88xxXCrxtnJNGTq7tBHCCg39ei19jDBrUEy4n+pykdarLY6E4xD\nvU2awOr/sDgfuT8r1hssctokYlNTiusoPpHfHSXpOsj0qCzP00hLIr3V1J+a\nPvZ0xsECWex8BaKMlbmDIdqOEdI6tkthg5YoQgX26ii3Bn0v7OixywzH3Q0f\nL/ashvnzhkUbAIvaiyHOs3r3b5hPdLMk8Yn+d1MS1rtlbtN2gx+SeeeUB999\nhGGhn9Z/KAuVuVn+4gfq7xKWzNAWZ0xd0n/uw80BR57rWAmcOTaJZGJvqASY\ngMgFj5XgBWUrkmb+atytqmmKPX4R5Hpi0av581fEFdQD4cwRr3WSkpXOaj1c\nRfELl26/GPFbFYp0fPJwf0ve7+yGyRasUDADuacYy8l64ZWHii89yomygnVP\n4Aq/ua+I1LYa3nlSB49eRc6DZsQqWVZUQy12OQKNbB9qq4DDPsdNkM8NK0gi\nF4E3ZJnCp0709ZTfkonznlwEmAPPPU5XrpNIscTbJuPKU/j+9UNgqGdvVp96\nx0YFm21XoRVOzPj50HRZRjJYEaJWu6v8xKpiXoKKgo/Eyi1qnSYnnBqw9ucS\nkS/W\r\n=Si/0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"96b0f6233378454cbd92781cee880a94fb403360","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.4","@balena/jellyfish-environment":"0.0.4","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^29.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.11-add-missing-tests-96b0f6233378454cbd92781cee880a94fb403360_1594874592732_0.978353182505564","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.11-add-missing-tests-8b6c0f1dbbe044557c385dc89b5bcdaab7a87dd9":{"name":"@balena/jellyfish-metrics","version":"0.0.11-add-missing-tests-8b6c0f1dbbe044557c385dc89b5bcdaab7a87dd9","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.11-add-missing-tests-8b6c0f1dbbe044557c385dc89b5bcdaab7a87dd9","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"d3591b84528f1b5c66cd44b724ba23bba2ae0d7c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.11-add-missing-tests-8b6c0f1dbbe044557c385dc89b5bcdaab7a87dd9.tgz","fileCount":14,"integrity":"sha512-TXaIvNCCgJrOl1OQ6eXrtwqPkG9XKABWMvwEh4CEXUvR3XQgxA99gt5GsAooJ96bGeQcL6gelL2O0lz1kymA9Q==","signatures":[{"sig":"MEUCICf2hSaV7fHXIJUjn8U9gXa24YdUys6Zx2rR1b5kfYEbAiEA4PLHCVqdajeucL3OZmnDEiQo931l/QfKlJG0QuvBWmM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":71859,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfD9yECRA9TVsSAnZWagAA1XUP/2kSHAW+tTjN7YqExkCK\nSYhWZhthKTmroekn+geDOWwmuexYvbmSUmA9wd/1yyXsXAzjq+FJjg5iDukX\nHEZbsAS4RnFnPVJ+ZHiCS5ro3mWstqTLS7AxoYY6HxQbzZDJzlj0HAyGQ+XW\n3LMMtdnJf6viahJ0NoCm+Y1vkDPpPO2E4b4IkRwk3Fdz1pb/Am8q6hw5xi0m\nzEZivWqsh4v+aFH7fY2MYzamMf4UaZ1kEz0CVvMuQLAVKwLzjkgzVB0Y/eRH\n0sQAHvhaZ9hwcsvf2n3FRmZWeheMp2ZxsnCTsov52F3p2JniU6YA4cJjehBw\nm8+Z9duBgJa2jFCNhKz0ToVvp85kKJZKUyl7T3q4Lp1eI8tZWbwfLcW2ISxk\nmEyk3oEYx/A2HdTr5Y4Mdiku/Xu1lr+PhaPAdZwge54rt42Si/B3onhq2joO\n7HIA6ncPppcQulV//I+l5JTdgXWeyiVgdc1m2/Ir1sMjfyUvU/NUPszgvlZV\nhKFF2V6GSC1oCwyChRzKv1G/JBZVHzTvbrGGeAQ2B5uQParJN9L0a3uWAklw\nuHpN3qQfawpThr7u1ND/nNCg/Mc0MJzPoeKqPxca3VJpPpfeLUQcZTfQBZ0O\nejCQmKZiWrmDvofr4D8gcvmL1+W4gop2GjayA2kM3UCgUsFk2/uC3Qh5/wxY\ndB+F\r\n=8rLD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"8b6c0f1dbbe044557c385dc89b5bcdaab7a87dd9","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.4","@balena/jellyfish-environment":"0.0.4","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^29.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.11-add-missing-tests-8b6c0f1dbbe044557c385dc89b5bcdaab7a87dd9_1594875012049_0.043562418913173584","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.11-add-missing-tests-c4257f8b316eef949d31555cb2619cbfff258876":{"name":"@balena/jellyfish-metrics","version":"0.0.11-add-missing-tests-c4257f8b316eef949d31555cb2619cbfff258876","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.11-add-missing-tests-c4257f8b316eef949d31555cb2619cbfff258876","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"d3b85a01614b58ffa78010598f46a16b2ce40cc3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.11-add-missing-tests-c4257f8b316eef949d31555cb2619cbfff258876.tgz","fileCount":14,"integrity":"sha512-ZGaTI+k4kpHvKFIvSJ41lXyjL4PSJBgf7eF0uHeT2pOJtVfIfbQgmgKsZ64pB1NlJMBf+RVWh8zSdBMXdGu1mg==","signatures":[{"sig":"MEUCIQCwSbYW3TeDY6l40G9Qd/c3gzgR0nvqeuwz+lDD9SqRDQIgEbnG5WdPhIrBo0K4P1oFBsFQqsb+RCN8utDYNRw9sZw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":72018,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfD95UCRA9TVsSAnZWagAABGYP/i3qB3r9SMCYxvtWfUVw\nRN5KC0OGN0stMOmziCRY5+nX7755t4ZYglOJVfLCTcxSWg/nAHzrCOkFpfeB\nuK/O2QE/SdqroooeILOswObVt/3sK/yvI+DCcL8ZJOAaLwmAVMXWpSILaT/X\n9LJVz5oekqa3/6UQEFpbLLWjSv6nwgtGD5q0LgCr4xQViT0RWPSiNyj0bR5I\nFkfw5vZ1RPU6ZPXs/0h9q9a5ESTOYTpEgdt+p/a+AF+jMHiycbFl9mnNdiqz\nePpyBCOq3MwNAaMNhNke28llQ70vpStc40r5SK1VInbkpfY5I+ATrgx77hyH\nModUtYHfSINFadqHrtpAyioKvJp9gDKdbRNYbqWNJ//0deA5WdwS7xzhjUoz\n+lw8YYR6XgnGQ3+XogI0YvZzB+P9exMu0A2qoVvsTn6+vzTqoVPTO3OHDh+O\noxMzKHMi+5iiZCpgLIGRyIQd+7OVw5i7/gBw9WVEFugVxgyq6xjAdHsziXEh\niYU9uU1irQ9q5f2U3p1QoV6HC+jkljc27RQieowWDnup5Cf0vNDr7zTmgzcm\nF+vh91GbICaYaArOFKaLZFyZk4FxK1Oobqaib24K+QQr9vyCz8RCziErwmEE\nE1/EkgHHgr8Dwg20rRHkHa08IWuagbC974xocpfdSZyQJoCMnE5V9xnHPdEh\nQzTl\r\n=knbZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"c4257f8b316eef949d31555cb2619cbfff258876","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.4","@balena/jellyfish-environment":"0.0.4","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^29.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.11-add-missing-tests-c4257f8b316eef949d31555cb2619cbfff258876_1594875476035_0.7254100191150679","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.11":{"name":"@balena/jellyfish-metrics","version":"0.0.11","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.11","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"f5ef3699c2a72a0336aae989d441a4e235b9b171","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.11.tgz","fileCount":14,"integrity":"sha512-3smPnTRk5V0lgHhPyPyOzygOQiWs3PZ5HMi1hIPUAl27J9bsGQmFRJQZzNcoTQmpUrVCcA5NP41/ijXndL8ovg==","signatures":[{"sig":"MEYCIQD7j5MbBelBOeZAC34hK2wK3JibjL7V+USzZ/Umcfdg9AIhAJ1dXA97pfkFeI+qY/bWgOfc7JpnufZFAAuNojowISBi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":71959,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfD99NCRA9TVsSAnZWagAAWnUP/j1CQjzgFFuiXW3KnUrU\nXc7bH4LXNi4qpotoF1nFlMs6ON2Hzn4zXfcMNf/wKZ/UEtQ0JFQLfov4b8mg\nwrV+U0w0zIgJj9A0y2i6ebrR/1vkH2meDPzU2d94IjEhQ6iyYsYUhLdKrgj3\n/HKI1h0l4CyaHrA8+aMy97n2LwXQmSvR5HLZ8Z0vHmsV1TB/k/56LdlyO2ht\nbkxlOeua6uUt4Zan2THfgVLeEiEhGsliYg6lRr8Nw79Dm6qjMquJA/JJDlZe\nH3fJq+mII8Hl6Yta3V7vNopaEosQesn9ENVh3V9xk9ksGdx6mbmjQpvAcEuC\nJndzRLfAHfT573mTl/Cf90Gc22YQhFc7g8ed6Bn2IMK8Si79kh9oSSQbJvkq\neqdb+sp1O1mHUeEWEguH+tNs5zzDVBoVSMjLdgYVyaW+XZX7a8oTC7eCndc+\n2weEJebQxs0UvZjzHDPPe6+pEj/Gn/ktFpa4ObyfOXAVErYZqw8ZxKrlnfRE\ntQjxmmAN9yRx4b+q14ntcsWr5E0FKfmSSWvstvi/qKh+MBXqUvB7tr4+1iwO\n8x4+Ss03WYV7NK9eVNR5ItGpSeyRC443qONH8WYFhbnr6kjOLvB5iq9FjwEH\nkcmQr068U5v8f6xnnyHIFwRb7xgy+XykinESz2UBnOstFJikOfE0DjN+BZWE\n4nE/\r\n=MIY+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"da3505a814fd197f19b402022b24317450c6198a","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.4","@balena/jellyfish-environment":"0.0.4","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^29.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.11_1594875725325_0.547713586050264","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.12-add-npm-configs-ffdc23fcbd92bb611efb05e4868e4a1fd240fb83":{"name":"@balena/jellyfish-metrics","version":"0.0.12-add-npm-configs-ffdc23fcbd92bb611efb05e4868e4a1fd240fb83","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.12-add-npm-configs-ffdc23fcbd92bb611efb05e4868e4a1fd240fb83","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"8c350d34316901b7dbf27878bae7fe529e83ffed","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.12-add-npm-configs-ffdc23fcbd92bb611efb05e4868e4a1fd240fb83.tgz","fileCount":15,"integrity":"sha512-RzAE4TOX0ilm+oDshSzniTOxaSn8dgUqDKuOsOK9YJMDMrG27cMgKholXT93p0tWCVb7tNRPl6CuN6ssyunm/w==","signatures":[{"sig":"MEUCIQDte7c0XODucFyMr8MwUoJgp5xEkPa/62oE2hjJtp3nAgIgViaB9q7q89XQGQwUrJa5//wQezAf5JR7NpZdR6cqfyE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":72116,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfEBYHCRA9TVsSAnZWagAAgMYP/38eEevEOGpCO7UmswNm\na7oYWRhffqLbmP+WdrpIp+Sd08pJ4ZpC+lwiwfV9b0VePax3gPwZ5uhgthEY\nYgVb4LT1POMkBz2Q9Ctps0gbpYNHPm4zbhdZyDp3Ez2xY17H8ZzbrQxB0Qk4\nvS0U7t4FYC3Vn9T83Ir2zZk3COQOXixubeDQ9YAnWQkkEJlhJ7Pq2Gv2pUWC\nEtjC+4oUlWU4ZuXSr7A24ItXs9z0aeQ+5IdvH1bzBFGEowwTYEYfFdzwWSpV\nt1QWINqBe9GN1HRBFU2C+T9KU+iBQKbYAlFaQHMq5ON6cnYEGR+CYCVmERIs\nnvzodQK6M6j2HTeSoOIsIAT1zUlZRJHq8ZFlWKAA+195kKk/oeZjgm5EYxLu\nGIqUZegIAXAkaIeSgyod0oY5sWx0gBXijGYo103BFVobzrnXvbUaNlIxDE2S\nHcT8y96b8tYzSx6X3ngkmnWn+u1weWTZHVPFateU+Nr8z8Ic5SStwxCiCyzx\nkZT9yRDZWzxgnJnCH8e7yxsW3vxhhRWpQ2JNhT264xNILyZLvt41YLad84Gu\nPnEairH28TmTM5824DqAYoH9lGn9dKsi6lG9StbN8MGIbtlm0vg4WAt6sL0O\ntFif79os2RhbelIVZgwdmub68Z3qRhJuSMzysQxZ7K8nv8yY2k3KBWreFOpa\nin9S\r\n=t01i\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"ffdc23fcbd92bb611efb05e4868e4a1fd240fb83","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.4","@balena/jellyfish-environment":"0.0.4","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^29.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.12-add-npm-configs-ffdc23fcbd92bb611efb05e4868e4a1fd240fb83_1594889735444_0.05415424465366647","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.12":{"name":"@balena/jellyfish-metrics","version":"0.0.12","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.12","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"d1a645f84e9f869740b81fe3a0cacdadfe91601c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.12.tgz","fileCount":15,"integrity":"sha512-YzaZ0Dm+CI7bhmihsYvEYpFf59oh+ZjnIs3k7SMc+g08yi/m7ZUvycwJdU60TaFt4czeethB/DhB8oM0Y+A8zg==","signatures":[{"sig":"MEUCIQD753gbWHXf2Sa92JOVcB4QeBdTUUhMg4pGR/IOsM42iwIgewqYl+62ZfDisSQrIt3sbG+CTEtYxIcGyPS9x10k9PA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":72059,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfEBbdCRA9TVsSAnZWagAACyYP/2gj6DpeGbtWi+VlI7He\n58IYrS/VAkX6NB3GRcuv4jZ5tV/w1rR4OPxsFP3kJ6rdu0BWubdUx0HDbtAR\n4u743SaD6d8JLlI+gWlbk3k6qTdUhxjnUtN2cUaM2IDO7qpXQTpo61gtZ4KO\nt1+srRq2TMXnuCrjXLRZgnzfQqFk8734vvrEcxl7nY/6n+4z0Gd46S8/Um5G\n/yJqIl+AcfmlIrrAeweNFOUJpQ2kRyYTHwPDQfgJdcBLp2Rb9WWnT73pDsKr\nkUssRDYHSzg4UElpBWPbHNiwUxij1+GjSXZ7LJe4HI52BkRTXgArzj3y8XZW\n48pwNL3USbgn5aRzKuN310sGiycILgrlVQ79WRTnEmuLm/VLfnMNkpcyHMzM\n48PzZFO0p8/IZxSSr9XtmyZwwADXlPJFuJLYeRu4Mmg/IFSpwWg3MhvfH2o6\nOkeW9SDGcUpNC/fJv5peI2qLoTNGa7XkWS0jHwnbXkzpvDfCb0MqnOe/9P/c\n6N5Kwqe9ziD01/kOLqS+zIgtaylbnq/mHUf+w7d3g7ebmnpOQe2gk0iJ0PBw\n20L4T1VUjyqaMBmFEF5oAVFZB/WYk49Ua8T0/MtuC0gp1t7h3WYIWGcGNDDU\nSwbrkTP7HAhgB7ldwGkgaaL8gGQYhz0/XArGNO5AULlEH+NcD1QylVPSv4VP\nFgL3\r\n=Lb0Z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"3e78533130eff6a34e5c13a2e29a1677d9efb764","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.4","@balena/jellyfish-environment":"0.0.4","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^29.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.12_1594889949423_0.33879712483567914","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.13-switch-dependabot-2601dd356eb9f9313c0e0c82f4d814c71f6eb110":{"name":"@balena/jellyfish-metrics","version":"0.0.13-switch-dependabot-2601dd356eb9f9313c0e0c82f4d814c71f6eb110","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.13-switch-dependabot-2601dd356eb9f9313c0e0c82f4d814c71f6eb110","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"485e37ab658257892c0ca89369ca6bd4f17fa701","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.13-switch-dependabot-2601dd356eb9f9313c0e0c82f4d814c71f6eb110.tgz","fileCount":15,"integrity":"sha512-UBC6ZIhCO/oZVE8L0NoV7kcQt2Hud6vMmH6Dg/ED7uM1GHeAys0zke1gyZM0Yu70gapOxLpo3cdpvopMc9nrPg==","signatures":[{"sig":"MEQCIAxL2fnT6Z+HP6U92/4j+Z3y/rR39GR1NLvBRH9IWhqZAiBZerCPre5JNsOLHr1salWl+bPaZg3ua+nf8uRxH/SKbQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":72176,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfEGWYCRA9TVsSAnZWagAASaMP/0krs32gibxCJKkggEeu\npvejgJQjxj6TQ6h+Th69XYCzdyuCEMaGI73hmyt2tcwG/9AwHciJMgxtAsoF\nwvc0qV6qR0QxKvzU9GKJXjD/UCvjT9JcTSO47Wjj197cQn+V53pGdd/kCtJW\nNb55YOh5sLvO+j1gTRatyEK0TR1TDd6BrxHejpW5WNoX/I1YaqixVOwhKKip\n14rfCQzewRfp6e5vpebGpNyWuk3VzSMdhoWgRqoZoeB0Okk9nbQ1/wp33KmK\nrmCXDqJ18OHgAnRm/CteCpQyqzVKMWGqvlBvRrCVJ6VrLCozPwlA/EOVB980\nbwcPpnV16joiD131uYYNbAFgtevvJJu+78T/MaFaxWNcVEzDv2UT7xcAKAXj\nY4OvWLMtBxkUnZl2QWTmNfHYExlnseZ/oAPtqREvFIlehjZ1esC66WlFq6Ud\nokUjLff+LczxIsG42ZQHwfhA6Z53A3fNNnyUEdKWKQfnM0pnfrY3jGPE4DK9\ncgbKtjr2y2DQjmIGCUE8O2fjs2juAFAGb7CvrCafbzk/hZJFmntP2HKyFzt+\njqdmwwpFkWEHWMraV+TyXxCaveQL5ytAR23dfvGgytxcYGQk3E0L/sKarFi7\nEdfoeGNUmAhygIL+REDFE5dR5OiNo1VrWZoJvEFdlZduhPwlmVKCEc487Mcx\nIbyD\r\n=13BK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"2601dd356eb9f9313c0e0c82f4d814c71f6eb110","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.4","@balena/jellyfish-environment":"0.0.4","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^29.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.13-switch-dependabot-2601dd356eb9f9313c0e0c82f4d814c71f6eb110_1594910104519_0.4552514470967075","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.13":{"name":"@balena/jellyfish-metrics","version":"0.0.13","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.13","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"148c7ad881ec55202f1519fb95e6ef8f739ebd66","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.13.tgz","fileCount":15,"integrity":"sha512-ELQydLsmBJFojZeNtw1t0DvcNFYINBzaCiL8WekqCdrqbUJyatsOUvftWT5RfZGVzzbPEJOgTOqmIfKXilirwg==","signatures":[{"sig":"MEUCIQC9pbiLvNbPXNB3YCAVzmFG045XUQ5GTYWEmeCWS7P84AIgfm4jrpJA/CTIljCLZycUdyekmPehwhVtDmUv18i9onY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":72117,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfEGaFCRA9TVsSAnZWagAAqQ4P/R4Lw4BWadIXiZk4eKLb\nxXWqEivqgvqM37uScczpOx/nKHILN4gZp0/svrwlVzxM8io3bf0Blt08Yd/Y\neR9/QhJpvAPsUeyiFNd2SgqY+asaOogQ0/CBq5BtQpzqiN0RGTv6nh7cfPx9\nspMRiFFNse0MjPQXr9PytcL9MhjYfVnbqAzkvezXPkpxm55+pWcNB/aj8Z7U\nIqfyE3UJaXzuxHmhWAUItS/BI8wXc3tZndcdFY8VQMtCbf8Oh4kyctcLMbJ1\n6LoF1BDSfEPP8vG4mwzz6ir+SGwMKZFw+JHF8/w6cH6ZNj4d6WR8rwetobdF\nOyPdnG3khuu8L5WzOOZMaJ/oYixsW0IALZ7kolqW9E2N+VmLNiYHLX/douRh\nnlT5iTHy0oq19uU3pmzlD/kJs6SuPVCQJtxlF0DGgmYEWikRLojhPHEWdDq4\nFSE8OS0us7XfRMgI4MLUiDrpRjV4I0x+o+OmUfV3BAf6a6s2NFd827VL/nB0\nKW1GST4qwgeFFjrYUSw+MzHjWb5lnTfMljjatuhuwFWUxYHZSudD5Niv1L21\nKp7L129zEltD+XX00K11/G3uYdOQBSV6iMcyE9ghNX1AgMZTKQI8+5SQj1xd\n41i7UtZfn9ABi5P+dlbrp1NCfhOKQPxKZ2EqR59Ei6aJZPQCfIivBoV36jJW\nPj7r\r\n=3T3C\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"284c1483d36cdb1a9a235f01dab0f849199c6587","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.4","@balena/jellyfish-environment":"0.0.4","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^29.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.13_1594910340754_0.33394919774234344","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.13-dependabot-npm-and-yarn-balena-jellyfish-logger-0-0-12-c2042f4a4e785eafa5474c39dd6235243f1f4437":{"name":"@balena/jellyfish-metrics","version":"0.0.13-dependabot-npm-and-yarn-balena-jellyfish-logger-0-0-12-c2042f4a4e785eafa5474c39dd6235243f1f4437","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.13-dependabot-npm-and-yarn-balena-jellyfish-logger-0-0-12-c2042f4a4e785eafa5474c39dd6235243f1f4437","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"c77aaeb1350917d730eb73a040a2d8c0198723de","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.13-dependabot-npm-and-yarn-balena-jellyfish-logger-0-0-12-c2042f4a4e785eafa5474c39dd6235243f1f4437.tgz","fileCount":15,"integrity":"sha512-cGSwGQ1JOc2h2i6ZLKwKUFp24692XukzrvacZu9SDZqLJjKaHdMKQvXWSbdh/B0iWweyPdBlUqArARfJw7Z+Jg==","signatures":[{"sig":"MEQCIDD9K8pFV3S1uvoGgn31HzH3BtlVcWol4xle2fDe5KA3AiAGoHxZFTpfcVrqW1mAXPu72MDa9fr1tOw8zZXp8C3T3A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":72300,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfEGdFCRA9TVsSAnZWagAAdBwP/0zyQsFODlpCOBaBLX9I\nyQ3bp9Xzo8oYubd6T6pK4wJ8bgskOvlrSuP6eoCOylKvkRJJlHnS6hGezONu\n6+9Mqyt8TIQYE9OcKhoCYXpwj6yVXJ7uj3Bncjczd3yVFVMQoTC6VFWbKxdW\nkWV/gVf3nErfSADHvYBkdbVDUBtiVZZ3YxTKwTSyuDC7+3s15+pPsoGb1v++\nQ0FH/EFXCg+x9UE0GKvSF5vVSXIXTmAcJSTaCitRflgd4CEGMKxN0LwIcD0K\nQpCAZEPMKK354ZiWPTbIcrFFc87Xu6sF7dunWZm5pFV0Hlxam+IPrhdj4Ht/\nviuj/SkIXTRHNQFtgkvPDJYMzI8/VB6jcyHOgpnl1NBYkQwni5T6nhH6sG9d\ncPR/yG6HFXcWVDNp38t3eYMwB1J2Er8XxwHCneNTOK/ejfgCcxsxSC7SnSEb\nubeJEJs8SGgLuHZiHYTFM4+yWSUKT6BomL/Mv43RI9Dv18f5fYIm7gVGTm0k\n0aro95NDAVAbuSX/stZsunDZHJnok2upvPh1QLqqUi4vysBznUB6+KX4j1uP\nQI0Ad2Lc+uIdHT8t1qgUhqz+vBOc34aavjbi+GzPv3WxPJw74HoF6OV5xF4i\nTq4abtvHA5wqCtD/CEOHxptRPiBW+si5f3FFFpptJvmf1H/vvElSgu52khAp\njxcH\r\n=PHFs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"c2042f4a4e785eafa5474c39dd6235243f1f4437","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.12","@balena/jellyfish-environment":"0.0.4","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^29.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.13-dependabot-npm-and-yarn-balena-jellyfish-logger-0-0-12-c2042f4a4e785eafa5474c39dd6235243f1f4437_1594910532600_0.22941694715791083","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.13-dependabot-npm-and-yarn-balena-jellyfish-environment-1-0-3-ba5c5dab02a2259beee5a92e5a3aadf5b55530f7":{"name":"@balena/jellyfish-metrics","version":"0.0.13-dependabot-npm-and-yarn-balena-jellyfish-environment-1-0-3-ba5c5dab02a2259beee5a92e5a3aadf5b55530f7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.13-dependabot-npm-and-yarn-balena-jellyfish-environment-1-0-3-ba5c5dab02a2259beee5a92e5a3aadf5b55530f7","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"84c81fee665be4b8afde8e5c54b0e0fb8ca3a940","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.13-dependabot-npm-and-yarn-balena-jellyfish-environment-1-0-3-ba5c5dab02a2259beee5a92e5a3aadf5b55530f7.tgz","fileCount":15,"integrity":"sha512-emrlYMKJTiOV+Pci50qWnQ9XHVq5BnMic1oE0qRxS3gGLgLaW7FZzXSL54rBecL2V+xzJ/tyIFrYOimTngycGg==","signatures":[{"sig":"MEUCIGBGNtayJrdxztVCDZ1JaitSrl11ivGVVpjb1dfuAcn+AiEAquDnQx1B7r/sIHoutsYhpBt63Qsb+TD9lZdkkK1ydQ8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":72307,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfEGddCRA9TVsSAnZWagAAXvwP/Au3PDjYA1tVJnYf26cN\nzphZqqTAUxhDPPfjS8V29FeNn44gKEfUhUB6Aw3Lk/e2kozJfx47+EZmw3YP\nprn0Sj7lWlFAd4AeSn0QVA5uAxnJrqOxbutROZa4hQptYvjqCzAqMUxIoN2i\n01XhldbgEEJX9ExssaNeVY5XB8mb1Vm5gfUuQD/UYIN7U4M77rKMpZHroHyl\nMiMdAvJLgUtyNrYizn2bTq3T2l2iKwVCkdHe9KxcKmyTZHgTi2vfxoSla4mS\nhRWt5BkAniLKPgkbhQqUNJy/yt0JwcCPLpCG4+2sYtdui3OU+xB6KbD/5b4i\nAxvNsR0nrW55WybQZHrQX65iTZ2x1ndsEd1g0fxlgdB39a716gRDKpFFGj3M\nYkxybaC7BP3eYPGv+l7zCYNZaTivUiyvYU3AciIEIgTePD065a0h3MTUq1g3\nSpkfLnuZDn164ZE1CoXvkFqrNzUhRj3A79W9SzJaeNo94XUqn0QzX9vDEntk\n4vsI07AffzjLOVKXCeyw88sQOpldA0JTARdz+m9feWcFoHfgTct84UYhtq45\nxPpI9ZAOyQSTfjCOXjKxy7IxBX3sWBvzREld6Zaqh1BK2XhIVJOpQwKrEaYC\nXxal1T8dQmtVEQw9B3QwSBv/1LhM1gT50LfkunbKPs4cER3wUZuuMc09WUQS\nll9y\r\n=4+np\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"ba5c5dab02a2259beee5a92e5a3aadf5b55530f7","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.4","@balena/jellyfish-environment":"1.0.3","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^29.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.13-dependabot-npm-and-yarn-balena-jellyfish-environment-1-0-3-ba5c5dab02a2259beee5a92e5a3aadf5b55530f7_1594910557064_0.3171562931018832","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.14-dependabot-npm-and-yarn-balena-jellyfish-environment-1-0-3-4133bc5b69aac82b1ccb78cb563833944b069ec5":{"name":"@balena/jellyfish-metrics","version":"0.0.14-dependabot-npm-and-yarn-balena-jellyfish-environment-1-0-3-4133bc5b69aac82b1ccb78cb563833944b069ec5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.14-dependabot-npm-and-yarn-balena-jellyfish-environment-1-0-3-4133bc5b69aac82b1ccb78cb563833944b069ec5","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"9b8d5c1c76eacdb494129df6aa5bf853812dce19","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.14-dependabot-npm-and-yarn-balena-jellyfish-environment-1-0-3-4133bc5b69aac82b1ccb78cb563833944b069ec5.tgz","fileCount":15,"integrity":"sha512-nMrm/48KjeaXh/axE4ZgjB02M7UdM/c3EnNfql5dyskDWwRA6nBU3JWVClMbZ6etYECpZgOcz08DUEcuRZThKA==","signatures":[{"sig":"MEUCIQCwQhxFkhfrAaNt8ajrJ2oVgQCk7BZ8WMGw8at8fNNiOwIgVr1VcQ8afJ9+Dh+chtkSERaH1DElEr9zhPDVN6+ItLM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":72335,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfEGpvCRA9TVsSAnZWagAAfo8QAJLHwjrbcwFo2lYRBbaT\n7UsRR5waM9xPekv0dLjIa3I5WmGN7s9Leqi2W/aQalgYJ+eYv+Uvig8hyI0S\n2yKO9v2laqTg8HX0ZiXE0OuadY2n1zijSNi4AwIjRR3QDBCpI1n4ui/pr+gg\nDpvjHlB2IiBKEFAQK54/MZW794tBv/ObbeaBYoe6NPJBtskl6a6giOmKUbfK\nMEuUaIfmEeHDQvXMdxueaTL0h2Y018Lqp0mzIlL+kUN/a+beTICrQU6exRis\nhghu0bmO5PHSCSXLZ2LOB0XDyLuSFMiF+GNlBDjwBpOOFpd7zm9S/81qfs2t\nTbGgCTYWiz8YT8oAB1nfqayoor4iiCtH8KPjoe5NIL3B5FnQRc2wahx9en/W\njLFnMhLZEWjTT0w+laFCthoTnownjLbM9AqJtqf4/Don0i2h0pKH+WoUDx0n\nxIJjakh8JX/uYtP8yH2v0gZj+lPSe0z1NcfU/jackaujxwLymELagum/autf\nSo5ShlLj4U+L2+Mv3Win4U3vbn0p1dbMpGMJSFyIML3qQmj6jPJ9YVjNU1sH\nuthhxNWRpeyfAJ84TkikxAbkHZSNVeyQg7e0Nb6d1YPoHei7Ez622GPB7B4v\noBFqdvhofm430ihochluyTMSchSAhCQvoUTHm4uuHeIY6SPRgCTVycJx22US\npur8\r\n=5cT4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"4133bc5b69aac82b1ccb78cb563833944b069ec5","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.4","@balena/jellyfish-environment":"1.0.3","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^29.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.14-dependabot-npm-and-yarn-balena-jellyfish-environment-1-0-3-4133bc5b69aac82b1ccb78cb563833944b069ec5_1594911342736_0.596395308342589","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.14":{"name":"@balena/jellyfish-metrics","version":"0.0.14","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.14","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"d0828fc2b85e8ecb1983f6b96620174e09a1e6ea","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.14.tgz","fileCount":15,"integrity":"sha512-zS3Q6ZM5w5ua3g4DoDBkdGSC/iav+wmzE1rv113ABKy5tNdQW+5z+KOHbnQ7LiuMznRZFhVEVg9fC5R5GvA14w==","signatures":[{"sig":"MEUCIHTzQzewtXPTZjIH5dE7Woohn9ln8+eOhknIV00auYioAiEAzVoPz/zL3im3uUd8wbko3JjShBYVj2MCJPOgmc2Lfzo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":72235,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfEGuDCRA9TVsSAnZWagAA0lkP/0NO7qPxnXXRdjF77Ly4\nJIbRGXxMKSv9lwIJgRlo/Quk51fd5tfqwng7XG+FLqP23XaOn0psz45C+Ydr\n4iDW9L5J2kcEjsKt9G/j4Ofd30EXCzoCT2N+CkXxNmiAxPUhwG94yCXkMk5J\nqOYjDX2gvNUfiRM8ljC6HUSMtEYESAm7FqsnxFlKd13mihf0URntQU4s3f0s\nPnaKPw1FD2dyVDND4qildilNy/NpInN4s7etdIC6+r9IQLXnsMgRudJVri/A\nxFAhFEBZEmlaK0KXEuPchJjCHWe0wNDp7FXAUjvx2jjC0gkfVbqAZD4IIthx\n7T7X7wIwkkZKKUwy4VTp/hg1oq9EB2clHxQPR84s5yEMfG0hcifmJOO8MqjD\nd42sjYSaZ/Ifzj0PaJsFUipztuaGuxfQyaFHjeBWywq3wdrfGNhdAmaTekln\nww28KxI2EvFNjsfSXj97UDwb3sG5FtKxof6Kwp055Brlgj1dBQqCOA5SlQbn\nvn0pLj49SCIgRmrrez3MnQeu8vra4R8udpKyOLyqEdYrfR6z/okidilq6Pir\nd2MTyqFIsw9d2PXA5+HaUpdaUXswZHm9kh2EbMMT/N9lYPw2lWrkUsy1jfzA\nGnnp1GqV/t+/DCS5QvqikvWB1Ltc1JZUFCJl/2jobJPSO6+hNA4mQuVQDgsf\nm62K\r\n=Fu1Z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"1c6d8e63dd151c853e3a928237aa2b3e1fef638b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.4","@balena/jellyfish-environment":"1.0.3","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^29.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.14_1594911618349_0.7854341015701509","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.14-dependabot-npm-and-yarn-balena-jellyfish-logger-0-0-12-476bed25e201e3897eafc2cab31f40c2810ae469":{"name":"@balena/jellyfish-metrics","version":"0.0.14-dependabot-npm-and-yarn-balena-jellyfish-logger-0-0-12-476bed25e201e3897eafc2cab31f40c2810ae469","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.14-dependabot-npm-and-yarn-balena-jellyfish-logger-0-0-12-476bed25e201e3897eafc2cab31f40c2810ae469","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"e478c872a381e2b20d221a4ebfba9f2a4416d0f2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.14-dependabot-npm-and-yarn-balena-jellyfish-logger-0-0-12-476bed25e201e3897eafc2cab31f40c2810ae469.tgz","fileCount":15,"integrity":"sha512-pzJHp+JC4LkdbOCtRGoy42btTXb+Mkc+vhEeuBL8N3p1BYfa1KX1X0tfYCAfbVqew0iJ8FJOPyLSjFbq8MHlcA==","signatures":[{"sig":"MEQCIFNd5N7SXjRoC/bB2l2wMtTT6x3kHc0pOivO9Lp14FiOAiAUfj6SxjY2deL0ZnoLD0ZwoguNd7JNZa2GbmPAHmgi8g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":72418,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfEGySCRA9TVsSAnZWagAAmg0P/3nYErFtM/oyAonz6hgl\nVvZhkOdCg1mCyZCPlqONCA4eFfKKpxKfVv+SBnVSlu7feB4dsRs/5U/xd+yE\nnE4xCOyF1P/M5lra7EILRbfuHdiJNlfy6co/aEoINfg3iY6rY57NvanWNs0P\nes0ClqlMQixwDR6Hi7i5Ci3B8Ao7YY8wa8JdfArGvtvIowd9iyMrcj+PL+hs\nNE1WVFaCLGjw3HtIU6JL4XmbqQ3QLdxeiCqcw9ByppPzX7ioGDFAVgrI4/a5\nrnUmqSmwVVhJoiQj4Vi07HTaDEdyR4R36gLnbnOzp8X7ySJuQtST4SVZSaIK\n3z4oq3Eu/BJ2Cevh1N2Bgmy1gpwawT1C/TnKoYS10AqvZTGoEDnpQwCfx0Au\nevMAR0CV+JOGdp4o8uTo+ktvx3TR55fdwg66N1WewhFF+k2ork0bZhpJEfTl\nG4KxUM2ml49mVTTJIFA/fVOpmFe/18VJxOEomz65+cEgWf5b0Uh+roNVR8bS\nIZmmZYLx7cRH5ZvP0NhR1Da0EKlvR9iOc8nPei3x/1U8RrGlBMgSFiEJDIrK\nocMQXI1O1udfZksWyAVZ+TTi8NJ9rJceuSKhoiRX41hTqh6A+9XKybr73XAW\nyAjXAWPsobEgSW9+V9Qqgapacpw6QX6E1EJ6x05xD1En3l32qBq9pSarlFgS\n63vU\r\n=1/gB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"476bed25e201e3897eafc2cab31f40c2810ae469","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.12","@balena/jellyfish-environment":"1.0.3","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^29.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.14-dependabot-npm-and-yarn-balena-jellyfish-logger-0-0-12-476bed25e201e3897eafc2cab31f40c2810ae469_1594911889654_0.017157393775758978","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.15-dependabot-npm-and-yarn-balena-jellyfish-logger-0-0-12-886fcf8f4057cb50d73355f52687c63a38b464fe":{"name":"@balena/jellyfish-metrics","version":"0.0.15-dependabot-npm-and-yarn-balena-jellyfish-logger-0-0-12-886fcf8f4057cb50d73355f52687c63a38b464fe","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.15-dependabot-npm-and-yarn-balena-jellyfish-logger-0-0-12-886fcf8f4057cb50d73355f52687c63a38b464fe","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"02df23e573197461146731e298e3f3d41feea1f2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.15-dependabot-npm-and-yarn-balena-jellyfish-logger-0-0-12-886fcf8f4057cb50d73355f52687c63a38b464fe.tgz","fileCount":15,"integrity":"sha512-WzQntFyYQfetOlkJCACFu25qj9MQm3i4trS3UMtm2EXw+5HVxvS6GVjoApRhH+VbKN4JHymJ6fvQVxSvv1CQ4g==","signatures":[{"sig":"MEUCIQC1emkIlsoK4WNHG7F06lrU/9YJ3Ha0VnYwD8AN5JXkfQIgRUhbUtxBlhMoGCWspBe52Q3vcsE5OrtPn32wyemwSSc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":72446,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfEG1RCRA9TVsSAnZWagAAvvkP/3ITX0IRpqxR9ke1OhoH\nIUYJzVeh1zlSyiHNh3h2tpe3njo8Itzl1Npd3hcMvixguqVQDtMLr+j0GQqT\nFbJs4gx2Gqny31gW78Bem2SaGI2Z667WFp1Mxma6KMTpKYUHFzVUzeofCvLe\nWvkbigfzn087d9oqYF+tsl0ssuGnz0s539QsyJhHMZ3kTwAMPBDPOgIo/iJc\n+t7+R8k3ELHtvetXJTNWnNRNVeLqijZhp4jQPiLYNKg79jE157FfhyNBkkuQ\ncBmajALIdVajZrvMDOF17Bi2qBLJ/a0+oV5YDSmQW0EbO/FO/1e1Xr93Hrts\nFYUiwxPS6/c9g1i/kQVPGuW/GouUUSkY5ByOwkY4bAq0dD0e3PCy8LrwSbeA\nuEfobeZE5BI7uOvikWlXZWFa8iRBeB3x6U8oR2yG/McnxO86q/YtaY+jXveE\n4IhiOgSO25qwSlVmCBz4zC4sS1SgNkf3o5KIGTSvC25CXyVGxC7HEWXt4D7V\nvEDDSPVKGxrcSWEJYre+m2Q6UPpm9pRhe5208nmWkICkILISOewWmjhHk4Jt\n3Y/OnqPSePMM6f80gjKN8XKtr6XuJa5D5R84ys+AAkjUk99j232VUwlxfK2t\nSkExt4Jp29Qp3DU+qsiMJAfoxnvwroYqL6td0G7yOGQWgI2tXsxpdlVvJqZ/\nItHA\r\n=wXhU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"886fcf8f4057cb50d73355f52687c63a38b464fe","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.12","@balena/jellyfish-environment":"1.0.3","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^29.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.15-dependabot-npm-and-yarn-balena-jellyfish-logger-0-0-12-886fcf8f4057cb50d73355f52687c63a38b464fe_1594912081521_0.6621574577863398","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.15":{"name":"@balena/jellyfish-metrics","version":"0.0.15","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.15","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"1246c70b7455a7bd8d4554f4b54f56cba0d2cb31","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.15.tgz","fileCount":15,"integrity":"sha512-r7I60IpzCtVioDWugNT4kxO1cKVX7JvZGanYG2m6y8WLapwh/FmJLKnrOsUGYhZagBKrIuZq3ym0E0NA+eVL+g==","signatures":[{"sig":"MEUCIGBauMOgSLmhz5mNsLkk+c+WxooTB5LiCGvWRwohglxuAiEAvtBCfXoOfCoiLNY3XUW8n1C6wqL879IpAD3QSB+50GI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":72350,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfEG4xCRA9TVsSAnZWagAA65oQAIDUCmNmjyrmd+D7NH9Y\nJuV3newhiLz/+Imf6hTDFlTm4L+kmzYhQMTcgOFr1ZUA2brPTNYysWrIUqbC\naRXeNZO9IK+BxtokRYSLWSZzmxwH43tMaotC/IVVQdlyxPnFIOImZWxbJtxn\nM3rCjmIpg3YlLNf2ht+53xweAt1/J4zZRVinpbRbEtI+F5WyKxkxab9giuDS\nfzVLH8bBOd3EQcv/ykGobR9xz9h7BlF4b+WyMfy7Y5i9oQQkrB0EdNTAiX4j\nxNpKEDCMqbPQhSTDQTJFnxYmmrbfJnQAfsJwk0g3bWMBltpnV4sgqMtO9weP\nZo4jAMnD/zxy+xlH8uRZ4dFABCpA9wZqwdq4AxhcICoqxc4g9KTtQgDIwjww\nx9CTdXkeYzHgB9T9Jf+JcbokbD3TaHqYwsGzLt6PXeVouStZGCn8++RGn2Mf\n8FUSLHrPYRRywyHTZ3LEQja84HpjA2NET5IP2VTgf3s6q6eZQflRpkwsURy5\nzNP4GgD82mEfV5i6Cm4F2Vw+zHxcHdnT3Hse3ut+hx8qEgEEhtGzJByIEOya\nFcbYs8NF3IM0qg/i3LnvrkRpS66XHltKHrovqGxRxJldSu3mh6wJcjlqPXL5\nwJUE+tl65GDV121MzVeYVlfwcYcIh/YlOIFolBVjinaFd13h2z12yGoyq/Fb\nbqoc\r\n=t9LJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"5d0066f5243004c061bf476dc42016ce82c164ae","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.12","@balena/jellyfish-environment":"1.0.3","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^29.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.15_1594912305179_0.8576727522903838","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.16-dependabot-npm-and-yarn-balena-jellyfish-logger-0-0-15-9b5b74b11c134e50a0cbecf91134fa9ad8699d17":{"name":"@balena/jellyfish-metrics","version":"0.0.16-dependabot-npm-and-yarn-balena-jellyfish-logger-0-0-15-9b5b74b11c134e50a0cbecf91134fa9ad8699d17","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.16-dependabot-npm-and-yarn-balena-jellyfish-logger-0-0-15-9b5b74b11c134e50a0cbecf91134fa9ad8699d17","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"bf1067c32a9dea3d51bebbc9ca7772faefc7d186","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.16-dependabot-npm-and-yarn-balena-jellyfish-logger-0-0-15-9b5b74b11c134e50a0cbecf91134fa9ad8699d17.tgz","fileCount":15,"integrity":"sha512-lKCO8ub0z8nsffS33XSqh/xNOCWJF6MGNKGv1z/+sIb8527MhJ07eiCHIeqUiueq3WJ0ldNF9tJqhGW1EStduA==","signatures":[{"sig":"MEUCIQC0l0AG1RgEvC9KfFYi2/Y85guMaJIjTn7x3HqxoK9uwQIgTfdv+ORZx3EzoakNSbw9zuVi/LVeDJzRqjrJ0915veY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":72561,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfEZfECRA9TVsSAnZWagAAOSYP/iN2er4Es/BRYe/dEZ33\nQDKwAIaCO9MrX/tS17i+T+JIt6CyJaZXgHptY0nkb+tZz2rLcrxKIs2b0Zs4\nHSZJEvxoY95dHkeWxSEcXlZN+kqqwAT1vphdh5FVJQdOobh3CDuGLIy+1TJK\nDiCFTrkUmvr7X0F4so6DOy7O6YwashWmGmIhjpASQyJ+PQFgLUTUq69pPg05\nQLL2KZ97WqkGuQ3dtb0YfGZxZTvix0Jbhi6E374ifQtmqTw9t5Rm+ilTaYkH\nVk9qL4LMEoCH4CgWBSAT2Mhg2k6TSTS8EUM6Uv/APomKVgYlTYNr2NfiOtaJ\nchZcLrG9OunJs8xt96FkDnpMZPJBzIuJ1cLGq5T6M1fnxCZEF4hzdAHDY1Oz\nPUopJSH1O5UfjaIrCxy70rcvUs7KJddnJhSKyKxoaN500fiuHik9FXg49jS8\n4mhcBo8H7OklKRQObFuadn85Z8jbNb8r0HJogd9G+uf+WTHS7QQ1gY6Trki+\nByan8RyhXNePR4Bddr+uptNcG0sLFR8FHy4+FRWefrF8LtNhjoVlATtwrHXp\nMIcWyCoV/YDfy0aL9d22b1cTREZyhn2ewKogm8SEZZ4oJku6ZCJZd78xxtW0\n2JMvjTZSDl8XxCEhM+u59K+ebvAaSHtNOSPiFQjiIaRd2ta0tQieff25uEAo\ndFF5\r\n=xG6R\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"9b5b74b11c134e50a0cbecf91134fa9ad8699d17","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.15","@balena/jellyfish-environment":"1.0.3","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^29.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.16-dependabot-npm-and-yarn-balena-jellyfish-logger-0-0-15-9b5b74b11c134e50a0cbecf91134fa9ad8699d17_1594988484406_0.36850078689718124","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.16-dependabot-npm-and-yarn-eslint-7-5-0-0e533d60785cdaa8657c71862e69ffffeff7d761":{"name":"@balena/jellyfish-metrics","version":"0.0.16-dependabot-npm-and-yarn-eslint-7-5-0-0e533d60785cdaa8657c71862e69ffffeff7d761","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.16-dependabot-npm-and-yarn-eslint-7-5-0-0e533d60785cdaa8657c71862e69ffffeff7d761","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"44aa43456ec9f513b64d0bc57c9f1061207ab45d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.16-dependabot-npm-and-yarn-eslint-7-5-0-0e533d60785cdaa8657c71862e69ffffeff7d761.tgz","fileCount":15,"integrity":"sha512-FYAJ/gEF30SKJH50po4Jw0g/x5O2Qu2VhaAtNGt/D0TpUAY7PwZteVYtw7Hq7zggLQDzfaHvgKye5jAcfr4elA==","signatures":[{"sig":"MEUCICvqxY4kEwGFe2yFDPxzZ5HhGDKnqTiX2N7VcMGWU9o9AiEA9fWDgNAn8X9j6iNnKd+D2y5RNmm7ZlsU96mNYo1PIxE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":72523,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfE0mWCRA9TVsSAnZWagAA82QP/1MA1YT+hWPh5XnDGzGi\nuPzxh3s21VI6AHTujuDpvlZVaLRcakF3rDSmTcEvRUJ/KXqIJnUbQ8B46lZS\n+MPkBkisheCgmZ5zIYoj7Hylca+xz/aMKjYOluvHrh2gRSTMXTg2MsmWi6ri\n+oMBzQs9YMD7xA/ZLOEbq0aoHsn6Ld0nG7+YInhYVKMmqcLhmmIfZsCGTqUs\nztbt7XFVBCtnvUKWOFwnILi15DNIRspr953dPBy+3YAnK0azcPvNG2CYLqAL\nUapSAfP4k69ejdpVE7c5erEsmmIAoK8iN4c4acwfgEWBHz0r7WFn/9zYkn0R\nY//KdoIuBlwQFkD31q+L66sQw9U5lOuL+MFpJsqUywv57v6g27iYxdSnoQR3\nEs8alLiNu0haCWWmxjwlEVjRdV18z/g+r8XKLkYgu2cUreVxepJkynucoWuw\n+fJDtWuIRAVuTzxL1O17DL5IvYDPtFLJaeVFVK6rxnnbF8qjqVjS7c3N6uvR\nhhukw4ncD8OuhuGYXahQJKL1ilVSTKfyY7kT23y0xmIluMn9IyBLIL8VfoCh\niyvVMbdj1EqFYukf7+jt6YnOVfH1Rvt0hau4bseo/08DQFwaMo3rB+RmwOHx\nnIxKn+spHGGUIAUCfxP2jHuWcXqwDUr5y5WTygKIY257+WI+TYghVd2ibUyw\nBi+r\r\n=EE0s\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"0e533d60785cdaa8657c71862e69ffffeff7d761","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.12","@balena/jellyfish-environment":"1.0.3","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^29.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.16-dependabot-npm-and-yarn-eslint-7-5-0-0e533d60785cdaa8657c71862e69ffffeff7d761_1595099541530_0.9300453168640375","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.16-dependabot-npm-and-yarn-eslint-plugin-jsdoc-30-0-0-0a4827df0c1c57751b587454be6ebc6e500132e1":{"name":"@balena/jellyfish-metrics","version":"0.0.16-dependabot-npm-and-yarn-eslint-plugin-jsdoc-30-0-0-0a4827df0c1c57751b587454be6ebc6e500132e1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.16-dependabot-npm-and-yarn-eslint-plugin-jsdoc-30-0-0-0a4827df0c1c57751b587454be6ebc6e500132e1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"32b7badde4e06373db1fc0d0c2c7854ed53181f4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.16-dependabot-npm-and-yarn-eslint-plugin-jsdoc-30-0-0-0a4827df0c1c57751b587454be6ebc6e500132e1.tgz","fileCount":15,"integrity":"sha512-iYCR7CulbTef2lRDHjBfoNwL1kxl31Z9Qnvz0ke2neml00PIDaY4qdv3y1BNWa5O0cSXV9h0DFXNUkPwyd2t3Q==","signatures":[{"sig":"MEUCIGu+AhTQFcoFPl1SBDuiSD0UaVBzucSHcBrry6/VV0NQAiEAiSQV62b4r0/S6ZtGY5nHeI5eFPwvebTPbXbhE6wD/bU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":72552,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfE7mxCRA9TVsSAnZWagAAzcMP+wQgi/epCXv15Bu4xva7\nXb103t5Lq2oMCaYEGrBzVBwsyIFkhZLOOzpENR6dmS0JR9XiwbSKBkY6D76e\npOXzGnM95CZEmHVFcQbVFQRGUrz5UkhbZ1nJmXV0VM1xK/5cmFkr9jpUxnrr\n+8MDiqBQkYZ/9+DiyE4WUDT3p8Ukx6kDh3m/nr5hKq4ORyAAMdCXYTcuQS8r\nRHmY7sO/XGNkEFXFPzxTe2sq52CdXVAKZuATTCK2BsQSeT2/jYMTDFsfLjSa\nucn2wsWrmPPA7G5/h4XQEIXdXx2sdH4ZOEBXXYW0XZmmGPIK4rkdis7QIxjc\nNB/+yoTKWxl/klYc0gmIstsdmhu9C2mbbDhkHUvmcwkA1lVqlDA1poeQ4pfF\nFMWFBJHwbHhGJn3YKM4xkmJqVJ8ATYcvsjhe3DmduUERkhZlQ1auVfQnqn0Y\n1DfKFXeQS/Xu7vn/T3ORKlrCMcr0rCwCXOk7uBPO0x+t7FeV5yUZ+YescL18\nuVOjAWlmMpkdyc/QFg/MgIKJm1DNmcBdZKhc7RKULFtKzzwtM2i3/5unOUQc\nrORVkLPrVBihqFUw5Z4ZAkD//yHd8R782hxPGlmcZN5WYyeQxQ9U1sXj4kJ4\n0NDWJYsifW0WRsbOlvSbfb3jNUyFRJjEFJs6vFFvdIBqDTmvCoIO+CNQ0uLE\nVDBp\r\n=ng8o\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"0a4827df0c1c57751b587454be6ebc6e500132e1","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.12","@balena/jellyfish-environment":"1.0.3","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.0.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.16-dependabot-npm-and-yarn-eslint-plugin-jsdoc-30-0-0-0a4827df0c1c57751b587454be6ebc6e500132e1_1595128240640_0.3972750944412955","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.16":{"name":"@balena/jellyfish-metrics","version":"0.0.16","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.16","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"ae44f76da32f576c4baa5037bc4270d09ce9d371","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.16.tgz","fileCount":15,"integrity":"sha512-2t58fYGD9Pok+z+eWdp73qGMcVO+f+99IvcO3Ua2ll1hVlKFjRq3O7FN2RBDd9T+XTMfaodHjWsU8r1ZsXhXqw==","signatures":[{"sig":"MEYCIQDizBoMnERthnD5wzAfwr4Ivb8dpbrUNYLGqe4NZNlKqAIhAM/pO64GEToAfr3PNEDUR3EVBmqM5Z5xfqWCsrygEGbv","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":72460,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfFOkECRA9TVsSAnZWagAAC6MP/1ZGwaDuukKXQi0WM3ZK\ng23+yaRLgjGnFuWlSfcykVI3Skt0wZ7HTSgs9xnVS2DJuh2NdlU3VE5qAbhY\nqlb2OAYyDAZS5h1FGrsINPSj6sTSjn99YlbjJKDIGe/haVt7wEsgGdcPhGsb\nkt76Ad6Lq8N0ce4a1Hmj2u4sZo5NuCAf2YP9F0rh+fOTaCMaXyw/0KYYA2Ta\nEIA6THbNTqByRAbfASckKdjVDDmtocd21vqZ4bJZ+dthyKGM2QZjzmWVS0PG\nWylh0Kbya9IhN6clB2r86q0FAHZk63SCvi3atkbF2h0TkiqujHqNsWJci0/o\nL3ogtRz8CplDKL2RnV2zbksIa2dgQjc5MkTqoRSzpIXXJzlcTfnmiBtRG0uL\nmyJKi1qYLn068KKZchvIV9432E5fNuNBwZ6AIAGDXEktv+PZSqh7ZH9R5lrX\nKGBhfHkkzyjXD0ZSQhI4ebCkD6JR+4v7hhnTQorxdciAOah4ixa5SBPq5pCw\n9xjd3mn81p9jlkeLIdH1fM1o3aEKsPs3nvzbg8Yyhy00of4PErsndAcsWCIr\nA9SUw5R/WLxHgWgnqk/p6cVVlilsPtQEDvzc0ruNOQVhi/L04X4WYhikjVzC\njzJiHFfaT4waRk1K/nlY/rdfomcJl33QnSgKak3lApL4qHM4IA1XTmZ94IcU\nmOMd\r\n=cEu/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"8b377ceb77916618ca4a6b2322809fc40f422641","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.12","@balena/jellyfish-environment":"1.0.3","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.0.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.16_1595205891816_0.6609685310061737","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.17-dependabot-npm-and-yarn-eslint-7-5-0-138dace301d0c8eb1d964638d4ff4a8a7620d4ec":{"name":"@balena/jellyfish-metrics","version":"0.0.17-dependabot-npm-and-yarn-eslint-7-5-0-138dace301d0c8eb1d964638d4ff4a8a7620d4ec","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.17-dependabot-npm-and-yarn-eslint-7-5-0-138dace301d0c8eb1d964638d4ff4a8a7620d4ec","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"b66d40d7d15658bfe572f3749e0addff84efa627","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.17-dependabot-npm-and-yarn-eslint-7-5-0-138dace301d0c8eb1d964638d4ff4a8a7620d4ec.tgz","fileCount":15,"integrity":"sha512-9i9T+cBuYDt8Pi2T9XuCJxBOK85Zjo5kjuMyPOtJJm2Rh5JwK1R8s0fLLl16VYj6VTQY/X34v8ce3F78ArkO1w==","signatures":[{"sig":"MEYCIQD4jQMFxtN+jNlqzqZze/Ic5gNlv/zJGkDUR/lQ/PBpTwIhALXeavAxCAkU8LgdQZsU77VLY7NaUarjRYWriTYglZDI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":72633,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfFOoICRA9TVsSAnZWagAABFYQAIeHssNkilSfchkmIKCj\nK0Ha0sQBjDILF/0iS/XO6qRZKU/ecBXoM/YvtH/ur8pi3sqGAUn3jk2w/U9W\nHHLUHHpxvHo7tEzPqcK/cMY0iMiKGfe3IZmUyOrFV9vqW31Wqs5L/gYXbZp1\njdCIUdwj07S6hxxuOY0CEVw7viAeb4RCK2arFAVWjeL51vJH+5zZNkUoahwy\nthmmxHy1g3c1tGnxeA6viL+N3oKc98fjpOo1dry9P7jdvOAUEWFlqyUMG8BE\nbnb1lvZv6/Ex+Z8wdaEuC/MMAO8Vlz6ZRXF8POSY2BolX6Oc98iHk7mGNzqd\nxq1+MFWQ+He5rP8p9GMvxpH7RM3pbGuvPvRKvuVU0KA/dERauDhGt9ZMePzE\n3HgysGpr1PwcEY7/Da54IEE9k/LcC59nwEQu71sPexNcFaJd3kpvkoJH0Kcr\naysRFW+QDaTHqMgYgREXRmnETNNk1hCdF97j6volRpkyVJGSvIeWB9Zjb4r3\nW24HFt88yde4xsrQ29gwvWj/botnyTIHFI01GFbvjwzCyKgo6cZL1CuKuBhl\niXXTiQsjjAf0kSUS01hTu5abABScoldtavbm6hR/9g4e+gIbYU94SK/hiumy\nNRph9leMP8ab/gfBw7RPdx7UJG1Z340IyQP4HzI7vgao54zV+2/ebmnrjE3d\nnTvM\r\n=oS/V\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"138dace301d0c8eb1d964638d4ff4a8a7620d4ec","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.12","@balena/jellyfish-environment":"1.0.3","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.0.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.17-dependabot-npm-and-yarn-eslint-7-5-0-138dace301d0c8eb1d964638d4ff4a8a7620d4ec_1595206152516_0.33734990919757624","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.17":{"name":"@balena/jellyfish-metrics","version":"0.0.17","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.17","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"9238473643747b2efb7eff1ebd67141003ed56ae","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.17.tgz","fileCount":15,"integrity":"sha512-NypX56R3/4DRnW4wC6A+e4HXN4jUYDNtaQVmo2IEuFwoZW0zPbyl0AMaW3zetRoPB1oTdnPx9RuyIrrVBDdbtg==","signatures":[{"sig":"MEUCIE3911dQ5xmyj+avCxV1rn09MSzAvplSG60vR3IpftJeAiEA9kBHUQgyuEAE0oDREW9mJTlGCdAmPjh8skMZNH7J52Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":72555,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfFOrSCRA9TVsSAnZWagAAUlQP/2IgI8oqphk+wR5PrIkp\ncXYUJlcIzFi37D9Imt7UP3qSGXO6Dh0pDby+0gAj9lifGVPx6aPrZxqLp9On\nshD6MuxZKuvfWNZ2HrMDgNHv66J0E5/7Z+eN0DOcn1IlI8ZenbloIwi8BfzK\nvovcK+8/4FjOGesaN7LBFgZPeGCIbm1lPm7zMrjx/adPxQO2D0Ci2ENQwFrq\ni4zC8ay6c5UV1osRVW95VkeFUJ9WMM29qh/e2h00HAVlH6nX+sPB0yDOPHfa\nwxJHjna0DKAImZMdLEm70iyhbW6RehrQ2p1K+u6/bFXk+V1FKNdxRkw8/eI2\nCaoZ5LnPmM1FDv3xQuuTkPDaC4WTB1Q8BftzBHnnAoq8I0sxhROaf5dGMBxB\nan+0YdpRVvheGJXlmiy6WUAvbXANAu4plnm5Go4FmU2hiUA8hOJe2c/ZiuTR\n7mahhTSxo9tf5RfDrIZMj9ne+vfkdWZ0M2K+sa3IMdOkQd6T6FEMRlmxlNxO\nh2ba3opXxImKcSgZoqBJ4VhQS2a9Kbpr7pVYr8KRv0K8kUc7KRlXoaUnovsv\n7SGT+fkiw9vwpoz9+ujZzbA+fsM7NG5k2yetjQnFm9GyanEMKeyYM6uAyOHX\nwtFfhw8ZI4WZnK/ttgnODRuo8wthw49ESQNVPU1xmhJAfI+VxoKADSzXr8Nj\nl/Go\r\n=wsjA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"a440feacb7e49296ec96512321885eb0759bd5ee","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.12","@balena/jellyfish-environment":"1.0.3","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.0.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.17_1595206354292_0.7736539994306844","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.18-dependabot-npm-and-yarn-balena-jellyfish-logger-0-0-15-68ff6dc3216b23f5050d1f6b290fb9dc4096a8f6":{"name":"@balena/jellyfish-metrics","version":"0.0.18-dependabot-npm-and-yarn-balena-jellyfish-logger-0-0-15-68ff6dc3216b23f5050d1f6b290fb9dc4096a8f6","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.18-dependabot-npm-and-yarn-balena-jellyfish-logger-0-0-15-68ff6dc3216b23f5050d1f6b290fb9dc4096a8f6","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"fb8755ab1e1df3ec79fdee5b9694f390cf74be34","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.18-dependabot-npm-and-yarn-balena-jellyfish-logger-0-0-15-68ff6dc3216b23f5050d1f6b290fb9dc4096a8f6.tgz","fileCount":15,"integrity":"sha512-bR6H6TwbWfmDyfxyBtyx83Y/g09bkPStcHOer3MYHRx5z2NngWEGE/w5ZHdhuHsW+TlnldIJ8c2nWP7vZi0NLw==","signatures":[{"sig":"MEYCIQCD8HVFty0arW+7PRKT0AU6rPemVDQHdqNSs2NexS+QXwIhAIFrS5E7DUc+HbU2La6ktIM/XFrXJZ3KxU873mwQA6VA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":72766,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfFOusCRA9TVsSAnZWagAAM4IP/RNtNlgPzFV7mgfb7GhO\nOnXAVvVkSFn5zIMFNYEaVqG+2dC3mMbweK2qMgDCHjnYhlL+HW6aiJ35+kxJ\nTrxo6o65616g89Vg6JpJ1UrJU76WkY6e6OCtq7EAglVHcoDTRebrSVhWe7yj\ncBen2L3VJyo4fnr/T1Xf6hbmTyx9v0E3jKvzXqaZ5REOtAxX/i/ZLbv8qXHR\nctXaCJr2rUpGzQF8PaxdWsfPS/TEh5cREsXGPlwVlyBOUwzf7uXItKXtuLLi\nxYQ+QEgBNuQvWn5fbOIyDVFzCuIDTihmUQvAiV9phQKo2/b/uB5S12qD+4m3\n6fe8GrMo9JY3stz3D5TXb7I/I21z4WHKHiz7N4w/uIH0oyRECvAOG9yPS4Mf\ngknJ2c94tQMHePK1dO21YmC6iWjMwaK1RCvMAGKO+wvclzkh/cHRvCwbGTmS\n7oWPkUa1PgbT56kG7ISLMhCm7xgjzkXg0iR7rY8i0sKVYd9QEuJejUzquTVx\nLtqeSDbe7l+cVXNPnR2RAoC8JSrp42drwLChFZ/bEOHAVCr9fN5WwIY3HYeF\n1/puahRRUdGVg/d6pGewgUf0NBH9Rg6g5craEeA4efl2M4pxEIJOt3VzbCsN\nj5OKXcO71QxQdLIxVKoJ41E+iJMuWYroQGV71iigGt8IOiRtY83m5AhUgiit\nsjqh\r\n=ZEX7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"68ff6dc3216b23f5050d1f6b290fb9dc4096a8f6","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.15","@balena/jellyfish-environment":"1.0.3","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.0.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.18-dependabot-npm-and-yarn-balena-jellyfish-logger-0-0-15-68ff6dc3216b23f5050d1f6b290fb9dc4096a8f6_1595206572354_0.5884941954445715","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.18":{"name":"@balena/jellyfish-metrics","version":"0.0.18","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.18","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"86ae6c7656a59016c7c0fdb4b5b9bfae084e4643","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.18.tgz","fileCount":15,"integrity":"sha512-av/VVJ6yMolWlneXBqpvX9pn63tupiEolhzv/cZoWhYikdbuCsJq84eaJlr0f/y7ipZOaXrhdUJmnSYs/YPBdA==","signatures":[{"sig":"MEYCIQCckCamxlNVpzywwIdJbD2nbuLt+rqgUk9tAZDdhzvkEAIhAKk7L5LtIHTx1f5H4MVNxnKou7znCQacSOaNWfqHLOne","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":72670,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfFOyVCRA9TVsSAnZWagAAwNAQAJTIVkvetXPninkMHWxi\nb/9k8V+4LnD511u0R/EtfZYUnF91E53pGdQa2kfKbi/mYKfTIKB4TH4Qs+70\novR6NW+nJhm8HSCbJJWqarU1H0xKVzeJYpbbX0mbffwZBmrm8otrGZQG7DlH\ntpvb5cWernawOmRXUliUxXwnWmz82U+JE9J27ENQK/P31jd86QO8bLBYCg6s\nbzSU81vcdFA9LRE5LSRKFoAt4VwGViQtBSiwFemcTKfV2e9IEaan3R5pECsp\nrWHhpl9ar1QkWVu0AO8Vt7jmeQ6X5J+6K/Bf8FIdVbXcKjcKbWuGlCL/SfsW\ndWBNxE/yce93lik1XTitXMhz5Gg5neYUtEqt10aXmke09RdL4Q1CvNsAGsN9\nUlQ6sQAOwIZO/82l0oZsFVb4vT39faOro4TOk5pf0MDUwIIOevNKtVdd9T3Q\neZZK8kX+4sWsFPV3JcqdUtT6l26aPj4QQCh4Gp0kcCauBV3I+S8U5dYnkg9s\nh7i7XaPLm1ZM84h/9+4a/En5wE5H00pufNcLKuLIWSI35x3LQ2DJWBUZhlJS\nSlnOXokRoBGpxDz9z6Z+xYmfjzJogJSqjhz7CHekxvT0DgwjmP6rwa/rRiCx\nYCjJK5cGvvb/x5LSwD+nhKDz7cNipKgx2+WeuVEAaPqhz51TkJ3miTcWnuP+\n1/q+\r\n=7Xox\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"20594fb1b7d87c1a59c5124898ab88f0f219af6d","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.15","@balena/jellyfish-environment":"1.0.3","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.0.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.18_1595206805155_0.9713782195448379","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.19-dependabot-npm-and-yarn-eslint-plugin-jsdoc-30-0-2-b24552d7109d085fa9498c4307f5039e4ed139df":{"name":"@balena/jellyfish-metrics","version":"0.0.19-dependabot-npm-and-yarn-eslint-plugin-jsdoc-30-0-2-b24552d7109d085fa9498c4307f5039e4ed139df","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.19-dependabot-npm-and-yarn-eslint-plugin-jsdoc-30-0-2-b24552d7109d085fa9498c4307f5039e4ed139df","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"76a21f7a8351a602761643df038c08038fe8cc8f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.19-dependabot-npm-and-yarn-eslint-plugin-jsdoc-30-0-2-b24552d7109d085fa9498c4307f5039e4ed139df.tgz","fileCount":15,"integrity":"sha512-KdmpxvztsoN4gVs997MNRfbC3lB4in/jcD3hPHV3trjdoVCiXXngHjSY6s2E/s91u+JWOaQjzvqqlY4qk+HZsg==","signatures":[{"sig":"MEQCIBFhSQ7jiifCNXDvqBwECY6uSd78Swmj+oUVxN0NDWfsAiBHcD+HopttRT2UltRyBqklwlcEp+Dp7DwLUmgmYAzf+Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":72872,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfFb56CRA9TVsSAnZWagAAd88P/i2uda3MgRblL2mHJrrL\n8w+vp3mXHBTlX9QOy0PmB7Xgy/pFZ0ZH3t/1BkIl8QVEoSmvI3SeZrsgQTt1\n3x4c9WwnZV6Ba9fw5kp916YKMj1Lrlfwp58hMsUZEsuv385+/oihlXlUax50\nS0dtbJe39Cp7829TCYruLBpWurs+uPOaZEwTfotCVvZYHjSrd2g/DOERkGth\nkJb11A73s/V/3qiWikTQApdW33fjhgJ9SdXepDcLLqqpFr8+aOl3pe/Vp8er\n4Q0bYoUIypxglV7WSQPWgLWCAYcfgaahJP9ovGWPMDO6v1MJOXBiAtc8flYQ\nGC4KRfLazWsb0W/94HW38Bu1dSiIAPydbGw3ac1Ct2aoCXifAZToJzVFISCY\nmeIW9lFgjJMU5nimEmBLXVRKUWduPqIwwvnN7SjwbR7dBLzHQMgnuaCVSTjQ\nKTl0jp5dol9lIW/UHneQ5nri7LGM2O4FsMtWo+YcIvqr0BU75+61lyC44ENy\ntn11Co7qIVZaESP6SJtMdtDA7ii2DK3j9V/AHJ3uiScU/429piVKUChYqaHX\nlE7oAzKYePZSnCHnFIv4z/1I1Y8whvnScoZvV6mVLy7XYLU+alwksyJ3vR8A\n+wWw1H3N/7BR3diCNkQdecRWg+80DH/rrnwxWud6gSlQ6hgmnr97W263ogrH\nfU/m\r\n=lE9c\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"b24552d7109d085fa9498c4307f5039e4ed139df","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.15","@balena/jellyfish-environment":"1.0.3","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.0.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.19-dependabot-npm-and-yarn-eslint-plugin-jsdoc-30-0-2-b24552d7109d085fa9498c4307f5039e4ed139df_1595260537687_0.6006982326341577","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.19-bump-dependencies-871a7de345c19f8dfed1486dc861b391508b7e98":{"name":"@balena/jellyfish-metrics","version":"0.0.19-bump-dependencies-871a7de345c19f8dfed1486dc861b391508b7e98","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.19-bump-dependencies-871a7de345c19f8dfed1486dc861b391508b7e98","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"6e4e3fdfbbbfdfc0ca8e924d3e15919306b709e2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.19-bump-dependencies-871a7de345c19f8dfed1486dc861b391508b7e98.tgz","fileCount":14,"integrity":"sha512-dwc99PpYKQjH7dF6+Z9pizT7lZM/WN+bjqmb1fVE2GrjyAl7qJ3bqV2m/BgoCXfr+VvCsrtVrSuiPD7d6IG9BQ==","signatures":[{"sig":"MEYCIQDK8MdXARF1ZnRvDDyWKuc95FFZJeaFAEKtPXG7nSJ+JwIhAPSGuLKcpHnyyiw3FtuZytHiUR4okyZ5LZhcfIrR8U5m","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":72778,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfFjoXCRA9TVsSAnZWagAAL6IP+QH8YwguDYs6btLK0Pk3\nSIlJcvqpJy8Y8UGtTQV+Oa4XnzNGdPE2QtBqpNWu/UfLU6txNd+Gf4dFnTtM\nLQYtIcVwHmyIK0CCZ0ZwI6IKt+i1gDYgbm4ZsUtIZ1PIwowBuAz1/RKILWzc\nAfJBMVLYxV07lYotaFQWvUrCQI5djINwAx13wmnD27rqop8MfxUjwBBrP5S0\nSjsPgKt0Lc/nLCQnprTw9XQcHnn64sjqvnZW5QWoAbF8SH9s5DmSs/X7R93x\nvenUT6ZaIM6RBF+nZxlN4ATAT8wYOXzqMIMvqwFdlEwWhVoZicieFoHcSVGH\neyJEGstINw4//ZTu6BdrlTL0eDEb9g/352Zb7Z+Jw3RqVNgbGtVUDdxlPrtz\n+x72UW8yrS2vsYWSQ9D9AAfI+3xLAPpaHKrOjikbAysUei0BVt8xY7B6sUEC\nCJSnBbyuBezRHizfxVd+/7MzT2ru2XzlZrF3aQLCiqDKswaX1xYHFj8BT/qw\ndNoKgalPYvUsTolGaQu7SJZlI27mtAjLR0onP8VdDOHI/sQiHHHLajn41mlx\nNQiWaahHEx8pu8G7cHJ7UH2QYCOE/pmtNCRRR1PV9i8MGCecnijr7q/mGRzq\nI1pJWbpnxuSUVShNYMeh0J6frgu669V8+4isdZVCbb+UHDsHtb4oD3oCMi6L\nAF2i\r\n=3A1y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"871a7de345c19f8dfed1486dc861b391508b7e98","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.17","@balena/jellyfish-environment":"^2.0.3","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.0.3","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.19-bump-dependencies-871a7de345c19f8dfed1486dc861b391508b7e98_1595292182528_0.49527663032519476","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.19-switch-to-renovate-4eafa6fd04f31bdbe06bb19dd126f4bb2b75f723":{"name":"@balena/jellyfish-metrics","version":"0.0.19-switch-to-renovate-4eafa6fd04f31bdbe06bb19dd126f4bb2b75f723","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.19-switch-to-renovate-4eafa6fd04f31bdbe06bb19dd126f4bb2b75f723","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"aed33566d1fd3bbea6b8074a71a8aac39dec5219","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.19-switch-to-renovate-4eafa6fd04f31bdbe06bb19dd126f4bb2b75f723.tgz","fileCount":14,"integrity":"sha512-Vg2m4fyOglnWxaZqRg62JV41sak+FGPoWehSQQPQgL5hYE4w23RGkk3fuvLNMYrwGBuzqqmAt8f0nEgBnQixbw==","signatures":[{"sig":"MEYCIQDO2jOOt7ZEw2lndJD40xMMKphUu8VLpzSHRt45YlPqjQIhALfJ3A1V83qq3OGJ28Ob1wXLtdeJgYMgfLd1/u1s38iH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":73561,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfFo+qCRA9TVsSAnZWagAA3XUP/iaDBi4XKwkh5J5+6cP5\nawCGy59IuEqP2WVFq5HUyhdnM6yWVJwoFGLbWAwuixWJ4nyl4Mol9L2lA3RJ\n0mDcxAgxWrz6h/5S4O0azDcPwhRQxRT1YYWcxwBS6j5LAyXKwhHroYcd+8A4\nYc8iRN0g2JUHFFhdXsKuT0jWrIl3ra43g2ByGOlS8V7DfrIqdLL8q/tOiYsU\nu1Pln+Yi/JMaSoZwi7gxOGC/vw6xHUJuhjKRpSCzzPa+SvlBN+FQbl+oKPiv\nSFQk2FBi9WOUX4WDTD1aSEklgdxmPclfOGOFq29J/GO+OR9A9AfpDFU86pow\nQrEqSBzXL0g/YBHq1oGNVe+XNz5dBqxZ7fbLuS/iobPMqBJ5FL6icyhq4Oqd\n8qximS30DJ1HZ2QhapBFEa+ktR2tUztIczFWu3fDoa2t2eim3GkK6TRASKB6\n50K5f0eqlvWLn76wYlpluDoIYzuy+Sr/anxdWkjH/deY76OrOrVLCy64daY0\n/crqFZSp8qfso6LtAImdWWqr3/OzlWKaLMjvOpSzdGLg/cjud5YgaurCjXwG\ne5PfwSvm0mGwHVNWW1fzTx9Wer8ThLy9VzayrCPG1H+wAo8XmGHegNx7INnL\nM+T4gVf6UbzNxGwtWsB9yqRSPwXBuXF2mekgNbcOiJ4rV65P5cb17KLpshTq\nkhbW\r\n=K6LI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"4eafa6fd04f31bdbe06bb19dd126f4bb2b75f723","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.17","@balena/jellyfish-environment":"^2.0.3","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.0.3","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.19-switch-to-renovate-4eafa6fd04f31bdbe06bb19dd126f4bb2b75f723_1595314090355_0.1975639662267903","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.19":{"name":"@balena/jellyfish-metrics","version":"0.0.19","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.19","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"c1972ee473e61afc9e097a0e51f204776fedb151","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.19.tgz","fileCount":14,"integrity":"sha512-qL6mGdbmA6xrnLEFDb4gnw2f05Ba6DxPm6FP+yMXGh/U1vu6yut5O+1MHlm7lkQqRHwENUXgwyKHvFY0u74n5w==","signatures":[{"sig":"MEUCICK7jS3X/SBCTw5SlGPABDDoj7mjk2o9aHguplf+QPNUAiEAmvP2gYIcyvDoDfHamotB6D6AmKf2cGKy3Tm1nCB2FjE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":73501,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfFpC6CRA9TVsSAnZWagAA+LgP/0biMLuCZSovD+7tgMoj\n+IcPEeB+s7CIQ9Ih7gfNREzEI12V0lbnBnSFlHIf0ZAkQNh8wUoSE3UHkBSX\n2VPh9Lm+Mogdd2ph135YO8HG+RGvXvC3X2vzdyVmGLTUvd/wqb7ddlE+UgKS\nAA59nOmXqAcRIStEfBbMBr1x9pJqd9U4lpDx4mX0zo2nRHcOZyf0NaeDXLx6\n4/bqAYcaTBBNFZcua2l4DOaAsvVba73oiKbRwtCGWwekzJiGwf7gChEtyOMs\nJwzIgF87SI80W6kYAjiJDF0Q8MHvH7zMfiKjQotJrcNfGkwQpEnkU8DcLVV3\nOpzQWd1+830e8793Z4huNsz++vtlFOLZuQQJSG7jzW1kxupWU2Q8u3zTWEwJ\n5omySYTaphHh1gKTf/qnGjMnQYuPuTU+bNvGhsFIlW8TzcWDIFmrVeypBKG7\no/p2Zj4A5ZAI7MCzif7orgTB8DHaBrZXiVsQXWCBkiJifYAJkSb6XGyzppu6\nO04WIunaHqcDmNv9b6dN9jXDbF1b9ReykUkNqaASIv8ihz4VZMuVYCpwfpnZ\nxpFZLL2Nb40N8M+ccSAcUO5AlLPjGbujR40Traf2I3aukQjlwVDIqHBY4YG7\nKX1HEczTnqvsc1zQwuQ1uZ4xuuS1fsWw1zdonZgO3bgl7rAR/jv1c/S9Mq8q\nYazX\r\n=UkQM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"cf28f4c047c818c02aed4110158b84503e0137fa","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.17","@balena/jellyfish-environment":"^2.0.3","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.0.3","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.19_1595314362067_0.7066953580393702","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.20-renovate-non-major-69c30fe67f8b132fbda5e40e3a6fc2e1a11f0b86":{"name":"@balena/jellyfish-metrics","version":"0.0.20-renovate-non-major-69c30fe67f8b132fbda5e40e3a6fc2e1a11f0b86","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.20-renovate-non-major-69c30fe67f8b132fbda5e40e3a6fc2e1a11f0b86","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"743b76dea699d6755eb1290aea7c6b6c703512d4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.20-renovate-non-major-69c30fe67f8b132fbda5e40e3a6fc2e1a11f0b86.tgz","fileCount":14,"integrity":"sha512-MAwKvuqsXe07zqOsb5hKi3VM+hUAGSjh8ftfgl2WEu/IaYcv1zANwjwLDbOqRo9SbOXO2LayAVdoeMd1fm6SZQ==","signatures":[{"sig":"MEUCIQCa4Lmu1/M3cLf1zGRsxsUghrDJlOP/OWT1x3d4ogFzpAIgOJcFpSnrjNhMzIaauhF19CFo4z2hmCW1nH7vCVOiHwg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":73629,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfFpFzCRA9TVsSAnZWagAAnlIQAJ4/eFJYSTlIDpRju4sB\nQg7gvoLG+MXFcC5MXuNo1dzMSpc777ehrXyeP6W5DNLo8HKG2t/GfVFhSYvp\n5s/xVMLwgg+0sbIrzFo90+3FHTr2N/iRgcfGDdTKi22rMFOr5BxUzrUOTF97\n3vgDOAvdJQWRjky7EYyK4522CCArcZ3P6mIknZ2lraoXDhZxl9jT/8t2n3TI\nTTyZ0S3jv/mhKxUkmTLcU6WcCakkBhP5r/p+g2wNxIwJrRBTKQ4YfGthgTUg\nb9YZK/GOpcDS4f5C0c/FFGJe7dpNcliAG0EwpLl3gsiTY2M6l0anCLa5OsLT\nfwb0u1WvAj+nuFKHeI6s+OR6Iuo1yzhHtiVIvNvdF0tGxKZmETrhkQZYg8IO\nKfXHvYc8ffYppS4pAByFcXMs7FzBbhA5JCrWQ/wKHedJvNQB2oU1ytSewYxo\nwldQS7rxgbWbJvSvSs9On4ROhiF2moxT0fha4g9BxlQ2oWHhVMXWJHd16FM+\nci3Kr1Mm88WMUB5TJj3ztS1Xh2GH4Oa8YyCojWSnD6HIiFSMTnmU274K8pZE\nSdqXFN7pYGhrttRh89DZkB0uQ86TjlLYph2myReLuGbaO9TD7fBRxv3CBglz\nbRY7iWjAWTo6BGtFGnln+1CprPkzq3evfG0mgUl4ejD7nOrICxL6h/17vE+q\nZP39\r\n=Okkr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"69c30fe67f8b132fbda5e40e3a6fc2e1a11f0b86","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.19","@balena/jellyfish-environment":"^2.0.5","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.0.3","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.20-renovate-non-major-69c30fe67f8b132fbda5e40e3a6fc2e1a11f0b86_1595314547595_0.8631995617383978","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.20-update-ci-configs-6153a15144bc82becf361f9a256c314a1fab4dcf":{"name":"@balena/jellyfish-metrics","version":"0.0.20-update-ci-configs-6153a15144bc82becf361f9a256c314a1fab4dcf","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.20-update-ci-configs-6153a15144bc82becf361f9a256c314a1fab4dcf","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"8ef0f69fc6de04141da17d905eab7222a36b8aac","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.20-update-ci-configs-6153a15144bc82becf361f9a256c314a1fab4dcf.tgz","fileCount":15,"integrity":"sha512-9crbITgmBtKakOls8phM/uZDG7PGC/1T08gV/obf+3HI2SHO2cRluAMuauSW+t4FyYL1WLAIeb70XBgmKSq33w==","signatures":[{"sig":"MEYCIQDQkZEfxmRMxaahGe1NU1IhBwm746RiIXs72Dfh7Lln/AIhAL+PScZutcO4THEhfraI6TOrM9HjVJzY/8klL7pUCqOw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":73916,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfF/1dCRA9TVsSAnZWagAAJuYQAKUOAaK05vybxJfqkGXH\nNDQPHysZNngOq3KNU2HeJsPHATKblvZcEnNp/lCZS3ZhqVrTupAlSDD74Gr4\n5mFZycEu2Zp8KKt4eyxvntC4l409pxiRPPiwn2xcD8WfF1/TU96YZux4ozh0\nK8K2nkkUiTOusMPMQCTaYj7vwMoo9TnYoSkcQ+WQqp1786iKwQyDWpYR84av\nnXTiWeoAfWZXKse1pmzCUSyN3rXfvEvMjjzQ0tYrEcy7RBgnNUinieJ3pNx7\nvY8Q5efXrGs6oIvWufPtpCTTFCHSAxV8NWH929ULOEflvYga8tWLaMfjPHGn\n39I8sTpZh/JVkRGqCs3+6EUPGkArWNeIJm13scqOJiEGc5AY7uPNhDOJSXG+\nlWX+a8HRVHV+BsaC5Dli4/4sNgMxetAZFbqswPp9EdOZeAykxMd3T7ymS33x\nubbB5eD3CpdRtOkHUuovfdSRND1iDo7RCfT9H24dxTJ8IxSpunK8VDy5p0Hw\nXSu4DDXqsEv/lFw/9H681JM2MXsqXtyUuiAPn5h1CgWwDizfm2373UmStPP9\n6zjp0esEP8PsVkrgeTrIKdj95xWCaSywZIMnva3C14pQmNNuAv+R1fm+Bdgw\n7KFH5E1L0NCmavZzz2niMrM5bZrzgRRr72391nkjwHoJIml6tKvSSQt+xac+\nZJK5\r\n=+6Dz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"6153a15144bc82becf361f9a256c314a1fab4dcf","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.19","@balena/jellyfish-environment":"^2.0.5","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.0.3","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.20-update-ci-configs-6153a15144bc82becf361f9a256c314a1fab4dcf_1595407708695_0.6868742143306419","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.20":{"name":"@balena/jellyfish-metrics","version":"0.0.20","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.20","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"048ec6f7c4ec616e9c76331114abe02981a402d5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.20.tgz","fileCount":15,"integrity":"sha512-4k+RXWlsKBGCnRxcua+uxrw12pAokPLpbyPbfXLIfRIPja6vCuUg6kuyF9MPez2znOsYN4OzekcEfv8eMHVzKg==","signatures":[{"sig":"MEYCIQDQfzlxHHnABPxcwJuwVmEB1AsJvDOuZ9o6GNE3i78jQQIhAJ0u2Jgh3qBjM5VluqDnRqIAXC6eT5vN1p+2Gj947Tuo","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":73857,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfF/4xCRA9TVsSAnZWagAAMJQP/j5ZS99xFa3ccAPVqhu/\nQa6JrSaagSdnTZ0GpjY5YUopGntFvydOfmP25/dfhoTlfC2Dd8A5DyWdRvif\nnWvG96QRZU1P6I4yRI/3IIUYjsZzbGWN3ZMfYlK82HO4GcAHq1rgCmq0adrr\nmmAQOb6UAgUJ43U7ZHDPu2D+qHuG4z4PM4mtsh332MpglH3d9fgzLIy2XrbY\nNPYsN2EpefW1sOeRRuwmX49vge5UIX5reOi1sxMfrjPW/IDPT/Ek5/biPvW+\nC2kfRLGL4w6a3RfVocVOOT9OpiUsCxZAN0sKsxxI9AJDOpliTvvI3Fpx7p04\nmN4lttHXG2/hCm9ocvzVppm3Lrkjs7cAKfd92vhu3YnFliEk/EmpyfIvLQi8\neuy6rPEeaAc5d3oJQMFpPSDjX9rlFAi2OwpeXhWkM0quH48sDocTACxQ++Nk\n35kYxBD/3zLaz1mj4UYP6FCPOqMi9zGzqrBF51ebUSO7+7JlJR0T4OXJn9Sc\n6gCkrUsF6Gdz6I6Joiul0qMMepZ57Tlp+gGIIlYfulB7nEWILTtMoP/f/dkB\nqLz/zvLamhuvB1cRmsuHOAAEe4vB5k3seY/W5Cm+ICwpBcqPrN6ibKoX8fyD\njhXhwHvnjwnc4r4MAZMtV1Et4DKfHk2P1+2LIaX8bvsaoRa5gMrGXkDVR5le\n1DzQ\r\n=QWCY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"a2744f8c7f741f028330a9657936bb64493bef8a","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.19","@balena/jellyfish-environment":"^2.0.5","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.0.3","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.20_1595407920867_0.07626597502164723","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.21-renovate-non-major-531edacd7feb2813e64fe4ff3ddd98d77b223897":{"name":"@balena/jellyfish-metrics","version":"0.0.21-renovate-non-major-531edacd7feb2813e64fe4ff3ddd98d77b223897","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.21-renovate-non-major-531edacd7feb2813e64fe4ff3ddd98d77b223897","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"fdb8b9b1f3c4d0669f30d575c9d0686ee9f80d8f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.21-renovate-non-major-531edacd7feb2813e64fe4ff3ddd98d77b223897.tgz","fileCount":15,"integrity":"sha512-YJfFEXORtIZ3qDPEfEeL0qLaLoDb1V4FhrBbiANwSV6Vo9D1AF3fMz5iztSfxPwoF7FG6sRCLcitud4HTRWb3g==","signatures":[{"sig":"MEUCIQD9hRi5xtFvM8IqgXx2wjfvTcl0UCjXhSyPHmMF713u8AIgYUnvPVgixIfdkKmvEESP4GejNqpG8zuWuSndel3Qx5g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":73985,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfF/9MCRA9TVsSAnZWagAAGRwP/0aIpw/44uiHVpDtUNt6\n1cdzTCU1Sx6s+BUr4h8rsuvgwYGcqoVOq6GZvcGcZimHQpteyE2xzIq6p05s\nauGhrNAd3MxJ4v8B1/WIm95RpwsS+ISQuWmYUhutwarqqmIYjlWX1YikV2Fz\nAsFagcFM1Wh7k7CJH15O9nBrBbuFvi3fIfykb4X3jZ09sJXwfWo0Qv1jaEtR\nzT20o5JFhC37IlhSwCIb0zTYkpN+DE/WB24/7ZhMOGtPAMbEo19qJ4TihFxy\nHEGxkC6+rPsrWXNKJk3TqHEmIzzHgkr5jBkzj4iopTwUYZLICYPaecVhlwmP\nu5Fbe7il+F3SqfEfAuQf+Z17+iUM2W9L0pZhj4dEC0YsUhJDY7oefwU3n/Jb\np+bAt426VU3YSDHXYWThLkenKfNZfSMJy9y10xMQhxIC6Zrq/6KzoOXZWPkd\nFcjIQb7Ejqw8zsoIn1k5rD/lyzohm9ffXSszhMf2asvKw5tgzTDYMPZmU9OF\nj6x8/C6dawh7iMMiFGzLDuLL4FYMGbhviiVKYorRubMvUG7O30oxUhceMXw2\nowWuNCoP8SUhd/r3wt8rof2nlK0+zx9MwNfBkNb6fEYG9hFfuJe9B9SIgW3p\nb0Hl20KXpPv9kntrUi/jTfcXtPSGYXiQVd4VgvFVTT0bc2lgQPeU6ohxaB4b\nRayD\r\n=38iW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"531edacd7feb2813e64fe4ff3ddd98d77b223897","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.20","@balena/jellyfish-environment":"^2.0.6","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.0.3","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.21-renovate-non-major-531edacd7feb2813e64fe4ff3ddd98d77b223897_1595408204535_0.9768217275341036","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.21-renovate-non-major-c4b9d88ac7aa37802213e8db8c4cf5032d74dc70":{"name":"@balena/jellyfish-metrics","version":"0.0.21-renovate-non-major-c4b9d88ac7aa37802213e8db8c4cf5032d74dc70","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.21-renovate-non-major-c4b9d88ac7aa37802213e8db8c4cf5032d74dc70","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"0bad8d988f689da62428d8b7abb5fde87e3eedbe","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.21-renovate-non-major-c4b9d88ac7aa37802213e8db8c4cf5032d74dc70.tgz","fileCount":15,"integrity":"sha512-rT80VzW2X/3/Iw6U37rgK+8WcxM+c6bUljJVhc7Phs5VhNzfSY+UJP4ZRjNsPPOnm5/XFBUemMmdb009AnaKcA==","signatures":[{"sig":"MEQCIBb6FYqXlw537lLpzNZiRKxXIasIG4n1Yr1UHQCZs7kgAiA9NGpLcpH8ueonS1YQukMT4mpY78Qk4+bzBEJqEcQgwA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":74066,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGXrECRA9TVsSAnZWagAAPuwP/1oBibF9tt7swbnxXvrO\nOEaXFkjXH0/bkSqeD6JSxbdkW9m01KX1KSysrdRDLuNs9RQNFddQ2PGYbXoi\nikH04IB1UU6/5oyxbdQymdEMsdyRU6ESWa0lZpDjcwgiUXdTPG0gWAbXu7VB\nkqWxoaQ/SCXyDDzMbtS13YagTl+nPHaFbRg4+1uEbQtSKYMUrboyW2RPIWhm\nJlPQNY+CN4kM6aQYmMNL1lPIe5KC6WBBItcPf9x4zv6ni934/14zYz/WY5Ni\npMzOLOlh5/YtcV4hy999ekyTlg09Mcm4YfAt0Es+fUOdGbYtwFcnD4d1BA8L\nm5rNT3WzD7GAKxAiBLjfoNJuHVqRcwsGtOMtpLnUXPW5D5s0WgGpLCq72/XQ\ncaNxrHoVA9Q3AwM2e+GbN5JrimD6lRxbgbkdEcV829oHeTQEMkQGLJ7luT0b\nQcLKOHiLZcpDXTgphPMKr+thKbV1g5w98lLf6BgRreitxdd2pWvtrJd0/mKN\ny6SkuVP2DU0kVWQ0X+/ORhtA5br914wytFna/cM6lM3eeHeTtOaJWxwgKRLz\nWpYtAbGtmfyHZYgaWnuA5dciaAsRpC8a2d1v1FVbdl9JphPSXe8rNgyo79SP\njdVhO6XMsexY1mh1q9uPosy/XihbFEqitRUKtfB8Hp6SblycBKvdCR7tjaJp\nDxLI\r\n=pfqh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"c4b9d88ac7aa37802213e8db8c4cf5032d74dc70","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.20","@balena/jellyfish-environment":"^2.0.7","@balena/node-metrics-gatherer":"^5.7.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.0.3","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.21-renovate-non-major-c4b9d88ac7aa37802213e8db8c4cf5032d74dc70_1595505348377_0.6663119149471977","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.21-renovate-non-major-02159b3fdddc0a21d7993b5a07a8a2171420d667":{"name":"@balena/jellyfish-metrics","version":"0.0.21-renovate-non-major-02159b3fdddc0a21d7993b5a07a8a2171420d667","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.21-renovate-non-major-02159b3fdddc0a21d7993b5a07a8a2171420d667","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"2a7396e472d87f2b07cdb14118410e8638c2865d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.21-renovate-non-major-02159b3fdddc0a21d7993b5a07a8a2171420d667.tgz","fileCount":15,"integrity":"sha512-stqyDsg1MxntcWS3HoNJOqGGTSXgs8qolqHD+5Gx/FQVqftKqTH4luVHISJdqJFfI+kbPdr9khQEkFolqpMLuw==","signatures":[{"sig":"MEUCIBVrZ9x7aw4FC18d3TRwnZlQL7WdUmlPTyYBUsqMO99EAiEAk3IcOno+slvCumkQ91CZbxCjd5zhxHaz8sWAjV4hiaU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":74025,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGodiCRA9TVsSAnZWagAAlbwP/3bHdleSPdd6rmrBQYwV\n4zzihAKIMlO96Tv2nDJgTNtXZT9YbIvz7yy8UGQBhAVWrlmYMLBtHUaUt2zZ\n3+EzDbZijA3/7AOEdpwp/LdnJV8E6izWdfsKtEAqjssgqQ5u8qWMfAid7zxW\nqx0OEUU/1bRt9CsEEjdX0sNB2xl/GP8/hv5+CMRioZqJRaVxwebXafNty+c+\naVYMzk6wqa0ulgDAjsXbXaw03X5+aRWPxnHjtyhVKXnuVNEUlKCj5/577km+\nLIS3oWydA948J1OzFF0ChYRoWF4VGlmLUe5Hhl+7+mpbkX/lJb37g6K8iCdI\nEAlGlpE6l8geqz5MDsEC1zhXF7yIYZroYd3XVMY7U3hQSClBOw+nxOQIzrdo\nHWer5QavD4lFBc+pyQ3xnb6L7iF1wcbKEObjz4BBB6exKDpGR8eQi7efJJZC\nmG/UGwQuUnOJA6erdjyL9vJJv049NkDLR6SwVEfKn2nl1yGmE8lwrFsjHt7B\nTSM1dLK7etMlvZt4IXv11aA79oJcbVCrlN33Js6YH88aVk9mrYFXd4Y5iNIK\n8dt8lUKn68W6UwuhGxncB5B4hQnDf5zIPVudbtYutIlxpEsSUv+5/UhI8AyF\nyh8kRN1ZALXVsqtXjzCddBOeO2OYY0DLpbNo7JZZkgVZk0cSQE43a+DVxBBe\nP6hO\r\n=S5mG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"02159b3fdddc0a21d7993b5a07a8a2171420d667","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.20","@balena/jellyfish-environment":"^2.0.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.0.3","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.21-renovate-non-major-02159b3fdddc0a21d7993b5a07a8a2171420d667_1595574113570_0.6078330350625352","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.21-renovate-non-major-71b404603a1b3393944e16bf38c8ff469f1003db":{"name":"@balena/jellyfish-metrics","version":"0.0.21-renovate-non-major-71b404603a1b3393944e16bf38c8ff469f1003db","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.21-renovate-non-major-71b404603a1b3393944e16bf38c8ff469f1003db","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"d67f3bfc6d34ce5c42caeb2a5d5b0d19b2f1cb81","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.21-renovate-non-major-71b404603a1b3393944e16bf38c8ff469f1003db.tgz","fileCount":15,"integrity":"sha512-cgXwQCbQAL6HPLIlW2DzW/5f2PV5qfSb8plYFwmo8NGTz3DRYD6wfrQuKc4xaQNJKXlHrH0ob9KmQRDA4KZBpg==","signatures":[{"sig":"MEQCIE6cwGbUMDBY7AsErohN+AU+qZSJj96JAf/ShLXKOBXfAiA4Sn/2Rmn/8iTG3ZR8eHMM9VTHBkgAsTmNylupuvZ32A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":74106,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGpysCRA9TVsSAnZWagAASkUQAJH1voqBtwz/fPwS+Pch\n2QI+W5iOfwM+Mbe7k9sgBsxz6gVGqv9PU6o23XTdF/t84iCaTz7FcQqxA/d3\nP+xog/v1anx8tStD/9ZyAdFAh8SiSfASYD+nQRfGU97ZkjCWeU3FI7MXgTdh\nw7/pmmweU6lq88dg5SlcQqQ8rUX0VsVwCEEyg6t5JGaLxCfeSvCPgVIf4FOD\ndVIoT5YUs1h5NUPi2IMld2l04sAVLQ0OnqGSSubwbjouXjh6nnXDklbkp1KF\nbbcBQLefVvhTz364+xvOHecmrss5/9mU9I1GWWi2zlRbRimQEZ0gLYee8CnC\n2KV63iDHrBUeGhAQKOmzg2fy2oNdqReJY/g7LWW+UxiX5oMpsrsi4OuZwK5q\n4Q3nEHQ8Z2tOpTyn/qLmvXh5CVvDtKJ1lUiOrGbjrQav354F2TqQMMd/yyUd\nTpZpAq7GErsyWBtzC85GsPOjf4XRMOXbsLPSsyk8sCqWLiaHv5NFigysrDUL\nwB6WtTZgfYpizBn70cX7RzE//yOgrw/MasQS2S5w/jXQIDCI0Ooj7dZfTvY4\nFXKWJMCvDJRHh+qoua4VID+3YKyBPhtYXcJEAhX1FHqxSNuhb5F2Us/ivOSi\nEW9RXVNWIajZ9N0Uq91mw5tHt96zaiXv6/tCAZMWotTskzDYuK0WlBsLG+/0\nY+dR\r\n=HKlc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"71b404603a1b3393944e16bf38c8ff469f1003db","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.20","@balena/jellyfish-environment":"^2.0.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.0.3","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.21-renovate-non-major-71b404603a1b3393944e16bf38c8ff469f1003db_1595579563951_0.1101185871967536","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.21-renovate-non-major-8f077669b49760cccc7e7dee0fd682c638671b86":{"name":"@balena/jellyfish-metrics","version":"0.0.21-renovate-non-major-8f077669b49760cccc7e7dee0fd682c638671b86","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.21-renovate-non-major-8f077669b49760cccc7e7dee0fd682c638671b86","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"0737adf314905250ff8cef825556edb0899e7cf6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.21-renovate-non-major-8f077669b49760cccc7e7dee0fd682c638671b86.tgz","fileCount":15,"integrity":"sha512-M1IDZp7pjOpEGo6LP+V7z/plq9qnguIW8BM8tvejxL1dP3VgakNECCYFKmHrwu1auH7ZIx7JhXrstTumnpKuZg==","signatures":[{"sig":"MEYCIQDUBNU8gjPlgYnmkzEUMtaaYBL/rWHPl6LCJHV7MkARWAIhAMDRAotO+Ak+z72fSWVfODdc58qu/i3MzWzPUqVUIxhp","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":74106,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfG4+GCRA9TVsSAnZWagAA+YUP/1skLMjEie+NvEdcMOe2\njgl+lq3rYIzXE2JdGTybZPZ37o0qfmo0J8eXbACl37lA9FCf9UBk+TvrZ1nz\n/T4yo3l87GT7LoDVRhfa2xv0eMJTQxNmMWYvkzfd5tI62HcZYH9H70+04ZoB\nQJfswBtquWwRhDZFG4R0hW4ADL7TUtP6DsQGelKFsuhzjd3ttfTdx96+MM3q\njtaB72B2vkxmJtx75fV0tiCXRI4Y4oKxJv7Pwf+fTL58ntLQ8Wv3Z0IZV063\nSs+PKWLc9GI/VpoXmORESmr5xrQ0FF6rGFleh1KyWO5NozBF0PYZ4QWvbqAA\nOLrhr9ISrwA5k5nfWIEcul9jqyaZqcpWGl/JktIVm3eYJsw0HvDaH3xZ2B/H\nTWE+5QubuDh81uAl4XOrX93+VsNy//2LVJa+n4aACmGG4YuLLr/5LOYZNBWI\n3CiNsm89E/4moC+JufhdpKJjxPsJAxAfDv050AvTvEW7D1Pjl5jMc0euQY1i\nv7WShdWvG06j7j7sfkT/oV/anEMiZhxWZ61jjI0MOQZ926Ehw95DWzVqPET7\nr9qWxkzYuH+YNgMHjg4fUU1WY/VtGsokNBfLPEqFi54WONgDpN2NUSyb6nEA\npayUbmQ087loPcSqzRvX+0CAEGxwjPrqqG7SWA08UGSawwU4Y8bR2hDjgLqN\nOzQa\r\n=Y9rj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"8f077669b49760cccc7e7dee0fd682c638671b86","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.20","@balena/jellyfish-environment":"^2.0.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.10.1","dotenv":"^8.2.0","eslint":"^7.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.0.3","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.21-renovate-non-major-8f077669b49760cccc7e7dee0fd682c638671b86_1595641733665_0.42950018040646376","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.21-renovate-non-major-b41db3e4562443318b47e090307f28cdd5e0bdfc":{"name":"@balena/jellyfish-metrics","version":"0.0.21-renovate-non-major-b41db3e4562443318b47e090307f28cdd5e0bdfc","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.21-renovate-non-major-b41db3e4562443318b47e090307f28cdd5e0bdfc","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"5cab19fd7a31950a2f7f0720b206912b068367b1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.21-renovate-non-major-b41db3e4562443318b47e090307f28cdd5e0bdfc.tgz","fileCount":15,"integrity":"sha512-Nw5zXSgKqiceJKSBLWzosofVj0kyk7ej3EKugjACtN4GNT7hlt2XtRB7tfgzRYCBaT2No5usGXCOhFB4WlP12Q==","signatures":[{"sig":"MEQCIGTwQ0uN4hU8WmVR6g1LcCC0EQSb0wnFIHxhG7CZyTLXAiBdT65igOk0lUzsxOE2Sysdu72Yla7iRJuFXB1jA9eYmQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":74162,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfHuzQCRA9TVsSAnZWagAA3hEP/3HWBO8S7+0QEaP5sz9q\nP9BTTooz/fjsXP2hlDFRYPQZZOMG/rAruQNezf2+z5LTsRRE8LFsWvniDI1P\nEOv/8vn8W2QZ8Uhhppvctg8R+VzQIMAkXPcGBF1johN/WyY8ZQx1pDb4DYRX\n8UVhubSn5QPNCN4OSQVpGr/UTKf1tWJ8vWWmznTP6LGw86JUS5Yqr1x6DQko\nnfLby+x7Pg+i4J6EHjQ4l1XG8N9n8vm/zeaz0QHskiRVnOpvo+5eM5H4UgT8\njwYJ1AZgvRn2v0pvBdLFFHGASHVEkoKaE2ttVH7FCaYcQbnZuFENaI1lS8iS\nQpAmT+bZeUyOGYkaLQt1lBdAT5fkJZw2O7ZIPtJ5YXA+hprgnFhOPKksaaWU\nE1I2RHyywaK35dUEVeh634PY5gr0dOml9lyWHeiZIL7qxyx0VlfFWHHbLD1O\nsUlGO38U2ZppxLJiZh/RRztIb75Nk93CXSD40Kka08zIB14gcAuBQ1H27vRx\nif+otGbax3IxRXy5LT3OyjTTxSOSGEtAPYW54IPwnEO0hLNrpzUGapE9WPLg\ngLLnPjUIsPht+XZvnbPw3VCOrITJvKBon1CKIsQeEEzBI742C4/u18DmCGTc\niBP4ZlfCjkynKoVauTRctHWD8vVeR44+CJ+lketACmlbRvb8Nf+QIgcEUxTK\n69Ip\r\n=+W1I\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"b41db3e4562443318b47e090307f28cdd5e0bdfc","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.20","@balena/jellyfish-environment":"^2.0.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.0","dotenv":"^8.2.0","eslint":"^7.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.0.3","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.21-renovate-non-major-b41db3e4562443318b47e090307f28cdd5e0bdfc_1595862224274_0.856482759139922","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.21-Add-a-colon-to-renovate-patch-commit-prefix-ecb7a56f291ccece923f71542247542d0b008e4b":{"name":"@balena/jellyfish-metrics","version":"0.0.21-Add-a-colon-to-renovate-patch-commit-prefix-ecb7a56f291ccece923f71542247542d0b008e4b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.21-Add-a-colon-to-renovate-patch-commit-prefix-ecb7a56f291ccece923f71542247542d0b008e4b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"7e6d0d7f947d6d959a9b6baea022b0370cdba441","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.21-Add-a-colon-to-renovate-patch-commit-prefix-ecb7a56f291ccece923f71542247542d0b008e4b.tgz","fileCount":15,"integrity":"sha512-qVCq0etFl/P946LqTSh1K3IDJo7mHKnRI8m00kSpiNzHyetfj7LIxI8fWFROsQzt3MTFyvct0RGc/mHefMlCkw==","signatures":[{"sig":"MEUCIQDtTTTIEufCO8+AsNGqsNXkAAfy6+hOhqR2pCjo9je2EAIgV7EAFRaXJe5FxiqEu1GBK2Ye0rBsoaao/zhmip/uPs0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":74245,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfILaPCRA9TVsSAnZWagAAXWcP/irkBke8HSmbhKIeK550\n5gNfjQoJVd1S9BXCCNnI0seoIbpt05AHMYCD5yDHwy+ITfyJd3HB/BqKvN/r\n8GBBM8n+Kk5BvGTa4z+8a7rni8TVNXJpq+ZJW7iFErXdux1c/ZFwRQrSX2Zx\n6DhsCadCylz3H4+AqN84LfgX6ZJVNBMNz9YyCtLHhvbRl0qm+my8uSdzOOSN\nOeTRCgvADXim8UeWi4xJThIujBik9O8wfbEUnRqXpSeOFeGXWESObdsv2e1+\nF6QdIZcDp+og77b4DGKtBKEZWFaQjBTL9Bk485J0hG9Qv5fCkZBZ4fU1Qdlx\nOPKiNwAMisH0QY0psi/zIFJToBd1XpxHJLPTwacUOaIqg+doSaxp4NXEHhtK\ncbaWQWccoceRxKASrQaOtIV9pFwcCLDlAJh9niJOHJ0Q2GSD/o7Y4AVinlzR\nuxXYVzSCpJYmdYhxJGqj5vgBPXJdiijiSCYTGseaOWReRpszduXwK7sBCllT\nYy9HTQQLbRA7bERjq3P33cfCs7chIbge6TTi1pZGx6hc4kLV5MbPQmNVJl7j\nad5UJfLY9aU82IBBFHYIYE+NF9B9t5XQSJp7bW282VbB6flgOFXV/kAXD3Py\n+mc2BLEnJtL6lGFRVwfB7tVeIcj0w4hOioze/5qBd/GHX5mkq51x5/9FcN+v\nZigQ\r\n=NiWu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"ecb7a56f291ccece923f71542247542d0b008e4b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.20","@balena/jellyfish-environment":"^2.0.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.0","dotenv":"^8.2.0","eslint":"^7.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.0.3","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.21-Add-a-colon-to-renovate-patch-commit-prefix-ecb7a56f291ccece923f71542247542d0b008e4b_1595979405932_0.496456627309213","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.21":{"name":"@balena/jellyfish-metrics","version":"0.0.21","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.21","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"7545f8896c229fd621129e5221d5fe4448a0e9dc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.21.tgz","fileCount":15,"integrity":"sha512-wPe25K7DYnLpJVn6U1qFCD0ZIdy5ihCg+bDN2UfqsHB/Im84kKRo/3NDfxJrDg5M1HZ4O6ALp919wfQe9yz8jw==","signatures":[{"sig":"MEYCIQCRe81LbcgAXiFQinHWmXyGpUzEFgi2ecdBJmdiH0yfTwIhAK/CP0S18pLCxptapvc+CR0ZvRatXx1uvzepVliqr5fC","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":74160,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfILeUCRA9TVsSAnZWagAATzYP/3tSJXQp+fCNYjxh3uaB\noCjSGkV5h2AqPpLqs6g7bnWefHOfPdws83U1r2O71C5LXjWgnhfUw918ztpM\n3vn6pn+iFMHCRmuPzb4p1tKHaMPwv/bDEYNEdDl8EX5GAdYd4EJt0XjzQTO8\nek1E1JzUuUh3gd4+3OYEpginBq43VOge/PekyTf5n1u0z6wCj8NyJIsvNIFM\nnhlolkPAhntULg0BnATNPmzZ4LXrm6EvLcMkKccj2xounbWsCihBpcY/oe7A\na5FPdIzV083YyMcr2wZmTn4xVKF8gMsf0wDxqY3rxEalngaW+BNAvljfcxOG\nqp8TccOZIYRyWQrPcR1OUKbvmDmJ1fieQMEGqYKddAcD23BwlxkuCVwGa9bM\nwE8qPAWxC5ZhXYFtpU1uUBW29j0qsssSXyuKTv6TQeSP0IGenex1kTZyXWxr\nxTnAkyDglp3RPz4s4N/QrKCQ4MuZGfhkkok3mGgYQu0lh+V4wxgZO+Te/htb\nlGEbtgr6SbTp2jEeJM7F0pGcvkLfHVFfMRGdBwJHsh+/d+GM4Fl6opFxQDbX\nd/Q/2N1qZJFMIUU30A3FA0Ysitpl4lVMgstIZWzOHdFK3Ltu6D+MuuPJxdLe\niipNm7d5WlEdKhlbgQYBX1bKK6TfWCwW1a25Kmc0Vw7BkX+yDNTLRSTu2WFl\nIXHr\r\n=rSYc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"b1d34fca9a3a659278698e116c1494139c8edc80","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.20","@balena/jellyfish-environment":"^2.0.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.11.0","dotenv":"^8.2.0","eslint":"^7.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.0.3","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.21_1595979668066_0.750430035236108","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.22-renovate-non-major-b2eb253c96c8270ad98c55b789df31b6c732443f":{"name":"@balena/jellyfish-metrics","version":"0.0.22-renovate-non-major-b2eb253c96c8270ad98c55b789df31b6c732443f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.22-renovate-non-major-b2eb253c96c8270ad98c55b789df31b6c732443f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"dist":{"shasum":"b670e8f9ef0693dcb2f0364fb812c04a75419972","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.22-renovate-non-major-b2eb253c96c8270ad98c55b789df31b6c732443f.tgz","fileCount":15,"integrity":"sha512-pTIK5lqxa2fvs1QPUoGUoz5KlbhqE0EIb4UAAkLqwOue2upQT4dqAH3vRJ2LBqsUtEDOOXKSEIqfvr/hTwnJZA==","signatures":[{"sig":"MEYCIQCiQIDwUIKVnGIYa4FSJy5GYZV8zrDeDPGV4CRwhafjnQIhAPF64ZnqCqXf+97DcNzOizSSIK9oAP9YarOqCvr8YH21","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":74289,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfILiUCRA9TVsSAnZWagAAuYQP/ilyukQv7TtebOZvpNAR\nHHEQM+9qys21sg/9QWG+ifP2kC4LQrGUb/Qn4VXHzEf4ABFuMqFS3j0IMdc4\nmMUjuYdrYz0WnaXFFJQXPDoEg2OqD5uOM/IriU88Vc2jycySGZSi3Z5Yod0u\npBtXuv9wWOQxSjP0KgSVk5xe7WLnBK6xasfgv+6nVHK+wdZBR8srKd9eVi+Q\n6pFrH3ya2R5UYLYFhj0LPUiELLCfdc0d1n8PJYl05lS72/3u+tBKakIaxQh2\n0yVrwEb5q1n6Yyn98/4yO5czBGP9vgaMRqP5bVAWIVoUk1I1zFbjgDbKp8aU\nQg0z79VGCjMME1CrjQqt9p3J9vDiz6qFGqQ6r804zdhg4FPZxHnYUNOA8AWv\nfGVHcxGtAnAMbaIdrKxGf8LyIlbBo5oD0N5BicHRGTWPwPYYeucwqsH7cJWY\nLT5/0fop09JiZ/oXgCkN5zU9Q8BeMNYcGfHq5B5s1uRT2JReosq7gkC1EC7I\n2Dig93S0hjj5K5+GG9S2dntdXH3DIdThBzZ0ftrtK1sCHEadhnIFOkbQHB7F\n6oXty9W47pt+HbCZN8ZwtXaKUWpsJ/u979wYVqE5cdR+Nmn/v94l2xfukkjt\n3ko2Q7nAfFlf4ty/fUygRQvV5Hxcen/za9WDcjXdbICzeQROpIMq/oHAqCpx\nxKEG\r\n=31e5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"b2eb253c96c8270ad98c55b789df31b6c732443f","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.21","@balena/jellyfish-environment":"^2.0.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.0","dotenv":"^8.2.0","eslint":"^7.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.0.3","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.22-renovate-non-major-b2eb253c96c8270ad98c55b789df31b6c732443f_1595979923669_0.5635441689740912","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.22-add-repository-details-0f16f4e08095ce080f171379abbf3ac104f3e72d":{"name":"@balena/jellyfish-metrics","version":"0.0.22-add-repository-details-0f16f4e08095ce080f171379abbf3ac104f3e72d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.22-add-repository-details-0f16f4e08095ce080f171379abbf3ac104f3e72d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8330fb283dc4e398eca19ba5ee15bf891d1253a5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.22-add-repository-details-0f16f4e08095ce080f171379abbf3ac104f3e72d.tgz","fileCount":15,"integrity":"sha512-b7plEZo8APBbv++ZJEtwyQzrHmBuoLWjBUWjzFpe2HGRatWRvCtOHCiNwVnCEn/dA/chiwUguIcQ7VTXYwz7Zg==","signatures":[{"sig":"MEUCIQCmCTZAcBUQZWXX/7hLrpuUDlkzChsi6+2nbpAv4L172gIgTQQ8WZdpSfrdbFZvxnt7TfQFQSzEiHNeszlsLVayPQE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":74456,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfINkkCRA9TVsSAnZWagAAcA0P/A1rqNb9ijK+XzpvUI6S\nV/CIDxvCoh5QvThPiTzJ2JEhUf+Mv1JAbWPa8GIYkZ5ANzmtX5RrmKQaqDbS\nbLSfbEYE0Ef0Bt9WHhkVIyaj5tgfiWSoRySYwIAEWvTNhtREabqcIhDg6N2q\nBrVffAUwckEYq8jUH1IBJJ2emCsR3h+m1GqJpJALPpOCJ3sjyKHWoLSoHxY5\ncM9qDlylQaYTOIMhqJuAYFP8BhFH3hkHNioyX0rtU/NlQ7v73YIglxIL9RB8\n6vQ8dGJ2NDdGPRoT1MH3EuMNE9CCVqL7EzxiQlUyh9RnPhV3frU8dcnHctu0\nx2CL+h7XZ1brET4Hvs91h382hBF0R/7zC1l74KqyuZuyHRpl2qnSsdkXUied\nd9Qmmg8raqCfAuWpxwbHtUH47FGRa7APl0mqQEBmKS6QDHBef+CLoOBU1NLO\nzLaGGscMqYejKNeY3o9fqmATkuD5qgIicVZftE7yeyl3LOO6XYhjogftraWF\naW5cjjIkoFAGYgaJNPNbshhpfv6zP4MCTajkbwCOX/U/luQmnJkGb5jchjv9\nq9NCRsJMJ3zishbKJNIALbIhQrrqu3zSTaho4eVjavs7HsNeYuq3fBe8cxPn\nx5RXlIsXE39Rn0eol1OBmVKzYre7mDA8gZLVqNIEnke8M9FG/uWtQLoFuuBr\nV/9F\r\n=r4Lr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"0f16f4e08095ce080f171379abbf3ac104f3e72d","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.21","@balena/jellyfish-environment":"^2.0.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.0","dotenv":"^8.2.0","eslint":"^7.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.0.3","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.22-add-repository-details-0f16f4e08095ce080f171379abbf3ac104f3e72d_1595988260257_0.8866102115274441","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.22":{"name":"@balena/jellyfish-metrics","version":"0.0.22","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.22","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f51ebaaac01f6e8c21b388253c9b17ce2080c7ce","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.22.tgz","fileCount":15,"integrity":"sha512-7nsxmCVVCeGw4nO4mIGTkgFzpSJ3l+dxVCtpyihDoyJcWLo7Ll3MjJXCU6fjHWKdFoKB7zb10S5mp1EsYpF43A==","signatures":[{"sig":"MEUCIQCVWFHTAhcLN0SA1gLotYIOrsgxWMvrnEdbcaXuSf8p+QIgd0I0f4JTpsIZswxoFXySH9/rLvF7l8k3K/Ggen3Kn04=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":74392,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfINnsCRA9TVsSAnZWagAA4HgP/jMWyrKAze5jJS1MC1Tl\nUQWOgNzBRbW92HhoQY1vVIerQay6Dc0a767qYOL+sqh5THt93isj+5VeBHxm\nhoQ9GANU8lxdGvljwqtsKZhN6h8c9SszK7xDY1WXLUm1d5not7RhB66D0Uwm\n6A6XICFDxlr535C/H15eqPJxQfAQ70FWDXVSaG2m7e4fjLWY4X3K9lJdx9tf\nSziYdr+iB9iwHbtLZAzfhee02lfm822e/eZ/OmcnyMYGye6ouq58kizt+AQX\ncMQVY5F5T3j53OJ4MaAAk3YZEMJbbFO9SR6ByfVL5Pmy0QcA8nr5v5mlWFka\ntN8+qwQt598Dr8uhxK/4NxoR8Ns5+aqJFODkI275TOTSDEW7yG0VNdNN178y\n3oKHFhv+bpPLFRcBrgkAl75cr1sOoI1XnNNU8w3f5SwRTccTbR7lSq6kY6WU\nWey2NaHeEOfAopHI8L+WNEh82njh3dtLScFsMHU4vb0KipvlpIlJq9Oye1tr\nusCez/oB6/PB0KLiXSSqRR2DLpsM1RE7jbTUSkhOH/76zqQcQBZE6O85tUxP\n0mnCxzuhD36kDkiGhw1A3gpcnDCV6ONqYkUYSk8vW/FYEF9H07l5cl0Ww0xg\n+vkeetMKNAbhnA3dmggg9n1ciDG/al63hisub9mB75ZvOOH31VrHTOqmPKhf\nhSgz\r\n=AA2d\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"b9a59700a3c278416c45ed318d8e95a4605c66a0","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.21","@balena/jellyfish-environment":"^2.0.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.11.0","dotenv":"^8.2.0","eslint":"^7.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.0.3","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.22_1595988459822_0.2909624182343751","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.23-renovate-non-major-5da684ab6bf8c350779003775793dd16e831963e":{"name":"@balena/jellyfish-metrics","version":"0.0.23-renovate-non-major-5da684ab6bf8c350779003775793dd16e831963e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.23-renovate-non-major-5da684ab6bf8c350779003775793dd16e831963e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"038e1a6f358aa86e5a447996e46f704151996cc7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.23-renovate-non-major-5da684ab6bf8c350779003775793dd16e831963e.tgz","fileCount":15,"integrity":"sha512-p2WzEpk2q+X97BVdJWz8SFniMe40ngR3RoSkuT77r3eB6PHZZlhcOr1j+NVueJate6qlx4RGCa52IGNpwW5m3Q==","signatures":[{"sig":"MEUCIQDFAycqJPnHVpxsMcOnrzF3+/QuT5h85oAr2nNqG0DyawIgP9K2wuWeS9yVf08YhhrqeFZ/XvayHH/AhiXhtMIpHhE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":74558,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIPVxCRA9TVsSAnZWagAAkE4P/1nqpEgdxur+XEzjZ9fi\nxcuQNtz14OysDn4dPoW1Y2IZxt7/TDsLM5nXmqZ+jmXmlEGg5GTu7IGjSyJK\nl+CJMogV6IhtmYhoa9T4DJg8jct4yduN4TVSt70C9DUO7xXYFOpsBHeVz3GO\nfR/TyRHFzXGuTm9GArjAD6L3LC6ZAy7TwywZpZZkA5CFff3LmxhgfN9jg8Jh\nVtM8FyBgf9gnG1dsAeLtP4i/ZUNuaC+PWgcYQZJdnYMibJSKuxyFqmWkLQqf\nuUSx7Otz9q1Uy+T+VP9XWo2SeFtHD/vhG0Stn88jd3YiLwp1SchMduj9SfRL\nxr7yZghHDZtHaPjTnp5V0v/viMOwGDfgUvAU2MalSqikurgsrAYw9LsicZzN\nfwkEWHljLrGeWR5hDLBdzhyanOG5/xdgpxAJwPya6WuLrmtOQql7pF9iLVD7\nf2YcwsGI4Yx0YqRrowoynHEp6WOEaWQfPluzRcJumRlGLkt55JCf1wCd+IZW\nbDuPN0dr5GechtvZE7ABm7mUbiW8iI8aJHaMfTOvp4PfauWYysU0J9Bqp5WU\nNrYD0BRT4hJMeiuOwz3ug5GZH/ujLjE66muhgYkoN3cTrwfGL4QKzzygRR4+\nvAj+A1av5d/EVn/93J0ajGGOQq1NVLupIlwc33M+v3LOBNgp641fPKBr3eQ9\nPd7Z\r\n=u9mg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"5da684ab6bf8c350779003775793dd16e831963e","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.22","@balena/jellyfish-environment":"^2.0.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.0","dotenv":"^8.2.0","eslint":"^7.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.0.3","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.23-renovate-non-major-5da684ab6bf8c350779003775793dd16e831963e_1595995504759_0.1896014979044096","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.23-renovate-non-major-225a83b8fb490a6052ecc22205e407376c833a8e":{"name":"@balena/jellyfish-metrics","version":"0.0.23-renovate-non-major-225a83b8fb490a6052ecc22205e407376c833a8e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.23-renovate-non-major-225a83b8fb490a6052ecc22205e407376c833a8e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8ef0ed2264c90370f7a134ff1b6918025bb3f0b4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.23-renovate-non-major-225a83b8fb490a6052ecc22205e407376c833a8e.tgz","fileCount":15,"integrity":"sha512-vlTM6BJl8oHRkt8GRUzcnxJ1u/zd1+h5yjXvv1oC0U+MaRZcq+xPBKJwo+6E171BG1MFI70cVHB+LDVq666c2g==","signatures":[{"sig":"MEQCHyDG019t6QbgUgQDoMdXa+ZdoGeRcW2fu96ldrH8UDQCIQDc/7BmuruC/5VfEuCJdNHHeSCUp/UeJHzhXI0vwQsKYw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":74636,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIjCGCRA9TVsSAnZWagAAIV4P/2ScDs0JMPh4XPj8Xe1n\n1HTHqiJvDfyuJc7mds2719dM6NyeclWCiuxuapAVOhy8XA3zhfsjLa1pm/1S\n00/d5Ej3HAGZ33N8nN5I3J9kB0ZjV6vDX79mUnOc6v8j33O2pAYWUgU8Fq5w\nyIjdHfsK/9baI9buCPsDfasBTklStevejw7ntcsl/L3nywYoMI+ItuypXwpb\nzaf8LqbV2ECwpHJPy8f+pXrJUnRVkyaA+cKwUUPakonghMjp5DOUjDqVSdun\nwyA3j51u2nHEls7nxlimEbtzJ4zXFxuq8SuM2NYQiiYeAaDossp3w4MFp0KV\nnc0nOiNZ/iSHYls9/oAF+VjW9SEGqikyTpNm0ST6ZPzGfM9zXF9Oc9ol3dYV\nzEm9KWl4q4It0lDQGgzTuHJwOYYWU9d/l/9Y5BMYMgp3BSqJq2xU6QU8GnSM\n402juxxHdjO1A2GpNLXbyQBo4vDzmf+DBhMrrvfTkox4z5vyct9X5/PABNVL\nuWgdueu3vUiV5401d2qedoSvkP8ThkzC+cUsFZyPMaRtKr8MwJkyXY0SbtvX\nbBERgwUXpD4MbIBARgQSesMP/kaQjGwcCmHs9q/xTdaEoM4p4UlhF/d/1tRk\nls0QLrgxcaMLfERbIs9CAYqFIH49LPe3kAK1WUJ99VXbmhkfrIThJR0Zh3Pd\n1RXV\r\n=Zjqc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"225a83b8fb490a6052ecc22205e407376c833a8e","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"0.0.23","@balena/jellyfish-environment":"^2.0.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.0","dotenv":"^8.2.0","eslint":"^7.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.0.3","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.23-renovate-non-major-225a83b8fb490a6052ecc22205e407376c833a8e_1596076165572_0.7462505231921","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.23-unpin-dependencies-87802c014c0865c5db60850c4175b281dd8689a6":{"name":"@balena/jellyfish-metrics","version":"0.0.23-unpin-dependencies-87802c014c0865c5db60850c4175b281dd8689a6","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.23-unpin-dependencies-87802c014c0865c5db60850c4175b281dd8689a6","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"16b5c8ac147016d90cc733f8566c7f0d5435eda0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.23-unpin-dependencies-87802c014c0865c5db60850c4175b281dd8689a6.tgz","fileCount":15,"integrity":"sha512-P1abqwG1TrOnUzcqmjCJ+h3KnDmO4YTyqve8p2o4DdkgVCUrjhnt12CwTDsUYcTEaOG2WL4YF5Wx496ta37RmQ==","signatures":[{"sig":"MEQCICdBWE+1p94o6dwJ5u9faXbBFnAhlLzaeWnZBOA/ThbjAiBs7ZJTfO+oa/ggZcpo8VC6+bjhrVfO6qVPD0Mtj2LzSg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":74595,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIlFyCRA9TVsSAnZWagAALUMP/idJ9/opot3wmbYqn63w\nRNo8W5JLPsH35L41/moI6zGjBJAkfBXN4znchUd8dafPFDhANjD3lM0x0JDC\ntpM0ubi4Iv7sn2MlJMsyOyRZAO82jseQHNPD6CrSBEH8LunKPsOS5XiFtix5\nWkD7Irt5pU6u1UYFgYd3qUwVQTawDKK3fTzpStpV5/Z6N3ufn/jUjN9P5oFj\nYmxmndivYj5g+c0NgIzLCv611tI/e9+ZgKriQR9B0h+1QCpHXXPWKqtHitmX\nFHmzO8V4cYReGRNxrqPxL98xEMJIw6YxT96bQZqdgOFcuVvQOJtFeW/9rAqB\n2feN5LjuYaLYauK9Lds/ST0fh2hJT7LKDvPHuWF7tw96bx3sHgN9vBeOWpO0\nA2873e2k/h3ELDYb4die8qDhkARg+SeqpZwjG1N6YaEO7fYnk/RDpm32GCXb\nPiVCNGZT4J+7Q9og5GD3lcn6jkdT5YyBp4QiD3y4OG0WyrqrXhvxIOv3y8md\nJJQleQ8v5y5lCG4cSkbfn5sP95iDzUNqv7tYT/gzQLvhmk1mzLCZTm4lfe+k\n3ENOXv517tQvjvBUKldzdiM4jJlqtNQ2dAHKpwgT5P8LT78OB8JvrOK7jVhM\ntrw9FMRSLiAe2K79oNygXack+Tr/BBWamklenLdomLQxmOzFvIxMyZMvzN6j\nxrjy\r\n=ddvl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"87802c014c0865c5db60850c4175b281dd8689a6","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.22","@balena/jellyfish-environment":"^2.0.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.0","dotenv":"^8.2.0","eslint":"^7.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.0.3","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.23-unpin-dependencies-87802c014c0865c5db60850c4175b281dd8689a6_1596084594395_0.5637007299993821","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.23":{"name":"@balena/jellyfish-metrics","version":"0.0.23","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.23","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"aea5deb6697ee0a1b60983de839a4903be3a2b8b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.23.tgz","fileCount":15,"integrity":"sha512-QzOEVhhl9Fl7DvuniYe2bYuTXP4q9/9j+Udr2mIdY8d0KrSxqOS539WWTgbNxpF9nCbt81Fr3cjRbt5rXnFzEQ==","signatures":[{"sig":"MEUCIQDi7b0ntKkq5qxuQNz9va0PFPeOyyKGidBb+dWn26j28AIgKKqPxdaJ+h29k6Zz49z7unst1EaCrPJIWXZrW6s2eqo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":74535,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIlJFCRA9TVsSAnZWagAAvfAP/R7COPtNyuxcnzbRILwQ\nbWTXdcb0stwVbrXV86jbiVLyx4kydaNlxrnQ90ecMbOil25KvsgJ3dw9yVUu\ngfVkA3qI71XQP5rlEUsDGT7cEZAS8VxD45wjSiDS6EFnLg6lR3ioZw7Sld3i\nd9DtlXXDSqPjdb/RHdFeqKvWjjFNfZTGh4YpBvw9D5XCkQ6GSBzbLxbKCqyU\nsgk94VY3LQ8nSa2vegrRcNkwnDKiw+M3ObKO8uLmLjB8zcyKbtyoSNF/qaqk\nzSuRI72PTZ63SuT1LvmUf7qvAIZBid8fxUJvIvJypVPkelpTAjKBbQCoUdrg\nvEqc8BOlEqCP0hdra0W0Ci0BOcGfNRRlMlWJbuOW4tUUgpi1tT2hnVU1dtbb\nWnMrSZ5y9w9YgiupFYMsurdB6WoiUjsd13OYO5h7BFrYB92ZETM2BprddlgS\nHEpfKr0hlDoM6Y91uoBU2yTDNaroyCn0T2MPIWkMjqkv6RO3Y08AgFxQhikA\n68wqGbijUJ6c06eFGHxMuqJvVjWT0ELzCDw9pulvdiX+AhosWSPfn46ULfTd\nvueJlHL/LyYfI4WbdwwGMV3EVt41d6aHZirQPtC8A3LuseW0pjZEqtlHJdtx\nb8QU7fEVuC/lUOdGpK9q6R9X8N57KJzriErs+wFkGXFJH0oLEvCCKcixJXFj\nyzGq\r\n=Hx/u\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"d33634bf8acbf273abbed7f5235fd927a5d58fd7","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.22","@balena/jellyfish-environment":"^2.0.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.11.0","dotenv":"^8.2.0","eslint":"^7.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.0.3","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.23_1596084805335_0.7789544839501421","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.24-renovate-non-major-ec2d56c80c45493279ffa775bfc0cfbc1217db81":{"name":"@balena/jellyfish-metrics","version":"0.0.24-renovate-non-major-ec2d56c80c45493279ffa775bfc0cfbc1217db81","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.24-renovate-non-major-ec2d56c80c45493279ffa775bfc0cfbc1217db81","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5f65fcaad3d7f816a2b7983a25d0ac95dfa4d0a1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.24-renovate-non-major-ec2d56c80c45493279ffa775bfc0cfbc1217db81.tgz","fileCount":15,"integrity":"sha512-7Ja6rjxZlfn9bVDLN2b74HT1dKusiyRdMfMCBq2EjRrohGuJu1jVvvhT09icHqJnX9aRJ41qdVe9cQBu8QQosw==","signatures":[{"sig":"MEUCIHaocG0/ccl6Vy3BlX2CsIinisZ/aEK5Cza8hupSqlN1AiEAzs5JeQMylNLXG3n3sWOQzo+SDzgRNqJaXnoD7P40Ksk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":74701,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIlLaCRA9TVsSAnZWagAAiKQP/3+9jkM3zL1P1GwHfA3N\n0j1wm3V/YpaIUNo8hpdPYEd/3PBEYnmvOo0i6D04cCwb4fGSZJ0hkEhKcEet\nFgc41eBwjckz1PgsTQf5tLg1EDP4fXtTVEYFFS0bYNF8pbu9IWjt0KaJ+2S7\nzPiQdFey70kzcreYrhcYVtVn/YkVudnSBZnB5KGA1NACjbdn0PT7dxVI4N+v\ny2d55nbWJaMEqlWpH2GBOAJue5ynpeXYk2bB3SYNVtidedYCAWIhQX5/2akX\nt7mtNGeDlS8Nsv7RM15hJWavh3HXUGzaAjFcrjh0jT6dIVzTVEnJmm1ixuG8\nE97ACFC456ldFaqakqxxEVNqiAq5pWygnIijryB1V0F2w5c6jwRBIpnAotE1\nMkd2mYIYDX+a8rfJZAhYe0/wO883JXkpZ//nvsMo+zqwLAEt8nC31reNuKk0\nf6m6oeF+vo7E/rEFl1kAhjkwmfpncGLnrhSF3XE/wzCkkMfDlhXJsaWp1Kq6\n4idCrHCMFI/klLW63MDqCoDTJp9oOw9ezS03bVGDnUmBca2fhJd7aHf2pcts\nyAgYDpxOeUA8//oSIVF2aMI40AuHHU45Qr4cc0dz8ALo64/PNmdFqUUddfVH\nYJbSRM6GeSxbb0Iqem8PgzLdWYALhrf+ivWJC8BBcjsv131Aj3UcggZHgJCW\n6W+3\r\n=G1rI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"ec2d56c80c45493279ffa775bfc0cfbc1217db81","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.23","@balena/jellyfish-environment":"^2.0.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.0","dotenv":"^8.2.0","eslint":"^7.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.0.3","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.24-renovate-non-major-ec2d56c80c45493279ffa775bfc0cfbc1217db81_1596084954483_0.1696846115039632","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.24-renovate-non-major-7dc757e94d2bc41f1e3184cef21690ae8f0cc42a":{"name":"@balena/jellyfish-metrics","version":"0.0.24-renovate-non-major-7dc757e94d2bc41f1e3184cef21690ae8f0cc42a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.24-renovate-non-major-7dc757e94d2bc41f1e3184cef21690ae8f0cc42a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"58a28ef152f69d1f9271167c204a7b3c95ba3aab","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.24-renovate-non-major-7dc757e94d2bc41f1e3184cef21690ae8f0cc42a.tgz","fileCount":15,"integrity":"sha512-fGShqw1d/BublSWLIA2tdxLxdSs0+ngm98bg7qf3zEW/kXgsUJ8F43c4wBgOeXODVQJCU/SzBzH5c/nYxG4ovA==","signatures":[{"sig":"MEQCIDrBGUStYvsIS1/g9L3I+nOCfVmHR2iO9LmdUnBq9EekAiBJrBB0VvjxMYgzFpW22r7UZ/WoqZlbZnhw4jY8pDX9ww==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":74774,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfI48BCRA9TVsSAnZWagAAmu8P/3eCxkL/+p+xZ4p9Lu68\nz4Xp3kdBJLVt5iJSiIj0BD+qa97kz2gkcfj1Ccue6R5uFambA7AsCjIh4fMl\nWIwnX35W7Nygw5TGbUlnmVdEebnLAI0avZ2Ws9leG6Ac25ASI5v8LqLzvVdp\n29eLmpVIqyttPGcGD1Oua3WDOx/78meYh1xlY2NU7Ir+In+M3LgJ3UnA4cJ/\nQN7qONyz7KDcnMq3xlEfQCtFZYrLWVsQQmOXhbgUhDJ6K27PR2CCt2BH20kO\nOWLyFUbK+9QEhyYrVIgRH2WRGBUsyc6Mya0NYfJD2nfi07VOOUCuiNjHUgKh\nMkylVCAbqts7ZLCCjUqGJ17MHO/WKXvwsCjNW69yGSKYLM87uBVcPdKESfX2\nZT83xNH/dI/oNy+6VpnqrnoKgAAi+7JJUay9VpQhKe/TvZ9zbsQzHx07PWKR\nsQox6rwkeDT15zX/wKoG4TafINQmzBCrvn461UWkDe9e4twKuuD0tHvhDm2V\naE5JljdPvRzYPelvzn9ncQZM8euhHK1Opy6dXgjtFkLi4+3YiAh8NwjGgoBN\nMMn0W1bIFLQUQLmg2p66tEGrVYmXCtgcTduT0qOEgIjLkWZcbSCdyiLUDeMX\nsTW3CQ3+BRxv6SKH5va+bjvInqpWkSO8sIUwCCU+MCqM8DvEiGeZuDKqyDMv\netPQ\r\n=aHWb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"7dc757e94d2bc41f1e3184cef21690ae8f0cc42a","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.23","@balena/jellyfish-environment":"^2.0.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.0","dotenv":"^8.2.0","eslint":"^7.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.1.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.24-renovate-non-major-7dc757e94d2bc41f1e3184cef21690ae8f0cc42a_1596165889029_0.5489742862959759","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.24-renovate-non-major-39f3d40ea6812812de60373d420b2a80af3f42f7":{"name":"@balena/jellyfish-metrics","version":"0.0.24-renovate-non-major-39f3d40ea6812812de60373d420b2a80af3f42f7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.24-renovate-non-major-39f3d40ea6812812de60373d420b2a80af3f42f7","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"35208a8c96a4379c0f28f452b68004921ba75d85","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.24-renovate-non-major-39f3d40ea6812812de60373d420b2a80af3f42f7.tgz","fileCount":15,"integrity":"sha512-baZ13PFUPGiMQ+8tsKYn0LSnzdSBXS3Ghwh2ozlh7yw2IOCB5X6ukUr79z8yUZHQNteqbyNbtmWGkH7sv8YAZg==","signatures":[{"sig":"MEUCIFGTAzMLNEdNa9/f14462poNRWzZvslY23NYWJmUIYq4AiEA+LM8EvrHsw/yZfilhmmalnXnctLKsZ602Q2oM+KGNPs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":74742,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfJLBUCRA9TVsSAnZWagAACikP/02XJ9g21lbmIDAEPszY\nMPODrxNFuCQm7quu/Bh2OaJHcNQTEVfl14v1CPvhcyA9niha61HAIaCyBbNi\nigUWEtpkG+U6L5JM0lt825SKoy6Ph9DxtRYUCyYkYgXXzRPVpNjEQv29QEez\nV8AlMdQTWJGYCZ1KX8BB8DuK4bEC6jlNjw9bzi4wqiOPOqyPWJoWSunsi28o\nD/ICTqCTB0//ZhlLcPpUn9BHL/fPkizjL0iuq8AOfzGv+Ie3gE7jNO0GMADv\nNVvOP9whDUgyKYBFFiqxzuhVd/ZZXzRGB41hPttkjsyx30QvpQtrxEIzXXxu\nCRa9QBe2+JHZaDstowygCLg4NxZLKmhtD0l4MAYTcARkQeuX4SDtNNN+dr9Y\nCKpWefnnr0X1o+0ZUmlm1r/oyJBvJMVeB6JyFyQCqAunzXvI1IBdf0p/ZPoo\nIxw9+AhOR/uZJ2wfqpEJr/hkE7b47fJ9bDE0xAuL0rDYrgp/9d6Fn57sfzgy\n4/T+ZqkBSsOUkxCn0IkB74EOlDS2gXb2uD0teEyB42FjwDMuM6LGZH65r2DM\nYx//GB15G4QSgRrxUPre8/pEFv1I8Hx8/EC4qcIPgHoAuoJjjwmUnrfvCFDr\nuwowJ6jU2sXB9XFbAoCUkLjdiuv8LTkdEiYIOXoEXqVuPQkrdTua8Xzw/IyG\nsT8N\r\n=YATA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"39f3d40ea6812812de60373d420b2a80af3f42f7","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.23","@balena/jellyfish-environment":"^2.0.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.0","dotenv":"^8.2.0","eslint":"^7.6.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.1.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.24-renovate-non-major-39f3d40ea6812812de60373d420b2a80af3f42f7_1596239955797_0.4103083612519287","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.24-renovate-non-major-7bbd171e31c4a6e9b110041174ae2e42b7487db3":{"name":"@balena/jellyfish-metrics","version":"0.0.24-renovate-non-major-7bbd171e31c4a6e9b110041174ae2e42b7487db3","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.24-renovate-non-major-7bbd171e31c4a6e9b110041174ae2e42b7487db3","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b0c065b500e0c0274420887cfb356be048df2e7a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.24-renovate-non-major-7bbd171e31c4a6e9b110041174ae2e42b7487db3.tgz","fileCount":15,"integrity":"sha512-YLzIm6Qr0o0knJNt5BpL7VtKmo+HOAwsTmMqL6E7Ao2aEfQiJ1q55vILlcRoo5FendXCxsMoQL8bcOgzDhiaAQ==","signatures":[{"sig":"MEUCIQChH9YJ2xU4yLrXUbc5E62B++oKXYk80anGj35gWUUDYAIgKG9TluTnwCcD0TrFtNiM2m1PRBOZelYLknKKIb65uic=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":74799,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfJ7YeCRA9TVsSAnZWagAAQikP/R2CVai/Uimw44P0Mpwx\n2XFXPaEgXSCitAuVu6uEI6uRVcuqk39aFtDTW36intKk36xBklaEgmJAz+hn\nCSVqgaS734brVqFL+Mk57e7lzkXNZkxKHjpt8TmNC/kxkrtm/vTHbumNMz2V\nW7WNB3J4BURTaTPa6fI+kmBHecfmqG0G8T3lvm3wRlekAE9ISfij3oImxwMA\nOPeI5+rXHEvleJuACQpli1ycCcwsc+349lWcR6RvS8IkMPrCASMbMeVCl3XQ\n+FtqM9Hz2V9CBkoJPBEL7brgiLZdqQLwn7/J46a0QKIJQFcI19kqZ6Hx1zhn\n1QsLsQ5FkB3OuVjhBRjxu0bvCLic6gNMpxHMTwV8AQy1Lb4vBhpaFz3Cavpf\nuJPjMjdJPPUQQgVUfGFvbv4t8EXWDQUuLfc7oYqAIO5T6I/uQffnmdMcsZuG\ngHZmYSvjLUo7jFox694lrFdNxiTBhfYgxRt8dJLKb90ThhE7H9TQQA/j0hBI\nDgXMsPQRhmyyqIlXagQfnsch/FAw4Z58KXotJv2cDfFx1Lrts7cVJl9q0Wj5\n2fMyg0FkhdMog6WD+B1RoxndE60l1KZWfmZMVQb0hOWIeaK1mgsxpzd7YOeV\nJwpjH/fqhxZbOuTmR3V0W1ntus1wUF5vLIiUT0/T6x1FFW3DiNmuCxQaueNj\njBH3\r\n=ubFP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"7bbd171e31c4a6e9b110041174ae2e42b7487db3","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.23","@balena/jellyfish-environment":"^2.0.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.6.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.1.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.24-renovate-non-major-7bbd171e31c4a6e9b110041174ae2e42b7487db3_1596438046514_0.07715350064723636","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.24-renovate-non-major-0ea9b8bff7f9114c911d73c09207b1371f2f7ecb":{"name":"@balena/jellyfish-metrics","version":"0.0.24-renovate-non-major-0ea9b8bff7f9114c911d73c09207b1371f2f7ecb","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.24-renovate-non-major-0ea9b8bff7f9114c911d73c09207b1371f2f7ecb","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"05cce088d4b5df315f83d002a2324278377f8436","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.24-renovate-non-major-0ea9b8bff7f9114c911d73c09207b1371f2f7ecb.tgz","fileCount":15,"integrity":"sha512-MvAI0/Pbiwkm6x75uUywZlP/Q5lHL7HRTUclSmtW8WEhKewfl9kYKjmE/IyKXnwIbbylyyGV7YH4ip6eYvdxlg==","signatures":[{"sig":"MEQCIAYDtRzfagqejw9s28UIm/kE0PYxz2MB5NQ0N/ZQHbj1AiBhMrqqD1hVgukv8C5dxSkhcUbJXwSWMABaAcKBQxqkGw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":74840,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKR54CRA9TVsSAnZWagAA6AsQAIOo2SdxUqBcziUIRA/s\n5cUu+sVZ3o/d6qoueZxa/5a1d58xjoDaqp0L2192liHbvW33TVggxhLcwbWD\n7WanJyaqg6F9Fv7Ic/csnwjiAG0ZYN4cZALUFeJ/bKelacCefCqNl+TgMM+K\nlLfb4nPevF/T+F3GxZpo6Nk1nil2szatwC1wHQdiPdp8L5JYFqMlKVPO8Dtx\nC9fzNGKPOT0ZOuwPnaXr/0Ro7uQsZKNNBv/cyV52PCaxBABBEAy+3+WiJgk6\nkXDhcHndtmlgGt7xYAqxKhK/2gJI/LKprfuLFNl35aDzrjSOcr+opxw7WAwU\nvsXPaOu6H0+HQcvUDBSSDC7fhqZ6jE6DLaqhYWEaspG4LLwvcELDANiBeZkW\nDG1HIKTOJP69u7WRypHOhv5mVXnVtMPrU9gZLmLn5f2zMm3SrT1HZrTigtwi\n5IvhBbjCqQ7ajn404IBXXg2KSKhBwp2wdQ969iRABXtVo6rmkL9wsHwvb4oi\nMhY21AnS5QoA+8ysQdrAMvGMDnNjSwP2vN9Ct2ekjAkwel4v7v+qxU0YSJX5\nt9LQQSy1fOiO9A3xi/5CxLxX9OwROBgKKJS2MevrgRkyjHijr/RlKkbkgGHi\n6LFuE/RRUMeOGSGACtwJOt2+kSznEvqFH3fKjoENVgE4mD/eq69wUUD2LqQi\noDPa\r\n=BHHU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"0ea9b8bff7f9114c911d73c09207b1371f2f7ecb","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.23","@balena/jellyfish-environment":"^2.1.0","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.6.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.24-renovate-non-major-0ea9b8bff7f9114c911d73c09207b1371f2f7ecb_1596530295391_0.12065964104982396","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.24-renovate-non-major-0c122e40f9d70a8b3e466195e9a35adcb542c2d7":{"name":"@balena/jellyfish-metrics","version":"0.0.24-renovate-non-major-0c122e40f9d70a8b3e466195e9a35adcb542c2d7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.24-renovate-non-major-0c122e40f9d70a8b3e466195e9a35adcb542c2d7","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e857ebf14e1b647104ba8c4cc97e5892b80d09ed","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.24-renovate-non-major-0c122e40f9d70a8b3e466195e9a35adcb542c2d7.tgz","fileCount":15,"integrity":"sha512-zTc1Y7mWqh2SqM/CKEip1+k03nzmsGtoROwvfaCUfcV84569gvCP2qh8SqK17XsV881+KOAm9PspYDRkld+YsQ==","signatures":[{"sig":"MEUCIQDNG+OmVAfJNojJWEmVAX/cQW/6K0D8oCCJrBN6sSIjrQIgYu8ulg+FwNq0IoSHlR1y9T2RCtUhf+Hh0fS+c9r4NRs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":74913,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKizRCRA9TVsSAnZWagAAgQAP/27F+iZlQMdmJEaJRARt\nPyLJaJ8e0VptqFP649yQPiJGgMw7A9MWkv4K+V6JTbfPZdLFeyC20b098S4E\n/qLtrQOeUWdYffSCXq/3OR1i9Ueg0DDDuqTdTaEtz2Pr8DlhC9lpCqHO2vkI\nVlcfkgmqKqk0kXl20l9giDfQiHJA4dp1p2vkhJTSt7sJnEJETpVkWXfmnCPD\nG513z1KfsaXwZHyQlRUqxOepitgOBNk/2gMqY4IF7ZMPUZXtaWqHoOTbTqmi\nrx9GzxCgjN9nCM0nAPRyWm/6TUnZ6ADGBnTnOabZju4ziBEQ2BaVkkG5BSw9\nWEeeUm3GUurLKStQ8F84WQ4e3sshkea2rnS+v3adl0oV+dmNAskrMwRg9J0a\ncNy1hTW4uesT/j9UmOX39iczooNHjSsSzmN198e+ETsdOtrx/+c++nxXnm7I\nuhS2dei8AuJc8t8WpVuY7XTmm8YH+DtcXZanGgQgvUwMARTBzZCUiS4W6yf+\nDLpE8ZM3ZTVAH6YpyfNSjYiQaXYJ0zG6vLDTi03pXPtLGxjkIxuoTEjHux0+\nJlUUthlZkHgho3pC9dzqjLullXHWBZSoFGyZzT6FsIY4kbC72T2oyGfOxVLa\nc3DmrgHJggZhQqVArbpHps3aCP3XBU95eodlt5UZkOCmoEL1mdtsADOuYL5P\nJLeb\r\n=en/w\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"0c122e40f9d70a8b3e466195e9a35adcb542c2d7","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.23","@balena/jellyfish-environment":"^2.1.0","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.6.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.24-renovate-non-major-0c122e40f9d70a8b3e466195e9a35adcb542c2d7_1596599505259_0.8021543039003776","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.24-renovate-non-major-6a05a1dc38a96dbb8fbfaa914f348e21291a3c09":{"name":"@balena/jellyfish-metrics","version":"0.0.24-renovate-non-major-6a05a1dc38a96dbb8fbfaa914f348e21291a3c09","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.24-renovate-non-major-6a05a1dc38a96dbb8fbfaa914f348e21291a3c09","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f81bb975634e3a6bfc17033b190300eb802d566c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.24-renovate-non-major-6a05a1dc38a96dbb8fbfaa914f348e21291a3c09.tgz","fileCount":15,"integrity":"sha512-mLkxULAMVm/cUmM4xHQYJJXTeH4Ux05ftNO0k5qUWNRy/ZHvcl2pUzI+GIQ8399X59lQpz9GsndgfsLAEb/ZGg==","signatures":[{"sig":"MEYCIQDObpMZSJhj40Xez6Fb7O0+lkEan3mQ7sQn66nQ+3n8DAIhAJ5m8EzSKGVGelNUMiayggDlzCZgMcgRTJdd6+QMkMUI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":74995,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKjgWCRA9TVsSAnZWagAA1ogP/3TgDqhccnVD5oek9AMO\niNhv5s9li/6as6pRduFHv02TgWHg0/QzarcIzn1y2YlATZf+qGSkagdfq2vC\nCYxv5Dkvqgj6Ao6AE1323nsXVjRUO1uvY5d5lruphEX0loIt9gu3BaMy3lJQ\nJ9m0svz0M/VgK/YHFOH8JrK4G8fVHg2w/TecoQdh7cl8LYQR7o3YG8hIMWeg\niUQn44GFolGqIACfEUDeuSiPHIrAcCgnjFTXokTvLqo13IkuRa6E0RkR4w0K\nSGeMHyiOrhR5W9F6VoRSELUBJB6gtWrmpl58v3z5lCv3PVFwOBUTrph2uwd9\n+tUdX5jjusjEGqghfnJz8cRehyURM/zgjcS9hdtaIqNEQoG1oGrtpPgy7y/k\ncNyyY32tkvLuwkvXtnh7ekVcdXNu6xHt7Tq9WThoeEp/SNH4QdY8qxlT+AO6\nkbWELlU5hHlGoVpqGTftRbzVMEAkhsfTVCAJTR0KLT0VC2AWvKfxdxwXgbcj\nktkjqPQ1GC0LnVD0UEMeluQY+Ka+ekx76FGsXh7Q1D2h+IrRU3y2LcgG4oi6\np4FVwcj1GC8tmaUVAT2U7KKS8PFRLZtKue1tJaXRZJ0ff8pNWALX+Eec3z4j\neuQY+yWX/fSxGypfAt82zqylAjOAVZQrtINBq81rQr5nd+7Mdr5URcNL8D2b\n5nSp\r\n=uHJk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"6a05a1dc38a96dbb8fbfaa914f348e21291a3c09","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.23","@balena/jellyfish-environment":"^2.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.6.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.24-renovate-non-major-6a05a1dc38a96dbb8fbfaa914f348e21291a3c09_1596602389764_0.08575649718306444","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.24-renovate-non-major-0be773f007d76b6cddb5dae23de4ab1f75a5b25d":{"name":"@balena/jellyfish-metrics","version":"0.0.24-renovate-non-major-0be773f007d76b6cddb5dae23de4ab1f75a5b25d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.24-renovate-non-major-0be773f007d76b6cddb5dae23de4ab1f75a5b25d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e83c6cdd7bb2caf9d3aace117f3de2b0d89def39","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.24-renovate-non-major-0be773f007d76b6cddb5dae23de4ab1f75a5b25d.tgz","fileCount":15,"integrity":"sha512-KLwlnJCfXFNEYaZzvBQy9rGbZl5L6LlGG8qdauoc5yOOsJ+sZ1WqguXqO4RjbsMtcbPjYT+KeZJe0BJtiCri1Q==","signatures":[{"sig":"MEUCIQCM7ZRwq7l3n95L/dJaYRmyzRY6Lff+SHC+RyhoD96nLAIgL4zKgKcN65f47HRMKfu4Z4K0bkV0v77Fhg1Bl9jIh8Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":74954,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKjj1CRA9TVsSAnZWagAAnzsP/3eI7yfwbhV9YZQGQpCh\neA6jgZjiNlg6L4ZTMP7+pLBu4WfgcrgmatEYLlxA5O8Fm3WU3rANxm0u9g2I\nQkypaGoxphtQYMEKs19rdT+zZr7xrep2TKfZzqoG3HqJSsCXhtLE3rLd5dDY\nqxvH9Z4Q48ZvASYn5r59jIPdzQv9ZnnRj0WexQ59u5bDyiCRzyuCmIMJ1jhN\nYvnfYMuW4WCwoYgRCVPTqN1xPLiZenDOwolSz+hTTtP1KgCT/2tW/4z1/YHU\nepofRL2dFOFBaw6dslcamT3d6mlS8UAFxOTDKUEGvd2hm+latsMpn4CGO5d7\nxs/lICPuEla5Wkmawhq8mueDuc7LYmJCXFcSqIz+dULP09d9sKuGaEwr4p2u\nrKG6/lrROps1yL/CwlSQYaKOeS0nierg8NUV2HbG21ebUpNt561dOEGWgfyM\nXlOVaHiTseusRVDMiU+5rndrxSZ8NbzAvRLNcSMqUXOL46ZOQKma35Jc3o++\njqVjYl5kFa+0BRLOkEnDg3/c/gNXZsJMOBL3Pj1WOkOIgSOepJWZetpTLGxb\nj9r4pO4RASoR2q5SgmdIz6MGY0Y9ONjttdbSN0iIAvzpLyFyG5JSC0WPg2rJ\nI8+vy9XmbpKY6sE9xX6LNtqypqFyozjaWpODbjF6w7FrgedKGbrqjKENPcDN\n5Sd4\r\n=Z4Ia\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","gitHead":"0be773f007d76b6cddb5dae23de4ab1f75a5b25d","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"eslint lib","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"ava -v"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.24","@balena/jellyfish-environment":"^2.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.6.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.24-renovate-non-major-0be773f007d76b6cddb5dae23de4ab1f75a5b25d_1596602613525_0.3513767960420313","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.24-increase-linting-8920709b6d50b47e39ba354e880f068a619da236":{"name":"@balena/jellyfish-metrics","version":"0.0.24-increase-linting-8920709b6d50b47e39ba354e880f068a619da236","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.24-increase-linting-8920709b6d50b47e39ba354e880f068a619da236","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6c51b1cd59f88266e3a68e79ebf5638f9563d715","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.24-increase-linting-8920709b6d50b47e39ba354e880f068a619da236.tgz","fileCount":19,"integrity":"sha512-ZsuWjsPInT3/vRrEbWT0Vxx09L5KcG1rkvnMcdKAVRsMWl3b8S118EwrSqmBIYTChiSAXMVs87vwLX2Ch860RQ==","signatures":[{"sig":"MEQCIF0dTjRyLKwz8Eg47oGWi8BVPJJDlzXtJvEb7gIxEZL1AiAJrwycQVT2s1V0dFl0DY7tVw6c3R1XC4DWSBlGF0Xu6g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":79373,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKjuiCRA9TVsSAnZWagAAu58P/R0jPx+bXAWKO6AF5yGa\nkgBDJrTCMEGYRUgOSgdYUYcxecF2EvJ2EKg/0nBBqYhdEMp850jUxxaWcpli\nzCJS4W3q4beF3Sx3E068wkqYAorK9QkHmopNefHMRw0iVJX3/BcxFyqhlNL2\nwzZvouwwhKPqvY+Czqx452gHXezw9lNLd5h9cXkjmzhvGU6Vn1Vh6+58F0uq\nTdV4UayEHm1SgHxYs+CYD7dQtMUV/U6VbCCVB+82RDWUg7PjB3ccY26yzhls\nW3ByJJkYzo9sQgcVZd98C90OlqsrnFRUvGzqZJwikgOr+Ow8d5/bkuCnlZuz\n7UUb3Ccy8swmfFtpu4cvp20r6P/2qwi/JQAAeVxRZ51K9ZhDm7zJHkYBZkW6\nqTUmMC4noP2Au8IRPSgtTed5mqkOqj2lmEHgUAT0u9Ky+LsX/cXMWTAWiL5T\n2rCOsUIgYt9niWrtS/4P1OV+EejY8d4gXAmnJZfiP42p6ZRbtmJJ1zOr1a+R\npRZxtJC4FT8Zg5GQyD/qvZX2RPZTz5NllWdYGd5ZCs54hfv1CyU9B+vNoXL0\neefaAR8bk2f12hgbgvHqMlXYdOyudNoFi32DnPAnDtw7fVsE17gO3R3TslMD\nYnaZKKwRP0tNb8v2tfCd5yoYGV3KokTYojvjFdmqnNeHddXEadT1wtFdP0Ek\nAvd5\r\n=iyE5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"8920709b6d50b47e39ba354e880f068a619da236","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.24","@balena/jellyfish-environment":"^2.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.6.0","deplint":"^1.1.2","depcheck":"^1.0.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.24-increase-linting-8920709b6d50b47e39ba354e880f068a619da236_1596603298551_0.990546161034765","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.24":{"name":"@balena/jellyfish-metrics","version":"0.0.24","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.24","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0e3c0396fe8e4781157c8c6a4e30c44a780333cb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.24.tgz","fileCount":19,"integrity":"sha512-JJ7JBni6bl9XgBgbC99d7ZdBrBum69Srp+SCqFC/RFekoiy0/eXU2/Ds0U3wd0VrKF74Fk1RPMfb3SlwAQ/IyQ==","signatures":[{"sig":"MEYCIQCVacXfgZcB2wkcl4t7EAcMhvfV+Hy+ylE++LKAbma8NQIhANwADJDXALpEWC6frSfch6mHAY/W85A8Oo31ItQnOSBW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":79315,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKjzBCRA9TVsSAnZWagAAaKgP/jr4ndJPrODktnxRXh4a\nqDRO9rXXOVPTf/ff0ABQP/L9En3WmtzMmn2EevsyXnidfrXipVwIotcToKfl\nCG5IiTgYgx2/98deLXk2VSGsDd8Nmj4/WPVgoWT+DSIW5aBvSqWWpVdkf78P\nRc4DbZftoY37WGCdOP9IuqKBLZPXY7MwaXfz7FlIsf1zFHkl4ZQA0ADhoi2d\nkbAQ8qqCicFVahUOBqQcpzW3lGTjebpEWHrrOTbmwrdMGE6UPhPAsg4sMj99\nqV/RFW9gAuCcHfONj8vbT1vVzxa86p4vg73eWchaSOrmU4Qjf5BqglertBCQ\nQ2MlBsE/LZcHBowa9UKdxbFpUYVCgzcTTSsU/GQZ7eRMTS0Dhe/cMUaXVoOl\nzwxL9W78fk/W7KUeH9LcRhIRJ/xF0P75HlCqFmt7my5X4T1t/Jr9mdlOFbL4\niVlrtO3+jhaAN1G1aB6UIevMlrdmHs67I1i/OgTO5Wn+8rKm1cQaKoh66PUi\nOpijtXkOWuuwZ/dSCyACXuPkf8wuih0IMHAZAmhuyr6V18zYOvntXd1P3RxR\n70bEc/HHUBU+sz9gF8c+BCnGsssqwAXsQitd/dvz3zOepwuV494TMOmTEgE5\nI5EifAQlBVGo7eKPc92DjwaxPe98trbL+eqkTq4ZHp+w3uKpYCn5BBDnAOSH\npAxh\r\n=wXRj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"86a130eeadce49785232339e8fd97191611125ea","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.24","@balena/jellyfish-environment":"^2.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.6.0","deplint":"^1.1.2","depcheck":"^1.0.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.24_1596603584616_0.6191727367846691","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.25-renovate-non-major-0db133284c452dc3ee45d3846a5d90c8a8a16295":{"name":"@balena/jellyfish-metrics","version":"0.0.25-renovate-non-major-0db133284c452dc3ee45d3846a5d90c8a8a16295","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.25-renovate-non-major-0db133284c452dc3ee45d3846a5d90c8a8a16295","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ae9728596e4125a53d28aacce61d0ea930f42c27","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.25-renovate-non-major-0db133284c452dc3ee45d3846a5d90c8a8a16295.tgz","fileCount":19,"integrity":"sha512-fQnrsm15wIywRlacAy49nj8xdsSwRIdqjmybd2tQf5vDRCQy6To7eRvIE0pqz8oeNMIVwnNPW8loclfQe/fHaQ==","signatures":[{"sig":"MEUCIFPhak0mqazMpIQIpEKS1q0BZsn/h8+SVWD5v4EHg2rwAiEAwt1kw9DTjat2T+r9UGW2nIWq4xIDwZtFz174Y6IJqO4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":79485,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfMCbiCRA9TVsSAnZWagAAIIwP+gKsvPJfAWEuuTGr7JA9\nmQU01iBW+SvKJ6O3hNNq0V5BQTtPBak507kg8K0jbpHzi12KUpD3KC2tAMVw\nq+NsmQ1KzgT1oNrCxWy+AdinBP8wlQ6R4nRrxUQpGyFRp0POvG05iQov1IuZ\nyObqadOLlE9qgzWSqtz7XJOrDlut8GJG28mBa4uIDuZ/Ajeri6m6jD6qcmRp\nzUERi6jSI0NZuNXEuo4PLeqfVozekHiruI2JW19tU8M8e/TF78AEG+GauSd7\nWmwVeLDyzY8nfo8kZToYc7uOFvFPhjJ+dCjFN/DrPuzCkR2b4WYnzjE9yX0Z\nF8BfJoc+9GLKVhMsgTp0U7VBoATQMmWzEcHj694VixZSCIvL/iodcoi4H65z\nZor/grgrYrBFy5o8zj99QWIDdbu+SMNAPTzfBjXgj9FuTqQxPwGhw0ygWxa9\nVzyKOqj2l0NyMknf5bej01gSB7CZomALHPp/KqUZldAwx/MabmE8xWn1Nj/g\nb4LOBi2OxxTwPWW7shuU6wbV/4OMq1Ox4xXSPEbmdkCgMWNMb+NvL2s78EvB\nZqqoaiH7l7THOdpYGULNz5n/nwU4flg3LR/izKtvFFuLZkOIVfU6iKeJt1h/\nk9g8od9WVujRUDClkQhKyQZjDzMw6ug8Gwu7b33v48GcVa9Ys3ceyDVs7rUW\nDUg/\r\n=Aqfn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"0db133284c452dc3ee45d3846a5d90c8a8a16295","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.24","@balena/jellyfish-environment":"^2.1.2","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.6.0","deplint":"^1.1.2","depcheck":"^1.0.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.25-renovate-non-major-0db133284c452dc3ee45d3846a5d90c8a8a16295_1596991201967_0.07888389302749221","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.25-renovate-non-major-776e2b06ee6803e4c05f116cd1767f2880291a64":{"name":"@balena/jellyfish-metrics","version":"0.0.25-renovate-non-major-776e2b06ee6803e4c05f116cd1767f2880291a64","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.25-renovate-non-major-776e2b06ee6803e4c05f116cd1767f2880291a64","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1814a779b8fa245ac90edb1be1dbcf67bdbd5710","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.25-renovate-non-major-776e2b06ee6803e4c05f116cd1767f2880291a64.tgz","fileCount":19,"integrity":"sha512-tZXpcI5RQQNp6mroU9ezMrLpCOE2/HuSyid65BJ4OA688VXspAr1xx7r+DQfCd41uVEErNX3+7d6lFWayKGLfw==","signatures":[{"sig":"MEUCIARgOJ0O5fq3wcCzi2F75V/LX6iLDFne4wFNlC6/wpL/AiEAvshcMKWPxuxJKWxqJqG5jg5ttkAc06WjPV2CxvBhqCw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":79546,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfM7CQCRA9TVsSAnZWagAAAG0P+QHxYlVFOGbtahgrkaKk\nibNPeM82gLbpIu2KZ7IvVwZnZJALpnd6QLxfp0/JMJq8ZqqZCKfF89BGw9Ar\nYTjhEDcuBU2N70h7CuhIKv2JqwMUICsKzMOkNtZP9nCcrO/xlXlqgLwQA1Qz\nV/OFQIWTeUUHXyDLF6zsYtVPrCoDOm5lQXxfCZIBKHgm24E9D07wcncH8U3j\neM8m4vHwthM40TH9m0N6vsq73UvqdwRBGJ84AoVm30mz3eDFXKvLRBlY1fdW\nok1k4fQ8ntLi5Hy61bIDr8j0BftbEdWjkJKr0md8qhdPos3lPiJwpzTAPSaN\nTYpzqjTnbJw/hErglkvGZswI4cM4dh/yGlZSbFEGMxk0uB0nFTEIKx8VORu9\nRjn864vVA9PbJR4HHkNr/qM2kSsvw7kwxDdg0YIH7b910yJm1yyO8+4eVcpk\nnRprT1D116jukODxmXznPLSY90CJl2pMx8SYePTBI2Nodide7t2ZXDQlYARn\nsyggxMbIqruzOkt5ionMQnCmZLP8EKpD5zKjKI2V9I44s7eWIgLxrcG5lMNy\n64y7VI11EtFlQ4pKF3LnhtHFc47Kr934YmL22ldBFRl4pAPt+NKO+zNCt6Oy\nNqed3/1hA8UFAdhgY+exceNMt/KE6LxRr+E/LSE3E/x83AL7wh1KUpjhwndZ\niJTf\r\n=A8mJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"776e2b06ee6803e4c05f116cd1767f2880291a64","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.24","@balena/jellyfish-environment":"^2.1.2","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.6.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.25-renovate-non-major-776e2b06ee6803e4c05f116cd1767f2880291a64_1597223056020_0.6081412783028131","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.25":{"name":"@balena/jellyfish-metrics","version":"0.0.25","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.25","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"20ee2de22dd6c2357835ef6cc71f7dd11f6122ed","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.25.tgz","fileCount":19,"integrity":"sha512-t1sWasliTkb5A2quvrsLj7rqJDEpbv67BH8pk8c9fJdyY37OQxuf1zgbTxJRIRKHqWQSbxTAKLwlL5GDAN2QMA==","signatures":[{"sig":"MEQCIEtF2TkLp1IreExqGP3zQ0r7YtNrJbGAp2ikS6Fw78o/AiB3O5qGl/3r5RlevlDEFVT3D5BsmNs0E9J9Mhqkuymsdw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":79486,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfM7acCRA9TVsSAnZWagAAj7sP/i+4dUQxaXpvyOrfsACu\nGvv12MCp3HbWrvkpisGBIxY7eIs6LgTHFDFMB/VqEfuL4UmoJHMCkpfoVpG8\nv8m//LEF30Fo2at2yUrHkzycHyCazNaJL2FMcs1hnLYDf/WNzSHjosKS9t7K\noHDpBu3Xnk9zIlAmHSPNyoy8QiW0BTT6xXVh5v3xtNbCv5QyeT5IcfgcqsTF\n0KEGrdSwQUZ6R6jeNn2NoI0CfsQLgE9jDRncAmY97rO7kX0iq82WBnaquGqk\noWvWIxblBGP33yl7WopHCmyhC96X/YSWBWQwQnKxLWiOl7oF5d8UDQwGbtbq\nnT82DrXeclUOV4/94nkMMNbiAFRMOw4lhiGePdGgQLyka5im6SgINOOysiId\ntylfXwbktZnQ0GsC+iQ8YQHHK27U6N1k3uvxw15D3CF9ycEOSvn0mrCgOmKr\ni46hFEJ5GDdQljBP0406suiqt3Hx/CmKJW9zvmXT31dDQ4zODijdA1E0fjLe\nxkw902WL6wJmq00lom8RnbGm/vJpldAzJyLkIeNXbsBjiL/yggBUX3Y56Bbq\niAxTAXRvBSYtT+H8/D9FErfBjhrJKKSXSlDaAQBKY7Wwt7GJZbjqdnfoDRU9\nbGxq7UTOYXOQVcLHZwiObkXzZl7gg8ilAL6rtKH4R80sDazsvMPOCKZ8qINn\nAh09\r\n=pe2r\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"69650768fbac39e65d3b01c6b41c69e6e75f23fe","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.24","@balena/jellyfish-environment":"^2.1.2","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.6.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.25_1597224603959_0.9957172647734542","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.26-renovate-non-major-ac741af38ec039d16ceb74a44c190369fc7c5dad":{"name":"@balena/jellyfish-metrics","version":"0.0.26-renovate-non-major-ac741af38ec039d16ceb74a44c190369fc7c5dad","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.26-renovate-non-major-ac741af38ec039d16ceb74a44c190369fc7c5dad","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"becd012f274dd95f2e920353baa3c6d13911226e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.26-renovate-non-major-ac741af38ec039d16ceb74a44c190369fc7c5dad.tgz","fileCount":19,"integrity":"sha512-8v8ryFMhXKzlDGiBl2NyElSWZDrXMoFaJht84+1bdFS0NVsjyDvnvFgbkHSdEvmKIOD9df5r86v5G3X5hNGOfg==","signatures":[{"sig":"MEUCIFo/PjgxOrlo5jraES35tE00O6DPQ60G9SNzwzo/8yiuAiEA0+TW9T6CVRqu3eae1oirrCa5SeojqJy/TbXwNr55NzQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":79656,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfM8YICRA9TVsSAnZWagAAkfgQAJIeAPstSuOMSHJCS5KP\nBl+WEC1X0rTUfisMImpDv9fPKtREm1t2oEm/xBJL6EPLT+53AAX+hEYY4SED\nMjZq9LbW+8rhtNSvvzhvcSVzQ6+nRHS4dzkT0SxgD1DjiddPvFkgNNQvdA+q\nGnoUk4RkguEgvBZxCaK2ZRCgUFD3+g3jSwlkvSFuylQY39QJgSFXtGU+/HwO\n9N0DAHWrpd4uQzo9+Wn1XAyM9J2bJf82ttxKUAWzjwKSyI2HoeCETco/cvTt\nMXdQ5dhxDMGXsNYkyuDeP2nvkNZUR6qJPTUR2+FV0d5Qo5anpJ5nXjkQ8v4x\nA4NnhjaH0puvBvNPigAr15wmCX5FKxJ2NtCyvSnEylHkUiXl2PwzxFxPkp8A\nKi1G4mDRD+pfue34Jr0eiI8iRE+1P6i8OSkp2AxkzUYWtij3fbwdVku4WpVo\ncxHFb63gJmom0AI8kdG9WikG380sdGyk6OnA4jO38e/2SH4I6ZLdZ6rAJrVR\nscQgAK/UaVI505DxbtK7YPBCUVetyNIF+tN5MX7kxlLBK2qO5vYSM74LRN4s\n2aF7f2iPnNpLmodGbrreboh+7PTXB36O3xKokA48KNxTcQk6UYQDXbbZhFBx\nsysLrJ17r/M0A0AqGfv1Zw4H7ODsD4HxLU+PFHIMM+xfoebZMeI67HUFRGbV\nXSRm\r\n=NzD+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"ac741af38ec039d16ceb74a44c190369fc7c5dad","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.24","@balena/jellyfish-environment":"^2.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.6.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.26-renovate-non-major-ac741af38ec039d16ceb74a44c190369fc7c5dad_1597228551999_0.41303738335278295","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.26":{"name":"@balena/jellyfish-metrics","version":"0.0.26","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.26","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"73ca0545ed6818dbb30669110371fb39ab2b436e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.26.tgz","fileCount":19,"integrity":"sha512-+luvuDaETkwpASUzFuhfaeQ9hPAB3NygJqvcA3njn7vQWA6vTtgKHgHT+ELsncwoSUYPof7Z7rqdLo43FPiIlw==","signatures":[{"sig":"MEYCIQDUK/rzDDZHO6UsPaPAofSqTDOPNS+ryiUdyvgxRODpvQIhAKLoC/yQlhFNywR5e2iqKt5Wj40pja9cnLITAtbu/C5R","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":79596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfM+ngCRA9TVsSAnZWagAAZYwP+gJuPCWPJBxJIvHX/xCI\ngF8WVxyriF2OvhVC76s0mmGsqvTSwQIkz3efuWlNVOHXKm7xGeGPhPfAS0n+\nd+qJ+p0EwmnCyZcvQ2k0PtsUmtLfM+fL+zIn6OPdnGtkoKdUhUsIOIIX2+dT\nJG23I0CKZnCtSjZ7NzlXmrni8sBglSAf/uEPXzC2pGad/29D4n52fCsUvJMC\nuAhlUYxomOtdvJ84DhDcDgCyr8dpTj79nE4qlKYbI1MetkR2Trsl+mdr13cE\nQT0iywy9zuuGeuB3uS1vWS5gNb7EhMgmUbSswPAIOUJQXhwXUKJBNVoV9rC0\nqmNnNuEhVjUbj8ExmL7cNYwQM+gb5dTgwjw6SQHx7aB55NLzIjEKdnIAEZES\n+J0quhPN6PRKoVxX1K9BHDsaR1AZgGAAGQ6P17A75Otua9cySQppS2W7KK43\n6pJfunLhRFXATl8i/kVFCwxd9S8zSfAFNwTfY1xTh7NMFEWuA1JIYaZ0TWHo\npTre30ulvAG6pPLScL+cvBj9Z0TazIGTFLZu/hT/HYU1Eb2RrwwcP4C6wAIO\nDUsyOeX1Q7YRVivdZwfyZa3MugsJYmXqf7dtFRdHnWyRNZKoS7FdeG9N94lZ\nQGi2wF3WYeicv9OvNVJkXtKGRb7055NAjRjbCAYXH8bjz5xiJzU0g9dd374A\nMR9+\r\n=3/jJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"63928163ddceca80899ebc2bcaa147bb11360bed","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.24","@balena/jellyfish-environment":"^2.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.6.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.26_1597237727472_0.752937363126698","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.27-renovate-non-major-851f704959d868c54960f52737c5b9a97cce001e":{"name":"@balena/jellyfish-metrics","version":"0.0.27-renovate-non-major-851f704959d868c54960f52737c5b9a97cce001e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.27-renovate-non-major-851f704959d868c54960f52737c5b9a97cce001e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e18a0e94042b78a334ee090d087a961155723a69","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.27-renovate-non-major-851f704959d868c54960f52737c5b9a97cce001e.tgz","fileCount":19,"integrity":"sha512-Rh4jLjFAwCWxCDvq484U3vQEjdDMMg8Ky/iMS2Hk/BctZ9mFqmvWKl2qyZ56ARc3Q528KHcENtmPCiOg9uZZ6A==","signatures":[{"sig":"MEYCIQDd0z6X6AOTRChmE+2QgcPVVXOhbQ1wEWGMI05qGgnOQwIhAKf6lMJ9G/45bkxCt1gQ7IegY4fpGrp8/gQfjxUgu1C2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":79762,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNAF/CRA9TVsSAnZWagAALfUP/2EFjsqgfWMg79OxeXPG\nYx1PlW/RTfdSa+jsFJHo9Y44ceHLf1qpKrLDv5kgelhlTQ9n3QHHcbQMqNSC\nd3eOsb7HALNl2RbO8LWeOW6Z0hnHMcDBphbVQPKUPKc/7G5vTDQaRgiLUWZt\nLkNyDWIAXRYuz+lh2Pb6G4HY8c/3/u7X7/yFL90ZWGRdtgGfNTe5R+gLoJp/\nVg/BtkSrZGWB/CkWeUacL7BzA8iA66ORqw0SYVipEQgKyWrI2pKJipHeaiYA\nwlYfmlxl0HM/EGIZHAexcA9mMy7MQMcMYRflcu5PmAUljdG8nAsSWtQAX+O0\nAddbbixNKcbOl4CSErqeKSU6yBLE/02MM62REFBuf3Hw36S6PwOkSY6qTpXs\nCDMxRbDnzgL1EkUoUqTzoYjrYzgyDjBB5er7B8hNJkwQ/AC2ZKca6XMaLza/\nN1ouuLAOZ4GWyeYR0H4AFuk4Bt+6rAh6TnIvIstWSB+adyWntGpSywnrupv1\n43O78Wf3642H9AIx3HlAVzhVj9cs0s7nc88MgmnMrrHLvbHbOsEWBeCYGOUP\nXC61j3rmeGN/JhDu2d8qcVWboiQeEB83cmSlECc8jsiSRR7Ba0qvU/4TPfXZ\nMytomNNAyfUps55NnAuVlyEL5cxCNlZDAcX/YjrFHTZ9Q5Mir/d7TWwo9iqi\nAxeJ\r\n=ms8T\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"851f704959d868c54960f52737c5b9a97cce001e","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.25","@balena/jellyfish-environment":"^2.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.6.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.27-renovate-non-major-851f704959d868c54960f52737c5b9a97cce001e_1597243774572_0.7880867960790481","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.27":{"name":"@balena/jellyfish-metrics","version":"0.0.27","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.27","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"df680e98a394810d09764d709c5c75ed7d7e9bca","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.27.tgz","fileCount":19,"integrity":"sha512-RlpComnBLghkHiVlSPrwndwm/cDbfLTogTIFCFtd6BarR1QMh8D7kMmXi3xmv3nJ9U7Ynqii152rNKJgAYb7Ew==","signatures":[{"sig":"MEQCICzRnAdwXqWw8jMmgPp0O1nyrqLq3TwiNiuHiut4D7dEAiBE7LVxv9fPfcu3wiegGAcmNYp5eGtJnAJa3+vMW4kVMQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":79702,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNITICRA9TVsSAnZWagAAZUUQAIYZ4ZHpTG7SWSbyoEPR\nfEEULubLQcSy324NaJ1l9os2bP9+Z8DMBe9q/6JiP/918oe+NMvFw93XuwPa\nqviXXCz66JiFaB4aVyK8vbWcwskii9F95FMEfycZTJWdCUx3VD9S88jU22T7\nv/g3xwHF3oLLu9n02qjI4uEFT5KZfCROlzX1ecme+g3pSk3s0jPtQYYEk9Tx\nRcZ/RVEeMe5JTboesGjFlKLzQLKNTnn0hPqjGbKhDmNiYvNJJA716X9Zy1zg\nd8z80HUXOvxH1HDZOaRvySJTdFOLuYYfL/VS5FtmA/qpObeNtmdRs1W2FUdt\nVWs1Vck1nmQ0tVP677k31Lnmp+gs1b2Q2FESaYwFgUGMT4dTLpoReurqVeuZ\n572H0A5kBG7ZH2hTIrYAQ/CJNVlfz2FqsYDNOEHq7IPU583izONZjS5eoLUj\nvv6Okp4Wn8r6TuROmwwoQmMOlAHZJ7ExR/P574bKNtLFP6tKC7OCLQNmImED\n2Wht7suBETJZufXgdDnicIUPeIq4YipT9ELLiUqGcKWvu84N1Y9V/yKZBfU1\njxSDtJlOLmIk9WKg5LaSWwHpwQJt6O9JII38EC2djio7cy6chLm/FSrhdceR\nBSy3vUT6D5/SXtOeodWOB6d90lN8FWUhdAa9ycunb6igbkY5EnCsjDVBncOe\neiSE\r\n=qsnS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"124a3f809be7b185cd20b8433834dde152f8f5c5","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.25","@balena/jellyfish-environment":"^2.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.6.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.27_1597277383358_0.2084874043716931","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.28-renovate-non-major-40c5a70251cd40df9f4c3189d683169986ece00a":{"name":"@balena/jellyfish-metrics","version":"0.0.28-renovate-non-major-40c5a70251cd40df9f4c3189d683169986ece00a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.28-renovate-non-major-40c5a70251cd40df9f4c3189d683169986ece00a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f9fa2902371eb49ea7c9d0d8c0ce5311f9d7ced2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.28-renovate-non-major-40c5a70251cd40df9f4c3189d683169986ece00a.tgz","fileCount":19,"integrity":"sha512-o78bf8TWmnfm3+5/Etz0fPoEntDHMeIdxHopkv7TmKfeD29F3SOI7Q6mbmqiw8rW17xOlL8MCjyiHaLgd9GAxw==","signatures":[{"sig":"MEUCIA2qVplufYObGHjjrViI09GNSUlkpFT7xjIpxcvtxHGKAiEAuDZONAXGW965VpmMxZZ1J9Vz7cWP6g6QMlcK2UYjKB4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":79831,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNJPgCRA9TVsSAnZWagAAsv0P/R9VQajX6GZl2BWaXGSq\nGbsNx03kh2pQsa5G4tkJcoyB7PKnIn5qf624+JbLChypwkq9rnLjD24qqV/8\np3jRReBxgQx4+ZyyA8F3D+UsPJ3kmNMK7fcQg8H0xhfPB/EwQauxEyfkDGr6\n67pD9IG7Ji6UUv2uQqnRT62puNnWgowBpVojOmSMTUgZ6TLCJGFZnRIi0/Wr\n2YbMVU/9Ff9fW5GPVzHZmw4QBrAupNkjpjOI9Hz6/+popHJ5V1okP7ATVrIS\nB75qclc7UTt+spDIwqbu7yIy2XSaVoeeFDE6KRVeBcrhmMyKT4Pg40b5bojN\nFznG3EhhCgPdMRUTAorVvyoYHaQus/T8Ly8iFFZnX5q9+53308KD2oK4IiHZ\nV9vuW+yRBC5KKY2cdV4jeBur5hgmK71VpXAS2nEhcPQkO4GEU1CRnpYz6o79\nuBPaXtGDQNJVqeUvwGltlM37ZYT1I6UJm3t0PkmRXtNsd+K4QHmxKKl+G6n9\nsB6WP/utzcOgADI2SNWiNq+LQNc8eqkLRn9K/+igYn+VXDGvKT9rnxs8DG6w\nqs2xcaghcH/Ym8ifxqP3CGagdmobN141FPo0/KcIp5FBTM8v3c9ceu6GLagv\nHBcN6VqbuJMtPnqCBqR6Teppkp6gc/nZi3opzhMwK5fWTjHgsVPOyk8zWEyV\nZV+d\r\n=mb++\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"40c5a70251cd40df9f4c3189d683169986ece00a","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.26","@balena/jellyfish-environment":"^2.2.0","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.6.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.28-renovate-non-major-40c5a70251cd40df9f4c3189d683169986ece00a_1597281247804_0.9060768563907486","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.28":{"name":"@balena/jellyfish-metrics","version":"0.0.28","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.28","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4a3848aa068909d26b5a75059267cd6e39529110","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.28.tgz","fileCount":19,"integrity":"sha512-HvaaX59Fj6ZJBArXTx62rf8r/EBPeA9l/q5SDRJY7UdgBBqthOO8vHdCO+ZAbVWJTfgQaQtWyu+IroKLypG9aQ==","signatures":[{"sig":"MEUCIF/9JQjVqoqNTty0+NAIEqmpICZulVlK2nDY5IzQnlvuAiEApes6bKFk0t/U6UgVSxk+yTVKlKWBBZQMxZ/rRwTU5Tw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":79771,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNMByCRA9TVsSAnZWagAAFZkP/3XLY3kKgGwX2fq49a5d\nQVmeZbq+kwXcu1TUNcjhdmgp+p4dmdcTB7pHuuCIqHWx/GJiLoMA4kiHRRZm\n4MaSRadlCePViElEA4GFYxvT/IPlYR1B6iGcNIW/ywdM/kniBKy7q0kBmtPE\nZYK16uQDY3zFb8kuSPoj8naE3xJjKzZmHhSJ7JjJrGdoIS16GZdf4zyO9Lou\n1lAgTSMuqynqMiA/PDdZXKAjt9E4D8hXUYUgf7tpgcnfufzFN2yvtRocqlq8\nAyaIzAIwUOafQ/Wqc49J8xAkVK1qZHXoBpXLj6V1tEvyN/MYM74hI4iR3FY3\nEwPDfuRs+TBASrFO6gjWTRZ+FVnPGABhmbE6EtSDZcxe4Lqsy8pKSL9OUEKz\nMKKp4v3D+y1ZrHhL1buDK2B2R3sSm8B6zI/EMZQ4HQHtidiF+bppuPFQoXcJ\ntBNgsaWq1RvaDbFdr9vFFMi21aMNKfPwL/F9lhNswXOTygKIHWQ2Jt86enew\nQ7Ya+jfOaOmNgKK5b1442or2E09GCJascNGB11pm/D3tAEU6GHdCTZTNXulM\nNiq9giYP3REwhtpxzyD7+dHrKqn5duhAemWnlWl2m12AGV+qXB2eBImZtSgb\nBlM675lyHAXsQihnc+PONqzJyzkOBj6PCI7Gap6J9t5z+DLoiHe5LJolgQpN\nT7aP\r\n=5Im3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"7e60d3330d4bc45fc62b46f2e62e7525b58eddda","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.26","@balena/jellyfish-environment":"^2.2.0","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.6.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.28_1597292658447_0.8016288701571948","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.29-renovate-non-major-4c5cdc246f61bb289899134d674801f9f545cdef":{"name":"@balena/jellyfish-metrics","version":"0.0.29-renovate-non-major-4c5cdc246f61bb289899134d674801f9f545cdef","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.29-renovate-non-major-4c5cdc246f61bb289899134d674801f9f545cdef","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e4e90d0d9b7ccaeb0c3b1bf404298fd9f7c4b162","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.29-renovate-non-major-4c5cdc246f61bb289899134d674801f9f545cdef.tgz","fileCount":19,"integrity":"sha512-NeflYgikjPiQQrhMzyKSGWPdQFqVzcuWHF8nc4qnXuUCEhnSh44tqSkTlPV8Q0Qzh4Im9CLsasHSWb6aLtc53g==","signatures":[{"sig":"MEYCIQDWF/YYoUCvnuYjCUHn5thLfCGiaEv3MoIvciNecJIphQIhAJZ9iFA3wmDUQmmRVw72CqnwGIwSN5Cy1d1CzqiHxzxw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":79937,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNNwMCRA9TVsSAnZWagAAFkYQAKI5ccLbFJCbm/ZJ2sl0\nshePcqyn4wqZ2EzA2zjR7I89ykSjyNYHpMaP/faGmiaoj3GfZRuO/Wpin0Hd\nQOiaaJyXbnl02QYhP2ZvTh8/bHAAP1Urlyr0Oa8hJLFcRBKLnvNgBrQC1sub\nUzz6X3Wk60N3iowByBuO1d2Ujh7e6qM8Qce8VZEX33AETMFzBil/lHcfElS9\n2LEOD8rjxPFvxC4Ds8sbsVd+Css4w1TdtDW2wM/NxtGBuvNfJ2t3hnKpu2Wm\njGdT62EzS31+haQCSmTgNzg828aHFQZS1W1sHOQBAqzZUuck9yHffyz/Mwoz\n/4ssJBI74xcsSjkRLhTmXXV0v/JpB1dgTIQDlCtgcbfK98A9PDxGYmEIcfnf\n5zB46IAxGTp8QIjvLHXU9zaTNe9noaPHKJXvojytecVCgiLMBggqibQ6fusz\noK7sOYqc3m+EfTBQqDs7KBRaSDeq7rpDAhRGdAt95RP+TtMn2xsCg7HocXm2\nU8U5gKTKEf/93NiNWaPYXPUnFKFjvR22d/Jy2wQhn9ivSxM3WlIWNbWl+ydg\nETUgeDvKRyKwpSy2okGPvtxS8z6aKisvN66c4/4DChUL2x+qzMu6/mVrSWs5\n4O1bDUYB8uaqs9g9+OjqbzfjM7uYlDUf8SaoQYPCTYrh5cKniQMGvFTbO5HZ\nAX/D\r\n=sYko\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"4c5cdc246f61bb289899134d674801f9f545cdef","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.27","@balena/jellyfish-environment":"^2.2.0","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.6.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.29-renovate-non-major-4c5cdc246f61bb289899134d674801f9f545cdef_1597299724231_0.7385523358119108","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.29":{"name":"@balena/jellyfish-metrics","version":"0.0.29","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.29","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b18ced0c2450bf5051a8966869cff6545ff0d208","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.29.tgz","fileCount":19,"integrity":"sha512-XkfSoB18uIi69x5IwFywQewZrTJ8Lho/h/tvvYXPcMdaIj2DvXh+fU5uOC9XK5XWrt24EjSmNjTaZHOvS3LBvg==","signatures":[{"sig":"MEUCIFcw44iwt086apbOxPtPD2NIcnvya+QsC8sm0bFbhZo0AiEA61qVyoK2cpGPmOfF2IPUjoTQUkICfq9B6RAmBSdNxT4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":79877,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNN2GCRA9TVsSAnZWagAAhboP/0LQkLovn4jCXfLnZYDa\nHm8RMiT30bw9gP6wTrJZrAXLFVN8pWWCpX9obdEbUbSMOKax0G4oF5mrXgvW\ngLtUxsoMXIvi4yorKHBE+0f5IU7p40HP0KNDVXxkufGQOOzcikfQdSMxelND\nMEwCpR4kNjYTpQlrxUgKVkpUmGJCxjA7htIGu4cGrSrE8HKvKmYByJAXTjwK\nK/Ue/EDGo78uHw3WEMLh9OjVCmUSUM2XiSjgXx9iyfLtEtTLEcsvUkHqnuQC\nMd4Sbsn2USrWKba3/gchgl9QYGWIDPEKvR9okqrnBnfy3+NP9HvnWD5Ju7Uk\n+ljQgaE7UYfQ5oUwDscxqxAqxtsm881U/m8Ms/QH3fLbKtdI1GAZoMsUEkqo\nmUKQrajWZDX/xPeHfzEqpyey5nwT4XrMQ/X0tuW8qed1uN77oCIEn5fLkCTB\nW8Em0m1qokGH2ppxzfNMGfi7T2cRTmax8uS5ysY6CAZ+okNqpBfxwhW8EnHv\n7GySgP3CT6mSeyzP7FGEGxzwp8scSzn9P3g/QRZSay4tTl0pt2BmWhR4rbs3\nyfcQR7r1rWJphQRlodhy6xFGYuFHPoGm6keuIi0ToGIgS1RbVS2NENedVP+1\nXgN5A/aemobxidHbiWQwe0SQNwejpCzlArW4TqJKteyQeilPobctA4NVBpZc\n4KqJ\r\n=2gtA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"cb64f1053ce4be295ff3cb7e15f84923e0779488","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.27","@balena/jellyfish-environment":"^2.2.0","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.6.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.29_1597300102416_0.537328290752823","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.30-renovate-non-major-380741d86c90eb1dfb785dd060c3b8153c0372ee":{"name":"@balena/jellyfish-metrics","version":"0.0.30-renovate-non-major-380741d86c90eb1dfb785dd060c3b8153c0372ee","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.30-renovate-non-major-380741d86c90eb1dfb785dd060c3b8153c0372ee","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f1aa5bb11e629dd887db3ebf5016c4bb115c4b96","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.30-renovate-non-major-380741d86c90eb1dfb785dd060c3b8153c0372ee.tgz","fileCount":19,"integrity":"sha512-uJR+sN6c3MaQ+SZJJIX9JyINFwCLK+Yr0t5TQmoUJz1lO9B/XWHcAgfskyUig+03yLUsTcHyKV0+JYp3j+sH6w==","signatures":[{"sig":"MEYCIQDf2m1UuIR+hLonN4tNNN1u+gG2Xnw1IBOd9itdP8WKOgIhALEo3fUWJYAub7TjGA0cSxhjsprAsXy3N3UbT0lkB83g","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80038,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNQFxCRA9TVsSAnZWagAA9xAP/2f4OGsLKoxD/+OecNC/\nxiDnP+I34/FKDe2oidXi/tWrNyO2nAHKd/jL2i0QuLSbZL3W3gZfo5QjUf66\nufdZ+p5NoyEtyIVB4HNFKDfgVU3jCX8MRwo0UNZ2mQJNf2g96DB3payO/apZ\nUzrgbOvUAQwMGDMQK0+dkg5lAxdkAJceqootUDkgJ3TPAOUBRNYVgNzEFcoQ\nUhM3hRIyXMr6M6EMjX1ns6Ay0rHXhEa68SQ5tuO4qBxtcsuDG7zT7CW3LxBC\n3Bv7b4OztSI/NMeUYit0jD0LikPF8vCTAj2nnL1290PjaF8AVz9Cey066PWh\nLTauAueXVeW0Me71iuOtCLCckGJc7zxT9z98z3YRCu/5Kg1Mo+CKWM66ObL7\noi4U+naS5QqodHAvdn3cm4GXIwusK4qZzSOnyKCo5ahA46RusAF6jeL2xyCY\nX2WnVwfBEbQbZAH4nH8UNmAePVk6u7FCuLxRdUH7xG+sUc1Uv6nW6TGeQPy7\n2A1SkmqN88w4igIk/euibJudtXPMubI26F26UmMhSsOq7Rmw5j8lYn5J5Ovh\nvPmS+MZBMHeWyETaHb697ndAnyLI1Gvd1v3ghRbxyutcoieJouc1xUgciGqg\nmi8pBrj0vc44/E/xiMzW/WZWEe2LBPo0j/PNfFVOldkFhvIRXuS3aLNCR0WR\n6yhH\r\n=HI1+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"380741d86c90eb1dfb785dd060c3b8153c0372ee","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.27","@balena/jellyfish-environment":"^2.2.0","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.6.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.30-renovate-non-major-380741d86c90eb1dfb785dd060c3b8153c0372ee_1597309296795_0.14174168261120612","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.30":{"name":"@balena/jellyfish-metrics","version":"0.0.30","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.30","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5fe21573a5cadd2d5e20bd2e73dba4d398046e79","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.30.tgz","fileCount":19,"integrity":"sha512-ung5FWokytPVaOLYsnMdhK/NBAEjPkROtsLOQBmEEE5yA52nTfKvUjh8kJXegAG42Yh6/QnmzwWAPiDA9MoucA==","signatures":[{"sig":"MEQCIHpYVgOiyRRBj6DfGdCZ3ZG3z1sRK9ZuLyGIQme43Gt8AiBOcNfHRznzxmShzYFzN27yomGDF8wd5SyDNnyj9EQozw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":79978,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNWlqCRA9TVsSAnZWagAAZj8QAIWb8PNMU5qz7mhx9sJy\n2UdbnVzGTnmo8dcu1/pd8sx+dpFU42KKM+8JmGteC9a1sdr6x/55vYD8APNu\nl2V32fxI3Xbun4x1rgUAv4laf2wjU68054Qtk6wjhOcO02NT3r2JqXDWSTX8\nC/AWUq+y0/kYRgOogY8u36W6ePHydHoqwQZa6ENcwGzj7lTnjHcQbstNW8Pn\nh12DXxhYeiaLqkrc9ciB1pFYx1gWUUhOpEmAzzrz9JAV5o3QF8HlRmvRlf6/\nkoHDCo6fhW/zLLUtxh73Sac3QBCnx3RatCasYVaN04JMFNF8/9I67XyfNg+Y\nkvLuM+Y1rOeEi8JuVjr034pFi2feGQ1W/+FKYUIkNpr8pW+KjFu3aLYR8OqN\nE2D41IbN7uZBy3BJF6vgXt/nVRd3OgJrAe18JZFaaljwKuq3+DNEmc7yOgaJ\nbqmjfI+7JTvZo3ISsNTrtZbBRgJZq3lvIf8tiOb35SwqIwj+dJ0yIBFITJ1q\nPYTRDHGXzVFk+esOXOrRU4+yV5mHugi9qqzzvuTkwC8N83xItrhqwChZEo+4\nIvGi+S2OVsbVvU3JI7JJAE5bAmRHSXTIljUjqMrmVRgqRFEZOs3NNu4Bbyzl\nww+ywhYMD3VMbvFs+TTE7yHBF6DZpo6deD/4nuBywbvFawvz4UY5dW0+kIWs\n0KxP\r\n=zdEn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"a4698a02a0fc6cb7dd312baadac3cf721e834048","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.27","@balena/jellyfish-environment":"^2.2.0","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.6.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.30_1597335914028_0.7353732648770968","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.31-renovate-non-major-0815aadec71adad4f5287f62fd5f44126aac61eb":{"name":"@balena/jellyfish-metrics","version":"0.0.31-renovate-non-major-0815aadec71adad4f5287f62fd5f44126aac61eb","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.31-renovate-non-major-0815aadec71adad4f5287f62fd5f44126aac61eb","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b81c11009dcc391d1a96a491505aaabe1d371394","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.31-renovate-non-major-0815aadec71adad4f5287f62fd5f44126aac61eb.tgz","fileCount":19,"integrity":"sha512-LLuFV/xxoWeS0wct0CUQ1mYWkZcBqeYV/9zjYIDFqQIgjy3fZFp4QyA1YTQCyJhYzc38uxOQYByv+NGiTi1NOw==","signatures":[{"sig":"MEQCIE4zUozwDCRAY3PeO+lk3+BokS57BbEsyZGvBY6RSbfeAiANsCFQRp+36eaSfCQY0EBYTjrQOyPK3gidDlG17V9+1Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80107,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNWp5CRA9TVsSAnZWagAAMHwP/1hE+JzEqQvrPw0AWvfJ\navIIEGhFYYqMKXdyHca9lqIUACplb5EeIcpln7yHxzxwnBX3PA49jWQHvqjn\ncRNhTL4oSPP0YVDxeacp39CNoEejDoBdRwPn8+yHzsGBo1d07yhG6e/8h5fW\nWWZ5WBrFJKSxI+su4Xxap1+VHhRyqKggqa+Uwb7fPOgdjk5vHosESTLPZlkx\nWLuNeZHQI/8eBq5Mj1Tb3tddVcyCh137SacwF8QLV3ri3OrBZcjtjWDxpDmJ\npA5rduiakrNSV27cP0MtLjmphJML6MFbJi6mG/PWqYo0pZSyVRUOIKttgOFG\nlUkzqEYfi/C+nVH/q9rHWVomyM7uQd7ekiiQvjU7S5YT+b5ACAjU2JaCYeF8\n17gEeIgSFRJxAIa553fwTwPMxHkxInv+Rhaf97Usao5s1M3dG3RspxiLyYzi\neP/1sPwPQoTbhhB3xkkOwGNbss+eGO4CjTuBUsoH73gBlbByYLsxXMGj+50O\n3CGxNqzrno535N4dAwDJDIswglrdyq0pfGWvhloMx2hiDKjP1tG4sQueB6Yc\nourhXgyxt0RP/MZ8VM8Za3zGhKd8f1mK/rfRJBIWHYnfFAF+tiyTO2cXfeHs\ns+CTcceMzEILHqn41Z5LNZY+htziGojvSzzQMHNUI+aOdwZDc/fcegsYfvpl\ndrWE\r\n=TLf2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"0815aadec71adad4f5287f62fd5f44126aac61eb","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.19","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.28","@balena/jellyfish-environment":"^2.2.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.6.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.31-renovate-non-major-0815aadec71adad4f5287f62fd5f44126aac61eb_1597336185179_0.4622288847901428","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.31-renovate-non-major-5aaddb64f1cb10f7cdf15527b8548033433133ad":{"name":"@balena/jellyfish-metrics","version":"0.0.31-renovate-non-major-5aaddb64f1cb10f7cdf15527b8548033433133ad","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.31-renovate-non-major-5aaddb64f1cb10f7cdf15527b8548033433133ad","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"499f5908aacc1107baba3a3f61d48aa625dbdbb4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.31-renovate-non-major-5aaddb64f1cb10f7cdf15527b8548033433133ad.tgz","fileCount":19,"integrity":"sha512-5sYxmXEtMXoL1ElQOzW3xDMKegOyuC9HuR1lWXVTZga+LpKiBrdHiZGqwtm54okTGBR4NHe/UxbeEOrfbnPJzA==","signatures":[{"sig":"MEQCIEXnZXLtGuYXFZIuZsRqvzXY6cQvzmcEQk0Vm9q1xbRnAiBkCzNMUCytvAEwPLHeKyUlygqpqc2tfIzn3LjMzIgBNA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80107,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNXZhCRA9TVsSAnZWagAA0qsP/1kOZxcf1lnpns9nUuFp\nwXcmmH9Mue4UkN6/Zptbe+tGNHMzxNU0GaPCltoh0IInoRfcmxV5Mwn37bMV\ncv5GPSp4pmrzxCvC5tZMh0glA2d9f6xHNYn257hbC7z/Q1cQDCb+EP4BI4JU\nNtHWtneb+/E2iVFPBTmvMVXQCMVCG4uLTtfB8W6531OrF2Im7AtDvRWlnm1w\njExq7G7H2zKI1mf37lieqaM8Uu26GgEGYLn25Jg/4ZWeWr7uumAiXrEXbpSG\n/upGXVoPnoDpmBMwIGEL87O2q2OeMJlGdpAfrUD6TmU4N5z69mivfP5HBt+u\nVxEBpH7Ajzj0pey8oLPkT1kdgFOm9z7SYuVnT2HJfkhxkSbPFHBCxkGzvSKu\nXM8SvaOnu+e8YatZCGX4rdykieA9w0eVIJOEsh2P+8jwEFsPwMvl39+CGvB3\ncNE1RgrizUv+GnkSuwWodIrWgPBthUJIqjxGrNPm1vQFm+p+wW0Q5Ob2vPJI\n5IOtZ4NHjJ03/kZo8/P/rqbyrYjq7SgpvXALVlF4h1IIlyO2quyybXr8yckH\n92rstHvf16AOJ/JfZHzDW1eItMsU6ZmAG3FYOvPOk7H5e0gSZnl623uNPD4s\nbqkv2hy4P431+NvempGXldxf0RVJ/WAnJBuXW7KJYRUpMANMAKMzDv2lfNyJ\nM4fB\r\n=LFe4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"5aaddb64f1cb10f7cdf15527b8548033433133ad","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.28","@balena/jellyfish-environment":"^2.2.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.6.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.31-renovate-non-major-5aaddb64f1cb10f7cdf15527b8548033433133ad_1597339232407_0.934691873006555","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.31":{"name":"@balena/jellyfish-metrics","version":"0.0.31","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.31","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9feea6e7c60024ffe4f32a8e6884659f9822a701","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.31.tgz","fileCount":19,"integrity":"sha512-ThKw7Wubjcb57TaTgcCkuC81j3WKGcKwA7sFws0lLxQu/ct+a4D4d+E3ChUHOdXSRMOVW4vC8wW9hzj8sM3KIA==","signatures":[{"sig":"MEYCIQCt8J3Qhz9Ut5/0AmN9yyKf6KejIpoBhwNszLQywtwILgIhANGifD9eTythPqrcfhANiy/S+QZRZAUCxcLjhZeM2Dxi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80047,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNdAcCRA9TVsSAnZWagAAq2UP/1Lt00MNutlXGqesQNOW\nFBUK9Mm9VQ+HuelfT7ZLNBY8/A/51xNkyhN4BJcsovuClAQXi44npJiPnQiT\nmFMeCLWi4rbnHHz1vawV+sRKFeNQHWiWwmqkeVWvTMFZdZXLbcEtD+VImVXa\nD32+C3Dc0Qk2BIT7CBiy7vBVkwfYU55IS4ndGMRxixw5KACkiIRLSsapCIJJ\nTnXfjTp6115hDcV9VqLC8xUNn4qu9NIZC4eGE39IP6tFgg4H+qgBMkkQ9t3Z\nrtplHljmbfFI4N+gcYa1Ip6zG7RhXk5+6IQ5I6+s3HphQLpxBnnvXh+uVCRz\nOrd7N46vGV7BNvJ86XdzjiGSGgjQxcLoCiFV+O1J8kAfOJeg8zP6m5SZ0Xni\nE5sDe98IKyysVjRtXpPphx/AiRWZNNx20vXo0FiZx8jJ099TXaTeKsViY2EU\nkAuZSraoCAWdDe1w3j5Kb9Dv45GpfQuhEkZYQIwbSMBxPAnjdHOAHKR1Ac9K\nJCjibAw9rgVQIIu1HprC+FcC3BGsZBMawC0aEYOW5nqbZvFV/NSkVmzw2Pxh\nmQq9odwoiDykMaDVrPi6duwIzypQ2JBmSr4K7HxDmAjsLAiHlHTXsWpolIEm\naJe3Bl2v8RCQTIw/ymUCetBInOIcAsft+mbSwtmrm/OEIFfQcjLom/WMmaXj\nuhga\r\n=HwfL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"dadda3c8df3c0d6970ec4a938020e7b90d587550","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.28","@balena/jellyfish-environment":"^2.2.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.6.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.31_1597362204199_0.7440944884747425","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.32-renovate-non-major-5ccc902c4a6097d9075bf26e48939b81db47dcf6":{"name":"@balena/jellyfish-metrics","version":"0.0.32-renovate-non-major-5ccc902c4a6097d9075bf26e48939b81db47dcf6","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.32-renovate-non-major-5ccc902c4a6097d9075bf26e48939b81db47dcf6","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fbbde3a1343648d1d0e7028dcb135386483fa4ff","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.32-renovate-non-major-5ccc902c4a6097d9075bf26e48939b81db47dcf6.tgz","fileCount":19,"integrity":"sha512-YSpXUu8YBjdzRX+PZ6qrnZCacLNfyxVmGRom8MuNwYN73Qa6rputpO4M/tlzHQq3QzXINyf0JLsu5GBfF64sPQ==","signatures":[{"sig":"MEYCIQDv3mimR1wpoX1QZquVqaGGf5VFyYM0F5oTfwkbR1R7PQIhAJ8qhp9NP8qo4wIcW3bWvOp37FZ8KhLrizGD1oCynZtT","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80213,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNdExCRA9TVsSAnZWagAAtmsP/RyW+g2E33DAtMpkN7CZ\nOLtnIFb9NOCL8QLJyO2WYSullY8x990d1sUAcbns5SokgQI0yZAVpE6evnQI\nMR1+EjUv4FmuvRWwPN0YcG8NIiEqQCyWHNJNUb/q3SNFfyVFaUzwiroLw5vE\nTsmyETTCmx5lr1VqkEv2yf9WCo43lx33c0XA6ViKjvugiRLpMetJCfRL1Sh0\nirDtgS8qOs8FWg9uttlSrjw+oRp0l+e+4qvMFsdNDF3R/evNPInW3b9bgby8\nh+Fj0QUCpqHGxCoypN3r+Xgt4x/k/oCMDqosp4qsftcYL0erswbsjGmDiYdX\n6IgVmX3cLN0lN7/79rckDIfS9TB6WrVYZirt6kk2gjDVSiUJLv0F4KsBHZ4F\nUeUBnv9hVHBwbHP7d6ywXayCVZ0fFp2x9CeIPegISPpHJ8rc3CmbSJtSwNDD\nA1V7x55c6H3ircc2wB1XlMpJNkDn+RPU1K5YwbbXGD7pO/8+2Yu8aXXDyVHx\n1MjCepVBPggo8w0eDGT6rD3Jxu7z82gex3nWEpiRQVgPWQc3/BO86ojtIbb6\n2Lrjx4YRDnQQbnTu2AbyYmsYVv5Hl5ZW5/jnQAFiKXIYdgH9chNKLoj6tTii\nB0pryvF9mJB9gSf9mVAPIaI+5CY65j/9zKll0boFop5GKDcQ/7j8TtRt932u\nj2Op\r\n=KXDe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"5ccc902c4a6097d9075bf26e48939b81db47dcf6","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.29","@balena/jellyfish-environment":"^2.2.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.6.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.32-renovate-non-major-5ccc902c4a6097d9075bf26e48939b81db47dcf6_1597362481228_0.6962095734904226","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.32-renovate-non-major-4060ab156d486cdcce68295cccf54f9b3b567ad0":{"name":"@balena/jellyfish-metrics","version":"0.0.32-renovate-non-major-4060ab156d486cdcce68295cccf54f9b3b567ad0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.32-renovate-non-major-4060ab156d486cdcce68295cccf54f9b3b567ad0","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c89b4a5c74afb330a230915447057828fcfde662","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.32-renovate-non-major-4060ab156d486cdcce68295cccf54f9b3b567ad0.tgz","fileCount":19,"integrity":"sha512-AeDDVmpVWJzdCCHQSCaYTWDxZFHaf+UcSCczbsqPcRZLCWcy66wLL7kYA/erwQstD/7J/GmQ9jgkDId3gqYx9w==","signatures":[{"sig":"MEQCIConGDn1LqJc1kZkf1eXyBpAwCrW5pytu9lJPmAyieyIAiAHO13kfeKo68FeJtwra0Vwv7Pia0JnJflGxdCDpAKD8w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80176,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNeInCRA9TVsSAnZWagAAr4sQAIvq8L+AUL6NOJx5TFYe\nyiBRKIxDm8cXQhUz9g86i+lf6+PLKmhRsVbFdWQM0nFaUbjrEcLsWXNqq+Dy\nSxY+iqUrN4+yTUGfVssAk3ij808wZHwSNZ9ZHw4QJMraTmbasuW0HfF/mIBV\ngANPAU4jrCHFtgVxaSJI/C8ldnfA5I2EuB7rc8VFjvQndLb+nxEjLYrc9dx6\n2xA/E8zJBXRxx0OGEYdDvdqWZxKgWPqdlfoMB2mVKf/S4NyrpvzmcqYQpuml\nuRltU6cULXV4KL6hgMKJomhPXyPIGpirB2VGOPkCTD4Wg1npUMPm+cbRKcFp\nHDr327JeYiNMxOYW25WOtbxXiVkgWahIxqORdi7XiN75M78+WJQ1CxWjXXiF\nTfKm42X98enDgE4ScLVzD9sbuseW5PMYSYmHhal0g2UDOFi1JyhTspbUSqn3\nBY0RRL610zJzRT8a1khEd7In6pJiZuhp9+9K8/5MISa1ev+jHZwlUi1/FVM4\nUZHiLYa/yw2nqqtu78lvWuYYKNRd4znKNUcDXguJvB5wNhxewxpaG4ARGQTT\n/uDpftK/bZIuktfHQC/1ySJ5iSFuNfL8uUGsBvx+n8nC6mWYqn9P7ZMgab7C\nDdunaSnzHz6AFZGOgv4r8ZWYa77I3JVbCKFuKonxB1SSuggucTGk3PWAONPp\n1tTo\r\n=p7zv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"4060ab156d486cdcce68295cccf54f9b3b567ad0","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.29","@balena/jellyfish-environment":"^2.2.2","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.6.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.32-renovate-non-major-4060ab156d486cdcce68295cccf54f9b3b567ad0_1597366822851_0.9585934623910919","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.32":{"name":"@balena/jellyfish-metrics","version":"0.0.32","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.32","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"045b1a3753b08eaba66ba887e58bde6f141ffa7d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.32.tgz","fileCount":19,"integrity":"sha512-720wsqwkr24LcXEpvfQHeKY/2wtitUj5xGDrCx2wtf19AxWjijrj8xycqkfdmH/8uVvKf/RFl0B9c1os2W8pBQ==","signatures":[{"sig":"MEUCIC3QGa/HIFIy8awnmdvs64Yw+kq1LKbg1BsVqBXlc1SEAiEAlWweRE2Mx3vQBMz9pmVCO5/1X4RNEaS/197aO61Hc4A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80116,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNhA/CRA9TVsSAnZWagAA+0AQAJLowsKvjCxjVPurQvPx\n3svYQaQojsXDwO7HyTqnRIRc4aax7B74vjffbO9Ii4JbwOaO1EZ0MsgoiJxJ\nI9dp9ZMK4IJ7S5eXXEEBB6zsv8RUXC+J5RQ86ODeOMgb00iugnwvzUF+Y9cF\n3tNyNrqQqUMT3qlgDgGOhglJop8BS3tPZ8atC01molT7Xgx972TPV6ey5l7K\npggg4lpWVRDGGn4GlYi6T9is+VHfaN3hdnVFUgzm6t1nnugL2yuQ0TTDxUn/\nFV3ng5UC5gESLX4+Pm5Fbu2OITQ7iz6Q9YiCEbuPgVyXjwM9fDwFuyvMilmu\n/KyqUxNXx+ZqiEjzbz4xBrTVnvQBsy17Fgxctg2kpgrU5bH1lNjYDVjQmkbH\n4ikrfOHm0+SK9H0jq16fPh0iil8qVtalxqE1f28CdOZP4LVkF/1WEy68YSsG\nKgg5/tmxdEChr2Ji6xiOCy8C5Obc5onL49mTJauxIGSYfV1aKdlp1jh8/HrG\n+uMwfG+anAGYNoNLQlpw1ZgdPiRs3XjHjOcVl8jdZJjmtumo1O+6dcQmuvjs\nL6yUIJCqTEAv1u5bPf8o5Au2a/4BtvPRnrueBQRjjeuWJmKb3+JbG+RnN+T+\nM1HIOYskgtOgMNp+6Q2uM2grIjvfA3/X37CdvYeMafdPjm98XsqkUkggELwr\nwbLq\r\n=gz3d\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"06fdf6ed2745d05c8bf0eaab7df27f7f75510df9","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.29","@balena/jellyfish-environment":"^2.2.2","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.6.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.32_1597378623215_0.10458226711220919","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.33-renovate-non-major-735c517c7afe7032712e3ba488fa31b0092ef64a":{"name":"@balena/jellyfish-metrics","version":"0.0.33-renovate-non-major-735c517c7afe7032712e3ba488fa31b0092ef64a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.33-renovate-non-major-735c517c7afe7032712e3ba488fa31b0092ef64a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ba5cea5a5b9ea93b802341d04256e09d28e6b16a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.33-renovate-non-major-735c517c7afe7032712e3ba488fa31b0092ef64a.tgz","fileCount":19,"integrity":"sha512-olf/UfbrYMkgEBRBI5LFly2NJ3XHA80hZkvMpfOxdOA2SJS72EnifajOuk3aac2JiEf0xV08k39S64A88LbIbA==","signatures":[{"sig":"MEYCIQDoBz3tLa3FSc8lci4nqnnSzjXbAzv2DXdtvlJHiI0BFQIhAPe/vq56YoRwGAU3/JoNtBq43ZfvzOk+KGH9LL4CXLIk","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80282,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNiFzCRA9TVsSAnZWagAA1JwP/Rn5fpy1H+zPJGZixMxg\nPNin+X8QgwqPqyMGmn45mjOtRkEG0if92BVnvXvPbiWc5BMdreaH6oEzR9yl\n4OoV4aFcJFHQ2upudBQfkvCmr0cJVyfivRQGfjYAmzMZwtaMF0PNlMxCxASR\nvEpRnTj6UbC9GA0eALygfb6cjCAsEOtK52HiaN0/UoNBgu3oHk+xe+Mylod7\nakaHg/dUAxoPa9vCyXmWNqmT1OVQ964ZSbVd4VNiHhyvYkKRjj9WwGFBagLN\ngd33t311341TRGX2WmfCiT6uxFQwAfb+XlKipstk6/lhKcDQNl31WLy+mwW8\n78UEAO4ezcInflIPgbg8EaT18JTG7qyP6pheG6hIH4J8IFImW4HcCr0Ja8+I\nspaALbuefaJ1AHtSzkECzGB9Y0bUn3o+vfRmA6uM+20KAMuN2aZszLtTyuIo\nx0EGgmenFrMoJKyW6z8cAOhZeEUV3Vb76zx8uvg37v4WCIi/S2aZG1G9sql5\nz0vUF6whgnTuUWU7oJ8ejoCO6ZFi+pqUcbQVUFLXCWtlfkpV7kV5CNZ30QoO\nN2kvCR/eWQMdSctBgl47GRoXAB9ZtL8kam4o7uOto/MRNb30ynfv7FaVncqH\nj25ril1f4hj5Iy5zchNb9eS/xyc8OgoV4zJy71AOhH6zbnRbq50t/sS9W5GB\nC1PU\r\n=zuCX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"735c517c7afe7032712e3ba488fa31b0092ef64a","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.30","@balena/jellyfish-environment":"^2.2.2","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.6.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.33-renovate-non-major-735c517c7afe7032712e3ba488fa31b0092ef64a_1597383027447_0.24985311310456648","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.33":{"name":"@balena/jellyfish-metrics","version":"0.0.33","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.33","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b5e0bf3f87d27c6dca9a06589dff75610d5356ab","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.33.tgz","fileCount":19,"integrity":"sha512-agqK7qfKSjEEETcADPp+mh4gK7mSX7IQhrwDelnSNtaagywQ3di53o1LEdql/RIuXozRyBTmzFwuofCmqYyGPQ==","signatures":[{"sig":"MEQCICxNf1dOwhZ1YaRntPvQQ3pwIVmc7mVij4Z5X8kCZTgLAiBELL0fRRh1cMCAMDQgz1me+rIq6DOLlSTnXqxI6jDkiw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80222,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNjj/CRA9TVsSAnZWagAA2VgP/2QdicMFgFI2INqrrmGQ\nb0yZ78gidqkazh6kTVFb1sdbyJ3QHiTR7PfaiQrcnnt6CsKKbHGvN9jkjS9P\ntGnL2v1dZ+cT51E95GOwch92nEayxLEcaGSoKthJRtCgxGBq/ZN9uVHK40AK\nV5jU73+loUC1iirm4Z+9qNaWFthySwRi7aicyR8a5M4dk3MzYMjQ5J3txJlx\n1lFxdBalwOgjZoiVCdHi6eshjpT7phTwenk3qV2olJ7HwJAs26g9vKiIU93s\nSyUfZI1u262FKKOs0qckw86yJ9H3sufLOgF8k+srtJI7YT+Q8Ij8Ojdj9lSJ\nmAvTMngNHFr0lm0yfFvLm5P30GnOuxVUoT6MXj9m4AKy3cs4qPY7SEvzhm8E\nOpKho9feGROwGG/cLmsjzzGF7Dnw73dfHONQ2xZ/tpnxeXXyUpj8TeGCcJVp\ng6avCWegFxqhTcxtlXqDRGE7mreCcyYzCFOL9yVg3i5R4OAUqiZpF4GWLOnP\nfbwU9Plc4eoXCBBbR7y2fFZWLGluTFs8PSIBgx1Bg++hh4HmWDvRNzao0k8w\n2tFnsbusrs2X8nCAwVqNM24lDJAetx0cB9JSe6fwSbvHZV1xanmAuOWiTAfO\nUpEfwII9JQfNB0nRG+b/K92O9AjWrPz4cwAhAmERd/p/F35AJnLFE0QjMfao\n701Z\r\n=YSrT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"ed0855e756c524598aed622e405a5258c240e55b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.30","@balena/jellyfish-environment":"^2.2.2","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.6.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.33_1597389054963_0.6278441423140482","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.34-renovate-non-major-0feb4b4cd2b5120ed519883b929faa25901b0089":{"name":"@balena/jellyfish-metrics","version":"0.0.34-renovate-non-major-0feb4b4cd2b5120ed519883b929faa25901b0089","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.34-renovate-non-major-0feb4b4cd2b5120ed519883b929faa25901b0089","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"983d7c52be1d0d018f5dd4ef09437bce91564c5c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.34-renovate-non-major-0feb4b4cd2b5120ed519883b929faa25901b0089.tgz","fileCount":19,"integrity":"sha512-LL+Tm0fdszj5r5LQFY7J7HvhfgXiXDvG1S5RBlcVG43HolxnEfZRx8WAcxDBhPDNDHvGrkcOJKsMZvpl3lfHeg==","signatures":[{"sig":"MEUCIQDH6yLhuOXNhY6ILJDWEkiAluYJQgvL57bWTza5/ANGFAIgVuwv8oiWTpEKzjx510vCWlNnPUGcZ+AHOIgism2VNOw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80369,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNwgTCRA9TVsSAnZWagAA+ikP/0LffBVrpmgVskWjMEdk\n47aT4ZsYFWYCjCjcfDJgGamgvFjz5P4juQY8ghbkh8P7hElDFCqls2Sf8sJr\nCFQ4GfO4bmepwwxenS8pYVNX4yjorU6mwhAtqwFFqsY3ivXWH32cB89OZjLs\nIe6GKz1wuRQUZYO2jIUHs/ieDiteh7nyPHtz6lyiDUu64jqX0OQJTkGuGKGO\n/aklS8YI5AZlFaRNRdeqMG8woK4zJKPxqq+dcsn8ooEZOlE/+68jPvjZfBa0\n6emdwpyGWk3sihuJumqJOmYzpdOuMYkgIlxixL1dJXTFqVWchoLkBhY+W9w1\nakZrNm6mZhvHO+OAoHkIUn6BlamS+LZjSzU6dW64y7GjYuoQa4FqElE24zrm\naVeorR3GoEdg7N3jqixDKkBRbZM6pR0osaNrzXIdxScHXDJhnxcT7DVvNJQw\nOtVx0WfYZal2LOs33Mo+GCKKTp9152+8B8lw1P82WVLH8T+KxVTD3pZaE3Wp\nsZ2M6rDyOkEWY9mzqlxb6Xai77Q4qVK3x1E/FFvk9xIjkKY+4MwwnD5cOc5m\nSXKKZHj9sOOy1Wm0lkMT+e0Lb9PAzI4DUaGO33Ka6cPMpBMJ/gL2hcOT9zNu\nTK+AXzag/GuycIgeH1Qiid0tBXjdxJUj8DIVpgxrKyESarN1sLFtImPQo+bm\n7o/j\r\n=M2ic\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"0feb4b4cd2b5120ed519883b929faa25901b0089","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.30","@balena/jellyfish-environment":"^2.2.2","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.34-renovate-non-major-0feb4b4cd2b5120ed519883b929faa25901b0089_1597442067109_0.5259393706031954","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.34":{"name":"@balena/jellyfish-metrics","version":"0.0.34","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.34","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"798f36f7c76be364b29185b5ffde06d10563ec28","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.34.tgz","fileCount":19,"integrity":"sha512-5DI7orqKFey8+bAPkioeNRa6Yf2orSvrS7nGvqetEAB0vT4KrMPJT+WuaKHtOWCn4RS/T4roXjLV2kGb6BuxGg==","signatures":[{"sig":"MEUCIBTpqYZcfbT90Ralj9wH5g0h+Y0mpbG7S3nCjS4XyGWDAiEA2+3HNhVqlyLfgjI4CzSt94Pc2KYX3NYIw8ZehWT1sSk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80309,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNyfVCRA9TVsSAnZWagAAP4kQAJbvztbqvvdJPdXo1slZ\n1eT9a5OdrDUhpmsyB4sBe9TV+U5rcNr9MolNJsFpQ1Kqr4G8PjmqFpEIn3lS\ncobTLmXkP3NM/v3UPmUGysvTg6CvbHDa6rvrngUiG4mxgdw2kYuX/uejh7bi\n+QagkuWknw/6x2G50UVC/xEPc9cdp3yRnvZy52RZRrx0NL8+Fn9BaQoiwbkj\n6pDImPVq0fkDnEKjbQBYW6aFbTfP7leoOnR/1aFmrT+VNMYdMMV0BKMWLRM4\nzaWuSCJKXZdOaq80HZOkzb4FTRZ88pZ77qGKIDVWgkZAepgnD000oAHHfPpJ\nL69pmCNM2sT17xnOwqT2DWn2Ez/MrJ3DqvV0056JzJpEqDu/mIS7sFtZRUZy\nG1y95KX7tdqqNo13RZCjM44STBay88fqgzxulin5OmQFJ7ATWabBOnfF04CQ\nMd66wSWGSF+h0OnlnC+5Fj1oXIv0rxGHMyKs0MTnj5JJehqPBj0kCiePftg0\nEEgKqD66NaL8M0cQhR0BYXz9NMk78PrV0wZIoa4l4z8IcHMoKMyUc3lk0zYr\ngrs8B/LdwWA2JeIB+Tx2c+UfbRROCiKJ5Jj4m1vSQl+XL/B7qIniaZogWK91\no8asdZpPYV3zKD46xwcPm68R5LOGRpPxcf6hgZvFlXl8Z/UjImesSKQiWT0R\nLHGd\r\n=IOUE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"197c5f0764fd8cb274f08448dc15ea4a9a31b559","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.30","@balena/jellyfish-environment":"^2.2.2","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.34_1597450196510_0.5935168119416434","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.35-renovate-non-major-af06294f1929a9bbaaea0f9e285c8d1290254839":{"name":"@balena/jellyfish-metrics","version":"0.0.35-renovate-non-major-af06294f1929a9bbaaea0f9e285c8d1290254839","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.35-renovate-non-major-af06294f1929a9bbaaea0f9e285c8d1290254839","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"84b74d010aa4f673f917c8c70190ff4f7c66f879","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.35-renovate-non-major-af06294f1929a9bbaaea0f9e285c8d1290254839.tgz","fileCount":19,"integrity":"sha512-HOXoW4zaXb+1EB9S42+zWTjNlvo+EfWyo191osUDTtEWXOAKA+mFU42SFPLhx7GmPYgq3a8RsdPJaiTiHId92Q==","signatures":[{"sig":"MEYCIQC1VD/y3b6Llb/zmVee0x80yvqgXkHrtF7vxtoOvniaRQIhAILjszkKlEeV+CubBrhd/qPKG2WsfA4+Y3rMYCDkqmXd","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80438,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNz7lCRA9TVsSAnZWagAA7+wQAJfovRkiXvXrbF1xod3T\nM4MacIMkOfhvcPvQusXW2pw7pQV510E9L5InCYIRu+U9LF0DG9FDuzGoVm2z\nS4URwPD889gTNl6RmBBvHDhP4aUZ2384etUeLDMaZUaMpXoBlFhNYRnLw+0M\njE+quLhA9Kmp2aQmUR1fRMVf0i7Y2RM5b2t2JN2TkpmkLnC8Xf+2S7Fgu1/O\nHJMhBD/sMWmB+axZhRhJ9pp+98tfSQBAFk9qo0VxR+PSUohT/4oTPWC21vXg\n2yHnMcPy+Jk/2TpILcxLAFVC8qOrjPlFBNdnupVPiGKgqI16BBGjVFpauGgK\n5EcdPU7shv/FCkCTIrKXCL1OzCyj0eRE2VkjyES+vMP8awwdTNp5/LB/MMF3\nPR8hfVqsKu3BtF8eAACKlm9+MXf0+XtCgblMbBO405cTCR5kpQGz2iTFEb+p\np6OzKYq6tDHfIRJC09CeKwr3nogmQ715u3bhEBESXeUpWM9RRBnbTvxdYb6p\nuc54vy3n5mnmZjqwrQW/27swfsLAp8i8yNpGVTf+hd1Kap3c4P1cVWzCzP35\nDQEb48TsLLWB4X/CozKLKZWZYWfY0zCc8TK1uN80JlNOChF7w7Zc6mH6WICN\nGq/sxJ0+/otfupKaBeGOHHC3688avzHPz2ZqZ5AKVJdr+sfhZkb7sniySLbO\np+/z\r\n=1oO3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"af06294f1929a9bbaaea0f9e285c8d1290254839","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.31","@balena/jellyfish-environment":"^2.2.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.35-renovate-non-major-af06294f1929a9bbaaea0f9e285c8d1290254839_1597456100716_0.9543797507499872","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.35":{"name":"@balena/jellyfish-metrics","version":"0.0.35","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.35","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7a50b14ef7e5ef7c0b910cefeab188867de4cad4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.35.tgz","fileCount":19,"integrity":"sha512-iwdqh1WhLfiNHkpiencBqSWZvpRJKPctUl3Jru85QkzqlhuNa4wGQxDOt04qmO9NXE9iLor4phkXxWOeZ4y3xA==","signatures":[{"sig":"MEYCIQD28W/bmNQe0Fo+9f9PxU61H+um3l4nb2BaISthNp+bzwIhAMMAFQRzvMmxYS9g4b2K5e/ZR3AkF8845Rdg2R08t+9x","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80378,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfN1qdCRA9TVsSAnZWagAAHZcQAISWCabG7JRL8whMgt8b\nTgijlvNNBZdXRWp1XKhxsDq2CMambCLf7zHo2wZhGOr7ZXvQHKzwhHb4YTml\nkwaecvwMq5M89EcA6MxlBofq4efQ9kII10caN/wkTMWijuqHAGi4ZVxlP3VS\n7Bs/HyuZAImd5h0ly362k5rmcIax9SH837jqo5oV6Uoe5ZJdLWxynY0U/P1W\nAPWtw6ZzPlc+wYgO0ZyYvsFnLCBDUkCUrmfRF9pVDSw/xPp1Ho4o8VXp2hw5\nxMIZ3ooBkFyhY8FCjYwATiIoZ8Zc7TVT/OsvWuPnxG74QyZEVORzHLFXpJpk\ny7hvxsvI0omOZEuL7fu83fE/pWiVcetVz+9IIC3z6J4Qv8Psx8nX3buCZVR+\nNWdhUiRjVbhedVt0QUdvhnV85kMbPqF5iGkuknEIuTMYzMuqoexEIW6i/nLP\nqOpaHifgECBxjJbQSICLcZAAf9IA96Z4Wikq+8jyRgFKS8qi9ZpmiZwzS3GW\nIbWNVre4HqEx7wmT5mbDEDeCUlxsh7NQ03KWHtYNQEn7fyFVB5l36bmjEhji\n2NzYZbeB38Oe9f8+RQbItLX8mM9w5z1WCpcOtzRB2Z7uJjmgQKsHJQ46I1je\n+cm3QXvGUtIcPCnEbuIvMvXF9h+n2Wfpq82HyLvyE5fHkSj0Mh2IMaSqn2N6\nkPOb\r\n=F++o\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"8c9ae5bd0e1cb049768de917c11a761b0123da9e","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.31","@balena/jellyfish-environment":"^2.2.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.35_1597463197368_0.6705139726784048","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.36-renovate-non-major-91d602b5592c6fefb6a337871e56caa0c83b650a":{"name":"@balena/jellyfish-metrics","version":"0.0.36-renovate-non-major-91d602b5592c6fefb6a337871e56caa0c83b650a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.36-renovate-non-major-91d602b5592c6fefb6a337871e56caa0c83b650a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5978a799745b443b0cada40266447d7ca41c1a67","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.36-renovate-non-major-91d602b5592c6fefb6a337871e56caa0c83b650a.tgz","fileCount":19,"integrity":"sha512-45D/S5mtw+dFWgfMKVVswJdAiB/kpl0J3A5/ef1wV7aRnXfV0sDgin31R2QvPW9MyAJgQs8mG6cpMvhUp/idRQ==","signatures":[{"sig":"MEUCIHyHsLZZj9GUDHqRsRMWY9EzNVQ3y7wKigcih7wOCG5VAiEA//qRxdHRucQMvbhIM+FS6QiFOVCTLsSCED6pHigIusk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80544,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfN2g1CRA9TVsSAnZWagAA/AoP/iEoNGZsNOhwPh6u8DnP\nD6oO9jVD6LBWvIss4ez0lMwHiR/Mkutrv3WQUOgfysRiBzNT1b2OZkBxr99A\nkC7ZFeMIwv5jHjUPDutSFFWSxqjwkL/ObDmh8zJE0xX1doQz+ls+I97hbIsO\nby9FhDDERDIA8KZl6pOgFbTvywMhvh4XwCA98Ldeo2jIk1Jc5IvvhQbEZIX2\nq+PTUYPduNL4Mt9i6slmEW8pbMGlqIegOAvsQiR4NBdgx+krd5rsHnB5AOzL\ntyITA9GiL0cT1EUNCPJHG3/rz8L5QhU+pGrfm0ujAz34F14n2Yhj9+Mrl2Yd\nwRYqsp2+vikwE3fDQ9e6Y9SANGkTU4wCPiNds747Ero+bsgrgJjw4ycipVeP\nq1B/SfOAVO19KJPyx8SjSLIAlamjkQVuRIf6yOD98WWIUTz2iv8GOL2nZ+xP\nr6VwCxrv4WvP53gyvJKrWLM8D+Di8bEdo6LTOTgR90y23RHYSeMpx+hvE7mz\nz+IicZLbfeESb3sra+vxFmBslShnL4UXnRbUXn1LZ14hV70Rf+igt0cPrkrR\nwSMtQ5/C+kSDsrT/6V6NzNz1/oN5maHtVkexpDEX1JVkX/SrSSmgddm5y4OS\nAylphtQHkBMwn7N8SYcqrrgaBMsnNCI49rSjckWYud0FSKtmB19T9cj3Fb5L\nUvg0\r\n=Vx+x\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"91d602b5592c6fefb6a337871e56caa0c83b650a","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.32","@balena/jellyfish-environment":"^2.2.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.36-renovate-non-major-91d602b5592c6fefb6a337871e56caa0c83b650a_1597466676441_0.9331457037201807","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.36":{"name":"@balena/jellyfish-metrics","version":"0.0.36","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.36","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"713e5ff81bee2f5d4c3bb32bb9b3ec76c00c2995","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.36.tgz","fileCount":19,"integrity":"sha512-p2mU/5VXzrvVOcW/aRpckx7+1J8vSFNV2VUE9xKqyOQ9gkAovCi1xuMBm8+wZAnmbJaXTneA5sV3K6EAqS9TEA==","signatures":[{"sig":"MEYCIQCrjtrMFl/ZvYi/0N85rEkccT3LS3CsWEtwJbKNUs3hiwIhAKQ/z13fzG073XoFaiC3NqaXq8krIcMgKhN9hGH7HDBf","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfN5SECRA9TVsSAnZWagAAdaMP/i6vvtAzDrCIqJho/XIg\nB2ytbnfD4iy8BT1t/Dp0aYMOQFFq5POiyDZe5GT3YTgTCStAbi8Js02T7c2J\n3IWXLx5RmtFdQps7ntGwGJPk0TeFdkGb5okcqrVUvwN+UyWPMYGfrDpAD9MO\n39R0Iib0OoCEaSCfwtvhvDEOJcokO2h9FOz1VJAHGxDYyeO63PwW+ObdK+au\nVxf7i2SGQyZhWFi87DkLNkWzhfSWEYuMNtitk6XIeIjX/xImzV8X+i40Q4Tg\nSYGrGkw0MJzjq9l0v4xaqkZ2slAH7Y18HCQn2lZUMhArozGTQSK2u9i4QGEc\n/6AL9BFLMR8gRbHcKYIpibza3+b2APQNKJHMecK+3kZHWaRTVHHfwokVZlN2\nj0eiKktt4mzFPQPjXRH3SbE0U9Mt4stnrsKeYvkdtWXB8SNZ2uR9wDXouIFX\nIGdasUWaCu7ENMCu6lYjB9aI3sakzrfkMJ9ltfhfs5fe4Bpv7kDHGSU/L+jc\nfdr33juUSexC+JF7PIdwHbtfthcBzl+NsHsng5Qu8vSTcBWTTML7+LDs4bks\nOgpYsoFxcNPel31TYVEJxKE5XuvSvgYHiQFDRDTNR7u7LBWamdey1Ip2KKyO\nQutyKD6c9sOYMWsywlCTD5XtwzCVS8hZqpy0ey6Y8raeQW6KwbYQgRzcMdHc\nRzrB\r\n=kFIA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"6aafc58912bbd8b57747ae02fd0407e53b14c8d3","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.32","@balena/jellyfish-environment":"^2.2.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.36_1597478019573_0.056519570393430474","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.37-renovate-non-major-06c509b06b0d6c56917f40e410d8724a946619ac":{"name":"@balena/jellyfish-metrics","version":"0.0.37-renovate-non-major-06c509b06b0d6c56917f40e410d8724a946619ac","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.37-renovate-non-major-06c509b06b0d6c56917f40e410d8724a946619ac","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e125f8fcd7216152f882f03bcb3f5a10e96a49f8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.37-renovate-non-major-06c509b06b0d6c56917f40e410d8724a946619ac.tgz","fileCount":19,"integrity":"sha512-mi83Od4rFT8a0QjfMgDADHswkEjZoMsCjnofrZQrhsUuTKGQJqJo7J2qndpv0/ZmezXovrNcF5APStRp4Tor1w==","signatures":[{"sig":"MEUCIQCDT1HhdwFS4aXy76O5n6jaBiFdyOfUvxjdKsUOwCsO/gIgZ/eKOtzHjz0areTM2GkyzQ8CmHNcwGH2E/43Szu40Fs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80645,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfOJvzCRA9TVsSAnZWagAALKUP/2oGV5mdIowH7dyOzPxZ\nW+GJP6pIYhihR3NnQ204gn2V2i7kJqSpwhpJg6Haw1aP0OOb4f1qiKvB1IX5\n6MvAlC3u5HIHkEG+wYBaPTqNXrIhTdy6yIzyo5FQtMxezXOCGIQJz04CrMOG\nla3PYMjvJpsiaGKDahEEKukhcp3754z5IhKVOjOFp2rwl1YbrPM6vpVCZneg\nCn+HRed0YYEry+9Ox/QkdBY4lAwfwpfSjsVlmjvuTZ5EUyXlbA8TpdtfoUh3\nrNT1fLmHIB7rIGcj66eYRVI8rK0zEV7baG5w56QHFaFEpDxhfY6K3X6/1fFl\nHBK+Ervpn1GjZpmcEr9FstlrYz05Z6hR5zI6UsQaL2JpZulkHkldWn7P/F1c\n6ZbzJKOpbkK8bNAOAEzj4NATwVIMINBBDfE7+0/pOs62k9dsSiQso0kSaS5V\nqoM8B/PtNnqO2u+Ngx9WVoxSKKS8UvcIMYXYi8bWZvrcY/1XD5GgpDdqsPfO\nKNJeqDUjYaLlMpOyZI3ccfHpblAnDyogSxhxt1KFDs/ypa09Bb6nfDgGEuOG\n5XiO1xNc0aus7Y/WuaMnVaBJQGuldnVPGyAd5teM8HdrTSrBlh1FGDZhA3a8\nCjzn0uS+AFKE59rDwQ/EK/mLwFo5S1QAvssM1HnMo9zes6przHN5b7VP6EwV\nGAd5\r\n=uWiT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"06c509b06b0d6c56917f40e410d8724a946619ac","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.32","@balena/jellyfish-environment":"^2.2.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.3","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.37-renovate-non-major-06c509b06b0d6c56917f40e410d8724a946619ac_1597545458744_0.042433005234030485","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.37":{"name":"@balena/jellyfish-metrics","version":"0.0.37","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.37","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2fa9489c85b2848601c00537a28fe96300866389","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.37.tgz","fileCount":19,"integrity":"sha512-vPZ4MwVMD85tgNX9Yu4/L9Ksg3sntdNbhh7i7JG/7K7S+4XOpdEgvLlaw5O8JEicgJo2gy8C+DOs3YXCZHJa7g==","signatures":[{"sig":"MEUCIQD+Jz4Ad/FR0eqBMQSUX9JzCoe8uBsOHBx0zH24+2NhiAIgdj7a/uYflt+fr1FjCmyrr5a/JTe2RldCKySW6X3Kadk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80585,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfOKl/CRA9TVsSAnZWagAAPVUP/0M4gZGxAeHS/pG+efNP\niixmFLrrbEB+7jdcgPyF7Cfsfrv8jMtPsf+O88noM4nbl6yHRwNSGompasS+\nnMMh/ahrFpwCi9ZP57KCk+F7cmlbwp0H3IIyTopEeLh/cGMOBQ7LS9vE2UlY\nr4hv0JOomAPFgIjdL96x0R2vvLX3zUsH7a67Ps369eX6/LdndLRdjN2R0S2s\nwdAeYLcPL9FQ1eOqbMW7t7AuzU5ZqNV+QfsHunqAUsgH1SB5i6rYmhxRm8+B\n3n94Yfv8vxAjhvlCW+4cMWiYvh+O9cCQACl8H0H2CDbGdFJymsoIbqYI3K0I\ngKqUJaZyIUyW4Xslc01rVrJlv6GVO5AANSuOyokc0i04awh2SmarFoL10rNc\nd6uS/6ImXdadaMXmj6T/SL7xcXjHSfDIPnjX2tb5Q+yhEzL51K4faghhX4Hu\nrFvUBUDRJ/yJiQB+eSk5EZIiO5kdE8WSuDpQLzBk3TtqCFneZA2eWdfs9Bty\nYK0gmFW/L5/Mp6ZxKomEBMK823/Xv5sn0meY/Vl0WRifo8zRTtusybdvjoxb\nRAuu7mmNmLwtIzsB4zsdE8ZxORd1MHwGZoV/dUa06IHT9nbJ4+Izl4sTfsu8\nm8akwYjgdIXN7tZP42m/ljJEHceS1w3tHh2wGSzspjtw/NtAMvVHY8TnuZZq\nmiY+\r\n=ud+p\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"f671ce369970e84a1c94c97e7b7718931ccfb1c7","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.32","@balena/jellyfish-environment":"^2.2.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.3","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.37_1597548927115_0.7363985860266344","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.38-renovate-non-major-04536eea628d94cd00a222b2369a7d24897b5f76":{"name":"@balena/jellyfish-metrics","version":"0.0.38-renovate-non-major-04536eea628d94cd00a222b2369a7d24897b5f76","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.38-renovate-non-major-04536eea628d94cd00a222b2369a7d24897b5f76","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8991c06b31c9beb73d1c179e42f10831d9f2b144","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.38-renovate-non-major-04536eea628d94cd00a222b2369a7d24897b5f76.tgz","fileCount":19,"integrity":"sha512-bIHvZ4NMffZ7E7bgSWU9kBhfOd9zg1X8YNRdBVKBEA8hMmUAGY6xkcw+sy4TzzMpex2zhVdO0bpWDV2vUchWlQ==","signatures":[{"sig":"MEUCIQDltbi88m8CuJ2QjzXBNw4PPWDAIZlI+vFuWEIPSSm3jAIgJofEqvAceCRHIYa+W6Su/MnNuE5sUJpXx9+hodf0/wI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80755,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfOKqQCRA9TVsSAnZWagAAPHkP/iPQo3DVi4YGBcMoZrZa\nmkJZ15EQrKmgSE+xDAVsHiwG5BclAk/uezxB+yN72FodvdNYosoBwTYZmo4r\nCGfCl2D1DnIPOOyw5oBjrXo2zdoMHqxdM92c8IujBuZu53MDGlHDvjimh11/\n2EvpKrlDlm2ovxMJooHBBi1GNhQPSvTjLT3NSYVYoI9Y4VZdp5VCc92nCn+P\n5MxhIFydkzroRBTQ/+bSEaUxMKm0izMGlNE8bCg+D5QAfXYquy72lBMiEp3m\n6DxVpPi+RCDIiZh5xE++Gr4qiIpf2w29LrWVpxNywY8YfaMFDKXlW4ttXGkY\nk7DnPQW+AIA8TAmR2VAipx2GSf6yq7GdPbCar7ZCJuxvO425JUFwe8J7ZUfo\npYXIRP/7Tbvhy9I3+SMNeJ60YNd9t+Ac8y0x3VcmWClL+IQeSpsXb8ZIqYQB\n2sygX6yeX1kPNEwxtNZ737N7mnca+Ft9wbfkT5ToeiDDATLQKh67YsFZjzha\nqGoHzO4eREndzrTrWTi6Zi8B60pr+Wi9uww3bUNZgU+xA9wKGD7RZLq9sMaj\nXuhbBMnN5eXKnzdA+97T7DkIvXy9V+QNHA6wQqj3zSLR4i58+di/kz0eO3mA\nw1S7sfcn/FaMkmna1NN5a+EGwbKlCPpkR4lTSl6ku7ZUxec0r44kfOolKqf1\nGUI/\r\n=tQoX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"04536eea628d94cd00a222b2369a7d24897b5f76","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.32","@balena/jellyfish-environment":"^2.2.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.3","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.38-renovate-non-major-04536eea628d94cd00a222b2369a7d24897b5f76_1597549200162_0.3692570293666868","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.38-renovate-non-major-0b8ec55b064f65677b7548d3a8f195cf511bd205":{"name":"@balena/jellyfish-metrics","version":"0.0.38-renovate-non-major-0b8ec55b064f65677b7548d3a8f195cf511bd205","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.38-renovate-non-major-0b8ec55b064f65677b7548d3a8f195cf511bd205","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c0be9a9032a362af0dc74f87e483d68acc48666b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.38-renovate-non-major-0b8ec55b064f65677b7548d3a8f195cf511bd205.tgz","fileCount":19,"integrity":"sha512-nkfQA7viVZ6WBMDXlgMWVPJCSF02KmKoRcq1VXG7E4R4wLL88zfHhd88LczRBf1pkjANhjPsY3CPmhaPTyzZYA==","signatures":[{"sig":"MEUCICYaFbLIjsV6NIHhcNgyGhocqLjoI/tSiwy6vvNiSN9RAiEA93+MNUd3RNQY0dgkoAREerJCYWoGXs/ejJRZ5ZmpMH8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80714,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfOKtoCRA9TVsSAnZWagAAZiwP/3gnL2QUSKXs3Rkcv/Il\nXQ8wkdrnWcRrxsoum8pi05QNpSP9scomxsTzTqOIemL1TCcFs5iIUCTT1KgU\nNmzJVA4h/sVRAHjrvckPltKnmsz2YGO2FHShUAZAcRNzm/Djcy1CJNVQ4rd+\nd6KT1o4FqwEcyPgmoi79Frbp/QIsek3gYmzqqDLNWNzkTCn/l0lDCdkHZoH5\nAjfZzwfqxKCI3uNI7JiuVTiFdXBa510giOOfgsA7VAkLFs8dMlaUlnx9uabT\nbhN+stpGSpXd3ZWJw2M0gy9VNKDKbKaktLe9SKoIneLFmXT/z9tlLCGTmUj7\nqhFy0OJFUAuCIAGkwOGRFQ3+LH5MEZRCisvQ2y1prEI1x77HLg3JypjM1gZZ\nsriOcAiBnd3008iyirGfTDecIoPU8ivrLYKTyIV+z0aBOTni14hw2LPxmiDb\ns91l6dj7cjBsYYPiD9NC4NnSTbpnepElw/SHSmYpM2/68GjWPTl9FU/+CLg3\nHZ086tAR5L89jSQ2H16cdn9cJ7nN1ODBo4MJyzlJi95khLMmV7baJ2B/gNus\njecBocQybVf0qlSonJV2K+deWGRklxObo/Zly6Sv7yVHgTsZeEoBhOgb9eZw\nTHyJmBZaRrYLilehqI5qIQ+dYEIOTsc/XmHmi3rOt5CNBhGtzoVvmLSEHJO0\ntK8J\r\n=bQh3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"0b8ec55b064f65677b7548d3a8f195cf511bd205","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.33","@balena/jellyfish-environment":"^2.2.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.3","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.38-renovate-non-major-0b8ec55b064f65677b7548d3a8f195cf511bd205_1597549415569_0.7115707046656388","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.38":{"name":"@balena/jellyfish-metrics","version":"0.0.38","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.38","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"af231dc418063813627b6366844aedd5422b713e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.38.tgz","fileCount":19,"integrity":"sha512-6ccWNWp/Bsa526i5vcu+BXTV0M/TOeKhGnWnlpXTPZWZW93RjUW2yHzqnmWaOddGEbZnNO0t4tqZn7Oo9PE/4Q==","signatures":[{"sig":"MEYCIQCg5V5s+AXE5CzTRWWC/gTB0er0zOC0pWgequP3o9LqLgIhAOl40AaORH5wXc0B+12bzvajlWzq6f1ROthCotI6cuBe","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80654,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfOP1mCRA9TVsSAnZWagAAP2EP/jgaOLs6p3YOZhDmFHub\nHqDUh3/pVINBL7PqozVAklI29j+eN1vRw7DS2wQ9bbBKFYR8DjheqCSgH6qs\n4WCHEstl/jAu4R/KobDGOb/U07bGwLpd0w3JsBQtAekppNMJswEAuF1Y9v/4\nIkLBf48u4/SJ6/hHd8w7UkybqzsRzpEaAD198dGjuaJR8x+S8RusjUBAf4VP\nnjcWH1kov/myVhe2+BTsuqUW3nfRbRIWKP8dLUmSJpEznsacty/EF5N6U6gj\nlAIg5v4Z2pxlJUHelYCH/1u4kSJfwcTnDwPCOBVyQGkkE+6dcBFenoEUmmY2\nMthBTkXq6PFbT4ps/LDgb7gR1KqLuT0Rmhk8CPJ1pRTLYz70Sj9nJXNfp8IV\nlQqN/kRUqM6Lidd066GmT/AYCmxL9u6ze5KpI4KZoQsrdVui96Iu8N6K7VX8\nxyCgJOeXybf46KojXkSHFBHBWL7oP8Su/sVXGdnEhAWojm4iKLG3sT2WuX+Q\n7tTWPebsA1+WMgY5lYxBE6ybLJX9S27E7S5u+iHtjZb+pYn1FbB7hkPVKimX\ndw+9RVBHan/JIL0s+BBKmlkP9rN53LIMrTMIY7UTknxQgWckuix3Wa/n9RCQ\nG3QTBtEZDiWQlVnQ9jHgdhhaGrBYmzQTxEep2h289Ib7MPwZtE9Qo03yozPp\nOxYC\r\n=ggA+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"03ec6d169d4572e5390b7d957f73fc127e2ca765","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.33","@balena/jellyfish-environment":"^2.2.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.3","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.38_1597570405995_0.35879280808704483","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.39-renovate-non-major-80088e9f9a5775f78fcbd47b379118a8fda1442f":{"name":"@balena/jellyfish-metrics","version":"0.0.39-renovate-non-major-80088e9f9a5775f78fcbd47b379118a8fda1442f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.39-renovate-non-major-80088e9f9a5775f78fcbd47b379118a8fda1442f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c92341e583542f8efaa9f8414527d3abdf09a7ab","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.39-renovate-non-major-80088e9f9a5775f78fcbd47b379118a8fda1442f.tgz","fileCount":19,"integrity":"sha512-af9wD/ErMW+Z+6tZPmFmbJyEOr3kaPJZqXRbctydHmJswMN9rwBs6Bo2EyAdS88IgShNmtRe+j9S2f6tnfk4sg==","signatures":[{"sig":"MEUCIB204fl0kV4RI0OWM3XNr+NL1GgP2CX75bEnWdtNA8kUAiEA2uUpXTv7hz+XNtM2GVkD130TDii98IggjqXgZLu/yAU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80820,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfOP5wCRA9TVsSAnZWagAACugP/0iL3lLyUbRrfgthN5Pi\nHg/kDnhCKbDk5ewPEw6yz4ZrjZL/44+nAPzrne9BID4Avs1FIgusxXCyZMOz\ngBEcETdYh9txBPtX2eh13ohw3jAtUm86vVQ+a5dSL0dVTpozDrZQHtM1ko+6\n/1b9a9lbMW0UOXlYev6qsQn2saBXGvJPbo3mulae2BV+06UeQKiYkQS6TSdh\nKa+vnm20WLH05O9k66p3+7QelYnDw7sx6zCrUa7dSiMiuDlBvzNe8PmhWubJ\n0dCqnJSImKjZNaiO67CK3RNJbWVNOijttlHXMktPPHcxXdKGPicqyjr12lIh\n8l4yDTZpSniM0si6f1n1Xx2Vmsqv4oybczG5ZjICwfsBnjicHlRFdPwQCPYP\nisImqxr6sFlaEow2Fkt/3KOv0aJMOqCLo0CrwZWim071+QXvCVAQmcXso1t9\njUF9qsPevoYduWbpIl+Zz5aKZczus3MvaCp1TQQ3Ip2qNeJSCpqXn8BtpJeS\nVA+bMeiXbrEUgfnABtcB4JeAoW/8BuyKo/WZYKHaM9KbuZbB/QB4SXhPAgTQ\n72mDp553yxTQddT2qVFXSuxqIhG9n5fQZGQeScbEdtiyNU47+GI0pAHg2uPl\njm1RZmLFH7DDBC+0+qMz6O5mGwE28oHVIr6z0Ka7xl1DFwp8R9KvbbBbHkgK\nu2OQ\r\n=fpfb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"80088e9f9a5775f78fcbd47b379118a8fda1442f","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.34","@balena/jellyfish-environment":"^2.2.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.3","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.39-renovate-non-major-80088e9f9a5775f78fcbd47b379118a8fda1442f_1597570672214_0.29692229761573596","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.39-renovate-non-major-6181941837f1b84b5e2854b0369d3be4f39cfec9":{"name":"@balena/jellyfish-metrics","version":"0.0.39-renovate-non-major-6181941837f1b84b5e2854b0369d3be4f39cfec9","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.39-renovate-non-major-6181941837f1b84b5e2854b0369d3be4f39cfec9","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c671b97323ef6c9385751c39a8ba94f4b077907a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.39-renovate-non-major-6181941837f1b84b5e2854b0369d3be4f39cfec9.tgz","fileCount":19,"integrity":"sha512-UMyRbh7l+ixFrmSc6EMM1yQsERI18C1hRDVIG45aSi8nAxTUI/47UAnGG5mXLApUhadMCzIiq6Ki5zLEEdavbA==","signatures":[{"sig":"MEQCIAra5a0EZmDRDiGPMHNcbZ263O7rzMVn90E8I77tjzpEAiB3sbF3HzAn7CYUR6TRI5z4dp4Vh95aqXsa7tvGGKOoBA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80783,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfOqS0CRA9TVsSAnZWagAAGk8P/j1LpZx9m6tW7TmO03pv\n8MhuaIMWRDjCrFfEqIPYffcHwayYpDjgdN2zxAhohqp5IfzfBvslbuRkX/dS\nqde2kAYyXqdgO61Rn3fX0yk3HaELXlQBs3TGNuP8bqQ8mh7LX7zZjrXR2Y/y\nIhH9OuXxgo4xkcKkfJ7APnGYjGGCzKplusFop/BB2qrfJrLESJlu/4L9FQ5D\nEOCVkZmCKLEl3Typ3Iupc4QuzLvgWZs+Zn0hWL4UgvXAdK8GKlb2saWBzZO9\n3TOdQNAKMPfvBjmsaQ6CcCYLfnoYQ5nQ5FB4FJ81kv/rPACFCxtpQTN+XoFs\nQoApHmRjvY8hCtz1mRI3/zHER/tMopEb7BbDEjMLVXJAPbFzA7coTmYLteth\nPMivbF2NWYQpTRhB9YIGZE5Lcstr/GQTa5h8cDqrcmFZvRgQv19raLwx5Dhz\nEJhMTdU71D35FELDHGwQ29J/8gNWXpAR/L7IMiQU8uByUgpje30HsKu1VkuW\nXHcxmhLRciu29Wj/FnYYgSgoJz+r/H4iSn2IY2Im3CgVUdDhAzFHxKIaa/qN\nZgGL8h3Ibi1UP7NcRTM0lidK2Gm0Yl5XA8vzZaPQfi5GvtYOtcfz0gI6mdYO\nOXie3z66l2841q5kkV5j0tiOD+AcicSb4H6hBmxUwpfHMmV4zFEg6okLFalY\n3OlO\r\n=yxjj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"6181941837f1b84b5e2854b0369d3be4f39cfec9","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.34","@balena/jellyfish-environment":"^2.2.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.4","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.39-renovate-non-major-6181941837f1b84b5e2854b0369d3be4f39cfec9_1597678764157_0.0016063035810862658","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.39-renovate-non-major-06179d8e1cbc1f4bd35645742551e93415c75785":{"name":"@balena/jellyfish-metrics","version":"0.0.39-renovate-non-major-06179d8e1cbc1f4bd35645742551e93415c75785","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.39-renovate-non-major-06179d8e1cbc1f4bd35645742551e93415c75785","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"58db3f119f60cc075ea7316b340bc8da6876c258","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.39-renovate-non-major-06179d8e1cbc1f4bd35645742551e93415c75785.tgz","fileCount":19,"integrity":"sha512-erpTOLl2pzHAKwNi70aVA0l0DiEs18F6As0wImhQ56ZyjTLRo3XDkMyGnHTEtg+hH8PElEweSAYbYPTp6uSaGg==","signatures":[{"sig":"MEUCIHS9/0nf/KHKL7Y9dbJIQloFPrvJRfRjY0u03l+TV2p7AiEAo4X1oSHtD+iBNrpLfO3mDZfnY4XXIZvXhzHvkLkFKqM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80783,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfOsMYCRA9TVsSAnZWagAAJUgQAIaGHWcuxNdArVJ3Om+l\nAU5bWiNtcyZv5JimXnHbDP0EatG6Lb14xRIr5uRnC1AOBpvu5q1cLdTSQrgU\nzgz2gJttc69sK31L6Q19KoKIVkCwkigRTpEj0NZpp6EvpwhUQsK89aFqadN5\nwkgv882FfdizRR2fU7MwymiJ2DDpUCfKqdkIG1PwRpbdDY6xJbxZJJaLuMfb\nmoMiWI0KGi2p9P++25Cu80bv99gsxDL8IzoASoCa65MzZgI5dSDn8zDL2/sA\n0WbQ0yqg/jJg9Vf+79eRquT3WAdCoOMmm89wR4HzPZ4cJIUrxBJyYH20FhpZ\nDctKbBZ3uOBnFQ59xSauYGLV/yTkIPPkRqRukcxzgiDtpgfueHKYBfMZh62J\nvO9hJ9ySbbjOBKxXPf2AZ9fZSGYWGNalPnlkN6zSsyqz18qy4RKnfGWinwgq\nRQBnhO4IH6mH++62XArLDxQqk7oRC/h6am1QFosP0n3yoByqbiuuagpoY7kH\nJJ78nr5YlI+wXlSbf9+ormTGFTe9rtpVhucn5z81avzpFjGwG8eiPftbqU4u\nfQ1u4k9F4l39j9Inm92SpBgLW3N/R8CnA4CtI7TRe01/A2DWHSs2OFmeTll7\n4TBmSydPgjGVRxhCDN/ZzlMd5pxJnRBnHkwo5UmCbqKMVCIB8ByKHba2WFjX\nebVs\r\n=QW6G\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"06179d8e1cbc1f4bd35645742551e93415c75785","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.35","@balena/jellyfish-environment":"^2.2.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.4","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.39-renovate-non-major-06179d8e1cbc1f4bd35645742551e93415c75785_1597686551753_0.29108872598351754","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.39-renovate-non-major-0c3fa03bcaf089ce60e274a704bfd47f3a518ff8":{"name":"@balena/jellyfish-metrics","version":"0.0.39-renovate-non-major-0c3fa03bcaf089ce60e274a704bfd47f3a518ff8","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.39-renovate-non-major-0c3fa03bcaf089ce60e274a704bfd47f3a518ff8","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3d240c35a75d7bc6e28b6a6c986bf9c664c4c4b5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.39-renovate-non-major-0c3fa03bcaf089ce60e274a704bfd47f3a518ff8.tgz","fileCount":19,"integrity":"sha512-gRoCQVokjNgkYcQy0sX7znMosM/QKqrSqcwhjIy885ycOnqiXjEicN8lxfWjTfxl15lSts2mfeoHgYYw9nlYOw==","signatures":[{"sig":"MEQCICNjMA0/wHOmMcD6WVjPB6QOedmgOQ1q/hyFOZkQo02xAiB8s7nU/EhDGS1VYfEMDxheGG6U21EcRuck+FnCqmnz1g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80783,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfOsPxCRA9TVsSAnZWagAAK30P/R7iuFjEtAzmyvujZkZm\nvEq7pCLq5msMH42VR1qRgmg/vgQBBWH+cLVa7cRWNgUnq1FhflwPCcUjKxtk\naG1c5CPkvIng4F56ky+JO5q62hGcXRIW/Cf7YUCnWsdS7hDRvacvVNW0j+0l\nbpzEbevsktephGatBQ9WnG9cP7ocHmvVah+whZNAya53WxUgSwPR6vVcxMf/\nlqZAu+droaWWeSwfzf/Y25REihwIEzqx83vjDrtMpIOuX1VsSSORplfHupx1\nAnpneLOKOteaG9RdEBIzZ9iAIcw0BxFv/1rsKNdLXn1wsgADoTW/kAU4bSVB\nfs202wqe0YOdecGAXh6dcYu2Iw9vuDS3BaP0QjGHH/h6lm2Lun1ntAHayJfS\ngbwHwZy/W8l3tRmEIBn7UXLKsNShVCVTDoAJqYDWFdNrRCRYA3UDfoe105ix\nc3qzvYdDUHLp9u4GqgNtb/Ix38yZqBnUii+YM8Db9rqnzbv7SVJPMzwSdbj5\nolxsMh6hoJKg3On8KcWoc91gmuj0o7YU6pUCOaZBlsxamldM7StrQEOigenP\n7aB1yW7UMBgSJEEVufYtYxsJbmaXyJChzNlt69DuU8JxMftNALaCmm/ynr6S\nLKGUSnt5Y5O8ZwzLoEdch6duG/ifR8qA046NaDhwojmGdanYBgp/8ei7thth\nLptN\r\n=VEiz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"0c3fa03bcaf089ce60e274a704bfd47f3a518ff8","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.36","@balena/jellyfish-environment":"^2.2.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.4","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.39-renovate-non-major-0c3fa03bcaf089ce60e274a704bfd47f3a518ff8_1597686769406_0.8607775316755899","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.39":{"name":"@balena/jellyfish-metrics","version":"0.0.39","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.39","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e53d39bf434b0e3a6034ff4725fe0a3c78b11321","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.39.tgz","fileCount":19,"integrity":"sha512-G0PjD6gl7Goukye+UYJxtF6sadTySUBDGif+rvtBIvPQ9D0aMZ+Gt2AQ1GiDqD1kTPQPf5r6Ys54oEIVmrVRlQ==","signatures":[{"sig":"MEUCIDHXh5Hw9a15AQ3GqY50EQylpr2eLVORxUJCRqEg2/fPAiEAqfxRDttjiqHYEUNOUcRkUkv8cYnYFw3D3ZM/fMZ62iE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80723,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfOxKmCRA9TVsSAnZWagAAP5gP/0cS3DhAQMXG1ETXlyxX\nkWYM3ZggHuXaUWRZKQz1KKOSnYunrpswH8d3JrtG9vvJXkF6BPrGTEUUyh7P\nHQLRUheAskZbvcuftnt4hMkvks6MO8g40Vy0EUUFxC1xP/uSXHpUXqr03Agt\nUMDRqdxn1y54YvD7pbLcOyJhv//Vft3HPhuldSkL2iBhTI2L+5Z4jJwXfWZ1\nBWUMvaowdyJCGMcCeorcMw80efaNT4kmp0qR3pa74ThVRE7KIKRHsvxb1WOB\nUwppWGlJ9kHKAINhFvV0l3x/6Kf2hW7jKIbPlatWPepUwmOEj+kpsVBMXVLT\nBYZQczj5Og7Auld8lEJ/nVMABSUytePxAH//XtSNfeJIV2nXeeLXLOyHpwvp\nugJT1+YDKlQyBS8DHBV0Bg4iFra2Kgghod/6D3Ghqe5UtiCCBMn2o2TNlNZ4\n9H/cCtk7g9ogiDWa+hCAF+zhKWrzwVrCcq9h12R1jB32PfsytXkq71CgQjfI\n4Cca8/V4X7p4eImeHYbZzKsMI2Gk1c17FDkD/bB8k0G3q00KiBRd+f4vCiaX\nn1t+1OxNXRn5XyfizMmLJeMwffAwET0eEKAta5cAKFmn+rgOk8eVQVQplgKf\nzzjj19es0ljz3V0y+859xKePh5vXiSVqLG9uKMETbojJMjYhL2DnWKgF3ZUW\nhk5J\r\n=PmiK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"7d563a952e858231b7f6910215b40fe4ea91ae3b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.36","@balena/jellyfish-environment":"^2.2.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.4","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.39_1597706917905_0.11913891754567896","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.40-remove-dev-major-f5d1d25275768d08dfdcd60f07561b3ec4d48cd2":{"name":"@balena/jellyfish-metrics","version":"0.0.40-remove-dev-major-f5d1d25275768d08dfdcd60f07561b3ec4d48cd2","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.40-remove-dev-major-f5d1d25275768d08dfdcd60f07561b3ec4d48cd2","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"aae72a078094baf244d6330abc473fcb1e0e32f7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.40-remove-dev-major-f5d1d25275768d08dfdcd60f07561b3ec4d48cd2.tgz","fileCount":19,"integrity":"sha512-JeSRKFNO/0r/gUtpitdhIROx2sFQno6aOa61xjg4nWtAL71UsfbNROqRyOnim6BhCkZtok+jSTvTEjXmzYlEfQ==","signatures":[{"sig":"MEUCIQCJwbBPgwnQ+CTOw3oXNZPfB8kQvUwX6eL65WwdKH3ZQwIgH0QaV85McBFKX2KI1yKhk64WNBPKi39V/aoJF8hWpos=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80699,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfOy/YCRA9TVsSAnZWagAA9jYP+wfAuUul5b9KfBOYWp5N\nVpW/IIq9tkVlMHMRXvwSLMO83/+jFeS9eboXuBw1GEjbKJwFCpAjb4Wxt5Q+\nel702AjPFnC0QbS253nHWmaBzqQsCQmR7dOzGbqvBEkM+u3wjXSHot1j17bL\nKHszBifPNfYb4XmmCylTaCt5hKV/UPUSKadC2PEWAOPJPsE8QWe540gCtT4Y\n0v/hesBYSev+54+QuHqnfCqgWBIjvDlUcNmaX+nCBF1LWWfpDB6RoKpdIjmY\njzQzNguX3qeBX7+IEscMz1KRK/gJRLXWnmgtqtLmSf61/AChiUQX97+IqyA/\n6KaYhyIMos1CGC6IPBWWXZEc9GXbwW1XznmiouuXvM/X0ZuUP5UwcKnOYn/p\nc6MOwvUEbFyH09qHs6+gVQnD2/j2gEQ7rdvztW1DXxypRaLv7enWzd1ulSSW\nNmTA1u6kVrW5+/Df6GonxtxQ/IzTcz5MzPNcPXdy8WAreBK2Dc0IPmZc7RCL\ni81QX74miU2ezS3MarNnGmGfkKBEGs697T405T0yrGJJJRPIOOaKENnBeY0Y\nIHo56qfC8mdhbSIgLGYY2TBv0oX++aqVt8KM6jwgb7PJMeUT1CwtbkuolFZb\nwYpnVCiEMDjVSq+vZXmiUDvCIWJz60HDjrUadYyEbpPmSlUR2CQGsr9K1h8l\nyR2x\r\n=e1Ay\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"f5d1d25275768d08dfdcd60f07561b3ec4d48cd2","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.36","@balena/jellyfish-environment":"^2.2.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.4","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.40-remove-dev-major-f5d1d25275768d08dfdcd60f07561b3ec4d48cd2_1597714391699_0.2420018277516749","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.40":{"name":"@balena/jellyfish-metrics","version":"0.0.40","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.40","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f135ac1ded91eeac4c4427b9e0f688f249bec39f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.40.tgz","fileCount":19,"integrity":"sha512-NVo/kdvOcbmEUCGdukb/jAq8ZHlg6NUvD9PK7SEWMvcnorU9U3tuzPy9GcLcQISBgp8X9DpQS3zxS7LJgFzMiA==","signatures":[{"sig":"MEQCIF7f5jVWMmkXLu0WX8Jm75zT5rfogdl1jFBadBthaKa8AiBtsA/NXf7gG2G4SRHuAL1ovdmhvZDI0l00Calqiht43A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80641,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfOzC6CRA9TVsSAnZWagAAbz0P/i0dA1p55GPnVCTCY8vb\n6WlUbkSwY1E/7mwOs3hZKrWp20tLa5/9dgW/2VSuKGJ3ge9a9RQ1Vi066Ba6\neXAMNea5Wgoxj8i4p19VHPn90+w2y6/qDOGAwpHOeAwH1nYjC4BgiDrqFtWA\nf734BwetNc3ds7vtdl6Hi2eDkeSKfM5DbSNuUSYkaLkZcSVxkuKP8aKO2IT/\nHEHDV9sX1iaY4LE6eKU0Anl8vPtbhRnQ58mgim20vlE5RfA8W0UB03eeXkEG\n8A9kJEucXR29ghroWjqmf1x+5ui0joX2N/5y/luDF6hc8rMT3EgLx3uF5b9S\n0Pt7ztR8CWslpZn1u9IVmslomSOS9jYQdt7ErKrrJ5/aj5BlQCSmIIUnbfqt\n4/OdQ3YJQYPBhizFNfhUZ87sy218rfz/03PxO42j8wSajS8upX6HkBWwvqGi\nbarlRgQScYWD7CoRUkfitruTbEnxV9cxh69QTmoNYMdThngsgqN6f8x8iB5l\n+3IWw6rkMzz/bMFcfsTduHgbwXUNk8MtJj+z4iu+FjMXddvP63/R08B7mBP0\nTUZDhv+oxZ6LmC26kIdE77x91e5p3kJ5mzfu/5mvMhJHW1VRUC8SZiP0rDNK\n+WP62sfu3DCHifU5Gt7xA0843aixBiLC0FYWEecUJ20h3n9Cxia8D4TscIGH\n5FrV\r\n=vaec\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"e4cdc0af7845735fcb6f58c8314f2d0a097df0d1","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.36","@balena/jellyfish-environment":"^2.2.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.4","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.40_1597714618111_0.9611635586055995","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.41-renovate-non-major-967390655caca29db3e9731a279476818332feed":{"name":"@balena/jellyfish-metrics","version":"0.0.41-renovate-non-major-967390655caca29db3e9731a279476818332feed","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.41-renovate-non-major-967390655caca29db3e9731a279476818332feed","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a3e4b8856a4ba1f683cce2f49b175e71545f119a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.41-renovate-non-major-967390655caca29db3e9731a279476818332feed.tgz","fileCount":19,"integrity":"sha512-lRoL2ZRv4n/k9Q6lcvyAJjbv9Nc6nw8pcOH6LhRG7gAmJVw2D+UY+hVxcc2kFLtjuLgN+uKS8QbAsz38stCyKA==","signatures":[{"sig":"MEQCIDVSqqgBuKWetlDhOCT11N0EKp7+AEwIHFU44svJszs2AiB6tJygE52WPZKlY+13lpojc0oJlY0cSrvuZnGSxnZOhA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80811,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfOzyvCRA9TVsSAnZWagAAtaYP/3rLsGADVlBEno2LWeEJ\nAqthLJ6gOrRgzTwBwSa68qZ9BwZW1JktpJhWacEhjd6LgOg0m6pUXnd/kFMG\nMV0CZwtQTVRvSliMNukIfetYTJx3avTqeNlKwRVuILnDrlrzE8+IwWKzV8ge\nunbaCyoaENeg9lmB09OnjKT9I+RGaGxphKgimOZQUwJroGddRv2IoWu4zTzq\n/q5nb3cGmu/VrJgGkHCqrupRQ+dlx1OG8HvjT8WrnNqTlUuadk7y9DLT4Zom\nLuPyhmjZA845svTAZBjE3ZDsnUyj4qd/J+yO3ibWF1vpYt1dl7LxSnRJtE5q\nMor/Xal9z2CfH9gMSOe1GXBrn3Q2jX/v3RsbAcd58QOYmS6hiru1hM6C+3jk\nJNAKs7jvZeU6SXTVZvP7jlMVmmigf2w1TEBuDqgbNnGfVzk7kpHdDzEs2vAS\nBPczBeeeXr7g/aT2vvvXDbKSB6vM4X12Rvv2gAOAY/njvdZXMF9DNaHQuUU0\nnMLnJdUbUCCa7hDUZmmmC6ufxCD4Nbjhc6ZqN4BTfx5jm+dDLcQdMy1AlEtv\nqD0GzN2FTRBY/OOjz46ZpUsZyyMddrlKKJfo9d+MivYdg4HUMdnN72hUJzIN\nkcuXCWznvcNpVxmkhq+1P0pMzXS3ky7AngU203TIopwcte9NQumGqwKzsyop\nY/jh\r\n=0slS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"967390655caca29db3e9731a279476818332feed","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.36","@balena/jellyfish-environment":"^2.2.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.4","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.41-renovate-non-major-967390655caca29db3e9731a279476818332feed_1597717678494_0.5739304752829204","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.41":{"name":"@balena/jellyfish-metrics","version":"0.0.41","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.41","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0471b4f5dcf27bf248e796f2e8797bc809a6337e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.41.tgz","fileCount":19,"integrity":"sha512-n3CnFXF8NCE+hyj1+6bKtLHhRhL4RRdlfqpXAMU/6/MREH0wmYesdN3M5FsZyUhdXO8xnSrt5pfahaLOy63vog==","signatures":[{"sig":"MEQCIAvYGCvrEfRkga/ZK1Ka9dQ/IxzYuUlj/Do23PsDh3tYAiB/4e1wnDcwKbYFW4YODssr//rDG09dQHUMpxEQR1RoTg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80751,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfOz1tCRA9TVsSAnZWagAAoZAP/3DhgkMkpBLxFMoEuptN\n9rgd50snfpOftf0AW/uCBJpljD/1H4ikadHf1YyjvZ6e7huCZGOCoG01iTFj\nrL67egdEc2PaznEvn2gG+vtTkrfxSXWAeYaibz/7Qx8ySHfx0VgttlLk/8Jy\n8RQvYlSttYh54D719HDpfcgd1DRCLNhWtmv+Uk6hNXWPjJoeCtyU4HwAXXLC\n85YaPvTu+Qs+OJve/HyBC93Zpdg2i89XWTdU7kZGlsqCa4D2FtZhuSv+j99G\naR1WIOKT7Yxd2Xgg7s++4Ae9xpPX1SqDDzbfpe6+JhhwPNbI1J3L9u2F8yTO\nDRVPvLQPABUa5P9L982LmE4Z3dzd9hOT+dfC+j0/N4hrTpdRJ0VTi09cMPPe\nSdP4EfN4GzQf9lfFRlpFLtsjD6dJmJHRLNjhtJZxWVwY3GTBpjw7dBdudmEQ\n6C8UxHwLIlCQClkdWndZnvFDQcn9FlkdYNbGryeZQuEvwixFyD/IewMTJYCA\nLVQ4GQPtRv8Rrf+4bNu4cgNOsDfhTPwjpCr/yItGwGwDbXvjHVdTDOPDwmdD\nJzcIsqpv4NEhfi4qhv+ekAMHBe1mjDKAB6hmsEnRS6f9WtV5IZxcABK7yV6b\nC4RNOvWoypdZyfIF6JLR+dHYxHwtJm6n4kLdPEKVgWZnkmTP6+aKosslP71m\nR14h\r\n=o0rq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"1942d14856aa0e49425d8d3ece4cfbad85ed65e3","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.36","@balena/jellyfish-environment":"^2.2.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.4","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.41_1597717868773_0.9330766907970114","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.42-renovate-non-major-3c94340f14e5abb39bb364dd394c0976e7c44a86":{"name":"@balena/jellyfish-metrics","version":"0.0.42-renovate-non-major-3c94340f14e5abb39bb364dd394c0976e7c44a86","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.42-renovate-non-major-3c94340f14e5abb39bb364dd394c0976e7c44a86","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b73b2d71ee7148accae3c7f61bff2f4c90718842","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.42-renovate-non-major-3c94340f14e5abb39bb364dd394c0976e7c44a86.tgz","fileCount":19,"integrity":"sha512-glpsNQQOzYTLEeY5rYF8qbujyKIMTJS1k9h4h5IoCH7wc2HU/+9+Gbopd+1FmBhKp6K4SIk0g36OkyTRd1YjFA==","signatures":[{"sig":"MEQCIEKERUKZ87FUnzWX5/yOTTxrhWKkixjFX5SGjF+FQOSnAiBjkbOKoyLeboE2fr1Db8rgGMO7oTwdzRvcbLnWUEg3zw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80917,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfO0jMCRA9TVsSAnZWagAAewIQAIHbcXfqtvKO9kywYahi\n95g5+O3UfeSeSL3ReO7GlXz7kOw0ZkKmd2NUxL/sUfqJt/pDKIy1iIwD2Y24\nY0Wpi98PSLK9jRmS+t2VWfk640s9/wt4gbfBo+GOVrw/piPvh21hosLmEeLO\na47x0vLhLy9ulQFYq0Lg7QbUWAAbPNTAqC56yHM1OWCTl516MTaQYEx96tJT\nIDTYM/ACwAg42qhGY3MrW3olgU5wtn6Y4veKM+yASp2SEdOlPIvzyhzYxdnu\n8uN9v61mabSHYM2HSTxFaDMQo2qhw51CwrbJjZ/eWsxyQTeSvsO83xIqIrJY\nJPdYOtVp2OUkyB6mdUAx7EzHYSVjsFr37G98VoJJoq+0FK9romU6MYh/8XNE\nXm7yVaI6thK1cqE8LzcCEfZKK61zBT6wf8Spv1Seh6Owr46ij+2FKzpdVzH/\nED5IREFxmT4+5H0exlwLr12m/jihdlivXUo1wgXJhUR17cKHXjrPu/0tfImU\noZvEih8SruigV0zAf2U+w0TVAN2pId/WOCLjnlKORroHZirxApOLxIsabG+g\nYQ0ndxsffXZGvPRJ7/s4/4DUE/s9xgkyatX8d6GIy7P35yY7gSablHM7uVhI\nkvq8xLLa2vzFbd1IFHa9nFJZbuSs4C16AOaq58grF6s2Z12b0v2qGA3RnMct\nEnv8\r\n=08QY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"3c94340f14e5abb39bb364dd394c0976e7c44a86","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.38","@balena/jellyfish-environment":"^2.2.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.4","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.42-renovate-non-major-3c94340f14e5abb39bb364dd394c0976e7c44a86_1597720780506_0.07607723047307346","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.42-renovate-non-major-dac1bdc9f9fcee05525e6ff06c7b6ce1fb5564f7":{"name":"@balena/jellyfish-metrics","version":"0.0.42-renovate-non-major-dac1bdc9f9fcee05525e6ff06c7b6ce1fb5564f7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.42-renovate-non-major-dac1bdc9f9fcee05525e6ff06c7b6ce1fb5564f7","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"54b2e46c8b3a512ead05459d75f87bf8bc201036","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.42-renovate-non-major-dac1bdc9f9fcee05525e6ff06c7b6ce1fb5564f7.tgz","fileCount":19,"integrity":"sha512-D1DrQXAyjAdMy4oD5A7ncTaRIp9SX7o53pZ4bDp4PAAzQ0zav/t3OwKDybAhQC6q2pP4m/P29UwtBL8c+GznZQ==","signatures":[{"sig":"MEUCIGhSQnx8F74XZnyxxfEjnkFhidRo4T9WBdcUFP/oWmUYAiEA2ulRGFLkcIucdk5p7wTs31OslAWRhph+1V0RqVH2qEw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80917,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfO0m1CRA9TVsSAnZWagAAqV4P/i1XuI5HyiWoqIRF8ej1\nMme+XbjIl9XaToh6SfKO1ORRmGpnpwlZfvZB68IByEUAgDZsdGkhbyGyquey\npB/QQ8Kc7mR0G6L+1jcmDRwnMZrDx9d7OL8Qi55IH6OF6gqrNgdjbD3fqUQU\n+DEPNv0GGFL7LCzf9MJZeGGGFLMsgpAEM3ysfXD5tpi1IfjMj6MSBfnCwQTK\n/Uras6Mc35uJ4jNmdofmDSzUuCQwoTHiBzH7VH24/UsVlP5DXvw2HpJIWxeK\nLFxvs/cEzRJgHy8OsnAQeERSP7jspQSNK4ks3exHjOsTXMt9fBHdl4Pf6niA\npQGZC2RtUDHd9+358jC7W6uFaZ03BESA8RW8ar8qOc/PhDpsoE7e1TSlZS0I\nz3cuS00tMD+et75tJk+DHhk8/cZaS990YBOK5MCL3Vb4KvT25CkaMYvyW5bJ\nrZA4UDlFzJG9IM09idrZCoX0RfBxB+457wZEnj9MgGALBF99guqP8QzIZMdA\n3ynimZqzJke3ISaPrlJqM1KswLrazsZmrASgioyQ/wQ9QjO4mamJqmHmgVfe\nSy5H9Z7OzUZM/N8OeWE6sI1y0PJ8NN2+1upkUt1JZj5LLwXbWfUBFBZ0ALYC\nM0nHx/PzkzaXfGOmQxBaDBn6481tUrMXQbC2DVlRjfVwkAyiOLYitjdXKIxY\nYGVD\r\n=//SJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"dac1bdc9f9fcee05525e6ff06c7b6ce1fb5564f7","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.39","@balena/jellyfish-environment":"^2.2.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.4","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.42-renovate-non-major-dac1bdc9f9fcee05525e6ff06c7b6ce1fb5564f7_1597721013353_0.9525546858641036","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.42":{"name":"@balena/jellyfish-metrics","version":"0.0.42","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.42","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b4d1a537e23f59a5640724f0628f1161becad77c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.42.tgz","fileCount":19,"integrity":"sha512-iJheLPbPZPObtAOdbTS4TfleGOzx9jzS6eGR/Gd7FCuc7VPl3I/o60t8DCQZNT8ad2X3OgsDm1w8HRT87qtz7Q==","signatures":[{"sig":"MEUCIHNRFkTArMEmLlJM4uMAnT3gP7nCJphzAcZmdgNSYc12AiEAu7VahfyLonMbd6JmF6Mkp4HfiQvSm0mBr9qjzTzKV7k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80857,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfO0qDCRA9TVsSAnZWagAASjMQAI4sWc2Xgf4yDdKtgpd+\na1JnkERynEtSVa8vn5qze8HPof2DGQDYjKVBlKI+1sA+UT7YDLHzJpFflYm8\ncka2VsvWqP18nXYkC2VqT9pqfQatXcXK6IItl7fdjzpzqsb5rtbGw/1pl2KC\nvS2FCLLq9eevxB9+vyzck7sUAZNE94gSsvdAFaz7DHuMVfSBrTN4ss07du2R\nduMAh7bF2HTMy/G+juoaZd97nT+YhpulliprtYZankqEWB99HknybKqhdue/\n9aWa/bb7RtqFqdQ0mkmz3aK9oaSQPieadQLS0UzWib9Car4tjnN764npopJU\nvZJiH+s/jev7qnTvwHTsC8wfAVkkHrKeWLmllBGWizcofxKX0dXUGoP14rHp\n9WH70TkHNiPw1MwwyWpRx3Zt/ap0qzH9oMGFgstlSjfNhVdhVAB648aOusMH\n5AJscDhSNxjnKlPGaZZ+VF5WdIXMIJH1HzWciM7nN3CdTWYgZbDXdlFjrusE\nqRzPmy8iFYmXfV5ELLxItSEC2HFqBLROH7oDhSt907DPMGy73tn/DB/wPKwC\n997QZspWUdP7QWyF5breuYeyAvMf1n5eC8IWBzwtJL1tGdDZVq7JJYwfETL9\nszFCgDRMtu7ctt4sMxB03d8WG+cgHo18tx042615ksFFov1yp4gBnRlRxGHa\nhdBI\r\n=d790\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"b73e5d24feb65e48a79c927f8d002d7602de8c7f","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.39","@balena/jellyfish-environment":"^2.2.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.4","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.42_1597721219291_0.03897024004996652","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.43-renovate-non-major-e9c56900ca220935baddc88fc969edb86f0ec2af":{"name":"@balena/jellyfish-metrics","version":"0.0.43-renovate-non-major-e9c56900ca220935baddc88fc969edb86f0ec2af","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.43-renovate-non-major-e9c56900ca220935baddc88fc969edb86f0ec2af","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a16ad35f8f24da109ab156aa4e71324a94c217e8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.43-renovate-non-major-e9c56900ca220935baddc88fc969edb86f0ec2af.tgz","fileCount":19,"integrity":"sha512-uzJNJTHDWLkSP0tQBeVTHoKIMRMtUjcHrDYRHYPDJlX5DoJEEy6g/wG9AkLlh6gCpN1mDfk2vEhuVRhT3RnbaQ==","signatures":[{"sig":"MEYCIQCRbJfymlJgU2R+/Zc2DWj05UHpRv09UGVdgbU7smZChgIhAKHBxoeSNIq1iacAZqLf+eibs6wTquhsOoT6uvECF9yq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81023,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQByhCRA9TVsSAnZWagAA++IP/3lA1BTBVRSzX9gPj7il\nksRe+q6R11D2ReKqsamrFeW0mIItv02S2z4P+eSjUZtBShsJfk8qNKpAZglB\nP38LpXV2wXAtlhEmij3b80KZ2WeKXbND8W4d7PrUuv9lvplPk5jYIGgp1Jdb\ntMTEwwJdVhwbv4bH5R6dMVeZBN/L/eDTBa3FDzyOmB01M4LagK2KTp4YKAD9\nBWalV1F1D+uMxccvEiA31ljInFv6gQOsAEdF6hFFp9WehCk4a66Fk2JQgn1Y\nqEI1YNCbh/QRobfad4dtonM3AyuW7A0Tp15w5RKrR7Ku5H1OjOrgQQn2t5qe\nzJCX5EWPi6lJyq36B2+q9mS+JJlP10hpbkKYN2h5RrIsRwC4tQX7u0E3xm3k\n6FiWfTFTFdPzdJqXpCRRb2IbOVb1ONC+icTxvzQRfvkbdiTaHYqu9cKtMGyn\nB4vQ4fA3L2L7WSL0GEo43CSxQad1kZcT0HCWSCguMRxC83oY7EP0RP5wTPzP\nHB0MzuUNh34hnzfJCZidlWoeK+9EJ6N926GWYcSWeCfd1LLYEr6Gtw+MLhEl\n3gNyQP3Lb1Mn+ijpBZnsEfD1ruOCbjiZVLl1khXnQyZ/ylZbYXtpB3Q9ch6N\nTdPZkzR6uiaBZzmgxMqITcBYtVPhz+k3tN/5ktCldjrcrG4AROgI2Pzf19QD\nPQZ9\r\n=l3yt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"e9c56900ca220935baddc88fc969edb86f0ec2af","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.40","@balena/jellyfish-environment":"^2.2.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.4","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.43-renovate-non-major-e9c56900ca220935baddc88fc969edb86f0ec2af_1598037153142_0.9826546550687598","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.43":{"name":"@balena/jellyfish-metrics","version":"0.0.43","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.43","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"be40602b3f42ebbf06b02ef85609bcacd5322bc7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.43.tgz","fileCount":19,"integrity":"sha512-7ogtVFhY1cVtHD7Nr7uA8iRYXRCcmMwUgU8m5e9UiTCS68bfTEY4gAsh44yaqatcvn2nsB+8rbV2uX6JX5m8aA==","signatures":[{"sig":"MEQCIFuj+dPt/MiAM54HHamGncqsWq0LwVLCigp5zvEqbMmjAiBCOgafAOi9rACxBfhMVjH3gMDGeA0S7g3vXnfP0NTsng==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80963,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQB1YCRA9TVsSAnZWagAAdSAP/Ah1yZxENRGcQTMH815Z\nzWEKRnxyN5jrMdjZ5dNK/UAtiyiYhaZyOYuDkVUfkFhLrOACNhlRKwWZiTXs\nj8K3RGR76VDfpMiIZtDli30/ML+SGoI3kGfn7CyRV3JO7FjO0YpuFFaC1BXV\ncX8fpN6+IGD0pQyCdLEfhxlbUFsjG5WX0bBWI+Gs2Kl/TwKxVkvzJPnhBiCA\nFLVln2CL9eYy5hat3ZXjRqmmjL+iS94fGlk6JiTdE1I2Fj5MhQFikNQ7m5Ty\niTSnC/Tm/T40gxXL1d3W7TgSYMcDSsfPaAG6J75Ox1h4xwdsi7bpc8nlrZa1\nv7DkZzks9MBLtmm0pZzcLlNEJ/56X6rx8pMtPz90aIg8UNH7Ew4Ke7kFa+ZQ\nPtiGmHMUn9sxztHJpBpFyvwGbJItmlgcg/NassUXABKX77ea4VrQNxMx8rMi\nvBR55agblZBMaDluQM7nnEBVsZU540gMSjhyQkgzlimbpDuqNj9QwrzgQtM/\nBJwn90BblaLjVHv9GGrE7h6n+Ydvl5X/7HxSBEHp6CY/uhucsOuIKyQCA6t1\n6HD0T4pmfg/xagiayz1WV5bK0+wHk8w7nZRaNMwdI9uLpzGlgc9KDsM1jI0S\nVhlIx+VRw/C7+wE90Zq5/zoJKlR6UggfRuaT9uksy4JZ4KpJCeVIo71oCLY9\n3VPC\r\n=yBRy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"9e47e39c24d2fbb8946601d52a31e51b1208fd9d","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.40","@balena/jellyfish-environment":"^2.2.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.4","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.43_1598037335527_0.30095234832001716","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.44-renovate-non-major-6d567bf6364999ec96f4725a8d53e04444ba24d5":{"name":"@balena/jellyfish-metrics","version":"0.0.44-renovate-non-major-6d567bf6364999ec96f4725a8d53e04444ba24d5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.44-renovate-non-major-6d567bf6364999ec96f4725a8d53e04444ba24d5","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7473cfc30bbe86de370ff40834fa075f5217bb39","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.44-renovate-non-major-6d567bf6364999ec96f4725a8d53e04444ba24d5.tgz","fileCount":19,"integrity":"sha512-Y/4KkipT8TzuwgUWFwu5Cl+ItCTTvVaN5/wi9Qk/7IzzMK/bMByAlMp/wFkZstSKA9xTf4IHDIIFaArvDwAV+w==","signatures":[{"sig":"MEUCIAi36F7gVk7/JyK/jxRqG9rWaf3k15r8z/B6x1MXKAFGAiEA8+KZ73Sd0EjxVhYt2zg9PiFcda25X3Au9g6xT3iLLHk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81129,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQEq7CRA9TVsSAnZWagAAdUwP/0trmamaIPPM0UWmLXGk\n2SkkhK8a2Vr/iRNeFQJHyrGvlLPMXa7GI6yczJBWqyIFqriW4HYjffB0m0JL\nGROgArYvYWYZSjrMJjNYxeiUGVCBA/cQNsQDm0cI9W04o7B0P6CrSadvNLJ1\nl618W+71ej9C310C7gqnXtHPavNa8EFBYR02jQBnHcsx1XBUyPX16Nw3BdjB\ne1EIUGsQGeG2FvgGQAQiuUhA09AD+blP9GRh6HIpVbJs7ibxwTCylJ/yYAlP\nvYW8rUWk9TCXPTO8jMMfaUXgA8faV5XT2Q88jBF0iAsORErdI1IfapP2Jd+V\ni1C3ITcRpNxtsKFSaS1fenFkDaKVatwQIuR7z6Wagh5b9ZmaJJloTE8HM642\n2TDmFCOEliDpZWZRNvMzl46CeV635rXWr8nHyLdA9QV+8nykxXXGWtmlZyWG\nW0ScVZfphpDgCEVeH8Hv0F3QpoNGuZCo/iwjXCvLgb/9Dljj/Z9WTuefdxUI\nxcM41cq8VIPxfKeAzPcxx+eZgEwCULHAZ2EP/8dPya3HF+lG0h1zX1w4A8fB\nlBhVHvEWTzbshFIZebcDFZJzRYusu5spJvkY0hENR31xlHmQHe7b74Cle8X4\nbNiXRzqdSwUkPq6xZagLUlB502ZKfhnGCX3WOCGiwt4nHaNamdh39bQbsoOh\nvATG\r\n=TmWw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"6d567bf6364999ec96f4725a8d53e04444ba24d5","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.41","@balena/jellyfish-environment":"^2.2.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.4","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.44-renovate-non-major-6d567bf6364999ec96f4725a8d53e04444ba24d5_1598048955128_0.5286588693223091","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.44":{"name":"@balena/jellyfish-metrics","version":"0.0.44","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.44","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5bfbde4bff5b40bbe002e20fb27d6f6f6b40d41c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.44.tgz","fileCount":19,"integrity":"sha512-gRW8lnwFeQlOAXeSQjQDZ21oTeFDhZ91tAhWYcB6wbXzOsSyYnyMk8Xvo7zchf7IxGL/AHweFLObOue6NMZ95Q==","signatures":[{"sig":"MEQCIEt3z8lT2/U9MFRh0edy8thnubS8UC2jp4gIw/HlXo6nAiA2cko3gFbPAApvLLznIA9GLzvpZpfewczswANs24Ye/A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQEtaCRA9TVsSAnZWagAAXY0P/3QxNPnKqHw2VCF+GyN5\n181EI3l7c32wsLLRFn1yYcI9MjVJlBjKtqkYdLgIJ6l2vvKxVCfGzkSYka9r\nvLiJyJH0O+N2Rk04gThLt+3wWNsukAlhyzi5W3PvBrIYYG1O6FyjY/ukP75C\ncxlKHS6E397fKa2NGVKGaasxXSXjFq2iQVH1SxvwJXbtXrXaDjgsMsfoZtaR\nVEjWtZzVWpqwoTZJ0y5tuzT+l97/riJEBbW+JXQnzJr0QfWRfvllHucPamiI\nam5+hoiSljy+PJQ04kvIsNU0f8340g3iu8K8ak8C/T5XiRr24PTkHbboXgPS\n8sN2GfZaIwZwR5IPiu2db3njnWEvxoX2AGbLaWZsz6cbeFXWFODngMx04CWl\n94YHhvjnOzrJ+AyqdjZorFh+6Ij/IjK2mNq1qM/eXuZ1uKtFMV2GWgNKEwPS\npgH7UxU3ZT9hnhpiGRLJbniBhF6EKbfIFiyVQYCnmrbmBuUCFAsziFmfGju+\nDFF18++O3xfZWIMLOcflMMwzOzw2kNRZfOQojYdYLuM36apEuRYX7DWI9j/I\nVMJ07nVWmgx04GjeCrsrI1ICIKvfzavRqLcFeFzos/RzVQJJ3CNEfRTbO9Dz\nJtiBN2ld0P5vULtLT+Y9wlSu56gBOjVGboHRYDvOC+aueHEH4j29Nfioxb+4\nOZSu\r\n=soSv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"26a20a76d3253715d365967b870f3e21bae5401b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.41","@balena/jellyfish-environment":"^2.2.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.11.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.4","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.44_1598049114077_0.35017291048619503","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.45-renovate-non-major-20bc525ce98bc873348c06f04d67a5cfa37a67ab":{"name":"@balena/jellyfish-metrics","version":"0.0.45-renovate-non-major-20bc525ce98bc873348c06f04d67a5cfa37a67ab","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.45-renovate-non-major-20bc525ce98bc873348c06f04d67a5cfa37a67ab","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"45bc37930f3715aff92beecf1286f0f8c5ed3122","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.45-renovate-non-major-20bc525ce98bc873348c06f04d67a5cfa37a67ab.tgz","fileCount":19,"integrity":"sha512-wW9XETloMEuio4whK2RLjy2e6aDTlzCa19vv9sYVAFTgfrh6uunmJXq1RYYCwJAew4SqUrbo6RAa4WO7bbThcg==","signatures":[{"sig":"MEUCIEFRDlYTZl01eAW5FdcIlQnNwTPZvF1h/mqkPSUcODiQAiEA+R7K4S+Cpp2v/mjMpwWauqgXqs/C4bSqqgncbWVLf3Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81214,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQsjlCRA9TVsSAnZWagAAxKUP+wWXometC93Po5bfPmiB\nSGALVyPoFvl88ONTeW66+C8B1caZgUpgY1oA6ZcTDmfUvHN/bCMyRwLqRIOo\n8STXN+8h/HyX0I+zFZYJc/nEKLCkCcBImNFU223tIhoI5ABJ+uhQLIMHQkPn\nOxyLYyOja7Ur5/Ayz6ldHEZbAUP5Y6iIKYnzZQ4T/OS/njT4/7MyVgwzblCL\nlFJmqHcF1cjES2+S61BQbY0ccSLpQY1FF1mxh9OpXyQFjjHpPGeGV0aWf4fv\nY50v5I646mYKSYFYMwOx35cHO6fT9HOfxtba4JG+6wEuJwvdDnrZbseXC+jc\nofM+5qyBHA65wn76UqVMLt3c9Vnec/KOc0uKNJgZOt5NCufP9RhIBd1kfy/p\nuwzRmFUwt5qnBzB0TX158GMYGk7Am5OFDtkfPZPBsz+rn9gTgpGAvEQoaAw1\n5duWpKZKml7EFXzsh5aSo7jXWiMr37L5IdXv5Rvj5+/OmjdFtsaNhsrSYqbp\nZV5jGJPI67CHRfHLPvEc+orlnJV/OdnizsOZ54H1XMukhMLO0IZncNHSVHrU\nXmhDKiQ4Sabkqsid1yaqOQp4Q0G0g+a6FK17q+kVuj2uQ3Pje9v9eLUXWDFn\ncw9vLftekdh1C+m1hbuL+219SqF6k5uLQkMrXsJ8JhwBoI1R9ENxfdRcLEMq\nVeaH\r\n=P9d6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"20bc525ce98bc873348c06f04d67a5cfa37a67ab","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.41","@balena/jellyfish-environment":"^2.2.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.0","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.4","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.45-renovate-non-major-20bc525ce98bc873348c06f04d67a5cfa37a67ab_1598212325187_0.820305185075932","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.45":{"name":"@balena/jellyfish-metrics","version":"0.0.45","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.45","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"359bad38a09fe42f11c941471b0f3a18030f59e4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.45.tgz","fileCount":19,"integrity":"sha512-LejynlUsg0/f8VCkbbmSgNsEVyduvUYFGHWVFFiS60n5PvgIi/JNOsiO3tWEtdzHfsJMIt4/C/PQQ63QqQnslg==","signatures":[{"sig":"MEUCIFVIsRJzoaQ3ZcW77fXvM9dzmT4bt57gHnRre5PrS30AAiEAxAU8CWo+RNE7bgiB8VkSMPD78raFXHY2aR4meueUyWY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81154,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQsr3CRA9TVsSAnZWagAA33cP/RjvN6HFBZRx1/bhfaE+\ndss9jeab4l1XtRKLOUId5xZn8POTHGjRcd79K9Wxj9VywkfdkreO/HBY5gSH\nEptfOKndVtJsyODWVEHUH2I09deiwUAjr7L8cPUzgQxEKJvFzdiDRnXtvsR2\nNv7CgRwdFNRM+kNX+naAoWO1yeVqgFTbSKjdcx2YbrH9h4kv/l3TfNhOOk/E\nY7A4hv4rtMgy6iD63WSDHoLWchQGzP+6ZvUmSNoSxo89WDfL+umnVdCI7N2s\n4Os4PqDIcIIqgDsUM15u9ePLzF2lF7x+IJbFCV3zVdk6D/ZTnAyTDL4rG87N\nuhzKAhF/c2AslBAklW3FgvFrf7MNqVhg1YIogOtAlhq4WNBgMjW/IJz0Z3f9\nE9emMGd7oN4zE3O60O00UOaBfAEmWB+naB1AJTzaxaI83NdPOctQrSeOiddo\ntc6aLJcA/6nW9tR0pR9rzvVNCfUvIWoUKPfuaWNxqNGjl4gniDlfxnVIlL06\nhrDqqjKZnjNUBYRKxj4zZnm5sYlGBo3EGI689YPA6c8RXxw1RVkeOjm049kq\ngObyS+So/13bAqjp0qcNE2V9zZ6EVK6mIGksw0/hcsJ/P/Afd7gfBnuwb6A5\nu0DShOFwmZhdPLX4ICTUcuiPqzDrGO5Yl/PhkAQCRNUx2AzTxarZq5Pad+EY\nXiVV\r\n=qk9n\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"4d6fa0a90a49b3020025cdcdfe6ca4a0bc38b2a0","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.41","@balena/jellyfish-environment":"^2.2.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.0","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.4","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.45_1598212854964_0.7178634637961889","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.46-renovate-non-major-b6d12d2c217f565d066f2440d7e84fcfa1c5d297":{"name":"@balena/jellyfish-metrics","version":"0.0.46-renovate-non-major-b6d12d2c217f565d066f2440d7e84fcfa1c5d297","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.46-renovate-non-major-b6d12d2c217f565d066f2440d7e84fcfa1c5d297","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ecda2fb6b269a696a7fd46fb09d6db7b9ae67e1e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.46-renovate-non-major-b6d12d2c217f565d066f2440d7e84fcfa1c5d297.tgz","fileCount":19,"integrity":"sha512-mIiXwwXbeCZhn6dO2dqDj2mBDpS9FX4ckhnatvL94EaGEilrPSoXZyk5uYGujfdqmOMmuUImTkaapA453JFLXA==","signatures":[{"sig":"MEQCIFrc5EvsEtZ+yVZOb1CkKTJVH+VEMvtPeNkcrX9iZDBUAiA/9Fah8syIOtqj9O4btwMjdLq/CMGcYgFwfnOVM+JOHQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81320,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQuJ2CRA9TVsSAnZWagAAXXgP/R703Z5SQffUpM7oyxiU\nb3l3Xol2VbBf0qVFCdwYNxrVplxsne4ql9wURyi0QFHqlsz8qimUvTcKqB5L\nP7CWgBB2vOTfInCV0X83grFGpBXJ5FgF6Dgrpk8c0t43MT0m5vE396N4G/zJ\noDlawm0JMLCBC2K/HNaJbjpItPzOJyHPPu53PISPwLmaFdOcwh/yb4MIE5zv\n/NrihHKOJHYQll3astmICoSmaY5yXePX8OzMRsorf4ryZnNE9I8khsfiTbQF\npHmCmxDvPUG0ZgVJIwA+3mVMboaYBp7RtnotNR1I6+7CzZgb4qzVXCEWrIti\n6aHmqqyjLEjeYkbRxlROhSOqto+0k6F0wmaAithCBihGuyaN4V5WYljyF6q0\nLCVRE6F0goh1XdRrfcULiuEqtv2nRSqK0dI2PJwVxsRXMRj8IVVEKkOqU+p2\nJ2fXhRdOb3UrvOaLQgQnAFx49gAPszoZX6Wb9PM0FWEIrTJgZsA943A49Sdm\n5lULNm+2HBoSwRYbxdIBiZ34jlDnY3nitPWQpF/flj1ew3ouXmG177kaco3h\nMSGDLR2Hf9LvH4kEtbR0/ULYcibyhjFPSTJeySSYwYAoayDn5Yc0G2+LmpzH\n7Wso40rYwgAEnoSWNwUXbizY+Mnz1g/3OkrXBRm2Yzrn7KxT7a3Eqb5+wyeP\nYVeA\r\n=RYZv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"b6d12d2c217f565d066f2440d7e84fcfa1c5d297","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.42","@balena/jellyfish-environment":"^2.2.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.0","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.4","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.46-renovate-non-major-b6d12d2c217f565d066f2440d7e84fcfa1c5d297_1598218869552_0.30873459678773396","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.46":{"name":"@balena/jellyfish-metrics","version":"0.0.46","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.46","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bee7a16182ea0225a7c25edc98a0a58f8491b703","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.46.tgz","fileCount":19,"integrity":"sha512-W3jgEGRMAvzERhAuucVxCGhFisyp4FhSYgewrnM9C1XlI2mMnPUf2dLcYfZqX+FOM3gXRz001m1EAQqzFC8Cbg==","signatures":[{"sig":"MEUCIG1FApCNFHQBkkefapVAZgITHSIk+LY+L49YJnfQ3RFpAiEAsfYJn6+H1/VCLlu3tTc0zbZA0UeZi+JjEoAv1mQw87o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81260,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQuMUCRA9TVsSAnZWagAAyToQAIhgbn+vkT0/uHdLrRYA\nskTUfLcmrh3N1GFjGlZcqTAWMeogvH1NOsP8Gc+mgzD7a5yHhIMMJ7qh+HQ4\nfgJldapgEptrNdhrYr8WvmJ3iYkvQ2MDitiKL4hIcniQkEN8U+ZP3crgJ77D\nBzuAcftafik6+sodHRb/z6kkVC11N0enuJJZ+mq+hC7aJ1J/AEjQzbrzvTbB\nHSKmGk3CbP4mGzeWL3Y5YX91HGOYCgktjNArxpNU37UojgJUJY42MG6tpkX2\nIcdJTp7jsprwP4yajuI4E2JaAAAUT3+pXimY2gfJ6sor6WVKnXTSTJJi15hn\nXVJBOJHfHEmz9XCGwUz0AUtarcvBCIqMPTAFquitLktSb1AffFIss3CakUyu\nbiPp+J5fya4GsqC8hS+r/+BiLXuCwx9UnBAw0uM5EXgJIDbWLbuq59wgDj5o\nETW/wI2z+1zFVVuxLOqLdoSlCzsQhWbg2XT338eCj6mT05AJrwmImo9Cyzem\nDyKu73OVIJYGz8eDiSccUGKR4xwWHXMnE5JC3MszWZMgf9D0qYMGJwjR90kB\nyw2oY6udRvYlVufYaFd8Du1bkzubwn67RKmt7zihRGfbpGrhghVdzvAYVTsz\nyygbvPQWF4KIZJ8ogkGoz2cL6aeLgsDBS6QHlNeSD5YlUaTQILX9pxRe0AqZ\nJaX3\r\n=/mRH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"68358badbced63aba0dacf8fbc195216773c2985","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.42","@balena/jellyfish-environment":"^2.2.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.0","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.4","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.46_1598219028030_0.7325272631537882","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.47-renovate-non-major-58aca14b10045d12bdcb5c35e807fe68321c7814":{"name":"@balena/jellyfish-metrics","version":"0.0.47-renovate-non-major-58aca14b10045d12bdcb5c35e807fe68321c7814","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.47-renovate-non-major-58aca14b10045d12bdcb5c35e807fe68321c7814","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7cca8876ef1bc84f9c6b7237a6003b70766d9689","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.47-renovate-non-major-58aca14b10045d12bdcb5c35e807fe68321c7814.tgz","fileCount":19,"integrity":"sha512-Rt2dt3/RYzXBwORrYx24bFOnRORVePcrGXFmTk/RJXTYqIlFJbuDLxMn5+udWEhkfg3NEp27//jeNTD+zNohDQ==","signatures":[{"sig":"MEUCIGkvBlve3wTX8nKkVOb5PJspAdUcuJ8wlR8KTU+Q9ZOHAiEA53jxEAyHSmWC9NWYi+zBqVDeEppa8HkEfLnEHOug9nk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81430,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQxlICRA9TVsSAnZWagAAPSgP+QHo3ZEiTUJzSkIH7I7X\nZWkvsINub84vxxudSV566MdCpqnrAotJdkgKL7e6LsGxFeS0Bwt/uF70/YKI\n8e5BdKMArItnqY+svSBpcwYbW9CkcY+5VWf8mZdQDD6XfT8iKWT2ZWiV+jt7\nw69CN8llo4L/fFN0lnXdberhe7vDTr4KJ8vF6yDJXsslGpzehEGPVVxM6BLE\ntUII1nwTLdh0MEShAVhS/0pi9CIMxxfwSnsdUED1f51Di3WoCpZjx5Ba4gmY\nX8sRGdz8IShqpLcQqNS6gFaKwCu1fOD2hcOJzBiX3QzNxHgr7VQyUeCjZ+Uf\n/MlWQbbKguyf8SnSABo1RWw2aZ6Pob0T3UExYemeEHKG35opl4tOyDYIM5Ei\nk6eNpo5g56SVisohHcEVo6Ebrt2Xt9EpxGYG50CgO97RZuBHCDG+UwEs1+GV\n6Ke54qefqvXf7sludy+CEgpFlFxUveVOI1hU4JQqN8PT+4sqI6mypkrEfuvf\n7lMRW8xJHw6uen/d/YSrQiDYSoFhP45nnKumLw9j67ctP+zMO/F0B7TAGNIh\nfj1dXmUb+KhwDrqt77G8z2rTw3EEEVrFQbibtxYLgb0aa8MO9BSrrh2vpvPZ\nBHHy+w8K5UgbcDRl+pUDzu/dXYEvfvNQp357sgPC0WI3dWuqfUk0Ybs19fMZ\nS656\r\n=pVp3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"58aca14b10045d12bdcb5c35e807fe68321c7814","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.42","@balena/jellyfish-environment":"^2.2.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.0","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.4","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.47-renovate-non-major-58aca14b10045d12bdcb5c35e807fe68321c7814_1598232903891_0.0035927545036589237","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.47-renovate-non-major-0ce8053f50c417abd4a090a4454f303c58aa9711":{"name":"@balena/jellyfish-metrics","version":"0.0.47-renovate-non-major-0ce8053f50c417abd4a090a4454f303c58aa9711","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.47-renovate-non-major-0ce8053f50c417abd4a090a4454f303c58aa9711","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c0244065d2b30ee391fc72be20b9010fab0ebc5a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.47-renovate-non-major-0ce8053f50c417abd4a090a4454f303c58aa9711.tgz","fileCount":19,"integrity":"sha512-a/RBq0bSQLmdubZmZnjOsNvKKYDYiLq0EsxkEmGDZe2mfS0FYDrVksBGR/kr7kdxUysjF0LoIf9SINyNeDFE1A==","signatures":[{"sig":"MEUCIBEb+vL6fi6TPUkqX+kkXtQiE1VpA20fzcW0kzUY0EP6AiEAosuMfMGE0uEzx+J/jiIMTBso4UhRUvb2yEFbsZrjbrk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81389,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQxo4CRA9TVsSAnZWagAA4u8P/A5qfC83CImjfIJfCadE\nfH85z0R1AXCkjcvr6fb9PsA40TPU8pieohQLF9pxlLhbqZIZ0vcYjl4dVBBB\ndc0N1M8gSRpKPW1U57DkJlUb1oFxZhfSJxjy7kNss1RkZV2TSdWklWYTGZlc\nyLkOYtCSYr0mDE/2bDWZIDnTNP6LupWEjpIyYwHjKg7EzvHnoDdg3BihzZnQ\nS8TFEgFe+oSefyGO5q2ACcYfinvV+wb5bL2EIK+NW9zq1/pHnkeP39LrziKj\nUeDX/9jjdjA7U0jJ1ix2A0KfyZq01RNUmcQFL83BRG0ct6MSyj8MYf0bcI4o\n0gR+alh5UftnxGIJ1YEgXzsO7y9NIQeX4n2Nr/jCK3jKUbdMtwNO2U0gIIbJ\nKNo9SaBjrxRXZIt+y2TpnLqy0oGIyAaG0uA1FxmpNCtUWc4mQxozkVKMRWBe\nWSrwRc9JNpPgr2mkPHKM0me9H7q4/EriLwh1CuJgXM0d2O8n2DNJRxpa0nbF\nruJtbph5IvCUy93zk+ALJyC8JZiAPUdEEKQbsFcCa15VN2Y/Xm3JfYGDJTU9\nKLsF3e23nyygRT/IZKArhg2vgzjRwPYlFiHdhMDDFSBm1y1LBUR9o1Vh6b19\ngMvYvMwU/ctobRFGoe52MA5NCXkUB5eHau6hMT2lbfp7J4q+LmSdV0ozi5G2\n7aOY\r\n=OwBh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"0ce8053f50c417abd4a090a4454f303c58aa9711","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.43","@balena/jellyfish-environment":"^2.2.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.0","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.4","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.47-renovate-non-major-0ce8053f50c417abd4a090a4454f303c58aa9711_1598233144012_0.7766337035130482","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.47":{"name":"@balena/jellyfish-metrics","version":"0.0.47","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.47","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ecdd30d360d7dd6248d950490a6bd003cf4b8316","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.47.tgz","fileCount":19,"integrity":"sha512-Yl+o5PjkROlpI/39LVY3+VAxj3vIgZyI7yOIJC07jcFi43rXf56g4AskJ4yM2U7fha6KdNYK5PwaC1Yv3fMP2w==","signatures":[{"sig":"MEQCIHoNHWUpXjm0FHnWF+rGG7id28f1N1K2t+ZFXe3dJhIJAiBn51xFh7WhVUoxTrYugBz6rEnJj+vlfg3W2z1omldCXw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81329,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQxrtCRA9TVsSAnZWagAAz/UP/jEoV1IRWJ2syH0Qh6z7\nZiOClXRcGVB8Zn+X/C5diIpIXW/tjGpiwWUo4bBspXLbM8QvXylQ1ynrIbV7\npcLi4NHlwl6noZS7FHmuJGUbcU8pY6aEfRy7UxGAKfGjePPbpO4Sp3bJydVT\noNf59tWlXcDoOL48y017PkGa8AWwdPxjb1nqS4G0NIwV1X4lW47+Rxrx/tTE\ng1dLjt0s2QGG+hAtj4aWI95CJve9lG/n9b/SMBKD9175c9Q2vHSOPz5XdIms\n1hSHQHNaQcqHUVuhSDL7N/cDn/L98KQzUNI4UljOsIZUyYfbID1YDmp+m9XS\n6WemIuWAAdYbLvhUmIdESvxjB9MQ0sZ+75/IySNQFd9NNeb8+TowJLsW6D3b\nx+edo+0hHgH7lr7jua3onmhrGUiqhyA8a7sWSCDQyCl/pPu5AvFm7MF2mWus\nVHiVnSqmXuiBZIvoUH2nq67jYZnJ1n5mhrt4vFAQ67PlBRWWp1Iay0S5US4F\nSgLgr2yj4vdORBrOdaFUXY+qrie3i3pYRlDKhCRHnNkn7VAEUqMcgMWHHxUT\n7JP2iOnWLxNklKJB9MB0+vxkAipAnqbr5ePWNFzRp3FTbrN+n+zp/YvQVx7P\nMwmyCMQIlASWKgBuVfHTfekxMK9gzTRQD198FHGEG+UYQslgreQQ/Dvf5oF2\nf7hx\r\n=d3cA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"f8d9d66f472bfa438e04b996cac3dc74fc06f61e","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.43","@balena/jellyfish-environment":"^2.2.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.0","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.4","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.47_1598233325402_0.38492430248957143","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.48-renovate-non-major-bc53623ec2876d00d11aef445fa23543359e3a5d":{"name":"@balena/jellyfish-metrics","version":"0.0.48-renovate-non-major-bc53623ec2876d00d11aef445fa23543359e3a5d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.48-renovate-non-major-bc53623ec2876d00d11aef445fa23543359e3a5d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5d0d14d9a081f31383d4265607eb8dc00ba53a27","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.48-renovate-non-major-bc53623ec2876d00d11aef445fa23543359e3a5d.tgz","fileCount":19,"integrity":"sha512-vtdPC0kXwmg5u5uyUD6BawR6iuW+xnovjBnKDgm/Qg3+xROzdJV49ihbVfXme+T4ctZ4r3Xiiqh5UT7ENPVcgg==","signatures":[{"sig":"MEUCIQD2UJHzGxTb/ya8fyAmH+7dyc+IXpBHJy7aTeciZaSuMwIgPGs9eQow2koqrkoFY8kfpUuhaD1q3VpjGqns2nD4MyI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81458,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQ75VCRA9TVsSAnZWagAAIhYQAICfktak7y5hONmaTG3e\nz9x46qNdQpd3G8DuWJGXeu/9F+7RfYTfDee1h4Ptcu3xOFRBj659VAzS5REh\nFwOYGwlOW3RXjFO6nMQfrLZgZJXrOo+Ti1yieBxFfbgZYJTT17vjCWxN5U73\njjXzo+EGTeq9W1yEbG3P89cvVjrXII73cCY8IMQmcmTWVk3TL64iuABcwCSr\niy6fidS2AoqsNDpJF5DzNKY8+ht1UR7k05pfval3DW8IpqPCrs2PK5cvNkNq\nCxKVD5a8/7VhgeTIxpVnK/kBYWUIrgb7IOaFqDTZTlvfDKN9/ZBzz2KB5onc\nNO+nDTEAiWjHc5TYl+fDp/2UpX9NHnICEbRG2zqDZCR0DpkdakbB2Vjvz8RL\n1TMkRDpmQzdcix+mxeu0XBNq3aTXHx7wxLxF9MfM/ryvmiB/af2go7ze2utj\nEXx9c0Bn9mDhhD1G9iuS8namZSgpBmtmfTyAIRRPKNNNMFTkM1ui+EwMgRwE\np3R250C6HThFdmdqr5QzPhN9CZMbnlYiZkxXriBfDgW1biUcFwa9C3SEAnfe\nSUh69XZlAZL+3X/HWMWcxQrdWLytDLqUTqtEHwBSZpTkk2RWXpOnknkdFMKj\nrMgMefi4TvQaYsyqwVzHqof1qOdZVVxSz2Ms+PqfP57ZG7XaPZqlM6MH/Kpq\nugyu\r\n=XuZN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"bc53623ec2876d00d11aef445fa23543359e3a5d","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.44","@balena/jellyfish-environment":"^2.2.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.4","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.48-renovate-non-major-bc53623ec2876d00d11aef445fa23543359e3a5d_1598275157440_0.9348966960508398","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.48":{"name":"@balena/jellyfish-metrics","version":"0.0.48","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.48","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c48b04897471e4f0d64d1d5768d17cb5510fd111","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.48.tgz","fileCount":19,"integrity":"sha512-/ae1sCQFKb1ZXsYCuoDSAgf8MDcsbkC31zHlm68420IW+szKiERWu8nuE8aNnzSYowGR8veQx8cwS2bO1+Bs0Q==","signatures":[{"sig":"MEYCIQDnm6ozmHhDQuodAzWrYVSiL7guZ8OB2JUffAtHyKlpdgIhAKllYD/72fWOEB6jtbt7TJQTmm9k8g/45bo3/IXPeD1t","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81398,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQ78FCRA9TVsSAnZWagAAeUQQAJfIbdNm+NLFGOk+Ymbb\nyQkDwxNJtLVPffifsG3ZWZlhRiTL8xGPA4h0lM/H2FcoE3HR4gdHShEA9sMG\n9BRv+HGSsyyVoCw3xQ0ASG0Q75QjosIC6fELVg0A16JPuLjEHb268GWRNE+B\nZMcT35KwzIFfZ04m7jFCTyi7PbCllzuM1IcB+DoxnFsPeSWeyL3KUxVajq4f\nCwGXK/2/JduM3CeDiglG5atulKSF2RH4apngO0RsWjupry8v5tFXWAL6Hro1\nb34lLHjeYgc2cj0pmWeHizXljiNPeqgUYNywyf6fLfV/iEmRwmnUuBVpDQMQ\n4wMHluWJYazzYmLc9oTcaAAUejvzUFv8yILLWkn5CfF4B8+u5UJPR61+zJu9\nt1lvi4diSz6zrVH4K5F3jlofu0UTXNHfO4G1b2whSm7lvSv3B6FUUmB9wl18\noAtMs2itoz3PM9x6OJ88qzkAYw9E6fJMHj9P/y5TxsyyI3jJoDlLSGRIbjaE\n1plUY0e96yIOpu08rJc0Olt5wS4FPLWqlQLEW/ZUisWYL+2oZDuSfvI29E2t\nJxa5U88ELwjqXNZcoM4OUdijmOpecwrpyhJdeHfCHRULFbTlMVk6HfnjSruD\nq1mzWF/E5X4hcbiPYsAbiVp+l07fR3DwFDSAbNu4WuexidNj/fHVgGCSS5p6\nmA4g\r\n=Tx01\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"ade9de86a004456b804911534e5917a1dd62f044","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.44","@balena/jellyfish-environment":"^2.2.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.4","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.48_1598275332646_0.02087400626779723","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.49-renovate-non-major-fff940027b75f736c568f9ceaf8bedda92f4b7e9":{"name":"@balena/jellyfish-metrics","version":"0.0.49-renovate-non-major-fff940027b75f736c568f9ceaf8bedda92f4b7e9","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.49-renovate-non-major-fff940027b75f736c568f9ceaf8bedda92f4b7e9","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"85a9e753432698ce68cd5e0dffff345b98325986","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.49-renovate-non-major-fff940027b75f736c568f9ceaf8bedda92f4b7e9.tgz","fileCount":19,"integrity":"sha512-gHTZ3rwJv5hk24Mv8rMVqDBJ1skj6tb5QxPwnhr22r6npmfKvzRdGZyojZhv2L6rwCnIf3raT7/+i9BccIgYsQ==","signatures":[{"sig":"MEUCIDju/NHLUMq/RTdO3uZnI7c6Nx8vaxY+ez2JzFcTAzU3AiEA2UFEYAS4lE/KhslTX1KUJgF70AEwCR0Qvv2F7eVDAVs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81568,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRPe7CRA9TVsSAnZWagAAS80QAIEtymqlm87sMKHjgHd8\nluI+cV8kW0EZbd0B1AQVO4zWdknWcUCrqBwMIIqxNXM5k5IjBpJ50KCXQMFv\n35X6aUAjGaDjUDpmUjXb7NLOoE7pQs1yvfLuugPvXnizg0ztuvMVNhl1BqVh\nesNLffDE6DIxYnmKnrthA0d8BrSbPk6fSk+IwWGUdhWD0S1BviXCl2i13Mxk\n1egTw5ABn2ShgTV30HYPOUEYwqic5sGpyf9NPiCytsmnH4h6QvsIlMcGbS3P\nZTPRQvI54vEkAsVjJCeh2Bbl5CO6s4oYjPuLKPwFON0l40LhUkMgUIoAQ7wb\nAaSObEF+IeRA7nsAZ7yrb2x1N/vs/krAZ2kBnz4Q3PrV/h1kXOwupmCjStzY\nUwBq+i79VRyN0frG3TNBT9cCBTfIdlRvtZCD7NcXiQoRUXb9AhbNYep+i6XF\nBBpfrCjs2m3HQYfGAXtyuzUevsxwcjz/Ome3qkBmdaXTLO4q3QzPm2efly79\n9YrqHrnPx0T/KjJcLi2RhvFhWk+GbS67FrgGBn1bR1GJmBDG4Ehl40kW8hh2\nB8cIiXEtsKQ/8dyO5JfpI7VYesGvLOEgz8SJZNODTXCDbn7dUUP8exj+Pt5G\ntKIOxSKf1gqyiSxZPwfdfovMWiv4YPXq8/ltKCL/RTWWi3C72MH3BTsty3hG\nEKQ2\r\n=07Fa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"fff940027b75f736c568f9ceaf8bedda92f4b7e9","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.44","@balena/jellyfish-environment":"^2.2.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.2.4","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.49-renovate-non-major-fff940027b75f736c568f9ceaf8bedda92f4b7e9_1598355387134_0.6410272859217809","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.49-renovate-non-major-6da1b7596b1f6883ae119b50c8a22d2bd512169f":{"name":"@balena/jellyfish-metrics","version":"0.0.49-renovate-non-major-6da1b7596b1f6883ae119b50c8a22d2bd512169f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.49-renovate-non-major-6da1b7596b1f6883ae119b50c8a22d2bd512169f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cd4ac91c8bc965e2a543f10df884d7704f561f93","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.49-renovate-non-major-6da1b7596b1f6883ae119b50c8a22d2bd512169f.tgz","fileCount":19,"integrity":"sha512-rQBxFvcuVZTDFi7r4k7ZkB4CDHIRhlrftCRwkyaoEjqCR1c981A+lVcioKRSC3fvSAYXeFdLqZFpqfV4WPkKog==","signatures":[{"sig":"MEUCIEGu8H1dIC+XJQLUE92kMbS8xf9RWdZrevXD80NVnE2UAiEAuZjIgwUoqCs8tTBHYAexNdX1tPXHvotOWJzoZdJyO1o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81527,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRckzCRA9TVsSAnZWagAAUMoQAIK1ZFgWGNKwiBfSiRnm\npaOcCAKvlJFtbQd2BHn6sdfXD9OOejoqwWR1MVxjM5j0+3YnyAJasO0GmpVd\nNxTVlS3xHTj5twRh4VdWuQdp0vLSAoUsTzf8eTanSytgGAXuauY6IEe5mv90\nd3Zg1CF4/fF18y+sOm9QJ0q7JdUyvD5R/+jjc5gkGFpmTOoqPS/e6ATm8UsY\nZvfbx9py5mflCaS+6I00ZwGdvf51rrpiOp+1nb61ibb9nkMJq1r9uCimzN6f\nw8mJ82tHUPsEfOdprJJwe7kfnhXgWlnqe90djc7/xdyRqtAmqVNhpHf3DA5L\nIA/PFn+jXlBXJOzs/GIOjoUjs5CDDgBBaTjG4Ad82lyQPF8n7W73uxdMKv40\n2+v4txZli4VMZ9FKNgxtB2xDis++WNMs41V2qi4lGgTLoXax+jJrrl07NycI\n6mY685lmw2hfMaH1iG5Nr8sLgp5UQqjJ9r6bbmJ+LGvW++jAGXgL6tnJjliV\naPBl07J7IMSEo2cVcAreBlSsBGK75OrTD4sNDFNM3Hu4fMt1IKU04k07ChWD\nfVCHv+5OVUxndIXO6b4qeCc4CPsWRSD0WD53gxtfbrjuBGNuvdNbAwL6QE5R\n/cR+aHdsu6QsVdIsr572D6wJ1a1FZRjdaTbbEOS3/r0+ox+uroVQV5rww9R3\n2oRF\r\n=FdxT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"6da1b7596b1f6883ae119b50c8a22d2bd512169f","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.45","@balena/jellyfish-environment":"^2.2.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.49-renovate-non-major-6da1b7596b1f6883ae119b50c8a22d2bd512169f_1598409010925_0.6513669704262954","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.49":{"name":"@balena/jellyfish-metrics","version":"0.0.49","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.49","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bba41412dbe5275b02e6490fdd990ad9d4ca0291","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.49.tgz","fileCount":19,"integrity":"sha512-OrqWNNyjpIqfZ8KQJewEZ3S99hevRLgUeq0gCMcFRkswv+W+AbeDxEv8XttcvBMDbxX25gWDgu+IBmAHCZo/+Q==","signatures":[{"sig":"MEUCIQDLnLFL1s8XB1fNFbAMuiGlRYy6pYk5QGnfj1BBQr1qXgIgGPIhEuIm5yVUJQpYT5vVBJZnatQUF8XLJ6jIlGIRZBs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81467,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRcnVCRA9TVsSAnZWagAAvd4P/j3Rh7hjISuL51/kjL5W\nQeHT8JXpQ7Te4LcCbYNktTpZkSH6hObM0AylHLrBSgSw83DT5V3a7VFZKfUE\nTjstah2FpM+YZmYXj/GiqVLrhx+klqWMUz1Zpx50nOGfk1lfXMDfdwFXDS8j\nsed/y0iFmzESRd8zFcvn3lW7hw1NpxrTixlNChWvjDt75+oS2/rvQMZign6F\nAcUEvDWpDuz4h+OinEV2xoVcZYSFcvW1CqaoQujCvvoVnfEOhjCSYVRYcCxP\n4TYmx6Y/AxvCz8JVzbRxqc/bYavluwhjJAwepDfhhWuYRjJO4ComOBZrXcL6\n8DZTYuFiA9bRpjz9d1H+9hG/VhbqOQEf6cu7iAcwZkInkdLFIJDPKIG32DDY\nfZ7vMjzcYQcFEgUTIJ6DL3VmTmbxTvKk85EZ0UeuFhEl+zEhYS8Gkg4pyYny\n9UlDqMpgVfooR5tcPruUA8UlgOdZS4qmN8iK+iss97ivxsjeIEvHcyrKYc1q\nME7VoUyisbP2hyJvMs7fOvzuMO57DCk64VUvUbd4uSBfV9QHMDhed/pSA53z\nN7qhdlCMHTs7E0GssW1cvMBDOreQE/3wqsjQuqRZFIQSJIF+EMdZMbHihH3Y\nbXLayo+j2lb6IDmWz7IhLXyV34+7rrgPSb2Xmec6SqRby/lXARSoLKULIWNL\nl7Fe\r\n=+lpM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"6d812e1e9642afb5ffa8f4d6196e60105323c78c","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.45","@balena/jellyfish-environment":"^2.2.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.49_1598409173403_0.777818962686639","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.50-renovate-non-major-f15969255457e40ef5129bf91eaf24997eae445b":{"name":"@balena/jellyfish-metrics","version":"0.0.50-renovate-non-major-f15969255457e40ef5129bf91eaf24997eae445b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.50-renovate-non-major-f15969255457e40ef5129bf91eaf24997eae445b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d2bf94fe42de6f0320642cf292bd827892ef3450","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.50-renovate-non-major-f15969255457e40ef5129bf91eaf24997eae445b.tgz","fileCount":19,"integrity":"sha512-nQPQVy83kpzcVKvpDae2H5Yha85guEdCZTpkZZC8RSwHCKEPcnUt+Flpuk6If9Pm8q2aqtGwzZGhwDFZZcM+cA==","signatures":[{"sig":"MEUCIQDJy/3Ez0dfDtnSEG4CLVbk2wwpyz7z6LFLqtJW1qNTVwIgEmgOEYgk+Wu7UkGgcV3vJsCtqbBSoE7XxXoRbMzl2BI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81633,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRfKoCRA9TVsSAnZWagAAH0cP/Am/ZaBzpiUh4SC3INXS\n+E7UeJGHhctA+UXH2tKzPWuX9mwhVU95nhl+FXSfxh9sE+LZBn5STqK9LcLb\nZyNPsKRzSs6ccIvyewoAUuDuCT9QFh0prykCZD1FVHFGOs8s6wfI4RLdDGQs\nxQAQedmSfHvIb8X5VJ0uYpmvo8m1k5AIpgFxF+V82BUTB0Vmvm9k61n5Ah0p\nVFHToqPVs+5iXP65CfITi9yQGjeBezS7hHC74vJ+CBtHGrUVE8wQDrAJapDy\nMrO8/3Zd3cddbmcZMQGsFWTrgdQxHRao5Jxm1U6YflathcXfgwJaHCtsDy2J\n9Saa0ZXrqlWg5YAx5RhMuRAP7b0XoQcpTQDVDzE6KuXwtUfxs0BwUuTN9Otw\nqw+ZV1eoti5Lh0dW7O56ojCfDYcZ/HDO33UTMbrCJ8IoDMetII6KEgKPpP63\nddYBsJQd62WTX2ZBwOSt8/URN+Mk8f+hX6bMJy/rfb5nX5TcHVt7rhtnmoqF\n4BV6yb79rwzmcQlimZtcTIud9nF1/ZKygeHegP295E/np0Pd91t2bJ+Rwkix\nyoall9bDO0FK3BkhcV62dkEHc1hbTRc+VoSmKSHESHQ3mku3fNwwP5FsBtTE\nlInuj5amMuij78HR20Yqs9JRexrFtDHtSIVCXCpuuxKSXIpJzQ5THFDcDT5H\nXFED\r\n=tmOK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"f15969255457e40ef5129bf91eaf24997eae445b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.46","@balena/jellyfish-environment":"^2.2.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.50-renovate-non-major-f15969255457e40ef5129bf91eaf24997eae445b_1598419623866_0.5116616766076911","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.50":{"name":"@balena/jellyfish-metrics","version":"0.0.50","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.50","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5357dfe02f762b52e7156b89e4e1f2bb002e4ba4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.50.tgz","fileCount":19,"integrity":"sha512-tWwTz4mlFWeknbcg9xGzqBTUNTuLfl4cMs86jb0K4xOA/RXVC6Eh9BmCrftRSXKc19Y1M/7BooQSfKsRcfIu8w==","signatures":[{"sig":"MEUCIBqXQ83JaizywAZl37Fyiv1G2xhdOiTuOFlz9JB3aCDBAiEAsl5i42ckwdqXtdDeDjpBWq0IX0MWLbl1f2FGP0fB1Ew=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81573,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRuyVCRA9TVsSAnZWagAARK4QAJqCJR2KhmL5IutASky0\n7xTF/j7fFUdWiZy5tpQyv8MtUqwM7R919B/Mlt08pTOaT+zJqqWAIJBp0H6+\nBgqpwYKyD1J/eLWpR1RKsSAwMAEIE30D3dor5//0ZNeA51NJGc848VkF/2+7\nYnX+cuAxftLCty5/Gb3fD1pExGINRpl/MC8PIc3Cc5+8vGjbn7ka4pMJcSvX\nJMZkQzyVcQ9UX8tf9Cqd+5PwPoqu6dmsO9FLQovk8lZSFJfDwXUdz1Bs56DC\nPLp8Dq3dWgQJr0veQJWeGWLBu72f2FSvHVVYMFmnSY92ILONDDTUvTzVVLlN\n1F93Ua1d8/wi2IudpVaWldx35YZF52i/K2mxPWVJnQIZKBcMP1TtOzCnXSmQ\nQr0bot+P9Tbqu50uqULz0eD6JJa8A/Q0LlWgNz5QqWLGOUNSrz/QL6puot+g\n19mnvZY1NENHlLqLzMJUq7fQ+1PpvaaWY3PmTg9jfdLiLHHCAHUc1Bwuddgm\nxf3u0TzGLnszesMn1MOsnbn83Em1pZe2Kk5OjHmCZtX66r1Wu6FOtYcvQxq7\nhQ86Yqg0L4bbNvdR2SDSodWcMGYP/9NyTDvf0o8RomoUbKPL0hdsZZgrdUvu\ntCBf8rYlrRSJ7YE2f2Ab+tf0p8oJPFyZzSJwc47uiyMdWFg3ICBM31UzZ3wN\na8v8\r\n=200x\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"e7e6ae3b7d0efdfd42fd2526039a6d37a759a202","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.46","@balena/jellyfish-environment":"^2.2.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.50_1598483605202_0.355084482089709","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.51-renovate-non-major-98d6354a0fd9908fd67256d23fbd8aeda607fda5":{"name":"@balena/jellyfish-metrics","version":"0.0.51-renovate-non-major-98d6354a0fd9908fd67256d23fbd8aeda607fda5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.51-renovate-non-major-98d6354a0fd9908fd67256d23fbd8aeda607fda5","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"83f2ac1a69f0e0e74224b0ba28b37b61664edcc0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.51-renovate-non-major-98d6354a0fd9908fd67256d23fbd8aeda607fda5.tgz","fileCount":19,"integrity":"sha512-NDGT+HOB/qL1DZ50Snm2qB3fc/olC2YXHPfUcRvc2GrfTmy5gCJXTML999NFJs3h/5o5QeTN3dZ34SE1L1pKpQ==","signatures":[{"sig":"MEUCIAuDnrJJC4+3PLgEXBOsaYP68WqyUSXuPY4ff+7DE3RfAiEAsGykDE6+aUEYL/8Iv8H0ywOc+CQhBABfMrqZ1GmaWuw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81739,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRu3FCRA9TVsSAnZWagAAQSAP/3y+Asx5PWyLAOTfeiNp\nEOgBZRog6Vc/aiG6/7qGgteWUPSsWwhrycI4isRPmzdfzcklromlbqnqxuR/\nRCdPUPMJ1JGecDp+R4OT3OJEnmfoujy0Syw/p8m5kIvryh3JE9LaUObMxOqw\n0IYgxY/y6qAorCQPubMr+SK32DqdNS/ErJwLT9PaZOq1FOrpUA8VmY+6DAwb\nf4cbQea6ntphuPluV//iNHmM/uMGVPtn9C2elPER0xrr0qoLNZzLgsmyVLtk\nY8W6OlX5LCB0uiltJwHraPUts2m/ZBszqAmK2liXrZlcqGqS3jHiKwAG8JpR\nD5iyvzHxRcIC8Ld47+3cH5di16T2kZDjqmqlS3+xJqPrK4Fvqh9GH8aP0I9M\nZj/0yqqixSG7sWmV4/8biqpSPzDliQzDRPp6RLqlClNFvg/frx8JOENXOBJ4\nKeBf7p2zUAtYXDk21rV7gC5dKHPBXCZQe9TOXe3KEsgyHT+whrqxukKNx1wn\nIKAPZjjGXJ5/aO86hLSrm+K8pLybhn1BEBNIiMzal9oSMpiBnK1K3P/S0+8A\n9KupTIWUQs0FHygl8Ay2qdyEeZBZHxaFXRstFh4xBJ4UarULlupDRN+Y2cPq\n4wlKqwO+XChWWfOV7S8sRBjCAtHJFhFM4XTWRTSx6xUV8eoImroT6db2BZdP\ndbEz\r\n=F5G9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"98d6354a0fd9908fd67256d23fbd8aeda607fda5","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.47","@balena/jellyfish-environment":"^2.2.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.51-renovate-non-major-98d6354a0fd9908fd67256d23fbd8aeda607fda5_1598483909356_0.38018571433923976","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.51":{"name":"@balena/jellyfish-metrics","version":"0.0.51","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.51","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c02a3263240b3bf16cbcc5c4f12baf1f70c50a8a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.51.tgz","fileCount":19,"integrity":"sha512-4P1o2ebdmVIhKt7oZFNR9+kYd+A90vR0/GSSmIDWBvQU1Z0/zqSOwfCyFoNI/0goaBzznN1ZaKZl9QQ/6NtzNQ==","signatures":[{"sig":"MEYCIQDuDnWaeUcxBmqNK84u9cRacrpcM1e/JhNSuA5cKxVtFwIhAIDs2fa9U6EemQaqgV231Pj2emaokhcvzTSCtQe9Xzp2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81679,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRvttCRA9TVsSAnZWagAA13oP/2tkSC2Y0exo79NfrJur\nUYYcaTGGcY1780//H7lY2AF1SBMDteT9CAam+9laiadZc8T46mR7QutsGxaR\nJ29x9XdiN9q42LEajaybg+U7Bec6xWjmRoPRtQHre3gFPMruJufVgQfwSlXE\n2AWZ+JCVp3q5nAyyEHiSIGfAifu6HOGsAC7Zsl2o0AYHJrxkGeR40xShxbOG\nSz1uO3kgjiWG2huELmNz4b2OoMl3SIzl3Fm/G2seNAM8o99xMr5TvBexOHi5\ndZkYRzko0KtOOw1LdvPrg9TnM9XaursvoPLGkcqaa+LoCp1fvbsDJMdHSOR6\nF/Y7LghZ3V51+BNaPlxzoPk93r1EXKKAmYzQEkNT9kVxBWqdey5/FQTLDqkh\nTaANklGdL2wMRVmEDUfAmqd7owyXAcuPa7D3q9yD6kIh9Zwtss+6ScDcSOEM\nrT5AvCyXa0UAO2l33yGXFbtkj5RbFeae9JqGCWRM36gAToT/0kWQHeuoamfV\nd0xKIHiBTthpFrNg9GB60nJrAc7xN+jXKwmT9DLbvjkWMHOUsrziHnVVz1uI\nZkzT87zjjLBJcYCgztZSCZsFnmGfcRAIwdEN1fZLJd1IwNc0krTQR5bkG/pm\nQkgyx6OnvqDB47+KkmotqTwLTyQTG9XzkmRNP6gAWM6jlhslZbA1QnMHQ24d\nDGw6\r\n=PcAi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"ef0fc510d63c7a46f2a2f458a9154c4c5e9a95fc","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.47","@balena/jellyfish-environment":"^2.2.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.51_1598487405436_0.4335748936266566","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.52-renovate-non-major-ff71d40bcdc7ada0f196757c4e25198b436f59a4":{"name":"@balena/jellyfish-metrics","version":"0.0.52-renovate-non-major-ff71d40bcdc7ada0f196757c4e25198b436f59a4","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.52-renovate-non-major-ff71d40bcdc7ada0f196757c4e25198b436f59a4","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"68a30887f73ab0b3895ef8dcbdbc3fc002c5ddb2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.52-renovate-non-major-ff71d40bcdc7ada0f196757c4e25198b436f59a4.tgz","fileCount":19,"integrity":"sha512-LsrJso/wy7XfB48BifxQwvbLbDLZZBhlzhhLeU1kZtoPF5Hd+GSYTCE9nk6fUWJloTkNPz/uq1pqPmGqt0QtMg==","signatures":[{"sig":"MEUCIQD3W57gyQQ10JP8ZQk8vf6/W6fLRKqNPLhun+dXylMw5gIgKg+7ZctsaeaEVmjJz4UBgnduF9CprBFAIZcXuIQm+W8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81845,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRxJECRA9TVsSAnZWagAAKG8P/jflueCm4I69jNTIBq5X\n8XHBxlc+KIWRaTZWl3SJlLBzMONNUE+4k/l5GaVXglqqqQKd50HssDGm0Quc\nHIjWBB8pFSjTPldzlPM4UMxGUhRE3N15O196ougjB5pGHFml34xYfX58RJhZ\nQkW/OW+pITqdsikX2Lg/YsVhZXed2SvcPWN48H2yVRtRAgxPsxIfSX2LjRcd\n0SZX1B52M4gT5JAxCVA37xVxiQtVtJpGAKUtLcGgYPvTLMS/RDqO71+keLgy\nYvKCDwMXqqyUcZIM4JGivjqAyf+v3BbGW6+Z43m4L04rR4sdPqZrcx3PKSwN\nTq7ncP57R+HFSjUsREfXB0wqTOPrjKn2bSJQUJhUen1ZRAGtWtsFd1W2SA6W\nZ7T+VTdncpxc59oiv6jPZOqP+xB2jVx4UQDUopE7x0hAlogHGNriSLgIJYGa\npw2vTZtYqSJuNgeSdMavz5DqO5TgIJOG0xe5sUSuXScjSDyduDMr4KZSc+Fx\nAnF77JIDz6E0lAp/37fzIeo+LSIAUIaHOu2/n/GtRBKf2AzCCSgKzfa99jO2\newfC0bn3C2qVwp+khdxsi9IU+MlIMxRSqn4LjeXMS3D+WRv81JvBY6SyTIs2\n0ex7r1EZgIzVRo44NFMbrEPdhazPnSzWxBRFzmJ+W19llyluiYbC8gTADglK\nEoJn\r\n=sWa2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"ff71d40bcdc7ada0f196757c4e25198b436f59a4","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.48","@balena/jellyfish-environment":"^2.2.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.52-renovate-non-major-ff71d40bcdc7ada0f196757c4e25198b436f59a4_1598493252202_0.15571726386100515","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.52":{"name":"@balena/jellyfish-metrics","version":"0.0.52","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.52","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6694c6bf8c713a3c446b1f02b9fa90e2dd79cf07","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.52.tgz","fileCount":19,"integrity":"sha512-xgsg9IbEmHWQr3tzC4PlbyZkaMRqOb1cCN0d9LDpnxg4RJCCdAgv9wkEGMOIChMHrqtQo5dNNmZ8UsgesavtpQ==","signatures":[{"sig":"MEQCIBA3g948ZU0lzIbUgplEk/0/ZGH3QAD+zcvGTke0VlEIAiABYQtvAG2AL28j5OYKrQPeVyO1ZJ1FPt7ZggNEABctEQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81785,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRyzDCRA9TVsSAnZWagAA4h0P/3xpIZGYQhE4uEnST5TT\n5PdhW1yNFPoV+hQ9lxlYyH5YHAyo7vm/S6m0N8Vbt9cEL+q2JWez3ZxxkOMB\nJszq93oTtc4daSo/qCb+mB2UemGxHyq2whUapBMarCMUXS46hc8Xo4Dn9DCW\nWIupLbFjszrk80J7vDLPkWrndDJtIORWkX7xHGVDETYyOafd5CprJju/LdLp\np377VMVeyrerfJLKJYJUJKtHH01RQGkhKTqrsY91Pp/WOSqJvFtP5jKy94AT\nVsuilUHP6E98WGnV0rIPdG4n9HZ2nyQZRrmMc+8L4D2aNlQdFA+gZDkpt52J\nL2t7cA07OeQGq2Ygf3sWAbsNWkmQbQ4ly3rSDsBJPoUTOW2BmUMd/vLJepn1\nxIcn0hbSHGmgMOZHFPkd1a1yjax7V/E9i/eRyI0hogkQWbZ/2y/QkPBwdt9i\nO1LKGtbuBLiMf1S6df/k2hPX7Wkw4BE1ec0+ifQJbgeL8KHvt3XiJ2WOMYLI\nPDvh8aem70PLkDLCru1LMZ02bbXsK4akephF0TkOIM8W7LuzTjQrI81NSZrJ\nzxFXv/4ErihviI6dvXsKMXjsNywGzT2ZZGrpBD1CRlYdrVhUZWScwqmxNuzp\n5dTDU27suN+LIfNG79OneYGlt59U/3p+25MtvzKWtyQclDtC3E/o/njzHrZi\nCJ3R\r\n=+v5C\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"bd39d7f79c139c7c59fd2313cffea06797391af6","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.48","@balena/jellyfish-environment":"^2.2.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.52_1598500034963_0.7734268454052571","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.53-renovate-non-major-c5bd7c1aed916e4bbe4ae236307b4928d92822cc":{"name":"@balena/jellyfish-metrics","version":"0.0.53-renovate-non-major-c5bd7c1aed916e4bbe4ae236307b4928d92822cc","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.53-renovate-non-major-c5bd7c1aed916e4bbe4ae236307b4928d92822cc","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cf106e9f75c75f84f7e4aa7e37194acbc56dd3d1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.53-renovate-non-major-c5bd7c1aed916e4bbe4ae236307b4928d92822cc.tgz","fileCount":19,"integrity":"sha512-7l0UJOk8iXeP/wexg7kygG8uZ9NaJkDwysyx3cpDrTMTJ7JUFca1KmCS7q7zX7+MdIFCaTybLyqPWvFNykXmbQ==","signatures":[{"sig":"MEUCIQDATW/bmcxiAGljNcIX2+8lJPcg/u8xf+SeLZuKPaVchAIgDuugP8U30HzNsVOBAgvRKuUb3Wly9sbCEuAlBIY3Pxw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81951,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfR5/rCRA9TVsSAnZWagAAnE4P/iStHgDe4Bhxt1LrXaNF\nA699I/KE5PFLCv8J5tTQQIYeiRcgS6ACxpr0jICSZLSnN9s+2aa75MR3wZnk\n3mLFNZzII2pSfeWhp9LI47NgAer7aXYzbR0VpuSNZ4yPLbpfG1BeBaalhP39\nIJbxlwtOHvdcZOEO+ZAKMwxnsPUcg1fetnnYNUBAqWaLKfIo1ZyGS+rT+C8y\nyt4mSjZQczMS+RGfVm6Kz3HGNGe/QZsbPJZQ5aP/yP8tQxTTF7S2l21XTCiZ\nS+Ydk3+6wWwcUo4WIEKQadx5399Z38rP3iSq6ILaSt4nvtvEurEs98OadLir\nZE77/QRwLjGHR3GwufBqicAHAY8UbK9sagQvhJp7jsdh5KLkGhp71gLbbirq\nKo3nXZdkI/HMm0wzK1f295P6MHelPBN2I5/4y+8dR2qgStWBLTEJ8wywsdq2\nNO5gofB/jnyBFG4m+0zx7rod154VaZ7s0I75CegTO1G/DkiFhitFHm23KQ8Q\nfl3ll4KZLjtLj8bwSL+L/5owQI4d9LMZfZRBS0oM96VMkqYqtiND1LiyQWcQ\nrhXS+S8CuSyT+W33ApAEKvRaWUlZy0uIoK4pCo17pVcV9aIXb8836g/GpME5\nmMHGoMu9X19WPnPdqiTH/e8b2EQlhDFNGgth3GabgUPcQEl60HO/H9XVvonP\nLsfq\r\n=7HPC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"c5bd7c1aed916e4bbe4ae236307b4928d92822cc","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.49","@balena/jellyfish-environment":"^2.2.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.53-renovate-non-major-c5bd7c1aed916e4bbe4ae236307b4928d92822cc_1598529515277_0.5252485467818502","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.53":{"name":"@balena/jellyfish-metrics","version":"0.0.53","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.53","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"40fc12ddab32cb1a92d894bbed399a59e33ff80c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.53.tgz","fileCount":19,"integrity":"sha512-HPvAF1EXvRKpbvLgvqzMxoZMQ4lNWBe3WLUl/ZojONv7+msw+oSuPpzZUEtvFEv6CbHG3R75SWbi6GNTvj62YA==","signatures":[{"sig":"MEUCIGgHq1rFtdo2PJYWaUUzGqhBOKaKFoGh1PDjdEzJrxt4AiEAgDN80VoA3ylRzlwW89qp+2UhDSyavmoPiScH6DBw1aQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81891,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfR6ClCRA9TVsSAnZWagAA2YoQAIlODMdJ4Kgf2dye79ee\n/e4B43Z7Kd9ebnbo8if8OIFxxtJfBbxoMqNwM3UiT3g/xYBUb/6zfzmDUyw5\nJLS/OynjqKh7KLSvR8sOjThAO7wpKrnBSX8YiHWSSTwLrnTm3FtazjtCUWhq\n3zNdEL+BBHD31N1zNA7OSTl+YHc81+typFj/11XrIaVm93xYgQB9Ve8HpFND\n3q3Cb+tO/1axI2sYovnJSMNCjBp3NYsP60rBsK566koJPFPFywmjU8/HzVW1\nI/m5pj1mIUQZBbbWlDMxSVTiu87G8Z6xQopzsvscI+DYJ8vkrveqtsfzRfwy\nlgEm+ah6xoq35jizaKaIWEMaEWbn1DHeS51hN5HPPFRlVfOD7ffRtb4+Iqei\nO+vAKfmhrkVmrEh6CHBvsBXfqZQZF3xDpMIekv/ce81f0AnLWMItOAHwwGmh\nuNoqkUjEXdU2sKqyhvEEfJMY+VQPPJk24PndqBcTd1r8bBuy5MT8LNht0ahI\n2aEtYvOvIZxoCfT6b8HXZA7WtPdxFLDNcpvsCeeZ3285qk9/UsR1RUgFe8uf\nl4QPBgP6HhDKxGdhpfe+a0neocEaSfN2cZ94aNo2ZU0euRiL7EMBhAK4r6Pf\n5iwQFST+t78rA9vkxlCHxqX+XsaqxbaA5U9YwVPwBfgoTdokZPuaZpUqORw5\nEgdx\r\n=P8Se\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"62ad7afd64dd0282c28c9e322564bb5cca1ea477","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.49","@balena/jellyfish-environment":"^2.2.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.53_1598529700553_0.788119933710818","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.54-renovate-non-major-4b677ee9592047b72fb5cb62225708cff5c04ab8":{"name":"@balena/jellyfish-metrics","version":"0.0.54-renovate-non-major-4b677ee9592047b72fb5cb62225708cff5c04ab8","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.54-renovate-non-major-4b677ee9592047b72fb5cb62225708cff5c04ab8","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"67e63f23235f66431e8165112c18712c21270c1f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.54-renovate-non-major-4b677ee9592047b72fb5cb62225708cff5c04ab8.tgz","fileCount":19,"integrity":"sha512-UCAfRo5UhPjwPYkY/OcpBu774CUICYdzE/GXfdMnVFAICRjoBEJmxXuXqVlviX1GOz8ILDLNiL1h9CEIbrr0Ew==","signatures":[{"sig":"MEQCICqHptOcUBWMayvljxR643oU8r6QhsEuvrau4fSTkca/AiALmNo3miLgFSpKqoYeNVRV8VuYW2rWxz20F2/edql9IQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82057,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfSQD7CRA9TVsSAnZWagAAIlQP/jQRi6Z334ea6mW9E0Xx\ntfUlwrpIkz7l1i/MZ5BujO1x3HMcmIr9gRTLzsdSZmX4UgEiGjGREbFILiyG\nU1JTRv6xSUvOxZ9HTssgKqT9OTyqqTJwzS9003zcUl6zRTj5GjPCbKSJahzp\nDUDM6PMKhSV8pasAr3T8ZCx1xFQGfIRvWjSCAC53Azn8m9Xdc+UbbDf24vfV\nvnRsBNO5o1o2www4tCqH0cwCeL8iEIv7ow4ZFliVKFWyP6MvbOm1p0zezssC\nyYtTwuMmR/sz+RcOZgvZh7hEkxYL6bLRjbNE2CATu1WiIpoWGSW+kHpeQ3vC\ngvgY/O22NgKISr2rAHDgKlwFgeXAMZPQzHyVmKzCw0zbguYUtjez0DPOaPDC\nw95VSK++kCmuF285Nb5bVlkEibD/nzy3Vzm/nmmGBJY3g5uufAy8AYWQ7Uea\nHLie/2LQiOKA5ObeiAgrS3bMW9XemO53WMBOPXRzAk7P0+MbcMIGU5ayFuX2\nDGjsByhjhQXW7EJKO35XmAiOoqgU3JTl7tbVx3hH0wpArlAn1ctWLlfMsc8H\naS4BGUtcVBhRqdSMv/DqkeHaf2c9RsXSSUJYT1zu/DPJGfTBpLLZRu2UCO+u\n8RkwXGwDfG4fPtc+B+WaD3iWCCI+nD5ZJ3fs0Amp4N34r3oNW0ntySAM+i6B\nsfqi\r\n=nuVk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"4b677ee9592047b72fb5cb62225708cff5c04ab8","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.50","@balena/jellyfish-environment":"^2.2.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.54-renovate-non-major-4b677ee9592047b72fb5cb62225708cff5c04ab8_1598619898634_0.3946229142068072","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.54":{"name":"@balena/jellyfish-metrics","version":"0.0.54","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.54","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5b78a088c532455c26220e0fe608064e2b632c65","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.54.tgz","fileCount":19,"integrity":"sha512-AAS5Yh6yZZ4D2I8r6t1EZmysalVegpLZr17rXcdjm1bne0Foi/ETgu+gvbstjEey+s15imOS8xzl+rlWHTmAQQ==","signatures":[{"sig":"MEYCIQDlxzYUDxrPNSEWRAAOW7mjPnk2Va1w2bwPXEvNblbBTQIhAIAlxi/b1ibNP3S+k5uH2ffKtmcXok9qePX2l+pn0wU0","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81997,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfSQGmCRA9TVsSAnZWagAACY4P+QF1GeM5rwJY/WLPunqt\nZaVlB7dqk8wxXi8PATRZ9TRngL/YR/j006bRNiL0VlSSsVHqVv/H9uylBR5i\nYEZIZluHkKv+bDqlAYOjsEVZCGM3TktjMJldbBTWaEDIlQtZZ3c9u1w74tfN\nhWyDrShRW90ZprrvV/tcQifsBRQaCe4ROW4t4kIrm0gG2mhfeIecSojy3IoK\nq6D9j6Rrr2M3SpUnU1n0XEq8OprkKS8hbdnYaOBKHro6gjxNv0c9xJIDXEES\nM22aJVDs44S2aOVL8q5n+t4OLcX8WumfLyICmon+l161niYwicZgmevaIn2V\nRm3fBhJmrAASX7G3q5zCHQSXb/kUwrLL9um7BedU54rv62SlIJf10yorQ90U\nM6DSccYtZ9R08U2jxbgezbDLZG1zgEzwa2hDNvlt4oY+5Y0f3oNVhNxEsSF0\njKZrFTKuy/HpDlQ53Yko76eWY8g5vpfT+X3mOWVbZ7yzcuwAd2u5Ii90ExD1\nksw8Uo2GloOZg5HXJ8fN7q5vqzR9yFxhM0pS2Io0SJQZjJ0vArcPM4gQC397\nUjYFc1im7cbPJesd4HP8ZoEExFPwfMkal8psGvQzNjJ8hjj9sDP7ZyMznFyb\n6KhOxNOMkMhK/VSPFnwiP3QWghyvpnqEsJ1QyYJgin1vUNRakvoSaPO4rRWY\nBX9r\r\n=cp5N\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"761cfc374338d8ea60e08578318a7a89c31beae9","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.50","@balena/jellyfish-environment":"^2.2.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.54_1598620069576_0.7137635786784737","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.55-renovate-non-major-e41d9302002a6910ff52fb04b27bbf05cf1862b9":{"name":"@balena/jellyfish-metrics","version":"0.0.55-renovate-non-major-e41d9302002a6910ff52fb04b27bbf05cf1862b9","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.55-renovate-non-major-e41d9302002a6910ff52fb04b27bbf05cf1862b9","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"29147aec1202123721f4e904d80d4838f2a72fe6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.55-renovate-non-major-e41d9302002a6910ff52fb04b27bbf05cf1862b9.tgz","fileCount":19,"integrity":"sha512-OpCEFl7AWTEsp0AB7o0y1lf8qojX4WZAkliGXEtQrTSLIXlcUW5VIeTdR2s3rJDs8vti7zfL6U5jUFvCVdhz5w==","signatures":[{"sig":"MEQCIEq9PgLSBC91tR/H+YsZweu2ujIF2dUTfkorEN8Mu2rmAiBGlgBqp2IocrEFazmZRIM5LhTcX7dTYlo28we1mrvzBw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82163,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfST1tCRA9TVsSAnZWagAAz6YQAJhjd0qorj6DV8n3H2Rf\nhOXGd4mWNyaQ1/v74PNK60TzgTkJ2hlvH4Z+6JH8/OGuo8Pcca861GjJe+/D\nwx+96dWwzNwl+uQNh1WkQ1/HOaWlY89o9XvpDAsQvPGLIif9eRRK1anEC4cE\n1Xa5X7ixi9HqSOU4xdz6RgKazjJfWLgv/7ebydtpXKAElzQemWv8cPOqIdl9\nCE7yUUoCltYi7f+E+N+EVTvtywxQwlsB4jTm0q3eloLsqntr2t9I39SRG1/o\nRmVbw/QiMPsPHEbz8pRaIzgDDKNjG6cHLsyuoZRMZc90CntAnoFqmWsAYhWE\nKW+X5uh+paRVx4L8BPNxOyMBf15CblKg7UGyeEQWUpESBrJ9Hk9Rlno39PZM\ni2gwPuNERe59SKAoCbkU9ZeKm3wtIy5A+G621tvgjDkQV5Hj1dlOiZHj4LUy\nQXxxefvjmzMXxlfBWlL75DYINIhofRE49H84MQTsT/OStDUg+nJt5iYRnxvX\n8Sajn4CAIYaSG9sIdsv3yFbAQuLvN3xBXBDDxN2PYqD+6oG2csWPYgwg0bbX\nurumWZjfA9ulAQI/rr1r9vwJAsBTbfIJnkI/wm80/ogZQZwah0sNS+wuYeEb\n08vuiZssjyOH0te3m9iuSqoPz0f3CCG44VUQJ6YykhBdK0EEhoiVm8Kl8QMB\nqJ14\r\n=lJy+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"e41d9302002a6910ff52fb04b27bbf05cf1862b9","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.51","@balena/jellyfish-environment":"^2.2.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.55-renovate-non-major-e41d9302002a6910ff52fb04b27bbf05cf1862b9_1598635373061_0.10509096427283415","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.55":{"name":"@balena/jellyfish-metrics","version":"0.0.55","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.55","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bfe0be159a57dfe8f404805400fb2f4dbd24e4c0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.55.tgz","fileCount":19,"integrity":"sha512-QWsDQQtZ0l+7V0eImeuYVt3gNjrKCg3JUn8iA4/hz0RyhFJSoFvBbY1WtiJYusD9NHDEkF//Bf0Kfp5u6gmg6w==","signatures":[{"sig":"MEUCIHFtYNYt+qZLVQNUrQDAIMGXYDr69wICf7aiCd4kSG6rAiEAgKOiq2BJUdt17M16Ec5VaQikl31rB4PVSxT12STG880=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82103,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfST4gCRA9TVsSAnZWagAAxgIP/02lTXtSt7rz3m4OK7KW\nLbbAMsmJsK+nRjW9YuxeRYW1esD62KJ/yXUXgtxwrX/M/OYnWf/BbRNWqixp\np6rGF9Snu+B06XVu2cGzP5LG2aoSGNhY+YiSAAaITAg0oofr431S6xKY1OAl\n+Iz2zJ1VQ28oTkPfc4bFYKV5D/YnlJQIaGoFMRVmQHg8r5VJ3kB5uaNgQwOh\nKExDgTxW62X+BjDkVXGAaSsggh63a3X4YlnAke4540mKlz+PBUFScWqnPxmq\nWIaHv1k86AJWYnMhC04hH5WRcVz8FTNvd/Uffd7LbH36Om+ZKcQSUQ58JzrA\nz/MidEMeVJpI5r0++GwOYK1Pmt9RSIuTAoG4HYYoERWK0/dwmfTJCtPT6Mmy\nOAkwTTWEuMn8fdl2wKpXIrvlWmqCaDJYZUdCDOztXdWx/wt1XPIelVxbLlbj\n/NeZmqAa1rM0XcDUmoZRga8jq3fCUqaYk6+XQBBP8sUnfimbMgargDHmoyo7\nLP5su+0CvU1p5RSNf5LgEKO/OBLeFxnkDlfksiTRWUAe8OmsUSJyy7YkWfJY\nVneV0iXG8bLCJv4b8i234jTbXZgYV54QtGnWY4EXan7PT/Byj9zYBwuaopsl\n81pwCi5UVl1h/YovcEV79Y3a/nSWfaSMhOqjeO9aO5uQCUhBvgKFaUXPuPdG\nWG/O\r\n=f7ap\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"eb8b39211f2482bdc40b82a946bd40785e81c0cb","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.51","@balena/jellyfish-environment":"^2.2.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.55_1598635552282_0.20997400919709008","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.56-renovate-non-major-7c2287a3c40acaa1d98337851b648cb98293131a":{"name":"@balena/jellyfish-metrics","version":"0.0.56-renovate-non-major-7c2287a3c40acaa1d98337851b648cb98293131a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.56-renovate-non-major-7c2287a3c40acaa1d98337851b648cb98293131a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bb734fcaf3717ca591be24e8d08b47285ee3065d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.56-renovate-non-major-7c2287a3c40acaa1d98337851b648cb98293131a.tgz","fileCount":19,"integrity":"sha512-ml3XHiKGc7rEPUig7Fsz50CYAsLzD+XvRNzP64kdMcAjdA09up60mL5UXLjBvCdOCEQPKi6VO4uGgeKR9jOsWw==","signatures":[{"sig":"MEUCIQDVlOofPn+mMiceyJQZSAKzw0aII3GcyO51QzCr+KEKfAIgY/sBoLu9TcS5/HimKAB9dXs4JKno8vqRagDBIqXgbfM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82269,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfSb/HCRA9TVsSAnZWagAAPogP/31V4mfP3DtcLDBpa97u\n0DaQ5g8jdaK5cVgyfV39HZvQG011rdLhObKxN6hCkVBXObzk/L/e1HiUpY42\nzpQB2a+jChLNhAS9cGHXdv4Qro6u36vkugHa6KqjhgKnfA4Rb99GiQyPIyS2\numWwYlUX224jjpbPqNhAVzgH/067fytWxqS8dnGrrkkAVIJbhQF9OGwZoMaD\n9gxe4L9DI1v73F7coxrmHs04GwWmlksXLRFjAHGsMXaVqGg7CAWtQPdsQd32\n8GNxU7yXDHMn5C2/0EizO3E89IfGhFURJNilhg8sHIK0H8fFVZwEoRJ+3GLa\nLy5rXAnxwZQzVBdcjl7O4z0/D70LR4taA4Ql6NjctUrKpiZh+yV3mlD/ZEbg\nUjm9xZf8gPDvalGWUUAOo1mblqtKSnJR0naB+tqjdPApo6k4FaLyXkeEf1I+\n+o0F5cvKJm5eOMjbRRUwhUZUv5wiWoTBaCGLPmHZnH9q/mw5wFGcrldbH+AO\n9/33EjS+xBftJgq0t6Ewd3hSl6PHFBO1V5HCvqWQ+85jZzB9HvFSvHslmLs7\nRYHHcCihET+xvcxOBLT6wTQiW4xORX+e1qZYNDQbriSZB7hj3amq9NzLT0QV\nWNdLWYf0hwHIB6Wihlj73MNcQbuEWgs14pran5TA8kUjvKP/fmEGfPBcorw/\ntDOJ\r\n=3AGe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"7c2287a3c40acaa1d98337851b648cb98293131a","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.52","@balena/jellyfish-environment":"^2.2.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.56-renovate-non-major-7c2287a3c40acaa1d98337851b648cb98293131a_1598668742564_0.8439111057678887","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.56":{"name":"@balena/jellyfish-metrics","version":"0.0.56","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.56","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"79975874500e03e9fcf7caf70e5f6776aef536c5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.56.tgz","fileCount":19,"integrity":"sha512-H4B/0iAcBSrteqSA8qkIriJslk92A6Rqpj/D7tYZcT5PEW/VUkh/S36umDZkfkngmfX7GS/fMRhbLH5aN//sWw==","signatures":[{"sig":"MEQCIFU5jpmFlDp4FBJGxTmeP06BoJEVFzwN8rJ/GdgN7Cj8AiABcOAzHLFDdAvaLX3Ycm8ENSUy2VvH/0iB88QVx6bbkg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82209,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfScBUCRA9TVsSAnZWagAAFDoP/i0FzbM5VLs41pLvnc07\nSIB5Sp3BBzfCtGL34diZ6WhZfAqM/p4kBtV/Y5MN+wg2T0hT9uqIkl+uG5M+\nypK3biHiuMUqJcTpqTpyPzpubP6ierga/y5YHISZKuuYaVz/cs5r5kk1/Q0G\nCz24iLYGLqDyumXD1tqizI1avW62o5mhT/cnJyCKp51jmAwkhCJESpK3p/6N\nT62OjId/XAH1GVo4Ugu65Ni3o+zTF1Kz75IUTrZyiXuN3Lud2kC1E/plbj7J\nnfiR9TcRd/Ctk1lMR8rSah8ui8a/0tqi8J9QooqNFI5VcZoc1GpWnZ0xGi1A\nmKPr5sPgpCUoU/egwauXtaI82B3O7SUquqiDUMSP4uKk0HlXStVRN/8DNM9A\n4TJLhWaCTt2PDDo9n0ZnCZw1dEE7yrkiDvu5ZR8h9GjQdY4UrHKMyayW+3pv\nhLYFhant6R227Z8X4TPhB2ZRqSkNZ/j7E4cJ18YYWvwDj4sovOoSAmffOKRU\n7mcWqAIaoiaPCNn0icqteLyI29eZWeCKgofxwK35ylUH3KaSmSBorSoxtErZ\nsf/V2VXPamF3lgiD7AqW1dT2zbp0FSR2IKcQry6J75TQb6cZgm0Rht3fnPDE\nCkdVOHXXhLVudD7uxGdGceIYJbRpCXYAqduQnKUOi7xSs+Rt0TmRIhrDbC00\nG8yF\r\n=gE2E\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"122bc59668a5936a7194e1138813f258c4895025","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.52","@balena/jellyfish-environment":"^2.2.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.56_1598668883804_0.11614040427422356","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.57-renovate-non-major-c8464ccfe6d8c4e6519250f26d378c645244bcb2":{"name":"@balena/jellyfish-metrics","version":"0.0.57-renovate-non-major-c8464ccfe6d8c4e6519250f26d378c645244bcb2","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.57-renovate-non-major-c8464ccfe6d8c4e6519250f26d378c645244bcb2","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"891e5a0ff219d84653f901edab6216f38ea0eacf","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.57-renovate-non-major-c8464ccfe6d8c4e6519250f26d378c645244bcb2.tgz","fileCount":19,"integrity":"sha512-xW8ET2G5pg/t8cHllfDMHMC16YkJHmbK14G0QhNxNgtNWCWIEQcFAMJz1kZFdGVWjX3qedWgce3C/xIJSc3Z9g==","signatures":[{"sig":"MEYCIQCslYkp0IFbq+Y99TnS7/nSLRPqCWHKwvdjOf1d7wa94QIhAMD/SVLaKjgKx7TnNe6jAH1PfZOEfKjQFTIDj5xsp+mk","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82375,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTGaRCRA9TVsSAnZWagAAkuYP/2buTM5Rm5c1Xi/nNV7/\nnKismieuoDpYrVP+FbDm+HiSz7WTBR0o/hkKAEhCCJrl1rSN99qB8x2LSJmM\n6Kh5U01Gu8kjnjxaCPVnhKLwMGnnKKKxNswLxRMnbyLbOcXSL06/J/ewYdkM\nEiTqhDpVw5owSq6V1R6gYSrM9BbStUiJduMcksd0xNAqkp7BMbAeP53efXck\nVBURjR4KJqgfw9CAhTgRtvrVQxf5vlNEy/d3vl7z7SGr1fCjqVyIyR2/a1sq\ng+b20+eMwzhIgLQjG3YzXCVmXAflHjuUxyhI1yuElHsoYQGAu2StVvrg9XE1\n7DRW1sABG+9Wy+9P9CTHR0Nh8ou1e3e5Fg0tZtPlq7aHI+i4nnlz01+PQH+A\n6Tj5jY+51Lc+PUZXX7AJ2y9EUBDNdyn0cRu61yt2csqdG8ahqj/PMvKdkHDU\nTmkUKXs0cakaL+DOz9ar+ajhDU/zIEOEj8aIBmolOB2KvQu4LtrIscqQscte\nm/Tz/dOIDr0ptpvQ5S6H/vt/JRfdygBtx4TkmTLDo9n0pUPO+cMs2vIfxkB4\nIGFPAHQbKg92HRkgiGFBCVO4fgpHTCp3OQk6zvZwx8RdT6K03xRzqe3iggZU\n/C6XHdUad2pnIopK8RDDTEJDs41oHFyhhaZ59vNbvakbxfkl+tNUqKh8aBB1\nKrQu\r\n=yHZx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"c8464ccfe6d8c4e6519250f26d378c645244bcb2","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.53","@balena/jellyfish-environment":"^2.2.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.57-renovate-non-major-c8464ccfe6d8c4e6519250f26d378c645244bcb2_1598842513002_0.4176496997530801","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.57":{"name":"@balena/jellyfish-metrics","version":"0.0.57","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.57","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6bb5a7a90b4c02652ee99165b8ae049469624457","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.57.tgz","fileCount":19,"integrity":"sha512-6ebFJnpBeFlb/pYUBHz0MtZFztTkhrxmU/GOARs7Yhsgel24PITfPi/RWUSHu9TmE/JZbHSW5fZZB12kxZRB1g==","signatures":[{"sig":"MEYCIQDKzWJRQM0yhBLS4HZ42w3L2ZC3VMRo5DiHKLT3Yl40VAIhAJmspT8Q9dFrX6NWSqgWtkHOaWm0Ez2cNLuzaQRuH6ZU","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82315,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTGdMCRA9TVsSAnZWagAAUBsQAJ4bfk1EbRp5gQwl3Pcs\nqjAssJZXHbwuDuemF5sVvT9bPk2GxF00CjVrsugCoPoSs8RkaTc54hIyx2nA\nWl43RV53ATufKon0yZPXxZNri//pInMAVfkBbBHOTxKHHCMNgzb8rfQ1wrrr\ncwGZ9D7JOAeX4NyxdLx1RnS6AR9RT9LgFKMnpqRnb2ViK/vK+XyH5ySFmXJS\nRsX9kUBixBMt+0AmqzxdHHFrpe7Ccf9hU+deMbo0dyLM9tZF7RMywtSBghEe\nFXGy6Kap2UH0AQok7z+SW+zSHe3RnQnIvkddjSiK4oQoh8IUFBDjnVwpaFBO\nDXU5xB8nDhgoE6Qfj3B4mM4pO28yZQbVHAqP7ho1BlGcYACzm3yMbCtWOZTm\nLsICXXkjipJWs7hjS5Ow7wK/ritLf2us5ruihKdUj+ZotyukEVcyQRyS5Qxz\n8m/WLzD2Oalh93/IG4jhSI7Sv+PVpl12YXSZbeSyGmdFybgZofdk+F9kB+m8\n/HN1rEkBpFx0fSb7w90odmtfkFV7u+zLxyVFiQruHVF4vEaYUblaePsoZS/Q\n7ZycG/8oto240ethw2rBSk8GXlpRYVF6ywUSlYtmgk5qYCgV0CQcDNCW98h6\nMbJ9Iopv2BfR+KYaMdsqkohx9I+aEK5r12K1kmfjmISDl8oKpoX3aWsi28ts\nLT0i\r\n=yGOv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"12d27d1aa7cb39144a3513a5498c9663277e995c","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.53","@balena/jellyfish-environment":"^2.2.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.57_1598842700078_0.5443134425196365","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.58-set-commit-body-b9632969e289b3cd7f5ba2f1b24df3290ddfbe0f":{"name":"@balena/jellyfish-metrics","version":"0.0.58-set-commit-body-b9632969e289b3cd7f5ba2f1b24df3290ddfbe0f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.58-set-commit-body-b9632969e289b3cd7f5ba2f1b24df3290ddfbe0f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"07813b513af7e34ae0418dfe43aab65260295675","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.58-set-commit-body-b9632969e289b3cd7f5ba2f1b24df3290ddfbe0f.tgz","fileCount":19,"integrity":"sha512-w21igMtAIeWZrHtF2quvAmAbmOkL7tfxmhx9uol5Za6fGU46NnX34RKseS44owwzTBRIU0QQ5ont/e2YT28UrQ==","signatures":[{"sig":"MEQCID9EMuVFrZIuiCih3qnpl4gQHfGp8Hg2H48+NC8oljRhAiBBXFDF7LvkRIXNcchrdh32g0Su0/2vxLobKXq27awvaA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82493,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTJRmCRA9TVsSAnZWagAAx/IQAIV/tUysojg5uTk17J85\nYaSAdQZQNfTtnBJ+cKGgZqLVi/bot5ga8k5QTIGjOjRAHkK2hDMPXG6taPbf\nH8YV+W3cTYkdbGR4fPH71TfXl1DuPKz4u50HrszR+PoNAMrPfRymVeorQ7k7\nBTZ5DGwTWOrnXrk98qlf3KL+hHaKcOa1Sxqnyp3W2M576fLFs4n0okMkLLZj\nM7UkLLVQlhQDnn4l/K5e9LTJqOy5q6OgZ/QtbgQJutOXK6XCW5nyKTrcUfCP\ntEm9VJ8zwyKqdUFQnMLWFO7RXXejp91WE5jQ6zWuqCP2Xg+xYtBj0YjxkY6A\nyWIO9qVCskP5tBWaSQtzTNj44BaRdvv2jNU+Ctk4RsGCulVzH2Pxn/US5jHR\ndq0RNNJIXRvD2M4a7/K8U7G7Kuvjs6EPlHP8J+GzktzMyfeiWwzOcHTKSv88\nHLwRrpTYYMFH0JZyvqaxqs8HH+5G3zJ7DH0+rcwItqkO6HBMOKsvgBDJJCXd\nsJOyjNgVLbyW0+Gw4bd5un8BTFblBfYPy58cK0tTvdNjbeKJGNl4+6vQCgwV\ntE5KD6lDqqFvATXKpy6raShjgYcYDqw3usJd2o5U6CONNFnd3486Gog/Og1I\nXIPQ125pf1RdKUWkclbYqlvG6+7Ha3PmQJgmLm1l0doumdCZfb+GIAmijR01\nRll7\r\n=TuFD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"b9632969e289b3cd7f5ba2f1b24df3290ddfbe0f","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.53","@balena/jellyfish-environment":"^2.2.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.58-set-commit-body-b9632969e289b3cd7f5ba2f1b24df3290ddfbe0f_1598854246070_0.6081057834774839","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.58":{"name":"@balena/jellyfish-metrics","version":"0.0.58","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.58","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"767562986a666301a96f636642f0c1317fc1af9f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.58.tgz","fileCount":19,"integrity":"sha512-FpuiVg4JTX1nr/YSiRrMkToUaitPO2Ca9rJorH9ins8VL1wb34GYqI/eEEuNGokOuVJtQR4v4T7DAy2CR91wpw==","signatures":[{"sig":"MEYCIQDg0vZdDKPoaogVK/vkkM/m7gVvWXf0WYK+hfsYUrOrXAIhAOh9BzU8QgCU/owZhT1QspIcRZtQ4KLZexYbhailzE2G","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82436,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTJWzCRA9TVsSAnZWagAAIiMP/i4CqJWIv4a0AUv5pQUc\nHzxXz69HX35DYWGVEbIYUFB+sVzQMPIpX91pnPefeHioAYzGbqwZ6aQUUIeO\nH7tYyXnBtCSMHF8XhH/dlWpjUFuHyhe3IAvhd6mCcOhC+XuZwLxtkh5QQqsI\nqd+WBYq8y+HH/Pdj7k6LSMYneCEoYl7WGQR5Q/z+bOge72BC9OXJ+cpXHbpD\nkcMiblKS+qCGfxbhXwlJhZ2EXmF2NKxiF9VbnJsQYD/9h7xFHBANoZwScdRZ\nojYHcNtq4YjkxtIpmf79FpmzoEea2Fx4MiXlyZGRovHCJ1VEh8ygcqlcatds\n3u+iE3g6wg2OwDidy1eHpAltzxtDEbbZmHJDgngt6tObEMtUBYHL16xoTUA5\n0PwFEDLuSQZkdEx/P7Ih/35eLJdKbEDqyKNAoVLASExqK4h5wznQtxBHLLOe\nt1Ipl+bOZLhv7LHb7rpo75A4nqaWnqSY5t8OoooTjg4Wz8yJfBtIaSItMA8r\nhV53XFO/6DK1IE9QHz5OTJC1FyqJDptqqjJrVeoFP8hOVjwcapaZuaTeGTyS\n2ZVmgHzc1sxVZ9Sopd+Oq16eAZJqvhmF7G3UQYwocansnIZzZ5sBPE1dImXv\n+T4kiEpT34P2Tw2576ubUpcCLc8qx+OrKOFy4JnTvtYziwg0wbbQU+ecV4fK\nN9db\r\n=LQbB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"ebcaae731bce86786e8799243cb3d64ad676ab8a","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.53","@balena/jellyfish-environment":"^2.2.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.58_1598854578946_0.5935095633199869","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.58-renovate-non-major-5cbf3e4a185a1551baf0848388a5059c7aa07430":{"name":"@balena/jellyfish-metrics","version":"0.0.58-renovate-non-major-5cbf3e4a185a1551baf0848388a5059c7aa07430","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.58-renovate-non-major-5cbf3e4a185a1551baf0848388a5059c7aa07430","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"05bf94552d028d60e77700d5fbe896d8600f363e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.58-renovate-non-major-5cbf3e4a185a1551baf0848388a5059c7aa07430.tgz","fileCount":19,"integrity":"sha512-/D+bGhDyNHj9y+6S8oy3v6BMNu0yMFm65Edu61LSTb/q4Lk9GQvEBdnvRxAiOTP4eOHBx5uMiHiV0tTghhYNGA==","signatures":[{"sig":"MEYCIQCKNB9MK7l6iJ94WRuvz6vEAUVoTiOJ2Ye/eilmQ9+f4AIhAJ6i0l3S1f/UeSbcFYc1DZfe/AxUjZQs3EXFYFexfd1o","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82538,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTJXwCRA9TVsSAnZWagAAIKcP/jPTFxalbp/Gjtp5YBHn\nK+wVmMZu7JnGBQmX+QCpz4WsIS3rA/hFeFOguSrl5r0MXbMMD9CsqCsO6bz1\nvCkCjJ2bV/d0WkOv/ML2C522vIxun3EUQg6wi3KjhcDWBNzhVqk3M7AZIGl6\n4RwdJ2MuX0qLs6NO4NuYkMiWHqMSk8/IZY+h3NaV6AWf07n+GnmBgm7VtGiq\nOzCcLMiNEjIfzDuB6ul1gOZ7dVhZzMmdBm+3tyiTBKHltWNVneeZ7g0Qd0cT\nshFVMVjI2pe9x6VXPUtXzsv4+WjlEVSKocd/Wx+IMYY17yE1L5zLR4Bo6pHZ\no+fGtvb1bTLWWxK8godBk9sE7jjUt8fnyJcmrupn4a7bITp0810RGlvlTYaC\ngEArfJcSJsQx6Jpop7aL5Q8DG2Hc+7os/uO5rLKB9DbvcOPlBCS7WWDFtnnd\nfuUdODvV0ZKJtLdGY9/8wgt7Lwpx/Xp5lGuy3hSngx3KnDexDH4yCtfPKUaG\n17ZfeaKPxXLs5aFEXGV05ZC8wu5RSWkwZ3399dynO9n28NDN401npUOpXHHA\nxSMqTrLHeTK4XLsfzNFC8uRBlgM5j5lDSAZorO+NjTX6EURbF7ychjH2Ih8W\neoFLDxPApwO7aptrGN/u4F2PjNI0FqQoYvDjkyJUPR/5iJ/HC6FqK7EhU6wj\ngt3h\r\n=SP8u\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"5cbf3e4a185a1551baf0848388a5059c7aa07430","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.54","@balena/jellyfish-environment":"^2.2.10","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","dotenv":"^8.2.0","eslint":"^7.7.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.58-renovate-non-major-5cbf3e4a185a1551baf0848388a5059c7aa07430_1598854639771_0.6652198367241531","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.59-renovate-non-major-c42fbc7e9c10ad9197268d761a54cbd173e1cb11":{"name":"@balena/jellyfish-metrics","version":"0.0.59-renovate-non-major-c42fbc7e9c10ad9197268d761a54cbd173e1cb11","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.59-renovate-non-major-c42fbc7e9c10ad9197268d761a54cbd173e1cb11","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"94ad577f9d033eb2a43c145a319b21389d8cf519","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.59-renovate-non-major-c42fbc7e9c10ad9197268d761a54cbd173e1cb11.tgz","fileCount":19,"integrity":"sha512-aa+HXTMAluZoQCRp+vCeCOGcUmnYYYxfyjgRzqA2eZPAZUm+APFf4DmrIJGephbtqv8iPpJW/H6uQZNv3DNYSg==","signatures":[{"sig":"MEUCIGnsG3tljBXSjpuC2YYoY8Tuqg79YeMtFbOhW5xddfcqAiEA7/EEGE1EDmgcqhLf4izeVFmWrZUYNLwAjuvoM69Rz9A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82566,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTX+oCRA9TVsSAnZWagAAJ48P/jX+KCQG4zML9kHa9hIr\nLXuANSbndiLuSTcButpkuU1GMzuCmGldlRfPDfBrdxzFtMBVJa2d5umIdXuj\nlCku+z4EpIG4QQEHpubG+1B1wonUoPPPEFIyF81+lcauBPmXrqpPppXFzS0u\n0J/W1R4KSRCfT7PPMAFVgFDCfzyB5ndByQl2niwro2gKP4zNTIdM2LI309du\nmJ8awdP6qIft9bJLRhsWbCCCS0aDZZva5hB/bvgUrHTlgA/L9rINq6Qz+C93\nQ7vCB4VcNI7zwfGPoe9kgKAeHem2Wv0ykvo8RTImr3TVs8CZ+Aov3ebi0y4Q\n0WVcbOvHhkDyCZKwkROkf/JsBX/4PAOTARoELeVupQbBVpdXIzbqYHqXffg2\nSv3kJ9w+UBq7cjE6HIxorrH0pRhCDX5R5uGSx5skGsZ5HADRZQlp56ATSrOU\nW0XrXWm8Tboz6zbqwNc/Qcln1csQZJSajG7B0nmXmKZ6irj++FdC9K7Bv9x8\nxys8rD+sndbVnpw+M+iVCuwxXRGGFKCTFc7ZDYueoFkv/e5mOPhjuXLJBtcC\nOvPGO/Q76NWu0caLT+ceZZiVdhFHTatT9xnVoVmpPyh2mZAcVxgeMMLr1qAu\n9oSk20on+1TLawH4QLw0LFvIkM9SdSlGqiUNJ3ddXrac0K+porIfGIEE3LHX\n9rX2\r\n=2URv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"c42fbc7e9c10ad9197268d761a54cbd173e1cb11","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.56","@balena/jellyfish-environment":"^2.2.11","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","dotenv":"^8.2.0","eslint":"^7.8.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.59-renovate-non-major-c42fbc7e9c10ad9197268d761a54cbd173e1cb11_1598914472244_0.6712803977097144","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.59-renovate-non-major-4da33a1c5f3a7bd4f7e5cbaa1bd3955861716850":{"name":"@balena/jellyfish-metrics","version":"0.0.59-renovate-non-major-4da33a1c5f3a7bd4f7e5cbaa1bd3955861716850","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.59-renovate-non-major-4da33a1c5f3a7bd4f7e5cbaa1bd3955861716850","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4f52433022291c14e44ee740e5781526265cdbe8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.59-renovate-non-major-4da33a1c5f3a7bd4f7e5cbaa1bd3955861716850.tgz","fileCount":19,"integrity":"sha512-g0LQJxopf96/AD3OjzPUKdClHBHddDPW8e03ceSMV8/rRMKRjvTWHIG5bmIXoxDrG3jNrGYnb4IBWN6V4Zdleg==","signatures":[{"sig":"MEQCIFN9ubgJZiw9oPrQjXiS81IH/7ARn2cGQZq4Bt0lJO/6AiATL/KUGoVekfN0b7Tsnh5F3p6qQhPwBMTb1iK72lxLIA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82644,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTZh3CRA9TVsSAnZWagAAY2MP+gJXnQi2dFqn9BgOfuSL\n4IGuI7QqZ4XygVEwn5F2anfuIfu2iQ/p6KPfYfqMHgZVvAaTY8+goGegHgpG\nj2cDKA96byoQw3LmmVS81rHHwDxChP49XbWGPtu/RdL68e8kQMClzB2x4doG\nRXTbi38JQBoIqMIT+1g03reTqtMkL82DwLBcWauuoQ7Rz8qRPJ8gHMNK0Ap4\nwkCEKUf2Ng5sAdTR1McV5EJ24A62Ij5fUpgGVfxs20mGADcbgxVuAm6uIdsR\nJ13iMVEB5ikYBSMh9K0ZU8cvHTRtmkauroE/WU9TGGA9ddFCdonGwKr6wQ0T\nCwt3phaQidVwDxyxy4CIDfqxRAprfs117wyD4BF4dUbWn+QHEIRTOzm1Wj4n\nNh0bfRD42hKnJlHxf8t0iyldDgrRoFO0WLHicr6YfO2KFKaKJtBW/Zb8Sb5s\n4LT4kual7EdVgmawKqor2MlJGUScHIa9bHImFGwkHTrxxwqMnMVoNIoxZzCS\nVZ/BYbTPqltl4qNbulDbTfFyq0WhouEizPNbio7fFVT00gJfGWhyMVbjd+90\nODauRf3XGEBDJprBW3b8G5fJt+y3/Q+b47Hk6AvS9q6DzLcwmd0JWT0OGkM0\nHHamzqNsYcYwCtwXEh2XMXWx9geU018p1n6qGOr3jkWbeHGL4kUD1UEtL1PN\nMkji\r\n=1wDz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"4da33a1c5f3a7bd4f7e5cbaa1bd3955861716850","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.57","@balena/jellyfish-environment":"^2.2.11","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","dotenv":"^8.2.0","eslint":"^7.8.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.59-renovate-non-major-4da33a1c5f3a7bd4f7e5cbaa1bd3955861716850_1598920822660_0.923472489387068","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.59":{"name":"@balena/jellyfish-metrics","version":"0.0.59","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.59","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a09b2df6b04bf337391c485441be77782b7db005","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.59.tgz","fileCount":19,"integrity":"sha512-kHfCRCZpYpgXCfPHM5Nw2piCeoWYF4JFlec62/6DdAwLsIHNeQE/0PWMVlN4hC9yULU4XToweIJ0p2bzAjBvTQ==","signatures":[{"sig":"MEQCID1VJqYH6BPL3068mFRxviY2dJxodzmYsEuK/tb9ydpiAiBHncGykYTNjXKDfpCnd/IgzbbKl7Ad3RX5YyJ4pIYzcA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTZluCRA9TVsSAnZWagAANw8P/AvFOc5FK58vGL/If5Ik\nWO3SXM7mENXMULcCcl48+/atfe5H5pCYG8X7GKOPz5XnBOvPT2YhiIzxLY9d\nBT0ZNVtg9TJMqa0UxF7LpZI17lx2jVOkJl0yRjXSV+rGxzx3uV3/WrHAWcQy\nC4lKXY5nT9EcET1z85WNQnL8EWGb7zgCrFIuJxt/AbZ4lu63hoKHL0LgDox3\nVUyn7ril4HFLf0IFpHb/Jmxh6XdgvbUqHy/g+SGfmlsmQEdmNiENLtV+WIfp\nEf31gCKkoNnmL3I1wKVX1EAbYMxjZdjbhSfirRwq14kTVs/JmKAqKzU+ECiP\n4EFmjTjf1i93333JeNSuepkEo/tieZNS3FCEBybSyAeTnC8zzpc4Q+Hc9BnQ\nabD2DkVf20R/SfjAuVspWDtBG0N1lcB40iE0kmdHrXux4At5phJQ8iN1H4kH\n+3WnTtuUh+9EdJ3OWbyi9eU0Jf8mIrS6ArWBo14SQG8SS5UsEVZHNs4XNv0Z\n5pcSBVXrg4g9aqzWPScNd5k+6Isn+luup7Aq1TZakdVNCaKWxG6kgo4IgImJ\nJDjHi1P6qlF1TG/gPCZBiWRl94g0jHttPrcOEHTtSn99OmZeHEngC+TAN4SN\n+TKB+cqlRzZ9mh8+zm3OOpjMRvz8X1N5379c08VoJDmj0laLGqa4Iy8IC+ED\n/xoE\r\n=jLf2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"894fed5484a9a68a35a3b1e7f2d19a8ad0955dae","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.57","@balena/jellyfish-environment":"^2.2.11","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","dotenv":"^8.2.0","eslint":"^7.8.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.59_1598921069518_0.08466908977444976","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.60-add-lint-staged-0b2e4c96b8baac52a628e45c988908181fc1be73":{"name":"@balena/jellyfish-metrics","version":"0.0.60-add-lint-staged-0b2e4c96b8baac52a628e45c988908181fc1be73","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.60-add-lint-staged-0b2e4c96b8baac52a628e45c988908181fc1be73","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a6d03d7f3fb8cd1422333a0eb355b8dba20de114","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.60-add-lint-staged-0b2e4c96b8baac52a628e45c988908181fc1be73.tgz","fileCount":19,"integrity":"sha512-NEos7legutFM3GEW016/ZwemqtWrOCJlA3Vk+FqvKGIvMlLrjsd/E8zXXbGzv9RbaSn6VmzFb40kMiV/bCapdA==","signatures":[{"sig":"MEYCIQCDvCt55QN34o/xUrNpmLGEX2belaXiUyKg551z/N1a+QIhAO89Nx9cklQwnDYatFU7t6bY1e8Q/FltdyB+B0sqCwGH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82937,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTat9CRA9TVsSAnZWagAAFFIQAIlZIrePQk9hk/neHPVg\nOJm1/IQeYrOhtL1ARKgq2ISZ0zWCKDUpKG6wGsOlETeRwDM0O6/pHhcHuun+\ntGoSSvSSMb451OPAX5HEwR9xhlhAMB1oxf08ELCBtfXvY1RQKg0bTeJBz1xg\nFsmNHXY+fTC+1+eBd6GyuId90ZvJnkuKb+YE+9vCLAxLxVYLw5iZas9mFeyy\n3XVNz0n4P/ZUeqb7qXLdB+H2UBrNUv3zVzazuYwai1X5QNNay5sWfluCCTU5\nsCPk/sH9UyKxflFm1el+EEq4VsrTVNtZYkPIPHu8HGcHeuF6NpgpGYqo/BeK\nLwGhlIoW3cgdgsZF4/p9ecNCYiBOaPJb39+IMw0aZgXT2Onrki3Rlxqmkl1i\n7VU+fgGRMiCZKxL7HuvWn3m+In3LGpn/A9rbrikS45knYK6vdtQvnb+gMMaL\nm6oiv/NwpV1+52UNA3xWMh6mPw9SR6sS8SRIGc21F8t2qhh/kTdTKc/Nv7aK\nFWJIwwAM4rTqoPYz0NH8UdqYOTp/V6kUaqa+j3FbnD6qUNsYbC7I8XIaGGpl\nxCb21YYOYnuDfsbk71BVr8GUTq2tj7ZNXNvN/S8Fhnsyh+wr9Q3QLVmy5N4K\n4rtt1q3U8wOE+/qdDqyBFUtkujfjt3AfDkOEFsSfEGkoF+OXa1F8r2mXJazc\n8QrD\r\n=MN20\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"0b2e4c96b8baac52a628e45c988908181fc1be73","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.57","@balena/jellyfish-environment":"^2.2.11","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","lint-staged":"^10.2.13","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.60-add-lint-staged-0b2e4c96b8baac52a628e45c988908181fc1be73_1598925692490_0.5137657181129296","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.60-renovate-non-major-aa2ad3d478c7f40e8073304c88b374b8e97a6069":{"name":"@balena/jellyfish-metrics","version":"0.0.60-renovate-non-major-aa2ad3d478c7f40e8073304c88b374b8e97a6069","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.60-renovate-non-major-aa2ad3d478c7f40e8073304c88b374b8e97a6069","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"51f8bf9466b700c0371cc45d134cdee219f30e85","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.60-renovate-non-major-aa2ad3d478c7f40e8073304c88b374b8e97a6069.tgz","fileCount":19,"integrity":"sha512-WtQKbBajgVADyKOQj9RXJwrKhkBiJaEj3DMio6rabyBRWExRqQ8QE3J/jB7o+9UzFT5eDLMCZhJpRajTiODLwQ==","signatures":[{"sig":"MEYCIQCsQXLJrPVmrxb9IO2uNqgdUCzI2b8dC76qPRh74A23bAIhAMwFi66zJ0ZaP9q8MbcEmgk3YMfucgriIhGWb9lxZlNj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82713,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTaw5CRA9TVsSAnZWagAAa7MP/RrqsnV0zfwB9KzfUA1f\nrTZTRLHwqj6uE/lLzzOh5YmE6Wc9OPmfZ3JTEzAdcBTe8RpslI7dCqYTutWE\nauurCnCoBSl8DBGrf1Tk2/y3wTC0pjwLz8W5KttKPsnMxTm4hV88/JxYR5lx\nUYvhev6vov2d6/KFviXGIP6BU8B6ruaX5VB64IfRAMcwXcW+n3nvn67pnlQK\nPWnGE72T5547IP/J61epGzq0b7qHttAAi4nE3sl3AnZ0YwPoia7rWqx6LPtO\ndWJcEv5lRyxAgnDVjx7QC8jEO/IAENtF7Bgco1X7IhXLuicFSNXASeAc9oVH\nK5twcDgMIN8Piqqlfvc4Yyz26IpnMznzg5mT0lpj8m497Wy7wZL6tKG/COjg\nkWiPi99WrSTkzm+5WkRT7kqCRUg3oISBlHfxSL+P+/eQs2VGsqwBwFAEMq1n\n5Uy3lFVbYJTyPCzCwyQzUm9iAbHjkFvZPVCoYmpAN4Nk19TJQyu3wRt6s+hD\nt/yCm3Ba4XWd6KlAxa3QoetGXiCco84hFPBgghwrgFt0nGktT4CH86V6/81h\nd6Jdfcwl52R4weImWp1qx3MgcIgAvdh51h62xG0ynSFbb/w1AqENWwrj3lij\nHgZo/9OkJa2mTAE35AENRkwR+3TcKR7k5SGG18R/DxeEEeSRAyLaJAS6s7Y3\nbyhS\r\n=UCxe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"aa2ad3d478c7f40e8073304c88b374b8e97a6069","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.58","@balena/jellyfish-environment":"^2.2.12","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","dotenv":"^8.2.0","eslint":"^7.8.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.60-renovate-non-major-aa2ad3d478c7f40e8073304c88b374b8e97a6069_1598925880552_0.7010201643818001","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.60":{"name":"@balena/jellyfish-metrics","version":"0.0.60","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.60","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a1c9c5f8e8cb62b30faa0db69795a29834da7ab8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.60.tgz","fileCount":19,"integrity":"sha512-dAPfVskBNo8kZURX8hMbaCWTBQcO1kY+FuLvrv6Yfr0a15r5EHGpnlHi3qbAXaCnzbqC9NahkwHaLKugiAIVpA==","signatures":[{"sig":"MEUCIQCkTPUQ7LExjKva8dwIKySdLV9cLE+KbtZUaspCc8hBXAIgJSSGEli3p4I69q+NJCTQZjCACR31sDhCti6G921crbw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82880,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTaxyCRA9TVsSAnZWagAAGDYP/jbg3HTLng+jFJ72uBiS\nhXkF+cK3aALVxg+w5oCxm76Ra7KtgZrqpmO/SudLHeQCBOYrWGT940pZ8SeU\nrotBddiLpYksw78bdSyxTWKonfPodbla0Td3PE4tCqjzJWT82ptX2Ps0lxQ8\nVpuiyaII+0827j0sis77WTdKgdAXUNNNghwj74ydQph1kAy0zZNE59zg5dHA\nobfz6DEdPCviu+aB7Qzd9dKNdiRhBo/L7d6J1KE1U1qIx3C2Vu67FUMZFTlr\nOeVQkLLGR8RMx3EzAwcLYU/Xm1lHmapw2x18QSpMDjzJblAcBg4PQvTekg26\nzJ85RgPqKPCcNeiBPCRpR2xSHd3C6Oz+p+B7+Jdw109L6qaBKGifLxXkqK2X\nijXgylVi4e5MJsQ0MZjPVf8vRZuYLneMCK8c3ogoal4in1bhKc8nbVyKS2Q3\nDwUc+NS7AytEu2S5ntftLG1kTGPlNbpw0AIDeSdpLBzzZMcBm47minhenaHw\npPZsG7SwL9pbmjju/pFnWme/Te8vIesGTNGSrfXrUCn9CGJAyZgfETPmGKeH\nfpL7MySSqdcWZF6iRdB40b0BdZFZ95XS12qM5sBayhLIPY9D2hUfgraa4UmJ\nVtrZUkR5tCb4RC1Sg++4pvRybKaakc8WJDS1YMUMsyyYW+x7LkKTdfvkn6Op\ngdNE\r\n=NCe+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"da46c65362f9cb229183f3d1e5cdcd8d25e90c63","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.57","@balena/jellyfish-environment":"^2.2.11","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","lint-staged":"^10.2.13","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.60_1598925938209_0.13398857258286934","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.60-renovate-non-major-1cfdf18e9a958cf05f55751d5c427771294fe859":{"name":"@balena/jellyfish-metrics","version":"0.0.60-renovate-non-major-1cfdf18e9a958cf05f55751d5c427771294fe859","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.60-renovate-non-major-1cfdf18e9a958cf05f55751d5c427771294fe859","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ad1f4ce9574264c9c42741bda032fd937292f5c9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.60-renovate-non-major-1cfdf18e9a958cf05f55751d5c427771294fe859.tgz","fileCount":19,"integrity":"sha512-Mu9AOQ0paHPN1/3WITQ++/OXcldDOpdFWkBfD4Rl4+HiFnKf2tZimMTvug/9/KdS1J/mCeIQcD/cN5DCVeMeFQ==","signatures":[{"sig":"MEUCIQDlu+cKkqy03sIs8kdkQ4lDFJRsaCusfQbUMJITQ6UQkQIgIFiRo1ulHTIu27ghqALBEIUQmuIr1j45c7+Vbjf23k4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82981,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTazvCRA9TVsSAnZWagAAxzQP/iIzTSHiP/x30urerTNq\nSqp/C9RcKq7Eipg6tnIWO6Y6yhcEY0U8Nmfyt98utChC5b9v1y499CH4Rzs3\nsOUx/9Bk56a3zz2NSgC5cnKK0btCgXISpL8AUpQ7pBYnRD6Ubq7zJh3liItn\nF54+LndR+7JUOEuG1fDhcNu2riH3dMow6UOeG5CUus23adC2Cqi2/ykOcClB\n8YOaN00GGYza+Cxwe2MdjJcPHNZFPKKMDLO0t6RYmvXpPhnSrplsj61hkDt6\ncNzvcTpXTgskKl7x4koayBQg5bQgVBXdypJX2xAxAO8qHIX6dVdRH2M0CXrf\n2jbPr4jh+iSW+VR8fW1zdnWR9tZUVppiWc3etC9l+OezexuPGDuI0EqQR2P4\nB98sh2sUC23jPuQRzrFRtzOQwSknOsSgo1ofXBKoUJK0DAUNaTNa+rHZ2OKz\nXnElUZFERnrkxq+dMDukMDDOMvch6MziB6y/IPbtJ/Yh4JSHG7EIn+0Pdjvk\nHNr9aXOqOaMTo6Xa1r309Rt1nLaj4x6wgJg9ZgU6qLGluPRu9eiRxu7aFpUk\nXtgjWgnpb3jdHaDNkq0S2DCxU2/1LZM42ODqraVhm4mHQoAgscF9dQn9e+q/\nRSUnLBZQYONUzvMrX9LEeXCPKjmevqiziUM+JHCzJMQIqjgNi5n+LS/ApH8o\nQY3K\r\n=cbpP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"1cfdf18e9a958cf05f55751d5c427771294fe859","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.58","@balena/jellyfish-environment":"^2.2.12","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","lint-staged":"^10.2.13","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.60-renovate-non-major-1cfdf18e9a958cf05f55751d5c427771294fe859_1598926062777_0.9772792579885441","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.61-renovate-non-major-c5698ef229d57e4fb49e5871afff63f2c098b87e":{"name":"@balena/jellyfish-metrics","version":"0.0.61-renovate-non-major-c5698ef229d57e4fb49e5871afff63f2c098b87e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.61-renovate-non-major-c5698ef229d57e4fb49e5871afff63f2c098b87e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a31d9a6c6a71e42111381c423520fdeba45c244f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.61-renovate-non-major-c5698ef229d57e4fb49e5871afff63f2c098b87e.tgz","fileCount":19,"integrity":"sha512-8dj2U7p4gSaBXHSOa6dOq4QrJymsO8iOVy8Kb68Utvelz0wG39YlnER2qdhGd9dOeWAhBcCt0LireFNYjsdteA==","signatures":[{"sig":"MEQCIEUy3M3RVyfNHutbbPDA5FirO03bUrvccYkGPCjDT/m3AiBx7odbxWN+OuKffc+CpYcXw1W4CjbTiDuG1rjVDtWhhQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83009,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTa3WCRA9TVsSAnZWagAAV2kP/1lLlD5BkUh/vE20tiR3\n56MAYoNfKI4OJMHufBSMINdKzjHs97512FrLIJkzdxrutQDX1Y76gQnGbCFb\nF8v+lroiwzjO/A38CFzg2sHMWM1fR0hDwSrsXzwksKIICo/izbg2udJanM2x\nDDLRULNljZjxbVm2Y5bt17BE2DZLovE9RPjtV2gKSne0HSKKF7axKQjnTjVs\nhKo4ITUmX2v5gYmHaiyr3aakH9xsR7EjQ9jXtNf9D/RN4PEZtME1cbuR9bfA\nD/ho4ivTU4kj0jCZorEV6tcCuNRYTiGPKFPmUowPc+9yesE27QQfCXUUIpWl\nGUaw7Si3AuCkC9nqvQUH0ufZwo+CARyb310UI29cS+phsZTM99FbDP3fNkis\nZ5/tNP5t5ngTFciP/CqWLjVUAIVAXEr1HjmUQFXpyw4AEa6HTolsNFyPyhsM\ns3Q0hAxjatRt1IUteuZjBkfBhJ6bjpCASHMWZpnptQ4V0CI8UVRcdUcjXFTj\na8QhUNBVuWb22cMnGADjqMLrczkw+AVqe+CRM15KCPBpl7Q/Ue11AJ2Pq50F\nouKxWnS1U3eSWGLY+lJA60tlqWgy+R064l31l1Oyl+2qv9GpYrGpkafHP8Vq\n67yJhSUAoLJD/oNALUz5n7v2FbjbdzwCSeR7mDnNmbg/Xb4VXiL85wBT89Lf\n1YFa\r\n=CBo+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"c5698ef229d57e4fb49e5871afff63f2c098b87e","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.58","@balena/jellyfish-environment":"^2.2.12","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","lint-staged":"^10.2.13","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.61-renovate-non-major-c5698ef229d57e4fb49e5871afff63f2c098b87e_1598926294339_0.4935152806120213","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.61":{"name":"@balena/jellyfish-metrics","version":"0.0.61","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.61","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5c937cd376cfd62d640f93fc63a28bdb2b4cb915","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.61.tgz","fileCount":19,"integrity":"sha512-u2Jlgj5HIMxB+2e397XaKjofgnSBlSIL7DyVV36yQWwyi3nTsj+gVjb3PvwbELaqpP8gh7ZqbzGrxIHrtK8l9w==","signatures":[{"sig":"MEYCIQC4TSaO5HJkZ8DHLXmrYIQghU//tfmUZfEQkQOuuTniGwIhAOIUDcqCtDfTrCpk6Y7EsRWjZOPXyMmOHPxHYF9F5xIU","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82949,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTa6XCRA9TVsSAnZWagAAKpsP/1mGk2hWIQNK5ULDD9aZ\nQ+c0v829OIqtW9h42UP1IGEg3u9hyi7/AZZ9KNIqMJdSZwopS44yRzPKjcMi\nokkIzZcSmclygPa1wt3IL2YKalZx0Iyv47O/8P0M/LlkPxNYm18hN8kMgrTz\nOHdlDQ/uSkqibpEKhUGvnluf05IoWyIG2qyYj1UBDQ6oo9VxXIKA1IaJ4jXg\nKHL3wR3mlgUFzsYHd3C7Qe9oNhoqdcgVu9i4lXXmqEsDxU7YJAwf+xo06hP4\nmYHqNKmoqGnhjw8Lk5pXSej4rJHTcdcRD6gqgalmN8ffNv7Ist+AP3lgkNZd\nyWO20q5Gw6cfcYOmZX9YWPKgF1M8nRal3Nzubex0Xg/Pp05uiGzZqLHHp+Y1\neZMvIqsmGPtB+7j0y8lv5tmVaYiJ/Q5P5+mGAQ4H399Ci3fZJUmrXIs28iJe\nXvACC0J00aok5WcgV02lF29BH2BlU/qi96FOmufTqxMG64KLITQh5HQKYVkB\n8m5bEZvyVcqod6rnpfaEwTo6MLoFcvfeRz7M96a48qOYUSHPItV4N0hr5q5i\nrNO8o8rWci8YOWgw6YakH+q3aBfIpxkZMX1IqXpv54a4jxOH8YesTaivGX41\n75tBxbespR5YB/KZJqcYqXGOA+2lcRhU3E1kxPiEuix4TKVcRvXcARorl5jV\nEFcl\r\n=8AaP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"e8433703e2a1f97e76c12bbf0f1e30e1ba4458a7","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.58","@balena/jellyfish-environment":"^2.2.12","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","lint-staged":"^10.2.13","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.61_1598926487060_0.5856324459258284","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.62-update-license-check-217ea3cd437d9d3441572225b5181df0652c87f0":{"name":"@balena/jellyfish-metrics","version":"0.0.62-update-license-check-217ea3cd437d9d3441572225b5181df0652c87f0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.62-update-license-check-217ea3cd437d9d3441572225b5181df0652c87f0","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"21830da01b9c193347279223ed13734e22fa381a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.62-update-license-check-217ea3cd437d9d3441572225b5181df0652c87f0.tgz","fileCount":19,"integrity":"sha512-6OV4ElwkOrZN1OgMH0BeOqEdrTF/uzE3ElAvhAuJdeWW49BBwG1OF+m0KH3Lfe8lrVsaVLgMYWMGfBnf0hPRYQ==","signatures":[{"sig":"MEUCIQDoEwRGgRBnDf3X70pgxfXOvY3rhBrwEljO/ff15QsKOAIgcx7n68XDZ/jNmACB2LSxuoSSgt3FxWokgkGYAa9imjU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83110,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTbiZCRA9TVsSAnZWagAAYokP/16Sx/mBV0eOJYtIIMmn\nFgCDvljKQ38IcZJDVlqaLaLZorFQO5qyYXy2j5+IG0Qd+VvKulPjmfVuoOT2\n/eZ24jOtqF0Rkpq1dMbUMrNMfdE/ltM6bkaC98aybZQgkgRo7CNCZRD6+CNQ\nMg5a8RyEee6dFOPfBYbuvzuU66YDAJzqg+szD0R2Fay63K2FLWV7QqB2Rgwm\nOCrEwG2lKBkxIvwBqJ8a2MI9JOpEHN74SkL7mtror2O6yBj2A+SkXj6yEBse\nffRF3rqkMAK55Vwbx3pcdClF7mS5HZ/zgfxkja+mVpcM627N2f2eIaz6HMbS\nqqheDpsehJTNcfyMdXmS3ruvdDk+mnDzOc84jSki7f1WUKxArbFzcDWNJELS\nqac2/HjUFXC/qGVv4ACcL56b8lS20NVKVN/Y04LCC8Ni1kpOP0BKx+Ll7Qkq\nJWZZgN0zhj7aK3ANwM2tV/VyBcIZdwVAMddFmOX5rN6Am6OR8paMBlDq+Tch\n64UmAHmJ8JIESly4PMWPsA4U7lnFDVMFS14Ul9gcayod2+5LK3MfYQpiqFle\nmeCHlzN2wX3JDFmHbLSKcoPg/Ss/XhqvbVqzl5XmZXiOk4a8lBCHTOxMReQD\nMpABONRuu5e7aGMw0cX8uGTd5QGYQ+8l1h3bGor/8+gXQ5JksIJ0BTHTT8gL\njHH6\r\n=ZS3Y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"217ea3cd437d9d3441572225b5181df0652c87f0","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.58","@balena/jellyfish-environment":"^2.2.12","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","lint-staged":"^10.2.13","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.62-update-license-check-217ea3cd437d9d3441572225b5181df0652c87f0_1598929048980_0.9593049448766104","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.62":{"name":"@balena/jellyfish-metrics","version":"0.0.62","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.62","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"93f85f3f100504911c1166ba39734bb290057c7a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.62.tgz","fileCount":19,"integrity":"sha512-ZLS+lzqPNI2Ptp9cjvxtdp/WP8bOWXsvSh1tvtIL7pNKn43iXQVFYtyfhrH7e8ija81R0zsDQ4p5k7fthHjxcQ==","signatures":[{"sig":"MEQCICZvc3ue/L/iMTGQXjBOEWluDcBYSwXaxiUgHicX1Fk3AiAxxSaAdb9sjGMcPbP94AYktBwgWubzSOZrR1AccbrQoA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83048,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTbyyCRA9TVsSAnZWagAAmX4QAJZ6J+UBjk3BXnGCHv/e\nPIZYczUFHO6HRjjYKw6jab3uEaI58A65xBgs0lCIc0NuPv0NrEHzzz04+u1Q\nG4VaDvQONSh3jRGq5sWE278UFMD59R8T/wC/8h0YnHOTcLmIwVNmi+pFr6VZ\nKyZNb7yHTF3ZFtlvdVZz0GNcr5AgkJjbM8kbX55YV9uKVVt7+uwuXdo/s2h7\nlsOV2B4Sl14jXFupwj5t30kSKo+BBbtn2drnO5Sl1qkv4cnQaSL1GdPadKQX\nT6QvaqmPdHWkHGK/Y4T82o5br9BfsZ0k/cmeWYhiagmaROPzCvmtOWDBMrHE\noHZH37uc4zs7k9doUzK/wndV5ApgOgHqDUCrCB8/FXJUtVCUEyh5od5nLL5z\nv5HyvXzHZKAkOcmnbD/XCmwJBIFSGaRElmlSEe2yBHDp5A4WFQ0o+DUDPSI8\nPfOhzb2hkJXl902LLRMSSZqEvLYSV4UwGNDfnql8IjfyfJVnBJfUYYm7sFgI\ni24GW+35A5x3G+iOPb95FExRakDyykK9GekNTDUUXKKvXng0JXNDiT8PWVEB\nUXg5ORGK7r6SQZU83UqIuYrdevx5gUztBKps9MIZYqGHVsP9KYBaXduZVfSa\nRjRPRi4G2BPWUO+Ry3DITmxm+YCeAQJaJIqrAqgTJT2ObS/zi8xFgOENLYsF\nEYHL\r\n=MD3C\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"9d0e2f5673a510904acc32bf30a5863fe7ea6965","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.58","@balena/jellyfish-environment":"^2.2.12","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","lint-staged":"^10.2.13","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.62_1598930097681_0.7102859102872141","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.63-renovate-non-major-3c94a7f4f375cedd601afa324225c73fe2f97d29":{"name":"@balena/jellyfish-metrics","version":"0.0.63-renovate-non-major-3c94a7f4f375cedd601afa324225c73fe2f97d29","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.63-renovate-non-major-3c94a7f4f375cedd601afa324225c73fe2f97d29","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"76c35b6b50a8856f1e439a1bddafee054f1346e1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.63-renovate-non-major-3c94a7f4f375cedd601afa324225c73fe2f97d29.tgz","fileCount":19,"integrity":"sha512-qaEjnlInjE6K1A6/ipkhgJRvJL3NJtqbOa/AjPO0QYy9osafOw95bd5tIiEo54uYVzKHXOyAjQbh3fSXsgwKGA==","signatures":[{"sig":"MEUCIAavSlvYN76TT42+fRsUVvEP7LZDR/24+G6/cPDH5p5iAiEAvaz43xBZ4dkyq1RHocmBjBXq6dXXvznOBrp9fkFHeO8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83214,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTcGLCRA9TVsSAnZWagAAipYQAJpmfAbZrRlEZ+tCt/8H\nx3pgvrw7nyGtDAjoKwl6ohAmA2SiP0i0tNOS36BMi3In67AXI7gS/Z0FXBp1\nfTERBNK2iP/ypuEBLMZZsBslYFUkj0cZzlziLz2f+MMMyXZjO8sqJsPSJKno\nOho1LK15v9M4XVGicGPTS/qbnI4T4mHJ01PqfP+u/n/QRVC4knFTH+Z/b4Yc\n9D5MP0ET0ybk0F4DWKhcUiLs6rPPVUxYsBq/VsiyFUGJTCHaW7Kq7fovzdU3\nD0DPn8UVfE8ADQs3rOhrHb1+CfEKST47qrmgFmJdf7Nv4kheKxur0DBfUihn\nNpc+zLzCdLM6TiX7JXoLhjekIR9dFwXeAaDkGu3SZfUW4NVcOXnK1MBiF8iD\nj54gyCnH6VVBe3xCMBXAo0ve+3n7YB3aS4oI/2+ZlsGgUxys8RWknaen/d0T\n1uTFyFcQJOkANDJbAPhBSNuyjQVT3nlljn5Zqo/2iS+LGOLaJMPOv9aAoTbX\nxLt1h5wPLsiAlipETMgZFiMMq5rRdkOUQ+jQIdfY9x2XH9EWT1uKx6o9YysE\nJo7qK2WjtM0AlcasuBhNAK4W2YqZ2FB6kJMV21mHMzaD5dw+EXgcNeF4SYfv\nie+Q3WQdrOzkcZfXPqjTYLGDdCK5Qp6gb9FhIlbZOxLMNSZt0UadETTvJ8JD\nI4rE\r\n=BLpF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"3c94a7f4f375cedd601afa324225c73fe2f97d29","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.60","@balena/jellyfish-environment":"^2.2.12","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","lint-staged":"^10.2.13","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.63-renovate-non-major-3c94a7f4f375cedd601afa324225c73fe2f97d29_1598931338738_0.05736696358377902","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.63-renovate-non-major-65aa67c35995c3acd0f33771064e485d763363f4":{"name":"@balena/jellyfish-metrics","version":"0.0.63-renovate-non-major-65aa67c35995c3acd0f33771064e485d763363f4","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.63-renovate-non-major-65aa67c35995c3acd0f33771064e485d763363f4","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"097a9eca341c49d99b01b1745de127b4da590a9f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.63-renovate-non-major-65aa67c35995c3acd0f33771064e485d763363f4.tgz","fileCount":19,"integrity":"sha512-AJJTxWhkGl5/oKXyk9dp9InqVrEVTJK1s1E/WEa06iKwaWR7Ls/LWPy9TK3XKOWnj6DRDcgMYCIpZwjneNBXLg==","signatures":[{"sig":"MEYCIQCe39PdbN2PBNO+K2+djA6lgOpNxfm0ObKkAQWdH93M5AIhAJc4sLwlatLPkK/OTHdQmzNY00uzS5ENvqZl+h7yOFBb","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83177,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTc5eCRA9TVsSAnZWagAA+HkQAJMssErAbLVrs1woOLKR\ndyo518YvYsmxcWcvnOotnvELaUCip1sWjOtttci1GsmhTCPDMg0/sUOE1I5W\ndx4Lzj6I/uZvEn6RW9Txw/MLGzp4j+jJFBAKgraH/Cp2JQZQnydYa2/gdXG0\naz2g4uYUt1hiPEikhwlR9dJ73V+7yYj9XmJKiXHCpj+eU8qfZO2aZQ1iekil\n5zBMWDfIsflcK5yX0r+gmrHJZM4AvfjGHhZ76IDUO+pqpO+O9RjtRQPdVwo9\n5zHBYXSXkJt41EjBRg6A9ecwl5N0tPK2fXp2Yo8jCygA5uj9v3tCdPScR6KB\nRyxkSlnJ/pY4HXBJc+fKpYCOh4A1vMTCnM8uzqe9HNwsPMqQLdGTHRXqIR3b\nSyrVwtLzLlp3W6NfdOgKVgU4vwcvoGG9nDdEKDmFFT52wusE+PGoOKDXPtwd\nQyr3+NjaNX25vZyMaj7tjWZMOLHhR8zqc6Q4WQxUJ1UWpEqgBClDsSyrZwpm\nVkfK3B+LevmeY2FE4RfEpJu8s+LGOusXPxt5DYexAeGVtmK8fKq/HITVcOst\nx9v9gyeI0Z08NE3RPImAKn13DOKD1eb/u05EEOE23+uH3dVBH1MlFERPkb+i\njCW8sBeuAdZPJl9ALR6LSlmOBZ80dBC9CveOpDFS2pP9Ey53IMLIjwJzQkfy\nfmNl\r\n=I4SA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"65aa67c35995c3acd0f33771064e485d763363f4","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.61","@balena/jellyfish-environment":"^2.2.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.0","deplint":"^1.1.2","depcheck":"^1.2.0","shellcheck":"^0.4.4","lint-staged":"^10.2.13","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.63-renovate-non-major-65aa67c35995c3acd0f33771064e485d763363f4_1598934621761_0.13379745801816467","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.63-add-jellycheck-2278f9ac22f3c6e5af8a94ce73dd3d277d546d68":{"name":"@balena/jellyfish-metrics","version":"0.0.63-add-jellycheck-2278f9ac22f3c6e5af8a94ce73dd3d277d546d68","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.63-add-jellycheck-2278f9ac22f3c6e5af8a94ce73dd3d277d546d68","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"049b71d81f2204d2f14c534f018386b9354682c0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.63-add-jellycheck-2278f9ac22f3c6e5af8a94ce73dd3d277d546d68.tgz","fileCount":16,"integrity":"sha512-97QNPRr73LwcVtIjJA00XwKJ5wSjyCRfk/zBU8W+GHi34DQr2USzsD4CFYL5QjapybNIPtPHD8vu175VyJ2+vw==","signatures":[{"sig":"MEYCIQCKdaBw82JbfOaN1nwOX9fYCMQDcGZMxiI3p9yLC2AZygIhAOfiIs1klg0gLrbeI1HT4eF16YFGkr2UPt1r7bowg9k3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":79907,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTfN5CRA9TVsSAnZWagAAFswQAKBAEAIiwDTrb4lAkpKm\nYbRl6EhFOIuO7kr1qPOqajhPPfKpK3ChyTBkust+iNEbXdIG8FY3FXsI/V0X\nfEzeiDi5cY/7px40/3NDVunUX6H0XKveatxRbnV6pSESBixIISz58nKO1NOn\nKVw+5terKL8w0q8A86P4SwqkBuQE2WehcLINBdf1JXlsFsj75TJkk+p8c1zI\n8AZiD4+u8lb8nKo6WZdyWegropBvawk3yK3+tbLgaHHd8RaT+8pA7DBiXqpW\nANOlE7U0rOMqaDOGZ3NIKW2vohgnEgLeajc4a2rQsYWlm2otRTbo1ahxh/On\nDyrF583RAfh5XddjDXGlvogB7ox+e0NLSmZpzzOsh85nSntiPz+jTkpbAEkE\neC5r8Vo1LCHd2hZ5nkOMTA6OnqoF6OilUhNCcSu3XZEbdgPPYYvo0YVgiFvy\nDHmtbR06HoVgNRTingxu6q1Lemu9qEQ3jBgohOKNNvJmpTMEyf895YFIpJeT\n/Yj27TC/P6BM2Fh7OQisIsNpcGaQdW0Ly0JkRHvaM1hrgS/Q/V9z7KvWpRso\n/fzxarncW/Di53Evjot5Oud4Zgz2ZXVHFpze1eL/lyswRUEBfVz8VAAsZJ9O\n/GaPm1V2EO+ZzgUSnebCOpqn71O+4QFCoLeQHW1CvTaUlrnt5SgXGmegi3xF\nde9G\r\n=E8v7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"2278f9ac22f3c6e5af8a94ce73dd3d277d546d68","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.61","@balena/jellyfish-environment":"^2.2.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.2.13","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.5","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.63-add-jellycheck-2278f9ac22f3c6e5af8a94ce73dd3d277d546d68_1598944120692_0.4281244923772789","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.63":{"name":"@balena/jellyfish-metrics","version":"0.0.63","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.63","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3b6be91472070e03c74f038087da45648c19e629","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.63.tgz","fileCount":16,"integrity":"sha512-5MzKFFcFkJEuz/UnbJ8noEm9G8lx9GFQzIqlBy9RzgV+7uVJ/7MroEb+OQmb4lxPmMrUatI5WY6ZLby1BSyiXA==","signatures":[{"sig":"MEUCIAcrJdVb4/x0pUXJS7zIV+Yd3/eAsKqHmG6bKbwyLPIJAiEA8szvp+pB3CLaIPEjvdMZZwSw5WDtjC3w5owM6f9wO3o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":79851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTfRYCRA9TVsSAnZWagAAa4IP/0E5VbNerzTM9cfzEVVg\na9QVRlShRldwnguCuGqkogSL53cr8tF0k/A0i6qB4kIwTp5faelyXyrX12XK\nkM6zXJATNdmtbHyqco7l1RkjgWmzme2EmAAU4BbUWr0voKW+2UlggthZLPdL\nnECSAfDPMztZaFIYjeHF/2WgJcbjywMHz7FzQ6BGHKhirOGLK9eBp4wJHR/O\nsJPg6KY1aBu0VUXqG7S0CUk0io5W9lpxQBUoVHkDmhGH2uiUoBtS4Q+GW5lo\nkPZl33MRP+iwIv2Y/WX5WEXiCYDmTGG7mvrqSZwVeX2D5u2cQzQfQk0xLrH4\nBDqE0R2YHqPqstG8Y3XNtZ1K8y6utiFOS2SjzM2iENW+SI6PGA6KGGCgovG9\nod7QCilAsl3aa/vm1ks38VoCryXzowW8nFoChEU5Di6wZVvxl+7Le+RoZG7r\nR56HEUp2Y+5tjT655VNUcd7sbGfzd+aJgu7NMHvA0F8yE0l4mATFTLwRtSuZ\n9t3/tYZ485tnze5ug6z3nC650kj7DlOx86dCMGvc2O8ppyCFfolJwCr4aeVk\nOzFNhcKVPeHrsyKhkfNjra9m/ThOga9euF9Rhb721GO/AuQf9emoexJUPFV6\ngVDgnSCCNvQTFmFSFszGQq2xdKIh6xxCD46Zd/FPWsU4iPt8wiEBi0KIUkwR\nDDDo\r\n=nyW/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"6aae215b478553876fcb343f6cd7502683edb062","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.61","@balena/jellyfish-environment":"^2.2.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.2.13","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.5","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.63_1598944344212_0.08254258710856521","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.64-renovate-non-major-8fc936d2f0083dd498ed9ca7b2d494ca2987faf0":{"name":"@balena/jellyfish-metrics","version":"0.0.64-renovate-non-major-8fc936d2f0083dd498ed9ca7b2d494ca2987faf0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.64-renovate-non-major-8fc936d2f0083dd498ed9ca7b2d494ca2987faf0","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"82f02f3c835ef7217419cf2292cc737cb4f78cc0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.64-renovate-non-major-8fc936d2f0083dd498ed9ca7b2d494ca2987faf0.tgz","fileCount":16,"integrity":"sha512-PYdJ217kko1QXBoFyRB6Qr3uF8CevH+jgmYwqFBdIp2K6nFmQ7fLgAo94FRCObf9kvAVz1hVBmvrMYOpnSxEuA==","signatures":[{"sig":"MEQCIGIrcFA2w0GH/7N7/rTWOxgguUBVQaBVeJlZA8FVXG7FAiBfZhDfAVlvB3P5qvQ1532IkyaiU/KByG4jXKb18gBEJg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":79980,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTfVgCRA9TVsSAnZWagAAJB8QAIBV+pHT/knwuY+esiEt\nxN4qSKYX0EZ9dBmafRS7c0SaeZaG3ndGRZoq5lDLXlxzyuztW3Fi+5cFi55P\nuXokZZGKzvRPSK5f7uKkmginYvA+2M24cKuFglclAlEjlWcPc5YY8a+cpypo\nDjGJ3Q7MhL6BhanlcFeWq6XjESq0hlcZR+UswCH5CvNyYCOkYAdXctBTf4S/\nuDZqQwuotYlrdR7w09b+AZN+K37imYT7BSoM+ZtzXJpaAxtL0+Kb9RGNBvsp\n7Dk0Om1+Ks2VRjJJGlbaebMRjLn1a6SGQI9+TwW147TNAINObLZtYdOliAOv\njEVsRIANPdtgiQRub6lCFb220f7/u0+R5b28cP4B3WGX2qG224N2H/cObCo1\nWqIWN6Q9uA5csr+XGPWdVWD5pebmjLEJ277nLtCwMUeeyCQhjOmuDVNIHMii\nBvuWt2fjblWUDBpHR2UumYbH/BoVrACzkLQquNylFg9UAKvcrkwv7Fclfu5Z\n5njsxO2rhQK2pOIrccTDlorwYJDOuZ9TGQyty1qIDIqjQLkz7JK7xC2UTs3/\nkbJHPWnZ7JWK8ZXyNsMdAuN9dW94xC/5B1vFLKY9B53hU0fSQOc7Si/33z4Z\ndJ3Tu3p5e2nf9TrUoHMg+eDi3/4aFP00r4IJBz3mdVVTyrk2uzlEhywLfANJ\nftej\r\n=zc8O\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"8fc936d2f0083dd498ed9ca7b2d494ca2987faf0","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.62","@balena/jellyfish-environment":"^2.2.14","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.2.13","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.5","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.64-renovate-non-major-8fc936d2f0083dd498ed9ca7b2d494ca2987faf0_1598944607666_0.31819710712445404","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.64":{"name":"@balena/jellyfish-metrics","version":"0.0.64","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.64","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"644bbb69c6ea78226f37644ad50e6a603ec77a3a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.64.tgz","fileCount":16,"integrity":"sha512-FvrdXwpioRmWwxZ8pDO9RHiiUJxJx/RVWMZ0rwNAljHuCi8Tv5XbgIqJ6CY/1RCNFuVAAbcymyRRjjcXDHxlwQ==","signatures":[{"sig":"MEQCIDRZkDbA7Zt/A7kJQAbEQPYm9Ul5lzt0rvsexIlUnhKgAiAWpIjEPa7yR/5pLH6xZhJ8VjkrJnrQNAgPYE4z92Eq2Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":79920,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTfZXCRA9TVsSAnZWagAANX8P/3hq1fQUlq2O7O7EQJBr\nyqhB6icbg2C6Lu8A4+i9Bw1tDikbGvyIzWAAG+d8tFxnlojVKplWWClkq6sX\n0wHTWsrBzepgkTMy7wQp+BmaZIjIOZN7GJrEr5GkRMX2qmGFAH4TVpRsqgRq\nTfwk+tAJVtZpPJoFjB+EYjtU/wxKZqeRfUweBfyqTrP+SGJkWoWYNKa9QRcM\nbP2Jdag5oqt4j6j+GX1eMbvBGh8h9WdZIDtZfbM6uXTTgSxlVy8b8QTZeWBu\nvozj0XPFuOtaq1LDmlohCCPoWxAfTwq4Q4o41HvND2LaM0xz/yqf1y+Rx2HU\n1Lxx+6+VEUsxb/gI84h9ssPOBYgV+DrMVqA06h27ozyUdXl4vgF577n7TLuO\n3oEzEKAql9uZoLWGwsYcVfa8lQt0B8dJ4VAX/wWmljS9F6PaIbilKlb3lczx\nvKmc3BZ2L6C145sEeGH+58XnEITnqequmKPMM/Xoalgc1cdpuWXxzWVpzgSV\nFCYmWOs1XcbSIURtjd33h0tGwv/JAUgHNVSXWTbeNFUISlgdXLIaD9UQEAz5\nGeyEE1YVdXLKtBO98Xolgutu9I2j1aLZDC0VE7bDU92iywp1O7vagLUjbg54\nXOIfGF9/wDi6Ecq4nTzxthDzLRnOsWgIZ1zsGWW4vBBUI0Cq3UdfKnlaGkm9\nAArG\r\n=2TtX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"5312f90e7baa6a7bee17f7f79f1fa70833da2b85","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.62","@balena/jellyfish-environment":"^2.2.14","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.2.13","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.5","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.64_1598944855116_0.9271478083850286","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.65-renovate-non-major-52c3c52e4ba76660897bf83f19140271e97386aa":{"name":"@balena/jellyfish-metrics","version":"0.0.65-renovate-non-major-52c3c52e4ba76660897bf83f19140271e97386aa","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.65-renovate-non-major-52c3c52e4ba76660897bf83f19140271e97386aa","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9b025a62161cd839c4dd2a9aa844a1ddfc8474ab","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.65-renovate-non-major-52c3c52e4ba76660897bf83f19140271e97386aa.tgz","fileCount":16,"integrity":"sha512-yYwmEwpr8XqlupMp+Hh8kup0L9n3r4HtQ1gG2kQ8ieN5xahnLpNmqvm//f7fdwXPoEnDHeIv3HM+yM9bDKcrQw==","signatures":[{"sig":"MEUCIEhErKhIL/qkGWu1nYnatesiLAQFcVOJfjQOosx3tIs0AiEA3y5aLp5unSJtI156MdzSuvYr2U0zp02NxJBak4TFKng=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80049,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTlfkCRA9TVsSAnZWagAAf0YP/Alrg+JsdhqjwBhuQb1q\nbSfIetegDlmSPgWYNK0jZk0ucpMaoCJMOB7gQSZ+Q8AVKywCnr0gdfoRm0ZA\nFCyGs6gPeEBpjFaGf4D8XPmRO8WvNaQv3K09NKpuIiFX8HLYdGaLbZRMdd7a\nSzFzP0vwrxBTMkMRYtBPvppiTlQbc2Fjbh2quIoPC61uO/Db5uGvgKrCrsgJ\nCUYDhFyzrW5YKdT2GaBObMl9XKmzU6c+Smb6vulzoQkysy0NHRB4JrbdPhkj\nJ2PpseVq5qEjYnrUi9yPAlkS+RWFxr1yB5ulZsp8RH/0Ie4kMZW3rR7PXv8+\nb7sAlN2/jfkRQfZ/wGaXlfabGFhVssz9bVlNAnegxkrX8GkYmKJskg+7kxLP\nKlcY1nuDH1Xi3XNDVfuIKXcHNVsbjJzqUU406K+Kv6a1eLtJFKORbDz1LDug\nZ3usn4x2ZfZhiSkzSWO/Eas2eS3F1rn2qZTXhNmoxbdvE0nPn/MC2RxTwLqG\n6v+Bv/0nQns7yTBtTSmJCJA3vlUJFXfoGEzqKR1CUgiAuePhJFtc0dHHjIuB\nbm69w9ZR5fkQELt8Cp3ccec42ulw5vR5uvbO3AmHzG6cH39ujm3PtWcQioo0\nx+vykcC6nuc+wpZwncyokYYJyKPOyb/OTXf/f0piFDAh3uUmMoAiCrsHNjX3\nqaYA\r\n=IaRH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"52c3c52e4ba76660897bf83f19140271e97386aa","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.64","@balena/jellyfish-environment":"^2.2.15","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.2.13","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.65-renovate-non-major-52c3c52e4ba76660897bf83f19140271e97386aa_1598969828170_0.11436001947641694","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.65":{"name":"@balena/jellyfish-metrics","version":"0.0.65","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.65","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ace75a7df8acb0deb02f5dd459ce24449da07eb1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.65.tgz","fileCount":16,"integrity":"sha512-iQYvzkSD8L5byg0InOnlLlCePexkFK7Kt9mSFt2p2HiX+WkP9Ql0ko+2fHmv7SK6S+BmPph1a5LrYvpTORlvGw==","signatures":[{"sig":"MEUCIQDnbveIS+WufxhS4mqICmJSvhu75qRO3xYGoPY2d5o57QIgZbHr/G5OIRYBjiZmsPdVR6d3z2XN6GkxuVe/QP+ZmIs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":79989,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTlidCRA9TVsSAnZWagAA2tIP/iEC+d+dQeMCvDhlehdS\nNeLyT4QNK5f0r6+ehcyO71j7IDV+isSljMIflp1p30BaJbYaSfkTyD7UjQw6\n33gK0it3rJ4FShBXwODCpBnthb5A8eHdGXr/jbFQ2QnIfM4BDZgyjfQw9gxI\nQ4Yn48/7eQKAPjTgG09h9UY8qewplCN/zjGZmG89GRpKOPzuqZ7pu3LRi8OI\nX9PPfG4agxLFdaHnQV4zR/1FGMjWurL/BuwcJkpAUolfZBkfaqt9qBwNQAQ8\nqjngO/u9sV/0LA5Je9IjddInUDJ6NxUamTrNQiJ8o6EvQIss5+h+w8C+TOGC\nr890tQfODNiKoSSRcW7/Cnm13X+gE3uvK+0EREEMr0YQ+JdsUV2kIEfccPFg\ndR/Fm8PLkvBzua0JjSxi0YKHDiSH3OhZOEIAG9PKgRgqsNbQIJRjfdvPgCdn\nYQLZj4mlQvflg3JsDVOOqNC3DPaYsHE1sp301tNP2SubED0jJxDlQISOZUXW\n/Y6/Ubu+a5jgrgWNVLbKAF7k/TmoODeN7HJVWEAKW9hscJjQ6nUrLpd2sNyG\n+hxoPj6a5qpY/1Mj+CipeiOlg7z6khPCO0Xz1tIRatnPGKce5m4ZGudEoff5\nPB8qgw4LT0Xg3lwn20TqJpQILw/WSfLtuIoSMaXLpVuocJ+VUcLhJzuYAI7v\nVeuG\r\n=hPkX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"a431dcf20b48d9a4527b3b94d7155688d6568fd6","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.64","@balena/jellyfish-environment":"^2.2.15","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.2.13","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.65_1598970010108_0.4342490597152444","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.66-renovate-non-major-3430e1f72e2d8acb4a7f56b51fbea03e3943d644":{"name":"@balena/jellyfish-metrics","version":"0.0.66-renovate-non-major-3430e1f72e2d8acb4a7f56b51fbea03e3943d644","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.66-renovate-non-major-3430e1f72e2d8acb4a7f56b51fbea03e3943d644","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1d5f53c5bf5e41b714c3203724a3d9b6126fe357","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.66-renovate-non-major-3430e1f72e2d8acb4a7f56b51fbea03e3943d644.tgz","fileCount":16,"integrity":"sha512-Euw/yF3YZlFo/AzJzzw839RVFZuO7tmzqlukx0Sejs70EPwgHPnmWDDWD9EX5ZRzvDqSrek9CKo8M3n23r7Kkw==","signatures":[{"sig":"MEUCICZj78bKf5d3hntHDJYkQ0iUFPW1W5qeahwGi8novWpBAiEAyyy/m5N6NWSGoUXk91RNzOu+HpCAxDAXTSRMv04cENw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80136,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTq+gCRA9TVsSAnZWagAAI/4P/1+pxAnw7Yewpm9MoFS7\n5jvwasa4z0wc4bDLQQktDI5Ajv/B8GnT8GxhZIAJoq6vnD/h1lSdxNGp3Baq\nt43jKqFkWlXbuNqpzg2kapVkjYhtDQ/b27TRpDp6mJMnL7++nrE+PTpCvRLm\n+2lfdkGyjHj2tLKmIxGSvIDKqjkO7E/qGnJCMeWh713w7q7yg1etGs8T6Cdm\nHE94PMLnTU/vEnXPNZIfomKg6orAZdX61p10MiJfAIjDTVzsAxCdUBq40xJj\npR2NrWNefmsW9KhVm6jnP6OUp6CETrcM9H15WVbYbezsFu29Z1GsNs/0w+br\n/HPGrwhc0jI4443qho9tSdeRrJryyvnpJIE/mbxkHfJ1taW9HvQqUCCmsY6K\nXTYF1Im13lk26kUxITKjeZsk9xug5AxqySI2P8xbVNpd4i+AQPuwOChFOF82\nog+PKvHlY5mBPueItPCsgEIRyDYo8uzHkY+AhkDCTvM902b97+MaMHnjxyu/\nuE5KzYhxbE8gyBYmqCzaBbqXyjXgOLaiMiRePXlBt+UXCN+dRhN05qKqudII\nVyyl1yFKL4sjSwebPu7NSeW5pk4cwA28g56r4dMFtsVHFxO7aZiTmQu2fgVf\nBkUR/iugnKgDZEGrF8hvqdcahDOD4byR6LMqeq14cSaFcjE3tVBdKInPHDxo\nlzud\r\n=c02a\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"3430e1f72e2d8acb4a7f56b51fbea03e3943d644","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.64","@balena/jellyfish-environment":"^2.2.15","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.2.13","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.66-renovate-non-major-3430e1f72e2d8acb4a7f56b51fbea03e3943d644_1598992287922_0.5890386210998355","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.66":{"name":"@balena/jellyfish-metrics","version":"0.0.66","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.66","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d6e8d92143221854970b525904201d7afae706cd","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.66.tgz","fileCount":16,"integrity":"sha512-OEMtWdV+eUt2kn7wWc68stGpEh622dcw934OS/sOujwVhaWWAFcMH4t6bX4iYX3rYE8kyb2t8TS3wrAIzbe0WQ==","signatures":[{"sig":"MEUCIQCMXM9vUXrcwv7uxj7dGdW/XNgImTLxlm2lB0rqQc/2kQIgcXnK1TYRDpUmUUl20zzqjwUEizxxlE3vKgrVz43khwM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80076,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTrBTCRA9TVsSAnZWagAAOgwP+gMVA7lcS7+lXetKTYCC\nwvd8dDDDRbZHoRFIU9WgOVF08URVz/1BWS+U/hsu3FVsKbEBfsqdgs6k5JfM\nX9B6HTC1iXQS8sl1JkmgdjGcpuj7aO0gqAtPHpFoQQPflBrUetxHcWR+nnlq\nRoVIUeTZEPdowBD24NI5tOVlTWcGsiLQ4fctvyOOFiPlDgcR3WJthJxQkgwT\nr3SYB0mqYzjT4sqjXg3lQzgAq5IrXSKVwHuGdjP2U9k4OfuaY13hizQajgBy\n1WlkNMWOv9BTelAKwsMOvwxMYWIpG0p/cTVSCJNt+TEv7Ixv9DNA2LYeetZL\ncJZBgoJVcSfm31HV7AlghZW8EzuFB46YPUEeKdqSbgX6djcgGrBxmxUPyqao\n7bq0aYKajjSgFDapcDjmq3leV5lIlwVN/y4by2Jz1ztlqCNPmRDQvfagm+eh\n3cxjXY4dQ2c1mn0aApwqjGKzVpsqTczu/vf+1IF7KvMOezkGdHroe0QhLTVh\n3erDC8CTs74INkZ7kqTjo6ewgp1chwspW3cAd3XQlSj9cRbPZU/OP0Cz2vlx\nbceyofg5I7i0AvAnFjtVmBLGS8DzG4R5nKnWTeDWJWk9XK7EKFg0StYeoHHj\nqEGW8RLyHVxSCPP5Fhp5+BZvBTctUKTdRh1hzQBuuJus5sNtaHCMNrJDOTB6\n0mRQ\r\n=iXV/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"38371ea9ca41cf1869998c58c1c7095fd03c1708","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.64","@balena/jellyfish-environment":"^2.2.15","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.2.13","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.66_1598992466538_0.724683703689055","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.67-renovate-non-major-bf43e244f5feef0950e9bc8165fc4c1faa923dba":{"name":"@balena/jellyfish-metrics","version":"0.0.67-renovate-non-major-bf43e244f5feef0950e9bc8165fc4c1faa923dba","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.67-renovate-non-major-bf43e244f5feef0950e9bc8165fc4c1faa923dba","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"82ce2b0833b1aa5a3d2801e492f4b8e99b9c0972","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.67-renovate-non-major-bf43e244f5feef0950e9bc8165fc4c1faa923dba.tgz","fileCount":16,"integrity":"sha512-Od7SQ5oCYVWrIXZh1LXHb1h3i8NPNs749fFq2coptkqZUYsr4duNbAM/C0tsXcjyGDbwLysbz4mDNHjkmzDS6Q==","signatures":[{"sig":"MEUCIQCpgE0JesvFZjo3skjhq+J1kZ+nMVWeKEN7htjYqpWDVQIgOaieXxk8w9pYjDljPdu9+jzBC1TMffvCwFZRSAdKYN0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80205,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTttKCRA9TVsSAnZWagAA0kkP/00uajvWuvL50fqJwSIi\nQ+hFXSb4zkCOlW7KrbVy2WTbpTuh2g+qrJQuM64AVj4BEF4mXuf8u5kj3bKM\nP0SAsf5Fd+K5GyYxCRbO6rijMBysRAGsVKWC0RrtdpBC27YyyHxBZgpZ0WnW\nTeEwOXKvg+Yk/+enQbKIlGKaB4KLIWViKcUrwPXcwL3egkGO9s7d75wy3IWZ\n1rvMqpCVr4MnDg2E8seivtKsUvs7i1A3AiAUAgznURcI/RzBhtshJCDGQjLV\nux/21RpHbqEAOzoix3h/xZNXonIRwSxAY3gkuQslZzKJJnJ0xb0BMw+hqAep\ndMTdTpntU5KgHvK1YoyYIDqepROUSJ82iC/vHQnK4Vc54YdpYt1ADBhMGMof\n8NLMr1/gzfJiZ/WdZQTx80Ri6hxkQmrwgoN4iGagorTWdLczD/mBi033CmA6\ny47k+NxqO+1Of2P0slkbdjE5TEovAZwKAi/3asC7+xP3OYQDW+E0wFlQ5JNs\n31gRnUGlyq0s8HXOpSKSlDwEEmgS3AIzQBLUQ+shtyIgIdro3Sjdtn83CDnR\n2Sql/HIltv5bCeqmnjyGOO+qmSEYy0ML5sxAC7y9a10iaY/k9ZVxjKxKDkEp\nrB7ts7oAIWPWqtELBZEes/orUSQ4QaMUsKQ4IYfQkhnWih4cPnFGjJtxZLyJ\n7Top\r\n=T42l\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"bf43e244f5feef0950e9bc8165fc4c1faa923dba","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.66","@balena/jellyfish-environment":"^2.2.16","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.2.13","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.67-renovate-non-major-bf43e244f5feef0950e9bc8165fc4c1faa923dba_1599003466323_0.24904540111789375","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.67":{"name":"@balena/jellyfish-metrics","version":"0.0.67","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.67","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c5b533f602e289e230953dac9ce6bd494cb1c556","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.67.tgz","fileCount":16,"integrity":"sha512-pkOzx4M3N64WwKBPF7yYPWTCtEFfry+CeaZE/sUMMDW00T8RD8JEqATdS6szzN+dwOFlxwvpScogE7l1FbOFiA==","signatures":[{"sig":"MEUCIENZJHOn6f/8JnYV/99UAY8Xd2JgLgx0bPATwbyhiWwOAiEA3S2cjXMz0f45SZrtH6DOCxsijUfDCawGy7OvHInMwH8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80145,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTtv/CRA9TVsSAnZWagAANjoP/1d3JoSANk7P3B6Xvg4V\n7OtPkhePqOVMhJM/cybplxe3EWeQ0fyQDsAqz3eDeNogxdVj22o6tP3mB35F\nuo/Liyb7QBYYuDuI6zJ/aRDe52F2mGq/4Y05CbXn4SuiUDM1HW5rkuRDFfnm\nqHlqpkDlNC+RAzbNVlJvla2t8WktEk4cK0/fXl0NKb/pBnMnrZZ2EOFAhfPo\njduR78/WogKOQxlQXKlR/L7t/1Qy8cVusCBRS7o5vzj627Nk2n1YIXDu4C3L\nS0XsJ/qNXYQOw5lWEG9iQtRceqnR4RrndjQDjefxNuSEiMjVtlyUlQUvgRwo\nheTqPt+pfHzAFmp6KBqSL6hgGYrJHJoD+JGJbQDloRlkGxBRXgbJkX89xMlr\nt0BlVDvg5ue3F7ZpfMC4pJniTS5KSWcwatLZAxbqZDdnnit+/2l8Zu7JAlx8\nxkVk6EURb3oWCXlo0vpEqzig1rUxWrtNjJ29n8d58c6duqfanI0C4hftRneV\n73okJ+rGIHHKW8aaK2uRkhStydCkhVi95TCA5edH+0NtPcFwwkUXxxmHlaOq\n91hX8IReW61XGZud5yMqWDcgLxYoT8cKxMVNqB0AFObwT4Y/VC8BVYFLNbNc\now7+fhAXgQ6eTZHSSOal4ZJjuhzJNyzTC1HDYfpdnsiboVi9M/j8OlGX1wZo\n9W/z\r\n=m63t\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"b18d325544761ebd2593a1a39fabf7ff4a358bc2","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.66","@balena/jellyfish-environment":"^2.2.16","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.2.13","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.67_1599003646664_0.12090840048969498","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.68-renovate-non-major-52136d7c986e8669ee6d0b77f561f6ba12ced508":{"name":"@balena/jellyfish-metrics","version":"0.0.68-renovate-non-major-52136d7c986e8669ee6d0b77f561f6ba12ced508","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.68-renovate-non-major-52136d7c986e8669ee6d0b77f561f6ba12ced508","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0d0539735191b7094821a07cf3ee8f035126dff3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.68-renovate-non-major-52136d7c986e8669ee6d0b77f561f6ba12ced508.tgz","fileCount":16,"integrity":"sha512-5PpwdarefYFeShTcn4Wc4LbxDmRgitQD/hy7Gbu0yrtd2VKeKnXpFALj4wYLpRy/Rge0IAV0EJNR93JHo0EBIQ==","signatures":[{"sig":"MEUCIEaObPMBThfG+GFs+FRuPmtxQUKtkmcbybQfmExoCERrAiEAvv7YS2c7gQY9FITq5MOWlsOGU8BGPhlvuGdPmaLjqoA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80306,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTx7GCRA9TVsSAnZWagAAmlkP/AxU6UkoMXnqomHxB2D/\nAG6SAHIdHYijPRAIWeD/ISmcIqCHVni7wJO50p6pvN19hajPul05iHRghC2r\nRbLMgZanvhTUcjYbMqXP+A/PLg7gVbhr4p2JIKievpbFOCMEJJ0G+yOG1QZi\nkiYfo90jylo+K20Y0qSo/aGHEf/wHNxvUlq4fe3v94JaeP298sTpk+ryOJUm\nFsxa2tNhI1HJjEjRYKb2lnUGdHaa6J7ImMnrxfWpZn7CikLC/1MCz+L4ZPjG\nfrfjp/o7OIMUW+5vNWb3Khl7BcM9JKb8vFVBm6i5v744DU62lhemtqY/Bg9r\nN4RK5MaTpP7nwrWX5BZLU2ZIm05dBB1dT1F7P4g+i3A91fLEHcW7GTxLhGa9\nxFrp5Oy0MGi8VhQce9r5UHXUimnipjoizDNF+1uqGYZqc0wdExJTCJbPq8a+\niYh8sqWMVvf3qUj0p/WMvijTlLmhYn6eaL4POYq0kRxVdxrnbIQ3fzi8xaRe\nqRA9V8zukeTWxR3/3QrJUVvD+0emb8gs6MVaDGN8fTmo+7ImXR89Pap5uAAd\nXy1YYTQnl12asVXVmYvE01iKORMblU9xXusYl8PqIMswGTDY3V4QSlZVaIMJ\n1FSXDKCtkgLiPl1VQrE77hfb63MX/Sbo/vPEO5e/y2gdVYMjy6uibt3cFDYq\n3Vky\r\n=RqmK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"52136d7c986e8669ee6d0b77f561f6ba12ced508","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.66","@balena/jellyfish-environment":"^2.2.16","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.2.13","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.68-renovate-non-major-52136d7c986e8669ee6d0b77f561f6ba12ced508_1599020741978_0.3802929446236172","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.68":{"name":"@balena/jellyfish-metrics","version":"0.0.68","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.68","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"623a302848694151a97c8198ea62fcb4816805ef","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.68.tgz","fileCount":16,"integrity":"sha512-h3naYFgg7CHBbLY62WG/QJrQXTUWfWjwHNc2iJZqpl+6h1MB0PP3lS44JNNCvdsc2LCq69Ho4j2cjjGRpaRa4g==","signatures":[{"sig":"MEUCIARvpQfKXaVmq3iNPExMJOOyTI0AfNXN50EomNfHa4fiAiEAgcvBYVox+rDUJBtnjaVRh743Phgy1HOyrh5N6uO0mq4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80246,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTx/QCRA9TVsSAnZWagAAFKwP/0Xlwed970ayEbh8e4sD\n3FcHDt88qHCTYC8dVJs87nIT09Ptpc28afYLU+GiOMy4A8oeHteHiopHkcBj\n3CbY6YRFqYxMN33qELo2zg6dmdbAwhXJNngEQgBAhXeiIvTorUjrVAdiLfXx\nduBhTWT1ZPF0NZv4LNrB7eGUhFNZvD35c8FY6wI26U+YQ4dl1XFpOZ53Nlj4\nzptBRpkmgRFzy/EdD0xsL95BZUbVetlE7urOHyBRdeONHfHfZToEbRGQ+aE4\nZ8cQ1p113XE1qFVb2uPtu8YtGGr3um1s3eKBjsdPjpZdE4NK/6e3YRes/O28\nwnHf8ZrXmMOE3hg3umufmLgkR6DBh/jT3iItYer1njsUM1jreV/4Xj0hk7uG\nCA8u/JQxf7tyEZ3+9fmA7BMv/GAkaOVWgWl63vRE2EDpbcvGjL8AUljbwL2m\nU1iw0jdj4kvVa6t1j0oo5EcBWZuNRf89/cBfdaBj9ikK/EVhAC2U3X0Zy80s\nbl40pdhcBKBfZhEMA9G6pbBOdEd50ZUt5IItccb8JKUNJZlrkY5Mp8vrE22E\nMmV7ZvphFa6Irbr8a/ixBSDWiiu/VD4qh9Vbi853pSvs4y30KGcAYULof6Y/\nC4RGUIc1uURdc1KMnLE/qMEje/jAXZfx+15TWhzxfaoK7UTb2U0jomtTTPqQ\nv+cD\r\n=bnJH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"ad56fbd60a783d92669486da75e14ea9a80fc910","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.66","@balena/jellyfish-environment":"^2.2.16","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.2.13","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.68_1599021007819_0.2717142274198361","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.69-renovate-non-major-5b599298fd13945c2abe0500ad2743bc9b7dd8ea":{"name":"@balena/jellyfish-metrics","version":"0.0.69-renovate-non-major-5b599298fd13945c2abe0500ad2743bc9b7dd8ea","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.69-renovate-non-major-5b599298fd13945c2abe0500ad2743bc9b7dd8ea","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cb8087817afe4f4cf59fdafd9264dd8dff8e7a72","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.69-renovate-non-major-5b599298fd13945c2abe0500ad2743bc9b7dd8ea.tgz","fileCount":16,"integrity":"sha512-vg3iSdOrnWmhqJPL8LXfR1j2nMgO0yIhZ1OINGsFZXF9oYNTQGRz28SPChI0eUn3dKWTQwBhRYcQ/LErfiJC0A==","signatures":[{"sig":"MEQCICQ03YJk7XYHP0mHHCJxkSf0hFRiIJHNvrIzZmowlc7lAiBMKdAoN2WhzHSu6xZzftkUnhN+eT6R5in/jXNxUQdklQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80412,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTzROCRA9TVsSAnZWagAAnbYQAJe3N6kCDay/PeUm5u9b\nDGDwjqxwDLEUmVdJ8WQLwJeB8fi0GiIU2wlNd120+5aiALe3VO0j0u+M7tD0\nL+y9KrVcKdjR5Vmqj5gc6QRrsDR3KfjQFTeV7jHzv3DglabhHiKdqLUYMNB7\nc4dIhEuha3sf1nbsUm0/haYzFLVjFwkc1dtxGiBQwLkIri5ZaLkt4UKaQ27O\nPhA028MbVVg9RmpM/tdyjSmQPseYgPZM4SCetkr6tvwO+bpnyo/uM9u9eGk0\nmqa9uwuq73TxwuBKsFBRwhXQLLPeYJIUhNIqHO6tAhhO7ytlt5B7WUcdi84J\nSOYSo33JT2F6EXXIiVMn9aZTN448J2lydIxGimQ2WvlbcizSqAWOSuTFBK/m\n88XD/4WHnIxmnSEVKnsVSZwu2tV/8WqDquvwPIMV+jqopZipUBLYNKkKYxIc\nSHVw4kXEA9KkFRRS0cSl9HqWLYebU7n6p4v2M4inSqiv1GnZCQsyVwmKwLaf\noSVlfVcfSLxJ100WCc3TdYb+IvrPYf+0BrKByPhMyX/dteWogKzWL2A6jxfX\n9BbaD9hP1yz6C1ejPjLrOGErG3N9PuhSRbcfcT8NH4FSdosDYQA24LE8wX0I\n70Ly/Sb2elukWxICVdQCjQB65ItN+jqQDrtPPh4TIk0Irc1EthZ1+a79ZRF2\njLZB\r\n=WQnM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"5b599298fd13945c2abe0500ad2743bc9b7dd8ea","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.67","@balena/jellyfish-environment":"^2.2.16","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.2.13","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.69-renovate-non-major-5b599298fd13945c2abe0500ad2743bc9b7dd8ea_1599026254138_0.0004186509227050994","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.69":{"name":"@balena/jellyfish-metrics","version":"0.0.69","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.69","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"80f61ace6848ad400fa72a32f88166740fa54c32","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.69.tgz","fileCount":16,"integrity":"sha512-GYblTBDICgIO1huQwD3h/LyqSHyf7G/P5vbz8U6QuLHuSpspTC/2PxDoFUW2Z6bIP8W1LySyF4X0YvIDD4cn+A==","signatures":[{"sig":"MEUCICnayqLX+o4U9DSKj2k8+4RbF0SdgQACJYej6Q0W9YSpAiEAsp8cTGdLgyXpv3H9Uds77ZqGYaY8xdS2aVSpDNDk8es=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80352,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUDZKCRA9TVsSAnZWagAAfzQP/jicIcezCPTG1Neh49gT\nSwfu5wUNrUfcC39RdhcVH/fbnG9F73J/lGNS0Z7OmUvgKBbuMIWsm6z1dzMg\nBtsoqySt/aijMcNw0emexLuJqchn1JH7608q/mUlH/EqMr3rFIqDqPJ6VHhG\n2Lp/4KxCdNzk2hnyRQJQXOoHeAkUN1ZWNZ7onL9l2mRxW0pv6Hny5l5HN3pD\nrcZLstatSaecgLEymxp3vD8Wx8+i5ZkNjtXLtVDkb6o9NvHeO6cFjd297gls\nMHnTV8JaTj4MsX9KmlECgz8f8TUkH8wjwMkA60Cp91ko7h3a2OHkDBacwo56\n0rw6RdR0Nd8I5vpQUSQ0lvr60eGcbNGQFoA0W0M3yGtMn8nMW0BmMfmBUAmm\nvcnWxaAAOCerwWf++DP2DgWunoAczY7vApt8DWNXBuHJNaXerYppHkGIUvte\nnXxZCw5rSY6QMrC2XO9Ehm8gncNDayVwjtv7yT3a3EDvNxq7QRbYyW4ZYHhC\nE+rIHpHNQDNHKKv25kr65t4JJrSMfArOw+ZsIqHuXjiz2CjeE2Z7Iar8azk+\njE1Lvm1UdDMQZgonGZ0+1w62wL6u51YFzoGlQDih16jmrD1QKPJiR2EPrQtA\nzmav1FiVZZ3WIVff4ACoJQrj3A9V8TdOhn60Gzoz9jwOh2gStZ8rRpQH/pT7\nx1mf\r\n=7SfD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"13fb560c99a1e907d2e271de1fcb8690fdd01d25","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.67","@balena/jellyfish-environment":"^2.2.16","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.2.13","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.69_1599092297908_0.257485921935807","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.70-renovate-non-major-2431958769c289b993cdf3449edc2e509b6d4cd3":{"name":"@balena/jellyfish-metrics","version":"0.0.70-renovate-non-major-2431958769c289b993cdf3449edc2e509b6d4cd3","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.70-renovate-non-major-2431958769c289b993cdf3449edc2e509b6d4cd3","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2119e6999d62bf3c517389421feae2def84be838","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.70-renovate-non-major-2431958769c289b993cdf3449edc2e509b6d4cd3.tgz","fileCount":16,"integrity":"sha512-tQOuOgSSdJtGHUHIU3y8WMavDKD/2o7gqWrgbzvE1m7bC/45HOAGf3Zjm2ITY6djp/qE3/GVV3ARdKbf1JKOHA==","signatures":[{"sig":"MEQCIEV4aglvQLTi7jIvMejtLmtfw4MdTD/Z9OB62bmNsMn0AiAXDB8j3TZmn07s7KM6phkA/5ggQxpwJARpZ581ALrQcw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUE0yCRA9TVsSAnZWagAA0EMP/iWhs3/O9J75FcctWXEO\nh/apr8RHhRlFoISSfxh9sQJCqQufk/cExKElH3mueq0Ue+fxUn+w5T2WqXrK\nCmJYPyFstnF7pBRsmhZfN7iBHX+OLgGFhF8CQZG7wepqLJT928FMCrYuzfzY\nruxysMi0FJGluOBUaimcRf+aTRN8SYfodPb/FOWDIthW7pAH53subQ4SDubR\n6363DiAoAijh57G5HtfdjU0TMLK3WvMNJ6dWMHL7dEMhRta/Bj0aA2trwb2G\n9kn9GvA2LdIcracKGhZ7XAqBVPJ+9syoBxKPW1/DPpuq0D5+Mw5FwwBNPloB\ntNi7L+CxhNNGfvi6c2dU5Vfp5zCCqwzzgARTiPMaJk2n7BKUzWP03miXLKnc\nSVCkXKxqbNxksSyvWOHiTNUJz6hRq7M4BCVNqHcyqYes/h1wnEENuLMP1xQp\n+StrBOWI+VGF1xMF2RHpqWaD9oS0LeaK8gmip3b7Euys2Fk9e8Fu41svbQ+A\nraSlKOs68L//UTPKZEAk+QrR57LsNJzvHssiMHxL46W8WT62Pve+ujxitUw3\nUrUSfLb201gXeW1dQWHhbYUIqwNYqGA8+X72Tk/oixp73KoVKXB6kclwjL7p\nM93w/LqRkqYQKSpMRuiiMMP+Hn9xYRq+AVL1lvjNqzKFx0bW5GTzL8O+qDOz\nx6Zq\r\n=E4Z1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"2431958769c289b993cdf3449edc2e509b6d4cd3","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.69","@balena/jellyfish-environment":"^2.2.17","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.2.13","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.70-renovate-non-major-2431958769c289b993cdf3449edc2e509b6d4cd3_1599098162363_0.5478824305951695","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.70":{"name":"@balena/jellyfish-metrics","version":"0.0.70","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.70","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"20c9b601d9b53f4d18cffa0437d41930ee14c2d6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.70.tgz","fileCount":16,"integrity":"sha512-lLqCfoczfyUx/3Gdzh4wp7MMd/AYJSRhbUuFHCTpenJNx+nboxhQa409oaxdZ65PQPs45KsVuR8USGkLz7K+9Q==","signatures":[{"sig":"MEUCIH1ShFqfaYHEUuaqDOCjp/rDhMMot9tRmMIek2mC2rGNAiEAkp/3ER00H22lquPefyFBDBe8GXiD/RnOM+g4OHczQcw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80421,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUE6wCRA9TVsSAnZWagAAFtsQAJSp+cYMLlo92Ic/KgEq\nvEx49+lA7+RtKSoFseZqnczF+NK8U0lM9xEF7kRuWkRo5+s5CtX1Gb4K5iC9\nOVfk3Xw2BDg/bker5Si7eXLlEDvS/0hKQ7MsO5kMOUjCt0e6QjT6PX/iwUrt\nZrCjmiXI+9v46OuZIex8nysUIjNPYah2GYbmkBCD1mG6/spTpW3zrApX+UKG\nuvcGfkrn14qNSV8bniUxcGE22b1RfJ9Fcc7exTlROehhtHZ3zOZcm7ZjZ58g\nYdoIqxaE5Mg2Dfn0ydd0fy6cuShvSm1EhCE7lF6EYv5oRmvytzOAsfQUTxSz\ndIrAG8K9MKlu4rYU5Vy9O82F5WWNCtapGRfyqv27XN19Fo4UpqzmCpvCs5AE\nuMXNqBVEtt9vww/JBGPcMsjOe8zDkynJM+2ZSr4YmYHK2ON/NiBeUt6WQf2h\nUQbTwi4sxxSHi5l8+fk7GkTAlGtN9y9jfJT1RaGjGh0qAgktR38PbcdW/nxd\nhtDNJ/JpGsw68Xh2Bybjc1wQtfP8gijJH1KbCwUa9uioMK9VbX4FQlFQ/5Zz\nibXpIoUkv66DCFhAlvW/Lub6VR6ZV+IQW9+OFxD0bHu5AAJ/D0h54qMO8AF/\nmbYCiJ8xhRJEVk5UvD/8eVMYmyGb7PuMOmAAYMPrSvsCQyyqKL92k7t/xSjE\ndwDi\r\n=0faE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"e3af427d54e70cf754d9139e78fe5c3afd80cf0f","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.69","@balena/jellyfish-environment":"^2.2.17","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.2.13","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.70_1599098543564_0.25067801928593103","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.71-renovate-non-major-cd13228e77a8958e19fac5dd1307209df5289df1":{"name":"@balena/jellyfish-metrics","version":"0.0.71-renovate-non-major-cd13228e77a8958e19fac5dd1307209df5289df1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.71-renovate-non-major-cd13228e77a8958e19fac5dd1307209df5289df1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a949fd53669c4811801fa2f282c6c46cb5f82b37","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.71-renovate-non-major-cd13228e77a8958e19fac5dd1307209df5289df1.tgz","fileCount":16,"integrity":"sha512-ZWJZ8bfxe6Do18qiktVWNJKGzM19izkrbmznRr47UQXTQ2kpjSM0b5/FGvWc/n+b1VKXQ7upnMkKV40hnakKbA==","signatures":[{"sig":"MEUCIQCUerpCNlDNnGO+oGloHf6lDesx+uCFTYoYnDWkFGX9rwIgV7kz/RUzD+saS++qnzdnmnxU9groR7ydM7ysgK1epJ8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80573,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUKZZCRA9TVsSAnZWagAAPBgP+wQmpCUPnG6aV9zW1J6D\nhCDKtXu5tGZOC7+QVGLwsA/CVsWI5J+Zf/jrrHPWFGM61WV8bCigRYyEz0cK\nMb3c2VyG6ub5Z7WPlaFy94DbNl7xNStSP5sP8Zz6Snh7DiDw0a5wqh2DzzRo\nQFzHkb2rDf3Ne08rCZjYFxBDi8Ev8Mfe6SVZ12lq4xQBX9QRe7ac+JhcK2f3\nnyakhff/I1tX6HFUTFPdKUVUpk5w6k5+K7qROzbCCkLSykpU1qLHBV7/D1NB\nDG45TRr9ldL5uUrzxQcVvhOIB707ADhFsd/9YQd58JkWvugyjoPxrt8iKGUq\nWjRj8k6BFaq68stl45W7ZHmHj42Ef2VFmFZLpy5gN3TUQtuip6azWzZkjZ5R\nM+WTfj1ShDLZRZ41oFtblQduLOvy306FwmTk1S7GOr7a1rH5aKMcubpw09Tm\ncMJghVYFU+BPYxAOY4C1L0QbdxuVqUqk/yoaGczQx9SedPWtZ3rnllfD0dUD\n6drb0mLmN6d0LqjnPYcRX8Iw4O3J3ZHbBYWV+Vz3C+B4wuxmVYFSSO0VPmJq\n56SxBaYuuIyAFqTFbYESSMe1tT9dy1AAyoU1F4HEELqezpLbt5ZEfJemMo8l\nLOlH5xMR8ALzpkVQajvlGnlaHo/vl+gPJiT97585tPVoVNCArmmPonLGRssA\nPmIo\r\n=ANWC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"cd13228e77a8958e19fac5dd1307209df5289df1","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.69","@balena/jellyfish-environment":"^2.2.17","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.71-renovate-non-major-cd13228e77a8958e19fac5dd1307209df5289df1_1599120984437_0.5551927555788099","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.71":{"name":"@balena/jellyfish-metrics","version":"0.0.71","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.71","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"459cc1d18fda3be19a751ce4e43c3145cd1edcaf","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.71.tgz","fileCount":16,"integrity":"sha512-WceKzihsxAgQhnlXPfvDiT22Q4mYcJkXXfUpzze11pKZpA6t8wMkZIyzn2cX6FkbGxNOeXuVuNmtRtMmyCsnMg==","signatures":[{"sig":"MEQCH3TCRRQaZGFH3YDhg77jtDAH/2t46V0/OvqjzHpZY6ACIQCC33otU7zrEvd/5qWbIAlXmtwSAWo8KqiXjtHFWe308g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80513,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfULJICRA9TVsSAnZWagAAD8gP/1N0KLUEawP4d34hCNtQ\n+r49WA2Ujnyfc+yfQwnMcigqON2BuC1fLPn0Se3n7IVEV+6iZMbG2Eai9GC2\n0MLCVVA93jUgF29WB2xlggJumMfWFY6NsGlzDFrOH+oIJm78DqXRW+zyvR7y\n5zjXY5G1vbjBU8DUwLl605Awv4QT7tdJ6bJdfBZoHwrwFzNXaDHBAJWj/+um\n/QCrYmsgNvJc//iKYQd2MTleWnw2aDNr4LEQw4ZceUt8Ta6aAMIuDkPCbst1\n3/c6IF8jv3iRibnoaboGNmgXaiZ5HM2tqosT5x1qhkNbqA4TeQ/DhziZQTz1\nIyWIYsDMtuJdgxfBhiqDZQe0IWG1WyWO7+u9ugtDcpfCzOOrF44xswp1EG+R\nHs6BF1Rq38jhetNPsqfVKyq9RwYNMpaQ3cBoKYZQKfgHQ7mylpEwsv8M7ZAm\nCSOIUR1acpoSP+UqEOw9bfDO6Vs0FXvjMo0d1QnVY9E1LtZqVQ1mHfjI5qak\nlZFLenlXkgJ3FQAU7OM6965ih582uaUDf9NcJPPzBVaPHtQx8dBknuzeCTe/\nXqCFqD1707MLXRgL21BEjtJbczH7q9tPRJuA5Ng/9sv6x9Ny4kb0fHMfjMuu\nAtsBVr6G64cYESDl/g9VHo7M1pblpUeCDlDdus66H6M2e+e+6t8nXV45yfyN\nHmP9\r\n=r2Ut\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"1015ce62fc5b4406edd68b6ac38a466163626a05","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.69","@balena/jellyfish-environment":"^2.2.17","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.71_1599124040367_0.3238141686260607","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.72-renovate-non-major-369938f6b67468eeea2c75f5aaefd5f307452cb4":{"name":"@balena/jellyfish-metrics","version":"0.0.72-renovate-non-major-369938f6b67468eeea2c75f5aaefd5f307452cb4","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.72-renovate-non-major-369938f6b67468eeea2c75f5aaefd5f307452cb4","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0f7954d5b581a4f48410a6f41be8c7c6041a4473","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.72-renovate-non-major-369938f6b67468eeea2c75f5aaefd5f307452cb4.tgz","fileCount":16,"integrity":"sha512-NGaWjm0RcJQTGqhZFJTot6Al+YJSnbI9rPXWkbQie22OSUm0EcoBCzU3u4aOZ2D9MOarSCT7j0VQ1WRQNvzW3w==","signatures":[{"sig":"MEQCIHK5QtCsWvdQfGjJPBxJdhsr20L85ThK86oIG0qn5LdhAiAr/s+AK29Si+YxfVP0hIfiGiUwCT9m4QL6Yd6k3bK+uA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80642,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfULOXCRA9TVsSAnZWagAAnk4QAKMhmfFj3NAD+ZDMVtHi\nT2a5yLbb5mPeshapGlY5IzacDlXk5VcOgyJSGwfbP/I2Ekwo+nLiHZzZo44s\n4I6ebWv15xnZF4xczlM3Ze4aq0bT1QqRZblusH88+ijqHgaQMWBHmhV806pm\n4GnwH+J682Kj3fAe8dedPfH/K86/5WuCUvjWUOQ8tm/X3tbP6P1m7DC9qViM\nksUkx4gVfoHp/8RR+fJ55d1juYaC4qJ4z8bNd/XAUBp0PVwHywFRKeCeNHmm\nE1vnPEeRdiMdbmisNXlJ/Ih0f5a6YZbTEKZFeQ/KyUnw+aN4w8flf+UeQ8Qb\nym8JDD9GmI0o2XmIfqhSKx1vaLkWXQnuK7yR+zuhGyC3MxVtgGeTHeseDGZP\nTdb+MOvqmLkMoJtkNZC87QcQJddJRVqJzIhvDO+eex6mHAfp06BPt6aoUimy\nVbdfENE/IDVJrubxjROqD3sV4U8esaYTeMbtTYeuhNict2bQQ/N7NkMGuvq9\nBhN0Qq7vvXyu1CzDq0KOvGgShpTFa8cTGbwUoFSm646P12zPDk5ez92IFJNf\nqia29oB4+XoNJyruVNCjrOlFd8d6Q4MAhkvsLWCBjLeC4GC//MGm6QkmbVKN\nwRunwSq+I2sZMtGwbMVZlqtvNOAviY8yE8R89jEdEK0uXPyNtFQN+9rdr1i+\nviQn\r\n=Jx4d\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"369938f6b67468eeea2c75f5aaefd5f307452cb4","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.70","@balena/jellyfish-environment":"^2.2.18","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.72-renovate-non-major-369938f6b67468eeea2c75f5aaefd5f307452cb4_1599124375047_0.3269632860633527","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.72":{"name":"@balena/jellyfish-metrics","version":"0.0.72","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.72","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8e15246ac547b32d71aab1d5bd508201ca74a8d5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.72.tgz","fileCount":16,"integrity":"sha512-F1DbvLMgrK5ZR+8q1KSlXlTUSPN9VuZRLMIIZ6sRgJYJQQedWKGrBTgQd5Rxzk3gfceKh7xfhZQe65Oy8RQDCg==","signatures":[{"sig":"MEUCIEBSC3E/vF0IUyL9FoBQsDm//JaIcDcGDmzQz1/rgIEJAiEAhyznciv8rY5B+km7SuN2iSKR/YUVKXtQWgqxQMKZ4do=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80582,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfULZvCRA9TVsSAnZWagAA+H0P+gM6Bfpqg1gTb9ZnShC8\n53vpz0mweyMCmEkFOVDApTDmuK8qWEvLSJMY5Y8K54LyCmdmqx/Q4UhdHeto\n+qNxkK5rjHjL3r7DhhAFoeHCxIEC5JdfvFWYOq54sNIn6kPMK1aJxb5XuupL\nLd7srYkK9oVCdj9bviFpCXqDFCjLwxc5AqlSw0A2XTjg82VhV88n7jGcVNwi\nSIXlXAWNwEcYc2ePXCuPZWnzB+YxQgscGlZPAc2iQ9lGAekVkp3RbPoM1zzI\nxj51cVjG/TczOxIj0axCu9Q3kIOhlsy48efotCd2y7yzEDKTsCPC+6xU/EUm\nKRn6mjsEHTqYgzwk9oveCT1Zw1OzOlDmQPDBMq2MAsfn0JMecrc6y0wpucO4\n5/Gs6mw0iiaPzErI8nZpMSKwje+4MMqAJkMdDuV1nqvzOAscZXkdzcNS5oFO\nsXEHmpsGAUFXzghv4DzCremfLMqaA1CkcjF4zHsVNjS2MpW1e6g0dN1b/56+\nWuouac1PY8pJr1WYM2JiIDiBmACSyPum82aFCsut5VGRhazrneKfrh7PCLdf\nIc5S7cVWqbEcWK3b24nFQvrIucwQrueEUQcWsHJsWAh/8dlcvBgZJKTCZAar\nFCr6+3GdH7xiQmfQsG/mSJ4XioHSoA2woa/fdY5eyR8TDrlNRggvcpN+Q27X\nq7UQ\r\n=89w4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"7438c08e2a720490493f2908b3678e0c41ec4cca","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.70","@balena/jellyfish-environment":"^2.2.18","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.72_1599125103071_0.23302683695156445","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.73-renovate-non-major-47cbe7177b8b4167ee29cfe0829412d793609234":{"name":"@balena/jellyfish-metrics","version":"0.0.73-renovate-non-major-47cbe7177b8b4167ee29cfe0829412d793609234","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.73-renovate-non-major-47cbe7177b8b4167ee29cfe0829412d793609234","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"abe1a21971f1beef0b766361210e4a3c94f65d2d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.73-renovate-non-major-47cbe7177b8b4167ee29cfe0829412d793609234.tgz","fileCount":16,"integrity":"sha512-Phci+8szBbaEmq3VYUS7ExCXATUmplu5a3V6/pQqx6G7xfYDkzMIbu9PwxSp6/8YuI2dBBFwzyJoqYK/vmsRsQ==","signatures":[{"sig":"MEYCIQC9IP9agReVb/u6Dgn2Boa2oqsqP44oyJwDjPhAROFPLQIhANNKV/bCs+K6PetAd18ELKnmFA7wsrIo7X2nG86A8smA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80748,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUj48CRA9TVsSAnZWagAAT58P/iHx6jnlagJTQuxKRNdB\n4JF/7B/XtRhosBLOgTDVN7jxru3xyEJ+R/gVWeZDmD6dSFN+Z+K5VhXkoNtH\nsQPjuny9vYBcf9EAtNm46xRxpGeeQggKLm6qGu0B4+rrjdPu+OV0/Z/RpN2X\npj/vc+5H3kHkZRCKwO4aJbRefRdhzflCbccVxwzlKbo4x1k5ClaaKlEH6uhl\nII7XTvkaje549qApSMmzxzgnx4xCJT+55uXSfBt6lgJYJavIk1vgDGKHOTks\naHi8NimdAAgYyPAdD0unq2LJSye8Sv/Q3U+fMSy8O8pfJGJbMB+cxXZKqBxC\nG/PNUZHIDeAEQHAREzV0+JF6vNwrZRf6ZcgvZx7dp06ooPbZOLmcb118wj3f\nH6xoG4cwLEZvpc1sjnYZxDrtdyVZqiZoKjpACUYmY4ruBnoVPBZrfXbq9JMG\nYjsckt1+reS7OXPAVxho74fSK4cTnC7xb2h+63gviVSH3bAGFnCxZnrdEf40\nLOBdYAxE44axu+2dUrOh77Q1KTeuaPt8szsaKTzQFT+fnMyUhDn7c0usBghr\njc3Fw/8ruPCHsVbvSv/5+bZUX74jWB6vbuJbJpJdUa+sB25DWZQ0yFowsOxA\nVuY/YGqR26+5h4MjQDAg65nnis2Aj8YveSaC8rUQBLgKIgVCywpivTc2W4qE\nJabC\r\n=sFIr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"47cbe7177b8b4167ee29cfe0829412d793609234","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.71","@balena/jellyfish-environment":"^2.2.18","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.73-renovate-non-major-47cbe7177b8b4167ee29cfe0829412d793609234_1599225403730_0.23807810659846673","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.73":{"name":"@balena/jellyfish-metrics","version":"0.0.73","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.73","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"800429ace3cdbd53ec71ee2bde4316c3b338c706","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.73.tgz","fileCount":16,"integrity":"sha512-s/mo9joHlqKZ/iHLIS0dLRcHh9bhns4X47h0Pfz1H71cMvvrUe14yNiencc0U31aGesbBgTBeIt3c4brE5LHhQ==","signatures":[{"sig":"MEUCIQDVxfRtCMntRxCaleAr63GUtIY+i3EK4ZBIkjCYXkOp9wIgFsTifvUx75r+wCX6Th6ovcns5xz6WUssv2bMxCuLrzM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80688,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUj7oCRA9TVsSAnZWagAAC+YP/jhrEyex620ka+9FKnpY\ne78E6DfCjeLmhsrrUkJ/xBFKAzdsOeiBbRLgCd411uIPo+ioJ2oFk4HZl6dh\nyycv8wvZTd9oeWhyNd5cnt6uG2PHbuR8sVnbc2Y1vXnRSyfOpMPX+7Ha2ide\nUdd4sZLpz2/uT/EZS4QNiXTB1HF73Ws4buHi5m5BqGqVc7v7xuvz22+LKHxN\nazJWel3/kWOXaJe94zRHjVPeDiD7vJwZ309vLGpVDmR7fpreyV6BlInnPIRz\nInAdbWPtzrPf990K8QmXQV8J/3UdNvGtcFAfIL7tQh+yROo7eXhEWh+LPqEG\n3J9GL5OZNVD5nmzlca3Xsj5YMKRqip8RgJSBmXXLrEG0rDruCdB84Ddm9OVF\nNQk+vgXzqycRqyUGdBsfzEJNjI6SlCKvA6Eu5VmDFy3vCcRyh20lnl1ZDKUq\nzRWm3cRS25Co5+1nEEfrWXcMWOLRo7FgiQedmFSGA5HKIKkkBc1llKLYq9UL\nUH8/vr2hpifCeiEHnSxJnYbCBMEnK/35WuwWb+RoY+YfY0t5Nc93kCQY1Ren\nclq4LA/gsuuFuVQ12wtKclETqbdMmVQanW1e2Cfr3xc0UUtvp9BFTbG27Q1K\nSCdrK6Cd5Zs1/Fk1WnHcrvLml5oY/IlKxknKj+0YvBYTWSRb/3iv0YfsquK9\njGkq\r\n=xuV5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"214c51ac32139d07d1167797112a84949ce7c545","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.71","@balena/jellyfish-environment":"^2.2.18","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.73_1599225575854_0.3288406462999156","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.74-renovate-non-major-ac3b533ffc0bb6c4af3c7e6826b700d97cc837f5":{"name":"@balena/jellyfish-metrics","version":"0.0.74-renovate-non-major-ac3b533ffc0bb6c4af3c7e6826b700d97cc837f5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.74-renovate-non-major-ac3b533ffc0bb6c4af3c7e6826b700d97cc837f5","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ff131b5da90fe886f3c697120d96eb394bb6b787","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.74-renovate-non-major-ac3b533ffc0bb6c4af3c7e6826b700d97cc837f5.tgz","fileCount":16,"integrity":"sha512-a00AL+fIVrVvJ/7tPyL4leqjFXXXxl42nhLr2ghu/ZI2PMvcqg0cThWeBVMmzzxI6UKqFt21w9ETmuGh5dz9Iw==","signatures":[{"sig":"MEUCIQDrUCx5r4ZZbfKYWWIRXPBVob8nPuvuTwxeBTdjrexULQIgOFYmOmgt2HoBZwBx02ySeRjuEy1cRobDpWOBqN/EiBA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80854,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUwVTCRA9TVsSAnZWagAAB1sQAJE12vRilLsAVYGRaVcW\ngf3H1WtikGhl3CUoF05GWar473DE4E5DnF52fy8OTvBWjvigx38aNI/7UWGF\n5jVboLySCY34i2VAuGojUzZwACdr+BP81r0nQ8uhX7CcINlnPp40mPnknvwb\nrwDBHGoOGD2R32dP+5+t/q9dZomDl7B+onDVFD83v9aenZ4ylK23DHqZTpX0\nMtJXaBFlj+mBTtFnPmiikJZcRG1WUiiOMRkrve7HZW/Y+OOwxbBPgIpBkHjD\nnfEh3QjYEymuL2HAadgDCmpdOY++0x1Fuzdtm3NXNmel/N19s0ZPCFsnw6u/\nMpOzXLZrsVq+5kyRuukQ2KYAjfl2OO17vg7BKYss1LMxneRgyS2382BDbbJ2\nfIUMIBmZnFYtqssNgUq0ahZcX5KTnNtcGfeSNPCdjjlNwEEmS6TuHfvvsiNr\n6LwxJP4Cjx4UbF5KVFPKwjl5fQWnHBqzx6mW2QDD9sMiozD/4voJnHrR2ggW\nd/FtzB2y2hOmJjpDZ3+iy5dE5uJtohCqs37W6aQ8EpPzQk/KcZM6zbvKZkJ4\nYygERy2GIkzLu0bJeZGhWsMGg6UMRBuZJQmdJx8zGJoMQE1NFeEBXAwPEDb0\nbBFlyouh5WmxigdAt9LJhUgQaC4DyDyvOX3dxUnMpyaiWITNnDfjfNdaqF2l\nouyr\r\n=aFWI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"ac3b533ffc0bb6c4af3c7e6826b700d97cc837f5","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.72","@balena/jellyfish-environment":"^2.2.18","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.74-renovate-non-major-ac3b533ffc0bb6c4af3c7e6826b700d97cc837f5_1599276371346_0.6038302752753113","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.74":{"name":"@balena/jellyfish-metrics","version":"0.0.74","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.74","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"686c63085b6d93da953e4dccf5affd282ae7066b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.74.tgz","fileCount":16,"integrity":"sha512-SR3jC/9LtAdwhpB7vtm6hNLdWttM+yeyN35nOgMYXOqOhXJJD6poxIUNOFU6gN+gYVPhQIkEjsq8Lgeyg+7wNQ==","signatures":[{"sig":"MEUCIQDeKiEDvcItzfFHJhraBReTaLOLAEmeKp0mh9F1tif0pgIgflUCuepNE2IAMdY7JiXc29kscxLcHFQpBG9y94Efmlg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80794,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUwYMCRA9TVsSAnZWagAAnSYP/iaONtTL3QKGAtE+JUmu\nA7AxlzAjyMftdumqU25nVF470255/3XpGFTyAb/ffl1ajL99lx1CV/a8OiAu\nI/xgwV7OUsn1U5waTEUZuVJMk7Ykae3Htb8FADGcZnKICyV7r3DrQVwCre6W\nLAQMvi0B5VxX5ER1vP2paY4EhQT2t0zhnZZn+WdJvrCejmCw/Ey8laED/jkp\nKhrJzzYoksVnmQDMVtzuyKNUTWyU3YRb7O9/1+KAWqA4HzJvfqEy3oZM8qzw\nEwIsqmwZn9ezIkQpCT957rk0d81jIDBf1ph3AIoU5Uc9bLrjWfp6CpncNtTO\nQMnAZiMAKiVL2Cm/wrdRaAUTOUzBy8T/FGraapL3M5disTkIxhouO0voliUv\nME8veq6LC1nCwMC0ZpFNoLSbb76FaxTzLi8ORETYH9CH03K406qqQ8NMO/Ci\n1XTUc0UGO0WJ2GkQTL89TjX1nAdz7Ism4md6pG+jI3rXrkhOAkEaUAsS4w7x\nUrzzDPEktZL+fJND+8xAhPuc+XfV+dwyJUbUcGXoEX9EleLxAJUfcqUoRcNv\n95QcdIiGBtsSVOLpPWfvQ3F5ZaeV27ye1dyDHgOEOTlMxKqs0WgvaqPtSZi4\nAp1Y7Y8+1Uztdga3t+SKfvXxchHvvTfkw2fuwJFWjUxGIDVAQi1YqGAnCUIy\nQ0S9\r\n=Bo5K\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"9835b665aa082c5b79ad9139b5fb443cb5099f9d","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.72","@balena/jellyfish-environment":"^2.2.18","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.74_1599276556233_0.13841207847944248","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.75-renovate-non-major-04d360aa29799995abe3f49a29e7507052a7f587":{"name":"@balena/jellyfish-metrics","version":"0.0.75-renovate-non-major-04d360aa29799995abe3f49a29e7507052a7f587","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.75-renovate-non-major-04d360aa29799995abe3f49a29e7507052a7f587","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"32311881319939978c8f0002bba03290f4bb85d6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.75-renovate-non-major-04d360aa29799995abe3f49a29e7507052a7f587.tgz","fileCount":16,"integrity":"sha512-3PKinR3yFyLyOBz/ttDJApqxLNR8QTeSFwlx4fWv5ODdyRSbf96Hri51eCqsYH5kuq8NZ2gHmtjXzeexRhKdaA==","signatures":[{"sig":"MEUCIQC7WpkHjstNjTblW03H8munzP9+JrVEE3p4cDyhlA2UnAIgFF9AXAGgrt8hDJixuyvnXB9LUxtH4aCr//mroMw2nDs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80955,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVEsaCRA9TVsSAnZWagAAN2sP/2NA1xbkkkE0JOl+tCSf\n70aFLT2PiaSSE+INESjdQeqSit4SAZpY5TLbrCcxhblVwx7tdc016ENcgXRl\nsHEThpWDSQAY/rdbChyqFhRGWAtayRTubrK2gcsVe6linpEqTk0go7XTAiPc\n7If7F6ZXP9BNSnTusqk8vTug/fcOAnfe2Hb5sZm5NmrU9p1IbKfcDHs48wC2\nEwuhuQgqmGRjxxrtberIFs09GLAeoeu9q02E4hY/4UM3EXSrW812PZ9tE5WK\njgCwsKznyyW+AzEFeYp5XD8Bx03FMA+qTYoEMzDGfrUjH+WCpc7tFiL8oOSl\nNe/u+FlA8Gw28Mm5syNQNMxlrG7YynTo/rv82aPRSM/ScGyKoemFKkpp4PSP\n7iGB2giaVn5Nm1rctYf9wgvCPGPOIVqvBaYgE39jom/Z4169hc15XLoI51qd\nfmi33Cm7tiM1y7sT6iPSfuTAkCJ5oGBxA4SVQT3sDx+i/J6eCXu29ThSd74Q\n9sHwXNlQ/Wbu4Tp8RkpHjQPRLPEBtnA1tg5uPQubVKWdX0BSub0NSASKupxA\nbt4hS0odskBzJiewUxtvua9oTbTBa6idi/2Yv0IPqCil4IhjA0dxIZWCdLCr\nOmxFZXfXqimeNbztRQDPHSOC/v7C2H+zTdfuoOKluam2hs5YEl+4IA8SxgkN\ncT5k\r\n=BZvz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"04d360aa29799995abe3f49a29e7507052a7f587","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.72","@balena/jellyfish-environment":"^2.2.18","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.75-renovate-non-major-04d360aa29799995abe3f49a29e7507052a7f587_1599359769901_0.16188209194382552","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.75":{"name":"@balena/jellyfish-metrics","version":"0.0.75","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.75","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6c79706fa6f084576a7d188e8ba52fbeee9c23e7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.75.tgz","fileCount":16,"integrity":"sha512-TXiODoV1F0CkO6k0qMWHmoTxNmCnHPPV9SMolZOzcXODGd7qghO5AA+5PcjfvnqgUURefkDVEzuR+bWnRsmslA==","signatures":[{"sig":"MEQCIDGNXfGAPbOPHZP+1kzjmNhiLCyC1ymyipIwZHo9ryLnAiBj8qkFuTke1yd14Z6+WbFTvWV+0JBV8B5Rj+idNVz6hA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80895,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVEvBCRA9TVsSAnZWagAAzfUP/jtbE3H5g9VGmEDUMwIk\njLZd8Cy/8vexxlNvUfIcC1Tw7vpINPBk7buUd2c/4MdI3pKfHlfIBDdPP4Yi\nKduSzCOcEuKGe9x/wAprZXTPROes1egrYqvVia950zZjSQvyDvEke8kMieGk\no6ld66X4qiOyE+K0CGqrKil/v1NJUrpg6mDssMPLkxgo7GR7aXhi6KBE9D5s\nR33+9tYWLoUDUlmPFbD4/xBvjAtGD5jRkAOauiNENrmOrIPdsmX3WaBhCxZp\nh21wqpxwbzvPUgz7Q8HfrOQzfoSrl2hdLOHvXrSpm9YIT+K1UFx5Y0wlzV2r\nqWCUjzkgukyIPeInNhtOOvnYzET2AAYeR8ylvkdCShq4KR3GxmIl+7vszSKl\napGZU2OswlFOk43ojnQnUbcrA2Cm9Nc9T1AHvwWVlm5a8Ujk+fst9IBsJpkQ\nRk6mL8by6mc9r6czAcUDYa0IzHecSEjPgUB/0MdGJ9J2/f+Au1aka5kBIf+S\npAdEOd+Rn//pnMEK3fRB2vnHqJMHN4nEH/yjuLANim/f6IjqEtJjhRTTz/o4\nlrLkHTrzmL7L676hKa+yh5JyXmM9t4c2HfkY6gcLOoNXZtC3rBhoY1z8a0a0\nyDZ66N8V7yWIVLAulmdxL/YE46cbJaoaniGEW7nVga8qD5LPCaebsPZMBVew\nDjxT\r\n=5KpX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"ec4cc2da3bba8a0d3bddd0f43c48ed51b048f8d8","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.72","@balena/jellyfish-environment":"^2.2.18","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.75_1599359936889_0.03439291930418231","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.76-add-default-files-82d940bd25b0f7e26e9634a62f5d28905d9534f3":{"name":"@balena/jellyfish-metrics","version":"0.0.76-add-default-files-82d940bd25b0f7e26e9634a62f5d28905d9534f3","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.76-add-default-files-82d940bd25b0f7e26e9634a62f5d28905d9534f3","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"17495cbc31472fbbaa2f72be1d11d344da69ff8e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.76-add-default-files-82d940bd25b0f7e26e9634a62f5d28905d9534f3.tgz","fileCount":16,"integrity":"sha512-je52/rfogTD2p+QzZnbqJgi1b3W3bWVUf59uCQzibmcGU8NvP+/e4YrQy2Bb8e+jD5ysfEhJX6pEBygs1eDxlw==","signatures":[{"sig":"MEQCIBYsTL2inh/aIExKvJB9izPhcwSopK6KvPeNkdzdtPzbAiALcOatSKj6S+aeGZtOE7UTW3CH3LZu7B/rsLhk0So5qw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81072,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVI4qCRA9TVsSAnZWagAAQqsP/2N0qn4Hg1lNq74UjQZq\nih4ET9BejHyYASpTq3fjyNDad4pnQrzyn566czsu3DGVTiixSzykcVk0GtVA\nuv7qgAtJZNX/H8F82096tXkx8m/BkmZw8pOSme7wxe0P3jZxpUfNJvxR5yPx\nBVDG7QeghWhYJK/DU0cREqUBEEe1tHS6K9bgJj53ERkWy7NIRyf3ppfjssyd\nK7/Jy6+6yBbTS3xS1+zBMergUuaGpQb5FOMzwm5YpsHdnQ/7ruegOLw+cR8a\nv1xcQ723HtaMNT0r0ezaIvltQBVh6Y6kzesaN7EgRLDg/gStCYDCHTdxHV10\ngTMTojedEJBiroRNoL1UWK6TajGpTbNUuYPFr95i07sCuM3238QJef8V6WcJ\nhWNOD7SHhMmechWExbc9EpntZpUfThBhBJhFrwxbCeL7r2ALKwfvm3P1NBcj\n/+rKIq6tlwdlHjYVFpHA37XoBhQxVY0jKmFSFQAAR1Yr6kOTXoieHGj3uO2B\n+BMB0oJqmpiR7NLxpjLumh8AqaCj2ba+3O2/bklfj5rIl/cRWIMGWz7phLEr\n7HZa96aVUvq9hHgt4ZKhpfNL8txcaHg4788hqrElDISjevhkoMI0A4wCybp7\neAgT5TweT8QaKh6H4KV+jQ2jZlJ+DrrpcA39JaASdQcALhGGV4ObrPMPPA9U\nGUPq\r\n=3n4j\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"82d940bd25b0f7e26e9634a62f5d28905d9534f3","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.72","@balena/jellyfish-environment":"^2.2.18","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.76-add-default-files-82d940bd25b0f7e26e9634a62f5d28905d9534f3_1599376937556_0.11887505285945354","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.76":{"name":"@balena/jellyfish-metrics","version":"0.0.76","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.76","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0c4ca9cb5bb5eda5096d0c1bb9be3b8ca9c4ada6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.76.tgz","fileCount":16,"integrity":"sha512-owcif58VgAznOpBDDAoKaIWufAIsmppbVpTALKgg5ndD0glyOqk3pKiZvFODrUT4ADjgj/wPSGaNF2TgxgHBTw==","signatures":[{"sig":"MEYCIQCclKuIHJZ33Ub0P5SOK4ls0w5UYec7H8GxwzDdIlnKewIhAOFaUoJIAljhDq6t64Y9Dr2gjEhRNklCntgcHZTwZ1tP","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81013,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVI8sCRA9TVsSAnZWagAA7pYP/3HiHxUvAkMiUv3CNjgB\nKSSN7Pq6e6SMpZ+uw2fDd1SSP0aOP2leiFJCz6UH2MvneIjjNlyVugrjtNnK\n/EvlBYwNemBMH9xnvxDC04ivSKmRyHEUPfFc1+gAYKb9XAqPpARbVIdxrOPn\n+tvp0ScMmiHpb84OQ2QTxHz1/pKH4645QiTA2jF92WqHt+lYmB4kYWkbpqT9\nCA6gRAA88SXTsxo+78GkIgKoNSPimZL0Muz4oxwW+9cP3ZpCXel7j2CkVnwo\ncTEfWBphYWAtKxZAJApkBgSoPPBkNCBIzqFY6+RwP77ehBY1hCLNFdg61NFQ\nSfYf9/HoQq8rV3F9fgVEccjaRIBtZm1QHrMFNMo1m00WErwFODeCD+8sf7Md\na7W5iUBB/TOswLvqHBfmRSuvPFRqH6eGJDc7hsb5CJvvGa584pRaLEySAZZu\n0BHP9n3PSNE6YuWnDZSZ6xUWJ58enb4jdRFldnWNKcc5IevDxkHh9S1gOjA4\n4F4TpXsHhqZ03N+Iyq/pTJ+deVHg2nqvWtys9zygERljbO3xv9Ogd2yYH8fA\n/Ak1lFTvqHt3BvivR0BeHVPZLVB8B/2fnUjZti1dNzAv73DZ033ETk+N0Bao\nwKVKFnL5GiELqyUhJU4C0DLbFmakCYyID9MhX4u/G8N3zWW5p1vUG4SUiYrc\nn7HF\r\n=Oxzw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"7de0c1d2cf9f2d6ca0389d158a5f1e1ec08ee962","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.72","@balena/jellyfish-environment":"^2.2.18","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.76_1599377195739_0.49303150945194596","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.77-renovate-non-major-9e933909164800b83101cd4361ad4099091e25e7":{"name":"@balena/jellyfish-metrics","version":"0.0.77-renovate-non-major-9e933909164800b83101cd4361ad4099091e25e7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.77-renovate-non-major-9e933909164800b83101cd4361ad4099091e25e7","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6197f515b699e6b7a6ff9079ee53c4ea0b26aaa3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.77-renovate-non-major-9e933909164800b83101cd4361ad4099091e25e7.tgz","fileCount":16,"integrity":"sha512-f0Nc+F8LXbctKq4jiDDyPbSkY2i6E5mcqmrOvoENe98xwjPoitIjy+MCzpz8Cr4w6H5uqMSt560gDcGuI93S4w==","signatures":[{"sig":"MEUCIFimCOa5O4S+1wA5kRh2w71TByCnPB16Y1NuKzMuWuxEAiEAkR3owZnM/zV5ErviU30tPVyeaOWY9YMi+aTV3I/a3mA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81142,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVJBXCRA9TVsSAnZWagAALj8P/iVVRs7mx8VXJycXGGKd\nrayhUAfzUuZ6fCZ3/F+5q16AV4hKUq95w4r/SnG7RHD4Kzucd4S4RhE2Czsx\n2oke++GIjamQzjtdw7UWqfJ+t1XjD+sLLYXsr6gmzJZxHgtEbTOo02gv3hWw\nzykImGOzpv1s1Wn19MWcEZ22HXhvxobbbtCbODbpttrmFdNlL4kKSLZ+APf6\ndgEC95BzY7k0VWzGk0Ad1L93aAhss6bjzAGy00o7GbON+E3BH6JY9QDdKJ3H\nNgC34+dbDKKUQy9ixjUYpxfwt5m15lWY8GJX4665ILTxLeJVpyDnN4P7lhZ3\n0nVC7xbPOVf3UACMEtkgsKvLuiFrMvle+N6vyeinsGt5zT6q2IGug2K6TbJZ\nJYE6unHRYSVcDJ77cOFOrt2ZUhzIq51OZ+Tcn/6zF1Z/MYNflGAEt0wbL9WE\nlNAOZwoeuUqyBKlxOlFeq9ADDIG+yAtnQkN5S/klya5ex8LIP+uL9h1RWm0p\nSpdb6LPWWrjj8ZbTlfTdQU5EIz73qqRYpY6c51N/4xmI8pz8vJdcRXj/E3eT\nXS57YMigRM1UCtXPqCg7+7m2wQ5RhaNbFG+7mNs7gRp+1hbAMDKR3qrZf6M5\n7wtiDwX/WKxyszC8AggBPLq8CGD2KP55D9o7MpBhXldNXACZcHXi5VFIWE9v\ntSyk\r\n=BIq8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"9e933909164800b83101cd4361ad4099091e25e7","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.73","@balena/jellyfish-environment":"^2.2.20","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.77-renovate-non-major-9e933909164800b83101cd4361ad4099091e25e7_1599377494663_0.8344160814972252","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.77":{"name":"@balena/jellyfish-metrics","version":"0.0.77","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.77","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9d5ec34fa986bcf0969a7fbdc968bf6ee558fd75","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.77.tgz","fileCount":16,"integrity":"sha512-AiXL+dkLSz0wRPwPI2f35/3qBH7qGr1omSQU1uv7Hnop1k9/WhCduv7xD21B/k4Z808WxC2vYB79S/mCqKqiWA==","signatures":[{"sig":"MEUCIDVy4uem53caAIXZAOr2/CT84vUcySHE2ILqIG1WqwgZAiEAr2qNj5XdeYLI7MQHIfPatY2R+OgIWA6+a5HLuehVFTw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVJE/CRA9TVsSAnZWagAAdUwP/0KIpzCYP9LlC6FQVrw9\n3JxravYCONPAou2GATfI2z6hRoCEMYzMfqI+k3doo0LH33GE6vK99/0Rno5/\nC41h+O+CzbUyHy9sh9fwlYEJGvCLLh2bC4rycMgaQt7CRU6EpDkwwr99XFeP\n7iHYv/vvWlQzIrK3mu3uX7B42bbd3S75BoG88ksN8oxEhSVhIdqrsALaqv/8\ndr+8egGfuVzOiZpfOKOjBZoTaNEfL/64RKKRzfkhk+TPT4ud2mjeN2ZXIRGu\nH61+iZ2DynKg3sR7b1x05xCdzWptpCA0+7RwwdrMak78GnuqG2MD0EUjePXq\nnfDG5nCrMbDKxCBMlCoYMPoDzrjeumy+c2Pm3j5ZhOoo+up65KTLe5KFLUar\nE3feawtt2pYTi+y52bVFFf7Ihe7K4LOPCN9GY76v1e0vqXfvKxVV4A2pPj9x\nslbeTOCaDgw6hdO5nJzWL9yjVd7jxpoy1CAzMCd7+bCNCaN9jM01utTtMb2K\nzdEoO6V4OnE8w3FFXIUPX9GL8Y9D+BOAxKz8X4yju55vH3vU8p/d+hYDcuLb\nXF0F7Dy5R+Iu5428fTDjciCX8cci+/1XCK9sHbwrstglOhR8ZDCwTPNsJ7so\nha7TfxvaoXQXKdX7IkHRDbGSXLErbrXEJDSbj7Wv6QogzdLyDkbAAU4NVo+4\n1P75\r\n=iNsO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"aeebcf690e97a8f8b28db195e1ffcf7c5c7481ef","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.73","@balena/jellyfish-environment":"^2.2.20","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.77_1599377726902_0.2810471022879448","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.78-renovate-non-major-ce82760a378ee4133fe38d9271c65e9ad963db54":{"name":"@balena/jellyfish-metrics","version":"0.0.78-renovate-non-major-ce82760a378ee4133fe38d9271c65e9ad963db54","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.78-renovate-non-major-ce82760a378ee4133fe38d9271c65e9ad963db54","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f274b381c9efd32fe40a136a3407c70d015b76ca","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.78-renovate-non-major-ce82760a378ee4133fe38d9271c65e9ad963db54.tgz","fileCount":16,"integrity":"sha512-DP80PuGmjqPMujzAQQywnajij626DehLiU1JYhBBTeU0vmQPNKHjAyGdwzF7Xjh6BC0utuH38v39qav/opJEkg==","signatures":[{"sig":"MEUCIC2i23SdAH2O6vGGqBJovdLvNtsKsrQgxut6s4xV03tVAiEAwMHj6pbK0QV5HO1qO2cM/4WtdB1FSq1PcdWw3C2Pkuc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81248,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVJXJCRA9TVsSAnZWagAAnUwQAJpnwSJ9D8Lour9B9vKV\n1P+CeE2PxIkQLbG6zgpVD3a3RXZBatf0v8oJZ61gwv6+Vnzlg5S4hXPpfEcx\nagNNvCbQXlwGgkPlRfJLsiDWT/Wny7X0mjbTe4lymHlPKvKabwrHpyV+a0yh\nn+wBb3don0a9D0puJKSfO2zUfkQzduTbr/MNPXseb2f8S7YiGyhHZ53lGtub\nmCNzKDq/irAaXCbWsSA2arC020g58zkl830LrGfAP2jV7QmoVYfk9SOMv7nF\n1+XfEf9tSQ73UwOKvShdGDESABqNDbmoS5a6YHjhG3PCIoBPdw0ENBbkch2L\nAtrbygyg3dzohVEbGGWtydtz08UkuSGXe/T3pycJe+DwkBUsqNY7vImsstu0\n8/5Ezb0xBnePQYyuXXaKfhBfAO8eTNWOzHI+6T5+e7BSgUteWl7F95sQdUiq\nAS2b8/eBusJIaYo0zr6BWw00jRlyZ+Xu+Nwu0zTlQm11ciA2MAq7dpoTLQ5+\nVRKt9MIc1kSIJj1GKwO6s8QAnFjWODsOhPexwS16+KyCXrWMfhua6H+6KaxL\n/KG9ILGtRdXkLRM0MHdZrpybNF5bvrh1BQ8bCC2KbdK4vim+3az0HoC9LT4T\nj0ou6hVMGInUrO+mH2xL4Lb22y9spOG0vwC3znPoqy/bv8wKvgCjWvHS1/Uf\nB1V0\r\n=P1Op\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"ce82760a378ee4133fe38d9271c65e9ad963db54","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.74","@balena/jellyfish-environment":"^2.2.20","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.78-renovate-non-major-ce82760a378ee4133fe38d9271c65e9ad963db54_1599378889309_0.9904827311804318","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.78":{"name":"@balena/jellyfish-metrics","version":"0.0.78","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.78","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"28260ba93f7a507510e3a1eeedbe7b7e283a6dd5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.78.tgz","fileCount":16,"integrity":"sha512-xwebwoD9JBLHaqxvK4TcH8r3jKH0zYP9KoCGInAuR4FdQ5V8YDTBoZWdjY73goTFgYHOjUNrSt0P87EGfQWgMg==","signatures":[{"sig":"MEUCIQD+lu1i4Or+6QbupMXYL6ztpJ0LjpE+eyK7vlN0A9H/dwIgXdxIdR4hpCthfElElevGhTFZDg3TzuWKgSLDtB/nup8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVJZ3CRA9TVsSAnZWagAAPH0P/ibOPAXevIvaLrM5nmxB\ntrxTSrclq5vGLov4THPC1OzJn6GXLBRr/kZsmjFgTl12Aw/y4C9cUUR03xPh\nnz79KXXV7Jrq0yBxpmtJYRJLW5zHjWZFsYY55gr8TgN3RG0X57YCxCo2KHDJ\nMP4oVhDtcLiVA/l8JWVv2DKPerHTDeAY33Ct/AGIdMKfywQkswg9A6Tp5J9j\nxB431J7/o7fRjYHXpUXUYMJ0bCQJMvnoyrlvSPm6Gke4YcXiZTNAJSCEXHRO\nBaq2+S/T0abhXosKlYy/8IgP6EeUYU0Jc2KM2L1pSR5/vJkcp8zzm3wqkkUN\nylkSYb0uSWJLAozZehEiv44YiER4DqdffizEwOXG4bKT5skZ2iEfA4ngtmPG\nyrRwnYnSwfRuuCnb4slZMum4Bs85BWXNWgL+us/nn1cI1+hRd3KM6X0sUOvP\nnN8SUq5SL0FKx/ZK3AezfcFGoqK+5G8ODMYN6c7SCscMP58jk+IcZ1WI4ybD\nL01ET2Q4T4fg5uXt9ZrjjxwKx1PVVuJxskQRHnBlM6wyXNF3IsIIsJtCj0BV\nwTf1sB93E9h1/CrN1bXHIVna4zWUBj6Ys6qZHMrW+oKFYO2jVFUHCZgUO3rW\npkCSvHXUW+ldLvK+nK/6hQEKi5X2KRatt/m44wHYq7hTi72UWd4uPCwEz0aN\nbuTu\r\n=LuMW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"414049dbe1182eb9e663ea974f7c5f7e204d67a9","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.74","@balena/jellyfish-environment":"^2.2.20","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.78_1599379063270_0.2999411454521099","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.79-remove-node10-tests-3c69ffb62cccff0a919678c503f7ba3fc8e81292":{"name":"@balena/jellyfish-metrics","version":"0.0.79-remove-node10-tests-3c69ffb62cccff0a919678c503f7ba3fc8e81292","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.79-remove-node10-tests-3c69ffb62cccff0a919678c503f7ba3fc8e81292","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0955d161da369cf4d8b7155ce78964652b143f96","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.79-remove-node10-tests-3c69ffb62cccff0a919678c503f7ba3fc8e81292.tgz","fileCount":16,"integrity":"sha512-k6S3kH5nep8rO0k+aUvgk+hZbi2PSGAyJz5aXoDim2jW4XQ29XIOTbI/9ko9rg2Kryu8Nn9bXgtsGLWMso7ufw==","signatures":[{"sig":"MEUCIQDScRH1N/FmLn+Oe1a/UWjz62K9gOT/UVd1TkUpTM3pJwIgU9gki9tiVskvqinfBrnw9qNAsK0ef8QWK+7D8bCU3ho=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81325,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVLRCCRA9TVsSAnZWagAAWTcQAI4E5P/S6tiYkFx2fvur\n2TdYVrmLduhhUXTAzUbKRgZjEDPIPK89Zs6o2Sab9GYmzCp7bOD6Khk3MOuU\n7/2qNsFnMgOBzpJxmPNPXgkcAJAEZKpVt5Z7TB1WeHj7MUQ33vARXzFS0u1k\n9tB8US9dxBkfSUOO79IjwrkuUD44eaWYHgFE7kGXih9a6RwoBgnrA9fZ112s\nqlQpsYb908Shft3o+PHuS3rASuLhYm0EcG5SwzP3lKEpF8hVavLFiUv4Eshz\n/F37E6+K1fdlSkLgKk/TIxnMUHrAdo3l4lCA4AavxTRekJ+TWxV7B97158zt\nsAnnA36eF+CyzdhNIqV0NXmvlvXss/RvQRAiwO0iD4lCaRpv+Fh7qMj/SBj5\nmLArzvaavZUMBFDg/dQS6iQlPSxMdNqUGNjPjADE7rbjyQ0kSotOjwpuIf8z\nm8xg9aLaioL5sDEq1epWv+7r84UONp6Hf3g9FQfecRyFzpjELj1t2Ph85SW7\ncTXCWKa33zOcrtXGVxMTpzmJHAEVqIH7EbvwDDGgktuxj3BlY1q7ktFIS4Zv\nlFTpBxhOFzxaPgShrE8jCj1XT3CBfnfvRIna4ZiLHzQUN3HHHOnK+IrxCvsS\nEjXTjxVXIDnU6QhJox+wssFw/kNm91LVSjefhzNGyTXz6dzDHbxgdoC9aCfu\nvpn3\r\n=BGzG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"3c69ffb62cccff0a919678c503f7ba3fc8e81292","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.74","@balena/jellyfish-environment":"^2.2.20","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.79-remove-node10-tests-3c69ffb62cccff0a919678c503f7ba3fc8e81292_1599386689851_0.03249578695746291","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.79":{"name":"@balena/jellyfish-metrics","version":"0.0.79","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.79","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1e3ccf88ffc2968e063b7a6125478142603b2cc5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.79.tgz","fileCount":16,"integrity":"sha512-R/JHwFO8w9liGcYuBYf9dk7b4NLy/lxsrL4B57M7jx6S9kwl4+NQoPRt6F7pHVJxOZ0HrXfDwyMTcPbisScK3w==","signatures":[{"sig":"MEYCIQCAU+w88YPup7lkWGVOOzOY85pyoYNXMErYRc9KyyC9hQIhAPBem3OQoT2zNyfCZOIf+9B9AnYSQWdrV/cdI69q0hqr","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81264,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVLXACRA9TVsSAnZWagAA6vEQAJruBvxBxDKIkgSA9qSw\nXeU+ryYriuAl/HcbLeUPWOncOb8p7oA42zQhjG4iq81pPidIKelWrizkK2jV\nG8KcdRaIOA2Vx8chFIgSNQAYkePTrsA//CyA9ywO7K6RQmNhqMRJHKqjdZP6\nTS9tOL7x5hevYFsBeELWgBk3Joy8aVhFJBOXBK3zCbGd4ib/ssOJuHguQVHn\nNdhF8WzCtrNlmowEG02ngGTJ+esQ+AUSizWCXsYrWTgC2D3hGEzdxN9A4C2x\nVwXc5hdAKo7WWzvxgNxGl+PG4cP32+oXjr2z/4I58l4iIy8dNtBVDbXwHofx\nriCnImJ0K60WMgqPa+VRqqAmpwNlz05+1UZNtZ2A93BK0Vmwt4Y3CFxKzeYq\nVbOQxvnYJtJRanKUT7vz8rjpFuyfW0Rwsc+cMrKO0jviGWjwdl1jr3JjerHy\nNsD7Q73WEUbWSb/4Q5m/4IAO4ihEoAybugRjF3MZmzgqHy94wGbrw6ALO6mh\n65uY28gcht5CWENG0hRv+OwI8DXfOX9u6Nt6Hg+w0Xn6qtjg72pPc0+QTJ29\nHMk0USMIQxlMVzhCOUxEInRj3kdv7nHQDjfP+X24AmI0lkNynpV/IhBG2QG9\nGTdqxxIOB/cwqt4aSlpQfRatQ4OMNfK+tVdhA3Ay5ScEUIucGUozMncBYagU\nQCdJ\r\n=F/bn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"ee77cb390568ded1944d34244acf8093c903b9bc","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.74","@balena/jellyfish-environment":"^2.2.20","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.79_1599387071829_0.5037368080225197","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.80-renovate-non-major-495ce2d6e8b3f8a5537918adc8ed2c8da6bcf9a7":{"name":"@balena/jellyfish-metrics","version":"0.0.80-renovate-non-major-495ce2d6e8b3f8a5537918adc8ed2c8da6bcf9a7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.80-renovate-non-major-495ce2d6e8b3f8a5537918adc8ed2c8da6bcf9a7","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"720f538f50efe5b19b6b8933dd2e68a945968aac","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.80-renovate-non-major-495ce2d6e8b3f8a5537918adc8ed2c8da6bcf9a7.tgz","fileCount":16,"integrity":"sha512-9d2Sky+kQP3Uc2DjWpIDqCquFYuf02L8t4SYiS/99rZWtUAyTVlO9gFhr56omiF/lsopUcgww9SmDoPoFjPSBg==","signatures":[{"sig":"MEUCIEOZ7cKcU/2YFTgI8aC6uBDFhahfJVr9ycwCYXB2RHdCAiEAvx7vKHZqs4l+NOofPXO+KCGLZwJramavYh07PfqVe7o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81393,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVM2SCRA9TVsSAnZWagAAYz4P/3oQWJBqQzkfMkAAESpi\ncjw9FyGV9EjCAfA+KFs5CRdkqttXXn6SOMRYmrr6qbROMr73yaJhz7VaWKc0\na+k4wk+PwRcxeCRofyvN3ftkHxCNeS9r7odzZYylsRh2vinzQ8m01A44Vf8E\nesS+H1sEKHB/h6WEEV7MPTUPCxN+8Y+IScgr1xzr1rp2BFNclD7bmXMiMe+u\nwZ2dBR2vRPE0FRd/1urxGTcEY1KGLo4dEYvBF2Ovx0Go1epwIyJfwTzPRQky\nprji/XVGTRT9qijzmBubvgUxFHnvWtUrvhsCqdZ0Drvdjw5ZIA4p3gIPezR5\nK3YTD3OC9kcCjKhLxu5SedyF4WQBT0cPdg5N9lel68U5ARfY0I6xC6zLgGMl\nHHnMAzIEa8JM6KJdV9yUQL/WmhNDAjMPkuoNXN8MOfrjEebIGvGLI0Q2D3Fg\nl7o/7pT4SnUSxuJFHbdF4kiHIwoV3LziC4zYD+1ULl69PftvhLxVus6JNOVQ\nmBj7/Mw4uNMm9CVp31BydD43jV98qXyvmdkLsBF1cv9I1OuTMNj02oS0CZXV\nm0LVC8WGi5LmQIk6Ix09IlTKSy2sdgF1nE37zbw/K7oeZ+YwyP+nx0UmaEgh\nqQxo7Y263Nsogi8TCSV5XjDKeH4sj9HvohQTTOIdvGkQA3iXIDb/6e+oVkzw\nhhDJ\r\n=9mvd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"495ce2d6e8b3f8a5537918adc8ed2c8da6bcf9a7","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.76","@balena/jellyfish-environment":"^2.2.21","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.80-renovate-non-major-495ce2d6e8b3f8a5537918adc8ed2c8da6bcf9a7_1599393169590_0.19894914944995712","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.80":{"name":"@balena/jellyfish-metrics","version":"0.0.80","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.80","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b1a291ac366edd14141de600a075b7de7b969bc8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.80.tgz","fileCount":16,"integrity":"sha512-4xNSRQOrvc4UkJz9NTXnFOOocbgDltGniqDU976pD+oc84jmnUueqj4TH64ggDVr3o6uC/zazB82GzQgQWu4Sg==","signatures":[{"sig":"MEUCIG04jLNMam4vsNSQa3Y0sVyuQlciUv9zEYhD7lNuYDL0AiEAi/O6WEk5ht+XQ+uJJUOIkK9Lcip4nxAdVk9wD8Kju4g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81333,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVM5HCRA9TVsSAnZWagAAChgQAJPh+C/ZBq4qWgaowr0u\nEiOCjPDj07leyB0xgsoOu797caWXqJ63NT4HFBW2w7efK4ZExEwobpfG5DDu\ncDurWWYyx9ruNoX6ciynvAy0u6OnySSEfSR+onIbPfLX00S7MthQ3DuUaaUX\nEza87JBDPy/8GzwRK4FBxWPEe3mDfe2tz9kCUBZzV9cJNFYDM2P6+7D3p1RI\n9YPz0f8X4LKpaT+r+5c0e7LFCgW/rEOakEJI4rHzmcnQyZnVstZ5RJbMi/dv\npsFa0YZHKbLP54oeHPaTTaOkxKe3vIWlLb5y+GjdmMq+jztc0R+ExWQqZtb7\n4yyQ23y3ieOUgejnIb2vbZ+uYXE7MZ5lv1/jut8CzPLeigYmpbQVDodF8sCd\n+bETLqP5Zs8SDuqsSFuTfbirUmdiaX5n9Y4K4yz7Z+/jj6wpfKZ0QfEEJqq0\nQEAFwOn1fmd0pR2/ubpx/PqpcgvphTCVQzoTdclqGsPgC5JQYYSeKzNmMZOK\nlXnI1yUQi1MOqzRboV1vS8aZWWqznShugMoL0gNtOpaWv7DZRQwVc5bXeX6c\nZnEfgA3iArup97naFZAl8Gnlbj6zP4v0dRtOavumF+B0xrGZ5ITevEufWbpC\nfCS9dG+2hhWjdoviG79K5c+sw8D+yyIqSO3v6bFOosB0HVHVmVk4J0joWBnf\nA/pJ\r\n=5sp9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"bd5bcd09d8dc097e3c9191dcf8d1226a3a3e9407","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.76","@balena/jellyfish-environment":"^2.2.21","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.2.5","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.80_1599393351179_0.2822824619777886","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.81-renovate-non-major-13118888420361624e61bea39d3ff60800caf7af":{"name":"@balena/jellyfish-metrics","version":"0.0.81-renovate-non-major-13118888420361624e61bea39d3ff60800caf7af","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.81-renovate-non-major-13118888420361624e61bea39d3ff60800caf7af","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"109cbf5e8e87f72f1b970c1205864fd4bab7b58d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.81-renovate-non-major-13118888420361624e61bea39d3ff60800caf7af.tgz","fileCount":16,"integrity":"sha512-YzSc4wwKOyB3GZzcEtdvUDM2CS3zWZ1rQ/zmPgoUeAiYy7rg2Ynmx5HEP06akISsc2zp0CpDtZALrfxAzt/F6Q==","signatures":[{"sig":"MEUCIQDGQ33IsgZUeGWsPtspKll9cErhMmtK9uC5ao41JrCPpgIgPFDzO5n/VJUFKvVWF9HVHj4nGRORXEfpzywmrg5MUaw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81479,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVghJCRA9TVsSAnZWagAAdi0P/0fjzrZCcNs9eOl7luna\n/PMRpByC17NjEpuJ69J+4O/jBTnLWWrhYOqCnbtT0GavhfdAUS6s8jsbt3vM\nJe1zxSwGARBj11RmF/zEdh35ODtP6iMY+Its24ZdG7YL8GPAc6yDr5OVr4YA\nBjlf+CL+teRrJtb6y5XSwXQnJsZzKyqg6k/beWMqbywYF2i+7/ZEXcbU73QP\noncYZKxs26XVowdn67koEZqMaqCwu+NeG3Jw870lgKGl1TkCWkTySq8acnOv\nVj9L8NAHY02t+ePEWLBKsYu3bP5D5xIyp0NArs15nU443OVaGIEHD4ba/SPG\no3Vad8CcAHXPhLXG2PjbnUZTeAFoRNKBNrVWu7VW/8xHdoit2DRQQbktqxIa\nYueilIHNT+lDShBigfIksHRhOnvdgNWoB+dUdCqAhCulgGpIJ0rartkQvyo1\nf2U1Z8SBPMPOSxDh710HZWmjat7voDfN7z6lSABZ0c8bJ3euLp9OxoOv2Kfx\na5cZnbEJaQdec7XVsQpAAod+lyKOu9Z3Nka0oU/gORNJuBX2QcBAZd4GAubs\nclVVoiJPLvYp2cKnKVBSQlLE3Ln997Jk8hKa0x0L2PxkYwEzaOdl6jDD9aiC\nqZF6D6kxsUrfryF73A9Ooc1U84yz17XB7pQa81qgY0jB41uJjtSJ5TsQ39J6\nRVPn\r\n=tcot\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"13118888420361624e61bea39d3ff60800caf7af","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.76","@balena/jellyfish-environment":"^2.2.21","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.81-renovate-non-major-13118888420361624e61bea39d3ff60800caf7af_1599473737157_0.007324711954971752","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.81":{"name":"@balena/jellyfish-metrics","version":"0.0.81","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.81","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8c14f6eacb00a593e06e51c71a15c447af009199","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.81.tgz","fileCount":16,"integrity":"sha512-aYM77u7P63BuFSHaxR8Y+yEY5hNRnlxl5FZQbk4FJeXHSMu60FVpYanBSOkOiUbWdMcOkaZW8Ygrk1egnvgJMw==","signatures":[{"sig":"MEUCIE/2VBsLl9hg/z8ZYvy20VLEhv/Teg+NHPzPH5D8NZzqAiEAsVkEkpjgUIYJjSATAQNlKmWVbl4QDDhowA3sLubZkCw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81419,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVgjzCRA9TVsSAnZWagAAWmAP/jTjrOixQjAePZXon0nC\n435dacSCGVlfJTljbrsJA3nF6s2TOiimtqOkZQF3uRztdO4k1UgdgTyCJfZ5\nxVPLYqfeqhqenkqXWfMXAnmfbMEadJ67nJwjthcdnVNWBu6sHXlod3i+q0BP\nXn37VdNdXu/NWv3bOhCNSKc0otKfdHdAW7b1e4NgKCTbUzSQBBsjow9DOqYE\nswp/sixsEGeB85Ffbaudqq/8m9RuMx6yj2Tc/vOG5iPi/ha96azKnwFGD0iD\nTmOSPlvQ4Q8NmYR8MJ+CVxvBU07Cx1DZ0sxNnQdo0tjcpbDuItZe9atct/+y\nFm7ThYiJdFNRHKYlaXbJPptAru6R8UpxggPvMtIx8Ni3h3MqMpMzUPz1WH11\nu+RaaheaAskP8nrYrIeJsHyNp/2e7yUzk/rcoFdDD9M3EerwQUvfFvJ7GJls\nnEiuvReG0YXnW9fb8EGR99HuBMmpeoY/WzD/F0K9lOARQ7MrHpWz/aAIcSSA\nxlJTPCPlBbTyzHpT+EvSzNGcQ8MaIav9bkTQph96IKLGr7fL7XsyHbVQWCMH\nmSzwkW2JHa4xMtttEJ3fYu8qQmW2QO/xgi0f3NVlcGcm9T9pxo3lut+D43Si\nXSMbncQAVbupw14mOxG++dJjMr60vHos6lP/IS2sVfLRb5kGJorcY33NB6+m\nZI+b\r\n=ba2o\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"d001414404a93b43f5c01c28b8a6720f1de7fe91","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.76","@balena/jellyfish-environment":"^2.2.21","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.81_1599473907250_0.5790103172521512","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.82-renovate-non-major-2f643a454f8f545377c04ca62ed7995b0af6464d":{"name":"@balena/jellyfish-metrics","version":"0.0.82-renovate-non-major-2f643a454f8f545377c04ca62ed7995b0af6464d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.82-renovate-non-major-2f643a454f8f545377c04ca62ed7995b0af6464d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f48d80f4ff077a8d68b49a1872fb3f2fb2d941fb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.82-renovate-non-major-2f643a454f8f545377c04ca62ed7995b0af6464d.tgz","fileCount":16,"integrity":"sha512-ikK9pIOIvUaymYuhuWKqLSmiWkBL9zt21jh8p0iVqrI/bfobIWodJpD5Ov7L7aUBNgX5vZ877RYdzG7w0bAgeA==","signatures":[{"sig":"MEUCIGWEd82X73/EQEicpUfKPAX7ISmmslbdsZf0zKqzFLbLAiEA4m8ME4uS9p6+B2Py5dAT57174JN3hGiwbLE4IT6Qwcg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81580,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVh17CRA9TVsSAnZWagAA8LAQAI15/BpYTRMFMgMHlchT\nI0H4vc+e2OR7xrAlKbhBWZjW6uhGLtvU+Lsb9d4nAmMaXCcMHCU7v8sAXqzg\n/aHK02e4AxaPJ0PRlyv4F/N/X1FteFJ3dMHcIKCTeG8sV4KxXuc8KQTrqpYR\nUwRMCR/LdymW8ErxLO1dSmkpGD6/N9XPfrxpmGuQEfKyabRFr+3KSanVerPn\nLi0sXKvPYwEkwDIBIw0QNJsAEShxDaKq6mOqCFNzyVeWo9SLaMsIyDno7FvY\nBBeCfT6EtImoc2LyAC4qHX9qsXhiYVyipyWegZHaN3o/zKMZ2plhygtKFMy/\n3r8pKHFgiKd+9J6sfJt8Db6eUZAA6TNfFleU9UvtKr1ogVcWb7fZ102P3BCD\nsumyw3gzIkR6103K+moH0xSqrYGD3tR7mWypwW9ZF7sS9VIkbDO2Ok/kZme6\n82VCEUnkaV0NXS4vgIBmJRSj5YHSaYB2H+l/pi+UkdMYchD92GWRKuSTwYZl\n9WG3OwBWe8hP9LeRhZIH/w8dNcMcPVaQpOW68AelE27fo91lh9AlLiSxP1G7\np2V6PSlxU3x8aH4ul+hIMhRc4F0L6Q4eEuorRgn3letuDJLy5Ki3XlySqpJB\n/8C8qtFub+8u6yKbvJLMxEF3t3zvE4De8lCYDtWDy0GZqaTzdcnJRQcq3YFy\nT1PK\r\n=yqMP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"2f643a454f8f545377c04ca62ed7995b0af6464d","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.76","@balena/jellyfish-environment":"^2.2.21","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.3","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.82-renovate-non-major-2f643a454f8f545377c04ca62ed7995b0af6464d_1599479162390_0.8278407538653294","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.82":{"name":"@balena/jellyfish-metrics","version":"0.0.82","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.82","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"petrosagg","email":"petrosagg@gmail.com"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"73b7cecb3e3cbce2ce95912853b3c2d8ea338ff6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.82.tgz","fileCount":16,"integrity":"sha512-6RVk/Vt9SKIlQNNGzKEjyn2OrDmMVZWJvKFPDv/HIIQokyogjk+AxaaCIfYYk1S5K2vsZ45IYM+ozZ+07n8LRA==","signatures":[{"sig":"MEQCIGvwNQ7bpbZP5DhPt5FH7ncxAfaGtz6zuYizUd83XBfOAiBKcwXKdcwRxY0jYb6uFugyFpySOt5fuYtnamLvf9ttnw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81520,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVh62CRA9TVsSAnZWagAAMgQP/2tfnTSXfJ1lgfus0yY0\npfvkMjep6k/9HCFSxKHommqyY5FywhvAXh24EcjlB1zmpe6VKDG3twYZVMnk\nQgDnTC07Y8k5JYdkQY5xmBIjXjQe6jZSgk0qnVf31FRaujbL+Mp8sulG+k1i\nU4Ikn6MGzfCnVeL7ssMkI+SsIMeWMNBJ5oAyAQC0nFB9f04+64h/4chUVLEI\nEmfsJTaPBuevquJdcRVBJwsX53KppZ6e++WQ+Opg8uaIRzBqxvKfmwHo8WeU\nxgQPogcPBWA51k7rAQuuIcu0JFtx9OETP5TkiUYDuV/p1tIexx6HY2CxPnHI\nPhml6oneRbef0+RiD8BK+46+k2YiulhoayISoCe9N6fy4Xmhip3JeqTlz68y\nZ1lgNmruh9Jtd2sCjMW5wsqSxGQLTLvy8tJpew+6lvJ91Eco2yhvkcfpQryu\n4fbiTdqHKTgUcrH22l8XpSyRCxymVv5G/irXkitU63bfIyDUGHc5YmLmO0MS\nOv6VE9I0eqnkdkG160UUEA0u/t72SI2anv1Pd2yeBuryF5gVkB7mMARe3bWg\noHCaGIxPWLaaDf5ulzYVLD9vZ/Vepo9/Xg5QRMTUn+uXtkTShOv4UGJVIEyk\nDPiftzCSOykSWKpM3QQoie+Hp6GCx7fQmXYUEl5iARQ3fu5m4NayEaFPSFGm\ncgnW\r\n=W3QU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"b5ce9e1ffdbbb1a22c5bddc491a9ecf2277c5329","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.76","@balena/jellyfish-environment":"^2.2.21","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.3","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.82_1599479477690_0.34698459578470686","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.83-renovate-non-major-74988219aad747f1bd6c966d78087384c7f9a8b9":{"name":"@balena/jellyfish-metrics","version":"0.0.83-renovate-non-major-74988219aad747f1bd6c966d78087384c7f9a8b9","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.83-renovate-non-major-74988219aad747f1bd6c966d78087384c7f9a8b9","maintainers":[{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"41e71240947e385a3113db972ef0064d6cc65822","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.83-renovate-non-major-74988219aad747f1bd6c966d78087384c7f9a8b9.tgz","fileCount":16,"integrity":"sha512-oZYH5ggEK2JqZ2br+O89jYZSWJm9MzSqabDO9M9MdE2/VvhB36uTgdIUb5qSfEI72uFgLKdZA3iOkBn9ovX4tw==","signatures":[{"sig":"MEUCIQCLxW2FMc6NR/6sZzW2txk8UbipQ46rsNoMTLljU2UxNgIgP2P3H0uxj55d6+rykL3iSz4W8EtUhMHRLQCmRPqMpMc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81686,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfViihCRA9TVsSAnZWagAAIg4P/A2wUR7M06S5GR3s5QQ6\nqwiv6CPlRqRjWkiP3tc2mwFFZVRJnKYjoCecg8jp1EZlfUaKlJe4d1NghXDE\nORt9qdt7OmxZkqnke5Ut4Xs2tODGyhMcBE/Lhdsd0cusnR0OmHc5VXr52zCC\n2D1j6CPfPOZA02R0OdqvCrdg7iuugb9eVb/pfjWhYhF8DoYu4hR6bC9Vcf14\nTfvrt4g4YizrPUIZ58NozI2Sm9uGQTAXDw1VXJ30Dt7+i1Y7yLjEWYwLKHLq\n8R94dX1QDqpEEt8bFwgjKF1dCYyC/mbKuTtCPiI34O25Zx/3erMmT3U06NfW\nCKv1OaAEtEa8wXIAJ2bywUtf0twXWuLlgg4LaWnKmD9DuLHvjlVAAf+s0Ea6\nwpFbcMyna6MAELwgDjmLnS49Z+IJ0X2p7R/cx4WQa9ho9UQ7oywTlLRCIqtK\nN1MwVF4Iw151lez7hpja1IDjRhP2jG/j+fIgnJeOJ3FJR9UghJBUFJC90cX7\npPhQaIb/0M2mltYxv5Y/qsk0ZYKKwIZNlddRIfK+0dygoRk1RstQbVIn29I0\nkjl4mdRBOiSqbu8NXUyWBDGoePfHGiCde2yLwVcd4BkBk/pO2DGNnKkEgpmA\n7y7dnrieNOl6hSqqXHE02KA/StlM7Jofc6YjrSKez5aqzQtU9/C5Ht6Xp5az\ndiDu\r\n=J7Jt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"74988219aad747f1bd6c966d78087384c7f9a8b9","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.77","@balena/jellyfish-environment":"^2.2.21","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.3","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.83-renovate-non-major-74988219aad747f1bd6c966d78087384c7f9a8b9_1599482016532_0.25840619308486157","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.83":{"name":"@balena/jellyfish-metrics","version":"0.0.83","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.83","maintainers":[{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d4bc7a882809f87db5e657bb3dca99f746755d97","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.83.tgz","fileCount":16,"integrity":"sha512-ne83G1B5Yrld2JTBGiT7Re572txCzX6ZA7dZ8kryZz8QLseXEAi6Q4SnylTzl9fIcJoXquE7ETJsMByZZpErkQ==","signatures":[{"sig":"MEUCIQCXvFqtEyiqkSSqzeYZgBdaI7UJXITGr7x4xwSdJ/m1/QIgJljg5/guTks4RAeqyZQQPBW7/bloAWIJ9N5vSUcfbsk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81626,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVilLCRA9TVsSAnZWagAAkRIQAKI8+MGWLkugkthdb/B7\n6OZ64q8Yt/AZ03Yn3FVUt5GA0x1P7c4ak4xROIxE7dV5kzRap/dKtYjyLEnB\nms6sBrK3BGesw24cxkQnOIadfCXxA99gE3AI2Fw7I2LGr3EQXRkZjZR1dpra\nVals14veslY1JLQJWbZGMexNCxFxDJih0hfyl6OSxf+OqckRZRqW3zdz16FY\nnvJ+osk+1FImY9AD1D6V/mw6y/iY+WFA93BSmU/K+R+7QNQ+ynWxLtiJhEPc\nzmijaaygSXoNTosOxKt4C53KQU9ctkpTQ2l6ZJNcpmuF17KaZcOWuc3/PnBy\n2ZHoTT85kEfs9as+b6sktmOBj23gUCADipfYXkd3FMvc7yTuF984gDvnpjPH\ng/vS0zuzE7Bp4PSioi69TgUAmcpMqGQ3yk/uSXo70eXBOz17eY/YHfS8MlFm\n8KetpOEmw/oDNUvzYVSQPIlp8/v+ZNgw239jb/pOq2SsG5EAWNQu7tsXeH/h\nRFIgE+o2JbsMjVeuxRzF6hGFfjg2/oce6bQzUbwGmDD4NctqGptkmFic12fh\noa4PKwYWRENKOy5QdpZ+lFZriinpLVt7ZFMgnf9bkc54fVkFu7Funnz1R9P2\nTe+mPxH514n34s91UXrWpY+lNNLUBNvuXHPN1VfTuBov3c4WBRBSH9/dZD8M\nwMEo\r\n=nFP7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"c2f12aad5e505392f552b6c5e72abe64dcfa0150","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.77","@balena/jellyfish-environment":"^2.2.21","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.3.3","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.83_1599482186701_0.5873775222270496","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.84-renovate-non-major-1d2474091b3aef6647b0f39d8fbf75a2d531909f":{"name":"@balena/jellyfish-metrics","version":"0.0.84-renovate-non-major-1d2474091b3aef6647b0f39d8fbf75a2d531909f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.84-renovate-non-major-1d2474091b3aef6647b0f39d8fbf75a2d531909f","maintainers":[{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cc5b710e6b8683f676b51e5fc3d82ca50c6f3c92","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.84-renovate-non-major-1d2474091b3aef6647b0f39d8fbf75a2d531909f.tgz","fileCount":16,"integrity":"sha512-4MQMkPjTOEIqsU0afHumJmO6omB4sW8pzHjQ43P+yBd2hgJcoPVAPttkl7krVHz30wUrhPe+QQp2XKrrhdnTgA==","signatures":[{"sig":"MEQCIF3omsC34SQNsODFCn1OjG3Au9zihHqzGdM0pB9ViihNAiAlnCY7Xaojj6tvD3+nGjcSyOdThdVENOQKELjrksrAsw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81755,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWDWQCRA9TVsSAnZWagAAdNcQAI3eM+TSCvc8u70uXvdH\nrs4qvhlbv9590rOgqoYwgKM6kiF+4KnPLWZUHIpKQ0+ddgxoK2s3EvhABpS2\n0Wsm/yFdI1e4CgoZZ8n5vqGvNLgcvRvzwN756JnbOMP57b5NluY5yECPWX1L\n4ereg3RQ/ALGq57LhCfX5h++zgWiVekVz7Jl3Bt6vRId/+kJdmnw9zovfY5e\nSkx2Iyu2YLZxhHEhtyBXjwAcnhI5gav8hrQITUu2FemvTM3oEUnAPJaD1S/y\ntXgUU/+Xxe+RySjMfCp9qUsQlsF870cKUbwMfjJhUbja7hc+jHIoo1Dsve/b\nqC2lPwUmD68Rc7UDSfFGtL5I5zMvd3m4eaKc2jWk2BU0R5vN1WwXQYQ2xZ6j\nR8mmgb2Y40dHPeRRJLSuZy6wsQ6y7h2s55r2ysQEzqlmJ1eHdq4xHvvdcYmp\nvSL2h/sIm7x9O86/YNlwKxXLobCYv09YMMJUGgQKfgAyzBb2whnzq2OVIJiX\nmqNp2cfqjI7gUJjJV3Lkd4Tk8/Uh7LQxuQ4mf+ku++VrjMzZQUeDLodPYZNn\noOF978ZhAtld8WU23lN/rFmWmset8FLcuugO+Y91G94IXJEKG+gAJPgQ6U0c\nipYrvnEGESgXqAgLD/1dx8mwWtAwmxH/TgHYTMwvUo1x98FRiLqiw9laqigJ\nTBhP\r\n=uNPe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"1d2474091b3aef6647b0f39d8fbf75a2d531909f","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.78","@balena/jellyfish-environment":"^2.2.22","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.4.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.84-renovate-non-major-1d2474091b3aef6647b0f39d8fbf75a2d531909f_1599616399670_0.6449819010889244","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.84":{"name":"@balena/jellyfish-metrics","version":"0.0.84","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.84","maintainers":[{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ac18cfaa63f0c9876234a8240b922b5f0c034350","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.84.tgz","fileCount":16,"integrity":"sha512-FZZgjOzwMO4viMwwES3c1W4vt7uR3EGcmmDqhG15MsLtrDwnr+mEPIEe+rEKvqRkHqWbFIHTpSZJttC11Tkftw==","signatures":[{"sig":"MEYCIQC+OqYLSRG1q3kdLWOjn4J34RxPRltrwQf0ZCzDMfxmZwIhAM8F/Ml7xF/C+vQhBhdhpOLjmShnYT0tkzglBZJJcHFZ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81695,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWDYuCRA9TVsSAnZWagAAi+MQAIxTyEtOLxz9rHV71T00\n/W73wccaPs0btLWE2okSVv3niEyunCo/HES/CFDGvOF/69FkdG+16p45kwki\nCXXrGJ/Wa/QekSW5JMYjTJ1IzA4nZnkiUAaoVJvltOiN8d8hgzVOy4cLcfrj\njnyVjXt3yGt9mv+PmUbggiLEILUWP35N6+/efhCXMgOGPOqrTE88KtBFaEhl\n1n8ZYlcEk7RfS+wKSaKIJ/VpIjdVFhDW5k7jUMFfYznFkzw1Ljc+PRDLARXf\nOWcC8NXvFt89tnSyN9ick6OkAszq/bpsZh+rv1pd+ZadSDWN9pPMHQnaN2Iv\nSVKAcsSn1AZdWY7pgkK6+Ua5AA2Rbx2J3aVRrH3XzfwvYdF8dlxDWBXADwN3\nngJ7rm8YirR2ALo5eMnpPjmEyBspbTyjDnkT6o32nkz68qHA7sYLf3Swi4/e\ncy4aZGm7lZeSW/kWJRY/LZf0lQ3Hm2qGL6H9N28/a05NOrvS4ENifylntKYv\npHI7XgIDQJq7B4gP67ii+cSYzdze5mOQyA5pe581izVfKpBnVToU1tuPAauL\nURevcLOY8yu6qxDCGu3zeBAXtqkIV4DOIDzB35UONc+6MlKnXr5NqCXxA4+4\n2BgwmHAMBL4/i1TofJ2AywmOvYoCW8FYtyHNCm+JdRqczu/IUtTJleRBNdQR\nHAYh\r\n=MouO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"7639ece7b0b1300b3db2ce2fba2d93c25aaf08e8","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.78","@balena/jellyfish-environment":"^2.2.22","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.4.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.84_1599616557868_0.02636118914951746","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.85-renovate-non-major-60b14f402b42f08a338c79df908198f5d072d3a9":{"name":"@balena/jellyfish-metrics","version":"0.0.85-renovate-non-major-60b14f402b42f08a338c79df908198f5d072d3a9","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.85-renovate-non-major-60b14f402b42f08a338c79df908198f5d072d3a9","maintainers":[{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5c929c00c4fc9e13ade631b1a61556c3567c79da","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.85-renovate-non-major-60b14f402b42f08a338c79df908198f5d072d3a9.tgz","fileCount":16,"integrity":"sha512-meYc+edWOcMjUAQdvHdkBrV2v+zB2b+96XJd+0rUfISTaf/wjzZTSw9n9+R1ol4es+BSonGCGMzzESSTgkZltA==","signatures":[{"sig":"MEUCIGom02YjeFlH1GfCpJXLnv6mXOUVuLdF+B55+cUwphKGAiEAtzjgL/QdB6WQTuDFtjylgsTW/j3DJCClV8RH/aPjyk4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81866,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWYNMCRA9TVsSAnZWagAA/8wP/iQiCOCto4WcBIZ6+Ji8\nAwhp4Rxy/vfp4z12IWTjipvZhg0/GD8Zd4zpZCgXfkZ5ZGEPXSPj2/mcijz2\n6laIiN9aDXaIGDyHwOAV9oIQNu1c4pwv2CwMBHiWymh+1cNNtQMRVeIu3iaP\n6LS5nWxAo2bjsj2LfwyyVvOgsafeszvIdypTYlAx7ORD+h8+lG89TuYRjTyW\n747AmpC4cqjaBHZBM9vxrPaKItM+g1gMCUQ3sgvDzr+v7DpKZyBGRYQAnocm\nRHi8r6m6PPj1xjKetykEhc0UHEMaGWuO7rxJC9tbfLXFbiygpzXZIbAQlioU\nFMmUSgjEEHGbSz5iwSygF2u0XHlV9DXO4UcPiGcnHPUXVWecqD5WYKuhkkaI\naYeDLIZJTXIa7ZTxuifUZTle3L8OBybNT7QXqHo/LYEBJ2Y4AJATVJjBoCLG\n7+hvZegnjkcj3BUhx4LlbR9xGQUeOMEJ4bj3Hsl6W3FN2LE9EW1sfX+eMuMd\nefnmVBaWQixcsi8vgBYIoqBcZs/dygW3gml8N97UIwvSH8zzNx8EkRdCdptw\nyFokQSAr/ibDbDMjzC+XLIYWA2urZwyss3ayX3fx3DUxqvjrqd6yOPifxEQl\nJWLmz8Hg/BvVt8iMFHKRCsD7xRILZTFuT9Wl/iqADS4b7JnVSpcQkQWSfLGa\ngd+u\r\n=WloG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"gitHead":"60b14f402b42f08a338c79df908198f5d072d3a9","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.78","@balena/jellyfish-environment":"^2.2.23","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.4.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.85-renovate-non-major-60b14f402b42f08a338c79df908198f5d072d3a9_1599701835984_0.445415607919152","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.85-npm-engine-strict-f1e55d7678ec67adc798a8f5df5062f5725bf329":{"name":"@balena/jellyfish-metrics","version":"0.0.85-npm-engine-strict-f1e55d7678ec67adc798a8f5df5062f5725bf329","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.85-npm-engine-strict-f1e55d7678ec67adc798a8f5df5062f5725bf329","maintainers":[{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"75b6e8e3984700cfb73fc9cf7d5b9ca45ed45efd","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.85-npm-engine-strict-f1e55d7678ec67adc798a8f5df5062f5725bf329.tgz","fileCount":16,"integrity":"sha512-5Yt2/DTXrvPFdjGZqTS21rVorwws7lYVarmVo48/zx9p2fEbGTYsN3zUJutRgqhIU6g4RNC5mVkA2sy+V4jRLQ==","signatures":[{"sig":"MEQCIG+UB8iee/mmV6gFjPU9+waIUfyHyxyQTBn0skh+kBjhAiBkiiAleFhz6fhLKyJpvEI8typlpvhNGJcG4xJTQ7vS4g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81971,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWedTCRA9TVsSAnZWagAA+1MQAJpy+CUSLGs0fQq3YI6+\nQR0f89u4ap3sHjNxCOQoG47YhwvIJbKytfTNMqIKO841C+d04cfcqPN4ADdZ\nmNbrh1gd8xKOExNJg/V+4B2gf7hQ5SITPY7rYy+OY7zcb/oiwz7oAB4suXyY\nMydIyG/L6ubZUsxZn0qc/n2M1YMFgAFD39y7isgbmGQ2KgUoxAyXVWcaqLYR\njNnFGv7HxKFDhHkqFCnkdwt3i+5U+EqRz0hxH5wVctkZGhPGBIa2yomdJNX2\nvEIecmuLVeodmFbUAiRXOzUZbSquIFeAPA9fjAwIE4uM7xtJKRFl2FPhlrJT\nVJ7OYZ9PeQmfEZe14hPoQjsilfUPJ8oSoHx2VgWaPQh7I2DBpMN0oV7Wgh1L\noLm2pO09n+ZToF4iHpdr5n35s/+HzNYQq+2xg82JZzqK+NgOWkCH2nQu1PLT\n5AYEvkNQkRAHERAExw2heKkSVp3mIwQvtYwiqe4pdd2XmjQ5ZTzDZJ+G7Xaf\n3inFFPr7asp/xGavrYaAFOhwsPBt9DD7VdxUZ65wvnq9sDcUO28RhAaM31Gp\n0Ktg6+VIGisOvpua0OPS9jKd84WGBJX5uFZ63MOFdzNoTvY3/LN1u/uUwPQ2\n31/hn2bDFPjsE1MRNlJqXbwaQC622sd85I1b2xosHgW1l1H4G/U4y8drgYdG\nkvxo\r\n=ksaf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f1e55d7678ec67adc798a8f5df5062f5725bf329","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.78","@balena/jellyfish-environment":"^2.2.23","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.4.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.85-npm-engine-strict-f1e55d7678ec67adc798a8f5df5062f5725bf329_1599727442528_0.23094909379343775","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.85":{"name":"@balena/jellyfish-metrics","version":"0.0.85","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.85","maintainers":[{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"98f845286a8e7aed4115a9964b0bf2556bfc7d62","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.85.tgz","fileCount":16,"integrity":"sha512-tE4BlG/MkAlwkr7KTfuF/JmKhS8E1+Sw7Gv71Y07TgmWIsjSPZKPi37BDtyCNdEVtWHqZ6lsYK7slbPAh+Grug==","signatures":[{"sig":"MEUCIQCzb93zgadAcriggG/Is1c5neXFp+KZCSwWtUWxdrMtwAIgF676wpfHn6EBVxhdVjbqjdZ+83ev3O6qWuIJsqThkcw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81912,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWehECRA9TVsSAnZWagAA8NIP/Ah0CygjzGD1WBiCIxKl\naOt7MnSKu/Kq38NLxfokV60dCJngEOpaGZwW4xhVKtf/fhDHE3H1iOgdnmGA\nIXBXJXRMns/WijK1SyvayNCd4qlirRznmGxvbDcfvvNNY+hItvAMgCPSSrJe\nIHXUGYEPw1CTyitCgvC9vktGwHO9t6jeRocXibzKQoRuXkDtotSVGwUXdWGV\nAbeefRbTapwc2bjcLGuOLcHT7RIhpOkafnrVfbL/IG8oz81EQgWFrfdK2TT/\nyTqF1nhazoNS7zaflJBMfgqBrwV+C/7yslIJRa0KQfP/LIigRTgxBbDmu1z2\nsuIPy9BctcsBx/B9FXKC6d0wWIW7z0/6iMwm9G4ZAauF9U0yBkadNBFzR+hU\nxgxtfXSBayTgrKjOkv5gAWPGusUvmJW9T7PAk+76Z/9Zv2UR0u8K8Wof1GnP\nznUTz7zEW7J2KG20nwa7jOxDDmps3XqK6Mt3NgQIYEU9E8PLc+BPJOboD59u\nuiL57keeXl7A6vICCM5+RET8VWpHa+PIxlAEMALDbr10vRKTHHnjjJ4LfIIL\nT2THIJqrJQjy4lc3xiBOvZfDqjdz94yKbZzzzvo2dTiItFmgWnxkQO/3l0T7\nz00fvcskOpZ9ALTdBt9OiAksT6gdzUACkwprcdXt6MsPqArEgI0Nt708nCA/\nLnAL\r\n=sn0t\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e35008bcd817ee8b456e777c4aa0a69f33124544","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.78","@balena/jellyfish-environment":"^2.2.23","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.4.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.85_1599727684129_0.41847006530702946","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.86-renovate-non-major-f5388ab0bcab5ac65ea20f877388c23c56acee99":{"name":"@balena/jellyfish-metrics","version":"0.0.86-renovate-non-major-f5388ab0bcab5ac65ea20f877388c23c56acee99","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.86-renovate-non-major-f5388ab0bcab5ac65ea20f877388c23c56acee99","maintainers":[{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7aec907e5618ea39b5656df7e32d77c8fb72c8dc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.86-renovate-non-major-f5388ab0bcab5ac65ea20f877388c23c56acee99.tgz","fileCount":16,"integrity":"sha512-Wz4xcYhQjqhRgWs+dgtIbsO72h23jy4ahkK3b9u1LNFi5mS+X/jzk0wbJoqGYwNHRF62d406okywc3JPLDcqpg==","signatures":[{"sig":"MEUCIEi1Q+9p9WO0I9Zs5CsYFSC2BBqqZsTJp3iIf5Om6PijAiEAqKtNgVVWTlpNHH3//Zi5f4TePhKTTpC5K3VNI6FNkr4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82078,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWelQCRA9TVsSAnZWagAA0X4P/RKL6xkAdBefHSz0U3dU\nSx7TRnAahZOm5QX8llMuQ7KRr6OXQ78TDbsu59anyH7Ww+zVUbi8iIaHI/fn\nmriThhWdxQJtNMU4QpWJKgm8yPHdmkJrT0HYOqoVMuzKK8V/AwsR4hJkoEfR\ntDLaeCRKU5CSfi0Nvxzq1qQiohy6KK43AwyPKQUHJxWfjGtAN944veE7PyhN\n6L1Vs24k+VXe2mqt/vmf+qT/10cx8Eth9DqQFBC6tF/qtw9rpS1kozF6wdUH\nZoUiik2UhBxvq1WacC7oOO/i77mIXU93vuM+hV1OuJLnQ8ye44yMNLEqmvqv\nLrV5c/2liKzLVm101Ayg5OXf51VF/XaRzzmIJl21ZKTNZHcmMp3i+bMbxxrR\nlChkOuj23mCfFr+dPhmPq3kqAADCaoAj3nIy/NpbsHiulz0iZRReEDpDPPyX\nyC0IVlyzsX4Pah6Q+Hx/WzCBtHotOJRL3Z4f7zpyQsX0a5L9QlZVjVSyKMu7\n4CoVnn4ZBkR2LJsFwGfho5XXaQP+Tc9m/XnQBgev5L8IFGmQK29dSWUbJzKl\n1t7Huctj5yvGGGLemWLK6eSjJEWzn6u6GrMJIK/4yObfQuIrwKi2zrwSmRfZ\ndq462bjZ7uNqKO6Ix5/h4JdEofjkJ2uVW9muc10v3ubFHcj7opaS0AQTPxdg\n4A5R\r\n=Mu/G\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f5388ab0bcab5ac65ea20f877388c23c56acee99","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.80","@balena/jellyfish-environment":"^2.2.23","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.4.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.86-renovate-non-major-f5388ab0bcab5ac65ea20f877388c23c56acee99_1599727951628_0.7708670141882983","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.86":{"name":"@balena/jellyfish-metrics","version":"0.0.86","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.86","maintainers":[{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"784c4c0418b0a087d0425e2c556dd59405ed03b8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.86.tgz","fileCount":16,"integrity":"sha512-rZ2jhqiTsWrfvazImBfd45CT+i3GNJlUq6VoE5CmtfZf2Haa2TFf63MX4XNs1DpP5z/l5ok7yHqOQBCx19Bong==","signatures":[{"sig":"MEUCIQDWCBHdO4X6FpXd3sRdK+ynUhKTUph56NvsQyc52XWb+wIgWVbjfO8o1QFQJwE6xxcyp8g6qGEzVMuKFm0FkTwXBek=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82018,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWen+CRA9TVsSAnZWagAACOwP/22Erz5NA//YycU2rbXv\nuAGKx/L5Lte+PvN0ejrMbpH0Pac7+5JDAHQkw+G/n/SMiugBBxe+nWOVrq+A\neUBZl/8kKfGw+DokvuwDP+SAcSJ0srxTdYtjhQJ6sgu5++Uy4HVfDgW7pKvo\nCeUSH3j4EahEdcng8mX8/G/jhPuGI0++KHZHlmowSwgZfiep6rBEswusrNrt\nGoUU9otGBunHB+ovIwNukymhKBzCh0+4gJQxVsRWq2CPlZExrWGaBOttmlfA\nLo7v4c1y9whjFVsWA+6yB9KBrqb9UiyaHHopXl1+Tp6K/79K5ubwgFDBXjVL\nt26zH6xLZvThZKCqSvka2cwevbvweQERhpw67jenz4/SU+btmBLmLf97i7D0\nBIVihPxPcQ7sdMdXrVCOrXsGhl8EuA8m0YmsZf9vvQ9bedxZwvNnL+sH5HLQ\nZExoq/mRouGrG+LfocLo5TquaGxv9Zqkl5JwGFS+ZCr3+dhb4ct1dUfIVdqc\n3nzWb2hlEx9B4FJCVPcmR/qmuvnsNSp8m3qpr8mh/JYMFCyglO2eylPJPz1j\nwhAzIX8LfXmeApfglf7xIsjBmqBjQZaWRkdEu2STv30stc4wokhCP7xwzIIp\nlaHWrqF13TZ2++MBvE3eHoQ+9hAzRnx/blUot00jYu2KqZXf9X/1Su0sDJBE\nOAPO\r\n=0MyC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"cb6914897e3e7c22f23b6fc2f917464e990a9bea","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.80","@balena/jellyfish-environment":"^2.2.23","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.4.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.86_1599728125741_0.2532264007583278","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.87-renovate-non-major-7ab2dcdfeca3eb218ae1bbcf4044ca4e7a493a7f":{"name":"@balena/jellyfish-metrics","version":"0.0.87-renovate-non-major-7ab2dcdfeca3eb218ae1bbcf4044ca4e7a493a7f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.87-renovate-non-major-7ab2dcdfeca3eb218ae1bbcf4044ca4e7a493a7f","maintainers":[{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6a0a9b1bc3960815e1b92b80e9c6cb63783d6469","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.87-renovate-non-major-7ab2dcdfeca3eb218ae1bbcf4044ca4e7a493a7f.tgz","fileCount":16,"integrity":"sha512-fvdEmvEvJhrJxc39z4j8/60S2sJMrKbNyxa9D2gMJthZqobtQfXlpNw0gJUqmUSQMVdRXd00cRpddESr+Hn34g==","signatures":[{"sig":"MEUCIQDsr5xPFMAoy8se//Wz/RZ6xCANAnd6HstTSmPN9DgFFAIgLAmJJpCHcYFGJKXR4QWwYBPTgvDNRtGPim8MgeimBz0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82179,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfW8O2CRA9TVsSAnZWagAA9KUP/3j+sjYK0sjjnBrQ7fqH\nbhbZ5I4GaBfZY2Bus7XXjS2XH1h5D5VTtlxgz6QxMrUGyP8M5k2ks+4+AhPa\n/VPlsdGp7mrm8nMbO6dSo/4zGrlzjMJYkqmXoEIws/AmyoD0d192wRFjvtdZ\naVqAnK45MmgO+RKcq2xszEQEOt9GIzhyTanQ9x4kqQj0MKr5dGRpWf0XQyYs\n5561YOSY//JgSNp5UfuguGOxtxZ7/TBWmSvHJWutsRc058XSrIz1BAQ2CwMQ\nm42BoSywiHFOxUgCk7e07S2r9s+CzjDLGkaFrtiCXAZegNs9u1KT81T0YxtC\nm8/gKvH7JFAWJndEUvLvb4Au3/ybO38JDb8R4ksXTf4QmF9abzePmk5QzmFo\nZMDsXCJVLgOj7kSDhUxR5S17U7/9Onct/XQNFx5HKXM899fBZ67Np6FhjaM2\nxGhLCee6wPUneXO8IanrAYY11HTXho5yF/oQLxYJQ753htFG4Mge/sR7+ePi\nfzKim8fKdriiWqBoKQcCmrX3fwcuz0MOKywaK/wIUrUKocDwBoaJc11lM6qY\nv7pn88pSKzegCicWMD7Wc7NT9bZ4WyVrOnSOv/puKtlRiKHuz2NoobowLjHX\nQji8yY/BJU7pQcBJu7+4loJKxryN8D9bTUrhCWmGcelnOx2ReMs1Ckf6XMPV\nneQb\r\n=PdBX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7ab2dcdfeca3eb218ae1bbcf4044ca4e7a493a7f","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.80","@balena/jellyfish-environment":"^2.2.23","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.4.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.87-renovate-non-major-7ab2dcdfeca3eb218ae1bbcf4044ca4e7a493a7f_1599849397312_0.893442130507462","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.87":{"name":"@balena/jellyfish-metrics","version":"0.0.87","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.87","maintainers":[{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e7bcc1e525ac2903f595568b4fc98ee7f6265c8a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.87.tgz","fileCount":16,"integrity":"sha512-s9nBZULnDBlZ5S9Ziga7QvX30gPySX6Bqprs7Uv0y4uA5hTSWFkRX3e3W9SLXiiqTEOdLbuiWSmnVFaZMYr6Gg==","signatures":[{"sig":"MEQCICIlMy55n7ITE6ZpLwrjG3IDbEjNd2pwJi0UBzrlvUSDAiAExVlgP1mwrF7IOQsRU3gcvXWmwRIraPKsLtOmLMnZIw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82119,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfW8VgCRA9TVsSAnZWagAAJkQP/25Q1BA6ridWFELYXegG\nB67rhLRc4Jc/DtpUjK5AiPK35f7NTqCwCEsAcPbOqFreINSnSy5HGqNG/PFF\nb3hkHGkKIdT+KUCO+PklRcXJpPStidP8huPeobpGDYPprXvasUnfTFMvZ19j\nzoGgjrbH+CxyG727QUTieFojbtCZBnzxCFjNAOaoFT6gwfReJjw371jHX759\nuafdSC9Vn6mhlA9dilNIb5G9Z212GkAZ6Ja8ntHZVpaNnQHmP05n4lvoO457\nkFGJZybPS7jq0xGRqXRkcaCo6YV2kAfRdHrud7EoLI9L+mm3NEV39FVFmgvK\n0mjGwZHEYEuOxsPLFjpVum60tdfjMI2ajebEeafBSjYdQbmZHJd+XDZfrRDI\nMnSrbhgb/NA+nbYAHiPFjO3gllZNWFGk2nZrwIl+A8TGio5vBHU4sNuO+AjW\nkLQUJkHgT3n7AY7/SQ8neSmHIlq/t+/SXouxK50UE44Slhqb6Qs8kIa7+bcj\nXEP5geY92nTRQp1LK5XeeIvLATB2Y/b1TXqHonqGw3P97ESpCKxf26g5Z6T2\nhjmoTjGd11ZEzcW7Izd3cm0UBi9O48eBPnp2UH5LukEb8bTO/2Nb4ZxIvIv9\nceubn6ON1wYzjoOfiJTYtEaXwGF18hQrEHHNoYcarZE5oOrBXwPOf/+7ltX7\nd17s\r\n=gXZR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d0abaf7cd811a8331ee93b2d71801d19725b9fc2","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.80","@balena/jellyfish-environment":"^2.2.23","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.4.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.87_1599849824318_0.46336033131631726","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.88-renovate-non-major-5a7f779940216e24c11eb5947646f91d2ff568ae":{"name":"@balena/jellyfish-metrics","version":"0.0.88-renovate-non-major-5a7f779940216e24c11eb5947646f91d2ff568ae","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.88-renovate-non-major-5a7f779940216e24c11eb5947646f91d2ff568ae","maintainers":[{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"944ebffe99438d423049b5f67ff81518fee86ceb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.88-renovate-non-major-5a7f779940216e24c11eb5947646f91d2ff568ae.tgz","fileCount":16,"integrity":"sha512-DtY5yVwTT8x1fC8xkfgf+tYrWbVb5JrBp39ZcCVwpnA9NHWjIcqe0BlOrrriuJzFVhajEu2D+XM1SiG6sJXaiQ==","signatures":[{"sig":"MEUCIQDfU3RGGzEi/DYTYLujDzY+0P801KeOdWJAy+LMHu9vBAIgU30cCFd1brw5+6poOAM3OPzkM7XgQ1o6C0LHdBvTNN0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82248,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfXL7GCRA9TVsSAnZWagAACX0QAJ5efa+4nnoNvMgNclb4\nO+qvLb2M99k3rdTo1eN+5sPZrz0orURPFZ6ZxqJI4yh8l1rXDsCMfudT4+p5\nR9HBpATVFeg4RuuuTSBg/0OTPRUQBABDsRSe338yigpy+h9tN2kvH65tP/PO\nMcbCofkSxG9bfa3IF+FMA9SHoEPFFulW1vn3VHKkMresBKkQsEf7SLJ/x7bE\ni1MWur9GC6ZDk66TH6WnUPfyj6tb+3p62y+VC2neAClQtx831zan5nwtrxbu\nZO2OyWeaBLc/BVKq0vKsu5iwtEYeCBnOg0b4keQL0igRbboKiSbcqYhwIXXH\nm39hMJkAed5De5OALVMZrH5NszaiWSWwBCIIRGCYUu6g53R4/9HbKowHp4EL\nrv9i5tE7c/cwpKqQrpSol+TF2HbD3bXNy9Kivc3AVcGktJ4DIihhmbBLK7uj\nIHNcQK3XK9a2rkoAhXyu2ASUPT8N8QXg2lmX8cXTy7n8j29ZK++ZK2Y3HZvA\nScESPKC/kWC4xVTceYDqUDkup217HG+DEkdrBhwm/z7eJCVRxcO238/BXwcJ\nIZSDESFn633Xt6rzHdtCviFGgzDS8P7Z9rhZapRtxf8hWuTeCzZ6Jl4IUUFC\nIjfQovoRbAcFsuYd61Ksphn/HRcz8fChUWz0gDYFC4/RiL3OisNEIGdxXX4L\nwgTD\r\n=Eour\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5a7f779940216e24c11eb5947646f91d2ff568ae","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.81","@balena/jellyfish-environment":"^2.2.23","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.4.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.88-renovate-non-major-5a7f779940216e24c11eb5947646f91d2ff568ae_1599913669640_0.23719166211759735","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.88":{"name":"@balena/jellyfish-metrics","version":"0.0.88","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.88","maintainers":[{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"83dd7b9496505e078e19f9f6739c02712d1645cb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.88.tgz","fileCount":16,"integrity":"sha512-p/dXZxDXq1u4BaRy67v1uTb0Ev5wQY+yAGPSCqkoXQA08FvIVlKWFtQr97dh4+WWdL+6T+Jj65gKFAx6QSklaw==","signatures":[{"sig":"MEUCIEihyRTXKKsCKVdV7DIcAlSgLQAkUAjhtRuAnG+1QpwaAiEAze5DUu6+0JHP4fLbMaAkNBd24GG6uBa0toWFHVQObSw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfXL+GCRA9TVsSAnZWagAARdQP/iR92qLTLbn9qZpsdubO\nwsJHTPyx4BOlrkLHY1jl/P9r/E3xG3tsIEX79ckVR1sO38yyRMLIlgtICrvN\n+hwVMpqDQ0i8rpEEMiVotGIqiUiVPUqfjOGWWNWL5ls142994xweijSv/pDM\nwT4wqDY69JxkcjwtJ42E0fAJ9wWvvMy4AQ/A6/qyC0np+i6NM4wVRI+Ac7re\n63FWl8Pfz7xk/G7xoC5AqWHKXEgUnXmbLiTIY/cXCrBVvxnrj8NYdL3aZ5Qc\nq8dqf/n30YNDksbOJMSz+gBGuExUozBu2+8lLtH1CJQiwm18S/BNg2tIUfLl\nhRx4fmRfUOHsPdswV+0pNouH0QQu760jlEb6IVF061wQgthr7rfD+8TuJFoy\nAoqT7t6BgbFrOoZ8NKq96cXGflhNuJsw4bE1nh5SqH8P7gHclIgpTnOyrHqD\nIOllrlCLPEk2uza418hF0wA+MgGlL7yGsAlzOmEProEzHtQ8aHeC518Ck5GQ\nmZfwv81dFSGkJeXaAve0/moqcjDCirwdP6YfQD98PPZ69c1q3C7nN0eqoirS\nv8YkEwURpklm1x2qq0YwrqXZaEDDGS7yUS2MGzwslsSQjQNpm8l8MKwGqtwa\nhdzNmLE55cNvlApOBmzoD+ZIPoGk2DHpHCD03kzkpJAPpqLFLuVCKp7ftMmO\nceFQ\r\n=WFWr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8c6421130f0a8908c23ec7cbe476c15e9d43e886","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.81","@balena/jellyfish-environment":"^2.2.23","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.8.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.4.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.88_1599913861882_0.4643838319329352","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.89-renovate-non-major-e9ef94b520c1680f200aeb2b6826155361e73947":{"name":"@balena/jellyfish-metrics","version":"0.0.89-renovate-non-major-e9ef94b520c1680f200aeb2b6826155361e73947","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.89-renovate-non-major-e9ef94b520c1680f200aeb2b6826155361e73947","maintainers":[{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ffd4c9b89ce4abcffa48695eda43715ad513f20c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.89-renovate-non-major-e9ef94b520c1680f200aeb2b6826155361e73947.tgz","fileCount":16,"integrity":"sha512-zBh0HbjzAH2+Vw+/AYz895HbMXw1QKzPDauabKeYF5k44EPE2SeNLdqVmje/9g3vDTn6WfxXihw+WiN+P+oAaA==","signatures":[{"sig":"MEYCIQCs0MTW5x4jdREq9bR2lFs63Ei96NM4zl75E/6fpbRszQIhANrOHYQL/s1vtkxrjEYAg++L/DKL8G8yjV725nMGI6Pg","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82317,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfXR1fCRA9TVsSAnZWagAA0k8P/ihBJUyhZGxgN1QSKS1Z\nuwjPuvxCl203tD70vkikPsvmp02ymYlvO7hRBHCJ8K7VSRpxWVShSZ47ibQE\n9qZCBl2c+UJ2MRIGe3sJSrXrizkC7IhhdAHM93T6rEHyui+lJsid4popNnfJ\nVIxtjw8KY+Z6tG6CdKxcjqFHuhtcNHyLECGeyZMu8mKJ8rwvxCMe+AAcEuIO\nm0oL68X1mXlH1R+wVLZy5Lch/P63U+PVMfEwKizgZPfmjJJDrkB6AaZe0BOm\nwjfvPIzIhFQVunVjDZkO6ZCBjcEqGd15O6u4RapS07gyGC1Fl85T/ptPpotH\n6z/vZPb90cypb8lQOE5ufLmdgR6+eLThCJ1mD/e37W660AnHmyGOaF9Ro43S\n/GbA6it5zdihSPTcy8Q2NO19taTBOWR758EIFFBTvof7h01JHhN4LG0eodhC\nACZQPoiPvEwoQGYWL+w1+idRo7sqTVuAFKhhcPW9VjophlK7XdilymT5WakM\nIMVY2w6Yh828eOd9RjwqhrqU3NmrM9QgMpQGfLuQDZgIOcKkqL1tTVWPHev9\n93LQWh96G1QSKg+3xEbRmAEevoxzfLkwv4iNLbM7vXWIcOksQHHZZl7Pxtex\nFCwCB90Hcu2FyZJanvb+irV9TM+/NObjG4hwTFEMa3xEQM5X+nkbpDQjs/qt\nvz9t\r\n=PM8Q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e9ef94b520c1680f200aeb2b6826155361e73947","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.82","@balena/jellyfish-environment":"^2.2.23","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.9.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.4.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.89-renovate-non-major-e9ef94b520c1680f200aeb2b6826155361e73947_1599937887331_0.6920476364920134","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.89":{"name":"@balena/jellyfish-metrics","version":"0.0.89","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.89","maintainers":[{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"52acd3b4f519277a168308ac38f2c909079607b7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.89.tgz","fileCount":16,"integrity":"sha512-R7eD51Fn+5siF5IWHReAGq/YDr6c8fEv1W5SE3M3qSNu7ENw4aeDAtU7GiVEMEkE2hC8fQ3NhPVu5zyh5PzuaA==","signatures":[{"sig":"MEUCIQDSDT6XeyK0RXdjCVLhf5hkGFAAwvZN6HZTaOq1K1IUggIgX0XGLxTN1r4qKKPYzifBRpYfYSZ7tNLcyY1IyCjP5jw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82257,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfXR7kCRA9TVsSAnZWagAAVx4P/2R0Kfsc7bAH3P8NZiP0\n4ewd3hsMPz4YdJXM8j5fJ82eeUiXFS9w9kFUlpIeHVfgVEWt3Ip4gLcCPQAn\n/bPLbGSLF2lamxRVijQ0WJ7+oonrtafCW6CpM94sJnlLTqTgSLWFcVHP8frs\nVfMJf/AL9qlRKtEbhautJO2JXBh09PMGfhUTZAWQGhUNpsYWopuKSXv7e9Qn\nKwQndYoenWrKR8UPkM/8YgLjP2mv5MYsgs7XZQnUSBSxG65qPF8XwHrm1vUg\neN87QiVsookKTUFW1c4eWwIErDZzQbAhQGQBsgxlHsbR97ONYDT/QwyBNQIU\nJayvcJskhMduOlK1maChfs29A8pguQNhvekjgGUBtfNVRpAOnoLVTFjFxRxA\ntPq/hL83bymgd62KEkNLywPx9z9P4QzsL8sE/9rTmha7soZVFxnLZiEHG2s8\nSC4XmNFGdY9oTbve0lT1u3RDyLgLL/yF9dyTCJBA3K4+fxny/dBD2pGMi9mh\nGN+TOr62iPdMUzxaGJG9Z3YwqKGErBI1S/ydSGFPpKcarmhxsdgy6VuznrmV\nt+RMOT9BObEzyzozvc1gyZxh5Oqp1fUQlFBUNk/J2cvzHFhHc38Xxzq/8nTC\nNcyF2OEXJPUJQjVSmQyIO1ovaz7r2sUP8kFmUs+bbmn0m8JUzAsPRRkxq5pZ\n7LbJ\r\n=r3ln\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"84c4ae1bf01f481256470ec57e76f5e652b1afb6","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.82","@balena/jellyfish-environment":"^2.2.23","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.9.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.4.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.89_1599938275959_0.7256791620509664","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.90-renovate-non-major-5dff1b30bde721fd9d3314e6ebd5a6694fa7bfc9":{"name":"@balena/jellyfish-metrics","version":"0.0.90-renovate-non-major-5dff1b30bde721fd9d3314e6ebd5a6694fa7bfc9","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.90-renovate-non-major-5dff1b30bde721fd9d3314e6ebd5a6694fa7bfc9","maintainers":[{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ba4ff6dad43e1c997fff8f7a147836fdd3417dc9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.90-renovate-non-major-5dff1b30bde721fd9d3314e6ebd5a6694fa7bfc9.tgz","fileCount":16,"integrity":"sha512-KPR0wGFJWTKQhtjvVb4tY6q2SXw16/pGR/4J2QkOGnRyPjlXadiTsNmJEAfKzWfqHQGus9ch9pcu4lUoQ3kblw==","signatures":[{"sig":"MEYCIQDECmxWBbLtDe09t1m/mL1N0DhXAS8pqCX3ueYtYTTfNwIhAOD7kVkOS8hzBKqCLHrKq+ED5DSMo9jdSh79ZctWNHXL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82386,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfXS+TCRA9TVsSAnZWagAAxzgQAI7rl7IQWFIMw9LFTbNn\nnwJkC03vQ1RRobwLCqSt1driOAns261UInZdBIgSZhKoBvR7uwU5URKzTOzh\nNWthBH+XF/P1cc2P/zLUA3M1tUBP6Ps5liR0Y1nIMoZClGw+jyKrBrB+m9/Q\nyk0qsKvET6NTGJqzmkQkNcsGvLT3foA4+i4eeo4crUVKI3zKCEik3PZREK1o\nMnkiQ2Fhez3XBUy54zZHnw+NyIf1tvbBBQelOfTBA3CcWN0LtSehThW9WFtn\nNS9QWca5e2lCoMENhE7Zh87aBTv86H40kHb2W2RbfNXgiGQD99iG4kycyLtI\nFDAh24Hg82MoRtIf2cyj2KhIvrmy9kCd4aeLgCz1grujXU5Xk3hH6VOHuNyF\nkCYe2AMfTcUksRd4fghJsbQCPZBaNpNw9TAfNzMZglBGmD9tAYGc72HN9zOv\nniW/ZiVMiFZUgV6ljfazpLqGq+csn7AeRslXuN72DqcTU9XLfp5v49sKVwlz\nLDnH5kwUDRcYP2f/71GI59jFMLfoSANjPK9pIz3nwfJ4VfhghcTsmfu1NaR0\nIhWmivHU3oUXbavL7iyt3pN17vSVRgI+qgkq5PaZaahy0ISmy5z9bIhTgSNN\n1FUuWomamOxjmMzdaxpvqWcsXnsNMpp0FOJStcUcCVnlPhkwaucGafvwUbNH\nu+Op\r\n=+coS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5dff1b30bde721fd9d3314e6ebd5a6694fa7bfc9","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.83","@balena/jellyfish-environment":"^2.2.24","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.9.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.4.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.90-renovate-non-major-5dff1b30bde721fd9d3314e6ebd5a6694fa7bfc9_1599942546628_0.2953741387082087","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.90":{"name":"@balena/jellyfish-metrics","version":"0.0.90","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.90","maintainers":[{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6583a10cb7843c3054784546e5644ed534c348ee","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.90.tgz","fileCount":16,"integrity":"sha512-eXOy/wwAfYTjaFwrZ7S3WWdtdHkZxUasjJvbx+vygDfnZGwF2BjsGxY8KH9I2FRCwL6P5BQZKmAKOphcS+N0BA==","signatures":[{"sig":"MEUCIQD5C0KPS3LIbWwdbxzI8c2oWUsYlsLMR4xCpfAugkDaMAIgd4P0c64q+87aQtQZ9DNLl8LVTN9qgmpA5Zau1jBhWgA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82326,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfXTA6CRA9TVsSAnZWagAAkF4P/3fJ4gPlXJb8vzhaUvxp\nD70EjzoB2jZfBqQW3Frqpf1gjjvBQYSm4AnrZQ4M38Yq8pteWWAYqsnJi/Bc\nw1tvwj6uGcFkA16xHfhXLgxOk04T1RiXJCzGP19WXq1Yb/xFIyZaXM96KJqX\nubUSehtoBPwsogZXN1+zvJhn9JzEhBLOdcvTrOJKpAKtvMT2EMfH3+tN/8nc\noGkc55tbA6b9fqDUjQKnpIyAFYu/quAWD9Nl0/60NKZgykv1rtJ/rAwk1bNH\nfsZEKTDXTv/5yP5IgM6lDV8SNLqZf+oxoSchIT7wEfJXSHyVLggEqtQqrGJr\nFoKrA0ValVUlgDsFjmIAYDyyth3fvwfd/3WOyztwqjOgRA5aAH72OYEVOJfE\n9DkzE9b8ofgCIcjhN8pms0B5lEwsOK9LPPPQTCyD02txzkGGOwbVLGpj/87D\nLV0slYg6az0CsxaZNeSRAeiw4nydgSGa/YtCrWCbokKzpgHj4ZkR3so5SYGI\ndqjQU+NxYTgywvIPL8a1+Yp46OYHvRKyduN3yzWxI7u0ZFyWa4xUW6n1Tywl\nwPM6g9MhpNGkdIjs/YYeVrkcLDMIYIZBDQUrqF2CXI1vFGnjhr2uKCpjYpNq\ni26jmYpJBTzWhSmjamJQoDAdexXiSy85ocP3vtXWNQ8amRfa2l0queHnTKtY\nxSYK\r\n=Vh2u\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"1380fe63b0c4f20ac882e1ec1cd44ffa2a1fbfdf","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.83","@balena/jellyfish-environment":"^2.2.24","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.9.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.4.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.90_1599942713997_0.2410271367286272","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.91-renovate-non-major-387d8cc65ce0afe49d9e3bbb59beb47c507a000f":{"name":"@balena/jellyfish-metrics","version":"0.0.91-renovate-non-major-387d8cc65ce0afe49d9e3bbb59beb47c507a000f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.91-renovate-non-major-387d8cc65ce0afe49d9e3bbb59beb47c507a000f","maintainers":[{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"21fe0b758e32dc5929c4cdc86185db948d8c2cd2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.91-renovate-non-major-387d8cc65ce0afe49d9e3bbb59beb47c507a000f.tgz","fileCount":16,"integrity":"sha512-EJOxY2A+RBZFXyQatzI3pmO9mLMvschCsvm2pgzpDHo+3ozoAdWPTFoXed42bt6OTOGGFujODuIyxu5i9sQ4Eg==","signatures":[{"sig":"MEUCIQD1FhgS8AqdwxnULwhKd3inpzErp8j9cmKV74CP0TGYagIgPEe1oOnseufa42de7yFAXoAAMWe6JXssJ8Ox8L4rxCA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82487,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfXyWRCRA9TVsSAnZWagAAxJcP/iVA2Z9I8Jn1sjpxoSwj\nO/937vg5VQQCLna7bqA6DooQvxwWYvqZSjWAkFWHskBn1SpOZG3XUFjpYxSg\nz8uutq8t5DJcTXXwHse++GEPvvczrWYTWAsd0sV169Ds35w5Uh+EMh0fO3fk\nQJPtRtfQJK6Sdg52PRnpNdtKYEYRkou8I3JN86LFk+KGK34WnQIEk6OWxFF4\nKJKzcAhTGvrqub1Fd9gsDDzvw2BjnhKB0dY8H1fUIleWT2GVxmnNN/iV80kE\nZfe4R14Qqg0mBToXtm4Gpqc5bhgZWeKII7b8HquHZwo5NotEYK18CMSQ6rCp\njuMDfF7Vj3as5eGDrI/sRCJR25O2RY+4UfmR7S9onYTEdvV7ixgWkYe82td2\niTysfkQNzszhe0+DvsbTA2ZqT92JbtIHuieGEPpf8km8KVaXCrGgUab85aBu\nDc13NbNkSGdylyD7BXoxWGcZ1mSLXV+oVld2Ltdfd8YYW+M6X1ySl/fXn2F7\naCP+af/I+RyeHaIfm6ChzOMSCAlbgmPEqN5M+43QAxHmHAZSYvWLHIWwrwTF\nVLEjXR75XS/NjJW9MJrO7Ep8xlkkyYwlrAHGCPNQSAx5jZym3OCDhUWATVrG\n6nLgfXyfevo61/r6CZ9FqWq9AsRGWY3WB5d0fz4MdiB8ZUc87MvLViiOxNq4\nfR9f\r\n=UClB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"387d8cc65ce0afe49d9e3bbb59beb47c507a000f","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.83","@balena/jellyfish-environment":"^2.2.24","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.9.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.5.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.91-renovate-non-major-387d8cc65ce0afe49d9e3bbb59beb47c507a000f_1600071057118_0.30233695657835336","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.91":{"name":"@balena/jellyfish-metrics","version":"0.0.91","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.91","maintainers":[{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"089238eeb1a205b624d039d9a84db9d19a240703","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.91.tgz","fileCount":16,"integrity":"sha512-gKFSzlrjfV2wxrkXGZ+zVI/7CVqgr86WnA/Q4lQgyXv5ZmT4r3r8pTJDWIKbZ83qoi+sJ6y/miqyDYSOCbv1RQ==","signatures":[{"sig":"MEUCIEKVWr9GAyunWsqqVIPrXY+vUZwe4W2hoDIndInSz0k4AiEAqaxn/b6z27LGBMV4HS4YaQ8FR0oQgphL43JXAWLG5Dg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82427,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfXyZSCRA9TVsSAnZWagAAK0oP/2NEFimjMnFcZnEQfyw9\nry7Oonqo5jd1Z7z9AkfU1HjhxCU7Cx0Xu/D1wjq0mwutdQXM6eHqfdbOVzBm\nCWbfdAZ6nopJ8rMR1pIZphJNMJ66Xn2RG2AzZTMcYVRB8eNpiplO49xwfMmT\nzjH765+8NPfr5OL89axMezxCi9I+NxTIg0jDbmrAhytH/mxGtzkZ1tzmCwXS\nlzTBC+Z62Tr6QCThaf/pAsHmniiVP7iF5uNgMl5EeqR2qT8tqHI0XizSJF7S\nW4pWEsd8gLl9srSP9pjnafMKOsnsmLbxSWGeAOljY35Yc5FgaOZxl9PToVGi\ndvXl4UgIgRBHlldo17RTcHLcVclr68WUW4PFVDOy+neIVPbMx7khOS7a6kS3\nk8rGnTDef15KPPgko3ZhAabN8WuHc4w0L9Xtd91xFEIpmUwawv/QX39PCOi1\nvAo6e+vZzHD5fCu/+i7vm55StIWYKhVFHldwd2iuXHCXQ7ACH/oJjPRZidRq\nOemxmDMhsDR75vIHX6UQOQoIPIAG4Zh5dEZptjRNwuvpS91D5J3BSHXy9mKP\nXzbQAlxPJDIH+jPTHLzZZe84pUKQAmr8/DyBbILrG7wO2STHJ1eWBqH3OA8b\nF5OLJKXFp78sYULc9jEAVqDFkC8+FgONLJnAUDM+OSrP+Rbjvau51nLu1Ffc\nNuzD\r\n=B6V8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"dda01455dbd0a94213128430792624c3df8fde7b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.83","@balena/jellyfish-environment":"^2.2.24","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.9.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.5.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.91_1600071249588_0.852322296948749","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.92-renovate-non-major-dd1f49b1d40f6c59fb1b6667f6c451b096148ccb":{"name":"@balena/jellyfish-metrics","version":"0.0.92-renovate-non-major-dd1f49b1d40f6c59fb1b6667f6c451b096148ccb","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.92-renovate-non-major-dd1f49b1d40f6c59fb1b6667f6c451b096148ccb","maintainers":[{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fa31ec78a61daa68356e442fc6202dcdb0dde4f2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.92-renovate-non-major-dd1f49b1d40f6c59fb1b6667f6c451b096148ccb.tgz","fileCount":16,"integrity":"sha512-ZpYsInMRvCUQAM9zGKl9LlTl44HzBexsC0M3lEHpbxUOKp6Jvuj7eCqlaA+LM87ZNCPQ07EcUSmxDMTxRv0VpA==","signatures":[{"sig":"MEUCIC3WAFUUn6CtXfAf18aSShkiOkB3lVhh+iaLPMZINqiqAiEAuksKe+rn9DbUd1cyNRrYMFMu6apGK5jIycJb73juuHA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82556,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfXyliCRA9TVsSAnZWagAAhCMP+QBmcZDQyapRMIFEBnL6\ngNLrsac9a5OdfzvjRcuaF2Sqt/ZitK4JllNv6H4MR0S9FUSL1UegI8zmFhYD\nhamKHvkEj3kxmcrpOFLxPbfisZzjJlUaH9UC/AN4GVcbre8nLwe55RytcdvH\nvvZXIdV6zzDHlB5ztfAjxcABxXbsamAzARwhjFD4kQf7N1eBK/1ABKfVuK7b\nWALqasneLXR8GloEWKDebp4gX0hGB6LdPRVhzxvvfTPyclF4Bxur3NiPF3f0\nln0EZxUJBuVGyRwU3VHXukUYQ74hN5QNIMGWIFYX0IHuCpSpD40ESxiBPkYq\nMgyrV/4frg/QZfuNGjnOsccmp0qnDOnR42mr/R7KxSvKxUWC6M59UMphb0Zh\nD7fecmfB00lEml61YpiExW7zQIgmEXt4aorpxj1VexM+YIjB1yvZTM6snRQE\nTg7gfimFwagSBMocJ5H4douzOkEvrP5FmbMQTgAm8UeOsT/eUiHUWTCg5Q4i\nSdnAvFLlVoVOTbwkTW4YkOeyslsOEE+Um27+7ZkjLzce+aLG+QCRNgmdexA1\nQAD1Vk3IJaxoiWkotVaw0gNEUN34oRLWkhYrFijmVeJYcB8tchodXwxMhuYm\n0Mq3JEHOFTrZmtU85j6vRnnYGkWTOA+CBQnMC+bTdbGCR15K5MV273RmqW+9\nvzbo\r\n=Vx2x\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"dd1f49b1d40f6c59fb1b6667f6c451b096148ccb","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.83","@balena/jellyfish-environment":"^2.2.25","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.9.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.5.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.92-renovate-non-major-dd1f49b1d40f6c59fb1b6667f6c451b096148ccb_1600072033822_0.09303615687418643","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.92-renovate-non-major-4547fd8915810d70c2ddfa017f6ad2e792851814":{"name":"@balena/jellyfish-metrics","version":"0.0.92-renovate-non-major-4547fd8915810d70c2ddfa017f6ad2e792851814","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.92-renovate-non-major-4547fd8915810d70c2ddfa017f6ad2e792851814","maintainers":[{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"374d322917cc2df8dd5d188a5f13a423c7f0574e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.92-renovate-non-major-4547fd8915810d70c2ddfa017f6ad2e792851814.tgz","fileCount":16,"integrity":"sha512-lYIMbiUWhRvZRj8+Zmwlha024ozr8EXJwkn0GpMcy0x1R6MEiWX3jstbfYwLS7OYtc/PYKZt/dQOYLeyongAEw==","signatures":[{"sig":"MEUCIQDsA0jwRYq/RmKa3sYGrVKwa4fvoJbmRD5vYD64ivoc0QIgBr9nuFMtZbiCaRJ28JeyJ2UKjuOdLDp7evFi5kQeUVw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82556,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfXyszCRA9TVsSAnZWagAAUVQP/0twyNo2s9T2aDMQhz2F\nBAEJ9Qxc++Xe6LA7T+KhsYRpopo3cV0vERMOnU5tDaxqwk7YTQXNTHhNWySK\nPYPQMHdIKjC47cOpv1g9uCdf0U1cA9E/pjEupfIcrT4VNdzdPcUkkuCmCC5r\nBzpVgsOsve0rN/xN8rY5bjYJenEZt6fUzNmHFiZ1nsIdv1V9iYoV+GKf3tHc\n6xSym1B3P/tpOx4l26Z+HzWTSJPM1Cg24yv25bf/FPlreTH9ZZijYlxkNN7F\nUiwaWB9bz464ts4qDR63HtgRESZzJw2cx8gulQGg4/vT36DqCUKQ5jrklH+j\neI7fJD9+M4lyuwOFRSyJQq0vsKZhf+STbopBTMvgAWCqTFNZ6hdvUlhkCkQr\nSTRP7PfSeF19zHL9ZPKcsln3K8NZ9zte/CaeKmPZTGeaGeisoO8QKJxyTvSI\nSeeIRzr0JwBruzlATWthVtHyVjIdHE0rf+ZLU/NYBbPzALM/45B/Muc6VxfJ\n/zCwKVxakYRsgDoNkPvW7u1tDIr6uUHEiayNRkFipYmqqCsdx1rG9OoEDedo\nLfCwN/isGkPCfTKIEkYZ/ezjqJx9WB1uYkAd2fQOwJJbaE4WOPKAL4g89nsN\nTBLMks4+sIGsv8weqOhFWWA9pi3MJS4Oiy1+AU/k0V1HfX8Q4FwFLsxbvslF\nXe2m\r\n=rpc/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4547fd8915810d70c2ddfa017f6ad2e792851814","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.84","@balena/jellyfish-environment":"^2.2.25","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.9.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.5.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.92-renovate-non-major-4547fd8915810d70c2ddfa017f6ad2e792851814_1600072498975_0.7489868186561286","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.92":{"name":"@balena/jellyfish-metrics","version":"0.0.92","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.92","maintainers":[{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9994dc7e353f50ed2396aa1867239ee7c4ffd421","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.92.tgz","fileCount":16,"integrity":"sha512-iuMEqd0ILwMo7dgPoPM55K6vWUjv27R55vGdWBgk91J/MaSVKV9GWzXaPUHtG+N/STUeITrrMns7gvdlMueSsg==","signatures":[{"sig":"MEUCIGacnY0MgVAXHTNiYBo1CYzIqY7drbQ4XjdnmbHr+GjJAiEA/v3bFg9ybZUCX+Zbl/kECIPNGglxRdT3Tvd4HPZ6X+A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82496,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfXyvvCRA9TVsSAnZWagAAXp8P/36YulZh/Bb6t62/sg4Q\n4HZgi+xrp/xSnY1eqw8rHoHGHy/89crsWisJnSLdSykle8P92i+/+PgJhkqz\nt9qZiZQ9hWdLdZHDuxSvV2fibIFZeN2yr05eKR3tpVwqb/uMvWq3dCkV/7sU\nW5Zusg0z7oqS1sLqPo13Of7cdVg943RHrKFnBl6Tv+qkzD6wnwIBYhZD588t\n7aY9vhPvSlv3QAgr/5MD4PlyZIuFZ9N6frpPBF0tB0F7S0jloZgmNfGN+dTH\nyJvR+sqXCxBRyHYqP1NEJoeC+yMJZTLfFjJjbXexciKza1SBNDXNbVcd9F22\nAjzeV3uddQFTGk2WKeJQK4oP8/rdoYkVIQA+UV71/QLW94YGiAxghvdYHPhG\nd4NmZu6F81mTN/Jie3dujcBjuP9JYpnrUDeAcaTipRCcF+Tq3hYlcfoGo+O1\nLb9UhO4bTfdJ4UZ3kTX17Y5/UAIm9W1UjML2WM2CDwj8FQZUmBW/bvHQdaIG\nqGxXbjdT1/BzYQ8W+axxQpQDDC0DxEgAbRgcTcfECv3vZuHypekShw2Wft8D\nHvwgc8ggvtKcg5iA/gdAJHQCqyihGPuBAgJNUxb60ndAmJUG6XhwemfiXdee\nvPr9vafP6cy/C2QMTq8th6cTP5jmBPBUlD6ekFleknVKq0POAGony+awqFlm\nIcul\r\n=FSCI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a57bc71e6e4b8d61809700746b4187710bbf501b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.84","@balena/jellyfish-environment":"^2.2.25","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.9.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.5.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.92_1600072686781_0.7548574214643216","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.93-renovate-non-major-13847757324098346b0f24534c51a7c057a040c3":{"name":"@balena/jellyfish-metrics","version":"0.0.93-renovate-non-major-13847757324098346b0f24534c51a7c057a040c3","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.93-renovate-non-major-13847757324098346b0f24534c51a7c057a040c3","maintainers":[{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f317fd17fac4d5ef9fe99a5d099ce24109b351d6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.93-renovate-non-major-13847757324098346b0f24534c51a7c057a040c3.tgz","fileCount":16,"integrity":"sha512-lX5fzPwAYqW3gI5idE6wUJw7wSyRgWb4rxndH+yuEleL6vUlACDJJk4AlQw0SM6nv9RydePJMzwsraBK4bjMrw==","signatures":[{"sig":"MEYCIQDpU8ZBdEQc0WtwItt+dvj5wKabrDzN1uz8zH0XAkuzmQIhAMYjSlb9MRqy9CrUOjK+FXTETTWaKleYhusYeAhMKlb8","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82667,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYDThCRA9TVsSAnZWagAAeu0P/jGlESPsjkE9aaqYKOWU\n8x7K3PAjGPhRtu7Xm3uiMtBiTXFPb98tRuSvodmgnotWh+HPhz8dMCuglOK6\n3daIT095DUvJU69zshgnAbBLqMyafehg8boPFou5QPeZ5f5vMiybUxyrEZ4T\nrLIVdt29VblRSHTekFK8GiNBHTcNa+W+XcJq862HCq+HJB7Q2qbxPEGkQJL5\nYGfSpPbWJWKSSp/u5ETbvAeBPDtFlZZjdgK/sTVKLx1naRX0tqJx6/ZfL0/u\nNcK39U2OQeuhfWcRGHuy67u3iaMxYeqXS1IDcNvGqq2IYxj3L4E53tbpnR2V\nNXu/lgCRpNm9aDoac6bL2bRAFlRUi7qRBtx3KKmhxdO/h71L1nh++hoDRJ0o\nOB1VGpBgMT1GqjZqnM7qOSxsygj0WdqP29m0/e+RHqFWwW7VnEe2ZYpyfiqQ\nI0XujVZ2GPaxftfwdnK1A5AQg5Kp3RSgCdnBGeCXLfu5+ZMcm96tDpLbb2/Z\n8HVxh7KvhfIyx3pYSM3m77zLU7tmkPUaufzY1U8aOPaRQw+og4vgYqzZHgt+\nH9sxfzeC1GxiUxc8gNNrc8shuIRv7P50SZLQGB//wUnZXEY0y/+nob69Nnsw\n1iSBX6WJXV5kHpfwdRtxkhsc8mCO9oGiufgX46tvZgzX/eXVhOeprGn7sjet\ndcR3\r\n=tcHi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"13847757324098346b0f24534c51a7c057a040c3","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.84","@balena/jellyfish-environment":"^2.2.26","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.9.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.5.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.93-renovate-non-major-13847757324098346b0f24534c51a7c057a040c3_1600140513248_0.536952761799242","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.93":{"name":"@balena/jellyfish-metrics","version":"0.0.93","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.93","maintainers":[{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f1081a1d4b5247582d20de1af5ae55c3bc97da53","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.93.tgz","fileCount":16,"integrity":"sha512-EYb0KGh88S2A1IlR7QIeCHWQfsvGf8VHoIa2CidAtBpAr7f1UmGQ3kM5CNg+j6aZk8kfZT+g/ku+SCoQHA/6tQ==","signatures":[{"sig":"MEUCIQDk4GUmR1KMfgZzwtmEUAGVv4JChBewdYK1Nz6JdaQKyAIgQCud6ZkYRFPuhRAPklFO8miPXSsAJXBykN9LEFonWFE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82607,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYDWBCRA9TVsSAnZWagAAL8IP/juc0HgIS4RMHB4y0s3U\nK7jvtKn2Z2Njk1qQW4L6KtlFDnmdkv1FXBU2EG9oKVUZ1kP8FVIHalTadix0\n9mL6ZGExr4z0ngdLlADE8cPGLY3mque0Yckg872gVnGjf9ol6OrEzLQu4u9d\n3mBNw6PQ4SnFHsiW+/0gfOs8KLMF37EC2UE3Fzu3qHopEPzKuE6En2kmgse7\nOw57O9leRiWBuWOhrcYiikrKufjiXwrRiZL8qSF9sg+qqhhRxllkYEB6Kz68\nEYJ9n36yayoGbMXljopknxD4zhTOUX7xaF77Tvafqci6NAAdK9BqWvIQm4EU\n1jzN5pLbKiBlZxyPSFIj5079NuTa29ma+47xEg9KxJ1nXRg4nkTZRLDay4mi\nRyUKqkQOLrPMa2lA/Zl+7Fj6KN4uT4Rex9oxNvpAuQyWn4DG0K6IUSrDXQso\n+6LnpA1DRFZDfxvefJaNJ5gGA4QMRJKieaPZKn//Of/tS260NCe9YtCITzSm\nOBr25W71UTGTMhiBLdZsdHhmoDLoEub8Qt3O0rxm0ZhhOKMrJQLS+W8GsBMW\n1slyMOiRWh89647gk8vCvj9AJrq11LKb+SXJR2xpPVzGNVa3rmgYX33iX+Ns\nMdS9MnhqPwHLpvPFop7NqmynQg2BjZ3Ve93CgEzvWLdOC4qP6L1CkDxBfe6u\n1csK\r\n=PyrF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"41df4b9b15da24baadc9a88a610d87c58732159d","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.84","@balena/jellyfish-environment":"^2.2.26","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.9.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.5.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.93_1600140673160_0.028218044266244524","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.94-renovate-non-major-fc364f9a1403d55171f5c27a36dcb7e4f84f4ec1":{"name":"@balena/jellyfish-metrics","version":"0.0.94-renovate-non-major-fc364f9a1403d55171f5c27a36dcb7e4f84f4ec1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.94-renovate-non-major-fc364f9a1403d55171f5c27a36dcb7e4f84f4ec1","maintainers":[{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2bf746fc3bafa377f8284a59df817ca18da6643f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.94-renovate-non-major-fc364f9a1403d55171f5c27a36dcb7e4f84f4ec1.tgz","fileCount":16,"integrity":"sha512-CTJiQvmSuTeXVuE7z6Hbn74BwGwxrYtZxA8G/GlPuqPQB7v3bWQUNnepNRN3DBYQW9DmRsiqlX8pt7SXN35ALg==","signatures":[{"sig":"MEQCIAZGdbHy4LV3nTJR7tJLsFElsjEX0YL9YaIFaakxhkBsAiAcZ5j28W1MXXwEE0XWfsLOyEkvG+4cRUgZ5RG5pCrVzg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82773,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYERrCRA9TVsSAnZWagAATMsP/1bDDNGhKkxpiBUTR6L9\nimd3SaKd8vucZaDHEbrRGiDrTWd/WjBOvS5RMePk7wmU2h8e0eVmI0ax6E0D\nSshP104NhaHpqJua5RyFiq6iuFJtHZ+plLhuf34oQCWgJU0106yKPlUktxOu\nKJsWqkcOg/l6eDhh24n9Kv75rpIg1CSd8DAnU7/nOnD6N5uzRcgUxhvSCHl3\nY/qWuwdYjjHoj7Qm564Oh/hKbYG4W4HWmVaFZR13kFLL923UeOnxxFL6yOXU\nxlSyFIPdRxWJNaCu8QXVIEkWWwP9thXmK31Ds64mpjSx4R4ZYrjI2ntcTg2+\nmZHc/FGATXwzzXBBQvGBibbLrz9g1qIwiXQ3cxF/HuZMN3g809+8Ogb4thmj\nZJbF6SFvOdvO9w+dmk+gNwTjOR8vJxjql4OcxP4t7uWZ7f8gnMXPo+VfmUDg\nBRit26GJkbQxDqFJIEY+363q/Qok1g05QKDmxJiNTAp8fVr4jNvf6eQGt9Oq\nt7vDVwoseV8m1TOH+5XukO/wZqbfgd8/NU+OKwEJD/sW1C/d6jy4bY3VFlH3\nru8tHQRRO1cabxiSaWmNs6soiHZO1Ka0m8ta+my0po7BxA9/M0CkLtPjpo+m\nMohvKtCIahd3ve6fV1g046+lAM8aWKh15NVLYaLJD0AA6p9UBmwOlRTTEfBk\nOEHj\r\n=60Wr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"fc364f9a1403d55171f5c27a36dcb7e4f84f4ec1","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.85","@balena/jellyfish-environment":"^2.2.26","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.9.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.5.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.94-renovate-non-major-fc364f9a1403d55171f5c27a36dcb7e4f84f4ec1_1600144490684_0.1722632428826132","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.94":{"name":"@balena/jellyfish-metrics","version":"0.0.94","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.94","maintainers":[{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9e385e772f1d5498b0218e8de9a020592611022d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.94.tgz","fileCount":16,"integrity":"sha512-0Wq2jS8iExu0woeKgZ1Pl8PsHVmZN8HeVOTQwAa2tVUXFd2PvVdMjc3XadknV1ecw87I6kKkMZDke2kRLlY93Q==","signatures":[{"sig":"MEQCIEDmrCp8ilgHdj4VjDFNzXtqyd4O1v1N0QK+oNnaSVWNAiA4qyjxQfPmmSbaSLvC7gnpVwnjCINQGEGPaBoEtKSOZA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82713,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYEUgCRA9TVsSAnZWagAAidEP/0w/bxfGxN3tAO1Ecav2\n6D4+zPcVj6WUK+O/UskgCHNQMGKj99gCgDBHT7n9zp875eOMdPaMBU+csAWT\n173Dn8XwzU7oPHCv0+AR4QawPMPjkSn19flzS6n63cPbktcrZEPmoA6bAxB6\nTGmmdIxpFlo+StKHIfljdZe0dIeFIwKWyM4VCu3Zo6RCVLDJX8boNNfgWoox\n7QNl7NvYEOYbh2jOwpJ9vBSOVM6Psh2g67uv6v33s+NnbQ73A2ZoePbc5izr\nEToMIg+SZpuRzPQPxm/FulKmhaUq2IQHW1k2tnEwUJkE9XHNuY7MlE20V6Ab\n1wtN59fYcaQNS0FCuNfqQg1o1CSO5CQmxq3KSln2N4kLNZLzQX1IzLUJRtwE\n0CIHsy4J+HXCN2VuWb17jQ2Qrl+7N4d5jWX3UYoF86hh813wUWBZRyhMRV/o\nxPyo8AOihN4agTlfLQr160wmQA6X3ZeNRP7+Nrl89KJJC8+8J0s976Pcgxl7\nhwGPQPX9ayovUut3Dvg7qjKamV+L9xobLNUvwRHKpahXbjGWPW7nk8tVXQk5\n/lTUfEXN9AWQvR2xNN1gu4+JVoJJDasVeTfHBfXfUkmzeVPlEL+NJjJF25Kg\nhixjqif2B1M8yiJOesaEtglljZacdDaFvZO3z9pm/yZtfuiR49VddgLmhIW7\netpQ\r\n=OUFo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"86f422197bb54fc4d100dfc7dc60bb68bcf8b6e7","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.85","@balena/jellyfish-environment":"^2.2.26","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.9.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.5.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.94_1600144671823_0.3168509520887475","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.95-renovate-non-major-5c1f3a849e27022229a1421ce1d63488f77da0e0":{"name":"@balena/jellyfish-metrics","version":"0.0.95-renovate-non-major-5c1f3a849e27022229a1421ce1d63488f77da0e0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.95-renovate-non-major-5c1f3a849e27022229a1421ce1d63488f77da0e0","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7b8b4b9f012b655ffedf19fb92eae082a978135d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.95-renovate-non-major-5c1f3a849e27022229a1421ce1d63488f77da0e0.tgz","fileCount":16,"integrity":"sha512-La0yuGud0nGY8WbCi5++4d94Rpa9PJ8QZ8lQGtv6nvuyiSKG8foETQj6tYHks/Vt9NjQCXyZmd1Zy26ocFUvaA==","signatures":[{"sig":"MEYCIQDw8ATj2P2AMBtz10gbDXYl8gRXUjwEEBy6NwXxttglXgIhAPG6EIcQPP34Ig/fI4xN8fkpnzzBY6X6wY8dw817CbzT","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYhiMCRA9TVsSAnZWagAAA8QP/jpbvXRutBy03s3KadQo\nVAwqAP9RgWD7AwqjYS8IYoQvZOQpeuJI6WEjecskiP/kbEHkYZ73cELk3JfJ\n1ZIMgtazli1lPh6+uJpD4pirRZfFhpUY3B1UVnjj5gEuxSyd85IDl3LUWGPz\nZwarOFfVTkGCEOYokybJ+PAhyBHpTAa8MDl+P4HMdEcs0vfTw2414UOWU1iz\n+wkkarcOBAhHlzE+gK2nJl9lwxoqGOiRey6Shy1ng5AfU+8Okp/TEHTHQ19f\np3FtD5jWFn9hOiW2TEZwSAoPk1JbAcwWaWSTYlaosgwhraStqYdeT1uk2S+h\ne1E4ufBGFesKIne1OtNS3Ana2LDKWuE/eUbMt5E48enWXiERnKE83ZjPRz2m\nwTHNHA+n1hGguFEQsvn2JCSVdgTN17/HcBHnQpfkM2A0BWL8XC0qDrM6F2Lg\nN9GEvGJgbzFo0FrwAaPxFH4zgQ3rs+a0MCf8QInPEM/hKT70Kde9TpQ6woDq\nXc9/kg/+4H4OIamBQiueMJxiMb521t5K1AYiPzItSytGzc4Yx/nYMYj6uG3R\nYt9QTYFAivFt12xFr7Z/0uJ10Us+Ao9AETy5VL6TRs5WclrTgUkkzHPaf0Jx\nwT1/ixjh8XBWnoP8gJotdI1DUDk77eP7XQ7/cNQs2nVx1JwKBkPwth2rmWNT\nX3nx\r\n=V/eQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5c1f3a849e27022229a1421ce1d63488f77da0e0","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.86","@balena/jellyfish-environment":"^2.2.26","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.9.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.5.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.95-renovate-non-major-5c1f3a849e27022229a1421ce1d63488f77da0e0_1600264331609_0.4174664097320617","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.95-renovate-non-major-4cdd8cbda355b9a59f6dc2883d6ae7278098d2a0":{"name":"@balena/jellyfish-metrics","version":"0.0.95-renovate-non-major-4cdd8cbda355b9a59f6dc2883d6ae7278098d2a0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.95-renovate-non-major-4cdd8cbda355b9a59f6dc2883d6ae7278098d2a0","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bdc64c121b21d5aaf65d084df6c363d030c8dc98","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.95-renovate-non-major-4cdd8cbda355b9a59f6dc2883d6ae7278098d2a0.tgz","fileCount":16,"integrity":"sha512-+HRthsCPSgxqqztUDojFmllTuDBbfW52vQa+UUB2cAbBouPzCwPutWXlKKYIKlb2PdjjclIzpIighuYgLwPV9A==","signatures":[{"sig":"MEQCIDvY9gHq6urLeCPT7MbOVcRpK0/y2TLJW/s1x+dCm+U9AiBcoFgZCHZ5EG7k7s3oZOAtnVVQmf7YRFYiT9Q5qY+S5g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYhmmCRA9TVsSAnZWagAAoEcP/2qij9n7/mXxg1PLGamq\nTUHzYga5L9rUTRB65Z/AP+9mV5Ccx8mUhsaLvT5xiBLZKCBkx4h6sBCEyr1e\nd0pt97clu23es8+8KagFO9Pqntrh6IeGfsR8lkYXUiocGBk+AXb0zzUmDCfp\nyepj9Ct2ex9yrKHor2d94jUW/HKTgVf8/ZseFp+StRveM2bLNmBl4keVAypV\nFAHVZfz4k5KysiPRriJvoWfN3/miSezc/4RNhMZ8V7wPZMTEgMgS2Iq+YKpp\nsNbqxrTNcoZTouIL+9TKqyM2w1HhYPLzLJunRcZ36FJPtzAfzUfrXO8n+6cJ\nCMU0pD2pmCmv30+9vmWZLjBCScGCZTBsijke3BZT/Z55F9Wsxw9ERGus8D7l\nxs94joe+qINhP6OBzFD64kZVYWVjaT0Iydf1+qj8py2qwctNXULGO3t+THyM\n8Nyb+RmdWEKF6EgV/KdNT2bs54JdAdY05BXYmBr0RjtodJwAvpmCpDV5IfOp\n8KIGgi4K8qZcpVUGu+R2S1ISCyuv5J8NaADDgMWdzL4AertkMyePyrNytUo0\nfvuqhmc0LL/J6sxqAfc4Sc9gGpJS3dKAmXHG2uXyDYGCQdOrfEzWTpFY3upi\nZ0dOI6XFGDscfmyfi0VEwoxEpeek1Ngq5oTY7iP4a2HbcP0wyqyIBFMKuMoP\nIZUH\r\n=9C7j\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4cdd8cbda355b9a59f6dc2883d6ae7278098d2a0","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.86","@balena/jellyfish-environment":"^2.2.27","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.9.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.5.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.95-renovate-non-major-4cdd8cbda355b9a59f6dc2883d6ae7278098d2a0_1600264613664_0.18092862640312823","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.95":{"name":"@balena/jellyfish-metrics","version":"0.0.95","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.95","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6c6eb77049d160ed972bb7ae8506d7045baeaf34","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.95.tgz","fileCount":16,"integrity":"sha512-PjY70NkChrPf2XI3Orglo6tBGYzH4Svbwn7DsKLx0BCXA4XckMHN+bImrhwIRt9CJmS9wbz6/rgtSfT2yy74vA==","signatures":[{"sig":"MEUCIQCjBnmnyX7yVUycGAEyxOKYo/3ELHgzue8pkf80UJSi/wIgF36RCL3cDmo7IUSINk2Dz7tCGyYV1d+HpzoMJ552CCs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYhqJCRA9TVsSAnZWagAAEy4QAIoFfEnC+6s08u7EeMvF\nBnvI9eAKVdFP+fzb3R104z3TMzewmrv8UW9ugk2Nc+xSuYqXmzZhrGBRV530\nFyidClS7zAIkTq3rELEX69xrBSZaii4qNA34GDBbWR2zmths4sz3w9vDETV2\nxf/NHiuMOavwjavlawkRBCruuMlamiN3+nz2rFfDPRW2ho+VvChzHPNj5yoU\nCwSutfGzOtSLawUkst/66/i2GxskLH73Rciq+FyZdvEaA4a3D4XmLaJXqCdY\nkqW65WP0mRYaSXP9Ek7NHgTf6xSq5ALK1MfctkmovHLMNlNG/ET3T1fjycmY\njLmW1gv6UEaSwB9wXa1PoWTHYgoY0ELe8mgmuHK7N3yRi6hYxoK+D4nsPFMm\nPyql9WR2WI29xNK8ZVaZ5pSa7t/LxwqQH0CsTRCermp/qcMIueSnyM7mB5m9\nOd0j10cpLi1/iUsuwe/qQ0etkdJdSOf80G77ROQLNp+AbxYWRt8fFvYWgUww\no/LkneHoCdcFzPCs6TDxI0kpEGlPh7LtCJmjOOmmVHhDM4C/GnlEJFY1W1qF\nBSrxUFQUuDmOKPo8C75P/0eiP22HP3hP2+DXAFlwO6sI8vu59Yo8UC65OYPA\nMbJpivAyzQ6TD3XJNuSgwupt8AvGmK+vhJLLVHRFrXCkjU+nOKGHGNDSMknz\ne2v9\r\n=UTXN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d03f960ae0513c846e58c6fe3e10930b689192ec","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.86","@balena/jellyfish-environment":"^2.2.27","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.9.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.5.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.95_1600264840565_0.9403079781329682","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.96-renovate-non-major-d272596c9c0f7db503283febc0aa69880b93ae28":{"name":"@balena/jellyfish-metrics","version":"0.0.96-renovate-non-major-d272596c9c0f7db503283febc0aa69880b93ae28","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.96-renovate-non-major-d272596c9c0f7db503283febc0aa69880b93ae28","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9de2c1f53d16442ef33fe9271b9629b2e1947a0a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.96-renovate-non-major-d272596c9c0f7db503283febc0aa69880b93ae28.tgz","fileCount":16,"integrity":"sha512-H0u/7m4hXthziOEbHaTKrfeme28UeE543z46WEsCB9+9Ue626vnDRbNni+AHW2W/lPXkttgBKEBiQefnWgi8Mw==","signatures":[{"sig":"MEQCIDvGJwJDY0PuUC3is/bCJ2olaPuVb191RVyPDB7l7uZCAiAL8vToEnOWZFpOd+kz2e2+sIH3b5T7DhUCjOhHqoznSg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82948,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYkjACRA9TVsSAnZWagAATtkP/RDXA5vQcFpqUWJslwLc\nCTl7bAKy8Ohvx/inVbwlgSL+CDlFaEx6OSlXouZu1p08grQ+xLtUN9WVIotG\nJT+zzTMukKCjtgjhMmU2sATrIWU2LI92iZPW1MYgPHViFyFJRi1tuUgWMaP9\nYbCC0V4KRTOcr5+JQnYWZQotLxA2uI/SUGUKEj2e8mnhlpcPyXduB7wnSpvI\n36hMn/6ynR6d5Sws2Lv1BcAzq+LFZESNlZTyBJEnsY3DDS5eRn2trfGdgWHQ\nYvvkddS9G2VrXToe0Y9cwE3DBDwxwVsp+2PVpI2ebMosODk8bjmQUy7qrdz/\nHDisKFToNA1N+GfrTASzMQC7OeDTApIsrYaOsEQlvn5Ns6MbxfnAWSS7QG+U\nApyoUzIconRdFIia3TNzV1kVDaCzaeKP83Zy0UJfxxJs3tfG8bpvC0TvuUJ3\n7kIhw6u9kfyVFOGNvrHIjC7jQM0JsXTSqVxnrL0nolNkNJvjFMLk+MuPJN1K\n+Fw5RudoTPciBGPxjkMlz6OSXyhQJTv1ImKdzQpAl9Nvlho66n6fdKDkWqOW\n4JUPg6mR5OfE7CUYwe1X7soQEO+3LTOmFzFkzYb7E/kFbNw8U0Hd3XgxiijY\nLeYT7AmGa54Ll/1YB73Su9QMx1aW68SoruPIoDFaIgiN3DE4vc+D7TjfyqVx\nhXL/\r\n=1sLU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d272596c9c0f7db503283febc0aa69880b93ae28","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.87","@balena/jellyfish-environment":"^2.2.27","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.9.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.5.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.96-renovate-non-major-d272596c9c0f7db503283febc0aa69880b93ae28_1600276671379_0.31938654797824984","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.96":{"name":"@balena/jellyfish-metrics","version":"0.0.96","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.96","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"59e4c27cb75fee3e693742bff3f41f5a2f5e7900","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.96.tgz","fileCount":16,"integrity":"sha512-8JjvervAF/+42OdSYRqRVHqO4HzfB4800WZkW1hi83j9E1Id7ZfZRFfTGDD0+z/efn92dcUf0Cx9CABjnVQVug==","signatures":[{"sig":"MEYCIQDQ1kiqy296dIcvXBwyiExjZg9jbPukDHBAYYU9isjONQIhAOp3SCTB9Eckum/XFdC1khcRrJyuYmyyczRqQ8ycXXKJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82888,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYklqCRA9TVsSAnZWagAAtoQP/RzkMicv2u/MSDeAw8MR\nNLuEcfneTRjrF015n7toRvT17qabLn0M+MaOlv9UZ4kQ97mqDeAXm7xXEpmr\nVaahB/W8BqP/FcQFHCHNzhyOc95YOpA3gdL4xiduMygw/pSf+YFacwjZxKBP\nec1yXpICbIWzavFihuYmWOizigSHV6wPA5LEyrSxfEXBrjb3PfyJhQI6bby+\nZcmilXzAm+5c9aY/IQkHzktfmoIK1y7aQ+Olpb3BqEKkdHR2yhWVahsZsdbH\ns3JrPgPtpRpGUq/Kgwa3Ihubj1xZnBeUZeCmmYIDYN1UGdDw3K8TzsmTDFAe\nEYAAJ3Eo8lUAwFLwR14iAXUhfLPpSSlIYFnuQ6Lhpy4jv0OKrNqeFw2ULnWF\ngQIBJBT678/b8EmsKj8hZOONt+r6WOOQ5CnfmFJ8MBPXQSb0CTnV0J3VRcCe\nRH/G8e0i17Xg5A+65SlRb153VkwdmJ1ZphYUFk1KpubXQ1+IOEAfx5ZqTNoO\nMtkF2es0DaMO/2yckU3kWk/kQDrYeNlc0BVS6GcXjfFhh6seSRx+C6Sn13CL\nLfc0b4xw5PShkUaSzB2fqtyiTMeX+QNKm2vQ//jmW4DCkVJeSD/rBggN9A4F\nbJyZodzA1JCPuXfsvLAjknEvWARn2B1EBHMLCKWZW1+7eI7hAMgL8baqQUVM\ndaOw\r\n=aj1t\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"fa18ecfff9f5e517068b41a7566b8b3f356706ac","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.87","@balena/jellyfish-environment":"^2.2.27","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.9.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.5.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.96_1600276842336_0.6611382624453197","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.97-renovate-non-major-18c5f6dd11f10508c83ad19c52e2b49213b972c8":{"name":"@balena/jellyfish-metrics","version":"0.0.97-renovate-non-major-18c5f6dd11f10508c83ad19c52e2b49213b972c8","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.97-renovate-non-major-18c5f6dd11f10508c83ad19c52e2b49213b972c8","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"976b03b1705e4c44a112865f6b3290c63506a787","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.97-renovate-non-major-18c5f6dd11f10508c83ad19c52e2b49213b972c8.tgz","fileCount":16,"integrity":"sha512-NIA5EZsdVRG3d4NWnZtJjCtggCE9IdJ9SM1TF9lX9q6yY8R1nHjDgN2lblg+sMqnL8l9STf/myZWQgzF18zS1g==","signatures":[{"sig":"MEQCIDzMD0b0ifdiA1Jn3/n+SiMeOOMgqAaoz2unZ0U3IglfAiAOks1pRc2DbQA2EBmKnyFWI/o787kbjK1AbDytitRpwA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYle/CRA9TVsSAnZWagAA2FMP/iKfOlfn9Z/nzK6aTHpw\n3ueixB1zP5kZ1UanLmofIFv1LTPH9IS0vcNox2yt0YNQOzz6wRCxzaPPVaQu\nI7iZ3ZfkHx8ViKfVCe/nTzK3+HVGEz5+PO53bLWu341s5AKYu2x9G64ZQB8x\nQFFs0eiqf5DZ+NaRBRaO/PB1WnKWGAHokmLWIACR2l7c2fq+HIwxcV0+FXK3\nQu1o8ktc/3Zaqm6zPSLzBpsLA805zhXzmG8Av4lDSPT+5mPTM+pWQinxGpit\nN0dozn/P0oRnTjNGgKmLmou2So4ZTR1p3Aah90et4+YjEYclppcvmqrBik9n\nne4BQ2BXvpG6wmtbWRM4VMbHTbmTiJP3Zo4431uzJh8yN9Ba0nN/aqMBPeSV\n+I9BeOYO8eX3H30FL74c2xVqSoxI2Fd30VKtOC/pvsHjtdvIz6Me68TAUs8D\ncwc/VCC5Y4OYx/sjG1UkDDSuNpIFe42lQve90nD3riWXrCgRoBDiW+iByEy1\ngIqk9TRMjkSlh76DH8Fmxfdb/FvNB2gAUZbv5RcDNgghrbGTBTdc8JXutRiq\nVDUei4ckUWJ3uyiGauv8tAhb2QLrndi9DTsVz5ENUjXp6QL8efTX5P/W5bki\ny0RSKK3qKa9N0r2Bi0jpfwToIeGygVKISGIxJjmm5R7BJjAOz6jLWqpwcmK1\n+R/H\r\n=6eXM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"18c5f6dd11f10508c83ad19c52e2b49213b972c8","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.88","@balena/jellyfish-environment":"^2.2.27","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.9.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.5.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.97-renovate-non-major-18c5f6dd11f10508c83ad19c52e2b49213b972c8_1600280511044_0.24792381480717585","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.97":{"name":"@balena/jellyfish-metrics","version":"0.0.97","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.97","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"43d57dd77373a93a3f2b92670267f5d39e2d60d4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.97.tgz","fileCount":16,"integrity":"sha512-kKt9ZBgj9Mreom9zFQYP97eO9JWVlpvGP2qmzfe/UaYpGrx2G/PZ5+YcCJhlxpK3kkHcFU4Nnw6ebEzVpDDbSA==","signatures":[{"sig":"MEQCIC0lrCZHLVw13jMSjCw8Q9sLrYH0MczpSg/NZt5q2r/BAiAP7D6hwetjvhfHG9cfo6OKQ1cJ1rIsjmPT4RYZVMLsfg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYlhoCRA9TVsSAnZWagAAKCwQAI0Td0nQ0z+be4VCGvte\n7U/gU4/2FpitedWWNu0etws+p47gqI66JTTD9f0bK+k7Fv+fxI4nmRvb/F4c\n6oTTUPZQgNup0o+ShSOfyTbTSDs741r3wNWhpyUjuX595KTIATWWRg9goUTD\n/kLStxssIa+gwaJnNWu8qdizj4cNxxkCKGixxPNyXS8H8MInqBqfXswDPUON\nCfwVX0Jb9oZGDXvzyLuCCYamwGG2C3yMdaYNnxkwyIirAMIbLRCKtMQ7idUT\nN++Z0TPNS8wiSR/vsZfsPw9Khs12xmwwLf8w2AekHq3749pq7o/DxcYp7md+\nGa8dUhhBGYhcAiWbZ7MLYhu9BqxQLNhEq7jShYv2ufRYPtbkDf7P7I/45t3C\nieBNnVyMjmC4UoEHyPMEodab5VSU8qfIvCYyA1hz/vBqQJ/2x9JHT8XCJZw+\nIIBNlLv50p4GOZDRomUJb9aHcQDdmENNraG3TUosZsPJA1ZUZuq18xXnezm/\nNeBQjRIAZFbog4crnuzS+uJ/Cw14VHcPvKJ0oW8RcGiVUKaOJjxoWkLZvfjj\n9KyyppQYS4QPaOLBy8LqxjUIJwzP4Angn3Z0v9qJv8xXR45m469nsKhW05Vm\nF6S4+RWgWBejZIbmEpGOnquXOVrA7gNxE3Gjcr4P3P7sDDX07YpMT8qxhkrX\nd8HM\r\n=SMHR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"295eab707afa159dbb7c89015efadeb805cf8f84","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.88","@balena/jellyfish-environment":"^2.2.27","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.9.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.5.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.97_1600280679977_0.18450659616915321","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.98-renovate-non-major-b5faf6158573de619becdfbf2c839f1d5bc8a071":{"name":"@balena/jellyfish-metrics","version":"0.0.98-renovate-non-major-b5faf6158573de619becdfbf2c839f1d5bc8a071","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.98-renovate-non-major-b5faf6158573de619becdfbf2c839f1d5bc8a071","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"daba16fb6de057c87ee5c5086aa156a7c71bde00","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.98-renovate-non-major-b5faf6158573de619becdfbf2c839f1d5bc8a071.tgz","fileCount":16,"integrity":"sha512-nbH32sJhcjnMa/HuqUr/wQcwDClCmhV9zVyRGPoHFzh3r/wlzjVduj8htmcd8T5YzWnp4wkve2E/rdRQ5Sha6w==","signatures":[{"sig":"MEUCICBimSv4v7kJI/X3KJIi2rbnR5MHUK65jWlQ+Li/NgHPAiEAiX8kjQ2qx1XMoUll3L8mAqq4TPCex7SxpU4mvwazTDc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83160,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfZHpQCRA9TVsSAnZWagAAkwkQAJqETIBqxznB+RxK1Q+z\nuxEjU6ZHnAMBtRAN0IxZqPn6BbzpgOLtyAiE+xkE4ulFgOPmALf1RjiORTZd\nsLhuSBorx2iwPtG0gFxAcIwEgTcH4880AkFcY0oOjORSF0Sh3LR6qp23sRoT\nSDOup6ra9JFNL95y1XFbPChPoG9hcxiRnIMPd9xTRaULP2I4AJjOZQF8FSbo\nIo/em+EnZgTJTSr3CdsJRxEHBQ38QhlOFSsGh7Hia5IBESI1Z8eHsr+8tD1A\nUKY+c447xskSR638p6tUL0tL5SUQ9fgcKm+k4WY32P2+OzwqpI34UEcvmtWz\n4PLS1v6OMxcKi0KuVmgbuMwhLjoPHH2N4duCMSmgUO4Gsi/KTOADTXksd/d6\n46Gj1fhVWDjy3wEFuM4YqtQTgsVHph2Dy2D26FGc6E49GA3HNN4JdFtrde9w\ngoiWWD0ZhY83A9ZQS0Hp+F2hywdP0+pUaQxZ4imrI5aBKrTfh/XvNZ+IKJiP\nkSU1OTJlgwwV3OzT0DhScdNQIi6rOmV38RBtjPf3qA9PHhu9FLjMCL32O7e0\nXsPgiLMrkRSULqaLhl8s+Oyrs0FYtKRZfyvyQsKaNdG+KENSRnUDZBE3ovI5\nKqlMsOevV5023pXRWgvwk8stJv2tkpvREPyR7n6QeCNTVRe0t3gXkOEoIr7r\nUUZI\r\n=oDUX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b5faf6158573de619becdfbf2c839f1d5bc8a071","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.89","@balena/jellyfish-environment":"^2.2.27","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.9.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.5.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.98-renovate-non-major-b5faf6158573de619becdfbf2c839f1d5bc8a071_1600420432469_0.9786749173809155","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.98":{"name":"@balena/jellyfish-metrics","version":"0.0.98","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.98","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e4714db10d3a99ce8a4c7e93c7b0f418f3318a21","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.98.tgz","fileCount":16,"integrity":"sha512-g7bv/yTrSKcx/bWrT8PfeyVIdSxKJYdZ12RlK5TnY88iVuyZi7mk+A53GZn9BBGtooa/s79oP1vOCkwk1srA/w==","signatures":[{"sig":"MEQCIBYdOnDdyUXkoBf8qeQtBNQpJqRZXBDx5AAfD0RUkrMuAiBFmmJ/BVXLWBBg5qNdtN1hkkU/tWcjs/kOZXLe2doOjg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83100,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfZHrrCRA9TVsSAnZWagAAKVAP/jN3+9+NF7t6X+nrn7nT\nh+svVYPjUsHABVgm4rorHaSZV+sRVoge2qw9B6Btp2JZfVfpSDRoh3p1zxhR\nksDMkrtHElffsV2weLMdbOuvELn9erZ7dH6gczUHg9OmTtFyVF0lbRKfhKqf\ntJtB04MTLPz33Qz7c6TENfvrnX8zoqQXcaJawoks3nlYkNJwfcQFW2Nhm43+\n7Alz8nPA7EcglOQoct5fMYY1v3BdCoVNntiH7WfMPHatTqTo49F+ZsxoP423\nHweUWwEtxicZbfM37jEWV0w2aqLhaPM+nUeD9BembgIxSjrRdC3myWOF3uMF\nLuXpN+Vp9DZsa8WRW2uR6O5u47iJN6gsEXWqU1x+EWDXJrAuB0KWPT53teHU\nrLid11/8rQgvvnMtoIjfRQrhxqwANCuY9DUn9JtIeBLo2yqrCUjfAVXRmKGt\nuIUnR0sb4INiOtWgjqH+LTG9r7iJ6rYSoGs5w+qiLWkoIFv5Z4Z8ll1XWLyi\nPo4Bd16XfbEdYj0QDqxOenxh/BGevnBG/dkTHGKaeX4mO7kJKn2LYNaXT+LY\nyqvI0Lc9yIVobHSkC5e1nu1UJugkGvwdvPNOAChlGoav/KCqaWy4J2d6H0P2\nN/WgNKpV0gsu8iAAcWIF3cjqqbZH6D4fKStP9bL5hK+NOYfu0Ics3WUW1uac\nc70u\r\n=QsSY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b3fd0ed130dcd00d8d75d0f2b599314cb447916d","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.89","@balena/jellyfish-environment":"^2.2.27","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.9.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.5.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.98_1600420587496_0.3633025917733952","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.99-renovate-non-major-09b9d6bce86219fb8d97135e37f12ff8089ababe":{"name":"@balena/jellyfish-metrics","version":"0.0.99-renovate-non-major-09b9d6bce86219fb8d97135e37f12ff8089ababe","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.99-renovate-non-major-09b9d6bce86219fb8d97135e37f12ff8089ababe","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cc583ad6c2be11736e3129e5524fc5479146f3e3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.99-renovate-non-major-09b9d6bce86219fb8d97135e37f12ff8089ababe.tgz","fileCount":16,"integrity":"sha512-ipihLPGdf6Kqhvx5Qde1GftKA5Fpeilrqs+zrJ4oGIKWgN/OKJrpxKRXeVtW1byaSIJAmKDCOQd/iT6e5SkOsg==","signatures":[{"sig":"MEQCIEs2Is7wp+sM3gBokwZoXACYz/s4bi0CT0lSxVTLU+5kAiAmwS9+7+homDkkjTbRBA1p50PrvXqqKlywg894YE+nDQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83266,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfZJO7CRA9TVsSAnZWagAA2SAP/3f7LzzXlJCuy8NEj5yZ\nG9qxzRmMGFb6JRdYNq6FUIJ6oFK2xFFqyd4a0DJDrH6uTMfG6d2Ym0ibXhBX\nVAVc1KqwpFCMNYo+Ua/Blu8orMu64yk4JyeMSHhRtQ1jqSnu7NO4NfJ7o1cq\ngLwkocbN+ZZopAfix/qY9rdnu/V0Szn/6vc+yoAZP+A8zQn0z3gMIGKI37O2\nQWStX5O56mKJiNQuNYioD4k34sYTM3EVpaFqqu5W5ZTY6QWR9WpqwdeAVQt2\n4kk7VPz6F6rPSQQtPQbbki+/dvTOtORq6onUXqojeWrpraJqrONSNBMT3LyF\nlkTlesLJiNjftwbz0vo9+sb+0MNLmjYnPCGzEgucjshoT7+Ex80ohcVjQ87N\ngip+dw/kSXokn5WxxZyQtMFfeEB2QHtwUQcGrcCy7rIX9b1933TS17KS0kMA\na6sjwIlXebyQC+Z6p7Y4PldNmJixDNzuiV6aliTLBXAUYzNtbCRDm637af7t\nddhC6AzOk0bXDllLEtp2Kzil/ca2pWm/Xga45Fmorepoml9X3TcOoV798YNY\nFhP+ZcB8ZchiRgXRKirf5aSNAh9kXCmdeCKe8+K3Jp3RwIVbmC1WNznrG4kL\nf9lUYWRe0vPvi9goj8naHlFFqkZmRWOsm8FzI32P86QmLG05DecoEvcAtqdK\net+u\r\n=1UfR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"09b9d6bce86219fb8d97135e37f12ff8089ababe","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.90","@balena/jellyfish-environment":"^2.2.27","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.9.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.5.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.99-renovate-non-major-09b9d6bce86219fb8d97135e37f12ff8089ababe_1600426938870_0.2872933898081169","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.99":{"name":"@balena/jellyfish-metrics","version":"0.0.99","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.99","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"41071f3a35fef5ccc980667a71e91322362c091a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.99.tgz","fileCount":16,"integrity":"sha512-VPXd1CrUpxDQmku2afbAZEE/ggIJ2HxhPaYQUV7sDXQQ/izPYOKwbKuBA8wyFYl+5hWix8ETOVybWNWIMcKZTA==","signatures":[{"sig":"MEYCIQC3bvnh9nXpLqSEbNfLmYQBTvG2XpnumiNjGwERl6Qi3wIhAOTZGS47Wt4K35hazfZ2hYSEBPHk6IpplcoTFbX4VTzc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83206,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfZJSCCRA9TVsSAnZWagAAUhQP/A5WTtv0EonkTSAuWp1h\nlYIqTBZGs1mI3nnr/KFINrkCyhTxkL6J93syuq+/oBNCmdsdy6qDce3PB8It\nHeXnNOJWzn58vNYKfLUtkNp3gkTwD7P0U83L1Ib6WAAUqNL9gXM5MKuHIcA/\nFtLAQeAmSOS6MZ9X+k04f47/AMZ3z2DDFPP8SMcHUaIfA4iteiFmMcvkrRuP\nTANZO+kfx8N+s+rXpNRW3vkt7tnaDRO4hGo6X5359mpZzIsSxx52/37EvQNr\nlgOAOAisg9IYbXvwnqE7+LF8sJOfi9xUYhmz4nVzW16ejiijCaxX7aovcOEm\nMrCIO/LJPkjDS80VlPC7Bj8jNsSvmJsOkG07UKpEu5cCcFnnPCQzYP4Qjat1\nCiAWEEloo5wFa/5lnOwD8K3mjcsYLAOcmxW7mIi5E7oiSEqEu+CcwUdiw3iI\nhryDI34YrZny3uhBjuin5wqw2egle1npreIzoq7Pk3hCE23pRv6ts0s96OJI\ncFt3Wq6HLNRJdyQXmynD6r9nwgjzkCU/DUh8H+0KdsOXblW6f0N/8Wo/P7oS\nnd1a128GXVxVdfc73+dSRv19sPEywAPue1jAidnRyif9rKPDbO1/50Qgig7w\ns9uCpYKXPYKUKlue63LzARa63u0/elL2ieznSmWGhQ4oWQw1w7StHU5s1c2w\nCjtI\r\n=4Y67\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"162dff3e034551083804ad07d3d0009730e51fef","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.90","@balena/jellyfish-environment":"^2.2.27","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.9.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.5.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.99_1600427137941_0.12570296387945623","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.100-renovate-non-major-025c5e5083bbd80e87dec2e0728accae5b71db6e":{"name":"@balena/jellyfish-metrics","version":"0.0.100-renovate-non-major-025c5e5083bbd80e87dec2e0728accae5b71db6e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.100-renovate-non-major-025c5e5083bbd80e87dec2e0728accae5b71db6e","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d44395197f38da831c4f6ffd2de849a70d4ca29e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.100-renovate-non-major-025c5e5083bbd80e87dec2e0728accae5b71db6e.tgz","fileCount":16,"integrity":"sha512-13WKFsW6cEqn49Z6CxNyslNmPeSLVwoAZOvQTLn7p5YGSvI7IMm2yenkaXDyYcq7Rtuedv0z/2a3fijVEiGTIQ==","signatures":[{"sig":"MEYCIQCZygZR7sDUhOQzO2eVB+mgGEMpaCG/AH/cfH/f6VDV5gIhAIdPB3Hj1TfVC8bmVu63RTibhIonb54cNChs99Bgd5eB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83374,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfZMwtCRA9TVsSAnZWagAAjzMP/j+a/5vW3lvfxF89JuQI\nSsfJ0EpdoglyRFmcw6P9aRd2EbzHCtCY3wjuAw3inV4VqUQWg2wM7EaPBoVU\nYRy0uI4eO7JyoEtWLR9NDp7j5D6OULUgMyjLJdNNdOux7/ZipDTpzzH7hcOY\nQ9RNQKD8QzAr5c7B7fq9wibGvzq7+aCz9PHRPSEBABmXeBKi20dfrerCkJKM\nX2bCug6D5gj3VLUlrepDu9dUjs8P8c2Y8Dat5ucYZ5gg7kqN+yTDLpvdQAFv\nY9s6hqUI0+3M8v2GDj8V6UHVbdddYaEN6+DNOzQX1ZjOfblYPtJBG4NqByMm\n811Gn6UM1HUgKREQ+a4usHFObTIzXDlWVebJyp872zGl0YHosLL50A4S+9yz\ncJvcMuqvmcmFVcNwXHUTOM4voRKp2fXwRyyeZLXS1n7T6d8YGrLKriCIMJyk\nBfVjNYxFOwznBdv6Zkb+B4VKeoiVf4SU89z6sIKS5U8LK8hCffurJxuFqSUr\nfOTOnG8phQ0JjL9nulnH6sP4ZULcc5VaDPbEC0mhB9Pg3UoZzkUV9olkmicu\nwBSESdFHJpp1gv8S8a4odpelPJn5R43KEi7jTyNh61i4QC8KVOhphnvOmrl2\ns2dQEKgXkSIHMEXaIV5rStZk0yCgGEdFNWu5fjyGptyopMlYkJn06bcgIMVM\nfZ99\r\n=TKhD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"025c5e5083bbd80e87dec2e0728accae5b71db6e","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.91","@balena/jellyfish-environment":"^2.2.27","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.9.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.5.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.100-renovate-non-major-025c5e5083bbd80e87dec2e0728accae5b71db6e_1600441388871_0.6202824525246511","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.100":{"name":"@balena/jellyfish-metrics","version":"0.0.100","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.100","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0a233a0f8ec2dbe0af03c2aac76d9eaead067d75","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.100.tgz","fileCount":16,"integrity":"sha512-eVcnURY7KZyhCNgxwWSH9hRvVFgEq2kRbtGzxQiNk+58LYcWR6xRgifukKY/JNk2qtCTuTq0tB1Wn3SXG+FuRw==","signatures":[{"sig":"MEQCIC3YjXeMHqetPYIj3Ncdj3NLAhfFHNp5On70DbtEixEXAiAeoHr8j0QXoV20gN/UmjjxsKgRzKYSIFzj4E8bCflxZg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83314,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfZM0RCRA9TVsSAnZWagAAXa8P/1d2GMp+PvfgdrPcFZls\npUSMTWOKot2nBSwczLKooXZzAFz4BooXz9jJhNjjQB5p7/ZLK/1y1LtWILak\nG3tIiloOOSFzJ5LTcuoQVtrGmLOdu+H/i3cDDXKbrG2OflFQQTVhW6Uw0PD4\nt18Y95jdxGCKHcF2FH73EI6il1rQ1dgnV1JhuRvULhrAw9XeeudBIqpXGGMr\nu6CSCsLr8cAOYw7fvMbjbv1OJb97xfSiUGHq3K3il4bWuuk4Z9RZnbkjMrQw\npYyXLjMQn61nWyczBFwqsyIpMwJSlEggGQo6zyCuenwhvjz3IC9asndusQ4i\n7zdLaWnRxlhwENtOl/5naPykK42fVp53OHEgt5mPRWa1wBBMitlmbnNLrFMH\nuEDDcElZyh1i/cesyPL1fD8/mt/cz9Y9DKokwNEeN8eE3+rjN8sOt6rcOF13\n7tXjiiUUN2OrYhgaogFx7Ex5/35sabYsyzj2WqLUrmLDHRMSKKuDkY7v2Q7L\nV29kZdxydgCyP7dV76jpsIUIeRkzuditEwix5uoNNV8KNcSQn99TvDQxlcv5\nVt8b00ShqN22hPOpfnb9PcqKlxRXdMMeSlYMU6f/ct9NWcP3FOOMZxQ+HAc/\n/HxdjNvcung/59nhpBcgmkgrYXasE+2DuJ+86ljmpIZ5CK2TVCG5w//MK9yn\n0LAs\r\n=OMAe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"88cc5bd61efa87940c44589a80a68fcd66ae102e","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.91","@balena/jellyfish-environment":"^2.2.27","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.9.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.5.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.100_1600441617409_0.6358327922961751","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.101-renovate-non-major-af7470e390774d337503b0c8ca64a7dc78416df3":{"name":"@balena/jellyfish-metrics","version":"0.0.101-renovate-non-major-af7470e390774d337503b0c8ca64a7dc78416df3","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.101-renovate-non-major-af7470e390774d337503b0c8ca64a7dc78416df3","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"30e686e67ee440c9f81be9263c05fb07637ff79b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.101-renovate-non-major-af7470e390774d337503b0c8ca64a7dc78416df3.tgz","fileCount":16,"integrity":"sha512-u7agD0BM8mjEwYbCKzs7e1RrEUxqMs34qpEvbHSqkFeP9CxHeOCjEJH5hJxHDGkNze99tV0AvZsdhKoJxS6+ew==","signatures":[{"sig":"MEQCIFGAQ10hHfI7NhlQ1/WR6+RLgcTwipsSK7QwyQf39lb1AiBQ/4FUUzuAqyl3mi6pA7KpIPjAh9i2imZvW9f5nM5meA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfZSn5CRA9TVsSAnZWagAAfxkQAJqzoo4M7XtqO/CKq71P\nOnKwZrMgUHGFJKlJ7dmwg+/PAaqc8a/TR56HVGoaO/GTgTpmYXAxCyDhKPNb\njl3i9aq/U3aSfyXQ/ZcMWVcFP3fO4hSWj/AkfC7X7JtsxfU6gth8XnrznVAf\nyhsJBV/ge+bjOSawDqMGfjXTLmssuViGhxKsHL30LhUKuwFfwpDZ7qgTQb+p\nzWyorRxNbHjCnp2uTSKcDHIQ3PjyF3B1SCrg2EB65wEXDlK24dtwx1LUmn1h\n+ChMIg4jvHfIhNd993L9Lrt65tgTmUih3Mdx4gxpuYGQcooWmvw73KU4uNqV\nItBo7N7d9sn6CLEyQm4MWxvLC2io5hLNZ4cj39woZ6M1AOmMEk18RM0h0gtx\nU/AauTOZZwXrYmVX6TCWrekzkO/yGtWYolmeR8u6T3v/+Nn7oyWxbRU/2uaS\nYjhPlrQY/scZuQiRKNLnWx32TIdzAj1ouD1rf6sHHvpECtoO8n9wJdzZ+QuW\nj8KW4EGYW3ZlwkzOhHzUXuahtJWcmh/wueCGsBZKq2KRlnyMBu6VQKKXFMZW\nHYHcDNqDJ/6GS+I2p3GgKqLeBUc6wQS7tb36NWsaWaeDw7LflOrO+v9J3GMH\n9hd0k09Qcavmvzm4nSSDVhLw8LOmpe5t7SoGnVx81txRIGKnwSor5U0TEPAA\ndqAu\r\n=ZtO1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"af7470e390774d337503b0c8ca64a7dc78416df3","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.92","@balena/jellyfish-environment":"^2.2.27","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.9.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.5.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.101-renovate-non-major-af7470e390774d337503b0c8ca64a7dc78416df3_1600465399666_0.04468549418604484","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.101":{"name":"@balena/jellyfish-metrics","version":"0.0.101","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.101","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ad1ff6aa90335f4a3c2fd2ee6b9cecf0208c7fd0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.101.tgz","fileCount":16,"integrity":"sha512-XHiy2CUn7cBcgXA+IWYVO36wTSuPMMnWrfh5q2ofATH/3NAQO5WddCx9tIFmLAVC0BXaNXWGgtfUH8PrpgIroA==","signatures":[{"sig":"MEQCIGLYF0rqohbXYsbG+3ehPCguijwweRRNMHvDVAau0dx6AiAogX9xO0xI5WXkJxfFPuQqb9fbFRfi8VpKc9ope3IxkQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83421,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfZSrcCRA9TVsSAnZWagAAJPUP/1i2cXjykot4MwAThS1z\nXfrbO+9LXB+1ZFdKpG/jGArm6Xxmok722T07k13nvzdotZXgmSIIBhECrdqS\nt6HZSzEhG3eoyhwMy8fJCfXrJJL6DVoVclXelj0A2EXlfuJ+8e4q/b5PPRNe\nR/sJvk66D9oGAcoOSOCnhkGQLmlHF2qqrygOrAlkN5dyYr1cvF9YTh+fl7Ws\n2wyegZK4tY4P+DOemPD4qBXruMJtBsYrcDHH9AjUkjR6JoFhq1VB/fFw4xXB\n9BLCRXU3dqyMjWYzvKRlhFHyInl6QHMu76KNSNnk64Y7Z/4oh0JSHoDneeIX\n0wpm4DunGPMd6A9SMEhKC6FAMOgFtJx+ywQTCjfy75ZxTxQk7XIiAuQDIGQ9\nGL5f4BLTj4wdrTSnnHYbUJW8XQaipD/pOKDmVk9f/iooU6tBkMhNCJU8DN1F\n8PKGnqL3IA9P4LY4O/V9jPhm0hfyT4d8QnDVNhpygXe7ZEA100YXTzi28CeV\n8Y34sYfFHkvV1DrjtWR3zWjHMdWLECFMpCGge1rEaWiy4egzbzucxO5yZ+sE\npEam/iCx9rQC0pAk5N90+h0VYhYmoNUufiYW4IKTrO4DotDv2b2HAbOSxn8h\nz8sbaP5Z+kQcASkvoQaU47LqmiQZmV2nazT66VYLxrYB+1tiqEzPAsXvaIL2\nhr+T\r\n=b0wM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"69722771542830b2a4f3d5b3794f2773b045dcac","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.92","@balena/jellyfish-environment":"^2.2.27","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.9.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.5.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.101_1600465627745_0.044183823964882185","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.102-renovate-non-major-83505132a301a5f07905745c68dfd4acf97548b6":{"name":"@balena/jellyfish-metrics","version":"0.0.102-renovate-non-major-83505132a301a5f07905745c68dfd4acf97548b6","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.102-renovate-non-major-83505132a301a5f07905745c68dfd4acf97548b6","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e84f0f9c4702a91f0fd31358a15cd30ca24d237d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.102-renovate-non-major-83505132a301a5f07905745c68dfd4acf97548b6.tgz","fileCount":16,"integrity":"sha512-i8K+QjFQY2ZD4RbTm7shCCMTuDgrvA8OQqbFb8mP47QkIKTIaO21ZJkIFwIPHd/qYABaFCkR6NjzCevmeBYr1Q==","signatures":[{"sig":"MEUCIQC6siYIaPm2FNcmVi3+PKbpU7Iu5QPOtdcxTJK0GGkY4QIgLr0IDnRADBFpUo6e9MQys6jX/k82fuPXcIOYJrXJeVM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83588,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfZ0nnCRA9TVsSAnZWagAA4EgP/3A0Md6BmveJ3/aniur4\nrDFmVWipvs3Ltaept1GLQIdQsWwFv8YsqNKjlpMtKTg/W9yqgLNQL9wRw0qP\n6cTm766gCQMJpNKZeOZXmvcNBikwuQN1WGKxjw0q81PlFAMqn8j7d87l/DlR\n48Fb59ZZUfuO0KTzZNkVwGbmWCxoUmpYQYa5+++JJy660RszpnV7P1XSC+dn\nsMrBxIf8AKdTF8SxRHTwMQVlIRwB5PQWijeG+pA2pEk1FNnZ0ojamipgq+F+\nH4O49+ctJ9e/K0saiwOLvc3PAcLdBPR8/1oca6U4tKUqq9VJVGYV4ZYY1EaV\nMRsn68MPZ0ezHffHdMN+k5g4gOrBGi48wsTwaJmp7dWXmAl511yvGCpC3hMV\naevlQ6Yu489vWi09WqTJXiVd8L6M01T8/Lubx2JLimp/KT1iD6Sq3CSw8zZC\nvSO8nR0n/+sBavhNgUyqyvC/zUBLAzuAT+M1bVW7MHdwKqaosM3oaIvaJjCo\nj0h7UGmUAehmBOxOLkb55dH2wRNELUTyOt199aRu/yhK8uoLl6J8YQxqRpQy\niRGUT8JQpEIZQAmE2TU+jysiNHvorMMNwkE5u2q9hIC9/s05rsMT3iiGpXzP\nRXgP2DtFkl6uzZgSmOjtR/vtJdwapGQ8jnNPPAnw5bnWTpYaHxpJP+WzcKmt\n+221\r\n=CKAX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"83505132a301a5f07905745c68dfd4acf97548b6","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.93","@balena/jellyfish-environment":"^2.2.27","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.9.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.5.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.102-renovate-non-major-83505132a301a5f07905745c68dfd4acf97548b6_1600604646596_0.7862564391146276","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.102":{"name":"@balena/jellyfish-metrics","version":"0.0.102","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.102","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8bb977740095ef7107699f7970823c5812542664","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.102.tgz","fileCount":16,"integrity":"sha512-csGU25F2397RVqOR4hOyoIecjJkMowqgBzXhFIJKBjGw5MB9RRrnaa0Sf21JQ/nvShEr5CnNNAcSef9JVmXgZQ==","signatures":[{"sig":"MEQCIBAFm6XH4qNPDA6pYaaaVRyI2F0oiHSZ5z8Iopm0WdZPAiBfrTX9PTh3jnV9vpj+KHcOWFBAYCJiPCFFmo5Nc37xdw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83528,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfZ0qZCRA9TVsSAnZWagAAZqQQAJCg+5EgBCm+Pqgod2pL\nJfG9n+Q7E9v+k5P+EQfFG/osguGk2SdbkI1P+Wlfd0+D1FAF/3w9tigFsbGg\nxPAN6Aat3HmpFoGIcgQGtgXOtJYO2N9NYtOPpzi/dPGOKpmvpYj1chF4kc+e\n+3Y/ZlMofcUYjfELtWq6vMaN97nhlHWZNECGBi+TCVG9npEqRisUwYCTT9zF\n+8S3jL+sVoEcL+aH32S8kPin7x260iaTJY+vHv832ZyA6WHO3MQbBAklnNkr\nfv3mCw9Vh+JK0bv607Kmv61IXGCxcIEDN1zb9Tb1cZnHaNOSB4dfwxaNHAkO\nz/YYyevL+HyY4tBTVjk112irjSui9+5CaNdeK5Xa6XnImJ+NMZjGbHd8nXGd\nu9OG+uQZJ5NMBo5Kzy7FmI5SPhktiQRAIWX10SwELAiI39rlpeh2hg+iGjqZ\nRVo/ECHYlUOg5+jaU+/psyYUUmjS1AE2WtsOI2TSpQxl3Jb9wT02uOV4XLlH\nzbRH8wzxEVhQDNxZHIuBss3Oe2cpOmkNjkI0FLkpM6DNKzdOCjgBnehPP+Fv\nTLxM02eOi/yZaMHg7ToqNuTL7XH10zUniawm5fkhXudGtIA/hvTuQxu8y7eq\nfsoOp1UzfjpdZVHgddQorajE+JSP3E1enefoyVh2bJx54qMBsLu/kW0znvV6\nOcty\r\n=LtB6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"426bd242011190fe0e880f54bb532011463c271a","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.93","@balena/jellyfish-environment":"^2.2.27","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.9.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.5.1","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.102_1600604824755_0.8985012111221942","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.103-renovate-non-major-d96ec0083a1a06e7aa8ab078eb76c7fcb90f26e2":{"name":"@balena/jellyfish-metrics","version":"0.0.103-renovate-non-major-d96ec0083a1a06e7aa8ab078eb76c7fcb90f26e2","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.103-renovate-non-major-d96ec0083a1a06e7aa8ab078eb76c7fcb90f26e2","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8201ffefd3211239106ed8449b3297010e9c4fc8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.103-renovate-non-major-d96ec0083a1a06e7aa8ab078eb76c7fcb90f26e2.tgz","fileCount":16,"integrity":"sha512-yFEnbPE89RvKJXkG/KL9sCoV29HF4nV52fa/3ZnSahT1WK9unAE8raI5jR98kthI3rB/A5+T6mMspOaH6/y9CA==","signatures":[{"sig":"MEYCIQDMaZi6Q09c3F7WP2ixWIzHaCJhmx3eBjru8vEaNApSdgIhAIUBWO5x+28YTanLHgj44q9UeqbZmZu4nb+RTyWlE16a","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83690,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbdrfCRA9TVsSAnZWagAA1e8P/jDBj5Lw2MPTrl/kqyfd\noleTe/VZMu+o6Nv6n3OSg9krBYJZw2Vt18yNjzzm4Au3CDFSNzo+KgwAeRgs\nnLTKke2O3/FTz33JmGX9X9VUP9eB3N59BmmSPuc+AAVL9u3V9dLQnedX8SRA\ndsxRilKQA8JothleZEGqOJJO7WidZXKx2GaGKynBNnXLZe5MpGXvm2pBAFPQ\nC3Q7QGA3fd3C2VtMoEB7s/byBXKFnM90TzPDRhnT4nZ6cp5xs+7kExqaV7Ba\nkfjE9lHcXEkKiuJgW43o1JP7UnDBjH5y5Dhy7ctA1ebAIN2KwA1zNIXb5mb+\nGD+69TQ6HFpCUk8kRP0oojazJKVhS2BDZtwndfzK9Gzxo8IO113iMbv5DIvk\ngd6YpaCX/8dv3/tMDx/xLCznPIRzQjFbJeGI4RWRpKqCIXhGLm+pBa0mdO9j\nsAXnwLiizAImlZ82W+vxUfWv0rPkcD4Mq7K9hTcF9QEuZAJdjYyzi17OaObU\nuuSOVD4E+2xV1ze8+h7xUhVymTMpBrohJ0dCeGlQ0O4plhtzm2SRP9KI5NjT\nLFQCg4HFrfCdA9HktxydKzpabZjUxz790b64fHpu45FnkdD7ZLZRDGsktxET\nQZEn+2cyfqyAj2dzmFWpMVGJXlSeThdoUiAptT1j6GAfOLUu+41DW02xfQ0h\nspKw\r\n=S9L/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d96ec0083a1a06e7aa8ab078eb76c7fcb90f26e2","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.93","@balena/jellyfish-environment":"^2.2.27","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.9.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.5.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.103-renovate-non-major-d96ec0083a1a06e7aa8ab078eb76c7fcb90f26e2_1601034975343_0.10116880840281373","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.103-renovate-non-major-e1a3d3c4c9fc73407a22a173aab8d33d8451f40d":{"name":"@balena/jellyfish-metrics","version":"0.0.103-renovate-non-major-e1a3d3c4c9fc73407a22a173aab8d33d8451f40d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.103-renovate-non-major-e1a3d3c4c9fc73407a22a173aab8d33d8451f40d","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"907c96881eae0572f681ffbf8a3c2c0efdf3d0b9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.103-renovate-non-major-e1a3d3c4c9fc73407a22a173aab8d33d8451f40d.tgz","fileCount":16,"integrity":"sha512-nDKLZZVNiReMRdvEtsbCj+nr4tWnVMLCxEEk9in74a9Zytc0q7mlH6OJG1NEtcJla3hI8WxQLjQkqM84UkbPNg==","signatures":[{"sig":"MEUCIB5F5k4+uD0XMGwY5Yghpxok5kkui42uQ2pWayTKjyVSAiEAyZ/UK0hSjl+f2lq/PZLSFWaBSjMJ7lGiZeHEtjpnvH4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83658,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbdwBCRA9TVsSAnZWagAADY4P/36Hh99S6qWxt/lGx7qX\nY/CqKBFucbJpLNcZcSwwfu7a0d0Fqb9+KTc9dVxvqFZ32vcBzqXMOggbIZaR\nukIozSKhtqyoByzHScl/FNzU4/Ltw3sdPRqjCRyjKPOcYr1xgAMhW5WTYrgk\noMA4Melm4u0LugbXBlWQvxgZU2v2+KHwAVIy61x97jYOhyb8CH837+zJ+ULJ\nfGuvVoENhYs4jRArSLXhribX1o32J99vDZE/27Nauo1/+NfFBQEJYGvT0LMt\n1B98ezs46nyAKtxB/SrT6fjbuOmAFpP4zhyAzq+UFCrA69zPdxCCduEkiAh8\nboMHLSmBvZ/pxGCbA3+O06sZqD4xQB9yGMokvWx3BAo+r/ll42Ki6rpcQBHU\nOur9ksz5RXp5LNqbarE6kOO7V4co+FIzhaWKUvH8aDKaLC1ehE2Xfdc1ECFy\nIc7szR/pXjYqHlZ6THoXMByi646sQz8qmuVx5Zcq2bIOMf5gr72XX/r5vCa8\nHXR/m7R0cIiDqUahERkYJr19PG5L0ZthnQQ/K1AMDdtIILfzmHONuVrkrPbj\nuXA+HZRpBrcO8ZDfL/nIzn9xIgLNGc3nPJXHMdH7yG5pcAR2ZjZS7eYKGg3b\nemw3PlJX0vVlTNdNYndqQ7kudQviluyxKIU/e+GeJc51G8XNfb0R9gSDWR2v\n6WDs\r\n=+y6Z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e1a3d3c4c9fc73407a22a173aab8d33d8451f40d","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.93","@balena/jellyfish-environment":"^2.2.28","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.9.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.5.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.103-renovate-non-major-e1a3d3c4c9fc73407a22a173aab8d33d8451f40d_1601035265267_0.10377228573059827","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.103":{"name":"@balena/jellyfish-metrics","version":"0.0.103","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.103","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5dc72bd55dd9cb7b474e8fe8254e9856d8736aeb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.103.tgz","fileCount":16,"integrity":"sha512-jLQGNnFi5TUq80Y6UDvlGUwC4+ibQz2mvSVusvPRwIr62wy2IOsoGbTSyRxSzG6XoCo5qsFUpD70I0v4iwIQWQ==","signatures":[{"sig":"MEUCIHOEPtJ19dAIvrDdh2TdgHs8k6DVUJoYfCIfsWIujBAbAiEAlFezF1l65SuPq2ULWLkpNKXvq4EtQPsnsFJcDuxCIYw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83598,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbd06CRA9TVsSAnZWagAAYsAQAJRFsDa1KdLNOqC1mDv3\ngg6T29oDft1Fkea0lVjre/CrOpl1431SgoZi8+ObBzouD5Z/VuZKRCZ5KnaH\nDiXd4nH96/f5CffqBjvSCxRKdPaMp/rKJsfIl2gXW4znO0D8+ZEj99rWV2AB\naDF88PhrIlax/bDMdQMFbzHgUEh81DC9ggfu0n3TCHttAXL/2PV+jjUwvxdW\n36zqEjICcCKGYG+OaiJ/JLy/EZSLrRg7PmtGfp/ylVxmrJrmLCAzcW5Yg97K\nIEu/dPmmqbuW5Q7Bz24vzV3x0BgQ9HDT2i3OHOtq5YvZeHq/eh8pm8OJfB1j\nkALRzwG291GVUmNtMzFKPj1RNYQJc02755O+v91Ot6DnJdUK8ttqT7TT8EfP\nMbIK4kGVwzt6nryn9zVRc8ujBky6uRF264jzXQWWW5YPRuPzEZwb6cpWbdsq\naSvv5C6IfqaVTYkuod9gllsvGgcmQzv4Awv00S+fvHI8Z5+GfG7caZFoNpEm\nsDx8UmGD1uwZBleX+id27RshI5QGmyYfWfeI6lmX8XKl+iR0nTJ76zzbT2bh\nsi5GKMPAmHzn+RQHB7stwXF1YGMGSBRI5x1f8pbQnnYiZ/UChDQhKGualoA6\n21/OVF1+Bj6cMvGJ16bVmeDn5sMOeBQGDBdSIkDzixanxu55YfNUDK+UIRkc\nVXZv\r\n=CV7E\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"33ecfc55becc00369a50689c40460231db0692be","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.93","@balena/jellyfish-environment":"^2.2.28","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.9.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.5.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.103_1601035578422_0.40158614865710396","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.104-renovate-non-major-f5629dce3bdf67fab04c6cb9ca3b9f2f86c19c08":{"name":"@balena/jellyfish-metrics","version":"0.0.104-renovate-non-major-f5629dce3bdf67fab04c6cb9ca3b9f2f86c19c08","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.104-renovate-non-major-f5629dce3bdf67fab04c6cb9ca3b9f2f86c19c08","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5f019be36d322c4ba0db4d5dfea880b3c7e0672b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.104-renovate-non-major-f5629dce3bdf67fab04c6cb9ca3b9f2f86c19c08.tgz","fileCount":16,"integrity":"sha512-sc3X9YQZoqDacAYt+DcmHsqUjtH7vi7owU9tyqXvecc6MqsXgVo8LXne1pJMNVQIGsGip6j117AygteA2PtjdA==","signatures":[{"sig":"MEQCIEVxffUUHCXkOwhRahH75N/bY4ofsTBQKZn9eFCtn6k7AiBqAvDRILqUzZujgptq8IFrQOOdhwQ9LRkLhuCwp2QEsA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83765,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbe4lCRA9TVsSAnZWagAAPEIQAIsd45xtkbWY3401GROp\nQm+7Wk6IvsqXsD/SY6MyxnkU6dRL9fgt3SiY1Skl8QLVexyuEIKt/KLwXLMP\nX+D7kkfq4alxTt/XHT5PD5ohRpf0njbhL9xRzfhkc35tYQGqSDXsXvBAWxL3\nJijs2+QBnAg7KNOUDELicAjeYf7j8DC5Z6or/0FMNsnv+GTVXtyJ7b1dJsIC\nd7oBOJ4jrZg/G6Usi9YZFVZT9Qml1wOyW9Zxt01MGEdklMyKTlM3edadBeIq\niUYO39GUu5dODkMKggcto8IMMnPm5++UkjRtERbRB/W7MqxveqwVdQVyNalr\ngv4V9aAS/tHwqSTmrVvo0Q9xTVqPagLYQjVmVJzdjL3AN5CjL/ss5vvYKgRz\nQlz7+oNU/1mdEH4efzEOxMODdOloHp+wTxcvgdVY1AI+BnVDc44Xg7ygBNxZ\npM7Y7lgC4flLoVYVP4MdC3dQ5tDk/FDEE6NRSf6r8/pOM+M1oNm511VMdpy4\n7RDFo+QoLSBoJ+coeapevQN4Q56qWp5p3TXM1MA5vIBoqsT/7dQt/bYRc2aR\nwlOWG/W+uPqy1R3NCdNMmlpM8lyP9sCdkrG72+tr3Rm8ZB1iIu4WwuSMeDta\n35nnFELalARD74NRwX5GlAAh49GgPSzvzCFXuQFnRUwPqiMCpFZoX5lnxYWZ\nPJg0\r\n=xCti\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f5629dce3bdf67fab04c6cb9ca3b9f2f86c19c08","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.95","@balena/jellyfish-environment":"^2.2.28","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.9.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.5.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.104-renovate-non-major-f5629dce3bdf67fab04c6cb9ca3b9f2f86c19c08_1601039908732_0.5965920162680025","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.104":{"name":"@balena/jellyfish-metrics","version":"0.0.104","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.104","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d769017992fcd76473bc00bdc20028285a7555dd","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.104.tgz","fileCount":16,"integrity":"sha512-xvqPbZdo7H5+QddEIgqj2p498ArnteGuEIARH1MkCNOrNuX9k0VKuoHiYxovH4KlyihsekJQee4QpOeQnxdzrA==","signatures":[{"sig":"MEQCICDzOHq1+T+wh2Ypi8djx8kSdZIuoCu0ddlVWOAT34bOAiAK1l3qDkWPKSnC1iinCt5ipQfwtsOVi7maavqF5QK47w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83705,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbe7CCRA9TVsSAnZWagAAhx8P/j17fVTdlnSx//Y+q038\nnvAew2F9G0AVeDvg46Gtb9QQwml7BYbDQ4VpjQJveG46JniqBE4Kr4wWykUu\nt5K9+t54V3+e34OSQccWPfXqGUQ5epiMskNQNNh4NeEfne4xbN2jLZPtOSJC\nhBzwNA5JGvJBHw5ZUhnhaBcgOXM5cYr09V7Ylwj0ktYMF6/5Y/kwgrc39JEV\nPRrCBrdodVB6/aVzl5qwb4AvQqDWBjYFg+irF62QN7+fLNthryR5z2d6MnFe\nEhSbIN6jzDYBKL1Q7zAauCoiSd9Oz6TX0xpTM+Q5jiPuP+XgRDMCo0+0kClR\ncRBo+jfes0RXgeNfD60iQclx9R44e/UVw5c05pMZFF/y/lYMWUC10eNXfe6h\nKT6cJI/4GHUltSUdI9t2ePTZfps8vOAy9lrsXJwuiG+LUlABiovJIRguIQ7N\ntK/8qDRZbWzJixvzYVPJAGoffMkp8KXISdH9L6ffJUvsAGgFwkVtaXzG4h/x\ncGQh0DG5ntLAACN9z8ooWd5DbriGHH6RRFSb2I4xcm9toZV1gfPFxpGnV2vW\neT1zc2+szWAkIqb+wz1V5kura78cI560qk1dkQoL0jFbSzBBn+sMIyPCYFVk\nI8yGxUuyphTveLNbU/1L1/io03NyVbvKf9f/pD/PmqbLUSEk0S4zZIq+sM4Q\ntCQt\r\n=AZYY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"068e6abb0d3ec2322d6b8b01e03c3a6b1e99bb10","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.95","@balena/jellyfish-environment":"^2.2.28","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.9.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.5.2","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.104_1601040066333_0.9340258277134843","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.105-renovate-non-major-f36a02e943e81bc5014a52370130a4a67da4e224":{"name":"@balena/jellyfish-metrics","version":"0.0.105-renovate-non-major-f36a02e943e81bc5014a52370130a4a67da4e224","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.105-renovate-non-major-f36a02e943e81bc5014a52370130a4a67da4e224","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ad11a07d0761de6ed8fb90d01f7692c2f2ef4a4e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.105-renovate-non-major-f36a02e943e81bc5014a52370130a4a67da4e224.tgz","fileCount":16,"integrity":"sha512-bOgjXnchppK0ccAUSOvybKC7dwWvg4TH/2NNV5Ge0VB0zURMMk9EdQ35T4PZrqZ3b0yv4MzxugR771WytXEXRA==","signatures":[{"sig":"MEUCIFq7sMFoFIskL+ptdzq+Hca8SYmfftHHONXJRIwpqNGdAiEA5KZpoS3Qi8AxHuP/9pPKL9iNHS5NwMvBcm0ofadFvik=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83836,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcAKvCRA9TVsSAnZWagAAplMP/idODzbmygQVHgQ8ttub\nef26C0jc1mIuEOgQ55Az2EL6bD0ZGCGyR6UD1Onepmbc29TeAw/q61IcPcpY\ns+6MpuFqexUiQ3XGvvjQ8PUUcowStbzUxH/Jz+Vpgk1jV8kKwBZjbYI1onfV\n8BfEu1YF5dc4ilqsMbjX5GTLpLSA+cOAEaEsw56CFjWsCYqNQJ0sTCEWicAf\nMn3hNaUJNGMDQREKLy+VfmwwikcDuheJAuu24Ow/FkFtggrrmEHHlwtvCU1s\nw+flrtGlyka03TA7sOo2MH1Dhsh7nniWaF7zSS00t+qvrSKjzDqJTgVmqdOj\nLcngf30nEolg0PwVTwz9xbpK9yAP2Sz9c3/CLf12RB1aQTDTKlxwfNsrUKB5\nYu4517Qd8hPSxZlBfgn9lwI3yJYWM609JJMkiprBtc0CW3N1GYHYggSOgIZ2\nc1xc7g7ZmV6/WCpSlnl28pb89OHuPjwrV0CF4njBu+jodY8a9wvG0xoaUrXM\nzNfYy/lstO4WS4zeqK+umIBA806jqCiOfnJrcEdDOgHkVLPMhz18IwHoSwbe\no4vQGWhfzlFWL3r4mQqT1jCC0i9qMjVZal2yJ0GcRSmbG5oHSy3S09laZmZJ\n6xwUON4B9nF/JbcKpHiR5jmuyAOzgt2OeXsX+Oj2TxmShSCvIuPGO+GRZVJO\nU4Jr\r\n=GfZL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f36a02e943e81bc5014a52370130a4a67da4e224","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.96","@balena/jellyfish-environment":"^2.2.29","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.5.3","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.105-renovate-non-major-f36a02e943e81bc5014a52370130a4a67da4e224_1601176239376_0.9315517660077788","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.105":{"name":"@balena/jellyfish-metrics","version":"0.0.105","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.105","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"24a48e313f12b95ed8f0ad08ae7cc252877fa1a4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.105.tgz","fileCount":16,"integrity":"sha512-L+WXBEOGxl7WGEkhCMOkAE3lgS0eXQyf5SzRe20Gr2xm7LyFaMDOj3i226aLFIwDYQty46D4olt0JAaf4JlSXg==","signatures":[{"sig":"MEUCIQCpIjLu+kF+bgZkp5OnnY8ZWOrUFNe7iV1lekJdAoUGSAIgYna23vhfcQVRdKp7ubbL3JSPdtjxq8BepVcZFiwhwHc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83776,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcAO3CRA9TVsSAnZWagAA78EP/jPkXRi1j4SML5EW2MSS\nju5rAowi1x3C+jyHyoSTfqz8BCbgU2NiOQ0Z97YYIsx6sn82ETucoGejehBD\nB0KNKQrup3b8pU/JcuihqbFWeNKvLnn+oeBG8QFv+bJV3VnOXq7ms0xI5CEf\nxjisWii7lvVmgbXdP68EJGclMk9OMdavotbYS1lWbgnjKzdPV61OaPkI2TFb\nS77e0mi7WoDBj2UdCpeoPQq/j/nLplzePucxoV+VMJUH6DK8ThrkZ+Z57hbw\nB60wk/1v0jh3IY7+deDlIfsg76vR9I78JBbrnFU0rluKzpmohDqqGduCp+hl\nagpzIDnN1Qfj2izFpNgQR46JBao2aCYCFAgDaiaALc59IuPAxW823ivrGHj1\npJ98EQlaw437gTl9Wv/GbaYwUIAoJ62HykaSpSVUDnddGm2utiY1vcvhoMLb\niF/+/WEN4onHxiByCtK4Trr0S0ivTMhP6wZhv8wRc9w0zhKVXzwIDaIa4HHF\ne0wVhTPdVDOMih71aTdy2INDGq/2lSDIcnuexolkM49w6ge4tX1QW9gIv802\nFNbk94ILojAh4trszuF5VFN6WPWPFwj0/WLf6nm+JF7MaF4lQcSY4xkCvmS8\nM6O/jFFFdjpCbMEhGjXk5lD7KTHubRkcDl9SCyefJiex0ury2ja7lgY7j6ts\nPjzn\r\n=cNWV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3c41c9c8afd402d8e72c4bf3a3c1d2c1ca899979","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.96","@balena/jellyfish-environment":"^2.2.29","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.5.3","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.105_1601176502795_0.6459702022251148","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.106-renovate-non-major-6e5e8495c852db76859354974d7d12a26a396bdd":{"name":"@balena/jellyfish-metrics","version":"0.0.106-renovate-non-major-6e5e8495c852db76859354974d7d12a26a396bdd","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.106-renovate-non-major-6e5e8495c852db76859354974d7d12a26a396bdd","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e607807c3045d0671a5b1b8f142f389398ee6978","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.106-renovate-non-major-6e5e8495c852db76859354974d7d12a26a396bdd.tgz","fileCount":16,"integrity":"sha512-5M5MCgaNjtaY0rJcSIONi9kh29q0I1jmS/G1vJ6BhxNZ/GTt4ApVO5LIm9faS3787QSIHEhNnLjtlEHfB+otvA==","signatures":[{"sig":"MEUCIQCyYkMkpkTvr1ZW6z2Xp+S65Mbyo6jrUfoT00ISjILutgIgQ4BNuqDhS8H65ivIXEe5DyF28HaaGMNz34q0F+qVX8Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83948,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcAT1CRA9TVsSAnZWagAApPsP/1CGhIRYr6DBNXp0rF3e\nvV8rX6VrQErzhJSQCkHwHIQLDtnUAVo+QtkY86bYsotMpsf455udxJMbtT9B\nem1xXh5Y3xILUKPBe/nxzjPW4pawMdHj1ytqFoISC2YbD8K17IjpnCRwZBIa\nXSVyGUnqDK049Isniy6olhi937mieoQ4hHry6XDGLaK1uKmmfX3sCHwxPIRU\nAnNFfkj9pWJBw7f76agqthNpbN9LlkzMQrufYEjfQ8pkCv7iKz3HYr1OzOBT\nberA8UFhoIMmG3ncbh9XaboiJ+YPrxuIL22Rc1ddnS3ebPPrqDv540tDKFH5\n0Xq1cHlSg+wjWdZ8gGnaxfxLvyVsq0qAWBM+N0znf1SvlLCXViISkR5+g+f0\nzAnt1D+UgK9aUFNSgbE4bAL5o+tYaOalpKY4P2GmRbfG1C3Vxvkrn5f0HLQR\nVFf1wmSgOQBRNSmmQ7jhs/U7hvFR74pa4DYl3md+vuiO7Adv+CGHZ85sJCJs\nE8NkPPaHOaHBDG36GobhQi45h8wzH3jUlUTRjbpD83TcSkDNt4Jrq8P3SgEI\nNRFsXVcbb4job8vlmxaBa3B8EPak8u20OA77B1yeSgDgoAkv/C4i6JISI285\nhmxWiNJuTmqgFCO2He/xjWH6hs1ww857HJ8aWhaTJ3uLH7bnCgOqkFdhTB8n\nFemL\r\n=6mGK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6e5e8495c852db76859354974d7d12a26a396bdd","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.96","@balena/jellyfish-environment":"^2.2.30","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.5.3","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.106-renovate-non-major-6e5e8495c852db76859354974d7d12a26a396bdd_1601176821147_0.41761823280891375","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.106":{"name":"@balena/jellyfish-metrics","version":"0.0.106","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.106","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"177ba23987e6f1c5a818936fe8dba1a8eff8279c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.106.tgz","fileCount":16,"integrity":"sha512-J8zxWF8OHwcmMZkCBKU3ie/nAbn2MWpAOy5bxa5hbY99qDuZhDSNVUvLEfROprzxNxb9XQmrY5diO1L9BMYslQ==","signatures":[{"sig":"MEUCIEKKXroWI9yZNrvY0hv2xWHA1KSvUUhJljHadOj2N1qwAiEAp3cuAmalvnoNVAdrNyaXsfb19VfpX48Y/FiZIM3YTFs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83888,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcAWnCRA9TVsSAnZWagAARw8QAIBx+7WWZ0Z0tzzBf7Li\nbQ5aJYNxFCWa4D6q6DTVhlSvyO0A4wG/sqaeegI1RJARj6IL+VfVfaHadVzZ\nU8vVyTzFkKzRGs4uxPTjhQTPluV1Q5tgKPuy4u4hK0YCjCLZPnKZdHyq0DlF\nabCB7pguD8SGj9l7cX5BQjXuV7n2g13H+D0dIxn1gUTgsVQpNEl2093CINKo\ncwbvt3Ghwt6ctMX36St2uPHWOrMTe7IWq7LaEWdBiXINpH2hkLM4iIJzpyPW\nrZbn5Y5iAQjBf6TnHYZV7HO46fZD4e65ZWMcapOuTZSwNgWEzgSz/cOzoAL6\n8n1gUVZPWqzOTvOsYLThAzvAh+xIzWeQ90u6vahhw/QPNZLvoi3q5NCyxu47\nI/FII68craJToFddbIW3/6n5emz/OmqfLFhf6dSds/vv0j1pAYL7eV6TBpCZ\nsZ+A/lCRvA7PR6LJ+mQEv0EEmTDnbb9/17KwHW/QiIr5WSq58Yd3HerBCIey\nMqGR2yV325pk58WweNkxde/kB42H5pmGyAnnyF/rxaEcrHvHWsTIJsyWO6SQ\nPLO8/pId7f2nOTqtRFYcnXiVysZLscu2XGI/SVfoM8remUHkBrHH1atQT0XD\npiKmwlxtW8w252u61WPK4WphdpaPZDorJ2ir1esUD74aroh/ud1r7VgnYxql\nHPdI\r\n=l7x6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5ecef32f86c6fb6e467cdb74850d640b3b807d94","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.96","@balena/jellyfish-environment":"^2.2.30","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.5.3","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.106_1601176998883_0.17002032327148942","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.107-renovate-non-major-8de40e4a24812456f15dc744ed7e99237588d836":{"name":"@balena/jellyfish-metrics","version":"0.0.107-renovate-non-major-8de40e4a24812456f15dc744ed7e99237588d836","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.107-renovate-non-major-8de40e4a24812456f15dc744ed7e99237588d836","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5f0d2ca13cf1f19836600119f2260ba87643649e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.107-renovate-non-major-8de40e4a24812456f15dc744ed7e99237588d836.tgz","fileCount":16,"integrity":"sha512-CfT1XOScZ1VuioAPyPmYOnCEZk+CRK8bniFJZOTASTg35JQmTRVXblN0oEiyArBYiRu5GFZbaiX50dZm70GX7A==","signatures":[{"sig":"MEUCIDSDaNCNqInTdMz7gNBzt1RAz04ajaegMlJYAfIt2E2NAiEAuHvyk7hHsSfUCcdWNpgIf/Gr5QA6eD1LLnsOCFvemg8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84055,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcBuoCRA9TVsSAnZWagAAhaEQAJyqR5fFLHW3AB12RsIm\nfgCUzfa7ggKUjU85rUoZAk//V0mShvRPaxOLkl2YDiMysVbz8bEfHpUndjA4\nCRv9kHjMEWS0HTCoeAJzp7bzY0bTofQcHDcUP65aWACYxBm3xSVGDKSi06um\nSMWKibn5p66kjiH8mPQm9V9AXwLcsR/hiOjN1c3fp8ZGULBbcUjnLkIjPoj3\nIZ8/yKNDuxpODV2FiIQIp6rBxOluRdI7nnPkbqnmm6nT1garHuiAdsEvNvye\nB4eEqfhZ+/7MQp3unDm0sULcPiNhgD2i+Z6mXj1ZF98VhYWgisDMhEzU/VP1\nNO0LYSRBUQB4FbQBgbFQqNDMFhdlNpEbniIOPWu8dsPvwI+H5kJHbI00hfqi\ncLi99shaXlPvZbge/H3n74iOAAdy3b1S/yBr+Jy66IMMQhiTI8I2+HbGXjPc\n6599fwnFG/KTHan9XANRExnYUI9pnGrstSaubYooxb0lavZgRKyKUJYtNzo0\n/bRoQjN0Jd+CkxMO8bHnEoHnAMgtFpK+lf+YERBt1v+3CXpsf7YD97UiEkEY\n3TzmYzCbMyGRgZOX+zd5dgyxpQQVSrxUofqD3iPJwg5ZPJMvzrgu9MSQQPbr\n+qySgz/B7ZP6pOlpDpE+gW/VYuON/Wj3bdEOD28WXJ91AVtkmH/OX04QKfib\n58ln\r\n=YV+O\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8de40e4a24812456f15dc744ed7e99237588d836","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.97","@balena/jellyfish-environment":"^2.2.30","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.5.3","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.107-renovate-non-major-8de40e4a24812456f15dc744ed7e99237588d836_1601182631921_0.6041774694198394","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.107":{"name":"@balena/jellyfish-metrics","version":"0.0.107","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.107","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fbd980a6bc9f3b4a83ec250d1b688cf27b61d4a3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.107.tgz","fileCount":16,"integrity":"sha512-PZRAUAm/ypXVYj3DK7Z3Nwg9QXb8BCNSj5/mlVfzpo+OEks6W+E3aOhJROdyfdeplk4bJTJ5+iVnZHNgZNOZYg==","signatures":[{"sig":"MEQCICIF34riTyQSLk3WjGLCaexRDOsKtZoFXTpnXFVrFEl1AiADYoZT/+xUIk4kFzsxf3b35Tv10WOGtUeseGSLmqHmEg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83995,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcBxiCRA9TVsSAnZWagAAYeUQAIZ5pglqWH2rx5jtcWva\nXlQVsmu9enTvNKPiGzS/88NJ9ISNoCcDXNQgxhr4ZARAdQdhaMubJG76/ucz\nnf6DVmDHc6VzPN7q4utKptdRFTv8mxLNI3gYSbL+fvexdiO/uCecGacF9pqL\ne2RGyLsTT9fM/8YaKRKEB2An6I4ubuWG5g5jYqdaAGEWp/3/wU7/uDsiqMMe\n1MEZdJxidY7fjVRu0Qu7DZq9HkNKJ6JGonIU/WxDsSRqPdIUHkhW0mMwrqlw\n8Y/XEpFizPaAP2+O+7Ok8Rb7NoP7Z6GLC3LE1lR+WmWnQIlMRMLJA0gq3HnI\nTLX87Ft9FTC43WhvDOfzV5b7TH/Scq+AM7vIdUcLkF9yi+a6EWOpMhb1uSbV\n0yrHjrLxQgf/rqebDmp4yWZOeC2fKp60NfHPJNyPgHDY/nQFAWcHQD71/Kf9\nIf08kWaxigOT6Wj9im1rW+h8vO5xQ1bV1Nu8PWrXPKKpvpdb7+WHbr7WchvF\nx7Kjo6gnk+SWZK12GOYNalIvhIQVWIc9kDPtwMb2vU5vv7//dM6WeSKPc7He\nb8L4jZDVGgx3k0Yw8yVZ0RLzmpC2yHjGf96SFnVsKpzL+95MXLivVkzsI7aT\ngv4amU2nPFeau9DZ/taUk0u4fUXPzDkK/rZdEYyksfM9+j66DdRS22FeQSRj\nCJeh\r\n=mYGs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"31ddb53a5b5502040692faf36b6b329e7767247b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.97","@balena/jellyfish-environment":"^2.2.30","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.5.3","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.107_1601182818106_0.818528670021502","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.108-renovate-non-major-d8b1ab924885d97ce864227d5ea963025d8075db":{"name":"@balena/jellyfish-metrics","version":"0.0.108-renovate-non-major-d8b1ab924885d97ce864227d5ea963025d8075db","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.108-renovate-non-major-d8b1ab924885d97ce864227d5ea963025d8075db","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"776b085a831b014889535bc8b5e20c0ea523dad9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.108-renovate-non-major-d8b1ab924885d97ce864227d5ea963025d8075db.tgz","fileCount":16,"integrity":"sha512-dTnaMM865m569km0lreIV00BLNDn46dRjLnqX+fGyiE6SO3mz/LnrYNLRVZG4V0rtx4mL5rLm3BFgWUY4DQpgg==","signatures":[{"sig":"MEUCIQDWhkGMAeW6NRqj923pHzlYib4F4X8VsvxmNec/fTUvggIgcF8I4MfkQwIuaJrVnXg6sMszilrrKGDb0gml1BZaB4Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84125,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcIpgCRA9TVsSAnZWagAAPKAP/3B9pals6W14sshuKBSD\ntyDpPg1ofKDViBtwE3GRMXSuRgLbUdwA1+hnEB+2A+cjSsDDpBW4+wktAhYX\nt0riyCL2ETtaHOoel5KZWsJ2M3X3JAhU5GZvJ6B+HC8dl0tWoUiQ8z2fH6M1\nesV/41VIslSuiNZI2skHncx8iZDNjw30UFIWR8cTFHnOxstH3VaVGnJyVu26\nLLXpyhnqExafZfpzGOPJ0f2xj+/QqMDS9vqSBKw2GUS9RqWxkmfhHlX21cEX\nBg94qGyuD2q65seCzng3vqaezWJCWdTQaa+yQJt+0IsazeNyANYJtXAzxnpG\nFEmoClehkSxK7qq+mSFJg+rqwAX6lqpDXs++xfw4KUfRw6Y4tG91cuuCrVIH\nYTbaivp5DeafRlIgZTnUjpvDuha2lhk3cRTc2v31QYCnVNpvPrL5V0tO8YZr\nGICWMTRFcCOsD6fwj0gxwVfC0JtHA2iluV7/k9mK8SH1C/D22Um9Iq53Y28Q\n7LPedduTqNiJv1dqrWHNNcZ1VN/w3OzbkegHWRS0QFEvrZbKRt/j7FBdY5Kw\nGNGQIXDnaZJXuM3IIg63JWmr3RrcHhZ3NksKrEY05ZYS+PqSJjn1t5GoKw8/\noWJJrdRVfd3llqI6USZwdofvXzysW05xtG8aTbq2cJMKxQxifkcP/RNX1s2y\nMpQT\r\n=f1oo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d8b1ab924885d97ce864227d5ea963025d8075db","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.98","@balena/jellyfish-environment":"^2.2.31","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.108-renovate-non-major-d8b1ab924885d97ce864227d5ea963025d8075db_1601210975593_0.6754806036405618","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.108":{"name":"@balena/jellyfish-metrics","version":"0.0.108","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.108","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c6de7efab3ff4e86cbe032036b39ca869490d0d7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.108.tgz","fileCount":16,"integrity":"sha512-yBxIp4d0piaAqRZx6Hxf8rTbolacd1LuxrYpcvxrxO5/7YZV43xnznEB6f9fUmzaPuQ3D8Vl7zOSbLvaln1hTg==","signatures":[{"sig":"MEUCIQDlROTd5VKV8pdfOLYf/5wTN14jGRUS7xgPyAQKeNWGMwIgDqE0HleoNdXxSL/FVYZjpimDRKWWVySm6JdnVmjAVew=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84065,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcIr2CRA9TVsSAnZWagAAClYP/1l0wy3FgFUKvQTm/EvM\neXqaPQwH0JUdbL5isuNi3TptBFFhdMFqLti8vxxMXl3+mQerhOGAK17iRIMD\nbWX4nDnMOy79hu5ZlXdeDDsT5vmUXhuvfaKXiS89halHjTHUJ1bdr/FDV8x8\n8uCiXU8UoVbiCVwlzNFBrTPYh6Gs1vlUW/rtNpPg7jVic5pnVa9fOPk7ER8S\nETSixStDx5607tI3dL6LHi4jKjEph5RNzTjSLlLoRt+7e6XOUn5GfFS/nYc6\n4QDk0HPauDS11P9Brl+pvb+ZpB6ZnqtyD2MIN8ON0rU4QXWyM2d9vzkub8ye\nKHMzhpeJNy7hpcsDA82b8vq981dWlw3xseOggIuxQC1iEttP54BF+tFcHLhJ\nh+fUjx8r0m85FDJ714B7ZaR24zqmoeEWQclKV5LRCbLTt5cnFYn1lfeC3aUt\nlEKa3pNEDn5aiVObbs4zp+qWWdglkFLHmOyUyXlAGNJDFszgH1ol38A0X/9E\n7+P6FLktL3KW9lr2R8g0S8Ui1vG0qYmRfB7S1SZN/V7IebS9bLR1q1ADF+pj\nKSdsTXWfilrl+AJyU8IvUcAy0I6VD3sMQ4Ho7jbIJW0Q4mt0Nce0GvOsJWKG\n23uluuJfM5HH5tDXKYylMnZdwaFvmvulIIjJ/6Cyi2eh0EcTEQ3Bjgepkdj6\nv1YS\r\n=GSJt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"030799465b7267bb1c610b3b81a8b0c4bdc2383d","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.98","@balena/jellyfish-environment":"^2.2.31","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.108_1601211126190_0.7646114692499966","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.109-renovate-non-major-252de3fc75128942ed1d6e282268e71656d3d914":{"name":"@balena/jellyfish-metrics","version":"0.0.109-renovate-non-major-252de3fc75128942ed1d6e282268e71656d3d914","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.109-renovate-non-major-252de3fc75128942ed1d6e282268e71656d3d914","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fb797f93ad58e532ecfb2f8c10ec03058eb234e6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.109-renovate-non-major-252de3fc75128942ed1d6e282268e71656d3d914.tgz","fileCount":16,"integrity":"sha512-xQWsqaHAE+diKkF74roUfX22cR9CITrHhg+yWTw2ep7t4plvzC08Rw/bA9KUK62oacHyhXCielUvnpbK482IKA==","signatures":[{"sig":"MEUCIQDjuADVOmPLZPjrPRpKYo2yG89H+qBzyHtIsA5enn+9DQIgMvqhZhNa+eqgn46PBlzVbxa2WYHDxplWq2LZrKUzssA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84232,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcJamCRA9TVsSAnZWagAAv2oP/1Hx2hT7spnldEl9Wr3r\npHNk3psBm/M7GKGlvCvtXLSRmfdnmBsNEl7EK9+SMNaBuk/P2kkVgt2PWCHL\nbxHA6OpTvPBTyvjWCZsh/V5bqopIkHsZlksuk8PANaH+9w+zPuNGscNQybqV\nvUkWJUOIo566TquQKFSpFk4ILUUdmW75XFpveLU4QLQmxu+2AKQVnD7omZRi\nMLMpLU2Q+EMfYpB0aKylAJ1/DYpmlp83aP96/FnIbrwMiJed7DgVrEtU7ZGh\nsYuIm1TwctCm3kARU8PKr22XYAoPDu8bfQgq6G56JGuxDEhohAqmaPENuZaF\ni68BY+6Z9d6zJWColuPnyMWTkKbdtGLFGoIl7c4O6hUTznpuyIWX6md1Hudk\nXBHt/UaOS+xbDJyRsmGK8hnz4rgRdAigtEia5/FT+GgzNdmI3vVTA61+VTqj\nrl6RL5COMAFaRF7eAI/EvEetgtaRPDhUCTE8jVzJIMGMyF4sM/MQOW2dkTq1\n/uUfHv506e6sbKA8LfRhlCdMBS3lmqv6Vbzj9GH6zzoSOmr8lY3/05S7J7AI\ndvKmNeqMzsdocroPntDhb7yoBDEkIR/SYGbXjWGoBOwcsmgOsCtf7UjnxkzA\nYxiI7tsBgRevfZu+aIWlSPoVP5QkWOGEBLAVEjFvfrAQM2rMwtByWwOaVsF4\n4Ulc\r\n=mUN+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"252de3fc75128942ed1d6e282268e71656d3d914","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.99","@balena/jellyfish-environment":"^2.2.31","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.109-renovate-non-major-252de3fc75128942ed1d6e282268e71656d3d914_1601214118016_0.615210265454118","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.109":{"name":"@balena/jellyfish-metrics","version":"0.0.109","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.109","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"29694d86f8c56297085fe4317c9fc87f634bd29f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.109.tgz","fileCount":16,"integrity":"sha512-6y9SAAJ8j8qaTMHK8OGnQTVn21iflfCYmVgnSE+OmBt8/teH9/kRquOF+QBcIaoazxdH+/Scq2rU9h2n0HaeFQ==","signatures":[{"sig":"MEUCIADHQMWAYJ7HXInACPv9ZABYjfngv7Sia/sEEWJrzDt5AiEA0jOn4img98M9zHrO1kxzXTBKyslsbw24rsRfrYcI4Tc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84172,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcJdnCRA9TVsSAnZWagAAV/UP/A8X+O2GVvPaUCEfTIgL\n33el69GVO9LbZsN1s2D9aWFlC30TrY2nvCtanjR+IDQqAW22KpnMdHpFFvRX\nIGqEHvl1OsAweBEuGd2fCHDbmipChfWKXGIje3lqnfIArtf5eNObW7fw+qjU\nzI8oA9FVrke5O/0fLX7lGXKZueK8Ag60CfKukto1cleva8c9Dvnh/4vdPuai\nyTBvMmjSjNfOS+H7LVYJKimLmgbOOYEnPi7Y2J8IiCnMVvpO7R77N0VYhCbK\no7WTGmqSH3xmojgFOfmodgZhnw6/J/ZjVgPFyAj0IbWGJd5PTaWy4aVTpRpy\nw9Gw35bSTF+XDq24rmW7qXqNZsF6vLnKH05nVkVAxqcGz+YClI1ljShhQ5dB\nWPRSl+xClJnuDwIKEZ2UhYFIFf0Y1X18xCJVUy8gXrFqbAm9EGzvugoId1wn\nFajWxF4fiXlrkqmwOEYtH3vaXLXA6MJ7qIDmAAYJ+0aNl364FP/2ayPx6T2R\n5WKaFZj482RBDAlk36D18DuWdUZsrLk8GvFmhC8u0qYnvGYK5OZ7H73yiDCN\nDnxQox8C4sY9CIuN/+lZ/IHi1z6TbdgqmwZ9IeD4NwDZ3ze3NjjHx37JnwgO\nSIoH/YnWZ51nRvBHy5+wfrrARSLGlB4DPNrSAh1+dX+MBLUYyjhV5Iv+ieBi\nHTTu\r\n=Z9pE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"dd6145da4de83ca4c7ea31ca8bdf8c4200d2fd41","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.99","@balena/jellyfish-environment":"^2.2.31","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.12.1","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.109_1601214310684_0.805942257116534","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.110-renovate-non-major-77d11ec0c674b14d583bba515385cb4a30e9b77b":{"name":"@balena/jellyfish-metrics","version":"0.0.110-renovate-non-major-77d11ec0c674b14d583bba515385cb4a30e9b77b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.110-renovate-non-major-77d11ec0c674b14d583bba515385cb4a30e9b77b","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bdb1bdf9ce3718a9facc0826ec853ef9d0e4ddbb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.110-renovate-non-major-77d11ec0c674b14d583bba515385cb4a30e9b77b.tgz","fileCount":16,"integrity":"sha512-FVUdHySS7Ww0vRu+X+iCtWawvnJ5lxpOHXOpXZZO/UiEyfEFap5OAw5J1R5uBo8Vaf0DqWfntOWeT8zb8QGL7w==","signatures":[{"sig":"MEQCIG5st3Kh0N5uBCCrg+ws4/a5WqNN1JWdDKZo557EkPYzAiB887E0cSIDPJXT7xUuN8iNzMFs+BmhJMH0NfHBkcQKWA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84318,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcLNRCRA9TVsSAnZWagAAms8P/R8Et1GlB1sthzzwLVzE\nlG4/nk236zdX2VUBt0YIZ7OsqR9VD2pXhCjPfc1/kwRSWhf2DmnA13QaqiAR\n22fSHmUIK8n0R1DL9xAQGDiT0rwpXZyoUd4bUkhOZb26p+uq4lv+fa5c7wt/\nMI30+NRPjcjCWPIKwxWSu76BSufm1ZaUp0WYDw75joPAT3B2n0Qz1BwlH56u\n1tmX5N0F4A7PieUCSt9y3bQ5hl/WaOwy/UtQzumOk6Icclv5wnfBmIIVZFYV\nQ1qDq4weLGj85LVImpDYAun8hnXCuLraTpyI4uxGmfL6XFRpaHEbA80ANKgP\nuQ+2RuYOExH7X25GejK7oLwVAv2ML+ZLxcgdtcQNoj6ESLxTH5s/h3KNu0MK\neiv3/ifzeB6Oq8MeThliklgloqgW/ynA9M8iEbV04aRP505RwPOmndO6mNli\n7r2hMADADnh4isasI8xPDmTf4b2spOOf+C1EbnOuPvWXQNodWqVtWOXWJFY+\nNJTArTLnHU9N2IAXWHVd7ZOiDqvNJsH36Zi5+96T9K7eB6HvaMPcQaFw/9dd\nYokGfmjyb9prZfROSE/WwwjWsEGe9XEArq2EIlK+jL/bCqeGl1c4MogbJV8V\n4w4057Qr/ekyNL0QtwkzUcGobc6Wf7408K5aqNtg82ukndDpNNy+y8p6gnPm\nUrVg\r\n=4tC7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"77d11ec0c674b14d583bba515385cb4a30e9b77b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.99","@balena/jellyfish-environment":"^2.2.31","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.110-renovate-non-major-77d11ec0c674b14d583bba515385cb4a30e9b77b_1601221456701_0.16786841857119006","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.110":{"name":"@balena/jellyfish-metrics","version":"0.0.110","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.110","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9b3f285528c1b8bd74dfd8869b2071965f56f9cb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.110.tgz","fileCount":16,"integrity":"sha512-whccsiSe/OBImZpCq4xyBE4KnkHUm50Uq/roCxnmXvAukUksAFYJEuYl7iulYS/GY2Bz36vwmJhCRLoBxKwhsQ==","signatures":[{"sig":"MEUCIQD2ViUIrP9v2pcS2wpk50qHuHoYuGuPPZfNR56VBpVDJgIgIDTLsUGB4moNjb4pGOvNpBGvM6dE+L0v4FnQh+t2oN4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84258,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcLSLCRA9TVsSAnZWagAA07sP/3ePBSe+YLcXc0QJbC3b\nyl2TrGI0+jejefdn+21AQIcv8GAY3683cJJ7sjlGNLGnTgKNS6d/qwpDNrer\np16bttnHQNnt/RLdJgRPjVYV06fAj2ipwd/W70RNEmSCt2C/HF9f3EHgslgL\nBUuL6yn2AN8HseHnHajsPcwF0XZzkhYbHIm37zODyhPSd+0hsPb506NClyme\ntxUQdnx6N/abqC9CUewlMwNTB0gl9gssOurMwqmhNCnJbDfx/M8otKoreMBd\nKsldWirORRtRWf/7K+YvRC3xBumKT/BK6GhLcj22uaVITfIDACi172ml4T/L\nVA0/qLiL3AF8pIh/wwmEojSEdg7oI46GJLhFoKJGf3g9tpEWClpmCHk2NWgy\n8b29ykcVo/SsiTr9PjnUjq55+QJxIFDA6QKtggGDnE0EnZTwBbUvfmvOy2zk\nXQICus2yRGZwF88CM4LuYTcKIILU3S67vWjqhp3GXWU2Yue0Oev6aHJGpva6\n2lRcs3UOU/rIZb0QT82tYRPQRfNIJ3At1CJOQz1DP7c4JFC1OLR49XHpSMAH\ne1cHie7scyzhaKU4qpjKlDcuKBQjoG7Mfytc1WEB6SDvTDaQuDkgvU9MFIlz\n+iM8q7HIGq6XiyLrkvLOr0lNXvxKltwOOHd2cKd/JubqJAm2qtrBSVGoKlhs\nx6BM\r\n=JA5f\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d029775b8fc42d0c1cd877f3079513a3fabd8ba0","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.99","@balena/jellyfish-environment":"^2.2.31","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.110_1601221770361_0.8749724423202212","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.111-renovate-non-major-7e9392719235e2f2075d140b2e115062f8a00d51":{"name":"@balena/jellyfish-metrics","version":"0.0.111-renovate-non-major-7e9392719235e2f2075d140b2e115062f8a00d51","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.111-renovate-non-major-7e9392719235e2f2075d140b2e115062f8a00d51","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e0d335167a189f692c851e72ba4ea85590b9f85a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.111-renovate-non-major-7e9392719235e2f2075d140b2e115062f8a00d51.tgz","fileCount":16,"integrity":"sha512-5Lze5v2W9HJpvCU3RMFL5EvxdmgDq8wNXJCz1yvfCb6bB96onBO3D01HJkXXACiXUA9bO1QoELLAf4sDhEQ0NA==","signatures":[{"sig":"MEUCIQDLkt0Z1wAWBKhC6YAZTNuV10wsY9NIqzWJlw05D/d7PQIgUiSwVYGGhp9GQXZ521GZG2wJkFgeG6+nP0YxN+OyPLk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84389,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcMNrCRA9TVsSAnZWagAAtQMQAIEhX9cSO0Fxf4tWC7hX\nwnMD5ypcFhQF8cW4ex0bW0dVx0xqj2N1KjVbymSyeSleVHJ20LrNbnclhb0k\n7HMKxi3GZW78E9Jv+fVIx5R2KDz+H7o5zrCKLoPP7BH45TJ3u/fVp6eUUhdK\n/Bmp0/ftAu3gcCoavWiV6v/nW8HrqzHaZkpMkGB53uKxx+EgncX/IC4r1Kpy\neAnPI4rPjYvu9NqKERgEr4h2XrSsM8IMNwYsqg7SI5OqMOX15iQcCgc+RtOK\nkQUacuAGa13Y2X/l+yCCTveGsANmNXk1/OkDWP2UHFZ+AiTZCl9y/TsfQoAU\nETfFSTh5FF29f845BSL/4ekp2F6LF20iZaVSVKNSEGfg22Agu6XgnUspaFaw\noK4If8/ylJlGBj/OCqAT18apXI8xFT1UPOHCH7T1S8UPO7bQsVCMMi+vAj/j\niYSndtS7PVJhO2esKL+zHOXPs7ExWsl/ouzFduw0N9/DM1Nm00wcD/hRHmmP\ne/LUrx3PPI2GFhYr0DrtuAoTpVKeXEP4GsEf/KraUp8VLVD+Wp8riGbQOX7j\nETSv6YEA3N9hACle+asPY4sWiLADcAhtACuub2J7+RYMmeupUMp6sXoI69qB\n+UbtO6mx2mkiPcZ8MOOYflW3hJpZ58Z/GYalzmlvg/9/kFMw7CVrLb6oVowF\nu2o0\r\n=asRS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7e9392719235e2f2075d140b2e115062f8a00d51","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.101","@balena/jellyfish-environment":"^2.2.32","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.111-renovate-non-major-7e9392719235e2f2075d140b2e115062f8a00d51_1601225579324_0.12149200079496847","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.111":{"name":"@balena/jellyfish-metrics","version":"0.0.111","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.111","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"67ed6a00848adfdd99d233052fb27bb5c2ec53f4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.111.tgz","fileCount":16,"integrity":"sha512-pysxCzYbb1xzY2Gg5Mk8w0xElfWzO/RHm0g7TRqWLa8gQ4u78AKW6my+Dr9WlBMgIhQIgJmVMOa60pdgJqDo1g==","signatures":[{"sig":"MEYCIQDEc5RhsxgczCibPaRCBlOtEIXRTyvNMtv42pN88qmGWwIhAPPsl8KF06+BnL9NCp0yf0cLUzmMvBrd8AB4r4MIi8p8","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84329,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcMQdCRA9TVsSAnZWagAAA9QP/jYzIjr5/xdkKllOctWF\nnLadiAZ6+ogIIkLtosx4VYl0y4/4PA++0oG8xHbkd0w+rWlfCvghsrXa3208\nRLYLnZPipIqU0IdXOTrXvfVx5PQuE8req1BwfyYRd0v3QeFSjthd+lOau6nu\n1lph/N0GkDXMG6K/RV+1o598yOv8WRWPf6XUCUkYNhQ9e9QDEDVsiB2jSDqz\nzb8+9D591XJB9XV1iTJdUm1Ara3ovKtcb4UqbEdUPE6vtinSn24jO1qbC6N1\nS7vBvhRJ09DgIOXsnA8yY6RtDutLZDqNgGJqvb+jB8+lMiC36DOHlag8jQbP\nosf9AkLapBLHVbkTW0mX6eNDlORFwtUrdr+2IHZWooaJDCaB2e+MF8ik7V3M\nbCJR+oad8OxO3Fica/eoDnti7orLggW7Oy1sMqYIQ6mrOo5V4BbISnXgJ64s\nyhEjtCpjsi4x0Z3UWBwQ76oqqctoOGvXG3mfibGD35rF8LVS0QKDcWcOhswo\ny2RRpC1Qg+yMFdFhdl9HWevZl/HreSV/KqnLzfIMOQu+vP4O5BbBOC/BZWr5\nf9fJA8smjM28sILgTIayx0bW7zw4HK9bmzizuyz1/LTKUZdnNUSTmFCOggGd\njA7jMul95Enw/nasFFtIQ9lRwn40WeoQIvajrpFg7G0WpIgOrkO7JhXMtiUR\nCpjV\r\n=Ffdl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e81c11580500f92540a319f998793b1fd376416b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.101","@balena/jellyfish-environment":"^2.2.32","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.0","eslint-plugin-import":"^2.22.0","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.111_1601225757070_0.7999331324259982","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.112-renovate-non-major-82602346b8586bf8b108bea7dffdc1b99aefe356":{"name":"@balena/jellyfish-metrics","version":"0.0.112-renovate-non-major-82602346b8586bf8b108bea7dffdc1b99aefe356","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.112-renovate-non-major-82602346b8586bf8b108bea7dffdc1b99aefe356","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"55507dc4d144605fafe980a8d07caf1c64501d35","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.112-renovate-non-major-82602346b8586bf8b108bea7dffdc1b99aefe356.tgz","fileCount":16,"integrity":"sha512-j7K9Rlv2Lf/OKlrk+BrzNLUY6jyt2JYE8z2TBn0dBAAKKZ3ZHtjPzbf1iwQ9BYbHrO5zfvBQhZgFs97bV22Eww==","signatures":[{"sig":"MEUCIB3fOL7VzQWnGcAOopF4qN7SUkV+Y3k+cgqR4wvl12qmAiEAvOfbTlv3vDHXuk+RV0Im1hCVcjfpLQ7uBCXUvAhSS24=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84492,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcTw5CRA9TVsSAnZWagAASSAP/1QLRTrImg50k8bneze0\ndi+xQGKb4qlJ0fL409uCDMGcx84gCxuGopy4FwsqHYmeImdxBqpLkrUUrwF1\nQYI01/YYJtPvhrq1FaKuXRZRuzj1j1Wz3xxcTOZB4WYf6OV16L6LCCNFY8uK\nRgEvOFf3UDJZnXTa8RA1GvoZgUAyR/jkNnK2baW559ewk8PL+Zsr03PyYa1O\noZEbqAQIahkDRAszIM1ssz26oTlA70zmQuJFBec5W1LYC1wg4mj89vKFIZXt\n8TYHprCmnVwOtNivFvXV4Zk694vQt+U77NU7jbOC/bBcjUmONOzq6/fIyvUG\nI6p4HE3haIFfbWVD7KRDwr/riP9SqbQl+npOQm1Dns5CpzB70QewqmHVR7SD\nY1Cjj8JHjc1NsFw7cVds2QwK1UNRyo+8opSKtXIEetMN6tidmIlromGQ7tqV\nTq0P+VWaT//x7SXj0ZQI9UM8TLKGntxP4mT5nF2Zi9O7UpXBJSn8w7mNwSrd\nD8wGKKrmd3pUypj9x3Ziz0lTzcK7YUOz4jInixjASglO72iSiycKcisFW2J5\ng5ZRbppEIE4wXMrY0Z2JnnYqUdfyWy4+4p5MgvMoYTRf1bs9cfzzG3gq4U7h\nun0stIOMa9Zv/WSOU1AOAl7tdAVkgBnwvfq09DJFJu4gwUgPOgcv04zbQKsd\nv9zr\r\n=l083\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"82602346b8586bf8b108bea7dffdc1b99aefe356","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.101","@balena/jellyfish-environment":"^2.2.32","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.112-renovate-non-major-82602346b8586bf8b108bea7dffdc1b99aefe356_1601256504655_0.18854759478635463","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.112":{"name":"@balena/jellyfish-metrics","version":"0.0.112","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.112","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0e80462b0ebf7c0dc94d6d94430a6ef64fc5adf4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.112.tgz","fileCount":16,"integrity":"sha512-Bn57LG8m+D/GZXQ5C5k52Hlcxi8bMYHHgDEiIdhgYvSbTdO7o/WHitrmPpCqsxDLQ8Qu9LKQoI3Uodtq4JOeeQ==","signatures":[{"sig":"MEYCIQDAn5JPZkHPqQuqzZcVpD4ocW7emv0byOd1Tmu8lMov+AIhANXT9r8IB3XOSDKBOqBL+rb7bIU2sydeThnn3yTvluIl","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84432,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcTzQCRA9TVsSAnZWagAAT9QP/iPyoveNTqUjpmEHyZcv\nQOTp07TqsRosuaxjUZXVKst+L4CT2RW7PAg8YYh1OyqmRU0FUZoPOHujdxc/\nSKyEQT4soKoP/2Z32rAXFHwQQCMi2nlAi//eA0iO6kBDBCyDLi9LiefakhWN\nrC05yHGCsedgZjrbHk9tVAWgOCgNXw8padGgwWer2CvlyfZBs7xEWweDehuu\n+xGiVN59yJCBRzoOLTNXDV7i2QVSM8UBymt4ndH8YnedQFE/qb268cQugM+H\n/VoAO1RBTd+68zf7nzlmktzXaT6BJnZOMI74wP2XuwIu9+KwZYKhluA88w3w\nEVvKcLDrZ30YjWafCqsot1wNIDKhf1CZEXae1nWzWNyLhAocO4YARPCLiEfC\n2tIShi+0Wl3pxbnMSAYzSrCa3+WQccak8gP5lA/T8fdGGvttCnKGKBiSoa6U\nrS/Jp7/fbHfwgsxhUX0xeofLlNPpzIgF0gXtRTGE2LkDvnEWKN+9IPkMpD3V\nqzhnST32WIGgqSaDr8sBhvsTA/0O8GqIwVfFfG8st0IujjiATkXqChsYFRU7\nwMDTOm762Ak6hJzdZBVA/qMb73P3FA8MYXJ+4uRk0x+ejNVomBu912K9EcvA\n7tNP3qBvoNcVm3R2b4oCcVUznfq/O0LKouKeauXnANU70oT/6qztEixa+3j3\nr0I7\r\n=fJUa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"72eec3d89152fd57053bba362b3a90af644e1a81","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.101","@balena/jellyfish-environment":"^2.2.32","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.112_1601256655769_0.9899557880447034","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.113-renovate-non-major-61b48e1d920b168778d659d120a3ba72ec58205e":{"name":"@balena/jellyfish-metrics","version":"0.0.113-renovate-non-major-61b48e1d920b168778d659d120a3ba72ec58205e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.113-renovate-non-major-61b48e1d920b168778d659d120a3ba72ec58205e","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d899b70f37248be6a2a8817aade14977ed0ca509","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.113-renovate-non-major-61b48e1d920b168778d659d120a3ba72ec58205e.tgz","fileCount":16,"integrity":"sha512-4rGvFXVXmFlPWRAHYTWP3G95zGKIUAKDFUY4PuQwxlQhdKB6WitX2WfhCoVJws2GZxzFYN/wjj/hJGHiaQ5u2g==","signatures":[{"sig":"MEUCIQC6ePy+RT5yPd8lN8ZFUtQ8lEOnSzMUbqBNfDRC1KRvGAIgcZPlIUweOxADQ8LrEpDFmqn/ONzFnW6IbZX/mZmVFN4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84604,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcU7bCRA9TVsSAnZWagAABgQP/izCINAJ2Kze+5ft+Qbw\n0f5PITHGcnLTn7ApPpTFsg7gP8jobIqOvlD4sMamePcsj1xCXN0wXHYsppVd\nCEbb5myuDV1Bwl0WtYlYrhfz4sNtqAWFKNjrFjg6F6+rnFltUn4nx3OwYUMv\nAYvxUbTi4XpXvBAzu0G3FfUkRN9IsEfhanLKReHBXB9OTIfDtXwP41mMuOCt\n2e0r27LNoBOgXd0E2vt+S1vSL9LiSI8igPm8uYr3wZrG85RvQCYILWplF4Tl\n1wdTvvK4eT6TcaoZvERajEeC7g+6tVBsA7FQmOyM2R+qc9nO1UYvY93ekXJC\nO6PnIdyN02XN2SJhtV0Ko3b0P1bMmK09rNdJMjvm96VtDc3KsWquW6v8aQvS\nYfSKB/wuHF5KzNeAEPkTK6NHHK+YrImKH+Z8+luJhU/9IA+VhGJQziNGcZqm\nIrYaMIEFJcxnYh4LR49yA4vnrPEYwDHA//NkQxe1J3oCEowGFWu+nPtGLh+x\nDiVgqHThoSEMHBXBU0ukIZJv4jNXG1asx69ZWBEwo7CPl9nE8WKc/j4Sh6zy\nE0tftn19W8IqUHnYgTEvEEdFFPrctzmw6D5Vz+McGEHog/Ju8q5BXH3/38tl\nKmmchZncpTYwF3PINLECtfNWk8Rjf9+DX57tH+gbzR0scsoSepGXMxHTUXh0\nV0HH\r\n=mmE2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"61b48e1d920b168778d659d120a3ba72ec58205e","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.101","@balena/jellyfish-environment":"^2.2.33","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.113-renovate-non-major-61b48e1d920b168778d659d120a3ba72ec58205e_1601261275567_0.3296429788723392","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.113":{"name":"@balena/jellyfish-metrics","version":"0.0.113","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.113","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fe9ce0a005aacee002e52ac1a8a8fd254e544443","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.113.tgz","fileCount":16,"integrity":"sha512-277NEWYmRsfNn4xbhoSUJmIfVyQfUx62urrWI9Yvai6q7d89CsslUB+Lq+x0aC/EjOuD2ixQJyEjA+pVNKokzA==","signatures":[{"sig":"MEQCIBoYK6x0pNFP4wPFUtRgN919vEXcjl3xi7gbsfH74JqEAiAUupYYNXYfiRhMQrOa8jriMq1Gpoaiq0ziMratkjA9Nw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84544,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcU92CRA9TVsSAnZWagAAxicP/0YNfVqWcQ/dyxcdH3uc\nPVvDge2c0vcQjXEKTwc0N6w7SScZ9eXPdl2ZJJSHhxuMdXVNlxGkLed951bN\n1gO8M1LRYtPihlOXWkiRnythEk7Qw3Jwxbw783V7oc7DPI3m9kOvoyC+IkyE\nbbnNGW8G6oZvOSikuN2/5WEELzIZO3+8KSf0bnqCiLkvLW7rgnP3NjID+FKQ\ng5ggTbKE9Kf6ZH8dwwU4wl3Jcm/v8j+QWCR2eFpCQ7W73PFFWEqbh7uKUGoI\n7Ve5VaVHwy7KDl4yaxFSciWbw1zMUFDBQDD0rJzlvXPaIXfHtQ4UdXwNgLJx\n6tD/jMVl24Y/4MOCYNAPSzrr/XjDvKMmBZ+K1p+PmqLK3tCwsnKLQr3ztXDk\nfTTSx3RBTKgKXi8mVVy4JkvVbuJxXKuFwJNM4bSDjqfM6PYmFJlgD8ze6D8x\nWsT7SxwJrxuwBObvLlQZHInohztkTK2NeuW/lZzpjOsuJnKnyziF9P+RZt8m\njghZzi8l0dXqmLL05KlkbQd3BHDVEq5fMwPMRkWJ+Rh3U5XDz0595+MohBcT\nRo9am4xSFRg29D1iP05p1N5gL49Bh6FvvYZDNZJxC4GxgbzD4pOA+LgDq/kb\nBzywemojqHT1/xf4jAyoAKEww49mB3YZHM0l1igkgpHeILU0iwusyJrT//V8\nHXCN\r\n=2Q5V\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"1816ed5df098c641334b24686a09b75f79dbe1cd","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.101","@balena/jellyfish-environment":"^2.2.33","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.113_1601261430311_0.8659147717436122","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.114-renovate-non-major-9070a8f8c92ef369210168cbf679c8c31df00fff":{"name":"@balena/jellyfish-metrics","version":"0.0.114-renovate-non-major-9070a8f8c92ef369210168cbf679c8c31df00fff","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.114-renovate-non-major-9070a8f8c92ef369210168cbf679c8c31df00fff","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"71db808a6bc6992a9b07a42ee73aac58c2418ae8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.114-renovate-non-major-9070a8f8c92ef369210168cbf679c8c31df00fff.tgz","fileCount":16,"integrity":"sha512-rYAsyCa/7G4LeUmZc80uTdBHby0Avlxq/+e4QQBSHva+/gRr0cI55CxXQJX6lImOmmtowGhvl2bg7Wsj87SKQw==","signatures":[{"sig":"MEUCIQCMK+dBooiqF2NLFvP5iSyX2BiYFFvv0cLvSua6XkbBeAIgdig8aWpbDIBcvNtGl6uDkIUdHKqguy+7jboxhyDRZdA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcViuCRA9TVsSAnZWagAAjTQP/1YAZB/lDGVlWHpcb7lc\nvNMKB9MmZs9FVNGpQmcYn2IjMu8f1kI2eD6Rlo8TghbOuA8iBF6BMbBovBET\nyFfRaOzOvzlEleiLemoyHuiA2oxCWKHuwlvXmjkHA2Wn5X/jRIu6Th5yMeRj\nwhEeTHNRPVqEnejGUm6zAUZmjRe+1y2ZmbyuudSSgThSuJxw6W8KGc/zAj1Z\nW43vgau4A52CE9IE9BB+Y1a9x2thvF0slSDBTnW9U7srCTBDf0feCwifkKq8\n9v5xnaj+jMiJw9Zvb0k5rKV3gF/QO2fEtIXwxUtONH71m44OrJVA0HHYE2qp\nM2hoJRM5JkGq2sKLQ5nei3VFaHMjj+/OVvep7Y1QvrXNB7ro52Se4Xi5PEoD\nV/oIrH4YGoeMftlGW/9e0sjFuwJB0/jOJJrOKgniDlTfIst15oWH4K4GsQJ7\nP+wyxOnx7NXb5L0ld3Pr/cMMRFdRM8B+mnz5wiEl0c3stXbBF8wlRS23MwOx\nvn7Rv2FX7yT+sU4vxJDXf8NaHYHqfLl8UmQH23KFR2pgBkroyOAiUFQyVSU9\n/WdVsZVsjLQJ9j+8UT28s+mlJT+l7a157XY6yi6dK+BUM0Vxs8lodf/wgyWm\ng+61VnSHs7LBmJjKORtB/cf58wx3CRxO1LlIGDbRtdDcf03YO6KoIC0KIyI3\nqzBh\r\n=s2oF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9070a8f8c92ef369210168cbf679c8c31df00fff","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.102","@balena/jellyfish-environment":"^2.2.33","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.114-renovate-non-major-9070a8f8c92ef369210168cbf679c8c31df00fff_1601263789882_0.21903532617073007","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.114":{"name":"@balena/jellyfish-metrics","version":"0.0.114","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.114","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d985de1764f4fde2842208729844463ec45f56de","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.114.tgz","fileCount":16,"integrity":"sha512-dJDBKanbIz6dU8tBoklgyAiZEEkmIQzeDbWFPqFNpE4HL8qvrWruLYspbSod8Dx8rmfNrhu4W6KrugnQGBWKmg==","signatures":[{"sig":"MEUCIDrdTF3yq22aCwvifcaPZ3r0qO90Ik9MOSIDRn5JopcDAiEA04avR81C3nPz5nJOw9jXKD3rxT7bt0ADZqUlBT1BLnA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84652,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcVlMCRA9TVsSAnZWagAA+1MQAIyWMBztwH6jcHq/amM8\nx41Ebx6bG9vgGb8suxJIA4s1/DQft6oVOnPerY42HjG29tU/E8dVUO6HNiaH\ngAtYTHHZXJBRPzHnXPo7S27uAgtpxy8Ur0b4Fs2Z9R045EV7G3u0MhhHjGit\nxqTQ20VoCLz5COqI1po/9wcNlrLEQFj1ZorYqnHcPERVJj+R8b27uwGAu63g\nrTjExGbF8FwfXqQVi+KO1NtDnUZ/ovw2okXJ0DVLaknZeu9lyL6TCMIk6P+t\nytZrlGQQRWDC0RDhLcYEi9AHXoJFRk5BPCFQ2sjZdfgciUikoTlQAG1zsHVK\nWVLfaQbXPE4MnIlFl5fW9GSjOkepYE25LQQ6zSNRH4chFd2p23G8hhRIkn+z\nA0SRz/xNRNl2mjUAhSTTcQEasrFUDB6sPHcu60F3oqqXnRdmnvLXN/K/sPe2\nAko3iNaeQ1mOmVmvw4ntBoGapn1wZnHtkVOAZFCW77NsVEsu8O0f5oylLQHc\nKtLX19pSn4wi4AO7pbuyazfFEnMw9IM+KuJY+hNBpEuAQxCELx8eRRTKti+k\nLv5EabwqSZIxDKCD6PEWfNhFvrCIEGJdo+OeSbfQkSyJWZUnONu9vCFYw6dj\nuOgm3gYVg4DTI1Xf3MVAFvePVQ3ZQlt5rLM9aZbD0oBpha+QsPQc3O8s6EeE\njmd1\r\n=xDbg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"89109f8f4d71a932eb1ba7a959b3eba8e60aa77f","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.102","@balena/jellyfish-environment":"^2.2.33","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.114_1601263947996_0.12133610946293905","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.115-renovate-non-major-c191a195c16038832d9c3c106320fdf0a9deb715":{"name":"@balena/jellyfish-metrics","version":"0.0.115-renovate-non-major-c191a195c16038832d9c3c106320fdf0a9deb715","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.115-renovate-non-major-c191a195c16038832d9c3c106320fdf0a9deb715","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bd2b77bde5188295b432963d915af71c2e4f9b78","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.115-renovate-non-major-c191a195c16038832d9c3c106320fdf0a9deb715.tgz","fileCount":16,"integrity":"sha512-WsTtBPzoBeKWSL+lTBvgTZ+KIqHrHx/hn0GrdKa827z3kNyD8bAuJyq2iYhJTThCFV/ioyLq8HfNk9h2nn1Ziw==","signatures":[{"sig":"MEUCIQCcEbez8ohM3junOUT37cDe1ek43p+MuZHp7Z+c2R5Y3AIgf0iXmvOQGpxq26V4sgVxq2adGsW0gLMSrDRwb0VkWoI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcesICRA9TVsSAnZWagAAbF8P/j2uyJ/x40o7ReMMCIvQ\nOW+BMm7aI4tnW92UdGobU1KSpaRL0kBTImLSuX+paIrI6uOvsS58tb3cypyH\nph36wDYl65iq4u8v/go0F7mm29+xb7rZoUUevx6C9S9kQvlaUqtvhUqlvsRw\n6vIzOw/mbFEPb4tRvF1m6dG5PGXdqWCflXK1SVBlihrjrzubaE1b6fgGfxcy\nKu25orAhEDdkkJYneQFNPhK8utG6q+bPE9Fuz62U+X/6fG8x5lF6kmRUS2PW\n4nQymMfM+FXwXduKBLUyJEs/hGZj5REx9JwTMkOXCnIaJogtKnaDuL6CCDy6\nO8E1Z+FUQ+2+WlNgtQH1jtgLtxJP8jQlR7R4RmbjyqykeGvyXvwPEGvQvqDf\nl2rA8GIVBWGPM0QTIzVGW1TNeGPgdO0azypxcc9RpbCncv+LX8Bj/JK69lqb\n1Vj2tltPp+dNq1XwBt7xeW7LcYmIk+A2YJd2t/RJmXMnjV7BGFVJ9+q0Ax0n\n6nQcYhEJGKUZzZgTSOvezRme4NTjMZ4xrd66pvYPq10uEgS3vF9oCqQgHry2\nX/K8UtmmkKMhz+tnxfE9zp+IK8zMbXFkHInK1myJYCNUEtISZws6Ei1O3JYh\nrnizBg4VDAm9ETdtIFqCtAR2WkZqg8CjJnWMIgL68whpH+6Rk40qQqdXFIV9\nKS5g\r\n=wULP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c191a195c16038832d9c3c106320fdf0a9deb715","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.104","@balena/jellyfish-environment":"^2.2.34","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.115-renovate-non-major-c191a195c16038832d9c3c106320fdf0a9deb715_1601301256355_0.8459578741945408","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.115":{"name":"@balena/jellyfish-metrics","version":"0.0.115","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.115","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"55e4a290136b75ad1ec917acaaa5bb23d97e3e54","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.115.tgz","fileCount":16,"integrity":"sha512-mKl2U7nGfvnl5y9EBGcE//j/8PnAJBQrpbVjf1joD4Ld2WIWpfMkxBykSR8EETaxMIr8N2FqjMGf2+9Jhg8Wdw==","signatures":[{"sig":"MEQCIEi4fDv9QGxu8rTzg0K8NUg7Umg8t8djFrIOzA8NtTwKAiAE/WLrm19LwMLpsamDzAOupYvnZfl0B8lGcbKlnZF0dA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84722,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfceu4CRA9TVsSAnZWagAANPQP/3LjPE8hkSPThj/CVSBh\nSj/bfgaJTDJpmnWtTt/tNf97YOi+gYVMZ5dC9j5rtqrBN50A9yDjcUuaMXtz\nOy9hMhKDzgaKbAB/PY59zVvI22mR3XhquV3WsGn4fDqTBDhSOrpZLOOuk73z\nms/0HQTX5yLZmToJrL0OXkwD4WObHYs/I8wZFyjgZ3MyUOCQ9+h5EwSgbhKv\n1o1JrBgXObsmTbDEhySMTH/qu+1+pDQiMW9dtzT/svXjK9yfR8orMfx4+0ZM\ndx7ceDAM831AZHdSXMbznOWHcJrISGGv6xIhz3uNszWRKnVglIsp69pi34pW\n0OPW60eJRZM+fFYtYtc+NXl8RayQjWx6CTfPYAGwHii3dQxZi/gFsORWt8/O\nq7sSXyk6VJ9YwDjXr5tfP6IBQUy+sQvQg54RUQFy5Iw9Zm24MOeaKFL4QoT/\nglKO2ZhN7ndhKKK4Bjy52da6B/kE7rEZeEgHwu5wZ7ypoQQ1ew966tWfBLug\nc/EUcLn7DHWZEsmrxAbQMXbX+oEUFpilaxdojzf1+VlcbdiwBqLK4j80Cw1i\nxesfVKd3fMegjD8iEsVxsT4Mwol6+Ol3ZGR3M0Mm913oiw1wQy2kQHfBMHWi\nbGEdPTG6DC5juMkTrLKuAs877UvyJqPDyqQkZYOMBBRgvHnCq1FXMbFB4rn+\nO8cI\r\n=CEuU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f339e0e2332ec7e81efa7c546d4d7cd7c5302f88","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.104","@balena/jellyfish-environment":"^2.2.34","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.115_1601301432431_0.8635253424698917","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.116-renovate-non-major-6e2de41cc2db41fbbce97b6c6a3737a0d360d1ee":{"name":"@balena/jellyfish-metrics","version":"0.0.116-renovate-non-major-6e2de41cc2db41fbbce97b6c6a3737a0d360d1ee","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.116-renovate-non-major-6e2de41cc2db41fbbce97b6c6a3737a0d360d1ee","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"de9cd5bb1cdb974a309909b622f6ff362664c304","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.116-renovate-non-major-6e2de41cc2db41fbbce97b6c6a3737a0d360d1ee.tgz","fileCount":16,"integrity":"sha512-0bWePZ+5Y7uAt4ZaUuirVyGdYToUrUpQESaJUHu3YUjcmxE4aPy4MSNem2QK+VEGvuX85AT2hkAoCktOUk1uVQ==","signatures":[{"sig":"MEYCIQCgG5r9YtriyKG/xfSrJpH35OKH59ceonKLt4KZBOCCMgIhANAt2wJkly5v8DuGlVjfo+Ey9VM/QEIDObEi37SugMXC","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84884,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfc1NWCRA9TVsSAnZWagAASEgP/3dtLz8KRH5fUn7Uf/3b\nXsD72xusUi5NVBr9uPOKggrv+pMHwPYYqQ/yqP/Y1ACC0OU1btU9vrqsKjEk\nWPZLmuJxdLszdGwEc6AKQN7fH7kZSIGEkicfBYFwe7a5wt/3w477yYvRuXFh\n/AIcW1bqUWTddPeEdVlPjAQRW+k+ls0hJ+IA9ruVnBGI6B9QQ3B8aVzjMtli\n1gm7wGuBS+u0WNibQ6k6Trg3awm3E/1u/2NropnjOU5B+wBAsHHq7srDSnc1\nQcoWSdcsDo40yKsYO+mu1KA4QHJclrKyK+tJ/oDrfOtQYs4v93YjTOYWgRh2\n5ffICABeqbvYO3IcJtScYE7kWM1R/4Gu7ETPKzEJfkM0F2tLw6RrWOmJ/U6b\nxjTgBhyBkvCWWHjde6HwgpRZsrDHOjQNDz/UGkIQq9l90K24fLYWlJwTVFVn\nI2I9ToCY54qZsNQKBxcMt7z+OAQ5i5ElnDuWpUZFrnckX0KwuXaRMfpAkPW5\naqDoLRgX9yPgDp23zdmLMXgPXvSwJ2N/UI7uxqYZdR56vtary8p9U4CbGeas\nc33p4wg32JknREtzJ5Sg1FY5OECo9N085sNwkF7lsce3jYAVzd/nFSg129lF\n2qv5C9BYiseUnfl3Fp+SA97lb4FzVj+JBESfYQ+GTI57PzlFPokYEDRX5N/Z\nGwif\r\n=/6wL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6e2de41cc2db41fbbce97b6c6a3737a0d360d1ee","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.104","@balena/jellyfish-environment":"^2.2.34","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.2","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.116-renovate-non-major-6e2de41cc2db41fbbce97b6c6a3737a0d360d1ee_1601393493794_0.7063369490115095","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.116":{"name":"@balena/jellyfish-metrics","version":"0.0.116","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.116","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8ff58a41a3b1a1dd616813fb6de1c1dea841cd2e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.116.tgz","fileCount":16,"integrity":"sha512-5BUxjcKFZNLTyIT4Xc9LWjVW7dVNFKcTmnGGGt+2pRdpphSlgai3ZcveHv2pITLZgNjxOVD6Xghu9nkAp2gd8A==","signatures":[{"sig":"MEUCIFQEJS4w2PgP80yvIfyW1vtg/fp25HCptWwE3gHAhzdLAiEAushEKLW4/yBsCPgEY+5HG2KSddHU6ZoqnSdPz723qyg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84824,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfc1Q3CRA9TVsSAnZWagAAzjAQAJvPXyOJD1GuWeXD4caT\nsoSxgFQ1/oRf58Kui2lliy/TMGYI4YhqzZVuvQmBn0VyKMv+8ADn4/6dPHIE\ngihdmM7CBkpRl+aVwLXlTrw7HxMk6K/1XfDqXmPgeXw11OCv5GPd6aROjhX7\nV+htX2f4gonLLB/wvnTTVsMjNPk/+FQwNvclF43fjTGvkdJhVXbXkk4Xh1Dk\niWJJo06FilBDt8ev+Yih1OqeW1MGk+m4pgDrqykpClHAW932fR7EWbUHrAaW\nPQlXmACXzZDkWqaG90vr4DJBzXhgdP6kopR4Go9uWbzSQ/1iDipGOWWaURDd\nASc54d6mdBAyxFNR/f9uFhSQvR25AB+xSvmZmiO/G5E+gQCJmzA6zd/zlR4Y\n3Bctlo/hdHPzUNMCfw8CrM6Z5rXPll4uHq7umo65JaY68YE02uDkrvNdEkRo\n91lvefUH16lw1T+7FMXkPwbnUJyvvbu9BftuZybdJqZtJFowDGfdsP3nXJg6\n0CRGk1qsGWge/VvioDxNgKe8TiHJ0mbUAsjz+6MYpQ6il0db6X/kFAX+JWF2\nLyIMIhySroZaAtBS89/9GTgL4OMKdmCJ0TLvfDUL05Q9lV80inY+nxBPHprQ\nCkYqcQoC6DkpasX2x/YZ0uE4kRLC1q+VlJ1he38+1qYq0rpxQmKH35tzu4+F\nlhM9\r\n=ZAx0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2e9fac83e84bf6d03d632b50272731fd1bae8cad","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.104","@balena/jellyfish-environment":"^2.2.34","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.2","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.116_1601393719331_0.5523207085482151","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.117-renovate-non-major-d157f61c1278e0737993a8214efc66db81a8f632":{"name":"@balena/jellyfish-metrics","version":"0.0.117-renovate-non-major-d157f61c1278e0737993a8214efc66db81a8f632","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.117-renovate-non-major-d157f61c1278e0737993a8214efc66db81a8f632","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3c0c859a1ebd0c6539302f84ef180ba3f8ac591c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.117-renovate-non-major-d157f61c1278e0737993a8214efc66db81a8f632.tgz","fileCount":16,"integrity":"sha512-wOmmg8iszUriNA9MM6VgWXdfqfpuBe0OrH6et1puAbNTjiEEcwgn6WsBfEM6jrAuwqDI4URSX7e0E/iLV7lYPg==","signatures":[{"sig":"MEQCIHcDiG5CBXdBLtwtI0ht0w4EKBODQetTwF+HnKuPQqT4AiBcmgwnNYQwCfji4NEsd15ohuEe/Akvf6phFisJignB5A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84992,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfc3HOCRA9TVsSAnZWagAA108P/3Xmy4M9KPan8B8hHcAW\niq6EodI8ySD+v1bioG9MJ22/QLO9kxizGWEPfT3n/8aFCHu63JSArbeYYwMy\ntE9bflvMZriA+kDrtF2fKyYppjqnBU8qzhiaQdEl6Yi1hMN1GUiOOx49h08g\n2fdkk3wrmF08JxXfwuOzvAlg58op4KVhBddos4d9Tv825uDN4JCKYHsWPSHB\nmvxmpvnDowHsC/m6XoBTokvIMWL3zxR6hMWwf/0pJkE0ynZq65r+tl6zhD/Z\nIJG+we3p0ZML/3/s4/94cJpw5i8Ke5fdJTFkEFyUY9+0J3U56jAOxVenTreD\n2VCnl9E7pDTINyZ6z7+C7Fx9prNUgSedzYgocMhVaFHHC9kKBQC9/JExqnz3\nGB1I9vtR1h59strYLUS+R7BCattG6AhxoXWuhqKzuobXy6S2Oj6QcEQeTnY8\nnNHG3KfWWT6GoeNd/+O3BmHy5V7OoqLyHwZ/Sbs0j5DtioOXtvgWEELsMAtp\nB1rLsfhr5YvRRctiKFvIFYGnYNFkMwAlvaMvCbIHr4vSuBpdGTl+3FNf65Ve\n8Z6H3LKv8OkXIb+sZc2nhig+4HtVU9NeFP2v/fN6+17zv0/OTcV/HE3UkcJ9\nwFFj7+t8M3QIiPh/eQZdr7xhgv6BJwbfuF3VSr8WcRmeIWOLL4PVnwma2t4X\n5MOW\r\n=3ILL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d157f61c1278e0737993a8214efc66db81a8f632","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.105","@balena/jellyfish-environment":"^2.2.34","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.2","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.117-renovate-non-major-d157f61c1278e0737993a8214efc66db81a8f632_1601401293751_0.19201816944551475","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.117":{"name":"@balena/jellyfish-metrics","version":"0.0.117","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.117","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e82abfb59679f76c6427cbbc6770aa469633ce93","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.117.tgz","fileCount":16,"integrity":"sha512-4OaR6Ms/9dTrfZlbLMI+1TBbovWRsfb+ZNSkYiIcZ5Z3vqYdgYywfsG+9//mJzCuEVQkHhQRkl/HrPmF9ELtuw==","signatures":[{"sig":"MEYCIQCqrA8rMLbx4SWFS5p/u641pcgBLfLSvVakSHZ6Y6HG9QIhAO+WEcpEfq3uhrv7jy/Cq1Lvp5NkVg4NnD1D+9Oqott4","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84932,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfc3J2CRA9TVsSAnZWagAADkMP/0R1U0S7KlH3em/RMw3x\nWzz63XT6/tc2azZX6PjPc8IBg+M6v9yrv+dMsKdIMNb1Wfypvvf7wQUC6Wo7\nntHuogF79Pb8oivmhrZyON9t6J3Vg552Jx43TC/JpsYPbWr3BGl3w2vWnyg2\neIvGArgfr+QxbJ8AF3qXJgdj6r8xk5ShbaeCHvfuM+P+ow6ZRtEvwIFl7e4+\njD3uOasjsccCX0zfHhYDCia+CjdUcnmkpiiulhkEvlTJHVUcpRDxshvp+cyr\n/JIuBbHy6XJ2Z+zWpB4wkYcMhborXt4ee4d8m0ZG/gvTLXjI3tS9KwyZKYyC\nPTDdiSqICHoVE8/yA6079xQNByqQeGl1kk57V6rzRLnAQly5QA+JC33q5DMQ\nUxokN9Jer8h0FWfrBetLHp0BXqb+c4E4dgNrB97FNfj7b0Lp3+uL6UO4oNND\nD9yU5fMxgy4GyIA+RQFlJdkWdrba+Tie/PRhXkEJ2BJSinYT9retV6Kyi2ax\n+PeCwApe7yEqwY/ppwFi2o2P4OemiFzQqbfd0/Tcd2m4TDQoTFuvgz9WakIi\nXy+Nbh71rF/XJOF9B3o075bWRhldRa1v5hukAueKkLbjQ8b8prjl/Jt8H2az\nlaY4LD9OsDGAVy1fJ0p9U7aE1bzUvlWWtD50SRgwMu41Dqx+6cU2II6ECNbk\nsS2+\r\n=WvtP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b10744a5327d639c684401042d9364855902ce48","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.105","@balena/jellyfish-environment":"^2.2.34","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.2","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.117_1601401462171_0.018319375622688705","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.118-renovate-non-major-e0383f928e59d6b9699c2ce2aa490bf722689a75":{"name":"@balena/jellyfish-metrics","version":"0.0.118-renovate-non-major-e0383f928e59d6b9699c2ce2aa490bf722689a75","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.118-renovate-non-major-e0383f928e59d6b9699c2ce2aa490bf722689a75","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ee19b53de62ed0f39614032b5724289d564626d1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.118-renovate-non-major-e0383f928e59d6b9699c2ce2aa490bf722689a75.tgz","fileCount":16,"integrity":"sha512-Yo+qov7IKF3HgGc8ytKmBwfk8lGwqX72owVAXrmVVdG6kZ9SvoLt/Mdoy/+MU9wo2HOv5mb88W9Vt7gpa19iFg==","signatures":[{"sig":"MEUCIQConTzFpgbdcjSQBCkBlD2ETMvJ/IPcMMwh5dJ0wsLmpgIgUpMYPO/jBAJ2iSlre9Vs0jCKObj3OO3MAd6lmKw6DHY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85062,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfdJkSCRA9TVsSAnZWagAAm38P/2Fv/+pvpt+gkjHkqTSZ\n+PcY3/UuxvaAADfIc58XHYZw2MK5K4ctyWsUm5wfY5vlAfZD0FAxi/crtjEo\nY2egFCV9Xt/l0KDfokz2ueWny9q3h5T8jzwA1kNJUFtT5QoYhlM0HPO9AsW3\nfMdcTPevBoMVH4jNgsSfOStmX/pk4PyOdnhlptvCBYlfuXduZrkvrE78Tx6h\n6JqWKoZ+ysU8dRV8yVVrnFBHmpal7kYBVUv5BtI3ivXm+iA20mmkqFYZ7Ipg\nd3LdhhxC59zOEhn0llS1U/xr8BvFZBcFv0yOJtgrHAvC6w8ej+yKxZS4T/TQ\nzJX3jo0eee9Ml/vgHl81IRIpWwpGG+w1kcVWYHU0YXm/20tp03ubLLz7n7QO\nQFgSrnjVWwzDYthKzVbg+wgalm8tGyJl9z1Crp1Eqvf+5eHei6EsIH0/s31u\nPvzmo7vT89QNm9vKKkbn45gT2/s3CSm+cgaTtgm1dzJ4T8sEQUoj90y+z06A\nCNAAoIC3vxBq4Hky/l5d7fWpXam9WGWbT7uZnAJ4ZmcIsLkKHJgOlWDcNv9b\nZ2JQleKEbQaAM5m/DIUjZHXpgfFUyPVrQWv3Xma1HOe2Jpwig7c/FP3Yu2Cx\nLRsQsDZ2I7iIBm6t3jhnPNGZ8FQJiJbJg9G8zW9vrKBeMvGPtojP3JPS+MMu\nCJNt\r\n=WvQU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e0383f928e59d6b9699c2ce2aa490bf722689a75","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.106","@balena/jellyfish-environment":"^2.2.35","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.2","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.118-renovate-non-major-e0383f928e59d6b9699c2ce2aa490bf722689a75_1601476881816_0.9183443140336269","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.118":{"name":"@balena/jellyfish-metrics","version":"0.0.118","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.118","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cdb26f47fc1026df58877a8b5914b84a582cc2c6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.118.tgz","fileCount":16,"integrity":"sha512-E4MIA2gOgFCdmJTmUlwnujLt48QwX8mktlT1iVfJr5Ov0bvnuzZOYmW43xxs4FNN3QtthKttaU8PiwaWiWZrQQ==","signatures":[{"sig":"MEYCIQDH6V3j1qWiRKRaTwa5SQ0qQojAyX6oG4RPAwVl/XNSWQIhANyN1UyhEWHUPJKDhiC8klX6iMNCmHQTpF6D8NQZ/8uo","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfdJm9CRA9TVsSAnZWagAA2SAQAJDPsYS3FkG92NPu+GlW\nsbqEHNyubrtv0N/w1xH1+9IzSgWVy3j2sFQoOdccCWCw/8Cdpq6xU58Q1skD\nGR3GQct7btHSeQ7vV/+fblmjOBahu5x2M7RiYO3590s3r1Xp9ppbbNGXVpI2\nkHE6cG8J97CFgJAAdtWgErV8fqs/QmF3XxOuw5W9RKTqhhtgWiIE1fYRV4Mi\nY4FaD/3AXoPI9T+kq39nfj25HGwfFazxTtWoxPjn4ntQQqVzt1Jy6Hol/cpL\n2OQZJITRbBpjw1I4SJWA6PfNErV4Wgs9d1JX4FKmGfw6dvvF0npSUN3Vz+5U\nvyF8w8EsdK65HNrNPaSgqMNHaF5vFOmv2NxCql2O7efJK2YKGB0Xsr5OceSG\nbdVA0NvM40ny72LtgDcYg0cA0EOFRZ0ZaXdw4bxLqUSLokDOXKTRnKIyHhOD\nJz0p5TlPDCxKCaY5+p6vWmJoMj4Rmx8gRArqOXLJ3dCo9PBwUwt48eWTVhwf\n0HLftHda7K917uMLdKFRaXYBLg4w3kpzUzYno0Cg/DyxRNuA7LShN/Ss4ZNa\nmrS98fjI9fmJARru4UZntBGy1YAUkpjIW4jBj1ChnQiUgs/GjYPprRGXapv/\n80ijhQBJBzeHPus/NsaNJJB/LPzcpauGBj6jnGTr59Fu0BmoQsSOn+9JqMCm\n8f0M\r\n=SlQA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0de4cb8da37b494b68c1cd9a28c60a542dc165a0","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.106","@balena/jellyfish-environment":"^2.2.35","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.2","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.118_1601477052507_0.9942491360558712","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.119-renovate-non-major-aa1d8a42f9890ce9c1a06f5a217e55f2542a6e4c":{"name":"@balena/jellyfish-metrics","version":"0.0.119-renovate-non-major-aa1d8a42f9890ce9c1a06f5a217e55f2542a6e4c","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.119-renovate-non-major-aa1d8a42f9890ce9c1a06f5a217e55f2542a6e4c","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1b57bd8622037f08a4c58826bcff79c4e1aa9fd8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.119-renovate-non-major-aa1d8a42f9890ce9c1a06f5a217e55f2542a6e4c.tgz","fileCount":16,"integrity":"sha512-Pt3cMW07e/o9ELWHv70yrzcSmZwufVIvhJAuH3C+klZehaGeSGTvGBxxzXEEsUwH9MF+USetDpl2mnT5wq0huA==","signatures":[{"sig":"MEYCIQDX0Qwn7dB7s3I7tR7Xd9fj3ZAxw7QMKYolaVWxegBdKwIhALuGwclDrjg6xx7lAyyDiAj+P4uGRozL+hQa+NIyIfxJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85164,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfd2AwCRA9TVsSAnZWagAA/9cP/3l13mikl5lmNWOJpKGJ\n7i5HYRqh8mtjM4mi/l28nnPIW+VCCsHKLjSuh6ECyGbsH+c1bzUSajMwcBvV\nZ9qWaX8urKxL9eL8fsflXzNpA9+orgsR91HB4VJ/s6/ymOapetDtpD1/pDvc\neWs5HIZJM373wAeQ6qlDM2Mxqyr7A/4qtFgbVdAhnGy5sMsAIY2iTw06PWuf\nCwecx0cK19s39PbOwBWgxTwAz0pFKNPqgLCkAdeGIvTwQYRMLXNleGC1n0pJ\n4w52fyNFmEEEH2oVF95PzTA4rIlKeHo7B6HI1n6CRkDUdjNGPsxHDtQlkWYM\n7JKFB3Mt3ctwfUuyLiqjBnY1t7ADdAWHXMYGW9BZ7W4zKJS3gBpLFYJJdUuE\neryAMiBxQuubSwloHLByu5c4RN1KDTM4C4m8yQO3aSaoHSjev8QeDWmRf8vi\nqkLAna3YBW2THsiky8MFI6l5ts7uki+xJZMe5tgJjzb7WEtjBw7UUCa4xLU4\nD4EFFpdfXzbbOiNfq/e7SdcqyNn1UOJ+k/1QeJM5R0g80Dy5N6pAoaoX9BB8\nA5UIoK7YYNrPo7WaXrtalRTPyY5XSpPMIULs3utZFtCdqEW3kjR2CmG/6HDu\nCpy8wjSRaudfI7RQE5ynrecjEV1+Kn5GAkcScP7BpotWwvlgFr62R4dKx/xd\nLS/p\r\n=w9kr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"aa1d8a42f9890ce9c1a06f5a217e55f2542a6e4c","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.106","@balena/jellyfish-environment":"^2.2.35","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.119-renovate-non-major-aa1d8a42f9890ce9c1a06f5a217e55f2542a6e4c_1601658928146_0.5498652926557537","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.119":{"name":"@balena/jellyfish-metrics","version":"0.0.119","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.119","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"04eac14236135a487c8a1a45ba416af178e48b52","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.119.tgz","fileCount":16,"integrity":"sha512-z27KnQjRyeOh3DezuMnwu1FASp9qrB/lQESDLNdjaqtMtCvjzO3Ph7ftbli0mQUMCL9VfyGPOq5Ym+cooNmCLw==","signatures":[{"sig":"MEUCIFMYE36jLugm42bCZjOBqaA/yP+X9Vu0KvTjsupUL+e6AiEA1JLlYq0Cv1vQ1P4Aqa2XCynzahTBcxqS0sTn40Qcv3k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85104,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfd2IUCRA9TVsSAnZWagAApVUP+QGl7Z1efLgQ0u/BgaIW\neyWBHh4bwNCNAfhw7y04PFLVcxGxFtNbn7n1KnRgwhvratyKfcUR6MA0hjhl\nP+p+H56UUv6TrijDVOFL8IpsX8n1Ugmw7/HbAA82CgbYMdcplaHIy5Jg9s1o\nm8YoozcquoJRanqtJT034XX/N1eYOBpu0rdAOOfvSAqvIHNGtwxm+Xg4LzVM\n3r/KgnigM0lpvl9ePb/EKF4CCVyOvQiVIkOwizPrTaFUDP3u7iYDRGeFaXKE\nWToAbj4N39LNjyRHRobJPLCoJNshP6Nsmw01+0cqNK37UJkvz2bpHaswAB/3\nqaZ1OCYRuq4vpdcANp+dFk0lfZTSSEgf2w7U49bgtk7c8lg4roW6AjMc81qA\n0nLtGl+KFT3+foJObC+gmBYfLdkUS/ZrwCCuKBRVC9P11uTj7neHgpRmdepX\noH7Q57w8G0dXZJ8lEaxpEEQfaHtI1tUFyIZlgwnadRXlA8YNpip18B4Vlqys\nIpmYcTGCTKgnA/fKLOHW47hxcF80iAXtEtdQ5eA823nv6VR6oWH8HPg/KJmu\nHc70ZWuGPewC8rc9KM9gEoqGNhCnQK0jXY0k0ybJuVsQ91RCmQwY/UDjLNLh\nuFztiC0MDGwZcH5slRralz5qu+gbHUVC4k9zzNM67eX60KrYRoAuhEgcHnsq\nR4ce\r\n=9UCK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f18451e6e6fac6744718628075b8206ed9ecea41","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.106","@balena/jellyfish-environment":"^2.2.35","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.119_1601659412260_0.16230267396552445","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.120-renovate-non-major-b6468925d5aa6d0139e4146406a4ac44176ed5a3":{"name":"@balena/jellyfish-metrics","version":"0.0.120-renovate-non-major-b6468925d5aa6d0139e4146406a4ac44176ed5a3","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.120-renovate-non-major-b6468925d5aa6d0139e4146406a4ac44176ed5a3","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1eb6144787008604ed63750f08a121cea78eaaae","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.120-renovate-non-major-b6468925d5aa6d0139e4146406a4ac44176ed5a3.tgz","fileCount":16,"integrity":"sha512-Xcla+A8mG8H74EQUE6k438FzcvIan3qh+0T1IxKveiUSeq8Pl6t6L8TzAtQQfA5M/5xifZ1I9YgSPcx1eJr6gA==","signatures":[{"sig":"MEYCIQDMQkf6YXueASdNHmmdiXbvbnaOGqbuteQ0SCxfy9/6GgIhAJ8ysDVk/KNpskYUWcCh1ihm6ONf3ZOOAEzrscRBCa+0","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85272,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfd2MtCRA9TVsSAnZWagAA4ZoP/200xf2gEMHiwbUTeqEt\nB5iPPx1vw8Wd6oYgJzujpsccdph4WiJOLA5ssLxwPI2/+prysrbe+x/MXyK+\nxW7Pu1oLKHir/XPEpgs57z1rpQOLBFu6pwOw+5UyWyDUAOn10RTrujZmmuQ3\nY7KIqa9j0ovuyPYlOT5TxvJ3TfYHk2UU+3VfnhS0QBkqixFAcPSwDT5VhA2a\nSjydvTF/mM5lSQ2eT9h/YYyCKW6plbmlDp8vrGZaa/eUwiF3gJTHuXBlQB9R\nutlXdJALKqf2l9AsL8a0PCqCQN+CXmr4j3br6ebvqktm4yQH1Fsv1m21wV/A\nDgxHbHx725N0lmysITjCuubk8gntTJ+u0E0ef/todJlf/0cO+UL28lzJumwG\nouGBy3NNW3uS0XatkVgCOHgkQ/E093/abgjkRptESm7/PmQxvjrPu4i4KLlF\nzKiYsJB7yY7MSeaUa7/76TeRCBVRLqMpSI0A1GbC4aCHFKqozIL9rLmd/lqB\ndTtGQuiln44vNJ6UHaUKEq/EjB/NbwZyvo/6kg1VC+3VkLWJkOkf2L4Ds1Dt\n2/3dsoCwggU137NajK/WT4TiyU1YSllOzoExkyt5M/CFX1f9wawBtghJezMU\njoK039V+wyUIuLnIchsdPWxxR68cGzApYMyF2XkjQFPTQBGe/hH7Y7yDur34\ng4U8\r\n=6wGn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b6468925d5aa6d0139e4146406a4ac44176ed5a3","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.107","@balena/jellyfish-environment":"^2.2.35","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.120-renovate-non-major-b6468925d5aa6d0139e4146406a4ac44176ed5a3_1601659693145_0.23569596255456293","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.120":{"name":"@balena/jellyfish-metrics","version":"0.0.120","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.120","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4e7108918e99d8feb1d539608c7ac2c060eb1cd7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.120.tgz","fileCount":16,"integrity":"sha512-jnfafZ6O4/Bhuiil64pEY4xrsTdgkEDgsKrYNASYc9VK6AMmxeDlzVkR6Nui7xzNVTFCSaxxqn5fdpIxaypt5g==","signatures":[{"sig":"MEQCHwIq2/pFRh596ffGv/aE79cGXQniGEaEOJQnDf1CgEoCIQCKHNBTwiOPwv5Vp2JNUjEipwjy0ysePn/DeZ1DYRhVlQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85212,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfd2RECRA9TVsSAnZWagAAneQP/j4fclrx0/TOtCRXKbqb\n5eI4Fr3jc/e8RGIb21mBn4K12cjqKLSDfGFkH1QWkorNgrSQN9C+pXF7sMEz\nipk8kAlwc6dFC4GidIXFihUDEsfGfNFY44gYhEV/D/9fUqdn+5xhdbTlK7MH\nXiSngn6nsaOFuNQtTCSFUUWm/RqABXmDrNaJA/JidlNivFWfmizAWjCgBa/X\nwjDVkWYs59LaZm0pK9Eut8mLoXEdqt+klDlHKXcHqjOWC0dyoaoBvyK0874r\n3aGAwthjozJDwq0Szr78JrijGK6GTx9xvszrClEsJrsOmnYcXzO2R4S3MXeC\nrNRuw13MgoSqhkyjzHXEuJn7Vz9JE3D/268bl985VXlWTI6Fikv1v9IkbirN\nL5LOOLM8DMitZ4nJI7w/x+9Ob+VED02j0ExKyHOCMGxqUSoQFhW7KLwJCAwV\n7tN9FUeX6ICZDLVbeGvZojM9CjAVBgDwQ9iNdxj99/RqN0/H3IWEjou2xl6l\nR8Ck70l2D5lYGWak6zsB2VkGLfbRtuyrPUbCJkZ3gWshmFhWFt0P9thJtI6+\nM5QU5Pb9CFu4FigsR3yeiR+UZ0qON9NTE+Ju5FrHxm/c4wf4JeS9Rx/WnceQ\nWLqoMTDb7iuF2h/oc8iWUH7g9bwuCn67/jumPUttTUm7d/xprZk157wNo+GW\nC9pd\r\n=0r9w\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f62d8c805ae97f7250f54123bac3384cfe4afe44","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.107","@balena/jellyfish-environment":"^2.2.35","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.120_1601659972156_0.8878574073930323","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.121-renovate-non-major-0f5085646c80837cf57507d94a09ff6e49542ca4":{"name":"@balena/jellyfish-metrics","version":"0.0.121-renovate-non-major-0f5085646c80837cf57507d94a09ff6e49542ca4","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.121-renovate-non-major-0f5085646c80837cf57507d94a09ff6e49542ca4","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ca757840c7f5efa20f92dcdec84f29760e5dafd7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.121-renovate-non-major-0f5085646c80837cf57507d94a09ff6e49542ca4.tgz","fileCount":16,"integrity":"sha512-nBmyY2SB8ledPLjQ3KUpdDjI2lAup1i2ROThWnSa4SFb+tlwBjQMGPkfFZfl7zMInfJ5m6jhlDSbWBDM2gdd1g==","signatures":[{"sig":"MEQCIAt+2ldTAGGu71Lp+IpVP/plcYtenj8cegXziy/zQyIBAiAv25SeQ1Ia9ljnqYdKGNivgqSKYWo1SDxWE2EasG/Leg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfd2VsCRA9TVsSAnZWagAAia4P/0CltKvYjBIkpyyQnJjF\n3+XGtdZ9lAmKVeAFhXwGK4+ZPtm1hAac357ZYryT7iv66jX+gDGX1uFKts2w\nZ/SusH5HpjNkiQp2ndpOtEgVMvPw/bH9ajjeo8z8luZaYbs1zeZ4Rl9bmL7g\n/BGnQQmerYWFQYXgYCy53oGB6iP6EMyC5npV9PMdKwVBMxFgg73qZLQ4Sx6I\njRmkuOy5NcCqUvKX/CWRX/exJN7yZJflupPJAb/sKbdC0HiwBgHPFIasvFFF\nMYus9t3iNa4DLAtNUb2MTwbIG/4DRvV5g2XCgt3xr/Pe8bVdB1u9CP4LEsij\nyZSDmn8TYqxOU044/DwPz+nd6I992VMtNV0vSQg7wwpTvYfqgutoRp3TwWJ5\nGLueL/6H3mxNY52u9EYw//OYeU3e3PB8aQpkYlX+pMClTVlfqUVNm/Ojwj/E\nZnXCzC2+6Tl6A2JUek+PaUmtIyvS+njhnHoz3Xj4Nd43ByHA3AS/TgwD/941\nntN+IeU6JVcYKsTuHxR+TFAjcReQiKk5foyKdvXuq1e523JIEMv1cjk/UOlQ\nHewO71sp59Hz4brnDOZRzkeRUoHcPX9exYpiF3rxluPT2ukcUBQlzWbvCNfH\nj0me8ne+Vzp9iWav53f0MpmvIWHQ8Et/ttRxoPPtoJ/k3y9UG8ED5JHUhlJ+\n1knG\r\n=+LEO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0f5085646c80837cf57507d94a09ff6e49542ca4","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.107","@balena/jellyfish-environment":"^2.2.36","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.121-renovate-non-major-0f5085646c80837cf57507d94a09ff6e49542ca4_1601660268328_0.44646052208497733","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.121":{"name":"@balena/jellyfish-metrics","version":"0.0.121","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.121","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"43f386e3acef9c681c9d01a7ae21aaeac920df56","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.121.tgz","fileCount":16,"integrity":"sha512-YknA6hY9r1nxHqqJoFB0GEjYO1gMUgRX1CXDHLStxbNSrTLivM0GBJnNih6cnxTR3O8yexdz43LPrpBwMXMbGQ==","signatures":[{"sig":"MEUCIQDQNa2KGcso56s2uxyq8KaxtAsdIJybgH68IIrj3fo+VAIgLs5jLILnw4jByi/eXnpJBiRqlGHGNf/JmlO/begn6v4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85324,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfd2YcCRA9TVsSAnZWagAA2vIP/1xywdpvvQTYMFTCaM/c\nAxoIYMjJo86hYo6tftwFsn6FXT74rodbR2Ed9wpWL7pzI3hMnM0d7zDz3oVk\n4SbkobBD2kevGsVwn1qyAboIdZWG9oDTzHPAxGztxg92IAV8kNKA99SWm5oQ\nvGtu3egGrqn9Netcwl4I2gTLLtYJUICmj2WlMZfZmMWttT/hqPQPAk0mHApt\ntFEFw45TW0ZmGzXCIgFQsNVmiF/+yN/QqKOwj8r+fMkPV5duIH5NeXuVDffr\nFxzno/j3SYcfytGkCtlgxY6l9iJ3vTd7pfnTV5t7GeZwHNVicU9GTUK5yRO4\nriD/U1ArweN1vzmN0uUoyuq/lCM/W+qdZMm+GncDE2FQldKCEDVo1ZDA/d4Y\nmYNPxtFtjulXnPFPbb3kfEnj7MiTzJcjQ74plQ+NBaWPMTG5RO3ZGMXfXAmV\nJ/KxkSBifXyjPIQsLuIze1caKHLHaLAACoSGvIhBaBqEQio7xLJD/ZSedJNu\n1nSIAjEC7T4aPUd21GSqsYhAZxNhE2sxzO1W/iUgRpCQaeBF15fy6uaIYbyf\nima/toPK+fm9b6GVDavAbfCwSBxgdlN3HvHijVTPOObXy1KG8UDFR5Wv/vCp\nH2F2zPQUevN8Wvd1RNwBNykBNN9LuTsgLSknI7QFDORkCIdJ2wg5btANjzkC\n2dYR\r\n=WNCo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9ee7c3b5bb7cddbf1d82449da128a968c3a9c2e1","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.107","@balena/jellyfish-environment":"^2.2.36","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.121_1601660443738_0.26464681320536076","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.122-renovate-non-major-7b2333597b222942e81b37d4f2a246e34d250d57":{"name":"@balena/jellyfish-metrics","version":"0.0.122-renovate-non-major-7b2333597b222942e81b37d4f2a246e34d250d57","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.122-renovate-non-major-7b2333597b222942e81b37d4f2a246e34d250d57","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bb7303f17049ef543379daee030e3f4900557565","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.122-renovate-non-major-7b2333597b222942e81b37d4f2a246e34d250d57.tgz","fileCount":16,"integrity":"sha512-t8fULQqyD1B2vwZr9vPPFEPT69T/aJquxpUGxoco3rsX29oaTWNULEf1qb8kRroopy+uE3TbxL1zYc6EuD+woQ==","signatures":[{"sig":"MEUCIFHydU2Vk+OFednu9UGM9qbWHBTJzjc0torTkC8ho1c4AiEAkL6usZS0Dyu6KaTm+g2dJN6QMOhV0FLvJxTaRqd87N4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85492,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfeaSTCRA9TVsSAnZWagAACpUP/ixn4X7Qbh7KKculTBMW\nTd0/6aJmirZf1BB0vDQqsvR50cW/4lscc8UyBYdXilyDYeLs93mJfeQWy/45\n5gM1lwdn3Nwl+wKMxsLITMg3cil1B6X6+4aAg7uhMxTU2BsBzsw4pciYQB0v\n7DIKJ3kbFtjQHRZcV4QaG1DuB3xOfbKe4ppv6MXhvuFuPWCMw1nXt807/Z4j\nLUq/KcURMjulx1EIZSlXsnyx59ENYTNePbL3ebKexa16blWcKjdlb47GaWO1\n/EAp7FpKEwGR108gdCKhF74wgSuheQZp4zDkqGjcz3lEx1JrUNuvYNhFkNxE\nz1v69j+D/BtmV4Utk10laSIYw+jOwhJXQHhjvTewFoQz63KkxVzpt9G00Rfb\nhPs5AcXPtEk7RIxFvwwLQJxKpWrSGI9+H2MJuH4coU8TSkIeZSVgfVdgK14t\nX+ReNxBVby+Jsg++xW4xrFbOKS1Ehj+dYsDXKPyv+tShX4q4e7yuBmBnEKfg\nztIRxutC09CzaGTjaFspo1cii8CCuXTaEdNqqVECzZ3ORoFEdO0f5C1gm98Y\np0QnOW63UAcmeoxbuo6eaCftjiXxCV9H8a/cdhpjifigacbCtFaQGFzp7Clj\n2I+9GL5CvibbmfXu0LUV9DAIrIURWX7c9DeUcgu2wVcOkZwuF1xjx73mhwW0\nIHRq\r\n=ISOI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7b2333597b222942e81b37d4f2a246e34d250d57","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.108","@balena/jellyfish-environment":"^2.2.36","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.122-renovate-non-major-7b2333597b222942e81b37d4f2a246e34d250d57_1601807506876_0.05553618933756854","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.122":{"name":"@balena/jellyfish-metrics","version":"0.0.122","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.122","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8f31ee7814dbbe864062855e56183089cce40c55","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.122.tgz","fileCount":16,"integrity":"sha512-xBa3/nqO432DqNQQIx4gVSjqur9JLNlF9yOx7EtIfyeXr5Vnl8VX6qeecDYfbOufvzRJOk2SxLFvezjT+NOI4g==","signatures":[{"sig":"MEQCICO+ERRb2xBaLDaHGBMHrYLGc/WZOAbdjegGNjKvnKN+AiAKeSTNeceVvEoX1MXrbJukT7Nz+EkUIRkVSA4s4n7CzA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85432,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfeaU/CRA9TVsSAnZWagAAPEsP/RkXg761iF1ZOmtf0YcT\nSqFWAEoHhApE9AzS9RxFzHiX8Usz3zJLaGQ7W1iyXFNyfGL/uE21NgPpS7CL\nbeXhHn88232cwSlu+kgnX7/moAqsS7CBphH3aAd3vA0sSr8SyWbyMCE/BVqP\niq0O6xUcjQ0RlPccGBBEI04wV9MjmonHS457RizmE3rLRBk4gix2sbYLbUpD\niEecqhj8LPS4EoFCyZTHI1q5iKQmIh64gxGJDXFzBVe0XD4tdZee+nT0X9RW\nsElQTWAOwjK2cr7sh8wJRuQVhIPF0yBLq9FDGvaepaWrsy3ZCpaBZsGqIHvC\nkiPcFLgI6Zl6BzGt8cBrpymVMjZq7xV9ykmbNjJXdlJeWBwEoAVGjHikudND\n5Ks5IyBr05G36Y5sow78HCcv1kc9X43zUEkBtlka1hHJZMaeM10TuQ7aBvAM\nbO2gaTPyNAmTmB2hP6fiYC9jIswKkBlXaP7uDh5lAO+LFN12pKnr3uUBDW7m\nMHeJ0IBor0TjkgvdP2kdquWzn83K5uU6v2PjJTQbVH74DtbDzXVgb5vJt3ig\nSP+w8H4yeAiQhDSZV9sliIJMZJ6miJbLb8SPj8d8/QmEsC3BQLXCgaVoBo5l\nstT3oKuvygdXsDRij8MImDp/DnsfvMUTwoJNjQhIQSq+kAxKNqq4sws5z7Ha\nL0sM\r\n=F7ei\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c8d69804697d2baaf09a7b14958e7e44df9252b5","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.108","@balena/jellyfish-environment":"^2.2.36","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.122_1601807678697_0.6591585493341923","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.123-renovate-non-major-c3306758a37c9b957d48c7526454507c389f57dd":{"name":"@balena/jellyfish-metrics","version":"0.0.123-renovate-non-major-c3306758a37c9b957d48c7526454507c389f57dd","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.123-renovate-non-major-c3306758a37c9b957d48c7526454507c389f57dd","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c0ba24a3839a3ed7b1ef8a4f6294fd3d26554c05","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.123-renovate-non-major-c3306758a37c9b957d48c7526454507c389f57dd.tgz","fileCount":16,"integrity":"sha512-gJEMgFwvthR/0NAL8rJobsSF1JaAOFkeSQ0lj4F9ZCHUnCThCQVst/P9cd6MMfz8r/FdgsjB4TmOrz5VGudAFw==","signatures":[{"sig":"MEUCIFVhpIrkAlTVsHO3fXwXBDaTS4tsdC2in1+sC58J7TsnAiEA5ag9mf++jj3RKrdb/3aF62WyWNgRaCGCfR4S291SHXM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85600,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfex9rCRA9TVsSAnZWagAARYQP/jnaTtR6oegNLMKVVtlx\nETvc4NwRUBNYxUj+kG6exQgk+D7Xzr3b9xunnuaZjHiLilEKwbAFrSryIBB+\nOm+xKhjJFF2HsXee+3cXPyrcbTO01q0GVWpaaWryk6/voHLzAc0udQovh+GG\npNn9wnfZjFzlCSeTPIfTLe58qiPt7Ly+DN8biJ9IRFM7t7QWaKZfc7bXhn2U\nBtsfZcYCMPgbhfEsL9GBgvITMhg8fj6ZHD2XuP4nVj77QYOXBv7ZS+SO+WJn\nz6r416Jl4hV76h2KEM2TcwHUk0/y2BKvC3V2cxpVWV2iOtppUqeblcJpvwnB\n4SYd9IkBZsPkeXxirsl4x1pxBg+SkpeHA7aY5WMtR48WhcrTlJUdVQaAQUXl\nzBnUE+IFhH/5knKFcxlLhDnxYBh9ikX/prsq8bBLOtvH/HCKLSLaYf0+iqg2\ntJ6kKH62GoYFQOkx/Bp8o9f8q0lJI+dAtJdnEqZOm6YpWXhq+hE5yIHcyixW\nnnUAKHcdZLPp/qZXF0otA48RkChn37JWifAz0lfUikNwHIP1IlxClRstQ3MY\nIqvm38vnIchXm4ddOe87Dgt1fB2TgTXFVDvnghzpcp9zgi4IKl1ZmvAENRoU\nq1PosV2fbxyS+tuL23n2HFbVGlm3/w3jqyEVoJHlzHsdsfm+ctSNxbVVNVRN\nzeA1\r\n=4SL6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c3306758a37c9b957d48c7526454507c389f57dd","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.109","@balena/jellyfish-environment":"^2.2.36","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.123-renovate-non-major-c3306758a37c9b957d48c7526454507c389f57dd_1601904490872_0.628513505622138","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.123":{"name":"@balena/jellyfish-metrics","version":"0.0.123","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.123","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f68876134995c17384ad6813459c870a34907cf8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.123.tgz","fileCount":16,"integrity":"sha512-/IF3Q7Ct8bRTMulw68UmqRycFlcw092xwrzYFtCboCY8f8q6ArN6NtdFT/xOINosGZsO2tmYUIKy/aDP4650OQ==","signatures":[{"sig":"MEUCICs/Ck/vA15FIU9rE7Qca3pVWU6e83Ch3GILDpS2hXPoAiEAi/u547V0Jy3hyFecY9bRHGxP+YfcuEf558r41fA8u0k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85540,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfeyAcCRA9TVsSAnZWagAAfgIP/jRBmtDIggPEnv97hxIT\ngGRBVjTa3otnekCvn5INyIN3aExhjdlVWUHQZkm+rM6G3PvcBaX1vpbDF+wI\npPluzb/eUkLmuOabnZl2W02Qtt9OvHhuVR7Pr09YW0l3o2gMyzZDU6J+SIZ0\nTFHWsfcrb1byyDO54IXzpd7Ikicp7fWmGDKsy5K+o6edV9hbHNFOsohiDQAn\nfSaIL9fb1jU3x7GZbn6xzfMQOUxHGAgwbtyoSh6iqzu1+sJYUUlRNNwgAbxl\nDSUMjpp3h2VXEYPMnCDx/tRztENg8duwPq1gV8vlK1uAQC1/lJRkg2H18C+X\nORKyGQJ1NACjMhtk3qhrbU7IUl4+zOumi8n5LY7+uZFpofEcidjRc0qUpZL1\nLbn+L3c04m+/2ART20ujTgO+KH9YMYka+vgI/ba+MnIeFJnUV77xWZXen1zo\nDiQJDeupkOTfMtAL9B6RVXbm083LOTpI/KaSV7mop8GvRB4OUtwv2bQ4IezY\nc6O4bngcRhDcVA50FY+BrPBOTiOotCo8eL3fxpUsypg5Pbipg96lkqKFgWcq\nYy9T/SvOFBKWhe77dJPynF3bbhR81VNXkU7gEDH+XqMAlS7l+Z6eH9tYbMCN\nik2G63mGl4yx6GqrUSBPqdou0C0FIcQ/R6YxfG0Z482HNOnciD8MX5gHrVDB\nmjAr\r\n=gUPh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"bde27f98e05fcde8915f84993f41e730343465d6","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.109","@balena/jellyfish-environment":"^2.2.36","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.123_1601904668156_0.954489601208244","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.124-renovate-non-major-f87703b38d3c0c9c2e39def3a8c373c490d677b6":{"name":"@balena/jellyfish-metrics","version":"0.0.124-renovate-non-major-f87703b38d3c0c9c2e39def3a8c373c490d677b6","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.124-renovate-non-major-f87703b38d3c0c9c2e39def3a8c373c490d677b6","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0cb84f0f1a98a06539197ffee078f5b641c55175","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.124-renovate-non-major-f87703b38d3c0c9c2e39def3a8c373c490d677b6.tgz","fileCount":16,"integrity":"sha512-+jTvL1aLbnsr2VmPv8KDYOot1E5MCnUHBEbDKiCHw4mBU7NxZ0YZ9ry1207cCkAAr1qtNKDvvOu6HC3aNAJh7g==","signatures":[{"sig":"MEYCIQCX3eIUKPMbeKL/1BK7oNW7dmeL0SkvC7REbtp+j7/YCQIhAM+RqYTeeIsZR39Iy0ryoAfFKXI0b6cRdNtnk4Te2dbr","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85702,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJff9FyCRA9TVsSAnZWagAA4d0QAIrXLTGc6M8dwLeiPEE/\n/Gr5HaOWabGT3tbz+KWDCUWEyJ+EBpLzhkNSXQ6hhzkpvAlYfvzi12/65HKF\nBPtxYz0SfmXV9P2WomOul/mJnKO3aO9MlEWiy4F5cJITL9L6+chR9S+A9ORG\nGjrMwMWvVotzq780ef5SYJxgdBAq5W//sWbL46a6iqfSPL7QQZju7b+ot4ge\nl9bCm/ufPZgoCXjL7SqFncJ4TDsQ0IZ3sI3aG6HC5e/SFJ0cnyV9ffHlvT+B\nFe20f5DMIY78suA+mDYdgghDfstnpQyizZSUH+i0OVGm/yq+scpBass+FeZi\nYZXtPEqUr0NvDbfQ/UFsbaz8cDajDCPytR7eBAu92/E5lpa4jNl98ZBGvkou\nO88CZGgDFFTOgqPNZ01201qdD2ZnBJLgC/bpihOLD2ypi9GqDhKsuVcKQtdj\nz1WGww3KOunXiCEMfpqRJWVkwpWhK8hNhyUj6AP4mnOhV0drqEfFSNXLFzKs\nR1LEYAMJcsC00JXTSx2SvuOMpRnUMTFLOy09a11R8UP5yb3UzVgPezQifEol\nEwaz++eUYSXVX420eVuiZE/upta6zwbPe4WGl4WNcv57SxTVYx05UcBAiHik\nyFGJu7LI8DF5X192Qu9bfZHFGV/W3tw0+U3bQtFo5KznGy5bHurez5/ZDNk/\nzNqG\r\n=Jk+y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f87703b38d3c0c9c2e39def3a8c373c490d677b6","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.109","@balena/jellyfish-environment":"^2.2.36","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.4","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.124-renovate-non-major-f87703b38d3c0c9c2e39def3a8c373c490d677b6_1602212210359_0.7299971720641221","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.124":{"name":"@balena/jellyfish-metrics","version":"0.0.124","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.124","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9cdc6ed87c50c7acd63d5367fb2bd4256433ec37","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.124.tgz","fileCount":16,"integrity":"sha512-kPWS16mzC/tEMBLU19WK0mACrZ/C/9VDgWO3PVftPecrZ1NJWa6HYIapQMhF9aKnS4p4NXbRdlaUSHqfZYn04A==","signatures":[{"sig":"MEUCIQDOe4tgCnIbO4vxK04jKiGswD8J0Le1YNTSOM/i7fajRQIgYmoeDRsuHOCL3RypWTVxwFDDCRd2vePDILsuum300gs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85642,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJff9IgCRA9TVsSAnZWagAAFOcP/AkfGxv76nGYNE4+qElu\nrVDy25eo5SgPD+h0RxnCBSzqoD0EHgSC7X6vqa7/PsWGCpVgt1V4YfmI4vHi\nhkd7tW4Vp+jwE7no7sayzYjzWJxAXZpUUcFvqUIkWGXqZdY1s7mosX3TBM6p\nhcpQw03mtFrG3sIMuUGGr+RGpbg4kfQ56Fp1qdhUCBkjwPZ2eYeJXMkLJcgG\n56OC09wLlSnetjYtvnW9izod4DQ8tSVjV1uHaquOJslCQeZMyihUx2ToGh8P\n/PqEb73Dof9FUUten8aCfS4tm2hp+yGs4GLIrlPPLNI96/xo0hIxWGu5Gvis\nejmOXlTV9HkNVhzBz5ZHodQguwtSrkq5yDxM0ssaI5v8Nx2auguk/ne8JNJ6\nyPYneBcMkMeuMpYYd41rxEFYWVl+I1UmGF0sU+xh+4C2BKWfaUqzUABbZdBF\nXV1WaTEu6z2MY8Mn2ha0g0bALnI+XQJ0NO2+p3vE/NnPeEBEZhVo2HFF5BdJ\nbnKxUP22BK9+v4O12AjobNC6A4GgSQvATW0A6Q2vlT2Eps+R8aEtlG219Lxj\nSS9gkPP+mxrEnKzSNntrYQzNtLHrGa1yOFj7lBKQMgsaHpzBLQwUqdg77e0c\ne8sYEzstNMZboDmr8TjyaEviIQ7f9rD3M8hP6aRmdU61zHLhs5W8lofIXIgH\ndzqS\r\n=Az3e\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c853f951c670844c6f418ac0d302e4c49015a214","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.109","@balena/jellyfish-environment":"^2.2.36","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.4","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.124_1602212384085_0.5390683132302272","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.125-renovate-non-major-ddf41212a5dac3f2afe9e6a8c891913abc47dcf3":{"name":"@balena/jellyfish-metrics","version":"0.0.125-renovate-non-major-ddf41212a5dac3f2afe9e6a8c891913abc47dcf3","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.125-renovate-non-major-ddf41212a5dac3f2afe9e6a8c891913abc47dcf3","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d6dad857eb4b95f87c8af8e6fa7e70b6e08a60cd","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.125-renovate-non-major-ddf41212a5dac3f2afe9e6a8c891913abc47dcf3.tgz","fileCount":16,"integrity":"sha512-Wmba/dZMFR4yoYDLfJya2qsLk283A5OkjrZsAAcrYBDvjoep3P/gQ5n2DD3GDC9yyWyGYepcLMoVUPg1JStBIQ==","signatures":[{"sig":"MEQCIC8OolmVGKnu6NZqjgVGpIHrdBzYdS82sM1+fw0QM5lIAiA/CjV8SSvo8KE+Chr7ObV5SMZv8rp9a/A11Doq1NAACg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85772,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJff977CRA9TVsSAnZWagAAi8IP/0vHY45qqGGnVTTcYKNQ\nwaIeo+aIl6kKx48B3fp+TNiG/fEiRZH+rUrJkdssY7ZiJ7ZvOWiYeCcxBREW\nb8NolCfXCcrG+yqq4FVdcI4taxBX3DwfebAJINNU3ifjxAA5m16VERkSNdKu\nKFJzVrO7S3WrpbMy3ha0ALtPoi68qlMi/1ypq7bUJ4SgX9Bm0O0JjvLmIoqN\nWG2BYx4BRL1hwOJ3O8tFP2w23zqMSxOPsTkKEjQ9Hwhh8CIeHCS/uWXm+2qS\nhRbMeV6NlADNiesn35IlypHBp2pRrK6MwKeRFtk9879b6bw7HhlSjQpeaXI9\nnMHx1a4meGPnEfEa/t7B5oOnGu25wE26u5zdwyJQk0USe77BdBFsNmp7EawJ\nepO40bgdjlKBhW23L4NLX0iarN3eKjsMt+jnb6UsyGUk2/AdO210PPWLdgKt\n7ft4G732JXwd7jy1Fn05QllKUROzlThU3DRuPIOVUZD0Y/VYF7Z2Dj8s6tOD\n46638gWD3qz4yd40siPaVErmPCO9wvOI8X/LbdyqIm8o8Iy6N8Yuk/SW/316\n89I2hMANSsMFdC3j6rJgxsh/opBk6EPHRVLKJBHBjPRq1lWhkhr9z1roKgEj\nw92uMAIl/RulcMoC8Uo10wJGq720E35JWDXTpSVVYpC+6yAlr0oC8Y+LhcMV\nlM7l\r\n=BKXV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ddf41212a5dac3f2afe9e6a8c891913abc47dcf3","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.110","@balena/jellyfish-environment":"^2.2.37","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.4","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.125-renovate-non-major-ddf41212a5dac3f2afe9e6a8c891913abc47dcf3_1602215674610_0.47597394313039576","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.125":{"name":"@balena/jellyfish-metrics","version":"0.0.125","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.125","maintainers":[{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2fd75f56bbc19f89659505350376343ee21ddaa6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.125.tgz","fileCount":16,"integrity":"sha512-0R00iADfTDX38h9bWGaq9e7TNrKhp4usC0kl6Kp8eADXSzjcNqzmkgCKOP/AaN3tVTMUM/lpe17XI5JJ5Qgo8A==","signatures":[{"sig":"MEUCIBYU7I+OrWMM5R1mlSoWn3D/VRrUtJ8HIh8977WwMa7nAiEAmCIse83AIyG8tVozZl6EJF86Th6ytJDdWB3cHmO4ucU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJff9+vCRA9TVsSAnZWagAAMpwP/RsJ9om8oXfFPZ5aLWbf\nSpJ59Q6iwEf+obyhRPoi/NoaJtDoSOYoUpKNp8qKF+4D4yuiZ+ZgBikxQ/07\nUS1LbKuRu9I5Mkh304HSXijhVXqHKH8VNk/pkVTAcU1g527Zp13UIwyIaGXp\nLPZkRg7cqQV/j5ndT+lrFasUliYOClu6ax14xyeJmsCoLk/sGEiR/2PmlYcY\n852AX0AIhsgWN+zj1AM2+GahwhVykwWBnCpebQElBgkzC6ITMyCIqLsHS8bt\nEKLb+TaEUWxVS9+Vl5Ox6W0qLZwbZ1n9vxjKh9Jj0TAQ50m07lYqbAyw4ENS\nhH5nsn26XU8V75Ljiy+EPURaCIKRxBR83u+95mYJm9o3Bx8uOXdlHwQN2Yjn\nndH8PxYpj2oAxMnPn6yMXKhB1Y4kxvxmj80mkVw2bhfW2FS1uQpz7Wupxgz+\nhFbvd8IhqiB3CBdAzucJY9wHc5I/nYoE+AV2tb6xTbvNds+QSDMi1IYqCnBk\ndEDTq6rmxgUf/5Cc9KiDJsjD8JOlgETr90cJTUyylhtAuUKZuMAoek1Rzuc7\n4beYRKteb6cCOggiGOqr2uGZ4LjT+6ztt/gva3FLIgrJ59hCe2T+b6sd0O7z\nJI31oUfKZN8s8JgBjSVReqVFMTKLj6UOt+kihwRnYBZnt+4JTjPOSYFPfIic\nz3wX\r\n=SVm5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"571f28f4e3a36d81673a575a6af7477f65d71afa","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.110","@balena/jellyfish-environment":"^2.2.37","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.10.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.4","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.125_1602215854595_0.6161808989646425","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.126-renovate-non-major-1aba205fdc2395a0001ebfd37c596da31d135a6d":{"name":"@balena/jellyfish-metrics","version":"0.0.126-renovate-non-major-1aba205fdc2395a0001ebfd37c596da31d135a6d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.126-renovate-non-major-1aba205fdc2395a0001ebfd37c596da31d135a6d","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1bff67ded840237b0f88b3ffa4d6376db5663099","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.126-renovate-non-major-1aba205fdc2395a0001ebfd37c596da31d135a6d.tgz","fileCount":16,"integrity":"sha512-xhZcvKfBK0KnbDMDO1u3K+G3pzsBplePUqWbl3/xyvxV+zOb7vjfWCSDOHeU4XY6ve7aZfYZPIE1hAxQLAIGrw==","signatures":[{"sig":"MEQCIAqSzKQQ8cOPE0xkL0yfBf8+Pj6fWMQ3Dr6FVk27OdPSAiBOGm5pDUs+QNxqT8tMsi6rUB9dtgIfAXd1rFHUOjmn5g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85861,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgNALCRA9TVsSAnZWagAAbGEP/RIUEMGk/o5iIYnCPiij\nsCdkPhpjMjujsn0PFO2GaYnxMSVq8FMSdfLyJwMHd8LG+h7oeOM2wm0PYJ6O\n9YfNOCiAH6fePWbD4hvTnUygXN2Qt2etEDYlGW5N0gOdsY/0vQJ6pJj76dle\n9DHh5iqiowVbJI3YWwvFRgV7FsZkhdJbW+7jEcvUdt5vVF8vAQMCe1CSXpDi\nJ5FQ3vbVp81Q/2NIH7h1UuceGhrOGzbTn7Rs73ElQfHVzdSyPqSIC+8Nv8Wh\ndAEJTFfP7oMn09VOajoZrUsNzQVX6pzSG12LJFSOKkSlL+ppZav0N+FnA7Zn\nhhiQVs4TEg6Q069XTAgwWoL698Zd+Mx3Un4NRBv9eFxyOF9pUZz8+0whkPmt\ngPMhQbXEKLZGQz82q5Hex4roR757VX7v3QQeM1y71tzKyJevdnaW49ePWW4Y\nA6zjLuqL+/f7gryzZGVTz47m07Q/o8QMLs+E6IX+zpwk9n04sGAEXwqF2bWc\ngOonLrFK0yolHWDfEJ2PHb7NB4iy27tY0zy1R03uh9ky8hmAnzUSzyHEkzQT\nZu7feLKpEl5M1VlXwv0xfjkME2MVwRJc1ubYYkGeSg75Y4MjwWh6HGMbeZQZ\nHH21AGE9kDlGE0tjO65an/oSq5jt88X88uWjuGht4fQM80AJgPguwncqcGCt\nMrpV\r\n=tvdg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"1aba205fdc2395a0001ebfd37c596da31d135a6d","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.110","@balena/jellyfish-environment":"^2.2.37","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.11.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.4","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.126-renovate-non-major-1aba205fdc2395a0001ebfd37c596da31d135a6d_1602277387195_0.8629717872921019","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.126":{"name":"@balena/jellyfish-metrics","version":"0.0.126","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.126","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"603e2f2a2af16b85cac161cb91ada79d34b896a7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.126.tgz","fileCount":16,"integrity":"sha512-S+bDcB9a/Bqa7NFzD52lnvDF0ypIVRTU25OZ9deeFN0zgjrUCDXNkR/ZWuHccc6KXis6aQW1p/7RNCcM9282OQ==","signatures":[{"sig":"MEUCIQCDMrnByVuV9Dsswl+KHJq6gDrSkD+1W3unRJg49UKA9AIgJ4ybhksfirvRzes45dzX69IN1Uaer1vLWBuO8maed6E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85801,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgNDOCRA9TVsSAnZWagAACq4QAJD/o3vzmLna1krjnwQv\nEszcgpyuZW5RXE+FtOHYonetjxoVZi0XqRGS9NU0F84JHGQtSIdc6n3LOWuf\nlrRVRRwgUPoWJ7WoqfRBSrtt5Am7oXGyUkqJ4lPaSnHlFd41icpnn655g+EP\nG2DPkscByX25BfRunhCGLOWyCKs18lJpYhKVpdI0FDeIeXr2jicU9vHtt7u2\nR5L2B1NXBhOOrKOgVvzHxy0b0rESPlPjY2mRWWYYIBIbhDgrBdwU1Z7y89Oh\n+p06xdT8nuHwoCDH52lILCR08jnhvU5UZWGmeoSMZKbg5j8C2NQKCFp46Ytr\nWgYu0LVhBcUBmUtkxU2dpykekvMCxyN+8mA/gmB72l+b6Pzj4YfCZRZSdSLC\noLbGh13jGOzjwCVbh/fqN+oPLfIAxo7gqsZUiA/xbPB+xjB5oHzlGUcZmJM3\n0ZEoGj6R0I3Crvq7f1zxseLKh462IwLCnKOstZAQW2XjfJxrqDH26A5gmpVt\nSBRCVIdgvA/vdmNRtTdcIAuz54ZX/IfnmHYcIXbOydbKVHUrg6SQ6Aqp2YFd\n/EaulZeakHgf9Pe2ADATadDCzyW4AmVS7feCnOWpxstk03wTSxfaeIGsLmFo\naiOzxDK+N9U6rzLn7AY9c4uhKgomdLrR4jAT4tYaY6NKSsmKOabsBdZUeep8\ncDoS\r\n=2F9h\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"822f58c2c3182c7e20b1b1c1ac59186f12566a30","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.110","@balena/jellyfish-environment":"^2.2.37","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.11.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.4","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.126_1602277581805_0.05195291110019462","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.127-renovate-non-major-765a86d0d2a377dbb5047536d1709edda22328ac":{"name":"@balena/jellyfish-metrics","version":"0.0.127-renovate-non-major-765a86d0d2a377dbb5047536d1709edda22328ac","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.127-renovate-non-major-765a86d0d2a377dbb5047536d1709edda22328ac","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2ed1ad5c655919048121f24798e64644ff49a2fa","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.127-renovate-non-major-765a86d0d2a377dbb5047536d1709edda22328ac.tgz","fileCount":16,"integrity":"sha512-UhjPFqbZSh1sm+84p0KPI3JrB1Z3LQ4ELKq24zJ1Ra1K9C3cm8QZHhjIavvfep5d55tWVEXePZJqfEO497vlpA==","signatures":[{"sig":"MEQCIEI0ZH7M8m6mPgCpbd5KgtWrZZPfhqhhwLx3yzSdb+5UAiBCyA8N97DvB/i9L5Z0oRZWuszvhniwFYhIi580b0bSRQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85931,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgOkMCRA9TVsSAnZWagAA62MP/jO1HCqm/PuRc7W66oEy\npt4DNimGUWMToJYPvhH3P3pILLYjdn/F+TgGnad8eB01mLBw5Q3HsEl7owd8\nOruDqKOsoSTSAxEIsAu9FzP5dhuDxfsSsQFW3KRBMRERFUnY0cfuQIDAMOWn\nhFAeEMTJYd2ymTBiq8KlQ8Y7YviHuDEF42kHzAMIePUwmOxcSJobijA8hZhQ\n9tSfKIpvmrzIR43ahyLxH8jz+LhkU3kYONkS77EHgtoi7UrHgDV+D9WpK+cs\nceZHDgAJkRrkd+BeDu7G0cmJ2RFBYSzqcSservEKvZFUbt1MSE2L8jCqy2Ww\nqeMOPHppleae14IGoUMulpbRx1vu4lJJtU6IqGxlDnziGj+/msyMxGuIIDXb\nepwOB7gcU4ErRyTjAo/yosNLNrNqrzfx22WhuTNLpbBvXLZXa23uZsXjVZkr\nX/zlo9YyZXtBMU1Yym4nw4iIrVfbx0GM/kVYhp0U34sgyIWla8Iz0zoQwpD5\nlrBtpz9hKULgbQwjEBZV8GRjfvf3MCOyNZpro/D7x/1eSRw/GI2dROPU7CrX\nNMXILNJc4WroAn2WVE9c1P/PcnJDBe3HWtScT6LShnHrSc84fgNbTMCcbknu\nKS76hRPzaQxsoOF0hIDAdAByC+idUlAHNvZtcV/TcAvNSTLqRfXn0mnYbCBc\n6hlA\r\n=Ss/2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"765a86d0d2a377dbb5047536d1709edda22328ac","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.111","@balena/jellyfish-environment":"^2.2.38","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.11.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.4","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.127-renovate-non-major-765a86d0d2a377dbb5047536d1709edda22328ac_1602283788014_0.6812902129445622","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.127":{"name":"@balena/jellyfish-metrics","version":"0.0.127","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.127","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b0e9bade4ca951cd0592686e2e07951d818370f5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.127.tgz","fileCount":16,"integrity":"sha512-Z4n0xZZex4+In8ExwedOFpQY9f6c3EYaZJ+OJn3jM411zg2JJd7hvgGJMytiJ/hmBf4C1eAkJJPVMFWMvBi1nw==","signatures":[{"sig":"MEUCIHaLDZJWWkoQELEy9UnaDCoVyCCKceEC1kpjIS3P/dAJAiEAgrXjXYIVOg5KJdwRLfQlgmApD+x8v7byAjMdqlI/6NU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85871,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgOmoCRA9TVsSAnZWagAA2FUQAI4QZpdQwdd98qUaaaDU\nhxFq0bwJdqUssEr01I5aK4BlCa5SZIFyVNW0dmqaoeRuJU9eRUckbgCtWvA4\n2otM+MOmNonxDBnQ7EIAi7jjTfwEENr6Jc2GdG4BtfI5Bc79e8QCMG6ob2hj\n57Xxrx1B/MRfmrOcHgOpDPxuKYfcv3hGr7OFiq+m7bLiuq8a7nuAQqP0g331\nnMuOz+xA8F9rayKshskYvxcUEdjQwd++mhBlZxExnRIq1oW4LemrJ/X7nXGS\nULNDKc4YkEtOi4A02yTji2rUKWMZF6kAZSolq8cXLVT1+tTt9gHuIw3S/iiE\nxy1Wzx5/+WRfF++0fBz9ZwzL0qpU4kgxmDtXs4JP8txLscx7GxxWeaBUoFJo\nTxMBkMAGSm7QavEQORijvpEiMU/EV/zJg3rrwMLusDI1tm1cjL5CQHl0RXIZ\noANn0ZVzvDTd9KVfKac6aeNCIdv48pOu9qT7wPIMVH6WEu2ruRSIRGLP+fTA\nKSZ68uIkD/tqSgUnVzeDTgJt2hfGLgeB3TkP4ctwXuhtIUyEPxwc98hN8W0z\nhK3+8X5lE3yPrFi7t3JBJmzN29EMnuCJ8TXvn/b5ukLILrnMX25FyjdfzHUD\n4YLCT0b5B6+S/xpSDyTrmboyNC492FZMfqUudHK25eUc3VSP84GK4BN2+/A/\nP9LC\r\n=Mk0n\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"24b18257b0e0a82ce4a1d4d4a0908496945918b7","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.111","@balena/jellyfish-environment":"^2.2.38","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.11.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.4","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.127_1602283944436_0.7889397374324572","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.128-renovate-non-major-5a25987d844665fd07697f6bd253093433040e40":{"name":"@balena/jellyfish-metrics","version":"0.0.128-renovate-non-major-5a25987d844665fd07697f6bd253093433040e40","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.128-renovate-non-major-5a25987d844665fd07697f6bd253093433040e40","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f64a38953a90c07d176500c286e251a4704cfbb4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.128-renovate-non-major-5a25987d844665fd07697f6bd253093433040e40.tgz","fileCount":16,"integrity":"sha512-lE6UeJa/2nV19lnsj8sXAB6IaIbkzBqMQmn5y4BLDvKeEgekIopyCowftBHDlj4kUDz+St2zyRnN8j++nx7nSQ==","signatures":[{"sig":"MEYCIQCFHFCauBNcHTdHsDziicd2durOUJMsaf57TUEqDZMleAIhAKHt+Zgi5PkRtTyTnpPkjTt6bkoQzQZUIlEhY9nv11gm","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86039,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhJhdCRA9TVsSAnZWagAAzjUP/3Cb+7aKDTIVi845Hare\nPHZZUtvR+AWjKb6H2fRgPW4iT7vwgcS9yzNvurEpJeztxxiejA04iEYepTBf\nml7Eb8tiFXIZry86uGSVmChwjY4te18+Bmutfdsx7aRtFhi8hof7q7YXga9V\nKFRl5hSmK1h7Wy9tt4ArpeVN31sV9hFz8qOgi2754dP6bAfj8K1nxd0OHLVu\nRD1iYndFUrdtB+868PpJOIEUefR9AwO14bWjH3hXncR4u32ocp3QFF2w17rT\nNE4DRCjco9MAM3mpRuJNGQ2+3JdiKj7gYShcRa77jmzRvIhg2GoeLjjgZMeb\ncJGbY4GFyVh6npBKO4GmdOd+q+lyt+SjbXg+uCUUDNUWc95lOnqAl8f2E0Eg\nC1ct4LNbBf9bLfSV6uSJzzdur0VmsRxBB7+5MOR/4I0/t4zDn+GqvlAaeBKl\nrIyWLPBUIcF/e9VLEyjnjPbHONwfzOy4Br9tM9haAJ99Ox5ljRP+8n4aSUws\nhlMJipt5Fyg+9aQjsW+UhUnDTtSekoH9f3XwLBlqHNFrDUf+QQDgjhCJZNur\nFBDOt1i9/irwchG3ThDgaReFlxa3hZhHkEmH88MKwAAPe02Bqyh7UJxvBPOK\nriho9XLtonV83oFGK0uLdaHmrXhioFNlzy3kLrneDVJas9WFRRwytSay1rXT\n7cib\r\n=quqn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5a25987d844665fd07697f6bd253093433040e40","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.112","@balena/jellyfish-environment":"^2.2.38","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.11.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.4","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.128-renovate-non-major-5a25987d844665fd07697f6bd253093433040e40_1602525277264_0.307826352383608","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.128":{"name":"@balena/jellyfish-metrics","version":"0.0.128","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.128","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fa85df5f23b4764b08006e2128312d0f95a584c6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.128.tgz","fileCount":16,"integrity":"sha512-TJWAMMN6LKDaYhPTqd/w8v79+3MZtxNoUW2DuVvBAskJrDiXTa/Dd+Fe5xvISITKa0W8pPNl2KdWUjxzLZlV2g==","signatures":[{"sig":"MEQCIF2a7KFtX+xOHyGmGk2A+JdDWW3wuECnyGRdJW/SEXZ3AiAiT9hDfQdKt5ji+Yn9+5DOSdXWak4N17dPPRpg3ZC9kw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85979,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhJkICRA9TVsSAnZWagAAnlgQAIAs4ZtOXn4W4WaDUf9O\n9qJxvsOKafjZVXcc8NNI6cy7kJSCQV2uAFOlEV71FGmhe9Dzcr6l1L8S5Lv+\nbPp1qJyCWH7ixH2ZtGjxq04gCxBRaVTmJcE9m0fJ3VRhvhMSUEmfh3FzfaTJ\nhVQn4+hEpVUrQ7lVbpS5ZKBWOJJFKcjiPQ5xOe9F8wF2k5v0UDkZ65F+ovZy\nSyu6o7K0AKZA6mjRZ1Q+0ADtvcYlXJTZj+frZJs4ASNfPzflOjKIS3u3qQj0\nQz2y6Vp0EDqMf31H9vn5RvMOCGnp9L30QDEvAcP+BPsk7J4BgX8nmH8vpMQg\n534lppchxSxR2uFbBhMH6Kgz6RFxgu0v6FZxyd81uxH6dPT8ktQY9ULUCrZn\n8Y3ByTghH6sE+6+q/H6On1y/Zi28XU5ID0SYq+Rcx0C0arsU7zVhvIM8Wx05\nNfWDtDPlsBxTpmJphZYNtDL3BBb7zLr3SistBf6ekcjt1enLopWyXEZhVOxJ\nkGwCLiaHESViOrKH0DEU9Q+WcYp+7bJlqsZiCwjXl4Af7XsmsStTG0NMPKf7\nSspDuQzgQZ+uQx5lshLx1S1FmEpv3duAZe+po9gcdX0sBJDGkdzlTV93MRc3\ntzZ3loi8Or1yA4TX/JgbyjzIlJ8nSGrGvBltZ9V76ygeP0ymYniTWv1zbO17\nl3od\r\n=DcvF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d6119a6171908cc0d5f00e5da016793c6fc7c68c","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.112","@balena/jellyfish-environment":"^2.2.38","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.11.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.4","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.128_1602525448239_0.8329356209470646","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.129-renovate-non-major-7f21dd19a9f92589a50a3fdb76b825da58d3b0ae":{"name":"@balena/jellyfish-metrics","version":"0.0.129-renovate-non-major-7f21dd19a9f92589a50a3fdb76b825da58d3b0ae","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.129-renovate-non-major-7f21dd19a9f92589a50a3fdb76b825da58d3b0ae","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"89978c253f26fec805819a183507da369c22ce80","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.129-renovate-non-major-7f21dd19a9f92589a50a3fdb76b825da58d3b0ae.tgz","fileCount":16,"integrity":"sha512-N9d3GiSFfAe0Y/8NkyaiT6SthhygLvacy7CXJa0Aq72Kd9QlBoEkPH1eb/9D4LYW1JTj56ZoNQWKprVsDCxLZA==","signatures":[{"sig":"MEUCIDdEBt86Ggy55jLJz3qJ9giUivmmKFaR0WEfXhv+PpiGAiEA7qG82r2kAnc3rqdFGAmMIaC79JY/7KrrVCwgdQEDEKM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86141,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhkhvCRA9TVsSAnZWagAAaQgP/3vQfYyH2ui2pIzqFm/l\nfP453K7cmk5Uo+hPMxkFPvFtVilfdAH0CFnsPYvdQo/oLajN/Em111P/Ll2s\nb6WqFWOSMjbI8g1FjbF7MztK2EQgxWeY+gg5/6xK+4zQsIGojHbl3HtQCFAj\nZMhH0uwfXciHtIXGT2lkCbviQBJE69fmW3QEchYfcBzVTZk9iyNvkoeoicJO\nuRBjOMYfX9ZjrT2tGJJMFpqPuc2yoPk1tRtRfG+fejGBbBhX2Z7pwrCjGcka\nKf85BXe6CRVFVlFZxc7YJax82Id7aumFDti++MAT10sG/MsgGMOWiH9TC/tb\ntsGVkf+/T3q5JBBZ4BIzW8z3rmuCthZwMNHrsU653oSr6rGFAi/5frQGi0Sg\nHsCb5FNM9b4LZvUTzZw4zA4miAKgyb9IcO9O8cpdrNMfWwcdjYf+Xw9EcM2p\np8It3g/Q35/FZFb62swFtvrc/QdN+UFeYJ7r3UlLYK3j5fXNJ7KnG/ppPEnj\nncTvFnhfLKK1FoXLtNRQLRkTnTv14Jvqj0hHjPGjEkopFriF31aYY14usE7t\nMdHeD5WiNUO5U3zMeOGv0EgWoFNftItUiU4orA7xtNlVlz/cKtOA7fh+hImS\nnpqWXYO7oXxhjfJo34CJ0JM9a4QeLQtK0tRc0MPulvKwE1s0yNCBgx1y8dq4\nOo7O\r\n=8lfW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7f21dd19a9f92589a50a3fdb76b825da58d3b0ae","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.112","@balena/jellyfish-environment":"^2.2.38","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.11.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.5","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.129-renovate-non-major-7f21dd19a9f92589a50a3fdb76b825da58d3b0ae_1602635887013_0.24690721403413307","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.129":{"name":"@balena/jellyfish-metrics","version":"0.0.129","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.129","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9deef97ade5b5039d0634a18c14ed6324930c07d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.129.tgz","fileCount":16,"integrity":"sha512-Y5kFRGXpeBzKxEF1lUsRAsmdEnzQtM6TgMMccbz5LK/CoI+tgGeB7FOgiaP8k0ob5qLs613VWf+68vO4mjEsFA==","signatures":[{"sig":"MEUCIQDihGF/1eaby1XS10TmXivk+YMByYJYq8nHpwUsBL7ADAIgcnXJoZck9j8ZRTKTiPodXuTwN4dnY9cuzyYX1YeXmow=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86081,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhkmICRA9TVsSAnZWagAAmBkP+wZousVXNPPGXDsbR2Ld\neGXWx2Uves9QOmfqWO0uKdAgknZhyxXtVrsz22gZZD1z4+fttMC9rJ7HnsEF\nEgIijOJp7DJE6Z3okF5djhEx/dH6Np9beWFuIIpTnakOhu0+FtP+7F/J6Rs1\nT7biGtO9a8fpZqpoeAe8a0P6ppmXgpBGxM9OAYwvXvH6V05RDsbGSjhBNBjx\nl31nyc3TtbpD8lhKDVxWXbK6L4UVwsE43j+Cnty6T5oZJB55fDMZQQwzEep+\nxxhW8b/JQGzadGC3/JWClog2BqwV3cNlqzF/hqdv9PE2cTPuJlezrkqxl1gI\np00ipeFUzojS4WxcW2ZXHYMm46JkVIkBxuUDVo531+R4xmaUqM0KWs0alRei\nfoGoMaP9OR3vWkiyRuNpoquzhf+Iwqj72e1XYcZu2O4F7wtWVYdnVVAgyXzY\nsYwHskO0P1ShK8sXUq+dv34y4jLuqFYS1x6k/77dbnjeqJQ7JmTHj5zxVh1Q\nK0mtPMobPZBDSHdRXq9QChdwxQ5x+Ren/mE3iMw9oI7EGevVspjufGurBeBh\nK7AN01OUA2PNl8zigUHX5PEUBY0wNRK6qDR8CGmVZuvvsUjrm9ujOx7h8Svv\n62kSyX1LU7GWYcO9xAY+ZIE/MAR46/dGZ2w8nkuTKvEpYWP/9ddMqHVk8uq3\nxJ4c\r\n=9y2v\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9afa322c2c41088761c4c6de8ca7b636ee49d0b2","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.112","@balena/jellyfish-environment":"^2.2.38","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.11.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.5","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.129_1602636168299_0.13475016350990376","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.130-renovate-non-major-fb3bf802abe06336a0c4b4f8951bcb2c71a3f00f":{"name":"@balena/jellyfish-metrics","version":"0.0.130-renovate-non-major-fb3bf802abe06336a0c4b4f8951bcb2c71a3f00f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.130-renovate-non-major-fb3bf802abe06336a0c4b4f8951bcb2c71a3f00f","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2dfd0c2b02e0b1d40dcfe12f95b5dd146777c5a3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.130-renovate-non-major-fb3bf802abe06336a0c4b4f8951bcb2c71a3f00f.tgz","fileCount":16,"integrity":"sha512-pFUY+y6rZvmcNceZAmkInO3Qjf+e+ZsO8U9AdmPZKbQvs6sQTP9hhUaca+GU3Xgn26qLj/xxarITaUz8KA5Cug==","signatures":[{"sig":"MEUCIQCqX5BRbJnYKApubYzzhzBZMk4gjZZNbWtRgmRgtht+AAIgcvGFeZXIa2tFxybgdABZO1z8KiqQCcAm1n9tim0iPAE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86211,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhlkVCRA9TVsSAnZWagAAzpcP/RLeohdU4tyu+0dXQnbK\nlHkeqTB0GhGHiWeNOgMZ4Gdsx11/KVLXflyDAUZdj8t4A2hVnSOsBHR/ewqd\nEcz1ogcyYccwRmHZRmhxJNrFkzvzECvfDijMeoCxH3g1c6DlteENGrT1q3fJ\n0qqlSS1ENEDU7F1tYL+ANpfq+beHjDLqVdv5UF8qqf1BsFi6qmTpXtjgdElP\nv2nxBEJJlTyIkiuXUudnBABzZZhLIjrGY8PD7qJGw9Lt6ssxMO+KPXB8OGfN\nGBD9B973LXt5gqY0+qay39BbwFpYyGsflylvWgikQNrrpvIIFrKhlnT/HIyy\nERnkoBq7zLPdQPM7U2v3mze5NA9b7qj9Nqlt0qxTx7HYwGoakEwgCjGkvu4A\nmw3aUvW7KDK/bbpN56N1pA3ScZET20hlj7v737yiF1StcaW6fY9n7PP/PVHR\n/s6L0Ux8/wsRyagY+1VEZAFMYHR7u2g/ZCDyhAW6DAth/oNk7ks2NFx0btXe\nVt4cSBrrhJgfDGEYtHZHp3wMrfJjd9Ezz/eZxmawfQc4hcufh8fZmWx0/Htn\n/cBRzl3GFyfIGvcq003gAU5YhU9K4yRYLad/6XeDRNGyHl3maPoGmXdVsR03\nJkwlbIVH/kIzMJjfSQTfWKjXO0qvxzEIFLMfztY15egfZqJE7W9hHZ/DECOs\nxDsm\r\n=mVxe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"fb3bf802abe06336a0c4b4f8951bcb2c71a3f00f","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.114","@balena/jellyfish-environment":"^2.2.39","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.11.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.5","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.130-renovate-non-major-fb3bf802abe06336a0c4b4f8951bcb2c71a3f00f_1602640148877_0.29973613503414764","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.130":{"name":"@balena/jellyfish-metrics","version":"0.0.130","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.130","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e9449300141358e66d0aafcee38de441a278e731","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.130.tgz","fileCount":16,"integrity":"sha512-Zh7/ti1WYdBjP4Ns/0hKx3SUmlcilYvD6Sc7RziN2MZVuhWuUEjXLkdxhz1xeY5uJtBok2kVoloij5YPNQDIOA==","signatures":[{"sig":"MEUCIFfFhhF+DR5RFd7ov5gYCEAKN4NbU01sb3NLTbS19hpAAiEA8WN7K/mdl1nQvtLJjMpXshqsStieAaRN5YIRReyXX+4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhlnMCRA9TVsSAnZWagAA3tYP/AtgbxNcMXXj1qZ4WbEn\njNEvXoNedoLqLQn7DJ6XxlbtYMzBSLWKZdH5LAaqRhlGWiIxbK8qdz8/x0Qz\n4fOQx8a9xMiH4+1VBas6UHXNfG3sdLrIm5uZL+pKm4yCOAw2POyRFQ0q85JV\nq186JglBAmvrIoVu+Z4ijrd+V21B9pSGdJQyO5cDcSB2kc1hmk/+piN6A7aF\nQnb9j2Mm61ax8vMuKT6fzypPcmi3lrJXNAATBnSEa6x8hwZx+ULnBBL+JKDg\nCqWkXAHH2lgZcH0W80I1w2e2tZwGQKBzGJyjnzcsmcT1N7Gur4IumEOIz9PP\nMAwJWl2iHuPtTkpWBptG5SPfBrOd2x5A2ZEVvjwk9WupiNwDiEKCTS/V+LN8\nSSA34CxNmhT/0lf/ZP72PCgnCyzIaT3XeOBAjVlhuExDN9tLilFGMAQeTG7D\noSTAf/KHCMT0Aun5RFgKkD6431m3gqep/Jxi5QW6BybqNaS7f7A01dODAozI\ntCqHeXj0h51X1+q/no6Us8FlMczQYctAJiwRlxPAWw2jAacbss3BKKbAjPNy\n/IsjfB4CW37iVNMmYUiKZcCYyePepUXYdaaUE1Y0mk6+9m4lkuS5ix0uERFc\n//JSRZtGoQfw+RT2ZHdXILQI1v59Xyyz0KbhHpI1l6vxwt/O383Ny3JPU+Hp\nRENu\r\n=Ufh0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ab43aa0dbfd827af7fdb0e54f85710dc7e1ffe98","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.114","@balena/jellyfish-environment":"^2.2.39","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.11.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.5","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.130_1602640331456_0.5063278877214386","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.131-renovate-non-major-69960ea075692e0e46c7502416b6cfe7fa0424c7":{"name":"@balena/jellyfish-metrics","version":"0.0.131-renovate-non-major-69960ea075692e0e46c7502416b6cfe7fa0424c7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.131-renovate-non-major-69960ea075692e0e46c7502416b6cfe7fa0424c7","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"66937e97abfd4ec14eb0ea3e6e60d8709b45b737","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.131-renovate-non-major-69960ea075692e0e46c7502416b6cfe7fa0424c7.tgz","fileCount":16,"integrity":"sha512-cT/yE934Ufmfcg37UyQoeigJzTMfqfWYmbfYJgZct6YeMJMwzOnuVGtIT6TyB0p7cYDaI0Oiv/+4HkCF7y2uLw==","signatures":[{"sig":"MEYCIQDb85Gy/MTQjGTRSRd8mhl64CPhxPzCiiSZV8e2dVdHqAIhAJ17hhZviSs828zpRAUGJV1Q4ELGx5aYMkU5tr27iIfL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86305,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfiinACRA9TVsSAnZWagAAkL4QAIoLhgROODlk0jPfnaYX\nU+5JpH3X7okUZSmkQ5mMB2uQTx17rxWbXCndEgU5jcIkXpMUPQ19b3Cd2qK/\nTg80vxWXcMFIDjt2quQpq3mlVb8aFDjvezKy/bGQIaudFZXslIKlOIPr+Uvr\n0G30rAVR1u9mjg/efsFqV6S/7AyxAL+D+n7P4lPG5WTxyyK5o0UHtNbn/cff\n3J9LhvVzNGvHh2VFmfV88YbzOxU1ydosGyzZmTwepj+N7UNbnAVTEPQiwBm+\nAhzio5EDIkrpT/RB1ms4sfVrsP5CozQIpRewiJcYmGdTdE5d+yVnkgt3ggeN\nT42+XUwZhAeg9UlyUKLL28Eyi/kv/rg6D44Mvhf8+iJjQuKUGi0BBm9R0g/z\nhU8W7WHfH2tmm92N5bVOOtIzHD8QzF+VSTv0aB52OIk82mEZsUnmAlbH5wWE\n4oltxB5Z9f935y/6bL5LZ92G4KZlj7P91jMCHeumETvokDj+LooeHlNv1h0f\n2r4rGwgn8xXLUbGUl6XKSFSShPNmFGU/9/VQm8bvbF8yg9ZwUJyw5tinTrGt\nQs1tzAvrNgf75QuimEv9y/OBwxS+7qcJU9VuYrZ58eu1+Yux7Ack3lhEM/aw\nSu6JKmZ8DFt37VNvQ/CaZxFRn331b2+5TXwb/lwM8oUp+Jjk/gKiX+0+U6es\nxRKj\r\n=6Ls5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"69960ea075692e0e46c7502416b6cfe7fa0424c7","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.114","@balena/jellyfish-environment":"^2.2.39","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.11.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.5","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.131-renovate-non-major-69960ea075692e0e46c7502416b6cfe7fa0424c7_1602890175674_0.09437415380629721","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.131-renovate-non-major-fb46b6c0ea2205c205e22370b5a54d56fe117c97":{"name":"@balena/jellyfish-metrics","version":"0.0.131-renovate-non-major-fb46b6c0ea2205c205e22370b5a54d56fe117c97","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.131-renovate-non-major-fb46b6c0ea2205c205e22370b5a54d56fe117c97","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"def95cacaa33c95127b689575a28e5f53c7b6021","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.131-renovate-non-major-fb46b6c0ea2205c205e22370b5a54d56fe117c97.tgz","fileCount":16,"integrity":"sha512-EsHbEtUq7a6ju3JHr7xHTkj6mmSgIsKJn6HSgSptcR3hcwR/F38CgtZLqSi3SYX2Pv2wBCG6o22MxKkkNglS6w==","signatures":[{"sig":"MEUCIE0YgsS+UZs2eWPk4N2i7QmEnOC5dmIkxLQOVIK+gUeDAiEAm6G8HIA+freotzI1nP53RVV86H48WPKFbrAAVwMoNhA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86370,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfiqcmCRA9TVsSAnZWagAAu9AQAJhPUfsecS1ORntgjUKL\nYPrdsA4tgLAPzqqJU6eBjiQU78nvfPRk4MEZmgn+Q1PnagjLyKTQABhojYgY\nQr7y4bnjkPOOpq95fzQG28uL8YmGtyQr6Bf2KhTD2Ew+S5vEJD82IdjybURj\nU51ME6Y/fTzDZi9Mp8iFEWFqwJ2GqxMvlA1OEGJBuBwLMQLN1nWjn7+K8+KD\nqOttBceOQlg/4bkannT+oDe4p5z3REYmFwF3CeGb0wU+ziAYvZDZfTNbvYeS\n564IilxtMYW7tSsQTJOHZLZTH/uCAdohp43JTfDusIW+VkumyOWFdD4ZHSPd\nuDOBHnxbDxOQmDHhHCowzItPQHPdtrw0I35oL1GkeksEAZKxxoa7KOtOC2HA\nEWYOSQ3kG6MB+8eLHxFhB/OL7YQJE1eRSMsh8Dimfa/E2NqNGH7as+2oxpdM\n+LDcrrY2bCpO/vC6pMoRFWM1wW4/L/dYJuZfxa6sneLfmPBz46bXxU3uzozw\nbun8lpkf2XxGo1zCGK5hX80tFpUfE3yV9HcOYevkUOcBDixH9FomVMhmflWj\n8MuZErjP2uopcliSrMzbkvzrb891l+VwvyE0NFhVT48XI5X/3HcaKva1+DiJ\nLM6UQpv/9raewinm57IJY+0oF8R/ZkgAKGnD/mTPYmyzmdOLpikd8LujeNoI\nlwPR\r\n=AeHY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"fb46b6c0ea2205c205e22370b5a54d56fe117c97","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.114","@balena/jellyfish-environment":"^2.2.39","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.11.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.2","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.6.5","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.131-renovate-non-major-fb46b6c0ea2205c205e22370b5a54d56fe117c97_1602922277811_0.3184781992046555","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.131-renovate-non-major-039ae17760281242889068736ff071c51f8b739a":{"name":"@balena/jellyfish-metrics","version":"0.0.131-renovate-non-major-039ae17760281242889068736ff071c51f8b739a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.131-renovate-non-major-039ae17760281242889068736ff071c51f8b739a","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b3a24547533cdf22fb4911fc9dc66c036b3cb9fb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.131-renovate-non-major-039ae17760281242889068736ff071c51f8b739a.tgz","fileCount":16,"integrity":"sha512-H4lxMAmBiRD9kj1NnchTTpZqowsifMLwIFb6GifJqkNgchwpxYPEx6MKipaQBQS19xCOzvnagoM41+aoTn2lGw==","signatures":[{"sig":"MEUCIQDXFmwKdNEAoAQZyGmxaKxoRvj9NPitO5drA6K7L6lH2wIgCUE3jVP/eL4sOWwvyHAQoQA55lHwfl5pOATHoeOAMyU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86443,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjaZ/CRA9TVsSAnZWagAAvgcP/0lIIbg/rjoP2m0mR2Yu\nvhIikKBYBLNjsv/uc5CkEwKwwoK7IIAcQvrOScIYaEjWEJi4OW7XX0DNGdnC\nc3ZTQPA3g4vV9zMju++NAiC27HgHwwPyPnNbWXds9x65jp/eSofKfwKzOTp6\nZD13kEJSLPbj1rABH7bgj4Z2v7eKSl+Djj8bWIogK4uaoXv1MivITyur+JaJ\nwu0y8BSD15UuIRhy2zHc4ZslCo4kO+oxM+Gg/aEZ4ynLRElG+WuO1APE50mU\nsSHgB0QAbcaPda568TBCIUPJBouVU8fBaFNxa5tqLazbQ0w6XkY2jAqyL/LN\nECORLHlKrLp2RF3c787Ntjf9md0dtGvYpWuGqCcpGgl4n3Qx/PsD1UiRsfT2\nh9J9deUd+YTQ91UVuD7vo3A5L6CudlEuejYSyR1mDOk4a91z7Gcta6Fuis2c\nclFDaoZMbQRQCbvXrAYSPkfktrJSuVpHU4LXzv9lTtTfsOEJ9mgx0LSgOQO+\n3wIrsVsOp1LYjxiPF7+ZbfposPF8WLxDblkxOOJsi6kq8+b0DNurJLAwW/Aa\nsGdzEaUbgtdzlbYy0yiDN6Jh+d9DUgWT5RNfpmg9qkNp3/3SSYx6EmusCSyZ\nD//lOia8oGtcPzUHkXN5XIccznee+yz5KLTbGZqBJPa5S5r3YOqoMbukxJDb\nuJWF\r\n=hMLa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"039ae17760281242889068736ff071c51f8b739a","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.114","@balena/jellyfish-environment":"^2.2.39","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.11.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.2","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.131-renovate-non-major-039ae17760281242889068736ff071c51f8b739a_1603118719297_0.5751783759796829","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.131-renovate-non-major-a213ff87c3fe1c5a16ee77551becd51f95b1e2cc":{"name":"@balena/jellyfish-metrics","version":"0.0.131-renovate-non-major-a213ff87c3fe1c5a16ee77551becd51f95b1e2cc","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.131-renovate-non-major-a213ff87c3fe1c5a16ee77551becd51f95b1e2cc","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"80199a458ebf70d8341bb769b2e1e900712ef18c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.131-renovate-non-major-a213ff87c3fe1c5a16ee77551becd51f95b1e2cc.tgz","fileCount":16,"integrity":"sha512-dg9keZeCHFKRtboiqtYuTn12MSFoTyYHU6Uk9DuITsOShdk5eRKRZqrd1TrbcyGHKfzJ2BhnfzSH8HETdQCJeQ==","signatures":[{"sig":"MEUCIQDkSGUQd2cyx+rTEsRs/YrNgRfhRjKXumsEhVUvSeHKQgIgPGYKtsS/ajmJ1M5FCubf5cdL+wGXKQlZu5oW6O7EOFg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86516,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjav8CRA9TVsSAnZWagAA34sQAJB8Yv4GaGUExSfdD1en\nVPJnsUCTGpS7xZ0kzuKRSazyOBpSOmeyQo6k+CcB1DxwZyR18CDIW0M/TucV\nXLACfoM5CYQkbENWcUicNlnfbwEU7y/vj1ZpdLoel+78ll/PB1JAyHfic654\nHodggN23Yy4rRqTgj/xpiKCGvb6M+ScB4eeN0N+R3tOh/IwU0WWWPSQ7Y/RM\nu+P05vzBDui+6tnPQd+qUN978qtkSBw0u4CeW+ouDIVe1V4k0BVLhgQaGdL9\nCQJANBBv6WUGmSQ7IZYObaJWh9ZvSh2hdnPfvHnzUPoZCWHJobfuJH27sS60\nxhDrg1ffcG3pr5b9MQNYQMaLAEGBK/2bLNIdff7Ckr1fFkBZ9mx1UbOa3PSk\nlaoBdyNnuA0zHmawm1pS0prYzH7O20zD8G27FifYWGD3OZnBNF1V7ikD/4fN\nYzn6VA3V8IXY0biHwU5FcLvfmli0MNfAE6lVseeism5NhRTA4uU3Nxa9uuw/\ntEI+9pJWhfmS7E5ak+61eOLHDDDBzkOMLmx26jGxAzNvacyft1MosYDtoJ3J\n8Qobbdt0zEv5ZCnAvEDjrm3N7XEDc6Hg95bvn6nvpwudf4oKb79tfBGLNQ6T\nmFltaA3ZX8jbPINu+HdKKkU2/y3MxEj8JZWc9qlUjmKZ/dU7yv2Z4ZpzFPHU\ntwO1\r\n=UCfS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a213ff87c3fe1c5a16ee77551becd51f95b1e2cc","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.114","@balena/jellyfish-environment":"^2.2.39","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.11.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.2","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.2","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.131-renovate-non-major-a213ff87c3fe1c5a16ee77551becd51f95b1e2cc_1603120123828_0.39268583696991155","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.131-renovate-non-major-8944038f32e2fc97d4110c2646a55d4d4631bad7":{"name":"@balena/jellyfish-metrics","version":"0.0.131-renovate-non-major-8944038f32e2fc97d4110c2646a55d4d4631bad7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.131-renovate-non-major-8944038f32e2fc97d4110c2646a55d4d4631bad7","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3bf9e8fd95dc4f87cf5466aeed099274503d6713","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.131-renovate-non-major-8944038f32e2fc97d4110c2646a55d4d4631bad7.tgz","fileCount":16,"integrity":"sha512-IqZRKNHy0W+XnHkETXmVRiKeahA8V3NYi5T5cfQ4XeYAhs28xoquWg/GVEFMzzQxdebCu/i3v/PRqO5Qs6LiDA==","signatures":[{"sig":"MEUCICERMDKAoQy0i6XPqndp/9xcyAeNcNPIt5uPfvaGy6/HAiEAiwNYn8dBFGgZndkE7MRZwDxp5uXqM7ytt9i65IQzZBs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86589,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjbqjCRA9TVsSAnZWagAAPGMP/R2cPWg8CW+RuN1p/hXy\nFxqFTpqUaD05m1RGz6C4QYZwj7f6CE2dmRTgTnGnVSozC4Hr5hGnngljlyTD\nG0a23fRNiwf9bTDpAwl4njz+6P4pjqUQuJyQs4YLdeMYbaqkgSFjMwfRWu0S\nya0uqiJNATMMSXebXl2TkBXilGNKbS308GLcat6f1P7/OiZ1P/Kbiz2Jx1wE\nMW/k/1uNXfkkbYzXzblGluwWXY2r9hzNq4lR+Slmd349MN9E3ASthVtRcXBF\nhQHNTh6GvWMmHM3kZk0z/xKFI7P2b/5x0TSy+JkxKhSPPnMfXaviV1GuI4bz\nFLLWPG8PT1OgyilZp3ELk8OACQwv4VH7UsIAeeHDbANfs2H1OXyjQEn/ZISI\nvvbZAV8qtBevcTMiD9SLLSqEYBny9ZJCvI87rw5s88QYJuC7FgJNe4IeKy+X\n5VzKC+6hHSII4cs/rJEuEhPOQBTILjw17gq6xRg7o9kYYI0RtecsHy/PGJox\n1gMNeFVX15/Yw0G9GmuwbGdQsKZcKsM1dU3brNURywLGqsAO5awyXRmHLqoR\nmQ6YPz2ESzxn7zOQ6J7Duy5x6f9430zTtuI7Pk0687nGdaiYHQCKWMCTRDia\n/p1yxJHHRmeBA0V0eaaQyOGkhEGnaPY7++peoQJBjF8fuljSjl+hEVdgw1EC\nSC+M\r\n=rVpT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8944038f32e2fc97d4110c2646a55d4d4631bad7","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.114","@balena/jellyfish-environment":"^2.2.39","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.11.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.2","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.131-renovate-non-major-8944038f32e2fc97d4110c2646a55d4d4631bad7_1603123874690_0.5511969648171164","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.131-renovate-non-major-59ffda89ca7368d6c1dc234929ab2861ecf1702c":{"name":"@balena/jellyfish-metrics","version":"0.0.131-renovate-non-major-59ffda89ca7368d6c1dc234929ab2861ecf1702c","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.131-renovate-non-major-59ffda89ca7368d6c1dc234929ab2861ecf1702c","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c33321b39df777684eed574cb1d906712fde3afa","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.131-renovate-non-major-59ffda89ca7368d6c1dc234929ab2861ecf1702c.tgz","fileCount":16,"integrity":"sha512-qJqwZDAjNiipQ9XCfg1Cel1s4tapejbSLqiPn8O6jqyen9l41qHUwErtfcCuy1dluvNjXw80K60PrJnT87KdnA==","signatures":[{"sig":"MEUCIEow26JAo3OS+0luP4l5psPtKwW7ROy+fmbwArrYEBfdAiEAvVYPoaQ0Oe0vQuXR/qFzCjOgUvO5QWlL9ck6ome06V0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86664,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkNBCCRA9TVsSAnZWagAAaGsP/1361gpRW4LNwb3A7fFE\n2FoyB7BnwI3mCzA99AIm8qXG657MeukvP+yM9iBQrmZDlJxhul5lbRRq6nHL\n7VdQ66BqsgZRpWgLRIoM5GYV5N+Xmx78BxuN+6BcdGnOqUMqe4+1JJ81CpeJ\ntVdHa0YWofmVfv/zmWq/tdr7uSVIz0JjexPGiJbJhkbUkqZQv9nuxSRatG8v\nb2lTmYJNyF8vTxU8FQHBxSBp0YSASznfamvDmC9IzpCupQfTQUixPlb6an6Y\nbYR/r/DbxPSJMv0iAEFG4J1rG2emPT7qRszEKWwlQg2EP/x0+5v6xqPMN3Hx\n6ZMBiD4VPW/CeVM/mRchCBuUVUv8ZfdSphW59ifLnd0bNYOCdk7i3aZEXzdT\nIEFj0gUO0fMl2a87cnTqJFv2vjiO42A66JCPiKiULHS0cY4L8gDyNjqmj8Xm\n3gtzqU4z6/A5n2ooynhdGX4cxLtOrtzG2+LBn8Kd7GN/sf5avNbRdr4VPuV/\nDWcD7WjIuhhD1aJ+dmLJijLirLrA2J47aZNEZ8Cy6AJZaCLD25AtBssCm3Tq\nTdAiC1BhIMtsL+sTdn4rE4S/9Bj9FpYx+ogAiVTe67yL85x8/g0GbmCn6HSp\nTY51LqvAEsu7O79W2Gp0enP7ZiZnStqSjImxL80yQEQ4xJaEIztWugTzxPW7\nroWF\r\n=pquo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"59ffda89ca7368d6c1dc234929ab2861ecf1702c","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.114","@balena/jellyfish-environment":"^2.2.39","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.11.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.2","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.1","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.131-renovate-non-major-59ffda89ca7368d6c1dc234929ab2861ecf1702c_1603326017730_0.9431940096541465","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.131-renovate-eslint-config-standard-15-x-157d728803560c968d2c7049e70fe1cb41776595":{"name":"@balena/jellyfish-metrics","version":"0.0.131-renovate-eslint-config-standard-15-x-157d728803560c968d2c7049e70fe1cb41776595","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.131-renovate-eslint-config-standard-15-x-157d728803560c968d2c7049e70fe1cb41776595","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"50b32122818d073773a7d689d2ba3d7910f84e50","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.131-renovate-eslint-config-standard-15-x-157d728803560c968d2c7049e70fe1cb41776595.tgz","fileCount":16,"integrity":"sha512-uXv/gdEQesAtMJkjH6igUV9zN6FImZQzUlhGkE2JgIM421FLVDytEztIHFy9yGs90QWULSsncJmQJbuedbhz2Q==","signatures":[{"sig":"MEQCIBV8t28VUa+vhRszdyGqPzKdGT87drNJxJy8pXQFoPVuAiBNm3mfdgULhwthZPmCT15+G5Ai1uqAfURsEKtOD9wmNQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86754,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfki75CRA9TVsSAnZWagAAaj4P/RHEvLQmuSVmpxy/g4cs\nI36ON8tRNGR2+w4+fuEzYny5CMqc14uwmDyJmrALjUIWxXfdq2YyFajmUiUi\nzW7k6V9H/VIbwCgTOJGSStmmnsP8gXBquwuAHzhPF+qyhV6s7bSU54436um6\nFqL9YtqJ3BmMY0bihQmhlQ4PrWZ4WvPcDpOurTlTkvzXQqZRP2k8RawCwuD3\nDZscLxEQDMVwnRTKDZdluWyk7ubUEXo6Y822EcMNoLwdvVh7Y7wZVYLcM0aP\ntGI84BwcikaUsLmwu2qBPjqMFfhj3AWvTmZ0rNfVJiqAytBMzYXFbuayZM41\nPEOhSf+b/n2mCbdcB7bv1wd15ft/AWIt8hMggOXTbYoyblNw/bde+50nHykZ\nCP8TTU6r+T6m4Dt+/Pm04uuNnqg32hJBpPi49I8wpH9z18R2UtnQnGMiUjS2\nrGoc7fXkUl4k3UAdz+PF8MnhshqVvWLc76ibrcH3bswYG34CPEZehVQLiAAk\n2nUh1tXs5IzjwqlRFxDk/JCAUTnPopdwAqYJ9blbimDQiXyeILSr8iD5gGIP\n0xlL78WKJVzWwb/aK3J6r7ZZlweCMssPs1qqIs8HfVAtKJx361L0lQURDu3d\nV07UY5gS/2FTAJqqX3WfyjgeItfvQspnuHTxi9jrwWJoGYbO7wVK/oGeVEjJ\naYLv\r\n=JdNC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"157d728803560c968d2c7049e70fe1cb41776595","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.114","@balena/jellyfish-environment":"^2.2.39","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.11.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.2","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^15.0.0","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.131-renovate-eslint-config-standard-15-x-157d728803560c968d2c7049e70fe1cb41776595_1603415800905_0.5841781793643468","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.131-renovate-non-major-4c941302584758bbcfcc3c0d592bea0104db6865":{"name":"@balena/jellyfish-metrics","version":"0.0.131-renovate-non-major-4c941302584758bbcfcc3c0d592bea0104db6865","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.131-renovate-non-major-4c941302584758bbcfcc3c0d592bea0104db6865","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1a091d184b29ab32755f26092dd19613406232ce","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.131-renovate-non-major-4c941302584758bbcfcc3c0d592bea0104db6865.tgz","fileCount":16,"integrity":"sha512-+wFbi+M7YThFQ8EyE34lZ6qirb/nGmXcfFIcF9Q5Rd855oNi4CZzORt69JgklzMoVC5uOrkAd/YkQZWeWfsUbw==","signatures":[{"sig":"MEQCIDQ1fFA4Z2VHpXmD7PSKanuOc9pxCkt/JqX7FFxAk2+AAiAsJTzClsUSv9er8o8K9azJn9X2pqtiPNWfdYTqN4B0OA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86796,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfk5XICRA9TVsSAnZWagAAqj0P/jPha7krT8HQKW53MFhM\n+HlJriMJZh6Cqa32D7Fvmrkt/QquKY+oR8fvLnqms9Rd3kl2L5g5kRLDDt4R\n3c0A1sJ8ugUjQSMmC0ENvXFiGPW4ObIqOHdeMWVfzu2HWJLqk0yv5jdR6ini\n8xl3SHODMsWty2qrCh1o5QfLgs4J5OyF4wfHb9AhZmr4Ohu1o9ttYnlVJj38\n2xhGG4Kfj3Gjo9aCHv1yVm18XPqG98jA7qe900Fv/J70CnC6wGvlihgKPf8l\nZxrxnBn5E/VjPA6fUCEJ4xoOF6PJbxgghDpda0fvIOHFbBPS1FFF8C9aOWVl\nuax8sNcXUrvXh8mxUSRTOMdPB/qg7dNtf8q7YswN6ivg75nF/zwzSXhaGJav\nIaia1gNbxJ7Tu8vZdFJ4nYLnIaxR79915xlpkjA21TefG3XpsPb2dv2stRKY\nN/dnRFflgdv728Pl5rvJpX3pYH3pUEbpJ1ffld79H5bU8esxaZR4MwJnMs0V\nQMYM29+wyjOqtqzvPfI67er2NUc8YU976vKWlaqK7XBTarr3mJPmtPi0CywC\nV4Eta54IGRO/WPOGSSwEPJshCeezavdaik10jed2APk3Cc511UtFs0sd2zx3\n4qzq5mca2NHpHeSAF+BKFhGmtw+odq1wCvJBTrtsga/rdfbZwnD9Wqd/pzHa\nerIO\r\n=oXb8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4c941302584758bbcfcc3c0d592bea0104db6865","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.114","@balena/jellyfish-environment":"^2.2.39","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.4.2","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^15.0.0","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.131-renovate-non-major-4c941302584758bbcfcc3c0d592bea0104db6865_1603507656493_0.17028064223503048","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.131-renovate-non-major-071c0209cb8dcaeda9787b32c28c1e9c26c623a4":{"name":"@balena/jellyfish-metrics","version":"0.0.131-renovate-non-major-071c0209cb8dcaeda9787b32c28c1e9c26c623a4","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.131-renovate-non-major-071c0209cb8dcaeda9787b32c28c1e9c26c623a4","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"06215bc8b49fc4e2a6699677ef1be8977c0241ce","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.131-renovate-non-major-071c0209cb8dcaeda9787b32c28c1e9c26c623a4.tgz","fileCount":16,"integrity":"sha512-D5E1H2VWi4dRp8eYkADZ7oSzaRWTznqP0C7/9j3VTPnIV7lG6zvp0SH7Mg3JwGRyv53JBvTZWKFllb3NmIrfpw==","signatures":[{"sig":"MEUCIQCUdYOQtJqvyF6szSymxE9BJsOtemndiXOnC5o0G7BuLgIgB/yHh8OLmamQ66pxRwy3meUlvXXgsV/J/CgUKDSy3Ow=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86861,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJflyIkCRA9TVsSAnZWagAAwAwQAKHSDWrgeH6gJWtDN/sN\ngAKBYmD4V4d2RAQ23xT6ewlST/X3pSCXoo+Wcmpbo9zgIjCIsTYcRGpiWpD9\nCZvlNDye5lNAhwzW01l7JmKtGzSAUQDoiISbVIZNKIHb7Gyh/v2WXzRiKFNZ\nK6TL2Mo9D6HNskE3bgikihbeXk6y4BoDl/rAOwqorLt8Mh8wZT4uvyANGLxd\nRHxdmZbI7NLX9anclrnfyxHy4xBIGQSdTYFjr0AdePFgFTOwyAhYkwHTeA/M\nDseG7o10TAWfHCi6KUgITfMxr1xF8MYFSpYEfu4S4kwTxioKMeuCS7PEFO/d\n8XBGHuHt6O3gGdM9LtbtL/HmR3Eiz1S/LBGEWiTmR+YAB1qHqZCu5kxhHNHN\nEUTZB5+mbimJhZDPmwETWQRjFnKXD/8ZvJGmOyJf1jFElW5J3iqx48/KgDGg\n7pgCHNjsgj/Bpn5FT9EMmNfr8HQ2KdcoX3kviTo/BvS8cAe4yPde4LRSsXZO\ntsgHq+GY8/emOKjejTPSmcylUgn/h8aruP3z+4DlZJLufLbiaoOFQpNQUHFo\nfJayo44t6Ns2ciXEq1zrTNXLBKoJOmy3RYasFmV6oB6ENuv/QtPdCf7PSgCJ\nHYeaLElsQltYHxPNRnYHYke9q6s4ZFusCyMzG+fWKCVlZQ8xNLRQKfk7PIVb\n+snX\r\n=q/FW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"071c0209cb8dcaeda9787b32c28c1e9c26c623a4","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.114","@balena/jellyfish-environment":"^2.2.39","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^15.0.0","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.131-renovate-non-major-071c0209cb8dcaeda9787b32c28c1e9c26c623a4_1603740196017_0.9937416238616721","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.131-renovate-non-major-4f6e4a7a322b15ee8d6a2965e1b830d01febd7dd":{"name":"@balena/jellyfish-metrics","version":"0.0.131-renovate-non-major-4f6e4a7a322b15ee8d6a2965e1b830d01febd7dd","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.131-renovate-non-major-4f6e4a7a322b15ee8d6a2965e1b830d01febd7dd","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"dea5be74c4d3d70daf0444f710033aaa5b5eee4d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.131-renovate-non-major-4f6e4a7a322b15ee8d6a2965e1b830d01febd7dd.tgz","fileCount":16,"integrity":"sha512-s5dsHvVaNOb0d1DfK/+t3bS+X+wogBy8bNYtENfUTQaaBdTQKiYfpKYhfluUTNXhjvGjIi+sEIqyGpwLwOO8pA==","signatures":[{"sig":"MEYCIQC5xoFVMGovUj1/ZIY9J45CllR5W8dGdfTVGE6k9KSBiQIhALv0mcHGz7ZQ44j//Pm5TgxCFay+I56nZ4pFbX1FxaWl","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86902,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmP1MCRA9TVsSAnZWagAAG40P/0oJXqt+dZuiG7xr83E7\ny5m4CnSwiEZSlN9DGxcI0Tzev+Ggcxu17M0UpWZMToeOWOvOGite00WDBMD1\n0NavNMGz/4TpWSOEyhgh05MH0JxL2vesPTsApTvfNRYJc6rDEyh2GowIEUGv\ngqkHjVl+TdZCtUr/6rvxHJBSy8Fkz3NkLFxz8OCCKyvMCTankP1IaIZ7C2qg\nlaH7rlHjhczrI6j9LVxAmy9pJeU1LEiX3ooMmq08vFBbnzMKc1AWtlyhsIh+\naRR13gxwVy57aszQusCh1hWDcAtLy60uJd6jPKXx8+/uL3kcA7BMcOogu5v6\ndkwtKhUEhoxH4/LJ+FuHh37/drO0W3dvngFQeLKXY6K7GV5kbfAYfsxkh900\nXxKadnLQBKiT/NCfdNVBMJg4613gQWgyuPs51qiTN47Humk5Ya7yQ7x8dint\nx9GwCs0C6iHUdWV93PuwvX4gAwWwmdPx5ELEk3QGnQW0TaTyPEyfeAeuSyJ1\nMY7HaizfB3wojQcqVq3w6BGA/2UeXFrSr5XWPhk8h1UXpViUMWA+muMdBaOA\nRgaNZPIdtzFoVfTh5ppfrotmGzKPcU7zQKxPRjYto6PbNzTPWJHQ6PIxUtrA\npE1hVfYwUM48sRHOCEtSfmaz3DyBF5e68tl3jteJxmywR6Foz65Wr38T2AGK\nYlUh\r\n=fCUy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4f6e4a7a322b15ee8d6a2965e1b830d01febd7dd","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.114","@balena/jellyfish-environment":"^2.2.39","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^15.0.1","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.131-renovate-non-major-4f6e4a7a322b15ee8d6a2965e1b830d01febd7dd_1603861835657_0.41888749599565434","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.131-renovate-non-major-eccf527b7ed52dfbf826ceab230f2548f46f7777":{"name":"@balena/jellyfish-metrics","version":"0.0.131-renovate-non-major-eccf527b7ed52dfbf826ceab230f2548f46f7777","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.131-renovate-non-major-eccf527b7ed52dfbf826ceab230f2548f46f7777","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c679469dfe6328867a714445fad22aac96cdf042","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.131-renovate-non-major-eccf527b7ed52dfbf826ceab230f2548f46f7777.tgz","fileCount":16,"integrity":"sha512-ddHVCDozwalRKoqMXx4fYla4B+EmiDYMD8WZo1irBXghDNZjQqZFYIMCkk1R/OdQE2Qto/pZ8kNI8yYQKQE1PA==","signatures":[{"sig":"MEUCIQCGBaYcoA/eiRqUqD5bQpOdewK86fCnBFHuFI4YQq4rvgIgc/TD0x+6XKrN9BFu3p+zNFRZkQhO1t45pV3fpxjmPCI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86985,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmUEpCRA9TVsSAnZWagAA2NUP/1QdvIKSLvqQ+uLaorTH\nCGtvlcWLxTqevtsf9F8xOlrB8nY6IMYJkyMjEl+fMMset48Q/WXZmHhSAr0G\ny+J4Szvg0VZsc2x9DQXXu+8/FHE7WiPpg4xdB0++uA2AOaLf7PFiBNEGOhTT\nEBzHiOMZzgrb6D4fcxIlPvccyeMSl4DQwNQKBHXE95GMDGIsJHK9hQmS4vvf\nmZHeRG+Z3npiWL79+ek2eyigw6Ou6RHiogLEaJCp7utMVWWGWfv+ixkiI/lu\n8V71YLQJCNQOctavEVnV0AhEIOlLWOzMCLgjInRdZzloxbcDezFtGMoprh0O\nztVPEw9E5MceKc7x4YqmhRZ1+w66ikUYEPKM0kcX8dedmvMAyfWQyoUuXEey\nhdyjeF+YI4yeZF0iMxDEnZ8ICU10SLBAJLWZKIVgwmFSO+5jwmkW32oHeLJZ\nCeawrh+EZTsM45oqJnrGx/RqTUh6OHzMniNBB4R4oG3ZgAIlm4untAXwMgU4\nzXnzZiuUE8J/MYRRtPRq3qOEAMWRFo/4KaVoc+ec8Ui6Sp4VauygWR7iyWC8\nebOcaLxJC3+r4I/wukNmpdTuhknhp6rHoMlKwG6GOSUnrMNtMRWGFSBGwdPu\nvAOiE0XCmNbAE2USiPFZ1Ts1vzFF8b3roPJ1ks7TkJs8jfHnWCG274EHqzcm\n4OSM\r\n=Rn9a\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"eccf527b7ed52dfbf826ceab230f2548f46f7777","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.114","@balena/jellyfish-environment":"^2.2.40","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^15.0.1","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.131-renovate-non-major-eccf527b7ed52dfbf826ceab230f2548f46f7777_1603879208758_0.02558343267160046","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.131-renovate-pruneStaleBranches-d9deaee8d989cd5344fed7331fc3133c53ccb33d":{"name":"@balena/jellyfish-metrics","version":"0.0.131-renovate-pruneStaleBranches-d9deaee8d989cd5344fed7331fc3133c53ccb33d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.131-renovate-pruneStaleBranches-d9deaee8d989cd5344fed7331fc3133c53ccb33d","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d84e1d0e86dec0fe45f6bf1240bbb30e91fe4d32","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.131-renovate-pruneStaleBranches-d9deaee8d989cd5344fed7331fc3133c53ccb33d.tgz","fileCount":16,"integrity":"sha512-geYZu5CLoJrCZ02owEf/f6vm4CB3X45BsL5jbNNp4ifDTrsLUjNCPv6ppN1XBzjmMKbOhQAn63tlV42uA3lb0g==","signatures":[{"sig":"MEQCIAkn+AqSwKS7DFZp9KhtcZmHyas81lG837q6KLnLJRGgAiALW2y0W7EMwmsSTtapIXBRWTr5h9EhOvrjcmhz0NiOfw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87096,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmV1YCRA9TVsSAnZWagAAUKoP/jpCvGCovLDdfpA7iFE/\nsHdXwLWTkED2NfLIm+kGhR3rFMLK3hKVT4Zf7gwGztCg9MSzbSrdBI5JpjrF\nrklPuUWP8TCcUVfEJksSO5Co3mLg41n6AGKSCb5kOdOpIxUDV5W6nUYByZvi\n/cvByHzqwNgx8BQkpqv3qaeAvQGeL+OTz32eDtGYT/OnQC5I8Fh2DjBi4Dc9\nP1SI6oL/NhAz3VjAScS7h+DpxKQrpOeIEXm1BND+AkGrOFWTDTybPMXE1ERy\ngkaIP1m1Uu4hiev8+KTku3+DwSOluciXfaftc+60ZpYCg5eAGKO09iF7kLTs\nvFf1pgNr5eQFI+kz2az73QCNcQIkotjqe4zjDjb/wU72vUhZDwJspYvcRt1H\nWk35FDb38Yrruze0N4BYxV6N5SkMkLZFET7Gf3H7JZiUhbZOv/rT+gGRsDJd\n87ZEw0wO3uZzE4cLw47/8/ef+w0VJQ1MxMGbNeOMU1DBmpG1C0vcbasAEIYS\nn4KeDDqICpp+knbjE4ktvJ3P2YT8iEoswBktIR+5z3mWM87NiIOIQpPNHqBk\nPRl5dH1ZBya2ICFbBltRvIGrV/zoBQVduDYDybnc7HPOhN16Lx7soh6Ad1EJ\ni1OVvYd1py3nmAszdlBVErBIlFm6Pg/200xsxy+MwbZr/DkigiKoKoQMn/Ir\nMrKS\r\n=/+Ud\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d9deaee8d989cd5344fed7331fc3133c53ccb33d","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.114","@balena/jellyfish-environment":"^2.2.40","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^15.0.1","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.131-renovate-pruneStaleBranches-d9deaee8d989cd5344fed7331fc3133c53ccb33d_1603886424386_0.2829906119915129","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.131":{"name":"@balena/jellyfish-metrics","version":"0.0.131","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.131","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a0a85ed487fc0c1524ac6daa578ed392912784fe","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.131.tgz","fileCount":16,"integrity":"sha512-u6VYQdQFVRzRBJkp5x9lNhrN5bJT4IBREt2oNjTWNgm9N0+XfDzZON7sfcyoF+ajq1riNFYUh0bH+513yqLsWQ==","signatures":[{"sig":"MEUCIENmslQVf0IgIno27YTwFnkfOTPXR2CUmMANUPtrIValAiEAwYWROsBLlfylqSbwZSlyi29aJ7Ij+GvYkBpI63W/Wso=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87027,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmV45CRA9TVsSAnZWagAA/oAP/2ZjRFuWZbmbp1FfZ9mC\nT2vBC8IOz0XwnLB3Z4ID0gmr3q6o51Hcgrpm50NwStvF5Z4mWAEFgbWWkrxr\ninCUcUpunsYAnZa//Idq6oNOKfS55gHoh0ngMUj8MX8AQp2lTXg2NvmgS45f\n0ZWrZNbwPDL6nnhtg6YLEVmUsqNA9fk8F2rSUf2QwvFvYCJxPbdv4lR5ZWHp\nMfcuceq96COcf6V4K/9gg1MFTCZJ4qhzqLH3N2KE8OoM5jiIRcBeWi7eKfpX\nyDN+sWEZ6FrELST1cvz9wcjKfNFOcdlr6KYJoSVQ9CKp25ggpSlFApEwknqy\nvSf+zfLpHpckDfE2YbnrW8SPWxPTd56aV+dvJEQokHEMN/CmPXPCvpOi6Yc1\nTcU16iPEXKZDUQK57DHK21jxGcQUA2VPtWF4gggrRtEURrV/pk0a4nevkapM\nf/SmBUP6HqEnwpGyUG3IVaA4pAb4Nk+KDdSRamgJWYbyc/ngvtUYBoMm1DYJ\nX2oGOSnzJUMRodWgyJRebSQ94TCPGlgpOIZqBMx6PwqdUBWtB2xNsVhhrF2X\nQG5tFsan6FNrLNxrk2zoM4iF4pFV7wfdc6e1M5lcp7eE2XAi/ukzLnBEKdHC\nBrW4Di7F9vY2Q17cW7ZNpO4ux/r7GQEE2gHE5vIXfxw9a8Lt3VXTo63hBPSr\nwfhN\r\n=fKzz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"bf8f279cb047d2e3ea9946469150c05afd38f049","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.114","@balena/jellyfish-environment":"^2.2.40","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^15.0.1","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.131_1603886649063_0.7935021717830535","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.132-renovate-non-major-7b7a62c549afc737a74dc1762c5fde65230a423c":{"name":"@balena/jellyfish-metrics","version":"0.0.132-renovate-non-major-7b7a62c549afc737a74dc1762c5fde65230a423c","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.132-renovate-non-major-7b7a62c549afc737a74dc1762c5fde65230a423c","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"971105c09cd7af3b760b9da92a6eb5aa82b70793","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.132-renovate-non-major-7b7a62c549afc737a74dc1762c5fde65230a423c.tgz","fileCount":16,"integrity":"sha512-gDskWD+cY6qMhvD2oRZ9OHfdPu2xi/BPn8kEcXGtVNH2NfEt/9HKcboc5wsgSNXTTY5veZ1zGcAFZ3zOtJR/XA==","signatures":[{"sig":"MEUCIQCwGacGyBrGWeHlC2bX3GZP3pGJ3zdxLhPPijwzEwuOBQIgdbuQmePUBsMj6gbhIfMAmhH7DqRJw9gLUi03Sd+jUU0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87157,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmXPlCRA9TVsSAnZWagAAhroP/RI2QyztO/S5r5nNb8Kl\npOOdkyUQlIMlgVqs9L+pQd8BrwQbgehGNlyq3uSXPt9tWYxuJzvhn6GWszw2\nLCOtTAARCN541adOLRQqg2YOEEh/5dIy2n6cayR51IK7XtPIoeQ6Kh8oEMDw\nvYeKpfRSQAgTWVwkAKOLabExRS/cVNRXr2pIDvBHBzM12e70kHigoJviNnRf\n4rIhwJMzAJSUS8e5m6Xa3Hczym4KRIMnxmKzej9T0ndJHcGEtoiyJqw/s0wN\nWQDvIrRNOHeD6IwAkUYqQnZV9ZtYOH9Qxf5Lpzew/uYv+QMq4UY8EmAJNGWU\nRwqxeg525kYiEXkuKDrMoqaiF8JkzBMM+icZOyK9QJBSNRIYVQ9Nux86lvaY\nOA5S8d6AiWPcHQ+/ZFB64BOD1nfv3zBxwMhbj5WQuM6E4w8A1oBorUMhmXAh\nPw50AlcejhxV5WO8cjw1OKVL62n9F56LW40CFcvNksvzieOmdtVcTQQg4BZb\nFfzcmRdxAF27Rhg/r9DCvh3L13mL1KdUQ3iaqbqKtWjbRew1EcuQHBRyIBmx\n2esHJXOIcJRR8P2VbZtxUvEoUvHZQTjHlebPWrF/UbOZ8Vj0xkjje7v1rAkz\nJGsOOvlB5uca2yfXfigc6Fl7bTyhTNteJxYMamKxNSzC1NNA2itlPXbCDpnD\nduuD\r\n=3vN0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7b7a62c549afc737a74dc1762c5fde65230a423c","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.116","@balena/jellyfish-environment":"^2.2.41","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^15.0.1","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.132-renovate-non-major-7b7a62c549afc737a74dc1762c5fde65230a423c_1603892197388_0.24522795830505362","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.132":{"name":"@balena/jellyfish-metrics","version":"0.0.132","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.132","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a82304e671a9b7fad4bb6ef5eba35f95120cd3ee","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.132.tgz","fileCount":16,"integrity":"sha512-9olh7W8n0/NTizmKQCBOHH09Vz7sDjeSaq8xpJmO7BiVU/dY40NB9RYR69BxGD/jg/sMe8rEGcFUjpkNpXK4ag==","signatures":[{"sig":"MEQCIHH43HGbgknjOsn4gBpj9mF9ZCyVLu197QLAICo+EB9NAiAyODqSt4IXroOAaZoz99qSBEPiut8N1AXzWSIMCbyQ4w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87097,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmXSvCRA9TVsSAnZWagAANzMP/1kFmyAktpfElEfsP6k9\nsTjLP+sUXw/G7XwTlYP/5eXloc+AnMJja1hg2B/hIptMGAk1ZhCpjM2Uch6r\nsYsHmNfqXlIP/2Y+Aw+qci/4/BITj4lT0ZlcLdJoU9Q8H9f9oCeIphK6Fcx3\nt+sFd7bCwEzaKCmfRr/abJY4kbV6b4yFhwVh1pclsXiSMDq+KcxwrZeXzZvN\nriwwmXF3UsXeoCMTiS7UMnnh8sIPu77yJ9Dg1oG/XGebkDHLpQH7tx/6eiSz\nPe9Y9aexy5f19qyC0fOYpa5JguLGz3MfaSoC1Exv9xpjxwc8hZZqN+tS36xF\nQ6oBJF+ej9kdX9OGsLxu6aU5mIF1dG/xKcBxBSIoEr/v0MOCS995nPGjsWeT\n9Z7ekOWZoV7PNzSAE/LunacsQ33HbIk20Yc8wwqThbpF0C9BrdE4WPMbi8Wy\n1UQVw5nExcbnyl8R5PT0CJlS3GTb1PrN/VpX8cWEtd97IYuOEox4e7mPBNgB\nIbrzFEuoPSdcGU7bcmyD5f8TIPbgc/XT2sWmpOmmRZBMZMace1fITWog407y\nddGqFGBCT2k81YQB+8tLgjpczpR1oYydU3jR5tdXh6J9cpDl4Vtv0TuGfWpt\npYMN76YK/YloHmusA9Rbab1FB2DAzGeVBiiWmYuGtaequ5a8KEOfcJb1pjb4\nQExr\r\n=fflG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"86255162a3c9715a8ca4d44f07c2b0392c1fe373","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.116","@balena/jellyfish-environment":"^2.2.41","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^15.0.1","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.132_1603892398840_0.15851131148960862","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.133-renovate-non-major-5f09e7ea17ee1fa1fc030583c994ecc90c903193":{"name":"@balena/jellyfish-metrics","version":"0.0.133-renovate-non-major-5f09e7ea17ee1fa1fc030583c994ecc90c903193","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.133-renovate-non-major-5f09e7ea17ee1fa1fc030583c994ecc90c903193","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b87711f8318bca7fa87d5d942619be24d6fc084f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.133-renovate-non-major-5f09e7ea17ee1fa1fc030583c994ecc90c903193.tgz","fileCount":16,"integrity":"sha512-O6ac8l1uhick6Gj51stb15o7cRL1hMS/3cb1OV3w4zKV2mzT3b34jEYtx2e1VUZrWNNEcggd3pdkWVtTyK5ZSw==","signatures":[{"sig":"MEUCIFBQyN28f2MIDUgbbY+PRIkbX5Zhbjvtu8xHPUySDxyFAiEA8t2NKT83gLyQMXVkz2RQ7NKL4YBNaax3LnWfc6HuBRc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87265,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmeSzCRA9TVsSAnZWagAAy2sP/2aGQTUyZfoeu7d/sSov\nvSCSo9CIKuUXRJS/1YHcXhSCGnmapabYwD68/voHOQOm7xpUAwnKN061w5QF\nx3DjaNvNtGoQdAyArF8AtmgEUTXqklQ+Ltq8IMIf0/772tqGFyfWiw1L5GQz\nccCAV9LokK9dpUqET2SfOvQ6jhBExl9XCnJhUQWmnkDQadw+yPjB/wRxeooA\nnVZWvQZWIsohbnbFt010qSTkXD/pd7f3lNbzzNNZg9HyuFs+ds3ojAFHg1wc\ncvsAUqCcjN6q94JdB7zUOHpVJGRBw9Y+EX5SU10X09v+2YIsv7kDB0/JBjiz\niHt8M0wJJKI1ErYK6+FHCJDKlgYfFzPnCYffPdiCUZq45ij3l87wrsuefxs8\nXb09xFJJY9YtCa4Ap1DtfI1/F99wYP4w9TBO2A5OnJtLqE/GXQpYXWFE0rVO\nFs9zNk6NZSwVbjG6fm/XR4lqrJWZLdCu2rBZNrOqOPspXq6yWQyhXgppDNcs\nay3Stkk/xmNUU/h63g5uLCwSuXziXy20MWFsIp6dVdxpS/Xcc/7rJVJgU6JO\nu4N24ZRdnzQ/9yiK7B4WyTGAbCuwsTLDkbq/kbt8PuuFt7F17HW/l9clvZyu\naH2z2doIiP2I/2BB2GF5lZe7M6DH9R7CSJvzfhMERW2g2E/IxpU9ks+KVA04\np92N\r\n=XKYq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5f09e7ea17ee1fa1fc030583c994ecc90c903193","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.117","@balena/jellyfish-environment":"^2.2.41","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^15.0.1","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.133-renovate-non-major-5f09e7ea17ee1fa1fc030583c994ecc90c903193_1603921075401_0.4255321690449747","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.133":{"name":"@balena/jellyfish-metrics","version":"0.0.133","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.133","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e48cb8af34cb4399109901daafe551203eac6c86","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.133.tgz","fileCount":16,"integrity":"sha512-ZxBjIDuIEnVIGTkL1Hr2aGjjBFPVAwxdmG8nx3eKPxC9VSq5HH7B5PvgHY0Esy3ABkLScYF7T+Wzp1x+pV+neQ==","signatures":[{"sig":"MEQCIHX1LJuYMdxNPKgIaoD/fVRTXBz+mEdkX+DZTMFJ3VIwAiAxr8XyhRXcmFhbmLZ/n+mtCzMkNw0uZVZj7RgOomskpQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87205,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmeVTCRA9TVsSAnZWagAAJ+wP+QCxWO1PuaOyWfUyqdJx\nCGK/M+k1mYCENkyGuLM7rDG4E6X7PUPW8VrB896MKo3llYTSaosLgziP12ve\nmV6OUCIvvYpqVnMWG1rs5n16FQmLYkVQuNSfH7sXnl9NKmgjkohVfLT++9w3\nXni04ffllxq/SQpkV11medbl0AMnzK53dwm/4Jk8yRODyOrjkhVksnPiHpLY\nIAx21bfvSNnv2fbAbtsjtXxdkymF4oxkbMyKpmKZR5qS2htu2fjsEvTL3E22\nV3G61NEbUSRlmOFrsMDNvmQCUDmkcsmiasMRHkNlHTdhpHGRMoAnvqVe0CC/\n4Ze2kNZGhhiJwYCXonccy0DUu90sdTxX/baQ3E7TPDJtCnizfLyRrMfY1hhq\nJy9qob0qHGQsqN9ACKl3mt5Devm8r0owZtmciF9l9IgQQEgPh4Hvg79E5Gnt\nnI+6kpzFdIjjOPe6Q1EDDNnVz7zkzEIWcHkoTNmZqVXCFLYpvnSiAU210yKx\nL4iYi1oLvJWrgD3xRmgYW6yCFG9VE2OFx+l44oghpnGfdcWs1bz6+pDbEX1r\nDTzr5V2FDNCiKnru9mDB/Xi/T/nTyzjET0VABle1ys5HTQa6UH+aSFD3Pk/P\nZiZurMRDaS8Ell9FZex1e+6c8LULn3f5fLlULcgAWNK+J6h/j5YkO9YbmWkW\n9IX7\r\n=jgC8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2316a2657767b386a593a01927d97e369b3a28ae","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.117","@balena/jellyfish-environment":"^2.2.41","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^15.0.1","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.133_1603921234986_0.3257434118087199","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.134-renovate-eslint-config-standard-16-x-84145d803b8de1b479eb57646c826d8a93a00319":{"name":"@balena/jellyfish-metrics","version":"0.0.134-renovate-eslint-config-standard-16-x-84145d803b8de1b479eb57646c826d8a93a00319","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.134-renovate-eslint-config-standard-16-x-84145d803b8de1b479eb57646c826d8a93a00319","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"833bb32754c610482f1bef2448cee1b9ae338b37","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.134-renovate-eslint-config-standard-16-x-84145d803b8de1b479eb57646c826d8a93a00319.tgz","fileCount":16,"integrity":"sha512-+GIzWD11MW93SoA9MXG/mdpTPUtsZhn0UBPVbNEhnqsvvnXJJWAqeA3PHIa2ELISpv2yJHDuvvL3ZBh2QX7LwQ==","signatures":[{"sig":"MEQCICtEUQdZncXkBjENYwHVwBzu4VJv5tPq6VfIVRQI0pNhAiAuB+fDnkx0rPxvTgdOXwN5ZhWTiIeHPoe7bkSQZQ05tg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmmPPCRA9TVsSAnZWagAAcBAP/2ompx0LF7ijsekolBXn\nYPf3MmrZDf8i0BEnuvIm8DgZMWd7EmiOUiXAy19EUZ0ukmHnZyUu+uA/T/Q+\nA9bwWAV1RcB0LaTPBAJklgDFasvnmhyeFBHH9TKnEefvrCwaO+Tz7mnTORhH\n+9nhL8OUmqsOQ7xuYPUYJ2eXTQZ7ckXcFKkZq5wwTO+jpaVb+5UEWMKzvJsM\nw+YXtQ3A0cAQJhDXvFFTh9hYdNomnoKDDGbNTcm5fPgBMtp61jUS3urBIosy\nQfdfHB3tPKCJ66FnIQMeFPilIuHzWZ7DL5B75/PZSbHACcxDwjRLih2nUbz6\nSJCyxmdAb11sH96zW8gA9ig1m7nGtlA1G45Cv1MFeAGZP4nTS3AOg3bK6t1P\nOegiIInq8Lsgcm/tsDqznGashQOeU1MA6QFsuMFZdLSaMftVYgX6uriJ0S+j\no6YLW4sFJ+KfNaHJzvr5knCAAvzf1OsOXQJ2LefA53fY+IaMe71RLZW5WIcA\nnJ9hm5XWhWZXlHblDCiPthK6W4YNMNoiBdr0qOCr7jl/JFgzRnTxIZDfw0iK\nXE9cNzG7pVVL3bClmKpDY/arQH8wtui1UasJTmu+z84RCKBtWHQ1XHZ5NmPo\nJRfKTjzAz47NbHHcWi4FnsOe7Ibe2DrJne6laXOiq/R4P6oJiBVuSp5UH+S6\nw+V2\r\n=HgBP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"84145d803b8de1b479eb57646c826d8a93a00319","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.117","@balena/jellyfish-environment":"^2.2.41","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.0","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.134-renovate-eslint-config-standard-16-x-84145d803b8de1b479eb57646c826d8a93a00319_1603953614861_0.939906286743386","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.134-renovate-non-major-faf14126debae86e5a213791b092e4ded8fd3a98":{"name":"@balena/jellyfish-metrics","version":"0.0.134-renovate-non-major-faf14126debae86e5a213791b092e4ded8fd3a98","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.134-renovate-non-major-faf14126debae86e5a213791b092e4ded8fd3a98","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"05b5f3d762ce261e97c196805cc6c1b7ad200be0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.134-renovate-non-major-faf14126debae86e5a213791b092e4ded8fd3a98.tgz","fileCount":16,"integrity":"sha512-+cZcRNd1BBabVZY6ryGfQp244/CN6ZCQjfC8N2+cuNp4+7TF+atJnMkNxNSKGuYLbXLeNG0E9GTbQSNuu5NbZQ==","signatures":[{"sig":"MEYCIQCMX95WPhEtelcFU7LPQJm3dM4Y0rPO8V5IsntOQkVWRAIhANQnj6UIh3TLfgD08CltE1xPj1iXtL2Hc906Mfil/6PX","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87373,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmraSCRA9TVsSAnZWagAAYWsQAIbPoW4aCuTQBIWUOJLj\nYfwQravFo6h7EwsT7O6bM56W3vjA2LFDJQF26uuyKikRp/n9ef6UF1Wwc6H3\nLzwT4ZSaaaYJCJwYIrhHM4uwPRH/sNd7oIeHAebxUGoFtXbQzDU3y9XN5Lg5\nqPJIiBtV3KmZNARxS9tvmtY2MxgLlVjQDkdUewG+3/GAf09gcqJOyx+dqxr8\n3DkjpKdhMAP7JGkWHAAVzNbwV8kFcWWtS3OlkqjhsgFINaOS1o4qLUy+DD9P\nSXJwP4gYxb6NRsfEx4SvvgmA1AJ5XB0U4JBHQamEyFCeRhcQTZ77svE6nvAM\n+suaqRRYqLJTgQzjCL09Br//gaZQngNEt8Cv38gP3ykU28hMmaI/QsBCNqTg\nAzTgGmx94LQvFQuk+Rbw0wQ/m7epM1GGrOawKU+RRvihMJdYiyzNPa5mHZAR\nfE+atLimOBwSh8yVogDo+PAQmVLbiTPttc9CqTZ3v2B4hIOp8T7K1yQWB7Nc\nRCV14uohQw1Gh8Piz1oGBjKLLRmt6BpZ7JIe8eEWEYQQv8eMkpEE9uG/EYXr\n3pAbAtHeBNhr8zh4CMx6XWlFnNkMsoC2wlJGk30PABmkI16yU9A+Kyg82GAD\nG5anLRwA5C8wPuZW8qz0f0k+3f3c70LFFDwHivHqkwW5q1t1ETHBmwtV0dLV\n1MfE\r\n=evT4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"faf14126debae86e5a213791b092e4ded8fd3a98","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.118","@balena/jellyfish-environment":"^2.2.41","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^15.0.1","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.134-renovate-non-major-faf14126debae86e5a213791b092e4ded8fd3a98_1603974802101_0.9117480159275786","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.134":{"name":"@balena/jellyfish-metrics","version":"0.0.134","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.134","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d5debba15bd07fe9a0d49f6075e4a94cf68b060f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.134.tgz","fileCount":16,"integrity":"sha512-42uXKkAid0a0YFYJWUcAczTTNjT6AFacjMR1+Zb+OWfemAu+hC5U8SxPZJ2yPhSEibhyGP8lYT3dwVGRKhNWjA==","signatures":[{"sig":"MEUCIG0m0b1A4gXAY/1qNIA7/4oJm02d2b3ta4bl/T2HejJQAiEAy9UXnGM1Ijc3VeaptlTd910Njy7pVhAUUbXD571LmaY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87313,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmrchCRA9TVsSAnZWagAAD4QQAIGpjapcPzJZZr1Llbb5\npuXAsFdqXANAgdpAt59Z+Gmx5nIhFmTPEJIMWqKM0bdKeQfz/uDhb04cgwxk\n5sTcPTifP7OKYq+UE8qpdp3x11AdAWz7AaFC7niDUxh7yYVwiOUjCo0PNuuB\nY3blBIYxfGl4n0bwZvIlVM+YEIpVvsf83mOuIkkjMSQzebq/eqfI63O6eWFd\nOfZ7iqFo429C8tTkuq9kofg+BLFRYGb+OKmsLQ84jJ7gxfY+Vh1NiINUvETf\nGtIbLEEH86juh9hwj4EgcRFVHfOP+rG8Qppfyhk3F/W7n+AD2kIfVqnNkmAV\n3k8kKNwpLEQ32Zr6MToU3oRqNyuQyJx/2gbFjxxYjHOV2MepUAmHELDbijKB\nZ8hiyEjMsW9WjTW6ccSPgjVLV8wHC+OamA/wpMvpsf7qzVMf9GulH/zwM3D0\nvVWLKI1D3DkdUQXYEAlC4SEFF6sVfoDfX/lqmbEDj9sSTVU8vWycay/4+BTx\nUIYImVZMqb9DKp82XE94mPDgpr/BDW3tIswirL7L+oAV1jR+yK7vnlLu0z1O\nwjmNUeT6kHXE5/YHJSDJG5QpLgIzPTipSHY4ZIG7utWtqXSoidaZzL5QtPzn\nqM34V4vq6hj8XvTquxrjUplFx7N+bBiNcjH0pbIB5Fm27pLsGSbmAmiSnpid\nOlNV\r\n=CVt1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"49b2533a794525f3f308bc786f19d84334e025d8","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.118","@balena/jellyfish-environment":"^2.2.41","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^15.0.1","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.134_1603974944661_0.08519158473564015","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.135-renovate-eslint-config-standard-16-x-f7e0f57cb1972fe64d5e3004d8d3196469a674e9":{"name":"@balena/jellyfish-metrics","version":"0.0.135-renovate-eslint-config-standard-16-x-f7e0f57cb1972fe64d5e3004d8d3196469a674e9","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.135-renovate-eslint-config-standard-16-x-f7e0f57cb1972fe64d5e3004d8d3196469a674e9","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"805a3eccbd8b6780536b4d4750191bb561ab5a2f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.135-renovate-eslint-config-standard-16-x-f7e0f57cb1972fe64d5e3004d8d3196469a674e9.tgz","fileCount":16,"integrity":"sha512-Q8our7TMGqC+B+Y6ip2N4nKXF1xFUCvZsm1i8+Q2P0jYaOEpt7pfkxgcJNZcNclUEfzmSbgN/YeD2Bwm/tMA1Q==","signatures":[{"sig":"MEUCIQCb3vVSfO7yeDmK2kqk9/O3GmKdrLggvYMRk3ksO/njMwIgdh90lP9sOh6hn1hETSk21jVXPlE2o5LKvm9A5NDDZXg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87492,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmrhmCRA9TVsSAnZWagAADAwP/05lHVOFgPO8hlL2x47z\nwyxh0KlwpSU9ZDra1umEjW2F/2F24O9bXnBBRz03Q6zMtSgbJiF+cQ7iC4/r\nHHg6z0+7GeNATkHu+yP+ZAzJ9ygDq8kZwP35CmcPbjhJmziARtZCsj/H5I/w\n5on3uMRThwGWAQlARWZHTCYjtV4dyNknxDL6Oi3FR+0qMmCCpevDnDLIvCRC\nBWUSUd0+JpQgqjMQpjqsLy0vZGv3h9lkPvx7CVlED8RXIZZRZqk/w1zgDw9b\nUq48Zj0Lu4J1boQYcI+4z8hdhXpnwmRkHQr3sMthiPKbfGUJG/YWaNnDKpmc\nL+tgJpYWM6yFriWZ6Dsdz65ugKjh1tCdtfFHM6NhdlrqhgGXD+jBqEGJEoaq\nHOpuNU+baL+MOd+tp4sFDofFpycJlDhATM5X5m/fxhnd67TPXQfzx09qKzPC\nCoOAeIJSZav7O64MWk9ogl/i4yJQq9B7XaHFvFaGaQqv7GiOkBTTvCb44jez\n2NTQY0vFNCWd4E9LcafWIh0W9vV8tIaXJjhlOHM4zDlSAsH5tj+Y1hckJLEq\nBNMNshlRZJOwXcKEKI2MQRImnk37B09v7srceUITLSJOTDnNmeD5pyD9Cuxl\nhIvRRgIvHmRvgQ4jR3GYIiQKfqt2uf2lBedmZlfz6PK9iugmu2mRGLc566Z0\n8hce\r\n=51hV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f7e0f57cb1972fe64d5e3004d8d3196469a674e9","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.118","@balena/jellyfish-environment":"^2.2.41","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.0","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.135-renovate-eslint-config-standard-16-x-f7e0f57cb1972fe64d5e3004d8d3196469a674e9_1603975269886_0.34377031870243013","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.135-renovate-non-major-167e3ca775ca8d623b5f19c32ea74a6aa75c5116":{"name":"@balena/jellyfish-metrics","version":"0.0.135-renovate-non-major-167e3ca775ca8d623b5f19c32ea74a6aa75c5116","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.135-renovate-non-major-167e3ca775ca8d623b5f19c32ea74a6aa75c5116","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6f73289fd7324c7abe60f7640598511176646e60","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.135-renovate-non-major-167e3ca775ca8d623b5f19c32ea74a6aa75c5116.tgz","fileCount":16,"integrity":"sha512-K03pGiduubR9yqZxDMeNZaFo4Ez1jGsQfpoVISFY/joYmUAb6XfmnP9XSAc2/leazZBQEgWZRWTXozCXTof+nQ==","signatures":[{"sig":"MEQCIFwPIs5Z6h4rbHXzBb160tisQvcnRXqMI9stONlOqZMDAiAwlJWI8Au+3qQPfa2GmE83wVmN5ZI5lNs9+SWU1M0szA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfm/5mCRA9TVsSAnZWagAATuMP/j9G84MLsSRNcfM8izds\nOWj6iSimZOexfsirShzE9+PXWvpFMUsIco3YtgHCoQ/oR11pCUvZ+X3PpPf/\nFYs15Wue9VwuaSgDJPDqWr3pmsuICO70dsVi6h1VCRtGZX1e2d0j65ueYiaR\nXguj5TU9OHB1Muo1XKHL/eiuGggCgMhqfxO8BG8nmFetJ/t5WJ3+lFpe1x7R\nZVM8taOtUx6tfO6PLHN/ydjkqgWiF7mzulSLFYd2TZjxgF8KAl0Rb2gg84dl\nu8NoYtPbccZt9CH7Ax5L9CoAS0hIqovZ8520y9RZ+8Ajxrx6NLWwR/I2yQRy\nOX7dkIFyi0zKB8etzJDVK0j0glZv0BBkNOfEDmOOaeJVwKYUKeaI5DPk9/FK\nZZ1y1CFsQ6/le4a8kdRihlsZvBUGQf7a/wChf5ilUxas2RYqCtYNWXQhXlvY\npOIZrxtTfbmo9ne6nbIhQ9fe9E0aP454FQGLpylpPQ3ZklcfvR0drWyf8shD\n1/aKdTCayuHi8KWtHT8Uc2m1ShGQGMkzGDe7z9K5UdoY0G5Vfa/N579UeIbF\ncE9Y2e2dgpnetJFx3SBhdduPeFLoGNhqbErUup/FNsuJQZx4IA3VWGZOrzkh\nLwxLOe7FYHgkh/3427gjUcIglsNYSOQg0UZ904H3/CyCKaOYZzSBiSy9xmEl\nj4K4\r\n=pFzD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"167e3ca775ca8d623b5f19c32ea74a6aa75c5116","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.119","@balena/jellyfish-environment":"^2.2.41","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^15.0.1","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.135-renovate-non-major-167e3ca775ca8d623b5f19c32ea74a6aa75c5116_1604058725500_0.1577482301373887","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.135":{"name":"@balena/jellyfish-metrics","version":"0.0.135","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.135","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7e8c537173e9da8684b65b5590b5614ded8263e9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.135.tgz","fileCount":16,"integrity":"sha512-M5P4ibQs+hsgCWdZEuY8QmJB9iGnLcQibBDmnhr3blSfODI07bdQvWvOM0ER/NFrT0xyKahfgYDxj3I1LyQbQw==","signatures":[{"sig":"MEUCIHhDIy+jBaTImF6MbYQnXLEdBWRZ9Y8uAoonkQn2EZtgAiEA7RDi4E570+qRkGWRpLu2uupBu+h7N+AQep7exRMBy7Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87421,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfm/8cCRA9TVsSAnZWagAAzukQAJu03kRiG1Squpk7WArm\nRzPL4des8GLHhAE184cMmvLTybB0fIxEh5Y/l7WVnkajs2dXar5DssKduul1\nIKOtmf6dr85oXygB3h4u6VkbCs/G1Rg3wCmVzSABC88fOrSZd2aG3oMERbPe\n2NcG36BlMdmFJlaH3kaDIUGfJpLiKOlppwDqJa4A5q5+XMLye2wCX3nlM6wL\nsPpBXl9B93IMyK2EBfmlTToRESCvQaBDYQw+v9N9QIBmySDQ9BWN1zVUMjR8\nfb7ps7s00Tk/NlsriWMXbP4HmVRz6FeIgV20WbyK2/v+UzCjmt5PfWrYt5F/\nQuvaV5Wgwsj1tU29ojZsF1F/hPLPnfoe9mB2fEYG2hvkZ2vwI8uapUTdbSoi\ns7Ayoj6ng4y3JgLbt9ujwC5AeHcb2s/EOctBeyYKRxzhcIM5QQIoNt91gRYX\nht6sLEAjFIMuL8T4VmagIsB0zHnH15Oq/m/WPHkO6M76YtE+yRCcC+XlnGPO\nV99bIFnEc3F6kaENNLJdTE5HKiZl0gocWX8zJ12LuOnOsHXMQ0bZCvJDMPlG\n0XvooM5ND5E6Lvs++6psL2aDmyzcIbxoEIO+5PEPAdfjA+2oo9HZRO8GI1UC\nXhw5arfCoPbBEihS7tlxyWb032HdejuvR1b7073NC54S07ha5naCKuPQiRDY\nuzLM\r\n=kZJW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c4a4a972a0523a0779ae7253a83e095b9a9f5b5c","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.119","@balena/jellyfish-environment":"^2.2.41","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^15.0.1","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.135_1604058908128_0.3713055772084428","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.136-renovate-eslint-config-standard-16-x-eda2d5fbcce8a9b27cefe59151a77640188837ce":{"name":"@balena/jellyfish-metrics","version":"0.0.136-renovate-eslint-config-standard-16-x-eda2d5fbcce8a9b27cefe59151a77640188837ce","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.136-renovate-eslint-config-standard-16-x-eda2d5fbcce8a9b27cefe59151a77640188837ce","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"294f87ed7b48c1cd0e37cbb811d0bf3304b15cd7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.136-renovate-eslint-config-standard-16-x-eda2d5fbcce8a9b27cefe59151a77640188837ce.tgz","fileCount":16,"integrity":"sha512-B+hUJvBAxJbq9hn1QgNRiRKqQUIwF4f+tdLe5uHRP/gCIw/FEFV2V9h93XAd+dRWWct8p1ZbGt6ItVnkq0s06w==","signatures":[{"sig":"MEUCIHufG7Y+lMMZbflEajs8IY/e8ggoa067/CZULuR0oTo8AiEA8i6K6EAJW8ng2IWA7D8jphb3GKEH/AwYyAWdquxPhmQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87600,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfm/+zCRA9TVsSAnZWagAAq4cP/RplwiQZcFR7UzM7Wnrm\n/7gppQpij5qQOfuFXvQlIeCgNCutOomOE9CjiF1D9WZIrtw50VHoGwYrDsFX\nciCC44ICIdZc+qsfKIAQ6FMNzK7pF1d2EXA96OCttqjDnG6J3+dWCUiFSn8x\n25kmwomgUDWxffwld1tKIwVy3H2wGWzNmAelqhX1HJixpUJncZbkaX5AytEA\nrbK78Xd+zMzkN7I0qSaqk1RGkB6WSWyAsZswWRbTcnV2jiBiV3CkFXyOsCbl\n1GsJXpzsjVSW9eRmr0yWQiV6jk8NVEfmHe1AhWAO8bmFeJK21Cq+5KgZbCkF\nxMNR5mk4JGAiTNbwCQqf8ql/KuXhXJmb4QXqT3eydSHLZXad7WAR9IH3CwPn\ntJnchSgc3qQpMQuWWwCp3j6KnpLeLySxC85qF8OIiwyafNQEa0IunAvn0X7S\ncef0joF7jgnR2f9BJ0oonyHTEA9rxMkjSF6lQwS5S1PmXN0FstoRBAni+kOq\n9Q+YYkkbmQTvURomWma1OYnmHeTJdz0a9hR0Q06yO0Ivgz8uF9WM6iQD5+xr\nqocim+DTPpzuvwocoMkCwjXkWgF5u64abuL9Rmzi+MJox3cM+JBa1IvwiLyE\nqL92SfcObx0ckF3sjNH6JjkE502daFuu/UtxPHn/Hclr8LnDps2c0LzW81zn\nfSDW\r\n=uykC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"eda2d5fbcce8a9b27cefe59151a77640188837ce","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.119","@balena/jellyfish-environment":"^2.2.41","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.0","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.136-renovate-eslint-config-standard-16-x-eda2d5fbcce8a9b27cefe59151a77640188837ce_1604059059258_0.88186139187108","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.136-renovate-eslint-config-standard-16-x-0bfc6ef5279c69fbd2a7be3d173ff5e2e3bc034d":{"name":"@balena/jellyfish-metrics","version":"0.0.136-renovate-eslint-config-standard-16-x-0bfc6ef5279c69fbd2a7be3d173ff5e2e3bc034d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.136-renovate-eslint-config-standard-16-x-0bfc6ef5279c69fbd2a7be3d173ff5e2e3bc034d","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"67ce1599d17709bd05f16ea4e56a7566014e806d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.136-renovate-eslint-config-standard-16-x-0bfc6ef5279c69fbd2a7be3d173ff5e2e3bc034d.tgz","fileCount":16,"integrity":"sha512-FNMIwS/xTtGBaIHOqnrWxoQrBUjl+YhIpFcKPjNOOoUz4O0N59BnGZC6YGTsK2pRrq/VGLrMndHfC7wETub8jg==","signatures":[{"sig":"MEQCIB94hRvZimmNor7xZ0WCKCqZariEGcqiJs+fUQfWwH9NAiAHc/Cj3SCPmdvrx+Y3v1Z/yA7xvQOFdrZC3XjHspQnNQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87600,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnIRnCRA9TVsSAnZWagAAkJIP/2AuA/loO88di3Z7qocJ\neAbn7mdWZ6Io5jTe+asp73E1AxBTF34sf3NapPrqOYQwtncZHvXNGsiqPXE8\n4TQuZmvPuZf+xwQUwWsMkYIr3BxW3sbf1HYgUwRQ1tq0LJIQ8tcj6DG+Y7mC\neGVKgXIj8Yp4YvENnqSIf2p+YJFRnb5wIXtWXWQeqr7b0KUHlFitTjaE4u+j\nIaZqcldiL4WmMV8WJ+t470LncNc4SbqdmU1bS3wD06xlg6Zc9GFLnGg1Kiml\nKDwLt+y8HfPwgsQekGwAugUkaLbFTDUAnZ1V62GuUJcTM3pe1ZZBmPSP6yl9\nP9BTWo9MffsOfYKYpXCODCI7/xxYxIQ09wXn16MRkOQso3PFSXa5K6ANNfSt\nlWwbAjcpVTpefF1LNdwEKa278DZLaNPistpiMsuXg80XuJ7t1nyzV8gbepNK\nJjE1duQtec4kMJT63xrG3HXeqaReskGZnebJLYsb6RcirjO/4oGzOPYKqgve\nkW/bhD7xVm9SiUfPo9NibGCBnH2ox7ib0bd+k2jBPV41j5sPOSwrWR6ZAAwh\nSWY5QDMdzcWjZRFTnUAw03zYkYLF+SDwsaQa6Eg/ibrgHuEOrKZejDP5YGBk\nyOemiUVZ1IcE4QrYO46xBYlIy2zgwBuoelraIIMG+ecLhzRRYbupijrD7oa0\n0sNq\r\n=yP+B\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0bfc6ef5279c69fbd2a7be3d173ff5e2e3bc034d","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.119","@balena/jellyfish-environment":"^2.2.41","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.136-renovate-eslint-config-standard-16-x-0bfc6ef5279c69fbd2a7be3d173ff5e2e3bc034d_1604093031070_0.38540077973847575","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.136-renovate-non-major-105a674bf0786ed64aec21f7bd74d65067948554":{"name":"@balena/jellyfish-metrics","version":"0.0.136-renovate-non-major-105a674bf0786ed64aec21f7bd74d65067948554","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.136-renovate-non-major-105a674bf0786ed64aec21f7bd74d65067948554","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a7e8714fb235fbd8a58cb6906595116886f37fb4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.136-renovate-non-major-105a674bf0786ed64aec21f7bd74d65067948554.tgz","fileCount":16,"integrity":"sha512-vYRbPrsRj+p3H7OXyayIdOEJ354N6EaauOIKenGehtHFczRVzkko+goEuziYeJFNXxPNU3eD5K8k9sWW5lkR+Q==","signatures":[{"sig":"MEYCIQC5mDw93YXCBW6lCYpDAbF0SIFP+lFsOB+kVDRMKasQ9wIhAJhmr7zF40UW0GkoEIpQD/+WlsLR4b0Qae7jnSvvA0t2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87551,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnRhiCRA9TVsSAnZWagAAb+MP/RzMFYYv/HP05Q3HEgZe\nmTetrmZC0IUi50g0D33/Cty95/dnVjuK68sjYY3DEaJt4z0VVXuRSOnKHXiA\nkg2/GQFVuV0zIpAYWcCE6F3zH7RA+IrHhpdp2cdtUQWqTJ/tgsc2v9SIDjeX\npIOv7tVSkWBUU96SyqvYfsY5CfcQbSVBE+isSgLE61dNY4qPSLUQzCN+gCWF\n9S+DH6/YSXKQqoFVKS6iRbBOeF+7CgnJW9BpzZSv7AOt/bk7+JucTBs5+FbA\ndawQZbp16x9TjbCyYZDf18T6ctcQURg0aCYKIkOv1URFAbIvL0vHu+L0RIJ4\n56wMKZiXEZ0RQkp0mifISX5V8esUGMVWS7lBKeFUpFbz1RuzH64voqcd7wrH\nuUjHe1g2pAGe83wEAOBFx61FCv7ZGgBgfSpFfHrt2rjzO0bv/F9PpiGm/uC2\nw3UdyORLxd329xclblbcgBgweTGP+yseyKre+iX7iXRgVbEivXWKvW7V6cY1\nsn60L6ctFoXczTV0No2bFxOQeAFzU+N//SZV+0fPnoLzhYJAzJwN8WYQBxPn\n6wDiGEK8M8eaobEs3buH6IEQPU8aVp7HnXBUEnwpjHl1mUcsXJc7Ot5bUKPY\nLrGmNMgdgSnu3vyc1SMVgIuZx2Ea7G2yNiA6EQwlhFWKGsdGcrecjaR9LuuM\niCcQ\r\n=OoMt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"105a674bf0786ed64aec21f7bd74d65067948554","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.120","@balena/jellyfish-environment":"^2.2.42","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.5","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^15.0.1","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.136-renovate-non-major-105a674bf0786ed64aec21f7bd74d65067948554_1604130913973_0.3708511752637671","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.136":{"name":"@balena/jellyfish-metrics","version":"0.0.136","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.136","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"afb1f307b6cfd20f84ce9a75a1fbb872f9020973","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.136.tgz","fileCount":16,"integrity":"sha512-iNi18cCpR8dWI6J8ATvSAf+bPd2ZTTvNGp7TzVCeOvcQgMjrxCs+XDttBcbbxaOK5N7nc7v68uJUROzngyOlJg==","signatures":[{"sig":"MEUCIBIn6/b264464/ph/i59+ZFrNdc6cNqFSJnXhbpf3zdnAiEA/QRZ0rzUFziglDjpgZahmTDO5BhEaYrv0kQfqpT9XZY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87491,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnRlBCRA9TVsSAnZWagAAPWgP/27ZJcxFoKTtU8lfnQvC\nCu8NHLD+YzIhhpqoccMysiqh1yNL2XIe8zxQkt2f38s0Rdw/yvEYxX8sH19+\nDsQOZtmu+zec/tRBKuBmtTQMF0keyc4j+IhHgIsQivkMztgeAb/th3j+R+oB\ndYM41uVB4HTm3hMVuLaaIzbp+nNZEW1q6ZI0u/JhT9UJs33NuBIuZQQZqLYM\nDdvgOEg+qOWYUS63x3G9OLVwTHcMUJO0Fl9lhyAPRo8K0T4qraea02LJ/ZCI\nUvPHBf5P268Eg8BD6P9XN98xilOI3v8rmUPq2EuldB67q669SOUxd0UhxyBf\nqrEdjMHNedZh4ODF0eZ81NgA1GNZLZICbUpLi+3TUmRAqUj/0Ta3kRezLVsV\n/ZZM8kzJ7fA6/lS5jswHj0D+1r+/QNl3NOwGOr8kxN/uJHX7xzshag0QnAQ4\nEziuERyNQwBo+Xu81PeeNhUS/EyiVHXSRWzSYteuMqvT0HJ6RvzGgVhwqRYr\nvvDUHBHmfThBC0zMZUDpVRZXkBauEqGeclus3ruMg+pUrReZROceGsNqCxil\nYI6GKJLrZFmTYdRKoLA2UA7PAlUJy07Y42XzEQdACJqgXDOaVFMIZSx3+ghH\ntIAknj46kNEfiRoPC9QcO/rWGKZ0NbH5YM/QRUHN5121MO6jT4b/tkdaMdKg\njzc3\r\n=q36U\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b164c3a40d2a83db61661bf246ad6f392be033aa","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.120","@balena/jellyfish-environment":"^2.2.42","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.5","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^15.0.1","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.136_1604131137350_0.6502984825626572","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.137-renovate-eslint-config-standard-16-x-527e6d0b8d65dc7032f81619bd0b58e0576f580d":{"name":"@balena/jellyfish-metrics","version":"0.0.137-renovate-eslint-config-standard-16-x-527e6d0b8d65dc7032f81619bd0b58e0576f580d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.137-renovate-eslint-config-standard-16-x-527e6d0b8d65dc7032f81619bd0b58e0576f580d","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a719cd9e33274a87da738cdbe0cafe9c55aef865","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.137-renovate-eslint-config-standard-16-x-527e6d0b8d65dc7032f81619bd0b58e0576f580d.tgz","fileCount":16,"integrity":"sha512-3j7fLXYX5uiUY8/SRUiOOhqWbUXiXeYFw3/zFErNysXBaLbdNZ8iEPh6j6yPBuqgDPqnIKoKV7vU/jrDQmpW0Q==","signatures":[{"sig":"MEYCIQDsQnb7OkhR8qmpiKCrz/cLQJHwbtN9ThI9gByIU9LVsQIhAOA0urKRGqmWDuJAlY8NoPbP8AmkS2nhQJF3JCvzsHgQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87670,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnRp9CRA9TVsSAnZWagAAAzwQAJ7h0ZYAUpxbdFHeKOG5\nuiY2jSiwx9TAx3rOEpjf+sy6sJlQ55kuENKW3lNUUwCvO3BjgMp5MHYiXgHI\nMEZwuF4rKy9OHWDLPDXKZPbiYl9sbh+HEDVems8Dn8xEjHhR+3Vb7pnPOPIw\ncRjnJwo+AaUqtYYwJFfLsarn/b7zx+1L5OyOTbPBZxY9txd+x84d349Lwkwc\nmW/peI20vCFUtxL9KcV9XQWe1N9pUbQCGO02TvRa/aYlDO0qNRaMBG77sdsU\n3WMs+smYrIq3vK5pypMyZFvsxY3+bv8h0CqKqHVe4mXl3wANjIf7ZJUzj2Pr\n+oNJ6WYiAy75rdPfQrTVG5t7hFWoWcuiRqW47674gYEJ/85qxlOJBag5GzrD\nLAeD1ryHzjreRSMNsspDzm6mB+VGK5vFdhgDdC+3L8fpHdk1Ucsn1PGakQDJ\nbhxByZXP32d7xtPL+QRfmuMSR8hKXoSQfeeLstCzt4LeSzU7rTO1lyyUZRGg\n1ov4HRh9o33THbHoAdDAWunH+bTtLPtVircpeRr+ZVnPK/RXqDVn0MI/p3gY\nRS5rt45zf7CKlftNQPkHkgwp64dls7gPU/swllFzOGGT0dH6dBTW/a+Gb9r6\niiJI8jeHba3kwqyBSzpk2dKh23z39AD4Cj8vrx260JiTdgkZkAgmW5g+mGr5\nYZ3b\r\n=mWV1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"527e6d0b8d65dc7032f81619bd0b58e0576f580d","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.120","@balena/jellyfish-environment":"^2.2.42","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.5","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.137-renovate-eslint-config-standard-16-x-527e6d0b8d65dc7032f81619bd0b58e0576f580d_1604131453086_0.8266636445013633","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.137-renovate-non-major-e103071fd7da225e9d1a9e212d356d7c6feaf14a":{"name":"@balena/jellyfish-metrics","version":"0.0.137-renovate-non-major-e103071fd7da225e9d1a9e212d356d7c6feaf14a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.137-renovate-non-major-e103071fd7da225e9d1a9e212d356d7c6feaf14a","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"43f0cb81a17c9677ca684a5ab2ee50465aea1778","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.137-renovate-non-major-e103071fd7da225e9d1a9e212d356d7c6feaf14a.tgz","fileCount":16,"integrity":"sha512-yIbgM+iJiBCayfTk5GwDnRWWpWw5f2znJmlOwTP7C20hOOManJMAe5ufAg0yIbTGkQ2b15RmXOBT+mtt0Yz/AQ==","signatures":[{"sig":"MEUCIHwS5Wkr5NuangMembwt+h2/9dzmcNnK2GZvN5NCfdqKAiEAj2Wt8TInid5DpZypuXpPyyS/GddVx31YahfdIza4llw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87659,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnS8gCRA9TVsSAnZWagAA1bYP/RdCC81K+RtYXLIGfViQ\nndaW6woA3JZjY/EOZnQ26pAE++lPgcQ3kYhpdl9tQDQvWiTmRYfAJQmJrV0Z\npQT0eIktkrxvM0hEKnZQfOvNU2o9DUoV6R81eZ297w4BQrrm7T9TTemrU7sl\nIh+MynH93M5QfUo0RIQQXNxe3cWxVVZ+yWRv1HGh8x/A28j57s9MZ3rlpvSP\nnfcpxVif3I9n9tgli/80UzpGE4cMLDgP5ppT3NgKBQlafTMPCByovFw7zIi5\nbGiLOLY/HdbXtfUYnnZZ3t74curYzvSH0VaKl+aLOs40Q/uO3B2ZiQwCRn0u\n07BBhyywHYDNtqU3/rs2MzdwcjAkwyTdXSHMvZwLh6hsY70Nzkhgz2xwJZM5\nV/+I7KR9zq15OQ1q9pnBXJfE43n8HWNsn2AYV3MRpGQo82cNS8gfzo+PnS56\nmNa2uWZJzPCEo5pIkr5jqDFRSPDQSSNfvIZXrnac2D6XliGXdWS8omNVkLlE\nbDfVv72kZvSuZtuF0F8+twBhOAp5XL+QEKGQDz75jR1NV6J5vIjGdl27TZ6g\nEnQjXLXNoL1saUWKpKCcUdPReuKGJObU8jgAszp70+KVgm1RNwcz86P/MUDe\nU36WBGosOxUtgG4UAYQqCbnan3IOdGJ4IWFqIHLYE6D71mEK/ac5OvvmCrKG\n/z83\r\n=apAx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e103071fd7da225e9d1a9e212d356d7c6feaf14a","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.121","@balena/jellyfish-environment":"^2.2.42","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.5","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^15.0.1","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.137-renovate-non-major-e103071fd7da225e9d1a9e212d356d7c6feaf14a_1604136736001_0.44405414788875053","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.137":{"name":"@balena/jellyfish-metrics","version":"0.0.137","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.137","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8a21ebc7d385b7ad73d1373048f58c4b391de844","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.137.tgz","fileCount":16,"integrity":"sha512-Ov/lMWz0uXbSbGdPKA2S4MPCgU68vYhI/e5vol5TuNkENNdv05yxNa7ukZoTMsEpcBokZrndrpWfLvbXrMRm7w==","signatures":[{"sig":"MEYCIQC1betA3xACDPc1JzwcIQVRmHVrEF+TaEa1bP6h9nzldwIhAP4x9kjEgNz1YxzBCCo0WNfStO6MBqE/C184WQ47dxPR","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87599,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnS/RCRA9TVsSAnZWagAA+xgP/R7HnL1jIyve5C5N7smz\nYAt3qsbwieXw/7x7s2Ykkpp6dYLRj6ShGqpanh9q1Ju2kzpU1hnHj1s/jSsx\nIdGtXoK4yJK7VDk1IQLykE71PwgcXGy9Fw8/upS6xvHiJK1azHZG+pvEQ5QA\n9Wr3kB4R8y3CCDasFmUPuQHqGp3c4kyKhImYA37rzFbUbejImykNW68KJqpN\nF+aLdcmq9yR2AuvxmAPt7OYSiBt+myOtIBKA47oFAEFYJQ2h1Gaji8zxbpbX\n5ZbCOViY3GPZQQ9T/1AJxUYdyFCYLyE3K2k8MhJqNZjvS7A3rMIU8CE6p5Ph\ne18JppC8vhfQVzDeSTHGxdEycLqCd1TrweMXdU/WPx1b6lNPT6qs36/yOK83\n1EqJ9mUifxp7hRNt41hhlEZ56OE5O/dGqMNidn83QGJ4pOE8ku4irtyea82v\nOaFXsJH0j5s2hqvW0EkZ3+9GF44IVaS2T6UTc7vS1tsJDRu09utHjjaffau7\nOSKDDz9cCpvwi4wPZpUTP+q/TRNPCDHGd3zbgFJzoL7LXcN2K/gF7ohYJAso\nyjUqvt3TGne09sF1Sr43NiFY1eerPBrrWAeJyrjdLMmJHJS6KlOUivcr2/Yw\nVqPcTqbLs2Diihb7XeMnyBAQyPUWaLmI2JKpIO6CitkfLUI91qNUUh2KnMcI\nL3rm\r\n=d/7q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"28ce08a32ad8d7a1a49d0714180320774d45e837","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.121","@balena/jellyfish-environment":"^2.2.42","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.5","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^15.0.1","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.137_1604136912646_0.38496379343427134","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.138-renovate-eslint-config-standard-16-x-e5f58ba2783305fcf57392efca522fd1b8892445":{"name":"@balena/jellyfish-metrics","version":"0.0.138-renovate-eslint-config-standard-16-x-e5f58ba2783305fcf57392efca522fd1b8892445","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.138-renovate-eslint-config-standard-16-x-e5f58ba2783305fcf57392efca522fd1b8892445","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"554e1e6a5dc7962b204bc5fdeb330de9471ef2b2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.138-renovate-eslint-config-standard-16-x-e5f58ba2783305fcf57392efca522fd1b8892445.tgz","fileCount":16,"integrity":"sha512-VraP9jw7EtCPLM8TCf7PVrMuxebHQ66vy4m9X+y35brxKpWo3/otCA5X+Q4ey+JLpXLG5Os7bl5pO0algSdqSA==","signatures":[{"sig":"MEUCIQD114q0rnjVCuypSe+x+cTs+S80FFQg2VNgv4QR1NGxQAIgdiUPoR5D3Dz2PEZES1wJ+HOkh33qeAQtKiR2Ctglpzo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87778,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnTBoCRA9TVsSAnZWagAAI40P/11XI9CKr3uYAtSSjuX1\nBGDSQHxds0N26HlTrnKuIQmwOeBrJPhlImXYRpuIPgT1do39tOUH0cJwvq3B\nRXz3x/I9PSVCgyat1qPFZKW+X2EclAH9C9DJ5rUL0NcOWbyQpWxt714fcxR9\n9rbrXuRsVxOWT1fIqQui4Ss9+i8q4lfcabmXRkFr8RZFuhno2x50a+jiiNBf\nqUIVMQzECfMy33GiM3Eq4q440cdSo3ymYrPAjNG4FkMrns3HL4zMTtG2VAIz\nGNc2uDfmujLvsoa/TUDNjnDWbhs0wUdapLhXQ1ekNOOCpoV1gWmz/SOg0Onp\n2V9D8BK+dVYXJn+QvkvXPXwHBssIipSNs5d9PCcZ99fwp2gEPdYinQ+ysprA\ngnTGEbqmHgb3Rjj2XCKDS3uEqn1R4xsYYwpar10shrbcAglHPRW4ijVddrb9\nQfY45A2rIW2oBbMBjnBtTbA58NNRmA+/QjpKiMzCpM6proiS3rxHDSDo2n/E\nXkB3cxlJVGaQiGtSr0txxwbX66EfaKO2tZc3myZdFBRQWZQrQrlITySaKlb9\nG8xeY6HuwCrL3ZNGmsMvg/+27xkH6I9a8SCg0NzRPTNTtg84bpPsXFEesJZl\nLPa/qFlddqQ5sFcnahK9psyAzWIdxt0SMSYiK8tOQGXCv4CAPmq9dePz/Fw8\nKHCh\r\n=5hzd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e5f58ba2783305fcf57392efca522fd1b8892445","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.121","@balena/jellyfish-environment":"^2.2.42","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.5","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.138-renovate-eslint-config-standard-16-x-e5f58ba2783305fcf57392efca522fd1b8892445_1604137064486_0.3707874871711516","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.138-renovate-non-major-bd262dc7f7f4370c46ea39c63de0188e0b314d60":{"name":"@balena/jellyfish-metrics","version":"0.0.138-renovate-non-major-bd262dc7f7f4370c46ea39c63de0188e0b314d60","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.138-renovate-non-major-bd262dc7f7f4370c46ea39c63de0188e0b314d60","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"df2a05f5306ec1657ad3979f894b6383449a8ef7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.138-renovate-non-major-bd262dc7f7f4370c46ea39c63de0188e0b314d60.tgz","fileCount":16,"integrity":"sha512-DTCao8bpQuQeOdHIHFAKl59+sJOj9j72FI3m78EKEm2h3EYaT6I4LEhIuTkSXl7CO7BTX5sW77zr7uhnpdC1yQ==","signatures":[{"sig":"MEUCIF1pUdFs0lEk7b7QR03PsnHnluhn5lfS/H+u/F1Ozxi9AiEA2R1rPdkVmh4AqKRVUsKI3ygzexFdYd0jESf6h+gnmuY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87729,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnWroCRA9TVsSAnZWagAAlGsP/iNjXgkZi21pB3beqNSV\np1qS9zT6F84pjBRnTEEuQRD4ea9h8fb+arFg6c94U/Vr0IdZ400etADgsu2N\nTpB45MzOwYckU1kSPPaUp++MxQBF11ydUx2K6CM0ZT1OLC9wu9oDY2/UdSir\nq5LCRMQ3XkesFEf+zZOq+YzW1vv6reGULWLP0L5Wx+PUTkPK1xDJZ7li8MTJ\nyfk4dP72PVUeWHov4MV2CbYRk4xvs9cOvzu6CNDgtDFiZITpgJ4ZFuGPH2ex\nPFJifDIEuu4u2v/cwNVPLwlE6zVBW/yRSZ8QbMd3oUlpEQ3n/AUJtrAXuWna\nAkMLQHmz9uEbAR3khbI8vv2jyZDInt2lQrmdmwoF11FJw7HOUoImEmIHwH6s\nLzjUSlL3LwQ/biThudLDd2Oi8yDSPGGW7xqDxd9aLQgV1DL0YgSXKPKpHJM4\nI0zVdnp3vZmgOfdULTkfc+2lWaJSGkju6yzZQSlrGsPxfmPbOy3oKn5vpS6b\n0JU7VkC3uHFiFqsS/Q9QREvOhfYhRMXTukewrTn4G0krRttBKDtXW5ggRvDj\nqQJkwcn6jew406zVlbKHVnZuccBJQFDMB53VW5zRcZGcB2sVaK0W1B8oGCQH\n4F2kOQUCancRM4Wb9xt5615QAN1K2bkhJ/KK0wHlEbWnWG0mcVsT5CJwE/yp\ncysG\r\n=rpoj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"bd262dc7f7f4370c46ea39c63de0188e0b314d60","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.121","@balena/jellyfish-environment":"^2.2.43","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.5","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^15.0.1","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.138-renovate-non-major-bd262dc7f7f4370c46ea39c63de0188e0b314d60_1604152040041_0.09585848883506154","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.138":{"name":"@balena/jellyfish-metrics","version":"0.0.138","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.138","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"591477a38334bad609d10d11a3265936990f7270","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.138.tgz","fileCount":16,"integrity":"sha512-ic9OOSYsiQCMXo0DUKiNZOsut2MkIcT8LfSYlnnvxVN3Bw4qgb9D5mgrTYNDa8bItdUB5rCZ/vm07Bww4Y7NUw==","signatures":[{"sig":"MEQCIDKD05XR/M1XpWhMcSjTXgK3WPbIRlf/RQC/dtBM3TXUAiAdSCOYSI0VAZB+LirAi1hQAHfeArziTrucHkLOU3BnUQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87669,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnWuMCRA9TVsSAnZWagAAXqMQAJL2/5Go0o0rL4qwL3eS\nQYnXf6nQCO48EqzTaPTnKhnt2AV3jg0hLwfaT2qD6tuAVupzjK0zZSXyMlud\nMWIeaEzRdTX/U90LzXlSpsn+3puIUFeTCuqfuSaPfGI/rjpA6vg5ctTpWb4l\nHn6gGSVp1dqZ39W+gf9vJ1ePsYUwo0zaUrDWq8nTgGrL0BKqj09Ybqde0QcF\nQFwP9RESrSt52kiulLPI+ZqpMRDD7CxGJ+EVztjvUXfgkulIhlifq3VWpBk0\nNgsb308cqSB0lMUl21/6LsSbdPqXc4dU1flmg00g3jjq8wUNBoSK32NUzKde\n6niGUZsM0BmzUeJJV1pO6k6l7maIgWXUzgJWJ1Nv+De+Zhy8yFWLTcJ38pip\ngrjVd4Q3qIT87nOUvJpCtOSPJAIgo9VpnsngRon8nc/BjclV8d2y90buq0DD\nkuei0n3US7l+uCV2WA6W7aSHY5ZQJmQDic/SFSuVGIKGlkfLRuk0R1k+ScxY\nTTuMRNiDeQ09obmx+Qd9rsOIODvLAjc+KIIRKHsSVIil+BzU+UDvsij5ogz0\nzsyiQvuA8pcb+fQS2fzJVlHLkJmrfgt4fTVM4qx13tuXLHDisncskxCMuEhy\nYAb4HV/53fXc59MCdi5ItiAddDVuG7rnrnu4Su5ZcNq24orCxMjaaV9suqdL\nCl0p\r\n=BAkE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0789c9fc71d7818091051a6dbced5a00594a9281","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.121","@balena/jellyfish-environment":"^2.2.43","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.5","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^15.0.1","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.138_1604152203632_0.3793944036825667","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.139-renovate-eslint-config-standard-16-x-911ce5e240d3a0e64b823fc2dd84d3f3b9ecc757":{"name":"@balena/jellyfish-metrics","version":"0.0.139-renovate-eslint-config-standard-16-x-911ce5e240d3a0e64b823fc2dd84d3f3b9ecc757","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.139-renovate-eslint-config-standard-16-x-911ce5e240d3a0e64b823fc2dd84d3f3b9ecc757","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e6fc37e888393d30f077ab0d0245f3f02acd22fe","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.139-renovate-eslint-config-standard-16-x-911ce5e240d3a0e64b823fc2dd84d3f3b9ecc757.tgz","fileCount":16,"integrity":"sha512-NuLLSu+lAk7WOGL8RDQyiFHZaRLkEs1aOhCFz/QDCWNJ5yOcH7ikfbOagzW/9jdqcsX8gk7b3q6iOZ9aRq2tNA==","signatures":[{"sig":"MEYCIQDm2aSD7BmSYniOPJHNQTB1WvXnL/IQS+rFmBHXci+XOQIhAPqBfmd/gqwiiLdeeBjiNzcvamXnz1BuaRhT+RAZqAiw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87848,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnWxPCRA9TVsSAnZWagAAXnEQAJL+MMfUTcaLWT1v12zG\n5MTWjY3ff5tb/U5fpkci+kXfkf6tN+hO161gx6Rcqryfmtm7Nd7dEwVmUGE6\nxh9UheErOYlBRFycDqHo73VXuKUnAsNQufFcKbQHiu/C2s7Nmr50EmM+K+2Y\na3eGtXG6EFj4yps96ztuf5BZqNT9okFFuHJjr+dGy7ZVRzk7CVd3lBbqd6H9\nRMmpa6+RFLjEn7aR0sUhuCDeHdWhdGJeXWNr7Xp+R3DthEZ3kELW/9Sew7rO\nsTlSqOFP6osKTZOdO0lmx35dgkOXpRIBz3OpYPQZ3vKYDl4BPxxaCY19C57p\nxZ8GWZ//Hn6VRzaHbQ4wT0756V88mvRataj2Yo+T24zJq8IWgaZ+pCKVCj5P\nMHssMm58NFqeVxC25HJ+Ss8xwRAEVIEGI8hsPmZ+xnmdF8FcyBRVKNl9wb4h\nXUp4YcqK8FwKAAoUSEeWaCsixOBbKfiaTr54ncAW4b4mgbV66t1jTG2jPKb7\n/7ECISTBIlUb/Z6GUDZMLWTmMl+m2XY4kr2nFdbu4UXtcOlNCogeV4ZrH/0H\nHKWf8T4z2kUhfTLfdZB++J1ReHAuu6z1WBNDYkfHloob20gKhHx8v/9bWX8I\ntrjqxLumbu5/m6ASTdP1E9PgYaX6CoNsUo6VRXDyyUCpMW6dgq66RJHU1sgH\nh8aD\r\n=x+yt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"911ce5e240d3a0e64b823fc2dd84d3f3b9ecc757","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.121","@balena/jellyfish-environment":"^2.2.43","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.5","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.139-renovate-eslint-config-standard-16-x-911ce5e240d3a0e64b823fc2dd84d3f3b9ecc757_1604152398941_0.18754767217147927","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.139-renovate-non-major-b7960fc139f6c720a16e54d34fa1f584d4e3612b":{"name":"@balena/jellyfish-metrics","version":"0.0.139-renovate-non-major-b7960fc139f6c720a16e54d34fa1f584d4e3612b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.139-renovate-non-major-b7960fc139f6c720a16e54d34fa1f584d4e3612b","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b9705fc9c0ece133144e9eca2067e9ac46ff0dff","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.139-renovate-non-major-b7960fc139f6c720a16e54d34fa1f584d4e3612b.tgz","fileCount":16,"integrity":"sha512-9+tDN2fi1zB33f6iS1fhwkybbEfUHUlE/ULiOHFE7a38KHvZA50/E7Ol7zka+R6A1ecGoglBhXcnBI/rm3HJ6Q==","signatures":[{"sig":"MEUCIQDCL1WD0jhPvCY5/qQ5EUOz0wnTMCljbroVsiN/nWZZnAIgFH/MLCzNHwBd/uh1aS+Ja9pkinJOJ8yTSpPXmDkIxGs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87837,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnW0zCRA9TVsSAnZWagAA8hoP/A3kR71CRGCxo9HR6I4f\nMYPfNCQN4lqw6h79HB/5HYCel1JFa8vnZyeWcHDEpODjsrTiE466D8LPCoqp\n//WsM08hIobv0Tg4Eu7212KUaaXQjInlptxPktUn9x2bvoBSxKi8s1pb9ZxG\nAGZ3keu4aCjwkOE1aSVsubPW+DHu+uCa+VnB2VzuFuyaRccGvBVycKBT1GiX\n5rybrEq+PWn32Pm7HjZKKPmd3U+suspL2BLHfkpltipCIkhhfNv+vVSUkGlt\nwL/0t7HXeC5OI/qM1UeTAh7E/u8+q6WPp0yBqvlPdO0ERH4EODw+wZ+emLGI\n3ifFQwJ5SmtyZlu1BNg02lfu7K3z4bnmyVsiwCnmG14kt5EzQPi3t3p1CA7Z\nDJADpDX+Q/pVaekuybHpaXVl1bbOoeLvEbQN19brZ3m0pt/lcaPnIOctDBBO\nWlMRu0F0iGnCUFREQDQIj3OpCFPVMekVIbbRsk5LYx/YvGLGn7ldYe5MefwI\nGWEi0JM/ThVPkAOlUwvM//QEKy/r2hwe7Ecsj57JfsaMZMeqcx+CyM4FNoxY\nqdrpKqztwOSL9TpglGwrr//ewN1mvK6goWgj+fIhyE/SJiI5oiRkfTinsDtD\nz6p1a3IxVr5uazzStYYugZDlpWfCMFeUWbrUYd2YssUSGKy4dcuEApM+My3G\nkI5t\r\n=Jc6y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b7960fc139f6c720a16e54d34fa1f584d4e3612b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.122","@balena/jellyfish-environment":"^2.2.43","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.5","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^15.0.1","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.139-renovate-non-major-b7960fc139f6c720a16e54d34fa1f584d4e3612b_1604152627195_0.22430940065754856","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.139":{"name":"@balena/jellyfish-metrics","version":"0.0.139","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.139","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4ca4a506a30109e81d561444eb70a10499085208","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.139.tgz","fileCount":16,"integrity":"sha512-Y7tcAmUxbPcGZfWlQ5z8o9gw23BhcEGivgXtV0CeegQCw449XZZ7m5mhOaEYHYyNGKGvgYhvBjys+17e/CW0AQ==","signatures":[{"sig":"MEUCIGlRFnOF3hzpKtyjp6aliEwXtqL+arp9gKGCrLz4L8A5AiEA786/9862CdHMoVB5sFfAo7ym+HExh4gP7aZQ3HK7w4o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87777,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnW3wCRA9TVsSAnZWagAAlJIQAIgh8VVa8Vukah6nEvFg\nlKZ4us+AIt/aN7bI7zTC/jJFZUbx5xhgaEWSCQFWaG//GrNqKTtZgusb+x+r\nyYvPvAi0nPnNL+lJVR3a91YvCJ+XE+J+SROkbelC0/6KTcgNaommZckL91hN\nEBWFelXIMOchJIhaR8gf9aCabNKwM1MYMzAuR+HK5tXSg9zjKInByPtaWG1H\nAfjI3+x4pTfJXegn5uK3SDM25WSpecMZpXah+d1+YwcZaVtXuS3pKBzT2JN9\n8rflKJwnSqnb4E7thcQflqZYZVHiXP1ywzzTwCZI+YsG7Lpn+fYx3f7BouR6\nPhzcnCwN79eTvjGcoqUn9hWqn1PBNO+FmcAFjqXlHFzGOTEeB6Plf4G48dBd\ni+G4H55uAKcE7Vf1vOqpLdR6lgnHWDAVcCZ31loVW8L8BVcCI/c/r4A6XOOL\n51w2405sV4BOzET72yVKUNj2Uf9+q4hzDxopa/wvyoGjgPDyuwBJSK3yiuj9\nEqjNpVckO7481UImZcC3+Zup6YnqFeMcaG5/eNM/ZarwH6/3nuaONzJI/PMs\nia6PZpjDRm/2TVmJ/vLDjF0liXFY7YT2+IW5kpI8a8Z/QPyWZq7Bs5w7OPbT\nEp/5M5GGbUMT2LGaLyOi4ED/RGlxzVNCrzLQgrv1ZZJZatHbILQS4iG+y4ku\npG2E\r\n=6o9S\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5fbdd3c05d6ecf92d413900ab5ba38054ff99ff4","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.122","@balena/jellyfish-environment":"^2.2.43","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.5","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^15.0.1","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.139_1604152815993_0.5652312442090925","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.140-renovate-eslint-config-standard-16-x-0be31bd68de64b6e63e5d407f2e83ee498dd190d":{"name":"@balena/jellyfish-metrics","version":"0.0.140-renovate-eslint-config-standard-16-x-0be31bd68de64b6e63e5d407f2e83ee498dd190d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.140-renovate-eslint-config-standard-16-x-0be31bd68de64b6e63e5d407f2e83ee498dd190d","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e9ebc16ffaf0de94e336d65da4bd85f149e299fc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.140-renovate-eslint-config-standard-16-x-0be31bd68de64b6e63e5d407f2e83ee498dd190d.tgz","fileCount":16,"integrity":"sha512-KYnVHjUdblAyrkjTtrXia7tm06UouJpLLV8w0a1V/36A+H9lrNMBke/Q/clnD8bv9PeFMcHDcFIpzghml0HLWQ==","signatures":[{"sig":"MEUCIH6Nkk72f834SXugZRrz0uqo1rdeyf/z2Wa2b8Ptr5ecAiEA0jgzACRYbT15x2y62N5Iuuz+It1hBzq9Ff8Co/zBeuM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87956,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnW6YCRA9TVsSAnZWagAA3R4P/R/vABGlMEj1iiPBc3eU\nkJIprgYPYoiL4/iypUuJJMiaKcUxNfEM3TAmUUtnr/srJ7vjTDVNPgkig3cx\nUWJvs0AZQ5Xl6lqGwVOTOxeqMKbdwbQ3qpY5jBCsun4iTbtwb0FIURi8GUoY\nXGvzGkXaZBJ8wWndRvzdMF2W6wYTq3A9knKPEem++T4cAY/B/NOdi+fwifNj\noCxDk8pCvsElBbrDVh5ZhcS4vXaJWyy42DQqiEgiLtdXJI54otHY7SVxO/zM\n9+ogI/ED+Pk3VTQ3/q/cOum3zf4ic+8SRK/jwazhrdBOAblDhelmftEIF0q1\nAkAHpquK8XSFLETNrqwzvkmULciKBsP6jeK9y//bzxU8rxz7FQA1BzHed/ya\nCqVwptfwWJASS6Cy/lnZyyvpfldJMPv0Oa9ZlAmmPhwbXRaSgge1jPXKvrCy\nFh7x4HdGfIBgjB8fmNw8pnhq1vm2xrwuJFH29ok0blMU5TEk0GtNwu5LonUA\nfdfQ8iXkxuFHhh7iezxhrCFZ0HtB3ZM8LY2PNu8JU+yvjZ4K4UWgisINfTy0\n/4KUIcj8PUs7R4zKLYGCgjdbTQbbcgciAbhDexqLV0JjARsVbH0ArjrMVGmc\n5qZjHJLXizTKnQ2Jqc71eL4N/cejTpzVGzWIYK6C3waeMcgBnt6w5k9TiA2F\nEb6Y\r\n=f6Xw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0be31bd68de64b6e63e5d407f2e83ee498dd190d","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.122","@balena/jellyfish-environment":"^2.2.43","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.5","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.140-renovate-eslint-config-standard-16-x-0be31bd68de64b6e63e5d407f2e83ee498dd190d_1604152984134_0.8037976726090243","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.140-renovate-non-major-4f52da7f4d9a1b20412f5afbe4df7f929a9cff00":{"name":"@balena/jellyfish-metrics","version":"0.0.140-renovate-non-major-4f52da7f4d9a1b20412f5afbe4df7f929a9cff00","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.140-renovate-non-major-4f52da7f4d9a1b20412f5afbe4df7f929a9cff00","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7510896c7d7841699612849a110077866ae3e586","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.140-renovate-non-major-4f52da7f4d9a1b20412f5afbe4df7f929a9cff00.tgz","fileCount":16,"integrity":"sha512-UJsnjS7kJpkxfBnoSiNHe7ls714AOEv+Xz0nX9J0bszFJ0hhcQSbCP7zFHq4megjZkTq51vrpbP3+DDqUZjcgQ==","signatures":[{"sig":"MEUCIBiwYJFCw3TRjx7gSvx+GREHRrZhj7g5RDrIC1+PSsC8AiEAx/Ji3uKnuebdXaqN8Pl0O4wmFMmwmrUVicPnoIYEICs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87939,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnkfnCRA9TVsSAnZWagAAiacQAJCP2yCOB69T7OwcsOsB\nEwWnhfHvw+bF38RqCIlraQjXgN9FWTFnoCelD7aDtvTAmKMmVCsStmV8Kddt\nVQI8AjDz+6uStJ3qz2o5Metb8oiRUHTIudQI0XXOfK4xyfwo1lddOR0lLTj/\nav0Q0F38USv98uNpkWmpHKx3EqcEESWeI6Q4JkfaRaHxc3IL/VfEbc7nTCWu\nVdRAsdzHRmbvwK0/lON4K/bKnPtT3Wa1t4iC5ZG2RhU7C4Gm3pn/dZVzsmDQ\n3MWDiPZywQJ9y1HmbCSJ89aiwL/A2nFPUnx6STFiaKNg/ox4ahwL3Ivwz6UY\nmhXZN1x7WV8qXHiY+vId/ifmgq+HM1SD3ne96WB+F7EKJYjsGFu19ikQWU+Z\nT7wZ7Jk3dI9AfOC/dPzLYGeA3huT0kLoysmC0N6ed49DjV9GSQv5qCY08VJb\nt1bfmb6TSiMHbt++sYqbZcsSEOFzgIu0HtDf3gAgEc1Cs1nYZg3IIbAT5/xp\nQMh/L++td358wK2Cn0kxzBjhMKjefneRUmlx/E+luqu9D27ccvwVNCyIlhvV\n3RonLG/HoA70SjlLK7fCPQHwM56ij9SXXeSWAR5Ru+ZFIHZGkyoyh10uIi0s\nw3G9orJ7uOf0/vfp62uwM8cBfHcyGToDz175R33PHnvpNStRhdy8M3MxbtAs\njugQ\r\n=vFab\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4f52da7f4d9a1b20412f5afbe4df7f929a9cff00","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.122","@balena/jellyfish-environment":"^2.2.43","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.6","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^15.0.1","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.140-renovate-non-major-4f52da7f4d9a1b20412f5afbe4df7f929a9cff00_1604208614634_0.7980631041224888","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.140":{"name":"@balena/jellyfish-metrics","version":"0.0.140","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.140","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a97641eb259c154c287a878ea0809d18eed57af5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.140.tgz","fileCount":16,"integrity":"sha512-LhGvH3EKvDFcbp1NmxEUxpanhdbYeKB927cB+X4EoKMk+QBYsDYL9gIaoe9511doHD7Drv0wI4Og9Kt7QKhKFg==","signatures":[{"sig":"MEUCIBj9nix/TECgFWiFbZTS9tMadrGgTse+Uw5mQgh71OHMAiEA3taIHUK4Jzdx/MtySyYk7WBZicohI0K7LkUp1qRUYzw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87879,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnkivCRA9TVsSAnZWagAA+64P/AyEQi7TNiDaQI7+JkNN\nmM2/g52gTduLk7sodejUedlV25TqhHaXFcRHocqvoCDuA9yQcAbmAHTciTEG\nYCYVF49EXHn5Ggp0VsG9DHZI/KybmK73+vZfP8xA+FvHZvWpfqQP0qMwjxr6\nhNhK9Wv2IZmZ5w+zaCJDqjwpJpdccCNmGnM9PMHeIhKdUKAjPHqA0kQ9VcDd\n//Glm5vpndvktYN6BcDFapAEcBkkCp71fSkcaytztiGPlSzSjtXsjTciouqb\nt+qCau930uvrEvq/BNtAwdRomkQdMS3dQl9lhKa4FZLBNOj3aHM020L8xF6r\n0o02adYuqJ/PtoMlnEgpHPST2B8ebN0ebwbEiumYfWBaIQWGOStvEsFrKN6k\nDtZl4P0hUqOeLcIY58aljao0WWQYoBYbueXBDE02WL5V4UeYIT5BzLYQlzT3\nWWIMD1YlJgKuzUCq+kM8FvNBJPCUWwY08KeBT7Lr3cQMwNb0yICHEVglSjpj\njUk8tT60It+5LFIS+Ov6KIabRA5hFTjycK8545OWNqGbSM5MvjaPflXmCwy0\neYxed8eGWGc3dQZM1QeKG6PC4uVdMKg4i9JtovKdeEvsaBmI7NMePxRkdS8x\nPfF9V8/j0mOKWJWXTj2a7JIMOPCMIpjc9z6YUwrnrZEN90FGpWi6X82ARmax\nkhzi\r\n=GoUY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"53c8ea0e48f730acbe0e0537544292dfea8997b7","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.122","@balena/jellyfish-environment":"^2.2.43","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.6","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^15.0.1","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.140_1604208815244_0.19320376452027221","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.141-renovate-eslint-config-standard-16-x-a467f086e99ba8525f1cd7c8503981e9ea0d1cf1":{"name":"@balena/jellyfish-metrics","version":"0.0.141-renovate-eslint-config-standard-16-x-a467f086e99ba8525f1cd7c8503981e9ea0d1cf1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.141-renovate-eslint-config-standard-16-x-a467f086e99ba8525f1cd7c8503981e9ea0d1cf1","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"54662c4f2e3a31f8badedc3b0126b909d6c0aaa4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.141-renovate-eslint-config-standard-16-x-a467f086e99ba8525f1cd7c8503981e9ea0d1cf1.tgz","fileCount":16,"integrity":"sha512-x3Okf+MLN2iezgt99bmaxpTA5mtBcmcxq/QSRozLvO2eFwV9W6h3G5Yx0Jg0fQMKMFNsYHdEBBd+q925pCPIKg==","signatures":[{"sig":"MEYCIQCW9aA3i1kwRtJDxuPNrf+euf3cdcCVNHB74RTwv4L6kAIhALjkj9wddqmLIwNt4Nf5OjHAG+D/pJHNXuoi0UMCWnNl","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88058,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnkmLCRA9TVsSAnZWagAAFBQQAJ5VIZUrMge9WWvs+RZT\nAX+uI3D7bpTA1+ynE9vJJZgKYAkMBySY/lBY60kixhUhUiFrBvxv7evwSQOE\nfWsLcvbVRFV1twMlZvUoofXv9e60fD1G7IYwOZS27YzTkHmaMa5Oio23aZ5a\noBF2HCXHElbti6x7YII/BNeNejgRK2u+gp++jAaIorkRqBkHim438gAHDku7\ncsUuiRMXXIRrioxJ4+0XWQ3ogVYInf/oBeft0/6dhhOjcl/V/bGcbGmntX0C\nfbgWEyJsz9uipT0AdzulENHBwhYYeVzMHWToWBA9gUAEHvG7ZRyvNQmQmqV7\nIv7F74UKdgoxphrr8aIZA84ps1gPwnlRtya6S9mklXfWd8VAq5M/kghArUf6\nOohqk09lfOPCPV5M/BWEorD8mPzlyUqZX2EE2yrGM53wUGPBj/lEmX6L9JLr\njUevALeINGumEwTD/hhAVgzD48pJtNjwmHzMwoPS0uxrwHyU9GErckXyOLhQ\nbTXwr/8PzoRFb5uEz3jVeGz+v4WkYAJZre1GXWFg/RJfO0QH6ZsSM/DBrFsG\nP22rtiTaPujAFD9zfBM0zhfVl0WJwGr4KdWvq9EWa26IG1mHTRXp9a5IPi0r\nMG9yv4rP8VoBopj2LkfyHA/E/NOSQIRo8IIuo+4w8MyeUwGyU3gq/Cg8ttxK\nMtZE\r\n=VMmZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a467f086e99ba8525f1cd7c8503981e9ea0d1cf1","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.122","@balena/jellyfish-environment":"^2.2.43","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.6","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.141-renovate-eslint-config-standard-16-x-a467f086e99ba8525f1cd7c8503981e9ea0d1cf1_1604209035302_0.0898108324212532","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.141-renovate-non-major-2bbc6add35d723218a317a0b8327883b491f700e":{"name":"@balena/jellyfish-metrics","version":"0.0.141-renovate-non-major-2bbc6add35d723218a317a0b8327883b491f700e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.141-renovate-non-major-2bbc6add35d723218a317a0b8327883b491f700e","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"97bc6a2d8cc1006ac15cbf3077b5a611f42b90fc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.141-renovate-non-major-2bbc6add35d723218a317a0b8327883b491f700e.tgz","fileCount":16,"integrity":"sha512-k/tViM7bI9npNortChM13MWtF2SkFF2o3chA+R7HlvaXt6Y214Zu/CGVGdaHVZs9lYiJosVRIUd8O3qIxZkWGw==","signatures":[{"sig":"MEUCIQDCuDo4wfX2GwGRiZx7wAHQu31nRsekENhy/SgdAupxSgIgKF9woLT+O/XATn0CWibeq9vOPgW7bkAWf6H0eyN02SU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88051,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnkpJCRA9TVsSAnZWagAAUjkP/1sgxEmFUa52vKEVHKi+\nkfzSdFaHehB3KXkDWT0Uu0iuvGv9MbL/QvyEpjJb291kHxw/iu2L5NcBnCkr\nBnrrL2O3wSkOrPZOWt99zpB7IGKLdmBzQk44gbrfpOTQZRjEu7yBebnilGRJ\n7oylzdeR/cs52tCIk9Xr2n7+eeicWb3o0KVYslSTuh+l3mpkj1pofyRx2+Mg\n0ZqGrzjt72EQJYLi6K3Bu74Ffc0Eo62fsD1wgrL7yOreYScMzcCd2MUSN01u\nwWwFzY3STgZHLZZOiWy/CD5Vg3m3oeRp40jdzL51UCfgX/ZR3h3Pb9tsFSyL\nKhPhAWq62+BTVahEwxFTVMvg2qZu+OfTnmc2QexRahPfpDOxbBIFPZD4rSQG\ne+ZHC9MUXQYivEm6+uusvTWfaSAIimehxUqVXoqQMLKf/Zs+c+ZAp8XJz8dN\nFFmY5bwBPyelUZ21GkBdrLI2UJd2ch1MU2ZOJKKG3cM7R6NczvAXyQfWSE4/\ntj2NBWQkXgfxLSRgqDyIR2kLtB4DEKv0waf1th6B4udCHA7SX7AtzJ4zcIZc\nLGefilUPcuF5A5PfFKlWGkRnkpBqB7bgjK1sloQqVfKElphRzgscVI65Jtlr\nDKUFApWCsznEeoEo+Rj8LeFOmzOx7QeSWjkzu6LTEqeEMXSUcALvfAZRwzSM\nmFrP\r\n=5JE1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2bbc6add35d723218a317a0b8327883b491f700e","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.122","@balena/jellyfish-environment":"^2.2.44","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.6","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^15.0.1","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.141-renovate-non-major-2bbc6add35d723218a317a0b8327883b491f700e_1604209225307_0.1497240722880815","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.141-renovate-non-major-974e78ad868347e51dac269a8c40f85ede9b090e":{"name":"@balena/jellyfish-metrics","version":"0.0.141-renovate-non-major-974e78ad868347e51dac269a8c40f85ede9b090e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.141-renovate-non-major-974e78ad868347e51dac269a8c40f85ede9b090e","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"af40a9b9cfdb1a93d77640b8b1bb5db9df738b18","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.141-renovate-non-major-974e78ad868347e51dac269a8c40f85ede9b090e.tgz","fileCount":16,"integrity":"sha512-exmJEN/Ef8m/2+rfZkNBDb5pYe4rt+mxTbo5E21fMDewOTlGgA53mDu2BpUhAx4VN9q/TaizLzisDt1vnrtYpw==","signatures":[{"sig":"MEYCIQDhTYbwDuJv1dLfC/gAldTfWR/JeFZlHD6PdC6vgYVkrgIhAOgwpnsHj1DrI3xXaagxFvKbXumyLwLEVu1+5L3rx2vo","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88009,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnqV0CRA9TVsSAnZWagAAlRoP/At+NdM8DdnPeNgWW9Ny\nMDUODXjg57J0K03kI/yHb6f2FhjCublxmyxQUpnDVmKxjtmXXE+clcB97PVK\nf305GTb8+P0u+FIkXGkkyFBgnDUgMBiYC2RAYW+Brl1SSizwO0OWLskwUGa1\nprM2CmZYihVCmQ68lT3oooYcfZaXR5R613wdv1XM0NgY5dnFLH5/ZdhuewUd\nLz8PiFZnQNfoLvc2u6hLM0oqfkGoTP7D/nbP8F6r8yyGv32M5yKKj1jEydhr\nV9hBJoahbj1bCd2MQN+e3iJhOW+SYXb/3Not/s3mykawhi+Jho/yWx451/ub\ngjKpfGyGHve63drUKozwSiuRi29zFugEaZGl4qKDDMOKYfZtMgG82UsiFDgb\nLzs1vT/AZfMey3XITzy4drGrWLn94MfzzustGj88QvR5AABEnL2y+/9p/pE7\ngBRWoKsIW7b44023Me9aHlvck2K6ol4ercjnFa3OEH0kR5OnHmCw7oot+REc\nry+UfSbbK7ajnjXQHJ4Ntmwms0sSNI80hUbKpp99pjhNIypZ1VSJRah4gOaY\niKI8LplO07EDPJoMZfEjpnrYLZRYdiO4Sh0fhYAFQZ74vPF2P0XEDuPCPtui\ng6FLlSwpOg0Ar1HCRGqbfzIFqm/7BJRrUKfZUjXUblcgOJVoVW9V7NYqQie6\nUTmy\r\n=/6QN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"974e78ad868347e51dac269a8c40f85ede9b090e","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.123","@balena/jellyfish-environment":"^2.2.44","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.6","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^15.0.1","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.141-renovate-non-major-974e78ad868347e51dac269a8c40f85ede9b090e_1604232564236_0.8561936765585181","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.141":{"name":"@balena/jellyfish-metrics","version":"0.0.141","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.141","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"32ddc7b25ad0098278b0ccd1b277e52b27a52559","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.141.tgz","fileCount":16,"integrity":"sha512-rdY6MdKKpmQOgUcXAcbNBivkEac7fgqA8ssARLHiECd/wFrWaRpv/N4EE/NTZKYvuvhWz7WE2cxqjwpyKkOPMw==","signatures":[{"sig":"MEUCIHHyB7HaXToGPMYjM55MJphyBCu3exihzWPl8FuemIv3AiEAxJcNR6SWnX9qWWt3EUfntYvXC6aNt3G2ph2tDWzTTws=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87949,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnqahCRA9TVsSAnZWagAArx0QAKCKgsyc9F+ByT+BPgVG\nTrpKh/ftZ2knE9wGOl/TbDWPGayZk47yz+k+gZzmhYtaJvnccpSYWRR3nyM+\nFqxh9nwWBBjiDV9DrwZ+ygqnmaJ8r8NGS9qtbA0jwJyW13DMwAG04ID3k98r\n4jkSlrBLDGyTo5BU8ryHYeBXmHiS2Gqkogg8hgKy8xZv3SBcrXa4VBZj5Ge7\nvoBMiQ5YdRorb7hlj1BnFygxaDuNSvUSBCTRDcpXGMaqEs/cKOX2f69DGm+m\nzcpLGG/Tp3DFMVyLbCzBgX4Qo1+Mxs+vspxb+OPK62yS1+Ngemr2kX83b3ul\niH3qXH4EKb05rr93klwF+nKz1g4b98wAmBeJWDcpw6clIe/Qauqdo3BOa78B\nIJOWf5mjyCPX0ljtxtwxeLNsTU5S39pGHbAk8jkWotmONYGuXaUtMUT9Tgix\nkyaPzBoSdw0ey9Cbmp6Lu5caYG5jJ5C2E5C6RmCev2QWw4dJkKvyTnmcvSu4\nObQnq/zXF3PiOAHihL+Xp4FTtT7x6PAyFnFU2rOgc/XZrS23xd4IEGgNuypR\nDKjOWpKd6qtHtuJUCfXGS7AB6bYur4ksc/8VIudarL3nYHBaIHWmJ24W0pgr\njMbI0dBViuZTFR3yyycO3rJmTGLqN08xpkeNeWXMIuoGbj9e18TI1YLIsMk7\nShPf\r\n=DaEl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4dc5c2647587f55018a3ef75b07594161f4cd899","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.123","@balena/jellyfish-environment":"^2.2.44","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.6","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^15.0.1","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.141_1604232864696_0.2260487216298277","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.141-renovate-eslint-config-standard-16-x-9efe563b456210073b8eefbf7c902f14a9b52e54":{"name":"@balena/jellyfish-metrics","version":"0.0.141-renovate-eslint-config-standard-16-x-9efe563b456210073b8eefbf7c902f14a9b52e54","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.141-renovate-eslint-config-standard-16-x-9efe563b456210073b8eefbf7c902f14a9b52e54","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8a052448adbeec7f993f83dd5f78895a060a735e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.141-renovate-eslint-config-standard-16-x-9efe563b456210073b8eefbf7c902f14a9b52e54.tgz","fileCount":16,"integrity":"sha512-ZVSVr1FFQDDlDoewi7rkRZfMwL/pUa6sFYQHCqmDVK/zSlQ2U3wXMKRvfEKdoj4is8mMDq8SqeZAzctFsUeccw==","signatures":[{"sig":"MEUCIENM6jjCEMeB8hpmlB3lX4TtNy81ZPvCaURKEltL17fgAiEA2lLPm4URlxNwfj4sXZKpJRZPS6Vsd978e6nwSXRKhJA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88099,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnqbeCRA9TVsSAnZWagAAXCcP/RSftCJqJo4jqVhgA03z\nLKkBuVJVZ0NlZzV+3klj15S4hM2q9bWEGdK3FwfZwohHvWzsR8YIpA3b9OfI\nsRkCuvjjORG1X9iSh+IjxdjfTASUyqIICBhn+MaPEiE8u00uaTaYG2xOgZYc\nzabH6WeC6XstFM+ze0Hb09GYKRbV5eeNhQPVKnalz5BUMyeVetquCxKg8Xpn\nsn7JGKZSmAIeIf+fIt8kTDtO3cJAw+TwS3I6N917qs4LQ3D7sHhMiA0Lj6XK\nWbUldnMPX6CcE225qYqvHK02LpDmX3v/wI5R0+8Lh/s9k2BscC/ZkcRt8q5j\nBICtAklZYxbhMpeEcJEKRGFOgb6yoT5ld0CPO5OO9ZkxujDvUI8GuOpVsPsh\ne7oAiHUXNobKBr0f7G/oiJAXXPl4mArJsGq2f5i04LLCpIloO7AEMGfPkDrr\ngEEQ6Yeb6lmzkG+Kopz1lh3kpVRpfzTT77p0dGm/h66uGQyppFRY7s9UsS+0\nSOJd7y0wqLaIcrBx2Vlx/ssxgNIiRYZZruu7j5/nmui9QmC/Nk6fndp70o3R\nky0SOvbq6jn1GkKJ/+WBdBHpXmrcLUZ5RYoYJXCLwS8zcES4N+hFslS8trU4\nlL6jXRCWDjTflFM5h05y6p5+o0sUbf3VjFzWT9WNevkW7SQA4q+lHaSS2PXC\nGA7L\r\n=qck8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9efe563b456210073b8eefbf7c902f14a9b52e54","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.123","@balena/jellyfish-environment":"^2.2.44","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.6","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.141-renovate-eslint-config-standard-16-x-9efe563b456210073b8eefbf7c902f14a9b52e54_1604232926068_0.6477981481756541","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.142-renovate-non-major-6142a8d43d340d51089436b4e6f517651d933788":{"name":"@balena/jellyfish-metrics","version":"0.0.142-renovate-non-major-6142a8d43d340d51089436b4e6f517651d933788","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.142-renovate-non-major-6142a8d43d340d51089436b4e6f517651d933788","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6515d802a3c7e83832e807e998a1ac665514494f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.142-renovate-non-major-6142a8d43d340d51089436b4e6f517651d933788.tgz","fileCount":16,"integrity":"sha512-OZTnMAmDsYObtv3Jz+1G5YpRS+FGbikaNVD0Y5K2mjt8uW+IcEnjOYqHFhiLPPA1FecFemh307SMmrv+AqbEmQ==","signatures":[{"sig":"MEYCIQDA9wTqLDInNlx5rlmhQQl7/CgiPq8sHOr1ZG+olTZSmgIhAOXYSBR3eU3SmqpFvhaoECvg/WfkfVHm8YFPUaQbQr70","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88117,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnqe2CRA9TVsSAnZWagAARpYQAJRiK4y3o+AEOBWUOpL0\n/4+/44+sfzaYNDJrzYuS5F8NUTOPru+M7YQrM4o5zUCI1eHaiwJS3oE/07P2\neFul+sK0TBiBMKlWeYNFA7WModpgYOe0ySaafhqoKqi/08LTUnlnBvr1Ph4k\nq6IiKD4ZkSSLxn4aIhkGchxcpNSGKtdwiqEWzj9FF6Zxpl5ik+0mOAI00w2u\n2eMlhMuEN3DzX1R7msJh12+lHS6extDKPErjBXRidgIvrVHYlv9lDNilic8u\nX6rdyweX/Y85Y29w5cLxqSq5PK3oo1uz//PiVe4V8bwdS4qvGc04l4OaaI7m\ngaN7A9BO37VyV5m7xP9+mra9XYN6BCYPfbzU37slklEPP2pGkYjSlA6jubLR\n/wH8jcbQtsc1tFTuiuChNdQwndj5tKcyt3g2iCQ44AApV9gjFNP6ZF1c1MdS\n2hmlduwLwARrOuxTCrggD/66SyM2yetzO6ud/NugFys6UK0PgSYIw9MwKwzH\nx49qrOTHQWQdK9BqLwUm26NmYyFSrqrDTjRO5EFkUkgoyAH9VK4Oduo+D6Pq\nNKAJ8WWF4fDqB17mIAxLAKKU8ueDPi3zsA4UicHoIXXAN+PTeQs/IOtYUDZ+\nvXw4/TBm41ryT+sTuK+aUO+l/vTSd6x/0HnP/3D9Zs5eUy1lhbdmAMdRkqe7\nmT/f\r\n=P31D\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6142a8d43d340d51089436b4e6f517651d933788","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.124","@balena/jellyfish-environment":"^2.2.44","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.6","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^15.0.1","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.142-renovate-non-major-6142a8d43d340d51089436b4e6f517651d933788_1604233141916_0.3103757405721772","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.142-renovate-eslint-config-standard-16-x-63901991bed9301693fc3ef750d0691e64c61c83":{"name":"@balena/jellyfish-metrics","version":"0.0.142-renovate-eslint-config-standard-16-x-63901991bed9301693fc3ef750d0691e64c61c83","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.142-renovate-eslint-config-standard-16-x-63901991bed9301693fc3ef750d0691e64c61c83","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bc30c97ca9363549688cb2a8138a564087665d9a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.142-renovate-eslint-config-standard-16-x-63901991bed9301693fc3ef750d0691e64c61c83.tgz","fileCount":16,"integrity":"sha512-7VVhKK8I/7kEE4EiXJKKJzPYyPYz+u83NFN/6S/o1ziDkIhPFafX3bgdX7iu/sa1oZRt/wJyoZRniC1Y2yTgRw==","signatures":[{"sig":"MEQCIGeWNFHnqYFEvEcoyFAOTfa0L8l4uCu6+ukdXWU8g9txAiBW2M9B7rZU2Y7a1vjt1RMKE8w9rFCeAiIBO1s0fSNKCw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88128,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnqfqCRA9TVsSAnZWagAAyqIP/2Uj/21V6Xkii3ON5bQa\n/buPlZUwWrxhWxCVXFWqpTk5O/KZqrZsSJ3Oihjo2JYuamuP3UkMfa3cwUKQ\nPRb1RfJnNTo/qgF0k80Gy6Eq101EXnDQBNfyqaYxqqgYcWP2VLQUHwoO2cwB\nhflRLJiTM4jI94IODeok7MJVytHRxGFUZuMeqFsAZx/rsBLiqA4E0M0bAqOD\nbIrHfk8CWh5jKfjk5FyEhmFstcUgv+dr3m4O6H20jVQNTnIm71D43CKZyDAf\nwXkJdtOlJ/LZNsosVffAAULPrkQKDiKGrRHzANhTc6eyy1bSI1RIH8AsJFxZ\nJqsCFAEQ18F4xXbxJedL/rW8zUZqamWun/sP/aTTuRGb3QynGm+IRQpaW3v0\nwWzh0l1XTLf+kVmone8wknLbRazBB4l4S8WDAyheqx8crvS9J+dZXlQXPVx1\nvPhSK6lFMQKuyUGq3Bwm8uv+aXokYhqWFq0xtLjTM9358RlhLtmh6Sth8mWt\nonqJ1C/aygX94lD/xKy9UY3GQS5UfEfDiUaAgJViK5Lcag3tT3vdC+hg4h5F\nxuqfUg1tQABvVEKEmMRvMrq9/CTYLMZDvmojygAZv5i6bCez2QwjYxLhAlPx\nHENqwNx7B3PBeFCtTURmpd3vGDdpeHjNj7uFoewONGun5lH/tF2i1Pjs723O\nPoij\r\n=08eR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"63901991bed9301693fc3ef750d0691e64c61c83","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.123","@balena/jellyfish-environment":"^2.2.44","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.6","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.142-renovate-eslint-config-standard-16-x-63901991bed9301693fc3ef750d0691e64c61c83_1604233193882_0.34165137499221787","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.142":{"name":"@balena/jellyfish-metrics","version":"0.0.142","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.142","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5a02f4a950b147e48322912b6c125c00d831a0f0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.142.tgz","fileCount":16,"integrity":"sha512-7TJKM1jURb8aq8Iy0iWy6WiL50WwVQ4eJ3R7bJvYcsXiH+sdeG0FX95x6/SRROrQ0lwbtC1asJRfWqNdcD0aLw==","signatures":[{"sig":"MEQCIEgDZ3KHUI+M1CG8pPExHITIg9HEUjroZ27IzVDpXi29AiB5EDBcMFR3EhKWKPaEhi69OMgCL/LnxsUXyCyb7HQD+w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88057,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnqhkCRA9TVsSAnZWagAAyWwQAJz/f1bG24IV4jVX8Zlc\nhDpmid3s02fKUOex9AaZJwO5M7IUxPvXdWCGZSWKzzDuilyijBQ52IRd1uu4\ndfbONmb5pM4Ku2yzYcZcgUBIvSD4T0CBNyLYC5+GC9EtW/uWbYZBD8hFXUXJ\nT+U39B9uEfiZOQOmGsKD5GxDVwHuXb6LvsgAn0bOgLwJ4RHiBIOU0eZLAeND\n5Ffz0u3gfb4vDByGl6ibJeZI5jLbsx2Ltp8TWCAcwOscPBXI3x8ZJHIB36dm\nD2yoXAiLKCX0UiXjucsidpFmKj8sik+UewAeCwEsnq8l5UxsXtWIOmog7xWL\namFTkdQXk0AeEEkmCJy+LwAMT7q/hgsfDAvWHVtOCI+TGscGeF4APM0BJbxk\nLY9dPIyw7HhhPq0OWZIUZnMC/3DZIJpXgL12cxwrRcEQnYm0OZDcACmxEXtE\n8tleD19u0y0jYp78VWjimTzovbfbciSD7F5G1lrzcZqGJ6GtIPmWyBDWrEjf\nco89IW8DuVUVoH19dF2GQSdJMd0oupbpcHV/yGQo/X2vThi9ChEkCdbTbX7p\nWITxQrN+4Bnt6XVviNAC9qdW03TrwNR05k4DnDturwzhh9DVcFaTsJAw14fB\n6TbIvOecowHJxo34dllbvZDYg6qUot9ZuZzg/l79+ltXCxgvf7GppmjfAgVa\n+nnN\r\n=C74k\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"48b0d7e4bf15dbba89f4dcc2a00ba3609a7db6ed","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.124","@balena/jellyfish-environment":"^2.2.44","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.6","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^15.0.1","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.142_1604233316361_0.16134458087305137","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.143-renovate-eslint-config-standard-16-x-a332fa07163a5594b9af9edb045c7be8c4c7c7d9":{"name":"@balena/jellyfish-metrics","version":"0.0.143-renovate-eslint-config-standard-16-x-a332fa07163a5594b9af9edb045c7be8c4c7c7d9","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.143-renovate-eslint-config-standard-16-x-a332fa07163a5594b9af9edb045c7be8c4c7c7d9","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a6bd91378606048e50dfa1153481811da4c04dc3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.143-renovate-eslint-config-standard-16-x-a332fa07163a5594b9af9edb045c7be8c4c7c7d9.tgz","fileCount":16,"integrity":"sha512-y0Yp61rfQF6+LcSGw32pvKlofevt16uekFaJVEIffp+kmxBvl2qbtH2H7CIHbbRy9k1fun0713XkS+9yM+3ffg==","signatures":[{"sig":"MEQCIFCjkp0a8Jb6WLbL8C43El0kELS6ApxFTg4ooLi08F/VAiBrsFf6MdruH626l0iN3ggQd6v9mCyk2VVlzGb7G2poEg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88236,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnqkFCRA9TVsSAnZWagAAW2AP+wc/A6KZwnqx5CLNb1oO\nrYgoraED2GUTvTYejzpNPmAgUqOz81qSFw7XlJx0sfnzwUOHnq3no6ud+IiU\nZ0kK8WWei7F+JjICKLLOJDscJDczAHkVgp6FuABTa2y0zdPB7b3kphgr6tiY\nxNLbzG7WGEM2s0TFer5lenIjccJspfGuHNqH3idoqizh+hf1LIl9TlIEOg2M\nwmXkNs5f6DvVJXLdwchDH4NROzVis6uDWK6Hy2ma7ilkRo5u6S/xAk13pFX+\nStlmWHYVGKQYBC4ZSFfDyy7GKwvGSkhnQ4KNJa4v94QA67IfOfUo/cfLGZxP\n+ZMl/NGbTbwNWPxQQe48vL+kJp4YDlAe9JMDI+LkpMkFFwTLZvJsBi7PoQk7\nplSfDibmGrSH1fCMGX9EOS1kUBnRUFaclbEKY75xgedsRUim/QN9DAbKEtEA\nfMfK8b6nIARIVaSeFYHCtDHOWhqbE7tEXae7qHSXs/XUnWJZ8uC1lhRdUIfl\n+v2TCjmM6ssxZb8p2xHdjFiGyMuyY/wGt6dk0CIbaJJ6B+KYoIbV///wPYE2\nNgO/xrSDMHIpApUeQNJPtdAmG4RPpploEMRzkJ7jJXi7jgOrD+eSSMHj7VPs\nHNx8gVE0j/mnTMZjgNo93E3F8QQFwiLEgpxDsXGquTVeIB462zYqFn6p78zU\n2vwe\r\n=AWMY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a332fa07163a5594b9af9edb045c7be8c4c7c7d9","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.124","@balena/jellyfish-environment":"^2.2.44","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.6","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1","eslint-plugin-standard":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.143-renovate-eslint-config-standard-16-x-a332fa07163a5594b9af9edb045c7be8c4c7c7d9_1604233477547_0.15892992048249588","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.143-renovate-eslint-config-standard-16-x-b506e1e8c461e3ef25e36d9ec5be77acb17f46ed":{"name":"@balena/jellyfish-metrics","version":"0.0.143-renovate-eslint-config-standard-16-x-b506e1e8c461e3ef25e36d9ec5be77acb17f46ed","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.143-renovate-eslint-config-standard-16-x-b506e1e8c461e3ef25e36d9ec5be77acb17f46ed","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d0af72b2b3d453d7f1322333e69aea4bd4eeead3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.143-renovate-eslint-config-standard-16-x-b506e1e8c461e3ef25e36d9ec5be77acb17f46ed.tgz","fileCount":16,"integrity":"sha512-S7hv7b7Wbbs1KTb4tpEidhf4Jvux/Q8mxH7jFc5jW3FFPOAga7RpVixB5mri5/BITK1kDwTp7SidMZnZnTI5fQ==","signatures":[{"sig":"MEUCIQCiUDdsvBwYdmicu2rhYbWH4NpEf7h3y6nlAAGi3W42CAIgWTT80IwF03QD179nwog3Rb4ZssbPr7+aV6yxufxfdTE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88243,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfn5WmCRA9TVsSAnZWagAAXlYP/3wnJGvhjb3vFFOA8yUD\nOFDRGVr0EWBciRurZySt4DExhF6XSpvFDxNXdA/MIOdceL0F5SoHRHDQ5qCQ\nmFibctMP5jUdnD+cdnaa4Yjv9WikxJiu5B5qoi/YCIlqeoq9NB1CM9r70/5G\nNJ1yJTCrXLSI8ZJRTVxKmp1V37RYKd99Z8tDrujpXD8eI5WdGyfyyCti8Jz5\nZxlQPrBbY3Q1gj1o/kQa6IDlIJ+sN60fSg6r04CZueH1Y564Qj3fOdPLqsGY\n1rM5Ap8JnVQP7rwezmvjT3rtFebveC/rsnvVl9N/hCdLY08X+i27HYqshGCW\nYZmqJDAmU++psyX97n1jHTI20CEY8VCBHd/JD6hx5+RL1nEd5+N6RCc/lnZg\nRQKyJmlTFkleVraFKlK/YWRC3x2F7r9v1Twds7ezr1gjZjggaLM4n9PxqsUt\nQBJY4Ss43ea5/gWp61Xvl63ZyG49q4a4A+vMAMUWin5dejbwo4/tiZvxa+29\n05ZL6BKkk727/YzubTXRkQJ7d+C6GPUnWN14DV5eTYIbXi3H+YhI2AyP9/fh\n6zOGPetD2x4DNE5N+coHz/oR5q7hCI22k8K1pYAWXmvkXdmuW/zPPS4iC3tF\nSEpB+AzbkF75BJdPU+Y8HJ1+z4SB+hBGZshJC4pGSDpmMkJAIXOZFkTm49UA\nMyKh\r\n=vksP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b506e1e8c461e3ef25e36d9ec5be77acb17f46ed","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.124","@balena/jellyfish-environment":"^2.2.44","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.6","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.143-renovate-eslint-config-standard-16-x-b506e1e8c461e3ef25e36d9ec5be77acb17f46ed_1604294054044_0.45448337608299894","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.143":{"name":"@balena/jellyfish-metrics","version":"0.0.143","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.143","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8af0dd97d4a513f97cc078f7187fab60c18915c2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.143.tgz","fileCount":16,"integrity":"sha512-yxVObFBVjLQa4D0oLLGB2pBc/Ytnh8K1fWL45tabC3iNycdDf3UjRAXw3f6mwSarAexpjDDLCc9h13KesjrP9Q==","signatures":[{"sig":"MEQCIH8loY2t4DF5Cr0LOMcPIurtZ2ryNk/JF12SaTio6Q1hAiB/xHluKMGtOJyJDJQYXUWdMeRA7DFZAgUB87zviUGJ5w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88165,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfn5fzCRA9TVsSAnZWagAA64MQAJKfR4QOpZS/SI0a6cIn\naZXQ2lZHeFznc9RAqlmKcxihylr58fqryO81lLsixZdQ7pFTyJatr0AB/WpM\nkyX2uJTSBelLSFsQY/Op1NsubXNMGHGgtO9KInqLfwnusEUadzmzMJVirU8m\nkLnX3VhHhdpQBViLO47snfEgcuX5qldaao/Htd+to44sfLXob3FAE5lAlnfB\nyKss8X4UaXOLTxM2uGYy3Mu7pIdHKUuYR54bTh+9OpdwrC0vO7MPnTwSxIAR\n8PvXIv7+KpuRiuvmTC3m6WVL7S8ciAYUYjlIl+WT9XIEh1Zmpusp5sbHTl8z\n4lDHtiOkYQhKOzekerzJMxALvx7GnhcVBiizVWDw27qeudNXvCMnaC0kH3RB\nVABDSBbsfI9uVhz5qJ4hc1v9pJ44CsH1ZES8TLrO1tnvG8PYGEu08980ohvG\ntRQO6WcG5u06lcOCLt7k5bllIRo8CBYNhdHAJ2/C0wuoRxnQMEKM2aOoETM5\nsWGn6oDfDsKGUWtCkWbD6GacMbkLe29WYzKo1FyaksP8q1FSPRIWsK2nq1nV\nmFqUAVPCCVQ5mBT+Eb1ja+TMEN4SxKCQu7IFggpFENvOMBIjOEAUs1GpEWIH\nzCDdzY+7AnyXwq/5QkYUzqRi4F9CP8AfivZLnyZ54R9TsMA5OL/POkcoEdG8\njAve\r\n=1eoi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"88536d5502220b561057ac914781d64120d6812a","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.124","@balena/jellyfish-environment":"^2.2.44","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.6","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.143_1604294642834_0.7626153179190629","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.144-renovate-non-major-5d04190412bd67e4c378cdf33698a1d5eee6eead":{"name":"@balena/jellyfish-metrics","version":"0.0.144-renovate-non-major-5d04190412bd67e4c378cdf33698a1d5eee6eead","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.144-renovate-non-major-5d04190412bd67e4c378cdf33698a1d5eee6eead","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1f392e09c36caa08259e685ec2de6c868a2f6924","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.144-renovate-non-major-5d04190412bd67e4c378cdf33698a1d5eee6eead.tgz","fileCount":16,"integrity":"sha512-jh4F7J8rQtGZ9CMe8wWduLYNxmZoO5geQpAwjWOzDbCXM4g0IJRJ51jacYcJKdsztnEKJD8pz7/6SPXe5ovsKg==","signatures":[{"sig":"MEUCIGVg9VQEMn0Oh1cnWjfjms6YzeskO0xE1aLlDJrU1spHAiEA6mv/DWgIUPu+CHg1xVEmbcxC4XcE83mdV48lwyQ+I9A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88295,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfn5ksCRA9TVsSAnZWagAAzNgP/1hXPz91D9ODsEQl5YX9\nBpyFBvg69fWOiDq+rzGAa7/AT6Uk9+LW0TRPz2T+61TwIcVC/Wx9aN408UWO\n2wWZnuEKK3oWqmK4nzEtam+5NGY10HbNy/yHfClIRz/U16YM7mSMA2yICzBu\na7exci7BOgWmw0Wn6eayPFWar5t36EwRSsJDBr82QLzDBmM+vzqJilw4apUF\nhxr00xjkoPkFagqAIsYwODuE8DOoN9OAHWpqlsGVS4K/8w47RjgGSvm3ly+u\nq0HitiIVO9Rgu6FDu3zPMtt0rJhFhCMqJ/b2ySV3fF7u5816YuWdDJQNfqiI\nc3/zSO52YmyiD04H3sje+C03Ut+hvShdYeAF8CAcPSHjJh0qYAFHeQ/el44k\nYkft9/aQRJ92JGKg8hzloN9/GCffBQHRlLU3RWhF4AecpZju52EUfAgfiiNl\nVJuoleEru6Fxo91fVAYAqHz7LmfA7YYRLdY6eV1QjBbrWYqEN9m0np6TdYU/\nF4WyK9/coR0AHnS9EpnK6dmLjpoJoNpL16ZlAY//Kr/GQyOdO0AeOaHjIFcf\nuzKbxlzHI5gnQwKxXkEM7XHmCJiM3UPLVqE4jd61ZLJ4z3WgAMrt8jDzrbPk\nJVnPETfiqvThEdJhmkBPcO611KQb8MDkw21p4jqhCum/REQXuHiRJV76NxFI\nRpuO\r\n=n1i1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5d04190412bd67e4c378cdf33698a1d5eee6eead","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.125","@balena/jellyfish-environment":"^2.2.45","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.6","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.144-renovate-non-major-5d04190412bd67e4c378cdf33698a1d5eee6eead_1604294955693_0.47923157364021396","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.144":{"name":"@balena/jellyfish-metrics","version":"0.0.144","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.144","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fc0db9055cb19ac3f17b8d0a04d23c75f53eee18","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.144.tgz","fileCount":16,"integrity":"sha512-YvgSJs1t9tOML/GKCuxW4wXgT56hxygNScSPdmv8Ykpm5bV46wu0zAKQ2l+0dM05f0LAVqHsV1CRm61nqs2Qpg==","signatures":[{"sig":"MEUCIE0UOP5Te73qQSFxI2YVkVtZQ25Jv5Fmy0i8MVLPdbiuAiEAiWNWu94H2kHzo3P92EIwwgQ31igWHWBUEGg/Vzb2Th4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88235,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfn5pzCRA9TVsSAnZWagAAaX4P/RjUw0+THPCQ14IEz5iE\nVTdegZpmlj7+v+JjJQvkEyCuLlCogwhvJw/2zTUY4rxToKoA/AJGtaJ+fv2V\n9Qr8rwrlh03q2IrKN2wDUXUw7YvD9D5mVHbd0jsJsqSiREBzpfoqogKmTuB3\nyCJE/7Yvch+NcrSvizxa1z0ORE041UDHKD6j4Z3nH3zTFodwRU0/s9j27lBA\n5QwUKP421a+wg/DiDefjkZe6wMCY/QSjVtBJL7G/+Iks8JkpaVmh3Mk1yQ3e\neLjNNTKnar50/ahHtE7kvZ608wu4rEhtE0gFKTXz+TaiEgh3PAgWKiF71uHw\nYBe9eVUVdhHJLNe/eQIyONdNW9e3+McUwXEeAQjUN7HiixIpqrEdZXr3ktWy\nNuYQ0ZpA/+jfHNxNRHL4WPFBcoeMASvLM05pp8il7oOaqKcfIxG37bRrvOAY\nlZRe8XMrL90Pft+RR8zUTrVyhqtx1LQmwlOPae1TxV0RsxFhS+VOX11213wt\nI/97HVSddJZ2/4uPPXFIGtHyVCA/MYNSXnQR4OcRV3TrP1HEXCNjfponluCw\nrd/T022TcSDpasBYYtVSTJ1Cm2vhxc9Z+xI2ZPEvYIx57XGm5AZTcg9kuUbx\nzcOdA8NcyU8VfyZ6yk8EpMuZxG6UNo5l/hBYoMCavJs4vL3xFCBhqVJBcYQP\nIbwU\r\n=8SWi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"47f0adae8cc72cc6791ae858ea1dcff5e2942200","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.125","@balena/jellyfish-environment":"^2.2.45","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.6","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.144_1604295282730_0.18349636197196229","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.145-renovate-non-major-2080b7310cfcb9b6d5a437d5f04ff3f3458929ef":{"name":"@balena/jellyfish-metrics","version":"0.0.145-renovate-non-major-2080b7310cfcb9b6d5a437d5f04ff3f3458929ef","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.145-renovate-non-major-2080b7310cfcb9b6d5a437d5f04ff3f3458929ef","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fb5f256b6645348518ec5512fd85eff273e4440f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.145-renovate-non-major-2080b7310cfcb9b6d5a437d5f04ff3f3458929ef.tgz","fileCount":16,"integrity":"sha512-c/D3gnyKOFrEkWRd8HFRiSGitPyXPFW/hAdmcMQjK/Xdj8XiwOhX/LZKMvPdL30Pg5K1gpIQfPNcY8Vua1WDrw==","signatures":[{"sig":"MEYCIQC//l+4TPlxm269cIv2KqON/ZFn6ISSMB/FNKOoQzcEtwIhAMaAThsCGPfUgJCTCXJa0pdzrC8Hv3zyYWhq75BNOzwO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88403,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfn7nrCRA9TVsSAnZWagAA+5sP/0wa21IA53Wk4OmoL8EG\nNCPhH68R3ncSCMVsu0PuMukFRnCiyiXAjGJOxfaAZLrJqtVUU432SxhlR/8t\n4IeFEgL95ylzkWcOG/r9leetYAAHQGpEq+LQK+3y3C6eiPPcmlCaVmoD4YZZ\n/rTW09rmGXCAoStICmKUEjh3vTNHuI3Sbsd7JbLPz7qzIpBLr/YbBxHOlK4K\nK6WFR6ZQ7aeR0kw9OsHyhYawXiqftikCCm5TmTqWR2OWz5LE/Z8xRq1EjW7K\nFV7E+YnvwbfA6nW03svbbQj8IsEknwnlIJWfqM1DBfIL11ZPo8UfGUwVSxTs\n4DglyiCVmNvST4D78bkN+LgPAenkBaU0HSJiU/qtGZKcnwOQy/SALT2ywoYE\nveJRvVzHByCzLhfAUKz3f4oD6V961UhFBobPtUwHerGM71vwQjRo8lADSZiW\nREjshx8WoO59YMtHAbBWTzjv25rj8y2MtwLn7thEtLgaV7KlfmXxPLHSb/80\nOrYhKhoUlyuAOi/Ckh7+8swIp6iIgwCAzsrmV/wTTvQQNQgXVO1J1Tg1LNJX\nm6orszRSDre05GLpzaG6l6DlBQZWEp5InbJe84TN17Xaq+kuM728/DNMiblh\nCURz14TEYMl9EtDQpi9/MeFIb7btV7cyJwuNjWe06b2FOva2wCXqgs8cNJd5\nJ7l2\r\n=C8hL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2080b7310cfcb9b6d5a437d5f04ff3f3458929ef","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.126","@balena/jellyfish-environment":"^2.2.45","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.6","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.145-renovate-non-major-2080b7310cfcb9b6d5a437d5f04ff3f3458929ef_1604303339153_0.5682158432242299","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.145":{"name":"@balena/jellyfish-metrics","version":"0.0.145","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.145","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"39c2056cf5158b279272802e5d682bd9c23b4c1e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.145.tgz","fileCount":16,"integrity":"sha512-16kdkO41NJEH1BiorGoGbYOJc0ywb7xFHKbiU5JFCY+7kD+Cb/TTjj0w4yJyE3CWHXzt54s8tnwUoHjFrXyeiA==","signatures":[{"sig":"MEQCIAqcTHSpmhQxlQZrCfmVpUWP0PQMGEfoHqB3/fTVPknLAiAiHIXtTe1ls5jrReCyihkTierJzqQX8DDgHgLe8RyK3g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfn7qvCRA9TVsSAnZWagAACBIP/iLtrehJ44V7fW2OkUAb\nswhfgzG7O7+HmV4PG0F33mVYXm2cCmAScidIQZ1NmiRkXgF5wkqBvPxHneD2\n/XhgXeD3LL3kxn2fvn/jsBqFSStX+dtz3QPGDRvNg+XV0rKewiMuKJ6K1kyJ\npQ4xy7V7xQ1KvECh1QU/FgbP3fjbiFpo5yIZhHkW+KWQ3GayAGeXjVhQ2Y75\n5M6XkNP2FIMbAs29N/xs2uzBzztBR8dIwciyUcR8d7whjOANVH16uvcNFTp4\ntGx7rMDhKF99SS8bGsvE/u9VjL55orsWzRN3Jgnbzv8bdds4bm6CJ61sG7HP\n74Hxh9fVTHusvCu/JAdYhhFFR+p9xCqCZMnJiC380M9+fL4StcD1mAjEu8CT\nMPW0Pz2PWgyECN6RufOWPvKrxl9CQKe6F34Vn2SwmbZrXuybqXV7xULSpdHA\ntHE7rgzlH1eIfbnqrTFMsCf7kYCjR6wyEvUyArxKO0IQHJnfqufjHX3qFjbG\nmxvRn02XdcYLidVj3DKaAToQQH3zakhjdX3w4xGygH6ibiGgohqFX8m6+SwZ\nupZswvx0Po8bW1o7cP0w7oLlrnBBZtZbkVXpf6mUECOTmS3jKHXhA3FhJHp5\nZraeYYKj/yIAsKbui1Eb4JFJ0W8DeXydbWX7dU9LvGcqLLl/4SVt5cZ+GKyB\n17Tr\r\n=6ci4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e983e0191a75f57a38de9e8a441f4b631a7ff4b0","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.126","@balena/jellyfish-environment":"^2.2.45","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.6","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.145_1604303535234_0.6412925077006457","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.146-renovate-non-major-eeea3aaafb97443663355f7eaa4d72840367fdd5":{"name":"@balena/jellyfish-metrics","version":"0.0.146-renovate-non-major-eeea3aaafb97443663355f7eaa4d72840367fdd5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.146-renovate-non-major-eeea3aaafb97443663355f7eaa4d72840367fdd5","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"66d2105845bacfad47e03206f8d81f7fc496ef10","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.146-renovate-non-major-eeea3aaafb97443663355f7eaa4d72840367fdd5.tgz","fileCount":16,"integrity":"sha512-599q9avz4M20FxSUm5ygijKAPm6/Q9j2ZarUoeXT3at7VehkMcWr36KliBkbTdtTN7TwR2YjkF5jmYel2iBdsQ==","signatures":[{"sig":"MEUCIDWtlWUtu6c/LrSUiORcZde1DIXCPOkznHHubS/21za2AiEAzDNrv2aNMrbZtDA0jkRu6jAz9qXwQjsEdisuLiL8FT4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88511,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoDBTCRA9TVsSAnZWagAA2MMP/3LsSTXwHNWz0e1vuN1B\n+qCTNdphpFyeVoZXOVR+lQQwPf7iFFqVj0XrfpaAcjOsrRzZRfbv10zYtKds\nVu7fMkEVxYlPGNtUfdUO/Q12m/6T4I6B4vASezYGVDS8mRq5pg+ptqoRGEpL\nPQ2ETtRE1ghNft3bv0hTsIloAc9Q1Ez94TttmCN8X9T/g7oeoRpO5v0Pa037\nMrnqiB+OaykqqWSo33qqZQNhl7QAl7obyUlmjpDKWM86qjvbkCa2PItQyUv4\nLaKyjNkOv8VvT4srzHX8uHemxG4ZH75ikR+9uz9HRSt7a1fOIlstIZSXc2Qy\n4CWR1N5oruIxUTDvMV5/f3R12KbURnNbpL4B6W/q0TzKlVeI6UY+kTEBkWSE\n76SlXBJnY49pVohHALtoaJXcYTeUzyUbuw7VUbvXeRfhj0HSssoxa4oKq5Kt\nKascmhQONy+RJi9/qXuVDIBLvYF5+UlvASW69RyVGeyI0GlyyyH27DZZiLr6\nbhO/K+IAchBh76J7LD6iNIE1RFgldNnKsXLZ4ZeZb0KMzQ6xVor+yPkaF2/5\nXiug73OLf+wobRFhtIIQxAPkSbJuUBS1LxA+t/5LAzJ3uEBfPfbneB1Q6UCA\n99SuO2h3iBW3GI75KNq1cqgay9+SJwtNBlt/12u4Syfar2n3QNC8NyEwgXGt\nUpcz\r\n=hqso\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"eeea3aaafb97443663355f7eaa4d72840367fdd5","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.127","@balena/jellyfish-environment":"^2.2.45","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.6","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.146-renovate-non-major-eeea3aaafb97443663355f7eaa4d72840367fdd5_1604333650689_0.26145779822794557","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.146":{"name":"@balena/jellyfish-metrics","version":"0.0.146","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.146","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9508930e136316b4aa4d2b19f03903cda77986af","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.146.tgz","fileCount":16,"integrity":"sha512-GT9mFhfHqyepLBUfP0dJWTiHkyEd0uUI8R1xnWDdqdJw4cYc8P4KsGWDagvx8fDvH+yiBtkbsheULnPafN8QXA==","signatures":[{"sig":"MEUCIQCjbPHEWAOgitfuRFvOOjvWejGMvWVZBsh7Buvzm1RJZQIgHbbJ3BhtpWxkTxRWKcfIdWbjSkJle0e4t1okk1IzGm4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88451,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoDEWCRA9TVsSAnZWagAAZfAQAJxTo7aUUrK5rRqWuUdW\nByKx0pdqbOrxzXadm29khj/9abAKwNkdtFybXS2WnlQQcsM0svlww5Ygusps\nzVrBbwppcDj2mAqK05gPb+nOVA4GYxjBXH/n2J/TyzzG5tjjhSmYyiGxeY4n\nfLw7Vanvo6w6Ay/hKwMahp9rzqa0xPnpvqjKLjbPsvOWqPyOWe/MKF/AHFQl\n3ODYLerqHE46HdxmMD2vr9DMdbqLbdlDp9kt430H+AdpflmFIf9Ojog1wKcp\nAXAlCgXDwcCXLXSIxoT5h87wLAF7Lx9dvuz2Oi535RbA3FGebFbuvDG50gpj\noHbaPZ3/U4NMG4Ov/ZpoXrvINd0GrOQ73A046eaC/iNkcz3cToBAsqdn5f0q\noiwKbtkMQLCVcAcW0+hG+TZ4dPsIhyH2B/FjMR36cFT5xY5C1ZnH4TEajNTH\nqkIiP8CnBrxLGB3CBSJtSzrr3KNxMO3xzyhdu3+EMlXCKDX/4iwnxiUEjhtf\nJGuR0XIj0f/MfgLdeLJ27pzpWFQT/k88FMbKYvcJTZriZIwMeQViAmq+Y1Eg\nzLzxtCOYPW2R7lH6N0gjI8afhg8nPiQ3J0MWlGNKGoLhvTiV2kpS9ymW/+aY\nFEL5Ijx/EGC1jDc5zDXnnepZk7xf2MSqBAVD4yySevcwrIYAjVNqkd/4DjOR\njxep\r\n=4Bfn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4aecc2e4f6e56b613eac5816d9f3dd3317d105c3","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.127","@balena/jellyfish-environment":"^2.2.45","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.6","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.146_1604333846254_0.9258204315635035","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.147-renovate-non-major-5ebf238f682458ccba794566f31f1e6eed5a8f70":{"name":"@balena/jellyfish-metrics","version":"0.0.147-renovate-non-major-5ebf238f682458ccba794566f31f1e6eed5a8f70","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.147-renovate-non-major-5ebf238f682458ccba794566f31f1e6eed5a8f70","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d0bbfec67feeb5a42d40d369a7861a6ea944b46b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.147-renovate-non-major-5ebf238f682458ccba794566f31f1e6eed5a8f70.tgz","fileCount":16,"integrity":"sha512-wHeSPqeHHQcGrDD34ouc4taofEo4s8z7UOCkotVLLqcTXVqEqsI4GBf2+Nx5BTKd11K7sJEQowseqF4v7MFDoQ==","signatures":[{"sig":"MEUCIQCuwVyLQ6kVvC5lSiAp8p7ZxxkyWj0Bebj/kdXWcIm7IQIgDv99E0/3r9hBAP6hDSIwko+CSvyXvbOyJQYE4CdfvQI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfomeICRA9TVsSAnZWagAAAm4P/jauGjt1uPnJyidOVnMG\nJHz6eiwond01iBSbyRfJxVfyYqQYoT/kttNEjkn6Bwp3F6CdJlK5RkGkV2EF\nnSGbLw7XIpSkNmB+AT5vVCzvUP0h/JDRTGj61LKUYLhdhgxaK1MsUFw/boGB\no51R5SMVZfNFYGYj4SIRiCGv51hDDu8rSK5z9UkR+3+MSjCUZqOvd0W420nT\nIE8eAQ2GFeMHvelJHPrBgBfOEx2S+frD1KrApXtLTl/j8p2ckCm2AcBpWL2E\n5MvhsgI+GMQBehktvHGJgRSC2lTFZk0tlfXlcE89wNIcbyEgPkR2O0tAynJN\nzkN521WebgFpR9D4wBTtULb5w3TZqmcRECuAMxPa47grKBcE63OFuOC7PGAL\nPCyuzxWV6YZD/t+jQV/Cbcv92A0IbWS34e0vWQbmEpynZEoH8qPX/z+9Z+4H\nVd6VoL4SyDI/o+ENG+b2p/ItDxCUuW6hZS5oTRxrTdpmOniCqzE6w0HYeLtP\nknQOhHqJ67E9mpuFLjD5QjOSob1aFSThbILErrbELI25dDpUwteGGCSACOLb\nbPIlmwnCYoURYYbS5cKwsamYOor5vPsgwtcwNcviN1f23IIpXv79HM9Fm6Ne\nd/0PMgwWuw5lZG7ZQzW8IZAmymuCktCqP26i+iP6/cTVXCW3FDK8CnvBpI8p\nBmNV\r\n=rwMM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5ebf238f682458ccba794566f31f1e6eed5a8f70","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.128","@balena/jellyfish-environment":"^2.2.45","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.6","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.147-renovate-non-major-5ebf238f682458ccba794566f31f1e6eed5a8f70_1604478855707_0.40465374411593946","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.147":{"name":"@balena/jellyfish-metrics","version":"0.0.147","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.147","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"972b8d0ce960c0b77dba9955f9f163a4da260828","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.147.tgz","fileCount":16,"integrity":"sha512-HeYR5+xGVf27T5UrD8t34hox8OSLIROqqK6AOfB45ZCjezvpk0hzT44bEdfueLmubFP1MyLga+3gML266VgpcQ==","signatures":[{"sig":"MEQCIFet8dpksph2tzT9IhXd09ZdzKlfydf6j9Gb/edTjCqvAiAMpJP7i8NwdfES9eVBq0yghHxW2UNCbN2N+J6oqz3yZQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88559,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfomhRCRA9TVsSAnZWagAA6QcQAI/Ss7jKSOfMkhXOQq2P\nhT4xC3E/P019ESHerhIUl9x42CMSKT7EFxujzRGjqLXzb3cru9sVkEFtvK90\nqK501DbCuiBB7uCWWSBkbGRcWCX8vpVcuiG35UUEnjfDyz/Vd1GiltWztPa4\nE0ry/bwvJcbrw4yf+5G8v17+8ewqxhxDsciDe0iODVRTbGsInln+n/G+EjM2\npof9lnQmRCHyRFcjsubTUyv1vT4TbZz34/XOACeh/Wbx0mMIiLrcRqohvjXb\nMYslwSqPTVW92I2bnYYQ5muJt4B0iRr7kX0aVfa3PPyzxleExAxJaQVqPTcY\n7kv/I8dTcHVeb6Pjb+zfIscVEUi369LMRZk2blYblu69tKzAjFKj+Q56QvEg\n7YbOiIGhcjMOe/MxU7Vd267QaMqQSd3R7fx0Wp/uMKqs9WzHjIUGFmj4BcsC\nYU36Z0s5cgmBH2d/ChBnFuHbHAmdl5pBdL07zentg3OrPYRsNKAfgyuIEage\nyscfwf8KnmLqPeJJbMCbz709l0w48ZfVKhZcsecdfgEzr3hsuis7i/Jjd0h+\nhxsgKf/zp6Pnsrz/m6kVkZ/YQjASt1qI5QvsD4cWMVsWU7AnY7+4WU/YTOp6\na8wcMhg4TZwtDU9fYeGgPEDUj0kU6xDTGHdaDbwMpEEdW7daDT+bcz5SQCNr\nOvQw\r\n=oOSW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8979b685dada84ffa9d730a2622ec4a4ace6620e","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.128","@balena/jellyfish-environment":"^2.2.45","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.6","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.147_1604479057381_0.204165229640892","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.148-renovate-non-major-7b7c3a694d5db225416da7b8d69e2764a85af709":{"name":"@balena/jellyfish-metrics","version":"0.0.148-renovate-non-major-7b7c3a694d5db225416da7b8d69e2764a85af709","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.148-renovate-non-major-7b7c3a694d5db225416da7b8d69e2764a85af709","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4fbded61af885486acf527073f044d5d48bbfd06","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.148-renovate-non-major-7b7c3a694d5db225416da7b8d69e2764a85af709.tgz","fileCount":16,"integrity":"sha512-6CBwoFY/wexsfbhVtyj0LZ8PqONtGdvXFlA8WJ2CIzTlr3oAUo5R2gdJfq5+HAAB0n9IB+hcEj8dY+kPbPyOuQ==","signatures":[{"sig":"MEQCIB1QC9KMNX33+le0KPdxN2X3bDdKpkhW79vUadEg0ratAiBHEjW2hPQ9mjIqmjuyuJumSFBiV8/NbMzy5vVghLLarA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88727,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfovc5CRA9TVsSAnZWagAAkN0QAJRsh/U2DYXK3EyoSW0v\n2CBcB8mvwBioW+PhvUchtnEjNyYblN6STYAE3JXBVv46/eqzUKaHHg9PS+Ze\nHLhDn6lPOopF9onnPLANQjDEdfKxh0qRzLNBVpPHdeu/cjcvkLlz8vaM9f+R\ny40EvVeVdYbZgVrN6bpIsaGMhzZmDyRvUr7SSRPR1HuIxlqQ23q2yRbrr5V3\n3P2A7xXfSAupvlPoDxPvkBYgs2boZxZ8UCw3n9Ob2GemL7EbEk00m1dw/9W1\nzgg5/ha10bqu0nOFXcrDTMa2NT3lZQeTcZL4fbAgFehAXfm7jWoM5vvv3Skx\n0iVqXH/f38DRct3cTQYn25InC1HAEh12uuVH4Db8sv8lWJwnur9lWed+yQ90\n/JJPyrkuLDYImsiq3tg/4uT9lx9Wx0svX6cEDNIh09HhKwASdsxn71yGVnhE\nLV4xsDctOchYIELr7/4Zt4E8OyAp4M8vFLL/7kZ61GAIdv6HiHpYi78RIJVv\noCi/XDk9qNM7TjB2y+HvqOzlbx1E6coNXuaNnEejOCu0xNa1+bYMYSJpuFMQ\njBoffgwmx8ygVZ/3Bt/ReGtiriePGI8ZVqjCbs3RUI85asEZmfQDhT1x4gFo\nGGHdi5KuAkDYei+PZTx11g/lUKlK8YXXKLux7St3wneeayJWyEM3ZV14jjht\nHjl4\r\n=KSzK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7b7c3a694d5db225416da7b8d69e2764a85af709","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.129","@balena/jellyfish-environment":"^2.2.45","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.6","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.148-renovate-non-major-7b7c3a694d5db225416da7b8d69e2764a85af709_1604515641145_0.1158218442630472","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.148-renovate-non-major-d1ecc1e49d035d1e28b8cc73965e728bef1944ec":{"name":"@balena/jellyfish-metrics","version":"0.0.148-renovate-non-major-d1ecc1e49d035d1e28b8cc73965e728bef1944ec","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.148-renovate-non-major-d1ecc1e49d035d1e28b8cc73965e728bef1944ec","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"186c609dc81817a981c0a7771093cc83a9b9be2e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.148-renovate-non-major-d1ecc1e49d035d1e28b8cc73965e728bef1944ec.tgz","fileCount":16,"integrity":"sha512-CJ5S46Kq5k1QkPGQOzM/zVOhcudBiYj6VxNvhioGzHww0HkXXyX4E+4TItDMXT90uzj2NueuRwp7c3sV3+jc4A==","signatures":[{"sig":"MEUCIQC82rhcHus3zRe+49xZatmyN8WjMTMEF6V51vkROf+RBwIgJtqxTfRPiSDbXbsuwSugvHMo49PWuH8hs25Ib1pqslc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88768,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfo5A0CRA9TVsSAnZWagAAUGoQAIbTTdLOWbx9bC+ou6Vt\nezvfyn/d+L3NNiSy5zcCpznI10tuhcPQa7Hv0tGT/jG8qpdfk/0qmgiTOTK1\nZUL0ltXoNcPhsEP9SNWpIXsnmJzIU8WpzlAMZ3BsJG9T0BFu7R+jVY1Vjoqr\nkZj6gtjbSYrfHHj0MEmoYYM2LqMOJxNRHE5gcRYhyB31jJcGc5vUkmi1Kr8m\n26xszXkGxqCnTfcfZgloOHQZ2vU56j1AqrMRKdzsOrvIQsKp88UL+v2vtsVo\nawbrz5lVb0kog1gbuWXJDwzXMfI0e+R6cNe6r+Kbvi5O7R502vH6hgRSWtKP\ncfTwMIJr/gRR7TwmbJApJ1Y9nhzXsBuAWbrQFRL5p2UK+7U6tctuDTRwNxS7\nzC1YPKPVmpSCs7HDhj/EQcxv6ydW40DqnJRN8Grso8kObYJRyHHUcgOifo3k\neX3xh+5xoFRZ/063wbEFWAq1a8n5aLQp7Yvv2xpbFpBmzr0cl23y+7sD+x53\ndQu1KX4/Z3KIIeTQBrwQvqzd6EeVdHFeTgyJsVLFVjEsHirY7NL6/pJhJgdR\n/r7Hcsc9gFPf8RrpjqidT4CKG9ckqM0POdSNgXbGlkWS0O1V6dj3UU6xyiwf\n56/tKgXROgpgoLIop1x9fqPHx/SGWNgpbR5OrC6uyNcsKzxjGYvWDg97VnYB\nbMp0\r\n=Vstw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d1ecc1e49d035d1e28b8cc73965e728bef1944ec","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.130","@balena/jellyfish-environment":"^2.2.45","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.148-renovate-non-major-d1ecc1e49d035d1e28b8cc73965e728bef1944ec_1604554804269_0.797200523385154","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.148":{"name":"@balena/jellyfish-metrics","version":"0.0.148","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.148","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b1c87016ecb77bc8f0a968078288547bb2011739","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.148.tgz","fileCount":16,"integrity":"sha512-PH4dSRp8kaP4Qz6oc+G1z5Di3dCMXmem9RFBtjLLEXR+i8dSnT3mXtAkUjUKUwfo53tWm/26K0YOsRiD/AsOhw==","signatures":[{"sig":"MEYCIQDqoXDS9Mycyvuy8ZmRKVsri79HIMpMnXx1lcVfKm/f5gIhALeiIv1b7fhFO/zxmYVU10WkeRjWk/knEUyIwaNFRqo5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88708,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfo5DUCRA9TVsSAnZWagAAW5MP/0l4XfGJG5yAegvD6kxR\nEKnuwHTRv1OsODtf+dASz0SxnBcjwJLM5ARnj33s8UwER0nR3g0rF/yhDx2Y\n9AmI3P9iurtrsfodLxHyWJVPQw804fFT8LzdD05jOuMWlxB7JOiDaGUhRne/\nAhp85cVldHSO3D/BOO1X1XVA9ONEf6+6O3tRcEZpMrM5vuh2H/lriQOj1tRF\nt4Wu7uTYaRB3xQ9s6ktI3tM4M6MWqGAVHA0CcNW1MMHE7RzlEuyTvMSt6jCS\nviZhLHnAhkPLStQP/GSnFd7WeOAWAcv9ok7A6R7//UUroif6haBXWqstEutc\n8+bUgL3N59uOmDy1NrTkPSnsCAQPi7B0Q8A+Z+9RYhwvOqX3avZPyVtQ6wwH\n4yfi+QtR89/eF+Pc8FOojljFjRtXaZyXmUGrlYf4w5W6LgYhuVPu0vsAjB6I\nThUTXoSRQ3JnzM8PYtYwxxxCDy423pV0ADiSZFv4XSDZvCrxMNX0M+jFH17r\nySb1ZqMQwRo12piwllP58s9jey2upz8V6UH/7D6dX4YBOvKiSG5Gbrls1m0O\nZUOMOtzzMoyyGNGn9nt9Q53gth2bO4vwx+MDYkuJQKdP+W6LI8NdOYc0qQE8\nC3vYJLbTxhKiPTBDyZp2uqGBjw5DeXpL8rKS2ZOO7JN01ZvU9zKEie/OYZGz\nS2tI\r\n=0qGV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"eec2797af7cf5619d7b278c36f784ccd496fa9d6","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.130","@balena/jellyfish-environment":"^2.2.45","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.148_1604554963443_0.9450103257114402","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.149-force-renovate-node-version-edf2f00aa05cebcf03b43c69b0e01a69790910b6":{"name":"@balena/jellyfish-metrics","version":"0.0.149-force-renovate-node-version-edf2f00aa05cebcf03b43c69b0e01a69790910b6","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.149-force-renovate-node-version-edf2f00aa05cebcf03b43c69b0e01a69790910b6","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"026358ff9a47a9e6f11f312c0cdbbc83989ffe47","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.149-force-renovate-node-version-edf2f00aa05cebcf03b43c69b0e01a69790910b6.tgz","fileCount":16,"integrity":"sha512-02Z/jWihmhzd/H+hBzwtQ/hg4ZHNt+hBC/52d+hnzUwbdnvdPMxTYrOq9iHE9I8Je393RHzcy/5OzAC1ObbvZQ==","signatures":[{"sig":"MEQCIAbXfSTgbiC9u/e94Fs9bB9AOzIbiEVKnQs8LL9g2WjNAiA96EfG9eWCIqI9NUQ+bYOcpucF0Wr0KRFUyp43+63PLQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88933,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpLoECRA9TVsSAnZWagAA0lQP/i8MWPtav1OiUtfyzBNP\nOWmoX6ou+cEPDat1HIdX6x115x/heWGJW+LbLBo7CeWl7pphkgb3hJniiIRA\nMK0VPNizm9ci8k4NoFhVbsn8M6ZjTnfzTHc3lfDYz0a/YrUXlb+oGB8qe353\nf8woAqP+ErOZ2IEmqc6cKuQ+4/NoH/HGqc/FBr0KrdktvqtG2L5pi6xYfsYD\nu3LhCg5FKFvPM/KFilMEKH5cf7w9CuftGbQ1vzqOu8DQWvOMf43kyIavRU62\nydCyMA31OZBAbkcyBEDIEMj+eP08pgZGNB27Yo5hfx7XxkDqJ8C5PqvlXHd8\nFXmquPp6EQ7MODkr5DVkEXqGJ6Cr2iMQPA3ub/XaqvbVuPrAiSqWTB+dfk/m\nvh8av2bwYzS7mVeMrviqYR21VZeS7u7S9WcMGJOO6XYe7PuHedENUuTIMsWQ\ntJVf5cHJwaVSGshl4Xr0eFBNeiE32uUJVIosJ3KgO/cSoFEGuUgXFsPkUrqH\n64Svjp31R8xJ7WuG6kHnpz4+xhOAeuL+YF6+qI1iO/WZXU1bTxPrHhl1zLbN\n1rVlYhcXu6PIsYN/XaEPnkwoZoagihuxYl9nblCVBaz/H+57682T52emyWFa\nsSrkqQ4nQCm50gNGNn/VESo1NmWbQkbQzlKR0+yfMlUwMaxBqmLktwVSzBmK\nnRJM\r\n=Bqdd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"edf2f00aa05cebcf03b43c69b0e01a69790910b6","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.130","@balena/jellyfish-environment":"^2.2.45","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.149-force-renovate-node-version-edf2f00aa05cebcf03b43c69b0e01a69790910b6_1604631044459_0.6641886021327033","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.149":{"name":"@balena/jellyfish-metrics","version":"0.0.149","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.149","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"642ff5cb7dabf9adfd1020ed99d260393029ee7b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.149.tgz","fileCount":16,"integrity":"sha512-ZJ9k83d5uaoOJ8VfFI0DyiVXF0XhMsEIdpM/8S2Ta1Ttw1QzYsWLUCPTTU9GfDeZwTJ5aYTjwxXanz502+CMOg==","signatures":[{"sig":"MEUCIQCHffsAQCtrYgOlZnJX8kz6CVdpiwph7Gix8VbaKhHlogIgBs1BX8QFSOtkv2/t2JpgH7U1Q8MlOa6m7na5Fq4AD68=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88864,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpLsUCRA9TVsSAnZWagAAuyAP/1EG2GZZHBIKq4QM39Wq\nbbZAH3axguVk0twA+yDz3aGVX+ZNscwjrFCBVoUsS1tmqbMfKEMuGm9JYLOK\nBlCV5kVvzLL6ZssNFYfMjRmDNpo5xVtU6bTkSon6n7XZnS1bzK4Q4JPG6dy7\n1bLV3QJXrr8j2aceR3N4HVXbVzgiIF8r1v1VttlTw5iSQpeAM57ZLRo1/vqV\nCXZvKzD1ImN83kmfkL5sdAsRbZ8gsRX3fkdLwQbBHsMBkrtSMENfQEgl8hOz\ne9xpLPOEYUvc/iaDqYUE+2aApVMcxHki2rvl95YQy09RQKfXZcVeb6hA8TyY\n19LTdCyVNGrKD6Ny6KlbTFwNW3N680CLI6L7O1f0aSDzNaiFCrb+pmC5neZy\nmQralo67iLxHhZucLh/d8O7gO5AmkbIj9j7eP2ucepU0HJl1VpbbUoLThm3S\n/4P2CTpDRb7W2K9yhOA1qPpOyEY1GBpenu/b01iXBDuF/G4xjM3Y6bttbnjP\ne+SCKxwiWmbVb5kYrlUmcKF/mNx2M70QwuOO5JzpXkc52Fpk8Vu/zS+pwJc+\n03TkoMfazmc95qazKi0ehJvbDqEZtj4QA6mL0XhPGW4CD8j4A+TD/MJK9LcR\nh+vtbwGY3REL+L0YiXF/GQnPkKqz0K9fPibap0srQ+TRErkWdm080CyoijZB\nKZ6m\r\n=Sudy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"23bd15b5b3947d1c29b581997805098a9d971dc6","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.130","@balena/jellyfish-environment":"^2.2.45","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.149_1604631315458_0.41203396191226527","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.150-renovate-non-major-2822113ba49a4d617a72bcca9e303aecb6b9ff8a":{"name":"@balena/jellyfish-metrics","version":"0.0.150-renovate-non-major-2822113ba49a4d617a72bcca9e303aecb6b9ff8a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.150-renovate-non-major-2822113ba49a4d617a72bcca9e303aecb6b9ff8a","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"36aab68c550f9cc61e1a8a0ef3892f098bc90189","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.150-renovate-non-major-2822113ba49a4d617a72bcca9e303aecb6b9ff8a.tgz","fileCount":16,"integrity":"sha512-Fom3t5JQePUlD6O+KefE2rk+jCD0Kx1y9KM7cSVxHDt/c+/tTmFH0R+wjulLNrrn5NFloMmdMTWQUVXLbfHiqw==","signatures":[{"sig":"MEUCIQDf1dcB2t/kGmRLEm/hcNGOpGa1C2g5CxHG4btn3AnKDQIgJEgvFSfGscj4IvXRMbzEY3I7Ze1DhIU1vllvWozEelQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89036,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpLvMCRA9TVsSAnZWagAA1WQP/RttfFlM8OpSoWJSZfLz\nFxy2BaPaRYvqKBor0r2zwTtEudG6QB6kLCv/xfoBnrnPs1HKLNg9id5q2OPG\nmaNVyzXbznOtemaRBS2L5EM2sPE+3H3oAnzbg9FxPxfvMKH1gEhqTE86n9Sg\n4CXpqWHXf3DW8O/MPxDgALrSs2jekjToMWC5nG+s+pbwpWn3cvmyawb6TrVp\noa4UXRa1I2h0JH9SAhW6dRhHleZj83o7t4VNNBsSUhMt12XAdD/qVao5k8cs\nFAw1tZCkKIexjijBaYZk1NnIz0o2/DAfS6yL+shB/OLOMslXyAdgelLTfI3z\nCQbtBeDNCO0N+Boj79RiNdESC1XtPbM9q1hBaDRteiWeFiohksEeUIsHG5iR\nqKNkmWENDcVqIq+6KoWR19+uz1379ClnbeqVJFM0kwGEd/uQqpVjOi7MQRYm\nxROiXaOySGSgapUsQHuhJtTu5OmOR82e82JyN0UMrVAck2bj0qkx0IQjLlUY\nAePWQzaDHMyF6AJt0brqQF5ljYSnb0ieqVsxXaoc4f6WXwubm6JmqqGU3dCz\ndmNfzEd91/xp5KUS2U7DAJjjukQhT7qOkp80uTUZdZ8WjbqnTlfcxpAQ3AJv\nHZi4ze47nIfedHmTNOG2Co/GowDKTKqIiLexrmRkVJDH6BkIhHlVhTZH1u1C\nsomr\r\n=ZMB3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2822113ba49a4d617a72bcca9e303aecb6b9ff8a","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.130","@balena/jellyfish-environment":"^2.2.46","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.150-renovate-non-major-2822113ba49a4d617a72bcca9e303aecb6b9ff8a_1604631499864_0.379179482615732","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.150":{"name":"@balena/jellyfish-metrics","version":"0.0.150","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.150","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1cfa6152761ec225243ebe7517d927e4eb3de88c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.150.tgz","fileCount":16,"integrity":"sha512-/Cn8xqCTVPKp4gPsr8IhJ7VUkeX9IkYRBt7CStNa75F0gaBncVrPQ8t0GpB9J9CUQBPNqTr/tlx/NGvVf1Yipg==","signatures":[{"sig":"MEUCIB7sNZf//i8Iz+DcIfedKCALLDRKzYN1otQV0El+JYUsAiEAhqSp69zSL1DVqfHYG4Dw33QH3rIOHmUreb4zFvQBN5E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88976,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpL0FCRA9TVsSAnZWagAAZGUP/1fr1VVgKLMAiaXDWeY+\nV1+QRF8+WHpQXPkUeAE3z0TIRgY0QA9ObKGNo8gJYn9Spo0TOoLp343aU2mL\nAH51XQ5ckjcl3/dF7HvzHCRArYg+wNVDQEfIl/OYebumN/t99pxN4ZZBLzvr\ntIsvgblYrzkHOMhn/2io5nxa9dp1debFlm3yZJvLWJ5UXiykkrBAm+TdwCCY\n3KVVrRuy3ISOaitNgRZqyaal4zmSeng6mdjuE5hhKxr5olQOFxtb4/UC6Oi6\naz+bCgAYitwWCT566GWQA0HWllLcjLTgfEgcoDvFgiY/+FnCukPdkUVsUt8a\nBhRCp5bgzJIYCcrBQ9ZK/76nMevtb5GY/h65F2RdFOynsEajgGsZHScyGn4q\nVJ2fIIVgABWS458dvBQbIbhd6LllpmdI3hldJQwvswtgaClYkDnI4dfG96RX\n1CdrJ3z69xKaoRhKyA9fVX78cxkH2ZDtfD0QNlGaypXNbHtFtJZ9JFiH3bX2\nHVuYmv9SVYQhu2if6QrFAlyfbbF5xxh9JNb+yvq0dQ/T3IIUWEQillQrnh2S\nKjGPymA40QVAnjLRvi+zopjGgTW3iX7dcZMWNUZId9N/yyhdJbLZdqbaFokG\nhJz71bnxVoy3C9UfcXH1c9+bpM66ifUIEP3UdTgbFINuit81Hg3y7H6FrVE/\nGvf1\r\n=BTpY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e4550afbea5b9094a4fd6ffd5df298d9c645d035","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.130","@balena/jellyfish-environment":"^2.2.46","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.150_1604631812749_0.7891015853578627","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.151-renovate-non-major-41a2d68096c2585ed1ec37f9334fbdbefc41ced7":{"name":"@balena/jellyfish-metrics","version":"0.0.151-renovate-non-major-41a2d68096c2585ed1ec37f9334fbdbefc41ced7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.151-renovate-non-major-41a2d68096c2585ed1ec37f9334fbdbefc41ced7","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"74af1a10f306936baac2c18629625b578b3bd0f5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.151-renovate-non-major-41a2d68096c2585ed1ec37f9334fbdbefc41ced7.tgz","fileCount":16,"integrity":"sha512-+Og1HCaoGUAQleK7GNVsTyex8tyeh2BVgt5ZrW2jbcY06yLSkXWhTREQr1YjwGd3XKr3JjPYupKz2XvTlKzTww==","signatures":[{"sig":"MEUCIQC8XHXPY+FkmRDpg7qmEEEfLmtnc8bZHACw+Bv1Dd7ApQIgKJ7/Giya+qte6N8McBJ2Unfz7eu8D9svJo+TRqAtkuY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpL3OCRA9TVsSAnZWagAAnb8P/2sMKynDGTaq8RNBHNV5\nUnQ8VMAYlElAtdpECgft6NvwrGXRUcfxO9iNI83InJu0FESz0aNVKkC4sFvh\nQnEDbBkESBu+3gukg14w3j6sMVr6mTmZwcF/rxM01c/c/92VK6H5AhFuD3j9\nsFp6ZEcrw0QBT27YZzL9EdBSwHwm/0zxs5kDmX4DlFFA1OceSS4wD/eciBh6\nyMPpTkpBvJUJLKCimD5HDDZpkzt4nvrjwe5ky2/1WJA1xaeW16RxQFuOFvNF\nCSe1viRoyMbes85Rt/4MQ7vfCDEx0KZlheeaoXI2t672IY7L2UBD29atCMfH\npk3T+Z3vCt391ob1LKfdGLdmq/coYAmAY4VBReOHZHOFkRNKaBQi4q2pAbpc\nXvJYtZ5SqlCWov2bXoF88XTsaEzMGi+Rj5LGg3EGUYzqciWlQ9FcDC/jS5gy\nG9u8cBP93Dw84GDkBLqp2HGbkJw8/vAZdSIGPFZUP7fFE+GgSaKIVeVEdsI1\n8VovOErNUNUSZGat5T1dCm7qJafwitsbM8pVf/R67FC38bLXaV3P2FNVG9/e\ne1m9sNDo7lwjmh2rsJjBquG0hts5tT6JQkxwgDlIJy0dp/DgPn3Of3+qwv7w\nJsntONXD5AnNU58E5dkY0MrRoOy/2F34WkomhS6pis+OQh3oq4RVg9LqRj3g\nz6ZF\r\n=KiJP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"41a2d68096c2585ed1ec37f9334fbdbefc41ced7","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.131","@balena/jellyfish-environment":"^2.2.46","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.151-renovate-non-major-41a2d68096c2585ed1ec37f9334fbdbefc41ced7_1604632014184_0.48239499879921066","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.151":{"name":"@balena/jellyfish-metrics","version":"0.0.151","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.151","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8d47b03318d8d05d5e0bccad595cfe9299b5af41","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.151.tgz","fileCount":16,"integrity":"sha512-DOU3TTbWM9BY5qSrQkDB4jIxwUKqh0x6RylkB7enxYwkRyg6xCMx2gxYAtvx5gVDAaaqcqZ3dUKWlKkMy6UEJA==","signatures":[{"sig":"MEQCIDo/GsZFSbrFOkPANOcA2x+uvgbPsdQNXZc+y55MNbHGAiAmmdwWChqZmjRYISva5dtrEUh2EP64IgMIO9ttIS6MZw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89084,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpL8sCRA9TVsSAnZWagAAKnoQAIIktaSghkX82Mk8Q1Dw\nf1VHF9eiC6xvM1R1o4e8BNk+uWKHABOj142Dn+FSE3TH2DcZYVE8HfGtYdBB\nZTMcgNvxSSxTjPX3ximFSWM6aZVzosDCB/XhSLyFo3BYR7i1zNzY3z85oEdM\nbhpgYaxMkTPUjd/U/cecWW1Nhkzs1wKQ2yHz7B3fx0X5DuUjnHYylOJJ94E8\nU/PFr51ocYCNBd0c7Pqz2p5kg4eKJhO0GC5yl5Y7b6xXEnVnHLEyiPQjs4wa\nZnvyJ63gZND7LQA1saG1tAzu+QtP/Yj9hxfzSgKdWw58rv9W8EDuS1nDxlBY\nuLk9958VHlFFdLgLWi6gGW5Mdwhg9gDSu4Xl4Rw5xEJT48DT4mo6iF1ZboeJ\nIAKvdrtjy+g9xsJmCOeu45FSEwA1myymyR48oeYfSW9cJMcC3A0Roqgi79yH\n56gr8U25UGJ9C4xj3qYqtuLHx5AFwPW2lDkU6nr9G4R02C/a8mvTuIFaAegF\nWwwnZ7gYshIWLbH5Yl/bN2GfS16TsOTvLEtN1gbXCESgepr1Q5UdBsZjLNag\n4dIIFTfyYay40ZOT3agJstIehuWggXqLLdCAyjvK/hldRbVXpkosgL6Kf869\nCViFz6McIKNsp+CSgY3kRJllizb4REZjz+zQtkwMkv3sPgEGkagO42XiHiwu\ntxwb\r\n=UXkJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"454ea5f5e61b2e1bf4fc766aeadd74904cb044a8","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.131","@balena/jellyfish-environment":"^2.2.46","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.151_1604632363185_0.9024567925665858","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.152-renovate-non-major-638e7b783a762e88715c55a7370a93370764d4d8":{"name":"@balena/jellyfish-metrics","version":"0.0.152-renovate-non-major-638e7b783a762e88715c55a7370a93370764d4d8","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.152-renovate-non-major-638e7b783a762e88715c55a7370a93370764d4d8","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"969ed106ec48edb615f37c19baf6f6b2488b9f7f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.152-renovate-non-major-638e7b783a762e88715c55a7370a93370764d4d8.tgz","fileCount":16,"integrity":"sha512-MCveHTpVNuCfwYUmEhhkHvlYZo7TPUirR0wSaaNCYH04s80bSINHTZ1VpKD8JsBGqHzxg0WqHu0Udggh/gfHXg==","signatures":[{"sig":"MEUCIQD4p5JqaB9Ngnwmt0x1bHysmC2opHH3jS59+6+gaGkEuAIgLHGusiE128IRa6VzuCFGLNDyHW8ag5DUZ3Ry7DID82I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89244,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpL/hCRA9TVsSAnZWagAAsO8P/3wyVy/KX6Swkgk1mvXs\nN8iRfh61Ccf8ZsU3oPxjM+L3Fu7S1NTpBi0C193bYjOlyzmvOrNeayCOKN+r\n1Z6pdQmvFMKCmj4oEe84gOTC9nBrEVb5HgDuGnWRx4YgKT5rkXh/LyH3JQxp\n/6k9QPTQmigxCEb7jSwY2PjN3p/kbjzqNMYYYv7EysKAmRbrJ8NgErwvx16/\nh5lyQpW7tLKXhkxU8mcH3icn/+hHuq7dUCtVkXy8wmJ9qaCvNRPsrnhWJ5L1\nykjmffsspn1qWcmkg+Z3saVsxXF0//xyWqQKpM+VAMPWnKk4fZnnTLeAv4aQ\nA3dP+rYJ/hLAqPEzL4YHPREXWqD9rWVZHa/gFwozmw82amqbV9isCkrpyGcY\noGdAyTStHMSDgC8HUmvt1SX/lILeg/dUxdVYXRRI1OO2EtOyS9EYRZcUigXA\ntQpCuISDpTt62QumRbPQT9XUxEnaMV2bm6Rxj3jBihA0V7zTzJna3quqon2M\nYvC8NGTrqTmCNTDuvZQkEbyUkGq40R/Evu7YCKHjEGlVImHoGs+SNC1Mtlle\npAa/nC+3oKQxpe9QcBa8z9pIjIb7f5b9TV60DtAUg/ryoTlRcl9K7uvDZ+pZ\nLh9MS0R6rNcx4pNIe8r2/Mk6ZReKsRfQH4DhdGfk+cVYfQ1/NlCi7v9O0t/j\ntX8B\r\n=nW2h\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"638e7b783a762e88715c55a7370a93370764d4d8","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.131","@balena/jellyfish-environment":"^2.2.46","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.152-renovate-non-major-638e7b783a762e88715c55a7370a93370764d4d8_1604632544938_0.7463626341898355","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.152":{"name":"@balena/jellyfish-metrics","version":"0.0.152","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.152","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"28dd73fd896a8b8922d2326994d0b1a772cbfb8c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.152.tgz","fileCount":16,"integrity":"sha512-oIGpeXcEsafv7j4BYfqa96Ne4J182zb1mYyQgDi+6ogcPIzcoNthg2cqYJZNEQXrhVP+SpFVtAkXJV1UniUK5w==","signatures":[{"sig":"MEQCIAGuGJ6QfWkPXHUHpTqPvfSk8IvcjjKwlNlMjU7qjL98AiAucN4B6m1di9t5TRL5nM07LqaZDCVGhg6UQr3b7P7jLQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89184,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpMVFCRA9TVsSAnZWagAARl8P/RDJjzuT41alu4EbSjNB\nsU0p6KY18YbawcByu8ff67KPX6BcvNx+yOvCTTHid+X3Zs18p4/T8vE1OQJE\nBOFmIpRPQ4Hm7J9Fm/fCnJ+5CFmGP3RuFIqwqele5rxUyoozBF/m9HLbWzki\nJQH8LJ3fJ2IayB3ibQQpZgf/P11I6go8vVXOHRE8ZvTp3pUupJx5yUE0DOwz\nsndi52/6Ef9WMnCZVXjd5DDhgREqdnx0k5++qJdc0atOlyLEHguQhXl0VA7a\nPL9UwrrZFsdEEKEhKOw1D7uM22cm2oGxJdY94c1FrooyB8+vKNdaIIlFZq0i\nOZ/pK0oGIiv+WWPZcBzxfEp47e9QwSU/YU91eH5NbDpWhzdWoyDUX01EOBNz\nVD7qw+zX7XRyEeVH4WQBagpBr6BPT9Oni70aMYPtFSyivYhDxTOXrUqloVur\n7WM6kc7KdSS0LEK++2A6++qGAWsqR4EUuI4FWidfvluc0OE0N6cjw/IJDXs+\nBevBKh4otXNxRC8m7six7SGEmvta0gp1vuU0KzA1n5n46OgjNj940yQbrKhu\nrsD/4XAcigO99UrdqQlMQNvrFYMmRzszerNs/iIVm/2aIIxVO7855xBeQIv2\n7/zc8AYjh4myQ77M4MPRvr6ib+IndZTxsi1yKwR/yGBZNaacMjDNqij3nvpO\nb4j+\r\n=6NKT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d4e587b2fcfd1132062f8c905a04f746673d256a","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.131","@balena/jellyfish-environment":"^2.2.46","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.152_1604633925328_0.7570930425522207","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.153-renovate-non-major-8692768cc03a81ee9942fd08f4725b262f6f8411":{"name":"@balena/jellyfish-metrics","version":"0.0.153-renovate-non-major-8692768cc03a81ee9942fd08f4725b262f6f8411","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.153-renovate-non-major-8692768cc03a81ee9942fd08f4725b262f6f8411","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9cc13cfae7d2d81c315f02d44928595767ab479c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.153-renovate-non-major-8692768cc03a81ee9942fd08f4725b262f6f8411.tgz","fileCount":16,"integrity":"sha512-482YmoBMAIctiWG4G9VHTmqoj/ZQ6XBQ/E4XfyFQOmmA7Szxz8RpUqWCRmw8Nsmwqsw3ToDltG1oJfmx+H89Qw==","signatures":[{"sig":"MEQCIHJCGx1LerhQwB7/eaZCxxqNXdGDS6MpzEs3iGGX9ZdQAiB/PwrXVrS0eemPdNpYIi+lwN9WtbCts79UviG5VEcMYg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89356,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpNv5CRA9TVsSAnZWagAAZTYP/jZZRHwy+BZA1clP/U4o\ntLsVikWIDmYi5EfO4l7zGKuwq8d7L7eXQK/NTcEmPq3ZQMxye0U38If97F5Y\nOFS7Qcp6ihOl5AVkRgTxl6e60hs3kWIDAiyi61V2QIcXw+qtmx+cwCd/BNm6\nu8BNUDPVU/QzqwSFMRmm2wYz4yXv2NgJp694YC+Dv+Hkc1SCkdLxZKdJCnLm\n0ysvDkWt78VRoHv1RDKPaQ1FTzYoEegI8vgka+rh4jh4IjrUdjho35qdchuN\nMtTWhhWwsBT4ljRLnYJQIZlqhFy/+ZWCHHkaUjnhk4gbuJLcSZe7zX276B2J\nDZNg74nRRg2NS+KVbrgjGpcZB0wXWtQ2DAXjYZtomonkG0+Hl6rp2u/le+ay\nawN72c2IBI1iCqa2a593xPNppstjKZsAO4BKYrpddKWHel2KBvFFfjq0ZOzR\nzl4Txn5yX1Cc2vr3IO80XVeN8vLGxkimkss5m048k7doBK3bRxhWUdAK9S8N\njQFM3d9nqGsXQc3EJcAOuP7O41EDR52zGFv0QrZ1S6gjFqj4JJuMjN01w3kF\nVLOAigTycfDv2Bz2ohPeYIUf/oPqdCRSDlmwQyXiX4w1Eo+twV+uKJLBAiY3\n71o28T002+GyiGsCmG+vL0NHRL9H8F33328s9lsRFVJeQNTw+qqZHCcZ5eDK\nQcwD\r\n=BwSW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8692768cc03a81ee9942fd08f4725b262f6f8411","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.131","@balena/jellyfish-environment":"^2.2.47","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.153-renovate-non-major-8692768cc03a81ee9942fd08f4725b262f6f8411_1604639736559_0.5040984597799358","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.153":{"name":"@balena/jellyfish-metrics","version":"0.0.153","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.153","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"81eb52eafcca575061773a39c120b8af48730e8f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.153.tgz","fileCount":16,"integrity":"sha512-uONGcztze8nB26c2jqxKSPG3tWl4SGjeiHVEUUWaalzfproLDECinIaGUcYuxbTOUaIQBOtQ5nMxaF6ADALUEg==","signatures":[{"sig":"MEUCIAMXmvY6wBRlvuCq7u2/gNOSWESXkXH06cRA9ultCyVLAiEAnXltq06cFUdzNVItpwIktQD18wyhFiv1xh716OqKMzs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89296,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpNy9CRA9TVsSAnZWagAAqt0P+QDRA76tVWI9LqPmaYvB\n9qR6gIHJalsr2jzyjp57l6FrvNoaOWeWNGxUzBbuhYjTai6Cz7zHG5+aXuLh\njEnUmOUWIaekXjoLvW72ZBtXv3YdbTjLECV5dTpxlORlF9fODnvyboUG9ex4\ncB2jOZkxaCWxRyECpGmp00743eIQiIsBN8YcFZqkUB3TJmTS6GbJeoS2XT+0\nbxVx5UKe4AkyCy7set5r+fyn2IY31iLMfJyi7Jwt0+96+iFDjIPBxuFJ9RVp\na3CCxoCJvT9e24nUkSwqpMT//o1SH3veMC9y6RNMjKRZDMFsB7Ii2lCrlDX3\nmoQHMKW/SYA2hVxE0zEWiI5GSc1V8+vYxyw29eNHkxnsSHcoILtXSOk+r+IC\nn3g1cbqKCfWrEnQWkhpY/uT0Go+se3SBsTpGzkJsF7QIKlaBjakO8/vEfz1s\nY6E6lt7to79uoAPIWj1yYrU92NF/9kdEQck+DXWaKK4NkOnC1SNXlP85TagU\nxjmDGhOEs0nPQYgDl+2jWwWyq8rtlCovz2aO/71BTmgyAASS6m1gON5eV7sx\ntV2TfwZ4+CJ27jKGICCb1rTXqc+qGKfIs/orZ6Ib9b1CqqBZZUR+8cUo2xqI\n2oVRmidtffEQDj7NRrTLo+Xtu2LYyzGaZhSh6+8HUMLaOuPqq+kRBxYFadjn\njgpf\r\n=GTyu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"94eccef58bdd21f3639becb9de7cc88dd5ba8c9d","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.131","@balena/jellyfish-environment":"^2.2.47","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.153_1604639932760_0.0837600951409967","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.154-renovate-non-major-c19a52f78dff9eafd2cbe857ccba9b9c24af2b9d":{"name":"@balena/jellyfish-metrics","version":"0.0.154-renovate-non-major-c19a52f78dff9eafd2cbe857ccba9b9c24af2b9d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.154-renovate-non-major-c19a52f78dff9eafd2cbe857ccba9b9c24af2b9d","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9b1b93bce0e61566399700e966b9522ee035f2a2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.154-renovate-non-major-c19a52f78dff9eafd2cbe857ccba9b9c24af2b9d.tgz","fileCount":16,"integrity":"sha512-3FPcOdTv9pB5PxLgKS2/n9kFURX4HaTPNxtCWxW1YIir3JaItFtFgghomBrm1JevzJysz9jsusSiDiXdCO8pIQ==","signatures":[{"sig":"MEUCIQCumbyjt1MkQQGRMDN7oXgn1FIgytceKgyTRFwEUAe74AIgS8exfev/S5aGXTF7n7+ELWbE8Triq/xf8EhZegHkE9U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89464,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpO1/CRA9TVsSAnZWagAAMvsP/jmH/1KEaWdFiVCtW/oA\ns206U/WV1xArw4wBSVF/TQXT79ImNInrQvKYOW2mrhWgfgIojdkbl3WOlRVh\nBiJFSq9tvUNQnOlIGDebFVbSvogptX2WGyDmD7etkYrvFUldtoe8lXrk0yAD\nKEwxTvGnIrVO3vbU91SHbEr0tf0dK3eBPz6Zy6d6rcVXF2X131Lw38nJvMcd\nVmYZ71/GNn3m6hwKV+Y/o89uxC63cAYTG0+KxPnpQOq4mTGrQneIwaVoMh+W\nFxcaSQ9h0xnS/dkNKIPkbQ0/+E+U8g3pOP8/7tc/Y3krZLe3/zxTBLXdtezp\nmDa1J3crOIN0GD7KM+I9iaLbKQ421IWaHzwgufuQArZCLEz2JtS9wJKgXuCk\n0eizVhX/vJdajh8YbNsn/05SDE98DrYfkZOgOthCe4id7cvAKJvU69nu8q0r\nUJIDxcLfGrjOGZkaUef6ZTofliEo9fLeFtBpMzqQE7WY6cWzy9dFyCdGPhns\nXio1jGs8w26R1xCs0B5Bkb0IptT/QcWUjlz0xGS7lkqSPCDlxiHxJm2re+T7\nLWj7YRYFASdHJcV7e6GZW7bU5btR627/WWqAGv9FdM2oGHzvHoX1CZWyN8iY\nu0SN4OjKICU2bWUKk3KpDajMN4SjSn7hJ0Gk492W86gWCRU20KHugv2cT036\nUbaw\r\n=Q4eS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c19a52f78dff9eafd2cbe857ccba9b9c24af2b9d","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.132","@balena/jellyfish-environment":"^2.2.47","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.154-renovate-non-major-c19a52f78dff9eafd2cbe857ccba9b9c24af2b9d_1604644222541_0.27474251968843455","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.154":{"name":"@balena/jellyfish-metrics","version":"0.0.154","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.154","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9193dcabdbaa0cb81a9f2a632d40fca972a7b0dd","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.154.tgz","fileCount":16,"integrity":"sha512-TtpyVzterPKQRN9LmBaHtRc6AQsd9h+ePNxpwnnl+0gbXZFsrAR1aPdSqsvnlaQRp5IuWVrX7h/YYmYvfw27Kw==","signatures":[{"sig":"MEUCIAYNxI6URKc4huW2hEiMl8ERDbZ0nqFt95dRUjs4np6mAiEA6pVuE5/yYc3ts4iqaMwGsruv0VOdFLntocQTL4BiNns=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89404,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpO5DCRA9TVsSAnZWagAA01oP/0hfXVtyA+GoXL2QSt9/\nwCXHanfy0Pp6UeOJMfiJBQpNWOSBW9pDIkE+smOXHNY9eXlQTy4j/lFc2Whu\nv30JSBKvJsXujHr/yzi54cp93Qw80YIVmp6zAGpKSRqmbrtL9Q4NfnYOcgdF\nzaz1U5H8Ymbu3yfG1H0w4re1V90lwPmy8GMSNTXPnVm2pesWQXKnSfGAARAB\nQrGCQ76szP7BwDNyuHy7BkVTgt56sqyWhrdK+aaCXObDXgtWnglgl6o2tfJ/\ndwGubMjKvMfbMOVxFlrovAui1j2Pyoz6izvYSkLRKpi1TYigAN83p5WIvOvn\nAa2O0AmORSeDWARV4fov8p5wte1J7oQQi3PCQWE1gfBvT/Dodm/7ffsngct1\ny9pCbgyoQs9Ik8AQIVFKQfs+zkZL7Ob5G1ScPUjq5qbuDeUN5XY9l06em8Gj\nUGUGVvdfaFatkSHHK4Aqp17qMAgsZpS+oaMl/2giNLPfDLrrovbn0351Pcjj\nVpxHQ3ewSAq6vIw2rSzuKizxClMcpljymhGkx3JfngBJ2gCwN1gHdF/34k0e\nQvUpIG4mmz+l2qFMyat3pCQU/SAhwY31YeWoyeULBkLKPuTWpm4nf3Ngn3q/\nHJdrfyenxWQYeLvW7IunwOy4KkSbKI2oKaYAuDS/dIrv2vVyxcFAnquLkzP7\nEA/j\r\n=UGMI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4e202296ee39c9e1c5ea29bd9ced623eb6a83bb1","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.132","@balena/jellyfish-environment":"^2.2.47","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.154_1604644418612_0.6518361998306303","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.155-renovate-non-major-0815bc6a4e0da1890271650b51fa0e2cb14ea2f9":{"name":"@balena/jellyfish-metrics","version":"0.0.155-renovate-non-major-0815bc6a4e0da1890271650b51fa0e2cb14ea2f9","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.155-renovate-non-major-0815bc6a4e0da1890271650b51fa0e2cb14ea2f9","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"71113f02781af38617b608b6398402b78372bbf9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.155-renovate-non-major-0815bc6a4e0da1890271650b51fa0e2cb14ea2f9.tgz","fileCount":16,"integrity":"sha512-g5QYVy0lPrYFLLdC31rv06Nu1b2duwQcal8AP4DMp77jm8fjQUTBdoeceOLQPE16YFPVS1Gg8KgyqujxWpEj7A==","signatures":[{"sig":"MEQCICmS4GmgiVTO/c+giajfPTfqAoCI5Oz6+4iXfXidYpgPAiBm0K0bwWyi71pHI5/P4PAO2uh4uQt754PK5XQz3f4yTA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89572,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpRTHCRA9TVsSAnZWagAAqUAP/A314omE+7q69KIHV89G\n1UuAs+IjZXbrwfFcMWMK9qA2df4M7gM445jVkfrL22IgFpGArVW2MUIkCfic\nNRaXksHJVPsWsQOVUAt0H3/7xTwSQKSkjvaY5PoX68cgwTCDO6c6LxOiw9w3\nimNtn6ztp+toxbPWH6mc12OsNYGjhqZo3B4Pfp0TCqvt6qnmkaBqnQMIBX4L\n6n9ZcwadjumipnRMwA054t1jt/D22Qg2GzrE7lEkd8Xm9Q6TTQK8mRayRUww\nPuEn8U7rvS0yEtTw3Ek4LktYYkenCk9LmM1lJY5+ICcMWHWHgo63abTbj+au\nMAGC5/s6uysIozRcQLuXuMyvTd0xPyfUflr1Iqa+Zb2eUwmwp1Gmz2aBbqvS\nqnEEd36oAMU5uT4rT6JokuZW04LtWkiLC6Ebz5mg6W4dB3o8N/HHcMAUZcgj\n+kdJmTzPHUh83BLNM/ymlxfH/V3Z3ZHho9NdWFDHuxZIJKkzAxPbBQMZKiGx\nDAPPmcMPMfGQXXHEdyb6trh9VAA1Q79dr088GkMOoY2uwE/LyzlMdIrLtHp3\n9a3fF4TztGi9csOEqEOZpBaOWv+OSwPwEX76rSRqr91yq3Gh03qpPKwxSNZZ\nNz0cvDzsnw4JSsQJ83WauAJQJT5YeFJaB8sEu7IrHCpqRpytkg6oZaKqIo0o\nBXfj\r\n=T9QX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0815bc6a4e0da1890271650b51fa0e2cb14ea2f9","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.133","@balena/jellyfish-environment":"^2.2.47","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.155-renovate-non-major-0815bc6a4e0da1890271650b51fa0e2cb14ea2f9_1604654279271_0.6229978301894674","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.155":{"name":"@balena/jellyfish-metrics","version":"0.0.155","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.155","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0a751e3b0599fdde39b3a6a075fb54aa209c5057","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.155.tgz","fileCount":16,"integrity":"sha512-4kIi8PahXINfH+EeA2L4d/5IJyZEF/abYSemdTpvOLFcz7QB1DUZyqxRBFmF0xDX4GFBb5BPBVRvAucGgYABZw==","signatures":[{"sig":"MEUCIQCvVTlZOPrvZdjGhgry/w4GVxRAFEo57VIjqrRjklKm0AIgQrzz1AFWLnnMj6zsF7VbXK4wZNhr81RIMJG6XgZsVsM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89512,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpRWcCRA9TVsSAnZWagAA3jMQAJbSrg98rdfbuvIRhn/8\nEXKzTWKUy1n0Zz7PD4JL9YXGdux+SsWo5x2II2rpWLTvrflMVYUwV/M6i8Ls\ns6/HtyJitI8XR1tcxaSfDvEWgXOuDMust7NuKMJBhk9JKtVsgMjSCW57Iu1M\n30RKFCKnePHmZhYVcTuBoGgnnRG2tH8XZoNPIhUvyqvRIqB8ymcaFykakIZF\n/My4noiHPMAj7XxBXdEzAiGG2P5jMmRx8SJWXfZn+p1MqPxDxlS9MqVTGTeV\neDwyKBtcSdkyyUedN1O/MxNbwBKJPmhMj+zWT9ZC0qVJZnQTfctdlLrc0yBi\n7OdnTHkQY4Bi+24wwJ4oq7lVqoF4VtF1g2CQYlkoILBmf/qo8+sR3NSagUas\nwYVNU+y7Qf72Jn81IMC1N5ClpTrfkcdzHnHL/bTX992A8g3bpAVxQ7CE6OVh\nlBBvvpnUBVDhyAregf93bWsv7AOwWIWDUPWnH36z4w05UG2zgB3shlgrwuTt\ncagydnxbYAh8ub8SGXIrlI0Fxd0S1vDLmVNlojkXBD9SqsCBIlmSt1IIgFzo\n6skU68CpwQpwswx7SHv6ZEHxA3LnhZK5ktNIkN5nGGu/Q7o5H1K/uZOZ3Ybt\n+sRoeiMn9haVEIt3QbxnSNXQuyp8pMdXKpzxoLEt/3YalnYAh0j4TI8PHja1\nDTvF\r\n=Z4bg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"bda73bddb03967350bf44aef943b46f057ba8596","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.133","@balena/jellyfish-environment":"^2.2.47","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.12.1","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.155_1604654492229_0.14531176490282105","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.156-renovate-non-major-3f3f046491715824bcef921536c5c7ac4178100b":{"name":"@balena/jellyfish-metrics","version":"0.0.156-renovate-non-major-3f3f046491715824bcef921536c5c7ac4178100b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.156-renovate-non-major-3f3f046491715824bcef921536c5c7ac4178100b","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"61d89cf9b10203525d3c69c9b1c6c8787614b0ab","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.156-renovate-non-major-3f3f046491715824bcef921536c5c7ac4178100b.tgz","fileCount":16,"integrity":"sha512-3GLLWU7WVq8FxgmbgfQMVCA65ukTeYHktW1I+hrmg51Fr75gNGuj+3JcK1V+BTtznwl2h+lxtil5TsVIZmO/+A==","signatures":[{"sig":"MEUCIEkBaids5UvLhFnPq7sAPJeeaWIR9wRQ445JiGW3QMzOAiEA4bYUICS38rVpQNO2dqyyseIgXT1ItBz3BdY1mQ0+E7w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89642,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfphzyCRA9TVsSAnZWagAARfkQAJVDrKKTzKRdGGLXIF9W\n7cbdgkiH2umcTeBPbC9MY4eazbjSX0DoqvGbPQkwr1b7R3iL0B4kN5MdNvS2\nfQdRRdwQzRg4fjzXJEZruKO76Bj1ULsQnoog1xGsqqdVNSlyNFHogHSu0F6d\nUauDNbdyq9r4yEY3AazuRpIPcUV89Zuq7r62889DgBjKn6xYvqJb2T4H3TAx\nofAMpsWBfegUnKs3SRPDMFqIoWqmyoAjFFgUT2iWjUrEOvKBIIDwpS9wG1oN\nHdb4RzNI0nSUBNW5r9CeI+Sbk4IrdlDkhtGVyRa358Hfe7/UJ76MrQXyzqrd\nkozzYmQHE+xyehIBvVEJKiZKQClq/yDa/idMpbxeqif812Y0IXnjosvVfrnN\nYzMjJQSgUO92ahD0cL8kz3VRFbhmVQOK4AD95o6uPXLgMvbjAVC/n4jvMvyz\n5T7HFOlFEinEiNXp/HKYZFLXm5iv17c/O+YxnmzCdvD87R7y9gytFXfC22pC\nJZzg/hEK2+HFzGmGIi/15kZJzWPhgXOj2ZqGtLBMA1ooDZrI/UCAgTz4CgfG\nn3VkYsfbEiPcP2Qu6zPJho18K1Oantjs0VVgiL8Zojjxisum6Q4HYW7B3ycm\nheT+TbMx6pHQmz4+tGX+zDDdYj5K/wPP74Gp7onKQd6MAblMLDMHOumqNUHA\nINzA\r\n=ymlV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3f3f046491715824bcef921536c5c7ac4178100b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.134","@balena/jellyfish-environment":"^2.2.48","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.13.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.156-renovate-non-major-3f3f046491715824bcef921536c5c7ac4178100b_1604721905634_0.8918070100899651","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.156":{"name":"@balena/jellyfish-metrics","version":"0.0.156","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.156","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"petrosagg","email":"petrosagg@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cd93916c8e088ffa104d1899330be251131fa18e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.156.tgz","fileCount":16,"integrity":"sha512-Uh3tQ8j5newozEeiOAIsqUQUo7Xb3U8O4ODL5OE+GMXrtN+HMbm9e4zgoY4OG892Sbfml1HVzWazv3BnYuXaYQ==","signatures":[{"sig":"MEYCIQDaMxpkWTqFswY7pVDvP3N0E5HjBAO2vdYPij75ZgiswgIhAIZkLkZPs3yqhfQk+wJVMWwnw4cqC7eRGObh3nnZgWh7","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89582,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfph2bCRA9TVsSAnZWagAAXUEP/j7RBMPlMZNQyy7228BM\nZKNtKBsCXLAcC1M0upv/sGVUECwxijZGV+LcmOBs6fbm0PXHDIzPVaNcmiPf\n2ACdocs8SFTtz1y5wzDMy9c2oVz0QCgulN+wqvdth1tYIqaCAuw+8WS7dGGG\nLkxUERac4hHju7nS9bFwLyKhX3+kibKJXPxfo31vRSUk87ZN842Gszi+F9dr\nGuPhnGwwbOa0ixqWK1lW6fe/NRmJcoPkHUyf2zbcRolsd2nQuT9/iB7QDYQm\nH3XTM427QoG2tDlcyzvdVs7o1nv5fsLzZ5bgHOuXrrdGBEg3z86GCsRTc0CT\nKZb42d9FOeO3CinLZ/RZ2nZYEcr8bZ5CwpJ6Q3OmsInedroAlwM6iynm8+46\np+quQ3nbZGJfiFeuBDjDmQqi91ur3d25/91+qUqtfcE6RRGSQ5bjC9/6vDXO\n5aC41DZlcy33v7fNe9HbFO6wAI7K+ekEtcPeIrLCZakOLFl0bFft4lS/LCPf\nNRviIr2RF6hPsnefcFbc73/hKKKiQg1CbOT8aowrQivQdsWA9fmKuJ2JKJvW\n/9eIqeriVCSJi1/0fgZpyHBsdVwW06F8DNB9Gvryizw5+y9/l/jISrMLMNYz\n92jnYlDC1AiyXgHmoYGFi9fSEQzgx7nCCApyvLTnOQ0IHZa/1Fw04U8ZWkmU\nVMlg\r\n=KAwT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0ba8840f84c76b90fc031a49f9a0cf9459ec3d23","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.134","@balena/jellyfish-environment":"^2.2.48","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.13.0","deplint":"^1.1.2","depcheck":"^1.2.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.156_1604722074712_0.7398345714578562","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.157-renovate-non-major-d1e21f5b765f4a95749e442430d34d8d6aded568":{"name":"@balena/jellyfish-metrics","version":"0.0.157-renovate-non-major-d1e21f5b765f4a95749e442430d34d8d6aded568","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.157-renovate-non-major-d1e21f5b765f4a95749e442430d34d8d6aded568","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"dd5c66850a9a17e9e1346a1d9708eaed4c37fc2c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.157-renovate-non-major-d1e21f5b765f4a95749e442430d34d8d6aded568.tgz","fileCount":16,"integrity":"sha512-xp+JNexd7h8CGMh4+Am2wseHK5V7CW2de57PjWp671hT/LFENOn9dCwCbXL09y93XxD8LryEoWcRJztpJdY/EA==","signatures":[{"sig":"MEQCIH5E8qP4B4G2njkmvhVLfyfZjUugE11tHV2QRbzRZwhEAiAgrG44yQ8pRfZj2CT/T5GOqZzkDpb+pHw6yiTHxcpfRQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89732,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqXBVCRA9TVsSAnZWagAAdf0P/1G4haDbBtqEfsPyRZNE\nAxDLlTO8n5gBsWWgl8tRDX6dvw8wS8EIIBFHJkbYEaRHj2/X5Y0EeuyHahie\nXpYVhbN37ZpVzk2fg8pTdAYtNEKR6l+F0YIlPn8hzcTO4fLW0wXl5DeKsXBS\njOicrc0DZpDs13I+N4hyPn/XlV3owY7ApWZBcgeT90HozDR4baBkrVSk5h8A\nUlIF1GDw6854AJfAd/UQLs3FOTYZiQsca1+LwBGPXQFpsdUVBSTSYFRmd9iK\nUX1SKCi6zIt0/Y/qraTAzzAsVnni/hHR2lV2BnZYtbh4AypcM4eIlXR91t44\nuiPwTfC2MHZsO2yJTQ+nE6mEoPKfx3UPtjhPLQsGyFPzof8rvREv482zIIRh\no3Z0+M9FD8vRvVaklm/DSNAAFMumvX9WlSx0yzIN9s2nK60+Mfgb1J2vmqYM\n7sA+bVktK7yT54xYCgMQShmLuL2/BrJhabE7HIdH6022fVSXdf55etUtuTfc\nVbeAZBoSDXW4oMWWcs7IGSKr15Ffnu40oNbiQG1jpyO8XL8KtU0qhPFsJk3f\nZf7IrwomdneTBmsAcMnYw7YgsfVujrod8gx+4CXzfjNuITUbyw1fsHZljZp6\nQQv2Zr56hX5YAGh+ifC5wwAFU9hyrICOTwygiXcCvoayI2FE6ceW3A9bBdop\n4ha1\r\n=IAe8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d1e21f5b765f4a95749e442430d34d8d6aded568","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.134","@balena/jellyfish-environment":"^2.2.48","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.13.0","deplint":"^1.1.2","depcheck":"^1.3.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.157-renovate-non-major-d1e21f5b765f4a95749e442430d34d8d6aded568_1604939860569_0.13028790094190734","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.157":{"name":"@balena/jellyfish-metrics","version":"0.0.157","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.157","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f65b33423663f2deba19c7a5a89cd1deb166645e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.157.tgz","fileCount":16,"integrity":"sha512-tPI9Bk+mRRbhCG6cdTHdvYhQfEjEBDg/vEOe1PGKvNJ+GDSnxx9LOQec7E24nCwTBycc3NOtiNpOo+wz2NyNCQ==","signatures":[{"sig":"MEUCIQDS/ln6XXg9WhhaAjTVLwZP2hiWKikfuG70LNTjL9v+wwIgbphzpTp3zMJUCPJhgQLvSQhCcE8BHlcVjpXOb6rQIvI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89672,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqXEVCRA9TVsSAnZWagAA8XMQAJw9/RQ4fMPEwmSgHI01\ntMJiiFab7rU5zHh9r6ofF6lRssYwh33aJx72A81jmUtWF0mGYRaHTIxWKInM\npCbLb1/EVUnk2Pp7WRJlqDFAOQPF1cUZTnCVyUMdwwB+VX2BYHCrXm7KJQRr\nj85mHcThq2vNUzFnVjt0r7MWmlN/vd8r2VmDHSHc/Riq5X5Yw04UDSbP+rAF\nFXQYNDTZ/zcqQDMyNxvHoqlxTuLPe4Cn3nX3AdsZJh5qmPAb1Fsv4/1xO24S\nlvriRC4PLd8Yg9Nrk4wanisb0Dq5FKsxZd0sUQLX8SFzReNpynziyrOSWnKI\nOKvo7eMXy9YVv9rhsTZBEKfCDEtrr63sNNRDQ9B6l9SM+cxnAPp40GJ/+nIt\n+L01AQV8qSd/lpl+tRSC/9bjUSnzIpDN10eFaDe+fC7xwN32ISK0yTY7nZMx\nVOuHs/RYNmMNdYZAKrjvG58Hn4We1KWOLpAb3oOAveDKHjRt5AHSCFD+Qf9N\nZyszjeR+CbfotmTYkrVQ1oz8v0ro5CBvmxotHgrFzvGcnGD4u24v/rShqco+\nlKaWZJ+UKOBjT2fS+bhFfuNE59Y/uCRyko9X7XcdqBimy286CZdAcjMj68TP\nWFuK/vl7dHHbBwLYzGD3s1SsQ5AtE9wqp/+Fh6eFkcpDppEF2MlzLyZp7V1n\niicl\r\n=AqgP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c8af81db27a22f584a91b2474668caeee76ceb93","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.134","@balena/jellyfish-environment":"^2.2.48","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.13.0","deplint":"^1.1.2","depcheck":"^1.3.0","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.157_1604940052374_0.6557785587825375","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.158-renovate-non-major-aecfb5c3f8fcbb0e8e4fb9a51f068e6ba10c6721":{"name":"@balena/jellyfish-metrics","version":"0.0.158-renovate-non-major-aecfb5c3f8fcbb0e8e4fb9a51f068e6ba10c6721","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.158-renovate-non-major-aecfb5c3f8fcbb0e8e4fb9a51f068e6ba10c6721","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"35d8c53dbbc133c48634393900fdd7112e1c7e64","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.158-renovate-non-major-aecfb5c3f8fcbb0e8e4fb9a51f068e6ba10c6721.tgz","fileCount":16,"integrity":"sha512-FaNF7tnaEj4sj7GH9dbtIJL8Dh8m9fT/VJ4m9ZgJu2C2LNLa2eKUej4F2kYkXWiMaSregzKt4iznV/qNoDgsKw==","signatures":[{"sig":"MEQCICPJZ+P69qh/9uP2oE8ZXFTH4srmGK8s20Ho7HOGlNuyAiANNLfJyHWjwPbkf1x3nbGaRbAycVZyubpQWr18VtTW5A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89802,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqeGACRA9TVsSAnZWagAAxeQP/jKQ8177zaTYmuTroj2k\nBMNjDuZoBYH51nENshmO0cTV4RpSiaY38fe5hncA8h39l9PCr6VsZF2FiEdu\nnmYlin07kBgCo1mXFPCqffxx5GTB326RRPbYathlKwfkkimfNayMyhnziUmz\nHatmnmTMiLw+PC5NjO7d21pnhKL4R+G5wbThDEsG2ie22joXAQaEY7b7vr6D\nIuRj/BHIsN6HTrJ0PkghihZqiZ4d1CuGx/zA4eSaC8uzrsxCllAH8vgBD4dR\nVJ0WtVolaj9TND6BW+7tdn8R1R4TvM9X58WuCBszh0+7kbZDDPows6TzJJ89\nYB1IDqykm4PzPWrysrhLQzHMItLqjJCanVR3G2Gh4gWJCczuBoUNkDa7wBSs\n7DULoUsWKdTG/c66Jt/axlAYJvwpAE0moJCHX3gs1F/62bxFR277t8Gx1xJP\nuIRXFs6Gbr2legN2bUGAGdq2dEqdqRHIYc3sib6mR6lb6QnVia8ix7Flzbbi\nzQx9czwZjKfJcLVBZy5vIgAzUkYGKk56eIkS56Q2zNifveYzxM4zpUOTAdRv\nT2X1Tqm7aRiUo2pwP896rTmVx+MM+RAe3eNbM4p01m64jZz084Mj1jntl7eX\noNnKYNeEXxRxAMUDdUdgWB1Ez4L5q037ee8tk10EODgWB8/lfCjf2Aub42jQ\nPAtX\r\n=o1D3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"aecfb5c3f8fcbb0e8e4fb9a51f068e6ba10c6721","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.134","@balena/jellyfish-environment":"^2.2.49","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.13.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.158-renovate-non-major-aecfb5c3f8fcbb0e8e4fb9a51f068e6ba10c6721_1604968832131_0.007088961555475004","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.158":{"name":"@balena/jellyfish-metrics","version":"0.0.158","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.158","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"87d40e57e27db0e79bb2bb3eba1e53bac64bc7d2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.158.tgz","fileCount":16,"integrity":"sha512-Zd9iVicKiqD4xrg59lHOdcZyuSIhFc/18xcEGrMDAwfpz1tsq80InLIB3cpgGxrLGVeJV4Aemjb7Zi9+dHqgPA==","signatures":[{"sig":"MEYCIQCXlYXtferwNMGs05VDQU5N7/Lb1Aeyz2aEmrJFZj4jGAIhAMKLOQIMhG5qXwB9e9wTvYd4eG+TTQPAFz/aK0EPFaoo","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89742,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqeJLCRA9TVsSAnZWagAALyQQAI9voRrcVS4WSQY4Lg9V\nM/krcLT1kgayk4vWIC2Gxfg8cLzEIt7BGM0AkWHypL11Jh3Gn9MlHib4L2gd\nkoqbLF6j+iXaEpTL0yIJWX6SpiB8VAhkZvn0LZ+zR5jDHFCxygcb7IthmfDV\nADdXSLA9jPEkxRJDk+R35JXyTbvwJcxnNzNLA7eozwQdsK7JKZPe9uN29KY0\n16lZl9grcDrS0VhYrp7ukjM1+1avYQHjKzX9HeTMZUY5qErxsDcmTI/daZV1\nx2lEEz9FqeVxFq6aJ531ihLUMX+l7mdgaF+JOGl9GvJm7Bmixvsf3ibB2LCd\nvC5mq0En2c+cAvPl/orl78iFEJZuEwdneEMXLhNwd2t9znDoaL73uO/8Ga8C\n3G1QF0WaQLRZ+2keDJnHnUDtfCGHsSprH8DdRBuM8hX8OhRv3Zf6Jwzc+DrT\n1jNySki8gczcFsvwlinod7n9N+i58sxlAphAjq/REpa3tnoYIo+I5xjKmowU\nL8RSlaRYixTdLGgjWofN8zyNIw1AgIgDIRK3pftT5EkQNCpc1koIDhkL1AmA\nlpshOfyCsJLr/BEO9Rn5JfwJkZ8/vp3r5BEekK9cYJ0M7S4uoESimOo3DfEG\nbVtuoZyAJ/uaRIegx5cdF+gmX3mJI0PjcNYlBJfG6iZP4slkOSDa+bInWTzu\nZVbR\r\n=aV74\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6029581851344244b64cf732b96f822a7fa551b7","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.134","@balena/jellyfish-environment":"^2.2.49","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.13.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.158_1604969034776_0.7069132838047203","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.159-renovate-non-major-c57fae639d20cd7fad5878f7b044d78ba34c74a4":{"name":"@balena/jellyfish-metrics","version":"0.0.159-renovate-non-major-c57fae639d20cd7fad5878f7b044d78ba34c74a4","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.159-renovate-non-major-c57fae639d20cd7fad5878f7b044d78ba34c74a4","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d72ecc672309ee527a0f352ba9fb65e726269fb4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.159-renovate-non-major-c57fae639d20cd7fad5878f7b044d78ba34c74a4.tgz","fileCount":16,"integrity":"sha512-nH4dIqvjZRDZR/kYQk2MHU3+eesc+o1j5s4U3nDAHM7IAHyB/RwQK+hb0+H7sW1BQei+LK3Gltt+4/IYu1UFBg==","signatures":[{"sig":"MEYCIQCW1nbX45i8pn2fB9B/bo/XSeprGpYL+p5u75HcU2YCYgIhAIFKYKKRaUUrytr39d9w/7SSiVxKeA6tLy6pokkTxusQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89872,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqe7xCRA9TVsSAnZWagAA528QAJtb3vmr/XNZM5e8LxyD\ngeBiPjFRJEL6Tzq9nQSbuLHH4NdWPviUDCxK7TUVfNfn/bCb/jYn/JdvRz8U\nrktZ0PQX+c9uUOAyMNnfBNMfnT6ITuneVO8ERCf1vRZqHaUykcT+6Flqe6Kb\nGQX3Zij/Jz/h88wqioIZlWRdHDo2tEgkmzDsz/MybFRfQTppDJTyJQhZ7ro1\nC0NC5ASTeeHFHqUgK1JjnoaFbK9PS9TAMoEZd42+IfOrWebFwveKRsdx+8OI\njTs6PENNom5OZxfAMEL2dM9kC26XSAFlOAct3CMoZCRClmk7+jcDHZbqALUx\ntRbzQcWvV0gd2Wg6EyNJgBbyOd2WSxvhNvdFHOY3Afou8kxU/KhROrSD95lp\nC3edq7N/WAuEX34I2Weyqe9w7R+bLkkCsdAOGEFwiSwsyifzTgy2dqpE2wg6\nR24gKP5t+iTb8URx5oHyWavcnp9dcbg8ZK+/7CUL+l/g0xrv+cp5A5LON0uS\nHYS4zwJhZoWKaCx9oKKD7LZkHNlCdWJy9g+weba8jCf8iqCm9XXoXoiRouu6\nsDbhnq0v2CfMyHd/zi4wo4mXwlwkp6xgG+Jju0sZNDgANssqawfvpItoTljl\n9IxPF++Alj+grmpgINvNRBa2an+9zEIlgnhTRdsD+FAINXBAb+hm2rnG20JM\n+7u0\r\n=t576\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c57fae639d20cd7fad5878f7b044d78ba34c74a4","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.135","@balena/jellyfish-environment":"^2.2.50","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.13.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.159-renovate-non-major-c57fae639d20cd7fad5878f7b044d78ba34c74a4_1604972272693_0.8412492133302876","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.159":{"name":"@balena/jellyfish-metrics","version":"0.0.159","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.159","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ce472f95ba80c1ad4e94706cb0c39e8901a35934","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.159.tgz","fileCount":16,"integrity":"sha512-+FyTzi3LmggPdUutL+CM/JSkDS8stjOtXfFTPg7pR4MC9P3o658wkfKGKtNn2olq9cnrjgZZa+BcTs7PHsMdEw==","signatures":[{"sig":"MEUCIBDKckMZLNjL+ibBJlvlp8BpBZJMsDkQWJwYr4L3t0peAiEA+GY1py8QCReZg/sX/Xqv+hQJy1lPWUb0wpl4D9t4APo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89812,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqe+nCRA9TVsSAnZWagAAEqAP/irUjRgrxsr00AcHpX3h\n+r53tT95aOohlcz87JU5jB0HIyYAzysioVZwNFazy3aA4X7oOyye2gN4dixJ\nFzi8yzWt/RdkP2D+tkY58dUt0KhMOIUN/yt1614lumluPMHOlfjWQZ34WhgU\ncwgfr2SZSoNnZsRTEgRg3HzQ6Fqezq+4VefHRWCzKRIRp5Giz9fIRx+Z4gZU\nwrcMPDSsvrOetRCIi6jiYQt8bcu378MjtqE10fjPUmdKYG/DMLzfE4cwRCHZ\nvE30lBx5skfQjEdI/sknAIwH5wEZvL6yetWLmENnsQlhw5kbxExRA52t0xGx\nv+9WzC4izRRlJBx/gs45g8D6QBEgPk+Mqw79m57Fn6Eik2jBABZtvW1tQ1IN\n3PrpKGPu9g9nWhblSHFCj5XRkk9sx2SkViZn/FEgfc0X+LrzYWGhRiAYxRCV\n0mGMhYd9HxMcFkXPvMBjgAhdpE4mJL/Bk6az+7X3MMAqy67I/AbtCJ3EqK+K\nZNOIffEQdfl48UxBCSk8YmFNC/PlXwNCjz8shduKyuGXadVzNeGwIXqT6e1o\nZMaX4wnxQjLBV+iPe7Y/si7zt5t5kjIBI4CaOd0mcUEoqtqJDfjo0xaR3xjv\nKJ6y5jDphP0ihDQDeSfBlhMDfKmIuIGhtCy67Y0t3q1QYke5t8zzFhGR37Ie\n8+mw\r\n=nGH7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3e8b19c403ad9ac0e3d01b42fe40bc2245afa6ed","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.135","@balena/jellyfish-environment":"^2.2.50","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.13.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.159_1604972455126_0.6108165254412357","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.160-ci-use-node-14-d35fb33e30cf956467402e69ed80c3471c32ae2e":{"name":"@balena/jellyfish-metrics","version":"0.0.160-ci-use-node-14-d35fb33e30cf956467402e69ed80c3471c32ae2e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.160-ci-use-node-14-d35fb33e30cf956467402e69ed80c3471c32ae2e","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"646a392ff44198dd7866ac28955e96033e2b2ad0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.160-ci-use-node-14-d35fb33e30cf956467402e69ed80c3471c32ae2e.tgz","fileCount":16,"integrity":"sha512-kAN6nyd8ZIX0qlYdTk/pGkr0T7jvXG9rO1NwECcZdmxMPcFvnxFbWouWDF/VNRj2wE5cJSjEXelHT7/Td/4A5w==","signatures":[{"sig":"MEYCIQDROvbsAQxnb3Azr3cohNZSZ8PqeCM5eyceiISCuItbLQIhAJD0grOxXRgUIhb/Hk+L4+mhCKIZaZwaJOpuq3q0NFML","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89943,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfq5OrCRA9TVsSAnZWagAAquAP/3HwRdoPyKg1GaMSzOLf\nNXZWksalkhZBX6ujnKAVAi9u5mF5uNChn8TOuLIhHe61yhiMIUmWlyVQv88z\nArVhPgfVzLhCBxZqKsc+PNh5LPysB+FMSODTVGw6xL4qZ94NfkF1dvzWj1ao\nmDDxyrvI2c4Ue2D5Ikc/y5LBiwGBfVmYRQ7uTFZJF8Ifc/8fQCde3tWpliec\nNktHx0VozC56Yc0BaZucrV/yKjhqMZQ7AUXnHSjqEtl4L6zasN7lfNakxnMI\ncRtVlhqeRkrfMZ0w7j2miK5F+cw1IqnM0PqgtaDJuekd8J/3CF9dqjdtwz6S\nYj4ofFyHyVM+fN6m7S4lmJelwo/jJw3FYryCmQtWFBp9glPmSx5XLCr9vGlI\nBAU0//Ngw+RxgerDcpm9JHMW5TGJNtL8Rv20NzGA7e3fP/p+MgqEPax4rbWu\nR6tiYFU7akEssqnN+EbB/3wRnvAT3cw8IO+iTxXdmdRnewkocaHJa8dmE5aj\n6mjOMRzqildXixvaCa+GjG/ClNInx+IFqexcyAvLcKmtHLtB/65eGmdQQMrk\n9OxWL1S0G3hIq23LaG70WkYviouuFWOU9+gsXnnCc13SNYFIStewGSeLiHdb\n5KNmoNLvtHE7ZMpAQ/lqkWE7Bj51VCKubzx40+00vhzwSPd6Hpavwhq+O8u0\n0xln\r\n=1KTD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d35fb33e30cf956467402e69ed80c3471c32ae2e","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.135","@balena/jellyfish-environment":"^2.2.50","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.13.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.160-ci-use-node-14-d35fb33e30cf956467402e69ed80c3471c32ae2e_1605079978959_0.7321738307782202","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.160":{"name":"@balena/jellyfish-metrics","version":"0.0.160","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.160","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"101ff2aee7e48cd94e0cf2f396ab35e3c7b76aee","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.160.tgz","fileCount":16,"integrity":"sha512-/Lmr1lzBLq0JUBM9nJgDuQg/f7nmDtDF/mrYdp2IP7V0VWwAtvESx32Hn100wdIGSnk0NatfeUaQU+QSdPYIzA==","signatures":[{"sig":"MEQCIQDu3hwiBB4DZ/FLhQ2HWGTzi4eIo2NROkPKuMmAzV/HhQIfUXdYoMmirZYMoR/UpUosWbZ1jGtv6BN7Ur3yZS+7Xw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89887,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfq5SMCRA9TVsSAnZWagAAvcAP/2sUtJPUh1L2m/8wL+Wl\naYW7hx9jwID6Jaw40249SR9/nZMczfkKpULIqhkKbUYxg6mq65au9UbGQWnx\ngxsktCrCSXVhFxiNbGajhCr2vT4KOWPlbUpTV9tyifUftAWTwUOAvCRFcQFt\nnp1c8dKbUr9ratPpiIk0M+j5RCI5A+0jLqe/9/XMdu4TehASfVvgLf6jgvfz\nRKolMAk8PXUCpSdrgvbzTRnVbhmobX9kQpXznIoaDfOSRqGGHzJ8LhUdZJ1p\nlHkSIGwIg0WBh2ksyCowpcmcOLQCo5n4XU2kEpQO143eDfjWY49W3oC05yWD\nXb5XiEh9/Kw8FrlJcVpnXMIGGajVf/YEO7/KNPAZnSYHzD2hpOZyIdbQR/I0\nJd/QbaTzFWNQK/2SBsu1xprMn5Oil2j8l/Qiq36+2vk1zSaL00QVWi6oSsCo\nXfvJI2E5ERjXLMOtnNNpXsbkTKuRKE1ByBcFvJHKv1CvitDe6T1/vO7/G3B3\ngQJUFMw5PLmvHGhMFy6I6FbK3ADqAWWggMJQQZ3HmQCRFsJigBkF5U17PDPK\njMrAbS81vjU6b4bxdOLzMmeIUWIifXoS0lLKS3EGxDhh7uqHRcrw4qHT15PR\nzvPsErPDtafDfqBBxNvdfO/C3sWTxVhbfx6uLoiUX4dY/zqAi4/jabmrWf7N\nqiJE\r\n=i3/f\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"df4c1a866f886fde4bf0a75737f24f630ddb6059","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.135","@balena/jellyfish-environment":"^2.2.50","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.13.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.160_1605080204065_0.13099751717651986","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.161-require-node-14-8704c3c0b558de28ddd980992633494508c470ec":{"name":"@balena/jellyfish-metrics","version":"0.0.161-require-node-14-8704c3c0b558de28ddd980992633494508c470ec","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.161-require-node-14-8704c3c0b558de28ddd980992633494508c470ec","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"961bc7d29df8e53e0f21c62b1597ba1deaa38a14","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.161-require-node-14-8704c3c0b558de28ddd980992633494508c470ec.tgz","fileCount":16,"integrity":"sha512-CYWQETrFFhLtK3iH1s66ZR3t+EMJGG0Ddeq1x7AeYdFRf0nUp6fn6cKHdzmYLGFx+oNbnA90JJ0ur6hKkaN6SA==","signatures":[{"sig":"MEUCIQCq/X2mLtAK5XZbCl5zFle9g1LZpL41K+DCJrWJRsmwvwIgBFRgBrUIBI+YS0d5t4x3Dqf7XOzxrqlosnBsRsuMnXQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90006,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfrI/hCRA9TVsSAnZWagAA3V4P/RR+1bEjuArx0cpmXAsW\nKb4svLKAsr195Kj9XfIoKaQIBpCAjz0zYF3Cj7OEhh73Sh1HOJHJuPRG0vFV\nyJwr4wnheHAZCWBSwKeQGbh2e7/vr2lBH8AjERaD7lrQIZsYvS9OlUXalKSh\nDxFMeXOY0j3YKo+CfgQvGFAVfRKiDDVeIrE5B0yb25nSmHhqFOOUJ8QtDJVG\nAV18CbdjYHBHmrvlabvaS0QC6VkbNklx/poY3Pyyxl2epZ6MF+bCpYpf50iK\nVT64YrlGmQl1jbxLvvguPGcJa5XOgkpIlLv7vcSKrgFT4WrSjTLqww9JqP3V\nVsVIP6fMfZmsMvUuwyavWvnqY6uL+HPHBpQIs/LlyKgqGmq4H/BFs84MW++q\neVQZb6vY1LgAiMxLl/wrb3XYkRm6s2BsOgK8HZwkGp9jjPFe0XVW4yXVDMO3\ntZMpmTdZeEV95j2GVz8VHrtjJNvmaz6luWU+j9GXWJwbX3yrRSpdFAiVDNor\n1jPElqQH+2H1P9pZaQ/adXxGmS0ASSXO3q8deiU5w8mWT22mNRED9/OUUgSc\n1uUIAQaf5UyuPRNKqFaltZR9QyN4/EAGeG5h9Q1SZBsnLv4GlrUNm+D/81Qi\nZyK1rSo78WVizriirJGGeCgDfL1YbN4oamXlP1AgphMunwjvC8kmf4/DggAr\nNB3Q\r\n=iOa3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"8704c3c0b558de28ddd980992633494508c470ec","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.135","@balena/jellyfish-environment":"^2.2.50","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.13.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.161-require-node-14-8704c3c0b558de28ddd980992633494508c470ec_1605144545019_0.47363098710753415","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.161-renovate-non-major-fc23ff735ee4c994b80a32bf5918147eb851a7f5":{"name":"@balena/jellyfish-metrics","version":"0.0.161-renovate-non-major-fc23ff735ee4c994b80a32bf5918147eb851a7f5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.161-renovate-non-major-fc23ff735ee4c994b80a32bf5918147eb851a7f5","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d961d5d4ef736fb1852970f7927864fb23b83651","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.161-renovate-non-major-fc23ff735ee4c994b80a32bf5918147eb851a7f5.tgz","fileCount":16,"integrity":"sha512-FSg/6w+YgpIwHZGe8e+y+ObaQkPcBeD5JDW+ce37jAsVvm8JfZUWvec0hhMNfjeIdWvHybgyZV5qCj+9+IdLjA==","signatures":[{"sig":"MEUCIQDaxCejN/SbHBI2luuf7ZydFgRhBos6lhWTuJJXUm25FAIgHjKUoWw3NYbiNiH/MKlDybmH+M+hucaEYnIyAVvr0gs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90017,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfrJAKCRA9TVsSAnZWagAASBMP/jnv2VcL1JK4u04NzrtT\n8xGb1gy6ElzwJe/idkdoJXF8hcoYfBxHepV6AuGDJppOmrGWaLmTZ0YP6+4p\nn5TRP24wNRnx8+Og7WwGZPExN+lyN3TXkFyYRE0KZLs+DfsHet1BZ+xHgTX7\ni60cII7s4iyPrcjGqtGLVAmDlFRsNPGmjJfJUIDd4pNX5PkY99TOHNAVByqb\njGj7xNHuDb7KHZqV081XgYPyo2OL2Oe0FQC4P2+B8S2NCCvi86dsp8n9NTBA\nlBlQZt+aUWqEDtV44zkYB9I8ynmGoKpXwGcuLrjTRxKJr+bwnScNZA/giMZz\n+/uQvyRbIMiKzWWLSsz6u9cM+21dpbUuHHYr1oc1Vq4OiBuByBkcy1EQbNJg\ncVbSmXjXebWWHCc7xanap0nFwMkdfVPWnqx8StMAw+zU7RX5jxA6YFVvxtK9\n9ISJc44t7d62BuBL1avlqpRQNs+PxRigZXnCoXtMWwUR0SFHAifxLhX1z03D\nEVwSIUNfEvZk+KOwAQ9khPvvhy0k8UIKE/UCZ8trdsMLp0Qom32c1iy7yWAQ\nOR725fVyB52w+DXn5FzUsCQFd/fB6ur2lKoXwjZjxOQo8IKLFH96g1bPLoZD\nQ+nWsgFg6iClc0x9ljRMmly/cQ7UzF35SV+a+KlVjpbr0f/pTtQp86VLcI6x\nT6Fx\r\n=2i96\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"fc23ff735ee4c994b80a32bf5918147eb851a7f5","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.137","@balena/jellyfish-environment":"^2.2.52","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.13.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.161-renovate-non-major-fc23ff735ee4c994b80a32bf5918147eb851a7f5_1605144585929_0.2928091934757857","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.161":{"name":"@balena/jellyfish-metrics","version":"0.0.161","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.161","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ff684b479828cdd4cfa2086f11600f08426a3ed4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.161.tgz","fileCount":16,"integrity":"sha512-3hFVZ0sUYiHfYxboW5wtQBoBbdcsKpnRf6Tas5YAQbykf2lVApQeyyygQtE3KGPlc9TDDP/p7z3043ytKCNPjg==","signatures":[{"sig":"MEUCIQDG3T+chht4lTS5aStZIjMzAiUufp9UbX0uCDZpdSjO5QIgYgY3L+nkodwB08vb5II5hBz0X9EBHxfl0P7BOxIAyNM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89949,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfrJDzCRA9TVsSAnZWagAATCEQAKI0tuFsrdTRaWWCCrzD\nwyLsUndy5IApPjjKknZQMtxPII7mrSTWeLARQjg5KCj1vgfAvfDhAIHokqj3\nnXLELzh+Gi6I9WZxIk/7ksfiJyv3jtSyXnVEdvHTY6crRl1ZQrHDL98UBolW\n4Nw7/p8L85SSG9e01iDi+9Vlnk8XwxZ2jcEDIgMO4zB1EMq076RnjmGfJwDL\nenZMTcFsspXZiWhKzt0yUv5u/wl3zxKIuZEO51E43zxaz3nddtW4rvxfrXaJ\nDQ1qIVGqTn+SiZoaQ0ITaeCh7TTxbH5U6owu5TZzSmcAm+/AMH2aOJXov0IB\n7qwDuli78FisOS+569RzFegOhivoenBixUxLGQwTYjpYdSDVIoiNXXJRKiCy\ncmi29eUAMXEN3ZzB/EOHK5Rhsaq6eZsW1/0LUnv3V6ejQvNo+uKaAyOxFZnl\nEfBW4Qef6Sk9r6ZeWnx2ArMIAHn6c+LMpRuNgiK3Hz4hYe+XMgG3oFYpfNDj\n9S7wvCpdIh0ZJo8FPmDPawuHsCMeOCbR6hf+Grb4LQ3xqko1ndrYdsOXMxan\nnI/qRGxb5/Bq5DOk48ZcNkgnxxEyDsqHjvlhlJPEMLDTKKJjZ5lCwDViitTX\nH8hfhSyyeD6C+pbJZcj4E3mqEHlUUPm5DhUaGjBek9sDUWAw1h07bkkM/5LW\nDavM\r\n=6Wpp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"bd1a5d8b0caf23faaf3bbe35ca4cfc99e5184042","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.135","@balena/jellyfish-environment":"^2.2.50","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.13.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.161_1605144818690_0.128375005609366","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.161-renovate-non-major-f9bc7447db5dbc6a5e70c2d4fd326194fef4d706":{"name":"@balena/jellyfish-metrics","version":"0.0.161-renovate-non-major-f9bc7447db5dbc6a5e70c2d4fd326194fef4d706","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.161-renovate-non-major-f9bc7447db5dbc6a5e70c2d4fd326194fef4d706","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"10211d29d24b4a1508a21b2011f68b144744f65b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.161-renovate-non-major-f9bc7447db5dbc6a5e70c2d4fd326194fef4d706.tgz","fileCount":16,"integrity":"sha512-Y08jsl2Jv8GDIqT/XxeY2K7SQUPvCIXbs+JlLPNPKJKNODeVze0yga2a6aK9/L5OKkNRwXZIHNq5ln7GXAfJJg==","signatures":[{"sig":"MEUCIQCMqXjbXHbJ6cEftnIOwst35MDFiRSybF1dTVASJT7QswIgJeGTLbg8Kskl1bVXsQzS3y8dNTkttC/bu5MNJt687OU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfrJE6CRA9TVsSAnZWagAAGLQP/AqB+TAuWWKMPiXSThqx\nwHM8JrbFZ+1H7KSUDBT7hAURFn0ndnpjg1XkEu4gXS1ZLxcNGxF4DUNfsc/N\nWfoAa1/ARDr4DDkUy4kof0hOsI/NI3/+x8vGLcF9n2uZowmHEyXRFFSeccbG\nEeQtltctYH+TcNvfXah3/tK4TzQuU/0NPDG3pqFRhN54wnqhzqMiwMqCNJF9\nb8S7B2NeNAXHIdHxhNekvqCOPRKH2rQXs0dnLrg7jnjKS75+ZZro3z/hv/XN\nuUbT58f/sV6nYX64xRp6/du8+v+6zCosXNEf5vuXwASi90m1EJsmOgRRROmt\nhY906GBN8uFMurwn7Ro+6lPM44z+GThnuCSOuWG1Vsd8ni/5Bg0On3vbk6d5\ntlNC77RDj3XkPt0y/li+ibceZP2n620yONo80R4TqvTcheYQ9BtWB+goSgnX\ndhi/gmggpEUgJEwyEyiFQXp0oCoO1xduX91fnq3iAl2baV0u8ceYXTtZk4fN\nX/yFLbtiTP7RU+4DPeq7Kyx3mk7cRmlVfAzSaHGXyZyzPWEHdA4imR7/SOuM\nyDZC72Ox2klXo147zQAadUzEEXbkH1VZW3XbJdEc4I4WuazfnUeQjbiIypWz\n11llSDFuYW783RUrxyRWkekKWYQR64P7j0y5aKko2JqAAu4WdpBXPROjJHHU\ni9Lz\r\n=WEwL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"f9bc7447db5dbc6a5e70c2d4fd326194fef4d706","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.138","@balena/jellyfish-environment":"^2.2.52","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.13.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.161-renovate-non-major-f9bc7447db5dbc6a5e70c2d4fd326194fef4d706_1605144889847_0.9281910934226001","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.162-renovate-non-major-e1da9026404cfc1e3c69bf73a659127ad5bad47c":{"name":"@balena/jellyfish-metrics","version":"0.0.162-renovate-non-major-e1da9026404cfc1e3c69bf73a659127ad5bad47c","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.162-renovate-non-major-e1da9026404cfc1e3c69bf73a659127ad5bad47c","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"339f8d66376cab2a14e949149fc7720651f3ac79","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.162-renovate-non-major-e1da9026404cfc1e3c69bf73a659127ad5bad47c.tgz","fileCount":16,"integrity":"sha512-NEkF9ztktQ0iEgEXiAAIb8SxGGJ7uU1iygxwgicrzDGip1k7g6Y09sQBbLMfIIBOmKr76XsZI0uVap4xs3k48Q==","signatures":[{"sig":"MEUCIQDXiXR5XoiXKVsD3LalUIOXZK8D50OBCk81MaE3X6ElygIgGGdCxT83pJ0Vpmb03/Y3exit/H4oNcgEWbXerp5rbyo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90079,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfrJGlCRA9TVsSAnZWagAAOggP/1gkqgBcHeWwMW0e7wXf\nL2Tv4WAy++gyYCO9ke6C/FHfp0DMS1pNQiahi3Sc82r3CkFnoaSWK4aDMmws\nZQfSGhqMdL/09upguWgRH4JYhyv7/GLh3aRZFZO0V3blbsPZj/McMGszxizr\nVx9/mIywtNLXAK4m7kCCDanp0RXPWZM1HEdI8Akg/3vWh83Mbr/S9iOQURfv\nnkema7JWAcwjBZZGYnKTNGpGHK+PlsY0JNX5LzPGSDV8qlsc9At4zX0B749l\n2PtULrje1KVA6oLjN/2TpqodcSuBFelih0kXRn1aCw7BSSb79p+tvZmqj/2O\nfY3H2/5U6kiYtRb6UqNwVMKdUjh9zUEQ9Y7h1Jp27LQM60WSPRIMLPRp9LXv\nXhPcrnXFXH7F+dPj5O8KfPSThES2sUAdUelm/zoY8n1cGSr/NEe/TW9eSUxk\nnkQBqMujfyVHFqKAuWybMvKFLEkSFch7/IXaDffvhbK0o4bX+oHVGy2pFk1R\nDSk5DW1kYMecogBv0FEE1KvcjJwNeWBpvudcbu38x59E0ogzp0YolESZOvhW\nBp1+LDHNtaHlHbIoNDXpzpOwaxvR44xP7ymR/qc76eg9/GhIBMPXDbhXm0nt\njfgfpEGxmBa1gRnhI8y1LcrBwp68QB12YuFFyLyu7aaGTfvSOs+ImUSEBj+4\nkFJO\r\n=pLMb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"e1da9026404cfc1e3c69bf73a659127ad5bad47c","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.138","@balena/jellyfish-environment":"^2.2.52","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.13.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.162-renovate-non-major-e1da9026404cfc1e3c69bf73a659127ad5bad47c_1605144996660_0.9629983566929881","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.162":{"name":"@balena/jellyfish-metrics","version":"0.0.162","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.162","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5fb67701819d3b16ccac6287b2af16e6b7f2e97f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.162.tgz","fileCount":16,"integrity":"sha512-dMeYIP4zh+SbmnrIb0ioUKxsxY9t6c65UtVnzzWjnZWPDmZYLHu+X2ZOZ+F/+ZfJhE+JmYeY8ZgRCrnvhso+mQ==","signatures":[{"sig":"MEUCIQDRr0Lt0dxKUcuOQ4qM6GrB/K6hLSfnKw/DjyeGxZQmjgIgfc93P5nXJ/fAqDCJ1PsA0p7JFchvtsHzr+R1qf2QTWA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90019,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfrJLsCRA9TVsSAnZWagAA54cP/13jy28Vh9r8oVTrucgj\n7Y0FYe8q+Rhzt7ob6b/y+lzFgCTLwEdKP0eAWyUowaddEgmZrfMhYzWIhRbV\nuQO0nLmJZrkoJ8epepONY4JR1Oec83BlcnQ1GRSRdDsr7H4Zdt6LnjtwL8Uw\noog4yqsHK/8UydHanjawHFND8t1iscYDjPs8b1xp6rS70KVjyZJKAHbWCdlU\nwaMg5bHa9FWBsJ4cz+J1l03/PeNpOFkAf6nn0bHIGxAPeV7TvcdzWwe6vtU/\nMLhXsOMbvRwn1l9ALFUdXej46H+e1t5C3Y+4tBIeNshAuL8n2UEEFZD04Nne\ntctivG8Fp4LSIQyVmoYxzr+roISq2Mku+xqGBm15VAJUiqeJntAXrgdDBKo8\nsOLfXdsjX2p+9NtNzZ8USAHXX7X/uJvIB5nZLAOWAwwhOBm5rg6yyBIqdH6w\nJP7zmYxR2OeVboTYbhU2LUCeCCWekKv8pSitqBO4aJOH8hjcPzRF4uFyGBsz\nf3jvFg+lUWkeoMHbj9NeblcWtHOdkWos5OveEtpGn0ut+q33jh2DVuggQwQM\nrk9Ak07rLon73W1+y4w15K7ZcW30phzOpy2yP3M1CuVMRvRNsA3kNPBkg+Om\nm1l/DH09Z9OKJEsixdn8NHpx4KOJm+xqlyS3sEyBH/8pCbtwfMJtMRcsF/Ce\nXEgD\r\n=FJDc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"9e18eb4acca6dddd25b8bfff683ee7b0d27588ae","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.138","@balena/jellyfish-environment":"^2.2.52","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.13.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.162_1605145324403_0.6467351544238857","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.163-renovate-non-major-509197b4c3d6617eafb946a2b86ee11a8a4a9a4b":{"name":"@balena/jellyfish-metrics","version":"0.0.163-renovate-non-major-509197b4c3d6617eafb946a2b86ee11a8a4a9a4b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.163-renovate-non-major-509197b4c3d6617eafb946a2b86ee11a8a4a9a4b","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7fdca82d8ae9813b0b0bfeff317ea52dc6c19d58","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.163-renovate-non-major-509197b4c3d6617eafb946a2b86ee11a8a4a9a4b.tgz","fileCount":16,"integrity":"sha512-GwHF2GIOLPDS+ZHgm4+2fzlTi7QgXfjHcCdvJWmknri8iwSXO2Vbcnc/nbfykv86daA1HDSxbu39hmOb2k9tsg==","signatures":[{"sig":"MEQCIDDuuuMBJIkzPvaw0clWP+zcRkLyqTLf4Qq1RiqXlh92AiAwSqynoDokcJKsBEip+LVOKY66jDM1FCQcPW1Hh+Bqgw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90187,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfrNyiCRA9TVsSAnZWagAAMjMQAI94SyOjXHz5mhEZxKm7\naSdwkuNzCsKJBZdedN0gsP0JjRrUp29ucpfeZ0yFY/g7n+8EzB/AIP+xHfEt\n0enOqYitUA2xhZjVlaJeHGRbNcWeyrhz+ziH2ZxbDP+afFfZcwwfo529GUmi\nUvnsOEEPX0/TYuzpzxm48PG6HlK+cvRplus7KXlnvH/kHwvpxZAxtvoY4Thc\nwpnh1E3B/JcFwN0ZPv0HoHN9VvZRLWKFM+6xambM0WZC8FY3RXFdvyWMzvvp\n7vb6Gp44ilt7hha266ROp9OSJMNAzEAIWrmyNDp4nIdGD3v7tb8G0FbX9U6f\n0ht8OzzMuTyKG9cHhXzQXPgEXlJ2kec1wINBHG5neaq121lg5h/LwLNWBetp\nktIF94BX/QM2SbBNXcA+KJJD1ZQKJVmG4+BDA5P8wc7YKySW3ykEoINRtGx3\nR6O3eXa/oUC4/eQD5e1w0PRoxFk7f84eF8QmHD1xmoRSglPlafTqM9Mep2AW\nwEjL0Pgb7RjNO6Cc4UExVEZxWCyZMKPQNrmJLqUe1IigJ9f1uHpr/uVbSTrg\nLAEbkjDZubuJoEgVaEqlE7lrw+LRi4ySqZd7quDWildR1Zaji94ODSEZfD+2\naBnH9nUeZWOR3/2oQHV/YoMRFZnlCExFnG8YJmxLTe+vcRG5S4lVgjoN27IW\nfa0X\r\n=YYlo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"509197b4c3d6617eafb946a2b86ee11a8a4a9a4b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.139","@balena/jellyfish-environment":"^2.2.52","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.13.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.163-renovate-non-major-509197b4c3d6617eafb946a2b86ee11a8a4a9a4b_1605164193610_0.4970248115234772","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.163":{"name":"@balena/jellyfish-metrics","version":"0.0.163","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.163","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"alexgg_balena","email":"alexg@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"53d1308f4e8a689234653d29442c952bb2a87b4a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.163.tgz","fileCount":16,"integrity":"sha512-ZyNlHN/jwYjCOSNy07AO+Z2vMfX42GlpLt6pE3GQro2Ijux564cP9xIBxwXvv35qPxl20LBW7biH1zXpur5VSg==","signatures":[{"sig":"MEUCIGvqvhR2NIi93UzFqNEqCoOLPsY+NqUb3k1j0HY0ZfjLAiEAgVnX51yUvjh4IzA9rvHo2gdgiLouS6oYVa6n2JrJykQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90127,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfrN1aCRA9TVsSAnZWagAAYBgP/3s8jFUvGnmCnaabj1U1\n4jo/TbeA6n61TWKj/MmM9ekXrJ2DPzRAJXbWX5Hcn7VKn6nMFNiCT9tmRqhm\nyh9i+7U0Utx4gm0BqINZbFs//NZbJsomeV6ZJh+rY8+pYRn2+X0voGD1QCvo\nv9VyMeFCV9bnRBDP5ngebsUs4xb9NarynbYtcptILrrh18KUsTobey1cwkga\na/FPK5SdAxY3rIb9aBXLTmQ9VMJLp9Hrvnrl6ajXTv/hPgviM3c95mYbWBXe\nhmlgAYXyQqNDnlv574aYkGUZtdAtBqzFdKmp+WSgEe1POj+Cne2uHcms6b+Y\nraAyaMB9piKXez9ijgzpHS1ZWMm620kj8eHgnsh6TXaGqkbwwzm7mX0ds9zr\nP9WdSNV7gevIRAwTMs6peM8t3X6dWIHR0uOcLbJ/zmlerpw0eq64s5lDAoBj\nWBvL1SxK7BdMz/m2GcxjOMz4+lRJyfOvqXGsv44LbQBs+WIwYFTMVPLOLlTX\nZlmUUjb8yPUG5FBlnSqtWx++yzNDD04+MQHjZyTWsRow1M7IVcwurGhfEQYb\nPCwYEiWOE+5DB8HHr8dD8eqEaPmcaN1HfLr9gM2uRgQmFXDMzj9eq1WB18dl\n5jY8T2RUg+xjv7aX+fpiehyed0xgSWFeLFl90e/9/G4ymrD76W+iMg4Jxhlq\nvoD1\r\n=k1X8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"9e7bd3b736c369736c0b65daac9b85df91b94ea1","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.139","@balena/jellyfish-environment":"^2.2.52","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.13.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.163_1605164378361_0.21599776092706646","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.164-renovate-non-major-64e0f5841b40756420d10168c6df00f331151c3d":{"name":"@balena/jellyfish-metrics","version":"0.0.164-renovate-non-major-64e0f5841b40756420d10168c6df00f331151c3d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.164-renovate-non-major-64e0f5841b40756420d10168c6df00f331151c3d","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"62a35dd28554ff1f5f7388925d37e8a4ad1ff502","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.164-renovate-non-major-64e0f5841b40756420d10168c6df00f331151c3d.tgz","fileCount":16,"integrity":"sha512-1QLmqf/fdWROoQKerDBKcT8S0sv6zK0ILAHZLDBSMfLEF7VzjiwWlmk9HnQafoJI0YeCo6I4qdijTgW1IDtoUA==","signatures":[{"sig":"MEUCIQDUbcQP6nEnJPhs8jnzEL5Pf4/m1x9dRz3hEYxM/8UPJwIgXx8OROcUCes2rZM1Bxg9fBfq5b/72nkCC8W+U8mQuOo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90295,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfr6ZfCRA9TVsSAnZWagAAS3sQAIBw/DV7TemEKzuoE8TV\n1IGi/ZHa63YLk1z8C055PqgwbLU81CnREmuoihQzc/Jgc6Ig6PJDerlR2dy2\nbMRPUFqlMFGjiPUQGAgpa4wmgBCsEU2hKNdcOUxHVkAwQk8nuN1Q9VAoDcex\nO7oUYiA/kAsL3ielY+O6nnxrBxNF3+RyvXXrIkjb22HWTZfQ3kXBPE1+aJp2\n4cRThxRP0xVS9YZKp57dBl/Ix9KwhOOrAOLUJ7oRd0kkODtTLVjjrkw7MEqd\nwkx307bOdd3OQW2/e5jfxGM+0EAZGkzzpxCD1gwR4j0Jk9NYYypAu0GTeiBU\ndaasIadoZOBt1iSM90tsfrtnJUXOuNwgAHGm9SsZ9+es3C4HV1m0t9+LyjYX\naXgTVRiFW/tS7m+RC+9Jdla0U6ky+FfV1S6n6WUyBYjmgicSVP+3PcA+j5DT\n+gNW3cACgpWesG38ZNg4HV58zXPGg/LTvk4hgD7DfZenHJwjiN56TRSRI2X+\nQU7jfhMXxnRYMrtIR/Pj+hWlS6GSSmc9PlLny3as14ulhJKDQnIUNV+MkxRD\n44UD2RJ1ab/n8gQOJhh2ufLce9Pb9zxQCLrkGg+4IZCHgcDMBhuPhUxd8fv8\n15DIzSeKnomZ3MWnBU/wf3lULqyU6fyQ7LMDVB09EUD+dx+5W0Kf9pTHmspD\nN8YC\r\n=kjkp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"64e0f5841b40756420d10168c6df00f331151c3d","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.140","@balena/jellyfish-environment":"^2.2.52","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.13.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.164-renovate-non-major-64e0f5841b40756420d10168c6df00f331151c3d_1605346911416_0.9664692940766","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.164":{"name":"@balena/jellyfish-metrics","version":"0.0.164","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.164","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cbf6fb67fbd8c4f640a45e0502b2bc2008a82303","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.164.tgz","fileCount":16,"integrity":"sha512-hQ6jNxb0a3EtJnyL9qngl9dxUbV9TdqBjkRx3zXLadzyQiUFafocZnlThzIyn9bhfVRuqHGOoEcV0FvxJP18MA==","signatures":[{"sig":"MEUCIQCLZfASA67dyevWTPsigAO6JbZqwF4+udcUbvfstX29rwIgaUlFBttydygcVPMiDR2Okrne1zlSLDX7O3X33Wd6lWU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90235,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfr6cTCRA9TVsSAnZWagAAkPAP/j/I9RPjqT8nppEBf6xs\nOcooEyevywtE2jNLDZGQta35RRr6Z0iAi/B+hTCsTjPZmoICvVZvGgZ8k+PI\nfOZ+YH57i+6sUHuzu/bYoObYM42Z9lPBlMNYSvZ2l0drCI+bpw43Twj6oXYB\nu4xCE55uJoDZWhnnOBmp8Ss05V+ajKMhJorcqM+Blz177FHJ3vZnQ+VQw64v\njUNGgXU3PNlwQCrk6AY6tOBXL+nLNK8AWM+YwIyGOpT4Af38Teiby8WEBoRS\ntQzIGJNvDRvgOOt+vYO2wGiDT0ssLpBm7/dPUoL/nm4D081gEF4KWFLNPHmI\nUQMIBsNNrvgo795vlezh2Mg7spPUUN9i7oG5mOccXK18kP45dQn566+Xo/Yd\nupkdwgiOu3+byLhpJO+Cl/WO9/8eWJzX3Ci74hvlgEAbk5Fd2jvKvXLH5Xpr\nhUYjvLCDhKK54+F03CLfLr2RyNPa1jSkcMFSvFVQSV64k3667UROhHd1Kcfj\n9+oDmg4DR6z9HRnpBDXkbkz9ZEqClverl3998vWSE7EVA6457neovAkV+Rmb\nILuJr6qH74uHcG8TDPmI+gEV7VlqjScqF7cS+vzZ/Pr2rBch80VUyajZMaff\n46OPATRHz2p9pY16bWcx99y9meFELP4aiVD6kQRFpsidk/B8P39L7J7T0IMp\nvS/y\r\n=yIff\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"efb575f3ce1e2f9d3b9c0fe90f35785105a855d5","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.140","@balena/jellyfish-environment":"^2.2.52","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.13.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.164_1605347090887_0.9760899652999953","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.165-renovate-non-major-0c2ff3274e42ebac8cd1eacef2800ad027f56527":{"name":"@balena/jellyfish-metrics","version":"0.0.165-renovate-non-major-0c2ff3274e42ebac8cd1eacef2800ad027f56527","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.165-renovate-non-major-0c2ff3274e42ebac8cd1eacef2800ad027f56527","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0cd87048c72679832284972c7e8e3d29e1172084","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.165-renovate-non-major-0c2ff3274e42ebac8cd1eacef2800ad027f56527.tgz","fileCount":16,"integrity":"sha512-zWHKwwPMk7tm50K8e2jck92Hu2oEtoIXPOsDzDBGonPES6myOty+V0eqEYcRlwdPNp2AbFIG0hPQNfN/mEUH2Q==","signatures":[{"sig":"MEYCIQDIaNZVpk5XIoW9TLd+J+2XbOU7IUcrHtHaIcxzTNtu0AIhAMMq6XJC8EZoNjT2pVhn32+aZpjmryA26IALIegzLTli","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90397,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfr8gWCRA9TVsSAnZWagAAtZYQAJNMeLqnqIxceEZwZKED\nKjFoQ4qRygdvqz2syFEYg2CUG64W+SYZSPR09Mv16T71HDAaVaNol0sZA/HJ\n4OmUlMmWtZ/uEFYGoWZHdWfGO5PJoe/0RYsKJyqxl7uS1xUq4grC6AOqlY5q\neS0lLpv122Jf89HEEaY116BLruTF9cCwVo6CDYZR70wgV09z6og2ZztpHrJ0\n9mE8Ff7ByFSQJ24dZsKWqvpgQWEWzzdYBv5X6X9DDRsr353IyXCut7gKnPNY\n8LVAEhU7gXuv7tu2yFH2drdCMAn4nThAqAEWMPSn3zPt6s7ZXTs/Rm5A7K7f\n8iDXlvSPyoodTeTk9xpFXUdTzj8ZxJzd5nZ2qmUyTLq8OqlqAun0RyAE2Tap\now5E44kzvpdiL0JfMiJQ5tbQjrGkJ8RuaeWu4EB7+iLfS+yaJx3MHb48ZWsD\ni7QkqsgWCcoJbtY1u6cYY6Bff11NPOg7OyXNmdAJ+Q1/p8iV7L6GawqhdXuz\nAiCmaHUAsJyP4ZkNJuMOjQBgzbUQ5Q9MMu0W/T35SE8xNacqUT63iEeHCVuS\nZrZZ2el60jRF0q+uDM/+dJTz+TGNsUO1b+ufmbPaqYlcTP/6YZPVefUTnw3X\n+PJpaTyiDRixb+szXhkal3Ixjlb0NnNvXwYFShk8nf33A/pgbE3dfJuVeLK9\na93F\r\n=ycC+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"0c2ff3274e42ebac8cd1eacef2800ad027f56527","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.140","@balena/jellyfish-environment":"^2.2.52","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.13.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.165-renovate-non-major-0c2ff3274e42ebac8cd1eacef2800ad027f56527_1605355542227_0.2055660780956885","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.165":{"name":"@balena/jellyfish-metrics","version":"0.0.165","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.165","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8571f9cace39881fbd9092b852353175df92eb63","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.165.tgz","fileCount":16,"integrity":"sha512-BMaxoSm3T5B3h45b1BCu47R31QLJgPTnWbGHfDDlwzaRFWEf/+qPf/gJn7Ax91J7AMFz0cKwD5/QQTPxQCRstg==","signatures":[{"sig":"MEUCIQD6gfqDKzraFRIXGq1hA1swL4IqPQk7k4atI27F438mVwIgZF1xvIJsEkada49/V6LLU4CRlCZrin1QNtgMoXbNNNc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90337,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfr8l/CRA9TVsSAnZWagAAvz8P/iD6Dgda65ZMHprHRTqM\n0odj31vS2LxNV6QPfz9XJ7UUysTYEYZaOqrGWKpIhFLFO7+64yYYVMu/dxcs\niAIQuZFjANbk+V2WugN28JvZXymBZ56KESRLr1mcj5xx3uLkQO9YAkEqFxgy\nQsDRtLHJ9FG02GyHeC2LVUJTtrmjR6pmaX/offwkPuiEZTwjb9GxJ1VasgKU\n3SkIAaGcsYK4c4qWx2zEbgRuGaiLdjQnT1hnx18AqQZlzJpOpma7TF72KqSt\njvWB6qPnAxr9U8tNAJmhP1KGD+mEw8OcLpoXg9L6MbBxklqt+6qWcMBY/kgy\nVLS9SGwY+Vr5tJb0WHsQRU3XjI3I/nhAgCjuFlM7JKYOoEOjF+jrrgMqsCLl\n8D3Xx7CU1QNmVSntm/v0kUhYFVKysPG3FmQICQgqxkYOJbjDQ7iW/z9caGV6\np5Fxkur88N/8qaQb6/4qR1XsfPfbrAXHLxoXnLYxbu8CIVWcEq+mCcMYEAi1\nQjF2RQECHO9kqvV3Ek0Cle9traCCBPFCnyKGQ1q25UymgWVf5FnSXEcePWY4\nQ5A/oZyAFUmPPp2SG2/KEX3HHKA+TR+581Zy5n7nxNpG1PUAUTq29pydcZff\nKukBVhFIuMcEqWLb/OJxjBRN2LkNLqHjxubxyJFQhBgq2NLKQH6Bz6NJV5M4\nTMjw\r\n=mfkK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"3e4875f7a47b1f59d1fc1ad049bb5f2086508851","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.140","@balena/jellyfish-environment":"^2.2.52","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.13.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.165_1605355902518_0.7905466222664588","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.166-renovate-non-major-7dcc5a430ccb4ff2311c584f8f6a9eedb0e30ded":{"name":"@balena/jellyfish-metrics","version":"0.0.166-renovate-non-major-7dcc5a430ccb4ff2311c584f8f6a9eedb0e30ded","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.166-renovate-non-major-7dcc5a430ccb4ff2311c584f8f6a9eedb0e30ded","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e5db8fd4091a9495f283e049e86e72df1a31e630","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.166-renovate-non-major-7dcc5a430ccb4ff2311c584f8f6a9eedb0e30ded.tgz","fileCount":16,"integrity":"sha512-AV3bffH7BOMBfPDD5/O2UARVW8Kp8lhSEMpP3IJtg3gDkS//o1dTY+eBnbbaFES85JAaf14NGrWkY6jQlPrHUQ==","signatures":[{"sig":"MEYCIQDqtBPJc2vJzyV0OCsdIDQ9+LUF70uvnto4MyOKZ0pzeQIhAOCsHJit5+8Xy3uwZ9bJo4kvaFDRCK09yrCii71jN2VT","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90505,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfr+CkCRA9TVsSAnZWagAAHkEP/3tah69HlRc4MuoS5bfF\nYxBE3xUtcWrdfYkkoJifrZrpKBXDbLSOEz+6WKY/mmkrBQLZk2tfvVM97jYC\n7nQiK2C1yWAIzo6EYdb7JNmb+vSkbTB1JZKnnL2ndl5/eUYV5t77ijHnXoY2\n30LGVVhI7ua3yeHCmnAb/R84vdW6QTWB/QAaJ6sN604+1ssn0c92CFP181mM\nG6dw9bVs5PP3+flIeVjzBpt1uhBSugVx6/LEkq1/fvuw6ltzUFMXxCMMWNwp\nPVgDsysKib098ehhkaQhOJBSlE2kOMh0AG4E3d/30V3o1+7QwHoEd5Zb4zc5\nfOVSxaLbIhShFcSsujK4jNTSZRXRLwJ+iMskPYpbd02AZ2181FFiUdpBQa4c\nnxBjpCqC1bNdqIVfZz0AbfVdnWNqSojiQL1gBa+C6R6JJ/LAxxJaPk/s+N7v\nBCJEuG3AEg2Jk8J0wrrCJWDqZia+uiaAlL+zB3Au4wWfCsQfajqR6jLYIDjs\nyqlp/DKFxq9KlubUqAL7svYIBXqa6Igvq86KY53CTIejH0eOGc+ZNztfBfdx\nJI25i5ItxOdzDw7Gax1705SwS5oQ4JQjrfU47ibSGCeNxirVHzRSbkjVROJ4\nSZfy3wUOYup/6k3XEQvXMb8mrq7g/tmbXTZKbAZeoCo1qztvdkEXgFeRXrq9\nMqQE\r\n=0jK0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"7dcc5a430ccb4ff2311c584f8f6a9eedb0e30ded","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.141","@balena/jellyfish-environment":"^2.2.52","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.13.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.166-renovate-non-major-7dcc5a430ccb4ff2311c584f8f6a9eedb0e30ded_1605361827968_0.11255510310687278","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.166":{"name":"@balena/jellyfish-metrics","version":"0.0.166","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.166","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b508fdab7e113fc20878106314dfa256b3c26cc7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.166.tgz","fileCount":16,"integrity":"sha512-vNL6CX5cV8YbR4E9d3uFtWZMJMtOenP+tshgh+zdM7B0rFSLxeikP48b9TrRNR1KYtVgpMnvHmYXUh9hJGNZOQ==","signatures":[{"sig":"MEYCIQCvh9kOPtDjzsbueVMAsRJYtUeqqKwsWPy+1FW7IO4SVgIhAO+63pT3RL8bxdCQDDn4WLVKLgchrbwNpoAtaql/XhSC","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90445,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfr+FJCRA9TVsSAnZWagAAk/kP/jI7dw2W9I6RsAKnDv6L\nlcm2MIG7K/6v5psDU71yc/CEWI6kD5QRxjHgF9b7yEhr2B25GtOZweojCLtC\nWMe6/FFNuUQ0fGN/PKFx3HM+lNTOzz3tlojtR7hyhKINGRl4tdfDt0RzkgL6\nPE0pjvpMJ6ufJW/6EOiszreQAJpc5oZC8dxmoPn3ap0m3He5c5fruVScAGZz\nNBqgfwWA3/wQaZdv7h9dtAlaPudIuZZ80z9vqKQBkva6XDNl+K5o5DeuzjER\nI0mxW23xze0V42NnEDuWraXellPVrLU2rWUVjmenQ67BcUQumKMselcaUbEK\nmqXoOIRol24htMCTO2nvrfSzMSsP6zuFDaTUemXLv9He93kPa6i0QSrl512o\nnysEHjIKxAq4Md5dOO9+nEqpSFfVdIjeQ2aURHCWsCvBRKjTSHqPpz7R5YA5\nT+x75vDjXDJwmxNpf6WmBF46NXwGIVMbe4F5Sr+3jZQ0kIiUbLz7WQEEXz8a\n1nm/wgyp61m8L1sAs1v7wK/kAv4Eal4WsXq3xRBmvodEw/TX+pEKHPcmMWqG\ndSxDuUaKIJ2aQ7D4tzaZwr+2L/3C6j4AGkdN65WLBGX1yRyyOgmdfY3owjgL\n5yPosFTJIWrYW2Effcz/0sUHsffwpuqQgUT6R5ZSaavPprRP1Jt3cIMSsV/p\ndqwY\r\n=VgiI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"8d6eacd63585436ef1b4a298e9b8de6610ed186e","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.141","@balena/jellyfish-environment":"^2.2.52","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.13.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.166_1605361993206_0.15520435850228043","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.167-renovate-non-major-820a1222fcfffa4a23198f57b6db3fba0a66d629":{"name":"@balena/jellyfish-metrics","version":"0.0.167-renovate-non-major-820a1222fcfffa4a23198f57b6db3fba0a66d629","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.167-renovate-non-major-820a1222fcfffa4a23198f57b6db3fba0a66d629","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"60132120da3cd1521d84b9d78da87aea8559786f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.167-renovate-non-major-820a1222fcfffa4a23198f57b6db3fba0a66d629.tgz","fileCount":16,"integrity":"sha512-+8UB84Xss2TAnOBiEWzHst2LG7X6/7KVhcjH6S4R5l4IWhOfsRqY3GsXabBqkAWcJcpTaZBTJfZxqvlJWoLj0Q==","signatures":[{"sig":"MEYCIQCQaZmrttdVxXu4XxZ5yD+VhAYm98U5DQ6W90P1fyVAFAIhAK9dF6rBlNf8GMQz0K9Zjj5HiPv0WkSAU+y+23BTWIcV","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90617,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfr+yfCRA9TVsSAnZWagAAaPYP/0utepLgctLz5IrRd6YN\npepRqDcJcITUp2gZxFmsKEMI9L23aBkM19UtoEPqKPDOeXa6VhbQ5GuJo/Ge\n7Bt3Jv+v3PVG9rD+sWKWRT9yE19eY40E+E9dLqHbnk2+hpOgZvvYHFGkQdj5\nJGZzKLkQLE0mCb18t+UOvb+5EpCrSfwOqzHrpAcpl1MtiQueLSD9/G4mWSML\nBQIDVRDG7P6clljmChethqf3z7ti/lr6kHcYp5ivd/snCA67m5LqLQtK7DOY\nWg1p+a4i739dLBZl9uVXymEluR1BzJwSEQMO1cM954S5ywy0wFz8Z7uuGHke\nYEwbVJ80kQ4ri+3og8GIjN1eno02d0+aXyq4HpDfE69hNNQIunBbFylj4Yd9\nfuQgG2D4NoAPGBAuyEekqMcUsIayhkDoNbOczihFEhtHkRHC5dK9FHIW3W9a\njfA8lrk7rEO2M1az0IW9NZ4WXiNwRSsheBAItoTneSez9Phd6ta0Crip5s9g\n+Yc03mu16o4+R7F1GRcB5qL21rBH/W8OzAWImA4W7Ek4byJlQFvGeAoidi2p\ngSQ6OrRaebOtlGUYysYSuZezt3A/4Sw1km3dL1Ai3Olh8mVVlL7nHK1goBXo\n5yApjXFoOVJSfKpNRq5pi7ct7uGeyfczKbiLsNRrYEyECMIGI+Yny+enBRwV\nGKBV\r\n=rwkM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"820a1222fcfffa4a23198f57b6db3fba0a66d629","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.141","@balena/jellyfish-environment":"^2.2.53","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.13.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.167-renovate-non-major-820a1222fcfffa4a23198f57b6db3fba0a66d629_1605364895194_0.001936430925788546","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.167":{"name":"@balena/jellyfish-metrics","version":"0.0.167","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.167","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ef202bfec3cbdd167839ddfa2f851f6b2bc95af3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.167.tgz","fileCount":16,"integrity":"sha512-Wc6SV9D/bAFwXnamR+fJQk9uvWxWAn7NJqTDNr0ULeivGrmmeQXZVjAV5GEljDRpXMgaFBOmcYXAB6AfwJOT9g==","signatures":[{"sig":"MEUCIQDPsiqqwSSAthSn2ajgJeGQW19Y+BiVJpb7jOpA+6V7PwIgb6N7Y0uOPYYXD0dZ5BJJVrGaZUWceTMvvlUwAdq1niU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90557,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfr+1RCRA9TVsSAnZWagAAODQP+wXVV4/CdaSy92+ZoRLE\nD3osYfluBYTgZKVUYPvCDBl4Z1QUTabqG2I7AFe4ROmUxiI99BJBrZ6xI5wX\nbLb7gbcu4IAcsvOMAHivIkCXTKITWKh7ls2xdBm2e8ErrSUbwBCau5HLwUeC\nT/MixCdezxeYsi8Ynkwsbi41xmVn0UD+K9qL2au7GC6ewUNBtO+VBeFkKhj8\nb+KGhKWblSQtva4bt8V3b5rTILlnktA8/He/hRsAOUOeRzQjunqUcUFmZEXx\nPpfWtZEr4wes2IyXHzhXqIsfceSv+sq5+b3BrPYb/Zdl5Jm9iT670HZSs3or\nfVJnfKMIs+HcLe8KbJzbKyYGgJHPFqRAyFU2hK8dIfoiFwuyNr5F0mOYGmNb\nNP2GPbMwF1DxkjoL+K8gYfUHuV+10mcjdujcOT4R5t6VVE30Qj8dJm2IPMXs\nSBEGYJAoFCfz8roWvZAYhcNHhjhONAt0aBl++NSipwCyljBIpDtJQEo6l+CW\n0w69tJ3BXZ4kEPmXMwyKKukAX8XDBbbAeylv7FZxMj6QjWHSuWErzH53i1bo\nmDZTQLQa4m/Fc75hf3NyfJas2/KkOXIoeU1hlbuV1fxZJfzrp3CC1GgohoAa\nXui/AGaCpg4xSYqTIh7xmbHUUG2FFl5x3YtLsnOwt3tFTTHH8rPckur13JTB\neEsP\r\n=Fdpg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"61183d1625a8f6e5024351e778d81d89be7f8c2c","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.141","@balena/jellyfish-environment":"^2.2.53","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.13.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.167_1605365073079_0.5501222178008638","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.168-renovate-non-major-14f84f69bf16c38e4c02c47f7f7c2b1c6e437c15":{"name":"@balena/jellyfish-metrics","version":"0.0.168-renovate-non-major-14f84f69bf16c38e4c02c47f7f7c2b1c6e437c15","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.168-renovate-non-major-14f84f69bf16c38e4c02c47f7f7c2b1c6e437c15","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8721ffe131e91f91251bafbd2ac505008f6081c6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.168-renovate-non-major-14f84f69bf16c38e4c02c47f7f7c2b1c6e437c15.tgz","fileCount":16,"integrity":"sha512-fWQk6+5Zwr6z7cwBQhAFoSCMGDuqP6skp6RqGlUiS6GAMSCgXfWYgTbcdAE4Hqoh++gu5RUKo56V+Xd9W8O5aA==","signatures":[{"sig":"MEQCIHKqNYrR7Z1KTTzv6PQWayH22+DN5BDccT8IeaYcTbyhAiA8Djq+hgfXPrI9HUzBicawyBYvvPPN4wk9f9BPI96Msw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90725,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfr/qUCRA9TVsSAnZWagAAK+sP/3bEAZGy0fuLlSY0hIY7\nUdzC4lJXBzybz9Nx9nzkJRqalRZBY/qGcX2YnAsyNpIBWm8Pfxg5bvRm5CRY\nWuA8OzQCUTpcLWLxouXdaRrSDkPK9yj21BEA6x9l23HLlG1WL7S1U/Jg18zg\ngpipHiB1TXu//EtuVJ/B2XAxreqEyMLw1I967WokDhy+mm2VNGwNkNiO6O5Y\nGQKYuADn1QgMCHz9vbsavMMgsw3usmfEOeR7cpT+i60xM23ZwQ6zbMaELigu\nvF22+AZbasbmz3au0JGgOMMRiYJRrPih+N4970GAdFDIb2QqoOTeNocaJyuC\ncXSH7mYtTDtKd/gByxKttDLkt3TDnG2QmHqkyhSdJqHy6eBkyk1iBeRWBs4Z\n2Ld2SLs4phCpOMONurVXNSf4hPFm2xtsN+ir4qfCd8lGzV0g5ITMvvq4v3nA\nMQXBod4dNNVm13LcNG9xwj79Tgvzta8vhCOuo63b5tI85zOUUwK7Cd65RvhJ\nP9FNuQ+37mEixYu8oS5sF5lEoE3j4wah+NzIkxZxlRW4jPMmW95v61w6TAOu\nDPPtbd8FGCnqTEuV72Kqz6AMKfSIxzQICp8Fycmk7GrnBSc1gGzFnD2v99P3\nmmR4abd0ks/ClZoPm2ZshIeiQkDFl/TQhDNasJcwh8Q+t4/slaLZ0G1cjUY1\nUJ3X\r\n=BBdu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"14f84f69bf16c38e4c02c47f7f7c2b1c6e437c15","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.142","@balena/jellyfish-environment":"^2.2.53","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.13.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.168-renovate-non-major-14f84f69bf16c38e4c02c47f7f7c2b1c6e437c15_1605368467535_0.2842363657383269","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.168":{"name":"@balena/jellyfish-metrics","version":"0.0.168","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.168","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b5693ce03e6d89427c78fcc214d6e9386e7bd3a8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.168.tgz","fileCount":16,"integrity":"sha512-tUhouuXAAiSRMLg2FwACpEMG7GA+OZt4buNzLEiCzkhISaOdKqypEk4hoL1nubfuoJ94RPKsHWr06f6vWJrW0Q==","signatures":[{"sig":"MEUCICUKNTyDGMw2w+KB57KN7RbgsDxE4m03TxUCzrFi9K8uAiEAyq37m8+m87i886WBY0O5fs5649KUJyrm0DkVplNzNGY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90665,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfr/tnCRA9TVsSAnZWagAAt90P/1RHXUhyGmfrcj98pDSA\nWyQnlxcN4l7+/sXHUDbkc8kRV92NaMKiojgrvkrE2loJw6pfpWk149B87Bw9\n5JJYfHsEvvQzOsu6mpvya0UeUkS9WuXicrRMGcDoILs4+mWTtM2isdLoGfKn\nxNE17/w70MlJwhmY/q4w72TBM4p6dyZ4tOS7k8QOVz14Ap0w2zImdtGt12tW\n8QX/+Ex82w5wJWXOKg7vAx6SHBWpSxQOPHDUDK5/O2W/hAHDHHwNf9ke/r2n\nUNvz9QOMlyXEY92CiaIazfaQkmasDABvAETvU6gkWK3iUSyDEBKcYX/LOsHS\nA4IVShOiu/SGe1gI1V57g+QlRSwlvYlnP5qIuMG+JBy0ViGCHXoAlWPGc2gn\nlyHFyaKjfrYPDAy6Ro1ZHOOLPesfaX6L8tVfkomKAdJyrpgty9mXEAOnHtvl\neYv0Xt8lOMr46cGT65eeasFQTm/pG8JWW3oJomu+oIDU5j328R47UWCN6dV+\ngOa7ebLxzTu3VKIFYNn25OypvbwgcSZ2UnaeOwoIIcZN5jr6IWfxg4pTcnho\nEXW6Z1VIRsGrYREgrZ7evptSJTE02bOq8mLjdD3a5RNg/5yH4zGtdytRan5T\nDtydQaAfmEVUKx26LrgCpvJ/hfxOCg4dd7lkY26usi+1fcl7kGkgDaki9BsL\ni08L\r\n=63cO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"05921bc629d127d2eb723833fddbbc77b512a081","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.142","@balena/jellyfish-environment":"^2.2.53","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.13.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.168_1605368678953_0.9071815100656448","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.169-renovate-non-major-928f3af6b499c6db298e56c2eb2bad94604ccefd":{"name":"@balena/jellyfish-metrics","version":"0.0.169-renovate-non-major-928f3af6b499c6db298e56c2eb2bad94604ccefd","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.169-renovate-non-major-928f3af6b499c6db298e56c2eb2bad94604ccefd","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7c09645168c20cc8ca9e3f752b7b15444e522ce8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.169-renovate-non-major-928f3af6b499c6db298e56c2eb2bad94604ccefd.tgz","fileCount":16,"integrity":"sha512-q0rxmvtio10V8d5aluNGCFe9kRwGHfsfIAVTgBcEvVk8M1EHCpoKQqBkTy+ITBjkwzZ4Zu8fNuJxxWoANcxVVQ==","signatures":[{"sig":"MEUCIG02KA1OBsusCuORE1SClG5Kzp5Lf5tT8yj5EfA77NvLAiEAulky8bZxefmBZaRLPmgFnLPmn2Cj86t5eKlJL7jH504=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftcpKCRA9TVsSAnZWagAAhi0P/0jTvDs3e9rB3KITLFHT\nUl1L+dPPgvbxDUaZlOB+SBxLZr8ZAgc9aqBHFDZ5Ix2v60FzRZPFNChn2veq\nK3YJnDAWSCpKXI9KJmbSbIfFYwKXO/Nk66MXxxzl9H/76+bhCbx5BaahhNh7\nvHgUcDtzHED4DIhmJgf+HU+DFp9v7yLUPi6w/cAJ53nBpzPawCC72q7Iifiu\n65M0YIXCt4ipJvCsA0RGgyCE/1sJEAqe7FWZyXBauhPNHTtXAwu+zjLQOFZ6\njU4id/BySIjFEpd/+nDjYRgwhr0r6NeN3GRXu5vX/8AuuTeH3j3RDPTAFi3T\nqK8DR/rKRjf2NSw8TWB+yW7elxnivmIskZ19REPgWvt46SaFu7YlZYevLh+N\nudkCTTd354rNn0iwDMmtTF6bUfro9qZ0LpBZbZ5QtAifM3kZXR+u82jQz8X5\npaXREZFLYEhJeMhoolVAQ35YP6Yv4y4HFZkl9nIWShAnXq0CQVn/0Ae6Fj55\nFqs2Zc8XFBlCUDca9CkQwIeXpwuHqXdwq9QWFCSr3P20xQFO09x1zkmMUwu5\nt2qZ+UmurXWjO/DmzBKxiIk+HJHxogsBrFAn2OYMQTrJlL1y0wbvw6/jUxy1\nYYD0T6xc9C2P6ZqTLCLNl1c/rJph11Ux620i42h7QHaLmFDcjmRar4Fiv/B1\nIT5r\r\n=X98a\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"928f3af6b499c6db298e56c2eb2bad94604ccefd","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.142","@balena/jellyfish-environment":"^2.2.53","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.13.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.169-renovate-non-major-928f3af6b499c6db298e56c2eb2bad94604ccefd_1605749321614_0.733903765746363","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.169-renovate-non-major-fb91722b89686737baf007dce9e85a35bb24aaa6":{"name":"@balena/jellyfish-metrics","version":"0.0.169-renovate-non-major-fb91722b89686737baf007dce9e85a35bb24aaa6","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.169-renovate-non-major-fb91722b89686737baf007dce9e85a35bb24aaa6","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0911cf4ec670159293624b960b359176e884a257","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.169-renovate-non-major-fb91722b89686737baf007dce9e85a35bb24aaa6.tgz","fileCount":16,"integrity":"sha512-6WjnVxm04csS+8VhWWl2hNYIDuF0ZMDjJzb0HN2F2sBGwcs613SK5k6BTXZyHlKVXhq764dqQqaBuL2CSTAQ+w==","signatures":[{"sig":"MEUCIAxR3XvruxdGkRaHB04TdRa8u6HHo/+Wu19bc1BEdpfkAiEAp1vSMiYYmFCAoS6/xL5dE14cZTAG0t/+G+Zl5MAgO8k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90795,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftdGACRA9TVsSAnZWagAAcz0QAI/X6jO0HOT8BQiLX8Lo\nXHt3oneiqyl65iGrSw+xJl6vpI29umUPKjaEHaaD5FivvdG8UveEf/PmzN+G\nbi5ckG8E8nZ1m3Zy7Uwhwco+zYcGQiD3tBnyp2C8Wz75OdteWEE5RnH6Ra38\n7UGJG94IYMsmiutimLLQurmVlspU2kve1AVUrar4KnF0U2XGyYhnFsqukmIO\nDp+2hOoSljwR2xGK9kTAhXOj/SFUiWa/Rdnj4v6RGII+xMcgYVwJ3J9Ex3ck\nkWN0TjJ0Zwu+lvD0EZaOr6/p4mzAakiPFKN37V4INaaMfMG9kX1ZbcnH89nZ\n5SMVWld82bcyxnDFeV/4jQ19XhImww+i6fe8T19N+Me+dLFuNJuEMP21uY7Z\nfKynnxWNKzkMUA4fKDwdCn2iILbLEkgTstEl15e75FkhPtUiyEu747ZMmVmm\nAqStVyRFviD6fK3dgMpia8SQhk0V4/RMfKR4oPNr5fEJYPg/qZQpvS7kk/Nj\nCtAodFoT2F0w/QbpuUf+6IbekU7YbFQmrif5XhjOQ3/OdzOu47QhSBIAYyBZ\nHJ1BJIpO0ocYKvBQFOWvIsT1CyfQdMyRyj2+r12cjUGFaG2LLXDRsitgrGAA\ntd/B0/ENWyy28LLKINqJoQ5rmDflBGxgDSNwIBQ+p102aEGbNKjPQZJI2OC4\nSgm/\r\n=BW9q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"fb91722b89686737baf007dce9e85a35bb24aaa6","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.143","@balena/jellyfish-environment":"^2.2.54","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.13.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.169-renovate-non-major-fb91722b89686737baf007dce9e85a35bb24aaa6_1605751167894_0.4284808190890317","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.169":{"name":"@balena/jellyfish-metrics","version":"0.0.169","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.169","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6d19611f51505d2f36719b740b3bd78826bff487","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.169.tgz","fileCount":16,"integrity":"sha512-rKucL4OhOC399WW3fy9t/6bp31L6cNYF2+vJ5QX8Hq6d5dGNinFwB5eT+ZR4iMINoMniZABY1MrMYhzf4XC8Rw==","signatures":[{"sig":"MEQCICMUmK29OPJeq5Q+M7sPlBAaKsFBqQASt59HoDNRS/ZdAiB8wakBWWg+e91viP5qf+wPXgy8mXw7H5+gQVUvTu5/ZQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90735,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftdKQCRA9TVsSAnZWagAAgqUP/iJAHp6EQTmMq1NH2MzN\ngbwBw6ohqiOnl+aexskZC1lE6g16Wv1T8+ym+TlAsQLo/Qw1IepxaiRVAd9f\nCRjFumq3PphHW897bH/3Cu6tmbxoVQoQpjbCQb3jWLq0Je2KdqrGUx0KkkwZ\nAmWilyWTAROuNysQWW1EyhjuxeXdwls+7LKEbiWzbn20+w591P3YsT9rfQQm\nK18ALB/WfurWB8aE7cw+8UzgnzmuxGqdLUEzrvr/PcUitRYwaCgM/Y1Bylsp\nrMMlKUXxot8v+efhvNOlN720SUALJwz+XRvd8rddw3ME1thUD9cl1ubM+ra7\naMASZLmbUxQvVJI94R+CzRdbpwVEPcbTNItE23l4vlgB6nxpRTo+74pDaw+H\nRf3HKNOP+5oW6b1e3TLSIklHKNpHsICn+Ug4a5ZubVumpOYuFbHY9A0ciiRK\nDXGSpOqtBtWnag6anOBkjS+uAhcKUhilYto8rajIunCFkKZHdGhixEb9P+9/\n1EnpO/rf1rY4dVsAPeBdLawBKHr+fW5GWJDTC4wf5QOq8UkwiTB9IWKPkmAS\nWuxxLe8XTH+9IMfMyNPhzbbjB90cH+S0G1lT9Jsl0x8KFYhHOfQsN8hCpaBJ\nRuZt1zwbNslomv39JTuKcidltdumjWAFfr+kcojKoFHzX5hZ5RMS5m04wvhs\nGb8j\r\n=/uHN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"d0f5a0632f4a68f84fe2d0f580dde55c49e195b5","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.8","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"10.20.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.143","@balena/jellyfish-environment":"^2.2.54","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.13.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.169_1605751439439_0.9988045350097972","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.170-renovate-non-major-a81d020da12a58f3d1a73febe3c2da2530d29724":{"name":"@balena/jellyfish-metrics","version":"0.0.170-renovate-non-major-a81d020da12a58f3d1a73febe3c2da2530d29724","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.170-renovate-non-major-a81d020da12a58f3d1a73febe3c2da2530d29724","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9aa3954439619e75f4996c29db566b1c7a40fb1a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.170-renovate-non-major-a81d020da12a58f3d1a73febe3c2da2530d29724.tgz","fileCount":16,"integrity":"sha512-AHTYQ6i+9re4T81ZItvMml88FWIacxq29NWYgLHbO5kBcN5kkbBtnaX5OU/2GpMES1j2wh8bo9yqvrbbNkIN1A==","signatures":[{"sig":"MEUCIQCse4LkRpvTayToNZLR/z8r65AO25eF0N9H8R5AqYz1oQIgNBO0gkVL01Z61huKXrtnW9I/uDCyOPW30P8W0EUWAQA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90903,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftwxgCRA9TVsSAnZWagAA+I8P/j/YWRnxt6jNrFMGwH+V\nNjWmyM62CXIKRgF3IvH6g/T2g4D0+aGN0s0F3xsp+MqYZycVW27g9FRZ7bEb\n8QTMP7ytA3FBohneisWEv0pDTeiuEu4NohkwshO+Ab+fB49DMd8baG1k7uWx\nmIYHdZWfhkzS35RKQIGFWcHSduhii2YEOySuCZBWucQu0gsdExfe+Fzn14LY\nrJidDyQR9WWfb1gFdl1dYAd3pgC4uVjRGgF9ZAECIDzm8A9AlWUMO3UHPFQ3\nRPLUc8wLbHG0x/o7BFuZn+yxjulzWx/S48uFrjv3QZqZIcKef/v4gREQI8CF\nGl+u+BuNvtuyKczpbNFDI3o5TwWCa72F7Nff0YhQ60CJbn6QGQdAYf/MQdaI\n7GjCjofWX8JUwV5DiToQxT1o6fFtdI5RM8UqCZnIR6zhklDGB92Vw2J55Xmo\nTi5h76ie5lOAq6wBCCh2CcXoxQJdjWtygsZo3T2Rt3fBoA0ZSg8QT7CvxeIZ\n/e0riA24rNlKcwFXa5lKMUR/z8IFW1kVLcd2qgA+I8XjduTpsi2inzgRcpNd\nyipQcpEakM3KGFWle3w4YSx/BGrHPJUJ6AwpUdpiSmX6vNfdxoVeccekati/\nAthmLst99/YZ+eMPYj3zo+8Da/lVGCXpaDY0vtlD7G9dJ7/NhYmRWIkVX2n3\ntUan\r\n=Rnqk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"a81d020da12a58f3d1a73febe3c2da2530d29724","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.144","@balena/jellyfish-environment":"^2.2.54","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.13.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.170-renovate-non-major-a81d020da12a58f3d1a73febe3c2da2530d29724_1605831775911_0.7029076857651075","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.170":{"name":"@balena/jellyfish-metrics","version":"0.0.170","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.170","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"642496dd72215ae8e9f9a6e58d52e19485e0ce9f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.170.tgz","fileCount":16,"integrity":"sha512-RZR67k+DHmf23U5bLghOkyul1SDqVwgIk4vGIp5/0WBIov2U6qlQKrW+ZzCP5m2R7FnAvjD2Pm7Ul5QWT7DE2Q==","signatures":[{"sig":"MEUCIAhe5S5CHB4nbrmxClUFoFIA2Y0jDY9tj+n1HWzE/Bl4AiEAnA3ZFKhmeeecNOTA+4O6jAsGFwPrlGZRdbX6ETXPEbk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90843,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftw0xCRA9TVsSAnZWagAARjkP/RMWG6/d4xNLOC2xy3p1\nzm//98P+paNjRHy7OBiVaFST3PQ2TOUnGaYF6uPeUf2ir71HhwkXODBwuEja\n5X9Krf3HTrov3R+7UiuWS2qIC+JrYqs/C5fqNvFG1mfRLMLPcsRd6SsOPae9\ntSAYJYm21Heamt+LtUG1CB7MQy5elcRM0myIWGLTR5ilLkukUl7FkhbaQb0j\n07TTg62d6w35ZZe4DKxvBf5IpmwEgod7zKRlc9NRzlRouXwEuswSWv9rKeGW\n6dUz7kDrfN/LWdvX3Sa8G13sG0BBOwM3aojslL9Xr1LLdMX3U8r4ZasUB7u5\nFCqejlmd2wT5TG5SPWGCT10LVqSMOz52ziWPZcfaJWqd0gA6S3IUmqI+WKQL\n9+r0zVzCLAK/XRyw/djT2KCthy7ZAges6zwOoGS8q9y7M/tJDgyXGp72elcF\nP0tEodnZiDMYEKYZUE2IauHExy4xxHVjGtZPZLWvsG3fg4eMASB1Jed1ZKpY\nqyEErFkv3wdIhCNXiyZCmZ6CD5zcsviqDWeHLaRRK/8exkxxce4+cSja5qJN\nSPUZBstW1ij1Y0bdzbKZ8yxnsuahSS4NmOFYTwuR8TBLSW0/yOITfT0nj3xs\n4ZXF1x/upywvAj9Z2AOs83JEhY0Fwi2ue6/C6wG6zUJMU1LpXaJPZpT4/i4n\nMI17\r\n=dhXE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"3f6a6957ed58bd8b4210b0c224b1c0397d503523","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.144","@balena/jellyfish-environment":"^2.2.54","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.13.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.170_1605831985356_0.8006696197142855","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.171-renovate-non-major-5125d403d7cc098b4f456b477f39acdc27078a3e":{"name":"@balena/jellyfish-metrics","version":"0.0.171-renovate-non-major-5125d403d7cc098b4f456b477f39acdc27078a3e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.171-renovate-non-major-5125d403d7cc098b4f456b477f39acdc27078a3e","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8307c35c44dff6a2ebc33367117a6d61602f16ae","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.171-renovate-non-major-5125d403d7cc098b4f456b477f39acdc27078a3e.tgz","fileCount":16,"integrity":"sha512-jvtE5ZScImAfNgWcc8enuJFhFulK0y0VPZKLNJka3sRllw87StcoLWsiGcfqzvsEa+6pX/r1qi5UP+4B+b3njw==","signatures":[{"sig":"MEUCIHe4xa/+bh6fAYzNX1FZRvtiV/B7AFuKj/cNRHCBqAIQAiEApqrahkXCXyUEHT05ra748NynvuatonNmZMAegJHoVbI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91011,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJft8jtCRA9TVsSAnZWagAAHnkP/j/t+S31AvlS/KEWgRo5\nAO5HGqzONJDWWs715FSpC+1ErG5S3mtJLa82FmawREMik5ePkAJr3KK86a8f\nNZ3vJTu4rsWw40z86w85pcCTBkJL/OnpaTYqMvMxijiHqlojECYLM9cFhvwT\nyj0bO+nKqb1Q280qbm+MfI/RGaJtlJPz4ewytfyVP4eqXxqHHP/fk9Tuj0Al\n8/l+s0VbUbVMBNq8bERWAxSuGX2phQiAAfWAli6eawUSGjdF8Thjqn6qKw1P\nwDCG50EBCyZYe+AmrqrdTp2UPvkRtrw+5mn6bYNQKpFn4j1r4otE3Ut7jtTX\ngEqoJsN3RjWvsK2VYxbSmnakEqDDFYosq0xhxJkWJh95sv4R7779tz1vseuu\n9e5Z66fuNSnpQNXrqdKJkdCkgJQZn1StXErJADM2LPGMw6IpLoAZY6nyqraR\nNkchPGn+Ld9rp50v9ptQE+D04KH+F1k689ExmFSi9XTOGl5PPvCz6yl67Gue\nzvJbTozmhfjGj4sEdgu5XHWSoALtwdJjHTSqtfihq/szEdcCAiQ1vROelWBq\nUS0AoLDxo4dKPrCqTxWrmESevvMR4ch1DcJYSJjYt7cNE4fmv26jK4M+0NkW\nYSoWPVddH27i0Msc2PgxfyHatU5DP4Lpt9NlBtxK6EM260H4qnud0v553ZA3\nxZn8\r\n=33tH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"5125d403d7cc098b4f456b477f39acdc27078a3e","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.145","@balena/jellyfish-environment":"^2.2.54","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.13.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.171-renovate-non-major-5125d403d7cc098b4f456b477f39acdc27078a3e_1605880045110_0.10846509190845444","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.171":{"name":"@balena/jellyfish-metrics","version":"0.0.171","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.171","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"75a671ed58f3ff7159a5a7d07fddc322278edce3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.171.tgz","fileCount":16,"integrity":"sha512-ZE8JjQiIK9dfrca53CBWMunFGfTOWnQcC6VjuUNH9EhnkdW/vgE9TdZB7r0A3DkEDPUpT1w8VmcYoMs08tq8SQ==","signatures":[{"sig":"MEUCIQDbv7kAQNmNf1304txQXqIkLn0sjMUIhIvxvYYvyindnwIgAW/FXUSI+Wu+2Zg5hce/20/IB99BG8OOMZ5qK/y2z88=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90951,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJft8n/CRA9TVsSAnZWagAAsEMP/267L6lDjVKKKblBvWgC\niQmvOTiv+ZTAkenqhyuIXFcm8VacJY23BIOwLELKpJcpua4o3s4sBtLeo5Ld\n75Vq2v+wmtnvNT5IhPUitVuH0QjdMjaziowifMNsyz9b1PVubczELQ6MiW6S\nEIYnaoVvvWA4DT2WwGt+W8lg3jEVOINRSP0N1E3OZrq9W1FL6QAdKDSI/A/H\nQs+RkW8bVLS0YBvqhKggI0ATZgJCsMPuSotcMK+4R6xSN+QOPq9XOMyXLVaR\nx60F+ZUb1pe+0yvwmOxtGXblb38S5I0EI+jdHdbS/pTSZ3kmBNQBtm7elBU7\na6N5mkG73FKT1mVJFGusAtiDdyQX8cqFn0qFJIE5gaGi/PN5YdSc3zGeqGM/\nX0vwFw3+JiHNJ3m1AbB87yioSl4WJKLCoFKuLGJXwD32i45ypMDfMLP7F5Qo\n+YD0urc2TRygtU4KGBqGKE201j7T7af5gfAr6tjbEesI4QXg+2bh9fjx1L/F\nfbr0twKsdWiUQerf1qhq4IQNb8JdJW3JgjTHh+vxEnlSQIb1WQtV7Xoq5avI\nhZnkyWMD3yG3dR7EwpdR4BVaC4MmuqzeIfP+dBOzLIh5eDf3THN7fNn7OOl8\nmVXRSTILD7eovMz+0Pdi6I2PpQ4NLpM8cCPN3fhLEWi57VpjQzouMONoskBx\nny+F\r\n=I4QC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"1e46e76a2ec5e7c2f67e2dcc045b79e5198a395d","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.145","@balena/jellyfish-environment":"^2.2.54","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.13.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.171_1605880318983_0.06447098264505469","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.172-renovate-non-major-744caf590123bfab2311c8494ced6dda5c8bcdd8":{"name":"@balena/jellyfish-metrics","version":"0.0.172-renovate-non-major-744caf590123bfab2311c8494ced6dda5c8bcdd8","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.172-renovate-non-major-744caf590123bfab2311c8494ced6dda5c8bcdd8","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"aa7176a7d7f17c8da0b99fd88243c2115ce430ca","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.172-renovate-non-major-744caf590123bfab2311c8494ced6dda5c8bcdd8.tgz","fileCount":16,"integrity":"sha512-SEITcESJsQgQXWLk2kWo9ayVQP+w6vdVwSHlRLa8IGCrnAbobSx9JLUT7cMeocE172s8lDgz5KkasowphvL+JQ==","signatures":[{"sig":"MEUCIBlpYlYY3bhl+DVNYQVfSMXsbez7L6ZmptmNw3/XPI7JAiEAyTtyJfRsmPlGzrKmHyCEAgiYwoS65yexiWgpisICJFY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91100,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfuEtDCRA9TVsSAnZWagAAEPEQAIXiBMBRWQSCO2TKfpfk\n0XvCoop2MSD2JLnt7RiwsXWbam2/bUe2EKAt/L/SwpdAmBuppvincVhChhzs\n4rkU0Uz2mUmsnGIfQWJ7DQSI+X5FqoUEwHcAMvBgrvVkOWOXobqxtjfGrvu0\n4eWPU6umCyaStT6b7sO1OOci7eGyS3HSB06hD2wcVJzfMQ88EcisFVO/mVKR\nduTH8EFUiv/nrFJccpX51KOshIS/F2tII2Hu5g0YGO3Ni6rUSJ8nTT94SDdD\nY64dgDPCjRWvPeAhjIsGVd7oggwqggKk+07hRk20MJs3Y/b+GdSiuzHwwMYE\nBU4Qf7cpXfIhmViRPHxeNAKdZsh41v3b2S9tkvkbPesV1mK9+3Hl7Ly4yuBQ\nBRGGa37Ia7SKiPpJA4XhpYRRmAICn1PFslxylnEdqxUqUtn6GUkHrVWERNTY\ndp+JNKrIjtGZkpLEg5h7Y606ObBHez2pT7Gc6h1Az3SqQRdmAgLP04pKE+4u\nI9iYmPazQoMaNdlo6nVrtczQF8E/+DdjMtQkhh2jKAMUC0bhk/94xF7yV4Rb\nYrT8nScErSkpmOaEtErkV1zxbntXHrCsWmzkQQfVIqnStRaEfkmSWTJbmwoa\n++CKjiqIn8XGEUNTuGJ9Kjr3A9QdZYjj44lytMvDP0onb4vSxI52AW+93A2q\nU/ws\r\n=b4Je\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"744caf590123bfab2311c8494ced6dda5c8bcdd8","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.145","@balena/jellyfish-environment":"^2.2.54","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.14.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.172-renovate-non-major-744caf590123bfab2311c8494ced6dda5c8bcdd8_1605913410531_0.5817656455761182","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.172":{"name":"@balena/jellyfish-metrics","version":"0.0.172","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.172","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"930f0a8f5d6fb4a087c44cf4a3df7f41eabccdbd","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.172.tgz","fileCount":16,"integrity":"sha512-CQw0vEj9wrb0YkpSyvHAsdsAYd/dZxgsnEsL24BUF0nG4D1iFkJzLoCx2PVv2FYZjbnHZFvq6x2q445/yq8HaA==","signatures":[{"sig":"MEUCIDQrUTszmCQgWt4bfn0j2UnWXbBkLSTUvgDUPfIUz3OFAiEAtQWwvvFP9Xa0XR0QUTNYwPGWaD8zoQ6NeQ7nIkIc37Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91040,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfuEv6CRA9TVsSAnZWagAABCwQAJ3uW4PgEEK3A6Rx6Hwd\ndcCKTkaCLmCV2boimG6k1wOrFdt9VjJMz8fGl/cfHCZnIE/nce9mNNQtLuKH\nzoeIshDAWTTuMIOH5Ra8DFj4GbBmg5Lv8OVZX8dsZOEqzJTaGyC7NoNWpWVa\nW7jjfM89ZnDPMtwyyp/jIbs0AIy88HB/SlVykVJ4OJbpU7BCf+qVLsVVhTK0\nvK5W/c7HYsEpFmf5Ea+7Uoyy/TOXXX2pu6134TyqwqArTmgqJ9RM/94p+QzW\n7vvHxMej1pg9hWG5O9QWQ/3f/4WtzZH30RD1R+9jOY8A4PhmYK8qGxD6IXwK\n/5oSRNA01waWw8iUyFSl/26Z13tzHUnI1foAR9z3AXVoqQ5WoqISB9JcROmo\n6l8cxgBDw5ty0z+6Sdvq6h/kmxm7ekzTOF1sCJj1oxDUioyqG3pEXtZZ21YX\nSKrdbJmrz7UOIYQYEnUooVDLKMuXpfWAK5LfxoS5XZ+3+83xiKz+E3fVf0B0\nmtPwEg8WWevL5Yw+OOU1lxhcFP4J5rNLY67SuJmXx+qmVeTXZsga0snT80SD\nRlmTEFit9m+ckml9gX/F85Hk+VZqEOE0TdcqCOLL/Jp2zzE7+Bpv961Y2mhc\nUYiqFwNuQl4tmXKEuCOsPYoSjdCqVaNadF6z2m8jq/d1C3sCBOVl1HHPzYoK\ng+/N\r\n=N2Nl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"b3710d703b48f127446c22c1e659b999a53640d3","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.145","@balena/jellyfish-environment":"^2.2.54","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.14.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.172_1605913593855_0.6394652524901416","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.173-renovate-non-major-2dc841e8cd09cf245d47d3c1e083140c57df225b":{"name":"@balena/jellyfish-metrics","version":"0.0.173-renovate-non-major-2dc841e8cd09cf245d47d3c1e083140c57df225b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.173-renovate-non-major-2dc841e8cd09cf245d47d3c1e083140c57df225b","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1135ec24ecab4d1a1aef4a4836769d6d87f7558b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.173-renovate-non-major-2dc841e8cd09cf245d47d3c1e083140c57df225b.tgz","fileCount":16,"integrity":"sha512-ixTy9uDU5RDH87sjsMVm1Ez9bseE1jxLYL53FXKO858ssgHnvCM7M2JFhDl1RuN8clbahJTX0XoyaB829+/pcQ==","signatures":[{"sig":"MEQCIBh7IW09lHRaR2sEJXtBrxKDixSq3X9LXIeUKFcurogKAiBkX5Er1ral+JzDVtL3+J9LUs/WWN6z9ad2+ngtuCNB9w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91170,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfuG35CRA9TVsSAnZWagAA8I8P/jJq6sPiKbL/RIjzwxlF\n6khfImq5Xe5VebXF+CeccQ9xp0tBJXAup0FoaBjQEDYoLxDqeEjZkjpJeVOE\nNXzNVfxJ3A9MRG97uu2OFSGrTun0aqpRAmj6zPH/pfmWatoxlR4f0bSTh7jy\nhMc05env+iSueL1dnu4N/GyI9W+4pDvJcib6ExijwnLdnR57pKOPWqSKrt7d\nyWFOy8wZFh7GKJ+x9uiQqI01IawvoyTZ4potuzOosdyWIRxF5lCRMtnmd1Zm\nfc/JuVN/dwOURe5xvG61wCcUtq/7Ml81kGi0j0sCI4HHUKTAkA/C4tRI1ylA\nMypwUXH70zMFPicNgm5RY8IbRJFWwaJmNQIa7+aDhOQ6mEkp4wSR+3WwOMXm\nsmrBcTNlLg2XtnvqJ+xF00Ggm9t4gPWDqNQSLe5RTU3FD4MgJ7wWi+2MSu2u\nWItebThajOL8AXI4skYhzqNcn+FL1EFv5U3PgiPMbbCSjmmppX+uCzLYU+oY\nGAACK4NFt2EET0+qvEZwZGewhnv8JfxFc6YhslyUHWeNRuTUbkvjx01W4Qb0\nd/9gw1u4TJmq3tYUtOqQIrUSQXbI9hxFbdvCM9AidgB30CQD9sTT0sFxs10k\nPWwvPFKCQT/AhyBh+q047FXpKh3wiXPofI2oWMKbVsSVAlxX4yS9vtRl5PqO\njw9p\r\n=JpSL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"2dc841e8cd09cf245d47d3c1e083140c57df225b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.146","@balena/jellyfish-environment":"^2.2.55","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.14.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.173-renovate-non-major-2dc841e8cd09cf245d47d3c1e083140c57df225b_1605922297305_0.43664295443400514","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.173":{"name":"@balena/jellyfish-metrics","version":"0.0.173","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.173","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"05f74d7350ace38d4cc608c6cc6fc1d3903ef992","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.173.tgz","fileCount":16,"integrity":"sha512-30dJAJ1HVSWpEzxE9MYWiCoVNkqfXJ/Krj7Y5OZN5Mlj72OQIhYJ7D/nCwFpw85H4WtnECfN8YNwwnrdPnVqsQ==","signatures":[{"sig":"MEUCIEuCgKudp0AJuAuwVfMxIxyztwW3OdH6lvxYQQcb4SG+AiEAhIFHKMnUcLHs1unHRU121kTM4hJgE2hFZ5xJURc9RfQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91110,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfuG67CRA9TVsSAnZWagAAai0P/2zKr6lO7mAcMYjifljo\nmPwHobK/25B6qSwECn+bMJqi+Q0rkn/Xc3pZEa4bLO/fXKOqKftgbo/kSoLe\nhhC2nFLrG/EbLpgTAw4VOvqPngq+FEKlnktGUuytJSSI7GKRLbUYZXVsiz9Y\nImwOBPyf+ZLcuVvxfrMp0LsELXk8ekVLY5h8Hc8ZKMfvTGR8XV5/j2eQMygO\n/+SghUDDIPGGD0e5U2lPM+rQc2hw+/0sVpN8cntYD68bdE+L5vtleNE07N7X\nYvWOEa7YoOy9gdOPSzQAu811JAXg4f3VUznhUK5CfdjFx0lbkpO5MviUgvAg\nwHsxBEjU9AbcKTFKLFQS0P0P9nWUZkpHtbk6/xuVJhK+a0RXQggsnLWCtuj8\nMUq730HSA1RaPH2NQKbXsti256Wg116fqT+QZ7sAYqA7bHbfgaYmQxDz4faI\nMORKJyB25cBRL8PpTcVlsF2oBMlgrjnwIJyF/Q6YD4/HeZhvhOd27y5kTjQH\nBOMRSP5bPrfuUWyG9D1UFU406TjIvS0A31PGpWjNjl3TJNX8+gw4F/X7vD4x\nQpX4YgnhOD7W0FepYgcYb3sHw1pTc4ftsOb9TPWdHroARWqln2xnLT3Ad270\nyO7dJJNMMpruvNkB1Nr25UrHZ3raYVZRKt0d2E6W/4z9aT8H7PGqp/6HcNZ8\nJA17\r\n=Xoh2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"50b1d088e54132109d72536a00ab11ac5cececf1","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.146","@balena/jellyfish-environment":"^2.2.55","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.14.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.173_1605922491267_0.9352498993397711","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.174-renovate-non-major-8b9ef52e6267197ce6e55af127764bc078b0fd32":{"name":"@balena/jellyfish-metrics","version":"0.0.174-renovate-non-major-8b9ef52e6267197ce6e55af127764bc078b0fd32","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.174-renovate-non-major-8b9ef52e6267197ce6e55af127764bc078b0fd32","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"99b3a7139fd9fbea45f5a8a06e1c29019e9ead87","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.174-renovate-non-major-8b9ef52e6267197ce6e55af127764bc078b0fd32.tgz","fileCount":16,"integrity":"sha512-DLU4bC1pIqjT1R3WVvcPaPgfOJg1ANBnrQGIXoD8btcirYM9kWS8OszFMcnBimbejNr+9dMgDe3OijsJwf+cEQ==","signatures":[{"sig":"MEUCIQDXGxMvBkHfSzyGhP/9hXOKP2nW2ojysnCIFMHMfJUCdgIgIR1S21w33Xdjx5Hggb0u19tKz4fEaMjzLA/HmNanemw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91278,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfu580CRA9TVsSAnZWagAAbbMP/jNMYZ9nZpB364s1SPDJ\nbD5nQPRXxqG9d6mP0EuXtjG5IIfUmf8c2H9+vZseWyHdfPvLsSETNPCtzRaA\neV+808CcQ/A1ZfFEiuF+hXxUTOX/3cseJQe/Z89rRjS1CxJ6NoLfwIzJqwei\ndIKNYsOHdy9YChpJ8QJRQzGyBZ4bAuKXLRZA7FidtoN6ypoTy7i6xsP50yL0\n9Iv66Rzhk/6X5MIWXO6ahuPncsN0slWvTt6ifsH9lWv8w+8b17MxESD3W7T1\n8Cs8Gq/ucCkMwjwBVDK9+erBxTLXI/PQNwjRum2/uBXdLoXW3Ymih+IQCFUG\nkQT++1JqX7LostGXOHHFxiv05wvgbXx1+HDWompYHqEqkA7N4LUWMnpewcp8\nrkRyj7PRVpWMDz7lc1EPe2g9g+/fssQp7PxwLgZjoDuOEx8/NFGJ5576/z2v\nEpgNoCBKmDgRm7SfrQPcjyRMYLV/W4MoIx11CqpQcVT+6bcniFIiQ3vIGftM\njFhJkY0cJY2jhv6ixTwY6uvV4lDyV2i9wiWCS9z6P2+dzV9HRaQ2o9I9zxmF\n9aN6Xr60SWgBckdb46i+R28iBokly+xAq7NJxjB9gdntR/qULC0u0NEBAzZw\n3rKHLmW5Ckkujz+gx6PI4lCwKnJUzxNCXcP2YjFdnXgHr8bXOzsDsi08kzxd\nsxuv\r\n=vl+Z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"8b9ef52e6267197ce6e55af127764bc078b0fd32","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.147","@balena/jellyfish-environment":"^2.2.55","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.14.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.174-renovate-non-major-8b9ef52e6267197ce6e55af127764bc078b0fd32_1606131508193_0.29657880624823374","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.174":{"name":"@balena/jellyfish-metrics","version":"0.0.174","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.174","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"edb976af33327b8f7d4a3242f763245e60010ca7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.174.tgz","fileCount":16,"integrity":"sha512-k2Bz32n065d2YZe++C/p9/ZpDg6NNb+ZckO6Ro41zBbtGltPtF2x0OnBZWNTudoPk6ZrSpRxkDCjvUCL1G/2Hg==","signatures":[{"sig":"MEQCIFQe9ba+QbF5cUT6ey1X/sl96hfDYVG49t0zPJWuemqPAiBeG2uVgD2djwutBQQRZhGivflUHPBETNztX64g+wHcaA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91218,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfu6AACRA9TVsSAnZWagAAYrsQAIhGgyQTh9FCOzX24I56\nk0+9JMvKzSKavFBh9D14q10/jqN9L/tEHrSQnPNyfy6wihbXAfFbR/zIIPW+\nr2yru61z5yE+s94+og1ApiYHj6+MdpbQqB+NzpmU3+z1qXY7qyLRb7Y3ZvS/\nBFU3+beZIvIwx0TcskO8bsa+y5A7SZShVQqSeUzK3KurHrYNLybCXEv+FgLP\nxKk510TWJrzoQps95qRPsicSR5PI+otYnZx8Npk1QjVCRfjmjPKsxxIiZy7M\nCBQ0RJzfpAAt4jjEtqEwDl027I5GMpgCDvTu9oieLJWUiGw+Qx42/gWr0bcS\nDYvIo7Qv1bxJ5sN2yIgaEeS7yDj4PIFgGXRnIkP5wTv7BUNasQ+bJC/G72ka\nrYeGascPrst26Q+fAoZyDP36J2ZSQh728HtEV+F8j1WFE+HejvkzORtUTkWQ\nyK6G5UX+Z+fZkq/VNa5ac46CmBl4v7CZqpKvZaiC4Oe3Ypmrn/NNhfr7YD7t\npMHSQl5Ybrlcm/QheaLog6yKoVzLieFY1v8fuNARimLF+NHJsLk6/kb2SC1D\nghh1PsVG7lspZ96WuklNAORJKSV6Dd2ArlpfT4AqNX+49Hp7neKarNwkHom+\nQmJCHVRqGJe88xVj8PSWUBzdwGeAIbZuXMQFdtQFkH4gXc5cZEbxGak+gyzv\nVi5X\r\n=GRZx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"6d765c1e3cb42be62c30b9609b3dd16e18a7f7bb","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.147","@balena/jellyfish-environment":"^2.2.55","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.14.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.174_1606131711993_0.41341338678160255","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.175-renovate-non-major-698ca64402b610d6922c2ddf34564dfec44067a8":{"name":"@balena/jellyfish-metrics","version":"0.0.175-renovate-non-major-698ca64402b610d6922c2ddf34564dfec44067a8","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.175-renovate-non-major-698ca64402b610d6922c2ddf34564dfec44067a8","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"53bdb70c6c5b1b81527d899790c29af64a105f45","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.175-renovate-non-major-698ca64402b610d6922c2ddf34564dfec44067a8.tgz","fileCount":16,"integrity":"sha512-S/AD21e78oSB27HTWJVsc3ekHfME1Co5G7Snc9Bn1ObEnCU6c1kd2m+gwftz69K3cmhK68E4+XyM43RnZHta0w==","signatures":[{"sig":"MEUCIEozQzlaZpaBzjvfNJ5xRX5SaURhluN+22UgP1I4H6GzAiEA2SlH3bp3rOM+kOaxNzp2ikNDUd8Kkjdma8Dk69HE0Mk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91386,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfu7VDCRA9TVsSAnZWagAAA7MP/2iupRI7CdOjo6JB2C/1\nL5ImF5uWTgn+Wrm9lCh1GGyeyoqYVyxL26TRKMsC3nKt5/02TVH3VdvSD+f6\nKI4TbC55Rxi2VdmaA3+Fs7r49XTMivqgsp83bWLs0gNOY/G69wIUrgnai6Kz\naWB0l9XeCYVfsOKRpoGYZMAfRYoyXaKcwTVu02P7onmHvB99538SPdcOx+6n\nWuEuSvIKjoz2NqHwxDlXOq7A0xVyCsBWehq/R4SPaj/ZoNTEDnpzC034Q9pS\n4nnOiT34C4sas2yd/1PDGHt5mbV9/d1Ix0P/6I4kcDxpbuCMcHk0fAE/Lpin\nIfGs5xRdwKEznVzSv+PZKFC/tvf/yK5PD0YejyVnH5yzdX8TLO0QcBpHzKFu\n5ni1xbLgdAIdpiA06e2espHfF2cvJSOM+ekOPNmRkGWXw5gBcbYfvmt1yf77\nIohTzvn/7Q1IQhyFT1+PlbKVsQtyFd6EJtjJiIColQUZySttkBwNnJ7q4A1l\ntW9KZ+zCTb4kr73VodV8MJuO2DJA9pIHOqPvMsaklHQ1GqSntoNkNo4euhoE\n5SBAFtDFJEOCmfeI0l0PdUI6iJQOsSDizD5jDbNks0+lAWv7wS4Sx7VQPUbh\no+mKVvukvc4B8aE9pMMSiJRuTFcBnKXLJFDKOE/08wx1i+k0V0toSXX7UFUW\nm7zW\r\n=3hTC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"698ca64402b610d6922c2ddf34564dfec44067a8","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.148","@balena/jellyfish-environment":"^2.2.55","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.14.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.175-renovate-non-major-698ca64402b610d6922c2ddf34564dfec44067a8_1606137155179_0.6411210648401802","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.175":{"name":"@balena/jellyfish-metrics","version":"0.0.175","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.175","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f787e5fddd466e03255dfc0a844b3ea317c36168","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.175.tgz","fileCount":16,"integrity":"sha512-QvycQ1ayWrKmQCQ110iJL6DoV6YqsKQdmnr6kyKzALjPSgx+rQsF6TwbhXlDDimYd6lby6v/2uk9aprH0mmIpA==","signatures":[{"sig":"MEUCIDz3KuRERvrtCUMS19pj+nwtiAcnDb3OILDaAR0QGkchAiEAz6J6bV4q3jhr7KPQu6XuJXwW5oISd2ZIjlPEWW/J5l8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91326,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfu7XpCRA9TVsSAnZWagAAu7QQAId2OfLcYduif/psFvUz\nM2MNJGOQpQ0YAOtEKw4FmSXBNSR4Dd/QtMuIS8O7LlfmoDqOfzptQHk6/9uR\nLV6Uk87tJKjfGopADmZQIdEmcFTbn1GyeCMgW0S5oic1IF1zm3SGtGcyxQjI\nqCZjm7xxVgjJUFciFe03EMU9LSBcdl97KHk6vobNaRuwT9DoSVl4YtaIdFj3\nzneuxOUSRgzreTY6WN96aGh0qM/fQvEIgoeXm3MD47nKMIzs0X3va8S5oFld\n0kCj7GxuAsmLnvCJtuauYbRrsZqPrKjpMcc9CrEqXksYwGVc8/23gr8cbkCn\nOL6tJc7o3aP8+w0HiZGu6qthrvzd/NRZpZGa0nvhArn+jwtA6DrhgkFF1n45\n+S/OxBmztpgB92BM+fWJIPz3Vr1muL7OtgLhp07P2Hrcv5bAafLaxmtmwA4t\nR4IZhfzQftUL4kRl5l01xVIFCAusiO3QubuBMnbz69dvLeP/WpbALHeQP9xt\nNxQJs4RZ/HPJHfycywFogrWvdCUPI0/a5KwRP458QznG0Z+QlErYAT14i+gl\nWya7EgRBSeJyUOoU0pSvBUA5wJLsU0BXU+UlDmvIg7RDUcMEyFbwPxHXJr6H\nKLtaq1seNg6FQNyss75ecLAItp4+Zyl6okUFJli1EI1WABnkADIN6MewmkEC\nlaQT\r\n=m4q8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"bdf0491fb5e16a51e25cb0474ac23b4af8195cef","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.148","@balena/jellyfish-environment":"^2.2.55","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.14.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.1","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.175_1606137321123_0.10448620510464934","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.176-renovate-non-major-049d9133d92e7d8bc0a3691973e384d7aa78495d":{"name":"@balena/jellyfish-metrics","version":"0.0.176-renovate-non-major-049d9133d92e7d8bc0a3691973e384d7aa78495d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.176-renovate-non-major-049d9133d92e7d8bc0a3691973e384d7aa78495d","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"09a39d5a049a5223fa3feee94d16cff2f0fd1ebd","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.176-renovate-non-major-049d9133d92e7d8bc0a3691973e384d7aa78495d.tgz","fileCount":16,"integrity":"sha512-mxpY+BovrivfXMJdziM2BpFf/Eq8G2NhtLX6uf+cb6Oo1LJEB1GVF0ytSDQ1N4w59FYdh14U7APVns4P4KWW3g==","signatures":[{"sig":"MEUCIQDchHMX7aRIgB4H2bXeH7dFDjpDbEONxa2Bx7Yh7ICnTQIgAaweEB+Za/1ZVkDTnVIzTVpV0b/zxYbyq5hUGYwtKq4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91480,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvJZuCRA9TVsSAnZWagAAxBkP/i1poyhmb0rT8bIaRJ+q\n1aNmwd37fyhJidFnvHolqtsiCCeFHtHENOfykUrRkkku4MtikyYgo8Xel18x\no5PvlPWxQdTOSSWnXyHSNVuEoAw4vgXj3WyjiRVRwCnCh6vfNvq3l3TcG+Hy\nosC9dDnmS4fVRRap8g8oPx5YFN12MlVgJKhwLcaPH+FST5+N4Kqx79mnt+ED\nn6LUpHjieOYJdeB6SEPraeqGsLOm8I2Lc7VoN05Ch0F/tiLoXE2c09oxNdgF\nwHEOIkMpf9O9W3QebDU+PdLpE6IRpLHId8vfhCWHMczd+cS1ofAhRUXr4a8z\nSceDQ+zELqDGeAyJToxHSk+Yb7O/KjHgQ6WjW7gRWcr4vuVzJLFOouyRMK8I\n2J0b14G0lgdGMnHxfsDTQuoal3rF1U6UMB5oWx+aoeqdnpvrwfjfQrh6vgFl\nvYnmcUSqLpIVtNUehFjecyjpzi6pLANlQ+xuP0crs24i6CrGNnj3YSSQIEb+\nkNrhh6eR2sG696DhkFAMheuCjxB5AQVqOazbSMafRDIWVGVoj7CBrJLLccCb\nOlZL8sidCe3nFacbQ2n2ufqCbWDnM0yXz+hp8whMBrwklXvph5MgdkeSZ05r\n9fPYyVLpxgm43lifZsNrnyPjUlq5xveCue6dF092Zsqi2AlmnGl5qPan2ROI\n2wa3\r\n=R3D9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"049d9133d92e7d8bc0a3691973e384d7aa78495d","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.148","@balena/jellyfish-environment":"^2.2.55","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.14.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.2","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.176-renovate-non-major-049d9133d92e7d8bc0a3691973e384d7aa78495d_1606194797430_0.7806993442265857","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.176":{"name":"@balena/jellyfish-metrics","version":"0.0.176","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.176","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3ea573736f59c65f75a9b1c45294191e7e6ddb6a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.176.tgz","fileCount":16,"integrity":"sha512-n0mVXfckC1LCA9245K6dnWmK/BZa8t8hIIn4PdboYqIBphVdWWKdl5ifaCEeNx59L5TMlBcmh/6ASMMDhgq0Zg==","signatures":[{"sig":"MEQCIDPR0NPhc9fC8OXQS2tfn7ZHicGXL2/6rDvkf+pxoUn/AiBeDDM5UfXJeVx4n5q+7/SHDvhngddmScCk6vyCzs87Og==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91420,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvJeiCRA9TVsSAnZWagAAOMEP/3qgQqK0FB60f3i3oPTC\nG+rl30oHDq43mF1X6zOZRnxCjNoQGuTJ3CyiX605GFiawnI6Z8HhsaxVw+vQ\niME5aAju4v7j67GwnmQf3QqBy2caic8GrDySWtTWQ+bLs6bfzIKa96cHwuuV\nIr+hIR5u5oitFPi3xgxHqRNQ82rGCsBb8thUjmLM01ezwuVp9URop3ujp4/D\nx/W3qxzIOvJd9Rl7ZDeV9aaxFQSwiFuIRmbqLccfYbPvEmKIqYjDF6s3RxRh\nka2QpkoMsMg5gTe91FpHJHSlADv5l8HftvM3Mg93qSwAUaCVlQyc/2yt1nol\ntu1BnCABrf7TycFwAECUwnbpn3IFBmQC4CxDVpGRNzbBj+FRuPMORdgLKbEh\nM1WqmxPhe7A50qHcH7hk0bSvgZeYmYwJFWpRVi1cb1taGjPMGI2W8o1617S0\nhI0bjlu/Go30SnXYqlk6bRJdu88FPH5OP1vCeKvAaK2iLtyzA1/t/E1ykzcd\nVQOx9Tuzfy2Rw1zlFnlIffoPnffk+5G6qGlMnLXYP8fGj3Q1+rVvy69Qym8v\nUo+Lnv1bedhvJfbdhHPeaBdix+/v0+kJf3yp9A5V7fu/LQA1yGO5iTGg4cLV\nS0zwFyoou5nAZ2a5MoA74kWdbR7O552/Qln/OMPvn0AS/9EZXQfoIFYA+dmE\nE4If\r\n=hZvC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"39269c8cacb603095479f4e1770d854f9eadd7c3","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.148","@balena/jellyfish-environment":"^2.2.55","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.14.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.2","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.176_1606195106127_0.6078425705491481","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.177-renovate-non-major-66255c533dcaecc0bfd6566c9f2f02716ac3b75a":{"name":"@balena/jellyfish-metrics","version":"0.0.177-renovate-non-major-66255c533dcaecc0bfd6566c9f2f02716ac3b75a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.177-renovate-non-major-66255c533dcaecc0bfd6566c9f2f02716ac3b75a","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"dd84e8f15053011a9094b43c643e65496736f999","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.177-renovate-non-major-66255c533dcaecc0bfd6566c9f2f02716ac3b75a.tgz","fileCount":16,"integrity":"sha512-C6s41tl9nkZxpduKSdNNp9BjON+cofYnjvG2Dky9iRd8xp8i8A4ZvGomMVlHBEmhbGxsVrzwS0UWA/ZSFNHvjw==","signatures":[{"sig":"MEUCIHW0L3GhZ+9PpxQcbsdwJpMCz2icC1Zch8LlWcVIoQ35AiEAnvGwx9+mYMSVoUC1CfbyRdP9Y2RkpMqh99GTjew3Rgk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91550,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvK/ICRA9TVsSAnZWagAAzFIQAJgmnbar1y02QwA70Row\n4RFNPAh2AneONBr3FFBNdMglyvNHHx9VtOpRurWrps38aFLQKSKl7MJPhtg3\nx5Down31qZBGvmO7xgzmd7N5fodpz8/1wI8LudTDy/imytGOSPaIBMUIYHev\n5EgrHuWZ0DgSRMdXvA1AZK5xeV9TJUreSW5zBLfYgzRN1Z8wU7khXE+0nYDE\necrHiXklrZinjVrBmS3ywWI19zUYzjzZDnHifz5If9CQmXjGNLMCTcIRyckn\naagwwzAPFwYMSZqu5D9WxO2iwTz0TQE2yG0t4ULRmttNJYhX5xKCAPHjx4ZG\nvPVgan0C86prCgstBZruNniueutF5LdRSnHrWJEECnYZDIzi9jMc5MSSPZBd\n7n54L9XbQ9X9x+kduaJSdRlsJiFgczmYw80vMFaST8/nFmI0VqIHBeuhWE3I\n4HUCVNzqUQuSWDvVRxo9DPIbR0jmJRhsacwDoCJ6gqLz2SEt88dlMOrkcYC6\nNhPVMwRXs2aDJyELFpBEhsvCdKQrXmwz+B3AQYoiticFSur162sof60SaX4z\n12jQfwWw2Qjm9vIPhHV/wPQL6y3Rh+RxP/+9kU3uCSm6IprC+6y345OD+Fcv\nn3PMEgTRN+0b0SOw2NMdOpZJlQzdnstGNSTFvrlqN1nhT4+U+APk3rC8mGQa\nNA22\r\n=t6tV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"66255c533dcaecc0bfd6566c9f2f02716ac3b75a","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.149","@balena/jellyfish-environment":"^2.2.56","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.14.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.2","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.177-renovate-non-major-66255c533dcaecc0bfd6566c9f2f02716ac3b75a_1606201287504_0.7321102796149364","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.177":{"name":"@balena/jellyfish-metrics","version":"0.0.177","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.177","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"72a6d5114afd3582c7266c714020347dafe02b06","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.177.tgz","fileCount":16,"integrity":"sha512-tOYattb4BheZXg9+x5CcZwsabFHEI/wNRggFnV5/FUDGUn5J3lDrVkx1Rq4uJLdOXeXAxA8zeKRWa8II0X+KTw==","signatures":[{"sig":"MEUCIQC0frRiNBx4sU+nQvF0+EdPO+n+Ha0AZBsky9fnHqVv4AIgcugHPw5oBAqXc+pKUgRMN1gs/+fBw7y0SZj6El7yCXo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91490,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvLCJCRA9TVsSAnZWagAAMeUP+QAyB5yTOerrHAZU8Q9V\n5e0MTjSJrJ+yqqqQw62NP0KUaPteJTRRf3DNPxJQTKH0GAbde0xhKfiv8S+J\nH0e8WkuV5Yl9hEou4ioQsP8pxp/6QHHAuaLic8siLARjkXLVU9ylonIR3Y9X\ny9lwPEgt68fIXCr0RNgF/pcBK84+qEyYTqVeOR1XLNjUHp98DSAeD/sGivml\nYZXVNABt62NmiqxSVuLEogUE6Z0lbREJjv5L0fTNqTpsW6qVEK1m8o0HJafr\nRnurtO5EV3XC68GAlwpeNuXeD/Nu91fjI32p+rMJSzCmg7MRBTDleF8F5tBb\nZTHwvnboGy02Ev5ITYzgq7ycC7M6pOaliKqUOLRANt4naWQSeutUgjqfA3w/\n+xuFKuSs9kfSGFUURwdthNFnQvp+F/SFfqPoFvfIUv7OvKz2vUvlU+pMkv2z\n2aEmtJQkLP5GR1EGlKmBEqBElg2oRcNi1pYVzl26TJMsF0s58xtaUk/rsOSy\nb8kBXN/5DIAHnuw8TpNgYhcAwCKGLcccds6e4c3Hcz0WddBqK1zcbcGFnAAr\n0SqxYeb3ta4g61v9OgKYowpccBQK3tT0oW02KOXfgckd2drLx+7K0UgZvdAS\n5Ts3y7TcKBeH9MAetIpYwcLquPfpH1RnRzpoV4FIJwhF8zg+rWEkVdEPeliH\n9Y+a\r\n=NPbL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"ea1f75c0835bd3a93ee6461db88e984529290e87","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.149","@balena/jellyfish-environment":"^2.2.56","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.14.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.2","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.177_1606201481076_0.6339740442669677","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.178-renovate-non-major-2ef1bfb16c4031f7a935372f2a38056d117fe958":{"name":"@balena/jellyfish-metrics","version":"0.0.178-renovate-non-major-2ef1bfb16c4031f7a935372f2a38056d117fe958","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.178-renovate-non-major-2ef1bfb16c4031f7a935372f2a38056d117fe958","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e18fca8d3a6e95ee00e39a4bbfe7f42f2c6f7fc4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.178-renovate-non-major-2ef1bfb16c4031f7a935372f2a38056d117fe958.tgz","fileCount":16,"integrity":"sha512-7gahCkKDXWqmmPTUHLETQarZxfFNIcotOB3uU4amr3i0moQJTHIL0tSbrXWYq5X91soBubAzo7nVfn7mTeiwkw==","signatures":[{"sig":"MEUCIQDiBdU3MZi5auEso9uXdP0zdqE3M14uJp0vajGhPb3JpgIgTy035vwHjzDkpL3qs7mQGfqwgyEKydkrIdFite4jUMA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91660,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfwLAaCRA9TVsSAnZWagAAFFgP/RfxzHKYYMB7D5fw7XYK\nquAZotMsEdsuZSIUrpRV9SGQnlS62BSgMz3uRU4522HvT3b0w4wmz0SBZHXy\nk6PG+i/DAIr/M8ROU3G6ANMLZUay45xXYcfq7ytLUYXYl71W1eTC98Rw9h95\nNv+UvIxwbuJXWI0H9KtbPdlh1HOjDUxnYXXJdzwMYbZWs4FEhOwZIIUurMkG\nnzvXT2ogO2RIIVaDRvt9OIIrJRh/uVAlGazNxO+radhcEJJY48nODMH5mCPw\nPnpdH4PKD2sd0ojJY5COvdCGdBHetxWHOZgy/HG5oZJXcSz4si/SzPrvYvQw\n9xFw1Sxd0Lxvz62mdhp4c/h5rWnq6EviyRrKHfO6+3q+AUKU6i7KGVX6u02J\n5jSkR4GE+E4dUYbSUtPN8S+h39vBek4RHlcce+ug1CazQZEMdcktD6eEhx2C\nXkhxNpFOJ/6LS1f0W0EMZhnTdzw+Sv2czMc3MVTR9KkJAnGV2tXInge2oNYx\nrZMUDARZEsj3sF8IRssHHeA7e272vcuGZmTwoPFL4tFbztsvqxDFcP+EabO0\nzUX6Nr7QJO/WqgEb77nqkiAfFncNR68qtLHnrXA6N9+jn9svuVZ64M2ITc0I\n4eeFZxa5jTiwujXbpafWWp+AEiTF44DVKo38jOTcNJXuGExTMqe6ACAye6Cy\nB5cE\r\n=bjxA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"2ef1bfb16c4031f7a935372f2a38056d117fe958","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.149","@balena/jellyfish-environment":"^2.3.0","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.14.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.2","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.178-renovate-non-major-2ef1bfb16c4031f7a935372f2a38056d117fe958_1606463513613_0.9080054993860629","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.178":{"name":"@balena/jellyfish-metrics","version":"0.0.178","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.178","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5182ede7f1e7b3baeac0e12bec52ef28af581a1e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.178.tgz","fileCount":16,"integrity":"sha512-RJszzAfNIM5vgbVREMLH1TKUkM+LryXxXJbZqN8B8r465zMFoD9PI4p0VxXmaX1mCAk0uahmyRf7PZhZbq5ogg==","signatures":[{"sig":"MEQCIFqj4wr+VciV0EqbKDXDutlcOpJ+O6vxcX57WT5YgsmVAiBqUjSlBvutUEEeeZ03gHPwAiIv2FYSVpkvR7wtqzzxxg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91600,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfwLDKCRA9TVsSAnZWagAAnJAP/0TslkXrmdImwN0P+u18\n9AnHzji+EzzrrNphiH8PniepHwLeT+T7Ng1/+T41BQ+n/sh/xDAHRqogNLoC\nffaU9446F716P2YHPzXdmkNmKlRdcYSAwwai9B6zBgKeOKn0CVz8fqhejps+\nIpRRdWom5aHxcEAJ3OcoPyTnm8NDEtbunzQ/yzy4WBCTTB186k6pAtZUdO6W\nqxmUXTM8ruI4dll23S/8kvQODVGs7t4yfMAqD5Gj1xZU0LFGxTyN018hA6KX\nUKGiczpeCvFSRDHBTkRMlMDjiPOJDmjPGlHdE1KQW7pT+zvco2KjqWhpBMzP\n9pTnXtq6f4oy8kIXz2AV9E3pba8dIe3Fl+WPxhUGyNNa1P1XnNHyDtuOEEz5\nHeGMRdeXxsRi0vh21UYOTx8Npeb+JC5GhDqFbuXuJMDrrpJTNaJiYMI+i4iz\nFrNqsWTe16IhQpp6icBB7e2KvrfL1spTlMvUNcHbMp4IiH+ZdcWaG3rd7IU1\nGPdBsZEkwJdUfmO00erZ8mq5s/9wx+mdyQxlgrM1IWb93xhmUw4gcyuHVYQL\nYVehqO5aNDvRi4Gu6FwK+whz4OGzL5/thpiM2VOBpnxTLkaQIQAId26jBDrD\nj/jG+2zYoSTcBMKuoi2S0BOtSlOFAlGLAnt4UPTMsaHxD9DRPIl2hTObIk2P\n2DGN\r\n=iJfR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"1a9a170bc5abceac1bb5fe815d03d9c5b452aa95","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.149","@balena/jellyfish-environment":"^2.3.0","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.14.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.2","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.178_1606463689619_0.938839058806382","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.179-renovate-non-major-15d09c8a1c1e54d37b8f6145714450d55075ab2b":{"name":"@balena/jellyfish-metrics","version":"0.0.179-renovate-non-major-15d09c8a1c1e54d37b8f6145714450d55075ab2b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.179-renovate-non-major-15d09c8a1c1e54d37b8f6145714450d55075ab2b","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c5611340f7b3494c3160c27773c0094c0ac3d141","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.179-renovate-non-major-15d09c8a1c1e54d37b8f6145714450d55075ab2b.tgz","fileCount":16,"integrity":"sha512-ZjKxl5+yM68ycfpmdDBlhYywRok1ziABd5zPktm+9Ss0At4wxG2PEapi9872wONDwz67LWNi++K/RRKj8OkXPA==","signatures":[{"sig":"MEQCIFxFvFF700dwVGAGDOTJ2dFmqLhm4IyyCPwrmL/WhZ2JAiBeldVsF/dHhe0OXNW3Ero1kzEGm1i9Rtrfmr3goM+EWA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91768,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfwLVNCRA9TVsSAnZWagAAvpwP/jw/20QSIxd4ZB5i1JMO\n6SZaz+csbc2qi81mrwc2PgsuBh2O8jv2jdD3xQSR1zSoYgBiDKa9tJcyjG6r\nTgfc2njnLYWqRqWC5TJVUEX1tVuRU8bUpg2iS41A7Jrt0LF0PPvju9v7bA4u\nF6+YYOrPoCloOdu3T2Hsb1uy1fjhKsVHPYG6afM/qINQBd5vF3RW/t28BbTJ\nVRRXjkveomNPDrzlkqr4stCM0IdneFfuShaEEzvwOSFVNElZfx4kUygwOCze\n29VnyTXHVI3gOqoAoN5iHfykqpzcQEACsDrN2R3a6guN7GaH3b0pamiBZYou\nAcWFx4z59Z6hGgbwxEmK/XntKvw3rVaCLHMZSthplNqAyujNq37BauQdl7IF\nxEvYcQmuKnvAHw62tSutrupqdhh8dyKh+HBETFPsmx1SPIHQnNDdXF1M6PTK\nxbA4Uk1TNKjHekaJ2J9+uJ+92sXEke0z3AyO0Y7F1jhZxwWWsJWwOMT6O+48\ndn0BcQ9XzeAsi2/UfLxAsDYuJXm3nc9qAvb5lXM2kSbDpCtkFpRyprMfWqtA\nv0SuI1BGAXKYnnL4XZGBf/JZANWm8IfhXDwIe9BVqVNXpfBkuQmKw0o1aEr/\n8k2gO+dABk+KXWd9cCVQBjGLmFfhH5+7mmmyAS20mHfZxwkuszbod5L+4fmP\nAnjI\r\n=kDi8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"15d09c8a1c1e54d37b8f6145714450d55075ab2b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.150","@balena/jellyfish-environment":"^2.3.0","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.14.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.2","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.179-renovate-non-major-15d09c8a1c1e54d37b8f6145714450d55075ab2b_1606464845021_0.8027808090113202","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.179":{"name":"@balena/jellyfish-metrics","version":"0.0.179","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.179","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cabba46b907c05ea3802913d9c54b4b1f3b554ef","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.179.tgz","fileCount":16,"integrity":"sha512-JEXyBChZKiXmmj3QesMBoreeuVBuqIH/TZLe5UGjVhGQZWXuuSRdswD4GGELr81RujYOjgUQ1ND7c2ZHk6XTMQ==","signatures":[{"sig":"MEUCIQC68imK68wJQ3ife7uGEJjx+wxGojMgrzL8gBk7BpKlbAIgCw8078ruu//+NEUjSj7uFKxuwWt785F4Ws1bNME8u/E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91708,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfwLYFCRA9TVsSAnZWagAAeHAP/iKbrrV/NDWbhfK5OmuS\nj2LdMSJx9XTyyxvpvfmf4oWvPwddmlvr3WDPA15yNc/Yx7dstCUOQVgYC7yZ\n1yZUV+uDUYU+xwtq26aiDF/SiP+E6yTuqQyLZjQIVirwU8th5W86ulKnPJd3\nEd7t77T70O5otsBi8IQkatuJxhU54+YBWwynr674grJj6zT28M9Ty85agb70\ntttqa84eDTVZ5k6mWWeXYRcIPe6EbXk39aZQ3xsAtiQ6bZK8rfHUVvRwpMNt\nzKuQEPcFmVZ4fuZ3Y1ZZnSfZxTr2emuH3GyQYSiZSXtZiAkeoKBaBFqDkZoH\nSDwu3udTFXU0xZNpx8gE0VcOdrgioDI7iqnYp9iodywVnsDtVES3NdP/cD4N\nldD589H4qmi0PdZ6RxwmMl3BRI1/5MmC/Xodo/eShPf+eijD8I/Lv/sBFwmj\nBVFVBPLAEGvzl7hNvL6781n/xEKlTkhG1YGv2uYsjcqr04Z+vV7vnOOf318D\nKlrjU/oafmui7kxkNhYZsHYillavqYMZq04i6Y1vMNU41UdYMj+VCM+/lDTs\n4k464mk/LXd0OZiOu+L/Nbdh3LoW3W9QBAo4qjykFRLvcrgA5ezS6ZWrDWqH\njDdDGhPA2pmJ5VdtNeGNs/rDrsahAriHzBFowgGBEdkto3pU43m2ns//TOT9\neq3S\r\n=UnFd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"3096d1d355bad01318f307f232ee7c66ce67cad3","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.150","@balena/jellyfish-environment":"^2.3.0","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.14.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.2","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.179_1606465028659_0.2361612202039074","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.180-renovate-non-major-45ed9ae4246e5d9e31bc824986d503893156ae5d":{"name":"@balena/jellyfish-metrics","version":"0.0.180-renovate-non-major-45ed9ae4246e5d9e31bc824986d503893156ae5d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.180-renovate-non-major-45ed9ae4246e5d9e31bc824986d503893156ae5d","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c8bb728f6f7f2a6a4fa88da0652c995a1c2e0b80","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.180-renovate-non-major-45ed9ae4246e5d9e31bc824986d503893156ae5d.tgz","fileCount":16,"integrity":"sha512-J6S2r6yPTzwNBku7AdxcrUtBMPCvP+yJz9V8x16Umrsrv15NiI22f1p0B27607cGSLUcIx9HZcf+X1ZSjJLPXg==","signatures":[{"sig":"MEUCIQCRy+s8+TQKWd1o73/OUF2SRh+qgGDs/hW9nr64quhjrAIgOFLxZB98QiIsmOp96iS1BJfxsFew/BO57TrzzRM9T5w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91876,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxmOXCRA9TVsSAnZWagAAwsQP/i2PHiuReAe60lFZ5T+5\n1rpTgwcon82nmtPfJ3TF+IKCX118S3KE4ADJoRhEtPQ/UiItguZUpK0HqHYV\nOJ45m+8KnDjNzvn+dlo3/deNtpdALDFfg/skeZTbkD7MPfF27nSVYQxPpl8T\nLdHVQguZ6ksBO941b2yGRyqg3oEMEQoX/TwAyv/nFmDMFTohsj0FIFiP6X8j\nGYoSLxJdc70bV/TrRKiJULeG0lNBL3sCTbpYNyURVSvtdgCcFTt7/WmSSUkG\nfIlMkPiBOL0g5SytI8003lA+61/kr2b1Bn4xwiJhULxJaftlhNcdxIzIkLTd\nRVvNuVNbxjsAlWAmZFuck/MKTjbM8GfW2M8HOJyLkzU3HyrVwZR5qTHHnBMS\n60SIuO5NkMQ69woVbwwLOOMzcTMxow15cjzk5OqfSR1sf3r2880vILpV1RyV\n9ifigpfvE/vVry3HlC0z45895UTSoakQ7yzxDSGdiHWla2jvsqnYPH9g5JDT\ncUqLAWKTvbI7DgOr6DCcQidIg+RZ/Bw8Gn/mTjotNmWNkpXT5+cMGye7MD2k\nH7KZij3aweUToSR8X+FDojfoVz6zW2YZLd+Itx+ESiB5xj7PiRXlS7aeFTVq\nUDVqTqE4ALZXteIFHVuE7bM2CGb+qENiuduLm02lAnT2hCsWi0a0A44G+NfA\n2Y8A\r\n=Qwj0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"45ed9ae4246e5d9e31bc824986d503893156ae5d","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.151","@balena/jellyfish-environment":"^2.3.0","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.14.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.2","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.180-renovate-non-major-45ed9ae4246e5d9e31bc824986d503893156ae5d_1606837143039_0.3691419559511919","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.180":{"name":"@balena/jellyfish-metrics","version":"0.0.180","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.180","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"86d104ede2863fa940ea6bdd7a3959e8b4f91c8c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.180.tgz","fileCount":16,"integrity":"sha512-ob2jsIPgZkDIJlxGwb6TskpYCeogXchUdVceI04Oojzja7t6Ays8vfx8qz1O67mraGjOl6LQf3oQdohZpFmyCA==","signatures":[{"sig":"MEUCIFxkMey+2wTjJAZ5zVDelvfIQ+QVqUiZzpsxzDHCzo/VAiEAtNgA2Xp2nezLjiIoDSHWDgo7MydyrEot6KSU24gnkSE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91816,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxmUOCRA9TVsSAnZWagAAkRwP/03feo3ln3q8ZgNVbMgU\nAYfDunMGppIuMv6h6xrYiNAuA+Jp7obUI1lfY/oQd+KkWuhTGgwR+1lUI8m0\niArwycemWEzF8U4cYs+TtMfAi9ibhj+vnLwZW8RiQkvorPgsOJbFcrlTaM6h\nBaQW9koC0GASnynJWU9NuW5gJ3hebHEJpyp3042psceoBY5j6af88RYUbHxr\nUC2CoPM6byu2F/Bt5xahJbRvYfU7NDiHt35hBMZmcbZDpUBO+vTy7X2QRmfx\nXaHX+uPapFXvicvr9glO984iLNFQTacAueYrq94mOLlwIcpKTQtQLm3ZTYPb\nGMxZzZIgejy5YWvPvpgkUsTY84W8+JF/4wXia5764rj/ulFPNTGFMAqywUfi\nrLawtAI8oSRfXrAQy2xQ7mP1IKLzf+7m/Wn/EyJ7VpIlzfXMdtwR+Mlrwq/X\n4wKuIoHrEQSwxMptSCwWIswDQagGwIltjdIB+EIhDEtcn5B/qb22MwEb12m2\nk9wyzmksPBY3x7ho9rK+p8QbE/2ci8cd7I3qAnfIFkiypPsuiodITyAXNqfH\nK4YfySfLRuI6cjRslv/9bBxiUjhLButgZDt9oNGlzit7uZgjwPSzI5jpFE0M\nCOIycJfrNIwdzarqXZhnIEaceZhwPLbtrkYqsCtG5TXe8ZjXRfQu90Mh/oQD\n986Y\r\n=QBr7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"59a218c3fdcee0cb62a5ed494fa9bd5a81b2b606","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.151","@balena/jellyfish-environment":"^2.3.0","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.14.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.2","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.180_1606837517966_0.40391905686001595","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.181-renovate-non-major-23e8da340e889b1e01a177199ce2551ed32b5ae1":{"name":"@balena/jellyfish-metrics","version":"0.0.181-renovate-non-major-23e8da340e889b1e01a177199ce2551ed32b5ae1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.181-renovate-non-major-23e8da340e889b1e01a177199ce2551ed32b5ae1","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"61e99ece11876ed42ebef3a02b4d2b70fe56c529","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.181-renovate-non-major-23e8da340e889b1e01a177199ce2551ed32b5ae1.tgz","fileCount":16,"integrity":"sha512-5LZ70wXfqmjIYYPzEZkUgEUw1JWTIr/bL2LgZ0i7FsZfuFeHXrf+I6niWoJVu5nla/sKgZxAgeiJnDZcQH2sKw==","signatures":[{"sig":"MEYCIQCdephXVMheqX+ujtBTBhZaylo80ThGxy7owjpXnnhxTgIhAM3yAPaiWu4bfiRyGcBGkijlyjypxKCnMK+h8i8UUcOr","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91984,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxreOCRA9TVsSAnZWagAAlGYP/0XU0WFG+D4h7yAdCFYe\nKaAHZm2gVnFr/AFcf3QFEaOcBOe+cmQKFPrdI2hGJfCBgpfA71Q7JPjxhdlI\ncJX2zxib3AsE061d99i7Rt9gJKpt1Fxn2/WzDThEmcTld5V1xacUzv/qNTPB\ngS7GHOeJmndKW3FKHrfA3b5f7zwZGOTbFDclYAP2VN+uHez1ea4vY6wvDGxn\nRJkL2/ydxhaaxbyfN5Htgq//TCL2oUQtBV4dloQi/Ws9II2xzbc7A0eaeeDc\nm9Cs/WM+b4trnrbMjxrFwelKwtBkpWmOvAMT5BxGsbyRrRssvh8fmEJ0o2O6\n3j1ODMWCABzu+l+r/pyw+JXENPUPkLCa8waoV+t9e48BvS+ygIxdrVJ6yQlY\nYSS6TG86XfrmN98SPRmY0u0SkOHXC9IYPaP6cuBX8WM+3w6FPb/8HV46yAx0\nET7zddbDCh9uKlKGfvMfOlHwTHOl2DFLvOssx2j1Qu4yat5o2mv4vcftag9g\ncxDv3h8mM5Hbj3uAv9vKHHPzFsPkvWKZhPsolvbf5FSHpUP9bPddOiaS5vXa\nywq7mJGZf6iDBXPK7HQfqZN7W8rCTZXskP4pcHcr2Urvez2KzX8ve5XAhhFt\nO0tG/JtH7sbos5xO3DqOiqnVAXPJfg3b8w+L3O0iB+S/3+CszZER9U2q1PsU\np5Th\r\n=rt79\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"23e8da340e889b1e01a177199ce2551ed32b5ae1","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.152","@balena/jellyfish-environment":"^2.3.0","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.14.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.2","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.181-renovate-non-major-23e8da340e889b1e01a177199ce2551ed32b5ae1_1606858637775_0.5095179934046361","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.181":{"name":"@balena/jellyfish-metrics","version":"0.0.181","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.181","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"58ae4e033d1ef824bc53431a65466962b6237ab0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.181.tgz","fileCount":16,"integrity":"sha512-FC3eP0hZKHtVUBZiixrUxC09hIYONZ417j2+tGDR0PR9z5pfje5Kfy3ic5IsvS7WOLQbExk3aOoXkKWo+XW20Q==","signatures":[{"sig":"MEUCIQDmB8k+HVNBt5AnaxQtZ3GlGour7x7TnzLM/p0K5N5biQIgG5uzrlz8VzPnZL/EWmulNBuGrrCA6bIorv2yhkVPBwU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91924,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxrgxCRA9TVsSAnZWagAACVEP/0eLQEJ/AcdFHS+k0fzi\nVZX6/l7FpReVZhEMa6Sp+FyoBhU/QhnxVn4fqhogJpvmLTTQtlrI5Yd6maXp\nb71AcZRz0lHN0BREA6OeJ1VDLhbVqyVj7M+cHGT+yNkl91FGsIDoGh8DMh0g\n/8Anl2SLVZV1zZ4wJFBOPzHkWW2wlv+H9CxSmgQ9bwmn7qVRNysavJqSNJKx\n/xm3DHm2LaGNsfrIuh+Am52ocBOsr00MOmX57owOsRjZYlEiXudsNF3qBEeQ\nyXROY5/IxsYgSGJACdjxZnWPIdX8Gez6BP03I2JmPIBjH+p2LZ657FoKtmLa\nyUe5rxiPHAcdRoxeFh3DAitevABTqj9XYT7m8fEtL0ppaMFj4+FzBbYgZk+u\nm/uISruIaEH3HvDXPYom93I8i2IKpNc9VqaakHT6312RkUDYrMkaCEKk8v7K\nS28e6vVtTF35obAmETb9y70LQhU25AtU9iFBNomSe/LqhxebqAyg0bWnj8ju\nTxy3tfnVhmu1oT5XKW8Gqexokf1GSF8hHnDkzEe98jAquOi24LSWREL64iYO\n3lxSdxEkI47OyVWIKaOPrCCsSneqFC3+SKzVFBlzUGrUnG6dVdeqWA/zFJ/3\nmlZGw+8gHjWx57Du8zThf+GWEIDYr9Ms1WuVsdOL+t7ryHzB/etCA4FtOTLF\nRiZH\r\n=+Id2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"f81e673ef23902446b9fc4b2760331c666178a88","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.152","@balena/jellyfish-environment":"^2.3.0","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.14.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.2","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.181_1606858800825_0.9094078652941227","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.182-renovate-non-major-5131cfc0e086d49ae759282a9782e22ca93de15e":{"name":"@balena/jellyfish-metrics","version":"0.0.182-renovate-non-major-5131cfc0e086d49ae759282a9782e22ca93de15e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.182-renovate-non-major-5131cfc0e086d49ae759282a9782e22ca93de15e","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2eceaf155be933034f53a05e8c6729e9d2d31089","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.182-renovate-non-major-5131cfc0e086d49ae759282a9782e22ca93de15e.tgz","fileCount":16,"integrity":"sha512-fhm1lrtbUZwN+c308b7F39UtQJMHrC37Dvs04yIfS3ZtkCbB/BRU1FwuT+OQ5kHg07pl4S49ZCpV8uWtfOP0cg==","signatures":[{"sig":"MEUCIH+tyeL+upEwsG5/GM3jUC/lkCLG/mzveMzQ4kXbukB/AiEAkH3v9io3g0h2tNlWSlvadbLAQuJNsBl3BOeOIYbIrtY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyms3CRA9TVsSAnZWagAAH64P/1EgU3oMxFng8LtvnISc\nHiDvjvezPirjolNNNek5eBzAhPAJBu1h99syv3kZDUeKVuiTCoGoGT+PneA0\nPvb8IoJvSudMFKFh71EhzK67lJHcMgu5Kdjy8GjEB/PvqIwjSswKXckDYOgT\nwI0vsxJgHSxzkoWteYXf6nIQVD34cQ5ClFsX3y4GLFy4N9v2SCbjbEH53JyF\nBvsTmnBVdfscIG28DQzaAVakd/znxX10o2LgeF7Ms1fipSlA991lPUFHt63s\n6eV1o5ovvR7zRkauQLq4bjd0vtTfnUNLFZteBJoVbfKvdsUmJ/RslRUXNxpZ\nqvu3PYznsAITU3rh+Zf8nTBXMy2MF/kwhcn/FivERJdf2/Bnl1aHlxy53qcC\nc7SyIJpxmMXunEBf8h1GNXyvUSY5QRSL98E93yofnxShU027NxNSthF1ZfyX\nvwIex+OX1hRjJ9u7A3354/0G0Nz0z0+qDj44Ph/wTD0ouaAJh/JgbLkj0gnq\n/zazSasY2597FqO9sOd/Ry52cghz6NQengaf1rA15Oy40Jntdjskx/P3mNqQ\nPK/rEtzdySCRmykHHlhHu5ti1FuTfcHD9nUZWnEwbTM0LGKids3A91IC9klA\nQdqG/nAFfUlTLKLnpITPYRV3jiGD7AcMX6a0+u4+ExxeMJA8OdmMuC/PEe75\neC1a\r\n=LN9h\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"5131cfc0e086d49ae759282a9782e22ca93de15e","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.154","@balena/jellyfish-environment":"^2.3.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.14.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.182-renovate-non-major-5131cfc0e086d49ae759282a9782e22ca93de15e_1607101238692_0.5354672676261258","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.182":{"name":"@balena/jellyfish-metrics","version":"0.0.182","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.182","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"acf44b4a852bea66b0ec3d0618e607e08ce1f055","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.182.tgz","fileCount":16,"integrity":"sha512-G8XARglogECWLdtj2OQLM0JwIc2pbMHMfpEbcU8LMUvw1N0Vghr2XUektVzMDVJnHMK5FL2G+PxYGODH7r2STg==","signatures":[{"sig":"MEQCIAPd7VCfe9Cu2bFymPGBeRRIgp0e8H5Cz16FAFHsE23MAiA87gq4jAydjmyUV80LMFoAlPhuP/N2NB8aMEbeu1CtdQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfym5ECRA9TVsSAnZWagAAPacP/AwiKe4WbXZkyTBoFKeZ\nV4PAf50mZz16LQcS8LmazsGN0Op7gGfAdD/iD5WI6PRi2G4uZm6BD0Dt4+mO\nz2JCGXEjfq7OQ1vMT1T7xr2ENyAc2LkdBIUJLf+wTHsyNWR5W/yTA8j6fDHP\nEYwkvdhg39bLxY6uhfs4sNVjhUdZDXRk8L+9yNtJlaaR9wXQTFrXn8YGu3ca\ni7EYqSBLrGni3gtEnLLZULq235jtVQ9wMtolz8Mlb8UpcFYf+6nOVkq/xRy+\nUGt16TJ2bAGk3tJ0WJkgmmWCbFiF4YLa3I/4+x2+VU/g1W/TvOb7bEFpJhtv\nQVUo+K6RHC2ML4x3r1PHt8AIbn0PwsfsiPm945cj8G7k8RjnBpceX526CBWN\nQvPZDJmNTZ+lUJLsvIY0UgrefdmNz8uUuM7aBvkzG/NSwoVpqnoY64LRohkz\nMAjwgy+QDxfcyVq5TSP6EmAlXd4oIh8dv7IRBCDHo8fDGbN2x754m6kZVffq\no0HnaZ+OcHcpMmyEXczTAttMQnvrK/Sg5lwJpxjq8uP40EVXJMkGt1CL8Gnz\nkHUcm0xkzgmbP7DVWpWM3q3VZvJtear5A74CdOxNmgScYKlFNA3GEbNIAyXk\n3gl5mnGlyRiQeqA8yLNUau+sP+J2AQEmFBpmZuomb8YRysmbeoVLL/xbQTnt\nVKeV\r\n=LASn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"99d76b08aeb78afd6ea7d96c41da267bd0b1b5ef","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.154","@balena/jellyfish-environment":"^2.3.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.14.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.182_1607102020141_0.9483103569017952","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.183-renovate-non-major-1752ed444b21f5eb39f13b8063c6b1ff16c43b03":{"name":"@balena/jellyfish-metrics","version":"0.0.183-renovate-non-major-1752ed444b21f5eb39f13b8063c6b1ff16c43b03","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.183-renovate-non-major-1752ed444b21f5eb39f13b8063c6b1ff16c43b03","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"66de56410a7733111c45342dfb96a57a3b3094cd","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.183-renovate-non-major-1752ed444b21f5eb39f13b8063c6b1ff16c43b03.tgz","fileCount":16,"integrity":"sha512-VbzTZZ2BAk7/D0GZOxEXIAnMEXKYk54IP6ppJXrcn53sUgDlDhrW8vSGiFD7B6KcEmXCNLOShnjuhmpDwSjwMQ==","signatures":[{"sig":"MEQCIClFFbDfZ76wu06tj/ewby4eLpRYPizZb5tKsOtZlVGRAiAZ/Zr+96d3PijagTIYWXrsmycnYtoEarx8jV4VWGc1oQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92162,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyoU5CRA9TVsSAnZWagAAxt8QAJRZa/o1gFICFX0XeEFy\nIQBoe3vbEKSeK672mp1DZ/s82yP6jJOSEABfK4v57m0BswVmGAWnmifY4R2g\nb+BLW0jBWJP9X5i0cRuVsWE9c2VrIv8LLhQUKRls6S4Ap4dZuLr9AywLzfVr\nyUQPITcQjJFqruRiOwy3OdcHi8nI5t7v9xvWU5M0KM9b42G8IqPIGeE1errJ\nE0f8YFYzyyuFTBhJqr+Qm8wtcZwo9IgBk/GjyQvpITtH8XPRMdft2wBoshnc\n0p5tLqZ8nCAeFBq3TfISzt63YjC6EX9LVBHOMJeGfpq8moc7kjztVKOL9ppt\nutx/T0VVcvtytRCyUfISd7h9Xepz2iT4F2j2pQkU2gAiJI+1LwiCdXAk2Qex\nzvt8Rt4KnOI2x5rrZYCp0FAwFLGLtwfLDS0c04ViMapREUdf6CfMD6EbwQjJ\nJtsCVWhg5zsgu5h/9kZAEwI3exBqpg11tj46OYCnS90mzVgbBxhGoS143nFp\n9V1fGjvIDhgq8Jdo5nrrvGq54RIqpKgFYTTClCV6QVLdQgGaPWzMiKBL3WlT\nEo3GWQIFh5RhkA+2hJ+rP2c39cAQHwNk/ptyQIhmJTao/3rJUoTQRZfTcXpC\nJZvC3/DHplj974O61jjqGrc5Yz6wQR8oi6pf0VMg5inlUMKOO8LHk4OKtSGE\nYYfF\r\n=ghyF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"1752ed444b21f5eb39f13b8063c6b1ff16c43b03","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.155","@balena/jellyfish-environment":"^2.3.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.14.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.183-renovate-non-major-1752ed444b21f5eb39f13b8063c6b1ff16c43b03_1607107896891_0.2622640363293187","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.183":{"name":"@balena/jellyfish-metrics","version":"0.0.183","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.183","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"09a4ff02556fdb543a67896d9c7c8fa26ecbbebb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.183.tgz","fileCount":16,"integrity":"sha512-s2Rw9xjZE6vsOxGhnGlam3LsOFSwtOgXNZZPzphIpUD1JvgAZo1opPGHcmyobyccgj/HmX3/4LroqaZcfL2SsQ==","signatures":[{"sig":"MEQCIC6g84CtlXrweY9pBjkYjR3/ku2fKu6wXspA08MzGdmGAiBmfdjAbfQKdmrllHRLPXjbM+bEKU/JUExb70Vskci39A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92102,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyoX3CRA9TVsSAnZWagAA0IEP/3ViEFC9i8LCX2ox4shJ\nnMzZhESfe/0YPSddLk7RaIug43U7uDti21s5X1JgxzQDow9jUjPow7VO4l2M\nvWJ26lkFlmL/kKVuuZ3P8UX6kn4sz4nhidWH9xGaK3oc4qPFqqNgi5mzbxzh\nHooWJzaqRNDYjRyq4txiz2i00pDueTjUMkzN5V4UGxi3HK0hNy8yctpvpvui\nqMu320yASdXrugMhGDBJHvJR4EthFsgv0bcPo/DcbJaID/KEyGV7/b1PMAw6\nxpRK54GTBNmRbEdSKu1tDYNbmJ49ub7P8xU/dq9jE7mSh+4ednx2ULGsd4ie\nESyDkI/JIn0ZSl/nj5oKviknK0ozXjl9N2HIc8zvzv+JlywrWoL7qVi2rfeB\nI9JXttjYHK8XG5WBUhRyMCSAMSwsdsO1JQ7Kc5nmz4ymwp2676OpmF+XyjlI\nn5eM0UQsg+8Jm48QTsF4nJUrinqAvrotMyBHuenSngPLMJQKzyqz/O0rw4y9\nj1QTDrZwqFQZZAzF60J4d1FYU7Dmcelc9r2z8H58RS+5o9IK2To4hBf4Pf1f\nevFD6y8jrqh9oa9EYBy+ojievkbP2qYfZ8VjG0oPYyre78PyTwDN3Nd7iyey\ndAh1IIW+Tszhi4zg5ss8aspckb9Yb+DU2H8jUUPRdjFk2BZC9AjL+yGyFA3A\nwrAi\r\n=qXfO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"e21687653e38f0f074d82b38fe1c07f549fa7bbd","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.155","@balena/jellyfish-environment":"^2.3.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.14.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.183_1607108087089_0.842485055645187","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.184-renovate-non-major-b194362a04335c178dc93401c2e9df41f4b2423a":{"name":"@balena/jellyfish-metrics","version":"0.0.184-renovate-non-major-b194362a04335c178dc93401c2e9df41f4b2423a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.184-renovate-non-major-b194362a04335c178dc93401c2e9df41f4b2423a","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2db9a0400a8423e3291e837f4ded03d95473868e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.184-renovate-non-major-b194362a04335c178dc93401c2e9df41f4b2423a.tgz","fileCount":16,"integrity":"sha512-PFlE5x4d5h64hyuNYs/+RVtv1dkyd6zk33DnyylGnqVAfUOPwYqY4ZmQzL6b83o+EmN96S72DH5Xq/y6eZRN7A==","signatures":[{"sig":"MEUCIQC709Era+Er0G5vBoj9vh+4prVB61aQP8xAUIkmOkcsRQIgdhlFhZXUykO349v2FfwoXT0AwC8V3nvdO+CjjRP3SEI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92232,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfy1MzCRA9TVsSAnZWagAAgccP/0q23pm098AmZpq3AKcW\nGom/jNLTmBwp6sYveDQf0QfN/FPt6HfwfIp/Xvlsm9RSltmAEqICkWPkCnW3\n+RNzNF7K/13QWEGzwAvqfYOg3w4Eo1Jw7lSaBy3f8Sf4dLw9SEv/dLPsd1L6\nKAOFQ00Qb1okdQI3maXwEfFP6oaj0nbuxaJxozK3+zagVrb03huMXOLIosad\neC4NE/BPJDX13rpTRmoKF7Yrjtncm7iE6eha9JqIDBxvrR1RIeOHZkVthz8G\nh0eqp+HWftVbZ5HedcxYAlM/DavyLzXq/xtKNgmcJg/GL8TK5UmVtJ+p6cV+\nXXU6i89E+eYu1f+QYsoKgj78tII0lYt8CEYO+a7oXc/WODu3oItf5A1ScaRZ\nyYt1mN6UoHwkQtR/Dst+ukmtT9Mj38fQyf3TZcCZHBIPPO3bwWN/vKFMirhr\n23mKLYvLt+NVQ1Pp3ihbCTkhl3RGFVIEyPMOcwqqNhfGVIDhAtUKg+vK7m9a\n9YtW+TPbGCdwHyPWvkVJhTnU75PA8DjpC+AoFOEi58hHbDTh1wgyZCl+JgAV\nt7KkBGanz8ptnl38IVw84/aD3UU/u9zldx93PO0W/576qaUSb2lDS2J8r86c\nzN276wUCI9KDWby94STooUUYj7Q/h5gzz1iAi52/5Uw/spYC83Cnw3RT+n5b\niSXC\r\n=uIuY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"b194362a04335c178dc93401c2e9df41f4b2423a","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.156","@balena/jellyfish-environment":"^2.3.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.0","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.184-renovate-non-major-b194362a04335c178dc93401c2e9df41f4b2423a_1607160626476_0.7293994609416627","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.184-renovate-non-major-3deddb641db830bc5952d4474791518b9923e991":{"name":"@balena/jellyfish-metrics","version":"0.0.184-renovate-non-major-3deddb641db830bc5952d4474791518b9923e991","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.184-renovate-non-major-3deddb641db830bc5952d4474791518b9923e991","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"86f55d30009ee4ea29032d83b860fb47806d125f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.184-renovate-non-major-3deddb641db830bc5952d4474791518b9923e991.tgz","fileCount":16,"integrity":"sha512-1gnIgaw9b7M5sAkHljRh3zWAkIroBRzu4wIMDF8E3f9nowM3omJKKoU2TWs8w8ZCO5z+5UUohyF6cX+wJIHElg==","signatures":[{"sig":"MEUCIQDhAIe2znuFtyAZu4iWoXKictsGBWgMvwd+9X7wIbj+6QIgZq0yHB3dLdjjKjts7xcJr/EQKXZJVCpV3BNAeYT17+I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92232,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfy4QDCRA9TVsSAnZWagAAYtwP/0cYzqP+NIvHOz8B0BfM\n8L/xcdGty6CaYMKJRSTm0JUczcUhaW+tdaR8tshgjSyK3xG1Frw2vNR2ifiQ\nyiOYPxmaWUaD3BH9vC5kdSnYEJ3MuH8tzOQM7rpFIB7FnJpdLPluZNkpPiKj\nGxZ73M0nmEUGfUk6JBKNEwrbQGJjWIyz8eUoNrEvXfk1Ak8otLpfC8SJH9KU\nagr1IEEgNLxgdf5oNZtSDDIly9MuYgF9IHxhxArutMMs9xE6xJa6z/pUxf73\nvxJMmRdG8DpTslEn45E3aSViFafC0UFPGyW00eyO2dSCXDOINLH3ytSBV79j\nxUpZ1MuBDTwH70u5jeI68l7pPVSrYt0QAiPpKY5ogBb5+nDhEKU7zdYMxqzK\n0fUZUTWY5jZbvB/gJ/ErVqiT3wSpqj0Kn+Fsxjg+aHUa2a00H9Cjt6nHzum2\nHmcRDHLJQqy4N49/dLDHPq5r9ZhxmV5cCZnA1uAISsuEreC6h+Grg2X3h2TA\nzlH+WAM62kZ3TGtP6oAsQ7iK922zm5w1De9ql6k+HcfcKWWe3S5kMux8KfWc\nJBi4Y1IrMOGJ+sZphNRH5ppL6/LMHTD0Evqv4nF/SI/2jVM0jJARxAT4xPZM\nzGV4oVNB+SQ9XTNCmRRb8QjTiQug+DgLBXzpkUMaqNJ9eptnALkBVs8h2Opb\n0tRl\r\n=d1gL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"3deddb641db830bc5952d4474791518b9923e991","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.157","@balena/jellyfish-environment":"^2.3.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.4","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.184-renovate-non-major-3deddb641db830bc5952d4474791518b9923e991_1607173123145_0.8914953593526682","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.184":{"name":"@balena/jellyfish-metrics","version":"0.0.184","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.184","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f8e6e36570290c3b31903b584e5eb391cc7ef8fc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.184.tgz","fileCount":16,"integrity":"sha512-wgcf6hXttZH+W38HZupH6UwoNup1LWuU4QKYzxXTzxq2iuybJIlolHrgsyM84lNn7N6sM32jc/ymAOffd7aapw==","signatures":[{"sig":"MEQCIFvD4QMx6ooQ4bXXquwCh5lJDd6VNAMHARQw07pGu2Y8AiBCCz1bHbrZTYFu02f6CQOxz9q5u/y8QPOxWFrK1ahJtw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92172,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfy4SqCRA9TVsSAnZWagAA4ugP/1erlC5hzhAYScC0ydaF\nlhH3GcMA0Quh2EesC/4Lji0btjoRSZS/ZaAAYqinlPmvCGInpOkT5yFY4ODs\n/4afB6Ce73bliitO/h/fNcOMPUos1Cl3J2wKDADWUSTvlkn9lU4hv05kab5X\ncFV/1cmENnTYpQ/I4eaooXAmwUqu+OR3nKUmhYIhhky+YKAB0fgPSbvdcxBV\nV4u96fH7cbwk0x6xb39pBC2IlvFZYbrbiCUX0Nb07RrcTmWi4xrpcrLgQqfE\nMgNCSyYbgpn/2lqu4kLU2FfX9eHwiduMMBTn41LkRglIn24XTRd6phVd0b4U\npTDo+Yr92F8bQFCdZewdxEBS2Eg/QbJtttuBN/aKdNIsJbSJQp1iAE625yHo\nTZM084UwvBW2VmlYbRbujX1ANJYij6U76FGNCd1Ys78MBv8wPzdaMJKoNdwH\n2bxWyHtLcmAvYp1rA9YzBpAg2cb7nApmHPjjMra3M0PQPMfpVnmRslkWe3y6\n2aUZdUwq9w6dvJp9RYkifsbbMEzlzeOHC37ALphSV42R1gTI5k3I+l8VF0tP\neT5J5JA/XOUMt7KcB9vCsljLLXeDRQuTNWNoqQOGHwdJrOGmaq9+qKWvAG19\n+zatyZqp4xPqxIc/YZv46JEgrSUcxE+VYqWCcBrTXUszdoecx3BTnhXvIqGy\ndmEQ\r\n=Z5jF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"02e5d1195a27447fe3a718a46fa59d588091a7bd","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.157","@balena/jellyfish-environment":"^2.3.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.4","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.184_1607173289971_0.9097434305509453","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.185-renovate-non-major-2020bfc867388d52c0303f81374129d152427ccd":{"name":"@balena/jellyfish-metrics","version":"0.0.185-renovate-non-major-2020bfc867388d52c0303f81374129d152427ccd","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.185-renovate-non-major-2020bfc867388d52c0303f81374129d152427ccd","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e5c38a84e27756d485ec1e264c7170eec319b8db","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.185-renovate-non-major-2020bfc867388d52c0303f81374129d152427ccd.tgz","fileCount":16,"integrity":"sha512-M2mdIeQ9WnIxEhkHjWFKUax0Orx48dZNoRY6Tf6ObVcV/zHWUOFWvtn6z2aE2e07vBgKg2HtLjkT2OFIe75iUA==","signatures":[{"sig":"MEUCIGX5ABjxknu+V1/sFac+fk+6N222VStC39lGsnRFsSPBAiEA2eDbgDECobuWjxUsznxqPhj/Ed4srrj6Ovf2oKmmryg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92302,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfy5smCRA9TVsSAnZWagAAYVsQAIxf4mPZqEwZTqvFPPiV\n4vKG6/z2Jn722MGEf12LxUMYUQyUYAvstzCJo4K+qxmqUVoK97giNagIiAZ9\nnW1bHl2CpjZEvbmHsVbRr0aRYoot5/vesdtpBA+IqMcYfCJs3g9iIJ7k3qxr\ngNGngyasE8J3xXeXYBRQ5VnFKbncJbATEGbevIYNzUkKng4ClbovDRH3m6Tr\ncyATD+EC+EZZ2lh0kR2sqHGOWDRfjo8JvRbI/TImb+2vnI+CBFcKBX5gmC9V\nVDN+SfBGTgV83oJELABuD+p4AbgSAhdVTNOB1SI1W5lf2m7Cb/44JB4OsS+i\niHmTjyBtDIWg6HmsHOps6BHlgwXUw6ybwyR0c6+tvhlck3BDd42eTxd1d7SC\nnsJzbUbzMkNmuvhQvvCBpX6Oo5gdV3ysIXEjyJb7U8/BgvQBqWdNVYl17D90\narkfiRD+/HTDNFvwnicMvY+0g4f4689nR8+eIbwRroxFB8MJFYdw9dJXiWeE\nHXZoq0NgPchPnM5jmG+Unaj3hMp2tDFrhO2ABQNefEkOEP+KrTlu36azb8J7\nhijFGh0iOQBXtoVCqgu9kyzCaMrX1mx+U1tysi6fNBn3HEOtNf7dwcHstfyw\nBK16RHT4GCuAIJA5kKumeg4tr1ZoUf2fGAhGiM+3BggG9AUam90qyDswc5mG\nfvlW\r\n=Id+0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"2020bfc867388d52c0303f81374129d152427ccd","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.158","@balena/jellyfish-environment":"^2.3.2","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^4.3.4","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.185-renovate-non-major-2020bfc867388d52c0303f81374129d152427ccd_1607179046126_0.7024974407625","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.185":{"name":"@balena/jellyfish-metrics","version":"0.0.185","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.185","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bb768162062060e08c993dffd8515f34a07894d9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.185.tgz","fileCount":16,"integrity":"sha512-RL9LJcNpxqU6SaDS7WDstxVhJc3KkGUAydDuMm3Xa0S4UOThFb8kds1Ja9Kk2kctISBdBttHygXRjWZ+XL6jOA==","signatures":[{"sig":"MEUCIQCn4WJwLBE9J+QEDOBgmcOh1xssgCY/cWUI0XX2Z850HwIgW9Vfh+iy4fD9FIHkMMHW/F+14dMmRRGiYRyEv3N6XXA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92242,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfy5vMCRA9TVsSAnZWagAA+MUP/0iNCRSEjpoOkrfuPHCM\novgTPU0osnAZOmaOUK+GydKTgAEtDY8XyhUUFH+3v9RjWHD9iTexEled/lrW\nfeNxOrk6MNmajoDcfolrklTF6YXLO87za1faOjtjDOM3oD4oqnrvgVAoSul0\nNfOtklB+SCSFUAXuDKJt0HQ5vFQJzeykzhEZe8NO0cEnRNJhZdZRldA2SSZB\nZ0RiHMSzWSygG5eX8AXZAD7Xh3Jkd7AhcGz77t74QF51Qyn/Qbig0E5ye+bn\n7dM9kDZoN+f1IsrsHY7RK+XIHbvUYLp/wfGLvhD7QssKxwQCuN9rVCCuhWj4\nTwIErkE2e3jfa9fqx3HOvh7+p2jtNCSPJ4AZ+p5rE4KxcZwG9txMUF/0mcIe\nQm4fl78mGQRjRqolNirV8cYB3qHAamKGPFinA//w2FvIyIRcoE1zgLOuuwaV\nfe6giHKFr4bbCCzmVGdGhNXWAV+16KruIw1MQ94OEfnTzJyUqiE5K6K/XcLt\niKO5soE1PJNCHA1oGJ5L9C4lraI8lub8FvBvk0rkOQVt6iJOkp9grA0T7KjI\na0EQuBXAwCvGo5KZZYWdOX3vhoPZj2XQBmXIg109u184YwUXejxD5dg5sthw\nVCAz4gKGqrehg3+ZxODIBxOmaqVV2Ymz49W3CPxkIjhmM6Cq166T+vE5kFE9\nEn4O\r\n=klbq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"f03b7315f8cc27e5e1968c71155cd4947bc8a5c1","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.158","@balena/jellyfish-environment":"^2.3.2","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","husky":"^4.3.4","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.185_1607179212218_0.7166084249519478","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.186-renovate-husky-5-x-8985aa605409d2c9415f51002f53f35be66af37a":{"name":"@balena/jellyfish-metrics","version":"0.0.186-renovate-husky-5-x-8985aa605409d2c9415f51002f53f35be66af37a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.186-renovate-husky-5-x-8985aa605409d2c9415f51002f53f35be66af37a","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"150647b7bcd2a3b9d4b095c458f8d60ae6f167fd","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.186-renovate-husky-5-x-8985aa605409d2c9415f51002f53f35be66af37a.tgz","fileCount":16,"integrity":"sha512-mW7SfvMUasAe3hMdyIPksyr30Tac8zF8LyTqGwVMl7MFvnxl3Mp3b3zhP/80jP7MxoFkOyn4OLRfFSXTHgyHrg==","signatures":[{"sig":"MEQCICqYBzZRORhgX729EsRmTCfyAkJxcijyFbnU5XTKcko9AiALv95/9ro8E9xg932h+1enl3ft2F6+MVbe6/jBgdFLmg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92385,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzXjrCRA9TVsSAnZWagAA+JcP/jfS22A3ONJl4x90fEkN\n+Ft87Tc8W/v3JOWMlr8jkBgdy7MRW7XIVz4AX54rvBIlBdrw9MRV4jbD0GNt\nTNcwKUjN6OYP++Iv1wqbDim61P4f/KxZKh1p80uwhsXTKsuR99gegU/pDvb7\njYVoNSerQnhvZXWyqqIYZZonqh2Lm5cAtZH14QWVpWZB8jgo+DyNKJk4KWa7\nN+rgDtAzUi7niEYmohMrmB1xOOdkdK48xmZCyfpT+hc4hyebR7W9nW9EIVo1\nzfdIV+ZvHEH2F50ABvQlVv6WrZCv5IwzCDkDsshT3seSIfn5+q+r50SsZ52o\nJPqCF2zhjjGfjoTay6oSvusuCY0ojhhZ/uK4du4OYYUM2qTHUl6FZW4zcXZ2\n8yytRJgLfCYyo5+UOZdDSs8MAjmJDayIQKUKM4WZRgnvfej8iLM+j0NDGmo0\nqfYyzTYunqodliwDot+kuYENvgqNfcKtpU3Jf7EWlcP7e5vkVJ9s23WNjFag\nglx2RNy3jYLxqAywakOtSCoHPEspQp9KHT6gtRyUUKRWfsYAGnDzJxOmgsEk\nx3x/pp0hwEFnUMmEkgkg5ktDzEgwtw4cpIms+8v6HXWxwjunAYHMPM4/8rzi\nt+1/2nuiQj7qUH9IskuIByvxmoFmXgvVwGKn9s0eOX6woz+WNBYKMtSJjBtz\ns6A2\r\n=YC4E\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"8985aa605409d2c9415f51002f53f35be66af37a","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.158","@balena/jellyfish-environment":"^2.3.2","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^5.0.4","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.186-renovate-husky-5-x-8985aa605409d2c9415f51002f53f35be66af37a_1607301354737_0.5995524323665706","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.186-renovate-husky-5-x-0479b2c1419e0f3f00434b72016079de400c792b":{"name":"@balena/jellyfish-metrics","version":"0.0.186-renovate-husky-5-x-0479b2c1419e0f3f00434b72016079de400c792b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.186-renovate-husky-5-x-0479b2c1419e0f3f00434b72016079de400c792b","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"85852b683773286ae5789374c7151672259d2dc7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.186-renovate-husky-5-x-0479b2c1419e0f3f00434b72016079de400c792b.tgz","fileCount":17,"integrity":"sha512-aavwoD8fiUhONKKMXEXgG1RVCFB2DvEcuhbcjJ5eVhuh2yTbhFy/VmDxiSsPxpT3JdStNSQlRW6E4BihsvGWCQ==","signatures":[{"sig":"MEUCIQCwgyCpD4ve+wCxTtep8zOiJZWHtGJ8LFPxhsVKNq4+HQIgbmFdKtxf8f/47ob9PMWX1Y6nCEYdrR2pgY4ewk8Job8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92487,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzd7cCRA9TVsSAnZWagAA9HoP/1L6DXCoYUDK2w1YB5RA\nOKSe2mdpCuiFQDU4P5FpBJYcBisO94Ijf6TEINPQIcomrDCnEQBhI0MGo6G2\n1odA7C2OwoJQZOWa0Ntis4pnT5wPmSsHb4F3fp8ED2+NEMSpB7ARNmeBVGCS\nmt15AcJuKmdW7YGLgAVpyqmJafRbwoCR/WVakV1R4YFceX+iiHEBweWlPy5X\nRfBmB33XMlduFWwPzxvFWzA8yA64jdsA94Sm4wmAvb3bRzozvaujR/rK3p+F\n7EhEKZsgFheGwG/HgDHQs6g+tzh88FYMYBIbG5i64MflutERnz9DV8iCn3Kx\nMTjXa2eMypgjiGmSB1G4U+n1RN9b7JihQ1iVtY7/5JKlUIyhXKdWz/mysqnF\n6Az9ozZZVpYOZLi+5XmONrH4YqlAhchnRZgzddnVlwdm1N7gC+Of2sGinULb\nMxWyFxlKjqOEYcTaRdCRTuJO+ru+6zJiBMdXDd7VCYQvyWTxRCj8w1Dm0xCM\nPj9F4DpghSsEUu1/yuq2Tpl/vzTEa4WVPI4F+xioIEOAQzzNxRGDsgdx5Dp7\n0mppDJKrRZhE93wLTtkSYqYoBXc3S5PetaLUgEGLzDs3M8I7FbexeC1ikH8S\nt2IDlx0HFwgW+m6az76XEsWq7e4KJhB/oH2XJeT2Rpr7znRtubiaJABtxSvd\nj6gk\r\n=dq5b\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"0479b2c1419e0f3f00434b72016079de400c792b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"is-ci || husky install"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.158","@balena/jellyfish-environment":"^2.3.2","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^5.0.4","is-ci":"^2.0.0","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.186-renovate-husky-5-x-0479b2c1419e0f3f00434b72016079de400c792b_1607327452125_0.9846463087538513","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.186-remove-postinstall-568d344f90571056be26c44c6721e908b3e978c7":{"name":"@balena/jellyfish-metrics","version":"0.0.186-remove-postinstall-568d344f90571056be26c44c6721e908b3e978c7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.186-remove-postinstall-568d344f90571056be26c44c6721e908b3e978c7","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"af7766e04df613dc38cebe0412957b38fcc54bab","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.186-remove-postinstall-568d344f90571056be26c44c6721e908b3e978c7.tgz","fileCount":17,"integrity":"sha512-kX3DNYou5SaPosEiGQXcpnXM4y3BW0ecKlx3gyoPvWWHCawH/UFld8Y4WgSv1eZ3xNolYpzbUmV5yOoRR8q6sA==","signatures":[{"sig":"MEQCIAmRar2zqKG179A6pBh6B/GlOjY+PotvsWQ5cEEdujfnAiAXHNfU3yZIhVYlP/6/nTMzPJlhebBVjLn3eI/yGdgqPg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92461,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzfW+CRA9TVsSAnZWagAA0igP/3PI5kO2KnU0+ilDvSG/\ng66hhlvSg5eP1NQvZpQWyZrTA3gEoc6gonCcFOAPxEd3WEw5K4iROKXqYuqc\n+LFcxH12EOPfyuBw9wdaeBMDS3v9Mt7y0AI1IgLFIpPUewrlvuScQeJZ8s+2\nclc/rhA7rsenLwQr+ER9ug5BnZt/0VVkeDYmKQIyFnOQ4MBc6wzEUZyzYbve\nKpoQ+1oqDFjFfzdGVSNJ9CaWsfUooD7qr/ftTm+IU3K9aH50vUo1jiDQ/Vz2\n3/ynNoL6dfe58a6mOMhq+sDEOYeJImE7yT5d+xr092yGXt9CFJWEvhJ7irL0\nTNQHV2pyVndzo+wsbm7vnCHEJKX+iwmIfUASKVckBkgLFpNxSBwvBYzPwZ2T\nfGvr9W9RYHdcD+/LRWmuCQmL3VxmcARRWi5HD1koq9qnzQrHWyIF3Ju9OQ1p\nMjB8EtGoA3f0jdMlJaSXUrjqKdVlWpzqxfCn3LobIzzCkARCYJk/rwbqu1aj\nSvapzHSvG+VUeOKt+MaGO5kMkoSzzBD26uTvotNuDZFrp2JouKhjcXQBqHBB\n8TrTPX9HzrZdzwd462E3LUHmtr3gIP41DX7Vtuwr3R8oCEGrz2XGlHhCF1OH\nP6tYiUUGK8gih4iZyfLo8kCYeCitZkSewkbB9UU40yKWLPuLYNLLWaDCCn9T\na//t\r\n=XCQh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"568d344f90571056be26c44c6721e908b3e978c7","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.158","@balena/jellyfish-environment":"^2.3.2","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.13.0","husky":"^5.0.4","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.186-remove-postinstall-568d344f90571056be26c44c6721e908b3e978c7_1607333309441_0.046786860490183324","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.186-renovate-non-major-42db35d5da6d9fc8b061df44b9098baecfadce34":{"name":"@balena/jellyfish-metrics","version":"0.0.186-renovate-non-major-42db35d5da6d9fc8b061df44b9098baecfadce34","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.186-renovate-non-major-42db35d5da6d9fc8b061df44b9098baecfadce34","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"692285f04453577b710cad61177731df95a4b210","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.186-renovate-non-major-42db35d5da6d9fc8b061df44b9098baecfadce34.tgz","fileCount":17,"integrity":"sha512-3jY89Lb/9wmbb8+6OKCeb63FggjFPia/xRpRYgKRFsHJUhT7Dv2gldsE8hrb5HOm5HeUsqV1VAHktEusObeCQQ==","signatures":[{"sig":"MEUCIFOzQPF425GE5Rv47hLOT9x49uHRJfgeApYFV29xJhUTAiEAqODYamf3YFsT1U23EAAjsheIUUeW7It/gxXFwUE4Jjg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92502,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzgz7CRA9TVsSAnZWagAAk8oP/0tZphhdxoVx7b/BDvTg\njJ/f0pL1t54hAcuYrWU060OVyK2VJuVuTLDaoNLmjXukAPcqQPNUlA3y0aR1\nmpAg5AhUItTr9MkBRIgXGQTwyieieKH5czMu42+Ri9E2ClOBUn7gCVzi51Vh\n9f8emlMV646LI8lzo9X3ToeUcDQc2OtxKTD4rzfpCvcLdEOJssO+54Iujdas\nQnuAKpeV43Nrb8QBQp4LvPDGGRaC3Y47HxguvhFegltAsKo7UWL5PdrVFnmR\nNiS2js/S83bVmxrQ5ACt2gPJ9d09LNS4c2whIFv1mZCveWQg/M09NDnjkDRp\n+0VcvSrE5P/K2g1+1FXbwVfHYDGb/B5xM6NFZyDq14E9RGw3NhHmbXg658j6\n3pHfEASKbMPL/PXvBhwWKGS5SeMNZYVQ1tqFL6BA8A6OymRaT40sS/cYIAWj\n+KoMCkmQjc/g6H6ukAlT0Ph7a1xKfs7j+735MIjj8sdyRwUCe/oy5de24xzu\nFRRJqjCkbkQaMb33c99gdCdXwN9gh6XmTKLyFNoxhYmSZXAB7+iDuz5OPUiX\nTBxrdvKx+p/ClYoCgmNS67DZeTA0E1XNNQ1MwD3ZIrSOg4fYFn8MfCJYehVS\nzlP13AN/orgrYR65oTGMuOeqUNZ1xOGfwL3Xk1G1nx4jtnb6K5VoWNVeNeoW\nL/lZ\r\n=P1mb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"42db35d5da6d9fc8b061df44b9098baecfadce34","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.159","@balena/jellyfish-environment":"^2.3.2","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.4","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.186-renovate-non-major-42db35d5da6d9fc8b061df44b9098baecfadce34_1607339258664_0.3355476875619028","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.186":{"name":"@balena/jellyfish-metrics","version":"0.0.186","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.186","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8cb6f54cdfdd807c761cb5948c8127881a062f1e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.186.tgz","fileCount":17,"integrity":"sha512-nif4KVTnMG4idLKc6kBjnzzW0B0CEW1DlVA84o1KXESKqzUZse38sssNocZYa6dcfrg636orqGAVJHw2kX148w==","signatures":[{"sig":"MEUCIQDFDpSIW0z/NDgkv36tz/ZLeoBKbtcCGTjuiH453itzuAIgcZKMYebcOv87Kfm+bDZg6iVVJc11PD72f1WCaa0IWmk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92442,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzg3YCRA9TVsSAnZWagAA/AUP/1nAIRdtZW1ymW9oXYtH\naje8JjxVuRy4txIRRXRqrgOaOM8j3PNxl7zSZiN9b88F/OeoasuAqwh2a76W\nkC1XrF2z5WO4YWKUV3HjrSfl1Z2suB+SD8RV4kXF7TTnNNQ8TEFbc0W9D/tL\nugrVE8SJi5eRlwWKcP9HH4Vw47/Ww0N07izcUcr7HN/ohiGp34qZ9PNVlx/n\n6fahK2Gk96/ICPWFS1NBEyxRUuUmMy0291e87U7uKwbaoBP12bA8exQr63X7\nkuPFVbMWzdHc0pjr4u9EFwMeN3d+/acnZvaiFKmKKYtMhzkCt34FLVuaMnx4\nQfhhqjMFBn3tR8dwRaR0cCEqM53giGPwLL2/UZrVHxNq8BbWTFgUhkh4Y0TT\n5T+97Mqr0bPQcEi7K0jf85kAvTFdSNZIB8GqEin5NPB+pTrg6gvSIza8x0sq\nbqkjv23imyikvitcrqe9yxKmzEOktXImW1RVhbo4OJKn7vI8KCmGxQ8p1QOr\nvCldosU3Jmp6N4TXKN8BBz3e1p4FMCujlZnhRb4wcvBniEz56hF4tWr4Bq87\nkiQUrGfwtNZcFqFRF5XAOXHdQZFQZ1OjPhTLEgsjWog/WQOADWS/LiT5bT5k\nnVrGL6pI3GcEkdQRQDWSdC8D3cIwtFB1gtLsFbQvRx4UNOSruOk9USA9+SNi\noXzp\r\n=q0P6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"94e1e7874b3c88259019d5f1db248b3e8ee2f9fc","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.159","@balena/jellyfish-environment":"^2.3.2","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.14.0","husky":"^5.0.4","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.186_1607339480232_0.10434617650432854","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.187-add-husky-postinstall-194f1103d8b1afba76b6709224e7a44257bf61d1":{"name":"@balena/jellyfish-metrics","version":"0.0.187-add-husky-postinstall-194f1103d8b1afba76b6709224e7a44257bf61d1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.187-add-husky-postinstall-194f1103d8b1afba76b6709224e7a44257bf61d1","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cb67a2c3ad5321aa01c92a5b4adc23940672e69f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.187-add-husky-postinstall-194f1103d8b1afba76b6709224e7a44257bf61d1.tgz","fileCount":17,"integrity":"sha512-oxG3dclX/MWMG7+f0rHXJKazWCHvt1f/MAKkBm+6OZvqDlpxI1Dv+rNpqnXEq6EZ84beOC0uWf97jMLE9q6qZw==","signatures":[{"sig":"MEQCIDrhx34p+R8uEEXZ6RB0KpdJe5boN1k2/zmg+X44VkwIAiBO+JAy6XcdAQzResYV8XDOhc4uUK473aQtQxf5XDyMNA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92654,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzuteCRA9TVsSAnZWagAAmzwP/3EIlSfwNynCvnc5GP5n\ns8a6xTDUcGR5u/a7Xvx2Hk4Nzz4aoTwoXFtU+/CPsTMfeGGJKG3mytK4M/Tz\nLJn0Bwv+c2LKapgKTWO/PPz2RAmZ38z2CKjq0xf8BRMkY2o+g4qbp4zpdmfQ\nI7L2c/WpK+EsExlWTQmowvphvylN3+lWELQk74skNbWcVGud9rLro6uD+1Sj\nP+4q9M7JQak8wTWmu+U0uKLyN8t0GiYRQ1f95N7EXC4Kcez9/S6LZ7V2RVyp\nNBiYkFPyfeDg120YM8upfIPTtkeSjYk6UQD6i3fZZjARnwcmkzsII7ZyctRR\n6ZauAYQqXcwVRAoq8abqHLdjhH/M0Azg9kIcx1RzdAAh8af5FsNhHjiVcHqL\nsQOSZtkPlaqUb5oFuwcxHuL0z5FaBupXnVQHrOldrmeuyKwg150KJgflpvHx\n8jjcItNRRANJRZSbTPVX8j8Ls7FrbyOtx0LmDC50QfoGhYI/j8QPDvEa20V+\nN2ZG6qmj+Hwkhk0VGzIDVAusnht2ZxtSyNvXhxQPjO19guDdIZ8T1Wf1yoQS\nojaAvcZgdHbZ1de2x4uRlcuhct1e2dok77ODYSW7RgYyl09ygqswaMxtivvx\n3AsEVbeunnTnbznZLAO0QodtLuz9ICC8Io5y+oBvkgvMIolYxlc+brT8Ujoz\nyQvC\r\n=btvB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"194f1103d8b1afba76b6709224e7a44257bf61d1","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [[ -z \"$CI\" && -d \".git\" ]]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.159","@balena/jellyfish-environment":"^2.3.2","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.4","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.187-add-husky-postinstall-194f1103d8b1afba76b6709224e7a44257bf61d1_1607396190439_0.926563937670962","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.187-renovate-non-major-4a11e735f4054684ee40f3b68d816dcc244501be":{"name":"@balena/jellyfish-metrics","version":"0.0.187-renovate-non-major-4a11e735f4054684ee40f3b68d816dcc244501be","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.187-renovate-non-major-4a11e735f4054684ee40f3b68d816dcc244501be","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6abe97e5b619ec53dd6a2142c5675e99646092d8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.187-renovate-non-major-4a11e735f4054684ee40f3b68d816dcc244501be.tgz","fileCount":17,"integrity":"sha512-HwyNhzlyCVQI3f7EMvxDd4LVnayRCI9XGaJE0VoUVCvRlaf2OY1lQq2b0rMksNBGkRjI7bUO4LniutcDO9ctaw==","signatures":[{"sig":"MEUCIQDft+Ld38oIquEFLhG7JbmI9kOsqPbwsk/sub2XjT2RIgIgJi8L0R3ifRFush84RpVyYnsFEn3vRrwPNIu3GiySLeQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92692,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzu5qCRA9TVsSAnZWagAALNIP/1dnu7OFQPOi16L68tyq\n05W7guEfXCW7KfI7KhlCyn2CKhK8Hg7XHLc3Q4PMzARqztRAxv5zjEQJo56M\n6PRu9QCE9MMyC46rsEsl5ptCyApnPCihEM1C9PrYbL9iMiHgY4vlKyUPtVG/\nObyC8nJomgDTYhJzZz0AohklSuU5dLPOHKtUuYqbONs+5aYOS18FywbDdYvG\nVzWS/KKon+0Pa2eOJ4zcjVFZe/LqkxZ/gKUVwtvVFfbf/vyd3KT3pi5MZgKp\nooSK+cqCKUHnNGUPF3BbCYBPT2Z0B/sxx6K3EC2UZfybc9dcuZZpuu6LbjxO\ntSGtGcaTdFZnHjohBqU9JUYr403cxTxHCijlosUw6ZX44fEyXFZPCg1B2xTO\nxydl91NDZfPVH485SiADN+M8O8GLIg5rTvOgDxZst05Gxkt96TnW73OdpUSs\nT2pVdQOp9EFKbdd5SG1HoOpQy5vNnZZSUtXYk4vbIZnU5KrWQnVAFJcGuZll\n+MWcFyLx1VWzP2U6iSjRwJTVinV/KAa9wSaMC/Nf4gwTNl+5XDaQ9efA6nZb\ncg0TsIdKSUok7VlCWbKv7yRPlbFL/WmVvwO4i/TwM0ZSzJ7hNCVXTkx8uww+\n66lzq+lD18HThFzeUShyOm1a+lHOTajt1u1Dg2RYGUqKlsH9fdoqAllY2uLp\n7VFb\r\n=tc0E\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"4a11e735f4054684ee40f3b68d816dcc244501be","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [[ -z \"$CI\" && -d \".git\" ]]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.160","@balena/jellyfish-environment":"^2.3.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.4","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.187-renovate-non-major-4a11e735f4054684ee40f3b68d816dcc244501be_1607396969405_0.3995764525045631","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.187":{"name":"@balena/jellyfish-metrics","version":"0.0.187","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.187","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"faa6d00608cb0580fa5855df441189f1a4cc93d8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.187.tgz","fileCount":17,"integrity":"sha512-ItCMUM35YcK8In/V8beXkwqjrr0+9Z+ZLglaYLgN+oMWoRffe8jqe/BzHQ5JbKgRQWC3z9CQ4fh30/Xq7zQPTw==","signatures":[{"sig":"MEYCIQCM6Rzsu1Kx0PbJantWjvt2qsQXmALOsOiCu42/Ez2rkQIhAMIgnnGHP9a9fUWOzHJovFbvaR4Mb60ss6NIAMSMCy14","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92632,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz1NQCRA9TVsSAnZWagAAIuYQAITT8AgvrEXEIKM4fwSJ\nUrEdU9QZCxlAgeBHphWPq8TumqMXn7AhmIbLG8qnHFjnlwuVEbvongG2QVaY\nmg8TxFGPoKmrzgHx1aB8O8MzV3DxKIai3R05XvRsQK10jkgOzl3exAA9J7Rv\nRGnXdSN67fC5B0RwzvwBL4mJPNu9GH8drng4yJHzy9WagpfEJH5Ak0I6mZRH\njySwaIdAo8UP4vNnFvOp/tNTgObn++8YwlalKM5fNjutr3BvtbxNIzYYoAxX\nuMDpIwr2OqGm+yJwpQYtEFkbdgLbBmvUDc2f872Gc60l1anzNIYvBgu133Wx\nxfDCgatFosvbyWdjJCl4gPVsFudI2mS/nNEW8Be0vw5C4VcIc9hEFcU4DpXV\nO2rw9JqmOfUAGMssJPMQnrIEhV0qJzY09YXU7jNIwCDYfm2Ng5otubQIS+mi\nZmYyVdS8lL0Ooi5HwB0zrW2Dscqn7/ONaJy/O/53eiiGoP9LECVlCW+fR9r9\nwwWOr54niNPXctFWDLpV0b8DtZttW20/tzm/Z8VGLkOfklQZHHfnCtj/wfI/\nbiNfbCs6iIE0h7f0pCh0pJJq7vXAULP+BOeABt7IvqKYfU6kEERhW+IAHAPk\n7eRGCxLHQX7HS0IMvX+WPeVzYvYeS2wBKq5OmOlOqxKeGw7cDkAxdXh4Mvq/\n5Jk1\r\n=Nxf9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"025fa024cd489ed575dd0617924715f82d3bf08a","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [[ -z \"$CI\" && -d \".git\" ]]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.160","@balena/jellyfish-environment":"^2.3.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.14.0","husky":"^5.0.4","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.187_1607422799562_0.16536827399395038","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.188-renovate-non-major-4f1a5ddd0ea401a6f0a12db0873fbe2001de4d7e":{"name":"@balena/jellyfish-metrics","version":"0.0.188-renovate-non-major-4f1a5ddd0ea401a6f0a12db0873fbe2001de4d7e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.188-renovate-non-major-4f1a5ddd0ea401a6f0a12db0873fbe2001de4d7e","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d665dfe38f9112b1f5eb2272b9b90872fadb36c7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.188-renovate-non-major-4f1a5ddd0ea401a6f0a12db0873fbe2001de4d7e.tgz","fileCount":17,"integrity":"sha512-9NOO2xkTb+y1QMozKCqT0gDhoqdUCZLqxtEx5carbB35ebHoG3fjPIVuKH30LVy9JKFhOJajhdDBn2vXqtfcng==","signatures":[{"sig":"MEUCIBEkko1cVXa67hWoz/bZVfhdiiWz/wApD0+8U6QCJBw5AiEAjLWK7zpv4+baKKPuH0msplSnEhnoiGGXmTmTKIaSCsI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92762,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz1StCRA9TVsSAnZWagAAlowP/2zYp2xEX+QWJKNyNvN/\nWDt6BQOTGF95v+EWEoALKDEG7pMkS7YpqCJ/bLKHqxFYTe7Iv045utv75hey\n4stM5tBI3r4CBZ92uTHheYPNBxRxAVk5b1LO3bazW6H9SBhEwapPlZOYcdv0\nOj/gyM7N7CukDSwpiIqNfyy7PePt7yTD+2fNiiJWAMEbDsn6IC9bQne603nJ\nYdvWUwdUou0JpjwcaBOgzTyTzjCLXF9QB4t2bktK2PgUf7Uzqx/W5aaX0C51\nUwfgcROb16gVApJ581+msQltD7NnS8J7QJf/Ddlck72QhbnE+nn0CgzaN1Cy\nEvTUx8oVURjGcLmyoBt7zOzx3JuJ9eqRgA+bTX77sDEL1eONmo9pCEOHmMj9\nu/HZ4ATKWHZTW3ZVLhgGS3Zaqfd/S+Jtmg117FTz05LxmPaCzaP8RphfMiGJ\npxsAc2mB+/avbJunFI41Qn9lpWf50CXpfAGDEgrJXKS4SHGFUDnk3VgAhUkN\n0/1aJmJpjFkdjXFBy05cJg4LEuA8c5rxqfcLkv18E/VnAVT1K7fB6+t0S/aP\na561gnoQRgazQW98AfhhvfxwiSdeRzVHEHsl2uMrsMoQ7gbojQ5acdHGIzHp\nqjlzoU6/1GrGsHwtRx+oJMlfgUl+rxHEi561XzrMqIjzykEjQISY6xenksmZ\n0IP0\r\n=P9jt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"4f1a5ddd0ea401a6f0a12db0873fbe2001de4d7e","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [[ -z \"$CI\" && -d \".git\" ]]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.161","@balena/jellyfish-environment":"^2.3.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.4","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.188-renovate-non-major-4f1a5ddd0ea401a6f0a12db0873fbe2001de4d7e_1607423148884_0.9490906288696295","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.188":{"name":"@balena/jellyfish-metrics","version":"0.0.188","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.188","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"85040b902da8c6f5dfddb2d1258fbdf278b33d9f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.188.tgz","fileCount":17,"integrity":"sha512-O8RmLCTBURzWjnXVmbKm8ucLOovdPhWFcK/N6US0/0wYzt7krZGOGyz6IhFz8kfnEUaJsJWvh14aoQ1oFk9S3Q==","signatures":[{"sig":"MEUCIQD6wyv/zD1XCUciddIX3KP6OtbGkW+Fl8K9cZbVT3N3ywIgdF5WiOfrBJc1OjUiQiJiIwLQtDoNMc6ts2C1Za0vbJU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92702,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz1b7CRA9TVsSAnZWagAAtcUP/A19nHb/8CYpV9/i7w3Y\nXP7Z0wTYqLqWk4reIE6aKDVutuc2xVBoY79EttuBl7jc2NKtHhgy/1z22UKC\ncZiy2P4r8eRW7oUDi1+Mk60705Klt2Tq79PyUQ+N2Jtg160euQRo/i3x314U\nKZsFkah4P7AvhdY+A46duQN7XqfhOO/BVO2NQVIAGlNCnxiMJDKyYFcXnjzG\nhxtloXydfC2bCFS8PdDRHoLJ1yi3nf52BT/hyZX6pDAk5xYoHltnjQx+bp5a\nS80Bk2T+Sz1/+mz5uYmuH20Rx6aiBpbbyIJGT0LxYPznc0Y1/kNZDkzQywHV\nqMdW+o7o2KMImKS8bg4/nP5Jvew0wy118LVbrZTa13wzKpLuqOCp9keWld6U\nvbwkgYYZwN49Et4u6uouIW1pzXYRmDTjutl21xJA7Ko9/hfXallVKdcCaaQQ\niHq1tNeYikkutLP5QLd4fpU20kxpFmGEkUrLeZ5h+6reRqosFyxBZoMrr/fH\nIQ87paQZoZnv7HYbU0cKkxX9D47eSvanHqKiRpTACEJ+UCb/SJ5zBv6u36Up\n4Vl5/rMcMueq5JK59nJ31dQOaePE+lMA+3TFlE0+46wuHrZ8CgUcYDa7lKTY\nPyZIANBD21EstMvSKWN/ermceeeuXktjMS2EBv8uzGOZIFvs56/tC5PrANZ5\nT736\r\n=X3Sm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"48df4476a4ff26413a776f5f73168ba7b0a83962","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [[ -z \"$CI\" && -d \".git\" ]]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.161","@balena/jellyfish-environment":"^2.3.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.14.0","husky":"^5.0.4","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.188_1607423738586_0.15039855486925036","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.189-renovate-non-major-2507c6024a1ad6ea9683b66a08e03d6ec5c67066":{"name":"@balena/jellyfish-metrics","version":"0.0.189-renovate-non-major-2507c6024a1ad6ea9683b66a08e03d6ec5c67066","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.189-renovate-non-major-2507c6024a1ad6ea9683b66a08e03d6ec5c67066","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c756f89c99b6d707bdbfc01c28cb8e6c097665e0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.189-renovate-non-major-2507c6024a1ad6ea9683b66a08e03d6ec5c67066.tgz","fileCount":17,"integrity":"sha512-c5AlLeiNtaDsydXJKBIvTtuZRuosaL3m3HmBpRRZu+i6/6XIw8Q6LwAaPZCb6zJ1eTDfTFEFyPI7Y/DVSQwBlg==","signatures":[{"sig":"MEYCIQCn5ydhLSxxwbPTMQp+ZDhc9g5XzBTYK3UDO23ry5Yt8gIhAL7MfscUGguChSFknow2yMVNr3evKeW/sv4RGs/8UwHd","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92870,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz1+fCRA9TVsSAnZWagAAAQoP/25lcEMZuRogkCcq1Px2\nLqLDpGCwdc1UR0R2d7eMEdIHC1ub+o1YU6Kd6Af004ENz9dz3jpNAmhcX9+Z\njxadVscOdQEPJruKswn20A1BMdFx/2RzdO1mox3+AbZxXK8pH3McGTPUPZ/2\nbo5st3H1WqASJPL/UzgvXe2udKRD06n2FkhuapddWFKEgv4vRoDddXpWHt6y\nPuzHO0/doWDfi5yLWPDHWDPHpeZxBn2L+hEj1ryeaiQ+766KyeVyIJKr0Blq\nTkETG8atO1oAk3avnP7kcgMakW09oXOOr6lkPHGX4CQVWVlPZMpnTZfBwkzv\n8WUZwJMHtgd3UemiRzmw+d3N/Zq2OLrK3JZWhMpvppgB+RB3m43rpLSBGHFE\nFz38ZIWX8875grvmmcOR2yN2f1sncsQEM77+cob/HNGVpvxfKy128uHcUtrg\nGh5uuSpvm3ZEj1I1rmfQlZS05Gt/gDQQWz7VdY1QLwjHf2np2fkmtdpOX9G/\nVNtwMW2KP4iFyn4VYV4MJ6BRtcBIPFAomGHmbz5LWaQiLKe10wD4FuEIuKd+\n9J2HcnDd4Ggie1llxDsphbnwtRWscenx+oVq1sKJahTqX7cjUbgV2Q6AmofW\nr7cVDPAyrOb5n/f9QowasghTJcku3PXCtwmCOz6VnGWUiwW1VZdW8ylzVUWX\nRAbB\r\n=iJ+V\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"2507c6024a1ad6ea9683b66a08e03d6ec5c67066","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [[ -z \"$CI\" && -d \".git\" ]]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.162","@balena/jellyfish-environment":"^2.3.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.4","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.189-renovate-non-major-2507c6024a1ad6ea9683b66a08e03d6ec5c67066_1607425951029_0.6345128620530918","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.189":{"name":"@balena/jellyfish-metrics","version":"0.0.189","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.189","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"731a904fdd7314580e881e19e2393ca837e68e4b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.189.tgz","fileCount":17,"integrity":"sha512-tUkvmKmnTdsMzNVerbw0uxV5JzGtZczsXe2nNOSHHduPyZUQGNtjO8VHue8nLoo0o83FWEip+NdqBi7iAJG/Hw==","signatures":[{"sig":"MEQCIBZI/qJi5K4eOlSNQyfU0zS+URZHqUwGxClYYDFT9OWzAiAakJBOSXz5RS+c0cMFWZdXy3d6ENpv9JlIa/dnJSR3XA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92810,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz2BdCRA9TVsSAnZWagAAqdwP+wdnLG/4VmyMSMJAPUGD\nGSYFLR7S3D2hwC7zyNoWZrb7f+YkWmkaPhACXXRDPrrM0PUktnd7bcbK8UHP\nuScfwXbWrJBD8WSpX0nPLtZbrw7Ii/EOuHFbGVwpO44LijCzZxmwMddfCv08\nHS/S/RJ7OrZT2Z5+CFkAtN/UxaZLGbMvnQ/v4iaoifYM1l1AF9ioQekZ39AK\nwYjCMVFKlj5r2rbWcXN1cHWkgY675xROTtXrhELy5De8twnvRrFVqWoi+bh+\nmwrWlhvbrS+7BVND6bE1zWOGMUJ3DprytwHvSEcmwLy0ELG3MWs10d3eF6za\nwHt80PXER35B2FUGeKVN2WLAh6+x/oqFTHUk8XoCWOS5lARjknSHdMQPAGEN\nfv8tgtdX+YSqrF8CNVi/i2aFNJQCUTLIEJ8+n4Xzwq3rUWB3Z64mo2DdAoNY\nnAlsTx93vatSU8tlVISj38eEwjoockE6VHF8pNnuLqOpwXuD6c08fA+8eTKA\nkskeILlYIvK0FIsVgkSkELQYRTDhF7d4BMiUVE2L4VgGrGxcFczbcjcqIMpu\np+YR57mhdKuedFVi4w8dl5AocIcWNDhqUCxwh86iqkTVPNANNd4erUubyBAk\nW/DgJjm6FEQWi/rN4TwcssxSeeWzlDalovbs4sZr1O0UqaEmzHGtN4cyvaOx\n95N5\r\n=CyZN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"ad9235aa94489126d18de4da7aec31d4db4ae0d8","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [[ -z \"$CI\" && -d \".git\" ]]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.162","@balena/jellyfish-environment":"^2.3.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.14.0","husky":"^5.0.4","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.189_1607426140724_0.08916481895838846","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.190-renovate-non-major-4d8b1fc2f9e8033ddcee0bffad378878f33febea":{"name":"@balena/jellyfish-metrics","version":"0.0.190-renovate-non-major-4d8b1fc2f9e8033ddcee0bffad378878f33febea","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.190-renovate-non-major-4d8b1fc2f9e8033ddcee0bffad378878f33febea","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d4c1a294f554cac16a6dea81eeec74f813ce37eb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.190-renovate-non-major-4d8b1fc2f9e8033ddcee0bffad378878f33febea.tgz","fileCount":17,"integrity":"sha512-XmRC7wTUU/OK4Lr1kmSITeMhh8CDvrz1ujeiuTJqq2B27ONChkodyxeIuYJhaCt7WnRzFJ0B0x9yk+EAStbTdw==","signatures":[{"sig":"MEQCIFL5pu6EHT/6TsizLU5TvFSca7CFWkksITqDL5fHncAjAiBi8bjzFr++hlEGtPV/0c+NJ1SKTUT5z62gDSZIbvbTug==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92978,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz/QVCRA9TVsSAnZWagAAgcoP/jLpDCSmt6Vqqz9JG0oG\nlf6Otwc76rTcgRhk2diGSvbCPCZNwGq8jMppOtfAdy54WgJW0LdRupqp4B4E\nW421uW5t1+8ZPIOOffsb8mVLQ49IegOJvMbirARHHg4in53todDT+yZu9Wsa\nsD9HF6VNnYgUkug1j4JxNorUfzfUaZubASs9wbctSjSZB+MIYIXOJy/Aniop\nkZIoNiPLvm8VA07PNyqcEeWl49M+QhdUpJR5/xZFgxowzCSLMVBjGS1M7M0l\nioTqNAAu35EiNcP2px30VwWE6bZiF7gZa4oDVL2RiVcQWNvyfDtmOHBmcj5Q\nHY2YHln5ohtpxtpJk7SzEFoaFOn3jZZ79+7Lq6iunLdblgn9nKdcmnJSw/sk\ncaIX93UJEjhAwu2u+2pXW2EFkU9bDKh7blvmBErB2Lb+/IaYJyuKIeUwY1vs\n0bYVbu5AUIfE5nNH180lA/OwnK0W/CAIMneL5pSkhrgRdVBCLS4N/bo+wVQA\n9YlS9BnArPg7HsAoMfLpM0hvV0HayM9AddRck7aUDdkkcTZKLPqI8/0LEUX/\nEQ6gyQKkhDcO0+ZtnyXwvO7CrbinugrsZIAwvJ0GFTdLksvI0TEDrOP5Bsu9\nDBPZCfqIY8MjPu/P60fXzgxcG6Yv5uOQ3Q8CBu+cGkn5eWYdr30HVn2nxaAr\nHhiU\r\n=f/vN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"4d8b1fc2f9e8033ddcee0bffad378878f33febea","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [[ -z \"$CI\" && -d \".git\" ]]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.163","@balena/jellyfish-environment":"^2.3.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.4","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.190-renovate-non-major-4d8b1fc2f9e8033ddcee0bffad378878f33febea_1607463957309_0.155771887239055","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.190":{"name":"@balena/jellyfish-metrics","version":"0.0.190","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.190","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"76f8ae035a43ed776b9961cc6a355f461e3acfbe","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.190.tgz","fileCount":17,"integrity":"sha512-jOwN8UtacPbWtC52wBNhBcKxDZGzY7ePwW1btL4wLPr3QflH+8ruqtysobCQ3EvfESAAzg7nwSG+VGzUS2/I+A==","signatures":[{"sig":"MEUCIDtCVrRg5bX60B5tnNVdsgVhTeT5A2DFsY78hcYj2s0dAiEA5O/oB2PPmfm8bh8RAnymHfpasUL5eeKeeuQgrjo/7xM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92918,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz/TcCRA9TVsSAnZWagAAKzUP/2EK1N6OgXOlx1GF52to\nTiWLhCzhl6CMj0V6Azkg5bZqJZ9MvM7jwLHxSO/ZLECM4EEMMqjbGwA+8Iyo\nmaHKi3cBv5n8/XSUawgtE8UeAXaxBMcu0HsU9wP5Oa7TJx+YudH+qG/0T0Rq\nZnnPZCI6EIrvhK2GNl3GjKOLjNqEJZY+xSSbqtNa5dJ80IuOTmOlWAk3CSqQ\n7xm2z5+ZTwsy1JJg4qa8r5nr++e890NwPvjEt+MeRv7dZtUNZ1nCsAqrr/QE\ng4OOu2nId/WujVSqFemwJd/zfpv8bToR0C7ybddv9be5SucC634hUSD8s+Mo\nOl+w5zzkqBqoKQ2250uGhRp7G92RCu2g7OLfv5fz0qOyEAz19L+pkM/ofSFu\nSxAfBkctAJs5Cv/lmqODCKf99zBiBokUZJXNJT3I61+W67SrZ31Iz62y3lGF\nOlywA4XOOULn6raX/AHhFm63F20bHY062v3kFkvSwcYsqhJg1s+D/6Ai4VQA\nwJr+nfzXqA9s1rjHGClVGtMtbMOp6gTnUC6nFbbcUeGYKUn/G5v8zd10/DKG\n2LM37hS1XWI2Yrx25k2qS6Enjyt5MsOTMNmRAZzR3c1DVJWoUGJIhki+JN0Y\noQIq8WXcLh/cMh3ICg7u+ArPyWJ4Roi4dRQW8GBi5tEAShH8D6BZJLINeMvz\nldoc\r\n=nOp8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"ebc09ae7b0a6e5af33151c8a6bd27d0adc3d4cc7","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [[ -z \"$CI\" && -d \".git\" ]]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.163","@balena/jellyfish-environment":"^2.3.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.14.0","husky":"^5.0.4","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.190_1607464155570_0.375961190113163","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.191-eslintrc-root-true-b296d8a75d6540c9cc586ef20cc8173f6af7c45c":{"name":"@balena/jellyfish-metrics","version":"0.0.191-eslintrc-root-true-b296d8a75d6540c9cc586ef20cc8173f6af7c45c","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.191-eslintrc-root-true-b296d8a75d6540c9cc586ef20cc8173f6af7c45c","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0408b466e679e33be9f00f15fd1888203465a38e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.191-eslintrc-root-true-b296d8a75d6540c9cc586ef20cc8173f6af7c45c.tgz","fileCount":17,"integrity":"sha512-KEZfcnVWqbzK7Z1hXS3vPZoXPv1BZLDEPH1K/1+8JdzM3s7i7EZH2UcEsiuyfeRjArPHjyDb/t6SoqiO3M1xxQ==","signatures":[{"sig":"MEQCIA4oWAgOVGlpskxiLAg0CHSwz/YQfpHACblLa/HpjWagAiBfjLTqhQk+Iy4+hz3pPref96jCvDpZpSUArrNVcMQl7w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93073,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0bu+CRA9TVsSAnZWagAAtvYP/RvlKOHEUANvTg3eeR8c\nqflt9CheOD/RsfLbHh72fwFB20NJVua/Jzd3m4L1TZubrBQy2jj77nvpfyQZ\nC7xQVw1yyadGAQSFN4K324UHk9pU4Kw1tQ28iG/MDkRDMwOiaoXE5hNlUriK\nvNi6q+bAnGVunVdYz16QZyPERqmCj0UBP0FLnCACJUGpkYIFOhk1Qk5r95PW\nexHvNLLrBcVybC1Jirl27m8p4Qm1PUfsjmV67oQ9cYuJwnpOTUZ/wKEM4qcy\nUx+W4IWs8G1K1rAGOf0g5+LVg54kKMQOWOCl1n3MbKKu2acMXy397x4XVqYM\nTrCO4zm+JK/MPYS1BUhrR811Xp/P8CLcvkPiEN1tHGAtSzJlHvcWhyr95ZMM\nZCgfxbYmLxgpxg2JzMaGMAgwScflKLZVYhnEDfrD6BRQN7FeKtqBxy1iZ5lq\nZAiRJKr6TtRGrq4HElJXfZlhC6E0oWGqR4C9iCtfG3oeaMJvDBzipMKognTb\nX92tgGms3bvohArTswwUGBTXfgxjytVGaxYMU+8pU1DDx4fvtcdvrl/v0TQz\nYB5aW/HVXXCT7QKsWNopFMgZQrm0F+3HWDS7s5FZMJKCmy9U8Osf1DBfKOZD\nle1PmB91KolVUEIW0bxusBmh38OcLo3NsgC+LBgKz9hC23uJjRlAasCrbR2u\nfILX\r\n=/M4d\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"b296d8a75d6540c9cc586ef20cc8173f6af7c45c","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [[ -z \"$CI\" && -d \".git\" ]]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.163","@balena/jellyfish-environment":"^2.3.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.4","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.191-eslintrc-root-true-b296d8a75d6540c9cc586ef20cc8173f6af7c45c_1607580605752_0.9572635731529731","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.191":{"name":"@balena/jellyfish-metrics","version":"0.0.191","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.191","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"25ebbc2e9da78ce03e9db8ec37aa4eae97072e53","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.191.tgz","fileCount":17,"integrity":"sha512-p6jMUu8e7zyFRbOOB2wYWYvsqdEw3Ay7547/iOPzH6XmtOXIcGUx8Z1wxSHUx6N4BZ3hiNHY0yfJhy9AZUrwOg==","signatures":[{"sig":"MEQCIGeRUrd+7YCodHEGWRUVxgNI+Fq8efJL+LNmJq4j0B8yAiAviDYI/pQS208FmnkOezMoLyzN9Kdv2qsmY1vS9+9XpQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93013,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0byHCRA9TVsSAnZWagAAXP4P/3en1kVhl6JwF0l5Zl/K\npVOPp52J0BJi+68rXnsTaV0gEVaCFojDrIuyjafSjvU260of/WJf9+Ft/ZtM\n8SqWls0uL6R0ek4xOBzsXJxeUJI433LaPG530tPgxHnUlUnV65L/aueWdh1c\nUPXV36mSq5n2PD3NH5BFuRbAsgm04O3OR6vHhD+h6zXJONG7eLccYFxAgDBf\nRSYyNxzC4Q+mpdwRqIh+xFXdyI/fk8n1DoJlmlLz/aJ9WvGBbc52TuVOcQ+i\nAaC0WIbh3hkXCTMfnkV1VXXeJ740QHMJ9uhQ5Ki2H1Bg2xfWPah49K1UWVP8\nNYEwgicbM/O6BZnC79+Cnf514a0NxThM5IMV0NHL30cwHB4/Yzra9h/ULyl3\neOeAnPboLRA7s8BlDfhCkulBbG8c6wOtuAIYMVaME5WFriZh8mL7B4P8AYux\nnS7hTPIhNhYJMHrvA0T3jkZB2bIqHz11A9D5dQdhVAGvZFDebZJXA7BiqG0k\nG2FgsBd7xdtAE4ZNccjuzQCKdB5R9nmhHceH8EGVKtCOfTm1l7AoMvpm+faC\nk/8ri17ME7tsPaMwN7uETQNrJYLLIEQlcXvbHgrURWc+siYGSV76VMHhIXFZ\nOrzZzbBhr6NH6qDfTC38+FhtgOU5M2fRbV9E/y2WdLjwgA2I4pPxgld8rOqu\nfn95\r\n=ancf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"6ffd8e31d22141a823e962ee3cb0bceaf2aa4536","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [[ -z \"$CI\" && -d \".git\" ]]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.163","@balena/jellyfish-environment":"^2.3.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.14.0","husky":"^5.0.4","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.191_1607580807127_0.48558612267555756","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.192-renovate-non-major-a8e6120d8c37147850de3609b7c2b149c3a5d649":{"name":"@balena/jellyfish-metrics","version":"0.0.192-renovate-non-major-a8e6120d8c37147850de3609b7c2b149c3a5d649","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.192-renovate-non-major-a8e6120d8c37147850de3609b7c2b149c3a5d649","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bce400e02f29524ac91536df0cfc5e8886ac4ffd","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.192-renovate-non-major-a8e6120d8c37147850de3609b7c2b149c3a5d649.tgz","fileCount":17,"integrity":"sha512-6koQTofpkBhhd0ZPljbc9547A32g/+8z6FPrA8+bOs9+TabhEpbNhcP0YQm2yZwZNQnMpz0vAMXh59wCCO3CBA==","signatures":[{"sig":"MEUCIQD9DgeU1qwXxeNNJwLc8P6rOaeXQEBeKCjDS2KILejaHAIgV1aNdsj2HMsPR5BdOp4iZRZryOI1XlkJsWOhy3BJE54=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93143,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0dMlCRA9TVsSAnZWagAA7cMP/RlSeftD6XC9nMrRnHK2\ngC9vYHC1NV+H1N8iv7KK5P0mzLn74aMPvkIWVc37VGE2H8DDs2PAN3SV0p3e\ntwhAi8WwUt6oziZljmHpxkp9XvlX2oDgaVyrh1xvf8LjMYNlS78Wq74Ne3jS\ngl1VC8jPA66Lnhpk/jys+OD2M+wu7pep6tARMUw5My89RPLPBnJ/XFaWDBRy\nHIvpV7z+sIxRx0B1HWxebh1kOA2W/xzKWWyB1jAC/WfJ16SBZDGoEXTleAI9\n0eydy4O1FBI4rK3ICZbNJUDUyQuJf53QtzRJpyoYxg9gGPs+eKClHzf7iMQJ\nOAvd64z5VhQ3edMHvo+dgV8TIZhpI652TlhHY7WtYfc9svbG7LaQgHY10h+q\nTu5hkP80GrtmmYc9UnmLmTEfnLalDDEZ5aO+8iLN0YN2huihskap2WTtlU5B\nPe+ok/rYSMAddEyXgHtiubBdInkl18ysXETV8tdTobotWNP24v2nxnjGZYt0\nEcb13Vw/9k5gawMsJbPhtRars5CxS6aX8Hxer9SRB67vpNz+owiNCXzBvfRQ\neAyTyYUiJCEroa9E+x2UNCCo6lNOSu15HYjeRL1v8PIypCX4W3k8nXe702tT\nwENhuGbT8MxVU2zE/aDJDeQMT+We7Y9EjCP/DlfZeLQ3i86VKMAPHgbihV3z\nFLxQ\r\n=RXz3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"a8e6120d8c37147850de3609b7c2b149c3a5d649","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [[ -z \"$CI\" && -d \".git\" ]]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.165","@balena/jellyfish-environment":"^2.3.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.4","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.192-renovate-non-major-a8e6120d8c37147850de3609b7c2b149c3a5d649_1607586596732_0.12339231770355563","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.192":{"name":"@balena/jellyfish-metrics","version":"0.0.192","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.192","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"618c26c73a4abe92628a99cfd184a7778ca0961d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.192.tgz","fileCount":17,"integrity":"sha512-80lOildeOCWOSUmwBoKmzFDUMJ40FDJXhc6A8PiVeKHfG1HBAFNfqH8Dfzbt46DCEbRrrjjviEwahbVw/D63XQ==","signatures":[{"sig":"MEQCIHshzMaC8hCki7RcEAvbuKFjawvXVMlgHX8OtS5tdaG7AiBauwFXoNxeEeW7hLV5HLQ5dhZBdwpF56LFh2o9Y9DSQg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93083,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0i7vCRA9TVsSAnZWagAAIOQP/A5rFZf8YvIc9MZAOJwm\n7KQ3SfazvHytMps9AYpURnTX7jjMIQtMGzek+MRp3zYETzpzVK1bmoEnoOvA\n/iICT6vrmbpXma3jF3ofCCd01aOqnF6/Vcm6C1I9qQ6v5ZUVxIpoMnw/HXwh\nuYCV75cOGuChepmt4ZyQK/4w0iaklKt8ft/U5pelC7rsZG9rw+hp3QAX9XdN\nG7eqZyLifj+JYbTI30hCzrvxRB89qDGqdjbtiFzcyTvggdiXr4C96IiR1Rjl\nkxY5Az4HjX8qc2ZuA4xELfmLuokE4sLc45R4m78FF2UV6jmlZ3gAI9wNunl3\nP64XbqMuPyDjHZOQPJREjs9Egt6zlhNqiq11czYyNcmKbO7j+XitLdj50Jiy\nMiS0TpQ+bLy6TYljS7Otfx3EsYTFMz/g9s/2LPFtYBM/fklu0MTyAKxYskHG\nSBLqHKQum8vMfSHQZFGedSH8iVHiHJVW3u6sqqFljCASVhcRoBleJ3eAEXU0\nkbe2gZT59aed6goVEilhDt+aZcaNvfv+RlLeQO8dTT6GoOfuhUN+QFRvocNz\nWILSvONgM8vZUYWlG2jEDQ0xDORJJS8Adkv3KIZzrL7IQU6B6Z8g5acSmQpf\nu8E8oZLG6srxbR60w+7wf/GE1PtVoCyZfS36H9HvmeKZW7xEMeoVqmXGvnCV\nMU5T\r\n=2nFS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"e5a029af2a4cf179b9fa0900b254187ecd21fce2","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [[ -z \"$CI\" && -d \".git\" ]]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.165","@balena/jellyfish-environment":"^2.3.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.14.0","husky":"^5.0.4","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.192_1607610094982_0.3922417175115289","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.193-renovate-non-major-ebd691f7f46fec6c9cec26a726554b48ef42e8b2":{"name":"@balena/jellyfish-metrics","version":"0.0.193-renovate-non-major-ebd691f7f46fec6c9cec26a726554b48ef42e8b2","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.193-renovate-non-major-ebd691f7f46fec6c9cec26a726554b48ef42e8b2","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0ed7e1b26d8ae5977a7c6f2d3c36d4c9897afd6f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.193-renovate-non-major-ebd691f7f46fec6c9cec26a726554b48ef42e8b2.tgz","fileCount":17,"integrity":"sha512-pkkcto3TSJngtTLgReMqupu31yVDpGFEe6HHqRkiGmPXpODZEFc8KcZlPqRPfTRYinLUW19K0VsxyuZiYcA0Hw==","signatures":[{"sig":"MEUCIQDWmmqh2uCwXutQfKgMmjpnffGvqey92LIIZ+90tx5EcAIgaLLM0JmfkOmB5k0Gqc/BCJ1BhB0oR9qogligtcgKDtg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93251,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0rRhCRA9TVsSAnZWagAAIAkQAIsu/J1TNy5V11wLEogk\n14NyHKB3vlDQAp7Z3bCBEtGmN5ROooLMjaQgO2YJRzXVaAxPWXPa/vUETm4F\nzLJnGRd4r4rZYLpIyWCENS9ZgX/eaZZColJsD1IwdSt6PbVLbwMZfGyJGHo7\nSVEollQ9gBPT9AHgEeKL1ekwLZTOqwY5c3PvsSBu4FuLk092QP7SJZsH0DOB\nvPoAIrGo1O1eZ6Dl/AHGDLqj5L0S8Xj2G+SeaWhcfQAq6LXDYDv/i/YeCAfb\nYJ5npFURWnA4AyW4DZRgsDo8LX9onRGBo4dkjFzaFyJBrtwFd1/QQoMx6pDs\niQ2Vqt6HBC6+r6TCydIslJsDan6/k6c0XdRjZmGuNFjTzmL4ZOGafi7Y2mKV\n7UEbhWKs8sUZknqNXQOFMO1zNXKdFgOazrktbMb1qsWlgDzb6EZZUt8wwf8S\nAOxo2O9NvUa7rvBr0yVkZVo2V3FDXcLRwjgfqFVsl2q+JQeoI2wrEvuCmerB\nmmhVMhssb+NhB0c9zaB2CCLpQTu/mjSBpiPTW6MnJry1825RKJtvFobGxiLt\nPmjMUcAs8/RGjCfOC6BGU+zGVfbzl3FKeupFMxV9yoDcBGzEDfsZbJexJoiH\nZVs0RphnmAdwDB8RdFeDr8Dsm4vMP6W2n6nLS0lgr1aJJet+3a4Il0TpKQ6g\nKTy2\r\n=AEVl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"ebd691f7f46fec6c9cec26a726554b48ef42e8b2","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [[ -z \"$CI\" && -d \".git\" ]]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.166","@balena/jellyfish-environment":"^2.3.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.4","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.193-renovate-non-major-ebd691f7f46fec6c9cec26a726554b48ef42e8b2_1607644256314_0.29926191351986753","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.193":{"name":"@balena/jellyfish-metrics","version":"0.0.193","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.193","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d82fcc7ac060dd06ff4c16d3c3b731aaf3b13d75","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.193.tgz","fileCount":17,"integrity":"sha512-WV+UAfzJAhlu9E/5buJLiBgnwe8NxsieW1gC3ijx5nj0h1PKCA0h44OZ1roQ/lzXbn2unm9RRmO2xrFMWTS/lA==","signatures":[{"sig":"MEYCIQD4tuvZ8pNm8TB6Y9qf0vWgq3a4p7WAGS0gM9GDUFCOIAIhAPnrk5r+MhRNjREgXXlKraOowgCyiCiXZxtoaL3HwAZU","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93191,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0rVLCRA9TVsSAnZWagAAOTcP/1+hiJmS1N0jybubxo0t\nhWpG3pjC8U8mLpF+WMCrX3Yzbzpc56OZP0YcQE4drim977inIUbYcHEH6mCL\nAHSVg/93vitf8LQDM0qPsHO228FHZRi8qqJNBlCb3UUVx9kR6kW+WP1tRjxq\nF5ztHe7/O/IEfUSluFNsp/8Xrd+eaOvIbW8BGTmJWzJs2e5bpx3ebv41KHem\nO4NIqqOTApaC7iWiOSAKbENyZSFJ82e3yziCjeiMWd72CLaHPJ/ClL7nsZYh\nvJhBFYhLhlkTq9aca+NaZ9OLXbyikdNCOxX2+yQI+aQH17ZLQka01YQB/SW6\noDGeoqnt6ialLjTCiimPgM38inZRL8vH696i6o2su+BqC1e59yxl8O5Vqgj3\nbUl5PuHrDFVGvp0qaQV5luF2KB5iLs8n0yAEgzfgJzZvy/bIUF3wmh8XnA5I\npPoXziH8T2xGFBkK88FvAl63nx8OD4nN/x8cGnx/ia1p5nBADcRnxmGrftfL\nrh16tcV4eomh4pdjXiG2z45qSZ4yq0CJIP0Fr7oTM1gQTFE0vInhUaPKUVv8\nex/d8gnrk7ZMonXloPZXDG6TuCb/Yi4AklLPm0WxNWMAW3qTKnr1ZSkbUVz2\nGz17cd5+b9b1rFZ0+Y1rVY9WuslmN2qAHi6AMDg1J748iPaq5ny1QculW+ef\nqbdH\r\n=y4fD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"c7f568d84bcbffb3a92b8de1bf224861314c90b5","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [[ -z \"$CI\" && -d \".git\" ]]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.166","@balena/jellyfish-environment":"^2.3.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.14.0","husky":"^5.0.4","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.193_1607644490675_0.6023990333278595","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.194-renovate-non-major-36a7feb91f107d941294c334e846771cad36938c":{"name":"@balena/jellyfish-metrics","version":"0.0.194-renovate-non-major-36a7feb91f107d941294c334e846771cad36938c","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.194-renovate-non-major-36a7feb91f107d941294c334e846771cad36938c","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ec3d7352cb547549458017b5205409f5d780e57c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.194-renovate-non-major-36a7feb91f107d941294c334e846771cad36938c.tgz","fileCount":17,"integrity":"sha512-IW9x9gDZWg7vc2FKwl4blcNnzhl74fVvQCF7eLzQ51kMU1Y7O4eP+Fbyi0tLsLTUeFOuqR4jJHMA37vtqOHIEQ==","signatures":[{"sig":"MEQCIArp/iq0LIfg0xDQqI459LBZr7F3nSfySMN5wbfKewwXAiBtP96KLDYGuaakiJNDdDJwIziothfI98cQhrqTK9RmfA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93335,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf00/zCRA9TVsSAnZWagAAhrUQAJNlSGUwZugsubBZLWkK\n0utbmv5YcwG3B8l7e4s3waY7hsWjk5cyrbOKgGlzf8mQKSTowrRd1tzbRizJ\nBLFIgR5hkuAakMqxCp2hC8xVoehowExrpg911ZQW2PGZZy9RBBIxNuEH59Bn\nd670DUW6dBw79x6TR/doWJAAd+qCtDlWUhcb6e+GrEkqEXc2UKStLkO29kWa\ntuHPO9VXEyUzs0PiO1hUZeqYWepE30a75AOgaKixY0GLNFNfD7vaa2n6vU+I\ngdGzyKV0pvv7aw1CqaIzbh369Am91Y7cUofrQ3ZAw7nTxW4MyDW8BzwJRHR1\npyc0ezN7JubC/QQmlj2KzMFMzxtNzCrcakwWUfy8oLLJiL08z8YjHNEnF4Tn\nbpxs5WNwkRYPZxwRD7NkgRxZCt4WQcjiSE1HmdF5UNQQ+Sfp/fajxDfwWEf1\nInf/goV7mSvb7WQ0Exg8phKnU/kJyg49u0UvGt8f4wmo6bRXL7Rbdq0TJgnG\npUze36hoIsYPAaSukLCTWUS93cj+vyY/XXQMlShqtACPkHB04TX0PUqnOFEn\np53DOG0Ok0cJJxgyowA6sVJ9Fdiexu9ui+7YixWi9jZl/Lh7ogu/qbQgy1Tc\nOdn3VePf778NsdPfOWHG+8fLPz7eGlDHHg6UgsR8f3zI2Y682OpBROM36DMe\nnwMr\r\n=Ki7x\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=v14.15.1"},"gitHead":"36a7feb91f107d941294c334e846771cad36938c","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [[ -z \"$CI\" && -d \".git\" ]]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.166","@balena/jellyfish-environment":"^2.3.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.4","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.194-renovate-non-major-36a7feb91f107d941294c334e846771cad36938c_1607684083480_0.413648474071304","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.194-renovate-non-major-acd78b438b09b58726a762226654f517ea1eee74":{"name":"@balena/jellyfish-metrics","version":"0.0.194-renovate-non-major-acd78b438b09b58726a762226654f517ea1eee74","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.194-renovate-non-major-acd78b438b09b58726a762226654f517ea1eee74","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"91c25e3da270b845ba7c6af0d54cf4f792aabae1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.194-renovate-non-major-acd78b438b09b58726a762226654f517ea1eee74.tgz","fileCount":17,"integrity":"sha512-3qHlfmDDUZDxYW3XzlRvhIjOd0ETwbat9GNrVNkr+jDNLsTZI7tjSx7W7PkmhTmU1cQ6Cj5aWd6QR6iHIz4prQ==","signatures":[{"sig":"MEUCIQCIrNYxlA5GbxCKeJyzsTjVYgn8OU1TteAYgEH5vbLS2gIgSnr/ntKdGU7kDnZzL7CUbQNp72MWey+6fOmBh7bJLdc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93323,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1Aa1CRA9TVsSAnZWagAAKe0P/itCY35nlkzCvV7xYKi1\nWe/Ah8FtaodGNH48LX0KroHXQmORMhmDFeKTGKrrhUdQYw/bs8792cMNY+nU\niTAEFvtsy9oyyHqGwwaSScipaxLqM+x6WczfCkAJBEz9jJ49YkBcL2vWKdc1\n0bM7rMDjqb+eA3iNJwK+e0GJNy9EVFXspQk0jxZ8RHPEZTahQHr/hdZdnUNA\nNAMyNOKLNvxhYNh8b1iVH0QRN6OZEvVm2xhx36axWxcrt6ttcRgsmtee2p5A\n8tx3HbY+TcsiYEl3BWr732b6VjWdEiAHJZtYCg5u3Cw9hmuHli6Pz+mAafYS\nTpsDerlro4ckEOqcPbN1+lPUr0VDumlnzYyzy9l8hNiGKgxTNwPqiAR76pWl\nKwTeudQ/6Wgl3vyTeISZsYVEbjZf4TthD3uzxFOIzQeH/VU71APjVguK/QvP\nXHeYcnXpDKH8PYgAO+jomIWeV8oW8NJ1tRMTIirCU//75yCt7t4rz4ERioHv\nfYFJ+9WFUVwPFZfuE6Qf0D58CRNDhnYcXD1j7Xw6/KGuQ6UfIqMnV/j/NrE3\njFua92J6AXQKv1cWswOo7kqPAkMCuMxANyHcw+IAl+DSySJMmKsssY9tUHMY\n9BIWlws9/J6agWJhy+9VMsauCTzXTaMWxXkNYNi/kMBiAM/a9YtaogyULJcW\nHfsQ\r\n=Z0KD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=v14.15.1"},"gitHead":"acd78b438b09b58726a762226654f517ea1eee74","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [[ -z \"$CI\" && -d \".git\" ]]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.166","@balena/jellyfish-environment":"^2.3.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.5","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.194-renovate-non-major-acd78b438b09b58726a762226654f517ea1eee74_1607730868543_0.5933078677993382","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.194-renovate-non-major-7cc8f2ba91390b34d24f1a25ff608f618a9060a7":{"name":"@balena/jellyfish-metrics","version":"0.0.194-renovate-non-major-7cc8f2ba91390b34d24f1a25ff608f618a9060a7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.194-renovate-non-major-7cc8f2ba91390b34d24f1a25ff608f618a9060a7","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fb7f38b980305bcfb3f8b6bc730b19a0eb51bae6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.194-renovate-non-major-7cc8f2ba91390b34d24f1a25ff608f618a9060a7.tgz","fileCount":17,"integrity":"sha512-skg61+491LVDamcUQNmTS9h0wB7zEdnxT+VeTYkjuZr//wOczvlPOg4zyfGyxd9axC8bXq/B3Q7fPiv31M1bgQ==","signatures":[{"sig":"MEUCIGl7qkjk56RErj7FyDi31LxxdtYrJvsj3ayDVx8HrFj4AiEA+nHjtodHUsgCtbbd8oEW8hS6USRXT4CtMoSVx6b65xs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93323,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1BJwCRA9TVsSAnZWagAA9t4P/28M/n1QZ6EZ8o6XzPK2\n9Eu9IfiBGL3SIG4JmAvpkrRSN+FbPq+Q/7N+B26hvMNJZn2q7d7E/OJopp5P\n81/bPY7ZA7gQ5S5vaPAEyCu9L1BcTRWCtxzviP3hW82ZsreCBDG5GjKXc5tf\nnej6iMxYtzGCP3KdLo3oTkRr2G6VZH4h8uBNRble7zTF/JaasUHk9IaebLFb\n699tbATdkqg2yrq+SdlOYaYD2+AH2xQ0gvOvFsmeqBZwIvP6PxTm8NFyHZdf\n6p7cXN8A/DnvqXdRxc3MmdnfUEhyCME0aMoMJZTMz+A/SKznNTThy234QLWl\neadfoljPb6o/rQxYOC4OiPRwxmirQ+SnUyc9GQE8cSrRdWqCvorwZHl4LoBh\nS1NsYHSqExkp/kfEl+hL1Yb35RvUcZhs4sFTSYa57Dj1AaN2gL15sb/jzjqb\nCs3JtNcDid9ABDWEhkSHkBokO26MJFqfhhWz2/ujvEc/qXIBOpg1qdSBIgh7\nDppOxzvuJJ1BGa7tR9JbeovsiSkjfpxckJ1PEQfLVDyyXNbGvX1scFXMfoo1\nmiOPuSIAcqwXWzHwVhkMH3MWckW22f7TRtqJp1ibQVkN9tDOMuLipkEhOT9C\nMKSKeZuYP2y1vTIv/e7iN0KLqV+X4heA8I8rqK/yxpHH7qXxeibMczclkBvS\n6gPt\r\n=RIhE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=v14.15.1"},"gitHead":"7cc8f2ba91390b34d24f1a25ff608f618a9060a7","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [[ -z \"$CI\" && -d \".git\" ]]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.166","@balena/jellyfish-environment":"^2.3.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.194-renovate-non-major-7cc8f2ba91390b34d24f1a25ff608f618a9060a7_1607733872044_0.2676506307705082","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.194-postinstall-sh-compat-5b7bb6e9151256a77d97895fe5f1ccd11044615b":{"name":"@balena/jellyfish-metrics","version":"0.0.194-postinstall-sh-compat-5b7bb6e9151256a77d97895fe5f1ccd11044615b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.194-postinstall-sh-compat-5b7bb6e9151256a77d97895fe5f1ccd11044615b","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a310ba05ab761dece15608831ee1b062ea2417cd","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.194-postinstall-sh-compat-5b7bb6e9151256a77d97895fe5f1ccd11044615b.tgz","fileCount":17,"integrity":"sha512-SaCEBD52BNy2VrPgc80G/K6fhYkTM7PQuSSUznrzj5ysmnhRyTRiI4TytBzRFTnexkK8OFxVvF3FmCYcp38hmQ==","signatures":[{"sig":"MEYCIQCj8UBVBvJ40ne1ngZg3M05TBj7iLz7kF3s6RwjSzaLXQIhAI3jVnzBglBW47s9JSUr3Hel5fgfEi9i98G8HgyEgmLz","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93342,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1DtBCRA9TVsSAnZWagAADx0P/AuC5UelbTZglS31Cm9V\nkSNC5vAaG+I8w4LH5UlTlSFJq02fUOzpP86tyqatuVADiMNNCx1Msarch41c\nQ8oKh+rNrKcrD5MEj6ryIwODI2Y2WeWtkSZdi+BUWGjRSg9HscvgYlaH84Lz\n+XNnbSORAF+dSqwAb+IcibZ3771VE8XLtr1m5VB0s5raXlaMhK9sCXIDBlI4\np5wDAlTjC8bL1raqg5Acnez3Tyx83AiGM6PRmafQ99q5QYA2IKaMjsO0G0Cz\nb75HYEHWXNziGIqoa4q8RO64xdo6koBEvzDM515vHo2BjhkUDNemNU242v3Q\n4SGCJ4+EO5Yi3oWhl0lG8e5gbur17rrIDV+UEJorQuVH+V9GAH3qZf3ginTs\nYKa3tWhmdgsYRqSd0FCc8RR2YBz16BYp807l+yh61Rmhaaer/1yqf0H8XuEl\nUSrLDpTgcZYhS/OCngK3XMgyN/xDWRD5c1hRJMLCbQHTnDd4i0ED9jIfMymr\nNdhJEE+rpd/erODdX+gBEDSJ9zZY22lMJ5FF9z6KAqSlwHII/DJJV9Q9G0HV\nL/dTUiNx5hFcKQa4zThPUzq+0/EEUHmm9uxik6C+xIPR7VmD8n6nVwSYTMdH\n7sEbLQ92slqhVGMAQy/n9Gx5uqJjLQf8zITJtqHk0DSrUyA7AEHyvuwj0sit\nt1Vs\r\n=izcW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"5b7bb6e9151256a77d97895fe5f1ccd11044615b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.166","@balena/jellyfish-environment":"^2.3.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.4","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.194-postinstall-sh-compat-5b7bb6e9151256a77d97895fe5f1ccd11044615b_1607744320617_0.9384867880703405","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.194":{"name":"@balena/jellyfish-metrics","version":"0.0.194","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.194","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"87abd6b050d941b6ff4d903cb02e88c576138088","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.194.tgz","fileCount":17,"integrity":"sha512-71fbtjlNXkDDi4BimmnPojnisNqE+H2TgTK/XWmFCBQkTGZwUMyPhJbT2zs+AVLpF7dlxjovt0I5c++xnduruA==","signatures":[{"sig":"MEYCIQCAfs6oiNU8Ln/wfJDfFSLFLW1vp+zhTb8XZNQnrT/kpQIhAN/ALMUAZuHG0j8KrmbZaT74HMikLX4b5zJ23CeIDXxi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93279,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1EARCRA9TVsSAnZWagAAbTQP/AwvKc89kOLQQrT9k/uP\n2m8nI+W8jd/V/FpZF79tx4Ja70SOxbC6/qalK7IXU77G2OxhnEqcS9KHjEV+\nGifmBq7IJTeTXNSBfJNGiWxMFtsxncMXgMwfvv04DpwrZY7IjoRAXE8TXC9t\nhAfak2xHB4dxgatfRIWIwPb1ZvJ4b5LdKT8j17CiSNaQNgtbS7pkaNNT5ILz\nht+OwsjRRzdJ9euYf4/J7/nPCpijS12Y2Tf5PCydBndKNbqYox4LHyHJeVub\nAmSvvmz8jWlkbo9sDcbSbq67lmtBAe9dYYtZfYdeGnUcYx5GMvdB3a5IpEJv\npguaPxV1ie84RJgJW1QT1deB1IhrFnVpJ1f36v43JHBo59IGINwiIE2rxFh8\nu2rPye/t3NqCFoa9aE6LcYeOw3WQ5ZLOga+c7sgYbVl3WQsxYX/lOKaOeiKt\nFtx0Dt3jtGlhCj0PHamEfFaCAEdt1IiVVTyZ09O+IoBfBVkq8cH+l/lTfoYE\nT2JwEjWsdA39wPL9p85DINUg/pa5Ql8VkiZQN+S/PETZiOcPBhZhidrM4vAe\nISAiDmA1MoZs3tU3LxGQJIPMhiTcN+l/GfClG+GcjfnzXtctCKsWvcQKAGiO\n46fdSYOJ5mzCilhrJJOFKSxH/2st9s2XffD4S6MtXKLSMjH3nnoT+xm3Em/x\nd+f6\r\n=Rr/b\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"7a3f2e290ae3406aa64b33b44b483fecd10d8b61","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.166","@balena/jellyfish-environment":"^2.3.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.14.0","husky":"^5.0.4","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.194_1607745553340_0.4567281968364658","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.194-renovate-non-major-a44ad8ac185d915225bf5e8ffe2d623ebeaf6d99":{"name":"@balena/jellyfish-metrics","version":"0.0.194-renovate-non-major-a44ad8ac185d915225bf5e8ffe2d623ebeaf6d99","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.194-renovate-non-major-a44ad8ac185d915225bf5e8ffe2d623ebeaf6d99","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0afd19cb62d8b8bd7a420826ccd0a9d94531efb3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.194-renovate-non-major-a44ad8ac185d915225bf5e8ffe2d623ebeaf6d99.tgz","fileCount":17,"integrity":"sha512-kblq0oH9wBfW9i9s6n5Sg5Inq/qV6ZbC4i2TlWJlgqYuRh+HHnAPRAHCzUTQOf/5IV+i7KVYaBABWjiRIXuUsA==","signatures":[{"sig":"MEYCIQD1m0nmikscycBCCQ3jljlbMSTC2UefM1WuIQWyJkvs4wIhAK50RQ2vEScm4AurZCZ8/z9tARkGBi+0lLxMc0ntYRqu","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93382,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1ECICRA9TVsSAnZWagAAAygQAIQlJIjSN08qVpgw6t4l\nqNBhcOMZRiRqiqnvA1VVLOYzgm4MQVDRpu06e/uTRAZV9j0n3WsCutuOgILj\nD9/Q8nfwPJGmr8dCSlo8DSXZ9VMF/wEP/a7fRamsQbESsiu68dOnVBcCEuzS\n8Xr65cZ8qD6AQmvWognyl4kiqXB+sQgEjWOYoCKASV9fBaGGd06Pinvvl3t4\n3JyJhi+JN23MIcJJP2g5Y0cpv3eFT5w/zCKbF7y7DDOjVTZNnJ89v95M0Hvp\n3YWQ2IAfOjhAu4vyf+uXiadM4iJ+QEBJJF3umii8J4hlRi6sT+TmrMP2LpOk\nclDYnsoL7eLXe3yV52cfxgIEmDAadvAd0Q2uGm8De8WK1xjgTfJWvrRyLoec\nS8ozqdIa06KO5BRzXotOOrWIvLa2CaMARIzed6RVZgN+FCHbwYRz297nkNYh\n+QsYwIYZ/+xjp8iCq5v5R2FWVH+1YChOgW74qDWIdWxmZNplOmFAsjA6j1cF\nG0xofSdrviK1ynpupav+2QCTWuHpcqEg84bNhNvZ/LrwbA0b/1oQQCPw3TO+\n/DAV9ZRodRGYazpFXa6y+SquLGcZN/jLwwX+xw0R+Zg5OOjnDKKzKJ0H2SnR\ng0YtuK9OQDyFLAnYjm/RFOm+QURH+nPeVL+XBFUpKjuzAhKj/HyMKKhunXSO\nAO+q\r\n=VAOF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=v14.15.1"},"gitHead":"a44ad8ac185d915225bf5e8ffe2d623ebeaf6d99","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.166","@balena/jellyfish-environment":"^2.3.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.194-renovate-non-major-a44ad8ac185d915225bf5e8ffe2d623ebeaf6d99_1607745671660_0.5413170701565755","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.195-renovate-non-major-6fbaa54c88bafe76f86e0ef82cb9018a8b953b2f":{"name":"@balena/jellyfish-metrics","version":"0.0.195-renovate-non-major-6fbaa54c88bafe76f86e0ef82cb9018a8b953b2f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.195-renovate-non-major-6fbaa54c88bafe76f86e0ef82cb9018a8b953b2f","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6d4880d195ba300dddb28df4011fd6a6976b2c88","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.195-renovate-non-major-6fbaa54c88bafe76f86e0ef82cb9018a8b953b2f.tgz","fileCount":17,"integrity":"sha512-NVM5ryiJDR2SX+sAqwjy7HEKCAkrmu+iQTsARSjsilwqLv5pqsbZH8rUkJo2UXJH6LN1NxeYF0HYulJM77vCTQ==","signatures":[{"sig":"MEQCIEM2n4hU6IdbRjonxq4LgYMWKIDsnpkFCvZZXLTiWtujAiAS8ySvhZvRm2oae6s/AyAue/lkBAHhVTAFgIqOxuNmwA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93411,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1EEWCRA9TVsSAnZWagAA+m8P/0W25oaTXOGG9oSiJYZX\nuqW8VWYo0ilQ6rDd7mfHnnDofkTVaUYJUPQ2oPL1rABMx9KdBBL/WjfZJF30\nZCe4lVc6k0rpFTc1cbWZ/GrblLCbThckkaZxle78Q4vlntnfCUT97YN29Ohi\nLiyAdATHQbFqlLoQZt457eID+L0+A16aR622Od01SCHxzmSXGvoQwK14TkcH\nqMhyB0VBa9Sot78EzCdE5koTC/Q94Z91Y9Oy6AIkYVjV0l9j3bfivQ4qmHh2\nRr9Zi/hW03xU3XErZfPdSjH482e+CBpo9AD4FVi+hJoLoMNHLwzvXlUMQIsD\n/JYuc1oepL7vDyk5JlGiWhoyXyfnQ91xGt4C9MlDLw3mNMbZXUOBptPGenDO\nRNzqdOdjgQwcAZMvqiZ73s9qs+adJTxXe6lfT1ws+yZOYiskwX3flLAedYCz\npAzHB23VhEUDrYZgEL2Zlo3duhx8TY7xy4kJYNmsh5HKejDR7qWWPX6XvLRG\n/sORyKd74S8GFhPWjhX3mGIYOlgVtG2fYvSl2HpCy2vPX2M94WsY3UxmFkM3\nOJCTUW5VSf5W//QMOipFyygHhScGHE3Y0KwNMb/sftF4V3mrOEBdd5JHlkoa\n5N/8maV9D/wDWJ9U0I+lDttBCU6QnMvSX6w8Y5FCXUaXJnG+LmaamXKvShaE\nTKEa\r\n=jojk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=v14.15.1"},"gitHead":"6fbaa54c88bafe76f86e0ef82cb9018a8b953b2f","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.166","@balena/jellyfish-environment":"^2.3.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.195-renovate-non-major-6fbaa54c88bafe76f86e0ef82cb9018a8b953b2f_1607745814051_0.27145008146692895","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.195-renovate-non-major-40262e55166a54f83a232792969f3171bea89d19":{"name":"@balena/jellyfish-metrics","version":"0.0.195-renovate-non-major-40262e55166a54f83a232792969f3171bea89d19","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.195-renovate-non-major-40262e55166a54f83a232792969f3171bea89d19","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fef771646d19ec6be388c519a3f613d5ba1be835","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.195-renovate-non-major-40262e55166a54f83a232792969f3171bea89d19.tgz","fileCount":17,"integrity":"sha512-tj7/19AsAEJmPYDVbuQ3d/H5QTM9VFlaiHtEotrW5CKD0umYD5CQyPEulHeMHwI0R9BmnGx5GXVVINaHUuWOkQ==","signatures":[{"sig":"MEUCIQCGTvCz5dxGQtPoWOaOmzgMQLHUe7ArmV7uZOk05XRMhAIgGY3tYmlHgw6lwFgfbx3HSLkr7Yv4Y3qYg8DJc0zuUkc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93411,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1HbaCRA9TVsSAnZWagAAlKAP/0vXRhDB/hG2+NL+fRLV\n8EDAeQZN0vRjbrDqWCgSsu0h6YUXXH6BkVO1D18yaHjFNNUFB3Jx9oob+lNO\ngBeJaiZr00urRUgKmAHDSSA5i71Wx31g5KEGmHkpDxqnCqdZ/r2isl/gyjYi\nSXGhDryNNIr+RFEZocFoD/EH9t6gm/VBToqNyIFBv+ue4rkPxOf+hSC6Vs51\nD1Iu6OoyQfKzte+3bpDiq23kgx/OnJop8GrykFsIlJ5RkHVx1E2gw+rSPyFs\nctMsh4idAEUMlEnuk4fk6qN7xIJ7H0WFXmnOcAotP5+du38Q7zqmLSyvDrHU\natc621Bx9QQhZ0Ayrw+SK3wryt+9Rm600tWgOEEutunReWLh7wtpAXNiYuTD\n0YEsEdU7uTHA2x3HZYJZ7YunbLpcJq86jUjdpPpOgadjMSRpP9HZhlWXHaK0\nT5LrTKFG9KEB4tbR4B8PkPmKY3w81nfCNtRweGe4jFV9rkVqVs13YpPmI6ze\n5w0IKFH3o1EJXy8l7a1ANDagA1IIUFpWMUlMs1UH8hEJJ7YmmuCBoEKwApmB\n4ubCzVtwPCcqUru4BqSqb8oi0QS0CFfCzb6Qw0AEchXsLVl+YDzJhAvnT0AE\nmkt86yy+XK/2wnhzGZ02+GC7fvGp2SP3yxM8q9myyBSj26T4GHoYds260WiA\nCqIF\r\n=i95x\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=v14.15.1"},"gitHead":"40262e55166a54f83a232792969f3171bea89d19","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.167","@balena/jellyfish-environment":"^2.3.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.195-renovate-non-major-40262e55166a54f83a232792969f3171bea89d19_1607759578158_0.5217922804773487","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.195-renovate-non-major-a7881517fbd8b4024120e96f69b7750fa9422089":{"name":"@balena/jellyfish-metrics","version":"0.0.195-renovate-non-major-a7881517fbd8b4024120e96f69b7750fa9422089","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.195-renovate-non-major-a7881517fbd8b4024120e96f69b7750fa9422089","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e0f28b56e69267d7559766c43d21f8b4508fe19d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.195-renovate-non-major-a7881517fbd8b4024120e96f69b7750fa9422089.tgz","fileCount":17,"integrity":"sha512-cujkOhTszlaWra3VCaXflP5Cz7iIl1cnrfyY7e1ckCt0Fd1Qp3BQOxSAaApwERBXM0DauV5lx/49xaKR7smS3Q==","signatures":[{"sig":"MEQCICAAKVKcr1zKx/Wikmkf77TYNHGxAe4F440/PHAdSldeAiAOOICtUurU49YlJBCpE3yLyBt+CW/E5orP7ihVh4W6zw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93411,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1HfOCRA9TVsSAnZWagAAABwP/30XdqzAdRiBj2cuBfOt\n0CzUGWg9GhJqZWIOf9wMRXwbgr6M/2hYjOr1TQY7Ah27jw+GdrdWKje//cVC\n70gU7Jdtr8rl32mvOEkigyflFZ2WV03sbrc/4Zqs6uGt+1qKiOmxmqSoRsHt\n76SqHwSNsMCTaSAxsj6IYWTgpCSkU0ow5NaWd0ixTWV1tn77/piO5NUj/kxH\nJlnKjv8++2Lf/0Zw9G2neEU7p10pRp415PSe/N+9FoOnf9XuljjKbiYPPWO7\nzvvVeZYuu3y7NMX8toJzNPziMNY3f4bP6lvJwcT8UguHinku/P+IlLogP7y6\nOSmxpsqUA2yalkTyCpillJOlnfvTNVOpw+cbBDFE/tR/AnRFIUxXJRbufwzH\nX88QjRj8o5ag0A7zq27+9IkhM5EttmJX/SUNPOfhOyr1I7NOMuxms6a73AQC\nA/TNGMiJQzlj/VEKYghorZj5Cp5Rj1MxV9Krkz1xfCFvQHSJYDW19anuZQZz\nTfLM83IIir7nQcTC9r3gLTge0WMoiYNTtZJCb5MygCCvrBOgOs0+nyhjwdBj\n7nZrihKbOYfN3bfhHTl83FCusIKfvadOL6T+habjwucp6xdo/HkEsrL9GXGY\n5uvMol6wEk0RmQe31k6aZHncnE0Oex0QIcV2FBuAI3FAi9ZDMkW3U1LI9ItP\nuQjQ\r\n=JcHA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=v14.15.1"},"gitHead":"a7881517fbd8b4024120e96f69b7750fa9422089","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.168","@balena/jellyfish-environment":"^2.3.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.195-renovate-non-major-a7881517fbd8b4024120e96f69b7750fa9422089_1607759821656_0.536837775997822","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.195-renovate-non-major-d061abd284f3667a0951f1349f4c632f478ed174":{"name":"@balena/jellyfish-metrics","version":"0.0.195-renovate-non-major-d061abd284f3667a0951f1349f4c632f478ed174","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.195-renovate-non-major-d061abd284f3667a0951f1349f4c632f478ed174","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"547b8bec9f62b9d5ca560525b99a6f5109218f85","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.195-renovate-non-major-d061abd284f3667a0951f1349f4c632f478ed174.tgz","fileCount":17,"integrity":"sha512-Ei3WUFityzpplia0Ym54why14jXWUjjsG5Jd0Zvv7NhhtrSzVSIvWye9i/W6aRgLuTaOSP/F6hMZnayrYwrLRw==","signatures":[{"sig":"MEUCIDtKFmqdGJabSFQLex/stb5lV9Bhm6bu7g+/1irPAgvpAiEAoiU7xRea2zAFabGwKCaQMmQEAQTBUEVewgc5nAxRhRs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93411,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1ICACRA9TVsSAnZWagAAZzYP/11xi2+DWblQ9cEDGQ2j\n5jDRJ/fq356HQlXn+tMJFR95P2KB0TPdY13hFQ1Y20sJ9n6ehbNNiHUG2m7i\ne1Aj4ysMeknabxm3lLPHmI/JQgVA7sb75D6jSN1/zbRGngzqULMWcAO3DqH1\n9jwNnrTJXCTpyBNYSov/iBJ2UJsAXTZTjZxxm3KKuO+dH44ipzEBBA1DixFF\n5pekszngaSydwF1vpM0P3NbG5XP6Wet7j5kPJEIDt3VjGyprlZA9LldGYlOu\ntMuNIS59XCWK6hRyd8os5YL6uCP8fHNz0gBwnk1xFF50bfN3VvEW0tebzT8t\nAwpet9oupLtf4FkzCMBe1TDREbQZyjEAfziDin4Wno4mhRXH/hT/lpqc2/br\nWzLrMRyxIqFEomO4ypnGahsxheZcXdSbuGMCt29RhPqIuMRueJcDveLj+muV\nNyjVHKR1VCIL1uyFVNAKR7DEDvoLvQQo/uALYTlRKywQ+rnj1wV7gNYhBIQ5\nsjOSpCQxwJrd4IEHhkZqAE3gWE06gMIA+OzxTRUCU3voJN0pNNvug2AoYqi9\nptKQ0AWLxDYw3TLXvJ4MUz5JZFpIQXmFwXVFbOaBQmuO3sWkrx/b8Ey+k+Ch\nS/3FfSukWQEbacnWgY9c7rboShklN0w9GJ9fvZiWsrf/TmC/tdFc0wPsS447\n0sro\r\n=dKaG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=v14.15.1"},"gitHead":"d061abd284f3667a0951f1349f4c632f478ed174","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.168","@balena/jellyfish-environment":"^2.3.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.195-renovate-non-major-d061abd284f3667a0951f1349f4c632f478ed174_1607762047809_0.8861296365744096","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.195-renovate-non-major-bc608c3cae9555ee49d55c38332a76c18482bf2b":{"name":"@balena/jellyfish-metrics","version":"0.0.195-renovate-non-major-bc608c3cae9555ee49d55c38332a76c18482bf2b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.195-renovate-non-major-bc608c3cae9555ee49d55c38332a76c18482bf2b","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1830407c825e3b327c60bc0f74b73fca7f245d76","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.195-renovate-non-major-bc608c3cae9555ee49d55c38332a76c18482bf2b.tgz","fileCount":17,"integrity":"sha512-VOt/3y6uS+glyYwp4LDkcDJsky7syPoEdnc5IrW5A3eLB/uwFT1NKgxUQnEexWtu234gPTbqG1IGBCvZnRe8dA==","signatures":[{"sig":"MEUCIQDeSaANIE2HmFEXTp9cbhNTqKlMe7eag8mg05C0/TqYowIgZn219QoMd23t4AkM/K0KQyRNCSWIaXIKVqnSNfr+Osw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93411,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1I3UCRA9TVsSAnZWagAA7JAP/jgQiWajosCn8j9rvl7y\nf/bx2eF+it+f3siFvOr8gBQ/gr5QtT7PDf8R32ll5syevRZsrkspoP8Cs5Hm\nN7kNGQmcDL9ZfWGv+f9TUsj2Y7CA+W/iQLzxG1EImb2Lj8oiUHL6T9sIfsU3\n4gBtTf+ojzni0bnBMyHitM2MK0AxJ6+4Vi1A+xWKIfX3OK/ueU/rg+9NjmXF\nJa8374XbFSBkjO4i2d/W8NY4TtbIt748VC+YKb/KGN4tu/Xa/Gzfn+vbRl5S\nDVY3VEMdVZkjrkGHo9ShMSDWhLqfY/TkZQoVu05uaY4eQHAX6b4TOOpX4T5B\ns4IOKE3PIQVKTH+DTbYE91HAth1P4AIgs9HmKm9ecSNb7sPki1uRE8jOyY3o\n2LrzQqhPaJ+uWX8JM2febvmR5UfSPWiumnjZaqG3egO/cLIXvrfq7sdIkkh3\n5DC5+6E5acTjwxANknMF9fqwEa67bY8/jebeciwRCqV0cQoAD6WumFLDvQ/d\nYGSVOuuM03iHBV0M3wgQe548iysemMsVgA84d8/VIjT1BDN4zeu6cnxcZO7e\nBA6HECd/F2tGeTjcq3LuFB8aK1r1wSzZqh5QCkLjifsriuhnY9VrsyT5UQFa\ngcek4K6HccofcZEeqC/4RTUK8KOJdqLTOL7DDIoE7i3PHPE+QGatsXPh6lNR\ns0/h\r\n=rvJX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=v14.15.1"},"gitHead":"bc608c3cae9555ee49d55c38332a76c18482bf2b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.170","@balena/jellyfish-environment":"^2.3.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.195-renovate-non-major-bc608c3cae9555ee49d55c38332a76c18482bf2b_1607765459776_0.6679401312668554","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.195-dependabot-npm-and-yarn-ini-1-3-8-43343de2a39b7db6be0cf1c643202d1212512538":{"name":"@balena/jellyfish-metrics","version":"0.0.195-dependabot-npm-and-yarn-ini-1-3-8-43343de2a39b7db6be0cf1c643202d1212512538","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.195-dependabot-npm-and-yarn-ini-1-3-8-43343de2a39b7db6be0cf1c643202d1212512538","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d7c19c9f864d00828a0ecf310c2888ab37d09625","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.195-dependabot-npm-and-yarn-ini-1-3-8-43343de2a39b7db6be0cf1c643202d1212512538.tgz","fileCount":17,"integrity":"sha512-eaogi+2I5QnE8ux/STNEimZdvJxDzceoXhpMHmewWHeGVeCBCQUXbf8aH/fDZpC7LUsP7k85dBUIDjHK+2iLOw==","signatures":[{"sig":"MEUCIEoqvwF/7H1GK6dP690hynaeN/gG8AnKEnyUtM0FW9szAiEAgW1ax9G5bq6nud0q1I0Rj9G+Trzb35fWMycxgiG8e9s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93445,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1JW0CRA9TVsSAnZWagAALxMP/22rpoFiIKict05VH6l/\n8q5CE+Z7ShHkQPHxM5J2311ronmQReTsVkPytsM4KqzGCmGr7QHyO99D3PCm\n/MNQdqHEHod2K0Tv2lsYZiiuyege4Wj5Y9NKYjmvjuJUwPmbrh7bS6oWGUjx\nNmyXiHHCsTeDe3r5Ip1M+rtIP8YVPHEkVB3vaXi//Mp2GMvGllj5eQryfuxM\ne07KLlYafl+rXHT7LigYzplblaZXhTT4wQ1lPW6kkoyYA+nVRI8iVEWCldRJ\nYm0Ik4zrzZEV9BYBIlqMn5ECrcl4V9UBZ2zS9eCSGR4Jn/i7U39VrSJQ4Nox\nA32uDuACeEVhcKmEQWzyCJUYMXn0vk1s+P4iKMbr2ME5zNVCysuIRwD80m3O\nYltGi0hSnIjgPpqsdXC+vDImGbNBNnZvXm4qhuU6yMujbO1v+ApbXmmzyLyU\n0NhB8JH6P+9vhKg8GviRtjn0kpd1lN0nKbP1RBl0NsSuz4loCO+uWG9joaC1\nbv7wL2zlmibljnqwn6k+j+0gnTQTnSXkYWhtduFYP08/xRcJLGcDmUP8eQZh\nhgeVI6wWkFbqGGRn3UUkiPszvJtwqOHrTRUJoKp0/taZoC34CR8OcmxhB6dV\nyKg8wQdNd+ukjLtqM01HkcNySwLVKi51if6pCfyjv4LY5CYhRF5K71VNTOOr\nq+ES\r\n=0iCD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"43343de2a39b7db6be0cf1c643202d1212512538","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.166","@balena/jellyfish-environment":"^2.3.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.4","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.195-dependabot-npm-and-yarn-ini-1-3-8-43343de2a39b7db6be0cf1c643202d1212512538_1607767475634_0.9844649894176456","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.195":{"name":"@balena/jellyfish-metrics","version":"0.0.195","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.195","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"47d48ced200eb7f17b3cf82d5de3683015751bd4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.195.tgz","fileCount":17,"integrity":"sha512-P6QoNSd6I8QNF/l/orQH+eRQO9t7rZ4Fx0B9zf+dNkv6V4RQTjHqDiL03tOOg+ongplCcjM8pwNiLko6x4D+RQ==","signatures":[{"sig":"MEQCIHnY7/XfAWjTiyDjF0dc8ezVoaoe+OmFw1QEefoDwkemAiBYozpkY7Jbgb4b2bGZFEK/jyD5Vpi980YF6q/s/3Qy5w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93370,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1JZaCRA9TVsSAnZWagAAD+oQAIJGtfJcBEwUgT7QlOdJ\na1JlVlIzLlb480rzJQ2SfQEdPrduz5BguYF8jfbhLQGlV0lFREqE3GoxQDvG\nxmBn1JZdzfL7l86tL2nYA3uur63rD59edxclY8rxOU57/ucNO0CfzcusB0bn\nllsyVpY4F1sWuELk+/mcSk/tUHI5z8R7uhcvSZ1Z0LNJqipE8B0WcRCHJFu/\ncjshn91Uy3KI/lN+VvRj6NNDFUcdwDeQ9Z8ikpc+DoUP/FVRU6rdOo4aw7xH\nqtqcdKcw4JZwui3xSk87vSzR60irwPWo2UkienWw7UiVkrYWHt0vKLvxguYB\n4WKWU7HP72ubjafdnFzAL+wTxu3pVbBTBfhdj8TSxkGg09E8iduDzSuLeDhH\nl7bbeiOQkgmWbbWeq/JQWs+O7pfJSJrRYkM4r6VEVu/Yl1pJ8kTxy3iCe49o\nAIBKjyI2lsj6PDUmDCcE5hFAhSVUYpkYeTSr71qPzKJr0bZvsRzCFeXGklRk\n1Ng5nCL1aii6qB+TPp1lGt+1LSlBJgx9wnq0esVLSi4+z6D5y36Qga/3VM7m\nKLdc/zhOWaxK6cq0nsz1nHEdUEi4rMEnPORqSB4f98NC3NQvh6lf1Fm4deNf\nildwvtt6OL+bo7yPKOO5qmij3Wn5i3dg0ea84tFtkyxq/nHtH+Wy95/ywQEg\nZ+cM\r\n=5Pk/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"8b479977a46ecbf7d6b4fd0227afced1e3ad0bda","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.166","@balena/jellyfish-environment":"^2.3.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.14.0","husky":"^5.0.4","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.195_1607767641932_0.4487825949954487","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.196-renovate-non-major-6ea3d32b2c85466ee50c21c2a5348cc07aaafb01":{"name":"@balena/jellyfish-metrics","version":"0.0.196-renovate-non-major-6ea3d32b2c85466ee50c21c2a5348cc07aaafb01","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.196-renovate-non-major-6ea3d32b2c85466ee50c21c2a5348cc07aaafb01","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2d0bb4a8cd6105593540ab023307bf00c1404b2b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.196-renovate-non-major-6ea3d32b2c85466ee50c21c2a5348cc07aaafb01.tgz","fileCount":17,"integrity":"sha512-R1S93HwmBl6UvtoMicbzW4Tf0bnGgtmnkvKvOq89LbKmr2gzZnV5qLd1gf+Ps7hwofiJQZMF3BRkJhoKsMTxkw==","signatures":[{"sig":"MEUCIDsQmL1C3jcRtycovPbQSUmuO/+qXi0GE/eXFWbsJWshAiEA9VmReMHqEvoe1uAUCkDCs5mtNTnZPD2tfFHxJmxwTBE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93502,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1JerCRA9TVsSAnZWagAANXcQAINXAbeJpjdPH/a+CW/5\n5JO4v55mzpL8+X9OJsomqNErc5lNQMtuXBYZDKYSatCbRPaLe4ld36Oxqadi\n/qBcg7D7jOOY2JZ4Wct5ydiMr8WFi5alpHi67vh1R8evyI3EQTbCEa/Fbwfv\n787kwirVZrU8BleLgvpvzzR3NmO06MEUD2cWzzceNoOGxcTQLYe2xdPC8af4\nqsMl1KJdlBrZZmL1ZrAx5bXpN5f1qvyhrFTy0EWi+r7xXmGgaATyE0WK0WJo\ngn1g/eX4QEHpH4r1BJKfqklu/yjBkwnglZLez3QJJ9ABmAnRLdDhEjz11evg\nq8/cAWfliBGqloRhGdw5dEPCDRGbuVsAzHGamG0iwvD+xKM6Xra5+OaJaPjX\n2+EyEbn6WmnYYMLeCZnOMetuIOtsoUb/PlBgwP0S8md3heXIhpXdNgmCMxQE\nrL3/eaC4JdcE1CIs6euXgbaYDN/59j7P26zY8gJSQ8E+QO4zg2YsX56AdHgM\nu6w2hf6v/c2jPkuKqQxn4VzzFBh0AS924LfrYW8IX1m9XcadQraT2/l3kRl3\nMNvlWTurLMCiNda/qQXt9haNZweixTtTxAG35e0pR2MSWKHByyoASINGcrsf\n/e5thSEg9NOK5wG2zqC77WdCx9FYI70YL1amh6KV6zc9uDO0b8gwAYo9JHPA\nMkj/\r\n=dPwr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=v14.15.1"},"gitHead":"6ea3d32b2c85466ee50c21c2a5348cc07aaafb01","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.171","@balena/jellyfish-environment":"^2.3.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.196-renovate-non-major-6ea3d32b2c85466ee50c21c2a5348cc07aaafb01_1607767979497_0.3851921983984783","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.196-renovate-non-major-b4356fead0e1b2c42873a1ef25864703d44b528b":{"name":"@balena/jellyfish-metrics","version":"0.0.196-renovate-non-major-b4356fead0e1b2c42873a1ef25864703d44b528b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.196-renovate-non-major-b4356fead0e1b2c42873a1ef25864703d44b528b","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"618fcb1ce1c529715347a68b9d3d47fac0481577","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.196-renovate-non-major-b4356fead0e1b2c42873a1ef25864703d44b528b.tgz","fileCount":17,"integrity":"sha512-vmDlusZs0ohWMfyySpSELTATn6+MUXmEx2RrXa2Skc6HlZZCNgc5NgxzByvsYNhlNGc59+BQrDL2GHtsNev6qQ==","signatures":[{"sig":"MEUCIQCCts8rDz5lY2QGK+2/CT/i2D96FBNggPnQo0DMTtvBAwIgSTf6Vmox5/wwKclC+QwBHGtjMKhF8t34ymkwdX5jAL0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93502,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1KcjCRA9TVsSAnZWagAAQAQP/RTTlb1f73KO1IfBMERG\nZf1Mk0YpgD3wUfG4u1Dl88IuA5JAvYdg4Ku2Jtlhoc/5mQW4eJO24xWrEI4G\nMjPfrpW+rOIWnsWCgZigos9C52ygSDd326spE+bKy8ub2TcAXZFxrODRSCtz\nd79G7cGFe4Ii83zoJohlc7LDSYF6oo5WwT5tz5wnzp/MA/bSG2JNHXitmnjo\nlbXdFJhLMrB8l8EmtcU5Qs14svR1BVcc5WDo/ZNlV7tqOUMTjMzSAi7t2ajt\noVGZIATfCe64fiIttcbilRmbu9x88I2ajXetYASYxDuCKdbkAyiJ3CYtHXhT\nWSltubhXVKU1dKj2ZjrD3VVtnI+R5F4cGUa0qxn5tVlRJElpJBRzu87fdotH\n1Lz2rOYPo2ZKF8+We8ml7sVuJ5wM53KWoTNwACqDdhK9sLJ2dIqtzCdDRNSS\nll8ocVWuh7jaehnYxvBLAzGd9+w5C0/6moScr1ZmVV83+AvLO66aYJP5El8j\n8CI1S+QeNyLQX4o88/oGUvvpkwesXU1wfaXAAFBBkQNTwQ9a7cHd+xoy5hTJ\nsCCteVaYbCR5MBU/jZx0T/DK0Ls7Je5nFK4nCUJQj50/YJEdHD+dRceBtjd7\n33rNzA0zyMortGC65bR5OTpnf7w9mK3XL53h9feChFnKwSWM/kN+MUjaah9O\nplrl\r\n=an+k\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=v14.15.1"},"gitHead":"b4356fead0e1b2c42873a1ef25864703d44b528b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.172","@balena/jellyfish-environment":"^2.3.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.196-renovate-non-major-b4356fead0e1b2c42873a1ef25864703d44b528b_1607771938830_0.9719882731584284","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.196-renovate-ignore-node-0ebca563c11dcf58b6a39ba17a457fda3100bac4":{"name":"@balena/jellyfish-metrics","version":"0.0.196-renovate-ignore-node-0ebca563c11dcf58b6a39ba17a457fda3100bac4","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.196-renovate-ignore-node-0ebca563c11dcf58b6a39ba17a457fda3100bac4","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"68dc19e04ca27eb0a70bed8ccb0ae42f322682ab","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.196-renovate-ignore-node-0ebca563c11dcf58b6a39ba17a457fda3100bac4.tgz","fileCount":17,"integrity":"sha512-VvoflFahAZmnza80yMNaHqm2wzgKdMwt5Jq8vtEXa672JIWZv0D6kYL6e0xkHJ4JjV5G6EH8AhD1KUU8dEEMZg==","signatures":[{"sig":"MEUCIHtiOEovdf+uJoD2JRM8pXtvVH5Y7/in+VNhA8qZMQhmAiEAofUaZH8UEbSDTEM12fIZteDVpYPPxjIUUkja8zXtDhU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93548,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1MnACRA9TVsSAnZWagAA9nMP/iLEj6c+b3+bGIPOWv4U\n0DybSVLtSAGfhX9KjGpspSbc0i2xb+VpLpuqRPHAXkjbou43zQ/odXzFmkHW\nCEAGLqvmFbaGXfqCr73V1Dq+YUxqBNox2GpKESRWBjJAS0EswoxmqrOFJrof\nJwo5UuspcYEqWDuk8a69Cl0X/PfSJmuuLBNjnqpmXhg2fUmTxk1tgO/O0igq\n3+d4NuwH/sYx5Q+RmhRFXgPkWcJ1ISFlg/qeHqe2imKRuL1PcUcKvIISyYyI\nnmmMiXutt9fnAcyiTG8SkJnl9jCaZkEFnLNNW6GACHktiCAQImMhjwWp476O\n13qiPU2xVc5xINf3JpHSEwmbMeaCxplkHgwo5KO2XCBa3HhcWTBxuuppixwe\nXNxUJF646UdTUluWJ+A3HsEp9D1mLHUVLQFSpq9+NTGRAuEOpJ5wEQk6gUSZ\nNI/VFjequZ73/Sh3CFlNDDFglgXwDJr1CXgbaY20+5Kamy2FgnetxBKfZbEw\n4o7H1k0cdPs1vqNg9Wl/3l2IiubxeKaXoetMr33nkp/MByPwEOtbgeVwAtSI\nT+W1EYHUY9D1iJQVD7A1gJtjOV1C6KcmXGWG6lKOi6TDYUWogPhyLp/KkxS0\n/hGBrM/AlRoO9oozD1B8954pB/9MIRGtNbIg+T1Eb+lt86HOGRyNHoRgK1SU\n1ZMd\r\n=1ORk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"0ebca563c11dcf58b6a39ba17a457fda3100bac4","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.166","@balena/jellyfish-environment":"^2.3.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.4","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.196-renovate-ignore-node-0ebca563c11dcf58b6a39ba17a457fda3100bac4_1607780799650_0.8187469055474186","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.196":{"name":"@balena/jellyfish-metrics","version":"0.0.196","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.196","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7a45019746d8672ee3553f53bbbb4e6188720622","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.196.tgz","fileCount":17,"integrity":"sha512-q9YJkH8gguB0KxfHHxgwzmwm3wu4HsviFokMkMM9AOOTBH1u2C8HMgeSfW1tF7mj06u8cGuFtUvqy913yczyHg==","signatures":[{"sig":"MEUCIAm1Oyx6mdWuguB1o7MuHoujiDBUbrOx0HaqCJfg3WPaAiEAsTAM9eURFPrsUbSa+Ed8uwcpMlmJvLxzQwg6pVfg8Cg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93486,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1MqACRA9TVsSAnZWagAA/xYQAJVHME0ck7k1gmFbxAKz\ntHsmaGgc4qiwb0XO31kozGViuqgeLeLf+I5/+HG4CIRuboApN7jtGll9ijgv\nmCoBSkn0AZAM5dg1k+i8fbPNAqJPMX75PX0N7pr0RsbVcYn6X8dasdvDsFjR\ns/K8R6W9VkGmqXINT2Hoop/WTpwBaYILpmbimOOOSuqsaLa5TFjlGaBhUOgM\ntr3ME/dXo4HXNTZto1EFkE0HDjMpZHjZ6VYBoc4XTN3mo3H5czxIVg9KyxMw\njsVELhPYa0KswVWExYer9SdbhmvzoXYjDr8TtEAMGx4rs1l9evTZO8/j1quR\n19wEvTZLgzC/mnMD58k6PQNnEHxjkQxlG2AZGFjNw7nrcl/sieA76wXoWC9h\n4vXvDSGd9Cqrd9Y5yobqTMNlCVTDApBTW4jBNML1LAz1CY+R3h/gJfviPn3h\npn17WJNgB80V/dpQqd9qXMB1NDERUDlBSB0brfGRhg3i6H/QxmfeStZDbcJ+\nk2FLyuEY12N1mKboEVan9qMg+AfPYnMVNzwSpAtoKJb20qY0b4Lv9htkLGSg\nAe+8mAPp7xQj9C33vSjDGmAZqLAFDEdRSPyfZIKs8o/iz+OMtU7ATs3eaG4t\nUAxs2Cm9sY6P97o0VZv20tqkYjOyDYqQrXB9A/rDIj8BL6Qs+gWcFeTac9cG\nM+i7\r\n=g/3V\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"a6ccaf3e8d6fb508120f5cc0e125c7d580b15396","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.166","@balena/jellyfish-environment":"^2.3.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.14.0","husky":"^5.0.4","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.196_1607780991632_0.6317212635114284","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.197-renovate-non-major-fb165e9a78643b648cf23b293fc5a8cee891133b":{"name":"@balena/jellyfish-metrics","version":"0.0.197-renovate-non-major-fb165e9a78643b648cf23b293fc5a8cee891133b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.197-renovate-non-major-fb165e9a78643b648cf23b293fc5a8cee891133b","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3191134b08861fef199d2c37f0fa09af0b99f337","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.197-renovate-non-major-fb165e9a78643b648cf23b293fc5a8cee891133b.tgz","fileCount":17,"integrity":"sha512-8giDLVReSbw0pzDyd48tOy20E9g/aA669WjtSC5f/cOy6Jdu94IGYxzgIAThe0kP0uXTbe4LiLAYM2wFPYMUNw==","signatures":[{"sig":"MEUCIHFWuZZ4ZQnWys+KPERQFpj+K2velqEab+WfoF/UbHLMAiEAxdJ90OmJ8mqfjaDljS0OMXAKtMDufojsTUzJSyM6HhY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93616,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1MtbCRA9TVsSAnZWagAAQJEP/0Ne0ebmB8VbUtyJ6OVC\nQ0Q5m3ncMv2TwBoICA/dUVijp3pljObrjIm1/kCUGtSy3BBWlyMrXcOJHJ9a\nP/2sTtYW1TKEwc4Nbh3tMIgnf4HRVQxWORT9Sv4f76fdVwFdISArdPF2SQBp\nmL3f8eR2iLdELB8ftjAMQzy+UxvzoYYGwnN6P6zJwseBdOOId9u02Ub2qpHX\nPfgNoSjgJEXtveu+zhLmvtQmztneHa66sZru5LvblFT10ZFxSlR+RqjBKMOq\ndXEvWvK2+verz/W673+gj7oLKqx94Tgx4aeCn/411pxYUYoG1zohgEhefkjQ\n6XDUmaaLxCUV7dLt3jZdQA45pKph2rsLw1Eoq8GyxfJNeQozMaUbSinZ+TjW\nVDhEXMaQmfD6fH0X2lYfIG033Rhgsh83QHb4pd4oUgdRSQGoqgjR+dplLEio\nSzKNRYEeZOhkVzH0kUVB9zdQbsrPsRx2DN9q+lPnc7xb9t+i5efwJ/u/6Nx1\ncOry554Auj1/cqAftIdEd61e4CfOELma6DemmtCx3clvFhgKA6l87xtkcEI5\nvKZ56nFJ6Z5z1JbwpPiIzoNvnoiAVPg/T8HHDgJlQh7NZXkaONe/iaTNBG7U\ncAlNhKb37a+avHubvQa+2fBy79h74cY7CEe52Qneu/hfpkCfqNP+lfeYHrOt\nZ+ub\r\n=VyVK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"fb165e9a78643b648cf23b293fc5a8cee891133b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.172","@balena/jellyfish-environment":"^2.3.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.197-renovate-non-major-fb165e9a78643b648cf23b293fc5a8cee891133b_1607781210597_0.7079917888388343","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.197":{"name":"@balena/jellyfish-metrics","version":"0.0.197","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.197","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5702d8908bcc4d9b0f842b9711f5cbaf65796d09","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.197.tgz","fileCount":17,"integrity":"sha512-m/Ci9SkVL6Q1bvVOB6O6mG8shv5uAKcccwhJ6EaaA+3LaGNOopo3UWsQ+/nnfzz/PaC09HRYXQygdNgYQKTAkA==","signatures":[{"sig":"MEYCIQDixDt5j69SJPR67piKwZu/XdaUvuEJHeoqWkXyaDBtFwIhANyGt5hq6KTDVRro1DecCtFS39P+bFAKiMhdxdHECtE9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93556,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1MxqCRA9TVsSAnZWagAAQqcP/3oCniqpa2K66WSLNNaj\noxjafbq6Q2thr2iTp2CXFPBgI+dd7BzTSbOxaO1rWyHHaRys3AfuFori8wob\neHa8g7R1+apQ5IKIIkfcEIgWVtox++cUkr+kM706VGVwM6Dv/ySvUzzVbp1E\n1BSjIqALjXXyBoVkxZo5cSCO/aRR6NnX5ALZkLm8GHsx6qH0xidPB/QrG+qK\nLLNPr83ykTsMDug2gGmFw52t4VhWe7bnEeqWz9XUCqYq0LoPmWeZlhUCuLQo\n+axOmI4xYWzC0uHA+IJXAGLOgcVmAqi/1xt1AeSqnQRT4IEVSz8rYivwXFfC\nm48TkEQNSJaz/ofDoNi/TqnHUoaCO+FAyGPBstfEgsAHNEs0+01zOnxX1+sl\nNllTve5g6bBqcXbLqwg1LcsfbZEgR4M7pwej7nkKLIvuREoqwQCsyd2OuZPo\nFqZjAt3s2ayh8jeykyBLTEXb7pmOVsaiLCpcN6yxjZjPF+g1ix6k6bUNA7qM\nk0WegEIrD49q5XWp3MW5z18KSMzTPcTpZjrJd8pJLKdbaqmP4NCwpvclMRy3\nvSOIKki+STqnsH1BXWjgXlf8gYDCqKlvEADT7zlvLn7L2ZuDpRYBbWOoSYfC\nB6kplWYHJgNYui2Nw3UvDWttfFgDziaPLM5NcCB1jwIqN+KO9QRRwZRTw3o5\neUTO\r\n=rYOA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"51e79aa7d2ca04e9f9db0535c5f440ff34c73dc6","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.172","@balena/jellyfish-environment":"^2.3.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.197_1607781481611_0.021714790272102658","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.198-renovate-non-major-b1aac5f7e18b13538be766fb8e67d2dd7af88d05":{"name":"@balena/jellyfish-metrics","version":"0.0.198-renovate-non-major-b1aac5f7e18b13538be766fb8e67d2dd7af88d05","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.198-renovate-non-major-b1aac5f7e18b13538be766fb8e67d2dd7af88d05","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ed3b2395cf699e5cb54962c0d63ecf5054be14bd","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.198-renovate-non-major-b1aac5f7e18b13538be766fb8e67d2dd7af88d05.tgz","fileCount":17,"integrity":"sha512-cz8ROMJJowUDgIa9r7GHbWgVH8JyUUB87pZfZl78S+8lCjWwEEQnXlcbjlehl/RYTRP/q2VFQ7NEpNWOEnSBBg==","signatures":[{"sig":"MEUCIQCO48GCmuUfBb/v9NGETehCJrQtpc31FyxFtEjWv+JRrAIgSiaxaQ98uD56+msdvi40+Ue35OGN0pAt7al8cRgae8U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93724,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1O23CRA9TVsSAnZWagAA/GwP/2xZaTQKfz6FbGiJRrUQ\neHLEeFpdGG/s9hcWrQMaDdidl+wxXiXBKuNAV6GNjaHp87WxQdxuYAEiGOcN\nUQCwtIqIY57wwyE9hHCdY4l61xlj+614t2e5cEp6RTaUTY4CaF9fXIdHciRN\ncXkz+gBVP4Rpjd4mqsoqwTGpHrpqUKp82YvGm6kYYqwPFbq0nMwUbwnFlY6J\nivKfC9sioMb/awjtHxlVYYfXd0Sx3yLeVHZ6JRyQpumDImWsXpoIBQxgv4F4\n7GgS67SGYD0feJ5S0+2ZJTD4wcAWyUV/RWn2nLLwTkVw5I6UqEYU/ZxVw4Om\nEOZeqKlT9QbSGuejpi6SfkrDsDK8+gzGrEuXhEhANgGVw3h9j3nAmM2UBf5t\niiZNXVrUaTae8/Zosp4nAeILhEa/4QJNB0QfETbIpiwJXZ7P+dVtR3X/7u7n\nfbgA01YklR2wSufWIBrJGv2zEdJ5B/dVdvT3ot9JV836UzmobRk9tioKEpaM\nj9GP1IebUMS61m1AfKTkLeVv1fsH9BF9fH/E7RwCrBhDcgDjUMPd/qdTVmsd\nGmU2OdPBXv8k5qDvVfcPy6BqSoB4X7wBvxJy3vCViyHQ9T7Il/HSBJsFyDwS\ndT4ELc2bIOW+KKGsO0sVIkx0vZvseJT4fdphY1u6MRkwiDcQqxMxtZkDeOMh\npzG2\r\n=JoJN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"b1aac5f7e18b13538be766fb8e67d2dd7af88d05","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.173","@balena/jellyfish-environment":"^2.3.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.198-renovate-non-major-b1aac5f7e18b13538be766fb8e67d2dd7af88d05_1607790007307_0.9085238484560871","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.198":{"name":"@balena/jellyfish-metrics","version":"0.0.198","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.198","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"dad52a1e2349e357b30ddd386356147d7c147f5c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.198.tgz","fileCount":17,"integrity":"sha512-HEUgYtJp41Nwy8MK+2RvZixfiFDgV+tX4fNyWonYkssHEOc1T1E9HZxGNSYmb1te8Xt/F9Ea1Yhb7DZ06AntuA==","signatures":[{"sig":"MEYCIQDWtZ5hFML7wEWR0JZE0r5NmvHmwVaP5ANADAAu9PFb0AIhAKmB/F0ra4VRqQj4w14QVsfKCNXFWg/rWOLOQSr0cs9D","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93664,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1O5kCRA9TVsSAnZWagAARF0P/2aoBR72z2MUbd6kvSDl\nSTHTH4/jL199hfzqhUy/YW0MPJ4ZGNGISdb0ouEiPhOechkRp+fDy1VDfxxu\n8myi+7hYSUt+7CLgODcpkY41xmzz8bDevdwnvcEMLrvNeqTaEzr6Oft8jYBf\n+IYwbRQHOZlTwa4WPPjA4o6fBGsGzyxzdvadrLLubA9HDw17fU3P4f+yYUYU\nrkbBSOT80KQlQ/Y9kxJfIvRDliZdY8Z7MqHwDlVyi9QubqwN3Nxu9vCdtEsD\nU1/3Qoz0PkVwk2GENxgHVFGPtltjYrekEBmVdlGQoUj4BtKWRmm9PB+Qdjkc\nVlCd9SotGlWHI4V3OWkjqi0EHZWUVpfc8nw7N9p+UII/qELTVvXJ0SZFP5ju\nrl0ya8DV6gafkgZ4UHUf6Kw6gbDTu5sVyIzuso5nRyIRaDL+teMmnx0F13v+\n5H+pzUwcKMpbM4EHEEVrxvWTIDtH/O/gcLGvAM1gh777U9wCLADB1AxRypen\nrN4hnO4pICFREwQrwju2jstxPmsAM50ADM4/RZsXdEqhmkh3x7Z7hSZGIvXW\ndboFTsmfVTGDYnqfesaqXliUXg9eHPorCOq7VkfYZjbbl9yLLwwi6MVts99V\n+mJuixN6rCvv4QimWtKEMEhk5P6mBbZvxm88LNxQ/+zMoKi+GO7bHWVO5Z19\nFuBD\r\n=qHC6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"6c92db5bc87aa4513d3c0c4bfa8180feb4c7742e","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.173","@balena/jellyfish-environment":"^2.3.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.198_1607790179673_0.7750631145632692","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.199-renovate-non-major-5273b7f757db8f41c520226ebd10dbb8444033d5":{"name":"@balena/jellyfish-metrics","version":"0.0.199-renovate-non-major-5273b7f757db8f41c520226ebd10dbb8444033d5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.199-renovate-non-major-5273b7f757db8f41c520226ebd10dbb8444033d5","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4ce334f92d6a6b9f867c5545dba76dfc509d6520","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.199-renovate-non-major-5273b7f757db8f41c520226ebd10dbb8444033d5.tgz","fileCount":17,"integrity":"sha512-PZcfiXoHkhbwu+QRvvfUKOMXMQ6Gg7yJExOTl+y+Dh6sddDyTaZY7WvPjfholOTZk2pMGsjsHktN9cPoOQr56A==","signatures":[{"sig":"MEUCIQDd1Nla4U74bhtEni2wVw1FaQn+BvE9UUUIQCxFb7SrYgIgLRVgQ5Xhw8JqxJk8Mj+bV7CIV+ColQvyl+XiZXBU5ZA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93832,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1moUCRA9TVsSAnZWagAAxkMP/ieEGXiEuBMrePzU2Vwj\nmidLrqys9ThWJNlNn8S+ndfGBph5RFRLBVuR2AuE92y0iCdOwmr2P23WtH91\nDLgW7RwK5NgKfpyHlPhX1KEx8TmmsRSNypx3F467NJYpz0aIu2wC5Q5dFeTP\njsndexiPb5Gu0yjKCTV/1ZRIUwUz0/C+iCPrkE7wA7F2E/tAPA+bCI+ghUcq\nzNiNEDcQmJojCp3lM/9vU+Qrtv6Ic2dart6oCWxL9NDV5BtaTfU4n1FHVezv\n8ufmE37/AEI2GyokWtJylN2zhgPwYbkIzZKKNKGR0F2MtLuGI9W3ZBqr8B48\nIOYM20OpFgaidGzyUGwFAdWCiBpp09uG2vn019whxGzoRfRAbMyz7PBffUkR\noEye56feFeFHuajBhGOgTeh6IgEH+/vgl7PTZzFmyL+mdYBBsDheSfQ43l9r\nN49H5CvVSFbB/mQjgxQpvdwUrPnYgQuBPU5ix9I3S2OC/XJMrZFMEOcVlp01\n3ajDDMOArNTSEt0AK8/k+ihmuZDpl+Tptkmaaqve4Geotq9AVTkOtFQhTRoT\nkoxrXUbkVDMOKRd5E0f+xtJjWIE0U5/ScSO9SJZCpu7ea1SrvOOrlOQ6TAJW\nJCEEh8KBH1LZ31Ml27x0pVkYgGF6XoU67DiZ3qNTTjJ6HGfxRm/gGLgAbhZj\nn/Uh\r\n=nNRv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"5273b7f757db8f41c520226ebd10dbb8444033d5","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.174","@balena/jellyfish-environment":"^2.3.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.199-renovate-non-major-5273b7f757db8f41c520226ebd10dbb8444033d5_1607887379544_0.5617278614982104","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.199":{"name":"@balena/jellyfish-metrics","version":"0.0.199","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.199","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c1b5647e012f0b2dbc94e8251c7c18d752eaf7cb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.199.tgz","fileCount":17,"integrity":"sha512-LXqVuVEhpYodUjpgK+Req2a8KVUE4JuODpw6l2eTf2QTKxSmqyKWxGGwVvUYEIbYTbnd4SuleQUIoi4LC6mgMA==","signatures":[{"sig":"MEUCIQDiQCXsaEvLHy+CGsJOXqB0BpbK601UqjwEwoL2cXV7qwIgFxpZrE7+Fha7Te8TQqpFKDGRFaaf6biN8/uTKWRCH0c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93772,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1mq5CRA9TVsSAnZWagAAbGIP/2M8ywSTZTNgKs7nMfKJ\nXsevOW/MIxbFntQpw7HeFeoZFVSNw+4DZPHJz2jRbsu6PGvELpOHwOqKsjO8\nYlcbQqkWxWCMBK0rslsfAXukKdD5wLODRkmSm8u3mjmYQ2zs0Fwd/cQWs1UK\nKq9j4xWw8VhR1nGsqOOEdKb4y1KFjHH90ckw0N317xkTMr0txUMZ60JvYrEi\nrgcWGakr6jKevqVoJI4VDtufgkW25WxXPfK5Wbmtwu78WRWTP1kHvX+BKgzt\ntjBpwR5IgLWJ4jGeCerUkfOmC2KRSX5GmRxWv5YIhKYhGD3olYRmxyyxy6NQ\nLk5l4lxcjH/UzyqguCaOIsTEAsA2JLQ0LLFVR/MdUEqB931jYwv3zSsJOK3s\nZQBL0NrDCwbCWUAdPPGx/m94IClOFtbjB+ImS+AL1v52Yfw9rk1D9dUpRlzQ\nVmFJ3nrCuZN3/TPsG1ptQIQiixhvHsMlfmr1IFT+4MNjdGvuTkIKaRAqmYBv\nsm5NxWM1hJdZn2XX2gJEtimA1YDU9Mq2VcZhUb1BmSwhBNKcMnL3ltuI0eB1\ngHQZtCY/tpM8dCWQfIv9hK2jFiB60qsCi0Qj8ldkrduXBDvdLc7rkWqAgVli\nSGs2mfFj7CmVR5uRHYW7bKV2pVqfjqkVfZWZ5FynsXIF/VhGs35dOWifiXin\n+lC+\r\n=zJIU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"e716c54acbbf4a1d9d13a1a4991bf54058929537","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.174","@balena/jellyfish-environment":"^2.3.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.8","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.199_1607887545461_0.38478638205633753","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.200-renovate-non-major-cb3596fcafccca62bb9d0ab56887c7155e309b7f":{"name":"@balena/jellyfish-metrics","version":"0.0.200-renovate-non-major-cb3596fcafccca62bb9d0ab56887c7155e309b7f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.200-renovate-non-major-cb3596fcafccca62bb9d0ab56887c7155e309b7f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"13463067d5319202b5f760f211fd59577cd2fd95","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.200-renovate-non-major-cb3596fcafccca62bb9d0ab56887c7155e309b7f.tgz","fileCount":17,"integrity":"sha512-3u4ExemqpgXp98sq3Ja87Ahf+sqNY7xxEbEGOu+YsCNefEvdlcSGU7mXg29K9FGH/Zj4Dhc4VFyrmDTvWPBbfg==","signatures":[{"sig":"MEUCIQDIrunNKJbh+W4gvezUHVHJZUhGJ+yg6oWr6Pza+v2UfgIgEJo9X6DGL2IY5+jmDUO5ByMIG1ScUnx66Or/F78k3Vo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93903,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2FE7CRA9TVsSAnZWagAA0aUP/RbCTZZXkzf/IRAeQmKX\nhhokMzuzRB26J/wrAWVWrSxE5k9semgytnohH1Pw1NDzy8xXsYwZex2g1FFv\nU7p7i2jT2B3YFfTXjoUU2RCRCR10D3jnaM2NaREwXl2VHAr/7fn+S/iKHva0\nMRsyEFhPzvf5j6sl+3J+LW46opSzr5h1eKCYKqxsxyiVoV9W+hxj7Tn2JAWW\n70OrbUe0hoguABIOOFG9tqwmGVJxOcsnFyHBZN4VmiQRfr7ZTSC4buSdPH0/\nMaT1YLpi81jJ5gkHi0AAQKWfLLcUVfVjK6XMVSnxoEmFxXpty16RORAIpUZS\nTqax7zhtc1i/bMX0WH95AedWy3O9Rxc4oZ7+tLJ8pfxJOfv4D8y91wMGpMCm\nFB5TMBq0vD5lAwcZatZFZvs7SOhbyNtunjuL7/e7OXdSkbe4bUdba6P2fJ4M\nXai2Xp2EQfOJaYwbJ6rPBo2eeWYotLSXIDHofrMNbNn85g1VjDoaHF31MSfK\n3loYSBco7rhR4qr+c2CI45IBVR7g00h/baqoUqu4Dx3Y5ouPfejOOv7BKDeD\nkr8rRC8Zxgpifmjp0i35pySQSx10QUldOCATMwD5/dgLgkFmUpFej6WO+fRJ\nz9EH7zBNizChTS5wNjdYPNFcHbvUzAxW8Equ1lR7Q2W7P7UsSJJ7eALdGL/E\nPAcW\r\n=lDD+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"cb3596fcafccca62bb9d0ab56887c7155e309b7f","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.174","@balena/jellyfish-environment":"^2.3.10","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.9","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.200-renovate-non-major-cb3596fcafccca62bb9d0ab56887c7155e309b7f_1608012090185_0.5124997222498007","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.200":{"name":"@balena/jellyfish-metrics","version":"0.0.200","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.200","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"255913969dbbad1e11f5e09a2c48135cbe9591d5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.200.tgz","fileCount":17,"integrity":"sha512-BJZykJlEFcsm3ZIDRY1h/LYWwN76bTldAWE6zMcrV2ygp2BF0sa55KGw13NvIAI5keFsO9L4yYkpS0P/Q6VJ/Q==","signatures":[{"sig":"MEUCICXgKyBqv4sFB0qDwcWBz58BlWfGIz9ISD7GZzOrsWOEAiEA2bh/e+VCMaQW+nOxvsbnYaRkS3A5YFRFpGMRpO70pjI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93843,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2FHwCRA9TVsSAnZWagAAFPgP/Aw/pqZyJLds875HVJ4L\nBwzBQSTj3ftNUJ8h2lGd0fFS/DefgZntjV1pNoUG9OqZjgqAb+W0wR8MLnA4\nIOmbsULhqxOPJcwblBn/Suxvcr055eEviZZqvAwcmU4muj9yjr62kJ5BM4zC\nb4VE5NVtiH5mFuCo6jQlRUf+e+iE8cDjllioWv8I/YjB7c1gKiBG7Vn0FjDz\n5zUMh9JEm56hPJQIvVFC5VNlaDFfMhkyo9vt1F3O6TzBbGj30VjnFcYZ7nB/\nQxcMijNa/O9AkcIoVshN1Y74Kd/N2uGG1P/QBCv3vnX2jDnbOYrzJXg59sY1\nYh1KiPUWtJexlxlXJCsbHQTc4MT9j9Pdo/K5YAD5TCKNJk0O+Ca34UQnGHuX\nK2FZoCWcv4eopx8Yl8FQD87hVlD4b75BCEjHxzgIflddnExm1zD0aug3ta24\nqWiLMlTsaLcSU36jB68s4My/ahjmew2KXGIiePwxdclCko8hFcQpZd0czT9C\nKS8nTKMearqnM4KO+9srv25ufq732Y2P7wrFrunmy0AfUUfMU7EgtvRg+uj3\nWUiKyXydGTNCOHG4AMTuM04IPmRV8/qZeAvJMZq9BpTIY1Y7kdu+Pt2ZoVTa\nP/IT3yEVWuKBGQqjmpn5OMD9nB9hwFuIcgK9AG5/4g/imt9IhiRZOSxIj5Y9\nEqLg\r\n=uLvt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"c73cdbd80dcb96290aa504e98581a4908f498ef4","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.174","@balena/jellyfish-environment":"^2.3.10","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.9","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.200_1608012272055_0.8674137884158089","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.201-renovate-non-major-7be2808363099445912509be0973b6e8fd73a5bd":{"name":"@balena/jellyfish-metrics","version":"0.0.201-renovate-non-major-7be2808363099445912509be0973b6e8fd73a5bd","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.201-renovate-non-major-7be2808363099445912509be0973b6e8fd73a5bd","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"07d9f8ff61990e0f6d2796b748728270a18c58a4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.201-renovate-non-major-7be2808363099445912509be0973b6e8fd73a5bd.tgz","fileCount":17,"integrity":"sha512-2lhrZMOY49Mhl6ehBa0AtRdRN7nzZhurimDNstBsj71SMlesgkao08aeGsqIs6MHNOHJVnRco0f000HOglHQDw==","signatures":[{"sig":"MEYCIQCttqzgTm5O4jLzi3hDwt8Bk3UC44WJ4Q9eAFYkARrejAIhANvTidBFPbERV37XdSTTwyiMgXgnpz8Wf+HClightnG4","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94011,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2Gm1CRA9TVsSAnZWagAAXZsP/R7e/gRlvohhEEHMbPcZ\n46McdyO1ZOikhoQWY5RanNcMUP1WwhQMbd41oAhyTxoEGc5g5mPHACr36EkL\nPMAbPqEVo+BF++ZX3G3JuJ95vwU/20hbNMFsR8c10qt09nu1Vgbr3Gaev9wJ\nuPGIUimvUcLQMsQZ2VU5VI/ySdgMvZog7ieIduylMGuLVNOxmvI3l6OK/0LD\nhGQpnL/cukEWGxlxTNZfN1idXW3gpjlmgWmd9SKTk+HYsZzxJWFtwy4x6uTp\ntcFRLniBjNh6URkvjTmhTGVOWPKbp8cWXIi/PVobZa/2RpVMZWqMhXB0qRMK\nO1V5jNqJnCrgWP/3BWuZhobrfjzRiPh/vEBwUXWwX8No5GLcH9jFQcNscYSk\n5+Qh4BtwhXqZFFdBi0doV8YgRRa4PqwpP5rKaCXQjDetEELeyQuQ/9A5n1n8\n9D+2ko4S8cbYITf5Tv+ZYuRL+4TumEWSprVRA38Sg+ETiUD5+zSOIRP8l6xV\nO1myGBoW0/RbpXIT7+XGF1yfZOYnBk033O50NZTbocGAAe+arpKGa60R+4Z0\n/wCZJ21mPBx61GhxHKoPvP3/v1w+p8iKCFR86MpIREzsmDkQi4iKzA0csCmm\nw0U1AR9mcRP5WsHvOagdSDp90plj4Z+QvAh3J/HLc4C2l0MzGytEF1sfwXi+\n7pLW\r\n=sEOQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"7be2808363099445912509be0973b6e8fd73a5bd","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.175","@balena/jellyfish-environment":"^2.3.10","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.9","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.201-renovate-non-major-7be2808363099445912509be0973b6e8fd73a5bd_1608018357349_0.24262748154230462","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.201":{"name":"@balena/jellyfish-metrics","version":"0.0.201","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.201","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"154bca61778793328c0cd57b2147b6d978e06399","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.201.tgz","fileCount":17,"integrity":"sha512-uQENCVMe4F3FFRKk8QcoVnwbjeilPNJNTwN9NIt/KswZGNoT+8ANg8hsHhBl8ank19ltjBmpcE4nDTJX5RfMyQ==","signatures":[{"sig":"MEUCIQDde6FLCEvFqlE7xp0A/ykoX74R4646YFoXFUT23J/+MwIgUoWPK3C8zccaadAwk7AACjWObMm1LgYYX0Dp81E5sfg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93951,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2Gp1CRA9TVsSAnZWagAAeDwP/ROZmveY0URF5RdVhliG\nRcvdiUMbCyUwubnciaoVDn/k7NYYtX8tjNkIFU9gwDKqxT8VGtYDZlpDRD2O\nHMuz8iP8AaedzY+3wttBVzxa5hcWARGPBRsJFLfjOXwnnmGfLGzcQpnWH9Np\nuOKOKJhIh8Pn795A4Fga/+/RDq0Sqy/TQI/HFW5C2FG8UvL7M4o/5KCxUxHR\nW7obw2vCU/EWzRhAYgt/UkMZj85/mVcgWXf/tST3ZZaUVRLXQWXA95yqTLPA\nQTTZ1QzhZ0F6HgBKNStqgY+xHkZsoQ2i2cf9/lkvvlZuD0VNMQUS8MaI27GA\ngql+uy9nKJjmpkhJw0uPHsqiO0UC9a2FIzqfnGAxgbCxxSshr+2Byd1ZsAdC\niQ9bBDHBPnNYX4JiZ2Q4fh8ncGBqrqliOQsamlOSAic6mnrI6zJwSWwtsaNG\nqonz7zFtlfL4OB2kX4DvN7yuEFgBg/M5QSzFtwQanjx1yoMLVykoLyZoLpqJ\nlASyGVOgPXxyzsTJncFAe6g4yTBgVckVxw0w3KwSAYJNR/6Qpmx1h2Lwlf5u\nG/UnIVlsctyOm57tUltVDQiR+jl+PYLU0MknPtPqCiMemlMwtRJyvB4Dbhid\n9wP2Y3GwKUBLg7WvcaifavzxNiy05Hw8/vOiBRT4x5D+eTjHWpeYdUpdGAsM\nLH5a\r\n=tpzI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"9d52afa6c575150b55b0b32b1b7b56e446969675","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.175","@balena/jellyfish-environment":"^2.3.10","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.9","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.201_1608018548544_0.2152063751308153","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.202-renovate-non-major-c540e8e4747bbff6fa935b9c21a21c1b29768efa":{"name":"@balena/jellyfish-metrics","version":"0.0.202-renovate-non-major-c540e8e4747bbff6fa935b9c21a21c1b29768efa","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.202-renovate-non-major-c540e8e4747bbff6fa935b9c21a21c1b29768efa","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a66033d22421e159a312e1620b914785ef3eb593","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.202-renovate-non-major-c540e8e4747bbff6fa935b9c21a21c1b29768efa.tgz","fileCount":17,"integrity":"sha512-01IQ+v9BThAC0EPfGV4ChA5A0641iEf5+Qj4TVlBQKxUz9ubKUv9DzBAECFobT+dDVGvDCNdVq5DqJPmDxBAmA==","signatures":[{"sig":"MEQCIHuIGhXo2X/5csLZHNlos6W0ag1CxX5CBVq6mqUmgfX+AiAz/y6/S0fc9poXyNWYokQTIF0l9CmDWd6rGUwadux9cw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94119,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2gTjCRA9TVsSAnZWagAAQAcP/3yo2KxKvAplJkmyFir6\nlqVl0a4XhQBXnU7Nyd5Y4q1EGfsMlzXpPtTi2J+kgPWfgFoWBzxHLf7XkhfW\nQ6w5gD0zRLB6dfoQSd6Gs+2EOorgGlWQBVUc7Cb1bBnE3Uz9IiF/JImFgq/N\nJ+bUny70zg1/pxYgQNqwVxR3Hb+y/Br4Iq7wVyECbNpotgU8qJmBG9t13S+M\nTvNY66R9Ge+sGo4O2epCmhky809ZV/uOtbX5G4HBAo+eWGYJL3dIaG6vaLGD\nzcHJV5KvvkbpT5Os+z0fBXZJgvxWuJLEQxZcHLpMhzmXVB1SM/1qkoVLKiTD\nB6Lz4Zh5uFV2uhZwWQf+ZbmjMaqBCG2ioDPhy1lZ1+54ngvCuML3jj78Xvw4\ndGhhQVCowvzmdl6VsMWQLHTHHa95VVDeOo6IWrNcMKUxAHJIR2+UWtm8lQF8\nkjWmmK0xxTbD+U4JzThkmAEIP/Ns64psFIWHlko0RpxKw9h2U37LjtBqKmqZ\n4R/U5D113HlWA2zIElc43N3+E+jsoiiFQCml+Kw9sJCbTuLUuCSzc60Omzaz\nqNPFyxFetQp77MpQ0RLxl6HBAEUhiWV/MrfmTjK6/SeuXCvOc+5GqTxDBHbl\nPBlCPVLdruLg/j+qUFKlihIZ0nB4en27UTx8HyQp966xRDchjXT6fqSou7q9\nTDv1\r\n=nMa2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"c540e8e4747bbff6fa935b9c21a21c1b29768efa","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.176","@balena/jellyfish-environment":"^2.3.10","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.9","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.202-renovate-non-major-c540e8e4747bbff6fa935b9c21a21c1b29768efa_1608123618931_0.4873530618897901","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.202":{"name":"@balena/jellyfish-metrics","version":"0.0.202","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.202","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f07c115039143f1740b6af13d634f89ff3e29131","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.202.tgz","fileCount":17,"integrity":"sha512-8HGbI2r/WZxti7AdSguUmW1a8paQB+xcauUw2p7h3YpFU/5ZqdDwqsRQM4YolpS1+ohBe5JKC1SU0aixrUA0NA==","signatures":[{"sig":"MEYCIQDjjdW13YTEhlAV+OI3Hm/MYEw3cfnmPqFRGtDpDyp2/gIhAKJOLbAmztvOEQfbEadv9MOH4Mo+jjTozck+nZqCb97f","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94059,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2gWLCRA9TVsSAnZWagAAeYAQAJOtQUCIxQo/dvWgg+LB\ndJMXoPJ3r2TrzEolGgdH6HI7Idj6llCFc2oOEzORcJ5M1S3YEEG3ASmM4zeQ\nAB29f5i2ZCd867VJ5bNHXdQlC5mClEsPte01RFtBbc+7DP4Gub+BRpfE++9P\nVaQLkpWGXcYwTsvr/jdGMssmQcDop4IYAAmoi/uLDsri1MCr88Lo0Gv4tDgK\nWcEC4SrZIEBfVSvpPQAaZ2CQchHcNQyToSx4t6wFZVp3HP7kgchDZgaXnJvt\n+cJT2uuQ3SaXwdY1xM3DnOws2RhmiHUJAJjv/KkjN7XSRKXwQKycX6MS3Q+T\n6BI6QDpH4mW23HWSZiRNH4vaFaDZjf5iq6tzhjWwJoj+DgoVWdGoq7sRWAeE\noViiCvNsZsqbLqffEIzw45Ydh/ZI1q8zI23IXcZJWlcLmsRmN3vqUwsfF/Nm\nCTymTxSWgxdppqoxnOJME8jhWfA6oRsOwCqNSO2H2WfOWSJiqGEhzOQGuMXX\n922o1lk0QGB2imJL0H//jjWW7yRWQEdd78qPk2mss3/MusIyeS4/JGSpyCrh\nj4x19RJPa5Vz7WnQ79qEaKdgQ7IAHU/gR/s5KWVfzHGnIAFLxJK8Ft/LGyT1\nd1gLT52h4FVob4gTXCEYXJbbffijWIaxvy3Om3daQFSToJBETBluIJnh+q6K\n5iUO\r\n=zLX3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"702a478bc4c0d0d1d7bd1029e95b950fa322dcb1","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.176","@balena/jellyfish-environment":"^2.3.10","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.9","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.202_1608123787320_0.42565763587327177","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.203-use-balena-lint-54477f32b590f7fd0001ca8d804dabd447a65e15":{"name":"@balena/jellyfish-metrics","version":"0.0.203-use-balena-lint-54477f32b590f7fd0001ca8d804dabd447a65e15","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.203-use-balena-lint-54477f32b590f7fd0001ca8d804dabd447a65e15","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"23ec5c3fe44e79282b316c5613d99f77645ce54b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.203-use-balena-lint-54477f32b590f7fd0001ca8d804dabd447a65e15.tgz","fileCount":16,"integrity":"sha512-AuwWv2Z/G/pQjnmSK14PS5Z2KLft6s29PAv4CLTU/NMWfjizN8S6tWGkDytdbSKdKrvAdWAKQutJ22Cj3tFZtw==","signatures":[{"sig":"MEYCIQDdcXliKL6XcLPm3HpySUQ8lemp38J/X0izj3EqjpCIewIhAI/FseKPh+4gh9YS4bBt1sKs7E99rxf67fBWfs+4EDfo","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88517,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2vizCRA9TVsSAnZWagAALnAP/jMWbFtRZVsU1Ha2Kp7w\nhQ8G/Fuegmipy4+9ISWWeNAQeW+9YrC4DKYySWLbNw87mFxxQIyq1/ZN5X7t\nvFt+q4q7f7Y4wNEBGFMcNoTCwhTK647QguXnRufS2SJYPFYMs33Tj9ulqQbe\nsjcJXJ8fMIvwoRDOphC3lZaApP8NtB6QaWST4ydeO+1+7TesJKnVtlUb3wKB\nJ7eQoTKT/WlPfGC3lmqO1/wcod0P+TnMDMw1piaBTwbhtEb7p9ip8vq3x/b2\n0Ee+iUF+Oi8Icc120ojDU5tBNKq9RnrJg1U1QN11zykxuk1ebsXE4eJH5+ls\nuJAiV+9wbUgcB13pMz5XCjaVcqXoC2eaCdN2d1zzohvCOgFYAsdsummudUse\nauL8/B+pz0GhdEDbELWulMbeRbSyteADUdDPcEknqB8a2PjkMcqBniLaH/Mo\napbfd25Cvz6oGAIDDvXOv0qqOr95AmK/Kr2TQ8yOUPlZ5oYw8IG/Y48mxxtS\nOH8CECyHjOzBd7hkURFs0YRk3t42b0I5qEDYWSchVWnOrXuIc8KR5IuOD8YG\nX9VhkF8mYVWgPt5/vgoVCgZKEEXKHR5HGT+HZfCnkZtaBg9lOlqZTCUcFV8j\nCG/965JN1fWrvmsEB9ygEVBOCrS3MT3eOn+8uKpUm4P+di8dXTKQMAcFCdAg\nLzE0\r\n=aMJM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"54477f32b590f7fd0001ca8d804dabd447a65e15","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"balena-lint -e js --typescript lib && jellycheck && deplint && depcheck --ignores=shellcheck","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","lint-fix":"balena-lint -e js --typescript --fix lib","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["npm run lint-fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.176","@balena/jellyfish-environment":"^2.3.10","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","@balena/lint":"^5.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.9"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.203-use-balena-lint-54477f32b590f7fd0001ca8d804dabd447a65e15_1608186035133_0.8445981706871106","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.203-use-balena-lint-14e284c6a3c8e55fee9347df6bbb3a2a471c8fc7":{"name":"@balena/jellyfish-metrics","version":"0.0.203-use-balena-lint-14e284c6a3c8e55fee9347df6bbb3a2a471c8fc7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.203-use-balena-lint-14e284c6a3c8e55fee9347df6bbb3a2a471c8fc7","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a44f9dd88a4c01c8d225dc532411543e9248eb68","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.203-use-balena-lint-14e284c6a3c8e55fee9347df6bbb3a2a471c8fc7.tgz","fileCount":16,"integrity":"sha512-sRA/mBiPmtA8J1rvb+q80vmzZGAz6WNHSolnfbXWKAo8eaVjYjlQiTyfVJeC+ZgztwUHt94DgB34iGkbNkpceA==","signatures":[{"sig":"MEQCIF+yXQDXwP121er22zlwXJ9NrNTfcTSFEObndIg1/F/YAiBpQBFfyQYs6QiID9ttdJeNUkzKVfbITfpht0BedXZHpA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88556,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2vyNCRA9TVsSAnZWagAA8uAP/RrKdOp/EAexK8VGtpA1\ncIMgwhnMKaVZqOOlkxiRfF0ozroetkTRi7oXSWetCjfeLQ3UwjqwCeJJnbWu\nqVM5FTtNgIlpzQVssuELMnYPIK8VKlE0PT3U+nJraXLMZo1RUUPpyyMNmiAN\nMbRuGoNU6aLHxXZ4orfDish+SxB1NyUiSrN20RyzBNWOQoIXUy9Mdd1osXeQ\nAmSvTWjZbpeQecZRrDam8w0bVqCY8UqqSLQpcqvovb9NOkC2T0R1ZlA7UJmX\nyrpF/Ss1VGAvdHSOM6ENRwYZkbbDpksYCemU/+KvsTlPYoL03pI3o2tiJsGR\nl+ZlZvYG/2wolkByut2C7sOsuxk0DvklAmb7VSp0ih1MqWMSO4sUA6SSQz1u\nxBeJ3WuYcvMyASjFdngoirRXjjoPIT+B9pxZidTCA4yrI+q8XUTFwNV2yL2t\n1lfyfC/r4M+fUG/63BGQVojjucmtNSNfLHj0woTzglYtmaf43RGv6dMN1Z8u\n4lzUqGo7gZFfGHE0rmK4B0Ccal+sWGVvOCACp27dYd1xKTUiX21rr4SDEWp0\nasmM5RFM99VksPFw8TxkCC5TI53SYL9FWWKFgD+ShNFKGusF7vnseGctGNkW\n/WNnI/dM3AQD6ng2qoUNm1SGvJ2xUeOtF/rkdmdAEy4ooSmydd3OzxJuLqqU\nxZ41\r\n=Yg2F\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"14e284c6a3c8e55fee9347df6bbb3a2a471c8fc7","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","lint":"balena-lint -e js --typescript lib && jellycheck && deplint && depcheck --ignores=shellcheck","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","lint-fix":"balena-lint -e js --typescript --fix lib","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["balena-lint -e js --typescript --fix","npm run doc","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.176","@balena/jellyfish-environment":"^2.3.10","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","@balena/lint":"^5.3.0","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.9"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.203-use-balena-lint-14e284c6a3c8e55fee9347df6bbb3a2a471c8fc7_1608187021301_0.44182041955338525","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.203-renovate-non-major-8ddaaa3d45acd1e736366cbc985cbb99789ad3d7":{"name":"@balena/jellyfish-metrics","version":"0.0.203-renovate-non-major-8ddaaa3d45acd1e736366cbc985cbb99789ad3d7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.203-renovate-non-major-8ddaaa3d45acd1e736366cbc985cbb99789ad3d7","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f86257c57045f491f1167b01d8f03ee70f7c4443","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.203-renovate-non-major-8ddaaa3d45acd1e736366cbc985cbb99789ad3d7.tgz","fileCount":17,"integrity":"sha512-q+sQ79D8yZU+lb6p+JHMQQxEJU3Kprg/OWYLGev3/DLASkzbCFJLSVjq9qnW0D6OrpvjbW3cTNpLCK32rQ4sTQ==","signatures":[{"sig":"MEQCIH02Xkde/+YtJel3gGrboEX4KvoSgeaPL8lxfTODq0VlAiASjEI1396221XVT6nZH5t3PY035MgtNrQvUo3BnHOJuQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94227,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf28xtCRA9TVsSAnZWagAAl68P/jcAbd4h4KgAkbY6EObL\nA4MBA6I1dYsFmEK8Y2UnCN7B/SRMALzQ9iK+E769Ce7bY9LhwNE44ilhkgd2\nor0x7dl5GTLPVnKdjLvuedHQtMZ7GLWX3wxOBzI3wZ6XerCT21sGF8A5Ecg5\nTa49+8AKLwBQh3ZfRy6VkC8yydRwsyfzQKl8eka+hZHNyvZxRWWiHuWh4W4m\nZxzmDHceQ9UezF8R8xSfclZ7FtasBrbDlwGqpWEHL7KH3f81G7SJeVzR9k29\nTwv2MocJm2UNIE67B9GPbtjQJTQIWWpxrMwAIAjpS2b0jfvuWk6cx02UenXf\nUJ9z5IJislRfHsaIWwkJXVmshA27Rnm+Ybt2sc/g5wJrwgTOmK3RQCunSf7e\nJS9IrVZ+Qml/1+zUTQEU+txpOJKsWI4H5C3N1ZdWY8ySGsg9TIs2+ux/nxJ6\n1+V6TD+EAf7pZ5cj4HT6Drs3NMiGp/WSS7v5o0pUTfuzRYxgLg4nlTRMdRil\noehrBUjO0L2oDc/67LlDU3+fqvZ4+125ihLJge80CW73NXtwqpbN+IkqVcRI\nlf6BQIxs7Ls5eaAjkEapd1PyfxM0K+fD0Y9pTU4SFBqnwP81EeMQpd8P23a4\ndJ+S4QVNJfDYNxfzlI+Ispxqe/yRb3r41YCWKCDrdS68PBgn92Sp1D8aNIuU\n91wi\r\n=oA5T\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"8ddaaa3d45acd1e736366cbc985cbb99789ad3d7","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.177","@balena/jellyfish-environment":"^2.3.10","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.9","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.203-renovate-non-major-8ddaaa3d45acd1e736366cbc985cbb99789ad3d7_1608240237464_0.6947151224971648","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.203":{"name":"@balena/jellyfish-metrics","version":"0.0.203","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.203","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b4fb49b32bd18aced8aa0cec57da842313687287","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.203.tgz","fileCount":17,"integrity":"sha512-BM22ivhuuDyA473aPIBXuPESVpRkithvowxP7apcU8kUmm5ptwol9CnJt5xqccIe5vr8ARqjMSMotiZoL0jBiQ==","signatures":[{"sig":"MEUCIEZJIQS73Exp8EJ7t4EEp91MkmOcM99EQKCdmY9TxVcZAiEA9qOfNnq5wHfDaOyKpSY6u13x6ak4CgtLRWv6W9mdu3E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94167,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf280nCRA9TVsSAnZWagAArkgQAJFxrg3V4+cZFcWb+PRY\nnit8DQT1Lyt3c5Ovd+OAU3LLpBTPByeqHZkGO6dLHUsUDh2myy008xV48bwk\nWWNwRvYFbVlmfsHRYWKMm9aZq9nuGEsvW21ZNmmUKTbC/GTOwLyWlf1xWjlg\npZUK7Fnzeniqe5A10N++pR5Iun4yBoI7mfiSuxwEDieJ3WXj6wDPtTPTYUQw\nUM4Rlb0k/QrYhvybP7hjmyB/g0oxQUHxwsnVdAHivr+guTx2LS+2Bz5Nn3XY\nwsc5tAtRqJqQNcmbv3n7X8st63ss6nGctTVm6zAcL4fNOurSfYnDs+11pOsa\nMDj4vWLYkG5VYPrwPbxqsNJd+LkcU3TsXmLcGllFOYcuR/qSP2FjKGyfuMQM\nuTeoAz3sKIzGcYMdZH6DZim5HfoEFQCY+Q3Fdpi6z+3nkYRBeAoUXqCMKpNt\nY2FimVGvZ6o0m8CwwC0zVjKCqrrMJHRQmTnGJ4SQTqY6yVuBIsd4Rv5SgvXf\n3CprLVb6J7kTFDFpmGreAKttCgyL2FRwaBqOdbvRX+5Yy+D9gJ3ELTULa4ag\nNlOiHHm2tQwTeiUTMXGUZPnOFJ5/b/RPag5qYA4Zh16deOai9Mh1o0sGAPfg\nM1IKRO7xaWajr2RO8bLzOvzLedpo5v/xhb4X/71Hmdk5mKee0XHwBGD1H3ag\nEtWt\r\n=ucXG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"35aa563dc189fbefa5b92eabeddf7ce142231ea3","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.177","@balena/jellyfish-environment":"^2.3.10","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.15.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.9","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.203_1608240422686_0.7192610436845754","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.204-renovate-non-major-e8761bcd15b43c74f59fda5a6af6e8602b605d3b":{"name":"@balena/jellyfish-metrics","version":"0.0.204-renovate-non-major-e8761bcd15b43c74f59fda5a6af6e8602b605d3b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.204-renovate-non-major-e8761bcd15b43c74f59fda5a6af6e8602b605d3b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8ce12658add23d2b2784549773850e24689205b9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.204-renovate-non-major-e8761bcd15b43c74f59fda5a6af6e8602b605d3b.tgz","fileCount":17,"integrity":"sha512-h47joaAtcPtTm7fafPwdW+MA1Ky2Dt3cixsPSISraGyMeQ60mLSTLx6tw8jk8NyYxIaFCe8DjWfchqHyLLgXzQ==","signatures":[{"sig":"MEQCIGDg/h+f0EyUcalvoszg6F1L8EpxLIFJdJ14KJQ48AmtAiA/COne6uqPqfb5UKryBKvT88jQTwfsupLCGS6ABOU/5g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94297,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf3UydCRA9TVsSAnZWagAAduAP+QAg56WVduPhNZVQBTlZ\nmNRqpcy7u4p3L//PHLQiTiHHrmgWPpqvf+BSkf+qNdnfQqZHn2chGWuyjnml\nHHZVEUQFfDpx99RuioMr7A+8WOnuFHoZMzFol4f8/8foqHQTj/qpv9Arv89a\ni67wJ6LB8H1P+HZl83pLvmBbfmDp8gxNmhYp1yLhaIxVBh8f+YIwri1UkfJt\nlH/UoIjptTQB1LgAFRN2cCWRDnyBQAnrrSVnHax6uGLLaHiBRbCAyuzoiCkU\nP02rRJZFeRV/UNw3EBMcckLz32axQmcKiUP9TRW86fhDWwaklZp4bjFxeMDX\nVt74FQlWkIcLYiIeJ94cbEfGcDWBokg/ksD4z/Mj2Uo5kHn0EB6qWjbT6pPc\nkIpylINLgM/QZ3vpZ/LDwWpzq3ycqW92oFzTNcRaX2y0h+56EbSWZEjbVJC9\n2nxvX9BXxSHgJ1oHmM/Gbc4w35IFV7tEMizAgJagH0Cy3XiFYUVNem/ucyp2\nxmWTdWiE/uEL7YrtSw/LPeBl42hzm9RlFas6hLMfD3lm27w5Dpg4PzMQr2tN\n5tduBNBj/yuxNbzO7I4C3T224CItlMTpMLoa6FtoR8NKbOeFe6kjIiRcsQDJ\n1ksY83XSMKbruK2JMrsh5A3jDKF23/5k1uD+/goCl2uMI7aKD8RTUzWm6E4j\nL/uN\r\n=NL66\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"e8761bcd15b43c74f59fda5a6af6e8602b605d3b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.178","@balena/jellyfish-environment":"^2.3.10","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.16.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.9","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.204-renovate-non-major-e8761bcd15b43c74f59fda5a6af6e8602b605d3b_1608338589115_0.3403805129117936","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.204":{"name":"@balena/jellyfish-metrics","version":"0.0.204","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.204","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"373cdcddfb03c00b313a131a99eeed6539231f88","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.204.tgz","fileCount":17,"integrity":"sha512-YjYVP3KenrpZRGAPOUTTDdXkbrfr3XWYZcv7S8J11TvfFZSPDafoiicQASs3rZEyhQ7wvq5QYzBQWZrR0P15ww==","signatures":[{"sig":"MEQCIDoQsnADjblBsqDG+6lDuVTpjUEJ9AGMOEto2OlnvOHeAiA/L5L6OotqxsQJbTrlh5AdCq6Lj0MFHIDDo5wm2GK+dw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94237,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf3U2wCRA9TVsSAnZWagAA5YMQAIi0K81g2HjYwVVVa1yr\nzoIdw8ypN7JBOTXwjIxcKsgi7eDTfgGftaZlqHSuArWuSde0JwnFOpnuNx2e\nGQ/do/1zEErdRsLuLP7haYPTbQ28opdXunTiKl8Wai/flOlXHQr3QdBpdCNg\nok0IdWVdP30GEWdPngZrfoHD5L/r9zOYVp2jxKFqElIw3HcVmynJowPbN0c8\nHmORVtXexBLvkIHIrc6R3495UnYGgCxR79zqHOQeTiHRCv1r7NU9GgJLhWCY\n79Qxr8bY/Ent5gQ7xG9nBL1enUFu+S1XaJWAZUZfeVvVLNTQdUpdtBJDkt7O\n5kJttYQIvHmPMyLyZvuyuVa2ojGk/WJNY0i+wwClq+ykpRt2rjBenwo7PF7F\nuc0C0AJe+2l7uZUCU0nauEaWbZFH6GszDwHfHMBnaLajBUxjP1qmtSij2Jk4\n7yOWw3ZvbJjBgw76FXs0yJU/zYYMhZ5V73fTGQjNE+3V3SSEPToWjc6u+tOu\n75mMVcPcLRqObznZrIdC4QmnVLACkKym63r/PDCOq2bz50PUydGhEPu3fuwu\nz14ZCp03qjCUlbCSqMKKaOFn+oqVS2thNs+JoFQpCLbDEANiRRWsrS7U5KOX\ngx8pTtdd9If4PBEbDK5GTOpUJs+4+IQIE8tScFr8xiFPxutxNvms9KoSOsy7\nlCts\r\n=5acg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"053af8be9b9f29e85feb4975757f7e86d2439b7a","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.178","@balena/jellyfish-environment":"^2.3.10","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.16.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.9","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.204_1608338863474_0.8287750447048452","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.205-renovate-non-major-42526e729a0bbe7a56f97a0dd4f26b79925042ad":{"name":"@balena/jellyfish-metrics","version":"0.0.205-renovate-non-major-42526e729a0bbe7a56f97a0dd4f26b79925042ad","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.205-renovate-non-major-42526e729a0bbe7a56f97a0dd4f26b79925042ad","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c811a5a299f2eec1ace18500f8454f432d68426f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.205-renovate-non-major-42526e729a0bbe7a56f97a0dd4f26b79925042ad.tgz","fileCount":17,"integrity":"sha512-hbNYtFWYn5fyZQm2zmgmiWaOjxB2oi+e4+UDW6j6zl4htB812+POg3lWHgb1sJzb7AOQEBeyUg/1+wRwQdMBNw==","signatures":[{"sig":"MEUCIQDrFk88CFQPCBKIhxtLSDh3ascJKIPtiBFlp6svizK1egIgc5gC2vrnYgcPr/r/Nt8Lw36SvaWeBGXh7sijOq6kT3s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94409,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf3U+uCRA9TVsSAnZWagAA1NsP/jH/w3inwvMLvXRp15uH\nY7xiIEmLwRw7pRQYG/SgOY21PRRXUHLZFoj7Sv7TvR6smQBKoxcCb2q/bfcu\nnpU8g8oulV/sBdajFAyCUc3Gh3hHIfaZ7DIZFXvLOmJaJLfgRQr/TUc9UDeo\nkhrZIoaoAYx+2HsAa2L1H/LInWWTAfKDgQVG+27jCp/UF2cWUB+hs8z9ZyLR\nKP2pXcdCPX1iL3+QXClinhHM+24f2j+KbhKrMuBH1blDcho7f/jdHgYzvVOK\ngBMa8aMiy97IqfD2Svr2RZ4zNzwsYOYf4wOf8+PZFha7GGubyB4d1WJ1EBOz\ngZN4hJQsm2OwHAyZv7sZEfbr3Bzza753RY2/M/VqhnoDW4wl64BroGkPG4uS\nUo75EORspDFSkczrGX90NESgvKIlHjuWFg4y0cwXY8ctoQlJESeOJ2vE1/Hr\nnpu7rpLMEEvDMZ/kSzG93sT8Kq7fnqSdYPNWchxaYRS039RTEqqEOBJVykJv\nwi/dB1kBWrdQP++C+WYDBpkpxhDbXtkXXIZWezrLKcTho3sobhjJEg7+L2Hj\ng4lossojfA6IkFLjkmcaz1q7AJwt0d7ZHucbYyj10PZScT6qcQ6DqnJdzfQt\nK+VZBJNxB+WDc8nYXVKLKbAs+9XWTM/9McXqRxr31zjO1+JGd+xKeRRgILjF\nOWY9\r\n=PbzU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"42526e729a0bbe7a56f97a0dd4f26b79925042ad","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.178","@balena/jellyfish-environment":"^2.3.11","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.16.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.9","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.205-renovate-non-major-42526e729a0bbe7a56f97a0dd4f26b79925042ad_1608339373636_0.08286837192775742","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.205":{"name":"@balena/jellyfish-metrics","version":"0.0.205","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.205","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c9a174ec5823e586fe9525f3822801ebb234d460","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.205.tgz","fileCount":17,"integrity":"sha512-x3ODiQqpgcyl5cmTVMiD5fKcpxIVliChrwsnaOjPTIuNi1PU30oR+GTfnsWnfCh58ICN19BaWSIuFG+QpGdsyw==","signatures":[{"sig":"MEYCIQCeFczlL8BPc/9rlT9CHPhhzkI1rh/2t+fMtdBXV7x62gIhALG57RlYDxto9UNC6eDy5XLiv7VHtTrkPhCh4b+zpzxR","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94349,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf3VCcCRA9TVsSAnZWagAAby8QAJjTTyc+t6mO2XpeUeFV\nULTnWRG8FEoNdmccYJCM4R5NAm4bXU8dtIUYKmWqIYVXyNt6Z7JfEAdbKy62\nJnPVKGkMcIapWqOPW7sguCms4JxOTv+F2AgpCyPQY3hqByQRddpcV4nCHRzX\nbt72sxdZOkrMyFI954NF2FSWg5W08i3a2582AasFUeFZp+B9lNntwU+qE74Q\nbvqp6Tbbhpu3vCccvoTBu4h49/DAYgF6n2PdZllur096iguz2KLrOdtrqTAb\ngc5ok4/rtFZfAfobwH5fcWtX7Wyqv278mewbGk/A8UfCqTSyF6/f7NvFtE38\npaUjIySrl0bxauQVCcq0myp8bK0iUXvcGEFxuMcOO8TKVihS9qHoMcxhlgvU\ngEYl9ZnW0YkXWFD5V8qOiEGIjL2WWiuloWdiuL4ZIJ953yjuNH6r9+l9guZv\nxbcerCLExgK58ZW6MpEfQpgaLHhrpcVUj0fESQdyL7Jy1ZlLrFgHu56fpZXS\nWcaxfRzQ6ye7msjWlDDTYLnyCfMvngtwZYv6fD+qHbuwrVtQqwTwR5gWxy9k\nJWGdBycd+g/TXekKufUj7OoqaCHeo6PCF/zH/IMEhc8K+5weSh5ZxaUmrmQw\nMSS92H6GwWoOHyhpeQQwlw3x2aeNj7e3dt75dSH312VuXRu4TscJjgbKlKZ8\n9D6D\r\n=V2eC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"ede64c2af481b7289d07f899531ca68939266cb0","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.178","@balena/jellyfish-environment":"^2.3.11","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.16.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.9","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.205_1608339611626_0.7391913346263168","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.206-renovate-non-major-fe3637b227d3d9e39d18618c00c635033e275b61":{"name":"@balena/jellyfish-metrics","version":"0.0.206-renovate-non-major-fe3637b227d3d9e39d18618c00c635033e275b61","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.206-renovate-non-major-fe3637b227d3d9e39d18618c00c635033e275b61","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5e894294efe7407e1c18dad35addf631077be957","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.206-renovate-non-major-fe3637b227d3d9e39d18618c00c635033e275b61.tgz","fileCount":17,"integrity":"sha512-YNoAaGwQqql67ygXUHwyoJprX9iSrMyrghMw8jFyGhlkxWF5272ffRrOAAqzD3SENwrFZdTFnvmFHrhRcvbsPA==","signatures":[{"sig":"MEUCIHb6LR5w3aezYA+XL900DiHI5RcOUjWxy/HTGbAjOV/kAiEA9m3QO6tn8haxf6C5Kz7Ew5ptL1u7ZNUp49+nxAqEWJU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94479,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf3bcsCRA9TVsSAnZWagAAvewQAJb3+UdZy3x1JaQKk3gB\nNAAL1Ni5OBeMm4iXDItMytokkL/RNkJLjXh538PeDBKI5S8j9WF5nxzFl/Z2\n8LF7CY7vW+NybLu3M+h32OxiOs8iTnnrqaAJNPk2Kxf2wmHm+QECLjF5z1OH\nOz3RCGKaovvHhQngioj1fJ0oQNkwMyqYPx5lEkheN93wLa6/c7MW1+G4Xxlu\nsVsa6JQlYqMZ4ClwF3RcfZ9LGa+SW53Zw3GoMMM9OC/lBmGoGVuoMvN54O0r\nhXuSP8IuGxg9BtXbjJzoaqlDCzAYn0Pyxv5oVk+RkvP/gA6fkwFm2DmRmK/I\n7YjRPDv+Xn5nCu54eRbDlcC8sOcHvFbrLE2Q6pacaxxgXyNE4M1aS0QrM/dD\njA92gENenkJXXR1qVoazrhI/c1QYwj81ECSI06yOOPdEdgdSdrZPNIKuiAXl\np7PJzMG6kerSspb98P4ayuwdKlYlQZ32g4lUuP3mirghvJ/ZarDbUQdfIDxC\n5h5ZfxT67yAsEcaedm4wIwitWeJsSUDwhbzygd0CSjcM1fkD4XSG0irPeNrh\n5rKXhJU2YhDfiUSi9Z26DG8xw+PDRazh2RMpvIXTrwOuX9Zp5jUvi7Fy/KTH\nG9eM6+K5+rxKrnQv9YvmeF6cYvaI348kO7jrBBmhuEiSrer8mxL8EOulxlj+\nuJ+R\r\n=nF+5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"fe3637b227d3d9e39d18618c00c635033e275b61","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.178","@balena/jellyfish-environment":"^2.3.12","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.16.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.9","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.9","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.206-renovate-non-major-fe3637b227d3d9e39d18618c00c635033e275b61_1608365867774_0.17990700047180863","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.206":{"name":"@balena/jellyfish-metrics","version":"0.0.206","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.206","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"48df84413d4e73d8a2031d5d7d11c299ebbef4b6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.206.tgz","fileCount":17,"integrity":"sha512-4mXPgvQVWt2dB9Rta/+DIgmbZC3joF+4x7qGr23W2qM3auDsJNDLWQkNNYNm7b8RKitQDhPxPKsuckrTZjoq6A==","signatures":[{"sig":"MEUCIAW0F/rIgYXxUntt8dyzAp/YJNNiIO56dThSsuhQN1Z0AiEAvNJ1162gdM0rF6lBAQcc2bHrm3FKTOEMIlbTzY/bZYs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94419,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf3bnaCRA9TVsSAnZWagAA9aUP/i3jXbYCSe6vh3CLglC1\nNnCv/d4WJZLtwiNtQo00N54J81cTS5Q01g3M569N43k/GV9m4hOKmwlk7dH3\n/oKmWF81uDewuT63U0VEaoST9jWoeBQszp32c5rOFFEGR43X89sQzgPVCGDL\n+gPwFM0RkjKvHa1FBRUvdTPHUMrF7jb0bt+c+qZ0/ipkCBBLhoNt6Bcc1d5Z\npYFfzqHvKYqfHNnMm3c4f7g+q36gZbZ3RGlwpaARDxC1DfULwsph5Xrywyfy\nt9eFxpoDUTQ6cidPAx+KVUrKmtJ1jWy7Q+yB2tr9nIxswH0gwdQuNkJdZyxr\nv5H8MYwfuNqF04byw820LCJXXlPfyXL4rL6jaA6nCJdzZ3ckGtbw9zoRWLqg\nP0rRcWuML7iTtVCEZdDAZ0gwqCyj40NSaiyeMraUCnUrvj+gXh0OwHu8xWdn\nFUDqYCgVDwBobhNf4vJNgaQIZxKPBLubhK2BOwtqvjfETbvRRJhErm6YyIHK\ntaJO4WkmIop2OpZ0BYBREejFy2HJSelZ7aYDjP8zqe1NYRxxxgGevBVj49Ll\n8YnL5KCZfFrKTnFbbLrYZXyVoZEV+2wxFAK3y5WcWTsy08vL45znwAYm7SiO\n39IMW0X/7n/VTw/6xoZk+TByBFxgEZVVG+IRXjCEqzC+Kx5Ejcpo7RI3olOm\npbX1\r\n=hEMp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"71d869820913cfcd6f7134288791703b459e0746","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.178","@balena/jellyfish-environment":"^2.3.12","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.16.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.9","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.9","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.206_1608366553945_0.25822864039665405","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.207-renovate-non-major-697ff277e771f89e76c9e233d23693f04a75835a":{"name":"@balena/jellyfish-metrics","version":"0.0.207-renovate-non-major-697ff277e771f89e76c9e233d23693f04a75835a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.207-renovate-non-major-697ff277e771f89e76c9e233d23693f04a75835a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fcdb39f97ccb3962387db9b4d38b602b803af914","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.207-renovate-non-major-697ff277e771f89e76c9e233d23693f04a75835a.tgz","fileCount":17,"integrity":"sha512-I6405gUsjIvxaFmkfjmWkTlEo3EPwUM4Xg8Qiperc9BU8STrGj1S5/vdTAj+colK3MPSsw2Ig9NyjybJeO+5Tw==","signatures":[{"sig":"MEYCIQDWJfQqjYle4YJOEFlA7v23pysIyQqtFYopGrOiiXolGAIhAJgVwKq7Cxzr7Uanb4uxZLpcXG/v+eAeeLnZbK+GlgTj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94587,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf3gPsCRA9TVsSAnZWagAA1AkP/0JsqUjEq6Xo/wF5ALkI\nKGstF28YX40X/AeT/ctcIYGX4G0uuRd4l900DKPHEK8XianYKVqnSSm9cwUa\npROjUvuTPbIcupFuu71XvbN+X7lR80K6SAq++lx/y97qOX3cqT/GQxhkBr/q\nM8qIItsiOdzsD2H3yjRNL69haQIYnyxuCZvetFmsaQa0RJSpIYOHLpzAGn8s\nw7mUwho2Vry3Z09kVxdgvW/7a++87M1FSuWyjUBrVXtzTK7Q68WAJwMvR4kR\nwJTtG8RqS4V6sPljp8Ub0C8ttaQhFIR9w1KFs2f1SEAxZYYQu2wKX+y72Bqf\n5YY5fCKkD/5mk9iHB3gSUWe9LylCPhI0Jx/YIAqPkofcl/Q9BLUzUeDk+RfG\n7tADyTsi4IK2iKAcwXaXtfkVXd1hx4Begl2K2uoTBGl2ClV9pu2VSk0AEmOZ\n8araWCLEz1qRY5ol4sQqueXapjm9GZ6mVWB3jkfi7i2IGCRFW12KPAeRu12M\nM7B+qV4tZRNoQOPAnGoYwrZxF+k2qezxfo9v6X7LE47zyhjtg3ZajSuqLd+E\nhdjXFImelh/SSVU7GBr/E0Zh7EeRQOEHEvbkSzFqfPosMWVibAf4EwrdPp7W\ndbm7m1zTQT5jZM1tUQ5CA2PjJRCgFx+Xd4PfGUtZfPiYBSxx/C+e5gxk0/X4\nAI3Y\r\n=MWXf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"697ff277e771f89e76c9e233d23693f04a75835a","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.179","@balena/jellyfish-environment":"^2.3.12","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.16.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.9","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.9","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.207-renovate-non-major-697ff277e771f89e76c9e233d23693f04a75835a_1608385516002_0.9537032063174558","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.207":{"name":"@balena/jellyfish-metrics","version":"0.0.207","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.207","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2555485f2d400719a8385e78603783892da24d2d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.207.tgz","fileCount":17,"integrity":"sha512-I9FcQcgR+Ed2rSSgMC/bJvcEfg23X/QO3pWPN6mU+tSej85THa3abFKR/ueoINOYYVxXUGx5TtZiFrb1xc62fw==","signatures":[{"sig":"MEUCICmHtZjYADTQ4vvM+3X60AHEcF9llFCFjrbAWon1hvQHAiEA35mmOX8OcABUTpgg/HsH3E1w76+MXtb+dpfMrD4wC3I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94527,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf3gTHCRA9TVsSAnZWagAAEFMP/R0zqOpf0ORR0mSiaQri\n+RcXElDAAqjyqYvgVW9ANC3rI5il3YY6DnxZutbLcOmFc63vddRoZS1M2x0r\nE/u3ztLX15pzS1JntH6LAaIb5dBHiaDt1UwVHp2q/fFzWQuyu0UzMMkOh3Wb\nRGO49h/KOp1j4HhBoPz/bOTvBlik0YceLNTXlTR+CpSUyS7crQFIlhh5i/fb\nOlYmFNwVutbn+d9R/knheiZTvx3wVWwc/d3mXUOEpSgg0kVCCsIM9tes9EwN\nWclMTne1LMYJzbj2Zz1UQ6mYIOCAc3rf/dI8LvivEje9sWQY9FjCHZIvH8Hx\nOUPqk4UwI0SE4RlE+Wf4Usx4TwBTZRQsofCYBatOJg/hBLtwS1h1A3Hzi3Bg\n6UR+grgEUODLGG1cGzFNvsyD6eB6tKXjMSlw2/tBWhOssTNkpvth+DLSGUkN\nP6Vqod0LC8mdpEnWwXWFP7vU7JJoxqlzJwTysiR4tswE3g2dn2naFQHxMD2o\nihNumIiimx6/Cjbm78isdIXIuAqsLmHHuHvyaMUvVBDxnYJ2Ah8yP1q/ETkP\n8+cwf8Ck00vdEJTHLYj60zTo3rAsGa9AzDud3tM1sFXHB6lIaTKGDbvkJDeN\nZutUOyBOWvGD7MqH0pjs5mfCuL6c1Hic9sgAmaSrRP6JnYowDvVTgbhsflNW\neuNz\r\n=oQkn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"707d98476bd26d0c852c5e9a837237269e0105d1","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.179","@balena/jellyfish-environment":"^2.3.12","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.16.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.9","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.9","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.207_1608385734487_0.7068616420538976","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.208-renovate-non-major-11b9c95e8fe994aafde6e25387cb60ad86a9d587":{"name":"@balena/jellyfish-metrics","version":"0.0.208-renovate-non-major-11b9c95e8fe994aafde6e25387cb60ad86a9d587","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.208-renovate-non-major-11b9c95e8fe994aafde6e25387cb60ad86a9d587","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e1c632da95b28f053180cf0cdc6497d1eec2a67f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.208-renovate-non-major-11b9c95e8fe994aafde6e25387cb60ad86a9d587.tgz","fileCount":17,"integrity":"sha512-QHQqRLrqqa4JCXyGMz1vzMfoCtNpsh0FfA4wmeenSU6ebtOz3nnD9vyw5EZQRSlSpR3hb9gInTmADFeSYQyjNw==","signatures":[{"sig":"MEQCIDQ3iFlvcvQVdjX8wZOd8ku9galKTssg+WouUhX2mnG7AiApm/hGAFCjfaS81LgJPHxyW3wFT8OV+VNW0vROTKb25A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94695,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf4L21CRA9TVsSAnZWagAASj8P/iPbFjt5xJp21HN2Htqn\n4Kcfta0Cpys3ttE2AJeGEULbrDkavNvbFPBXdyP/Ubdym8AmiAj18zT1xLEJ\ncwZqr1BQ+XLc/Gg1QtPAG+Eatz5K55hBv9JKczQOS9ly3gYL7nv7Zw+jSLk8\navZEIgHTXGcuH45mObz9SVXL6k6x1XW1/wdqqGtUxjdABuErSSzYs7Y3IuKI\nsCVJyqGc36VtVGYMa3xiSHDOYat05m0dmtmAtkILTLytpfobGSHmT65DbfjK\nvKckmp3v2NILHNPOvkznS30zTaSBbUbYDK2Ng4wuzm7LvTYXSsmC4pSG+rPY\n2pLQQ8Ff0lKdkEN0NFhk7XTf0tLGCVrsQNsVfhlBxDNm0MfpwVVlAQqr3a3v\naUN/rX7nDd7sfOs4CuGLrZsRn11eAsQaDILBkp8HsLPq0QojMAUhDuNMwx6v\n1Sf1hmXwN/Y1XdmYZMnLlZMQZJ0MVXNdTg4qjt+8EZKLLVKF5gp7mpCQdCUc\n+ACmIP8XklpwUNGWMt1f1F3/M5td/ovtoEhas5ngHqJLE/hfLu3EA8If97UN\nR0cDElTsUvs+D7hJPgX6amYwXHoZONmTKkvglLc3BhRjR3/6yYOINbhblCmv\nWR+x08dWsZh0FsFBrrjPno5U9WKwrxWASFIzuGAKqfqIoukJ63ZHb0fG78ON\n8sro\r\n=lE86\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"11b9c95e8fe994aafde6e25387cb60ad86a9d587","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.180","@balena/jellyfish-environment":"^2.3.12","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.16.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.9","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.9","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.208-renovate-non-major-11b9c95e8fe994aafde6e25387cb60ad86a9d587_1608564149091_0.82062204619281","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.208":{"name":"@balena/jellyfish-metrics","version":"0.0.208","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.208","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"dfac92eccc6ba2bf73cc224cc9244f0f53b405f1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.208.tgz","fileCount":17,"integrity":"sha512-s06uDO4oKlV5p/XmuGnenlWL0at5V5N2+cmGfvi/2AiIcIqjVULFXYc1mjG6EMCl8YnRi0N/yHrvzRcryDbIBA==","signatures":[{"sig":"MEYCIQCy+8178lO81REreJx8ftyJfhuhRVuC6niLQFPP3yWa1AIhAIiDmEBT/JT00GWfaZG73bc66oz3jujNSO1Ln+FbSL2V","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94635,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf4L5gCRA9TVsSAnZWagAAY5gP/R5YsfqwwJIuyH7de+qJ\niVbtiTnz9x7Gp+o8AbfGJQ+uEJ86COWMsl86JC954npnWAC2R/DWdMjuwQxS\nBQHZCxPp7V9u6X4pZkaUoyodSg3AULDcAjvdw18YCessC7mnOlMZIBmdHFkI\nzXDzhlFV+d28wpmAvbC5s+nkc7f7MYw5EqWndMsmYUFkHnq3tNPfrtEGf5r+\ncVr7Hs4zvYm7n+JXtTgVrEH/RXR7p2JiSGSDEeGmAsIDz2rI+WouMvGE4iUH\nDR/OxEAfWZ9vYyiOL3JoaoY2wSNR0f3RsEZrdGq3vNKmBb6xkr4RBFyCLcRO\npxtHymjuOu3w/ZoK4xRZR39CysjK7hgMZxfp9kXV9i2mTma53e/7jjvr3EIq\nNk8QY2oLMEvKlZGkdvJ2kaURDTbO0ZoB6BaR59hg/XBIyXBRIOJDM1I4ouF8\nb4oUr/hbkJE3cs3mDDsWpCPgeWb4CprULU1HRhm0868OVqVjIEZD96R7JJrX\n9Mb33XM8ZQcl9r/JYvkdVHAQXqX8kFPk3Qz10ToaC7il+dNo8CsDy0vXZzOe\nP9tnNeXrWzxyqVUXHkQI0U7chGlBdpdbcqOSmc72aDv62yZDdgCls/n3mwZg\nuvPhuj9UmfE1eWYCpyQb+8Q32EXogVAwG5vWPRhCJMKeqpiDFWY9Rz7BaYXc\nuiMh\r\n=/+JJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"e848a14f8902ee066af1d8ffbf088acbfab24ee8","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.180","@balena/jellyfish-environment":"^2.3.12","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.16.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.0.9","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.9","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.208_1608564319602_0.9051775767317651","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.209-renovate-non-major-0bd7508d43b3c7388cc3f7f4cf51017ce19fee34":{"name":"@balena/jellyfish-metrics","version":"0.0.209-renovate-non-major-0bd7508d43b3c7388cc3f7f4cf51017ce19fee34","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.209-renovate-non-major-0bd7508d43b3c7388cc3f7f4cf51017ce19fee34","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a7e56b23f9381abd3d14ffaedac4b168adcfa9da","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.209-renovate-non-major-0bd7508d43b3c7388cc3f7f4cf51017ce19fee34.tgz","fileCount":17,"integrity":"sha512-cH+ST25uY38MIeSeLG2giq9pEchar7qmGmLphJHBzFih3sHD0HU6ptNUBfq0OU2TUuIeeVvTQs21mTHaJPa6gg==","signatures":[{"sig":"MEUCICFrxSDFHia05LgfiYfVuaNsEa1WkdDddnGvUF4j3v4OAiEAgBJWjg08bYAR2SEGnBP/Ida2641nAPa6t1gEPXaDpPs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94765,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf4wL6CRA9TVsSAnZWagAAFdAP/1aKdMs/WAIqVMDqWjN/\n+Ad3ekPOAhqFWTXI2S5fIdyhaOhSHfGdBoDSXyKcY/RP/eC2Q/lfczZD4Te6\nIpBlX9DoBvzlvyR2M4rC7Tm/jufAuiBu4jWwpJyCYhlHZvFSV9NUY4/jt/z6\njz2u21k6hCcGYZaR/X+i0zvIydZFhjw4/k4/FHTHRYsHdw4PazPTjxhGfbIy\nA6G2H1XW/KZ1Ps06kXrhCPvnsFRyBPqqadP4eokLFxqI2yqcmjbA6aZbsEiw\nHe/eh+hf6kSQEflGKlOeEzONbHBQ3KCAEafAvmfz9+paojLMW+awBBbCLds6\njDUDfiwalJDIspT6TDyO9HqyxTmWAgU5uZHyl1dNZ54gptXEbPUr1SIoKWBd\n1nnZzei8NYnOrIgVGOYZuIegMXwX5pr3V9quBr29l8JC/T/TT63G4EAy4vue\nBhWTaecuXGZLHshDXKzW0luMWApRuR30Sur17+KHeWbnIxkbXs7b4wnKpKVq\nbIurKf3j/7K+dKqU6At5kW1WsNvwaMqkAr8NGM8WbVVnN1e7UF9TPccpNwe+\npdIpm/RMrNtyDfPLoE/iuaYLTvNMmnTJHntWnDX4IYAECtm8RxsxTmJTHCcc\n3ZbU5G/162UwGOXY6MZ/mIIAVV2eWmPzpmJb7dcbULFHNXRWi2SeKiL/iC0a\nJITm\r\n=MiXH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"0bd7508d43b3c7388cc3f7f4cf51017ce19fee34","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.181","@balena/jellyfish-environment":"^2.3.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.16.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.0","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.9","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.209-renovate-non-major-0bd7508d43b3c7388cc3f7f4cf51017ce19fee34_1608712954257_0.08602221082419725","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.209":{"name":"@balena/jellyfish-metrics","version":"0.0.209","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.209","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"60e41ea79fb2395a19dcd30097a8b67cf2d91585","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.209.tgz","fileCount":17,"integrity":"sha512-inKpSoX4/nXIWs5a3leLaZeJwUXLK/XA2NbNAwNCkehQrZWm/GcijqPcBz5AMSja1ZUgJLnEZmnjF4Jjdr7dgA==","signatures":[{"sig":"MEUCIEyuYDG2hvJGNK87I9ZJoGZjDdgoJLxfjA98RZh05R+GAiEA9JVoOHkfPZogHqgOYSETQ7zhHeSVuoLGMofEhMfpur0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94705,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf4wPCCRA9TVsSAnZWagAAZcwQAKACZ+9GkrG83mJoohJ5\nM+LEYg1IO5j7C+0kH6abrURtQxxMPh3tC0eDzhmBlEYoa3CBHnUULC7HLPOv\nBx9IkLMN/11Lse9uWjUa+lYdlYuWk2w21913PhrhjPxE+nwVmp/yR6lvTY33\nHrB/VlwH99HM4qg71OnTR0qREtl7fHoRRPbYvVi8lB+Nc+Z+u+Gf/BPosd8k\n7ogL9T1BftwMMqE1eyX4925LkoHmhIgJqr5NcbNZ+y/WpxEi4nQlSSLX1TDG\nvAE4xpnL1bl506BfcoukfFw4EShik8RGfwCLjmZW2lqCEDU2QB0OdtpiHWlT\nr3Zjkd6956WwZ75HbTeni0Xn18ojW6penp7aKb0CTKDTpAEOAOVi3VDDzAl1\nL733IvEo1m5aHH+wyz8/47SLok/XF5o2REgEcjhC2TNW4WKmRptPtw5HIU3S\nQnETsQgFH+JOtSjnUWRMOYA7fZaW3lgBZbKt+AelPUP/te3bINg7gjiVrbwg\n4IhI8mg0n+wH1rec3y2BxsWl1PANv35ES1S1nhbIotsUe6qII+ME/i+OGiFB\n4KiZsA4bnHxZHVFdEI4aQ14sb7WVJ5ZtnUp/xWes2MGQvc95I9jmcTGQbs7S\n7VCazGuQviQcTQ1mJd04jatNNa9x65h9m+01lrc4DdcbRmELrTfoazX5NGsL\nxGRw\r\n=1vVw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"6c729183b7c9e4f836ed9d01afb5aba317b9b0a1","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.181","@balena/jellyfish-environment":"^2.3.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.16.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.0","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.9","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.209_1608713153561_0.09492037750432902","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.210-renovate-non-major-c99db4975a3f6439118da4626fbe714c96245885":{"name":"@balena/jellyfish-metrics","version":"0.0.210-renovate-non-major-c99db4975a3f6439118da4626fbe714c96245885","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.210-renovate-non-major-c99db4975a3f6439118da4626fbe714c96245885","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"dc2248a90ce690f19b1605df3b2812e707d55f89","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.210-renovate-non-major-c99db4975a3f6439118da4626fbe714c96245885.tgz","fileCount":17,"integrity":"sha512-CzvXtklxpwfylZnNebpIFavDO4jY8//0XF1UlEMMSVjswrjy4LDz+e6/7xOhXKH5cvFVwfFPDBv4fhKjTBPkEQ==","signatures":[{"sig":"MEYCIQC+EMC4+y8J7wmazYNygM9S4zI3tLxAMHu//ZSSGpOy+AIhALbZccdmS7JkcRVlzDMU5p9yRWFg/wni0ZCFYd9HLzAE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94873,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf4yCpCRA9TVsSAnZWagAA6lYP/3bmhh93s8elAU6dUqeh\n93ZU7r//19cb9wHOdXagH/jkXpxfhNn2kzkqs9pUPSRCHKgBHX/dpZXQ7rW/\nyke02/efdH3oUghbfPvx1oX81o8/i3uWav9WLYMmSVLJsrzNYoHLz8RPVO5g\n12/PaghPsGZYuomg7dLkKZDQ2XoWHDiye+JurMQE3EhBgKQg+zse82LRTKwm\nh5xOEYV/li8FdVO511JJ6k6iqIDpe6A3OSpcQCst5d6NJqJ3yu6/I1GTlF6l\n+Mon5d89KkPLIeXLehunu2G4Od4a5nuF699FD9Sx46gnDX5qS4e/nIAE79km\nx4wB+JPxYjmwEsUX+R3bi44k2Y5R+5UQrElxNPlU+Vf0fOeNAFfwbWDZiRsI\noVfNPj45eMi3jkxx/PBxoVb8rFNHChdiZp67K1p4OQtS05HDxXg5sEfcoTom\neurdTb+fhvVFDKv0lm27yrkDEzqh48JgZ+rmUhkmIOw+9g+oE6smATTd/ULi\nwg7+3dYYz+Bh7gxJZagh8llBP37sS62RRpBLGs+Yh3VVp0xXTEXAqNF2Vi5y\nRqiYKTHH4iOMwFm9pfROVj/K+pc7DkLhDSClFzeRMYsMFYgaaUXMvUrE0LhH\n0gCYV4wlTq6eu/DbXd1T/2nOZKzKdIaBaF5avWKZk9PWB0lhhui26ZS7nYqT\nH5RK\r\n=c9bb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"c99db4975a3f6439118da4626fbe714c96245885","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.182","@balena/jellyfish-environment":"^2.3.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.16.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.0","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.9","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.210-renovate-non-major-c99db4975a3f6439118da4626fbe714c96245885_1608720553221_0.37488455862520054","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.210":{"name":"@balena/jellyfish-metrics","version":"0.0.210","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.210","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d2990a58f7fa903677a90c2d9faee36d30731167","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.210.tgz","fileCount":17,"integrity":"sha512-Jn4d/9qHGB9uy1io7zc9h16vZO8+jJvirpnnqNCri3uALq+0FDXfEACQFWYBmYjnnIYLVr4oig8MqHwwubI6eA==","signatures":[{"sig":"MEYCIQCNsGVQ1JmpzFHLoIsFlDGRDQVvwqqMZvGoXeFYtkLpTgIhAJahxYKAvHig4XNSgDfQkWCf158lzj2kQnEm26ALypbm","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94813,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf4yF/CRA9TVsSAnZWagAAMnQP/jJes0dthsiyAksxkRGU\nAaqhiiBq8B2fr/6QedALvPileveU4si0tRrUOpLnkJYEMs9UkiAf8VGg7tKX\nnecT9HLOUU5LATwOAUCVMPevwePBR44zviIioA0jJbCNu4j5sghNdX37O0as\nI/3VKvDfQeZ0Lfhfte54JFBJuHfbxQlMoiAvTsGGpf1venM4JzneoIl15NDx\neFMNQgQtAhrFWcX+fre5KGjdJGUZAoxZhlwe84iBtr+RGtZ6TVyQLFBR+8+0\nSTWH6iCxosZy3Icd8R1x8wgYe8UebjrTnDa/XfY+7SM6MVjv0BsVdB4pzYHP\nE0kj+I8rQPDXo3R1QJtxJOm2fz0dAx3glKBbggPl8baLJlSkhHqbIbgdE/qB\nZB2n9X/WmMhVAlgSeLzPOv+Lgha119nQ+WCCEW5SLlev0TC6A59/5abpq8Eo\nPFIHTa/p2stSFsO0FLrpKkEpT6Rlf5ooKDoNWFtBEwD64EgJEX0mx4ykBHkZ\nu+MjxQbi3EV0yfaltkBNseyWWE11kCITWz5w6j6iDVro+YeNBfw58E4JwLTP\nNapnqgR5UF50fi6GIfYicqZxguUNALW0JneRgCJwLOoIMNggPV5kLQ58FLNI\nqRSbWeyuDYLiswX2uv/z94XaebnUGBUjhmR5FPmoC0LiqNU6eLXIEfU6pHrk\nRItd\r\n=dZmq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"a136fd05c0f5afd6a845556205af20186de83699","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.182","@balena/jellyfish-environment":"^2.3.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.16.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.0","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.9","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.210_1608720767210_0.8488653310830683","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.211-renovate-non-major-99185a737dbf7b5e92088ef1dd78a69e9eb6322f":{"name":"@balena/jellyfish-metrics","version":"0.0.211-renovate-non-major-99185a737dbf7b5e92088ef1dd78a69e9eb6322f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.211-renovate-non-major-99185a737dbf7b5e92088ef1dd78a69e9eb6322f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d5489b1acaf51429dced47ed135a3be1debd0309","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.211-renovate-non-major-99185a737dbf7b5e92088ef1dd78a69e9eb6322f.tgz","fileCount":17,"integrity":"sha512-mwwMQjENGJuShnpALTqCk5NnJH6ClyCcOej5cZ7LfrU+oe4grvTKSewobEKGgJk6EUL0cc0RD/RyJBRjhRi4Fw==","signatures":[{"sig":"MEUCIQCoASqrSuh7auorlD5DlTusZIg5NCCySUyf1UdJsFX2gAIgLlzuNkFJ8WpXrvLimG8AhO5+IZ+kdH7BwxQhiuwqnUo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94981,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf5/qHCRA9TVsSAnZWagAAiKIP/iBDFA75JaEd/pW1CyV1\nVBRIs4mPSNv8CKfQOUIkFYRRG21B24P78mfbTIQ34/ILXpdDJww7MTFFVYq1\nR5wUjDkwOXTa3YqD3+CLZ8CbMVr9ofJJwX8lfJ/Tj7FtB17sOEIcFGbvKOAi\n9KoFyfAeZ8STiT+sF8aq4PgPX6BnZx5yJn7viw7EH1TGBE0qT/REuvxFArdP\nKnwB8uFmWjca4qnS6hIvzrt93upLItK22mDB9w0ExI2wBkpoSjVDmNRAhy4r\nT1LHlceZMLeOhSQqmQa3DRYW51bBvzB/0ORCTr6Torwua9/KACpIOb+ROoTN\nLFpeW8TV3KHBY58OpDKMLVBdjnFZCfocZ77ei8CInr+oyZW7nC48hwKTh0fs\nGwRjNx/8gdBZ9TGuT/lPJpPdk4UVANpjc6MLi1m9JB6l13CsM0FDEHEFYVgp\nWNO9xBQRNsOaNWq//Ue/qu9JkOfAnP00JuXkJP/chO8rZJXR0B2wte3ThwVs\nHKDOyOSMzuw3w13fsYBSsCz7DmUCOmXLntpklpNar4ud7NMn1CQE4xgOJw/y\nvPRedoyQntJPMXWLXB7iP9ISrXf3iMd9VDJdDZtoV9s7TaWA06KPt1Cq+NvJ\neJp98KwuOKPATrEzRhgC3e79pvIah5pxU+ppQGFFaG4uii1wWDMBUQcAmSjR\n4miD\r\n=L96R\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"99185a737dbf7b5e92088ef1dd78a69e9eb6322f","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.183","@balena/jellyfish-environment":"^2.3.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.16.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.0","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.9","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.211-renovate-non-major-99185a737dbf7b5e92088ef1dd78a69e9eb6322f_1609038470641_0.5295015496433131","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.211":{"name":"@balena/jellyfish-metrics","version":"0.0.211","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.211","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e55f7f2a7034d2058f9c2ad4b20b118d2f03e137","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.211.tgz","fileCount":17,"integrity":"sha512-H4+KMt/G5YQMGvmWBeI47R4VqSKxUhBOBoMjeBijr5kmAs3Ycn19tHOO/gRrWdETJZDdj32zfePPmjz+UPvhvg==","signatures":[{"sig":"MEUCIQDVViqk8gTBNqWB5hywwTd2Su8DstgH4vl7JmQv9K5yKAIgLUfYxTdf7MSdxjnk9A0XmGikg5xRKsiOpnsdcmol9mM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94921,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf5/tjCRA9TVsSAnZWagAAa7MP/ipYhp9eDzfRhDxTyYmE\nybQViUgS/NdeYvuTlQSY8dYAtdIHiszANe2cCoo+0pn19AFn67JAUDVCgpad\nRsUJrX7rv47h+/S5tgRrRviMFxajzEV/waiakuWtzVsxRUqDe463vgRGSkAV\nkSW5t9gWLA7p20j01aBv17R6wAmS4J0RbvTp2Dbc9ZCRdTAFvnXtg8OB/c16\nYisIhkl3X6VVXTowuHxTBmB8zkmBceWxrzxPVr0Y08GubYHCCDPQXtRneRAA\nNcalSc5vuN1tqROuv1fC3G2xRWp7eKFBxZce3OGoPHjH6rYTqUo59gElDPhl\n2dEwJOwDvA2hzTeCEEEkxu6dQlRepw+w6/9DzFMNi5dhy6Y86myuyUbeLK1H\nIqAMTVWpqC/xLPbjQeE6Vc4Bp+zzPcQ3E0x/vlM9zc9fLGQwBe5xMquaSpHf\nm6sMVoHwkcspsX9CCYpnIRcO45oIqTrTRGothCH1Tg+yCEngv6r51+WgN9n0\nwCwvteg7rXjc3lY5yWj8/GyLJwlcmi6sFLpYLACPfXlFl/5gcE5a0DRc4gHw\n6A/mZGnULKuSzRHjhh9N8rEsenRpFAskC5gZOj+dHIpnnZ0/t2VQDXwcLQAU\nyzjrEmI9/m/v8UaDi+vCgZ3kWbliirbKqaUmXIIg8E09rKXcmVH4lmkE/bPE\n6nlq\r\n=EJYB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"b679447c87d8b3808bf678280c828f61dcbdb773","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.183","@balena/jellyfish-environment":"^2.3.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.16.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.0","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.9","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.211_1609038691152_0.48219818549664617","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.212-renovate-non-major-4fa14f36274a66113cf298e4cc26e225efd969de":{"name":"@balena/jellyfish-metrics","version":"0.0.212-renovate-non-major-4fa14f36274a66113cf298e4cc26e225efd969de","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.212-renovate-non-major-4fa14f36274a66113cf298e4cc26e225efd969de","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"29aa51a9f9a6629358bddf85a60c8da1938fbf5e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.212-renovate-non-major-4fa14f36274a66113cf298e4cc26e225efd969de.tgz","fileCount":17,"integrity":"sha512-kbDK3Heb9pai0lVjFONIJdjkOFyF72y94nEpsFdG/VlnbZrEQHMmpFka/3yMcJ8y7tu75UrSTP+/8XF+3NLxaw==","signatures":[{"sig":"MEUCIQDPCqtS1ShQG41/X43QIsi9vMyjjGAvGpnsYyItqY7lEAIgCCbksbv+/8c7WAy81TH73CTxO6q24izIi3DW2uuTaGE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95089,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf7CZmCRA9TVsSAnZWagAAN3kP/A91pgF2/fdEtKoCPoDq\nMXHh3mxGyKzsHzn8JhuZ2Jaj7dxGH+rEGHxZAu1W5R+cq1mWMNyFpxdhBP2q\nd7zoO5tHZNJcn4nyRWrO/ulM4fSl4MyjPX2bEOyBcAnXW+0ISdh/PwfiHSSz\ndE4VM+5dzQWafrnHZFx790w6HuJ8L8pLfPFH2wF9hHq+89qPUjWlFW5dLrwL\naUuzAM6h3bBhimGAsMjfCVf8SVRoteO2YBFkAaUr35VoIyPBVFx2Ow1z6XOu\nQ2A3yyxxtIn3W+WJRM7cGsodOZii6r/JzGyiX51ZyPTCqb/Gbv+pp8xWThx0\nQNkzAS2Dpi3licNl2cveWI/vLnznFVUhKOqmqHB+DsuZLuZH5e0eddy3DKQL\nJxIwsj4EzZHTMWT6h4UVEkjFEAMRWAXK42cAW8dPt7FI52PJua9tqbSDy/A0\neTIzUNllU2S0OZMpcX6uODsxj56TjZf0YATP1fTHbFp2agKzUBa3YEVoaPON\nrteAyTg5IQhBhJWoDdN8bs1HZ5GJTmTTjOkx/zOXN5uHgH4DdnSvUEPz/ZIk\neGwDXtQX6o614c+UJl19uzN4Pg5EQQrjIB6i3S+OtIF9WAiJEDrjaJ1zxx4r\nSH6TC1vNLXpvEHENpPjrjnusUK1IE+g62HaNSQDskdUc8CH+2c22LqedcnCu\nS+Ii\r\n=vzBM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"4fa14f36274a66113cf298e4cc26e225efd969de","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.184","@balena/jellyfish-environment":"^2.3.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.16.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.0","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.9","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.212-renovate-non-major-4fa14f36274a66113cf298e4cc26e225efd969de_1609311846074_0.9378997107963842","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.212":{"name":"@balena/jellyfish-metrics","version":"0.0.212","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.212","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3c0385c23e1af016c832b7df17686dd324c374c6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.212.tgz","fileCount":17,"integrity":"sha512-stgC4agbgBl82JEf3gFanWsqwuz2Mb7Ad8Xqzwd8LR3yQo0k/DeWItlXS5yABq35nAgMnogrllAuEAQe83pa4A==","signatures":[{"sig":"MEUCIQCiRNHOCEwYdZnIrwH0o+iKUmt9te9ZGru4O1ueJYzXOwIgHljpjcJIBlTSs3JcKmi14dhNoVKCK3NXUiv9tqqPrxw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95029,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf7CcqCRA9TVsSAnZWagAAbsYQAIjMnIJaT+wEzUI9/e/G\n7T+0S/pKjHYGRUsJBaFLuZYrvgJuPIIoHTHBtP5PAFoPi3OGS0h17lBKVthV\nzhvLL9OW+hvVOBMrYwksqczSq5SQr219cLXDb99KakJnKpJd/oPQt4eRdPu+\nov8YXdJBCHs4pbJTOavpk4jNjDJZyStS38eFzHxHeW7Fulv2p7AMrbQRmNIv\ne0zoWWPBehN347EhA6xsR1eldxw3YfherqiimAvP+aYbKPiK6t+4jH8nisnl\n/t8FyzvbuTEwBALT08RtGw99Qqk2zMvH9AMt13foWnBUHkt4r1XcpHN1B0Z+\n5ppatNS55tIjEQc4XzslwOYilPt9SKKSyKVDw69U1PUmMHwt5fCtGKIjIuTN\n14zygM3nV3iqg6MllmdQ/g6/OfHqaH4wDlOxwesL0PeHH/Pa5S84+ufr81F5\nG9l7VuerzKeGuY05N3GaOWSjRRhhe3/UHjoOlo1QgkMNQmhzWU0BMDTeD2mn\nlMJkGnsoGodBLrw3e4lLw8Jzfb2Bq4aKNeJXpGSLEMhvUF+Vhc3ezMEN2VD+\nzJvkAb8qhi2kgEotXiJtYTRdEm1NXhVlE9IL47qdYhXL7aq03kKOhbtfx2U8\ndi6UPSBMnXGf2hSddtnfgu4eLp5+DK0Cv64Jf4BA0tS4siftcqPa5SJCAWTO\n88gz\r\n=WOPd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"cdc6e758118e0352d83cc463ec293f2fc85c442b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.184","@balena/jellyfish-environment":"^2.3.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.16.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.0","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.9","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.212_1609312041878_0.1298863394161438","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.213-renovate-non-major-bd4ab7ca1e6b830b86618daf64fe0e81c5d1c9ba":{"name":"@balena/jellyfish-metrics","version":"0.0.213-renovate-non-major-bd4ab7ca1e6b830b86618daf64fe0e81c5d1c9ba","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.213-renovate-non-major-bd4ab7ca1e6b830b86618daf64fe0e81c5d1c9ba","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8689907747a1b50d2c60883b37ea0ad51165025c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.213-renovate-non-major-bd4ab7ca1e6b830b86618daf64fe0e81c5d1c9ba.tgz","fileCount":17,"integrity":"sha512-Iu+4zqyhp9BVAgnVRL/FHkolHVhrxZBm3Ulnd/Urts2fjB9gCFwQCVOrUQJZZ5N5U410eT1kblKTupQ8p+UTqQ==","signatures":[{"sig":"MEYCIQC2pHBDBVQrxlVeQt+A/1lh8ZI9/X8dTrZzcH69JoijHAIhALLRjZQKjTOhS1mcl/SKP+Ing63Dbtfb4xwSGwamSuWQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95197,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf7NfpCRA9TVsSAnZWagAALMoP/0VLnuT2xRp1V3g9L1qy\nZY8GL/fztWmvADH/GtAUddaJicUhGU5JswYYcZvKUHO46Uz05Pctf2TWO5Ye\nlYrMn8ECIbSCciBnXYGdqrrbzkotqmjdZ6ZtWg34ZzuEtmwrW7Qkltk2eqyz\nW/U5wCXM5cTo9UwSWni+Hg9dsz3R1YUhd0L1TH6qT7n2VH8NQ+gDjaijPMwX\n76wkXRkYaNPjsJr/MiQdHeRhhrzJeLyGeUiJ2hRqW3X+uU1BoMfkDHOphtOV\nOhac8t/+jsigumzVV5cm0WI6YeRMDWRfdsntbxOdmDibYN9M9uOQADrnKBGx\nGRaEdnzVIiubseKZXMApXAcMyY464kpBgrUnZpq+Td0GFvfpYHU4ysDSJB43\nb5n/+VEnhpHq3hHoiJAMHLHa61o1swlLNrq5/d1NjcUuR4wxpRGia1BoQG/Y\na856/T4NMtHWCCnQWqdXQQ66uIhZk5YlPYgTX+FHfoe+NGjHJh2zz1UllYvT\nOR0zZaMuiAlGoRPhLEtOXSI9sM7hcB7S67DyessCGelsiuyyiXdkwMs5b0jl\nhxnbmDsPntFemylS7kz7O11pzYPkUcZkU24wXLC3b72esq47J80cq/v0LeAW\nEkeh7dOWOo9bAgTvvG2tEIL4I8v7S6LUAMLUh+YvshMjLWhVHoJeJbujrORp\n+My0\r\n=2YqJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"bd4ab7ca1e6b830b86618daf64fe0e81c5d1c9ba","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.185","@balena/jellyfish-environment":"^2.3.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.16.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.0","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.9","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.213-renovate-non-major-bd4ab7ca1e6b830b86618daf64fe0e81c5d1c9ba_1609357288607_0.9014701646500252","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.213":{"name":"@balena/jellyfish-metrics","version":"0.0.213","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.213","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b325e8b1957cd298a22e40db6507bc7729d514c3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.213.tgz","fileCount":17,"integrity":"sha512-77Xnqk4TG59BoWDJPMXdcHX/DxMofwGgbPonj4Now/hW3Um5s0lcupSFCoeQmgGyLj/bsGgVBFgK9dgmNwYq+w==","signatures":[{"sig":"MEUCICT0jU3aS/5iYn/5+jSK94FvcUnt9rxw+BGWiVCGk/R5AiEA8w05P409XXt8ASAa256NJBpv1PNix4mc7iiBw8niYsY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95137,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf7NktCRA9TVsSAnZWagAAGCgP/1s6iR8O4qzOV1NOUwMN\nC84rVtBEVj0+gTqLNQqt1B2FFCc6Hiae4rvYjgQ5LlH47p0I/kQpH5u0UtQT\neN9OeKsaLwrOEB0a1x/+PqXu4aNI0JlBZ64eTm4BjuizDDzgSIqAW8V4tRJQ\namAMbCLwmOd4BU2+PntgsOFHAvYkqrYUBc7gpuLJmAEkpbHOCtmMX6b7wxt8\nyuGiCNV9zxbTNfBatxePaw1tIRxrdekxDnIXpDvCU00d3tBB+a+7t3GwhYsu\nfXMtK03nqhOKeGU5XVO0CsoaSqDkdLzYHmbBl8/EE+PeX4gOVcSPhaHnSkgQ\n0fsCosMsLP/qe0zU51Klbhs3fARVwLyOx0r8+cKttOkN3RDrCGF4hcgorCop\nEHZrMrBgXTkM63pwRwngpqNCfrfNiANzw7iwwce4wrIcwAT0LsigQqE5448g\nCkgqiZF8the9/nfJ1HocXiksqtTwdmtES3CdFw/KzseXs9cSM2XVGYSUjH6e\n0LvTNbdbHSOmh7wJyWDYBH2jlPMJ1B+w7B4QhIx+jvmrLQd65PqK5CGxulZN\npDkr/ffzsxLZ3xRJH0+MWYx3FxdvVANpt3WrGAgxGsbJTYXOJ0MREjHkCxqq\noutvJx5oR9jjqrl4X54qxxP1VIXEFNMc8DaR9az1XYEZmTKuu6kNdN1L43ru\nWY54\r\n=tzRI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"59f11ddcf8535d72d6345f926ee255519d79ec51","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.185","@balena/jellyfish-environment":"^2.3.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.14.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.16.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.0","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.9","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.213_1609357612835_0.5880657011550274","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.214-renovate-non-major-de778d90b1d70ad54fa9b1cea56200a84980e98a":{"name":"@balena/jellyfish-metrics","version":"0.0.214-renovate-non-major-de778d90b1d70ad54fa9b1cea56200a84980e98a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.214-renovate-non-major-de778d90b1d70ad54fa9b1cea56200a84980e98a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cb8b87f0a19935630b133d4876ff94e177f5d0c0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.214-renovate-non-major-de778d90b1d70ad54fa9b1cea56200a84980e98a.tgz","fileCount":17,"integrity":"sha512-8SuEaBzbYJu55GWtYpFWrjAQlwgo16xTQzigNRQ0sOkjHWrXsRHDttf52IBVEjJc3qFgI8Jgmaiz/uGz9iu5gA==","signatures":[{"sig":"MEUCIEjDE5xQEyZmYFI9a4TFQMQl+fd1MEW3by2JiDcJAxIfAiEA+PZFguQw3Ffo56d8o0soG+LbY+SjZu+YYXVSMEtoKgA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95267,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf71ZhCRA9TVsSAnZWagAAGfoP/iTnr2BVC26eoXpCsl8P\n1DqoBOR3Xd7sOahGZOhMHfm4EmUnJVTxfpCAX7CB0zDZWCTorrQxdNz+DeUV\nW+tfAD46u+8uZuugp6rEHvgn7gKNkkZauH1yW2DpI++VmaugqlNI1BwTcAWP\nwJk4zymLHdpJmqQw629rFoCnzxstvyaAa7aX4FFBje3RWULfV9sprpjHFFyn\nIyMiuF7TGNvZFa1V4HKGoF4pkaHGvvn2YJeF2yNvrf+5N7vVogDMdiVoVr4W\njBnxtZ+ryRslAjRmaFvAx3M9VuTtay3a9fbTmQerh2KybXhYRRhUVvRf42kb\nP/WkV6w0ZsVZfhHCc3HGoIwnyrSc2cFBGH5VTTNRL/zq1xV6hwBtpCZ2Q/a3\nyClGWb1A4U8GBFi0JRgDkw7Ffoi2tOdxJmT+RD5zYfMD/u82SeKuazSAazAA\nybbbNTh1Z7bVbOrbnB0jidzZxM6jfz0air7vw64QeH8f/lC0KLO3ZbJeDrw1\naxBVTbS9xBmOZtxOJytiPmd0CQurpjYG9Dgf2AbdzbkB+yz1XLwm05iyLBjN\nxniV7kWFN3eR3RNINQDq1I/js+z3Sq9pOgsytTNLACsMnztvkb48STbKlZ0e\nKTtguSxV+bK7sq3SlTR54U5MI7pBYMy7siUor6imPz2p0uZ7Q2FBGKoYRYQc\n+6pa\r\n=iqMN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"de778d90b1d70ad54fa9b1cea56200a84980e98a","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.186","@balena/jellyfish-environment":"^2.3.14","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.16.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.0","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.9","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.214-renovate-non-major-de778d90b1d70ad54fa9b1cea56200a84980e98a_1609520736644_0.06294655581894948","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.214":{"name":"@balena/jellyfish-metrics","version":"0.0.214","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.214","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3d96be8bcb2b3f003a3598ee269597fd12e5b74d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.214.tgz","fileCount":17,"integrity":"sha512-pfsnFx3tecKwo4drrvuFSHufuJU6ghN4hBVfgBngyaxa9M9JYN7RcRn7O6w0aeCbLCKWenepb0ymM6khAI/pjA==","signatures":[{"sig":"MEQCIBrFmUk3Y6x3E77W+220Rg0iz/btXOPdJ5GuWLCUMkaFAiBHvURAIQCFwonT0pZyKIKUX+Sl2aQaTkh5x8OlEnQPqw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95207,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf71eaCRA9TVsSAnZWagAAtNIP+wYUTqoRo6ajndqwcdd8\nvuZ0Ua9o8LmVL60KqtfXjLeSehbD9HJjsAEcfn0A0wcVcRTs1Io8HwRrjALs\nXslSShJ2Tjuxo9e3lfsLc5zvZ+63vgIUya198J4988dhMb1ZA5PzurhMTddW\nwHPM2Mu2TM/raeQ9igg9RwipaWKQgwJTy03JYE0aDFIYmdRR+5iWbXYWKNPb\npeLOm3CVzZ27H3HSVgU9RNOvGeBZyXY0JI1fX7WwZTe2DZF2glcbE15EOuKG\n1P0Bl/pu3Sf+/K2RYuZr/gBNgDqP6eb1HJ6m+tYXaVfZUMujffZzUgNDGtN8\nyj2fIyBCZ8JRsn8c7SEUjgTMTtPeSAuQxYgKmgVIY30m+co0l7GDASQ1Gh2V\nx+uncloztDe9iz0t+ei04+Z0wyG4fwyvZXC5U7YFXGfEu7LPqwltFunLoh6L\nwrvpcmZ3G66aE2STPNPXN1iNwek0S9xjiMsBgNcntRVXB+U93/tAczxuys7e\n/t2iClICpZ9nN8cbAq2OR4+/6VrlzmlKfeJuKkdYdPc0TsTecvOwFwER01jr\nBEztyyYlCjGzLX+YMDSmVYxNk7Q3rpQNmY8NkVOzzju6fG8ih/PooB5Tj864\n7R71kloUMDOGoz1dNgP7NfgaZHDfunFRItPtypYqmCa39qi/Y+Ehnwrox4A4\nl8I1\r\n=CF/Y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"45f78f5cd01e5a9c7c71f7c6f0a7d64571178bc8","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.186","@balena/jellyfish-environment":"^2.3.14","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.16.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.0","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.9","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.214_1609521049612_0.599799594843619","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.215-renovate-non-major-5b02ed05455855ecbddf488291d7136c132ebb2d":{"name":"@balena/jellyfish-metrics","version":"0.0.215-renovate-non-major-5b02ed05455855ecbddf488291d7136c132ebb2d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.215-renovate-non-major-5b02ed05455855ecbddf488291d7136c132ebb2d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cea65e58d900f5b100c74fa7a523964063fbceda","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.215-renovate-non-major-5b02ed05455855ecbddf488291d7136c132ebb2d.tgz","fileCount":17,"integrity":"sha512-mWFqm5ENHKb/EOX5Oy6wfzSQBxldvO7v4FbrLQxh2dpqAV4SA1pBu70whgGOLNKtd8BD/60VdDGg38n72NqPnQ==","signatures":[{"sig":"MEQCIDE5vGCDhf6oTEOW5PVeizVKdjoONX9fR9i65HZbVgr1AiBX0DThrq4fZG6zltegRjRXDveYjZar7rAl/IhNFAYORQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95338,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf8v8HCRA9TVsSAnZWagAABZwP/3h++ufP6/m+8mEtPzKa\nBoIzrEXZ7dx6W1n9IAhF8iNoB5gLMr3uMcnx6akP+pbEGZoL09bHKq2CmLq0\nRMqwAS32Ba85e8W+D+XdY5Gjxf4Sm2k+ZzySbbj3PoZ3ChKEsBaUcnAEBLlE\n/Ob2pneuZ8YfaqmDhACG1t8/LAi98VEbJFitk/lCesioXuMLpkzEGoIzDomV\niW9rYLp0aJj854rGe517vxC6VuGGuECAbolOUlWUPOWVpIju4mWz0tkwB2p9\nsIwIEq1JwWZpT9hiU8HMH9t0TxC50qBhYmq5KaoU8gmot4inobFvCoCgQ8nl\nWNzmC5qBNWupK/W/nCUsmnpETf5uO3CdPmfF1hWjL/HbZ75g68zQUi7YXXC8\nIo4YPgIjnWw5SDRYF5Kw3RV0nMGf13QQwjC2aGyJSmTHtz+xv6FFp1aB9fjE\n8wk5E9nqRCZt/W2k17gdnC1kuDHdMImEPwCRnUiUX+rPZ+pfk4uMT8H8pP0V\nfadOnKebIv18Spi2yRh7SZn6ulPuBc+t8M41tUoKim9HLh0tuztGXAMgsrrm\nYHTRhaVInxEw16AQtbtI+c1LWqrWEldtNvbR83yyQclXhIFhFWMWxXZ3/z0c\nxprIPuzfFnHHG3zdSF5tNC0l/GIEmegjPOKDp3Q8K/91ptTWaHlCv3kLw1Ao\npjVW\r\n=OIj6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"5b02ed05455855ecbddf488291d7136c132ebb2d","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.186","@balena/jellyfish-environment":"^2.3.15","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.0","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.13","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.215-renovate-non-major-5b02ed05455855ecbddf488291d7136c132ebb2d_1609760519008_0.4759021617172856","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.215":{"name":"@balena/jellyfish-metrics","version":"0.0.215","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.215","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0c7425a7755aa64b779215e01802c32ad2ed811c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.215.tgz","fileCount":17,"integrity":"sha512-SpjFeumULUsmiqa+YUFTaZYyPJxARGdXBIY/KQe2xkEI8653rpWAZXyMicSoiGFu67KiJTwSw4JKRLcoh7yivA==","signatures":[{"sig":"MEUCIBoGX3axcGqFOs2DwnUukimxdxaGYMScH5De221BIZxNAiEAl6Yyz93ore7IpVj820qydpR+fkbVxAZf/4xHZRHupWI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95278,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf8v+xCRA9TVsSAnZWagAAqAEP+wX6nCFNoObswwibpfF7\nIkYtUWA8h0P449bk7WDRtFVO2bZAVk8cBFT62Mnv9+x3YSv7fnBPWzrWV9j8\n5DhT0EwAF/5LghG1L2RX76PGohOLxTkRjvKs17SA/4s0aWyZXjHx3kHqNRnJ\nQ4fwi6Q0ZnfJA7r8i1F2KITPku2+fBZ7VcDSwgMlr+g7O1g43sxCZ9z+SS6l\nS1TfPCy+sizp//VS2WAXxyK4A7/VyzQJPvLauJtP8cd2BiE2Vybi19EkFM47\nabktsiSCIDgVrK79CP3Kz3RCCRAOo7kbfdnB9YIZwpjFL+tXhYDp3s4JYvkl\nBb+fVTxp1U65Dz9gH0Gih0J/LjcBMfvNGojFInImGeEyhAkRJV4uWZ/8Ddwe\n13Zlx7omv5MLnwQHEKzHUCyJgVXA0hg4HqNuH+JuK6Hy9WUwe9SsOWuWVSFX\n1rxlyRS4J8cVylsLa78FFL65bvXZENzmPKRfFyEqVrbofNZXMzndqr4up16t\n8ZJFvgD9n+hVeY90Rb9XA0WyUlrYYjbilLWno9l6FhQbnkJ0UTnAaxDQcmaa\n5/3CyieUGQdIwe502W0w8lZLKsqpeNZWYry8NiyRompWFKAeXyqb9NZ2KZPP\nYrbVkXGuA4y9oBnX/ZLiwuw9HOpueVNcV6Ezf/Cy1PjpZl2BqFQ7NE76lzoZ\ninUo\r\n=2BQI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"27a53483125f4a66e592ecdeed1b2d76068298a3","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.186","@balena/jellyfish-environment":"^2.3.15","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.0","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.13","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.215_1609760689417_0.9869027798387457","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.216-renovate-non-major-8ebcdb9eb52c6222a27240c106a6398eef06d2eb":{"name":"@balena/jellyfish-metrics","version":"0.0.216-renovate-non-major-8ebcdb9eb52c6222a27240c106a6398eef06d2eb","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.216-renovate-non-major-8ebcdb9eb52c6222a27240c106a6398eef06d2eb","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7d5076898cbf76b2af70bdb3e82141c2f76017fc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.216-renovate-non-major-8ebcdb9eb52c6222a27240c106a6398eef06d2eb.tgz","fileCount":17,"integrity":"sha512-cPi9OlQ5JY5+JSqjRMnR10vS9L6+zp+P+IWQKQOYGVG7WNYJyVadq/2m0cWHDwK8LJWsv135SwOw0T3vNrjlCw==","signatures":[{"sig":"MEUCIBol0Nc2LCgLF+em/bHhnSpE5hERuPty6Xa2ySjnvz+TAiEAjEGTunOQwrIJYKK5IUFNfgs57q7bJbwX6e3ykxyG7Gg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95446,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf8xAZCRA9TVsSAnZWagAA8HgQAKK/kEBGe+oCvciO2sxS\nYkC219Rk/K/pRalBE25IxrM2UkmKEOkybp8paLuHxuYMRdwHWBCS5s/F8Qq0\nRG5U0wgrWKCT42POssIzJIs9qUEGhD41Men/+4fy5Ewkzy1qYn2Txyg755hY\nqpg+8MffshLVZrxfXMMtiS+aEAh16CQQ+BMATj9YhZa8NBHGQ0r3VRmhs49y\nvybHyYld/zqiqm44kHGxGewPBfKtlnOxb7WeiUDRDssLOiSWw+QcjuIjaKLu\nXs8XAlFLmK+wvKC5Xg0xlwF6TXWeKiIf71rqUVdr42eyupImaIArl3yH6bqQ\nvXVlg468VSR90T0WwPv+uYxuCr/tTzIpfUnFwO5+NnJXypZr52A0eOAFrKJ+\nCviFzK23039N2lfs4xf2lE1+FszRDbYdsA1wk2rvSpG0M+008nDn4LcV3Wpa\n74d8o5t74FShbwbtGDz4vOocSSX1GzKIwDl7+1t0AXEgFs15yVxn382AEtPp\nqUF8eHAPBX+1H5ZmpxdK8m8capNbDtZmbVccxrWVQWJBIewXXr8TOtHvPvOx\nJGJ4WgmI63cT2E6mRDZu+nRTVhhQKGgokJ2FC6TjG6U6zLRIW7EeRnXfex1z\nHYJ1M/OYbQoCiBWMIxtI+I06s/1yUPKZAqV5Xl6qTEhuOYL5CQCFojVpQewM\nU2D0\r\n=yHrn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"8ebcdb9eb52c6222a27240c106a6398eef06d2eb","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.187","@balena/jellyfish-environment":"^2.3.15","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.0","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.13","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.216-renovate-non-major-8ebcdb9eb52c6222a27240c106a6398eef06d2eb_1609764889211_0.6104808573174278","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.216":{"name":"@balena/jellyfish-metrics","version":"0.0.216","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.216","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"eee48f8fb949562cbb941390c6af77ed5952ebeb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.216.tgz","fileCount":17,"integrity":"sha512-xZxANYeld+5DZOCfg+8I7hHlrD8XZkmrrZndrBN+bDoF4dgTLqV8+9kLtjMrdaHCSmIg4VsAYTk2tNGhn9VtDw==","signatures":[{"sig":"MEUCIECU6QMA0186U9sRwB2LBuSMjF40lGl9x6Iub6KIHEqVAiEAgOWDZZC0436BEsip0IgATW+hrLLmYHbm7++Wgrtbfzk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95386,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf8xDdCRA9TVsSAnZWagAAVrQQAIX3ABryfseS7ZEpP8JO\ngRy9H3r2he+pIazBm9yIstX9ud9RFbbErWGysH3GpSMWIVQd3MHGrSNcp2ld\n8JGx9mYwb3XksOrxUnQ5pu1ElxXnMHYapXfaAUzBtncUrBAxdztcq9qtmwMz\ngbWHnfRa0+yP5q60Jft6iHUKdKR5L2A0/+zABtg0yZWohDSO2enG1r7/oimH\notFYdd/sebYg20KCgPuVGWZ4Kyh8qcCArNb/0npXfDlE/+i8o54Qfbc308wk\nd8q2SuW8vIiLiV0wDf4Br+/8wrYC0GQpvXq8a4ZIOLyq66OgZXysmisyif3c\nAD4xnRKHcRc14q3ly/agkvzpul2nSG2aFsx2DNkFLtU/f9l93QZ3oiYcXCCk\nxS+nm8Z6MBDMTvUU/vHl4s1khi5eb6rHkSMH/YSsZkXRgM4sfZaktlgcqvCE\nKvB8zlqW4HZ/giH1psNQMa90Ablpkx61QzR1FtugDRqv65IaT5reyFOYKFU8\nAJ58l7dUhiVYcSEguImm4BmeCS8F+oMcDExDoWcXn05GHsQ/JHHfciZGf/qF\ndzogGHHHHNfkPwjqdcJcI/OIiEr1UsPSt4lNQbxpx9J02Gotj41bOLRA87CE\nPZBYwI+Md1zw+HIVmPR1aaQNZQoQQ2A7tt6PeRL+SXC9AQS99pocvBIIEnUP\n7OOi\r\n=J1if\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"c5df850c990e45dfeedcb4ded8f30f0557d7901f","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.187","@balena/jellyfish-environment":"^2.3.15","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.0","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.13","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.216_1609765085105_0.9904750296512717","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.217-renovate-non-major-31cd1cd5c0640e44f710990952e49a905c820b49":{"name":"@balena/jellyfish-metrics","version":"0.0.217-renovate-non-major-31cd1cd5c0640e44f710990952e49a905c820b49","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.217-renovate-non-major-31cd1cd5c0640e44f710990952e49a905c820b49","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b391ac0801aa1d581f178f49df830c9b511f5cd5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.217-renovate-non-major-31cd1cd5c0640e44f710990952e49a905c820b49.tgz","fileCount":17,"integrity":"sha512-jXoNJSpnuA2LzXPjLPcQffQNZ1cVQpj5oIff07F9fjne1NZctooIV09aH3GU9yPUG0VmGBzqqsmSnKFp6QMxng==","signatures":[{"sig":"MEUCIBA5v85fl4bspTXsZpcI0dHf0HHJ6DRvtW8xpclSNBvJAiEA7Gpag5afDuVL5HVB35wIGb7GlfZ5y1ucPSjcjwyzQVI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95554,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9oEbCRA9TVsSAnZWagAA+HEP/R8WdoJ8N3TsjQcXz9tv\nkeMiowTA2BFamdmJ0/w8l5nAafze1RqVYuEmhhzNWnhPqrl6tLKw7vAJUsZ4\nc6kks4XDWz+two9PLGEZg3tvnEvm0s5iOf56eDM3PWBzgXVAQdwbRd1fPdgD\ngLgz5p2bB/cdjLM5ajr0HyWiVuUGk/9qTsI4sMEJiDkGqqIY58T6Nx/zMHgW\nFpN1MEu7qY76GoNfxZY5DWM0K7OpB5l0OMK3Yy/JxQvVDT0qcy8BTiYzPgvv\nHZW9cgkjskAvAHLfEB8hcN0GEOAPVQyFm6W0sM/raMYGID1J2sRIpwHvSWJp\nfp/srwDHu+1B8chGU/zSVdI/W7RAdExT3mOT0mhzzuSCKnLAnMAZWHbvTh9X\nl9v2fgpuClizEbsbRySpeoXZYAc8+bnGrds4sOy+jpEe1OMeEcOIG/4Onl01\npTW2Za4z1IkqyeDz1eJYdx6CsHCkNyCgYw68aT41TE+zZpVojrHAuBSjcFl1\n+YmTsXQbWGL+dJqiirv+qjTwyPXXfM9o0Gcu77MWH1GCi6zPicW441eY+F3Y\nUYCpXuOtCXnUEl+58kswhxZ9s/aC7WQBr37OBqdFMPuP2WeIAX1jsUQVFr7G\nRz4kAcZxABEkUfOsb1xA6+PGWjsqFFAp0Qv8pWSt3JR66v/b7Dy/VcnavARJ\ngzxl\r\n=EOR/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"31cd1cd5c0640e44f710990952e49a905c820b49","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.188","@balena/jellyfish-environment":"^2.3.15","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.0","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.13","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.217-renovate-non-major-31cd1cd5c0640e44f710990952e49a905c820b49_1609990427127_0.24212450540059272","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.217":{"name":"@balena/jellyfish-metrics","version":"0.0.217","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.217","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"62a1740f3020cb4210e8dcc195390f14f25160c7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.217.tgz","fileCount":17,"integrity":"sha512-sa7afdSRg2P7H94HmQt4dDoAxLl0AbW+gsiA1Zc4KKo3pMzZowy9nDS80ONeupzMnVcYSRpY8HNU0VlzbQi3eA==","signatures":[{"sig":"MEYCIQDB+YTIoevO+i0v64gi16VoYyWj96jZl30d6cwrjIzWyQIhAOG7xEnO3SUgOzjqTj1v+ZMoGhjDpk+l3jJ5F/OEVuBl","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95494,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9oHkCRA9TVsSAnZWagAAzlAP/1Lg/8mfm9DUWn6PeDcG\n7QeNMKjlXrFVXkIR1TCCwFN3tU56OInO/nuxAY/i357YYSCd3+PPTcQ2uvIk\nvEHuS88dF4CgTcL7uVyIOROaEVLSc0wZ1z3ISuBAym4PJ66GmNStTVZOtMT/\n4NMyhSSyCvkJTkhnm3/zPJcrRcmlHMOhGJvp8zwM3ZyydpJf5TjonnCWSCi0\nGvy/2Qj9LKipv2eyrbZKFRzhjTBnoYQ37S/n0E7RN6p6ZIWwJSMaRvHgKYEh\nUnr8Ubte0WgDItxrv1JlwjCtmgluBbS7MIax02gRzQuHNssrE4BhIgNjA6PA\nZhetW3RrWliudz8eM9RfIPby0kyUcXlHXoepNH3gKcTjAaVFnV0tH5kKbUJp\nf/aXyD4B+oSNZp6bq0XXAZVJPjyKHGGy10EFvc3cWnR7l27u2wrBm0rUPX7U\nQOFTIdCyBK7hVum+wNn8aA8/7vrxLYspgAe9G8cMR72R01W1A2pNCWeWafPv\nB8se/rbBA6ASYF/PbWXNOfbkdDGgYMN6TRGUgH7NK59obGELtCKiwd7Yo5uV\nywP2cmoxCZ+bsou+l5gLCsOL8q9Vvnj+YgpEK3b/wehA0ssBo+es7RubDYM8\nNPl4bkTAYb+xCEe/uSvyMgq6XBnJXvzYugBxmpEo4E50Pl3oT9n2saRHI6LY\nq5kH\r\n=4OQS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"3e8a36b806260bff8ab9cbd68e4bfb0428f4dca6","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.188","@balena/jellyfish-environment":"^2.3.15","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.0","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.13","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.217_1609990627911_0.9096189474240877","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.218-renovate-non-major-023a1641b8e819949965c4965f82b4dbf1f0214a":{"name":"@balena/jellyfish-metrics","version":"0.0.218-renovate-non-major-023a1641b8e819949965c4965f82b4dbf1f0214a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.218-renovate-non-major-023a1641b8e819949965c4965f82b4dbf1f0214a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"068ff604d9bd68d74ad3529bdbf20784eedaabe0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.218-renovate-non-major-023a1641b8e819949965c4965f82b4dbf1f0214a.tgz","fileCount":17,"integrity":"sha512-hRY86ocvoEMGT8+8rVwluIPPcuIFnrUkQeuOgF2a6taT7WdZM+71K4ECG3UHbLngy/rvtoJQVSHH7T7wT/NPBw==","signatures":[{"sig":"MEQCIHPcqaSwEoLrS6p5K4BCJEVi1DndsGSvzZGJGA07Aq7TAiBe+dDvsNK6OThO9Nu3xLXClGncV0fVVlv6iqqBVQeNzQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95662,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9uVgCRA9TVsSAnZWagAAzlgP/0nWuDh+X7YPCka+/fEZ\nR+3C0W+R0s/pJL34f0qmPJobl5h/0OUaCg+VRxaIV4ANziTe5fErxIu0YS/w\nX9TZIRPzYMN3kdONscej9/rGgGAyzrAulYfRQTcQ/Wr3pPeOqkeyVVEJsd+D\nzdukG1inrN3AmM0b9w2bZSS19CPZ3JisV18LlgcVTccwRGlIAV7X9QU9p+t7\nFiUraLfmIFKrlEC5xVNBL0dymJjDpn7dVrHjTEQhdlu++xuzhMRm+6iP6wAJ\ncRMxKxT/0w77oKC5gzMP3Iglar2EwkYbktTnZlnxFZEpnJ2bOSWVQmQS+FlD\n8annubhiWmfliAszIir/1E8EYTyq+nBI7oQGLg36tdxG4LV6cgv31YORMB/t\nIRaTFRkrfJtuz9H7VlJGql+6/iMTI4E8L4/sa4h7rp7srsn2fDbmGSpRHjB4\nsCRVxTMR/zc1OGyX3A52k8//jmOr2T5QRl+v09Z6hKJ2amJUbT28lvF6m8nz\nyB2LbsqfQRlwZPMHphbYdqwiCtSmlxHW/gcgGC+1YALB/2Ub4Yun7Q25Lc/c\nvW+MoN7Bej6wu+oimejI4+XhhENCyNhvQR5bZT3BQ35aJ8X7QgdNGLYZxO6k\nv6+X7E7vOsZ2TlD7lrVsIsFtLtar711A9jeg8Rstk6i8lZrw7gLVaMUZmP64\n1WH8\r\n=RAln\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"023a1641b8e819949965c4965f82b4dbf1f0214a","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.189","@balena/jellyfish-environment":"^2.3.15","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.0","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.13","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.218-renovate-non-major-023a1641b8e819949965c4965f82b4dbf1f0214a_1610016095770_0.8072160498211383","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.218":{"name":"@balena/jellyfish-metrics","version":"0.0.218","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.218","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"49dab4320b4f647d1a5edd14a799dd79fa7d0732","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.218.tgz","fileCount":17,"integrity":"sha512-mtlVgXqobTMCGVeaWGidiqpLa9kFml9NW6GmpfHoIb73ORYmPM+RtwIzmUYK2357vPNx8lJU1Xq06A0LLvrJAg==","signatures":[{"sig":"MEUCIF/uyRREm0gF9M2K4A2xQ0ZVATGH65gi4esMNF6VSHuPAiEAww2g8SFCp40eqsRrJGfK3f7ucmxgHEWTSqBKhs9jsuw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95602,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9uX9CRA9TVsSAnZWagAAH+8QAIFH7zj5xMsan4l+2JLl\nan7QvMDwq+TC4VsHlsA/o8zJ+iPSQmxktROjXCdsEfwpUyvyBrxaRlRam6tP\n8TLhvpDmw0J4ifdTktuTMNJRcwKt4wJAYhPqCadKAOddY9KgsRAznCHdH+iH\n5tdhTpXsHm5y02gY493CPmw0BqdDFDWTuP/QsWOMd6N+H8Kev91GwJLvKjhp\npPiJheNSTlsNawnEffyHrhDFvGF9mtWHblWQW/w/mttjFPO+Uqgcmqp8g2hT\ndolYrI9zuNenEh/5kKnM63p8pJJHDou+8TYIK53iNi9OgTEM1gtlHJxI4h4b\ngjhatAocwhKDo5YQeGQAUXWnI+OXUU+djVUkynAR3ueIFxdEXfSfPMo/3cfs\nMkSw0uTRVyOYvKw9KQQDgWIhw39QHUiwlnvcnuj2IjzrOz1epAAAOj8XEuz+\n7xAYEYF+fo/uRB4P709Gz7DcoKk5xd4s/sDGeJlNumXhxbieg3qTDnpuGx0l\nONOvUYPeHr4081habiN6gk6xuY4mpFjDa0aHYjJGjPUfp5UUtMeIg3OBZdkp\nZTxRkR6swOq6EGvHejGkRaQAygChMyNYHobbhBatvK4pqdclBWd/g58DiT++\nxtA+r+KrFlJZYb0bSdC6d7YDOSQNF0n9Rbu+rBU+hga8w+Ocprah9+3c5Z6f\neV93\r\n=AwdZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"388ced52ceed1364ea5540b9d0e3705ee941068b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.189","@balena/jellyfish-environment":"^2.3.15","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.0","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.13","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.218_1610016253373_0.7552043715002801","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.219-renovate-non-major-51e845dc7cfc1cdec0a75039040ce23ce34a7542":{"name":"@balena/jellyfish-metrics","version":"0.0.219-renovate-non-major-51e845dc7cfc1cdec0a75039040ce23ce34a7542","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.219-renovate-non-major-51e845dc7cfc1cdec0a75039040ce23ce34a7542","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"663487e23c7e57d75e7d85528e5c5fb2f80ef75b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.219-renovate-non-major-51e845dc7cfc1cdec0a75039040ce23ce34a7542.tgz","fileCount":17,"integrity":"sha512-wwfGNjWo5JMI2HKGMOAeaum8dQ6taPRSEz7unGfCgQORG2CfJFu4ojxeyI7lQOReUodN+ahHu7lJ4XeieYb1XA==","signatures":[{"sig":"MEYCIQCww056X/RtYJ4SSCdV+S9MXMYnaiVaGfFKmZdJ5pcnIwIhAJ+FS+vHjL+7z520HckiPsAoBv0LKN9Bvpz0W5lE91bC","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95770,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf+i70CRA9TVsSAnZWagAAwgEP/0UNiHPXXCTOmxYyVQ3y\nUtKqcsrSPshJPIUBSBvrBLnC8r7tcuqb8mNhYxqOA6jRHqrmDeeI8Dvgq9Kd\nXnc+e9Rjc3jrrLAGNCZr+NE+7QtfpTakYR5RnHApy7qXPTDfWUZHyQL9nQPg\nOpsHJ2AmlH7XkZuq5nW4bj5EpaYHuWmpaTMWFL/F5o9j46PGvbhrO/qgLIhr\nB4z1S6hWUY4K5JWf5PV9wm3myBibIyLDRa6cjTeOsgP6BpLbBax31Xk0jPwz\novxV5W+8lIZlGhxkNbvzDEXUWwRqM0Wg3sFnvKx5NOV+epuNpFxAZ6W9zV1H\nK0j0gF2akd2BweICjn7Z6VHcwPAlbSI4Aot+UftcfUcZVkMSp0xu0ajEhmNw\nuP60Uvmy5AFCTOO6zgdSPexs5oZr4+CVpcAA//fHPRIaZrMBFf5qTwRjI0Zg\nly3j6mq/ewEultKzMeTbysdCqSy4n7PVOn5RUm1oelgiVm1BMLpM7Z1xoH3v\nYtQd6Ql6NyxwzmRxQCXr11NK+m0hucSsUi9ejn+5g9S9Dgb+05qGku6JUh4+\nMa+Fnb8x2CnUsrQohrw881NScj0GSUjShfxH7mTNjnbBNGMHEycWwwKECx+O\n2sgGYmzbxKIbz8XiyV6MltQXbanrvb/ZE8VX0HREF1Q8CpcEqV6lQ/lD+qQj\nbjbk\r\n=EnPT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"51e845dc7cfc1cdec0a75039040ce23ce34a7542","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.190","@balena/jellyfish-environment":"^2.3.15","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.0","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.13","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.219-renovate-non-major-51e845dc7cfc1cdec0a75039040ce23ce34a7542_1610231540097_0.322462258012973","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.219":{"name":"@balena/jellyfish-metrics","version":"0.0.219","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.219","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a3bf79bda91c617f1e5b576973bed3dd5a6fcad1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.219.tgz","fileCount":17,"integrity":"sha512-b+z3JQyFcr4ESprx0C+3VsAga2y8ll/Zyh3xFXQ3Gcc8ufmIzgQROheXCp9L8QxQ4lK4AMPSPUXJCRt/eXqQ9Q==","signatures":[{"sig":"MEUCIFQ70DaRC+Bu2osjEqM+qVH9COiRIZPKECVK7Q+LOTKbAiEAikUu/LBJDkSmChwVyFER5qlv0YzhhCn8VYIgLHAAcPk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95710,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf+i+gCRA9TVsSAnZWagAABdYP/iHSj9+TX+Ej2ASdwWV8\ndAnW9gnEFT5Ii0tSP0THVPoW2pFtCgHCoG5R/HLwGqo2VZcdayIpyVkobqH3\nMHG4nrWfKaUymfUkkuonR2Ux4Wg3zhi/aRjVmAf8TcgC2gxq4CnDF83gZqhs\nWUVfxadOmZOUvu06mQB4AXGxz1sVUzG5nPhCbeq6UysIq2csV+jaLy83vs+a\n5SxB90TkEBef9tDwBedFn94KBJNgVE0D0bnhIFMfUGkxyVLimIMKIm6tRRGG\n03c6R2BcORWnZLx3YQ+10VDcdMqZGshXdYeDYOX2WjzkHglV4olhMdJy8x6O\nYMml8vPzX4bwQS3UqxtCVHjMrlQaEE+2QXDe3JJSSqiPfE3pQDlcQjlZY3ud\nmjKqOBMMdTm2uTGsJHnMpIDp0F9RvZ5BlhSiCnW7imEGA9ZteSyjwiz73xa9\nGuA0HBYicIqduYXm+XhVRY5fWiq44Yb1gIJls1iKO8GelLPMBBY9XXErwOG9\n2GQCkW2WnLNDjfCi+eaa/9vHozv9+hlyUHw2EUseeGD2/AcAUHm760Bx07Y1\npJJxbvEKVQveQDHAyUvePtc72jKIv3kPTREGWbW044kbS1AJiX3tQipI+xIH\nTUm1EC5VHZXp9O1R1dj3YYKe4u0cK8/PGlUpOsTOf2Ezjx9+m0+Jtz4Up8+3\nZqvJ\r\n=AgQR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"8c9735a5e07ba46e46af0e23203bbad84dd829b4","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.190","@balena/jellyfish-environment":"^2.3.15","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.0","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.13","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.219_1610231711958_0.9752394389294747","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.220-renovate-non-major-e32deec1e8786472d382150eaf6f188517afcefa":{"name":"@balena/jellyfish-metrics","version":"0.0.220-renovate-non-major-e32deec1e8786472d382150eaf6f188517afcefa","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.220-renovate-non-major-e32deec1e8786472d382150eaf6f188517afcefa","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"07a9c8e325e25ae1695092f1182a322fbfc244cb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.220-renovate-non-major-e32deec1e8786472d382150eaf6f188517afcefa.tgz","fileCount":17,"integrity":"sha512-5ePLJNBXyqHEUksiWw/jIibxijJPCykMtmboriCcVDxpIAiIMDLfalIiVqp1FIz5/nEIr8Rgzim6NS0Tcfkzuw==","signatures":[{"sig":"MEQCIDr8TCsOZAXW8F4zop7xUuprR8j9UBQMTQMf1cRQmAgCAiAbuEKzf2NEqlKSM8sRTkcwOoSOH9oCdaRC66JEgAdF1g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95840,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/APeCRA9TVsSAnZWagAANw8QAIEiX1jUQWUFX4dCGYDr\nVH8jN95MqYCNK9FNk/CrxKZIkH/qcfTAw/eGE78Xy5LqEZMCqMZuNnPb1ZqY\nZp/mobtneQB/naShHLlWS9N5/8oAz9M5sGQvNSpLuZ0DrMYE4Nk9uRpbwlgZ\nCrj6c87MQ7g45bAhYzKu+P1eCbbj+94H/hQt+w22709yueJwK9ZPz+IKE8Mv\n1wu5piBxpNwADnY6q2cTGLUUm647eFDSfFITmXb246XxJH+vSUf9ZuN45k0H\na2SukF9sT8O6/5FBMrmQ+c9MQzUs66xOWmPS3p9p3BWucTrnXaelCSGNXWri\nbXRGygKytXJf5ibfzWkAoLruU/2wXKSKC99l3EbSJxOyVfFfJdZJTJz2vpXq\naxIT1ucJqnd484/QSVZ8VGOhiyhDInK5HddU5aZUU/HwAdRdKyirW9olmsQc\nM/CJ8AyPstqHVtkHrUE5gCC3D1ngDf4V3ExZVTdY3oqjh600CC483iTSL3Wy\nvtq1cMD2N8o302jShBQG3YHDNWnzor8Ly+2dwD34mmKLRVOsotWmuUreAy+U\n99PiKZbK3eMG1lF6LkQBTaI5UNxxzdDhjbfwut1QhFdP8FfwxoHo8xKSl8+O\nEo+eikeiPrPsKlaptJF9dRrH5CL7xkBEbJfrXKUXNeQc8T+9mWMSmuNSOXh2\nSJF9\r\n=DiSO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"e32deec1e8786472d382150eaf6f188517afcefa","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.192","@balena/jellyfish-environment":"^2.3.17","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.13","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.220-renovate-non-major-e32deec1e8786472d382150eaf6f188517afcefa_1610351582118_0.5794582350368043","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.220":{"name":"@balena/jellyfish-metrics","version":"0.0.220","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.220","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0e305adc12565a6fcfa9f2ad10ccaa25f7bc07b9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.220.tgz","fileCount":17,"integrity":"sha512-LeCjh45Z77CgxbuzogOTF+JC4jzvFyCkAhKjtKoY6080lNh5mBbRkx01/sgkil9e4uSCedTdzOyG8usgDBTx8w==","signatures":[{"sig":"MEUCIHZy7U0cmf8wPp1lUqxoMg5Kq4V2GRoREex8d1RRTwCnAiEA0gdGWS4HwpAMGg7ymajLd71Rjnl2SXpusX8KOOup1IM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95780,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/AS5CRA9TVsSAnZWagAA6WMQAJBEuDIcbjlRFclPR58M\nEhDAhKKQrYYn7WkuXYrnU6jL/A+VuawmN55P4R3WT0ovimAlWn6iTef9xa6U\n/GW0whLZyV3kBflU9/k32LUXQ9DqdHqKN6hDsnrlLlMoE0T1cSnpEbRVUPcb\nyFP7Blr8ogvDqRwBilS4KTz9E+KzLEgvXQZ7/0BjmqSqENzEMsbDaKpnRgte\n4zlTLdArEc3HB0WbkJaeTv3DxZCqxOrVeYRHw4eOb91IeHB/uRCsBoqSU/xb\nCxhM0u131y6xadcEfByiGdQhOxU2gI9vGIUn2+FB1KDb2eYHhrbJNl4x3Jt1\nxRJdBTAb7J8M4N+NOjJypSAmvnzR+f410llednF0lQUbOKUsheUUhigoutj2\nLDcoJRJx3Rn+UeaIJgHqQbpZCn7K+EulQsSuPErjr/boRNpH6C4yBW8w3EjD\nPPy8v44Edi5NAttQihNw4pIq8+Pl2KkYvM5JJ6deO2HPwwCIOIK0ofIO84Iw\n6zp2U2JUQzUUJSlu1V6Ak82ZPG+dquLsAb7eQUgh1c1/h1kZ6zDMtVTKNssa\nPSiGu1CZ1uHXlDOWiJlp+Ioh3heAI182Iv5uOpU42oIXAIodTsAflMAvkc5V\nLVYd7vDMCIZhQ8RfF0SY+Ehu92tWu0jJIn+0nJsm+DoI1ITX7d2hxz3zIrpz\n6QuC\r\n=BZPR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"9ffc8e35be675b5791d54fbf9f58cdf382386dec","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.192","@balena/jellyfish-environment":"^2.3.17","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.13","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.220_1610351800597_0.5817610498673804","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.221-renovate-non-major-e1451b955ceff7ec0e9790352999810faa7eebac":{"name":"@balena/jellyfish-metrics","version":"0.0.221-renovate-non-major-e1451b955ceff7ec0e9790352999810faa7eebac","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.221-renovate-non-major-e1451b955ceff7ec0e9790352999810faa7eebac","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"160cbdcda560fc48659be66559a94e9c279b511a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.221-renovate-non-major-e1451b955ceff7ec0e9790352999810faa7eebac.tgz","fileCount":17,"integrity":"sha512-5GOsZZD0YIz6nLZvGzFe41pidPUM5Q0dAJTfsv8u1nYjcq+vPSXZTXhuRB335d/CxktztluAOjSQXvxP1YfpaA==","signatures":[{"sig":"MEUCIQCKsots3YVQPNX+fscOe82c1jw6dGaPOh4w2lxJ+dPDZAIgBN+uLKO2SDwZNr80149fSSEe9P1qFj/q068pXEyQo68=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95948,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/AYECRA9TVsSAnZWagAA2jAP/3DP4xMMxYnty1bLDrKJ\nlNuDVeb/UtDMlzRrnkhcUNDj0BFO9W8MGsC7vlgGDojPhhCO2Ac8tk2wUUfb\nGzqtYac83hrta5bEYcE53l/9dYillvebNQRJ0YXukJbcy729d7lUkED4Jwa+\nclK3z9v2d3qtgl/4KwzRd8TyVmBU/9iHXwpu82mBcnVqsyZmdIUIht7VQ+n6\nNuWP8Bm+o2waYDmoBwcPc39FU2O/bJElqnW/dsIBdrgEmbSo6iue/ktnaLOZ\n7IVWip7+Vb6EeDZNXaH+MKlGt1qHT3x8gsRC6GKJv5g4IXhzaSngJm6Xgcag\nk2pZbJMVNB+ou48hkn+pNU/dt4Z3+NYOx85Mvix0K7muw+kzrJR3tfyIoTak\nZV/Dc+frkz0wmxeNMyTcPGr1pbHzq1dHgNjykJFB0c6Xiqq4Q43PCPlQv3HU\nvsou/wn5LG1xh5UXJLhExLV9mJNAjpDhQBbn529tBtvowXa2acEIEsV4u3Tg\n7r6QzD57cnHY0V0QG6Jj8GwqPX9DLDLyBQTsoIL/fi9HmEM0dmgRCL6ok0L8\n0oJivObyPhrz9+28iXKA+PLUxuVXy4iy+A2K0uxi6XwiUnPWxtHHk/fosHMg\nzdI0n++wE9JX77SNe0fcvL84689wj5JUsKxc1IshLsJFGe9894zDK+fMQiVH\nUNeh\r\n=vaIf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"e1451b955ceff7ec0e9790352999810faa7eebac","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.193","@balena/jellyfish-environment":"^2.3.17","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.13","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.221-renovate-non-major-e1451b955ceff7ec0e9790352999810faa7eebac_1610352131637_0.32598292324981815","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.221":{"name":"@balena/jellyfish-metrics","version":"0.0.221","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.221","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"74e5aae8906035b5b484ba08d2f5210f9e94e3ee","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.221.tgz","fileCount":17,"integrity":"sha512-z91VpparJbC3thvqnr+u4D0zO2Q2v2gv/xTM4SJ2LrcpOHrK2MQmvlWMF24SsVNDBD1pJVHPrD7S0NnQqenjQQ==","signatures":[{"sig":"MEUCIFnu3+0mHCcLx7BUisMLeCPEeeJgfGLZh53Hb2LSKcU6AiEAs61L8KmMuKpQXyZdXrNaLghAgRPJ4Hdtw7mHhn+Lbj0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95888,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/AbCCRA9TVsSAnZWagAA3DUQAKPSbfS6UR/vYfa7Pge9\nRFVVz27/o6bUDkc9UQDMvx2eHM6FLKcbwh091gvGtjWY6tBV4czuZOuxUUkZ\n5LjCeeNY6GAXnf9wtSdnD9HNKnfg2MT7sE+zpIDG1zdJ+kAWgLwYeFlT3Dbo\nW/gQrAlfrGrJ2UvcN3SFhAtQCRTYGVWEy14ZPQiVXGYMAiUCpsLE5xnAC7cy\naRjxMeUfjDirDZJqxmuJZoW++P5+TX4ajq5WLqOBhsafR/IKyzOfIY4r/nCf\nac2DAf1TGfpFpPmqHQl/Qi7NLAg7K/H5bcecNAGNFLaVeCJ1qD2BR8vm26d8\n9bIZ9ROncovp/QI2LwcCeZy4IMPQSNyzK1jvs6nslpWNBV0Rf1uvxWrUvcl4\n54rxty0O62UIc78SczXQaDk1YtyFm8APVC9xl1FHk6pIOjieBmqj7e1mCjhH\nsJyth5fXjGA2p4OXZ2ZCUvABeKSEIkMkJRcWR4Q6D3M8Gh4h52rSgLc9ZKOj\nvLXe9iszIbr6TiSkOGCiwyaqLPHlHsedl8TVG3K2nFjSl8MrczSSC1IHcxJH\nLqrvyegjNgz7WBVI2gSCwKmH0gpI5nbRCyLp6ZFtsm1s4H9U8j/Z6ONBjDUl\nxHw1KKc+fI0CoUCrJEADnIBErEhwJgLsKDo/H6KqC0fLnZWb+I4PxHljgXSm\n7enF\r\n=kBCw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"c26937f6b0c5db8710a07fce18c6e2fa72cf3af3","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.193","@balena/jellyfish-environment":"^2.3.17","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.13","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.221_1610352321776_0.6900566943146935","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.221-use-company-token-eec8b50388d20f3a9de4a5e3a2ed8c945d48030e":{"name":"@balena/jellyfish-metrics","version":"0.0.221-use-company-token-eec8b50388d20f3a9de4a5e3a2ed8c945d48030e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.221-use-company-token-eec8b50388d20f3a9de4a5e3a2ed8c945d48030e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b40c0ce1afef92b48f29af8a8418e3cbee124eb8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.221-use-company-token-eec8b50388d20f3a9de4a5e3a2ed8c945d48030e.tgz","fileCount":17,"integrity":"sha512-11x0OwQbRVKp3Hod/w+hyKaoACWvWYrTPhQGPyBVOAW/Ny4o/1Zt6O3qXfjsVozsmWjmomcJAyo7n4mNRplhYQ==","signatures":[{"sig":"MEYCIQCeI1JMkKrwgh3e41bF8VRbhXnVJqdJ+TYkzvKoRBtmLgIhAInlo44G9dluz3tfmf+HrvAvKXJQ8xXDVs1nL5JGWUvu","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95916,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/AbtCRA9TVsSAnZWagAAKg0P/Rdh92cCOW/Ou9Yw1s0p\nxIInZH7C8l/OsQ8jhZ+G/SjhJsHwkxFyE1MJEIyfcfKxLp+hWLg8YhRuiJ03\nMHoBXyOkmbQ+MO3LfjPaiNIaXnDocaLVgj6lcZFz534U7Oc8f/yEzs3qcU8s\nLsDbpxU5gzVu8NQm/HrM08Wfxl08HGLJ8tQ1yMQglB4+VVq3z6NovC0r8HnO\n8/hIUYq8WpXNWARPkCn3om2NBMTf4kdechyDIADMwC1Le1+aDCEGzC6rRn7z\na3qe1QbYYy9Z/+3cnRrvppm6XmIDl2U4GZ1oekZgHWCC3tbx4lvLVE5gHeVl\nwhrBiokP8sY2cnrP7qt3TSn+t8hx24J9P0aURUrfiaypxH5c/q5zRIsrvYU2\nL1+B9NTLeOSSbRoQMEuvFDjO6N/N6fhEuGBUcsU9M/6JrMYmVuJY6Pf/rEG7\nIgVfKBFtU5g9DZQS5U2Sfx3vjFeCwTynBX6H0Ts5JyDFUX9SD1aTjxQbtpAg\nayyA7kddziqJiu97Ct4xoB/v63GKl/H/BrA7+4hmN9ixcbFBsjtZYb9F9I0C\nH2X+SRLHTASbaCVTGfgHL/eSWfAI+E6SRwmOiySFEKA+Z7WSU48ItGuWLp8b\nLbm2z84iL8pjYX7fRRKbVtLEFyvBFNumChglqc1OrvBFOlNH3nA+BHPjq/jM\nniAi\r\n=2BuQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"eec8b50388d20f3a9de4a5e3a2ed8c945d48030e","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.192","@balena/jellyfish-environment":"^2.3.17","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.13","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.221-use-company-token-eec8b50388d20f3a9de4a5e3a2ed8c945d48030e_1610352364466_0.7744324878077815","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.222-use-company-token-9ab810b3ab52f12c39eb0bd50b86c90fda600a40":{"name":"@balena/jellyfish-metrics","version":"0.0.222-use-company-token-9ab810b3ab52f12c39eb0bd50b86c90fda600a40","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.222-use-company-token-9ab810b3ab52f12c39eb0bd50b86c90fda600a40","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c2ef069fb291c359ef2472cff960c31669fb7d82","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.222-use-company-token-9ab810b3ab52f12c39eb0bd50b86c90fda600a40.tgz","fileCount":17,"integrity":"sha512-7tMLdvWRHkANnT6qcLS4yT7IHYIqEDQUG87Krw4NR954o+jUiIKR5jjJmxeueIVNwafJCV5h0PTQee/i74L2wA==","signatures":[{"sig":"MEUCIQCiKjG5Y21aX7ESohqCmlLmpbwT+yMbMaPniJDR/aP9hQIgA6KfwSu+4b8hYLzdAq27LwfTqpGkTloesNBggz24VlY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":96024,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/AhECRA9TVsSAnZWagAA4YMP/juhTysgTWvGTJqlcJmx\nWtg8HOdoUAc0ob5kiq+vrIeutiPvdTpS9X+8AwKJOFowh4v7LdmH4KHdvJbm\njVXnJrWez9j1Is3a+i8xPxqvPGwb6HRT+xV5VM6Hot2aOQHUpgI6KbGRyE1N\noRn1a/NiMiX2n9t94Et5JFeEV1fpaNpad364V6WYnO+x4R2eOAajOA6WknqI\nBgZUP1Gb6i0OvXAnR68GpBRhgHdrVtz1AY9NO417q3bb2R3BjAr65Kp0gIpC\n7DOFuIrNUCiAsASQi5vUklgg4sBtmE0bWmr4Ra61ODcV2DnCU+K0/p6K9nYv\nZM9a280x2Wblkw9oqloYgdFSkhEhpUOu8elinCVGIkfFF9K7deNePeFV2g5S\ndW7rM4MF+vdBBNZHU+8qnTHuc+cX3iCHfJcIJTLba90Z29SZ3Kq7noTxRwtG\n6HmRUpF3Xui8tffrLvaXAldyw1IcB5Djs4JckTi/tHPsLeC2J1cWxNl5wBcp\njI1cX81FFtU1IeZ0ZYNbpvfPQZgPWi8dCwU4wVn1Qoi068UzOuuimOMZZmcF\nJrFtiss7ADtI9NP5Odp30zk097KSrybQ2Jo1rGrKK2gUAOECZjASvHfXeoSf\najJElf8/2qWb/mCqzELVEAqsc4E1dCeMzrUxYu+16FQtLelEHYkqmhZLQN7I\nIdTy\r\n=g5+q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"9ab810b3ab52f12c39eb0bd50b86c90fda600a40","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.193","@balena/jellyfish-environment":"^2.3.17","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.13","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.222-use-company-token-9ab810b3ab52f12c39eb0bd50b86c90fda600a40_1610352708043_0.13597077738113827","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.222":{"name":"@balena/jellyfish-metrics","version":"0.0.222","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.222","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b86f5c010356a61736032790700956d9e6c45979","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.222.tgz","fileCount":17,"integrity":"sha512-eTBWBkac/fq8VyW1AeUeVPrhkDSDkh3hp1x78ZrLsLFGwUhYWj6sbjGLKeBKt2u9XwxRDrQ/jUCEFJhgyylXcQ==","signatures":[{"sig":"MEUCID61uS6CbzrAI1cqMl26Z+PLpJlR13RusbCMWRZQQYHEAiEAk0upcYl61zgpPW57bXxnv/xma4qi2MH2hO+5xOxYs/o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95965,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/AkDCRA9TVsSAnZWagAA5xAP/283OUtLsRtWSHz/VOK0\n6PvjIKRj7sfTaQCeDg4CksAAHW6JejWOBkGuUyZhTliZWWYlbVfVpmpVEhXV\nsZXr6HbhMmEDBtagmu756FGhy4iMA1HoCT9xUutNrdLrGdEWyoqcpemFycgc\na7IOOlrtFi7y5lXr66ZAsI/VaE6aN78mjUbZtTOOFELYKEwWZD0XGllD8uyu\nV0bG0hUjNUjOOzpC51QybbXZMaArb+7ZKj5WTBpnkjssMbioOpXZZi9Y8Wcd\nUxY/ujKmjUzG0xbbetqT2+M4yiGm6D6QzUWc8erEXIyv0+BgDkMIYxSNzeCR\n6uREfmI3WAAQmXpN/maRHa2Kw84vSeVFO5ZeGJYJTcJJgu0+tRov0i0tNgPB\n4tuUA5PnaYF7RJYxrfQmVaQPGs9XlYJP1nL+FwAWTvYq2wZm04pYw7U7k9X/\nZEV12poJoHtHVoqKuseDpugsejT6czeEYe6DJhHtNofdB7iNVWx2fssx6zTt\njpfyeruqp6EShzMx4I/4coUkmJRU7yjCnj1a69WY7e7W2r17EUjQsCPRLidM\ny3Ew1RcT1/1jbEEO015XKgbUPKqoBIAmK2i6cp+mxymvb0wOm7tU8CLwtGH6\n5k6NsBptgKVU65Q2bSkYSCaFNB2ON1BOEo8EF/0+sm1vjzs6phDC3ywiBdNS\n23Au\r\n=mLQN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"c5367881df24bbc1714ffcb49699edd1f7512cdf","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.193","@balena/jellyfish-environment":"^2.3.17","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^30.7.13","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.222_1610352898810_0.07914594745621817","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.223-renovate-eslint-plugin-jsdoc-31-x-2aad7883f9b614b49d3635d6e8bb85a77a0c0875":{"name":"@balena/jellyfish-metrics","version":"0.0.223-renovate-eslint-plugin-jsdoc-31-x-2aad7883f9b614b49d3635d6e8bb85a77a0c0875","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.223-renovate-eslint-plugin-jsdoc-31-x-2aad7883f9b614b49d3635d6e8bb85a77a0c0875","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2e017a0dc3577f3d3687ee11bc3b9dbb7f98d448","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.223-renovate-eslint-plugin-jsdoc-31-x-2aad7883f9b614b49d3635d6e8bb85a77a0c0875.tgz","fileCount":17,"integrity":"sha512-rhLRRdST2P/HWUbHHEYDed2T7AY88O8XC5iCuxlw6S8dHcMtqxGHTSR0zCyqCIFcyisPehAHP+Y+zoN7aY02jw==","signatures":[{"sig":"MEUCIQDDDtcJJ0nagOL7YsMzpCCbV0nQW7LvUWIjWdgdpNgyTgIgXSVCqxmlyXyLMFeiopqHyvxgnhYCtvLYjIdsnAgayEk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":96137,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/DVbCRA9TVsSAnZWagAA5jsP/RKQsgzMdFTzuIVYu3Nb\na4zud8FCaEsYt1QZjKjrKW1PEUKb2k/LHAx898sQLla2oXQ2GY8Y+z6DkJH4\nNMMSpeg1FoPqIWBE9GLGYe75hUubASX7RsoyZ3EiiXDlZ4DmHAUB5UpFd+SF\n4N0aape1Z3temA+0jk9iAaMn7MbBoWxhHnAP16wnG+TTIpma6JELR+FElEF/\nxUKqP1SSgKqqFZXeXLk5Bb9iLHg7B2LJR6u60h9qbqqjWcc5Pa3KmgQganwg\n62pA76LrCwNeiRT2qnj3W+A/Ej5a2V6eAoCBpO4h0sj5HgseipX6Mah2IYhq\nbTjRmlt3yXK2Ir5nTNTki5zd46+ddWd6LBHxWlKApJ3gD1aft2FjqAvy3BIo\ntQOdQLKKpgLkL66x29AbGX43sQcrF4bDA1eBRFojUL91qcEJcNU6ZGfvyIJZ\nVkJfkLNXbXsfxTB1KHbxUAk98EVR4x4UI0K9CtX7ct9EZ/Vey17x/vWXwLTy\n4eE5FRdWGoQnFfJ4FbojBdGBI7R7ZLcaJu7/W+jX50XTxoRuYtLLVRzZ4cu5\nYvilrSzBXf89XOvfnaHbm9ag75gmvhViVVq7WnT5iYC7TJOuxoLm4oSPF8tz\ncCq2PiZ255wjqxZ2ZuCbr2JzTD/TzPwzlzoDQbBtxGS5o3tO3FrYEjyjNY8K\nogDr\r\n=Qhi+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"2aad7883f9b614b49d3635d6e8bb85a77a0c0875","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.193","@balena/jellyfish-environment":"^2.3.17","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.223-renovate-eslint-plugin-jsdoc-31-x-2aad7883f9b614b49d3635d6e8bb85a77a0c0875_1610364250629_0.8713078326728139","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.223-renovate-eslint-plugin-jsdoc-31-x-0c7e15c364ed74a8726a2b9dd3c783e9c7373994":{"name":"@balena/jellyfish-metrics","version":"0.0.223-renovate-eslint-plugin-jsdoc-31-x-0c7e15c364ed74a8726a2b9dd3c783e9c7373994","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.223-renovate-eslint-plugin-jsdoc-31-x-0c7e15c364ed74a8726a2b9dd3c783e9c7373994","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cb609911f09f68458042dbda0c8a6901c6e9b368","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.223-renovate-eslint-plugin-jsdoc-31-x-0c7e15c364ed74a8726a2b9dd3c783e9c7373994.tgz","fileCount":17,"integrity":"sha512-u4GSoi9gU/fOr+xF9liQQLsCgj2p311B9YNhZywWPRarDDlHHIpjs60lco2ESSMSd1pbSg9Lo4z1GOj8Iew44g==","signatures":[{"sig":"MEQCIHCbqu/IfdYqsagjzwM3uyFyfS0faRWUj7I86lg7gr6uAiB9Sp4u48mVGAO56PuCliEmgT6lGztsxmyyVHHBjunp6w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":96137,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/FgNCRA9TVsSAnZWagAA7/oP/151o89ir4zL8m5jKiKf\nYeXZ8lXtlJ1wYwC0ooErHtQ+JmZsGn/sN4OShPGQd1f6TEkNL0NOR/Z6Yjzg\nmBFvJm65jQ8vtJR8u+mK8LUmfTAaix6HMrg6367SkIn/puGNzqa62CUwTtm7\n3Dxi5kM8kwp3pWi4Vbolo/IaKxbHkvfyyXYAInQegw8ToGbnOo5fu/xPPXG/\nIYG3XfAOo0eQ5crmPti5AptnWaPxAl7OwNdjRAlNTeDNaGkDA/CuHB0rLI5R\nds3eqk46L6tTeQ/fPOwmXId+1OYNbnu5L/xnXJqyhduuUm9C/2W1r7c5BuGh\n5WEVAxDgKU+yZVPd3KgPYK/ASjzJooI0wXXyxDpfgKJ2Rpjh5sI2ijJ4WIBh\nG8L8bKdZZcl2paqukD8E7YepaF5mfplFq7+PQuGqliB8qq3U/1OxaoTkLXbc\nh/xoT/QPigJvQxhsEPLt6R7YbZOXRyqDT7Ha1gs9ior6ZVyIU7POjuj+8/tq\n0g11nM6s+YftV2zaSP7E3bYnGFWKea/7dNHMulpcN8u8MYS204zWati5/Nh3\nzotzViKDg/wl61pHanfSVA+RimuTh9mNLkb6cS6DEoXzv4eAmiNmuILlutFY\nbaLRXk72vei30yaEpumroToR219vqD/dus2w17ODa02WNGkrL/SsBN/ZaI9H\nrSPF\r\n=Cmu2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"0c7e15c364ed74a8726a2b9dd3c783e9c7373994","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.193","@balena/jellyfish-environment":"^2.3.17","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.2","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.223-renovate-eslint-plugin-jsdoc-31-x-0c7e15c364ed74a8726a2b9dd3c783e9c7373994_1610373132721_0.05592731626101899","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.223-renovate-eslint-plugin-jsdoc-31-x-db93955db4bf8ad5561072ba5aac07a25083dbb1":{"name":"@balena/jellyfish-metrics","version":"0.0.223-renovate-eslint-plugin-jsdoc-31-x-db93955db4bf8ad5561072ba5aac07a25083dbb1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.223-renovate-eslint-plugin-jsdoc-31-x-db93955db4bf8ad5561072ba5aac07a25083dbb1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"623cf09f1eda312b13a3dc205330e8587a0922bc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.223-renovate-eslint-plugin-jsdoc-31-x-db93955db4bf8ad5561072ba5aac07a25083dbb1.tgz","fileCount":17,"integrity":"sha512-CQb8/Y9/YePw3XoeHQOU1xxZP/5H3B6rG4zTOq9+9+AQteecD0BRjN3S/yWgtTPmsavPET2BbxoLfof0E/iHKA==","signatures":[{"sig":"MEUCIDC9layKX8s0Ndy4fVds4pscI06DOzK1dahh3Ji/Mxk9AiEAqY2NdI5W46fPawvhvyy1sSv5rI2LtRTaC3J6U6VMuOE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":96137,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/IshCRA9TVsSAnZWagAAwaUP/2pYGtnuDXLsukq2oR7t\nluLo64MHFi1owz7wFDo4He65xKVI6VD8F9Jxk/cB+XwqGMV0SMIo58ct2VgP\n1EhcGXgj0vDkCttkcVULHBlZeH9Em0wwsmtvJTccIORmxqCb46ni4dgbVtgF\n5e7z5q2XpN/k54yD0c+O7iGmBugLXAsIgIO6vBoG3qkyvCASBbjQZxfYKTWI\n+6vlhfJwZut2NIindLBP1aNrWMrGKlfNkSohi+nv7BlDVPyzeCNBF2EWlOp/\nvAWPcoGDZnK0PPZgkKxXPWhbxaymMo75ontJ9NSFBIZm1yDmW6tsWztMiTZE\nxkB/lQX3Ah6mTAjfGBD1Y/AUXn8q6Y39ZxgeHfqT4Q2eWbmHJkydgbgCF8uM\nunDkmK/8r9zzttglk15o4GKXNthBXFK+ukr0cCi2NMk/jcc3LWYoVdKfipmV\nZg5T7mIXW/0LiYM2o42/x2AWQM5fSNqs3Q8rZX7GFPtGNg3OzAqRpKxkdNTS\n6O5OQQocz3QfAJHRSFcKlucLyMDQHtX9nYHGLTkHRkxVJIpAU1Sv4DEdwq94\nDMmVMONktV41Fy+kCYBi4FJPQDKH5zQvS+W2WGilq6/HPkyll/+48nN01Blq\nfjDCu5LnyuVum3/hNjTmZFq2Cl2qNYkmDu53ds1bWq8lbkN+Q5Ah9ImuzOJu\nLb0P\r\n=iG4M\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"db93955db4bf8ad5561072ba5aac07a25083dbb1","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.193","@balena/jellyfish-environment":"^2.3.17","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.223-renovate-eslint-plugin-jsdoc-31-x-db93955db4bf8ad5561072ba5aac07a25083dbb1_1610386209120_0.5484060977877283","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.223":{"name":"@balena/jellyfish-metrics","version":"0.0.223","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.223","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"516728f4e255fa1ec1715e3a35f878179b27dc7f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.223.tgz","fileCount":17,"integrity":"sha512-9ZemGRyC4z4kI+AbbiB0xYu5aN8f2tEprLtZwaR8KhII1VIUGKHT2vBB4PPvt21xcMN9a76cVmnfrOP57wcS5A==","signatures":[{"sig":"MEQCICoG1ucWNhF4ib6/3AVSwQRixGj3xS0JX+ziCRB3pX+fAiA8n30YfYuOLts6ETZzt+NRaeXrLOv/DOpRkD+4xTOZKA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":96062,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/O7hCRA9TVsSAnZWagAAY9sP/jzi5Zd8y7KcHTOp3kWW\n8uwnuoJTVknIXz3Z/tY3re9ZfdzVZKFQmxiIYKdSEaN9xNShpHQy537yqVCu\nroGHvkD1Pij4hxHdMvPWpEXMFW7WcfvgHW6AldcejAwfEvIoTkloxGRqWIND\njqhCSz+ZL8atYtA9uNJrczIocKCtoUHnMXSJl8CutdRaAZOOqKO6KHgPp2hD\nb99zr5HzxVh/lGT/sJSBnFWF3/gm+an1HOgPU54WGzBhr0JyPy3XjgDEWyi9\nWeCbKj7zOfbm+TT4YuYQ3I6UkCW57QvDDGCm8bhwbbE8mk5rUsu1GuwDkujq\nQ8ZczFQQKMVIkvkVP1VKYIx4knAkMVLcHqLfQr8Yb6/9BAbnNUfjV6VKwZQe\nTwQHaA0L2zNMq/noBd+2eOQr6wN2BkLPJRexIHZ7I51wgwD/DJzt4oSxu7Qh\nEr2Tjl33OcveZOLFExSlVZQZn1fLOc51xUq8Z2Ql9bUdBxcRziwQwpCwZLEp\nAtkgj09P3vHcgD9vxUvKCpi3AS1Yf95tW0l9lpYDFwcg/40GRv1fdAtvZIP5\naBt1HzPg8h+BNEsyMm/mz96EG9QlcPr0KucF/rnyhBkfTZYtNMkHaIrnuVeE\nwd+aNhGHhsIa3758k7qHidIHpHdoALDwRFztJLw2Ej2gJN9rJ4vWu4X+ClDD\nowD/\r\n=d0/q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"a5e9789c9641e7fe2d142a57c8cab434b04b56a5","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.193","@balena/jellyfish-environment":"^2.3.17","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.223_1610411744971_0.3100534051461028","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.0-add-card-patch-metrics-8d8b2a378d117a4a1b9fa7dbb03da81bbb96fdf9":{"name":"@balena/jellyfish-metrics","version":"0.1.0-add-card-patch-metrics-8d8b2a378d117a4a1b9fa7dbb03da81bbb96fdf9","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.0-add-card-patch-metrics-8d8b2a378d117a4a1b9fa7dbb03da81bbb96fdf9","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"01f4d25318159fbf72ba9767213360dd8feea3bf","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.0-add-card-patch-metrics-8d8b2a378d117a4a1b9fa7dbb03da81bbb96fdf9.tgz","fileCount":17,"integrity":"sha512-fpP0K33r9zI58YWaPRyEKTad901sRfOxtHA7hGYOAHuk357qA+SdYrOvXwkRDtZ08vmMGgFPJH5P0ghEmwYnOw==","signatures":[{"sig":"MEYCIQDRmP5QTkJRVGhYmNGFibOBBlw9BX0vQ5G34oPcZ2euAwIhALHWmI2ImtqmcJP3zPlQR5n4P8KjIbFKaUEAMsWLu2sB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":99649,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/Rx4CRA9TVsSAnZWagAAQ8wP+QDjItgn5Aq+pyz70FJI\ngmY6+Pohch0VZe+A2SBdhNH1lJF6MBBqpBB1zbARJjpNvvpP3SdkSn4sguAp\nqnyd6UHLrbh+G8d3HSru+2jT7ZjIXKu1YzOmWwfnXF0aoSuaeAuF8p0VH5MG\nNM2Cq9S+45sCCBdGiMzsGRvVxEs1mf/I5VHX7IlfqcncX/TOK9mhQHBLHWY7\nMZcl5Fy7D0sZ5ifvv6kWsNDA07m4rTRY09e9IhHs+RNAt2+JvDv5E/aS9mrC\nLVsxcdRJV5O4xGuqo6558V1KXDisiaV12dPDaBmB7gdUGEZpvwGmIIDPuNRN\nDN1MBdrs89Dtt5zeGdWdDCaUKoCoEVb89eduiHNoD7qVTXDsW0vQKWMSYw8s\ninI0BDK9GA6cCGt1ZnTuQgthzRBK9G/94DJRC8g5/0nKZb3er+ZSX/9s4FYr\nermHTCG461pRjcPh96flSsN8Tl/ry/83o/8vTf8PC2lZvNinZyLZcZkcIHqi\nJT5pIaLP2iwapQAmQRDLPLMvvzN0cBotmTjt51EtphXALezIYJQngST4Fafn\nKOfJVnE6dh6ziT/QUQ8q4A3FQaqRy4G+Q2lkvu1da3DOeWvyevWWm2R2C52b\nBRFmv2rZiIabOOdGXnsAk9j13GEbL6ymaT6uMtbjIqGr2QOVE8qTwyThigJu\nkopH\r\n=XEWy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"8d8b2a378d117a4a1b9fa7dbb03da81bbb96fdf9","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.193","@balena/jellyfish-environment":"^2.3.17","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.0-add-card-patch-metrics-8d8b2a378d117a4a1b9fa7dbb03da81bbb96fdf9_1610423416204_0.5956520354112496","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.0-add-card-patch-metrics-956b4cea6a4b8f06bd2a36dfc0a7a40909ff22ab":{"name":"@balena/jellyfish-metrics","version":"0.1.0-add-card-patch-metrics-956b4cea6a4b8f06bd2a36dfc0a7a40909ff22ab","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.0-add-card-patch-metrics-956b4cea6a4b8f06bd2a36dfc0a7a40909ff22ab","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"742a5cbb7c92c49d240f2ffe86137327f118a563","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.0-add-card-patch-metrics-956b4cea6a4b8f06bd2a36dfc0a7a40909ff22ab.tgz","fileCount":17,"integrity":"sha512-gBGaKsGTd86+K04HsplLb40WTfmFmpjM8eZ60qRTrTXHKYStSJFQ9qhaKlYepyS3PsVGHJTaGmSW0KHZQuYqVA==","signatures":[{"sig":"MEYCIQDNSsfNIlc9fVNk9RPz0Kr453YmlJMmRzDMS1jJt4z8BwIhAO8xw3VoI2wZz+nq9FYdB/Xf9XfphIX9AH6Io/8TNRmu","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":100527,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/WqyCRA9TVsSAnZWagAAun4QAKHBbTy2+ApYq5WMCIXp\nBPyOpTviroNjnyIaLOocmUNauH5KdrkQT28Hw2n90qWaXkjoEf69NBKWuFxm\n5rxzDjmSBSILI5lvnw2NqOhu1mxnSx3tFqg0feYxOV+F+PsNu8sSpYlndQIk\n5ztW6OsD7ZqpjbHnC22jHFNCOTyFqGmJ2xc9MHcjZuEEa271pbsFSnSKhebH\nwNRlaxnwjtTlnu/m2Mtb1gEyrp/GM13edorzdAgwsTlZjmspKTHqD41WUihQ\nOlB38fKooz4gb3uDIV7iPvZieFB1WcdJ3qRBDxubTWKTcqMFbCClEBSwHIkJ\nIIMEjVm1Iuw9+vpqq3a4CFvIJSPIw3vq6Qk+EtqbLWnKVs1iDR/ep8KD5vLP\nMqqfDE5quBlIL9dgZvjIH7hfPbt7y40TxkVBEWaOhl+L5R0lW0VjN3NkBPlH\n/+O2AyLb2eswNicPk8Ge8kkXbfYsju2jn1szJqMX8Pu18TB6uhFsdneFI/dO\n/txOYO/Q8wP98/kELTkYhpDrBuIbxUUVRNdYgLw5fELUu5tMlWH8gtIM3wAO\nw+Rty1pmcnW0dnZv0G2+YDUghBfOwFdd1LOnp4RJvfMukB8tiPhHAa3hfh4n\no6kUCEu+7R52nu1qcaK64n055F/XJ533qxiNVZkXd0AVvU/ur8sGywW5cmVl\nK7wE\r\n=2caB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn, onSuccess)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, onSuccess)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn, onSuccess) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n| onSuccess | <code>function</code> \\| <code>Undefined</code> | optional function to be exected on fn() success |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, onSuccess) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| onSuccess | <code>function</code> | optional function to be executed on fn() success |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"956b4cea6a4b8f06bd2a36dfc0a7a40909ff22ab","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.193","@balena/jellyfish-environment":"^2.3.17","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.0-add-card-patch-metrics-956b4cea6a4b8f06bd2a36dfc0a7a40909ff22ab_1610443442249_0.3549254809472908","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.0-add-card-patch-metrics-993f12c3cb6577807333fe1fb66410c6193cf323":{"name":"@balena/jellyfish-metrics","version":"0.1.0-add-card-patch-metrics-993f12c3cb6577807333fe1fb66410c6193cf323","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.0-add-card-patch-metrics-993f12c3cb6577807333fe1fb66410c6193cf323","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b11449d125d93f69388905a00b11bc3a282c5f85","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.0-add-card-patch-metrics-993f12c3cb6577807333fe1fb66410c6193cf323.tgz","fileCount":17,"integrity":"sha512-GJYiXz0hQnJGkJb6s9W2zSjpsbR7iDr+5MGgsgFBs2mYXOTp9NdFhQx4hGWi3veC+g/sIG3SV8eZYIllZxCuCw==","signatures":[{"sig":"MEQCIAMgxQJ+8ZKo2gdaykRzssW47r+igaXfS5xrluCy57yyAiAngbYKt6p42oGmUQd1TgPP/o8eX3Zg1gpSo5uSNkBR7w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":116555,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/Z6MCRA9TVsSAnZWagAAObgP+gKLtZdWLBhQKdNQ7Zih\nw4ffuFTMxOwhQJMDAq8EUhfOrD0vlcEtQ3vdDerUCM6M+hH4PjenmCzIr+hf\ndxihc+JMoNVFONbgfy8lJ3wrEAxKa3LR8RcWbDEo27Xz5hxWDJLcwkL4twuG\nlZ1GqpBZoEUnE5Tjut5EwipUYcS5c1nRZ/4GZ4mcpbUVv1+jn8jtktK7xXrY\nXzbLJtBq4chswFfUi968HJPVx6/kwmTMXxxry3vVkfnLS1IZEd3gqpFATAuH\n98ppLo7VUVH/UPBlOtiQTDXAcRVowAoX3LbDfMp8i/uZwwH5SQdSIRD4u3We\nxeZ7HOLoE5IFGeblAgE1jZdR+Uf15WmXFQMOI48P9O350EP6wyaB4uQQ/Kzd\nXDJmquvcWdvQt00OwqU4yLOjDU4SoqXe5rPauZ+LpzURzUYsiRK2i9JC2wjo\n7MmeyH60Tfxr6J2XZtjz6X2cjoB5fUXhM5M/z9r9NgMJKvGgy/cShp/jkiOO\nHHBpkZ3gXGNzlXYLi8JBjBMWZyUJq74oj48OL/Ng2IJgyxnr2lONnfAb30um\nlHb/d5+S6MSsmEVhkLxDghY329Rqd5MQ85XAAmKR0+wishHt0AvMpV0loetn\nkdZ/+niBfvQn99E4w38jND9L+XZomWyHXGysiv3kT1izam0Gug21ZRr0hzY4\nj1oy\r\n=t1B8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn, onSuccess)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels, onSuccess)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n        * [~measureAsync(name, labels, fn, onSuccess)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels, onSuccess)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn, onSuccess) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n| onSuccess | <code>function</code> \\| <code>Undefined</code> | optional function to be exected on fn() success |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, onSuccess,...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels, onSuccess) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| onSuccess | <code>function</code> \\| <code>Undefined</code> | optional function to be executed on fn() success |\n\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn, onSuccess) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n| onSuccess | <code>function</code> \\| <code>Undefined</code> | optional function to be exected on fn() success |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, onSuccess,...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels, onSuccess) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| onSuccess | <code>function</code> \\| <code>Undefined</code> | optional function to be executed on fn() success |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"993f12c3cb6577807333fe1fb66410c6193cf323","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.193","@balena/jellyfish-environment":"^2.3.17","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.0-add-card-patch-metrics-993f12c3cb6577807333fe1fb66410c6193cf323_1610456715996_0.150556586471023","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.0-add-card-patch-metrics-c29f95125e1949ecaed6b382e186581f652edf88":{"name":"@balena/jellyfish-metrics","version":"0.1.0-add-card-patch-metrics-c29f95125e1949ecaed6b382e186581f652edf88","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.0-add-card-patch-metrics-c29f95125e1949ecaed6b382e186581f652edf88","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b281e85c6333d26d8c4f75b522d085ad4f04f04a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.0-add-card-patch-metrics-c29f95125e1949ecaed6b382e186581f652edf88.tgz","fileCount":17,"integrity":"sha512-EfmgTEKP8abM1gHTvq7FhcgLgx6sWdA2kyY4zevQbwjJoH5atEI7YGbAc3FeC2rkuMbXflAyRxMFjbaKuSXUAA==","signatures":[{"sig":"MEUCIE1VuOjeIbBM0lYEmRWjENzuR0/8Lt/u/Xe7SGo20ShVAiEA1lkxEzsi/AxXuvkdBerIDOHejg2TnPOBxNTpeF1yHrQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":100751,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/Z+jCRA9TVsSAnZWagAAV5EP/0AhjErQsYkwuzWCUYgd\nmc6hAF+BSMAninylQqulXAEG5dprhrWuM2qX5IZceDcv/PQitzNl+yZaCGTK\nQK777cqnTHKkSR7HrQYDueXhGqvK2bB/GHp+AqRI8cL/2qGRV1uB5J6Q4HGa\n0sAESRxjRkNr3alLTN2yHU0G0tO3XDQDeP/VKhbpbXgHc18j7uRqpnPTxNLq\n/HqfiSKQjHBK6B2qEOJYybCDOsNK8kZma3VqzGF6oNzGq5LcFUngfv4tOqba\nVPjkDJI5W2HDdIxZGfBRD/X7OArazJySzCkMErAvBJ1CWPiLL5IArueSprpK\nGi6ZBhb43QivSNMMl2xJzmWU2OCtCzd/c/KTJz5JbOZWkTTEJm7kDwXxrL+W\nDOAj+O3pK2loDuBiyrD/rsIx1bPTzY9OWPmzZAasAW0w+SJGSOKjcqee1Q5g\nlhan/HsUmB9k1+gHkWKaQydvjsYK16EQTjMYZczNbXdvFecN0/NY0LqyZOoM\nv5M+OBQ6xBZfZCxmoeJQ33rAo9trNlv5EDtl64V0ZwP7wVd/xQxjTAxunY/z\nAaOLgZBiCuDDR21TPew5nGYVu7rDvIDVx4zdeRwiXKGDpmdS6NMKvLR7wO+L\np8a8SE1qR8ZpR62lSI0JOUHoZsSHt42kr5iHBzRvmKbftgby52fCHolK0tth\n/osC\r\n=ZA3f\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn, onSuccess)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels, onSuccess)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn, onSuccess) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n| onSuccess | <code>function</code> \\| <code>Undefined</code> | optional function to be exected on fn() success |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, onSuccess,...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels, onSuccess) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| onSuccess | <code>function</code> \\| <code>Undefined</code> | optional function to be executed on fn() success |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"c29f95125e1949ecaed6b382e186581f652edf88","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.193","@balena/jellyfish-environment":"^2.3.17","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.0-add-card-patch-metrics-c29f95125e1949ecaed6b382e186581f652edf88_1610456995028_0.5515875289963408","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.224-add-failure-tests-f32ce9bba300819e5e4aeb0a3bc4c92dc30a9cde":{"name":"@balena/jellyfish-metrics","version":"0.0.224-add-failure-tests-f32ce9bba300819e5e4aeb0a3bc4c92dc30a9cde","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.224-add-failure-tests-f32ce9bba300819e5e4aeb0a3bc4c92dc30a9cde","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4090c5557f92a58640d2316a46357c32bbb689bc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.224-add-failure-tests-f32ce9bba300819e5e4aeb0a3bc4c92dc30a9cde.tgz","fileCount":17,"integrity":"sha512-qiCrttiBKKu6LJAyGYww2SYt8auo4LmUBU9Xz8YENsTgPaktej1hgZroKGiACRkbLzCEQqkGKYGi1d4WXL5iWQ==","signatures":[{"sig":"MEQCIBhu6S21bZ891Dj5qi3u98lLdEL7I4NVEBHHnNNZJiEJAiBVs2zlBTlPpJnP+up5kwxw0+g1aH4cZCylEUMFriODnA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":97917,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/nd5CRA9TVsSAnZWagAAzvkQAKCAs+2dvBj6m6zvZNQP\nixGQrsUZ8gmLND3IUY0a274Iep4ZvlQ/cw3AXa5axB+ZK+TMDUYWo1Es/j8u\nURrCtJ4OOIT3RTDKCXxDeyQFE5y+SiUow+oH6Hi3Z0W6C99G+VLbA20C0xfR\n7XFRcdhuOxdjwfKtfvbwy1AtAG+iOozduuy5VrYOI3M9NwNWroNLZ7D+uSCP\nXs2zxbyRM345iVjJrx7BqLc/tyIawHSHjQ+BrlWfhaGZLOvqNs/UyGJaufp2\nfinGZj3FuVoZiYWl38dCs5lJS6XiEnfXYkLGuhYSHqzh2ey5G8VvL7274Jac\nI2dCnDG6+cVMf/zzFv2kQSKVcNUAws8I1Jnzk53dfR6LQghD0Cg+W1LnNAgg\nHUgJkUeF/+lHD2EpYsCZgjl8rAjgSmmrO877UPOcFkbkjUudBYJW06+Qhh4C\nYfDOA1DOMfHHbyfC1zEmkG/BepZqXmYb54rUkrmZjqkky2OHQPmz0LB0msMp\nczzaMLPA8gylArc02mrhg4j47s216D0vasqyY+NYY4MqDHqVF3/ICJl9eAgd\nJhMtl4L8pEcUDB+vpWo3ecmYQLI8RJeWTeMCE7yf+Eif/hLdOJUhe1AGXel0\nqP/xo5u6bYu6mDPV5w6fYqaQPF2hs39m3gVeY7KfvzRoNNV1TTs9APRpG6rL\nJv+j\r\n=JXhe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress(context)](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress(context) ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n\n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>Undefined</code> | metric labels |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"f32ce9bba300819e5e4aeb0a3bc4c92dc30a9cde","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.193","@balena/jellyfish-environment":"^2.3.17","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.224-add-failure-tests-f32ce9bba300819e5e4aeb0a3bc4c92dc30a9cde_1610512248655_0.18058396749078143","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.0.224":{"name":"@balena/jellyfish-metrics","version":"0.0.224","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.0.224","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d5df86fabc5b2f327334c58294691652376b14b0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.0.224.tgz","fileCount":17,"integrity":"sha512-t1lPIGUmDxEAI0NKuxIKMFT3ML9qP4/S6XpxWf4GhC8mMQ2Dz+GFJPa6997SxkladvT2/8K6rHnAXv9TFcWYkw==","signatures":[{"sig":"MEUCIBZF84EkLLQ4Rcy+OGFX8sw1An/OMY2rloZkVDvLaNzKAiEArpVWfaYSm37qtUObnCZQ9Qf4XUzhajATOFI1Ys7W0JQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":97858,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/nqxCRA9TVsSAnZWagAAjlsP/RGwAJXFHvW8Lyj/4gog\nyGGa8aAHOwDHQ3R7565y0xNX7GzU6uAI1QAcwg/thFpNgmfIddeEjYZh7bRH\nD78esay62jC6p2ieLWBV0JKmWR5V6PCKFrKX8Mu7o0txQLjX9Teje+eV3cXv\niF19CYXthz5F+gFGu78lpaxKlyo3vBTer/HhMFY7XmaFNVKDCII9sin0UJRr\nCRD+nZBQgtNTb15eNV0CQOQHgkW9FjATx8HgslKQPl91+qwzIGiW6vPOHkg1\ndkO8s59qyHFI/nPOa1n25wMuZnxsc4E4t5WVG5RUMQqHzX30ONpf9notha2a\nHd29boxw9NsDrIskpeNbZzo4sm9muWbCombNy7D7exF98DxqBK8RusP6ZGxy\nAelltRvy9AE5fEpfw7CfF4AMgAAfLH/wqapXLfa22VSNg8/I9pmdVsw/Cu4d\neQKRbygN8O5js4pWQMaH0SNg/VJxo1t3wfT6piuoxK5VHvucN/xq5WybTxAD\nO+Nd58O6jtF5tNgUKFzRYhNsvNqzqKZEQgkyh36gN+i8FT6VZcyMFBfU1ctP\nfyAExbrOp52pd0oMAsV0iYbJAb7qkhYYbPktjoJDr7ARScP6U1xtHa5f5oqM\nqQGL3xD9MenJl8xkYgIcxFBI6RHjbFnMm3uCq/DfkdKcQKeOpL8fvgiNOCvd\n8hL5\r\n=n3KC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"4046496040e7840bf5d7ada2f69e0d61d6686d18","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.193","@balena/jellyfish-environment":"^2.3.17","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.0.224_1610513072639_0.16195604700470434","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.0-add-card-patch-metrics-a568560e79ae9cfa5e450c010fb7673a453c987b":{"name":"@balena/jellyfish-metrics","version":"0.1.0-add-card-patch-metrics-a568560e79ae9cfa5e450c010fb7673a453c987b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.0-add-card-patch-metrics-a568560e79ae9cfa5e450c010fb7673a453c987b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"de6aae5f6b39b9891bb612c0b424ad46fb451ff6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.0-add-card-patch-metrics-a568560e79ae9cfa5e450c010fb7673a453c987b.tgz","fileCount":17,"integrity":"sha512-N7dD9jPbCiI/g1nmvEnL6JeMlWKDxEfOjZGstLOEN7UtTeq9vsJoDLAZVgMiElAOzwgeqoQIHintZoeeSebJJg==","signatures":[{"sig":"MEYCIQDLgL6ViLMZwuEdutdpPq7RLV6rxR5XqcCeJY1meOYhDwIhAPD5IcMrrg/HjTZd45idKSAMMtuQk/uF9eV3LMrkb3iR","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":100740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/oLZCRA9TVsSAnZWagAAx5kP/15pnHz7+2fYiWjX3D9w\n7/Fe6ADMQipfSQSN1d1yQU1jwiRX0DPH1ArrecVVDYp+Peyg4Tx2zdAmK4Eu\n3Y5QX7MQXi3moihYFcBv1A+wIS2v792Gr3EPs9/6LB0jyz/8IzaWWnE+5/DH\neKSqg75G5YGBixSofvnwgxciyOKcY+c7BHSIrrYVJ4HazvPIfO04IpnJZKb+\nuH1FDqcyAc5uY4G1XiS7Fezgdu6gLNu+2JHpF4z7yXBoQMYIFRW3H5wkburQ\n+lEV6+/NSQvf9pm+hErVUks/fPBLqLWo1ufCtQbACNM83nq5oJyRB1f+qdfN\nqENoXS8PNVnbG+HEc9/Xi02UsqUJbJvSoeBUi2frPluiamRYxhEyvaOJ/6au\n/VM7vk0MNTyNeqMolwtJSWyS/720SJ1RZPND8wYT3fhZ2YHkiLgPkf0qLXun\nzB0laByJkyxsLMj8ghAILdsnYzsVWKJquTMP/50ixyjefRG94k/QogTKuBLV\ntxfRrFYigu/AUiPuIeOe0/AEc6oIU9reC4y0ZOvMbGPBseDpQthgJlD+OKCp\nsE+TLcH5FheDcef1hSzoUoqP3lYMsVKWHbkZ4yzJCNtTLWIRR68C6v4XMEue\nFYm+pp/gT7LrK7YVQNpkdPOptynPKTuQUukeStrsxeHT2gXOWyBG0kXYbpeL\nC4WZ\r\n=WBbS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"a568560e79ae9cfa5e450c010fb7673a453c987b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.193","@balena/jellyfish-environment":"^2.3.17","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.0-add-card-patch-metrics-a568560e79ae9cfa5e450c010fb7673a453c987b_1610515161223_0.15853772072749894","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.0-add-card-patch-metrics-f76c0657fe970753da880ab3d57f6ba501464e47":{"name":"@balena/jellyfish-metrics","version":"0.1.0-add-card-patch-metrics-f76c0657fe970753da880ab3d57f6ba501464e47","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.0-add-card-patch-metrics-f76c0657fe970753da880ab3d57f6ba501464e47","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fbc7c98e05d83200fee0fe6b05c161027a131866","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.0-add-card-patch-metrics-f76c0657fe970753da880ab3d57f6ba501464e47.tgz","fileCount":17,"integrity":"sha512-zXUI8KYYZHjwajA+yb9X7WhUQO7zmbFRJR5xCiHraT3k+8RLSP2nEgw0azearrEuBbn+xrfe4tcYlhz+mpHk6w==","signatures":[{"sig":"MEUCIGl+Q9R/bz8gRXp7nlkd+PxYof9M+1Vu1TIY1HKGk9rXAiEA2jc5ian4w/FukiN/k475o63Xpw9fLPTX1d85ACo2h+4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":100735,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/oMUCRA9TVsSAnZWagAA4fwQAJZWX5JwT11adZA4TWCe\nyqWhzNzgrP2ZqtdR5AlTItYT7Ua/AaZTaeTFRcqIW6neIW+WSFO+D3dDDXWF\nMF0BUgBjhcU5CpZ4nKH/dlYYCh4HPaI77FWH3T4wANpEDxIAePe6KybvfBjj\nGDfkAmpzjwzS9Lk2FMXFCxF+MZvC/N33tD76A2BtnH3OZLm70/9TNlAoYixy\nt9lzSq2Vb79wP8/xbwa/YKsRdbaNaqD/ulIdqDg4mHg7Vk7hnpyT8gEliovz\ndqZQuvFLkKQs9sor3v7UfcWXhbbRrd4aUdkjN9N0A3fnLMjjcXxBkSKR0/zy\nzgySsBVe07iNlKzt4Rj//3LJM+OvCzcurSusXBTYHEyQaf/njOZGYlx+nvwZ\nB77kTWKwb292vp/SYIvfb1jzw4D9XCZo4zoNS7wmzefrMhDpfrCTZ4SsOWfo\nFdGs98hITcJQZv6BYQ8Z4Y1El7tezgbdUPMx4kfXs8hAXg7AREpt9fmOfiBt\nVgdO408hkJpWDYCPDhQsJ57NsJ/kgRlvH5nZZCsp/PUVyqVpNeQrzPZXP/+B\nJhWxWIxMNoFvAcPOOVK2Pbv8AdQ7C9nkz04rr7LxH+k0s+vpAejpNa+C9T9z\nRaFoDXvbnNqjm2oUY5iznesavSYfJS4pwWC6twoYpno9qEETmua4NMDTQqTk\nm8ZN\r\n=RkpQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"f76c0657fe970753da880ab3d57f6ba501464e47","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.193","@balena/jellyfish-environment":"^2.3.17","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.0-add-card-patch-metrics-f76c0657fe970753da880ab3d57f6ba501464e47_1610515219511_0.3917803752816009","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.0":{"name":"@balena/jellyfish-metrics","version":"0.1.0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.0","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7629f3f28fb889d5734f041c006883b64b3f82bc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.0.tgz","fileCount":17,"integrity":"sha512-ZX4ciQ0xDlMgAok2GdGB/gYh9BnXj19HugzAqDdxVC5rIg6W1ZzDahDwwh89xwX7tSXRfnu1/olRNAlE18E1OA==","signatures":[{"sig":"MEYCIQCmCrsRrbvgrLjFjJvyXF/4YA7tcCgweywBLzjZ56IQ9AIhAMB8QJtw5ZVoNvdCCBuP4ZohWnTh+nq7+t/sU1VFKVvJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":100671,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/ogRCRA9TVsSAnZWagAAOsQP/3+0AaOShH8m/Gp9RK7T\nD71dIWHIkNJ5hSe9t1c2QH5ApUH3RexAjXg6aOmLhBEhy3TbAhRLzvVZZq1U\nFatfCWJ+9bDrqL2ZHza2YlDXNkwz+vFE+UP9QGPIzPBIMmQ5Cepbe6lkqUsN\n8rRKydX3df+pomCiJQJk7XTqrcB87tbFy6S58olwvkVp69qDVMoTgZIiuB9a\n/jOKa9n0z0Kj6L3Sp4jWDdSBlzr4e8plUXcnB1Ea/5iXTDaQtIDWw1mc4IAM\nC/HxvZTm4aWHYHItWwhRCZurRxKtMWh3yPrVpG2XxZb/8kaO2L6YqvHYuhGB\nAw+ALPdAVPwjwtuSfKysQ13xuHq4491SuBtex3sse2D7ZMBbZwzqWGxxtzH8\nwumxXmgYoroLucX4N2XoB9mhGIf149ZUgHTk3LdQcR6LtK/igzEtYCLOQl2m\n7X4pvHYfr94fTYf4wenb80JDVxRJl6JgCniZXtLysJBmdXi0/FjrG94Ahqz3\nODycbvGnWnI+UmYedjG/Z1kPselfWzICKWRFwHLEtbx9oaaGh56h+WLVV2ZB\no/3vPCLT93e9yztH/82NrUKCmw1f9CTQgUhs8NdjisPnBKLg20AL1ohaFpr5\nusCJG+CstJtmbsf9nUbErgPuYMzxxujBzASaZjv5EetEMpiFTWSZPwZG+K/L\nhTBv\r\n=BzYb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"07925ca4504c7678c3441c7fb29eb15d3a3e09f9","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.193","@balena/jellyfish-environment":"^2.3.17","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.0_1610516497260_0.014327635036028408","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.1-renovate-non-major-30d8ab2254c6ce4442c9993ab5cd8ba7f6d83689":{"name":"@balena/jellyfish-metrics","version":"0.1.1-renovate-non-major-30d8ab2254c6ce4442c9993ab5cd8ba7f6d83689","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.1-renovate-non-major-30d8ab2254c6ce4442c9993ab5cd8ba7f6d83689","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"576acc9eafa4add7bbdc21126f7fb27643a4fae7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.1-renovate-non-major-30d8ab2254c6ce4442c9993ab5cd8ba7f6d83689.tgz","fileCount":17,"integrity":"sha512-GtE61Qdut7ylUyvczRg7oKcCtTjn/3v2/JKXZETjSRF8bSpqMWCGf5CMp7ge31svP79p96H5Vay7xGIY3e05NQ==","signatures":[{"sig":"MEQCIAb/7TA4T7JJcZ1lyOSsUHgQmKhzzgxUzEqTVW37aQPoAiAgFU/Fcy3bsuhwRbRwIxvfMxOmmg5j9HRNOubKBxJUnw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":100837,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/vapCRA9TVsSAnZWagAAU8IP/RtMQ8StJauqymYbjopA\nU8DRQPRMHNEE5kMTqGYiHceTfhsyWA6AjYtRFLwQvRac09qly6+LGw3gU9DG\ndM+grNu66H4tmbGh/sM8PlJaRLRZAdppSCwI7qnHdSZS0zbeCXszDEONvYbz\nLdbq+k5RuDhEmjoddso8jwhmr2a8Nll11X8n3SUB5tadHmvf9OKf6WKUCrvp\nwyRQTAtb9v92LIR7Lp9hIm/2qqLz8hestDm7JeviuEz80DfAWozJYlhvGIVR\ndtkFu8aDtDEzPT/FIfoa+qp5foexZYFRSEZDRSyEHm9ewEmdlLNR0PffODtA\ngODE/xa4qQkCSWgldXz/6z4FY/zWDq4r1kPG8DKyNGyW4CSJS9w6wWZzwdpb\nU8mT8q0JvngaJIOOOwbo70c7RwXe2VMLsmkl1IeSmKTs1WWFz5p3p7K+vYNN\nn/XS4wE3hVyoiKeBcyBO4RgRht6GQlbbih+TuBl7rGYiJaih3TQYBLUSPtD3\nckIFpYns3jmBPQrW4EsxIQv6ZVN+w+3zvvvtdiU7WvbNfKhUPxKUl/saVsOa\nzkTVnoilM5YA8BBzwX9F/zAEt9fHGjh5c6C10D5vYZMycyJ1DqVGQRGcNMgX\ndH0QlaN9jgAwKeM8Es0N60PWQLE5mGEwUTaA0Mijgu67a+MEHnM62XY63n22\nP5e3\r\n=kgPQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"30d8ab2254c6ce4442c9993ab5cd8ba7f6d83689","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.194","@balena/jellyfish-environment":"^2.3.17","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.1-renovate-non-major-30d8ab2254c6ce4442c9993ab5cd8ba7f6d83689_1610544808704_0.32132060863650636","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.1":{"name":"@balena/jellyfish-metrics","version":"0.1.1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"852b324c883fe2d5cef883c69ca677df8f6baf20","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.1.tgz","fileCount":17,"integrity":"sha512-QL/kC6XSsU0cHfUL9ge9j4x8IuJHupzec/iBHswljxk7Og/VbzMc/eDHxrG2Qbm3nMiGKj+JYlpx7qMgeitXWg==","signatures":[{"sig":"MEYCIQDC4Gk2S5+iJ0iG0Mw3xWsspTNXO3Kkapo10Bx01DJT5gIhAJ4CJhrDu58mBRnFaC5P+2v9ExYqkyUTdsysca2RKzy2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":100777,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/vdUCRA9TVsSAnZWagAAKJIP/1pXXllDkqH5BFsqOeGz\nwn9og/Kh/tml+fbHZEspLqOsDiAbEOcmRkgcxLMijk5VQCd1tQZ9/r7Jk9vx\nXoVhlP22O+rKKB3JkQAkrg4VneNIp6NNySmJEItCSTZQUleYz7mQfa3uh6hM\nS6EVIIcqt1ZWyQ+MOWJTf/d9SvJvnq1m+3A5qiNke7FUb3nzIbQuFTpbhQFL\n7vqKB/Invx7UODBR52Owtsvt8OBDwZejwdtl2xLlwdTYrbYe9MfUR8hrjJc7\nrHzhfNIKV6s5yWuvFEXPB8PgD0BGIt8MygN91+ouYV3LZ+pNFzDZMeASBl/c\nx+F6ehg66u4uLVnKPIxamzH85S2suqBp6a1p5UMEsWOjIz5rlAz5SCH4b3r7\nN2GqxxFEhpL9za9ukv2lyMKIKJsuIfnnbvoLuIPrqVQupPQdG4+aDAPoJZQ+\n1YQUhqpXwwVPhBakzWk6iXlYS++/ly0fGKcTPAy9ADirf3bZEfS8UIq/d1hO\nJmjBxORrCMbA5pt/PxY7Onw80DMW5nf7554jFmK63axQ8xKhuNNnW3PaNLGD\nOleT2osRD/t6pRJttNymGM625jo2Ua40squd6u4XZaJOAEclM39nUOyYlgEs\nhhs73KnwDsPtJfkiVKYqWgrMDd/nje66uI8wStmzctQr2+MdJt4d4YpIpL9r\nBEZA\r\n=GMan\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"7d0ab3160b9a7287f88f4daa3c7989a4f6a3b48a","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.194","@balena/jellyfish-environment":"^2.3.17","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.1_1610544979981_0.5562969801120896","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.2-renovate-non-major-1bc5db2d5e476b14f7fb0f6b993a384b1d65bb30":{"name":"@balena/jellyfish-metrics","version":"0.1.2-renovate-non-major-1bc5db2d5e476b14f7fb0f6b993a384b1d65bb30","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.2-renovate-non-major-1bc5db2d5e476b14f7fb0f6b993a384b1d65bb30","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"36e059a10f2ccf056c8ebffcaf127f76bb849124","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.2-renovate-non-major-1bc5db2d5e476b14f7fb0f6b993a384b1d65bb30.tgz","fileCount":17,"integrity":"sha512-xJdZWbF2BBZvtYuDoZJELLsv9+55m9yXxwsQJeYBK06GwZGCz1vKdMHa/0x2xrLEoORwtlkfYPaO54fNUbKPsw==","signatures":[{"sig":"MEQCIHL9IoEvnDNzWrGxjZojrnf4L7pFyIdTtrIRZU7PLX+qAiA7LmOt2pNI8z9E/fay5NaRUiHoh+Wl43LuUo546kyEsg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":100905,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/7TvCRA9TVsSAnZWagAARW8P/3qwqvS9LUUkQJQ4uLGA\ndm4FLcVHvXkSgRVsZbU2h/949Y94go6/ROkHf4u1c/jC3RhTFqmha6N8Y+Xa\neTkmzPVe1sFRSmEmzW+h0A1xqy2IRpDBgTlIL2e3qrcMKoi6LcjUDJD1GCnn\npykkw2NgeHPwOjeUtKS/A7UxHf3PWpJYw+q3fGzDvT8G8jE5saQ/0vP5W7dQ\nuKlutCadsIjdyEsE/OmSoJXkoKT0t3iEOJMmLqk+OrvhtlbSIpyJLOZeCs4V\n8CcyXMapkEokmEM4RXjzW/z9Vl1iCBRbOeMee7+32Wauo4rGosE2C3pSFzAr\nd1b2I2ssvfSV5IBD2g85WKFCUFzLPcU2SQT4gKPvBUJ5RCcwEVkBkoOmjiww\ne/xtZljEfLWDKDn30l7uRvx5c80iz8OdUQKo1xi77w2c3lfa3MHmfccMth/8\n7Ka2t8efb6bUHhwepLHyjNEIsJhxUFzhMOq4XC1oG+bqI4XHc9aRc97dowiA\n6os/LywESKUGbSBnVI9LAyrvP9K1JmHeoWIXKN9BG6ojxVHs5eVzPx/Kua9l\n89cibypxIMX0zeFYavcERxq2W4jWpVkyrO09nnG49jmztGc5SuDqfnIWS9iC\n71j2t5myK/5g3+32T08UtvXOD+tcJOaRBZWl05WbiXppLBKkmQq2QVZ+EDec\ncIVc\r\n=o1M9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"1bc5db2d5e476b14f7fb0f6b993a384b1d65bb30","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.195","@balena/jellyfish-environment":"^2.3.18","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.2-renovate-non-major-1bc5db2d5e476b14f7fb0f6b993a384b1d65bb30_1610593519332_0.7978791090617414","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.2":{"name":"@balena/jellyfish-metrics","version":"0.1.2","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.2","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b31d9cbc928ec3724dc5856744c43934e9307d92","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.2.tgz","fileCount":17,"integrity":"sha512-9heZjANXGgMGbdd5RJ8EJmG5AihxFyGs8MuGAS94sAMgykBL93qrKiquuHJgHP/OF0cWkem3s7SFkomdC5lfZw==","signatures":[{"sig":"MEUCIQDEP30IqID223ove24U0zYy82gOsTXM+owMQbk/72f9uAIgHAyeYetUlwYFvTc/69I9xcGRoz9S3nVEma1bC9b6X7A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":100845,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/7WrCRA9TVsSAnZWagAAy5UP/iz//h4/N6mL1rNjO8nH\nfdH/IOrOkKlphJ8Thqa6y8HcQE5zFup8XQeX6kkhg+HKHIJ9mohEny99G7rt\ntY0uIfZVxv2ypwSscNyjU1FiZHzr8pHcN39N5MTP+4Zf2uFEpAXe3184iVdz\nuCdfdXgTlQgCaTEkJL/hiLADNynrWO5/Hl35dxi9JCt/Po+gXaChCdK+lgVf\nCjJoqx5ndVkqFqauVhYLcse0Or4xndQ2EUFTB/0lMYYQ6gKECqVpA3Y4QdTb\nUc7QRIpzfj4j7LzLCK0GRpb6oIXerr0Ack8Ehh0zUBiSaTNMUbdK43ZH2xbS\nBlUggcGVRbvee5GL63rGDGo3CedcaXAQuxfD58NFzFDpUkUBzxEXUGJjrF9o\nxSMlqHGOGstBsMlnIPeskQtE/ZuHOmF7OY+YIZnpWRAYfENU0Ze8C442gfhf\nD/32CcsFqX+4ITSOGWep70cYfMVEeWDQ1F8xaBsuzZ+oDajvu/hVVj/PsUyS\nPz0tTlNFpL4MEdgsJzRUXcOu1BSNzIabQ6aY/95TIjpBixJiTmAxnUYaTumP\n38rYJpIjBVJuPmEhsHR4t0YuJViZnKeQVRFEDulTtQ4BcxHGQXjJyHqhr3xQ\nWe2cWFpI8ZF/7WI6kh8CJiexdJSJmq7VEiwy4KkSf0YHU8KBaWBCXe3+4Won\ny9/N\r\n=T9tk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"79e7ded53197ee4492b7d7cbefb67e28c97ecc79","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.195","@balena/jellyfish-environment":"^2.3.18","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.2_1610593707145_0.701146457939164","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.3-fix-lint-staged-068b95b136f89096ad2835208f1de1a4082cbbd4":{"name":"@balena/jellyfish-metrics","version":"0.1.3-fix-lint-staged-068b95b136f89096ad2835208f1de1a4082cbbd4","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.3-fix-lint-staged-068b95b136f89096ad2835208f1de1a4082cbbd4","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fcd2ce36b1fa326ae09347a2c3a6eace0d65b94b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.3-fix-lint-staged-068b95b136f89096ad2835208f1de1a4082cbbd4.tgz","fileCount":17,"integrity":"sha512-T/a8v3wDbBhYLpANnfUltIzcUWg0m4H8Uju+ABBbgzMXGHJ0fbd/zox3Ivh/XpEE1g+C3Y8BWCSP1h6ZoqeK/w==","signatures":[{"sig":"MEQCIDA1LA/vK84uNwNqR8G9P2HmV1pySsdEJbx6bMgYPiP6AiADAd6oDpxTgv3Ao61BCgN+eWxuQe8HQSMAjlnJarhP1w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":100994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/8WECRA9TVsSAnZWagAAbkUP/jVffiZysWX30b6VCFXz\nzZuTSnBsQbfp8oQvRZAwFZX/czumbrro7dUUxsCr+rMsj65hqwEnyU1nBiNW\nxLs3eX7YB6Gqgrasgj0drp7y5uIaShqGe59F/R/WFKBUNfF6iVO6WJQgXqxJ\nw5aD42BZe5m/Zk8Y5I7E7ILzLlSJw3Mdjry3Y6toNW+E+ekS/SI4Ijzz3wlz\nrMN+oBnCeUiNmne9DjMsMxbqNmDrQaTkG0Q09py6JEbu37J3119SaWfwTS2D\nAm1E+sGshdYC+iGw2y1ecaX/Bs7l5gbnQK0cBbazbdErkwb5mOj6hPVAN5B3\nxnQeIR2fCrFPyBgvV0PltLr7YOV/j0nOvB+cY64p5bvt+UIZbLczVTBFkWs/\nr0zgMpAb8V3E83ffDPj/LXR0bcWzUXd6IqizBSRWzLTj7/fpw9Fhoxf82YG1\n6WOTXbgxoqsK9lckjFEtt4xUxo6SBgFdk2FfuJkvO1euPDztbtxmpn/8ohjd\nxrCdLkKM1fHTPYAyHZ1xgmtPo5YJVhrjBc9nrDoYxmP0dQkdgl3GRD1cn4w7\nZ2Nx21GBhDGA/PR81xQrQ1d4afCe10d8HpgwtRBw0ZECeZnbAgvi73UxKEAs\nmEiRV4RNHVEEEN3w+1fc3dtrRTwiAHB/xwMKOTPj6VzCkpNvSQLwsF49VwUS\nDqpC\r\n=HH8l\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"068b95b136f89096ad2835208f1de1a4082cbbd4","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.195","@balena/jellyfish-environment":"^2.3.18","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.3-fix-lint-staged-068b95b136f89096ad2835208f1de1a4082cbbd4_1610597764081_0.3486039541133754","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.3":{"name":"@balena/jellyfish-metrics","version":"0.1.3","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.3","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"56a09694a9fa71a7326f9c45f79ba294466eca3a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.3.tgz","fileCount":17,"integrity":"sha512-MDaPcdVGPVgCMS0tAb7hOtyRwsFZFddPStaMt+hdREiND9dlNQUAJesn9PI6YI6JA9oYizkvzMpfhfEMwy3WyQ==","signatures":[{"sig":"MEYCIQDirRpq6nKb6vc59DnGRoCtyd35fnuZ+AlJGEdnOGBUZwIhAOlgoRtpS+C950HxUvw2knfuihnx0V6MlpMiCdlWqDVc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":100937,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/8YyCRA9TVsSAnZWagAAjgQP/39q0UqAmgbyK+oDQ/U8\nvuwZW/RdUtmHwQoZnXzKYVaERsRxcR6TUsjc4P7Wqh1ca/8kXxCOekFB25vW\nXPmTHZ5ZvvT6gjpbll7SwUT6BFHWOERaKKicMivNqp2bAI1dQSyAZ054pe8X\nBnnj3BgrQ0smzgliFLYSvijiUq3maGhGo09wK9as+Aveho0nmRl3IeJffYzG\nGZAaDHznqNaPjqyL4h2MOr4AK91KgK3MmqwB4w1+MRbqoewjSmo5NtTd8RHV\n2vdn8O1bHwnnktYS3ed762/6u9xwwB618e3p/pifbW6+/RJqZTfUmzgLUIy9\nKINDK3oEXXmeKLJQCf3aibQ/abOrFxJKDgVyB1ZBLz5O9CijCFinbtCp1VT5\nq8edqycdBfZUmXPYXBUK8a1jQKptduEu480YyDvg6h633uDiTGF5ozKLmQ4l\nLVeL/MW6IUnVpKH9QI7FmY3gpPpC/pTgHYFJnNI0m4RiRTRAschwDPjUj5vP\nuB5q7lTFmCw7OxBGCwTrKmK15jih6WomLg2yKkMVYSvzoqXv+uF79gySFu0U\nktUwrRmFxn5oL5TuaVIr2AiEZtJebTxmSjT0jJkmUJWLodgVk3d+Z2x3FcJP\nzLVpc0f2rXC+/WnzfJ8AWTaITYE6H68nVEawTQl7a6ha9/2ocdMIrC5nC1cR\nRwOV\r\n=jWAp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"96d274f1071c3e7dcb1d1c97a321e941910b4da0","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.195","@balena/jellyfish-environment":"^2.3.18","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.3_1610597938056_0.7739596288965727","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.4-renovate-non-major-d2d2e3eb3f3f3e433509e09c2c882e5419870eb4":{"name":"@balena/jellyfish-metrics","version":"0.1.4-renovate-non-major-d2d2e3eb3f3f3e433509e09c2c882e5419870eb4","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.4-renovate-non-major-d2d2e3eb3f3f3e433509e09c2c882e5419870eb4","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fbe7e325dcc18e8abb91089f81d395865834dea0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.4-renovate-non-major-d2d2e3eb3f3f3e433509e09c2c882e5419870eb4.tgz","fileCount":17,"integrity":"sha512-PlpqBCagdbthw0firrKopVpyXg7aSexj0sXlxctCSiGQsUssNjXmmUm7sJJNNY9ee63WPuVKkYrwHeRoxL2YIQ==","signatures":[{"sig":"MEQCICh6c30Tob0FKmyx9Z/gaLQqC4d+pfXrSfCA3wbuKyOTAiAgO38hIYxsH8djjZTah8HGuPHu6E96/1j8yUeGNyBBWg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":101103,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/8dZCRA9TVsSAnZWagAAxl4P/Rv3Tm+Wj4kbLsM4itoW\nmATR8MktpL5WWZffTQqmZsWzEBB9oqepHmXiRJefWj6HWn2abxu0T47sMc4C\nSxewZeH42xMGDwXGAMdQ+IS+/NUhUwO/e6qq8wKpEombtcjH8wpsSv9eJasW\nOwIVGg4TwJELefICfAK5dHu69ZnUkUQtsJhWV2yoEC6zLtkxkKD9e0d9I4Xw\nUYkqGtiCvG5M+mKCfXeqFtGihvqHg2DjEVp4+YLTgl4i+7VDSGgT1+Qo3XZX\n+Ygs1D60C3SOjoGvK96L6lCDcIFW2kM/OjfJ2l+FRBYLB/Yh9sp+b0+hnFgs\n/7zPFj4Ievwbyx5KGRAhHrmfUHvH3K6vxknu6SC7f4YKBh93OQZHE5CnPprh\nuQa9cyJUy1JHqoe7iZs4SZ+FzZRFkHLXIAvS+GR+XFocFnS2g6WtWtlLmlAw\n3WsybZaVNNvlxh6ZUt0PeFzMCTzar+Z9yjsM/29RiRW29YTVZUd4CzzN4Umq\n4eF/wTq+bMWFtDvLVtmuLM9/ZaXixNgFQRb4dtpmh+s4S6mLZc/+/osMxY2B\ntdOYFVWzbUCS9eejvvFFMRISzWGlY1zmRj38Br+enVgvIelciXofaUd6RRqI\nRrBDqHmlN3rbPlM3PlG3dVSF0KPRlcd/QnabIPwyQttemEGFR8zjPJfl/81U\nF9Km\r\n=4iQI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"d2d2e3eb3f3f3e433509e09c2c882e5419870eb4","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.196","@balena/jellyfish-environment":"^2.3.18","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.4-renovate-non-major-d2d2e3eb3f3f3e433509e09c2c882e5419870eb4_1610598233182_0.21648882877915643","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.4":{"name":"@balena/jellyfish-metrics","version":"0.1.4","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.4","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"77653effee57f8ea24f8678d925c110c0eff239c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.4.tgz","fileCount":17,"integrity":"sha512-1JXdsqmGiVHTJmlfGulaXc9irblo5B6Iv3kN31DrXMBvgjP5C/zGM1qIvLzybtZq8d5omOXPNfdXALqLOz5HOA==","signatures":[{"sig":"MEUCIFVZpizKZgl57eDSkq5Z/RsfzY4Xer4YAZC/VhHxllqZAiEAmPMsZNIFfiKIVRcosGkxYJe+2ihRYeWVLKp97JyuiHA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":101043,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/8hACRA9TVsSAnZWagAA7qsP/AxKU8wBKKzMz/4r9oHr\nYTVAkqmJlvsudVaOpNOiDeQUB+3LiNpZqlE0IOn7FB2qEtFnOTrgayR4QI/o\np0ywUF8+wqQE5LEUSoUN6iIs3KiUAl6rjtZqOEA6ySog4hSQLXM1Qh0Kdr6n\nm117U5FlQ4h5bjFag7WKk2L6JIC03hZ2YLeY91CoVaUNK9MCuYbHY/oT4Llr\nfjw7Gx/rsVgCQmVzSOLFBHcKE7piS9w3mrK9nfJsUes5Xspui80lyHGAWqCD\nfxnHRdz1f+77fnw8e30Ti2hMkpP1mVfS3OiNV1BJZ3JEy+JQMhOtshhO8bTu\no5bjWfBstMkXCw18ckfNbBIhLExnnMs5YzJnIFUNsQW5Xerxt6F1dQzK5u3m\nmKMfQg3vLK38oMsGfcTEqlW55gJqh62gXgQfAaNpy08SWa5jKzMXoQAU7WQt\nz2L+ajdO1jQirPIMrYGGlrASB4DIk0yxSmgofrEUIKqr5veFD37wMs9zHM79\nTiqoczuZyQhnoJXk6xtjVF9mIUORnrStVx+s92wZRW4XmvuG/pK5jlplvDZX\n7IGTicemro8Hywovz16YDmviNqi1aBquDrgO+8gpFrCxzG/xpxcL8XvlvQrl\nzIk9ReURFccst6NnhCRpRt1UfiFKCLr04Wb0IRd9+TrUYyQFV2S9a+fNDipa\naRb7\r\n=GZdq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"3ad4d7f759d45b07e904299fa36030c5666452e4","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.196","@balena/jellyfish-environment":"^2.3.18","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.4_1610598463874_0.8163417538343267","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.5-lint-staged-add-readme-ce3cc11920ef6815ee8eda41ca21fc852cd095a2":{"name":"@balena/jellyfish-metrics","version":"0.1.5-lint-staged-add-readme-ce3cc11920ef6815ee8eda41ca21fc852cd095a2","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.5-lint-staged-add-readme-ce3cc11920ef6815ee8eda41ca21fc852cd095a2","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4bacf3176e2a22c14b59f05c7a8a5da61b847b83","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.5-lint-staged-add-readme-ce3cc11920ef6815ee8eda41ca21fc852cd095a2.tgz","fileCount":17,"integrity":"sha512-CCIERFZ64v8iiObHwkSEzsYaJnPkygquzk0n3MXOlqxSVhAOO6u0SUHHmLZiqGnWpxefTUzwNbfARXlY/r/MNw==","signatures":[{"sig":"MEYCIQCEkcT5jI0Avj2yi7kTC2ILbp8kN5aGUZgAWJVbA9Vz6gIhAKoDqrP8QLutmzpivx1T25jqUPDuI0CAT29qt63eGWjN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":101203,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/8nuCRA9TVsSAnZWagAAOF8P/j0MKdmz4v4HCRfqRN9J\n6GHdKc92LdAEJxezyfAEl/qv+EvX/Zy1BLhoFfvKbgTMZQX03iL0M+jb0gzc\nNIq7yNbe/scgMHt7uoJ4HOW7M/I9dnRQRbfc7LWGa6PJC9aktZd2R3W5lVuo\nTXferWVZwx9pBTPqpHrVyro8cxWIRmHPiMU0yrVzcD10DaK2KzQcN40VRbGq\nKAWynSOmDHRLpkOb/+lrmYh5WySVIxIyme9lnGsJqXRr1H2L6eDMlTBC8Dxi\nr25hNX6HulQfsmX1KO07mT/JS7BM5if/EjGVHbNkoHLDVqim/RNINRoWhZDA\nYYGjIFwemglZZxQK1sjBlg4TV4OJ0D4y497Yl2NA/7zthfK8qDCmeLBHbNI/\nZNucnX2t0W7n4QNV2r1IPOQT3nvIQRWoTWVSUyvf0vw1A3RWCYzXKBBoi1ET\nwJ4rwPvD5cNItRJB+J/jtpduWtPrkK8rvrclu0qt9bcj2W6+o6LrzYdDikX/\n8w67w9SjI/Vi45T+lQYVvNgqoto6MN9jY6rAnoHU3Um8pnISg0iojsG9vezk\nCZjqW8jOhTK0Xqst2eFrD33TzVC7sc7DBHFHWqvH6uYXp5ij9L5A7eQBp7lu\nHY5mMhlw3Y/k2rB00sXzLYXiZPve4K9KR+JKmHT4Tbe3lWXd663Vyq9AGxmZ\nZH9o\r\n=529V\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"ce3cc11920ef6815ee8eda41ca21fc852cd095a2","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.196","@balena/jellyfish-environment":"^2.3.18","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.5-lint-staged-add-readme-ce3cc11920ef6815ee8eda41ca21fc852cd095a2_1610598894303_0.3840980643714973","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.5":{"name":"@balena/jellyfish-metrics","version":"0.1.5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.5","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"44726cb50acf9fc41b6d0b01dbe63ee20c51d320","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.5.tgz","fileCount":17,"integrity":"sha512-MBJXga/iopCqISp1Z96Rf+malhDc/qwC3RkVlrtogqzlZp7syihB2pjK7lIV5L73M9IB08E2cMIGM6EE+qzzag==","signatures":[{"sig":"MEQCIENExv6rXPZxlepKP66odR9gQ9USm+wg4BGS9ymPfMrSAiAnV7brd4nzFxpkJI8Ybk2YlNRyYq3cFiIiR0tlfaz/xw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":101139,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/8rNCRA9TVsSAnZWagAAQYwP/RpCXGsKfYKV8ll6XdkG\n8goLEan/ljnvZD9NHB2+XzBn9NQBux0t26wvgY+Ml3bmiwbGA80F1IAiErMs\nW10LDxC6v/2mp+OAtI+6YvhBo18EYOh34xM4Xn1HclQU5oG67OSBz0bHTH4R\nunv5w1CdI/vhZ9lK7k570SpmCG0K5760CoZ+K2lBaD8wc26dxwkA061pBdis\nUen5gf3dFjOU91PrTracv2vCFORTu18Za8Eq61ZS0nhAfU6BpNtbUviKqkCA\nHHl2J3OU2t0NcvIFUE7eHwhsIYyUXJ+Bm5L9MlRsedqBI4+tdhh1/h1A5lwL\nixJKeFr0PjuG1QydAxrWhGfDemiJ5qFYN0DSBLYpSZ5dHu5exMDo3WdNhR2E\nCYKTjCF6b2NjQqarXTJd5K8e+UilLn1riGe+fM3jCX6dDD2qltPU4H7rsWt/\nLb0ttm6a9BVWvxMkQJ8G2sXpi+orrZbLAs66Vh0cOtvrxgd58MuRSxohvVbb\nuOUkLsUgtA1gbpSjNbkcCGRTyb6K+zqpHkHZ6jM/S/ExhOSyv8qhZKaJCdzs\nQB18QxmfpkqmykkptJpFHVdesLfpMmXqyKgO23w7TsfdZBB6OzpNUR+j7tX/\nd9yTTfbDRVohlmLxgGESSw1fREygqQGfYPt6BLWpTFjzWCyEOXczTBAeJekm\noYMa\r\n=SsSq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"5667769d8ff3cd16c3a8b0921953d5e453b61d8b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.196","@balena/jellyfish-environment":"^2.3.18","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.5_1610599116985_0.45163361795501133","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.6-renovate-non-major-686758eb350b313ed6c51eaea1423af9d6d2546b":{"name":"@balena/jellyfish-metrics","version":"0.1.6-renovate-non-major-686758eb350b313ed6c51eaea1423af9d6d2546b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.6-renovate-non-major-686758eb350b313ed6c51eaea1423af9d6d2546b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f8a9a8b1d6f5ac55acedf5e1efb6d4ce7078d85a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.6-renovate-non-major-686758eb350b313ed6c51eaea1423af9d6d2546b.tgz","fileCount":17,"integrity":"sha512-26asHHoNdlyPradKDMg3dyKkfOWjySu5dFTPN/d6lioXWQZ1QSRxqx36GYCCWMylG9mNk0o53btAcsnrN8Ur2w==","signatures":[{"sig":"MEYCIQCkFTaqIXS1t0QnRT2xGeXXAjhtg7xSASPJbkBD5PapzAIhAK/O26xNrgz+uGEJ0BoETWEuluNsPldUeyLHECikzzq1","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":101267,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/9kACRA9TVsSAnZWagAA6TMP/ijuYCLEMEoprFkdMiPG\nfBy05vfStdP9jFbDu5f+zc1uqv/+WiG8a0I8zMeO8EBiCB/W6jhW5Hk3E7/j\nXLEJ6iFNDg/K2XH55nym8mKVafGsl1Cr2QQmfqz6ZBdT65o64PcnSc3/qLVd\nQ3vEebqTb4SVOJIS47Jbm5bflpPXnmuBUIipOXlQT+/OgE94W3ZHm7SlQYl8\nI0VahCb7DdIur12oCSNhVqZAe2j59IpcHZj0l4KnKJ73NFllG/5/kdYyo4wA\nIZuOkqZ4TaktsUVj3DKAklEW7KRvtjE4OJejb6XYVLHWj61bKFfJPKl7VYB2\nY4tSmOi7wjXP9o+1aeJpUEhW/2WjLxTMAsBe6NLUC3vyKa42EkfMCu/hBa5R\n6oB0Q8NDcIytQgZL89k8X1hGK1eL0b6HwUvJtPYYOaGscF33qmHIQ6e17OwZ\n24Ha9L0DGCSUTz40fFFdjSeEH+9DsHdX5BB1fQjbWqBl6AwhY/cySZWLp5gl\nZZUgkLNO1/gJmLn5P4h/xkpdZdvT0m6vk3rE9vVDrtqNKm+S/oUX7sukcnyf\n3mVsuU74vaUps/fFWCrPUMF4ItgvBSUsjU8t2Vhun3pRBuYQWDQ5WHw6lzgJ\nL6cUoB+6s76ajmTwvqmr0iZcZVv+qlNGfB8ukTtCNSuenf/n3GYZjbj8WcB0\ncfD6\r\n=fot+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"686758eb350b313ed6c51eaea1423af9d6d2546b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.198","@balena/jellyfish-environment":"^2.3.19","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.6-renovate-non-major-686758eb350b313ed6c51eaea1423af9d6d2546b_1610602752235_0.6558172153047357","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.6":{"name":"@balena/jellyfish-metrics","version":"0.1.6","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.6","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"395df1c3212996a79dcec2e9f965c1f1da1f22bb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.6.tgz","fileCount":17,"integrity":"sha512-8a5hy82KsAZWxsDlkzVRD+eJjuHr0Ofga7NQgIfCth6mYlP5rkd1aWA1kyrJXCmsk/5/2dmRbUC7XoMGuRGJ2w==","signatures":[{"sig":"MEQCIG60Z9B7lnq0fnNCocPpInLxWha1rmWlvitx9h4SxRMtAiAf0Nnunw6PCZaZDjaNTwdQCPQZrreUCclWq8zHWXUglg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":101207,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/9nLCRA9TVsSAnZWagAAKMEP/2PlQR4qcV/PdsF9NW7x\nyM7gUpk4MkySX8OMXj2G4AciChig+jRg8xBRH8WRXhtXZnFeH1P+Gp2hCAHf\n5NSRxOIh5OXtGVtSwyKBjHZnWCeyCHW1bC9Ao1N6GkDWJNrc0JITA0NRQwyY\naQzZO73bGtjFKxd4i2tlwkyFEWEf0XtG2yFPPow7S4/eMPRodxdjGubP0qda\nuukOZsMR7vKUU/ToIxgB3Tr7NLJElsYJqVATfyaC5QMpdDjV4M1AvmkZ/hzR\nv7FQJT8W3JMW1VWDxG8DUuuGCyB/wYfQegl1+usXUNmN+ZXWomotr1YSwXXM\nyPgS0hWr3prTfeMahxEAq6CrQxAYlIhZM/jPQ6GRF15Le8O30tG45zuvDAZ2\nq2qgkbsty2qIgqeUAvkKLaEj9cX/xAifobmNzrmq2g0coWGbLrbQ7KEVyDuu\nljoENILnfdbDd/7z/k5ExWP25J2vovtiWL04kzu2Qg4tcc68cglmY+N3d3EU\nbnpe2tHsRc4ZG3eiCe+ep9aCfD3LwkQFQeKdJAa6MY8TbFO9H2cnseWqryml\nXov8UKQeOFXTlyu0CQnoaoe0kA39n/dHl5kd6FnPzItNutBcA55crl+t5mBH\n/GFmd3+nvhiSdeQTHFOYc9dHpFvaxrUMbmed79Sp5pK47zQXbv/FWHcM8SGE\n+TJ4\r\n=vE3P\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"29769c487e7f629908e21aca57a309dfb00c419c","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.198","@balena/jellyfish-environment":"^2.3.19","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.6_1610602954760_0.060145477982889606","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.7-renovate-non-major-18dce27b27d347f5f7abb2d03f139afc796289ef":{"name":"@balena/jellyfish-metrics","version":"0.1.7-renovate-non-major-18dce27b27d347f5f7abb2d03f139afc796289ef","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.7-renovate-non-major-18dce27b27d347f5f7abb2d03f139afc796289ef","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f8d1325c74976a43356ecc4d5c0c3971e921a075","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.7-renovate-non-major-18dce27b27d347f5f7abb2d03f139afc796289ef.tgz","fileCount":17,"integrity":"sha512-/GkEaVqkWRhW0D0XrDO1wEYSMc+DJyakvN8sWNzYbaSh0K4XdpoWGZjiuBbYyjz73N14lEYVQGGxbI+GHQkjuw==","signatures":[{"sig":"MEUCIFfkOIbqPEKuTjpPxS06XGAlDzj+fCJQ7MfaFi24cjU0AiEA7hMdXZZyqBvPjmx2FpSkJFxLh4jabiSqI/7BazH5Kx8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":101367,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAHFVCRA9TVsSAnZWagAAUr0P/33hvjTeqP5EZWevwhNR\nhhB19M5+GamV7mL6R+s4HJ8XFs7d89zf1G1FyLZguGnlD6LEqadc4HJGEY9d\nuTSSKYhslcffTI/oSQIowdqXCjxN3noydSGFcH42O7Iwi0F7c9WpdKAqOnCv\nStk/C9y1hMhOOTyeUIe2qYMPPASBkUqbnzCQBADqEkuT6EXRFntTTC4RmPcW\nl3t6XUu7PmjM876A5Y49PKjFb241PT/WPYijCI656YqpxhZjOCvVRmRTSEXf\nHLPbFJVKvo7UfLfTUSY9LZYHjQzGmVsjqHcWcUSI4DfPXh9u+9gVacoZxGZg\not/GRRqHRNaG8Ym92pzDHRzWNji/MTn4I5rd9soQVa9YDHpXVXEXjxXTSz09\nP70ylgegSIdtpc4FsH9zwjaapocEUIVSs1IxRbTutOFS59JrQSSrt8/AN+M/\n3Pew/vlCW611THHYnJ+yFsyZo2wDz1CUm8Vwf2d2HBYQbzKVrklVyVPGlxjH\nRwu0WgUjlsLv3n/WuZWpkhXjvnF/Jp52UNK1ZmwvNCBa7IjbLeNbBV7XkstU\n1S3BQOH1ePg7uN+X1AXS4859S3AMaXV0s51zWynhnyg6mJ0vxtNAPCZhY1rU\nGsBo0GLUDqeWK0zdwAeSC4g6w9Vl+zGlNA2LYYfmP6niJpaxXq4AQbJDyHfA\nKaST\r\n=nhIL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"18dce27b27d347f5f7abb2d03f139afc796289ef","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.198","@balena/jellyfish-environment":"^2.3.19","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.4","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.7-renovate-non-major-18dce27b27d347f5f7abb2d03f139afc796289ef_1610641748611_0.17762380073548645","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.7-renovate-non-major-f72e0a52ffcfdd7af05ea7999c8a47e323d0751e":{"name":"@balena/jellyfish-metrics","version":"0.1.7-renovate-non-major-f72e0a52ffcfdd7af05ea7999c8a47e323d0751e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.7-renovate-non-major-f72e0a52ffcfdd7af05ea7999c8a47e323d0751e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"413fdc0ed3eaece0fb0d357f91666ec72a9a57f8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.7-renovate-non-major-f72e0a52ffcfdd7af05ea7999c8a47e323d0751e.tgz","fileCount":17,"integrity":"sha512-pfRQkTar/bJFjR+GoPa3hhOoyTpGfZISpHHWbPGM0YKxu/Dx4CLgyjUnKVOhS5nFP6IbpJvKVmpn1KpRV0kzqw==","signatures":[{"sig":"MEYCIQCict+kFJJINcEQ1x2IVFYJHziw38/IY4RSLiLMAu7EjgIhAKhdUCW+p0MQ2yhyoznoNmr4Or6nSa/hMyVuhswf4PsO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":101335,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAHJDCRA9TVsSAnZWagAAap8P/A1+uIr1DsorMNvNVYg2\n4wrKwHXBHb3cE+NM6SdgoFEj1/zkkKNaEjfzy4/S6yRzZpsLUw+TCZatniud\nKf39P9vpG2lkTJ8wurAAzT4q+C+5cWHkBA/HB1wSTVubb6lrzCuNiU0zV8/v\nCQkknkt6FGY3pP/F5y8jF7o2OccqZcZuw0l3Os7VJh3j8wDVSs/Dg0noAKux\nf+cSUEhG3ZlAlVJwTJCKZd5EYiVb7ZwuzC/NtM2E76TlkaTEKmyE2G2yRN5r\ngGOkxTSH7YaqrDK2N18qMLKonU3/R1On1SzO00AjpPePqQaD9yT3D4lTzhUA\ng3IW9CAqmiHZywVHWhlU9EztwgTZFJjxVtpAs2thIKx0uNfc30Gn8pPM4JKC\nFLP2qAxt8CpmZHDRj9Dam5CpiNX+/bFVEzrr8im4mIb7xA1tWNxgc1uC5NJ2\nqmciETe6nbLqk6mAtbw5yfPkFto3S361h+OLaTscdrNQXvdealTw83fcjs0F\nP+wKOVZvL6WAR5kcX6bVQVWSpvbQSt+btOa+iG4+XS0psV+09hEny78Hub2/\n/pq2eEdLUO2RqjPjXUNrG4SW5Ci5FqGDmUdvQRxVXfxJ2Z00aTWHGIiqyQuw\nr6aee/Xxj9wnBn5KB7dZXTHV1XmxUXLf+ZilkyMd3mQ9RZ96CAEEcgHOcVY/\nH7RK\r\n=aqsq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"f72e0a52ffcfdd7af05ea7999c8a47e323d0751e","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.199","@balena/jellyfish-environment":"^2.3.19","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.4","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.7-renovate-non-major-f72e0a52ffcfdd7af05ea7999c8a47e323d0751e_1610641986869_0.7125982361368826","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.7-renovate-non-major-a04b25a0299a2b9b0b359209c54503826a86535d":{"name":"@balena/jellyfish-metrics","version":"0.1.7-renovate-non-major-a04b25a0299a2b9b0b359209c54503826a86535d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.7-renovate-non-major-a04b25a0299a2b9b0b359209c54503826a86535d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f6c64533088380717c0b3c18dc1a7e82fd4d9790","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.7-renovate-non-major-a04b25a0299a2b9b0b359209c54503826a86535d.tgz","fileCount":17,"integrity":"sha512-x66UTcCtONlE3Q0//m3ET4s9Q5Tc2QUds7WIv623yTW3pMG6XWke5TfRRIBTRzsBmR0KLSGEXikwoL+L+aA+tw==","signatures":[{"sig":"MEUCIAv7H3epNYjeqfblSVDWsUEtAiQ4j00d2rgu/yiNcllPAiEAsv8SDsmz1Te8ISw3lhiXYKymG6fA3fJJOnNSQbNU1xI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":101335,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAHNNCRA9TVsSAnZWagAAxDQP/2WahiouKQIYflf/C++C\nuxckwSxyKMul4hgGwNBPKmmaMeTs8jCuM6SkJ0xttiqHlkComrZBKWXH7XTn\neYXsJHgx4KVEdIT2IfATzBXepjcrCtzRU+/1sC4Mwl9FkzA71CMfYJSylzVr\nM8b8uM/82OhzTTM/8aafU+5XtV4tf19Z4vdZwvOGlS7woEm1xLzuNMfx/TlP\nSBAZh9Z7D0DFitaNYiCSFkIixE/E7LkAie8HTpDA/EehxCVFnScTyNpTJosG\nMJ3Xji87mdmC9aQkIWxXbe3m2nfYCaFEIbIwFC6CoijPHfOVY9R96NCe2is0\nHq6GjQur2hDJtnHzo7HpIRsWHPquhPyHOrEaWxA7n0AFvHVxS4eGG87hSfQo\n4at1wCa3o3SHVZ/VrGBjSLH6MTySj7lfnMHnJ3c2Fntc/PZyuN0ph0gYIiWt\nceESBs/Mt2ixMVqGF70yucEbRiSJjgfec8tKihqEfnEyrStQJmZCLF6uNOUZ\nsrle2CP/epChdIHGqYyUG93iDRmZDUC/t9iwxN1jFd7BSHRJITV4AO7U8xST\ntS5z11m6/Su5UK40cf2JqhUWjFmjVPnUwHtbOsTfi8qN7P9sotRlStxEwu+y\nqdawbhY6mzVZodpmYjV8kl8QW0nxyjLdzzGuo+r2R2Xkn952N9toPpQ+eJPG\nczi1\r\n=Qxqe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"a04b25a0299a2b9b0b359209c54503826a86535d","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.199","@balena/jellyfish-environment":"^2.3.20","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.4","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.7-renovate-non-major-a04b25a0299a2b9b0b359209c54503826a86535d_1610642253283_0.8459312279407987","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.7":{"name":"@balena/jellyfish-metrics","version":"0.1.7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.7","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7c0b608d6421f7926611f91dd3c9c8e26c57459d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.7.tgz","fileCount":17,"integrity":"sha512-DzBpbBUPknxougEzMoT+RcA3Cl9TQsF9lORkKPILx+O3DPCH4Dks8vg8t1eF6eFeIjtbVNDtFXs0/wXz+uml3g==","signatures":[{"sig":"MEUCIEV7CQ3Oam8mQvdbFRAorBXeOFwd1j3GMV3hoVH6e1+DAiEAgwNxOzSDyW5fkkAPhel6lFPkBwtWDA2k/GxV62+Sty8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":101275,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAHQBCRA9TVsSAnZWagAAmocP/jWYCEIrufj5UR//iLYx\nKiuWjdvmS7WvJxF9r7PWZaCTHBDEA9TKAnuc2r7rEDCAiIigxj06qzpHNOKw\njp+wpBzBNejkHpHE+e2CXMBygeODWpVugw+eX2h4ydQjgGckh010oh7rxJ9j\nYfDkrtjMWNx7sKZh38Ae/QJlrqvNb7D9A/+vribvbGUluV3ksuURV6VH8Vh0\n8TpLRG8RBlUK1eaigO+6B7uLN59p13b+ZpxKEeblHZiNorvldevF9J8C9lEi\nk5FxQA6piPvGmoBcNj7aeM5vlHTDl7HMV8kfn2ccQJCBqa337YlPZKRdRriE\nE8GB9LeTk7PaC/FwM/35sz1H8STTONSBbOwUetgCoZ+fsl6rSLkj5k+0IDr8\nhPntceeatSBqjTv6OV1ocLA/HsYMISIDr2z9z0ON6hli4Ilj/fRoTr0W8LhN\nkVEPusSgKNWWaWwbIiMzy3ZB9lA6lldLQ3RvEO5BerzqTulqTvyJtLrIJt/5\nhTnXQl/6X3UX82CFVLSrd0Hi5VKwjatG5rKHtYwvqOcgfZ9nmEUCHM0cZAU5\nKfdRtPYF4iJ8CwFY6IOEBz33uGafg+4QCQ+BPDCM0nICYT6cWtNNmNgJy0wU\nPen+yBd51i85ZulFJgi7szmPSYPPA2jsx6OQ6hi3pyxYJgKt77gjvcc14GjQ\nqkMD\r\n=7f1u\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"27591aa1ed3611875f647e063bc89733337029e1","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.199","@balena/jellyfish-environment":"^2.3.20","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.4","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.7_1610642433354_0.6495441191152544","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.8-renovate-non-major-42e5171acae2e0fd6ea90d48cf4794b2a0b72778":{"name":"@balena/jellyfish-metrics","version":"0.1.8-renovate-non-major-42e5171acae2e0fd6ea90d48cf4794b2a0b72778","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.8-renovate-non-major-42e5171acae2e0fd6ea90d48cf4794b2a0b72778","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8b508ae67d9ac3a2e9288a891559406a24846ef7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.8-renovate-non-major-42e5171acae2e0fd6ea90d48cf4794b2a0b72778.tgz","fileCount":17,"integrity":"sha512-4QtqR370iGmAZJZRP7yOW6sovPzaTEIBI5QNllJt3frlKUzj83rtdVudNOZihz/B67x/Z1ZlWnPfyD/qBKO3YQ==","signatures":[{"sig":"MEYCIQCIu68y31a0Eye+UWkSZ67X2Yau9VgI0yU0wopIhnbQiQIhAM+cMxmrePryV5SlzQUVLIaBGNCneobDwfcPLEYMlS2g","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":101441,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAJDcCRA9TVsSAnZWagAAnVMP/0h5PCZG2MMsr6SC4LOB\nx+jzAI+4yHsFVKr0JbnPc8PN/gbkH51iwcjwyzA+vsrURPH3vNDeHwCbz9Mr\n+9NvUSN+WHWsmn3Bk+7b5ZVOsTZScrNDd81/OIw+F+7amHHmjCZoSQtdqclN\nPUQZi5cYCHzf7TfxifZoN5PNTHf6BIdJ93pcVngoZ5k/GGU6stxlXZVoGjaz\n2dk2mDYmSy19Y9MZzIYhbt7/gMNIdEIuyz2jpvM5683wJZNROPeqFUYegN0x\nh6DL1FMKQOrgBY+egsbNYC2YtKi6tEokSET/gthJWpLEehd6rNXa3ZOO49vM\n5RJMWbsD8UfsN5dQCh+JctiYspqahs5iTGELJIDADgsHTc73vB5uPOfNPsPZ\nIZeaNIRqgBSGVb6pVnD6K50M45j1poDVVBETnFXmYuNAST1IVhmq6P9bzbwx\nJdwdw48tAeiSakgkIgcmy+SVDIz0r3oH48gQMjiKVQHkWVLh5ej7DrsOcFTN\nnyhKUxYYUxFzt/xp9/U2mnpgzmrllh0WS4SYYRC3MN98AgrMgN8mBMa4oFTg\nMaEkdOBJmrlivHuFHfWWskTpG92xymQT3dZrXMNcP88D+JjIRHvbSz9VR4Tv\n4gPhuT9fgG/UG0hRFdl/UzFw2rXe+Fo8KwSOW1zJeNjmyXx92sIQayl8xORF\nY1uO\r\n=elcK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"42e5171acae2e0fd6ea90d48cf4794b2a0b72778","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.200","@balena/jellyfish-environment":"^2.3.20","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.4","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.8-renovate-non-major-42e5171acae2e0fd6ea90d48cf4794b2a0b72778_1610649820351_0.15100463242918205","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.8":{"name":"@balena/jellyfish-metrics","version":"0.1.8","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.8","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"46665a94d9604bc4bebe5023943996bd5dee5346","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.8.tgz","fileCount":17,"integrity":"sha512-smR5Itq5kggh4qVDYkRaKeqlxsszEHjEpMpUXi9XAPoqoKnPkovUFzHliata3DarXfYChqiu4ANnuPz+LOgV+w==","signatures":[{"sig":"MEQCIFZ/Bhm/97w5JltYwB2EfO/3rW51iJqi+lKiqjCwMSCBAiAfJ6z+gPjJFsA+vwODJaEQJTr8SftoDoFeABnXsIQ/mg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":101381,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAJHlCRA9TVsSAnZWagAAsMYQAJS/l0G26Evfa5BI3ikV\nhgrDaxe+UJdeWtu+Pzae9fjFukIhPqRxy4KEk5dCsmX2/7YQVPRoMlSx4pMZ\noRugRPe9w2lKTy8HbyBIbzCuh9m+jHTB5qmZWtNw1dwBH68wn134hzgMtyWD\nUGWx1qJyg1QUzSgmOevf+febKOQ6076KJN3f6K/sXJAMhs8y4nPXvFRIyxC7\nE7xBeRBliZm1PrUYg2LNLpwRDUtDNqyx8OdbEcylANtW+SuudD5zolGsAxnx\nr0mcxBeODdv/bqsace96u7CcFCCJkthyfPA7v4HkQ2mjpZP9iXfd+uIGxlbs\nBHnWXdIlo5kjQPb65HwroszdbvjaybLYaW1G6f+39kApkEOR8Rw0YdjYa477\nc0OWR3q/F1lZU+R+sF/9vrAKlthr+jQ/8bZQqMvv0rECzK1gMX6QZSIpHQOD\needRqkdJYuGano/5DWAF/zj6oPlFw2ay9vq536egUBGrHvBdOx+UP774T9z/\n8oAd+2PZ8+Z7CoR+9TRXrOxT7suXZkgvuGGdBA1fQyw7jYrOck60DDhyOIaD\npCHmlcNxiMC9SxXGI70wSg3Gr2jTd+Yj8MN0BV313HgY2pQXTH8R4NvEEmqa\nD2HD8Ld8wVt/2QhfTmwQeRVYN44+FT0IdmrttySbz3A9QH7zEQ2kM6dzu1gB\nFbdC\r\n=soqZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"e75e5e7fd5dfd0426f3a4aefbc2f6847ef4c349e","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.200","@balena/jellyfish-environment":"^2.3.20","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.4","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.8_1610650085262_0.9718784563045664","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.9-renovate-non-major-f7de000f96cc36616abaa05703d36e657268da23":{"name":"@balena/jellyfish-metrics","version":"0.1.9-renovate-non-major-f7de000f96cc36616abaa05703d36e657268da23","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.9-renovate-non-major-f7de000f96cc36616abaa05703d36e657268da23","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fcef335b4f62b6c4a8dbe1922d1a6cda488c50b7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.9-renovate-non-major-f7de000f96cc36616abaa05703d36e657268da23.tgz","fileCount":17,"integrity":"sha512-JGPKEn5SqbD3JCUTf7qancTafD+fNJx/3yW9O8hZhVHtmzLJ8VXr59AcCbpo0QnHzfPBNBpdJ5v+g/2fPW/jnA==","signatures":[{"sig":"MEUCIQD/LiGueZa2dKtA2x9iT3RwyUsMmJRuTZiLgNO5veiTUgIgfs82Wfe5E5few7T4lye7VSaR+DRhjuQ2ldnKwQJLiNw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":101541,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgANmQCRA9TVsSAnZWagAAxJsP/Rr6Z8276vGnLBgQ6lQn\nQOjx6ECqsZtimjcyJAkni5UJS7uXE8jFOvQQxWwxTqqn1ABWUpUtjufHah2u\n8fuQ3TLzSQPTa/yFABSgqssxjssKw02QsuF2kg9999SlhIkoRlhInnoMkTOM\nc/Pc0xsXZ71Pi/AckDNQI7rnhBC0SbZsElt9GgCRu7lc4asLlMxnedOTybUi\nK1Dd26rrnpoJK0C9pxb/M8Xsvt3ZENrqQEvS5MuPj7+s/93/CXJFxpqQTP1G\nUxPMioLhXUPQFaOflqMWJA5Ez8/Hh6eS0099KXwRvJ4Ta4zOIkMrFpRLcYUq\nZ98vWxtIDAjWq9mRnTX0u0aGEAGa/0F69k6ECv0x3nE8Fi6FOdNdMnaxyQ/L\npQOZBkQ99WAtmgdZfEM1+BdErbGCRreKMAOnVLdVLLIyKxhvJq7vZqHDxseK\nMoyyEYStI/6N/3LozsacN0fLNkIIWDhgTAycmlTDfRl9HtTnHkchOkNR1pi7\nANajiXX9oVG9ObGBhPnZ3UqTGkUbPWhmEC9ra5wUbqNLq8lzwn1SKSiMMyJF\n2zkKDHk/xi+y5f8vZFr88Z1XOoNhuc3Ev7dsw1VsqYzwSykMH7BEWhrWm8t1\nYDDCKCDFtlXms0vgUAmX0ikw63Fv3GNXC/4YDuXAQApVkWJaPGeC3XIuLfJk\nZH0u\r\n=It4T\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"f7de000f96cc36616abaa05703d36e657268da23","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.200","@balena/jellyfish-environment":"^2.3.20","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.5","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.9-renovate-non-major-f7de000f96cc36616abaa05703d36e657268da23_1610668432329_0.6759500233111864","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.9":{"name":"@balena/jellyfish-metrics","version":"0.1.9","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.9","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fb79c2bc5e9d179a1f6ecef012f0923f4d3012ed","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.9.tgz","fileCount":17,"integrity":"sha512-Fxqb8ycoaDHn3+BQuKCBbP37/ad/McT+w53/iOto3JaKsq2HoQYzpRqKRfZH4QwrzQs3URHSGKh0MspEj4D+GQ==","signatures":[{"sig":"MEUCIQDn/+aoqOpn0Fn9Lx1l3dGDlIAVwzodyBrlD4ZeSdMGjQIgS7CXqEkB6rHlkH3nYGfgIEcFjVbYytKgr3zRLXZP2NY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":101481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgANpdCRA9TVsSAnZWagAAn9sP/0nq7U1I7RE6CT7lg/pi\n5d9WlGqkZB18un7WiZPVA4qfAm+5B6br6v3N433vFvb1Mu/RbxC6hUZrQiGH\nLAyxXWsl4wdKt12rVA2DP3FzL5cSHOGUIojdAPNT1PiwP6Dkt+Fiz2Mn7rby\nleAbnXxRUiDArkSKQYyydgN11fhW15XdctyRYbClenf2BX/1CBvYLpuBuWYw\nxvA77i/Us6zWovXL5snyDoNYwNC2F8xx6r5ynvTIlPfQ+aKBE1XoDIu3TgGi\no4y8EeAuSfWE/U1PKCAhcPdRgJ41Y0YASPl3inRRK+9MArc9LNHCT0r/AZsV\niQeUIRW9gHwb5F+pTds/kL6vtgaDAJ7pD+ZKtM6A0LEBcfzC8rEvxLe1jDnx\nvX4+JqtQ4O6lfjaFZ4mmYZWT2+jomz7BljVYYupPFI6YFgLQBz7Cq0c7nqOi\nFDl/+BC8FhEy8dKKC3Xc7/lo8QhuqA8REmDbSULdeRiwe+st/lbaNtZ+QUtc\n+SLTv+cvUIiHUPsxPZjbB7PdIYNK5iUoAXpM7JFy6DTO6kbcvL4asZMl1hip\nr+epDjI294dtBY/e1bLGaiYS/AbYpYlZUC99Qc8aMfkMy84N3ToI0s2GMfNI\nsuejweP/KD7r8GR/FWpraandidQng6RXnuUTPrE+PNRR8GItWsUi5IPQiEH5\noUNQ\r\n=pW7/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"cabf5c7a8cec3165083a2ecd275d6942fb57b7dc","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.200","@balena/jellyfish-environment":"^2.3.20","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.5","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.9_1610668637392_0.648371502034204","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.10-renovate-non-major-28e7dcae476403ccae45edf5db9f1aba12d4cba5":{"name":"@balena/jellyfish-metrics","version":"0.1.10-renovate-non-major-28e7dcae476403ccae45edf5db9f1aba12d4cba5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.10-renovate-non-major-28e7dcae476403ccae45edf5db9f1aba12d4cba5","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a49ae410a12efb3ac4c55eaf94972328538ea779","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.10-renovate-non-major-28e7dcae476403ccae45edf5db9f1aba12d4cba5.tgz","fileCount":17,"integrity":"sha512-qmEmQ+I64hg4mMKUbc5/TOXODEJk1Hqsvpyq9kH0hpET9ZLP6Z82wBke+RKaNDhSPHj5AXJEFz6phOLtZnDHqQ==","signatures":[{"sig":"MEUCIQD5fEXjLxlW0SyFuQ7Wp+qh6tn6O9YYjHTyoDY9cZ/lnQIgKnP/1lEdCTMMbTfqjHalPiT53ga/VOmPpc9vUf+tHKw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":101653,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgANuxCRA9TVsSAnZWagAAWuUQAIpdROohiv50OlYwWWef\nYlT/Hz3Xo+Z0zY2oZmcV5YzrH7Ma9m4Lk3pqqT2/Tu0sCowtCvuiAiXWpJrJ\n2XNTbFzHLIDtqS8U9d6OW1/qnoohFpEXfezZMwrKUgq3XIUNnR3zLAtoiRSL\naVUeEP69SAALZw/7BwviDMTYQ991ozTT1CbIxQDwiyohXoXAEY7FrTPsxo3J\nl5J/YPGzxbleiRr9U6ntVRi/0dk+nl4Xzmig3Bb1zPYUOoqIbAx7nCRg/onz\nARQmNLNdWy49kyKV5Oz/hqR972HKYVQ1OyN6ihxfVeazvhzCV0EkrtW6rI0x\nTGAHVjgqaYwUwKm8WxLc922wVCojS2yNuGjNodlAfoW5FO74R+27OjlN/JFR\nRDmjdxjGKCqQsPazT0MeHIPXaAuOUmXhztu+HmANgbyMbsUeVFBbFonb5+9a\nlx9UOfgI2gssJot2AUHrJcfsTPqZ4JrWtGOe+SlYT8PfKwDuh7HhlmvvLNGa\nR/ofsXg0zEvo1CzoSTRp1qzZN+0RKM1LNqRcMUSlzV99jDAGRAc+/Cto+Qsy\nsh3qyYO7MkuOyn5MH87tXNP9ZrNHbwa0EnicFLVrrrtphsj+KEItX0burosC\ntQDsbXo63+HW8PKwpXMVYBWKV14EpqfVIZZOMmIvT1AnTadtsPo38iCqRVf9\nZa3B\r\n=IiDh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"28e7dcae476403ccae45edf5db9f1aba12d4cba5","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.200","@balena/jellyfish-environment":"^2.3.21","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.5","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.10-renovate-non-major-28e7dcae476403ccae45edf5db9f1aba12d4cba5_1610668976531_0.5131109013127528","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.10":{"name":"@balena/jellyfish-metrics","version":"0.1.10","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.10","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cc8c5f459546a6a45494f4d59fedf9ced052ee83","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.10.tgz","fileCount":17,"integrity":"sha512-Kocwc5EZBIEhinXQ0Bxe2EG1FUu/lP446eG/f3Z1J1rJIb1JHiGjxu9Z4madiJ/bsb9Jw7tkPt2VhV33t1+Oig==","signatures":[{"sig":"MEQCIFdA2FlfoLfcgWNv4yRC5uDoBcFOt0k5OCUPLbAiY1BNAiB++MDDcXBUUTV0Rh1jBEaucGbq4TExNM3eap/2qkeFMw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":101593,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgANxjCRA9TVsSAnZWagAAi5cQAKTga7v0KDAM1+JZatFG\nm5WS/mBDUY1F77o+P3sI/fut/u2ooSfUwDAS9MGj7yk11zTP5XEbjzQOotBR\nYlkg/uFncxqDzj5cLUdl8mzV/GNzNAmjccv4nbalojY1TOBIkf5tt3K6Wnsw\nU6cQbwxk5niB2lQQZ5yHoTsesU1+nppf98h/kos0yD6+KZtp32N5Kw9daQna\nRItrN5fPl3XpHPguwLwPX9qx7lQqB9P3RY112vlheEmmULhxy2YL9UrEc7lT\niaGX4zMdVajUTu/eNGzr/xN6bAIPEA6WstCVKejnPUtDl2C5My64tZLcBOEN\n1TyaFdRkco7H2Shw0UaWhszWcn4oenGraX0LrrTmZYYvP/RulMYzA4bkOjwG\nxpHAZ/rMBNAAThz7fAEfjIh+S5FjHT94arfDVyJMn0tfww7NbBo+EB56yeIy\nMlwByDg6o6ffHdkfmFl+kX4Z89xKEODVzXcUrjtz4rPmliO1NjL76Ae+xXIL\nn7clsjSC7gHQyWyxyJFi6JdSogZp5eaAol8aFM0eEHbgLGbid4CkU+DJD81X\nu90PzxdDXZRMs3qyYgtj7wQdnrvQj+A3X+DNxQA1pc0Kqvp7ye3/lWGoF2qE\nVJAnT0YUN1ewhZPSTZ3DqFZ6ofWT9deTrEQbds6lSdm0CwwGdyu4LIj7S8kJ\nbzKC\r\n=9EOQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"44519cee29fee8fd3bb804c3c32fb082a1e57ce0","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.200","@balena/jellyfish-environment":"^2.3.21","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.5","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.10_1610669154885_0.9186738600280746","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.11-renovate-non-major-4c19fdb567344f2f6e361c3dc6449f0612624451":{"name":"@balena/jellyfish-metrics","version":"0.1.11-renovate-non-major-4c19fdb567344f2f6e361c3dc6449f0612624451","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.11-renovate-non-major-4c19fdb567344f2f6e361c3dc6449f0612624451","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"58c49fbaf1c2da96bb0cfd19afdd1a63b170d782","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.11-renovate-non-major-4c19fdb567344f2f6e361c3dc6449f0612624451.tgz","fileCount":17,"integrity":"sha512-dkM0S7A1dawG0OtSljHAYhokauDu9ITiCNQWmT644cBOdM6uF/VvNSA2D02axiFDxGw47f6qqbizCrwnBg8mnA==","signatures":[{"sig":"MEQCIBOLwAPj+67zlc/stlsdRvxOKNcnWqPonf3eeq4IjCNLAiAHfJIeJqj9/1OQnlP1FoMnSgAdcK1xh6Mvav4AkqN3ng==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":101760,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAPaDCRA9TVsSAnZWagAAZjEP/jkYhNjI6COpxCsuvBp2\nCEbKD33YoFzjcCVxbGQ2yk4tLP8UFNlEiy2xE3+O0/8VRQnpJWQqie0gni4+\nDn7iWe1Qj0f06SntRVvt6v12tq5fqI6E/2wQKt1O8gVMfjSTFgLnX6KyTa/W\n+Y/pg6+qf+b7ILZ/uKemXgn6zmXL2gRdk5C/IOAbcVsBbMtlU17SDBHEcAdG\niOoH6bea67N/FWTdjwYgFPzluGgiUkhHAVmI0RDoV60rUsn+z74XNSUDEJ9z\noWydfvTRqN+/zYHxVgXW2SWEMq/lolx1e8hZKjbdKKkz/+GjLHDqf88Beb/M\nuvCSEDo7QCLAnTMSl5Q9XkHUOsCoLyNxN6gB/Pd3iYn1IIu4X7VpikJoR9VH\nspJ3PPWsN2uT7gw3DY3EbEyq4EST3iZLP/SAZ0BjBfft4WJ9YioXx60jUHVo\nE013gQecNlA6rZuNqn9ST9sOedKZsTHU7DDvDil01Zl2s5EFMjxfrQuXenw5\nKeB2zs3uRtf6OoAjNA0g9Mn0VM4AesfkuicCmq9Ig0xilDWHF8IWyIRU4bV5\n0QFHupERnTVj45xWGF1iIZE9HKSHNTOz0FsHx47vVjt3gVw/W1AIh/p9Yvir\naCv150g2FeNfxmWnXK0gLvLY31rUF3Xl1s2AGoxoFAu9uEC/GTaca4Gilr/u\nYV4d\r\n=NUa5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"4c19fdb567344f2f6e361c3dc6449f0612624451","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.201","@balena/jellyfish-environment":"^2.3.21","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.5","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.11-renovate-non-major-4c19fdb567344f2f6e361c3dc6449f0612624451_1610675842353_0.036884695920050836","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.11":{"name":"@balena/jellyfish-metrics","version":"0.1.11","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.11","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a5f79796b52af12b8dcee4eaf4ff86688015e86b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.11.tgz","fileCount":17,"integrity":"sha512-rXmhcuaZLAtVDLw7PlUduENoUDWNHKaiX211ssYm3Dq4MQ3iAdR8Ias2Oi6jobvMlwcTX6hRyhNT7ScTmZPCQw==","signatures":[{"sig":"MEQCIALMAow1YV4A8JcgHGFtngA7FIV675Igm0CnuAVpUW2uAiBO8ybTCpRk/JtSzZUbz31TuKCFJdHpkTCqzOTNQR0nrw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":101700,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAPctCRA9TVsSAnZWagAA9OIP+gNxLOygyJoLBwB19rep\ngncwUnYuJSADJkgvItpyHfiYF0pRE8riLeRXoFqjqJ9FDyXPXPscxFcqDrIO\nLlOABoMsxV/ODg6zZKGJU1b7xN3ZTdLCOGtqv42I6uW0OhyGhimJEYFtiz/i\nJg3CU6iCR0DXXfcWeDnuZ5035XQR0PamqlOg85qnLslCG/7pnaiIPaoMmaEL\neqfSBKZjpUSKgOy5xyzsZyTZDM0Ri3YrVcUMzww//nAe9M4qpIUSEA0We/ve\nRl/AIhx62Tfe8XbFZVIhB96bID+qLceEY1UjFW5uHr176k/lO5+w6pRn6g97\nz0FazcQLzZZYkertuvsKAXxvLNcM5ou6D0WMlARDeGrN7SzDFuqredLndT1J\nkzuqTyO7sqfn44AYfGBV7Sq1McGNqM7u+L6Vvac6U+CheJW74IvNhdmawaJr\nOJSc3lw8oqk18eF1AKHDCFl6mguKKpfqK4wNRMB57vrqxGxr595EzIqi95Gt\nE4hRbF23wmwCKnqDUn5dL+/e5LOLyK/O0E8B4Ek8tAJuuXwiH7D/tcYmKX7f\nghwnjX1Z7H2sputWAVJuVyYAax03QM0JL5pHU8/vMf2pAlaGyzucVxjiV/5J\nbGJUo1uxSWem1ICAHVNQveqKvgEedXwukQiOV6r+LESqpLj7WKbWOgM+l6oJ\nucwK\r\n=8ZZa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"439d475de7f55b2524bd50df0edafee021c32719","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.201","@balena/jellyfish-environment":"^2.3.21","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.17.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.5","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.11_1610676012736_0.8406740651658282","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.12-renovate-non-major-e436e483c0b1e33a3c19a26d0444f76f5b38f015":{"name":"@balena/jellyfish-metrics","version":"0.1.12-renovate-non-major-e436e483c0b1e33a3c19a26d0444f76f5b38f015","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.12-renovate-non-major-e436e483c0b1e33a3c19a26d0444f76f5b38f015","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"aec00d46cb85c6caa227462ed2ea49b49253255a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.12-renovate-non-major-e436e483c0b1e33a3c19a26d0444f76f5b38f015.tgz","fileCount":17,"integrity":"sha512-v4VHGDJb5LGbx6JDR31HDNPh7yhDhESBaoNKR0KNEjtLssecTjZzWJ0TcGHZgAtaJFKPYaezhX/hyn61Tia1Ew==","signatures":[{"sig":"MEUCIFE9v4fW9LLUdEoWK/yYhqa/hJK8rX+9ne/Z6fVu4+qFAiEAr90MDcWVHXjJ1B/uKKsL34ga6JLGbY3OI25ZZEI9Wnk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":101848,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAiwLCRA9TVsSAnZWagAA55wP/3BFlcBm9XctKH52z83q\n0LwPUfHdj0apA6Q91ZqatYOO+RD+YlG4BfA5uPO4ulgJ5xQBapYiLF5S0A8C\nQ9S5kCYsj5x26RtAd1tNGeRSPvEECHum+EaEDUrWfSwMZ4Q1lUlQhwr9eduf\n0Q3p64nALds202L6TIWcYeFGlBbRN65lYcaMjbzVrI0hiin2/WN+FNEaYIZU\nYcQbA7nAdb/OIg+4rUt6QFeNQ6RyJvh7vIGUBobaoAEM33dQac8AA4b88iNP\nppUTeGoTfRRRwYsaFCMhPsf029RT057tGIeuQRv+zSliEZaAdU7QR5TVdcoF\nM6/F2kxVEjdV0zcyoaEC05BWpoOEUoNmTzX+36HrDIarP8p6e9Q816IFgTeq\n8tR21r9vFXGkp8rrb9j59KFRLSRDZyapG6Yoc7AdHuDZSlpyJaT8PXqj83tm\nC+OlggyXYLocXlgpZRNyKI+33EX5cXH1EpiiFo/4lFBHgDFvBasw0wzsE5MJ\nXXhmbtR/8xdMHnc2rwQgwLNm2q48oSu6ZIv3tn6ZZiK5oEDxi/qtdcwVM200\ngtX1HDJX1akNn3YOVRC5N8QzFxAu4kc8wcZK1iNZWZX3IpsaxsljgV4OQyL+\n8QBkmnV6Ov318sU8GWCSJcZyIOJD9Dl5BcqSAxsSIAAFIN+u5QYQnfJ2nXya\nrwJV\r\n=pfPD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"e436e483c0b1e33a3c19a26d0444f76f5b38f015","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.201","@balena/jellyfish-environment":"^2.3.21","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.5","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.12-renovate-non-major-e436e483c0b1e33a3c19a26d0444f76f5b38f015_1610755083461_0.46479170205504294","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.12":{"name":"@balena/jellyfish-metrics","version":"0.1.12","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.12","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"24ad2d2dc150eacaf94861d16a7af5f6cfb4fb3c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.12.tgz","fileCount":17,"integrity":"sha512-PVoGcsEgeMLP0fbqqWFahQLJUWaPmMBR6cj3zFazCqfYQ2LFKpjGhYYzBVC1kHBU5FwmsgNie3UhpixY4H3KUg==","signatures":[{"sig":"MEUCIQCtsfgDNoeajw7yCgaG0g5t6ZGflsE38K6y+vFox4hfsgIgUATUPi1dsNIgbMZzW6Dekbsf0/9kh2+4aeXuxWs/32Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":101788,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAizECRA9TVsSAnZWagAAlMsP/jU828PnVSpDRMl0y0/m\nA4PADfrnQNDV6wLE5UTrSnFuYHNkIYC6oM+4Fm9apGC99X31L9UOVMr7r2WI\n1wTP39JVqGJMRoc96vPTga45pfRN71o7PoPP6FLqLa0h89rdbruimZwLKZtv\nzmZwFIWHPcciJcJEjGB3ObUB1JZhnaERHN0gus9ZFIaZkFqlwEYHtyO7W//q\n67jeetrvkr36yGpGsLviEwNo+50kq7kfZGEcs66XcMjNfwX9O2t7hdzpQrRP\nVYBncmrvj6q0HXmKFFwYo6CjePtdN9cJRqy3jYbw46141p3FwaTvf03mK384\nH0GuaWQqq64iTwJsOZ1G6rmhxv7Wl43x6iSoBTGXhWx1+bbG7Y/jZlW5kYnL\nDQirCocNUvcp2YxbE++2yBYB1WnbtyK3FXLMxYZkxg0kw5e67SirhfLuyc5l\nBAlwWcpXUEw1x3XE5fxG81Qi6GSSHD17lkyPHpBXngOWFf8AhlKNqZHokd5+\nP75QBLJVIS6/qA5rSc6bAZ7qHZv4EkRxd5Kmi5GHxxLvNM0vf/6W0HTUohVV\nwojbJVgDcGBZUvsvGw0wLcPMu1gFjrQ6VlsogUKmf2nP742pogM2+GYOI3AX\nfzOhHfOhKHFr2BGBxILeYJ/ePWC/vyD1yMPuv6jslTFFeM20VWkMevArpzu6\nyDg7\r\n=w6Pp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"340016a47021fa3fdc1b7ec4ba4c9705ad073ff2","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.201","@balena/jellyfish-environment":"^2.3.21","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.5","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.12_1610755267965_0.4322480497603778","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.13-renovate-non-major-106581b8c71ca107c6214aae80d6dc0be897d074":{"name":"@balena/jellyfish-metrics","version":"0.1.13-renovate-non-major-106581b8c71ca107c6214aae80d6dc0be897d074","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.13-renovate-non-major-106581b8c71ca107c6214aae80d6dc0be897d074","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e683553e928afc85a19838d0666685d8f9aa1779","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.13-renovate-non-major-106581b8c71ca107c6214aae80d6dc0be897d074.tgz","fileCount":17,"integrity":"sha512-vWig0VBODF0Z/iSbb2CIPYGq/gWL44lxfn0q5LUpN/N077oMZpx/XQCKSiDtEE7i8lRZHdvM1c13TO0/q4bvTQ==","signatures":[{"sig":"MEUCICzO6vr5uiuA16/beXG5c5TjFI43hUPoON60Mh6kfeGrAiEA9jlieQ4WpxYPrk6BbBJDRN9UtmneNAK7DcuH4/PdVEE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":101917,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAldxCRA9TVsSAnZWagAAM/sP/jk9Da2cMN+zdnuoC6hH\nrAgRVwdeUT1PryzC9vfgDOXUCv2uODvWvxijPPqLqoIWEPBj1cpiAYT53khb\nTz11tO6ySrhg2xFkD4ufljFo6qqaVFkFOpS055JipVG2sUsIb3gfYys/ap32\nuw3aE04fWpEwtHOJ3iLn/LZ24SwL6u8wHi/77TWRweQK8UhRBkHaQyYrOWgq\n1etQIJt0itPj58KSWotez7GH5kcexmzASiRHW11po5SHoHnQfY4Co9THsADK\nFVeaaWA2We/zUgl5C6otbwGC9tFzJmVG8Z3faMXan5ar133pxnbsr/B0L36p\n9ivWjGNviaYif2DVmUxOm5iIaZ41OdHwXY1xLCkgALpA8F5D+LcbguirfIoX\nQzXXtQI6XS5KDW+7dvmMDMVQaeB5cDh0WtJOuqYHqjO1ShiaVeqe9g/zxa1/\nhtVyu32IoIjUVdPtCEdSAIQBZEMumFEI7sacgrRId9lyOWPCLrfxDGZ1Ld/+\nnipSZhO2HSgx9H829BPTbAG6VUTIU+LtjVkR15E0EDdePITCFP+9D3plQuRV\n0PV+XZwSym9wqvGC/10NHO4wY0FtO5temxx88FcoWldv2T9C5ygcnE8vw0XD\nlQBW39tPGAH2Pxfx+5Im6F7wsPUiFIFF19xb1HZRCwB2+VZjOMaN4MwFgOeZ\nmFzd\r\n=Cpyl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"106581b8c71ca107c6214aae80d6dc0be897d074","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.202","@balena/jellyfish-environment":"^2.3.22","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.5","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.13-renovate-non-major-106581b8c71ca107c6214aae80d6dc0be897d074_1610766192755_0.6350668962012085","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.13":{"name":"@balena/jellyfish-metrics","version":"0.1.13","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.13","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e8d1f1ef119cee5e1f175f6d5602b63359e359f9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.13.tgz","fileCount":17,"integrity":"sha512-HgeIukuSJsCECQp0ioTTXdSescIf/6TycGjOaZxajvI3oYdwmhUlMP7OCgNPqI+fmaiQdDgDAyOCWqetFvftTA==","signatures":[{"sig":"MEUCIDTWJOz+wfCcUts6qnR3TS/nHz50q7xsCLroq8e/1FmSAiEAh55F7goEh4AsTVjP2jYjhqUJco3baQPtccs3CZSNKe4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":101857,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAlgjCRA9TVsSAnZWagAAkLkQAJfIYnBWn+LrdbkDtq/V\nIshspq3BmSW+V/5AUUj62+i5mRsg8h+qKxFVaN47FQFrYJo8j8LImeXlmREf\nwTQXi357azi96VrtOaMaIHe/pVjy3BzFpxDX42OALJTHl4wt5c9ZGzHzv+o/\nZVLqN9BaFebbSqFl09tNOiJgYebN5miOAAWJtPCdpQAJwAwJia1WpoQp5bPV\nKZvH0xQSnoyjjROqrpTbn6J/pG13nBSuf6yrKdnx5J0udu8yJBjzXvymbytz\ngmFd83iQw8UxQtjToSObSuwX+U7PMlD+iYQ85xPR2NNSvZyIOIxbwXQCophq\nFjS7m6rNcaqey5VV/VGjFIdYbbGyCWoZJMZI5lLQSohCMx0eONJIVUfEiPtl\nQA34gWdiiTpNGUNvSL8CEeXJZqsm8cbkBf0cLUwWE0OuvCy1OW9JXLRzZnFA\nEeL8hzBf/rF4JEVNlDt5owWoqw3MohRF2kXR7R4jJ+PJT0C2fd/3K8jGJUOQ\nl9nmIly0hbubXZexXweSc0sMklOMJEBDTgXCTjCuJlzHMI98tijAUdfJB8Us\n1+P0BbcShhfjn3cYSWUalgaHBhUGyTmTsc87+Ou3aZBffN3zczSjC/61iz/r\nlWbjfB81VETyMQWiARc8P0GVN+zJXqLs2rISxxOZNIyRj3ykR0F1IAGYXlRi\nzIib\r\n=NhKo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"49255f74766565057e7f493e41a6c88a2808bdf1","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.202","@balena/jellyfish-environment":"^2.3.22","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.5","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.13_1610766370840_0.367760496904868","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.14-renovate-non-major-cc5e85e26421c4ba3bf9cf8ad9e0a20bb8a5f90c":{"name":"@balena/jellyfish-metrics","version":"0.1.14-renovate-non-major-cc5e85e26421c4ba3bf9cf8ad9e0a20bb8a5f90c","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.14-renovate-non-major-cc5e85e26421c4ba3bf9cf8ad9e0a20bb8a5f90c","maintainers":[{"name":"toochevere","email":"pj@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"67d8ea8ebe021e6b6e3e40fe4726ce2bc623db43","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.14-renovate-non-major-cc5e85e26421c4ba3bf9cf8ad9e0a20bb8a5f90c.tgz","fileCount":17,"integrity":"sha512-HZhTkDiFcuYWaqON7CSZF3k/5jDN8FM9T9nqcI7W+PBWtfN1gLvjpwQcQ+jDOwguBFQkMTCXcCaj9iVltNcquw==","signatures":[{"sig":"MEYCIQDao+48p8oZVI8do+Ov6TEismlfsOMz9ZC9c/3WUFdgTAIhAKrrecwz/0GesqrsVFh8/xf4Z1AxHf9UUrVULFzRfngG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":102018,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgBCqpCRA9TVsSAnZWagAAie0P/1S7NYwK0XP9SloZvOmP\n0soUAmw/p1bgHHLXQzeExc4JX65dpBTNYTidl8Cb8lf8qNa5/hJKe2xxnS52\nrKYu3n9SIouwoLY42Qv6Vq4VqrJrboXcT8eyq6DuTR8Fh9GdPBbL7ClHmaxr\n1xCyGuAhFFiajWGbG60mvnDbsqgbLc6hkyEHje7/3+1CxidOwLKBv3ZT9Ocn\nJCtiJucH3bUC8R7rt3PybRZCqfLSRxeLGI7aiwMs1Hk0f1mKdMsihQRtDwUm\n0s8dDKyp94Q476FmXrfCPxQJm6Gdy4jCW21/iNQftmPKbe/T9aA+9Mm42sxc\nUsJ6wgCM7eMq53XZZsqlNrdy4seKoVrpsApUKef6E/HyJS4eK3+WOL+ovOHl\ng602gikte3F7kdQEEckbL+4lrflC+Vi64sw4drlmmZqycikeirhPVE+leAXB\n0X/DMwvrAz1v8tuVNT6+5JJI89YYqsUqBOzEZ+wZ3foFh5PP3rEWr4oof8ZT\ndj1ar0hAvuyq+bJ12UWwkwJVR0ijCngc4ml0BCwNMHPESxk6edLW/5aON9+L\n6oEhsYkG3e+J1S0d5HhfAaQqitygvJXGFO6JAqw/938Il+Y3+W82E4/0PLbu\nMsNDiNx7B2BSk/GJVqy9mS93a7LHoR5j7EcHpqkFM6xerIU9m5zjUH1tnyu2\n6Mja\r\n=pGO0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"cc5e85e26421c4ba3bf9cf8ad9e0a20bb8a5f90c","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.202","@balena/jellyfish-environment":"^2.3.22","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.6","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.14-renovate-non-major-cc5e85e26421c4ba3bf9cf8ad9e0a20bb8a5f90c_1610885801269_0.5231021208852562","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.14":{"name":"@balena/jellyfish-metrics","version":"0.1.14","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.14","maintainers":[{"name":"toochevere","email":"pj@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"77e911506aedf681a4a34feb28c525b1e332a515","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.14.tgz","fileCount":17,"integrity":"sha512-pB5XdB1A+K/TdE+el3HY7kp8lLXSZPxBDM+/wQTUOh2WN/VcwaivSmF1Qjai9jUsu0mCJMTO6CdIHTdOfvicGQ==","signatures":[{"sig":"MEUCIBsmmVZP4YEo30TojTpIqdFgg3yqfahZJAT5qn5vuJSZAiEAmRulhN6sIraQcOhCgy1SThBsiiSI3DTQ9CNQmS9zA1I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":101958,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgBCtlCRA9TVsSAnZWagAA/EUP/15SD+tOaJQrbz9RSn24\nyxi/cnXwgHVU86jHAbSvKxB3VNI4lYtjKSWywK1Zpq9YkZBIf7ehEZBG6quf\nfK48dSacsrU1GYFuASavVIKZZqHRYnbDpC5XNBnXzLbyEdCLB09ShVzfcLYy\nRxYktZWQrCNN435Nah+KyUFQrEdgGfUt14q6U14rM1DNLjyTE2L8Z+AqBTvO\nJF5GuuUa6nHWwYi2Ez02lPoq2uO/Ujt0Y5genXw+upYoM+d0a5di6s4mEBqM\ncAED1WzXPO6XQrqpldBwYmSMUnWGDwpb02pNQ9B3BUQLhtJCozz9CgBoVps1\ntTBvOAXtin4BrDC3qqpKoHjvoKkYy5+ats5M2Rrry0iEjTlviou3cC3M175r\nLKuXkd4NvGZK69Y8tnIM1w5cw3PbUi5IholTnUsvgpBgeLceHEv/nKbWGyj5\nPWmbMwRdzrMsJw1J9ovaLaNB7PHPfsXfSKjtDVjrXizQjkqrTQTSpN6X7Hxr\nqzGOEyk9MzqbCiofrM+i1RGxzQZ+gGjhfx7Jy7crsMhvoFehQIvxrjl5GPdl\nUMpfL1tNeVVdmJs2rzcI1vBSH8EVDVOUVyHrXhMHkOsGEZU7/fep1NUctSmi\n5+cZBf4b5k705zAS6WVDOI2yghJ7tqKa9TsK7a73LIUAT/JcOtRpVQdP+tnC\nMv+N\r\n=vPl5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"7d70b2a5d5415c0199fc2ea392b2db60e8acff00","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.202","@balena/jellyfish-environment":"^2.3.22","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.6","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.14_1610885989086_0.27501682311092357","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.15-renovate-non-major-7b3162f5b892d175550cee71ab171ffe1294b767":{"name":"@balena/jellyfish-metrics","version":"0.1.15-renovate-non-major-7b3162f5b892d175550cee71ab171ffe1294b767","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.15-renovate-non-major-7b3162f5b892d175550cee71ab171ffe1294b767","maintainers":[{"name":"toochevere","email":"pj@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ad19eb36b086bc8cd9b61d47dcc85a581dd467bd","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.15-renovate-non-major-7b3162f5b892d175550cee71ab171ffe1294b767.tgz","fileCount":17,"integrity":"sha512-+51rD3cISPlAo5ELO+s72yZ0eCm7jigtB9FRJ/g1hkTaQb0eRFn045f9VBd4zppvBQWZNRzk64asUlftv6O6fg==","signatures":[{"sig":"MEUCIQD74tBXRD7vuNHtXx0tUPqpKSLhR87XxphD1RKmRbd3+QIgF96cqbYHzZWfP8drl6veVvzJmGnElJXJ9JsW6yGfbKU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":102129,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgBDoKCRA9TVsSAnZWagAArhcQAKFq2+X4xuVN0v4s3f7C\nwBdlO+zLtwUkBLbtGhWmt8Vldh9lik/4VCULz2KFYWudOF1A8zNI/NMrrR+R\n2BwqcHob3Nn+ub2ptIIq9I7ARK3g6R6lyA1NqqyGLPq27s8s0WV24/K+tL9Y\nJb5KNY0noib/oYVH6wDUOP44N/Pz3W9NOl/9HPQtPHFOy7LeKEpYYdafO6AF\ny+yqq+h9Bv+UzOldpPgLGzqOUGIfMWMgidK0NudvtUCMBdA6NrNcpzbSTY/P\nOQtjG+cHn/p6JY7LWcxZvGOjIoqQFYUF7Sv1dz7HnI/U34zIukscWDA/j4Pc\ndU9KASJRrKrx5E1NdJvmY05PYrYr/ZX6RrjloI5DEbqtinZg5qcfTXtf3yn6\nLb4p0r4mgLo7Udmxr1M55JWjdHgjYBNKWXTGd+tGh1GJubPGuUlo7bSUVwqT\nIgfftenJEgTFGGpihFHfmMNEW0/enl3NUPVKSU5+QljZtoDMG8K/E+vmuj4V\nHWeVxYSLm68hOla9XbEJ9HJ5CYPt5w6eICL6KUUmNs42B/iULb9pZGzvx42l\nCydBzNboAIc+CMqAIdOsWrm4zrFxS3UFvqbMO+goSmepSgEIS0ZEmOHRJ6b+\nYMC73cQAFH3Zj2YwGnfjjcxCU2ywtPorvfE8ljCGT5yGVrMbo0aaIMz+jCCz\nVWtw\r\n=qVfx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"7b3162f5b892d175550cee71ab171ffe1294b767","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.202","@balena/jellyfish-environment":"^2.3.23","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.6","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.15-renovate-non-major-7b3162f5b892d175550cee71ab171ffe1294b767_1610889737977_0.7914010583719773","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.15":{"name":"@balena/jellyfish-metrics","version":"0.1.15","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.15","maintainers":[{"name":"toochevere","email":"pj@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cec7fb4840d77bdf60acbcf12c3d20b0eac91a64","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.15.tgz","fileCount":17,"integrity":"sha512-VLofE1RJzMklhmOal8CGt4acsNG0PXfk/UgR3c4XLbgWXepeTGBSKOnVGv4qKQFXCsKFLGID+xm1ljJWwkA6Kg==","signatures":[{"sig":"MEUCIC7+ysCAbXkqtc4NA0CFrKEYMP3h6iU3oMquTByod+HgAiEAmdHeYAMFflNew+/Wy/KuU/5AMi5AIxeW8d9ERC5FAmQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":102069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgBDq6CRA9TVsSAnZWagAAERkP/iiOKU575wQmBdrCBED5\nnCuiEz+9W+6E1NLL3Ul2TWk27mGU8b0zqeZdbfX4893x7vqGVANVoaHGUje+\naxKvRjrYgwp4MyKBo+Ik3cxqm3jrugy9KtsdCi7fzx3Dpx0FKG2cbgnDe9PP\nwpXvUMWwFs4iaFMovZTJSvydOJ5sQAXKY21j6xJWu+amOR9dS98KAmmc0vBb\n2FiSfUy1ie9E8XQ6yxm/kh08YtKLAcdd042As9Ll8ENCBmRpeeXzE7Y/dF/s\nc/uxQAzjkzPX0xYD+xT5YaMsv0TJw9//FhAJ/g/2AcqaN6mBzi2hvk7ER4Ok\nUpqWC2QtxsMty0q2kSjWN91DzO8NEhthezU6wIkjFifa2Z4Xl6kStUetf9fm\nOl3pEDhZiuNJ0fZls89fvCwfZMSNwwm4t+Y6iHWqqciZLkp0MrfDSjXOT61X\nET7khCSFpcbsr/CNOmHXGvFdN9Ds0foLCfmO9P5ovRYT+42mQrpGh3JZOTfY\nDFMejx47nSun2P3jawf1Nm+Xc9Zl4OnyTzFz0pQr9GQ48qplD8PPUI6gtloy\ntzGEHRGAh7x19CnVWpX2/mL9/+6OWVMgbKF/yTTW46pFFVqHT3NXB7/ZXnFX\npn32aimFB3doXHnyG1F0q6uVhc9m7TNY/AJ6HZRjWyNgb2PxhqaeijeOLDb9\nZ2Dj\r\n=9Ngh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"26f84df68c084e2dfbf56da69f9b83eb4411276c","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.202","@balena/jellyfish-environment":"^2.3.23","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.6","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.15_1610889913864_0.02549352246490555","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.16-renovate-non-major-f8e7a1a7ff66cec1a7783201d634911aafbb2ce7":{"name":"@balena/jellyfish-metrics","version":"0.1.16-renovate-non-major-f8e7a1a7ff66cec1a7783201d634911aafbb2ce7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.16-renovate-non-major-f8e7a1a7ff66cec1a7783201d634911aafbb2ce7","maintainers":[{"name":"toochevere","email":"pj@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"480b785b17f6e82d5cec6768bffba42cdfe5a4cf","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.16-renovate-non-major-f8e7a1a7ff66cec1a7783201d634911aafbb2ce7.tgz","fileCount":17,"integrity":"sha512-IU25BRy/tkztb8TlhP3mjjguoJVojZjF0iJKTeMG37sXL7r3tCZ+g9jf9GHuqcB8KNo2f4U4GKTEgn5xBzEWCg==","signatures":[{"sig":"MEQCIEyvI/adzWNzTGR6QzKiN0erqeBIBtguEguk8PmxRZBFAiAolslH6LpqIkLcJeOyD/FKOGExExaHyatNgR+UG1cN4A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":102236,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgBEZZCRA9TVsSAnZWagAAB44P/RTeaClTTxd+AlZt3JV/\nMa2a6i5kTMXaEYxWB5YgOhxwXIDM0MHagHUETtkvd4H8Hx+tsbrp6eowjNAP\nxl6KXrRAsNuEVukgh1xByVmVWSRiyFtY09+b77FLvTtC8pGyZ6tek/dDe0ky\n1kM59fz9HO4S3zZsG8KAiJlfT3cz/T+VPB85UhPevx8l6ZAhykUKX9djOxhD\n1g31tja6zxSc038KCDLCw3WsUQy+tkShkAFo6G6BIUK2IkISVFRJb49kUxYl\n3p8GQCElEGRM/moPcoREyoSk6i5g+RpeQ44h7JWC5FrDWgmez2vQIL83t3l/\np2RpjoPSD+XVfADKBXKbqxehY0LQTQGa1nl7nM3i3cGgOwcl2r8PzUedz0sl\nDp0bALWwbxOTV2/eEeqQTHyZW4ZA1oa/8KXa1pRdqgqz7hppl/tJAjSmKxRP\n76PnrTKOQbxEhrOkoIHbrAhlHDPp/Y5EaOUNDZeRMe2rgBC3/mTVcnxqlpVM\nEckSF5T0XiK5iDvX1cMVqBJk8QdpaQuuUoBSAP0Ciijl+ajEJZq5Z1kT4l9L\nSPQA/dau9GOFAJ/2aMo5VEqrbdi5yZxBNm9FySesaar1nAPJ1MKWQu7maTvQ\nQH9+7PxqM8z2+nEKP082I0cdkCbT8MDEvzSG4cyuQKHi5m9WmIF51+JShJeN\nA5GO\r\n=nqzB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"f8e7a1a7ff66cec1a7783201d634911aafbb2ce7","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.203","@balena/jellyfish-environment":"^2.3.23","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.6","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.16-renovate-non-major-f8e7a1a7ff66cec1a7783201d634911aafbb2ce7_1610892889250_0.2989215815176882","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.16":{"name":"@balena/jellyfish-metrics","version":"0.1.16","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.16","maintainers":[{"name":"toochevere","email":"pj@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ec5498249af5f027dbd24ea76950ad5bd5f21ef3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.16.tgz","fileCount":17,"integrity":"sha512-sIQpetwmeTXU+BHz20taYDbnU8Gy+vAjDnLr8rrFC6wLjIKlVJC6txvuCy3i8WTBiWZsOTgqQBBUiRwuJoCtbg==","signatures":[{"sig":"MEQCICjTiZ/rxqUJIUs01lghbJjqsph1OjXXpKwuLS2lYZYzAiBogJvrjWBy7duxE1z7/qmf6Hs99RqEj/ldBdJntXc6Cg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":102176,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgBEcGCRA9TVsSAnZWagAAZCEP/2CT4XGJGP/ePADZpdaC\nrO9mBJAnt+rRBya/ZIWR6xYjbzX/fhwQWMGzx26yjuyeddpZny6kcnb4eG8Z\nSTwP87B4685eJ6MTfvlwbFOsv1nZnDCBvYj1w2uj+ktpsRbgtXaKBtRhnvN6\nVjSP8ZuMA6hyMru7Sq0St4STAIVGD0TevQDjeEAOi6OLd6UemxfZQKKaJ7VQ\nknbJ0YKn9hMnyMRRsCixFQPQL44+FztRvirq2N6uEDb3/Onll48vPk6Wbu2e\nt31NyUFhMXwbyR1xffx4hkXC7Zw+ktA0k3UGYeq3zaD5yo+O38hJg7BV8k3G\n40Nx/RYbwuJlimGkHRa4O8b0cCb5ZnjHR+xfBLQoUlkmNJVa6THAE4d8NLKZ\nq7LQM6K4ltu9sq1+wNGTuDsTOJ3oLVhnYd3ea4YmpVwQLqFOBGkzrit64UPr\nLfWaSxAUy9REYhzNl8t0RUq0dqXh8HTFAAXBTjjSeHvIvOPxvrFTintGILlw\n7lWME0/cGzbFZ2BUKUbhH49z3JVF0xgsobi1pMRsfKP/hHaA8/4avtBEjJ12\nulB6Ybs7C4LfRYyxwilLeoLvhsPNswQxSVJaSptzMYN1zheA12kdKhZLxpd+\nHTYXVqEK66PNnLPWCfLj1M+WLN9R+xlJbl2HOxubDXMyMo5NdF2LyDHTkLtV\nOsEL\r\n=Wlgt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"8d020efc951cda49471b76e7ff02f67255db4ea0","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.203","@balena/jellyfish-environment":"^2.3.23","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.6","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.16_1610893061718_0.23767547778521547","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.17-renovate-non-major-52368694d649362e5e1f0145d66950efd7a24ab8":{"name":"@balena/jellyfish-metrics","version":"0.1.17-renovate-non-major-52368694d649362e5e1f0145d66950efd7a24ab8","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.17-renovate-non-major-52368694d649362e5e1f0145d66950efd7a24ab8","maintainers":[{"name":"toochevere","email":"pj@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e8b60b302a36bcfca15326bf6a4930c6b5546996","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.17-renovate-non-major-52368694d649362e5e1f0145d66950efd7a24ab8.tgz","fileCount":17,"integrity":"sha512-S8EmU1N76DZ325VZ3RgvwVyeBWZwEvBIGuO+w4MIEltuo0rxh22XJxXNFuKnVq2MZzoVElXhURDvKZk+qkJj1g==","signatures":[{"sig":"MEUCIQDHXzF5DdvUdpqc4l6PNXkVcRDdMhqUpQVzZOd3rVkLewIgWdJmXqb2iVAQNQpZFhuSoX8bbI4AZBpzaGp9qAm/B7k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":102337,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgBUqSCRA9TVsSAnZWagAA0YwP/RW+418tYUNuHKOb7PDD\n28EbciY1c+AaBZGgrIeNuOOVwbdjV5z2fOVcPgt/7g+zSmSCh+2uvBSZa/1d\no2iYCiwD4AUbq3mobGpmqmCYzWtPSwkiwyFiKfpF7Xj2BayNvJwIzt8UOqHr\nr/sIMb26JqkGZzY8XIGjoSVweSu8x03izymqtgDJF15vCaJaaKaC42npi7m+\nEz2Xj5CkTDIphf1l8FsOJb9tdMPCbrpqE5H7/kZmES4c0d+fcd0MB3dT+9bu\ngZh6ADT10DQezAYsypHx8a0h1tp1X7gbKEV4klhwWPe0LhmXGEjbkhxjZbEi\nTaUyqEbkm21oq7L9YPbjUURfYtq3jp6pMCwXg8t94TLTRQpAA0GDrjd+VUAU\n2jlMx7MmX42JgLeJfVPmuqiiFPHMPDp5+kwRrOSBK4psNOprfsqesD4JRpA7\n4tPKZSJF5KTUDgYSl3WclQw6gJWxrwIwxaFdO3OZ6Ause7/4YWMhOyA9/lGj\nMmfWj2ZVLK5vV8uViJSkf4gFKc77mOEN2h2dQX61K0OuOpSoXPiGWUOrsrH0\nKbfNIR/Kqoknrbu/pI1hHqlna6OSFvJekjO2Y6DQcpB+TMbDVhatRgnxu7Qk\nWEqNCbYW0qxyNCyaBTPRW1LGz5E64XWlz2j0q7nuO8W2Y+Z9we30uryPCMX9\neGuM\r\n=MaqM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"52368694d649362e5e1f0145d66950efd7a24ab8","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.203","@balena/jellyfish-environment":"^2.3.23","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.17-renovate-non-major-52368694d649362e5e1f0145d66950efd7a24ab8_1610959505507_0.17992252755607163","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.17":{"name":"@balena/jellyfish-metrics","version":"0.1.17","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.17","maintainers":[{"name":"toochevere","email":"pj@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"80c09dc47b4323267b847964a62f0709a9a0c678","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.17.tgz","fileCount":17,"integrity":"sha512-ImcTaDpVk+xPunlFvZpavQIXY6hCboCcTU268atscvXDixywpsv5El2iFG1uJW+ULkp4ywZgu+QTTwTk8fz7Iw==","signatures":[{"sig":"MEYCIQCvgQfvM+lUAnrpb6QNA17RDocGG071rlV7ngRIUqR1fQIhALBqbcc36h651V/6t85663Gt2SnjacRWTbfw6L1oWeQX","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":102277,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgBUs8CRA9TVsSAnZWagAAOJQP/iygcN9qOEWFasLJjis0\nvUSJ/kH2HaBjPSBm8QvTOpuvX3pNU+wwwhQHNjdUVg8Dc2Qey3Qcybc1/zNc\n2N5Q0aGYxEGvhW9s5vNHhmL36vLVo0Uw2ujI1HWEn/uy674ENg0rm7iXsTOu\nV6Q8ulkDiHIewPej7fsq0Bb+SnwK8nT1obolvhy7feAf4tKHn6poONVbqrBR\n9OAv1bzW0+V0dcn0ruXptjDw31mdgi4gOiwwvpKxnAd3UZXDEKjQZHRq7rHS\n12auv8G0K7UihJ4ljxtJ9DTEqkS79LBPrYt049lNy5aXTaf+C+tBeKT9Rg97\ni96hfYwe4wYeSaGR1YF2eSH+bD87YCW7/OtwMNl2+d8NQpVWpyrs7qzAek3a\nbqzQbh3CRarRzojihcpfy6kLQglWR0NYXlhlMcMiv7lcrX4SzHMyPQer/NG1\nJ9qFX6m94AznoXY8yOM4iCqoqdRIiEtW6pLcEUWJOyoHt6mKvhQe0jjFkvHg\nYRmGdOBysvH3IjqjOEOq2oi+hcB6DTO3SvlmBNPLx57Hzv1B/ckJS4owpFJT\nHrvFNs1U8bKO7Mm+nmTZgnnXMyBlMAzkgK0QxJ0vddR2LjWU6KKLEGQmKT5p\nyPaeKT92PPV4PKjANw36drOweyCWVKEcD6gLwl1fPAFx4OQusZHvwy5QcPGZ\nnsw9\r\n=bSZq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"0b72402085b5d4b99125ae2138f45a89c65a9edb","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.203","@balena/jellyfish-environment":"^2.3.23","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.17_1610959675648_0.3391492384599546","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.18-renovate-non-major-bb22dd3f9f93c6fc7e3ec54c5d1616af054d28b5":{"name":"@balena/jellyfish-metrics","version":"0.1.18-renovate-non-major-bb22dd3f9f93c6fc7e3ec54c5d1616af054d28b5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.18-renovate-non-major-bb22dd3f9f93c6fc7e3ec54c5d1616af054d28b5","maintainers":[{"name":"toochevere","email":"pj@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0e8c2cea65545c8b47edb03029fb871b2aaa392e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.18-renovate-non-major-bb22dd3f9f93c6fc7e3ec54c5d1616af054d28b5.tgz","fileCount":17,"integrity":"sha512-d2gkyVZdI0akIe95iagAbSrhIb2am9Fi9kSp7eScdsNRxnpPz1ld/ZWrLwJbQw8FzvroXPmzym3jb3aPeAjd8w==","signatures":[{"sig":"MEYCIQDehtePGwUpDnBSNtsXfvQursA4ygHQqFW4rf6TWcfPawIhAKNLP7J8ZWMnlgq9xnYo55e+7m6xEyO/OqVvUQpgpsWh","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":102406,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgBWehCRA9TVsSAnZWagAAuCkQAJWPl1IU1JhhUj4gungW\n6YP+iC2+XDMCnmhJXG5kwP01CB5jqtXCwisr7KEB37fQKjXeh1UPQGCSeEYC\nBAec5B3ehfR8Qa7c6g3R6cwqrAT2Hy2OrstOMAgLEEzy3v+XD+rCz68RDOLK\n7UufOWiOoeznTEuFIu3RpPArl3JZW+EehDkDLW+QmluxvCYqc6xAveSFFh/d\nSMKDupfQfu65joSPuSxADIs14Je92cHBFmEV978EHGRuOGUWv+bRMOElPjFu\nAnshPKOvZoYTJDORd1v/YicmuKXE7bnE1kENVe9WgYUAqFNAMGOR5ZiIxG9P\nVP7QK+RFpuvN1X/AJ0dS7TYWSTYUlCLwA3c83wQRy+W0QVDjBgwRyNMGF6DM\nV+9saCZSyckW1YHI27eEIFoMS/S9e58phvZ6gZ7So/Z3D8WpMvDkfY8iKaQZ\nc5/Vl3rn+CHeAZpmaHjM3UPxuWCAtDvfIwqu95i2sWLjKdQUe8EmOXLhKE2C\n/QoMBNeNjPBbrh+bEwMJp7DFZxILl5rhk6OoNHH5YtaVySv3jbhVNAh4Qm69\nLrdhntP2fmfxP8DFjVHQBc66SO4CemceyOxGdot18FsstralhNuftUslIvVz\nbE5PhmeKhiyfn0lwLeWRLh6wRU8M+hAWVdD1+gKnO6E11fhALhtymrIQUKRq\nQrSq\r\n=ZEzh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"bb22dd3f9f93c6fc7e3ec54c5d1616af054d28b5","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.204","@balena/jellyfish-environment":"^2.3.24","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.18-renovate-non-major-bb22dd3f9f93c6fc7e3ec54c5d1616af054d28b5_1610966945297_0.023541430754772996","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.18":{"name":"@balena/jellyfish-metrics","version":"0.1.18","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.18","maintainers":[{"name":"toochevere","email":"pj@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8f08189a9220e21a067928ac739ce80208b2987c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.18.tgz","fileCount":17,"integrity":"sha512-nB4TFea3/jNqGwKR+1Zm7YFha+TS8AmEBw19CRFraEroRf9ZqiwVidachYYN2vfdHzvrsRS1vCCne+pf/1LoQw==","signatures":[{"sig":"MEQCIBxlvya5glEIiHSJl2M8veHeheTLh420h6tbBJDiL1iFAiBVbak2hEZdTzFt0/Dd/Mz/Ngtn1qYTxTpMQn9ql0BqqQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":102346,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgBWhYCRA9TVsSAnZWagAAfaMQAIvMa+GNI9LzaaZDDiLR\nzRh5VM6w7Z5J91fieC6jl52esSde3EthRs96Ik2ZhjI9H+277LOGiwmC+Z17\nV7Z907n+0/RJ7I2QWtg0SZbfeaL3emI/2WGpjQ9EkKxlKjStEZrLvuXGfeQT\nKLy4T5jrf4DoJhz/AY4u0U7PQB56mh+d1tdvq4g62nCSGQLlURyvCQM+GKJ3\nl9ItgiJGoSgirw2rS9ttCAQZjqY57mnRS8U5At+pNsPgx2OxfBUpYWbs+rbh\nhW+70Ia5qgreTIfs5slIKf+tlOebI3nfeGXmmJk3Ceebb14pUQT2KrV6tuem\nuYNyZ4BHBNJ6nbcCzrSoS2hkYL4t2qUaMkWBeRcrlKpW371dHljnQoKyPdzC\n3j2svmKqoGFS4akuy6+ITxqu7JAg3hbhze2HLp6cIk4L8RifU2WnOK1YFkAu\n4wIoSXY922f+rBpseVYCiAESXkZG1jPxs7fMaGxPFvFWUhW1l0VjkiV3MrU7\npEeGvLhkCFOEjfiy1jjqkdwLlcMPwMAj7ftPsa/bl9pfz0nHIV7bIIeL3hJG\n09TcFBxMNyRmD3k3ZgmdXbxlTBeM0sSu5MuO+SElckdwgEppUrmhkDDathCD\nbvrTw2YVA54Z64kTVpdgDZe5fwsQoC+feWkXfhvaoyUDvHL8bjZyf9QU+TvU\nK0LP\r\n=dr/s\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"95f9511b92ecdc11a52cd3ffa2b3d612fa084007","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.204","@balena/jellyfish-environment":"^2.3.24","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.18_1610967127961_0.4747135228368622","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.19-renovate-non-major-6354b464dc80d6b51e71ae35cc0202965aa9efba":{"name":"@balena/jellyfish-metrics","version":"0.1.19-renovate-non-major-6354b464dc80d6b51e71ae35cc0202965aa9efba","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.19-renovate-non-major-6354b464dc80d6b51e71ae35cc0202965aa9efba","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"50428cacf22a23257eacf6f9ddb954bec880f56d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.19-renovate-non-major-6354b464dc80d6b51e71ae35cc0202965aa9efba.tgz","fileCount":17,"integrity":"sha512-s8Mq5vP3z7JgJM41K6nNooBt3QpCscTmt7hFw9T9+gUZqJGXK2uwLcSQLN6WQLTXSh+lXN3pZk3NR+T1Lwczwg==","signatures":[{"sig":"MEUCIQCqCcUm2x0g5UgoazuOVxSoEP+8zfl2MfSTFhY4bDQ25AIgHGqiYU0U6dsbjIfdilK8OPYhX56ZF9tNZET8Zp00dmo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":102513,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgB6//CRA9TVsSAnZWagAAlKkQAJBHUsPkLmRXdDYsHqZ2\nJYwD2H+FRB56H4uvfCy2tZ/FWLsnbrD+6tgyjxBZGH9TNmTMFic2EAckMEM4\nCMAwVQaJ7vHMbb9KkjKqugsKaLCjBSvIz/zqjCPMMj2pDrNGevhkSm71T7KL\nOQOg8d9J260/S6Tmy/301nkLC4LeO9SytC5Tse939jSDR7mUOz5zMebGx3X4\nDeaZxWGAxwe4pY1MycbBPCTu4mBd7K3uMHlWhDrhoVXkTkrRO8mMv6MulJsx\n55x5pwTnIKwp87mw91/unAni4LKJskeRtgHvsiIQ+a4pHGotKkjivQ8M3wzv\nGYfYWNJOczoAPOexyY3/4S5kndE0SETHtCEZm4FV6YhKsytUevP7XoG1zJL/\nc1GiZ3b3fH8OtG6Nh8ItrnrDfUo1QGlSGRVkfaIcrGLgRvDWPYW0Lx8iuYcU\nY10EXmX0+iRHCgsbkRVikQEMume+wNtoccd5N1um5P6u2j5uWK+DiFgo34Jl\nY9bND+t4UPbVT6u+zxVzeY4QR4lq8fQs54+WEofVspd3TY/+aHTTUuXrSANR\nTZbGNU28M/D7nEjSC+SVdaidDD0QQKPUVzDjm0AOc4Nq1maGndLu3utoHR9C\nJ2A63FsWcrz1uSFZY+QPiJJ0DxV3NZHKtgDpvlUztK4SPMq53gsmYOYpXkRi\nUq/S\r\n=JrsQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"6354b464dc80d6b51e71ae35cc0202965aa9efba","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.205","@balena/jellyfish-environment":"^2.3.24","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.19-renovate-non-major-6354b464dc80d6b51e71ae35cc0202965aa9efba_1611116543318_0.2354483911047227","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.19":{"name":"@balena/jellyfish-metrics","version":"0.1.19","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.19","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fd9743a65571e2dd8aa056693d5972ea5345f63e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.19.tgz","fileCount":17,"integrity":"sha512-fOKY7In+PIQoEJpl5WQM0kLXxhdCzIXoz5aU5lv+Ie2wHujH9vFR1i/spvhtPwGxNCu5Iir5BNAeuvsYHCTbmw==","signatures":[{"sig":"MEUCIQCI6jifHuy2G36wfN+gTfOiqSx+Kfwn4zzHcm5rEW5vBAIgMTVWyAA1tNsSmlK6kDq9jfutXw1ftqs1xldT6SsLLns=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":102453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgB7C7CRA9TVsSAnZWagAAmzQP/jBPw0WEyL1S+G0v8sD/\nu4Grrtm8dQvPGribIK6Lq70ZpF4737qrCkYxHomwh06cF+v9Fb0fDRJBlFbe\nx3K5GZjRrbQHDl6q5+/V2m56yFc/JNsB9tAkV41qmdJTsoj/qlyM5mnyQsCW\nWm8CrqPIbovWmzg0oITcRnTV5WrFGT9y4WfeEGbGxoRqJnLnsokgzoF/6KhN\ns0PRz1syAuc5fywdhCtfuxzqqCYxzIoSc8J3Y0X3beIpyZxRzmA4s+3WvTGF\n4YCcr5iPEInPlBEnOdFWLsfwIjCWkMzNoRvlPMwbXb4hMXtfRkuKew4q2rMd\nJIaZjJBgXjkFTk2Gbiqfq0MbR1qnn6tkrYocbhje8BtxQWZft3IsuAY4WIfy\ncQMcXzFc/bOuK3cvPRzx/Pqm0PSngt40FuaE6sUxLzfQDO3ieXkuFy0k1H5i\nG3Jv/wc6E9tSodHq8icICdfMYBb+l7v8kbOnE1jrncCGPCarB24sidnfo94d\ncQZLVsWkiuIGdBhZdCswuFjIl8DCVFsApy6IPOCUNHRw7z7dG02lr27oebqy\nR1sokexch5e87UzgnfaTnT39V09B6hsmc031E+OFCBVsT9q6xeUx29GufY2t\n0AW90O4Ue2FA5oBLwm5O2ndFKevHZK8davpD8FQ+mHTlq+4ENgsrvel1n0kq\nhOlv\r\n=G23T\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"247e0dc985b71e1b2951085250be36da582731e4","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.205","@balena/jellyfish-environment":"^2.3.24","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.7","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.19_1611116730517_0.060421233495044246","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.20-renovate-non-major-a2b587a3a9effb97294e9333c8ce301969603f0e":{"name":"@balena/jellyfish-metrics","version":"0.1.20-renovate-non-major-a2b587a3a9effb97294e9333c8ce301969603f0e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.20-renovate-non-major-a2b587a3a9effb97294e9333c8ce301969603f0e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"29178e178da900c070605a14e9d1597ea79fac1f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.20-renovate-non-major-a2b587a3a9effb97294e9333c8ce301969603f0e.tgz","fileCount":17,"integrity":"sha512-MHIPxw0ZEeEr3XQ+qRuWVgsZAI73jPoCLTHZrxk4Lxz9fbfezHmtrr7W+lPWyuWlBBA1pRfhqMYfsBc7beWyLQ==","signatures":[{"sig":"MEQCIGvBDTRtI21KTB1YmfqNetj0ZgtMAT1c1whvDynLJvW1AiAg7l4D1yAowKMgbaZq1QmTlp9D9MlonaBIW+eLxK/36w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":102582,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgB8ZkCRA9TVsSAnZWagAAKCsP/1D9cVHeq9BmrXNT+3BK\nyAGwaesowtnQgVo07lzkK2wWjEc1svj0lF/Jw0Z9sr+gHvEv9w9Pe1BPSG2q\nYQuOl5RCY8UdMumA1BobVaL2p2VUxtDzthzbyR56vFW7YhNA4TMOxyw6stsk\nua3KABS6lhnCzxLaBonb23XSOlyMUKbyyfCwnPMIBQbFhBMvorPfacSuUCwL\noFyTZP8t637peRAe+8/aFrKlyvMqSw+yo/liOPYJHzAnSOJQlryTdSfWmhzj\nACHBRbYpNZQkd8XGeWYrIuG3nFylWogzShU7DP3vPCFokEEl58WDvaTJ8fpl\nVhxCXrx0rT+pUFn59QgaBPBfPIP1a4yQo8HFW+XR5tZa93PS3HM3eRzK0B/H\nPhuQq1b/ML/7ccnix8Oepg3A1oNZ7LhLDwBmbg2NHV4BOB/QgKHsLHIEqc1b\n+s46WMls5cmuVwmo6zYUiyR3NPtqyMuvLA1S24WxPVjxumt3djJoyVyHGW7x\nJteRJ5AAOZARm+6TPN4Nvva3yNytok7Zz4gRBhxIY91e5ij0P2yLef80G3HA\nN95+CZV73c15FDFZz+cXsi458h/EKr3E1R0Ra/SpV8kvcSG/F8sez6IW+FXK\nL33SD+WaQVzFq8omMVy7yXEDMbgRXc5PUL5+lhSBgSqw6XjmQ6it+AQBf6Ng\nhOAO\r\n=RbhZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"a2b587a3a9effb97294e9333c8ce301969603f0e","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.206","@balena/jellyfish-environment":"^2.3.24","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.20-renovate-non-major-a2b587a3a9effb97294e9333c8ce301969603f0e_1611122276367_0.05553055397597606","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.20":{"name":"@balena/jellyfish-metrics","version":"0.1.20","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.20","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5958bcac8c6921de5f77e507270b5da895f69947","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.20.tgz","fileCount":17,"integrity":"sha512-2tVPgd5C7+Y5hiS1QdWA7qWbhAfqmtq84/wlLDrp7B2o4S/E3sN4oqM7i6JAejmKMqQkOfYtvMUMHQC0NlAncg==","signatures":[{"sig":"MEQCIGLSLJRzFwucI6fCvrBBh+aOqErdKDnMV1Shb2ULn/xMAiBjqA9B3NU9Pm0WLgwU43lEem2Mw3cQQeKF/6b6C2cWtw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":102522,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgB8csCRA9TVsSAnZWagAAEP0P/j//B04OYa3VArIxkmTJ\nYjj50EW1a+8pBjiJIj4vNq7kigAOx4C5XYk74f7S/V8IST8l9DUE1UWz2DU2\n8p4x/U8C3cSW00IGr8VLR2pXAUS1cWsg/flcsyEduI5GNVAigTWH+34jlNZR\nygVNQWdJciitrp1ptInBSlZ/vaSLCGJwmlzCEz+k17NhwK9EDQcdHirMbvFN\nkplOUwgovWro30XqgBTVpcvjY4Xz+2oKiPQ/QTaaq5SgpOmWmQ00mQisg04s\nh0Fwz6Vq92PxIZVIeuZgrXUzoxdugcySjKNXkvxLfkRtPO4562Z2s8v09+Cq\nUE5azvAVhBbdyqY5r76SqZGIyRLqU9w+SmyjrKK7HxxRGk1gAyyClHIUmU3p\nIdsJMXZ8zNHUieoNm1I4j/MBUWzV25wtN1JMDjYuIt6zCRyZ7/NKomo8IfR3\nVqAWs6jQDQm5fzuy742rB+1lv15QXXexMJMsRzV7OOgJAA76LSAZnHXbzn6T\nkxo6jvVCcj2otqp9T8C8bZZEgK5Wru3mSyyPfDWqFqny6N6EiopoIe7RsOBx\nC4lhI+04gBsy1p9+H+/Krl3Tdg1N3m+BzbctU6vSbE9IcGgLUclED0f+UyT9\nQkgPMOTrUvUIvIIwfDJt+Z3IcgEUP7QMtGgV5wyUyqev9vkwDhOLFjP0LUzT\nrr70\r\n=glOB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"8be881d22a9e5e5b219fe85b711c353344f1a0c1","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.206","@balena/jellyfish-environment":"^2.3.24","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.20_1611122475798_0.9603365095611254","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.21-renovate-non-major-f4f63fb873ffbb5f4e454931b743f52b4466647f":{"name":"@balena/jellyfish-metrics","version":"0.1.21-renovate-non-major-f4f63fb873ffbb5f4e454931b743f52b4466647f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.21-renovate-non-major-f4f63fb873ffbb5f4e454931b743f52b4466647f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2ef4f886046acf8e273c971024b65cf67e419342","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.21-renovate-non-major-f4f63fb873ffbb5f4e454931b743f52b4466647f.tgz","fileCount":17,"integrity":"sha512-DnPNq63tLA7DHuLt5DbDiFLgpWmGFJSgk+krY6tg1Cd/8NuuAAgTby4YstcefZWPXDYkvdeDarO/8gaBM4psjQ==","signatures":[{"sig":"MEYCIQC4dIncZs+/IcGLWNTbgL/UZIWxh+58qg0UisRfTbj92wIhALaNBXlzp/g2s8vpis9FdsnFE4qEAMNG9GOV4EZWV/0z","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":102651,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgB+DxCRA9TVsSAnZWagAAgH8P/3HgYWG7zAL/6zp/MEAJ\nwX+SH906V8tf9zhbo6HPNFOwlEueUVW/tlRICQJzscUk4/GDL/p20YvOmBJM\nq2my2RJFouDFABu3bcTSil+j8yjoSTLCIgCRzgIhNpcyWtT/v8Ex2EquBKI6\nIKBLMaCeEU9rzvIXJMj0R1KCVYN6dfB+KjQtf9hfissFpUwdeePgKGye6WHo\nz1xGCp4R8X50CzVcZg/Bw5gzPQ0LcnQoCmjPnCd45PKVQ7aQOp6OCKXYF5QL\nGpfRELAsvx8eq0heHSHcASza3OyxIxmRA3TYCt/Wx2Qd8EfvyQAL6+86xd6I\nWxOj4zt1xDGOnCTz1UtAknZjrU+cX8V+2jo0PtutL4lGocGyyZfkV6Lw2Lar\nda0Pq8bBEPmPXJX5C1g0Bb1vFi0udbBSLC4BG4cXjQJYZP27KoXUrw2iTSOK\nf0mp09vbZSEcvQ485lsx2k67jafq4c50unLyQ5zr6PhydoqV2XZPvkvF/ckE\newOsDuwmg8mc1xlO/Z6sBxyclZFnpkH8A6DmVQuscWlnKANmdKjkCkt2jKPe\nQ9xGA/JdT8Mhy3xupEcfkulN8FbUcl+zpaJ5GsQ5fXnsYHR4GSkcSdvNwCWi\nTYTXbEMD2bbYsLnjQiE/v9wNd/hfm5pl0Hvs3QfzmP+kLsYkViFTuzmFiNyU\nJnpx\r\n=ZHKG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"f4f63fb873ffbb5f4e454931b743f52b4466647f","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.207","@balena/jellyfish-environment":"^2.3.25","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.21-renovate-non-major-f4f63fb873ffbb5f4e454931b743f52b4466647f_1611129072970_0.3660812592841711","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.21":{"name":"@balena/jellyfish-metrics","version":"0.1.21","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.21","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ac1e96e5e4500ceceba8f6ac781b4e47d8de0985","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.21.tgz","fileCount":17,"integrity":"sha512-Y4LeByG6+/DBQba5ko4KLRwCj8u0xGdoN8BSfMLZdBV539UrMwuOp530VMFdeJPsZDu3BO/MhdKqk9f1O+KDQw==","signatures":[{"sig":"MEUCIDSi7nkCHkhr1C2fg1pZdg9C1HgCE3ge+CnOhdOF48KgAiEAvwjNO3D0/B+/ldmCL0eBCVfg2SxT7lliqQY7JkFlgxg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":102591,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgB+GjCRA9TVsSAnZWagAAqyAP/jjGKo1pcVtbfWxJ2PjG\nzxFAdmZmX3eqI/bDReMUjZ2CzoqP5M2pqJfvnZs2tO2nxF98klQshRjCa1QM\nTa1PjCnLOntNW/uVr+h89PyL0IxqOp65tYPt1VCu1xij+Nf4bU/aJkWE7Om5\nsUwbjah7+CTeHZwh2wz3e1DQlYZCjZT8ySzzyaVJ1VNZfO/VVHLZFzU/gdv3\npV6Ld9zdtrPAokZS7JvsPYbeMtkH3SJuR7do5MVDHavY1zY5khwzsVaWjVFP\nQvhRMyv5E+fNH8nyZ5xiv0cih1wrO7jlVa0ePWhtm0N4NPxpPKYDbgI0N1M1\njLnEF3QwELiWMi0meeomBNV7Sg9T1GphVnv+sQiaHzFg6UphgsyWOSoZXhNt\nlK1UmVe1aGZo4cd56KTXCkS7jStjs0EKlHHGnROwgB+HJ40CadJcu+PCvAZc\nCTQmeBRXkX0TyEbJnCxC4o+hfjj/wK/AYgfNUZtTpZ4LDjcY0baDu6NyvBwn\n+2CimUo8FVqdN4F9MMI0id8GTsasyyCk9RTGdOq3Tbq/Poy3tGmz5VHoGm66\nGE5aNMJR3MAkRUYQrcVjTPgWeBF/HtYthhswD+cSACiDhPJfnVUPl+qqCYsp\n0Hc8j/3KBW8jvcGYZAHgVBI1x1WmzJ+ZrsHxn6W51Y789xjyrt3/drc5zQ1T\nwDeV\r\n=mb43\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"f80aa0dd74c2a610475b1fdfdf83b74b630a6aeb","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.207","@balena/jellyfish-environment":"^2.3.25","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.21_1611129250871_0.40301749746666693","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.22-renovate-non-major-8d2e6e69cd6fbb90093e7621789ef869e2e58dde":{"name":"@balena/jellyfish-metrics","version":"0.1.22-renovate-non-major-8d2e6e69cd6fbb90093e7621789ef869e2e58dde","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.22-renovate-non-major-8d2e6e69cd6fbb90093e7621789ef869e2e58dde","maintainers":[{"name":"srlowe","email":"sl@atiklabs.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"df1f3242d44f520fb01b57695ff4a3f85ba756d2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.22-renovate-non-major-8d2e6e69cd6fbb90093e7621789ef869e2e58dde.tgz","fileCount":17,"integrity":"sha512-rlth6ZuS0EI1D6S6sGHdpFa+TOmKQ+8dDaoO+nGOtozr61C7Ncmxf4hyFtBwhFn3TUjCt6SkTMZJK+DlfWxXNQ==","signatures":[{"sig":"MEYCIQDOSaXcJipa9hFF2nhZXcibTB6VaisW6aADyYPW4FgCfgIhALFJlr9j88w4PZU32a4rHzQuFzrbdZNnCO80Nv9etkXB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":102758,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCZ3TCRA9TVsSAnZWagAABpoP+gLY4K5rx3U2LCbKshK8\n4JG8g6n6bz4ddoj86EtwulE18JNYPYR/EXmsASXl6cD/zD6KrgLWwRMweGUS\nKo0I59QYEjFGwHsC+ymtAUSV64LeL2K34m0+Jpkj0ocIl7nHMME1Ihjt4uag\nJ6YHsMUrKLwt5kvlNEaXJjTLY2sIf6vCnaIc/VkKoRYthFWxJlvGqrDpjKBm\ndd7u+LUXk88KdyWQkTmBhRasuCaUCNTlxkR2RPonDOKNkodORjaiBxiSUadE\nyW1OCyxVKVvD1aZcraEBvA3yVb+OfGZ49EP48UzQs5MXQI+Z1lVE5PMv53O2\nMU65B4ZUUgT/ZQuRFvvS805cSQqrQDWT0EpUzJ8Lh0CuQ0q8jgbkUO30QBwF\n4InqCP5Pzj8hF0c7BgTOJ1BR8+bKuD27YO1rNJybW7XyiM7q9J77jW894hhs\nPsbNgopmWYlBKXQCvkeTjNjSZZsVOr9QNNt1ICHA5dyKW3C3SjLLqhK9wqxX\nW2hUH/TrI0fuRfK0Pc2t/MgKVFeB+mC69H+yptjjEOU5iKVZ73YaLUMUwXFE\nldlHQ+MOJnkpVs5Hc8O2xxNyrgVqBvtB1Axa2N0P2HMi6Q5F4bRc2/zyKZAy\nuKYuub24pAPPuWj39pvJ4wTCAgkEIfQk3vYRf3OsW01hthWM1KBWv8c16Hft\nBz3Y\r\n=F4/e\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"8d2e6e69cd6fbb90093e7621789ef869e2e58dde","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.208","@balena/jellyfish-environment":"^2.3.25","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.22-renovate-non-major-8d2e6e69cd6fbb90093e7621789ef869e2e58dde_1611242962718_0.40173680453913607","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.22":{"name":"@balena/jellyfish-metrics","version":"0.1.22","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.22","maintainers":[{"name":"srlowe","email":"sl@atiklabs.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c8ff42549dacc99b092253f82c82c32a17b26dd9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.22.tgz","fileCount":17,"integrity":"sha512-fMjtllacv5t52r3a4qn+md4DfTsYmzmKyijdTQ3FO0J0Lozqq7judC8lPo/VyAO2MizIbQfynL/OeH90iJuuIA==","signatures":[{"sig":"MEQCIDX2R8q1Ge0KlM98MSjBQBJ02SGRznK1ikcOHEz/5XOAAiBzC4H+Xsl75yEhyxGK86sSmembRdaBku9miDRN92FFlA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":102698,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCZ6KCRA9TVsSAnZWagAAbJEP/joQl5zc186ZDjFdfRP6\nT3xHN///x3urD007j/2j7KCZUEmMn3uNb59i4pB7cvbf9/9RFrC0RKMMGliy\nG0a5BocWhFDssd4rXAZCUWoyLQnbnD4XMY4YMZ3nLZbsHZiGipD6bE5z/T9J\nc9wHRhQE4oCxVFCjW/uUO79JiGWlp6KYJGZn1+Py3ozSIiXCexhRUWtW4VTR\nn0GJ6vDzfgdMQCQWjlirEFRxfuubfsXxxIReMrl8Xc6YmSBYXaEMasF6N+EW\ncYz6N4lcR0vj5zW4UIaGCdVf0Jb24I86DxntrVnsdHrJP1u11CuAt3mBUjLp\nbdm/Nx4WLsAaE8Yz8b4UFyGzOYV9wMOyZ4+WxDaudJCjwfUnYc7PoVjghLeQ\nkDw3WMCsiHe1MqaxS4Qxi9qyfDJRWxW3pegUJLPLWceEHGfLkutYaKUdjUUV\nBwbhAULYV6w9k0RFarCJoElPU51gjwZxYb8jyGoLE3GGv1WXaJ2EiFRg1ugk\nkOiqYAurwnxnn50JN7huBaV3kzgp3y4KRUXkITMIw6zNLpiIzmMBRfmnpEV3\n5UgIc0tfIqM8MfsctX3SReyzHoTantNCLugDNPV3vPRXbwpl9ovL216OE4L+\nVer6jlgS8LnlBM84A47O82mqw+zNWfz/GAosA6nmut2iBZ7IcimEpbolzeXz\nhSgQ\r\n=uVIq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"028444ec87889c21ff844f61baedb3a442505dd6","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.208","@balena/jellyfish-environment":"^2.3.25","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.0.8","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.22_1611243145468_0.18761788600701723","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.23-renovate-non-major-817dc9a06d9d472df56b74bdbd7e92040b23d231":{"name":"@balena/jellyfish-metrics","version":"0.1.23-renovate-non-major-817dc9a06d9d472df56b74bdbd7e92040b23d231","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.23-renovate-non-major-817dc9a06d9d472df56b74bdbd7e92040b23d231","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4962a67f622624a04603da1f438d61c4a4988f26","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.23-renovate-non-major-817dc9a06d9d472df56b74bdbd7e92040b23d231.tgz","fileCount":17,"integrity":"sha512-G7xe0DvmSpHnrS+e2WyWPg1RoeCcRby69nf+KGu+H/ki2JvhvoCoZB3ARg3Rs4DMTOaBNBtVUOzvIerOP4bicQ==","signatures":[{"sig":"MEUCIQDxN+rNk8TdZdy7fTmB7OUqkWoIWEOjTvXnwYIn/tpHbAIgGRzsi2Cf9029gPHqEYsNM/CUDGwzeyQPDBnVzw9yrLc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":102827,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgC6sCCRA9TVsSAnZWagAAY9YP/3YuFjgQZ9J8E3azJpsY\nK5KbrjG3ptzOREHdA+ukLQuvzzIaGbljsudvit3+lmguoPSZZsawDy5zVz4D\nhVtFE3Jl84FPhepCLyuSMpZ6tntFVALvGQGgF+zTQieYgc7v/X8NjtNwuLe8\nw7HQPlFUL3HPSNPCvSSXqZLZd1fffD9H5Jn127IaD17r4HRlB6v8aND8w/Ot\npXMiXFOW/Mjg6DVvZ+yo2fuvqCvNIYHXQZ+opHzZUQmmngSca6zeNs5ADnfy\nxSwDHNs6xI+Rw4sG/Zs+XVZhWIJ5EaqrnXmSRupChIJ0tAdhijrifLu4GCpr\nv3EEfz3mRTGUtAWqCFmTr3gII+/MOFcLTHn89KqgUPerd7OP8qFOsz6W2kX/\nuxli5hj9uv3SmF3sg6wvjMxkQKzWFbeKWR8YQo26a3BaqQk9+6WqzTdhg9D/\nwXICxnkPbKvNFLJPESh9y22TvimLWMQrRQmR7Ss1Fw5Qa3wnIg7fzSLpudDe\nwV47IOR8w4oOa6x8EdqhNREIDa1Y7VfNYC0bjY/fr/MJsvj6zxJbpmpa4XdS\nf3MLcHhOwxk1p8XMBm6FxM2IvGRkPbjf3bjV8A2w4A7WVloORLRjCsoQgbPD\nsCnvgvExXL0atnZNPZRv8ns+mJvffCimk/A4zqyX0ksw8CCNGhksTxI4hIcn\nzKO+\r\n=/8Fl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"817dc9a06d9d472df56b74bdbd7e92040b23d231","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.209","@balena/jellyfish-environment":"^2.3.26","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.1.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.23-renovate-non-major-817dc9a06d9d472df56b74bdbd7e92040b23d231_1611377409713_0.7261277655292644","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.23":{"name":"@balena/jellyfish-metrics","version":"0.1.23","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.23","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"32d1cae7b094608a351cd9cb3d4f2c378bfbd725","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.23.tgz","fileCount":17,"integrity":"sha512-ibp4euOnp9c/ZeXhyocqVI6o6N1QOsjF89RT/l40rdFZC/Jbslqf8ZZ2oRD6pLMhQgFqsy3YDZG8STLTxHgDjQ==","signatures":[{"sig":"MEQCIE07djp3Pf2iUJjszwJnUq+xa3nJaNbHz4DlF3Wfz73rAiB2Fon0YhKkMn7ezPbIoAPQag4KrlE+LgHPsJQf6KRTtQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":102767,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgC6vPCRA9TVsSAnZWagAAJpYP/RoltUleAXSW6jIM+S3A\nGSsCFnZYJVctITs7nWUi0DAk91JvgjhUoFYep/YlQvJC489jwZqkJZJFfY3B\nzmj7g/xFIl7sgkng0pW/APWxZ9pgsvwamque8FOFFfxeRMHNqx/hhntARpaK\nm76+DJQLLX3CEcBV0Wk1l4VYYU/dw9Zsmcru65BXCxdjeEp+BNl+E6muGXNA\nJJeWkDlXExpmxm2e37cH1WEG03jP7T8zf+XFOKYwybx4d7P/B5UdYxwRbweJ\n8XWjaOrT/1H1PZtKNGNXFTHL+7Bu10L39shWrm1M9XVynwsgwodPQizx33z7\nYK08hQxYu5K9X6XXEywVvMjC29P1vryRV2qjrtHfrtVrmysXMN2FNI1avVjD\ndg5MZ6eBQGXwM3ANnaNiPtosG7trpdo/VBHeEv8Yep6rdYNYR4LlUPA8dro8\n8pmGO4yw9Ui8KmXlvrPKSulRP2ZYjHNlMyRWToGzzGxxpxMQkim+JJHTVnBs\nJvoRqpd3CuDzjeHWWBm7bpLipNZPjm6OidI+boPUhvzYuDLWF9rwWi1kgE9V\n91Nwzp44cgumzCxRDhUCr5PcWzI7wEjSUAeEt3TTcv8ruVkoFcnXoCJSglxZ\nfAMperzYwIUY0MS/ACHNhsse/FDyMSMaRS6McWzlPup91NJzWt5tS5CpCOz4\nQGar\r\n=ybcJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"108daa0f85ee450981b25e603915ad1cbff844fb","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.209","@balena/jellyfish-environment":"^2.3.26","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.1.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.23_1611377614921_0.21756537513993646","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.24-renovate-non-major-2fad1f64f0c3ac90a87850e9d5cf249d36300011":{"name":"@balena/jellyfish-metrics","version":"0.1.24-renovate-non-major-2fad1f64f0c3ac90a87850e9d5cf249d36300011","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.24-renovate-non-major-2fad1f64f0c3ac90a87850e9d5cf249d36300011","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ceae45ae9d4af25f7d552778637f19b0636ed80f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.24-renovate-non-major-2fad1f64f0c3ac90a87850e9d5cf249d36300011.tgz","fileCount":17,"integrity":"sha512-19ZFbk1juHLwYmXGfd49Q6TR3mreSePw8G7u1or/+zfXMq8B6VuSFkO+o/E0LPqdjmzFC/H9d/ORBH6MT9v4jQ==","signatures":[{"sig":"MEYCIQD/uDcw7eZGFtAynnond8cTquUJrphRrXyAoj0BJSc02gIhAO/fSGB3blPry6Al6DeFs1LpvlmgQayJ1+byNyBQnMQy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":102896,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgC74vCRA9TVsSAnZWagAAdQgP/0dB3cwRVeAyX3mqUc9s\nsOPwzJofMsviE59A2kztvSPIpZOa/luNnUCf/6pW2Ej7PUSb3Yiogo9qovmM\nTVxQlYniyU5hZihXbg3jk+6vLNeux2dpPtFPnNHJuBdrwT+wq6S9v3fz/wYM\nucl75gpNurJD7ZEOUqaMI41XNmYSo/ovuycQ84jW6c8Pf1wA+btMhiISKQgC\njjSOZFKBC+w86esiS8levgHvPU1hAfNVEAX+jROLAmSR36vS0xrlCrESAQy6\nGIEbzvaDkqXpN1b1nHvMfCFPbVWY22b8NsVR6q/OEEU+87n9fbIXm3si02EV\n+q1nzVzxQE1E8kxCe2YJdFe4vHHHG8lqXEA57ql8+iFXBJ28aH8MGboiZB05\nDoi3BkCsoaCulEoir3ImiLPU9CA8h/q6HdI8N2VtnnDiVxJxfdZO8fscTrEy\n+AAVZdlVqgjkDl+4WUpdnRuq0IPTktwyAd+nClNnRHhTcD3hnaA2l84QljRQ\nHN2NGyqEFxLoXvVzNK9YvV1zn0h9rKXE2ZourVkxfrY54E9Bl9y+hsLsiP9d\nnLdOQYMQfI4EQ/Ww2b3WT2Gin2s7tFhNr7BuwAGK8c1swMqqeZbc8+EeSaBu\noE6C5MaXic+MQVwP2g4DjmpUGqi8VYS0q1JWYrk5rSX7fsfgxTQMu3xUcaOo\nZ7pP\r\n=LqJS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"2fad1f64f0c3ac90a87850e9d5cf249d36300011","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.210","@balena/jellyfish-environment":"^2.3.26","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.24-renovate-non-major-2fad1f64f0c3ac90a87850e9d5cf249d36300011_1611382318967_0.6875272325769597","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.24":{"name":"@balena/jellyfish-metrics","version":"0.1.24","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.24","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"36f2303b3a87a1806eb4280bd93a593a9899ed2d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.24.tgz","fileCount":17,"integrity":"sha512-2wcwnvQZ6d7VxKhZJ48pEWKtQ2YvmYbZAdz04jgmBOlSlddVBU/AwrYbwKXG9voJ1fbtSznada7iRguApe2XVA==","signatures":[{"sig":"MEQCIA9Ac88qY+K0ueC17UrvEg1wNk+4neZK16IliwrGYN91AiBi+bdC5QRD9VvBgkRm5N86BZNuHmzDt3/QXMzTrQ41aQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":102836,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgC771CRA9TVsSAnZWagAAQz8P/0eAJfb37TVvI91NmWaI\nFiGa4VlmxLaX1bHjHpWYvfl+QIelAsSm2BXsTI+n0+acj3m2Q0D4EwefGlqE\nIpeU01iUqxM9Alt1jw5G8PZCXEnVqWqPYP97AGya9U5BgQM8Xw8BLCH3+VBO\nwSMXyOov5lFvtUBKQys5qpohee8Xua6qO+p4uY045Kw2h/gq03ataX8XDVE+\nxL+tVqHVYMFaF3kGUMGkARtUqpxYvvv0rV81EWSziIVjv97Siv3LywVSuE06\n/uXQPZsPGyvA60a2Xdqq8fZ/ouwiL4Np6WAfa8GKVCPC06elQxLMRFnRSeK2\nloqP4H5R+tXUfOiu1tM5LqgFpB54yE0Rxe7ITCYUmX+vuYeQq4S0wnZkDrYi\nRDUeD6ZBHxIQL+61x4rYh3VWELeU0eRQatg0p1kDF/abCPvNzBYnC/hEEP3h\n+SszOf9sn12e8vP7LwwNrvGwdnXmpAkQQZpX+jA0z1BZM3GZFX7+z9cavZui\nzrUuHj+X1vN4A61d/DW9PHCl6YXNBBrYgKX4UF+njGHp0kAmHortIiiWH4WN\ne7b2tKk+55VLa5XNijfyEGvYpZOW+GGKOU0U4xuhWWExavZ9lVRBSRvtFYau\n19GFRPNAAq871XtbBIndJHGqonMvepyBt/okm+b/ceSJRgtFRgau9vSTZbUB\n1gI4\r\n=/NiU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"16335bd525f924d0d9b568def4167fbc109de749","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.210","@balena/jellyfish-environment":"^2.3.26","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.24_1611382517158_0.33548381868455524","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.25-renovate-non-major-152169b2a8b74f1f29bca2e300113207e5b8023b":{"name":"@balena/jellyfish-metrics","version":"0.1.25-renovate-non-major-152169b2a8b74f1f29bca2e300113207e5b8023b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.25-renovate-non-major-152169b2a8b74f1f29bca2e300113207e5b8023b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"249be8ffb7716a2bc9d58bae61115c1e5b62db65","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.25-renovate-non-major-152169b2a8b74f1f29bca2e300113207e5b8023b.tgz","fileCount":17,"integrity":"sha512-AhVbPgLcZGJ/5qEGzeySDJr+4+kXx3ecKo38BNPwDEHkdwIE/QlF0F4gRphpEzy47Wh4OdbM+yczF23R79KWVQ==","signatures":[{"sig":"MEUCIAIIa2dqXqPrndcKegt2p3qNzKuSa82LZwg3ulhYkS5lAiEA3qDqUWvVV/QBz7lMmV8n+xtEapNZdX9lnEJ+Dk/J2E8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":102965,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgC9V+CRA9TVsSAnZWagAAZvUP/19fXMgXjyhgNNyBCEwf\nms/WD4B2SUlxTNQyNEeajZfnNVWRZZr3GS6QG5Tr3uvFGn3WgGsyTuwEr6ny\nKVPA5PgrchKFHhMPIMxD5OJVJC1FV/E411BAXejW/TZaH+RDdPldvOb4T0uG\nZazmzay8X9bWVM/Uh6RoOmk0uGqvSP/oo0miuZJvt1d07Lu9rGfoSHguQG5O\nLbSjdQ5h8vbzMcZV9L9lNKgvKtow8nNwHA+ySNp7MLSbAuB9xY2cjxxo0DM3\nrKf938xFwv4SCgCxGSLCW1RCxJxfRbvluzWUCLitv7KIoBn9Px/Y5g7uHv4x\nhzM8NtiUajzn8WsmnWFOCOI6RVbqGEtaW7xf1o2WN2/42V//NKKGCKzqleOr\nUZeECP9NbZV8H4Sd0qzdXPLgwHRie5hPdeeUZZSl83YSPn91Ke2rxnPS2g7o\nX5kEGs+zlF4MC1iKXs+JWIQXgR0BxX589UEIJVJeuPqFDqmZzxuGsWtovK74\n9XtV7KKlTLDDYHgtzuA0ckBGKRyTmLk2ZqPcd4MEHzJP/IzhlQCrzu7+FIGW\n2MBSTcmClpznVC7NiAtnNUyB7bYe96HAmnC0L0OE+AYKOH70EyLoBjxcqRkI\nuYvbVooKVvxfk/Zl/FM76mwxJ8aZciE5HNFDUORk1ZH4skt/ub3DWL3niI6e\n+7mb\r\n=bJdM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"152169b2a8b74f1f29bca2e300113207e5b8023b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.210","@balena/jellyfish-environment":"^2.3.27","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.2.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.25-renovate-non-major-152169b2a8b74f1f29bca2e300113207e5b8023b_1611388286055_0.972072411864765","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.25":{"name":"@balena/jellyfish-metrics","version":"0.1.25","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.25","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"343368169a51f474c27158e73e103c12fbefc960","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.25.tgz","fileCount":17,"integrity":"sha512-/Om6RTRtXfNA99dNaF++AjxLVqxNoYfVP1EXx0PBpA6Y2fUK/OCcOfOLf09mfcuVbWsyz7WYcxX/4xa2GRbwKg==","signatures":[{"sig":"MEQCIGVnsuSgKZcOV7qRKRjXnUwEVIFzi/RjMgBNNXlwUS2XAiAK12lXijxkP3aWONmICFrUNfbxkP/HZ6WyPsjVTQML8A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":102905,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgC9Y4CRA9TVsSAnZWagAAmnkQAIukSikyjGJmEVP+w6bz\nhsYeymxJ+DBXyKnz6FL1TJhSLUeLLTlJH5wjEcTjcickoGgDMSZi8WfkaM8T\negBYDDBbv3FwHKXCQ7TE7bewwAymY6L3bYDPmHEP2ZQ8JSfR8mZ0xS9fnYDZ\naL9cGkEkJ3qREs/2ZoRSvWKrIEkdwRkQ8Rb6dQca4jiMbpD8Ys8CKWTly0Iz\nPU63Fod/5x+nDD6fhpzjwsMilZhnk2Aq/5EWKXRJzUsh2UFp3hBkIpniDN5A\ncY/cQPdUASOOxojX8fKDVIc5AyUdjY6NIuiBosUws09pTeAGRotou9cMvxa/\nstyq17TKvD2XuAqnfw9YU1Ti4C6CkppZvBUdqCK/eMozr8G7YJ+QCfdHAzRi\nvtEk1utgEQ69mtYajGbYpg+Go3R5WzoG9xcuhFNfQcySIY7OJ25ohhLs63Xn\n7biZtoKNJepXaLPNwpLIUyBEOZ7Ub61+QMTSMRQTk5B+UEQVavjPr6DxM708\npRuRLhlaxpCxDUbtyIONhrL8xUhMDMa0fEk6o9MsTAPb3ygNomWL1mIeFGal\nho4q7LiPAJffJsEC+7yn5A9hP6ofdrg7sK4LsQDxcRLjM/ZEcsYJTRGozUQv\nSGn60gfb929OfEfda3dD5HiVgNSTBKZCDxKkAucWOSY3oWTErY5PfJtumAl2\n0NFq\r\n=Kbmy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"d28ee5f91aaf64bf11370bddb5492b52fe8fc641","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.210","@balena/jellyfish-environment":"^2.3.27","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.2.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.25_1611388471553_0.9633613179671046","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.26-renovate-non-major-40e96c930e8fee31a2d4548c265ca36fae3adf3c":{"name":"@balena/jellyfish-metrics","version":"0.1.26-renovate-non-major-40e96c930e8fee31a2d4548c265ca36fae3adf3c","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.26-renovate-non-major-40e96c930e8fee31a2d4548c265ca36fae3adf3c","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"17a5bd85323b82281cce1dcb0f8307eb055aa604","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.26-renovate-non-major-40e96c930e8fee31a2d4548c265ca36fae3adf3c.tgz","fileCount":17,"integrity":"sha512-/Fv8Bisq53/63tehYbm+QQua9o91L2LP/NnzMEztK07Kw4akxgdyV2L3eoC12H7ys10hzC2BQctiGfCQl7hlRQ==","signatures":[{"sig":"MEQCIBSarrrJyK8yo6x0sKNJoO0tBrriWfpyKQQr/7M3r4lAAiAFSlF9fIVbSVcBzqTq0d0jl7NWQCL5BGgp/xphMA4+ng==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":103072,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgC95jCRA9TVsSAnZWagAAR4EQAKHTpzrp/bG49U36kPKB\navOJMTJSAmHeeQNkmDAXDiFHb5LSA5OL9farrFBAsgGeIl+esTLm3pSKPMH3\nW04oN06yMhXW/1zKIbTBXoRYu8BQFW4+5rkWZqhYJLm7XK4pqmu7wIFsKAqB\nIIEogZAyt+ty0b9KuPOlgwIm3JU3s3gpEk4By5fMkNWiWco8FQjoFuiX1dh6\nisVzofePsbcA5mIQyj04pjHZK9VjJ0x3+dn+ViJdNmVsnuOmMwichNTzhMFY\nBi5yOw3NJp+PCjcKlwYYeM8HWj3PJ6ajHEcMJbOU6A3PGJq/2bhzvJlcTBZa\n4bdO6qdWwYgTvw2BZA6CxJyntYJaro2uqchKiPo8q/bwmBhMh60HqwtGkv9m\nOKD4gPuMy/doNY1r64E85QHaegCD6J/cN2nTxYwtxZDTBtMbdIk9USBgkGk+\na61mFFAAezxOhK1KsMEpcXfnXKyEXZJn9aqbkedhdRNyPDz/hm9N9h92821R\nVVmUK5ayzmueWhoiaG2P0jccuXkeAA+uySspCI0a5Pg9rvbFHKCKoxlZPlrC\njC99U3T71wJcK5PX9anBYUYnits1lGN57CQlXuYim4RlEaKqvCFd5wxf21XU\nmWd4g+G8lXf9EJfm94ntj9mjFxkppHoq9Tcyr0epaY4xwp3026+ySQI72f1k\nXhz6\r\n=/pol\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"40e96c930e8fee31a2d4548c265ca36fae3adf3c","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.211","@balena/jellyfish-environment":"^2.3.27","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.2.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.26-renovate-non-major-40e96c930e8fee31a2d4548c265ca36fae3adf3c_1611390563276_0.0033966687615358815","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.26":{"name":"@balena/jellyfish-metrics","version":"0.1.26","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.26","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"865413109f5455ede5c4eeecf65f844d4a1fbdd6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.26.tgz","fileCount":17,"integrity":"sha512-bOrQzb414LRZYXmIKWpVZqD5XBAI0c9bC/enUtLaTZ3Z+JD6FgdNe8HU/+GoJFMdzSM1lzhsf9Gq48wipWKRSw==","signatures":[{"sig":"MEUCIQCtToBA1RvhcroIhHxjy/2yKtiaJI+DL4EJW76zP5+XhgIgZVvtLuKD31BgwDcAa7JpuS+BoRxQWIocy7MsEbrxs5k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":103012,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgC98gCRA9TVsSAnZWagAAlJYP/3aootSuUkN0imXOQbPy\nBOi761xXCsgNd+K3mEvmDm4PTNHHDikZMRI4V7yLY0dv2ejH9byz5sBTnIJz\nlwYR/FoeYY7pl82YYWc70XqkBvuC4DMc6jQrDq/H1TZVaTszChR5EGFzJUc4\nUdBOoNQH4sE9yUsfuwM9mgBNZm5wyM+33a5izllM5B4aVu6sJuGRSESwWrQF\nmD89Hx1w9whtd/GKe/xUSr85MdeTmA7JdXxJuf+O0Hw4huizoSDt+KXaoQIM\nqtvQdEVSrob1rGynXeNbV4QFv3gIhjrTo78nYjoQ3tB/lJv+id2rzRpe3UuZ\nQzqQ9BWGAdSMvW/P9fKNoum982HFPxRpybwyE9XG4GyyMrW/81y9qY1xZdx6\n09AFw3nkJmjFvKKWS2KI/vadSHHpZzVRNw66wpNGGMxyD7eA92d+ug+gWeR4\nmCToPC6tH6jztHqxAxnzaZBNCxIyTcm6PVg/W4qgd4qls8QLvWhchMd8pb76\n2tdvBmFvQGuam+z8LDdoR/Kw6BF5nevWZei5DFpZtKXCmg/VXeBhsaSl1iRr\ndFT8NeJGNvnc40J2Sg36H6q8FRi18xHV15JrO8/tn9nHNxElSwHcd0JpmgRA\nU7IOFqvnqA5VVeHc2OwhiBS3B6ruNGeoFUouj0slreBTbVj75LMK/fPLj46C\nS6lQ\r\n=uyYw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"d74f050af9b3a0f299f06ec83d4d5aafe803b0ce","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.211","@balena/jellyfish-environment":"^2.3.27","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.2.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.26_1611390751498_0.1896564105687788","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.27-renovate-non-major-2b5cbacdcdf81ae647d1b9f28557cc3293c72e65":{"name":"@balena/jellyfish-metrics","version":"0.1.27-renovate-non-major-2b5cbacdcdf81ae647d1b9f28557cc3293c72e65","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.27-renovate-non-major-2b5cbacdcdf81ae647d1b9f28557cc3293c72e65","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ea06676c0a371c6d878f747a77a9c3a1315adc0e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.27-renovate-non-major-2b5cbacdcdf81ae647d1b9f28557cc3293c72e65.tgz","fileCount":17,"integrity":"sha512-KKSt/YQiq2s2V2ZHOAtNlg5b2929UoyooyEHAABKML/ZM1TMoc/SshnBQb29wJ6OIRMxg2Czcrrmg81UzR5H7w==","signatures":[{"sig":"MEYCIQDIVh2RWQ5VDhg9DrD8DENfsfRio0b+loVcCPqYO+D21gIhAKsCqqe0VnNzzPnNdNwyibnzezFxxs3NL70uZ8orgEt1","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":103173,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgDEQHCRA9TVsSAnZWagAAp3MP/15W3b8jGnHViXZCYy54\n6i+AyQegYvQI7NTualWih9arO1BUa5Lsf2IC3K2a0oSsvaRjqbudc6x3Qnt9\npHgAkfALNqZERfq+RzJpC/vuXFxwDdiGdK9cV8nrv4VMuChEoI3tNxdGnftS\npOdGDJMt2kY3nDgWoORAp1q3C5ossUplkhFzz3wEQxfjPg1QsTAOep9r4/2A\n5M/1mQc8/m1um1sd1Iwk8/BV4YtdCAHn/zh/CYInGYCyEbLuhiYBNDCZQdCN\nLt0FPL04hUfGFeaateMRLO64VVvAm8NP2ea6YBT+vmA2dLscWEAyOeYP6k8o\nIDqECDvqh5HJcdUAx7nwxMM9oQDA2ut1Ns9YRagNiBiwFo7W3eP/TdQ1U7gG\nCXmvvGjDjKExbUhynhVRjbflMXnIlxtGoGIPg42SDQKvzYUjU0rf0RNwrQDR\nvGw0KGKJ6jzre/XV/1aAZDFnCOGe3ugWubXT1NYNLfXaWwDx6811rvj0PWcT\nYIAeqjQWCbP81biTWe811UDioNhoHZGqMoQGUlWZYr/eo7fTIXy8AhWxA9LL\nnWLAH+w6F2+W9LeFOLWgr17nnHkAbA93cMIED7y6HkMufc+TJVFlsOBi/aNN\n0rB1DdisajZ1IroTdLiv57hOMP9FzLaAoPjg51cBmR5b49qpHGYtaAj4u00V\nb8RA\r\n=cY5C\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"2b5cbacdcdf81ae647d1b9f28557cc3293c72e65","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.211","@balena/jellyfish-environment":"^2.3.27","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.2.2","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.27-renovate-non-major-2b5cbacdcdf81ae647d1b9f28557cc3293c72e65_1611416583245_0.14903339035021013","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.27":{"name":"@balena/jellyfish-metrics","version":"0.1.27","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.27","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b77898ebf424f6d3eb20ce0c9c72e85247a99f01","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.27.tgz","fileCount":17,"integrity":"sha512-bJ5sE3Xy6PeZkH1aHtA+fUkgebzZf/QZMF2IsPiKIOv1Gi52z+2t7wDf+21jHeX0vu3FA4pC3YS0DHgNSZAzkg==","signatures":[{"sig":"MEYCIQDgGfqdgKbzhT0F4jt91wv163rGUMGIpcPnB5ThONPbgAIhALm/iaqPRw29xXJsgMKxX+/zb7SbR2U5QMlGKI9MmznP","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":103113,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgDETLCRA9TVsSAnZWagAAYXwQAJJl78qEmzppi/6da3U2\nXN5zO0oc+8jMRDL/5CDZAIpCe7/+SXvU7gtyEC0MrN00UNYYddb7pDzOkRKa\nhfqA/ZtjFMidkInFJVDVaxBQ/fB4gGEabwzvx7LR9Gq8IYvSG3z+s5+NtwqY\n+aE6AmYBLLsTt/PlZ9tqYoLr5FXLhI6dX4b/SdRVETZChJhomUQWr5vm9FZq\nlWRQ2Eqae9J1nS74qyU9h0/UHyJ2SewUur3f6dKUuRvDVTkLiMJveXegEZVA\nYtH/7UC7l2c5VzdjQ9O6hgXa9UwE05qoJgiyiBocq+qzs+6MvUL+709CXAAK\n4z/M/r9lFI+otVLn4yZq/xKc7tk5LJYRa6zmDNNMudGV4Io5xvUJmohHSmSB\noNCmuds0f83pwuUgrQ1hVyWfPRlpBI6CfpS4RRcB9R37rd7k0lLQNLzb1JX3\nzSBi83kF9ZotejKhD10MsaHOo6mDJzw7ztBGe3WrrMgphtW8xczBCmpfpa6h\no4AQr3btkyl4fz9ghcDZXBMD8fsg7UKhy+YD4kyCnCDQjqqgNoV4rrrMPZS2\n+EDqBghcFCuwhLbTkkTORVzDmz7U+altwEOo+wtZxtHpdCt4jgWwBm98cBUb\nJJfmVHxslxByCeepJNfhXjDHfrp9lPe1Til9tfIy4E1Dfnz8hBnM8rOgEIVS\nyRTd\r\n=cm5y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"ab84ea75783270ff88e7a865c3775235c0c2451e","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.211","@balena/jellyfish-environment":"^2.3.27","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.2.2","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.27_1611416778607_0.6396694192330021","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.28-renovate-non-major-59a6641c8bbc2ed9cc31ce6e2cfe49c2a8fdadde":{"name":"@balena/jellyfish-metrics","version":"0.1.28-renovate-non-major-59a6641c8bbc2ed9cc31ce6e2cfe49c2a8fdadde","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.28-renovate-non-major-59a6641c8bbc2ed9cc31ce6e2cfe49c2a8fdadde","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"79c458d2323d67c528bfd0a818047f308fb7a15b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.28-renovate-non-major-59a6641c8bbc2ed9cc31ce6e2cfe49c2a8fdadde.tgz","fileCount":17,"integrity":"sha512-C9y1mYTNCImi2KCk+XvvQUk/jJLToIe1u/tAEL3R3Vj2j22z8i49yYEPwDiLIKr+ybL/tFYAhdtWpW3Ql3nKkg==","signatures":[{"sig":"MEYCIQDPxBb7kNlWTqEow12kbylaPVrs03I/PGEQZyBjqD1B2QIhAJ+tOhTP184oZgZXLv2oJNccixRhq3V592MJvGM8oSbc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":103284,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgDFayCRA9TVsSAnZWagAAv2cQAIiiz//kaT4Ya27bX5Of\nsyGVgO/GGxwA7c5IIeUEMKDBH7KPrChUxTXmm7iKJkuol+ORqZdNjlrntzAZ\nbgEoiMLW/EQurzR4miHroxzad8d/x1BqQN+CiP/h9YrnOzCHtUhP+AD0r5I1\nRqZmhl6nph3Y5p0o7iBp0xUtCPNirI0ePc2mjlXNtWhMcW37nDADszy9QypD\nrciCnjsTma2vN5RpgafAGcmpx0YHpx6qWgDSPfmr8iZj0lyz8tvuJhQzp7Gj\nJneQ9HIJjh69yPaYa+Vr19yMdV99AsHACUL/ABqb98s62kDuVZLy7q7pxAc/\njpAnMLvBMvFdxiocS44vuQKPjm4F2l2B0LIN1NnADaxBAsPLRuR2AT+yMgGm\njSGORFyb5pIi/o/02eJrEBRDHbKuVbs5PWPs0SB7wlznSbZAd6SHogrs3QHm\n/qx8pCEKVZiN+dSgoQKszMdlAr2hxu7amReZYrT1B0T5w/xNn8C4eUKS3gdB\noV7rUNgqispeL932UJZR8upmCH/U2ttY1rNN0Dl5q2nvEOQ2K5tCmaX/9PkQ\nDaVdVq6ZV4+aDRMdD9CjCtiGRmMoP9UYIS32G2UJPXj2o4wTfNNrAvjHtrX/\n8IRjTZwAx6PatK/oceAy42iwfmSb0y0yh80ataO6oD8TO7LSRiizWBQrFB85\nFHQV\r\n=vReC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"59a6641c8bbc2ed9cc31ce6e2cfe49c2a8fdadde","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.211","@balena/jellyfish-environment":"^2.3.28","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.2.2","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.28-renovate-non-major-59a6641c8bbc2ed9cc31ce6e2cfe49c2a8fdadde_1611421362061_0.40906648256938416","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.28-renovate-non-major-a67ff549663d84665edf3ca5d6f54bd1d916aec1":{"name":"@balena/jellyfish-metrics","version":"0.1.28-renovate-non-major-a67ff549663d84665edf3ca5d6f54bd1d916aec1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.28-renovate-non-major-a67ff549663d84665edf3ca5d6f54bd1d916aec1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"60bcba5cf781ada483223d1bf25b87c1d05af960","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.28-renovate-non-major-a67ff549663d84665edf3ca5d6f54bd1d916aec1.tgz","fileCount":17,"integrity":"sha512-3t43HC7H/Aj/lSPjf1YYZHRIrqFNm3uuxdfokSB1MHAbudkuMlCw3KcNBBJjWbWfzJYcRvCD2qn0ev2n7hv7KA==","signatures":[{"sig":"MEQCIGadKHNDJNTuBKp/uVIMIQ2cSxPXUM0n2mtIqmD2X3zHAiB4S4A1c5hXZr2TAWXyDQHbS8h5NB6pF9K6oU9PcAimcA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":103242,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgDFetCRA9TVsSAnZWagAAf4AP/3ZdEITWecDBsKDEnFsM\nQGtSOPOqCctB1NvalNsSyZfisLOZqVt5DNc9fWGDxBeLAAUFgUGvPUOL7aSC\nhkEzf1xEFuaL0FA+RPjh63t/OmMCo8yI2T1+kSZ57TKcCR8VIsv3OpT160lY\nqAQ3CeEFw5nQnP+28YlpUa61pSE99meCe/1pOwQLRecmNgxA8JEvLc1cf5PS\n+wuBVv/OHnir6DKIBeHFwquGmi0AKUVFRoTjO5CMknK1wt//W5X3T7/cKYJs\n0P0IjoJiYT8vxZfpq0iPlRJbTjhhwCQ/wd1k2xSRVWXtwP+JGuPZgLAtL8Zj\nX1UlyvwNMMO3LT8Wo2TvtVYcsHWbApvl4Y9g3w16HrAlHXyiz2cGKfjYFXlC\nAc156Zy3vvwo/GDOj6fw3d3v10jRjs+f7yc/5FWNrUs/GixEt8NAIDJYd0Cy\niE++6ISjPlVenYdnYSI3UlSUwokPvTSavLjxzic6OSUpYmOUk5ZbNWXAuahx\n9xsOnjyx4x9SiFAcvPNbIMhU2Rx+E8XjvCvvOPcAAVNqEJGAUufhZ2KW9hvP\naw6mtgjC4gt04OIentKeoo4aiIlBaSxYyQW2amTeSZGu94wQJt/fYA2Q8J3m\nNZMrT8Eg0F9Mv8ZKMvEKQN9/8Ok5iNll3Vwa43rYSR4fyF17pwPNddcfe02a\nvZmN\r\n=ouRt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"a67ff549663d84665edf3ca5d6f54bd1d916aec1","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.212","@balena/jellyfish-environment":"^2.3.28","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.2.2","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.28-renovate-non-major-a67ff549663d84665edf3ca5d6f54bd1d916aec1_1611421613445_0.192923795377673","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.28":{"name":"@balena/jellyfish-metrics","version":"0.1.28","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.28","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5a86b1c5d2ec25f035c8cefcaa9343e1ba042423","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.28.tgz","fileCount":17,"integrity":"sha512-uW5jYQ3R0GoAF9M9Qgc5vDTAGZZR8SHD48EujD+FcStA8us0g7QJsRfEwNkb4MZA9MANsyQkW0WUqTTtEI2+Gw==","signatures":[{"sig":"MEUCIQD73gXGYTY7yo66K6lTAE1JjIJnYFcCDmQPndk5aDcO2AIgbHaJf2ZIVm9i4vQMwFPopRuYZ8Uu3qh1TTuRdAM2edE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":103182,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgDFhJCRA9TVsSAnZWagAAkz8P/0KVq78+aXxs0ije8LJV\nKZbaCh4eI1Ti1F57OnLytUambWaK2Nl7q4nGqtK+aruCkwTOTn9zMiFdG5+c\nJiWgppvSOGGt3sNVLaKRKk5VVjzeAUByg2as5PToMCDzNKgS7cKQrmNwOsIM\nj6rFlEjaGGE2bUMlHC2xSg2MafcWUidlGlwicOmLJjXFpN9GsFq5dG4kQozx\nXHaS8SoTVK7gRw28t9+LppA2dP0oeUQufg/iyZeqNg4+KUGY4GoIekpFxnTI\nl7He5DCqRmhb+9oRs8zPJeUixGCgp3jFYHRvfMmpLa9+21QCIqvPa1ORSIGi\nai40otRp/5ueJ0bTMOfae3tBlY40FcTve3K3pn4ZArNCsDVd1uz2Y9+wB93J\nGEkRTu7dbhjhnHfNOUT8VdsOPJjIfkE5urapc/vVI8WbpSNiytO2TlxqBCyk\nJEGpHT02vVhHFsKPun7OkcWQLTbVB2J/DezE9lYGRxV4vbMyE+1Bm/6BCulQ\nPo2fZFkHb/BdNs8ZWrRSF/88J99G+/QOwi170BGl7LPEMSsI3YSsohvFtIRs\nrIlUF0VcMCDUqoaslzM2O9L0GbL19yayyFBBwSgoWe0/fAb1d2silwQM7aH2\n+C0y6St1c5t9c2y0s0JVCGmek5jr38eer4zsMFgDyTQemC972yqcZk05WXe4\n8zNp\r\n=qyGO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"80fbe7db487a39319d5bc7fb1d3a1dc2bd50c8d2","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.212","@balena/jellyfish-environment":"^2.3.28","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.2.2","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.28_1611421769026_0.8384696789243018","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.29-renovate-non-major-a4a3dc34f54a566777af0c6d3113a75769de6f41":{"name":"@balena/jellyfish-metrics","version":"0.1.29-renovate-non-major-a4a3dc34f54a566777af0c6d3113a75769de6f41","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.29-renovate-non-major-a4a3dc34f54a566777af0c6d3113a75769de6f41","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"47a22d7025f7d0a3b6f9b9185d720effa1fd3998","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.29-renovate-non-major-a4a3dc34f54a566777af0c6d3113a75769de6f41.tgz","fileCount":17,"integrity":"sha512-cf0ud5sYtoBcct2U6IXMHcpr7tjcHvfxlDVlhODLU85fPSwNvhDXlnEga9+eI27VPHSMpiEGaD59MDuXMEX5Bg==","signatures":[{"sig":"MEYCIQD+wzi3jovqjSRTf8tdTj7U8ZR02m0EIFuwzGWM1fHicwIhAKl/XGAQAmE4HNHdj0KfKRYedlzZcHax6S46hM+7kdrq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":103343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgDXmcCRA9TVsSAnZWagAAIMIP/11FxnliDU266qpPCFO7\nWnxyBdELgwCYoca5TQ5S8wPiP2wabaLuL0dKoVe1h0GgBI9f6Iuxu1c0nIGL\n7p8jj6PvQJjBZxrFFW1P1ObpwmNdTI/xmp6A9kMScetFwyC9fCEBHqXky0eM\nngJNVJ9FQm8Ub8R45aPsSDrXuHM9pabThb7S+CF6rwLsxW0mEqxX1ZsyJlZR\nYEToST95M9f0UXMAeijeTcbiysHkbPBysj5i8KR2d91t7Bl7MEwZqU++YaUK\nh3CyYZl1ZLXOof+R0R/AhCuOBlzREKQlEjdWL7hom1u1VLwvWYbalrgzRcmf\ns2GVJeI+mc79hgytd0gVspW1LjcdxzZcTqD4k8ncA+l4ahaurLLZsjUWxfxS\nBADIG5K8aBhKZafFuF7XF9tGniGYYcBWKarK7XDgsRlCnsSIT7+XipyeznZm\nKeSS4RLpz0CaYK9XVvKKp0/hoshcu49WswRoVEyPWt4eYTRDloM/9jr1RTD1\n6hGhl9KI8b5EqAIE9IU9NK20uARE7Fv0NDCSuNk+m74ThTszVMJ3hGciEVIU\nY3uf3j3mtAtsL8EL6OWbgV73QtG6wR9JmZmtvVjUwVMBLNj9MpgVWhFUu7LL\nQsUrAuog2/UQH2zR81KB/MlSKZEVefJJvGuSOGn8IT6B3tTt9RWjnNQcjii8\nk0v5\r\n=vCzA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"a4a3dc34f54a566777af0c6d3113a75769de6f41","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.212","@balena/jellyfish-environment":"^2.3.28","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.2.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.29-renovate-non-major-a4a3dc34f54a566777af0c6d3113a75769de6f41_1611495836471_0.9312317161857366","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.29":{"name":"@balena/jellyfish-metrics","version":"0.1.29","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.29","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"57774be7deac14a0273c6689c8ca4fb3b683678b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.29.tgz","fileCount":17,"integrity":"sha512-5Ra/1wJ3jn43hiu0P1geQuTTM2oc0aCJ3G9MphET8nr02U/Mvq4Y9tyNQ9bO4Jvy4urJZVYjznJEIt+JYBBuUA==","signatures":[{"sig":"MEUCIQCFqtYcpX5W/gpP+8jeK1+xitiL7mLRXqT/kCjww/zDbwIgUbfVzQRaMQoqy/cyLxc3YuNOO12HhvBQVa91AWNfg7U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":103283,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgDXpGCRA9TVsSAnZWagAAp/UQAIGX2PuqJw4oThsyiUNP\nXHsr80aUC+Bnf/hQ+mFlmG00XbQSPuyDTIP1ia9nG/X2sSObZlmltql6gUc4\nSgGPvUd/AhmrqbZCsBkfurDrE/0OJGVcMjBreWmERm3Q/WzC6PD4W9+PBTDa\ndNh7PS86UJWzBUO9y1fBPAwpF+eNKTTXuZ83F/XbOV+2I9CPDMx2fZM6c6C8\neYXbU/EhsfrpItFT6qvoPaSoWbU5wsn53+9uwYHl7/K8prwwhxAo+QgbZiOs\noozY3+ydAydc3OfL2EktV4q09UlbqZQIrr0Jolu4pW9sTrmnSXp+iblyq1Mx\nyLdEly0kVsbvCc+jG+OK02NoFiY2SSg6ree/aCQ4xsazVUkmlIHged/44eYK\nz6nYO8RSv1F1HUFzd6oA/cf1rpx38XNGJ5KZ/J9F0ka5x99DGHfAzxbRUeti\n/fsd3/5e3vNUvhDs8AY6rmzWgiGlw9vlnp92YYgrhciBjNSuHPPCLLOaMSSj\nxyVCUR6sGHEPcTv2qPaSrsGJ3MW/5FEgOyY3KWBW+NULYzDpTkfhfX2AwPhb\nUMYuB+7Vvx3ssMx0HelGwOKpuI9eH0Tt09VLUbnsS6SHYpnrEy7YzowlNdL6\n2BNJLQEo6sTcM9Lx6kM1qlWxTiUa6cjaZrStxQ94kuP2KLmwv79eBxnqaBFd\nuQJn\r\n=9BM4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"f1ed85b15032bc5b5aac39348af5ff9f9d7a4cad","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.212","@balena/jellyfish-environment":"^2.3.28","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.2.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.29_1611496005881_0.4587298995668587","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.30-renovate-non-major-bc44191db914b22f3f312a3116ea965c883f5b53":{"name":"@balena/jellyfish-metrics","version":"0.1.30-renovate-non-major-bc44191db914b22f3f312a3116ea965c883f5b53","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.30-renovate-non-major-bc44191db914b22f3f312a3116ea965c883f5b53","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"54377a44a9b658cf98492317dda2fde53c6a458d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.30-renovate-non-major-bc44191db914b22f3f312a3116ea965c883f5b53.tgz","fileCount":17,"integrity":"sha512-Tqv5BnRyRxnLJyYEhFnY8BwL/2sF9RoB7/g157BiaCUneAfQN7EWcI0hj9S8IX8EnPklTHoZebFZq3IShsvyGQ==","signatures":[{"sig":"MEUCIQDFk33RMp7gr2jmax8+oIQI+olz2x1zqLuZQrCqgRonQAIgQlTc0dB52vcpjvDA1Jfc+F2wgoRbSixzw4yxWuGvdS0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":103412,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgDYh0CRA9TVsSAnZWagAAIrsP/iSQBGq1bGS3BdPF52vU\nWiivo+NdUe5OfAFUoR2XDj5SeNjFXfWHlO9FAzPAPbaGklbD6NZStDg6IwSB\nUs60F3B7D52Tz+NljATmDQoVz6Z6VFDeehjWCjRSXqfoVWQelH+zW2F68uO1\nnhDto7pskm/Vzuolg7iaxDhPrbzCCrVecBfu1Sjf2h2KWpc5jyROOCYokJPN\nZaFQ4vJ7BWcJ2AG/Ay6paEO//W8Mg56SdoZAZ9Z1LLE15UE8JCruJKu6FPCT\nF8q6AIkEwUGg5WaJxUPtSMrSDTNsCn7sy3KDQwiJYv/fBtHZ7WP+TZlyVtio\nF8CQt03lHbMXvKuQ1dQODi4fSBunaDLhH3XzvqkMOCbQr6w0wiIqbpsteUFe\nHnLPhxdzw33wRZSENEKEIeyMS+G7vS3jbPhsMc+yR5sj3pkZG73GcLaxYiNQ\nwF6doPp+6YO07mfZ48LOslgtP/9QNetdmzcrvPLOP6DVv67z7GxkmKkiUxjW\nMBuW8gSjxCvp1CUP2OJy4NTMKYncImviwZ5cTzGqepIywKxbFATqd+DMJoWz\nWakdLFEn4e91OJirNCWLA0UEeHXRJ2LtwHlshwgFPvppWD5Dw/+rL/5kxDet\nQL8f5WoE4Ob6dQTL0VCrKRwkLN1yvU25msRtO66CESyanf6vEHCKn9ysILk3\nQjUW\r\n=aiQ4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"bc44191db914b22f3f312a3116ea965c883f5b53","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.212","@balena/jellyfish-environment":"^2.3.29","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.3.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.30-renovate-non-major-bc44191db914b22f3f312a3116ea965c883f5b53_1611499635507_0.15316071541153087","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.30-renovate-non-major-2febadd177fe71aec71830f5e35ed2fe4173cadf":{"name":"@balena/jellyfish-metrics","version":"0.1.30-renovate-non-major-2febadd177fe71aec71830f5e35ed2fe4173cadf","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.30-renovate-non-major-2febadd177fe71aec71830f5e35ed2fe4173cadf","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c30cb014c7c254ca0ef6cf40f5dca797e72315ee","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.30-renovate-non-major-2febadd177fe71aec71830f5e35ed2fe4173cadf.tgz","fileCount":17,"integrity":"sha512-awJpgjR7+vO8eUv5WWTwUJVr+DXsrNg52OCvmCGxkODEsKt9hjAfw/TCm/qc7gGKC7QTBRKTWzNr/zXRFO35Yg==","signatures":[{"sig":"MEUCIDvVuElm1d7cmvbidM0YDYDELxVKaBAo4I1ahP7CVVWqAiEA+eCZwnl3dnJwG10EdCPyeuJNq5+3FfLTPHXXgDw2ibE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":103412,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgDYlfCRA9TVsSAnZWagAAHrsP/jhHga9SkSK5+luJhVqc\nTHbBul75AOqZot2QJoI4dGLCeu/vWoc7A+b5igszopDJvtApPppGyuHBN6x+\n79+ArK3sY6FozFzSSkzP8HpxP/dnVbT2RAWQv/0ql66urfvbrMMTb2p85TrX\nGOM48CScOa7inNiyrVnQ1GIQnib80icSzzhek/ZuQ92F4yW/1r96uY3XoKwC\n1IJh6RcjIzu+EiNdCsaZijc6KPUtac03fSCf98yg7MVYYfEwlllPMX3Wtcim\nk/nbV3dZoPC/wXf7fMHaA7jhiFVC/ATIJm7NG7GeTq60Y+GKSR32vzdqqCLj\n3By8svtfboNR6FlCtpeEeONOE32TLwx1gehjtJe/mydHTevZG1XIE5jYtbkX\n0dl/ZNqp9ik6A7fh7I9dbKL2xbUL2tM+VTRIQClFsIhxRhW1nP2bUMcjuz7b\nCn3/0zqKudz5fPtX93k0Bl3s6zXGb3cnllt0I9kFkvkwGCX3PFFDFznK+b67\n+Jt7ZGxs2pTrSE8mdYeXbCnR6rv36PPmZLWrfVtvdnqTt+C3SqWA0DJyibXM\nOtiCHPbqq1KzWtIbwObPmDu53UMcvSqEYkcw2xsJfFZIg5pICvNl7Cs7y8Ai\nL/hdnRzMvk9PKvtI6COdrDPpmkHbtyaIOMkouyQfSHiAgqgAbTC+CoUKqeoE\nfnje\r\n=VK73\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"2febadd177fe71aec71830f5e35ed2fe4173cadf","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.213","@balena/jellyfish-environment":"^2.3.30","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.3.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.30-renovate-non-major-2febadd177fe71aec71830f5e35ed2fe4173cadf_1611499871138_0.46696544743273183","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.30":{"name":"@balena/jellyfish-metrics","version":"0.1.30","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.30","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9f22eb772ee4cd53cbc10e120bec75660bd22409","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.30.tgz","fileCount":17,"integrity":"sha512-4Bs/m6lVQM4s8WEwN56DwO8KJqr2fLgBXKo6Pqg0NjBvgpSYInlBKika09thNqO8P4+XVySFVgEG9n1X0hVA5A==","signatures":[{"sig":"MEUCIQDWT6sZDrS9qpCBdfDYGy0qDWTupGu2IWcJq8+Yu/gNvQIgNkii8hZe7KRp3DoguHyxKzOaGWoXw3FK3LGF8yBhxs0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":103352,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgDYo2CRA9TVsSAnZWagAATz4P/ifMKtXHb7wubwqqCGn9\nDDzLIea5jUNh/GJsfZM93K6dIqUEDO2Wy/gYDLQlLLI6kH5kFkxumL+OP86q\nMb9lER4Pa8xGHZKs2Oxq7lM6o05Bj8Fg50DeP2VMu6YUrxGkk9xK9nByXxgd\nyEsIG6wZ79U5WQ4ZjYgBh1lyBRCwqBpFdYYSK8PYDJeexA32usPy6eTNN0Jf\nDwW9dpjmdyJ7mugi9ANtIPcUdkMMdwgkB2udXF73kViWa/G9bSLLrUMmjlSw\nDw80KA6kGFowFnlnapUEORZJU+m2LjVNgbMcR3sY89+/CV1xPXmHyMRn9K3b\ntiGInf6bEpWY4SLQmpIiuSzxvqTrGrvXSWQQo296I/z1SzDsYN3ECvtrmhIW\nFDignoAMhumRDKrX7Ne0EMjv+OtWYd5BYzzl75Txpk441V6rNjQ0Fv+pWekg\nrUk/CUVUiz//E1RgaB2VHMlts4mk2XLCbwEEO75rQW0OszmESk71bUQdHz6x\n1vHcdl0P8dHjLSyp4ONBfiWVB2F0IUtexjNbHBVYAtc4K5H5pdDHX6uw9BQ0\n2Y/rRJ1/3SMsSPMhg+J9kNcYrrF4NO57Jd/7pL/YFJLO71m7zWlBs1zRdONS\nkeLkUEpItobomDlmOLFGwyTAGCDEm6IswVJuE/HegYEkHeV8qLWNgu5FrV5h\nvS0r\r\n=851F\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"e04d34a6fcccc74e0707a62ff7b90fa270625334","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.213","@balena/jellyfish-environment":"^2.3.30","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.3.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.30_1611500085976_0.031712631694083226","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.31-renovate-non-major-b6f86cae286a182f3b606b2b020e6b4f73f439ff":{"name":"@balena/jellyfish-metrics","version":"0.1.31-renovate-non-major-b6f86cae286a182f3b606b2b020e6b4f73f439ff","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.31-renovate-non-major-b6f86cae286a182f3b606b2b020e6b4f73f439ff","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"83dd5290a10c302458f16dc02ea19028f20e49f9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.31-renovate-non-major-b6f86cae286a182f3b606b2b020e6b4f73f439ff.tgz","fileCount":17,"integrity":"sha512-ut8PqJ4OFIAe3Nix20liQTLPwQSdzLleLXCq2oRBllji71gGk+kE6RKjXVw6XiiGkVoH68ddj2olgT3BhJZqIw==","signatures":[{"sig":"MEUCIGY5HYyqzDBue4PTtgieVMqGyJy+xfvKViitbFytPDeGAiEAsmVCQulnMdnz1phspeOTxg0nmCefyIsaRu/B8CAtKb4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":103513,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgDZIaCRA9TVsSAnZWagAAVksP/1Pu0oX59n0khuhnYDO2\nyfKDkgo+vgcUHUHtbL1fwAcex3FXDOJkELDw3FX7aPjtkUI82sFREE4J5BmY\nIJSUZ/FUuRIlkBWyfvTsCoQBzYmdNvjoVwdeJZ8bkpEPC4Cw2wFkjfrW7BC8\nSBbjy4mGL31sGWGMszazcjbp36+51c9k5GajsVoqd9fW7cCbJleUw0EQviph\n2TA9G+O0DmIuZm1pVgYzFND9v1kBIomxR17IIzFXytqzKI0iXVBkI9zizbU9\nfhH3SJnbfTk3yKTzaHbtSw7lgDuMk+PNdriaN8HFaQ8v4zKBly0w6r8TlrlM\n+nS7Onw4+Qp/JrucFe3JiljVo30Jdn+AbVxoGzcR8LxSdoyPa0hedkoX8QHQ\n6PMdZxxMmpHDaT60CACAp2Bhcf3mKPFlJS8ZwepIYtAU1SSfKmvpZ+bearaS\nuXx3XPp7ggMMUIPtyCHojpLcHzGv0DLz3jtPn5XrsTmJeWLCA6+lbUl79FrN\n7de/hXRVUi9IUhmVq9ZkhcXWEYneNvTdo1Lpfz+yGrQSpt4HCIGWbTpq0O4r\nEXUAItIw4nbL56gXmAlhLyuopzCAiDJ/irW7RcNygh1hjzWfv52rPqynPUlP\nzyZoCTxI4YXI16EEBwVeC4TlwFltALEfglot/5KUvBu+VNdxc+oGkQnQ+xaf\nc2LG\r\n=AOF2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"b6f86cae286a182f3b606b2b020e6b4f73f439ff","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.213","@balena/jellyfish-environment":"^2.3.30","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.3.2","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.31-renovate-non-major-b6f86cae286a182f3b606b2b020e6b4f73f439ff_1611502106171_0.07632151728327163","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.31":{"name":"@balena/jellyfish-metrics","version":"0.1.31","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.31","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3aa538d6f046f9f5b0495e08f0cb07ab1080492c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.31.tgz","fileCount":17,"integrity":"sha512-3b2Uucm4CL0gK2mU79kYIbUlSE15C/mpYCpdWVI0Zsvby25Uy/hkccQMjz2Ch/inez/tiOazhgqVzguwvR+Uug==","signatures":[{"sig":"MEQCIFwO1F6jPBFelHPqXZDl5zTMnCX9PDPW1re7PG4l58q2AiAjltYLCV/xta6uH9JCkVjFiepJaSjBveDuSSssFkYHiA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":103453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgDZLiCRA9TVsSAnZWagAA3jkP/jqeGobXjIqtafqA3IP7\nBc5C72dM3aIaKv5SWod6NKU89icJj8AQl/M07RH5c/1uZUzquhCRKQkusEzs\n0J4M5LiCTqVWD+MzroF+ANO4wTkt6T1ZzAeO2LBy8eVO+xAzxthKzq75KkRC\n0Mi9Trn/NwECG3iAIKCGvuUOPkiKtZqsP1H1nWxoE9w7Qfh/nj7P3D+Ko42p\nBLBEGT15Ff9uo9WKOm4oYYT7Em/l0iTI1tzpI1/epKyfG/GtcyNwpIt9zRJT\nX4JOtF4Z7CEuDr6F3sT0VP75+MsUpctwjVuFpdpWUiE/cllJ9TRfiZi7ACYx\nfkRKVEKCUkBigOALFuVmiocgaTqC9BBGww7+47qZMKg9l2q9x+VeM+oy2fAd\nmPFYjTmsGsvlBDvxGjvijPn6ZxiGK3TyA37KlVgT8ymNz7ixxAjkerEOygzu\n6obQxpbj4D3FFL8SaU5eZJU/kiaw80drTnfdZqSzJ5lIqdjb3vp0b3RK9nb4\n7FstULXrLs572bJiGvoYsFVawGTst+3wVk2ku+6JAAYOTpItxaJqNOys/3kR\nWnnBE4mysoJGEUiJuFOsjBhymZyTxy1ogz1MeSVQwLr9MyT6z0akYJKcBRkR\nDNmbhcIvmHak5jWxX9OzRLl+IgNhc2jNuO5pYPHf9o0DzF+vfk6lJgmobDJu\nnvYP\r\n=MXBu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"3f5354641e654d2050621cb12fdb258d7f20e4de","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.213","@balena/jellyfish-environment":"^2.3.30","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.3.2","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.31_1611502306311_0.4957472917529977","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.32-renovate-non-major-813c8f38744e25f242b89ea2292db59829d32903":{"name":"@balena/jellyfish-metrics","version":"0.1.32-renovate-non-major-813c8f38744e25f242b89ea2292db59829d32903","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.32-renovate-non-major-813c8f38744e25f242b89ea2292db59829d32903","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b535a46dc940f92e185255ebac3fb414705db12a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.32-renovate-non-major-813c8f38744e25f242b89ea2292db59829d32903.tgz","fileCount":17,"integrity":"sha512-+HC0tKRaxRQ7XTEDFOkwlJAeNI5/mKDySbsShSATCfSPR9+z+QX/w554NwviqxplweG+hTlpNIDq4l6t7Sq93Q==","signatures":[{"sig":"MEUCIBoJSV96IIWT9IryWj9/Lq1X/40v9es6K+JJDEhPEA/PAiEA99KaEYN1CP6AB76wZFRp1OAzfy5Cxm3xGbplEMI9upc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":103582,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgDaLuCRA9TVsSAnZWagAAPDoQAKHrbnVpxNiI1jFnuuZi\nJhhufXMKwMvcRF9Ofi4LQKa74fKtLJ11I/a2g4Lplwe8VIJRhVz00xez/+7u\n35FwrKTYNZFvLf7BHL4L4UnvhZbvT6A75FFLJ3Eyp0H9mKwgGb1g9SiBFxfP\n16lcfYNlE1H1dtMSkgVjr3JiqVkxjWQSyNkAnh+4mOckOcCDdgWPAU5dl2wq\nPQJ8MaUj04yaAuyJP3K1ErOMgJdACSh9SQE86TuzE2aNXVQmyzlPYPoraMVe\nnbsDeuvi3nJanOVeSzvwYHH8U6Fy0+eaqREFAS+nHdU2aRcJk/oy9Sof29fe\nG1wWnyNQtOnMjfuP8ko1ZZoZbwOWVg0bP7Tu/FKrNR+gan8V4Mbbb3G05Ts6\no3jnab612YIhYsKYHXMlNUF/D+VzHAOGOFWbzBx3yky4vxG+un+X3S7kg3Hl\nHW26LvLZ+KRo3qiIRBF6ilB8/PaXl0eiML7ukfwZ58Pr4B77MfOKC9irn2Md\nkkX5BPLiVg8FP8gzpUoz5QeMjmAusxTD7KBGGm1mBzYT1IKuDzinU1K8BulL\neNXlXzqKNMhdxEHzImtYLVEkTcaeIJrR4qlLoaooa+sYR3yP4cEGV4GcMpAz\nWCYdLkQdZT8La5vdMWX5hoNESwtvLtYixR2l+T+KmSDYXCFCYWcK7EuBfCbD\nPuJt\r\n=l37Q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"813c8f38744e25f242b89ea2292db59829d32903","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.214","@balena/jellyfish-environment":"^2.3.31","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.3.2","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.32-renovate-non-major-813c8f38744e25f242b89ea2292db59829d32903_1611506414414_0.7469226076570532","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.32":{"name":"@balena/jellyfish-metrics","version":"0.1.32","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.32","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"91d6c640cc6a194002d969f0abdf8f056710ef95","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.32.tgz","fileCount":17,"integrity":"sha512-P4+Bs8HDbGdZYAKLM67inNL6UOWVnR5P0jcIOiaFMKZXUzarrdu8fJgi/GIPl6LTyh/rOS2WjhtbVfWxjgPOzw==","signatures":[{"sig":"MEYCIQDCtHQeky3KB+6X+/c14nCSY1VVtd968AUwBfr9XZkFHwIhAOBKydZQLZAYdFqN3ZKhT9umeT4r3E1hJZbOKxVkjQWb","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":103522,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgDaOiCRA9TVsSAnZWagAA+ksP/3zIFebwsxCWqtwsnqsD\nZPi8fct7g/lLBd5k0Jj3MMfdEYJX5snQpjz+/re7GFbPmTOwilb2XXZWcILD\nCBDlI5Oj00/bVq3DP2JeMC5U5oWTxBHfSNeYuxUP+eMjdMAaOMXlzr4sTsBI\nkcH2iLo0Bn8luBCeVECSC1PoF+qjUnqm3m+71Yd3Y03ydXxmLQ6UrrwsquPW\ndg9KOVpoD65C2bd8LMgQgcDCQW/uT97lFKFl1X+TStoR+TBosJFNl/MDoyuT\nusqqYR2pr+CHN/Z0rpCuavng52a0vQimAEmEJJjbpth4U60SSGtheNr5mr4m\n+mcaAV12ogBHjj9Q1Tep12bUQHMGAoY7pCuuyHN4kKUXLTA2csGa3V642DRe\ndVrVAI4OWy4OLokeQeSZyEbv3b/3SEqoHRI6HBL/GNUTxn1OMlXuNHcGxhOR\n//PHYIVeQhCUO7SxnNZj41rslEaZ9k98dTMhhWaeRvntCH2El6XSZChXWmAp\n6ZyL2VQB5iNw/sUgZl1jGTDCMY3GAiFX7/PWqvFbUGqFGs7b63hBF6R0o9hw\nuWITTKXd2KadWXvdjjNgLrWzScdRicIorQtdvcKMjkjdmxVcbNGyGUEPlwGv\nqCbhav//4FEkx2wAaHmpuUFizKBKVqB3i9ESXNJbTldmmauPTEZMwq6fPs8/\nGZCw\r\n=jX4f\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"faf640e75b20702ebcfbfae3a541fcc6bcffa942","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.214","@balena/jellyfish-environment":"^2.3.31","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.3.2","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.32_1611506593965_0.5474975991809006","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.33-renovate-non-major-df2d44e5b2df8a05836cb531bc9ddd9f851c77a2":{"name":"@balena/jellyfish-metrics","version":"0.1.33-renovate-non-major-df2d44e5b2df8a05836cb531bc9ddd9f851c77a2","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.33-renovate-non-major-df2d44e5b2df8a05836cb531bc9ddd9f851c77a2","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"114c9b929e958c9b50e66cf98277394444fc9530","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.33-renovate-non-major-df2d44e5b2df8a05836cb531bc9ddd9f851c77a2.tgz","fileCount":17,"integrity":"sha512-y0DqXP6I0qSlStM80czYGrymRqJ22RmkMeR5kK3zX6Ph05cAUrCrKn54dtQm7NFszp/tcqm0kxwqFYSQnOagnA==","signatures":[{"sig":"MEUCIQC9z5AKTXZyPV6aEw8h4omrSm2A/bAg1fEp4tAPe/vfVQIgN7gXCtWDGO/+oFMa+vJyDSyp0nSKKhjAeMP0KJze+Bc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":103651,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgDoexCRA9TVsSAnZWagAA5ogP/0zHHYtrvgbcyhg1PkYs\nqrTWbiXee2Tf8SVFNb7iXHRMEYvgHvC/dzoIdIpOGqsJT1w/A19GRfEv88SG\n45FX7C59VQI4srm0ImUGU9YTtKbJarFfUH1mc0kpoTsggCoW6QPtMJFosujv\nZxPhOmd8+Z68KiMrpj11ECj76bjq/7hOZJbv/k9pl+oVUHiOXTBTMS436NwY\nE01jgSzSBSgt3VlXp01dLyW2J6AwU4zsvE9jjc/18td4YzT8Sh9E2hc9+N0j\nv+i1K/kt7EwPxeyTkGOD9J0QnMGiWMFNntws1/qMCY9DxhB5eFH4lNPc0+BC\nFVKC+J+pKu42eaz9N5saYiWMS7KwqOfDKaTM6tkAEkptZYxuQTgVXI7devYD\n3IPco9iljQJtwdZiYLZYR2dRWSmQnzkE4bZwRYg3RjtTUcnTn9ET3nSPpUy8\nKXlgZOg0CLfKZaTMC0ca/ZO1UHGqY3eI4D1Rpix/IK1fVl2tSg1Vy3ZmA5Po\nMrbe8i6ZngdnaXU3vp74X/1vpmqCKvYb16OrSPzwljILookr6eCjur2bhspN\nJuYphGImbP4tr28Jk6Q17lb8Vn1LsVIxXLJdsysI7uD/CgckA01yagSd+Cue\nRtW39g9w1Em5SeJlnxaBqM9m+lhfW4C7piceM2h87nlC9yGTAsbiHAfK3m9x\npsc4\r\n=RW18\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"df2d44e5b2df8a05836cb531bc9ddd9f851c77a2","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.215","@balena/jellyfish-environment":"^2.3.31","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.3.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.33-renovate-non-major-df2d44e5b2df8a05836cb531bc9ddd9f851c77a2_1611564977341_0.5660213253031947","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.33":{"name":"@balena/jellyfish-metrics","version":"0.1.33","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.33","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"43c343ac4f4b4482ba10d73530bf403b6c7283bd","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.33.tgz","fileCount":17,"integrity":"sha512-PvVDDF/OKBmnJwmM0QyKbe/OaR/aH5jISMcrQ8KOQ59aowczfgM+NxJLzBi1cY1W8GMazID5l/58Wv6q+U89XA==","signatures":[{"sig":"MEUCIQC3DQtYC3GlJTKORGDcudQNSngeY2s6HbUDH+e72b/T+gIgJGE1Y88f6IUUOslVJVMe2OHGusgWhPX7SHH16fcIh2o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":103591,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgDohpCRA9TVsSAnZWagAACLwQAJwJzD8RR59jv5ALXEX/\njnuAKS0SGnrPQeLsCrMENGXBf2kp5PsqX5XyUVZS+pWcjKsXYopH5hzAV98F\nZP5cy/cPCE96fuQ7EAeg5bW0A3IXzdtK0RBbEJTrBmOSXaFeIfsQIhrejWJm\n1ppt35K7DBoJqKsHCNcQwQ1LlVE4pha3Nu8D7EuK3LCzL+cJeh4ygJEJqnxj\nICQOfab/s8Q/zHEShL+dCXk7fci3LtYKBj6bbHUq6sOV0tcnfqGajegs8AAj\nMiKUyFBp7XCpf0VVQn9SzXlbDtB+Ehly3UOqmJz2acjaL7M9kdGPwHUI4tMf\ndv9YRX9W91lYLVOYDX1D/4BKPcVfHJ95TA+JJaFXj6eNeXLLquriN1WXTPVY\nd4NDs6/PB4ca6hsujie7kRVMOZSBCs/mrOC1hOKV5bALeDotqxlyTApbON1o\nMPvAc4prNx8u4PELTXAZ4feRtY92NCeleNcFkJUEpf+xilC/DdtKNq3BGM3I\nVatov72Puz239gn3/3MIv0foeDA0MU7Azqmwcle8jkQi6JWO1nZdriMMMgYi\nMLsUrscKnfNtoS556Y/oMBYd73jAwykDbIL1YRvNFu1Ac/sgmjUOLiofX46y\n52PTNT7DJ8vjKh5+5hfyI1qZRaLRmbUx28yIJ4g1PuwsTnCu+UmjJqjlff8B\nXUf+\r\n=iCzm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"4020007acf95cd413d0d10f0a4da8f1fc414a308","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.215","@balena/jellyfish-environment":"^2.3.31","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.3.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.33_1611565161303_0.9845227935866603","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.34-renovate-non-major-77ef3ab4c4dba828a571d463a25d51924a25f87a":{"name":"@balena/jellyfish-metrics","version":"0.1.34-renovate-non-major-77ef3ab4c4dba828a571d463a25d51924a25f87a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.34-renovate-non-major-77ef3ab4c4dba828a571d463a25d51924a25f87a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b934f7da2453d88d9de22cbd7b870f997956c577","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.34-renovate-non-major-77ef3ab4c4dba828a571d463a25d51924a25f87a.tgz","fileCount":17,"integrity":"sha512-o0+MqSQEorFQX6+KdNnpyTSi6H38pfkNOo/6io2UjXY8kTqiBfpSa0KtKpvwj43J2gDTF+Xnk+n5NlQ/BP6cLg==","signatures":[{"sig":"MEUCIES3pRMkxlJ/pOGZ89YLsQyCIqCjoXopaMe4SsT9uDnGAiEA2Q0k2kyu+4F2LBVcRAhP/IX8yyPrhF4MUyWhCYci5VA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":103762,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgDom7CRA9TVsSAnZWagAAZuEP/3Zm3H6MlWRGK9++dRCx\nDk8uWjlVDXu/dXFcyE6ltzrVMiKMsEVx/YNClawtPl1Og2ejFY3SzTZoltX0\nh9kYqgK9UHxetFCfyf72UufIHvWgFaIS4vMidN6Lzt57hGXV8Mk9G9Qa728m\nCukvBMga+odoIextrpie6LMVXsxJMRKwxtiQS9ccRYcA1vvkhMoo60WCFxmL\nf10+UDU4VQXIifWx8IA0kNdI/qVN/28st/4j6IOGppR6yfg9ezpz8bMCSpAN\nlMXGAAPphRrC4KptLnJ5/n9xaU4Oium+t7Kf8v3CVtn5nT93pDGpZeFQ0sW+\nEZCjxWpL4DIInr2T+egSw3dFYl04jZYVrsU6JTF95A5VdQVgI74sPlHR5IVL\nj9J4o8+y/LqbPQzMQGGaRW4lhpAqNPHtqRPhGE6cIdSrFfz+6l7mUTi8SBUC\nTr5+FdKQ9k5PBNyY0+p42sixPg/X/X7MsshzMek73NeBHDXF9Q5dhKGow8Mr\nZ9JmHUX6EtaBEZZKUovUW1k1YnyvIoPJjuGlF9UILML1fcISIxoBPVhNP01N\nKU/aZP2yppmr8Tfk1ikMVMAk5qfJWKvGVUvS6HOZINa5YJFj6mO/m//ou4V5\n+SM6QucKgNd7NxIOIFEeqV+dmcBmYDzU+8dPAr6ShOXBbpLinqOqMj+tvlUJ\n69zH\r\n=fnGq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"77ef3ab4c4dba828a571d463a25d51924a25f87a","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.215","@balena/jellyfish-environment":"^2.3.32","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.3.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.34-renovate-non-major-77ef3ab4c4dba828a571d463a25d51924a25f87a_1611565498752_0.4863656834952974","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.34":{"name":"@balena/jellyfish-metrics","version":"0.1.34","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.34","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3be90592a93716f2a931ec2b4ae96be4c8a48c91","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.34.tgz","fileCount":17,"integrity":"sha512-a5vrSebzLONkiGjqD+OzE+PZJwMQJ9nzZVT3ZNXyGhc50CLFnUAukU8IXtMiv7uj3572aVHQsYZChPeZ0Fgmng==","signatures":[{"sig":"MEQCIAkTP3axYqaJe8GxtoHRmMqG2fdRNU//SabBgSc95TKQAiAQQutVJI9LtsRu7EboyHudRcaouTU3VvuwWBHeHZqWXA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":103702,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgDopwCRA9TVsSAnZWagAAG4UP/3MjTCQrQPYdg3s+ebLb\nkUKjjHYzNbcf4NHJhQXivWCgG7ilW2Fkd3tJd/WvIoh2y0pd7gVNGdnUIXo1\nTXamLDDsFsZiJRoLLqmT9r/tOWUMo31o1SK2kSwJrlLxiwbLZ79zzG8pZMiD\nu6y4IUOjqpv6lKPVzVupE/tGDV72Hz8C5c6Yw3vGMpQSjVzzSiDPfAQp6CeH\nEEej9i/BHLFgGWABVtBz0QwkcVtn3RJNqn70z8xhPC49YHwh2r1h5ejWWRkq\njpda+muFUvj7pg4Zo8HAGE1YucSZMfp0y1IwVeuNXSfziL5omaRXtM0Qs6JF\n/+7xI9Lafg5cUl0Hraj3msKjquQgkj0ELBPx3NABdOOrOQlXsBOi/r5nJJwO\nh3UUEjQ2LWy5npOg5+F95AG9v4xWL0ccyTrSZgf0RiT0X+2D+xQGxBwwEQs8\n1yyQwwNNJDUjOb7npkM+z6V6PNotpaCuaCq8UDFxnyd5Qve/Fa9rfsb07yAd\nR3VeBnBYI2GLhRbPCbApvl7lK5p18Ju0gostmqlDMx5BtWBYkQjZ/wi0L0Iv\niMVvEyw3lfXJzX+6KnCa87RPjLgwUksMMm8g++757pZTzyQ5/TXEEnKi2q7s\n80VHF2m00cF9Z2Dc2M5XB+x7EQVs4N+KCrNJLRmM2H6+NM/XsyUnBEd9gQfC\nSROj\r\n=Schq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"c9fc1f495979f9f061afbccb5d3ab494d8d03c9a","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.215","@balena/jellyfish-environment":"^2.3.32","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.3.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.34_1611565680284_0.5439216977695711","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.35-renovate-non-major-1199b6277ca94cb9bfcd405c320682d426eb3379":{"name":"@balena/jellyfish-metrics","version":"0.1.35-renovate-non-major-1199b6277ca94cb9bfcd405c320682d426eb3379","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.35-renovate-non-major-1199b6277ca94cb9bfcd405c320682d426eb3379","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f9098dbf0cb3bea8e225d7ac78e3b2fcba5510bd","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.35-renovate-non-major-1199b6277ca94cb9bfcd405c320682d426eb3379.tgz","fileCount":17,"integrity":"sha512-FuS9u0I2C8A/PXxkrJFqzNSvlXYjWJiPUKwHemhJKP5z+ZKh/mSgGplyjHies0jZFel5cZeXJteTRfTbYtlZDA==","signatures":[{"sig":"MEYCIQC6kseNKgu0yRo5n98oGkQ7iIkf2Yo8/WbrqYdTh9iNswIhAPc5vNBLNYqhXS0ZtuN/B5byxQi54yCeKCtIp/YM0ik5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":103869,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgDqG6CRA9TVsSAnZWagAApdsP/25M3eSwtSIwxBmnGjoH\nzaHr2PULO4SNcsBJ4wTBypJfgdyZl1/u4NtieJi1V1gsLQWySwacfXZgGcvG\nLxlzBq+BxccWS3U6ZL4YmET5RIJJfJu8QYDH8Dqcxhe6TRjmqKkLdRhEP5+K\nqJ7xIvXdLOVbewS8wQonnS3hbHBVhc6yV5tCs7uNSuEyuxH1B57tqq0IzQ57\nv58mY0pNYr/4dMMcCBWc3bkwLdANaVSq1wrdZd/0Kt35FOU8zSN6XsljcQMp\nXHVNbU8jxtCXef2mjj1HLjXLG4YDU7qkVcKH4lvVyc7wFRnKwfM8PHTVYl6H\nGf62oxvO6Ig2tHMGXEe+GKsG+b56MPqwmJT1tNE1wn2DfKnfjcdzKo42dthf\nOxUA8nwVxXmB1DIXq44tNqrm1WPOI/9wNd9ZbhoWeWJGd4ZX18h8aonlFYbm\nfPaUjSpnVREysZQ4ofPtpntTctUZ4jlp03jQ1s5SrYWF2blMc5ZWzgk6Q2vX\nAhJRAtvUt/jccsOMiyG2ee0SjFR9ji6Aq5i64XWqoY1lxXNvdM8INGNRgKn5\nZworZ8Igkr7/es73NVh7z0u4HB++yTCiXEEpz4sePZ8jJcMAZEN5LOgUNO2s\n5c2rV6Php7MuKNfz2SPpxE5XPiGhHojaXE4f2vCVVqCeFbAapalGbIRah7Sq\n8PfI\r\n=+mBV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"1199b6277ca94cb9bfcd405c320682d426eb3379","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.216","@balena/jellyfish-environment":"^2.3.32","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.3.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.35-renovate-non-major-1199b6277ca94cb9bfcd405c320682d426eb3379_1611571642340_0.8015599284252952","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.35":{"name":"@balena/jellyfish-metrics","version":"0.1.35","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.35","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2aa896f70b41c4d2393dcb5eb5a08e3a5e0e3505","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.35.tgz","fileCount":17,"integrity":"sha512-yRulo3VbSut56gj3Yf01zAjbr5KqmDRFLVcOx7vk1Fxi73w3K3KCqEEd13cuZsfd9MyyNv5MkA1wsBqU5JJnig==","signatures":[{"sig":"MEUCIQDMQJ9Jll5j9b+lJT/fl1Qb3gEdVfNcMZMRSDmiMGDT9wIgWWgM9wwAKTRNmoMhfoOCrd9/jhdEJ1ao1f2p27YEOk8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":103809,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgDqJ+CRA9TVsSAnZWagAAXiUP/0BHQs7FobgD4p9SRw/V\nIa3e7q69VStxM7ufQbPKpwPxNn2Un1YaoKbY7qZf/v/OYnaH8hqz8bQUeXlp\nAKt0LapidR3Ftt6SAVtT0UcqIQarK6jtoRqcamdp1hSaiRF8VUwj6BBmvX7m\nEK/0ZDUQby0gCqjtrTYaGEFCX0tbTnCgm3h4fjPGlYVMl+Ikeyqghept9Bmq\nWADdiFqBQvimeR94qyik/zRU5d2nUUBZYYWbKOfMkPKdM5XlIRIR6DxlvIRy\nfF+NpVFqrdgH5h1fPcQqjHiqrt3bXKcDpkalbrLsG7WZYA4pHa0wJOVc/pfe\nZjNxwlEH5XBYVWfr6kikhLsdidbKilV9GEd1hUqcEpbjrxCsL0Kg+GWmW55H\nst1zvnIiW7lw7Cj6D8u/5uuFN5WYrDfdzAVVbJGOFsq52kdHHTVUUZ5SUvB7\n/40r4K/oYgTRuSyi1zxOaxapprFhW7IMdYwVXHuYIxRO/yyKOMt0BUq1tG9L\n6sPVaM+z9jr3cRlmtT4PbUdLLVDXWJK5z5RJ6XFtkseOYCh6EwQM9r1k5tcA\nzuKAdccf+jQ4s/tdAFd1J5x/IYp9+6vrFj0HegJ4ZIwX5LayTAeg2PxnNhbU\nOlH9j0BE+2lKpcsObZnP6YJuhGQT19tSmNMVEcP/ExUeRVU9hAYMMFqzaIjT\nhzOS\r\n=5TRp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"1d532ddce933193954d6f185a46faa34eb747e6f","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.216","@balena/jellyfish-environment":"^2.3.32","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.3.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.35_1611571838416_0.8816424126537619","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.36-renovate-non-major-78c276ecb52a0ebb975eac810fb96328cfd12598":{"name":"@balena/jellyfish-metrics","version":"0.1.36-renovate-non-major-78c276ecb52a0ebb975eac810fb96328cfd12598","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.36-renovate-non-major-78c276ecb52a0ebb975eac810fb96328cfd12598","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b102c3ce6584a112ec5d3ffded6ca7ccebb5c928","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.36-renovate-non-major-78c276ecb52a0ebb975eac810fb96328cfd12598.tgz","fileCount":17,"integrity":"sha512-LCKDgQ+h/AaYPdVnGFR2D+aW8/kYMcfNvdCv3fEyPEWRLuAon+nG2xda6zT4H/dnQm48oehlCQ+RPXKpOOai+w==","signatures":[{"sig":"MEYCIQCrSJHYIiAKT5RsBzd8P+Z8vytI4hmfyLDCLDhUOGX8HgIhANLh6/nyqdKXpfYLNdzQCP+Rx7+CNNnnhLL5nBCrzBmX","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":103976,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgDsiKCRA9TVsSAnZWagAAIcAP/A9+0ePsxaUGYLje1dkb\nkEXhCnlo8AORqnudPzBNvoVD/+BaYcLv6phAbtc5iJP8tzWNdFs//9hiAaDu\nVvgw8raRxhaXpnzpXfXcAwJ2KlopLdDzFJgDyjTI9cM+5EH+PD6bMzxcKIqe\nyas6KLVYMnjLXOSt8wAPIrLFE6iiP6p7ZHJatwlciJTLDC193BVHNyMs5fVd\n8i7mGdJmT8ppJRr7mMuz7b0zKpZ7Jnj9c40Rzh3HNVLoi04TnRh66dcdrQBd\nxFmWi/vFNVCoJp8WcjnYXYzSBicRZ8ZxCV+RZj2+NOPODkSFgq58trKwOAY3\npsYrGAaWXApP5mgpZvA0bCunvnkzVfB7SanbGNWhuDfpPS/wt6ajDIkWPKiF\n08cs5tWJaC3elTw8ixMw3X2xNmHKjxmKVVQjHJg4dHdPTN6cOXxHfEwXkudF\nWPXr7E3FV2Di3EgxPxQRK4ayFLc4aEiiG7Ueis7aVssDuETyxtrkwbEQGB7R\n5fBwO2HQLU0XZSVDAvCrNt5Nem1iqc6XWAxJb1l9cKXA5h7Yn0PR8EruF9Kj\nIe2SIVKWxPyuv+zQL/j3JmXBZrsCXMfGHyPrjYzF0z9ed84Co/MuTltizy+s\nJs7Hlx8Iqm0Di5/Oyta723bTLoKNtPG++h8pg3sDgJXazj4U3OTBYqOpLqEH\nA1qd\r\n=OJmd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"78c276ecb52a0ebb975eac810fb96328cfd12598","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.217","@balena/jellyfish-environment":"^2.3.32","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.3.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.36-renovate-non-major-78c276ecb52a0ebb975eac810fb96328cfd12598_1611581577785_0.04339155126732752","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.36":{"name":"@balena/jellyfish-metrics","version":"0.1.36","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.36","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"kaisoz","email":"tomast@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"388e0dccb85ce0bae708e56f2dcbc45d44896e23","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.36.tgz","fileCount":17,"integrity":"sha512-5PjP95Mr25wgfEAFeWdWvAm4D/+9pgF3erktyPvqqJMzUNiIRx58S/G03A+oBfwZTpFv85culp2jRqZwRXmdvw==","signatures":[{"sig":"MEUCIDtGi/kHLSMGVbcmPW3Fqa1SyKBR31x9sroW9pisYhqRAiEAntW3JMFr5Tj6NkuM+aAmA7725DkcvC/BQkiDf5BKdo0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":103916,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgDslMCRA9TVsSAnZWagAAWugP/2nHILCpZZ3ZkuJf7StG\nqdoQWgD1M6yWUupJud1+fPLTffVFNGQB+Q0icNWEliX4jKgk8pWXMcLiVkjy\nd9PVbjjVSEKOL70uehexKaTN8OmZeWRKrCWc9IPKUxPMVnx011Hm3TquPOeO\n3r19k6Pr7YIife+fb69vuGyN6EUAiPKphuhIAaxMDPBczgE2QYl0kCaGr0Q/\nZiRgfVbU4G2++56GLwcyLcAgvQ7Jb9M31MQApvImzasaIUxssF0HRWkIbxF6\nrkEu99+J4cXCoUoWaUee3/kFEStSTwvBbj7o7N0TSJQTs58kCpaNJnI9uTbl\nY9oUi8COKS3QP6IAb6qAT2gpwHzRgRBkNeK2Tp4G8lsCpin6u2ll3c86ObyX\nsRsIOpj3IlvaFv0ufRCBdWBmsiQM0SYLuNnI5hvv9nZ0m//GSVvNXdwnmrJI\nXPNVK5sXZvbAcqCKgyiMKPLAe3h9Nn6BQLeV4Pj1RL+U2eVVwfOAPtdPP5PX\namIcjkQhiMSzazKtoQwutUAOcK8RJwYWTup0zQ3v/L4nZ92SGLxnny2zaOyf\nPy105gezWJH6wX0Lz2D3pK8FOYidI/x5y5+ZoNn+cbfBrRbgTOz1N7EPNoyA\nedC2C6VbRyk8P8kIWvPUsY1nYiPGzOnQUk7cqTMtqO90OL7EOMcWMLUXns9h\nRrAX\r\n=QZbN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"2f7f9e3832f42d65d64b86ed8e41792df9df8bca","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.217","@balena/jellyfish-environment":"^2.3.32","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.6","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.3.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.36_1611581771767_0.4344098326535737","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.37-renovate-non-major-7e564cacd638b7fd68c83e6580227cb3456f626c":{"name":"@balena/jellyfish-metrics","version":"0.1.37-renovate-non-major-7e564cacd638b7fd68c83e6580227cb3456f626c","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.37-renovate-non-major-7e564cacd638b7fd68c83e6580227cb3456f626c","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"45f79d2ca0a549c0bde5e6b4579ef7587a0239d8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.37-renovate-non-major-7e564cacd638b7fd68c83e6580227cb3456f626c.tgz","fileCount":17,"integrity":"sha512-rsbfTWcxihSzMR6+y2bwmBScTjUqLYN87S8eYxvszkMFJRB+C+SN1izBQfuEcMxQoIhdkH/GaIytkkbsqKUq2A==","signatures":[{"sig":"MEYCIQDe5KCr/b6SRay1GTwE9lu7zB0bnj/QvvnyqhmJuji+PgIhAMcQg70qdZ4mrPB/1ekrJwbA5f9TUaD7g2aYVbgn0fr1","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":104045,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEQJECRA9TVsSAnZWagAAUHUP/00xa+QFAFngmWwpy6SD\nSTn+2lvQWNQtVxrWBbLU4BQ5VKjGBoCmbwxs4UqDeWbhVaHJLSXZ6k/N2be/\nBi5l7tWKIhSE+MB3kDusVQFPZ9lBjsD/4zxBLTg1HyUim7OKg8dB0ck43E9i\nrK4mKDCBi01Q2LylGRxImg78Vb0+dAw81R3oYyWnJ9D9dILts5MX4Hg8VYSB\nVr/SeDpoekk/3yatZYWZx5A2MuhascQV5B45vqrRntSwVpGS+MgMijiqSHUB\n2L80JBFSCc/R1jWEO/tc3V2xc5mB2jkrz7nY4FAVLNjWTQ6tz7Mbe1yqELgX\nf5E98Jd/0v85b6xOxpJ+B+EoWTpYWe+RWbNX3AWKMjXer+yy+kL+3cNFQp49\nSJCY8TKlqK5TOhqr3gI1jBqdj1TCLsda+meUCoOjbbODgxpkvv2EsDYXXyNE\njVXlWJAySbxrsCwtgwep0rbYxMDUiIasR07YUCDYz1CpFwM3DT5oTv+Oba+9\nPBpE80fVTAR9OhihPDk4hp4SmLZmZz/LsjTK0mzeI3VVIEau78r05U1/vjIB\nxV6Yr7fc/1wEdpq3UH7BRmnPmszZ3Og1lrcpAOxR69GhH2MbU+NQPSz3XOnm\nUV1582U0xcmWR07+88biLkuq3hcI9sCYc51XILBVqw6FG3VrmrVfuaZ93VT9\nAzi4\r\n=9KMe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"7e564cacd638b7fd68c83e6580227cb3456f626c","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.218","@balena/jellyfish-environment":"^2.3.33","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.7","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.3.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.37-renovate-non-major-7e564cacd638b7fd68c83e6580227cb3456f626c_1611727427981_0.9189308876380768","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.37":{"name":"@balena/jellyfish-metrics","version":"0.1.37","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.37","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cebc3fe6f13ba87dde48acfa1506d7c8dea29eba","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.37.tgz","fileCount":17,"integrity":"sha512-QKqj8zEWkcjWLr8m9wdwQ8+xVh0pIPt3NUh5lQAPv2oJdQS5PEIyfq8YxnQswrn1Mn6/NU7cbTkT9dWeZ3LwUg==","signatures":[{"sig":"MEQCIHKTX+Jihq7iCLHxEBzLROW/89DkZvHPyqZ73ygs4Q6rAiBpBh4fTXX5tGmxyjUdhuwyXdrAP6WlwTpUYMz5PlDJnQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":103985,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEQLoCRA9TVsSAnZWagAAmYoQAJ6TlxJDGasS85RxGH7I\ni1l8aZHM8dj77OMEOfbr0c/ES65u3QAfaSZtyBknvyZ8fVHSjZ69JfRsJQY8\nnknc0RvBT0R/DoUbrt1FnbX6GKshgKft4AryalSr+C1CfN5FKu8ofhzdM/kq\nxpouaxT9VKBUwCgQcNOH47bMi4erVBBT5FCTzx10ozGd6T/ZR1nZo79T2liq\nXglt58y2JzibBBPPssjhRgCdxqKuv+PkBLmSObj3X2jgt4lwdV7q3ZG1U1JA\nTSDoauGolXAh9mHTZrbf3eCC21dWlPDclupDwqg1iC5R6cAteUMC8vXukvPP\ndc0exeDKVuH1VFFFKPRg9pghykm6h2PYMPJIzcBoSS1IteiKCQKdZq0gCNrQ\nir3G8CrCzhtmWZvMmGHYWDRhH21NeMRTqggpryOes9iwLI0UDfpmJWAVQ4Fu\nrut5jy1bZ8lCKuzO+3JpyvLRIlokaAS3CF4tuWZ2VQ9xQmHa9n2qc1aGPckq\neLE2SFLoZJ9pXd1+Pb4NjND6MwiMzY2jquTAgIjrgb/C+RN6qbgy3HfDi0rM\nLl8ilfPZFeChJKn5zKlzCcrgPS8PYCyaFDMukd8x7UfFaNTOcGeXEu9his9v\nwSc8RDdTlTZH8+9a8dmMqdjwLOA5MnigbU5SGpZGhgmic/tscUlQhOizgk+p\ntS26\r\n=1BlE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"7fb0a321131b1f921687f3ac8f54b45de0dfa09d","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.218","@balena/jellyfish-environment":"^2.3.33","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.7","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.3.3","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.37_1611727591780_0.5626045955485732","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.38-renovate-non-major-7c6c4114cc15074fa4839475665aadfb0d6d820c":{"name":"@balena/jellyfish-metrics","version":"0.1.38-renovate-non-major-7c6c4114cc15074fa4839475665aadfb0d6d820c","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.38-renovate-non-major-7c6c4114cc15074fa4839475665aadfb0d6d820c","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1f2f6bce63e1e9b468c28e4083fa4de8d5007019","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.38-renovate-non-major-7c6c4114cc15074fa4839475665aadfb0d6d820c.tgz","fileCount":17,"integrity":"sha512-VwtW7O7lzOssuRon3sRSdq/zp0lI16d9cWDSnBpHC613K6AQBkAq6nBEBJBBTF3PyUuG21BL3IyHBmoGMy0e/A==","signatures":[{"sig":"MEUCIGgzdKnvG9+31yYu3/8P7e32WUqCZy4QAVnx3l7uIs44AiEAuvKX1TTD13Z4lfb86EJ9ZBp2tcEsKG9NKnS6q6fZjG0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":104146,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEUVmCRA9TVsSAnZWagAArUsP/3TP4oLEzWwiLOlS2BA2\nAEQ6uoPOxqB8/IjULZyVsJPVkLeUIhcFYTFXWmyA1Tgppa9+C1jks2TaIrkf\nWX4mgnA8j2fjBWD0FOH7l8L+uKIVu/cx8dQ1qM1jRzAx1/mmddv5VWVYi+x2\naBXrmw8uYbKnwp/3n0cyYJkUgJXXXXfTnxhWEwLILUTeWwVhZVc/wAO2LyoM\npmZKB7rdWvZ0bcMUfV4ppMO/nCanyuKhDHgYdQ8PgqxMW8EKjfVAET6uXjjG\nmBOh8F8u0Gn4jNLCYXCfbH0SOh8d1Bv8O+kQWsf0cXltlgpaMLNgU50Ot/kE\nzzZJlf1vl6fTcveg92aMgpHJ0jumqHGARNScAmKoIm/2oIK5F+w1lRyzX6VQ\n54VqfKXBDy965FWm0yPucw/fJGO1lkLUXwU21VVAU6R5RH3rcB1mCDFJOFa7\nek/Q1FM3xcts1/4o+wvReEdknfWrzpn9IU4dBV1ScixnE2XomMe5HUq3i38S\nL3YtJUr4gpLZ8AlbDntjPMVOex9metTKI2fF3bhk41bSiye1DVbW7sR6TQYG\nyGsdpwKXrKCjl2CCWEUK+LIQe2yQCzwYp/6PVENL3ETz+yGY1VBEK0ARcW5l\njYhA9+E0+6tAXs79SFkfLz77Za5mBmwylxWya/GJKbnkxY6YildrdvxZtr4o\nTTEf\r\n=digp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"7c6c4114cc15074fa4839475665aadfb0d6d820c","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.218","@balena/jellyfish-environment":"^2.3.33","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.7","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.4.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.38-renovate-non-major-7c6c4114cc15074fa4839475665aadfb0d6d820c_1611744613824_0.9972778138868212","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.38":{"name":"@balena/jellyfish-metrics","version":"0.1.38","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.38","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a73a55c7d20405733bc825b5453878ca695e89a0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.38.tgz","fileCount":17,"integrity":"sha512-kYs1nTr8W0ckzeta9Qrzzv2CA0mV2UXDmknS1Ra3MphqsFThe7dolUAODjeBLQck3cMJB8RSwyFb4e5AotQnpQ==","signatures":[{"sig":"MEYCIQDHVdopuGU905NXRe7EF/AJ7PPlt8P9DflQI8r397HJgAIhAODbQakBkPYiqjwLL9r0toAXw6CfNQ7oXH7SBPS3UDGX","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":104086,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEUZwCRA9TVsSAnZWagAAQK4QAIERvp78w6/JbdXlBmPl\nlsp/ayIAXYc3cSUUNxaXkuWQA8w1H70y+Zv5TZCM5ZZyra2r4dLNWgL35RGe\nwNf03D1yl+uous3Jxiq3M4m9D4sPAJHwe6pPH3UtFZ9iG2ITynVQ5Q2zqX6r\nngajItckA3+20yzGRyCHZH824UNmTERW+TB/zK1bv3+xriSiCL3RKoL+oQJN\nScZbKZl3zWTrgKxVy8MwsLWoFUhFa5YFIajNEBkTC9JlDvldufTB0vH/k+XY\nFhY/6EW1PvGQcRahrZFkW1UO7fxA5jw/66n1Rw+TsyclCYTdiL6Z2oumLOF0\n325lJrWgFYKwJeKRnbn/UNn3gFgdsGTfudXCBjCz+tWqBBuCl9Rxu/SYH+aI\n8w7RzKVbeqsrT0BoiS6B4Ry80pjdoxHq9aX4cML7ZTUV3bRsh08dlNdUgTmv\nGdwxTLAE++9DoMuTGU1PWm5AscSb5btet/GNSk2Q8sMCOruyVhvzrgOZHXem\nTwkMsGqU4aao8F/EbuesJKwrPUtz7LvYxVak1BDidLNBa02URnI+VGg4uQCI\nJFd8lJdBaOQO3wpESJO8YN8d/bMR7e/GwOMLHUBZ7tlyOw+M2Wd1qgYjvHLd\njykvVZy/GnsbIEgczecqOx5DcnMGb4DftSBCW0CgDFBO998HcVQm6a5982zJ\nplku\r\n=5WBS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"a41345a6668b91b0d94fcf06274a8684fbc5db6f","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.218","@balena/jellyfish-environment":"^2.3.33","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.7","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.4.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.38_1611744879534_0.07142302924761212","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.39-renovate-non-major-c24e7bdd0eee1a9e8fd5406217540283be351aa6":{"name":"@balena/jellyfish-metrics","version":"0.1.39-renovate-non-major-c24e7bdd0eee1a9e8fd5406217540283be351aa6","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.39-renovate-non-major-c24e7bdd0eee1a9e8fd5406217540283be351aa6","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"267f677ad41bcbbbf917d3361b5f2e02bb889285","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.39-renovate-non-major-c24e7bdd0eee1a9e8fd5406217540283be351aa6.tgz","fileCount":17,"integrity":"sha512-pZSSyuVlh0JaWO1hhmdr1L+Mm05VJ2efQrFwWe+J0/k0xlsFYqQ3zpPbNLcfbxgwCS3P8V6N+773dLKBGdQK4g==","signatures":[{"sig":"MEUCIDrdOuwYrksifpDOlCM0WGZOkJ1p4WM2BGO2JCIHTjETAiEA2NAyv+pyarRgd/JHKfyaBldq3bD6papd34YXXn9kla8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":104215,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEgrhCRA9TVsSAnZWagAAcEcQAJo/FJrgIJ5KjiSdoDG+\nNOlo94xIeHWnjKT4UTI31RZjlz1GHkfwDdTaGYfHtisKNcYLPKwqhwQ2Xckz\nvyuqImpHNCA0HhZ6VwgmXKP6cgo52R4gkakU2oWkWzP5mU8dbvsevYZrYkVi\nr9wK5/f8mnfVlS7yJfe3grOz6rWXXm3HBE+1tzk9nbUSqAycNSnlhlhkkree\nj39ojMCnNzZ1bIpqkGBNOVqt0zX5vzxUCdghkFZg9mLovAyOq9vthqv7hWif\n97o1jyhgNFP83AAwHqa9Rf0FsNHZ4zmIgeXBhmvDgZPy+/7LL4salCtKw7Mm\n077lMHg2WVt/oFZ7sZcYKgF7VEcqZbI8Op8C6wt+3k4210uJdC/hUF5Cm/GR\nmTU/ueBNpFNmZfcUP/FQeV1c4gOXLHYq6zDvtBP02CavMhipDjpFu/rcyUaL\n9UOLXs24TN3qRRamVvbKkcmV4UrhgpHEdfi+v7CSnaIoxK+8tNd3W1cDIRFw\nVSFwvZe2OUhd/31LZmz+qSsbpRdG8ApMqEUP2mOH3l4S/COw5d3VQ4gA4axV\npG6Tw42QbgqKrIGfrUUBANLkVgfMxvNJod4lpbKwLQtD89fczH3Y3t5Cc/io\nAoTtkawK3NibsfYok53mWTVtQ8gXztzy31MFXKoC9lG/wa5am0ZvR+M/WhII\n7Oty\r\n=omKt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"c24e7bdd0eee1a9e8fd5406217540283be351aa6","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.220","@balena/jellyfish-environment":"^2.3.34","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.7","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.4.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.39-renovate-non-major-c24e7bdd0eee1a9e8fd5406217540283be351aa6_1611795169187_0.45424108330840474","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.39":{"name":"@balena/jellyfish-metrics","version":"0.1.39","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.39","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cbe6b32e9fd32bb271d6f1e39411a7584fd8046a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.39.tgz","fileCount":17,"integrity":"sha512-FBmTXs2gFz5zDi76qbuOB3CPFySGGis8HEOX5pN9fUzBU5gCYscBqZ5Ol00upubn/C6f4xMYjfs8l/JE7iSEQw==","signatures":[{"sig":"MEQCIBL3yLoyrj5XmwHOCeyybybFvckl9fZ3upGZGRURhVYuAiA+LCtLr1PjchRQifO05OhPpjPPodczn+Rng9YAJ4SqzA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":104155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEgtwCRA9TVsSAnZWagAATygQAJl/ooVINUkP1Ehiv1Hb\nye9nO9Il4zvuqyOD3yOp92/WdlVd42i66SQPVMwsYSSKQtjEd9ANyixdqNib\ndVkg7sl+jGCca2pH2afKv2b9xETRLX/E8fXuIHnlqsKFcYkroQirpYvaZfEH\nkGIgU1MjVQ6vLvoqBK8TjBV09cRCaJclz7bLn2rOeCZhr9nbqi+05P47gR8T\nBfb+Uin6+6dmf3uYCAQTPQ/+2hTV9gKwAQ1Elyk4x7q0djcBUQxNqb60g2wl\nrt5zi9dmLeEeTcToJgoo9KSHEwRuiY3mL0Vsp5icjSrbd2dj9LkxnohqGpLp\nspDdvfixsh0R4apCXOP7Tq1YpYur3bPGPGrcMAazGEMHaOmj9ZwM+BX1XUt1\ni0jxq0S2vmanio+eayvfzwSK4HmLebqA4Et74XmWi37ANL4R0A7r/FuN449L\n7kzotAXwrINNx7Df77dyVclZ9XenL+V79HA4MVCN8kRR4DH9bFs9hNBVkXTS\n3xS6nQg7MjhWM+zmqoxMoAY8Hi/F7LCAXqO8TBdr8urUMCOO2h57nfkeBihV\n4tqUbih+qy0UOSsaOSxdAtoPPWIf7dvYlvLp+DSHAGIJQWd+W54OwY6q9ToU\nYRuGUFOXUYSIIrAJ63ahfSKZFtZYSzp/4zV2ft1RGNVFbsZlJLUsBiM4Pfqe\nR8Y1\r\n=d7av\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"c90026fb0812e2e7e3d8ef0d12cdc4916750b722","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.220","@balena/jellyfish-environment":"^2.3.34","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.7","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.4.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.39_1611795312140_0.8078489920770702","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.40-renovate-non-major-d5660fbdccbce20dad1b4e07452abdab040d6b1a":{"name":"@balena/jellyfish-metrics","version":"0.1.40-renovate-non-major-d5660fbdccbce20dad1b4e07452abdab040d6b1a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.40-renovate-non-major-d5660fbdccbce20dad1b4e07452abdab040d6b1a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"660107cc341aa13fe28df449d2f3819bc7034270","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.40-renovate-non-major-d5660fbdccbce20dad1b4e07452abdab040d6b1a.tgz","fileCount":17,"integrity":"sha512-rfi3Wqb0l70ZVNnyNakL0UASdaXeJOJ7hswkdLGGzCmszdlKsJDzqWlQzDeefg4UKRTRnOPtPwagoSZmn0QuIw==","signatures":[{"sig":"MEUCIQCwFGT7TayMii7eqNFePEfif/xFsYIHgA+IC8Lqg3qt/AIgRtaIiWonaXh+mH5Lfy6C+iNuPl6DarV3ZA17qNkzuKA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":104301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEhS6CRA9TVsSAnZWagAAJ/EP/jZfLHnRntFM7RpVrkNF\nBVa0MPGNLy24g9mPAofrSDnZB2YUCz02ZTGQ6AlpXiTknkxGyY18235HId41\nzyUC5AUGOdFkk3i6higrIVm0b8zLlFygt1USziSHwlGq7aF41gFH1gulg4+G\noyB8QbZ7fBFIUqCc9U+kVc6r58rvlXiFpV1yK1af6ywtK0uba2OH9coSYmBt\nO+gdtJu+7/p66yYT1ktiorU0BLuDvwgexGq7LrwGnjtqqwu/o0cPi341JR/a\nhWZaehGY1cNKlP0cN0QhaROd8lojzKscrLV2XJchQHvxJjEE5e3ehboU8VKi\nONwFMvZ77AEHVh12SKE+z2jRjaHLDBzCsm9ltMrZTx9CJBk44qElqI5I67AN\nBkZ+KviNu17ONjygZ/5ahCGhktC3nDFkaG0E1D4s8BOF1kMXN+kuslftMHfs\n0GMqQjDeh7IHq5y0KfYh8JwbnsZJMn1h11bacxGnHmsxSvUsmHosAzuLk9yx\nCEXJVl/gwDo45Q529/xN6S6stheH7NGPP9Z6Jo4MQoOjIrL6RiZg7daGwzwc\nqEGcPiPP45bGu1FDlg+MwM3h9EtlX71ivuJVDp9K2lorsVjITnQcuat1TbHm\nY9KDWBrBtTSr/tQC83LMpbF78YadEwSDHK+p//qF7Bn6CuIyuKoxRg2qew+1\n3cCV\r\n=dzyW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"d5660fbdccbce20dad1b4e07452abdab040d6b1a","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.220","@balena/jellyfish-environment":"^2.3.34","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.4.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.40-renovate-non-major-d5660fbdccbce20dad1b4e07452abdab040d6b1a_1611797689913_0.052021902180684254","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.40":{"name":"@balena/jellyfish-metrics","version":"0.1.40","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.40","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cbe456f4a5a3fb20d9eefa87b96525f458b573e5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.40.tgz","fileCount":17,"integrity":"sha512-VE8j9z9eFkObROcUWkCrXdB0zc7ziMzDyQsFPOgYxG783DlTv0ZKJbNG62+yji2/p55gnhVv46hdskNP1UQ0wA==","signatures":[{"sig":"MEUCIC6BiOvIaZQojUgNRNStSsCDVLv48yIDNhdqFRmGYzziAiEAxNUNTEXvT7XTFAijOlDmFXn0BQijGBpOew42L6WvIHQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":104241,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEhVwCRA9TVsSAnZWagAAI54P/jsnFjqOLvcGIQd2qM13\nDUExlGMz90HTj0qzNXfrnNr1j1JTKqk24G/nn4sCtqvMqOdR04fIRbn7xXDS\nveqfapelMRwjDBz4dMbyKM9RJ15x1siHp0aSEn1Zg3MJMjUeMuppE/1CsgaN\n+nEFuV1DlJUcuYVEJLtJVzoWVaUOJSCjndtwcN4yHiXka0jdotf09pCLtZEW\nexLHYRk4oWiQY8aQzsg3EjWFXd83XKzQxFderAelm40sCsF46Z1bvJGwwrse\nsQgdb3SE8KPpa++KTjJyFSQZmqtJ9wr/p7kvnIHuLNS9IouR2RpHR6hUdFXE\ndDw6E85QtFPr+HMYpDeQGxG6/Qf/fX8lLpShn0J4ZRmUCyOa1odlEUfV6HOw\nhJgRWGbPY2piKDGPQauFIaI6mv2Q2EbS5HfnGi4/ewkl8NQykzA0Gc4bUqjb\nVEZlxhjKvTBIV6agWScAEdjEfcaLahd23sUxwRRAfSZRA2+PRXndtKy8+Xnu\nXAY5JC+TVnRyVmIIyZ1F0BuHI2dK1IbgA7Nlr8XwgRaEQ4bVH8sdcVd1eIPG\nNzPkcx14rgWR4lauoTz4t7MytiJot7XRGbpEMzcVJKdmQqwRhLnRSMYp5yR3\nTwJ0A3lOcVmYyDnOnTKTCc8nsIFSjJdpuNYuCza2OcNrzuzL0euL0IW+QN+t\nWU0O\r\n=7Kp4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"3346d5d1dad8d16f4ae45c1f88fd1d4f2ec11a09","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.220","@balena/jellyfish-environment":"^2.3.34","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.4.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.40_1611797871991_0.5553893866816941","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.41-renovate-non-major-6705d8b585ebf4f7001b1ac3d3b4a988bb73ff65":{"name":"@balena/jellyfish-metrics","version":"0.1.41-renovate-non-major-6705d8b585ebf4f7001b1ac3d3b4a988bb73ff65","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.41-renovate-non-major-6705d8b585ebf4f7001b1ac3d3b4a988bb73ff65","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"64877eac9f9650facf0d24c3979d74bb7f3398ef","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.41-renovate-non-major-6705d8b585ebf4f7001b1ac3d3b4a988bb73ff65.tgz","fileCount":17,"integrity":"sha512-XUq0tdVXip10sy6Om1Tn0X5M2qvbMhM3hSZQvvDMeSzlsv/3NReFJdXqO174HSAIsj2J7NCzvifuXBEiH4l7SQ==","signatures":[{"sig":"MEQCIGzeou26pjSf8GhHho/qz8L6lvbbFgagTXgUI8qxKCwJAiAcbTtTMd3TjRHb5Fc947wKtiCE5omEtzZFFio5tuGLOw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":104412,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEiD8CRA9TVsSAnZWagAA3r0P/jgnpN44ItdY2UWULvFh\nAvFkPek7wqPrUBKqr5BiYDu5R7x355iWoRtdebmbPZwVb52JGxKR5SNcOZWO\nvxx0dOMLD9B9UdeNv3ATpB6gMEWSKvcNZ+E5VSxLsNAyD5zWKLHZC2cy5dWr\nToONiVaDtfo+Hy8OOZzC2xwDgEPHzchgCQWnK3qVpLPoam6dONf5k2eWP8AE\n0mbC083WA2IQz2b9x+KBUgDLetRFUS9/zqY4N6Xptvd9bZ0BserleeU68hXH\ncyj3x/84ywhHC7Pa4RR774R48TTob3rDicuyqRDFGABVgxIh1q0LQN/RR/Tg\nrA8kjo5jB3Kb9WCS7T5LVwireM0DQLfUrMFL01OhsVL2TVMGvXi8cTF3sIsa\nWpAmBX02kgt7kbKaTz66CAa9r/EjaI/Qx3KGixhBwq4lmi2pBTTFTRPkB4HS\njo97GvpAcqjHQ2dNqxQDneECld1flMEESlkw9y0afpXCSMaV67EdLAYwCulS\nasq0vfSOCyntVmkIDpv6oOgrhOznwVNSBNqrwqatC/x0YpMeolEvaVCH6vaT\nqBpPWrPIRN2qRU5UsJjQPTnO+JR3twsI+JG3VIXf2UMtZ75lAy2pUWlcg8gO\nUi/o5auICabiNXF9j54YK9uMGAknWXy+KyGlvRrWVV+2ax994EiX3aJawURA\nAIvP\r\n=B8tK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"6705d8b585ebf4f7001b1ac3d3b4a988bb73ff65","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.220","@balena/jellyfish-environment":"^2.3.35","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.4.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.41-renovate-non-major-6705d8b585ebf4f7001b1ac3d3b4a988bb73ff65_1611800827838_0.39505280135563714","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.41":{"name":"@balena/jellyfish-metrics","version":"0.1.41","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.41","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7ebc2a30cff67cc8541a65d56cd64b797b397cda","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.41.tgz","fileCount":17,"integrity":"sha512-SPdUrfOtXsjgVIEevGVMTHpqBv2zfFGz2LiGVvtRI50cGveehNhCZ93YT/yWlWnecugQouWqz5mS/QUCFHxS7Q==","signatures":[{"sig":"MEUCIQDpiKhQttzFcmCety4o5VNd1PnrgzhJnWsjFRPOiGd8XAIgBjG0yiR94M3FMWbUWklK6/j3ejzallMjaAlasU1N5WE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":104352,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEin2CRA9TVsSAnZWagAAYnwP/10iRIRT6nAapH9yLOv4\nO/3Zz6ejAxo7cDDn0ebJaBUNNh1IsesehGW865CA9kLgYZ98H4usJRL1/Unx\n2DwFruel79mhYEUcJifXX+gDIlSVKo7MjDb+ShTTtuQg3fIsHNmXxT5jE14i\nhOEMiex5Ev1sOSX/riHD24V7KhZ2A8Pjz+ns8DcmksQ8gni0coU3oux6Hxek\nEPW+SFkfgsDUtArbRFU5Gcffs9KzGs+vX39BtL1HVCJDmgYWvM7BxSHne5Kr\nJhudn5ZViw9sM0TLDb4BPo8FpWFByzbpVuuueBKK48sKzLEY0aBhYN2fgzEt\nNvHll2OsBmmEoyOhZ+N+hxeyBBCLOLvtLDNasK0KuprBSwK177IGRrmQt6tn\nD9tZ/UcMtJXi4cebPx3ze3hMU6t2ncJgdQ+JGjkDtSAdxHxxbBscylfhm9rQ\nwDQ2IjlTCdcd1BC/GAP/89QvpQf8AYRTc6NfEthQnXeBLXqR/3ADxZo0Cg42\nuut8RZXw+ZWuW9Svr+8kGtxJEHG+MA40g43ioxLR2BYRGtGMGkF3YzF3IduJ\nOlMYiiJ7yoNn5ZcnvtplDDQbOOYIj/k9ZxUs+Ypp5Yur003fb/JR0FQju41w\nhlORZylYrP/9Hl3JULJOPe0DOAOd8AjTkVvpVrVL4lueI/sTUT8mXHt4bvA6\nQ8Lv\r\n=brxz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"71abf7a6aeace37012559fb972fd6e5fe620fa03","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.220","@balena/jellyfish-environment":"^2.3.35","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.4.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.41_1611803125548_0.46995496986946894","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.42-renovate-non-major-549df2a6b15748edd53973e116835c73a190b546":{"name":"@balena/jellyfish-metrics","version":"0.1.42-renovate-non-major-549df2a6b15748edd53973e116835c73a190b546","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.42-renovate-non-major-549df2a6b15748edd53973e116835c73a190b546","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5f19066961783d9001c8af46d4e2dfec59c8edff","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.42-renovate-non-major-549df2a6b15748edd53973e116835c73a190b546.tgz","fileCount":17,"integrity":"sha512-oC5sQdtHpZ5K1lILDp/U2XXDykXM3v6YEU32MBUtv8D+UWHpwuUlLY4I4Y1ocIkxmpLF1i2tfUKt+3/tejtuWg==","signatures":[{"sig":"MEUCIQDfWc4yDEZUqOsd1NfXhvVEavRkUhNDrMhiqT3HXoSTSwIgM6nQdgXTOu3ThjKeYj5hdVr6yICDKHyMmI2QreK9FWU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":104519,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEjxnCRA9TVsSAnZWagAAXBMP/jBRd4zOLK1CfoyndHhk\nEX31uhJWoAprD0ukZOz6XB+ByEoDF24lrKn54iIm/MuwxOeedcjBlvqbrDWC\ngJBYqEElWIEMqD7EA3/qoXC6cczdlxq7PgW5ZhsrVyU8wTLMc5XWUffRVDhM\nwhGDrmrhlUte9tV9AnpuAMfaTSj+cpHD8j1sgS9J5PvtLykYNR1PFSPFH0jE\ndQabalsGdEvb5THdq9ampcy5utYei0iBg9kZ/rrlYDsmCSoH7ztnhFdfdYJY\nohW0Ia0i828XnJe90tJUmEsqf8fryNdl7te5A44C3fzggGu5Yi/FQTdJK/KX\noO/N3GkCekiJ+f8AFwbTew/xYXDGaNgdh0oDzK6pFXxqSlg0TmIwejKyl809\nzEdGPyswKw/3wO+29+sL3ZBwTHHkGACHCooEm2M9P4lsDGDVpec0EbdK09Yb\nqxLtCl7M+yFxv3k+U7dkzO6fE+fRhuqct/0xU3vxeWl1SNZAVSafIiNtgVQ9\np6RyJ1Te3wkGVV+RJd94d1xbkOFu47Zw25a9QASMWuicywmx8hgQ0w02Cwfn\nuCZZkUcWF5hx/vwZ0qqd3kFm1fwzmoDYNuoArN5pq7pyvV37aCyk7ZB1Nmrf\n4w1YZ1O4U3ZaApaNgUzKlfCsS00EMf7t92B4GtdM6W5gys7ODFofGP8qIC7E\nFckN\r\n=80ax\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"549df2a6b15748edd53973e116835c73a190b546","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.221","@balena/jellyfish-environment":"^2.3.35","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.4.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.42-renovate-non-major-549df2a6b15748edd53973e116835c73a190b546_1611807847425_0.8785404429610586","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.42":{"name":"@balena/jellyfish-metrics","version":"0.1.42","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.42","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"95156467dcbbe9a7d365a8ddcf25f4970c49d089","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.42.tgz","fileCount":17,"integrity":"sha512-cDDTrP5FC87cPTDGUcFrz43c7JrwYYlvZj5m8PvTujtKxEKSMP5k1cXr50Nk9WSUKc1eKgaWXHDSOGK+CwtXCA==","signatures":[{"sig":"MEYCIQCMFrtwpc4A/NErIYrnZsiovnQ1PtUvHD1tAV2eUZ27UwIhAPbLhws0nSDtU1eGxZ9klLje+numfe2pYo5nS8aEPWx7","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":104459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEj0kCRA9TVsSAnZWagAAt2oP/0gWOvhGIlgTMSNHYE0a\nLA8jepWWeJCWWBhq+7N4PvXtwBP0xR3EqCi3wSvFjAQZHS3FStdkGbSmPw21\n24cFsgs+dymfkMQMz+WbswcL4DJysrimkS5IqztTwiv0f8/rKaX99mIoUHSh\nn0M6sDWonPN4VqAQIAz7PsC4z33htD7OYxVE70HKpKy3oLEVLqI67daxTpHv\neVeLCKCvagFG8eh35/KetstQaeq2sFGyOplU/tEqXUnsmez2vh91D5aMR4y9\njonBnvrWaHl0hB8TjXHIpI7qu7cvfVL+KMwfaJxq8B3SJGJxwwnel28kwAV2\nX2hwj3fNkLXqhOBLv9G0ejTe0mNyganHuhOJanQDWFji5EOu93+MCjQHz39r\nFkcbIEQiMyH3oeYl92cXELxUNRD3mU9PDJP9NHfxTDLmlyxoGpQTo2bl5NHO\npV+vQB8Y0i5bd/vs0dq+/TjYk32suBUxClVkw8wKs6YRKRhQmZLjeKL/7Yy1\nGuDjzGQSPzbJc1bd+eSHrhsgwlMkk+grAGIfjsgfxxw+Q5EEsDe+0mg/25CL\nKK3w+mN4q6JqN+/uvR/EC3BanuvDK+MtnSqXrjvrEiFOfmyBoqnpfyCxpa8L\nVs9ngRlLFUYVQooIioM1f36Qw1objsKyYxtdWAgnjRThePvRfZU3S0kCLess\nZHPd\r\n=Wocq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"1d0534f593b163c2a24504d8e092670517030bd5","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.221","@balena/jellyfish-environment":"^2.3.35","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.4.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.42_1611808035964_0.6424457536430643","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.43-renovate-non-major-4fc9adf8fa471fc8aa68b1c7c46d524b7d173d9b":{"name":"@balena/jellyfish-metrics","version":"0.1.43-renovate-non-major-4fc9adf8fa471fc8aa68b1c7c46d524b7d173d9b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.43-renovate-non-major-4fc9adf8fa471fc8aa68b1c7c46d524b7d173d9b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7e3d3f8f83ae9830f02746a03b53cb09dd8b1df9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.43-renovate-non-major-4fc9adf8fa471fc8aa68b1c7c46d524b7d173d9b.tgz","fileCount":17,"integrity":"sha512-kayH1EEGdwrCkUxcjbwmo6reqDKcQeDZjyyg4B1CfjmL/tDMs107a6B6M/xFyck6kZA3JQeATAwH77WBRNuVJw==","signatures":[{"sig":"MEYCIQC37UpzYI3ObwZI5kgWllOtbp4+CBPihL/2MVLwpATNWAIhAL1YB3OT9wYtRRfYQhekeyBo+YqmrRNih3GvXTzc/h4n","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":104626,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgFEYhCRA9TVsSAnZWagAAGe8QAI8i3WoMa7zoJkrQpBF3\nZ/bA00zCnSVoJRWx+8JNpOgkIruc9ZfC/y5guAGzvwFZe8kCjbRBTHuythcb\nikHFwhL958FdFXRQNNf9B+PMqb8ChnWPxXhmCOcJXQGlUtrMXopwwsU2Tj6t\nXJWb9xg/J2y/k0goSr0GYzvpI4nWYAtXMCM5djZgugqvebpIw8dVYxxbGZBh\nJBAm9lwMRg5Rt2pcbEtnGEzLFMOcN3zXTETk/GbUllOuXmtieIYRIJRHFTrG\npiUj4qJVH3QzkEPp3J6GKz2izH+voe8UzsiOfkkKYBfeh140sS6MTXjZoK3H\n1Ojg1+Div6QiCReXV+64y0fxfZZHtIyZEFtucWixMzw+LivOvwn5ic5bGSF/\nQGjs99Rm76RtP5WYFBKNMEJ8udy7maBn77U4NgMIGrWF++Ktw5CplxgZaZTd\ndpTZSKJuFKdaBgBIArfu9mMuq/FGf30lNl7eqKeYvXDWzBl7Adp2thtge8xG\nYs91qYbOvgrtf3KYbhTooUKYADByHwlyW4VJAg/UPwkVW0thWbYVWskCM9eP\nIRUpWzMqJlTCYvlsAdXB4++P5mamIPNWh9b7i3O7au/HNa8JTX2cr+1K5z5t\n/WyqsD0jHUXw8X3Kvf1PJCEq+89W28Zd7toOJXlcdyNDE9oW4kYbTbK7MPN7\nSyXT\r\n=8pH0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"4fc9adf8fa471fc8aa68b1c7c46d524b7d173d9b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.222","@balena/jellyfish-environment":"^2.3.35","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.4.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.43-renovate-non-major-4fc9adf8fa471fc8aa68b1c7c46d524b7d173d9b_1611941409135_0.5174654528089466","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.43":{"name":"@balena/jellyfish-metrics","version":"0.1.43","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.43","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4395a423e584209cdd04e9f3a9161229e61e20ea","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.43.tgz","fileCount":17,"integrity":"sha512-vu5WqTL6+f5gYuPPCUh7A9/QTAL84UGxf+qG6pDt/JAtAHz7IziKwEYNbqvPClMLvOELiomPuzabGFgpLYvIsg==","signatures":[{"sig":"MEUCIFs1dXW03ll6JHklvutorBa0wRizpKsHgh/KD/L3Y4pMAiEA/8M8+k8KvG6R1+fiBCEpvtxOQZaAJO0LreZFyXXA7no=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":104566,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgFEb2CRA9TVsSAnZWagAAj60P/imVaUOpepe0nUGzsvVR\njcGJlsXFG5PHE8yt6CKRov0oJCeUsa6SH52o5uUISwSe0v4q76YaKXGL+cnL\n4XzRZTtZsbAcaR3sflJhpv2cmzX21w4tekbfmadZv130OPt8PMeIK4iuXWHD\nugilTaCeHVE3n3Fqeb2Dj/3nNPYOfAKm3eP5L9LbShboYP61JBJK2RrK1nbl\n7pvx49UtlOI4wTgkCGbkl/OxiMWhQfYBOXSxEcnkoxGrpPzG1ZQXjbb+SqhF\nYIWXjkRs1gGNWyrOlcWYMMVm+/9BxrfurYLtBJj24fhOK/viy95vRML30bYI\nyNHExmPHNplqop4wkIw4YHbnxHOIV7C6eHItViqy59FbpF4j0Je3eKbK4/yi\nHnhPGD2mi9Lt4wEFqmZq4aUtl2bPLeWcTN1SshYCKViIbBopzPujdFvqSZV2\nsA/zQIsh5G6KH9WHxroFHbK7rwbFED1vFBvVlk6qKUdP0OYPJySrppe4n8KE\nUgrXw4SuCGCJvGvnYMyvwBCIn6FXOqBnKP74lnDH9xbd0ZbucpzQSC7sX/SS\nfbW2DFohByd4AOTe8+bjtEaAK/vB3F6bqlC3UcSoNmINYl32pgtMrCAVTykJ\nGKRpQ+8kVFezF0n4h+S2bRcfMzMyDkeqwQBqFERjDTAF0lf0aiy8hyWZ7oEA\nmVn/\r\n=4YwD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"24434d430e4c482549e566cecc29d5f22d58c7cd","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.222","@balena/jellyfish-environment":"^2.3.35","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.18.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.4.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.43_1611941621819_0.2547706491120345","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.44-renovate-non-major-5b2653ab8a7aa1e274aa7f4a1ad32143fad4f649":{"name":"@balena/jellyfish-metrics","version":"0.1.44-renovate-non-major-5b2653ab8a7aa1e274aa7f4a1ad32143fad4f649","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.44-renovate-non-major-5b2653ab8a7aa1e274aa7f4a1ad32143fad4f649","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f1a434f3059776805ed733425469bfd6d9d66758","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.44-renovate-non-major-5b2653ab8a7aa1e274aa7f4a1ad32143fad4f649.tgz","fileCount":17,"integrity":"sha512-pN65kbTKulhb7XlCu+0XWtg2fodpL1ECXve+mqwMQNKbweam8o6EBtG9zyegw0/GOlux/Iledpjt1nu+nhlf8A==","signatures":[{"sig":"MEUCICIm8/8tHFNEpovSb7x6MKEPXPafnxjVyrYB0oe0YP+mAiEAvZB6Budmj7baDxTPGURHVZH1LKS9ursxurEmZqROhU0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":104695,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgFkRqCRA9TVsSAnZWagAAuVIP/1ewNYAKuV54KJxQuPwY\nK9SALryPTU7/CypHcn2yQb0exvYS54qLW8jkDkjJq2RVw5IPXHKt7GHBsl6n\no8Yxn1A2nDfkPPOP8PEvpPaHJzcxxCFst3JAsVBBJ1lg0N1zb7B+u44F57pp\ntrSvhsH6D6cCuObQAoeS69HXhnwT3n4KQTQv5Cc0EMHF72NKXI/GE1DzeoKw\nCTNYemrTFx3teEuERnHvYEoi1hSI0eVYwUA1ZPqRT6Duud1qikTA0K+ePeTa\nKCtsEK3CKYhQlP8bDiQ5NQ9/WEVrQQMyTJkl3/TDDCYecTpdxQDoWQnyPSe+\nCczDppxLbGAvLEGxApmETpKc/NBX9glgj5FtphniEGQpETFrANqVSYcSpmEY\nd5G6hv/bRbN/0TWwRLbVusvKsX7xqgZAuPsotocwqnB9u0BF8FE+l6oz8OnZ\n78GNiUyh/vPnbhjZuxO74HxwgwrEVQw9sQJt5q7zso2pfrA0mZPPp6FF3ijO\nNj5Vb2iTs0BmZKipJVMVD9qyQFmlmVAFdIw8EdVFk/xOnmWQPKC9orMw+b+A\niw/OmpseKHfAHEVQlUg6RIFVfQ31Cf+IeKUthTAZShhnlswuhmDtIL7MGtMS\noOAZuetDgiGdZ5pSmehutDPjlb1CG64+cQVFpOJbQ60dSUM50MGiBaNm610B\nXxyS\r\n=467+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"5b2653ab8a7aa1e274aa7f4a1ad32143fad4f649","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.222","@balena/jellyfish-environment":"^2.3.36","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.4.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.44-renovate-non-major-5b2653ab8a7aa1e274aa7f4a1ad32143fad4f649_1612072041899_0.6242528988729146","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.44-renovate-non-major-f5cc2d08083d715edbc82f3f13a14a4dbacda9e9":{"name":"@balena/jellyfish-metrics","version":"0.1.44-renovate-non-major-f5cc2d08083d715edbc82f3f13a14a4dbacda9e9","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.44-renovate-non-major-f5cc2d08083d715edbc82f3f13a14a4dbacda9e9","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"de0e6ed1bb13a19d8a0d5eb2960b0e37144d50ee","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.44-renovate-non-major-f5cc2d08083d715edbc82f3f13a14a4dbacda9e9.tgz","fileCount":17,"integrity":"sha512-PgdgU5y1JnZRI1RI1VZCaTr0GQy2dWX1i0dH9rHXgrargWh9rNyRoHqLS/ZIxbNGzuC0nKUgf1eAIabNbLbSoA==","signatures":[{"sig":"MEUCIEpBCeKo92F9wokcAXXbmNZvuGy1ykWoz4xPs0CRBinhAiEAhVV3sQkqeXyfkm+QO1ZpD8waf0RVonRmLh1GQIAU1sM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":104695,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgFlevCRA9TVsSAnZWagAANh0P/0wdTUCcoMeLgwv9ZCge\n4qq0z8m286j9cVl5VQVFDtQAOKZ7UM/3nGz6k3l5mn68aGo15Rs6K0ZCnMtn\n/F7E4SacPZfj6VJeIU355nW+Vk5aysn2tCrk8XpqRlt5ejxHOiq2k5wx1rZ3\no3jqLVCNtc3lmQZ35ts4TvZ2zBTGs6qYgb+dZ+dJVgrZcEp9+iK5H2aLR3TV\nH+cptnq/BGBEZ50oPj3JvyDzP1aOd70idGlPfVEMbj+NKEHcanrycM4BrYxV\nsKaIdct3gsdKCXWo/bjlDG+TYyAoINhpzqlWnla/KaxP6tqXgbiffUssEZ5t\nE70Bjo/w4bC3Mlnljxpqz3P+kolWzq1VT5/0h/P73rrM5tGGJKIeTpMxVgnG\nuIMDYpX+FVnVoM/xrGOtfqFlxa3k7+XErLpoYS4mBzUDO9OC/anVH73iLUAI\nQ0HfZliWWgSmDX7aG40Z3NIwxEAYAdrqoc94PeDZSBLAOA6YOwg3Qh8OeQY+\nUG27mh0+2d2cliaDwucQwTE6OXzuC4iLEvccjHo9MHCCuD59QUL7HCH/9MAZ\nOZuJO8QefHt9jU/KIpP5euupQzlyC+nzg3vn8BYNXr/ysO8wBFGsdJA+X/A8\nhK8yZfRdURDXGpFTwvVFcPMsbqqtd2BUTDyocM7KcIZVIh4K0tA1vx1RT5EP\n+wmT\r\n=NnYt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"f5cc2d08083d715edbc82f3f13a14a4dbacda9e9","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.223","@balena/jellyfish-environment":"^2.3.36","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.4.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.44-renovate-non-major-f5cc2d08083d715edbc82f3f13a14a4dbacda9e9_1612076974889_0.15180018252307703","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.44":{"name":"@balena/jellyfish-metrics","version":"0.1.44","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.44","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0e77bd869ce4e1311d3ba091e6cc5c4d8cf7e0b7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.44.tgz","fileCount":17,"integrity":"sha512-3ZBv+2HjDiP7d1mA9b9VagG7gHKOssPK31qX02Yis00UyJhOza3sLIinM9O5P8yAP682EcucIcalaf0r/6UvKQ==","signatures":[{"sig":"MEUCIQCwhMrQHIvSbCEJ9lvdGf0UoFyQWh2dZJaLcj3PwSAeDgIgD52QanDJJvI6HDAE5wM6Xbvfipwba5ghzKzdxDQfKKk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":104635,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgFlhZCRA9TVsSAnZWagAAPIQP+wXgHqGdEAF5GCaa5OGx\njXt7HyT8j1d2FWBPq7Vmv70XgvbI7tguULWlstnXaR32c4uu6yO7WcgVbyY0\nT3FnVj0L76R7PIFr2qC5F6/4Tmi8+gYezLcsVc8N6NlZwJ0b7F3D2mwH1jRs\nnPQR/cVJWN5feAdQIg9MQm4OJRyHqSS+2GRjWZoIPu5WeG54rgjaRXzhxruz\nS6HyoXls4zGL2Dn+bT0c4PMEYNf6puXInRJA2w3DXYsv4DSkj6SfpeJHq5U1\nx1vIY4Kx0i5W+ZCcm5zaRgPo4Qz2yQzkMfYiyRQg4MD4tIx4abfAmpRv0B2u\nYGXOG6+5f0+1QUJTC2riZgoAhFBHgsl2g+O70OU/D43j4wI/8uElD6qv+7xZ\nnApOBQQXEWqtFyJ1nQQhBYEENIrZMWfPxtOAJw11xQDjwORhr7aIPq1AglkA\n70/eX6NzjtXVaTNjVN/6X+3kQGf37T4ox7hwYlIosNs6mXpOD+KNa5JceSVA\nReMw/OeGkBYRMgdS6bcgnXPbHgu6feAlv/LLdwlaNHRZWWh4qBmChm7BNf96\nWcB81dZMLdmkNLht2hVGjlEBPHEr+nWSkAgsdsvxywUQlkulIsFxsBZOBiZD\nBr0ZKLoWqqS0fLbkRbwzUqxfoHomkfY8ucAdYNLRhlgUHd9GiO/v7Cbd0tqB\nDffV\r\n=7Pnq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"49e3cc8bc5fdf300490f9ba2c3091df87d0acfde","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.223","@balena/jellyfish-environment":"^2.3.36","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.4.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.44_1612077145243_0.00381152988948541","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.45-renovate-non-major-a3151050283d19a4e346bb5a803aef968d9cc457":{"name":"@balena/jellyfish-metrics","version":"0.1.45-renovate-non-major-a3151050283d19a4e346bb5a803aef968d9cc457","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.45-renovate-non-major-a3151050283d19a4e346bb5a803aef968d9cc457","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1596b3fd496152e7ee139cfac57a103f22b88b27","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.45-renovate-non-major-a3151050283d19a4e346bb5a803aef968d9cc457.tgz","fileCount":17,"integrity":"sha512-GV6t1xx9j33Ae+U8P4puMlowMbJZYiMJoTPAl7EPjoIpbjgaUQgBbh0aJ878qixD3oY6/HmIuomRwIDJmlkvLw==","signatures":[{"sig":"MEUCIEQwbUJ5m0WE1N99mhcEPv5aJzHVWJFkT7v8Sv64ZlC0AiEAgBbGvyn7eTxCHif9oXzkE89O1y6XyQlZTpjgHwMI7k4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":104796,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgFokWCRA9TVsSAnZWagAAjrkP+QC20Z5geCdaE+PivU0h\n+gjqTjB7cBR9DGC1jjP5CsTQnftfh5izqTLwWmLHfhTgv9lYqLss16sUbnKu\nus1mDwBP0K4sWZS5+KOogVBqaFc95COOxrkhVOXm1R5qNRYR/ilSvIl+7voR\nyQaxhF8qyzybU7n+MigtC7gcFWnIPVogwf5eLkKGHPW/Vt48wBSYCj+dFN81\nKQSAsvwIaCMMMxaXY1TDQF3Mgsj2MtMJZ6OHYG+VKHU6n0b6ct+5zQ1P3C2Q\nqNw8MnmDg7e3UjDXZje1ocuLmt+TZQYSDHT5XZI3Gelf8MDSr+vAUz9F77zf\nTgVT8EutOsrZj1Te22Hj5+0cFJtIUqqjwNHo2uAXhGaTy92LMxZI/H/qlTHD\nhA9io1bOss7G/kczYT52juMZU44BpKgcImXsDtriL49ewuX1M6bDaheF2u0I\nijRspoZ+wrk1pWftr37R4jiPkUqJ2+x5NV6Ct8UodUK+9BIlRvkw37yBwCM3\nAzs0xxtrOSfdQea6wLqQs4jSJBNo83ckkoAIeSiUteiG5N0Ec14IDr18s3k/\nop9IOTQV+7Wrn52B+S6tMRKcSTJuOujqpwy/lU2/XpB+k7Ab62v/a1+jsMBr\nQnqgwCtTvS80zQL78vU99ZRMMCwQByzYZrUZ2vqJxDpr/wMxaBSWHl45i0vO\nLtXc\r\n=Cg77\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"a3151050283d19a4e346bb5a803aef968d9cc457","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.223","@balena/jellyfish-environment":"^2.3.36","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.5.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.45-renovate-non-major-a3151050283d19a4e346bb5a803aef968d9cc457_1612089621587_0.6355494273751323","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.45-renovate-non-major-874f73342a764647d90834776f083a65774d161b":{"name":"@balena/jellyfish-metrics","version":"0.1.45-renovate-non-major-874f73342a764647d90834776f083a65774d161b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.45-renovate-non-major-874f73342a764647d90834776f083a65774d161b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4f9dbe502d10157f67e2d16dd01b73fb7938210d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.45-renovate-non-major-874f73342a764647d90834776f083a65774d161b.tgz","fileCount":17,"integrity":"sha512-6t4RCtf1MTIYdEw4A/aDHdTtDV9iVA6DHjQEjvM4boGaQ/WL7hB5DoBL2YrH0lqIm7d3X3lrLBr9XePLMSHySw==","signatures":[{"sig":"MEUCIA4NLE/8UxgSLRv5aztFuZbFsSbBRscW0OhFmSIX1A4LAiEA/V6DHJ9CVmS24mw2svP0TjWk0G/pcEtRZGQSL7pV7tc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":104764,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgFpeACRA9TVsSAnZWagAAM6EP/2GerDJHIlG4DftgaWIC\nhgjzShDYXODUBi+YAcLocPMnpfmRO87xmqqYBi+PYJSthuXCxp7/+/gVO1jJ\nR9hsyvhcGgB5ERjbF9F4sFuTZe+9LofjhVbBlp1xq+11jbf3jb/13h6iE++G\n9Y+3Hc29O6kLSxuJpXjeQ7J+sniYbsK2249gVNa6s99DLcURgAhAdUh7qAiW\nbaJDxiioVpXYu/AoTfdEBrdl4710Ln0wKS/DtkYyNWwQ0OQeYuF5C0MXpH0C\npyWi9CwTqt7IplJLVBZZQuLMprIQlxHX7znnF0wsyILkmEhbKlR/w63lyJL1\neYSDLxjeMA0/w8KE8579aKLQD7VVYz1diVtN7H5qLqRHbPJkdOKsLJIBv+Fo\nPjcp/m0ZT88b28SOplpTMrj1O3cSpsz5j7Ct8WYKgjVgTVbLtpGoP7f08x2Z\nPQbsvNOq3Q3FZ4vkMG734p4fjssBa7UJDnYqiH6kG3itjxXXdStEfeS3IkW4\n5vYwjdbHZr1s4ZNr2lPC1TnZC3c2Gp8nl20+zSVMOf8AEc5SGjyhKNKa1jBo\nfLK4DsdlRkmupEqoQ6f9soJX99SykRawpeMsC544IbqJ27J3H7j/N+boHSDM\nZJE3usPKRpSUzU5Hwon/XjfPhGsViA15cCLaAWrpNlRQuvUdBB47hJ7u5hh+\nHCCO\r\n=TlTI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"874f73342a764647d90834776f083a65774d161b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.224","@balena/jellyfish-environment":"^2.3.37","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.5.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.45-renovate-non-major-874f73342a764647d90834776f083a65774d161b_1612093312423_0.2306563147854186","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.45":{"name":"@balena/jellyfish-metrics","version":"0.1.45","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.45","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"976f7b3ed18ae55ba8d044a47af21271bd6d1e97","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.45.tgz","fileCount":17,"integrity":"sha512-l9WucS74LlytB1cjPwDEN9iDqMuT21pD2Pev79D/8SN7/fTB7Q0mkTcDn8HWSw+TSkIeP2Vvr6PsUaSDk3ViFA==","signatures":[{"sig":"MEUCIQCsP8uTRt4QBaIeDB+9M/SpY70LFcEBHjyGPz+cOo8pJgIgESpSAy7x6apvny0Yx0+2fp3RN6j1IaCmJf6Dgnfs2g4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":104704,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgFpgxCRA9TVsSAnZWagAA/3QP/RVhClvOypkTGlJsAbG0\nJngN+T6gDEeyngq2pwgZdWRFuL41qxPz8gPQyVPHMITFapOvAuZG1rLXXXJ9\noaGTRW68TbKA/mYyEMevdtfKO13BBPKf83jeWH+8Lww9jd/If6cSWJixKbAp\nL+LdcFOXDcnfFuMfqTkEi1BfVFMprjMdW1o2TFbgLXrIBjmH2NeQJ1fzBT/0\n2VIq+LgFZI4nDUhq9x2kzbVUqFBo6b7rwBrh01UfVu7yv/RQdfPVsVxQzVCY\nM7wR1vVKHf8BLQhifBQnat5cR3bJc/w8CZ2EIQYoLZkzHOWYrlbz63fIt5MN\n5y8CbVVpo6jin6vdxXhWDwuy1BzoXLjI7QvNxtFpRJINepXa1PIWIc3gRPqc\n118kUuB5mSYmQ/oLtjBGgjTRC2ABMoDLamZWAqNuS1cLdLa2oOTBYH3HjLgR\nN95sVE6Q5hEN26tdBEes7amGxkRRkTFagt8NUolkL0+b4C6ufk0Ff9I9Z6If\nd8FOaapgYPTSJgxJXDSc+YYM6LnpPbb8PRZGYKyUEbau/hPX6z4gO8JHDKYT\n96rAaoq1gCXabM1hFCvek+6kSv7SRzIdu4qVDKaRhbSAQkdxajmBCWl77FNj\nFaLbi3CPiIhaSFMVY4/yqKankoF2BkmoNK4G184aWhwqhPWIcooUokv0TNga\nEAH1\r\n=28dL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"61db2219c427ef3ee057df2a70d49435dccc6abc","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.224","@balena/jellyfish-environment":"^2.3.37","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.5.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.45_1612093489043_0.2597134624513382","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.46-renovate-non-major-5d9205cc2ade4d21d9a03f6b90d7a586f5289e33":{"name":"@balena/jellyfish-metrics","version":"0.1.46-renovate-non-major-5d9205cc2ade4d21d9a03f6b90d7a586f5289e33","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.46-renovate-non-major-5d9205cc2ade4d21d9a03f6b90d7a586f5289e33","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ec6afb483b86f7ce48d14bba2f1a572c5dfa91dc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.46-renovate-non-major-5d9205cc2ade4d21d9a03f6b90d7a586f5289e33.tgz","fileCount":17,"integrity":"sha512-3V4oFWOi/W4g5JW7/wS2jWSoigp3wBaEh6fu2AFJt2mtWhk7bZWSkcep12ih2lVsy4CzdR1nGK4X7uyHChB1yQ==","signatures":[{"sig":"MEYCIQCx4dUdVoDZUfBnNHU6jAb73pHZmeEYjt89vHpmdhAI7gIhAIDqHBg+3yCO/sg1aMMavoTolDG1gzUsbEN4CSmWDzhg","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":104833,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgFuVECRA9TVsSAnZWagAAVjQP/j1/fWMgAJvznhyXIp18\nNfdRg7ZGIyuudMMHeTRVU0dHMeYEkZFwryVmC/zW8KOhtfgqnF8cSCke+HIh\nhTazjKV0aXjAmC+/mYD902RrVNmLl5Ky4y9kadW5/khEunX46IgYvLSPtn7s\nNuJ4engwiGQvX5WuCBQO64Vzz00Ro8wWb0hnQidlBYWMJLl17ynZW34qH6jP\nsIahVqc9TvFBWjeEizQxHmkVfaX0ysDYkt5htAFK7BpHBy/eawp2b8NYVI97\nT2ju0NjtQTLHn8QJPPv0FqK+tXshugx8oSD/Skz+xxa9tVS7wSd2yUYKB1Ow\n8M5Cu5vEThVUXo9wOuOkSLid2ys8DUUh7UdEZ3ySaZup4USJ91dv/xgvz788\n0pu/EAX83jOH1cXGprHjSvwlLv4nQpL8zWSSJIdbf/XizF44H3nXnYPsJj5C\noc2zd7PyANJ6/pYe4ugHccH9yLL15Sd+C5B/EZWlpNUIUJaiveaG0Rc0V5Be\niD51KMRtxl2h+/SIenBAS2+hGAIQ5eBMmR/O9l24M1wRRA1eV/krDvm9bHCQ\nmUsWOYuqZ5PryWYWa2TLRcdi6Eq12KxGz9wGnjh4Bj9oZ7eNesyR36VQJXtI\nzi9B8cLj8f82wZx+ij8r+XwO396sbIpAuH5wDpdcnGD5IVuwoK1NHUTcoKSf\nw4JC\r\n=AaCl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"5d9205cc2ade4d21d9a03f6b90d7a586f5289e33","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.224","@balena/jellyfish-environment":"^2.3.38","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.46-renovate-non-major-5d9205cc2ade4d21d9a03f6b90d7a586f5289e33_1612113220283_0.3253330373057528","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.46":{"name":"@balena/jellyfish-metrics","version":"0.1.46","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.46","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"10eaf9f4501219733b08c0c620b318fdde324278","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.46.tgz","fileCount":17,"integrity":"sha512-EYWNW+v1PAKjFBfBC7s8la6V3D0JyzcWs88QPsNoO+ncx6Ka9K138cOnSlhSbNvqVvgBlSUYNnevHcUFcpA0AA==","signatures":[{"sig":"MEUCIExrrPYuP9uzW3OEy4RpqTYCwcNO4/xzekLG4cG6IR6dAiEAuEG6/68NVMWwdLCQ7cCsrcmHQ34w079TYUfxCKcqlUc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":104773,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgFuYCCRA9TVsSAnZWagAANRQP/RttGnnwzC7YPCFFzTwQ\n+WP//PjsnoaVnm1NfmwDJkOwWmE3HgyOosrz9etmcRmBJEKFuaPRdTf8JIUp\nS6wllea9pyMbZiVaKI6kM7mX409OZhrQ1cu9x6INVJqf5qCdCTdSHeHUq6kY\nMl6yZPeUUWvYxflXj/ugJcBLJa92PJvdNCn3tsDWiHVGySbuq2PJ0ndEBxWZ\nUaz9BpFuSck9+Ua/NJTAZ3R3yGap5kx3MeFvtu44tcy/M8Np1/2nnOw6S9Tb\n3OhpTFQXXL04GWjzWSHV2cqThT0JBnERBWzLNGj6heNoFZ6t+WM3toBlXLod\nOjFwidO3i77td6wCmFUgNSCzxCbq9ETEJDla1hRg3a76HrzSewmTTMwy0YZQ\nSl0Je+9caIAE3SLfA3uu1C4UpHOjx1eWMGRhj4P1aa/TRBIv0briLlw8rcnm\nS/vqIwcOmoKjYf2uySPfeYAMtp4+dRkFKXZIeqkmcZg+WTmTte0NfRNU1s9F\nK089Fp7NvySdyad6cpsTDOG616Jj/MZZ1FVCQ7LKe18xd4Y7tGtGNbTWwqai\nQIUDtaODWx2IFAnttwlbH0YrUHdoTp66qqKvP53jhFukqDH27U5v4VQZcRQj\nUDN8IPhJZ1SxBQYMPNSRTPASgRLuTXDZVf1zz/buO1eJ3/fo4u3vkAW+o/mo\nnSCe\r\n=7X5W\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"d2275e00bb5a537116e40f549507a71a0676b38b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.224","@balena/jellyfish-environment":"^2.3.38","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.46_1612113410015_0.30524612220848635","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.47-renovate-non-major-ffc492c09a3b83f7f4a454923424ce5218736971":{"name":"@balena/jellyfish-metrics","version":"0.1.47-renovate-non-major-ffc492c09a3b83f7f4a454923424ce5218736971","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.47-renovate-non-major-ffc492c09a3b83f7f4a454923424ce5218736971","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bc460d42686b3d85d11f2d46d77d3af933bfe547","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.47-renovate-non-major-ffc492c09a3b83f7f4a454923424ce5218736971.tgz","fileCount":17,"integrity":"sha512-q9mKn5LVhq/RRHywga8MuuhTNENsMM0IpaxDIY07BHgxSlYPDu+GYUrDo0bYtue5Fc+LDLMHpw6h3T3cTuj7sw==","signatures":[{"sig":"MEQCIHvOWmfyl1nU/QXX1N8dFXPPNt5opjlo83d1phoWjvXyAiBvaWcYgLR4do9lPF/36tWJ8lynsQ9yjDG8wwuBFD2vqw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":104940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgFvxXCRA9TVsSAnZWagAAAiwP/3T1snxoFPbopuSP4u5S\nZ49e1MR7t31GviNQmA4pDNZ9ie43lDtOBSF+S4LVnWTohmHg+VelWsJOIgrv\nXdk2Mh3IatpziV7iA4qq70QYW3GE/znmnjUKm4MUylc+GaneNIAs3yr+mcVP\nsDRMn6A3KqcSqH8Er4fhjFjwTmgoAQs/5aN0UbL8OS+Oz6sawmGcJ8o4aH+O\n1+LF271JhNJfhsDLMOqYVpvGKFNAmVjOft1RkpVcOhE+1eCkF4x+EMYnllok\n2MYzlIe7VGqIjKV66uDy2iYSVgtPhH6d+alf1CJNf+rfHue+WGeZ/DZvBiSj\nKbZiz3sMWYn303pxxq5/7fwRxbMj0F/Ki1bi3joL8JgJYUk4O4qIysGHpF4F\nRvNaFOrIu7VG+raS9VfWUjccW9FHuIKo4+dY6rGSzF3pMSUn9vXzw+K80168\nWOzehwJMT3jUDNFhYl3Q+lOf552QGRKN/fJzsAGiQoBnzOFSIMvU9VTRjHhd\n5It0lEY2qOmvx8n3409Z6m9iAiSygPXk6G+k972nM++krnzEN4+1+zXyIwcN\nkHWsiBYIi2KlUiDtb5nIm54IelSvoT21/gPkko9k2yYH7z1kShez01JFfcmQ\nSVZs5i/BQvizemNL1kmdXeMe+tdT4vehpAJnntxHxCB3OSxsw+/1pjeJeSQS\nQPgF\r\n=OP5u\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"ffc492c09a3b83f7f4a454923424ce5218736971","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.225","@balena/jellyfish-environment":"^2.3.38","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.47-renovate-non-major-ffc492c09a3b83f7f4a454923424ce5218736971_1612119127239_0.33363225700846644","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.47":{"name":"@balena/jellyfish-metrics","version":"0.1.47","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.47","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3bc2460879f15f604047ff5d76707c10ead43492","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.47.tgz","fileCount":17,"integrity":"sha512-7q6vEWaUH3OvB2d5mQfX2e0P3Yua7WjFRAT/EhuyyBOKb4IOJo7LhNd9zpSte9R3mMN0IAh4ftHyOGoZGTOTWw==","signatures":[{"sig":"MEUCIQCPhKDIqJwEsCGo1xc0Dw3dP+rl5TE5716hgnV5+VQFIAIgf0REYwZbQTY2F8JEAWpV0DHcYF3qulStC/xIgKdii/A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":104880,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgFv0GCRA9TVsSAnZWagAAyZAP/3tLIwYubC6ceQSNtiOb\n8UvRc35vqviy0rG1/fSJHjrogSHLChA0JXCzex65bQp0SixIm/+ULLemBWih\nvkxdKnarnEtXLjOPXPO2jkr59sVcJxShY//44GkjAmEy1EKX21hBjfEghSUJ\nhHmUkepaHq2BvbKsCUdM/REyNszDV73+KUnaNxqAmSHTsyd/Si6wLqkpPsym\nWaYahrs5B+LrRnMV/8zRHqgqbL35Xnpw60N05YV5pISIzAsZUGNVFUWa/yMM\n2cDgY887i1kPLXmOwPsSy2bCPdcRO5wEJ8VdOOGYA24G1pRPruwy/+qPGN2/\necTeAIdDR8knD38sSmYu41nZMuGNUjzrcYlbqaeNQIV39GFvaiZUqWLLfXqb\nJfjoeqbeauzMfeVCXmdnMThksQ4cBuCAqiEJk6CJU20pjuh6E+TuPXSQYdYb\n7GQGUKNXGfUYnf/3BRRP4Zj+n9A3FUuQFw2DIShrB0hEyeSnWgfWAdYv5/bw\n6+clnnAyBTPQvKXJf9jr2ABiFwKW5usXDQvKsFdYM3Y3bX3LnyjHUqxI4Zuo\n+hXnU9cqXeXxtvfxz3uIjnNAPn+WSyccxl6T4JdUKycQqNhrr5uUvCU4GYwQ\nn76U8/Qw/5qc/VnvYCpI11o2kE+kT6EVZrXAmxT8E2Vj64VpzDRmKIn/h7zb\n+Luq\r\n=a/03\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"a2cd71152bd7c7fee3155e8cde8cee5eb22591fd","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.225","@balena/jellyfish-environment":"^2.3.38","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.2","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.47_1612119301934_0.021956992680802978","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.48-renovate-non-major-6e46ab9539269c9cc298929fac494127c9ff287d":{"name":"@balena/jellyfish-metrics","version":"0.1.48-renovate-non-major-6e46ab9539269c9cc298929fac494127c9ff287d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.48-renovate-non-major-6e46ab9539269c9cc298929fac494127c9ff287d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e56339b681b39c54416d1876d881ba46b012943d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.48-renovate-non-major-6e46ab9539269c9cc298929fac494127c9ff287d.tgz","fileCount":17,"integrity":"sha512-v/r2ItO6eewPVg9sRwoP8BNpXZ7xZlrpb42zPMSrNObcLsSOi/w4ANEIZkEBMo4L1Geni7chemXqf18fXgjyjA==","signatures":[{"sig":"MEUCIQDx0r2+SSSFSXU1AJ0VVBcb3zXV8a/3g+A1KuBa+c1+iwIgJo+JLnAbEbomrH+X5mmyMDznuG7vNt8W8Cf6hA9GXBM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":105028,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGBkeCRA9TVsSAnZWagAA4/IP/3AF6VHUSN8Y1W8M6MTB\nZb1YFNdSWOngEuO9HvXboE8RtYIWbJbNotAKniWPyrIeo+G1QxFHAhuMr27U\ngrNhaxWrcjayU8rK8/jVvC6eIdV2rLoUArofJzoi920haqHzsGU7Gom/b6/c\nbcsZ8bau8m1oiaMhqtesNR3pkMP+hk6jcrJZIFKyv46dHX6tevcfUsrw8Nww\nW3wcN9Bxrz3AG+djeI93ROgmNMhmGYz987GIc1ynWeGJ8cQLepj3xdSCVRFi\nhwBY7xnKS05/rSoU7QT3tRKt+6BpNbY1XdOMcELwVFzRKOjJWc+c85xbaUTu\nhGwYSaGZV/8k6x344jEkGDzZPlI74VCHzexg2Zk1IjdTnuJZoiyrUuk64ZYb\neV/XK1NpuCcGDKeLO4TRbzFia9auB4q2uc4eJmWQTb1KpWYZB8Ey8CNfz14u\n1jknI8xiGARg4B7YH3eVt89YlwWHNYWN5GThAHBtR3BNDZ3cDhE38N2ToyzD\nBjIwki2+ZpkNSqM8UqrWPrC1bLTzJ/4Yla9lFWBlu8gm/g8nNxlh0MBRWh4H\nyc4wYJI9m+jVEgnqyceRqBqkFgvTqeSjug4atHoq/neFFsUnKJlxhy+QbLUw\nK4wsCqnF8WyUgwxiCym0Gl0QFho2ko84hXv7YYwrWUBEs+T+rH6k6Z46rAS8\n3TZZ\r\n=h4FQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"6e46ab9539269c9cc298929fac494127c9ff287d","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.225","@balena/jellyfish-environment":"^2.3.38","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.48-renovate-non-major-6e46ab9539269c9cc298929fac494127c9ff287d_1612192029971_0.7739800929745113","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.48":{"name":"@balena/jellyfish-metrics","version":"0.1.48","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.48","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fb92a1e5fe55c7fdea306d6d4488caf5b04f354f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.48.tgz","fileCount":17,"integrity":"sha512-2XmfNXRBdyl1Iq5Of+KlrFX2GJbvasq1ys6KBzDf+z9DZ1qo2Vbk4J3+5Hs5NMGwKxSfD8yec1AFgnAJkCgutg==","signatures":[{"sig":"MEYCIQCyCKjk6ks8XxFOctIA7TDbNbGC9LMwD/sPw1sLHmkeTgIhAPhDV88gd/OL1KQ258TUfkwOvQAHhr0bc21FeGbbcjpk","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":104968,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGBnCCRA9TVsSAnZWagAA8eUQAJ/6um0kJZFjcSPrKd15\ns6nSJT9spIMiVCfSL6FvDAKk6sAtVl3Z50YEbg0kBCLOkGb3s5AFzQ8hc3u4\nrKrpvOHvNsARjPdokTqnGDLYVahh8wR3XYGuE9o7/B7YesYR0hEGJPUwQLPU\nPsUO7aLD+2NytcjWQf+U+8xf4RhISP+Xq/v3kmc9J2PNhoj61dh3VK+RS11l\nXw/3oxXsaDkkdX53N79tS+DzNDaxVEZq6TqHqxXFPUZ/PUN2vDGNcVoK8vts\nBUNRVtLrol3C5C/agLSik9hNR4p8fP3yovBfQ13UffBIxx//vpeQaprpouZC\nr+ROIQo23MVbP/gHtHbyV4JyYm4lQ38O0+LjY07QBLOSKnmf7ENG5CxJxP7+\n130+p0yzay5p3ScemOBIMWrmoHUibHxOBB1USV5asB93P8dznJkTScpMpPDV\nQRfSqSOa/hjNqc0FT3iCopdU/RmUO0MXEebaoQDOJEyYXU2tRVOPsx10r120\nAaRg/klnE+UlcMJM9MzLpU02Eai3NujjTFnL8WrjJU92VgDtIFiUuJmLDZvc\ntpX0/JSyMEIlITcd7lJTpT7Pit+yfBgR4r+8MAGTjaDhSZwiZgRKB7psuJvd\nYrM9+pfoSgSRW6QrUHvvpW/Gst9mewf+MpRsCEYutT7Ha6lurF5AOU+rCSRV\ndF9P\r\n=De2Z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"d95c557a91dc9637d526706b0c5230405b558324","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.225","@balena/jellyfish-environment":"^2.3.38","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.48_1612192193653_0.30299737645961944","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.49-renovate-non-major-7e170cd2a879e0e4a387dcaa8bb3f8fa292a403b":{"name":"@balena/jellyfish-metrics","version":"0.1.49-renovate-non-major-7e170cd2a879e0e4a387dcaa8bb3f8fa292a403b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.49-renovate-non-major-7e170cd2a879e0e4a387dcaa8bb3f8fa292a403b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1ee0bf6695c9eb4a196c276797e82c8fbb20da0a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.49-renovate-non-major-7e170cd2a879e0e4a387dcaa8bb3f8fa292a403b.tgz","fileCount":17,"integrity":"sha512-VXpxiZtDTjZipuQVq4HEtWsQ7zHqvWQ6/xgbBELUC0fT017MOD6q4nbOS0Xdq7O05C0lzGFdmZL0WHvO2Bn1OQ==","signatures":[{"sig":"MEYCIQDjxJ7e4aIyj0EdHJQsfR/QjrALSZ2fCmfIkkKA4U6sagIhANTnd9Vl9atbzGuVFiEGZYtOYVDDAPdzx9w5vyNGSAd1","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":105097,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGCpjCRA9TVsSAnZWagAANZgP/iIFV00Lc1B1JXXQZjIz\n2CS50VfkHnAwFq/5t9Cgo4v80nfQaCudobwWiYJJT1LzwwnjCRBdm8yzNvC4\ntRIaet7FIGhivzS+NzQQ4mB5No+IlQFr2kd+N1nkTVTchPq3OYbtJPN0LzF5\nF4U6FkXF+Foq+2+getHGwB8hlWS6b9cXlrvzyOaWBgbTfYviVcXczZyg5+/7\n7/vX9aTCqIBLMRYtn9zLSdjcGdmMydSIE6bmFtqUGpKaeAPN+rbLEhr3cXbf\npUUVie4lbFprjB1vAKlEM0WjjQzmfFrSihJibxVvdMam9kD1PANaZuYgATM5\nQyYtufqDSj4/XOPP3/rcmJriOfpqQoqtCnUk9Ro+7RYEfAF8ex06S/CFuMEj\nDtC1d8ZBtS4vNUcEYtkKuuwhE+DnR8q50QNLYHBrqZ8hzuzPh1BY784ZLYEk\nLFlS1RlNDEllU3lSgiWTT1JyvOqp4SvTsgenHTIpMDSE6KTgvf7cexdPLq0u\nxK5ipzwVm+u/v7BgpkH9i1uGL1tC+oCTpRte5HLcyYW6C5saMwjMCXVyG6ZO\noGn1eDnfmzBBvmt7iCKoInlbAG+qYvs9mOaEeBMps6gV7O27PWPkPxhlPiJy\nR807ZFHglVPkzoJ4/flwcqY6Vvp1epLr9GuhpEQp0HAjFDZKf/lkmoVLwkCb\nXUM7\r\n=YeGC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"7e170cd2a879e0e4a387dcaa8bb3f8fa292a403b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.226","@balena/jellyfish-environment":"^2.3.39","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.49-renovate-non-major-7e170cd2a879e0e4a387dcaa8bb3f8fa292a403b_1612196451329_0.7549834533800033","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.49":{"name":"@balena/jellyfish-metrics","version":"0.1.49","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.49","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bd4e2c2e8e3e7b3243cb27ad3971663c3b2d762c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.49.tgz","fileCount":17,"integrity":"sha512-erPvvW1+FjvcqHBqtbiv0XH3WiPidMB2AbwX0YQJUBYqDrjdF85St4L1+zuJ1Abi6kJo+pMywtGob+hXANWJhg==","signatures":[{"sig":"MEYCIQCbqGoJO1EFQaL7g5DjpG2VVy7aF8R1oFfc4Iuiok8PEgIhAKXHHBgQsBE7gIlCfPchf5S3WJ9OWF/EEKR+0YqNqrkU","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":105037,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGCsPCRA9TVsSAnZWagAAnoAP/0HFvo/13Exlf7CUpW4o\npAIzPLYQ2ifvkgF+eIJq0RUSnpy8k4hKxxG8Dwr1Jlxrbm2xvaj6PD4gg9Lh\n/XfNTaYkNsgkWULvDjElrEuL64co25hu0oi9nolQICUK6UrZzdTmItLyvKRR\nAB6YQ9quOxCCQWJPoq247eYvs6HjhUtzuN/Mck8qQ8RgJBFRuJIn4N0PhZo8\nJRJBYnRSOkGQpVzcRG2vAsrXJMkRSfbKdL9MBILryLtaTYAbh3FrloYMN6MA\nEitGbT8MVtOh1SjzPu6LNwxLb8GjD/U7i3fYU+6REMG4outZctIxupexaSxC\nW+dFAGm2oetqFB/EvRoVf4tMusY+/8Lm+CbZrNDYhVnVnbWRzRolzfkjrVeQ\ng7K8BWIyVb7i9QEzSeTNXRy/jn5kgQzQ/KcR82x0jbdofj1taIzG3cyyduL9\nmFRpEvk3v6b1WAvJ1jwo0D3oF115egoYvNhQ39Np51dbCDoLdIyIYY7wKoOy\ns9bkQMfOE8MwxGdhH9ckQg8ldFpz0L3mDR+X6xamzT90am8PKQWR8aMAjsxD\nhbGerwVL6QVDPRCluEbw4J6AimUjhKDRUOXehejDj7ijGt6IxX0ks+wOQd/c\nAMn3Dwts4O/lcyo+WwriieN7ZEr42JhLg9wDLU2qwvjgJxYXECntEue+HwRw\nYs6O\r\n=9R5U\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"23c54ce73f7d4bbe516fa6d7f396a64be610458f","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.226","@balena/jellyfish-environment":"^2.3.39","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.49_1612196622605_0.43479555536814773","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.50-renovate-non-major-cb4685e582a3b536c55cb84fc56fd92741fd4117":{"name":"@balena/jellyfish-metrics","version":"0.1.50-renovate-non-major-cb4685e582a3b536c55cb84fc56fd92741fd4117","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.50-renovate-non-major-cb4685e582a3b536c55cb84fc56fd92741fd4117","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9649dacac09dd520ad8e958c51efa996684f6b60","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.50-renovate-non-major-cb4685e582a3b536c55cb84fc56fd92741fd4117.tgz","fileCount":17,"integrity":"sha512-br31i5WgzsirUrUPc45WljZfd2ftNp6lucdNoijOA439wolxZz18qTq9ewPCwLWWJV7SvEn3W9HPRsFt7SnG6g==","signatures":[{"sig":"MEUCIQC77cxv3Lofr4pIq+sl7L2DKG7qWdAvJqngElVwwQ3KmgIgb4zXhcMGtBKZjK/7dpXuikGeQEfSr9RsC6p9o7yqzg4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":105204,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGDtmCRA9TVsSAnZWagAA76oP/1XcsKJVTr3QuPM/NGLR\nNilLqbncg/UcPDzbvc2xY+oZ7EcMdrAn8l+7AGlQpfHmzDl4BO0lZSGJ9VCI\nVMhCX3kkapVYPfXpJemaO/V+WSv9mmptsxnZOw5bzX3/rZZvwsJFB2ZkatSu\nn/IN9EYnIODPEEUXMN29v9qN2gHshbrmtjkrljh+TrCCXILbEn8UR0AP560X\n9I4rc3v/ZH/UYUO0m1LAbmt20RGE9KWTRPANN5b6ifvOIqhl0/qtYt5DZmaZ\niYCeAPBI62CGAbuiqKoaHprkxlDx+4Hzp/7inB2xvChCZeQcFLLORMBKnyRh\nQIK5JiogE3Fku6fOVghLRr41XCKMGplnBsykYS4sEw6baPnTm30zeSA8U1TQ\nQQHpd9U3aKTTS+23Jx5yB17XfhdejzXT9JvtQqTXnewilwiKP8yrlGoMTums\ntBfYlrkGJ7xFu0LnPxZu3gdGnHhig86NfYNq5nxvm7advKcx+GkE+kQM5JQC\n7niXAlWURbxru4/Xg2nA8mjVvOFPz+p9P+NtdFwg/1sV2anOu3VFTog547z+\nuWAhg39sEBgLkQcL7nn5lL7MELGruEBuH8ppj8JMKXpAB8AV0ZsYrrlKV9XN\nUfI0GWOAAa9z3ckFG/XCXziQ6xKscq42Ds0YMH/pUagbsvB6UmDFDAZZo1qG\nHCWe\r\n=uxa4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"cb4685e582a3b536c55cb84fc56fd92741fd4117","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.227","@balena/jellyfish-environment":"^2.3.39","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.50-renovate-non-major-cb4685e582a3b536c55cb84fc56fd92741fd4117_1612200805723_0.38406252473555513","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.50":{"name":"@balena/jellyfish-metrics","version":"0.1.50","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.50","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"88a23ffeae7ed52b6f6d10462fe8641a3f483a1e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.50.tgz","fileCount":17,"integrity":"sha512-X1I4+212U3Vqjt2S4NnCMvjYZLzdLQB8GmgworLPFp+faYpLdshRTyz6ifHmBCCdBndgFqdSTDOwCS+znlJ9KQ==","signatures":[{"sig":"MEYCIQDV1WrgD3f9QLqibF05IJwKcFble44/iYGXOOmXNp8shwIhANmUPUjezkMCzOvSiUPDgyIx1dGQ81iVF6IA3PHMN8YA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":105144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGDwaCRA9TVsSAnZWagAAO1kP/3Mxw1aQDxsNjx6hzCwV\nkPHs/jvDuIpFRohLE5UW8F3oNP0Y3+BHXLDczfutKpHPY/FF1Y2phufhJT9t\n7RXhUbbSEgeKJutAjbr3qpjGBBAQwHqPb5WQYdTXobY8UyzwpjNFlhAlglnQ\ndLmDRln+5rzBN+ZuCTsrprm0HinByBB4iwOY1bHghyOXGFSYfT8g60r+5HNK\nSQodX3NOPiBoAXS9cKYTMP2VgzmgZfeWIn8AapRSl0sIM7rmNowTvobTWLgg\n3ciqJaJrYzJ4Qjlxc3nLXWGcm3qP+XsTIO2Ep6JfBsfBtN2QigKB9Kf59Hde\nFnoa+TPUyoz4SocK2qFid5XXJdTNMZEq1thPsbO2/SAdEQhhwISPhwN7HOGV\nXVcslVpjqfKPVSK7K8pRNCkavHnkZhPVxLryXo9q8Mc43TMoDSSMay0kVPb7\n4orVV+by8wbUDrynm2Tq0UWbAMQQ0shTLYomQ6xubicRfG843ooTBkcK3aAw\nJir1jzLH8Rb+F3EW1tXtqc0KgggDGE30DdjsKTaIVqgPts22hwhQTwlx3H8s\n5jWsJYC/NfVe/N7xKs7MXfiIr+3swH173LO34GkgzMnpxAZNZgmZxvY6mNZr\nro8JLGwwcYj3c62+jfyg4Fg1gYPaTkIE60pm+dU+bgE4axNupFNO25DhskNu\nCIEc\r\n=Ndu3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"5c1f8e79a09f49dd3e32c78cf3241ebfe3b319c5","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.227","@balena/jellyfish-environment":"^2.3.39","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.50_1612200986404_0.8582433297844334","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.51-renovate-non-major-058b712a8cd891f276913cb9f32dc83f073bee9d":{"name":"@balena/jellyfish-metrics","version":"0.1.51-renovate-non-major-058b712a8cd891f276913cb9f32dc83f073bee9d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.51-renovate-non-major-058b712a8cd891f276913cb9f32dc83f073bee9d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1a8423d16703fa4090f4e6c238a0d8722469bf52","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.51-renovate-non-major-058b712a8cd891f276913cb9f32dc83f073bee9d.tgz","fileCount":17,"integrity":"sha512-Zn7OaydK79pYHj4qVtzm5Us8EecYXX2g926w3KItlU0BtiIedkjam9KQJyI3EdA3eZuURORLA7Q/4Ezzp+Z5jQ==","signatures":[{"sig":"MEUCIBwyM0ldJczk2BsFn1Ycip1LUfrT7yF/e8/X33o87K4MAiEAktxlgnoEM8HUyDHJR5xinxfbIw4qxADov2HSWiy8DW0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":105311,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGGruCRA9TVsSAnZWagAAka8P/3vjjt+FGpNk5gQ6vGLB\n+vlYTn0IBJn8QRMiRrc/UXH0PA1mSVH+tcpb5T6+vwqdObgKu+4Bg/jJ39vf\n8aCCqX+G34hg09DgUOk+W6g0bYsxhCGgc3+TnbJ2eOuPUSh+e4ZJwMvP82+8\nRdiHGwxy0E4Tlv7n9trA7+HOJopzHKJ0gnd9VVLktvEfEiWXtGgmNqeghHr6\n5LF9f50YP65hnufEQUpdWhlsmx7P5GnwGmzKcNjUc4H/D3J/05XS2HpX4Y8I\nzOOsvTNjsnpX0cfHMkgyngTYF3e7c8uIuIuAoJQyIs9j+YY//DO8Hlb6KF8N\nNvHdEKbew7t2MeIJN07II9GT9Hq7xuQh2e8KHI5fMyXLgJ/7d7OH6kJMCG3Q\n75tMkA8u8KyItphAHfdNvf+uUey1jnOU7j7zS/X3JQ5Wkuyki8NyqwlvN+Ep\nHRlcOR4+z2MBiPMcaNgL8llcwSjj7m4HNF8Jd1SxWnXKYtiIXIFAt7Lioxzw\nt8dfmfnfmC2jtHhN4s2hoQh4v2b2/6PsATN1Cho/yxNynkCVYKn+GTZI/CXe\npcs1GDCzbDSLWRs6akW1sNV6RLssaWi3xi5+PWKAy9q5SYyLQe7lIe0nX+iG\n3Wyx2fmEXrbp9VWHSUp3gfArVL++vx3ueOcWQdpD34AUxvN4fkagDZwKVjKV\npwGs\r\n=rpej\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"058b712a8cd891f276913cb9f32dc83f073bee9d","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.228","@balena/jellyfish-environment":"^2.3.39","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.51-renovate-non-major-058b712a8cd891f276913cb9f32dc83f073bee9d_1612212974278_0.4647604949684858","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.51":{"name":"@balena/jellyfish-metrics","version":"0.1.51","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.51","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f70b553a7189a5459aaa04446c4dbc7c4b7f516e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.51.tgz","fileCount":17,"integrity":"sha512-vY9RWDUGrmUpK6GAgntKVN8FNuWfI5nWD/U+RPbHomsz0BOegLF+773F08LmyGuKSrDL6BEAYpW7rXYmAe75QA==","signatures":[{"sig":"MEUCIQDwav5j6FOVZypRHohnil5duRRAKOYXxOZPHOnlKHH32AIgOnAMI+KgiGMcen3Stazk5j6En3l1MTZnUDg5NQqqyfg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":105251,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGGupCRA9TVsSAnZWagAA8H4P/jw6I5xgTAcG/oqzkxVr\ngi3d71gmDBoRn+oSyRm4wG7YT8dKWbdO4jwM2FgPasVe3ziutwVMSJF3cmO5\nKt3URaor1KTTpIekr2+css9JTXeby243VV5gVg9c1rpXYnB/NOPcSoYIGXbj\nieynFW72cWWQ6BQtgbOfWzCV93AxXB4HLKuPhXFUUorFJYjVVIi6jT2haXZb\n9cSlMBc3X0mQW+RsCJVb3hf4yf+cC8YKAChYoBucrYBiAoE6OH4cwR2DIiJI\nMU+RKwLwsAodIYYUKa4jUPbie+vrjO458VsYZLpCZsTdC9A6bk2PSwvlKtdN\nCfJNAQTDQsmOTvZfac1STpDdJikhWuvE3f90ISGhoG6JYlqAzWVIjOzXYHTX\nVbByKrzZeddfWPRCBkUyY37fjA6B5qcZ8IiHFSl6tJlW11IfKLlcZjOrVA9J\n2AE2sCT9gDpZJ8tjJ4nkbomEOE/rMBNX780onOJhEhh3pXsP7x056Lf4Og3Z\nJl3PrM0GlNCtstBrXCVF/QCTVARKalkDbiu9urfa6ofOqmbD5kdrPwAjiybR\n4rZcnGVwhyJUfpf3X7a1cwFJ7TgWy1vt+wB9kaJQEgDTYTjbgMofw4zA8OPM\nmA+sEc4FbuVMEbFy+9a3PNI56EJpgmD5KyIVMOJlIjFmzyqXR0waCUjDlJAU\nn2fV\r\n=XCJK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"e720da5ef8cacc1befd851d1a79f6d36901313ff","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.228","@balena/jellyfish-environment":"^2.3.39","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.51_1612213161469_0.6402052201429198","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.52-whitesource-configure-e0ca1baa58ace2e72f26e5320b4797e9578eab88":{"name":"@balena/jellyfish-metrics","version":"0.1.52-whitesource-configure-e0ca1baa58ace2e72f26e5320b4797e9578eab88","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.52-whitesource-configure-e0ca1baa58ace2e72f26e5320b4797e9578eab88","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a1031366ea81adafc157a308391dd62e5e292090","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.52-whitesource-configure-e0ca1baa58ace2e72f26e5320b4797e9578eab88.tgz","fileCount":18,"integrity":"sha512-DJBVY3oBmfN82YYYAXApXh7acV9mQ457AwiXwG7t6ZeusYdLsclaZFVTyxmEyB7o1bdqXub9nzCGcVhhoPK2Rg==","signatures":[{"sig":"MEUCICnJblRmz4TS31wVYFOMpMUPG+LwGyNdQWcU6kYaRkfMAiEAz+/9AHRDepu599gLqU1++qgSEuJ6jAFL3TjtkXn4hSs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":105628,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGKbeCRA9TVsSAnZWagAA9IoQAJ0Iyy4/bDSnvP8Y/owq\nTpqntOn28WN5qKhu8DT98NqF2Iatxh+WfmMQH4mZxBNmU8Fhfz3e3aG+vZH+\nLAzfTIDOQnY4PAhMpVrJNon4XYSF3p23ZQKmVREB5KQNbRlWCWpqlG349aDK\nNdH4xg2tCSNWKmSNzROLHfi5ZXvyZGqfAQXT6gHBtHjGv5jMQdJUAf7FzQY8\nft8URPK55GhlmkPgpnWEFR6/fqa9SAJaezZz8eBWVXUH2iC1KUb6JKj5MUzr\nGOyHbCitV1qaSwD9l5UGrqChL8HFF1cUehzTW5DdxUG/zTuI2qZDlofAkxhk\nEsfFb7tm54/KufOUN4aiKH5PIutGqBakeUuKZVT3YSfC0WUvciC/bPVxU6m2\nG3fw6lhT9r3ALnpfmUMrwWmCOr7tficr9Yl9Dvtmy9+XDQpyOVoj8AapVupC\nsvQKjm3BrN/Mu1wLWn6ojUJAZhy6KvROU2mtRIh1ddZ8PnflqYADG2zVjAyS\nKDgonORmFyByUwy+IdPpJqcx1DGytgUG2Fl9kJoSnlEASYW9kUQqNAF514ps\nMUJzMv1Qd6dWMCfNjA9m/6wwMN34Z3aEfCsHeY3agct3XjXoyn61KFt+xT4R\nqeZGI2smYTA5bLDDcB22cNhGda7a88q4r7Z8Mq/jBEAPlP3Jk3PxRExXpa/C\nwbK1\r\n=djbz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"e0ca1baa58ace2e72f26e5320b4797e9578eab88","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.228","@balena/jellyfish-environment":"^2.3.39","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.52-whitesource-configure-e0ca1baa58ace2e72f26e5320b4797e9578eab88_1612228318292_0.8837392121711265","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.52":{"name":"@balena/jellyfish-metrics","version":"0.1.52","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.52","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c056d29465f7b013d5b611b5af5f845a56b6746f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.52.tgz","fileCount":18,"integrity":"sha512-J4FQOtoXN1u8PiWCw/hE00deIND5Xkp9hmyTRmSCa+3S8BjNjOFaRg19Mm9BjzH5wqR7uwtGTlZFh+JQqw14kA==","signatures":[{"sig":"MEYCIQCF4umNDVRBvsDIM4t02dX4xZWkOlRpOA9B+O5Km+PyHgIhAJ6Qg29DHDdPVT6A/2pp1F1Jq/7DWxyAr7JhkbgG9UW3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":105565,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGKfCCRA9TVsSAnZWagAAzDYQAKRgovRv8kaBrUPdwGo2\nG+UbnOFYlBcnYGGeRU9d4b8/kqCm/8aZe0awcWHuUiu9V1gGWMLM0rIU5+H1\n77owyXN/+sZhuPkfuLgVtA0unAn6jpptCoeKoqKJVVNFCWgaG7qs3zRbDiQO\ni4UyfRHAmvw6P70ijhGXu78x0riWMon1P+9ITYBEcZOhWluXwea6Oj+Yax6d\nOSDd/x52v1tcYpjjiF4cFi8vqWLkTRMVocEIzNr6BEKJkwrIZ9D3GQrBgoF6\nu6Dne5CYbXlNqZCbaj/zVwa7hVazJPFdqB78DwFZPO2afI360Wj+pcdcShh/\nQBPhXu/EBX9nMTEqu1VZGwR3UNljbHDXfmMObjgsGMbNruYyGBCo+61sU4t/\n5pilKYfIjmou9TxyRcyTJmjLoZOMpuEy6/83hj/Tgf7N1wWMKSaCIJO9HwW0\nUDk1tWav3aUUKOA1vd1V5TdSDi3xn4P1U1acUbJAHaNYmQQcY9yBSqgJPb0S\n6RKezuBqzHaWlKlV/nenz68ODePu9eJVoub6+EIdWvPvEN1aCDT/zjVZb3+2\n8eDIjS90lTmhShW21KftD5crA5J7VZKcfE+RLt0uhdWtddzfjx7ORcFuF8HN\njuw74oisV9/p4oZ7ZBbnqWzlS9MUBBZogFNoVV6AWCCtcJ/Jb/3GGWfviXgC\nn6lS\r\n=aNUI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"c70633ceade1c2843250fb5f67029dcbb637d19f","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.228","@balena/jellyfish-environment":"^2.3.39","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.52_1612228546020_0.4352590111916339","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.53-renovate-non-major-e05cf2e6914f84bc3762720b2d0104ee535a442f":{"name":"@balena/jellyfish-metrics","version":"0.1.53-renovate-non-major-e05cf2e6914f84bc3762720b2d0104ee535a442f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.53-renovate-non-major-e05cf2e6914f84bc3762720b2d0104ee535a442f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0fcf01135366e90c6c260d9881e0ddf90af68ef4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.53-renovate-non-major-e05cf2e6914f84bc3762720b2d0104ee535a442f.tgz","fileCount":18,"integrity":"sha512-0trspEeuwl/7BeRDs/7xAx7H2azuQVTUDdpwIn83CAE4QSNb+x9bVqWOLb+A4TRQqsSXjyPMV6UTN3ek2fDDWQ==","signatures":[{"sig":"MEUCIQCoZE9burgqINrX1B9BShvFDqaiNPm7Ac2wLidTfnTb6gIgHn8d+vqK64LVeUU674PmZyNW/7ZVMoSGnO2HZ4rZlZk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":105693,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGKlYCRA9TVsSAnZWagAAneQP/35dAeOpS3VvVAPdyE9K\nTVLEfLnLOvgbFPD2m8GQtSklpKTLY3J2NxX7gZa/lmKw9b5PK63IUZ9i60Ht\n8MaUDrzCrhL5b8GuYJ8Yvr3DgB10L8Z6pzPG5RB1lxV8RC4eRt1MDAlSR+ez\nYB75OkHwoGdsH8hmCnd8XYmsAaUaIqovuhvi+ohSPGMeIJQ2+DOuCnSL89E/\nY2EQg996MTHGnOA+WRUP/n4RpbainOUwzcBdsOR9zTS/BxYhZARZ03J5WT63\ndWb7+rqtMtQiDWtvA+CZc1O9nCmyaYaIOWbPMUEQowmawvP86LzEQ66Rladb\nzuoM9eSU6TIO/Nk+x1q40sFECJ5ZiUoH5+IKhyNtsn1Bzgmiy1q8m0WBMSJN\nSE1jtKsoBIDcXyY4A95McSIjjJu3hlOlE6BMH8/UNgH67+d6vVrU9JyDGlAP\nINS68UEWroRY+iR3kIQOgK5tkDarG2WJksHu5tq8MIrAVrfNaRv/KSXRX5u6\nJjQ7NVIoLjQ/kuqXQZnO7vA6fKozm+bqM3Cptk1EUasjGgWrP3u5Cavaz7uO\nlFXCAc2MfvLKVucGLV83/zLkLR9itbhrke73WA1TiFvIA+qNfg1i+G/eZYD2\nzo5EtQZnqBtJEOzdL/h4FjtOzgqvZ4gJbvPlG7dJciEcXVWuTl4T8qp+FNtK\n0xhv\r\n=F3v/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"e05cf2e6914f84bc3762720b2d0104ee535a442f","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.229","@balena/jellyfish-environment":"^2.4.0","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.53-renovate-non-major-e05cf2e6914f84bc3762720b2d0104ee535a442f_1612228951794_0.49386207131669435","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.53":{"name":"@balena/jellyfish-metrics","version":"0.1.53","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.53","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"90d53a1c07d123521e9dedf9712a6a78f5467376","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.53.tgz","fileCount":18,"integrity":"sha512-BDJllOzgB2HQ82kjKbSOYgaDoRIigCQLws4dkU1CS6GHhCBKPjKRFeWqrnfKvcnRQB1ZInGMqgPKPqy68cYT6Q==","signatures":[{"sig":"MEUCIHSxViHK/dzQJ5z6kHo4SOXFekN8EWd995MAc0NF4o1+AiEAqNzWDRc3VWqE/QZDl2+RcXQdettjuc53kf66Wimp6f8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":105633,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGKpxCRA9TVsSAnZWagAA1r4P/R6OMOGFBckgvkUARoqp\n8AHWUuFq4l9efDbwgU0hdbpT9nlQT99Jzv6t9Z5tOEkq3F5eFuhxq8+2XgiP\n8f3JzwzGp0N2yIzaonzwp6aD1fdLCufh9UuLnTfqploD5qMsUfvIXggFpaRj\nzKKz/sIZ6q5Lk6GzvuNTKWJjczGghVt+iMNMAo+e6Oum+84cdKQ5TFx76P/F\n+q46dKKNmAB1iMibnaUT4T8ZFrV7rMk1xKYv8qrOx/r8U7RRmH3wKDMPkfm5\nnhtjcFY3/YfjAC/K2JrJWK6GSmQpW/KUGeQ6qRHFK7oAswFKrEx7qcmHjFHk\nOUHO/w2i7ViWq8iKc9FwLyFxjQwuZ+Mj/oOhkzMhzzQh+NubUnMM550p+DSr\n2RqzwuubvEQJZth/QbSvX0FUU+PUWRlS1JwRQDPHct1hefW4zCA3al1b1JY+\nlfLMzsSr9Gbrp65IDM9YC8MmnpN6HXFP1DYXPTdkwE3wJ9ghmxWT6FwdYO5k\n7BEQlqfLx/E0Y2hOZ3PWBBVoI9+Ky0xys8IiUne8fiYUva79CVymK4usB1xo\nrRtO2zsPV1AxV0TibTTXj3LkEANdTn89tgVupalPv1QgnEmiXJfOm6bFTKAA\nTFtMmah6RpA6+wgzIZGcBUdSHk+EG9hDUfHKozin5a6Fixn+B2xonh0ImiSC\niVAD\r\n=COzt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"0c5f924092056d029e5586ec9befaf96ba91bd35","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.229","@balena/jellyfish-environment":"^2.4.0","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.53_1612229233400_0.19537359782069608","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.54-renovate-non-major-1cb571ced52ca56b9260e1127d20caffcecfd5bb":{"name":"@balena/jellyfish-metrics","version":"0.1.54-renovate-non-major-1cb571ced52ca56b9260e1127d20caffcecfd5bb","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.54-renovate-non-major-1cb571ced52ca56b9260e1127d20caffcecfd5bb","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"015262efe93aa0321d533ae84c6f73129b6984f4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.54-renovate-non-major-1cb571ced52ca56b9260e1127d20caffcecfd5bb.tgz","fileCount":18,"integrity":"sha512-fazw0N6zv/PaHl6hV8p6HzjNtTS8RhhbgwSf1Oh2Jq4Tr7Y5QUW5EbOiEo0r6BVI0xZOAymKGiVGpx39Vz+qPg==","signatures":[{"sig":"MEYCIQDX+V1j/0W7S2E0hlEv90Mxdar9K4uyNuyEDzL1JtMIRwIhALHAIrSyVpq2Pekb5Be9p6kmkIReF1U1jy0tNtxzoq8m","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":105762,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGKs3CRA9TVsSAnZWagAA4rIP/3eri2ivKJ8u61V5Kn4Y\nrM3fkt9pipetk8csfN0Zw4N2X1kBtjSjREguqdjt+BjD2nhs11mFCmXaHg/a\ncchJQIHUaHV0gpV8JLL8wTrmh+bPCnWjKXlo7MNlr8zHMxTNNByCL3AwzF+n\n1AnC8VYm+eupyfjZKX88WD3CtGXaGX6ynL/A+87gthoRPR7/J2yz0iy980hS\ncK6i/QfmrVyByPnHpv7Ma0VUHwLjmbGIuxSWgTUrMYDAhCOVKEm1Ej0BgtDM\nRtLLHsijtMn+zgYFUDbpmOq7uigY7ousy+zmdDJ6MZ9EQmQ3vhu+1muaBr82\nm0O1v6Vh2gaeUNH7NutSJNabVBtXut8zfjfz9iQ4c4eNTsXNV/o6CbncBqEk\nXbLZ7ldwawe7Nnx9G36p5l/CS7jrTemRhIxfbRh1bTFZdNH3aV4dRPf6WiAP\ntDn32uUK7kZI62v9oBctV7nSGZb9/2wQT7EaVdAtHBnx9FHKF3p3XiMnWXTB\nVWv47u6Anx0yacexzH/nA25CBswYyHsQrv+flUnn/fYW8B8NMi1Y1jQSipYK\np+jmMS6YUaToE4Wvypf5YISGPLSXmmvbKHLm1DatOW4C7BLldwgLy8/VdT81\nm50c0F5nVVkGyTcVyQ3pfZ0Vs+vgUzOfewor/NJ+9VSfni/TfzaQOmVcOAlk\niIYe\r\n=ThjS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"1cb571ced52ca56b9260e1127d20caffcecfd5bb","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.230","@balena/jellyfish-environment":"^2.4.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.54-renovate-non-major-1cb571ced52ca56b9260e1127d20caffcecfd5bb_1612229431162_0.6077573073604536","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.54":{"name":"@balena/jellyfish-metrics","version":"0.1.54","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.54","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4aaa8081e5382986b490a319db6422be47a86289","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.54.tgz","fileCount":18,"integrity":"sha512-0mNWQy/og67nZHeUJPhxBdbVNZnVhv7EMZZVMlmbRFUaqXrprAWtn7QAAYXA0ca7xsMUWNmFxDXcki0wCda+bA==","signatures":[{"sig":"MEUCIQCUPkCs7kS7i9KYsMdk3FhNCHQc/eEJOMKQpeOuv9wiEgIgBnwbrTHjuVqS56A3jJBwigf4rpTy+h58AQR7oWlkR4Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":105702,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGKyjCRA9TVsSAnZWagAA/swP/2/2gk7LVV5uKQgtpZdQ\nWMSEdbsldJIM5XhdG0te/DWEMGNGeHmYpZXlqUOIr6qMYZ0nJ0MDB1QjnF8V\nSZHYgEQvfnR4rf0EoR9JkvEux/9kp1pPeGcL3tMcymqE6XafgNdD+sjsDKjN\nxqqrIum7dOe3rpM5X2JWS0otUBqRITreOnAGW0jRbFBEc6nyGBv7Mifgi7rw\nJcIgobhBF/PxVWpXZP4cS2CmrI9iIOTPgqu0tOcvU2lEz/ZLjRFK1Wz25DlY\ndSKGFm0u0qZZT3m2C+vErzspZ1NB8DReEDqJ+jfxEwUdDJpgF/WwCOZsOFEE\nM/Vme0ypKEBqoAMeTJ1JM1trAaaX6cmiC+fqX+tsD2fZyKgkyyGxxOyDRKPG\nkAa/0f5NS/P9YbyWNKdwg8cv8xV1LZbVf7eYKlIe/WTFJN/rn9NXq2s6Fqtm\n6d63WClm9jgysf11utJOmzAgOK82ouhiZifOP5r/uoqv99PxLIYlnm+qJNDC\nBPgxWk8nygamVqDDtbf1C4nCBlxSvjKNMJkv3kzcf1Nz74l94tfX6fJ2xhFB\nBjGaflNb+TnwnPHMRR1UJDyotY5Q503q3bOuc3YZKZVanq4CmmM6YWoDhYCv\n9658wEW07L5xouPpAt5V3NhOEpU3Ehzy+kkZ7p/rtmxacLuVkP6ybOxjkqG7\nT3px\r\n=aATe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"8cd28ba078b5257cdb1046810599781c3fe90ff7","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.230","@balena/jellyfish-environment":"^2.4.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.54_1612229795220_0.34252784957212","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.55-renovate-non-major-a20ffa12644ed117cd0931119aadc66e4a275193":{"name":"@balena/jellyfish-metrics","version":"0.1.55-renovate-non-major-a20ffa12644ed117cd0931119aadc66e4a275193","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.55-renovate-non-major-a20ffa12644ed117cd0931119aadc66e4a275193","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7572272970422c5da57151db487b9d03a4dd22ff","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.55-renovate-non-major-a20ffa12644ed117cd0931119aadc66e4a275193.tgz","fileCount":18,"integrity":"sha512-et9WXymrpvWMY37pTQyzxskG6Pu/7Q85KxaoaobOJ3/XI6d7Vf3aYQz3/88NRMJ6oCPtodsWI1BSkFg4IZYtmA==","signatures":[{"sig":"MEYCIQCv6k0SFdUKwqYfH0OiZ6cjpx6OHf0lBM+fcV87p1TgPAIhALjYluzrlJEgXhW6Srd8BNdIwJk2XO1yvCI48jX1np5z","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":105869,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGMSrCRA9TVsSAnZWagAAx1oP/jKsLtPOcYYmV/Bn1p30\nLVyF9ZNJg3eWVGSnyb5oj7YZJ3CKNYdBXqBj8BhUjM2ZqLZnxAwkfeTddfm8\nbhkFHiZ4pMbGOMMrWiiAsy3LtNwuUoaDUgjBrb75QESAeVhP3pe4RKubpNTj\n0kDhp/eGmIGAq/n77S/CV9VQukEilP9KDU0J1qPos+hD3ISJvMCBRneaev5o\nUeTMOzWNWMu3o/kuKH+asAGL+kOiqI6Ujc2ka52kwWj1KhTtxJavMhWcVahU\nP/45OpBp2jVcov+Xm2dy0tlEMem9GDS/EXuQqkCVODq4sy75k/6cFXYQilc2\nNxHpk7ku/YHA57H8DVIf1PxOrvES1DniMulH6OdgLV1gkPBegW4G6OZ7AYyG\n+MCXYxM2Nfe0aTSXE5JLYcpFMwLDE58WsrRs4j0uWWXW1zVhQMBdvki3kIR0\nVcRDliBS/ug14/Nrx/TJHlmbFyDmS9IVfaMiY3BM8Xfg3gCRd+oUuPc7ZDyc\nmmt0/6YsqsdVHlzj/Li8iJfuSfdn9JlgTpWAgbiSejHbZ96uqADore3cxLRn\nX8Bo5izmq827DE+FXSHMKE1qQQ1iaiTgkj/9k8CyVqAA8Y9kjWu66cwuaYfP\n9GdsHsmPpiz7L0GwjlNeoW8o8J/8kUCQBWM9C6F8/2puLVn0DIjV0oqud5m/\necaE\r\n=flmI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"a20ffa12644ed117cd0931119aadc66e4a275193","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.231","@balena/jellyfish-environment":"^2.4.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.55-renovate-non-major-a20ffa12644ed117cd0931119aadc66e4a275193_1612235947236_0.4614033578887702","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.55":{"name":"@balena/jellyfish-metrics","version":"0.1.55","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.55","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bb0da5d67f457a7f15d06b9c967d9e027ad4ac0a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.55.tgz","fileCount":18,"integrity":"sha512-sXlbr91o8bySd6D/xb2FmFeWHv68CABVgIX2j9qEUDpxUpjHD/SqbtuOhAw95t1Wt6q0xjjyBwMtWZ3MPDhmTA==","signatures":[{"sig":"MEQCIAsxZ+A4grT0MIC9WAT0+6KaUXK0pA98nNew3WV09uHfAiAa7oNkgWtJ0g28XXrCz9BedAdqDdwZCLilr4AsMkFuKA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":105809,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGMVsCRA9TVsSAnZWagAAOIEQAJBNg3/0AB0KyGL9GYys\nur/LckNM3gxkkdP5/qEqu9KHH4FQAhiDbU20nsRHDyjFo+5RxigCTH+3zZMx\nxYTIo9OQwLwx1EDCZPOo6AyglFMFZWqJ+96mYvjzamNUfGX6wkUP1HPoIjKh\nN7sbbFucpLP8Xmgjc9uoybljlOKUGyIJmbSaI+PLGFYqfELPa9gdFOojQ7sx\n2frsc3GjTYxg/3KXfSPAPYAd+gYIyQQYa43ORlD9vpiaGAKMp4KHFpV7js2y\nMYvFBx6TVr04siuY8FTbP08D2rVl7m+61yY3QOsjQR2mKtoq+kpJZdljo8bZ\nho5Vc/70ymIAE0u8Pmb2Q7iCvsh8qodw/KG5ko5kaTBHJ/TYsVomrO2tS5BM\nmEUJDnab2OoIAXKlyoeUuYAQ9laoWYObZ943sXSRraVEsEbs8SvpuhLEgqRU\n/d+PUpU11PExk0mPIAR8Ya5Bh4baBbC1ZfbWuVb3No0QUO0eG4802IkfOIzG\nQac5gNx45P8krdIqJOzV8KDk4R9+Pn4OfyoVzd9DgBx21HbXbhHCeBdf1ofj\nirNUaRMv3blNG0rTGwZnI5IA2peNjOp/WeMypZG2tbvM63ysJ4N9hokyWwYo\nsCFCZxMAaBOBSjLacEyzTFQgS4SIl5h2aMjIzJTrcw1BFkR0dKTInyvgHcZ1\nQRkU\r\n=5fMS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"d459b4af5e02e82faca0ba44c3c685a12f958c0d","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^0.0.231","@balena/jellyfish-environment":"^2.4.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.55_1612236140039_0.5206732412807678","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.56-renovate-balena-jellyfish-logger-1-x-2f1fbd855d157556caaf947ab3d53de002bbcb41":{"name":"@balena/jellyfish-metrics","version":"0.1.56-renovate-balena-jellyfish-logger-1-x-2f1fbd855d157556caaf947ab3d53de002bbcb41","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.56-renovate-balena-jellyfish-logger-1-x-2f1fbd855d157556caaf947ab3d53de002bbcb41","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6160b50313195f9071d4359d0c14345a09e2182c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.56-renovate-balena-jellyfish-logger-1-x-2f1fbd855d157556caaf947ab3d53de002bbcb41.tgz","fileCount":18,"integrity":"sha512-AdEty+EY31q3AhRTUAiAN33yCtRys55Ju1h/asoeoqeH0Ifvcpgb1zANS7e6gNwnvl+haYzAhv5Hj8SKdX1SlQ==","signatures":[{"sig":"MEUCIGrnGAX/51EAWHJPi6bGeSE6gCo9NrtGgywO7Z0bAB/WAiEAu+xXC+rnj+HxF6SRMlcPlat+lkonm5PFY0bGFTsVbrk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":105986,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGhaNCRA9TVsSAnZWagAAoXEQAIyHLrl1x5kGzUjUVtaF\ns+0XBsVwHme5z4MYks3PIqBIK4CoC+IxJdhe8Rp1FmIrvcBpSweEx+FBhULl\neK9YucwqZIw1Ok35K0xjWa1JBUUaMC0CRBKjumdiQ0aEuU/VVTNhyWnZ5xRs\nVdSYeCyxinP2n5HQXcPEAaoZV0qSBuC4DIYEvg/vJlrWtHUFvJVhPOquIlpU\nZuobH+DGr0YoLYetrCzlTmYNhQPCEd4JTRt3bkol69C5YS7Pt45+n7sf40mC\nINQXG1lQJpDWqS4pK5V1x4JpH8lboLFD6RLmmIfmeTtEM0yxOdyVRDix1EHp\n+8VR7/EmtRAaSEmJkMIXV98iEThOB8Tq4gO+PNv0eM2bxpO2pqGShZBv0YCg\n/kHje8C5l8Z6wAPgAFFuhkl4CwNoulPACkl0eqjdmUj8uVlT/0tB9RUrZFJD\n1Z7QForf8GJgPUJAXltr9fD0Uxj/ZsDMBkK5HzSPG6apAnJ+otSMhXdXcWPU\nzkw5CPZXaSk8O8Ymb51kXpY+pIlXvQWV3hDDRqFpuJ2xEYow9D4ftTIjXit4\nKJpAD4rKUu87NZpduX8J3Q1LSNSiPR2TAd9k3SGobP9koV6N35QI6cz387hE\nPyxzS+NXIaJwOb+2e+g2+egW5TmgWgfr4x1+UFfXqvMlRe0DwUzmOgbcpVWM\ndmVc\r\n=9j+x\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"2f1fbd855d157556caaf947ab3d53de002bbcb41","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.0","@balena/jellyfish-environment":"^2.4.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.56-renovate-balena-jellyfish-logger-1-x-2f1fbd855d157556caaf947ab3d53de002bbcb41_1612322445302_0.7679967604378732","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.56-renovate-balena-jellyfish-logger-1-x-9121f9080ccc117b6f9c107c0fa758dbccffa109":{"name":"@balena/jellyfish-metrics","version":"0.1.56-renovate-balena-jellyfish-logger-1-x-9121f9080ccc117b6f9c107c0fa758dbccffa109","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.56-renovate-balena-jellyfish-logger-1-x-9121f9080ccc117b6f9c107c0fa758dbccffa109","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"de114a1ddaa2b974a0b3aa7814f8ee431dd15d07","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.56-renovate-balena-jellyfish-logger-1-x-9121f9080ccc117b6f9c107c0fa758dbccffa109.tgz","fileCount":18,"integrity":"sha512-hrMYXdsmla99gId5D8iQzwD7n7VWcA6qgEMKNFhLZRUA825R22GGag5b9O8xD2mVcBRZHbsFzVKnrxPO0J2jTQ==","signatures":[{"sig":"MEYCIQDyU/wsIK696C23xhppPNjpbgUZ2i1x+R7ejEtouomu3QIhAOqPFjUCMFyptUUDwTI5kjD7di+Db5ROvmIikxxObKkk","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":105986,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGjqDCRA9TVsSAnZWagAAQ08QAIVqeasmjow9pw8i6zSr\nROxxgyKmi9Nsb9Ekli4lb2fSBp/lzkdzTm90Ugrblat5DgQKaOeezwwPAiU5\nntMbxUrtpZ5B5y1FE0EjG25jUnwgsm3UBU/+f5PLj79mO7XYRCwX2y6dYnfc\nBDNS+Yj73rv3uM4PW3lJGgRoO7RoZlmrUdZleXjQlmSuqqQIWkFZY/mGxw1C\nsKZiJIG/1s5hqMud6W71laoF5KyxzjmOB8LOAUQI8BQrdneqXkKOnx23exqU\nobmwhbBN1WNmjFtwJKaz+wca+dfovAt2xOQRF2LoRA9EAobEH1iYgj1bxuFn\ndcvv0stkJ3xJ1MP2OIRK+6Zbb9X/FZLvow2oaGaLwOqWT76iLh8dbcq0D+BT\n7Tc78UOETy3WtILH7w66H112UpwtgN9da2kAaB6ZW4h+9YnKOi760Nu9IhEj\nBkPmhiaGTavf/pjiQoy+r3OFvqdnsNSyvtY+MUigK08nagEpjNlkXtlY/AMm\n47cEk6gMruBXCNKoZYEfQnc28bIBGO8ut4esxbKuqs//ByW3g3n+J41Psd2F\nIBNOgXVkTdfNJnmn7DjP2FUKjrNVToZxc03EYu6hV/wBRjN8C7Eb9PaWalds\n1mJK8xYlvT6tv3sW/PvS74gMHgHfv9ivlPSI3OcHjjJiy102f9yEK6sojFwk\nikgO\r\n=hbST\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"9121f9080ccc117b6f9c107c0fa758dbccffa109","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.1","@balena/jellyfish-environment":"^2.4.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.56-renovate-balena-jellyfish-logger-1-x-9121f9080ccc117b6f9c107c0fa758dbccffa109_1612331651398_0.9566160555778185","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.56":{"name":"@balena/jellyfish-metrics","version":"0.1.56","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.56","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d92bd9bcb943ceda4a3df33d30e122810a967810","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.56.tgz","fileCount":18,"integrity":"sha512-a0OJ9ljxVbG6hKrpssonQ/ecpwu9qT71mtje+UFFfqMEW+TXa+TCDQCnA3kMj2r8jgDLzG4pP5u9IaE9JqwZhA==","signatures":[{"sig":"MEUCIFJTlFyFo6Drf7JRnIBMAYgbHZ4opOw7sCzkmgc0fuK3AiEAiITsRl9ykyQy3at0fX23vFXXgloZQ9C/hrmAmNB5T74=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":105908,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgG2OzCRA9TVsSAnZWagAAR0YP/i/uu4AMN9eHrScfS/f4\nfuicAKfi94dvrwihtldmrIZ+1Yg/M7H2SNJfkFR0+va0NvHHt3eQttq3UwDP\nq61+1sBxVD7QBZY3S7S6EuGErahM5ZHc5XbDkY49AINsjggk+7dYbXnKekQe\ntc4x6YgPDfQZcItcaV90g4EgVrrF9skH6F+Id+58HFhEC7GAzukANqyAoppk\n9jcUF3MU0ldMI1gUCtE4/zdARMHvwmK9fQdxPphwGVPtS6+9mI11uQm9T4kl\nhSvP+IS8FRWPOwy8LTRyJRxZ1oCiPNBeMgZ+keuzdmFIxYjpF3nX/4/5wid2\nHYGHjvT8oehbYqKOHhY+gz9uRMtAfRE6Z2aExEYJcwuMgxwqK22IC9ps9awM\nWIrD7BL00+5sp8ncqq/7DfR3oXqr9oDSj4CRv2pTPLxNF7DukV37Wav603Cp\nFGrvjiSPPYAFq98TlM61WaSPKk4CGGk/sURYencilTl85UWvA2rS08noySk5\nicxtaHlrhfoSiZJBs4uAy+Dy9/kqN0FlWlYwI/sVTJ0SM6v7U/u+Xxn6J70b\nEed6bqZqm3lDwaGxHwDTU0P6i4aIrwotX+uBwrYafQPnRizKYhtDnshhn0n9\nfQOEElOE6M9xM9Z8RC98uwSaNqGtR8oCbwAkHgbD4kO/eqXeLt1xLWkEKk52\nGfuN\r\n=FFoO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"e4481a64fec28173652cadf1ea1b9112a9690d75","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.1","@balena/jellyfish-environment":"^2.4.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.56_1612407731169_0.30985436612538164","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.57-renovate-non-major-f72c4094946c0127a43ec7a57f431e4e0fb64da9":{"name":"@balena/jellyfish-metrics","version":"0.1.57-renovate-non-major-f72c4094946c0127a43ec7a57f431e4e0fb64da9","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.57-renovate-non-major-f72c4094946c0127a43ec7a57f431e4e0fb64da9","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"361dd59fe07fdefc192c36c451fdd4eba37c7e09","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.57-renovate-non-major-f72c4094946c0127a43ec7a57f431e4e0fb64da9.tgz","fileCount":18,"integrity":"sha512-zASnv7zIFg+OV5uBbUmdfnIzFOl2/GqZypta2tIixL7vcPHrVSUIqUHPme+AnigZXJxB6XyzcubYUIi+8YDsaQ==","signatures":[{"sig":"MEUCIQDPKXE2SjGCld+ZhuBoezub4cAijZz8T6maJZqCDG0TeQIgao+TREroYMfdhXj1J0i+Du4UipivqgJXUlyP1eJfXY4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":106073,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHC6ICRA9TVsSAnZWagAAPAoP/jAP5livsWohJteSvxof\nxhwV7x11LdNeWQkSNiFfqKtg3nqg3sa+T8Vm8XdKC16VqQMt9aTOrR8shtGR\nb8TjdguApBVH8Git+hhtnXFSwrsTiD4nzMZFvSC0tL5BKeKDNOOp2/fphyAn\nHVMVDmksusx0FxiHPtwZhdyo96mWG+PQHSXrhjUbpk6NzEcRIQZiUYwb+PAW\nBYHEB6GfR0ddaH92MR/wHbEEr/3bngLH6RRL3DU0kASTyrdS+006gevTItL0\nyXsnfBrSVA1zszJ0hDx1EL11EwI+73snIiktRuq9r6VRQ0S36B4uaCoyseuL\nyKrTZmEI347hUtLtM55PQuvDG5Gfe89tKdj/22W1yerl4+E6OAN8tudnH9Cw\neabn/T0HaQGWYH+GtUj3rYP+ZQouIFFbLFbHidBpUnQxpGc2h+5WguttVSOc\nhxpedWLX/oagKjP1+A5svMvqVjwk7hsAYf6CAKjvKSJvR+F7BM1OoVTAwjuY\nvehjYc3i7KnseeQsGIbj2LVpmnjRozPJYTu5go9rejjBv+h37mQGzpBEHLOx\nDIJZEkMxNVqIVfiO6v/8A9MNbYvxsdQXYAArExep71qsoXz/ErVqgWkPm/YB\n3x3GJdJB5ZD3oU9qFRt+J96TJVJhxJpaxdZrqbVfyqZt0ultD2OUD4bwUvQy\niL4q\r\n=XwBE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"f72c4094946c0127a43ec7a57f431e4e0fb64da9","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.2","@balena/jellyfish-environment":"^2.4.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.57-renovate-non-major-f72c4094946c0127a43ec7a57f431e4e0fb64da9_1612459656025_0.5777290524524827","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.57":{"name":"@balena/jellyfish-metrics","version":"0.1.57","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.57","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8508d1b60b1ff932da2fcb71e64a65c867e1db3e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.57.tgz","fileCount":18,"integrity":"sha512-91ZCH0AQAwbvvVcZB44UnmXA3tc/eveNvbX5ipGPFeI6RvcOd56UxSYsW6hPGziunBht88vS/NAlrXy4r5qJXQ==","signatures":[{"sig":"MEYCIQCCPiaRBEbDlYwTGWAyFSEufjtKgtvO3U+kU+xxeVpKIwIhAM90Vk+gqH7Mw4kUhglLks7QVd5rP7euQqqkim4lONHY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":106013,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHC8tCRA9TVsSAnZWagAAVpAP/2VOELI9gnwmv1yWoQSI\n6WP0gasMuePtjeQuMrdptcZWuytu1mEXswDzNcCmTMOqkG+AM9pQXTkb/OK+\nQKDUlV9E7I/ACbZHr4HFB8WyC+CdPB+RWmyVDs5jld35neHfI3sRW9SM8txe\nt+Gcm6Bpfze2h8x2/xtV6sSoD1RerxUbZkBh638oP1klCjYHt9BrI1uaxttm\n9+tpI2pPUDd/1Yrh0w918vFBp7iO6Jt3T8tYEhTs8lXkUW1EM4I/Uab4CNCW\nU60X3ClvT4JBTnapK2AH9BkF1R8PtaUyjsLoR7qeuQaOdNsMmr5yXAxFH5QC\nsVDRK7qPboC1FviVL6KiOX40OZo3PecqLFyviZOZQikzW1ZHrtbmPJ6kcjzc\nc5a79tTnACbKjerLcgY3/EqSUSQEKe8+rINzcru39oHxJ5QmY3WWm4hjcFB1\nEvzCgUS0sHgqeyi14B27ZtISM8MhL2JyOq9LXvdYOXUUTxXi61K5ebFRWtYl\nnQKCYMBMohdGtrdxcRiIVPbVXFqPjFF7RYSA9HMCJS5PB0g8n61yuruUx+TJ\ne0O7KxriUh/vS2OJlOeXNfyHSgRzBos91vcW2l4KtxQxNRVd76+2ss/hHlQx\n7WDA6aROwe4XBmZG3uqQ50Xw2Cs6FMsvybb/GK3pw+s7V/pt3RkuVGadatJc\nxmtq\r\n=E2Jp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"b123ede533f32b6d441584ccc1eddf36149de68d","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.2","@balena/jellyfish-environment":"^2.4.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.57_1612459820462_0.4558123490258894","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.58-renovate-npm-version-101ea72554f6c5a71b18650b9ed33ba1583f064f":{"name":"@balena/jellyfish-metrics","version":"0.1.58-renovate-npm-version-101ea72554f6c5a71b18650b9ed33ba1583f064f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.58-renovate-npm-version-101ea72554f6c5a71b18650b9ed33ba1583f064f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f228e53a2685e18491d662a9bc4ea44bc111d8fa","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.58-renovate-npm-version-101ea72554f6c5a71b18650b9ed33ba1583f064f.tgz","fileCount":18,"integrity":"sha512-D4khA0LV6mvNSw2Z/6rxtYdfn/dagYUsGKovo48LAsKwpZC5EWqPnlIbNcXmGSoRr8dDKyedc6DSEHadQVTymw==","signatures":[{"sig":"MEUCIA7XU5XCVsN39DB/LCN7KWo73f0Ske2GeLGSVT/IoB6hAiEAzpmuMtUCcKsovHkXm7mlkNK9wfnz5c4fh9f/sQsROFs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":106169,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHMX/CRA9TVsSAnZWagAAynsP/RbjDSQ/LB3t+qHiMUfh\nuX63l00k4530KNRCF0qhNss29lgjgm2cniBGwlxSaeswXtHmTk5mO7iiQ7hN\n6++RwYOPh1KskidBc8XQzwtM9H2ZcEfUH3AddPlUnbo8VbveGXiwjeVZe/Q6\nPtN+chcwj8rU3/+zVJHRzSUcGa4yh9NmK2fXV4xmwvxOdegIGCPUqBqz/syO\nLEY4k59LT6nA/E8NaJ8W/WMAoprDKPaPIQkPXZCQ4B9e+F3CFxJ6a79UxTQp\nlKtP55+erGB12hUWOizyBFCiLPejl1gKjA71ogfps1VsDnCSTH0PIDFtXdyL\ndmL/EZBwNGWEPpHXSnZPAPK+mViCBGxjwBRD3B6zQvHlEn+XMJawKBAHea7L\nmBAqzrlbbiI0I8mMNT5/I2+idTL9dBTEA993Sm5y3M9NxZkX4RzuZg0kxVaj\nnVcG4tqjTp5FfI9Z2IVDNe1jz9nFFw1YkW6LW5fKMso8YtZk3gl9hIQVHvoA\nMxoGdx5T+sbTBLidiOS4wYD9qmdvRwyoxarQT7ot2sXtE+eJdKPd23k1yqtT\nXmeR0mE7K1uhj52tlN1u73p4i9PEizD3GDdkuY1H/4nEYj3Xe7kfAJJc5uHq\nM3tKo96WDSGQsQaSz3/D0ZyCQ0N3ykRUgB3tknlga1MA5KQJSe326c8Fgx/Z\nl+LN\r\n=NxT2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"101ea72554f6c5a71b18650b9ed33ba1583f064f","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.2","@balena/jellyfish-environment":"^2.4.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.58-renovate-npm-version-101ea72554f6c5a71b18650b9ed33ba1583f064f_1612498431190_0.7793801234778817","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.58":{"name":"@balena/jellyfish-metrics","version":"0.1.58","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.58","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e265fae000211dc2cbf2016b9899c34e9ef6213f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.58.tgz","fileCount":18,"integrity":"sha512-bSpo4Q4MdPPaYaq8QBNFLSDjsnoTOaEet75IOr42D0Fq8ZJXWw8hWZypC1QLErCRialQEVZH9z7QW/SbqMCHhQ==","signatures":[{"sig":"MEYCIQDorZXQQIvReVUZ6p6hBsT7y1FaqfdIP+9m6E+iGobBSQIhAKr5fkaIBIXCVjEZIp3vOBuoIKs/sIK3KX70lWyK8FLC","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":106107,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHMgQCRA9TVsSAnZWagAAVfYP/3hpvrTD24dnXKgiuE3o\ngo9BrXSMeEcYXZ1G+CEqmXUrjJBEzNAwkPCHUkxNIWLmIepBRTEDMLkTMXzr\nKmzQDxeYAWe/9XAZvUawlD3evsLXmMpWdKD1h9shvn7bb58Bv78FloLoOrmB\nN6QqhD9vqsLchg6Q05jcuUZYhcROqChtsq1tgorG/bHnB9flzDTiI4zP/U3/\noDYp55cXgvuzUGJQV+AjuKvTPyo5M/5Q8hIpvv7nc52o1QS+9nYXkKDOx66F\nNDyUvoinU1hE02ome2C4wftu7AzvAM3+7lCIMZTswbLFtwk61ejWXYJ7xGTf\ndMto1RPuCyDlv4ExLGfA9+iuwjAeIwlKQdghWFMy991jRRew3njUx02CUjK3\n31VkBwjDgeyXKlDROTcFyrwwocR9IFOiZgPQzefpyaslf4d2Z0tLwM2dHrJ4\nva3nNsQVrYWYeqZyGbOLtaO7S9ESR0HjDmtB/NUqV818hRo/AhwJJyhgun0y\nzqiIVrknjml30S3BTQ9RSW2jlo9LJenZ7woqRrRzEeatO6YgfoynUn1VGtsC\nYdRZDH97e1ce2EOTk0fFj/gXR90uE6fucyh+qKFHHaaTB6QUnSOfvFTekLWk\nFHKQzlOUXs/KhWtb6lt+e6M8SuRLFDf8LGFzptRpprT6QHetLScs2nj7E33a\nobeg\r\n=rgPj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"db45e619f759a06a44693a4ebef0db8eb6c14c59","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.2","@balena/jellyfish-environment":"^2.4.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.58_1612498960246_0.4726496218664811","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.59-renovate-non-major-aeae13b567e100544557f53e0c21a348776fc8f5":{"name":"@balena/jellyfish-metrics","version":"0.1.59-renovate-non-major-aeae13b567e100544557f53e0c21a348776fc8f5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.59-renovate-non-major-aeae13b567e100544557f53e0c21a348776fc8f5","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0c0a18cbd1cb6cd6ff3d2c74b303dea58a6598e2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.59-renovate-non-major-aeae13b567e100544557f53e0c21a348776fc8f5.tgz","fileCount":18,"integrity":"sha512-ey8884Ts6dWEUVqJrXASc1AfAmUetyu16GeMygjui23l9++ZUBCUSPRKmcdEfxHWXqODeazPid/RyGjLOUuF0Q==","signatures":[{"sig":"MEUCIFL/mqHPvgYx6sQgpmzfkosNTv/JavWlG0c9D6kcxxBkAiEA0o6czo0+Py0OfxqB/x/iejne2RAYfuQosr9bN8L6uU0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":106236,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHN2JCRA9TVsSAnZWagAAZOgQAIdvV1Wab03HPChO1ljV\niuZX54pYjcbHDfLLBUdMYPqPPy/YsS24IP6L29Xtv/L9nxkTqiS/w10W/MrH\n1mSjaiCeKs3DI2RBYngQk9gLQVhOfyKKS14zMq4fOSGLtGXzfDeTJnjpoO5P\n6rLJ5GcOlfxg0dEooMFMEKgM5ZJCba86WrHhJmkLyTqyWvtAHHsiXCUR4yC9\na8IUN0TvCr4CfGkgO9pu9Zs7JTDnyi5X57jinAaN4cz1ss32zapl2bsuljYx\nU06AOq4vvkL+wNP3eVtnF3AauM9RTP8m1eaq3JtlaALq79n0qaCjLHUThKtT\n3IEUun6O4AECBGF9EQnrITNNK3wRQSuff6fNO5CLU+OYa7bhAgAhRTu92Lo+\npxV3vNIiZvsm0oN7ZBaGBrafEpbLzJfWe0AFFIvFhk/1MMND/JySSBCwxvGH\nNvYhAStKHIRt0J6kzkfzhb2SdZdgCPsHSiI6B7KAg+q1TwH4XJZ2gJGmWZQy\n5V5MFr7vyDL4dUGkHAy7/1+8pU0wHwz1qh8JO86ATDj6WcKs19ExWkAxbJ+d\nbfZm3A9k5vT1uVnbddOKw20em4vB1HGx1+Qcyqa3E4YEcSjzChXAd0oOg4d8\nEJXoJw4PzaeG1/7Vs8dN3LBUDbZdE71i/IZ2HEy6U40+FooJb/ys95MvRaCJ\nsOHL\r\n=16nu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"aeae13b567e100544557f53e0c21a348776fc8f5","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.4","@balena/jellyfish-environment":"^2.4.2","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.59-renovate-non-major-aeae13b567e100544557f53e0c21a348776fc8f5_1612504457390_0.4543458686690294","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.59":{"name":"@balena/jellyfish-metrics","version":"0.1.59","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.59","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"018c4072dcc84c0e75b5c6f6dab2b9ab1cf49628","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.59.tgz","fileCount":18,"integrity":"sha512-9uHnW80hECEkiOSbuLI55w03j7mDPYghSPnLGplZPO0hLzmlQk7AZDXmHd8XkYz+Z4WbpYpCEPCYGr14X0nfLw==","signatures":[{"sig":"MEUCIQCU2xTbfHdtxsIUg2gAPntITdBoV2MBue1ch+dYDZBR6QIgFFE9PD5uiSpLmdMhzlN55QlBJWiRTQtjWq9FAKGBG3I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":106176,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHN5NCRA9TVsSAnZWagAAbCcQAIrwRAvgsCythGxtqP3N\nAx1+ZE/QSeg2FR+9sBy7A3EzkeLCvZ5U4qD47XdxOK9Vrs+hMShowz78VctD\n5EpGOo4qqrySL9NfTkmxbYlDk954BmmeFmmy3O/QQB7Kc9SVuQSeNvqJ/xwS\no1jVa2QjXefg+kNxgUFLzbUGyy6Ig6dCjbEX+lyWZqyTwnp34VE8hFaQ/crz\n5J4Ri0ZsfP2YRvN/lDXdLZYfkJaAVJeq4yYHquW4AH0Hdha4Snv4xu+ghgBZ\nl6se5NkNOUjCCiMYWr+YEZMDKOw1adDzOC7miH9tSliCQM5UoLLFotI2/zG+\nBs8ie+ytYhhd/C06M+eAWy5nv1Ud3hnwYuhti209WZJQS+EYZRpHnG4F4fPx\nuT7GwinENlGTNg26Nw7/b99oMBToeltroDoNcLMJrmEwcpnKs4W6hK4/c4mI\nbYqaN8N6+i0tyOkCXQ3Wmxd1AFyzK1R+0oLEpLlavab6EU3pwAtsFGGTG6cE\n8Ada/XpdOAMUmZ/Gnu/MJaUPurnYFQCexAujI/tS/kMj2WiRO9cXs/DzBlCA\nFEE4/BEj8KuyKO51fSK5Nt2AKdjoqNeTyHwlrKnDll7zerQ9eQnC14pOBC05\nJmNzRaSgBqoeHSuJX6gnJH8ZRxfymYaPq+A30+9GqJoRLnSN5wVT/XbLT6CY\nOGK5\r\n=GBeA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"076408c5c9283ad4eb9ddade1dd8dca981121e05","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.4","@balena/jellyfish-environment":"^2.4.2","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.3","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.59_1612504652616_0.1513097766092928","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.60-renovate-non-major-5d14ce6fa7028191c5c4114ecbe53acade2fda1d":{"name":"@balena/jellyfish-metrics","version":"0.1.60-renovate-non-major-5d14ce6fa7028191c5c4114ecbe53acade2fda1d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.60-renovate-non-major-5d14ce6fa7028191c5c4114ecbe53acade2fda1d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3aa5ffac6222308ef7d349ddd0bead4ecde4a20c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.60-renovate-non-major-5d14ce6fa7028191c5c4114ecbe53acade2fda1d.tgz","fileCount":18,"integrity":"sha512-neK0bFgHMdjrreuFCID49x3CRTikPf38V+TtJpOXQJMeEy2zKcak9Ux76d8j0RIWsHbfY9VmDW70s/CvsJVMAw==","signatures":[{"sig":"MEYCIQCa2o/pCcmhUdcDmEO0V0/taj2qmYCkasNnCxCiLyRV/QIhAMRN8FkFgtfDt4WqI3rl0SVTxm1saN3jTLdzcRz+bkKV","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":106329,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHYB0CRA9TVsSAnZWagAAeFoP/A/0f9EPiksUldNt8O3y\niosYbTRGq7vXkoUDHxUXFpXyE6oyvG+/B6XyocBpb8Zq5E73O24AcUYKGNlW\nMIpx0Qr34VvqYBd4wzHgqGaa3uwBGM+8AJhv0HEShkHEWJLCqEBMLCrjmDCi\ne2vMNADJ0v7vSdV44zBBv/fpHIsUQXqpGb2EpQGyzt3SALGF/9tli4YzlvnN\noK0hoiImKLObBIUYVSGw3C+JcUpQmHQtBZpduiOvs9RGM54H3DT5ZNo+5+CC\nYuluqbdF51QjUa2UH0DtSITSsTqUC3ORswJVr8cGR+fEUzteuSh+S0mwP3v+\njoRIToBxjlyHl9znVOWA/5dZhqqWOdxEYfocFLkA4ZhtY5nQZ0OnxQ6tEvwl\n4Dm2x4BtN+0+sBs7/M2CEmj4EdOpdPkw2l/cULp10LQSr/gjvi4/LXY3AHY1\nOg6+X1nnYa63nHeD6jy/qRK+EyDs2/EZjZhal+A7IswFUE0pULQHNMKBTsBV\nktfe+bCa5Y7cHcwgf8kCf9OmNBLDv89267v3KJQvHQ7HlC9ISJMYvq5lIviu\no7rsmY9fFabbP/7HKxtWfCSunlVZSJtPoTTHqF/p5eynBovgv5uq0CtTfPGu\nUuGzhzD1Mo63EEeIBP7wR6y4QlxAD6eVUaIs9X6gwCIPpwm3MHB+0VxXI/dD\nd+8z\r\n=LrDl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"5d14ce6fa7028191c5c4114ecbe53acade2fda1d","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.4","@balena/jellyfish-environment":"^2.4.2","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.60-renovate-non-major-5d14ce6fa7028191c5c4114ecbe53acade2fda1d_1612546163700_0.7410291908696665","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.60":{"name":"@balena/jellyfish-metrics","version":"0.1.60","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.60","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8c9d92498db0ab0c7c256702544a14ee5d1df4e9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.60.tgz","fileCount":18,"integrity":"sha512-eCV5WsGQEDe2iXa5w2NZ7oX/4ZIawH2+VYToGiglxWaMSqd/1iU/nezCZmdMgvZxpNM8oTFFAetwRet56H8E1w==","signatures":[{"sig":"MEUCIHF17bEWUUnDSqtJu+xPqKOPzBFZchTesYJktz9Ef7dtAiEAm2C87p9ZSEXvOkbSzW+2loOpx8D+DuD2mQUUZbYfvck=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":106269,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHYE1CRA9TVsSAnZWagAARHQQAIgrtOGsXmB095R+5pSr\nNgvRI67uAdidkhWReUtLXFw/u+wpWIv58c0OVFtUmNHzWvB4eZTSqqhVDZXB\nyz+kzugg59u8iAnRG8JKb6r5KRb9eHe4ANTN1zpiJ/uueRwySI1Cbh6RKFp9\n/x7INjpcn7FsBwc2+rNV5StY5sYseB41z86pJYXCAVlnx8jhlH6h2wodADIj\nB5wBsfLIXEpmoyYJO2m4ORJEtIziyk+MKukDktVAchoBJblK6b2c0rIDBVRz\nQx1n7IRNYAhv9waSrVfgqZTp9XRGAS7UdD9wD15MO89yJVOowUuHBC3HotLO\n/6SdUcRAd6RBB7WjcUizijdZVoFjO6Eqz7lK/wK/EB7AS707U75NcYmZUZU5\njAQUSYyCRYxM1aJJA7Gtfefkm8twRAloyWkTMuiJTNXhirLE7/VENN7GVN/2\nUrFoWzp2rsmbhS3VLjmOsq5F0xTWkCQ0XgYq1L5VHA/cg9Yzc+zX4v8F8UOn\n3rd+vXVQZiZ+IztWuwvUCtHyXERAOsvvvldQodhfTd73AjKBinOmS5Mg2UB7\naOf9Dm0JQQ6epZf7Kq1LLKEkrO9VdNiqDchdXvPxtSVYJ+Vw97gub0n82Iin\nTSdQBkHmIrwrzt1mj7i7B+CGUsA/UxtZuGZTN0tIvN/Y43LkUZCsZhpT/bfk\nv79I\r\n=pVaj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"33ef13c03ab68a04c7ff89d5883515035c544bfb","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.4","@balena/jellyfish-environment":"^2.4.2","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.60_1612546357004_0.088794960578787","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.61-renovate-non-major-69dbffcc50e45fd5578182abc6affbd12c219984":{"name":"@balena/jellyfish-metrics","version":"0.1.61-renovate-non-major-69dbffcc50e45fd5578182abc6affbd12c219984","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.61-renovate-non-major-69dbffcc50e45fd5578182abc6affbd12c219984","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8a5b67d5f1082d121721a971a171f33da964530b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.61-renovate-non-major-69dbffcc50e45fd5578182abc6affbd12c219984.tgz","fileCount":18,"integrity":"sha512-6C7/H7qI7Tt3St16N9IIGF/knRIKKQZaHqUDDTTEEFJLbOjkpZB11aownBQlWY59SSLB4b1UtZvYme3FjWQtYA==","signatures":[{"sig":"MEUCIFsHhYk4ypExHErvgxpQszUO1DmwBQQU9PPHAOdz1+1tAiEAzcltaaay3eREq6bDSR+f/YAEi7cpDT/ML5o/v1dT8Gk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":106398,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHZEcCRA9TVsSAnZWagAA3MsP+gJBVdvyTo3EkpqUY5HN\ncp0UjL8/YgoDKaw6I/ze9rEnBu53yv1xUNjH5Mzim/bbwxy/aA8AmIF6wkfH\nwS/Izk2tJxNbGwdig5p2uRXtCJIq6pFXu4iWpTdoVr2h8Mbw3pCYhejEWz1U\n1weoUF8ay/XbP4nzEd8vgr0ccSufykbEClY6Mgg5DnN5/xZV+w+FLlc20irH\n4U3EpNQTSpZY+nrn7Z9Igs3An0rudcYipH83LJvtIDzMqS4DHvmXyssbiWN9\nJoClaLJojIIyTb7fnz6GsbZTHOQiJcM0HHrawESXWH7zpEdAbfggpqN9oLJ/\npcn6iFMwPTJ/awkconvFU47d3Q3PeIrFQwc/3xAiEICVVLmztQeaZqs3izI3\nS80qm+RwyY+aky7rB5k2a+HrAd8qASm6kPUKzBFuIlnAuGY+PdzVKdXT+dqN\nftvM2PmDMtqEDNNFzz/yx+9wQZfkfLAas+16PF2WkJb03ZlVB4w17AX8Ig65\nPPqw7sdwySgCNTh7hbBXDAZSAHVP32Sxibwpoo34V4gX6Rwp8MIOGWkmxt2r\ngNevXJKrOuz1GNPrgN5c3fgxUopNZyuxG7+q++W138cC0OAUHd2hIzdKfQ6e\nvCmriZ8S4xTHbGU/cQUnc2LNvW9dSFYV/1FxKexdsZudAaSqw/LqqHjwHCYc\n3vHw\r\n=15rj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by balena-monitor.\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"69dbffcc50e45fd5578182abc6affbd12c219984","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.5","@balena/jellyfish-environment":"^2.4.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.61-renovate-non-major-69dbffcc50e45fd5578182abc6affbd12c219984_1612550428298_0.8702626842581098","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.61":{"name":"@balena/jellyfish-metrics","version":"0.1.61","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.61","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3441213276d67cdaa872534eefb2a68aa2e6e852","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.61.tgz","fileCount":18,"integrity":"sha512-e+mc/ZoTOX/OM0FILusJHkmeScfd+j6LVA+GWmp9fKCyBF/12jQij2iU5+gyx5/PyFZ/TklwHY7SJoY9+MSsWw==","signatures":[{"sig":"MEUCIDEU84cZHc8oTYD9Ero7B5hCVVGSLT/c/pUtgz3x2cavAiEAzlI06eaidDNqTIBDD+10wmqAkdYVz5tCDyCjwdi5JdM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":106338,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHZH2CRA9TVsSAnZWagAA/SEQAIPWSVlR/IRdCtZIGOly\n1Kdbqcr92Up5HaWPb3neyjBNr9gUx290Bbnhv29YOvOl+bdrwIbxyfreUlhl\nffHUXWfjr+s9z9JAP5r6GwCqrHy9NF4alcd5WOnxG/1pLT9WLG/VwJ94wGbk\n9Ai22rPDK53psR+l1EVGxOynNM10vTEHLtaj0fEY8pIpAVm7MYTN3THYXO1k\ndyMVPsskcv+QmzFygUvxI/tzXal0BF6dCSwa0vo4ZuNmZ6h8x203p/CjSulS\nBreKpEP1/wE4VoGEbHUO5aCqumiEcOZaYXDjuQRUyFxO+TfREsCFcUTZcjk7\nw3wniYwaseLBaqMlIzLn0GtUFVCE6k1Dc/+sjZVoFtroamHWj08L19y0Eh9i\nPOs+qzU/oN8r9X0Qz/vGJ6PEWFh17WpHxZXTLed99pL8doo01telCAsYkXvS\nBJU9L9gVxO8n8wAxFogv7yNQaKmdCRhccRmu/FMKks8nTKf/IpQDNAiZBBaU\nrBZB4uEs8liAjbbkZac32obuqEzc1H9hFEPEJ6cnuiSEwkAbEZQmAlbHKgsb\nl33czV7uJg9qhBaPqrkJm0tU4XtsLzMY8aQv06o5JB1mvOBgDyb6Q57eOWBH\n62Kx/YirXHQN+eHdsGo7gCZNHi6CpCQzbWlEL/8BU6q1A2KwAaaDgycytE5P\nz4ys\r\n=O08h\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"18cc55d6bbd75406eeaef221224418ae95e752eb","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.5","@balena/jellyfish-environment":"^2.4.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.61_1612550645582_0.3905408946143598","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.62-add-link-in-readme-5cbde67fc72fc73bb1717827b83972fcfcca2037":{"name":"@balena/jellyfish-metrics","version":"0.1.62-add-link-in-readme-5cbde67fc72fc73bb1717827b83972fcfcca2037","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.62-add-link-in-readme-5cbde67fc72fc73bb1717827b83972fcfcca2037","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fb04d326ff428b9cb63124012d75b70e3cd34917","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.62-add-link-in-readme-5cbde67fc72fc73bb1717827b83972fcfcca2037.tgz","fileCount":18,"integrity":"sha512-SvgAUPwDitNu45wvg07L8kEO6+WYUqPm3FAg5Dnkw9CrRXTmPkrmVDof6eCjUri8PIdyM+zW5ckd4TzuBMaeyQ==","signatures":[{"sig":"MEUCIQDV8sryZl2K/sRGb73J6F8fwJ00Qfvg3Yc8ezHKtvYlrwIgXyQ6FHbCKLQjJmErG/yVT/T+jnmdVTFLPJ4jEI45aqw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":106574,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHklWCRA9TVsSAnZWagAAmnQP/jHGEqTg9az1Ah3/cTD9\n1dv0ouxVgX94DiMF6SL+sSNK7peC6N4oKplmhdwyifmaP3YeDhxrkHkAdQbu\nRRSTa3sLZw5hmscToQlWV8ckeSqXrDWAMlhZv7exKxKgTX0akZgxWGxDkUuA\nQ/jOx8RDgmiubjbweFaOvD6kkw1nLEEsMnSu8MXj2H3SzI/fAnOvgkV/RfvQ\nDZ4fNQs+h30MmykHVS8hIhytJFZEx9n/EO6qjmQ+NdiJNsT0MMpnVfP2KyIu\nKcOmhstu6OXFafE7UaDNCPojQcnp3CEiPv4XkeCz0NIjDqlGyBWcIiasvd9+\nrty6qRQyJ6b6/sZspZqGGtkADSjnnz4whh9ZNznhtHuSgIUGzVDQWSQhD3tA\nUzfmg3UMoxBq0dHg4v1ZWKGhIchna/Cwwujq3CAVewIfbGXr4didaVSvNjxI\nk//QhYFtCO1/xYvSpQr2P/71PhVlZ0rV+xtcyJttJk9OX504/U9cf71ZXheY\nCYNYh3A9xVHWzEp+3BqZ+4BJlMRmoFqghiLzYKQ5+DTqeVD0lEQuv+5SAlLn\nvC7Hc8z3f3O3FuGWmI59EBj/hTX5JOUz37kwbHJv7lsm/k1Ug5UmZHIrE3O1\n57X1sFaIcxQ88R26OzmWGCX7I8jG4Se+9FlaMaX/y59tuv9hoPZrKA/Nj57l\n7hMS\r\n=8W8I\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"5cbde67fc72fc73bb1717827b83972fcfcca2037","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.5","@balena/jellyfish-environment":"^2.4.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.62-add-link-in-readme-5cbde67fc72fc73bb1717827b83972fcfcca2037_1612597589868_0.7348046884184967","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.62":{"name":"@balena/jellyfish-metrics","version":"0.1.62","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.62","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"37e3463adcf608cb85267b15d5eb9c70b3d82cb2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.62.tgz","fileCount":18,"integrity":"sha512-jCeUJDt7PewuPxwhDXTlKDCT/haYLrLvmlVCxpK6otz5rLm0P99wLNnUVSSHpz0RiKqhO5z8afvW6zvza6QOiQ==","signatures":[{"sig":"MEUCIFJwC4B4IcDmxtya/L+iNvmDvtWwz0wwcuE+FHSuF78FAiEA+ZpJQVsH3Eu0g9wHUwhOwbPOnw+SQd5azu6PDoE+kgw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":106514,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHkoPCRA9TVsSAnZWagAAp8YQAJN45cP4w638woVkYIOQ\nCzvNxGcYkViWfEMBOmuFxjCsmMPFxeHqHoKKljE77flJvBw2M8XXSN9+mz0V\nz5h1CwdFXPEWvTbaKOC3yw7nQQxJZaaZvhDLo1/nVFBHjxrvQ24f8eZXuWgX\nW/ZJZcSlcXxorAx9HUiT2vkyGue/Ugi9tnnRovNquq609pjl0gb4ucXiHzyU\nO4xHnx6YEh0PQbtvdWdlJ2EY7HYae/uvBr4c85+ZOi38UCcyxBGU54P7i2nv\nVHzaDtI5di5jYx1SBwnfKJGVD3ac9E6RqSuA/Qps5rirNabDjTtUFdnl5aIT\nykcAt6VAkDMq5fLGzNN7rphTh+Dnxdoo0Lte1094UiwGMsuCkscRIR6o+sUH\nYfhFeqmBrBtFuPmXJG2JaDUsi+sdKcV9wBYwXLTQXHa2GyC4y/T2Szw0yPoY\nl8JGKSVmIg6eUhWBn+mRRcIsEU4xzIUK1kQhcqlMsKnPD7NQT0IV9ALmxyOG\ny8s8ZzenP0wF/91s7zp6DzG7PuAWE2EYEZHJAd+5rs+5qEz+c1i/dPOiuOcw\nSTBLVSOgBUTRbGIiz+Q2dB/ah+O2oocHwK5slTZn/o4cqMfiezdfZo61RBOX\nlUuYo4OA/pvUj7PEdvWM6wWW1q2J4jQka/HPD95uTrwSsbJp3HKJlDx+0302\nnKjU\r\n=MPKH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"8f4742bf2dd623a99b2eee414064344783900b93","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.5","@balena/jellyfish-environment":"^2.4.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.62_1612597775170_0.4370114556022613","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.63-use-shared-renovate-config-e42143de5b3548a75ad70c7176568ddc2a2b751f":{"name":"@balena/jellyfish-metrics","version":"0.1.63-use-shared-renovate-config-e42143de5b3548a75ad70c7176568ddc2a2b751f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.63-use-shared-renovate-config-e42143de5b3548a75ad70c7176568ddc2a2b751f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c4c465709b0534a0902a701229eb3473ad485649","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.63-use-shared-renovate-config-e42143de5b3548a75ad70c7176568ddc2a2b751f.tgz","fileCount":18,"integrity":"sha512-YvWyOGsVq5kCK1pdzPm+LKRk8nQwfU0f1/PEdcwQa0lW3AIDV7YgUjX7I9KK4hu/4Gtqa7byaqSU6FshCewcxQ==","signatures":[{"sig":"MEQCIAht42oV0sRN+ZztuOYQtRjB/2dF0iuz/N65t16TiC6mAiAPR6Ft39moWXGOfdO71k30g5EzIqAuHDrE66teQDQloQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":105791,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHmWnCRA9TVsSAnZWagAAwfAP/Rcxtk83cDhZ0PKSr3WA\n1UGGOMucc56FTqk4PEHwAPfUUcvR79aIAEW89L6Ro9PKDcRwFy9Qfwl3Tb2p\n01xn5tU3Qm4LPxpByV5NIMYTOq1ylyJX9bsDJmFH2rf2sHzZU1vdOFV/jPPE\nkF3rttwGV9NUuCxW4agipulcVap58NJ37kmddYJCYzSGIahwq5f69XhC6WtN\nkw8YaYe3LOObfAsZFkpRQdAUDV/oRBz1iLZ27esqQJLFH7jGDy4wnlkoIqOj\nV3dWsrxvoWuniBR1WRe5z02HDBy4LkIADPSynDAO0aM0eLTGRpj8+i/r8WDZ\ncD76wYZu+fA5mnAI10a4oAnU8GEFnOJp+sePogAE4nibJ2eKfLKkqIh0EbDA\nHq2jFuZNRZMwyWtVYkKcfUjtLXJ/ImYBojm2RqEGniDt4xJb+QpBPhw+U24r\ng5hDslgsuu+RqTpjCTZgihIBJEZda+tSFN66nC4dYJHCTBk8awNfaQLNJMim\nPgAD4xyfyL6msMWCSqB9xQudf0YH2F+2uKHaUxrNljNUcbrYKiz7Rsh1v9U7\nAHWT77l8UAlDPGecpEVI7Q64mUHRMqLmqRwOrqvYMkVTZewucVky6IfzdrXA\nhHhE5wIYbMNilHatQFh2vKUssK8y4p35MwgBSm4lg2ZCgfYjla47lKsny7mq\nlxnn\r\n=za/J\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"e42143de5b3548a75ad70c7176568ddc2a2b751f","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.5","@balena/jellyfish-environment":"^2.4.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.63-use-shared-renovate-config-e42143de5b3548a75ad70c7176568ddc2a2b751f_1612604838813_0.9103867731639446","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.63":{"name":"@balena/jellyfish-metrics","version":"0.1.63","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.63","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bcbfe88562c0675ead91bc87d63bde9bfbc3540f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.63.tgz","fileCount":18,"integrity":"sha512-TNQFAaVnmeMhVJIOOgQkCcuHePgzPOtrgJAztygZOWwzaqKSMd6jQsCz5EVtU5NoNVP2ahb3sF91lPp4vUgjyw==","signatures":[{"sig":"MEUCIQCXmIIskkr4oj9/AtsEuO04Iaa7Gl3RGOUg9etu8RTzQQIgcCUewzk0cJSkdtZvzDC1+VxsweqGAbM90dz21BtMtkU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":105723,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHmaJCRA9TVsSAnZWagAAKYsP/1EWkqf7s186oyleqbNF\nscb7VcrHDJylNitNusg6LtzZ/9kN3Um5+tCdqe3HEfR9CWnzNkWzP5tNOwmy\nXZkauZEil/dp0YVAyMEXdJEyJYRTXS4AIkzQA56swEgI/qWAt7EBwFsnuq/5\ngxUqCl3gLiluiiPUQ3S7sl8ymKElkyixV0nTV+r3+QJO0+L5JmNtJ99CBSGN\ne1iJnI5dqzdDaxu9ekM+d+M0o4a+lBgJZ5kmjBgJ7QTqC+A8oi24ggONhQp7\n7i/OCI0cxqQDHZrBw+Xv9ABxR8Q1y35v9MPiTuzaSBQXVYmqIhhVuWptA6Qj\nwM5QiK++rvHjmgM/fQAh0NBPZKpmGSl3a/9suQGTMMurvcs15GfF/z+bSUOm\n+PrLR7cJIrvM5IgPIHlkxQ0YswQxZz8TAB+X8ov920dQ0qEnw0jS1cXb6vUj\nMM0Q6Wr2FxOqKSABrDEOVbLetWnGT0LdS4Omc8O3hu6bkhbTazsAYMk3TjWp\ntEdxqxHAFnnPtY6IZtQCvb6pLzKbz3tmYf2c4YvL+woVHI4ktXYvM8tGBc4n\nH86eWD9HwdlDaW8iaGGpvZtdSjTYd7hu6WXfTOuTTd912TCYUnCBojWuxzzZ\nDuOo7a2TWMOcABl5OPS7YTlxCSHuaApnCX8hdKC/zAmanwf3TDOexyxI801k\nF7rK\r\n=jQXt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"34a130eef31aa8dadff25f78c497dc0edbf53bd9","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.5","@balena/jellyfish-environment":"^2.4.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.63_1612605065197_0.594442166084413","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.64-renovate-non-major-a769e42da6e4ee3defefede96b6e7655165ce19e":{"name":"@balena/jellyfish-metrics","version":"0.1.64-renovate-non-major-a769e42da6e4ee3defefede96b6e7655165ce19e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.64-renovate-non-major-a769e42da6e4ee3defefede96b6e7655165ce19e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"02399b79cb21a127433970f44f5a4db8afe5fd32","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.64-renovate-non-major-a769e42da6e4ee3defefede96b6e7655165ce19e.tgz","fileCount":18,"integrity":"sha512-lPvHkrQgJqXvnBVr028558t8aGhwbVljQR67aDtrfZH9dL/4tjy2PICa0x4D4bR13s+inDAnunEsnP+mScZwwQ==","signatures":[{"sig":"MEQCIAi8aePyBPKhlc6C4fDGEZ3EdPZv0Ltk8RqkAgC4taZcAiA+j3++5EyTRtRBgbAHzsI+nanQOnGnpIMkPZCkQZe8SQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":105852,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHnKqCRA9TVsSAnZWagAAs78P/jgYE8AbD8bNLBZY373d\nz+bCgDe/iphz4i3pCHBXc3W3aeDbqbCeNFAZn2tdsDcDp+IjaT9I63mGn10g\nuRYJxQP05+vvawasx5PM3gcPZD3EwA2mBnyYHVs+OyVVwwkdnMspO0TddeDO\neLMsCkhHloL9xaveWyns4lbXwXuTghHjU6SZsZinyGKMxr8tIar4/Hnv1XjE\nFQLx3x9afBJjbdC6kufj+L2ED80cHGtItNkRoCOKoKJze/BPZe9Ho/jIgIpX\nch17ppAFRopXaTOI2yHPZm1N/m4z1PmiXFMEpzf2cKw5kGpTTwNN8u99Q5M2\nQXUquUG3nwDICTqeJG83hyA4+NdI3M3cy+h9Q0deXA0GqkqVXqbclbPope7M\nOVDsczf/KqK6xIVe7b1mzOCqboTSjTkakKW0Jyh5K6IfxxTXZPc3h9bn9CFX\ndXoYjNt2qpAAS+dDx5LDOTC00oCWn5HqHzqZIw9RRA1hkJ0O51c8ugzyE30Y\noKrzHs/ip6S7rbeuLtd/aWJsrjZ5mU7b981mSQy7xEoyS5BfzfPgjHXPfbQ+\nkrGzxt+6wajUE1o0rWvdtZ40bFtlGt77OqVd12KD4kkikcBYoy62tmKCc0/v\nICB756kK6StMFKRmjcxGuFASt+Kz9d7hEBOAxT+V9DEMdOR+1xGAa6BCcJWe\nto2W\r\n=Ms+w\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"a769e42da6e4ee3defefede96b6e7655165ce19e","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.6","@balena/jellyfish-environment":"^2.4.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.64-renovate-non-major-a769e42da6e4ee3defefede96b6e7655165ce19e_1612608170192_0.12715130485715043","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.64":{"name":"@balena/jellyfish-metrics","version":"0.1.64","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.64","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c8932b738baeeb8cd92f1382c2e8e141e9251245","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.64.tgz","fileCount":18,"integrity":"sha512-MgOc+t/SoFCFyy0bTsDLAaSRaseKpt5HcL5l2pcQSjs8WNI8NHmDZhL5MZ6Y3xfkh+QSkf1JHUq3N9QY4wrEfQ==","signatures":[{"sig":"MEYCIQD9nus1tDA1gROlBvQhIn483CLLWWi7LC1KeM7Qn5H+iwIhAMl6N1weNuv79wr3StkF4P8Qb1BGElQygVhSz45vQsj7","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":105792,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHnNVCRA9TVsSAnZWagAAJSgP/1dP4ZAtyJHeERfn4MUP\nsrxF0cawUpP3Q0Nl30WJdGPFoUiuPiVLKGZYmTJDs9RALH2K7JeY6OrTzsYq\nEUmU/xubVEaX92cQD6yLhbJetNntMycb2yhjXYyKWhyD6s/YtkUXwquqBh3a\nRegDisQKJyBfGUjWJQsjqBejpURJkVDuSOiNIziTv4SuTH42xVAyvkvRCYZu\n2WxkePFGIevqn8pRhceJEISaJhOqLrLfKxZmWxQMaRNpgAEBKukRKtGVrkHD\nQYj6H1HGvTXOeGLL357ImRJCieJxLLiDWHijel6zYNkrgrprAhNvHIpYZKRP\n+f2jph8bRlkov9FjyE/k6z2y7G2ezrC2NwTKNbCyZlhkmtGx8sPFYrbL3B6m\nDuZrE5Qa3bvP/SoEdZVCrEOoS2+ZX9PS+pB5gWq3t+1BY7/IZyPPLH6/Muzj\n5D7+7FGtb3g2WY5/bxDGLDkArfpABbo/7iCC1+KxX2bQrQQBuWDGc3gJksL4\nlQ4P2bIsddHibvMK1Lc93MnR5ZrflWfO3K0kbVlOoPEYUqNiw4oT0GsvIB+q\nEYLNTCTVskhww2UYUoYcaqZWfYnhrIOCw+XN5uQIUfMqAwEtLyWQRjHdzrzN\nTMjd2yXgR0CaKDvEKfI6/ZUs7agTiwkDpJTKm5yBcx0HVSYMK17Usgf7704/\nhEVD\r\n=Z2Q9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"d5c32a3c4c4c18ef666652a03d0d80ada9389b41","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.6","@balena/jellyfish-environment":"^2.4.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.64_1612608341004_0.6019927052136318","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.65-renovate-non-major-698d74d3080539e5cf7b509ab1caea9e33c5b202":{"name":"@balena/jellyfish-metrics","version":"0.1.65-renovate-non-major-698d74d3080539e5cf7b509ab1caea9e33c5b202","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.65-renovate-non-major-698d74d3080539e5cf7b509ab1caea9e33c5b202","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4f9f0fd388a2c10209f07653c2220bf9fe628e90","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.65-renovate-non-major-698d74d3080539e5cf7b509ab1caea9e33c5b202.tgz","fileCount":18,"integrity":"sha512-f0Qf1ZsiAE2jH/S7n89yp3iLyyjp1xs4RpeXj3Qt1nj1N78VzItp+990KGmaFknNUdD97a67RAuRliFP4paUKA==","signatures":[{"sig":"MEUCIGdLLo+eWunrmcuqPg70Q96P/LBdX0fGCuL5cYXZy9+CAiEAzwHOfwxdm5ik//edvBesuUGbwCxxYoA6LQFA8FvIULU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":105957,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgH7ckCRA9TVsSAnZWagAALJEP/2l5YGUiijM0WH+HBaKK\nBjazpCeKhPFQ6BKF4+ana1rhE2B6ijKWZbdxYWzYCXyb64rQ1wtjA0SgFWIV\n4PyOGw7aB7L2EdzYZLju/dDqTA+rIThHavIPxlWmOTeQhgHp8otqNGUN0/Pl\nfLhLUpNJrFAUhScuZYuByjLawRNyM4zkjXNL7TEbziyVjXw/ep7NVT9YviUJ\nXoFCyjzxDshX50p2QwZvIDavx7AmDpnVcgVuLjk0DS5D+fB5fPUUVKYm2det\nXThuqPClMBtrzJz4g13UB55ELEpmxRx4QgyKhbsi28KxIOaUbDztINPinpkc\nSf7X4Z4zXp30E/rkfkmnzlrMKouUF3JJyqQhqLUk7IFd2u1bwSnph9JrU1Td\nIzdBlO5Vq8wX26vXZqVgq6hEKQChEiUjJBDdQSRjuUiT6rY7r5Qo9QNQyR2+\nFlZFh6zHN7x4R/I9q4W05Bsp7sEcUjfcKZVbp0s2DOd7eNkLnz9WHtnVfggH\nou4mrJv9UkRR52vSUWhXTLbv2N+iDl5hjPJi+4cfRmxTzvxuhaRHmv1lwBC2\nd35pPX7LtJ9plaI2kDdV2k/xU65ttfqCAt9iMCa/e7cNUlOqeqF7uhHuB6e8\nrD76L+POVhgNaeb7niZ144TGuKOhNlJNZ6aTAsKSr8tkCXNn6/vUqySv3XPc\nUV6I\r\n=EVtG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"698d74d3080539e5cf7b509ab1caea9e33c5b202","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.7","@balena/jellyfish-environment":"^2.4.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.65-renovate-non-major-698d74d3080539e5cf7b509ab1caea9e33c5b202_1612691236385_0.6105251489543726","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.65":{"name":"@balena/jellyfish-metrics","version":"0.1.65","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.65","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"47cb25f0d05ffb209d02f70f33574b3ed7788514","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.65.tgz","fileCount":18,"integrity":"sha512-Kwk+xJtr57HUPagewNEY8w6L+Sxk5Zh3ZB9GX6m+8dMBz8OtFmXCtGm8TcUrdXihwl7BdWkpEGaumsJ0OXT9eg==","signatures":[{"sig":"MEUCICv1+KXo+qukipELZxGrs2+hp2edJgd3tloBKhaYArMhAiEA71LG4NJxOyj8qRdBZUOPr64nmcmOgCO8N5pOZtkN8t0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":105897,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgH7faCRA9TVsSAnZWagAARukP/ipNhDzopcZOhyqJuelz\n9lkHaOYncaKdS+riTCzSiToJwKveagHBTD4kpTPm/6Y2dTXKY6jYFGlnlDx3\nVW+lXOiZPkVhIRZ+wlB1eBDk31lfS6Ynyg6xJr0MKPAQkOUimFC0YGqoQJGa\nJ0IbQRqzdXdK5OUbCFo7W7c1Y3/mROHr3GjVJPLXv6nsFDRS/il8wGirj5ob\n7Ih/v3SStpjbdx4fRKUaer9oqzP5xWPwzIQed56YprZgXJJ6pyOVDUctZwmu\nHNLzXkyhvZBbbacFusDsU7NezRNB/gxuwrPjtRDGHfrwTOpipLDt2mfki6Ef\nsK6XSuuVUI/EahD+SCNvcojiUPVr+1tOPQnbJBip0d5vGB3yooPnWwUFQ0w1\nw8HjndwnFSSW5ygkEIwnQcI9pu7u4ogy1YjEqGwVcITKFrd9B2cKYRKdL1Sq\nQd+2CD7wU1ozA4sGnVOHjgVMLWiwlQ2pctscb4PZMc2py0JSad4A6hs/oGAI\nCpc50SAKigF6Ds47g2sOsgvEgk/ow/U4Nv3pl45JAthFXhuY2bjzQm1VKeVf\nV4mamvXyqyKV38q0M4k6hUxK039xZ7KPnz3ekzZKmDFUJWrMqz72nzFNVCyp\nKoQ3jJAcc+obMWpXB5vZBHjCZsB1KLd//EOteJe8jlVzdLYKDmiE0hHSS0wf\nJNQk\r\n=C3ck\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"4a85ea58abff76150a549f8b3025b420e473b031","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.7","@balena/jellyfish-environment":"^2.4.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.65_1612691417601_0.9148435660709746","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.66-renovate-non-major-eacaa58b213471375d95f8abbd0c0c200494a7e5":{"name":"@balena/jellyfish-metrics","version":"0.1.66-renovate-non-major-eacaa58b213471375d95f8abbd0c0c200494a7e5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.66-renovate-non-major-eacaa58b213471375d95f8abbd0c0c200494a7e5","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3a8d48035a1146c0adf9fb1f4160b071e3c6948f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.66-renovate-non-major-eacaa58b213471375d95f8abbd0c0c200494a7e5.tgz","fileCount":18,"integrity":"sha512-yb37qTp7DRUVpk1S101lb0knL9EUfPrJniG5kIDkJJVr/J57aX1cIp2zMwPWlF+J/c1hPVeMq0K86Z1STr/YVw==","signatures":[{"sig":"MEUCIFklzb5KQ5s720fTlNr7MOhgDP4RySm8xxF0aB+bzZCOAiEA5ydAtV6hIR9aqDckcCUk308w4I/Yz8+E0LYo4UKAdIs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":106058,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgH9ABCRA9TVsSAnZWagAAarEP/RuHZdTo52QBMkQ5uRGo\nxAiom7pMliZ+02mtMbnKpT6lJSlOEi70nd0FcOoMNXDVU+hHRZQ3yzv/LVZ1\nW9cF2siyMNlG0A4TB6ZMaIA03FrC7YK3/iypyGbzkEabpsxJYLpBMJNQY+33\nQ1X4y45W7cn2+Nf4A91pTggORl0XsqTbmU3Ceitfv9EffsJ7vV1pG9kSfjgL\nHZR9iXqa91WhmJm1ewHn+xclcMLOmTLKl/bV8JIW3cFEyU+a5NsfrO8rvdBT\nFtSTTopKadLFWNo58NEVhIMz8l/NShjGgAHt+TqXtpv/Ga1cp6WsHVaTYxt7\n1oC6aTvUc+4PkgNywXtpiLnDB1tD1+VjEFsZkuT80ULDiQ1nUYY1l5Gol1C8\ns+kw54Puug8TKhDTp/k02DigqypIUAlejoQ85wAGeUw7g5ns4yvrHn+kU1Qz\nhsZnFTxlRRXccr/DOnzfu01c9rGt8b9HVZtOUMrgekTgOmvW7MuwuhYiesqZ\nhYXwu8U9EkXr4EeQAdFNhb7mWxYALtmRJrKaS7cdp9baFRwTWCOXOxEzqyqc\nuUZz7GQVRqTRC+dR+Cl0iPAxMYgwZqnEhlpgeYTp3n7x+vFZGECJbDr+ixgG\nhDp+KsIU76oOxEffNP4YvKonkhpSGokORf6Z9OBklUPAuAVj84tVZ0ycdfQJ\nHe/S\r\n=goOu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"eacaa58b213471375d95f8abbd0c0c200494a7e5","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.7","@balena/jellyfish-environment":"^2.4.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.66-renovate-non-major-eacaa58b213471375d95f8abbd0c0c200494a7e5_1612697600757_0.5282088165153058","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.66":{"name":"@balena/jellyfish-metrics","version":"0.1.66","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.66","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8ee79391fc04f2066d45efe2fd06032b62dd028b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.66.tgz","fileCount":18,"integrity":"sha512-FAGq2OSsA6yOEWmtphmS+0HpYe1ZSK7APG4G/6JWdZ/ry1ErYTiYUYJXFZ1FQsIN49axHX0kI8/Hl+Wm5BL/PQ==","signatures":[{"sig":"MEUCIH+cpYui6NieMvQ73wrJ0hz0LA8mMw3B9kL+QQekQc7LAiEA06DzX92/X5JwDuB1RcFDlxXLDo1hmKSCvEOVbmyunO4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":105998,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgH9DCCRA9TVsSAnZWagAATBsP/iTOw/LHlv09OEGiiSfF\nyfwJ18WhpERiZsMXuWDpRZHbRoRAxnU3jLn5MVOuPUKl7afQZgHIlGWydrSa\n+SZ4lqwth2qfJJB1cUkPRcdEPQT2QmxZicAxXAr4YYTilSJpTLIMhhyAcvpF\nx1+6bIGehisUunXRgMn/eDLWnNq67sDfiH9WQxV8XuATsZEEyzkDjn3NFwh5\n5dqGmsmKj75r7t6G6C1F4Epa1Je1Kj0vMUk8ji/7ybboNvn7LtItScOnTKWr\nD5qUTPRsBfTygOiIa0wNLG5/cin9mto7mvsle1RFFz20vOGkP6BdaOuld/MZ\nmmB4uOCoshMk30u56A1/Z1n69REoSFMmRS6Lm2cGYpqH652kFpZw/AwnSqZH\n8O+we8Pm1t8/4LlvwGqldMDH87MDtbXd4IWLUEuF0W1uPPddbnSP9NiyDGVC\nKIuT0kiBEKX0nwYFARiLrUJXydy3YLSTi9UNpwcixhxfB3lLvsAG5UnLGhze\nFokUmSmuAWinfbZ3QdM2OaaOchIBzBOLK9XuRRX0gtgqP+no7OewiFRfwMnO\nQhXGxQtLnCOyD1AYj418hJF5JgIPRJhw45RpODjip0CL84MiUTClkpFmZ9tD\nkM6RgIfjqCgvXTHgh3yAFTjaWfQVkoFcPikWm8792YwefoIKQGgcE2livgXu\nPszr\r\n=sfbt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"7aa7b0f5d83990aea2279cd71e1722898e7a7d3d","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.7","@balena/jellyfish-environment":"^2.4.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.66_1612697793888_0.8852661035144389","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.67-renovate-non-major-f2294970a98b21a60d6651007557043460aa0f53":{"name":"@balena/jellyfish-metrics","version":"0.1.67-renovate-non-major-f2294970a98b21a60d6651007557043460aa0f53","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.67-renovate-non-major-f2294970a98b21a60d6651007557043460aa0f53","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b8e0b0a27627aebcc67a044842a7bc2d0105fb24","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.67-renovate-non-major-f2294970a98b21a60d6651007557043460aa0f53.tgz","fileCount":18,"integrity":"sha512-ldSJ6zbXiC2ipWolsucKuD/+5B4UDp+olHHw9YbSvi28JQk1tIa0a8i7BF7VbNT7Csr+E36QyT9Z1cXTaj+szg==","signatures":[{"sig":"MEYCIQClyRbFhFwNW+FsT+Jq9lN0BWgbgSxd5qQF2RA9uEUmdwIhAI3U6ETKf0cP33VcPWDb2Nh1LfKVxotSB/edJY3UsAha","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":106127,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgH94gCRA9TVsSAnZWagAAImcP/16XbI32l+WZdGDdetNC\n9lV6QwoyFyNfa41xQ8ZoxOjOrKRzibXaumbz9qXbhd4e96ZfiQe6s3sOdWye\noU7xrZ9CDH6Jkgv6nb96FK0O2suRCZQYxLvhfE4iLHlHSPRJ2XYk+PaW7ug9\nL3BuBMwuW6RTelgsAVl9f3edWDxGKZaWsyyFZVmijrkmsmvewhJ11uJHvY6j\nLiTZOnsBhXXA7ZZlYFRWpUHdINqD2auv+MBX+n/KMkf3aByl+vQH6yR8q2s2\n/D13nVHIXLqUthkA5NY/oJBkjY5zZHUNsJrsudx7XQ5h2aEeZAbB+Ar5S1nv\nEOgI6VsMNrUndQx2rYLAHLJgF41mJhfWoR4bvbSVKskAi4lEewCVJLe+TEeS\n2WGYGgWyICOQQbQ9p8EaWIFNg3ikXoCLZypK6QvmqXT3TfYmzkwAlG8TfVCw\nkPG6NKKwv7r5QwxiYGFiKky/m6qSrWXO4vCYISjv4r860RXasrxPq0nkOjSm\nRAQ7MKkiqpKap3M6TAfcUtKR5R1LlTPoBVrC35gWqNl3c+ue7JuJMe3hPh1v\ngq942G5N7Yqcj/HOsg/43yY6302SuYv9gXEyM2EpI7hd9W2QQuQ3Tt7SkeOQ\noMbC9kUlrT0jvdfjKkmpliTiSyCNMAt0MQw58lc0G6+nEMGJaegC75ODwF2A\nhnEP\r\n=NrEH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"f2294970a98b21a60d6651007557043460aa0f53","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.8","@balena/jellyfish-environment":"^2.4.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.67-renovate-non-major-f2294970a98b21a60d6651007557043460aa0f53_1612701215680_0.10470474407942998","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.67":{"name":"@balena/jellyfish-metrics","version":"0.1.67","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.67","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"dee9c86972d910c76c84e56462fa4bc4730d97e5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.67.tgz","fileCount":18,"integrity":"sha512-GdOhFYxtf9q1ME+DB5sGh0kC8jj4eMKxB3YdZMl/x4L+CUZC8LsX62bEds8PBiyMlh8SYKjWNv0vsR4d9vWehA==","signatures":[{"sig":"MEUCIByVGZjcGYlT4fqb0bNPduNoxnkKd+BzcoQHcIQ/4DXGAiEA6cxaOaQuOHM1Rb90cT1pxRW2w+rIvmieBSrbTKlTYY4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":106067,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIdewCRA9TVsSAnZWagAAtJkQAItlBYWBS2xy28X30w3t\n8pRyZuzh+kzcf5JoN/ByH7rFKDsEtxNmoPe78Jveqy0lJWqXESeICmHJ3ZB8\nWEsyT0OEReXKiRTWHKXa+j01Jkd1zyziMZbWqdyBgfB1GXT+3rwMqLZOlBl5\nyL+yM5UyLOn7R1HAx45pLqG2gFcLmkSni8W/dE+f9llYvJBc9gUEa0ISghvt\nN8HJ+qLOX7EJ0pQwUu9WcW8tqa6i/Fg6hJ0GVIuiUXqSzlB6lCA4W9gwGXtX\nwyH4uaGbfe+gL3kznVt4fG7C10B9XrvX65ugoCxnHR0wP65U3tXn5jDxs65M\n40iVzggkt7+wn5WaTynagXTslndqV6nnAQEBx0THtDCgYCkxQACH6iA8ibLe\n5fYYgGQPVzT4Q79r7BfnfssgA2gcDGmm7xP9Z4AZqRzpDsDDoVEx5n/iKygZ\nhAa5CBgGf80Ujt6M2HTJE81zSie9M0aeiJuKs4n2/0aB71VNRsmiGqtR3Kr/\nOf1eKsfugg/o+ECohY4ekr5cUv7SJkesXMIrBarC6T5HdNHnBSOKlcl4fNgh\nk2LmaH3pmEMGiILcEI0jf7SGr+qBijI3Rk5cAyHz6HSYoD2oiik5Ffrbp/qY\nRiBabNQHXVjbfcE8zspQfB9tL0YpSjDzR6wGOOOB/oXP2mBtZ2NCnc2Xb+a+\n9fIv\r\n=d1FO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"96e25a9f151fc50a689ff58f167b6d23c65b5301","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.8","@balena/jellyfish-environment":"^2.4.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.8","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.67_1612830639572_0.0011079949632395447","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.68-renovate-non-major-2e786de9cc152ec97fb500f75464b867eac30094":{"name":"@balena/jellyfish-metrics","version":"0.1.68-renovate-non-major-2e786de9cc152ec97fb500f75464b867eac30094","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.68-renovate-non-major-2e786de9cc152ec97fb500f75464b867eac30094","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"91387453032fc117c80c55822567a33a8c598abe","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.68-renovate-non-major-2e786de9cc152ec97fb500f75464b867eac30094.tgz","fileCount":18,"integrity":"sha512-74P7rLLXQ+2ne1ZLPSg0f2O9kuqII2BnlTkBosAw9V1QVL4C0+uzKr2KSYcjYF+tWy91Xs4e9ZGkbUMaW+Vm1w==","signatures":[{"sig":"MEQCIE2uUT57BhRtEjw19YZgIg6qGaSP1mACsKUiyqnz09VZAiBNBP6dkxcmI4xNLzNseJiiOp2sy19W6K17FGok3Tt9gA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":106197,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIdhZCRA9TVsSAnZWagAAM6oP/ijTv5G8GW/MRBfLhd39\na2HtMGFvzrjh6RrOXUVwti5vC9sHv1THoHBG0kcWfWZa/rXtfh4l9I8EgjxY\nRVa948k7lNN3C50mJKfktEaW/HV39apqlOLVU+8IIV1MtgXSzyge05gzdvxg\nVBg5dSwjm2Q1y8xBlwbeu1iiTJMKZK0LarJyNtmmPXOLxji9Lu3kKYiXig+L\nQmbE8EqfqXShU3FnnmKNt5l1Po2leL4ibk7Hsg3r5L8O0fpyO47It1TsbHyC\nz4FZ94rzzXe5rHuFAD2tHEd7MOZcp4llgsFvrsdmeViesxgH0l7Z2vxkDHma\nGPcArSH5nKthptJ7Xz5G6qY4if8jJoTgmhYGrayHuyTZkoi6gZlEw9UeGQDi\nuJd8fNu+J1os1q7UIga61yy3TEoITDO+Jo3whElpXMvZRNHQ6fETbvsV3oE+\nAayKIXRjJPRtIf+fD2mGZR8yoC5GLytmW5XXvfk5uwdDqvByS2QRJfc3qiqh\nPHFBZQOGErpRyYPfXDsZUNLLMtDJ12g2vXRZJdP6IDvNg0yJZeVUv5w9+xS9\nokW8ZK/vMvdrwHrcHLyfOCAbXBaoyQoQGz0VMrIt/7Hl6kVj15ZTLHOoQ6hI\nj7sNnsxysf4Dp0jmzqhyX2T8hWdmWmL6I8JV+rsxvPDcs261Klmm+c2fGdL7\nZiIR\r\n=9J9p\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"2e786de9cc152ec97fb500f75464b867eac30094","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.10","@balena/jellyfish-environment":"^2.4.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.68-renovate-non-major-2e786de9cc152ec97fb500f75464b867eac30094_1612830808791_0.951531893731344","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.68":{"name":"@balena/jellyfish-metrics","version":"0.1.68","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.68","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"372bab830dccc3a6da168116d06a8d7d1be39ce7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.68.tgz","fileCount":18,"integrity":"sha512-8mUQNNIHeTNcwbyb3cf2e9nTH5nvocPOB7Xj2v1NaeD7xgxAPpQ8togre5QqzaUgss01lV0sK9CyCDLg6zEvSA==","signatures":[{"sig":"MEUCIQCQKrSEwkTHdvUU4HKOHOAuH2AOWw0jG7wvCKjUZ9FcZAIgPzrgCOek/PEznN9dkqd70dgyFKvVe2k3IvSSf9cKyFU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":106137,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIdmWCRA9TVsSAnZWagAA70wP/0gw+18HVhYPl1Dqjf1L\nDjJRgwIfK1BE3tHl3b6iNnql6htXelV+1Wam00vb+C5ksXd6b9DR2zAGULDG\nvVcIoDrsKKe5O0J8Oy3ILhQNzn0veY6hTY6TlpyWr8ruenZcw4dKThJWbcMV\nkhAPgPqfVdLcH27DCdcJvqkKRxOQ/ay1xQ9cqssaVtUUbLIDT/da8pqlul7t\nm41xfdaH+Y9jLSRTGgsZ2dB/1TmUcrtx8EWGIYPvo8tL/6bOInUhdOCtGelc\nEOrbo17uIkNvhAgzPuXmPeg5f+ignzzIcay5oC+5q5pTA0gV6x0aEmJ3pDUa\n4wuwNLFo90GJJPNaL/OUQFvHUVg27zcifdyHZGqGPtr4RAN4iNDCl1YnIwaH\ntud6H7JP1kR8J2+1pQVZvA8iGI6cYVQQMTj65gehAb7ODIMH228wAgDApCd/\nq4fBW+KkI4gP1txfpNqrL5pa/PsIiuRve3m23F+aB9a6Hbu/NTPmksi1sgb/\ninB2tILwWdYvgD2ntiJyFbFDMYaPiQ9Sip41wSJo9yQmlCUYa4crvqTt/t6W\njAsICBqMC31qtfY0ZVDEPG06tvvF5Ah5IGtH6mq0vOmXwZv2Tlpu6NGiwzm4\nSoZNXU92KhLhYeDuycdh1c7Q2n+Akgxp0Yo4dl3RBx8kk5zFdfolCoIiXhzQ\naTVT\r\n=BfeB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"69cf4bc9eab7df69feff4b972ab51d8ec776d4fd","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.10","@balena/jellyfish-environment":"^2.4.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.68_1612831125723_0.7048408719999679","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.69-renovate-non-major-463f830b6ab39fad2685a917c3a129f83bd1e4d1":{"name":"@balena/jellyfish-metrics","version":"0.1.69-renovate-non-major-463f830b6ab39fad2685a917c3a129f83bd1e4d1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.69-renovate-non-major-463f830b6ab39fad2685a917c3a129f83bd1e4d1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4d3310b2e710d55b39495bb02f2a5e8f3351b133","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.69-renovate-non-major-463f830b6ab39fad2685a917c3a129f83bd1e4d1.tgz","fileCount":18,"integrity":"sha512-rVoXumxmc2YX5sPOYc+oc3SZvq95r5UJVyi2lYkGgzR+oxm1fUcC7L5/Td1GW+zq6kowKAe8WOWlI2DzNXtMvg==","signatures":[{"sig":"MEUCIDeucn+tqJAHkxe4FfBLG1f8nNWakXSnAumHkbNIVcncAiEAy6KrpXRpWadJBOhZ+bg4TfoPnDj6p5XYszybbi/uIKQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":106303,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIfAUCRA9TVsSAnZWagAACG8P/iOj8lfLjSFt414LMkfb\nJ/vkE8jrsezf7Vxm4EWigo3EK8PtgZKGRvXuzPLMMypP6BW2AGzXra/Ypqd6\neVMfCMJCHtf/UOWa2fwaitAwBy5SoiD7Qc74eIwn3NgKh1YmbSkZRoPkKC50\nEZBvBBMPn9R20lXSbIsz9wbe+t+o3TycVnE8vbk+aHPdGW5d31EiBI3MhA7P\nlsDlJ3CY4QbZ3HLmRn2DXc6BwGl8inyRagO620e205EP5fI4Dy5Q7W0g40d9\n+7qJFJ/BLpw4c2jJtu/EDocnWPZ0vt2SN0BDr4xrlWwsjJN4AX54tmWbTwkN\naheiABJu+IiTvZd78jbzRxREvmRrHOcy6ujFnhmqrXLV6ehFl8155JhbjucL\nxAs3p1OIRq832sTFcLkpnSjy/aQS1brex5zdqIw1+xp78N41CTKHKGhog58x\nHfcEgwK+RMP3QQOy6jhXrMBxKTM7NwKrs25cGug9ltS2t0nXeWCLJ3s0dGJn\no8//ixrGd4SMQjk/Isf35FI/2xZAESyhpsWDzxk5ovrHphzzirfyf/qTwl5k\nC++XW0ANGzxEz/aOjjhbap+k6KN7jvAyj73xE0Ab7mF/LAexXJP0uUgbMZ3G\n41bzrjIQuRLLID5kVmxwMx/dNTAXaOeof6nhr+yDow/FkBT3xn2vJ9Pu14EK\nkUiM\r\n=wE1I\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"463f830b6ab39fad2685a917c3a129f83bd1e4d1","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.11","@balena/jellyfish-environment":"^2.4.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.69-renovate-non-major-463f830b6ab39fad2685a917c3a129f83bd1e4d1_1612836883787_0.700620127370303","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.69":{"name":"@balena/jellyfish-metrics","version":"0.1.69","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.69","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"66395dbf24dcfb5a7356ef2d9e2e08fc85594d60","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.69.tgz","fileCount":18,"integrity":"sha512-mMKybDa97Hh2qutHGV5gk5dvOtZ8umvi3hDggbpEC3NhZDRMS6DFIV6+8RoFLOdAoXiXmq/x/7chm7Xs8b/hQw==","signatures":[{"sig":"MEQCIHyFVgJEXGNDB3FquTA5biOICj+gtcap0v9fL+Jcd4SUAiBJhWxvStVfZeRdft38/agJhxktnCbqk0Xqn1qWh386zg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":106243,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIfDECRA9TVsSAnZWagAA+UwP/0cc3m0CeKKeZhhghBqU\nDhzb6S8uzPjoLLa2V/ORlV3SoIn0O9OTOHqlKLBlaMzzBgl39QueV9X8EH0h\nbk62AZF8JaN7hwD/5gKaljsW1xINbsYalrrrE979ipbVHrl0x/JevXr40MeK\nde0WBPaW9Y5a1I1khou/Za0BZo3VYWxLlT7X7L5z/qU1+VkNG3KaergnsKyn\nvupSvH6cnZEI5P9C0O0B6EYxB51XV+2PckdOvFVUZHfaukEGDEgQ3tRLGxAi\nw4p7I4V7X1COj9W/ymSyiFTs53BhqRUTvfULvwEFfBh/u3g4YMBp0YaIvnz5\nQyVDQPkRwfqnpX4mjrapt9ui8aP32VtMk7PlFgItGy/Me0SiMWrVuEwEPK2p\nMNGDuEM25MwxK4ty0z36S/NBBE5Uwp9LkMyK2dSrnJPQnK6JvhLw1DgxIUy2\n0106mK4Lo6RmYLMpvf6zgNgjRsXzYZXQ4bMX6qh1f+GMrTI6nL7IB5SU1srd\ntB5N9qODfMNMAlQOBte3Tzaayj0TcJzjZ9U4WEiqc5JsJ5sjXWMQryDEB8ky\nYtCYwLqZ1KSU07v86pGF4n4/aT3YdodDv0Upi1Vx6HalIGC23xBXyM9Yg3Gd\n7zdfXveo+/5ofk47LadT7kD5qdt2Hqmmf+a8o5urCrhivQzSrzU842oJaxWY\n8KjJ\r\n=eQd8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"cfa0d882568196971e6b3580d986bd752c08f4a7","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.11","@balena/jellyfish-environment":"^2.4.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.69_1612837059361_0.6004012857278882","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.70-renovate-non-major-6ebf89e5b3d00933a9d129190d9557c30c03be52":{"name":"@balena/jellyfish-metrics","version":"0.1.70-renovate-non-major-6ebf89e5b3d00933a9d129190d9557c30c03be52","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.70-renovate-non-major-6ebf89e5b3d00933a9d129190d9557c30c03be52","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7434cea72042073babab9dde71711314160e7e5b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.70-renovate-non-major-6ebf89e5b3d00933a9d129190d9557c30c03be52.tgz","fileCount":18,"integrity":"sha512-tN1HiYuWzSJ16gTZ5J4aP/fyPmEaw1nd63HMiTcnI2xqWcfD0h/ailGJPJX8PybM3n19nv3+GUSrAvBQqRbe0Q==","signatures":[{"sig":"MEYCIQDmA/umouPy6N7hKw+rjL7JJRCBOHyGlNEIzwGdaxqciAIhAPgDymj4gZjREGv9A5tOkVRvWyiAsJ9VirWWCFpZZMub","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":106372,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJNtsCRA9TVsSAnZWagAADoIP/2xJ+mCHwP2ZU1xPyCMz\njWSuOAHzEXvxJA9hyLzj8X60Ca3Vf6N/2/+/670XfnmVIecweFPFhldYCKEo\nsiLW0pJUBy5WF/bzp0uNAVfL09qVDVNtbPX9WS3vnvLcHNZ7QNbu4NsiGQ08\nLfkJB/H6zW/Ni9pRLiNXxliT6mFh7isIEIbSnb06+5yT0S68lwPAs4ZXzX4y\nvQKJadO/fY875P3Nxfd0JJauWsEstaOhbH2ESmKjdaWwBSCKW49aU6p7+PNP\nrw0oCRq+bDaRuEgqHfvvJCXjUCRbELZjauwxuFQedNxy3iXo/a3u/XtjwU7X\n5zx12gXqXHhKM985CI5dWxHDaO0ckP4LkfKTVtxMEAPE5VwkDl4u/ZR+O4pG\nipeg1H9wRnoKQkuQu3dI0l4TaZMVugVVhB9Ad39QRfHb+Zu91E9mcgAAOKOU\nAnrFeTfsaWTESaAIkq1VIEUaJERw96Naj0xUcG8CzqlxmKSpXIe+6m4+HDCH\n+rhLA1auXM/dt4thgQAREqg6ms3ZdHi/02vushESaKanqi0RA5dOEZ3z+bTM\npJ6Ms22ScW3Ff/41Jnu4zFMpLvNXs0cpg2hRlrDoLH1f1kxng+5oVnnCAT+X\nkiwj2vyLQ/9M0iXMdRL0uVQcXaWCm+zT+0y39MeenpjJdTOdHulSGirLyh0j\nIBxv\r\n=vW8r\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"6ebf89e5b3d00933a9d129190d9557c30c03be52","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.11","@balena/jellyfish-environment":"^2.4.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.70-renovate-non-major-6ebf89e5b3d00933a9d129190d9557c30c03be52_1613028203849_0.9763832858692811","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.70":{"name":"@balena/jellyfish-metrics","version":"0.1.70","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.70","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2a5e11ac0002cee5f8bf587286c79471b3970df6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.70.tgz","fileCount":18,"integrity":"sha512-qA+lC1jP3irtu8WK+7Ur3w6FLRYPPQCfUE3OjpnPX6jCwvdUNdQYA6J2yCT4yMSTewLQoHwJBamYhJXEZN7rNA==","signatures":[{"sig":"MEQCICUgnHZ0N7fKvJiG6S+IBAoJMLWP6OHw5vlnjgUTXFjyAiABhp3FbPsD1H+R4KfOIer1aJ9GkZCv+QiCqCi4ykLUEQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":106312,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJNwsCRA9TVsSAnZWagAAdxUP/An3YKETBxg49iZnInI0\nGVU9c8CKwQYBZGt57DR63wMlBP8W0S8YH20ahw2VwH9Bno05djg6hyGdYiLu\n/f/QyI9v2RgoFArUctrMZkaIZlRyNcZCM4S0ssA7WU+Zc8teaYiXy4LNnnEM\n8/jz59DrBqpA+ZQvBTLPYJW3Xqb77IpVfKvIbeF23kyLPnn2ionOzy1WHBwz\nOJ2xZRhGx9GyBRiEy1JW4Uyh4mlJNwbcZJYaoZcsvDoqdCYRvM93E9p/rEIq\n6HUHrceCm2ghy50CP+tIh04+duxUd6WKVeOmfKn/b9SnMvEgMEEYG/eQm+7a\nsMy7d3/wg9iTqP4d7WTukJDWUeog/3EC3q++qYVHNyEnTjRgZ8+OYmoGUlOo\noswpQGWc+q4eJ643P8tzxZLR+BulcJv3Rd3FA6LZcW5a7e3C6aArLEe9NrkO\n1HGnueB8Gu7vQsiUn9TIJiB1e3+/2Rc80O74lltXDfxCju3NGyNIF0FvdUb4\nUWB3nFpEKUdnqWEUikQTyEQ04psjgsZsLH06UHLT+amhr187Kn5jfiuvaUAQ\nHwB84MkEJdhXGYj9YuI1UUIg3esRQHEQ/3sl0bvHCm53SP0KmkTpZ3zrxYok\n/Is/z8E30Vn0LpALAYg4zYElclNSPgn5aZ8qvFdrHq5mQjGA6ELDRiDmkJkO\nD/FR\r\n=UFL3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"349112e5838af1991bafd58e81e29e26b811e15d","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.11","@balena/jellyfish-environment":"^2.4.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.70_1613028395921_0.4808126782927298","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.71-renovate-non-major-8c7bba9ea86dfe84f09fbc3e73e0a3551e4bf3e5":{"name":"@balena/jellyfish-metrics","version":"0.1.71-renovate-non-major-8c7bba9ea86dfe84f09fbc3e73e0a3551e4bf3e5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.71-renovate-non-major-8c7bba9ea86dfe84f09fbc3e73e0a3551e4bf3e5","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"80a300529f76f905303516890ba7906e184b87d1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.71-renovate-non-major-8c7bba9ea86dfe84f09fbc3e73e0a3551e4bf3e5.tgz","fileCount":18,"integrity":"sha512-BChHEa4rUWWpe+2iWQevy6+2PuHh3G3VCdIKV9w/wWPsZtqkbuaHgZ+ES6NMvYtuk6DR0NVrGxEaI3aISHcY3Q==","signatures":[{"sig":"MEUCIHnRphzLOUNa558rHNDQ9CExG83wULjyui+rxOaO7ClgAiEAiZvgvVFVpQVat9iYxLa5GT1u6zSCg+iCJ0m7/Kfds6Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":106478,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJSehCRA9TVsSAnZWagAAUbsP/2oibmABYmHWDiNavMqt\nBQhwVpHgCLEeDS+eZ+gYCrRzPQrci+KFOD3EquzeSKWMk64OnLtuCW5EZNIf\nPv6H7i71/sEbDbQ8B5etDOYVftrWl4VvHImqX6AMMoHi+e51GOXlb81Y45z3\nU91ABN8lOmvnBHN68axOYX5MoSYSycp2scyU+0Qj41+Jz4weA6zwNjCd6Jss\ndoX3e1+47W6obqP6vTi7IcgbFAZT2yYcWDjYCN6+Jyf44zYJ0wLvCmE+qVjM\nU59vKMTkQE5+RyJSes7mxBCk95yV4I6eLUUU/afeMTZResrteM6Ifv7IkgPe\n51wbAfhq8+bfkEbeh5MdouVirwmMPCK75DmwpemxyiPA4vfhV7iQy71Si9iH\nO9PZkft9mUmk+RomzfSqx1hAxxYKWMAfrPhLjZu7CpYWV2cupESC+2l/pwC/\n+UqdWE2C/xs7fk0pJTbFZE2wjqkKwFJRx2AFHGDYE1ZMYHt1rzzY4CcgrQ2v\nUdJ4zLYtGVKvDc0Z8Uk0XN/zY6PKuyCFNmi7rKJ6ICO52isPMFi5s5KI9r7W\nUxR0ZwnBg68f3Fy4qxEWODqr+9utKdEDTY/vuNydp1LytEEnfMXodjHtwF5y\nGx9sXVQJb4sSQG5m6GyKFqi5GGX7wBBTA8AdleC5j5HZJMNStO2fUOXQTvPm\n18fW\r\n=tMPP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"8c7bba9ea86dfe84f09fbc3e73e0a3551e4bf3e5","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.12","@balena/jellyfish-environment":"^2.4.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.71-renovate-non-major-8c7bba9ea86dfe84f09fbc3e73e0a3551e4bf3e5_1613047713193_0.2986421178502958","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.71":{"name":"@balena/jellyfish-metrics","version":"0.1.71","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.71","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4d7f2da8162ddf1ffb953d3c3b167be8726a9a23","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.71.tgz","fileCount":18,"integrity":"sha512-Uj85T97dU0LSi+Zy1loDyy0gbXnpPzQ90nFtkO5C3gXH1PcV9DP9HbMbuWgZUpia9H9bjH1tDUDyHnpIsbQLcQ==","signatures":[{"sig":"MEUCIQDXlHu2PDsdzaowCmdW2/g9IiCKxkHf8XbYknOs3glDIQIgaHDJr1ihN7CUHOFdEqnBUAKawyjNRAl4QGQdH0njI6Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":106418,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJShZCRA9TVsSAnZWagAAvnwP/1z5ryFH60z/7Kzoau2+\nXJjcDhd//eZGZ7QQ299Yl8vZXqssCNQ/gNRuDk2fJIIZvwLQdZyalkDw+xC4\n7NTq8hJz8yDvzaPKkXxRulktKA/q00ce6tdxAlSg5iJnL3Q5CduwdNgHXGqg\n5bz5t9AJoEO9DpHaaegUnCl03h9S5s1q1WYaFpBlWzxMQY7TWQB1ElU7o8/T\naUFbwDbB+5Z1pPxufYMWy3+f/QxSQDAl3qEYe3ImTbvhBnnBqtktqEnirD2Y\n7rVTqsovn7/XADe+cI4fGm5TXUN2JhRsHm8MItUjcVX9s26XLv6lH9wtjAvB\nBFxveqLwRY8V00fzqVnyD4PkW+myMFjFkbleZhyNLI050/G/BE+6rZ96tGeg\nFoRKvD3veaBKVYmmQxuCSKECfgJ35jfDhlVJJtkiEBmrNniw85OpnbGrk9uc\nf5nZgfdSN1Ddg3bEdsuCeEYR0yU9yolUwFEygzSkdtkA+hRfe6LfxK7vg/Xx\nUIQ6j/HVc7JW5rPLJEEa8J4al66IHkRc9znIWBIKUfWSzTnATnEcrmT2QyRV\ny+6P7VZMLlZTxRFR9fHlbUt58DT2lhjD9KzqB3rzthWE3Ioi6Wf912jS7Dbq\nBLuWMLwUYUwSVH5UaRR95fd83e7Xmv2+9Rktz+f0BU6VzQIOkxRd6naFpYMZ\nj9UJ\r\n=FJ6I\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"b378899997bcccd9128e6e33c5f4a792507b51cb","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.12","@balena/jellyfish-environment":"^2.4.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.19.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.71_1613047896529_0.5169475791047398","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.72-renovate-non-major-bc7f1a6fbb3020fcf9ee8abc3871a0759210bb55":{"name":"@balena/jellyfish-metrics","version":"0.1.72-renovate-non-major-bc7f1a6fbb3020fcf9ee8abc3871a0759210bb55","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.72-renovate-non-major-bc7f1a6fbb3020fcf9ee8abc3871a0759210bb55","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"79e78f9511c6a1c39c0865cb255997c70e9a2e95","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.72-renovate-non-major-bc7f1a6fbb3020fcf9ee8abc3871a0759210bb55.tgz","fileCount":18,"integrity":"sha512-M6G4ayAvdGoK14F8ItmvNcQ6Upx8TZ+rtEg/Cty4xjNrntb+TQa3keGfezTJUQPB8nTCKRYy0q6I3GnbTsEP+g==","signatures":[{"sig":"MEQCIGx+ct9HA8BBBv/UIubJ9tPLqD2xIXHUOQBE3lyUCuDyAiAXRZ5zEIVkml2RP/tqNeSZc8nXritI0ymoGNTXtet1LA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":106566,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJwzfCRA9TVsSAnZWagAAfEAQAJWi5uC+Gs1OrrYzYMP7\n/2IiTyxT0vK2Feu19bEGi5+gpqYo9INnNvGG+N2MMNVg13dOSUoxkcy0LLH5\nrJhGHSM+0D7XpKwJ8mDbXfDJMKPMFVLSn/aIK0qikRQsO0vVXJWPKOp82pX/\nEfXEc4t+C+65ttDSCoJSxoNp8pwgMz5phbmIG6INofBEh0B9PtIii0SYPm2v\ng9fnXsaHXTKb8IuoC+wD10xg0GQk3RTZR8ldcYpPpHgowaGo5Cqxw4XjfEOy\nWod9mOrKpgrM1QsKCKXQJVdqVQ97s++qN/OHtrXYq+Ag1T4r54xOzPpu4kCB\nAZS9hbkDrY6VK/c5T4X+BkDrD6gH+rhUNxxMAcU+trWBvZSCtlseYqY90IIr\ntSacjVqwQ08bvGBylZFf1z+Bc544Be3mIDJBeNctu1UfMY1S3jByDdE0ZZnH\nY0aWKd9/Z8dtRmYAkPPA82zlp44ejf85iVkFiBEGCJRoCC2m3Wx1dqnJZGWs\ndmFCmMOZxiaO3Q6hFx+Ptm34fW55Bn848tB8XoCvz2GpQQgnNAITRVzRaNN/\n99UdGOcv0tX5bU25hXUW+NPwu7iIS83IuaQ8ZwkzAapuZYDp+2T2sywsg/l+\nN+OMjxBgKsjd934gf7habs2JPO8gHgSd/y1F0kmCd00+1160AVEoLK4/EXqP\nmXsI\r\n=s60D\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"bc7f1a6fbb3020fcf9ee8abc3871a0759210bb55","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.12","@balena/jellyfish-environment":"^2.4.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.72-renovate-non-major-bc7f1a6fbb3020fcf9ee8abc3871a0759210bb55_1613171935223_0.24022253880829547","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.72":{"name":"@balena/jellyfish-metrics","version":"0.1.72","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.72","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"03bc28f3840342f922735d663a92e34d610e1d3c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.72.tgz","fileCount":18,"integrity":"sha512-Tff6ij97f/OjrEfqilswxevdhugFIWAKGUTjP23m7rN7WAOFP62ycc63bRbez7s2CLDWUblEcBzg8T1JperWNQ==","signatures":[{"sig":"MEUCIEW5HHQ2kVOAfOMUqaY6wbTNu/k0ZfXdUdAOb+ZztngNAiEApZelJiO0Udkc9xiFMdI62sHRMNlUv/94tHNjRDNL24s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":106506,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJw2kCRA9TVsSAnZWagAAPKAQAID+fxEzBXBlxDTU9JVc\nbPbJJVy2txEGZJBG9qC5/PHL1nSijBgrBpai6vBOW4vYq+PEAJfRbkbteCKA\nhlW8wu7R2JCrwefJKqljyEusGnduUPuXwUaMoP+xLH82mBmFLsN4vwiq/lY9\nxRD7Dxy/VzJg2yx8MBwJDWvW8CaB/UifRdMIoBvjJG6tXlgOsPgmKCCq6Fwt\nh1kLBOnGf+2IteV0eWp7v6Qr17AktQltQkMjk/biRdTNVlkfQ8ocxHU6jaob\nl2ymQX5YQpJlz1e6JEdPCN8swRD/wn5wSGNDYW56R0jjH+kMztyDmV77LYuR\nhT7AiWmfherUbarOXtHT/RsvM4ri9gIGca7z725Yms731Ei/lHKrpgO8Q7B2\no1Ud1DU3Mlh4auVgIy5pYtLIdAQTIkTk6uUd0bRHbzRQ+aAP/cC5cpfk2te7\n1eJoWBHajNGQxZYxAGET+x5hforBqTNFv72Loq8L6B3LIDfGvThO27ckEf7B\nhE5Xdvse+syzIwuM7SYcMpy7Ig2xwe1M/Rzw2pDEog1JESAs8N8aaIZAfvMr\n3FvBmkC1yJH0Arcim8VJtMWI6W3dZ6Pf85P2d3z44FNcFlRQWSA2kEAQyymc\nGgVddAFK+SsK9QibSvK/AzxTZinJug7iFw7Y06BRDg0KQz8iimtDCHyeR8JH\nKOUo\r\n=dtII\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"5808ad70cfffc9fbc0744a57503c26290c54bb1c","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.12","@balena/jellyfish-environment":"^2.4.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.72_1613172132230_0.353810688411055","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.73-renovate-non-major-06491a53394c084a43ac50edbd69c2768220ff6a":{"name":"@balena/jellyfish-metrics","version":"0.1.73-renovate-non-major-06491a53394c084a43ac50edbd69c2768220ff6a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.73-renovate-non-major-06491a53394c084a43ac50edbd69c2768220ff6a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"de3d365ffb97b69de596808cd15c5f1406b582f4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.73-renovate-non-major-06491a53394c084a43ac50edbd69c2768220ff6a.tgz","fileCount":18,"integrity":"sha512-cGnRsxH1ANE3hUg5bZorObdfAz3PfJBfCe7GAG3l1DKK8EgUIdmYVLl9QYiFszr1zMxpvPa5VhyOC40bmnnwYw==","signatures":[{"sig":"MEUCICdStLkoZgI9bTHe19ctHOY6lrQj+xV2z1UIXkSQCXrnAiEA+pH9wKPkkCdSoJ65V2FLS6hic3DCvkvF4xqCc2YpUXI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":106635,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJ0v/CRA9TVsSAnZWagAAcZ4P/RCG+kj57oIlQnyLMj9Z\n1/I0j7gksnwg1AqipUpT+1pe5+OwHbNxHMvSr11ahWnbxdRzw0XzS2s5vjdD\nNoi7fwQNPswGBuogvfv0XLCwJQLi7Q62Y7IXKw4A/DgMDzQ+c05E5ShIAjFa\npLk+WWxOTmengc1UuZ5agEdWW04OOmdzE0HQYuVC8iQqAZQ3BOBA8abqi6XE\n+IP5dTEjvKqrfuQzG1psB9tcL0JZ1+ZO9eZ90wBmq3Yo1nEvRYkfOwHYdZ4Z\n8KiSZSXLLW8HHwC7wzRJvu28in5cbOxtP+c+hKpaGFOikDs1965hlG7WgK7e\nqoOytOBP7XiSjlxs5MxJVZmDk++6nmuFTMMdGc4x6uC0eZYAd0flqdg/k9g4\n3+74IjJK10jy3P0zNd4lGja+6Yg0RAQvRcBu76hqlXsYRx+eMwM2L27hg3Lq\nsuf07+RuX9jSDeeNGTLETgJLQBSS0KvcYX/IHRPn4B0R0Ij4CymlIdvnby36\nYWERpDY+0+NnX4MhkF/fkOGV8fbOaZlBhvmr4zg2RaO+qr4tZ6DaaKudSXz6\nH5SA6Y3DBiJilx0uHdO5cNAPxqCeA7ndV5wdL2RKJEXSaLbER6cNOM4gbhZ5\njm+tRFyRA0ReqgJmZVmjeEm9xOM2CzHYuLYgYdPAqHpD/ewcNRn8GBxy7Dls\nSSqv\r\n=/gdS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"06491a53394c084a43ac50edbd69c2768220ff6a","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.13","@balena/jellyfish-environment":"^2.4.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.73-renovate-non-major-06491a53394c084a43ac50edbd69c2768220ff6a_1613188094689_0.5722894757886912","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.73":{"name":"@balena/jellyfish-metrics","version":"0.1.73","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.73","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4dd194dd6b1af05224505d6757976dc65a98d243","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.73.tgz","fileCount":18,"integrity":"sha512-x55D78/wrCTvmawXihSLCj9xqooZg1McMIe5RoeKnhmKvHoahheAx9l6weVbBaLwl+3Aicuu6YL/VkBGKGYdRQ==","signatures":[{"sig":"MEYCIQD6+We9+1RtIV4Fg1JltSo/9EYolHzPBE16bTQ9Hg3b3QIhAPeFX3dP8FHwjNc0SKEo5MydrZ7j5cJdGqg9bJ72WdkI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":106575,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJ0yuCRA9TVsSAnZWagAAd64P+wTrjF+6Gk2gkVeDM+ux\nebvyoITK8cqQV6GSD9fzasAeQMWWaV/Wgrp7SpZXqk0jYGoxddK0C6iY3osh\nyg8+T9Ym2WUGzBJPnyoPLt0MlDn54QX7TozGuVZqcqZEaTSaPTkVuwbMmDkZ\nx+AOrcSdt6lwMrcOLxp8mF56XgyhcteagEvrM/MaBV9w13jYKpDUP47O46Qs\nNE8l+fO2lXH4bmwQ0C1HnSvS4isYFBU7e7dGr5mrcJ+t2bm3WJSkphQyFKXW\nJ61iJz/PSJYIiRzesoLpexfMctQJKiNfzSlhNXQZQYm7YWmq0EZiUlmTiK5Z\n9s8jqW0AS3Mu8Wi1+NGu06meUMUxAyeX/TZKooeWsrQmMdinMsuffMQptldX\npK4c8a0jK9c4YBq4TPFkK8pGjZHy4Md5owtFVYGdw2zN+jrLaIhXuEz04K4q\ntlYd+f5VZlTSgOz2/6aWu2cJ+6vcF9px8ShF8kAGw5PNN4BL9rDCOEwvGZEV\n0H8TELtpg1wzl/SiMFzyvXCL2XhB3GCEO+oGu32dupxoWgV6vkYw+ownDGUQ\nck8Sy7jrwgvmDex7BCu5GBHgp8KkrFExCWhBOzXZWPw/P+uRrc6kgdNeSoLH\ng4FqOiG3XlpLss+yxsjV+TCoDauEuTprLDsvAqxrE73m0REzOvs+RelLWjua\nIDSb\r\n=hoO8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"76f0f39f5f5fc4ac1875084942f42a154b2f1a2d","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.13","@balena/jellyfish-environment":"^2.4.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.73_1613188269514_0.5073047190832471","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.74-renovate-non-major-1c045a40ba9628ba6ad213b2c12fa7328170215b":{"name":"@balena/jellyfish-metrics","version":"0.1.74-renovate-non-major-1c045a40ba9628ba6ad213b2c12fa7328170215b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.74-renovate-non-major-1c045a40ba9628ba6ad213b2c12fa7328170215b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e813792805e1bd34fc5b6dd5d2f12c7e7fa43cf2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.74-renovate-non-major-1c045a40ba9628ba6ad213b2c12fa7328170215b.tgz","fileCount":18,"integrity":"sha512-ouvCf0RdxuV2jseQtS/nyKihGaijEAD31aIt9DQXC+lhlXkHelrdk3N1etPyXDH3p/PZy9/PKHZqNE/ojyj8Vg==","signatures":[{"sig":"MEQCIGw9vJRddNHDD794L96wNNAA6AzfHdYB/JcSkgGA3RJgAiAi3QCBwRhugGxwcojNrAlCRyu/ftZ7zvPvJZzB/0MZgg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":106741,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJ2axCRA9TVsSAnZWagAAuF4QAKRpyHi5jQmkZbURQZOy\nE4oyF3HzrAFn8mhnRty/npy32jBKoXPTVroOfAB18JzmJvE0Kb381JdGG0dC\neXARgGwc/y0Pd6jeD8bwyL5SoajVoNOEIIqEUZxX7lIX4dC+kMvNYZ9sJ+Co\nG1Qv0FiIXuBN9kIzTigsN11NfNcbNtIAkRhu/DMofoaLd7rNyOzHaLh8wQlW\nNxbu6SCZB2aW5Qgc2Yn+JqCC56PQtn0LI5Qy4liItpB9MqxiR8efTlCGztVM\n7OW9bwa5bdQLjs+ZAuk7wH0Ta6ZPnTBxWIDofpVKV+0U+bWw21gSxfvOZsUp\nKgpd2ebJBwhBJ49DfTIXY5jhDkIuMOuogJr/2RQs9olHsnGzfzoDt2HpPJwt\nwoMASWqywu4N46UxL7D6YLL5HpKQ+EXOUYl5oHV575BIwAkdhaFUl0C6NjQR\nlTdbod5FXPgdSxNtpBXhZzIhqvIu6YfuLsML+klinDeLbnUuOV++qa2KSBjT\nSRQLoyZgFU22dd14dNsMKcTvfFdB8SjlKJLthCYLOELCXax2iPn2GqbOLJVL\nvW5G+6T4KIWUKsoKgAKc3TtY0JPkoSxViyc6o+pbg36pPOjg4xa5uUQMd8ea\nIf9PXuTmGXz0CdWUoA0UP7EImzb7uLr+fhzPRNP7+yMv/oD5m4JKaRS2AiNO\nm9fp\r\n=fkPN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"1c045a40ba9628ba6ad213b2c12fa7328170215b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.14","@balena/jellyfish-environment":"^2.4.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.74-renovate-non-major-1c045a40ba9628ba6ad213b2c12fa7328170215b_1613194928558_0.5040213413465247","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.74":{"name":"@balena/jellyfish-metrics","version":"0.1.74","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.74","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"07734b0ddccfb9f5895a6df2a496e56ae45f4cf4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.74.tgz","fileCount":18,"integrity":"sha512-SAA+XbyMWSkHPJSwf2AO6z4sFtZL8a/v/Ix140a8vBTJcKywO0zafLwdEMN+ObyCOzVVgVun3gvOETKyqG8i6Q==","signatures":[{"sig":"MEYCIQCITwBbGi6vrUhzFexatx5I4UIOHQ5v30UKVqhHRN41aAIhAI8D3X3dVQfT6205MMuL1zEsoZf2zcyW5UvEsy+EeXFv","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":106681,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJ2dnCRA9TVsSAnZWagAAdS4P/Au8iE0wf8ExyFsUAhJ0\nfiSppCHNj7FYRpdTyl/ceUEC8gd0y7H8kSHhd0Z06M+X0zPaZggmcQ61JpNO\nyuCIoYCRMcaiDVX5Nsaarc6w7bfI8SaR4Ga97+lrbvvmRfy8eMToPOIntPil\nQeAmtkRTQbctoPZB24ZGhg/iqdNh44nKbKUrK8gzRfeEzxOfEzNo1Fmi1Qrd\njfhxdYbE8R+41zmnGbdQVJCX3pMvYYCwUEo0WE4nPAddbla7Gj7Y4tFHGCSb\nBZmglk0QSvD+eZaO8ZFLqYtAnGUfITpR69dIsCNv4Xwkom71BSsp3ZfQrHRk\nGZuIhEp5wqH8jcbfb9aEALtzSnNTNTkimUGnJ6qJwErn4sWp8bekTrTcoZn0\n+ErIJzVrWUQoF73TQ3+uv8AQ03/Wfo6MZ37cwumcqoBa3S2tjIJg8/1SZtWq\nTZd5oz8bWwGSYvttWnVMPueypnjC5/CF5Qsh1+UnA15A1L4diS0K9J68W+iW\nQA6hHJyzws23S6gEWYwRHEfOgJ5w7ayv1PAFqPdc1JDfTYn74scFaeYkmEWV\n0fnhTlHzCxali9VDwD3BvLVAoF2ox/9va17Tx4uLVSfNUka2N5nKnoqYHyCU\nygfvnorF1vGzvyuMBEeG4iX9YG8v3u+AIV5VLC2t5LlLBwxyvWPEgdmRbw9m\nQTLz\r\n=4xIJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"cd54cd3e05c05a14892e83a98c89652af88d7fe7","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.14","@balena/jellyfish-environment":"^2.4.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^31.6.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.74_1613195111384_0.059737072726543605","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.75-renovate-eslint-plugin-jsdoc-32-x-f79e9ed150d847bb4e738ac3ee91fbe4d5ede3b6":{"name":"@balena/jellyfish-metrics","version":"0.1.75-renovate-eslint-plugin-jsdoc-32-x-f79e9ed150d847bb4e738ac3ee91fbe4d5ede3b6","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.75-renovate-eslint-plugin-jsdoc-32-x-f79e9ed150d847bb4e738ac3ee91fbe4d5ede3b6","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1ee0b932bf562d4ae6509a5791ee18d4576f95bc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.75-renovate-eslint-plugin-jsdoc-32-x-f79e9ed150d847bb4e738ac3ee91fbe4d5ede3b6.tgz","fileCount":18,"integrity":"sha512-TVoO8OJ+Orsk4Or/R4Z4xpy0N35WUybYDyIzJeri0vEv/rcz4Xib9ILTNMCVohJ+tJdfjsbueEQPSirF1tPTfQ==","signatures":[{"sig":"MEUCIQCHAa6koPiFb9HSJ7YYFpUSNj92acXsi5RNYPFhRWN6AgIgQss/iBOn/4droeqBcxpq9+/Z8TrX072J3ZZ8ldFRKJs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":106853,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgKgO0CRA9TVsSAnZWagAA0HUQAJNOnSNBP8AjcHSENOg2\nj5I/r5gTjwcp2zucCanNVWg7Ja517xJ0kkghoC3xTJaq8b3PG9cS95wUn+CK\nJGSpPrRu6NpjRhrMKAXY4dCXfJ6sse0FSyFPrmgQp4KG6d9bOP2fzkQbUtPM\n3VcK2BF2LY7e0Crnb6wtETboO1eTl+S602ll38VFA+p+8h0aa0wMtnrDnSTG\nTLBDsepUx0m1Elwxah5GqZwNb7uhfjYg5eXfm5SyaJhp/KdS8HE6n67k4sKG\nKCZA4pIqpW4H0uwUTVQ0sAgt8TzJ4tvgfbWg8csCriwzPAIcevaaRThH/5q9\nHAbpV+TB7+dmn/FhncD+m3CYOOTJ+kBa8GI1SIDapcU3+g2SyFdCHiTAk7X5\nRGCjQs3uJrTkGbjzPKmQWLGRl+//Y9Nj5fh9g+y4KWce7c8c5d8M7XOyMU7Q\n3+abyOpwiwvNx4s+DT3Zlgor2uNNnXhI3oFF7/npGOy2Wl598Zkh2OVJGdvZ\nY9OlkYy3fV6bvxpw7tmkwCH0330gu1ZOWxGXy6nhn9ujpVQfTm7YWg7I/9F2\n/ekK7hnNE1yTp6luVJj76x8OsrMHN+3a1P2RPaGkV+9NksLnVD7/T9BBxK/Y\n6weLEZs17AsbgM3xaEGoozxftVvlivpz9xerXfjcDqkMVnAkmCVIQRWOlury\nbN0Q\r\n=1sxI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"f79e9ed150d847bb4e738ac3ee91fbe4d5ede3b6","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.14","@balena/jellyfish-environment":"^2.4.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.0.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.75-renovate-eslint-plugin-jsdoc-32-x-f79e9ed150d847bb4e738ac3ee91fbe4d5ede3b6_1613366196222_0.9849202419092271","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.75":{"name":"@balena/jellyfish-metrics","version":"0.1.75","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.75","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ef8f68ca3fed899f35f4b4c8111488316b02e547","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.75.tgz","fileCount":18,"integrity":"sha512-B4lcHg8Ff0N5IudCofKTNb5KbUoHoWyooo8Oguct77akCKPrJwjKU1BmEW0jumQ+Owcb1woHENvIkjmW025/8g==","signatures":[{"sig":"MEQCIGDHX2c7mm/EfURyR1ibl/GLMsEv8IsmYjojO76Bc18yAiBimkKRwwZb+AR6Ch4cYBQb9qymgZ6ncQujoWWMCAUxnA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":106778,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgKgn3CRA9TVsSAnZWagAAt9sP/3xwm032aKP7PMfuud6t\n2q1+XG5p+fe43UyicuG7HBUTbx8Vt+mfo7jLnOwIniiSmjRtUIwECqQ2RcIo\nxKv/BampldojSTBqyOu1T8F3riwKXyDehqzKFo68F0tmtS8SU0+DxhjSwRLR\nKpBRUHn7fjT9DnT00a+1lh3OzTfS9lxVh8sMdwnLEa+VYHHUnJh83pqR01Oq\nyDU76tbaHU3m7kZxK7z2pyJBDptoYaebtbhxRpcMO/+4oXRjBjqkfKuWLuP+\nSn8AvAPYLWuGikzV9hby/8PxRqYq2RAIVUQJRGVKD5QAADVmk8VDsoeTXZkF\nh9VvbHvzeLbzbuHuBkBVOTAXFLEmAtJZcPwgcb0daYVrljLF8m4IUPSixmf7\nJ9eytAX61FYgvwbNjJLSQWRReJeSL5N71YVJwvJmcVJHoiHmhfEgcegR8CMW\nmjo8NDBbrjHeX7/HVFQiSYb0Df4UsB1fqlRCYEEKfFgC3sH1vUyuL4gKHIQD\nnhGAUjw1jQccoYhBFypYR8qUSMPuT/GKdvPQQ8jGfiqMoLGE31otIGnz9EAU\nX72ctSvU+UZvODHSlqUc4V0z3uP/tKk0fZ0He6ORh0UZj4B8MqSFS9tAY+na\n36UNEosGFEMXpFcAPfLXUITVGM86uJQi11Brjicms1pcBJZeM9KTZ0/ukian\nZB+A\r\n=2h8o\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"76d2d328c997cbfca1a93aa682301f0f2b3a88b1","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.14","@balena/jellyfish-environment":"^2.4.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.0.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.75_1613367799120_0.09340655264333453","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.76-renovate-non-major-e17f2616532805acf0d745a82d1c3215efa72282":{"name":"@balena/jellyfish-metrics","version":"0.1.76-renovate-non-major-e17f2616532805acf0d745a82d1c3215efa72282","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.76-renovate-non-major-e17f2616532805acf0d745a82d1c3215efa72282","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fcaaece41a0c89a225a9f09759f3952e251e7a97","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.76-renovate-non-major-e17f2616532805acf0d745a82d1c3215efa72282.tgz","fileCount":18,"integrity":"sha512-NeiKQB/qR7hzmy076Zgs43f7IPG7uVtvTTITUoIBRsRo8r7eBnqd59tymkRHyeRTtUVwCif7JpIl/prtlTx9KQ==","signatures":[{"sig":"MEYCIQDQWzztfSaWo3/n2wkgKNi/hCQ938Uum19K6PDnnVgdhAIhAMISSgepBee+Ps1ZsrjSzlD3U3q/UUEUa32k9Pq3UI++","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":106907,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgKgtnCRA9TVsSAnZWagAAgu8P/jPoYDWJ++1RqCncIP3n\nVM+ZOpeTLxb5zD5jJGXAYHCwUZQ+fuhLXliIjj38jf6Sq+Bc/H1/09nWfb7z\n4MHoOZ/zxiEY5+TXEII21KCydnYm7pu39d76ACRemHboilGNlQH6lH0yidxG\n3OOd5ZX+xZQJiGci5Tuf700/RtIUKnKjihwpGpFBH2HfiWwm0Wty4POAVqEe\nVja00FS8U//xNDbM/rBGPVDn4xFD/7uds54zhoutW13KZGMrOcrk65CYx9jJ\n/E/+Ivj8Y9rwaXXnZeVexD7Z5kLrY4bWLQT/Hbnpn2thh9jxtu6vksJF7gxM\nspxamNAVQomZpTW1anj/8nS+7SxhDIrmXLOMGyb+dC9uBoS5p1k1krkZkMcI\nSQseocBjKlHuJc+daZU/dZsyAu5V5NjzLXC4+PNjhKZCbhLUndNtGLuXaycu\nLgQCSZXfVgasryKVz9fYBmIo5oe+8J/k0zoEzV+JB+VeSibVLkAE29ioEHSm\n3hQBZljtCIFFwgBtRGktXl35HdPKa62gGTyvmNzkCWvVuFEshsUnFth4pn3z\nZ/8pdZfW0OK2eJMB2PUhZwomzr+uC7ddb9ffozJa3c7VMv5Yu8TuBELGUEqD\n2HTIujeJfEtFFEpUcoW1Yq6S184BDqxW+n9UmX3xJhy+qEPdk/3I7taFD+jX\nZeYt\r\n=m/2B\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"e17f2616532805acf0d745a82d1c3215efa72282","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.15","@balena/jellyfish-environment":"^2.4.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.0.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.76-renovate-non-major-e17f2616532805acf0d745a82d1c3215efa72282_1613368166819_0.9857788780551939","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.76":{"name":"@balena/jellyfish-metrics","version":"0.1.76","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.76","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ff57806902405c56b94f81c242fd3515553eedd4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.76.tgz","fileCount":18,"integrity":"sha512-xYjRsflLOngOfIjUz6P3fL6cn7gK4Y6rGqL4r79ChpPu//imtRDNSCX63qs41nbO6wZaeDvyYk96IGsoI+F48w==","signatures":[{"sig":"MEUCIA8Y7g8gM9LpSpVndP5y+6Ej8VpzLVCsYt1fdzZo3shuAiEAjYZZNX7u8e4vtKibjMEWXgWQjIRHPIefwzZK3i46/f8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":106847,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgKgw7CRA9TVsSAnZWagAA9cgP/06KgkSF326+P4vJZ8To\nhtKAtjzsnqB+3XsAFa0kqgujLpHECRb/e1T3LNcLlwWvxGVettg7CaEKRaN2\nldP5YUPhfBdzQKxmnioVjCY2G1YrQxWMCSteQyS6HJ5BXU2IsQki2VDBwKiv\nQJd/mMA+5vAfEiRn0DNs9laMfQY9CGmi9BIUnqdl3krLmSjj5W34kVQWi867\nnnz2ifvTDjpNCVZl6womLBHYfOJQz9+LDHgqOLMOlEJUOhZHwrU5u+VfeS0m\nrlPCC4k3f+mecWjGLbsVuhTSNsGwdwGiBwwW3t3SgHM/hCASRMcFj1+Xno7h\nDw50lxWfQIeVSK9z/7rHFfgWg1qSd+Mf15psRB3FYFehwhuMcfXaOTaAjA5F\nLsR7q/uoN99b6JSP2tNLLs4o0JPu8Scg7A+x6dSIt26PjWPPFFOjLy6FEQhd\nBkhWdOHEsXpaHEQPo+AYf3zVmiXOjCS1JbBlTJYGj+C06zuSy5fHuGiVFtGX\nefILe1AKHNhaLembtkNezQo+xec/ZaO7MBwLLN3ZJT20i+6IET2KoBO0mPig\nq5tVDCW8XJ3sz+VdY0lxDS0OtPrX9NTBrUbG+3nHFtfTiy/7A+2KjY2NZFSj\nn2t63HDITcdB/e8JxMAQlSYSIURDEqOTqrc3dkpIFZJl5VEyKWLgIJUmLYrC\nKFUa\r\n=/Vsc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"9fcef0b6e11b0f2c6f7472cc860fc38eb9cd2719","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.15","@balena/jellyfish-environment":"^2.4.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.0.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.76_1613368379010_0.13348921346359477","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.77-renovate-non-major-72207fe6091914d76beb24a9be2eeaf45f11f04b":{"name":"@balena/jellyfish-metrics","version":"0.1.77-renovate-non-major-72207fe6091914d76beb24a9be2eeaf45f11f04b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.77-renovate-non-major-72207fe6091914d76beb24a9be2eeaf45f11f04b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d8a95e9c5f148760058151ba61907573b0517ca5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.77-renovate-non-major-72207fe6091914d76beb24a9be2eeaf45f11f04b.tgz","fileCount":18,"integrity":"sha512-PYqZoPGIrKnPVREImaXcXm+CKt2sfX+lSMEFRBMNmfC0O8jsFk5oCkipd6av6EKjjRFZNcy0YeXfFWZplkfafw==","signatures":[{"sig":"MEUCIQDksY+4BhDbpIy6tTjDsBwX5zgrvLlgDP9UNjUVJQNaiAIgPgyMzGoYSKREode3HIPKQ/pdWE4L68GthBK15GHpW64=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107013,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgKh8DCRA9TVsSAnZWagAAm0MQAI+nTV9hm/BO6R2jCS+W\nPqzdr12GOxJ+XJKSegVJBQgSfmJHlAW3SeNT6nnCXcohro91teEoWfZ30uMZ\ncSPiJwrvvPiqsAe+xfZdpVIOMdAY0b4T78l3G989QacMqZ+mubI6aq7HvxLY\nfG5Rv/LZ4aCpXw0EMwQRCb/rfLfAeSj+dOMBnuMSFxiXhZPtS+H1JjRyebHp\nSoiyIFrd36X1PAn4Ncs2agU5AK7WT3naR28oD6fK0t8CJzi1DyEQHXyEKhy2\nCJA72E3YPck5MWyQaIPM7LxOX64j+uIvydHXuCzfEmRfYagd1wTE6Eean+cR\nE9Pwc8tY2dB6xeAPtLJzVRKQWOmGHZww/XWdfUO3zZvNjJ0wWj7uvMLL9OG0\nL0pCq59nVVVSgi0UDpJjJM1719ISai9TqQA0RSaO9LX52CYjcdSyvgI3kpLL\nmreMbtvWEKKu7vhixIBTLYy6FBLxmc+hMg1/MDDgnjDk7Qqxy4hivNfJVSCD\nBsTBVLWLYU3iKSO+JPqXC4/M+4ov14jX7+KE+/FOARKBgGQ4puxkttLWGvfi\nouAmrdo9UqwupFo2DoUSVct+FNbkKrt03bnlwhFFK1QY124OUOqxDHcgM5AO\n+8/c0Jd4C6QZ/H8TxQCPObzHJ1/FQRDRCO+8eEJC4d4f7FoHZ4cnYhN1joFo\nBXIS\r\n=dnme\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"72207fe6091914d76beb24a9be2eeaf45f11f04b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.16","@balena/jellyfish-environment":"^2.4.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.0.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.77-renovate-non-major-72207fe6091914d76beb24a9be2eeaf45f11f04b_1613373187068_0.7548151447955498","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.77":{"name":"@balena/jellyfish-metrics","version":"0.1.77","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.77","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c51d9e2b4eecc89e95e3552053aad3f4a0b10f36","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.77.tgz","fileCount":18,"integrity":"sha512-+LhXKBwYIjtkr4Z2hcDcXd3K1nedLhXMw3JFCGyosK1sf7KvukcELG2TFtcexyNcqfpNYXdudylLzeJqTV1nnA==","signatures":[{"sig":"MEUCIQD8h7Q9d/zfS5cSXbVnviEbkD5gEImUYLl/GVe766/hAQIgPHq3DKefoEEFhgbrSBaNEhRF6sRgr3TjT6h+5HFIgyg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":106953,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgKh+1CRA9TVsSAnZWagAAUFkP/jahHQ1yoNHchgFnLxG1\nw3bOuEsi/dQf32TKePzj/Fwl67ec+HNPFQPjdSHouJTBapxwVdo7+V3eUiPD\ns1pgJWPl5dWeilDmffK/ZWeLrthR0gzNn0oe6vHIV6tn98prDOd2Bc6O+RNx\nHLMoDpW0X729vPb0BR10rjjh0czhLan9kz0OxuXwMS7C7BVqmLc4VzWjjCkH\nBwgSBms6W1FwiVWYJflr63iizP27IkiXQRpTIFWmZLqIMG7EEPLNb6q6ZeE2\nTpYmSgVOE6Q0y+iJiQVloeR+8M3CS8p6i6YmBYk7QfG6YUv7TzDfjfombMuO\njFOvpTsi8vUL7X4he7AduBwFOIQVNLNQEcLepOeGsN4uTk/JpjiwMHLpNn7F\nrX00HRxvddMroBPUTnQtA3vN9+MwSZk1GRxEa/iuJz6AmpPxB//pKYNr/beL\nWxiJb/89cMAEYBjhUVHkVr0QoI3ap+JJJPD8naMxcooz9ITBklut44o8XvRg\nhv86LxnGjYkpTNUFC3iNthoV+MB1K9myLLa8yMyiUkGxVeG31RcghTzDDyS5\nYPo4MFyFuUp0UDx/GqKxkh8uBmtnL6sg2nykEcUT8iy6fIy3w/axzPtXV0fH\nOUcbQIPTAsfR3nhFekrTXK9xupxmVHUekNQ2tuJaHA/BHNnQ22y7T+9FTigD\nkN4y\r\n=gYDj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"55fb8da2366c603f2b3f579adc392f7eb80c32f7","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.16","@balena/jellyfish-environment":"^2.4.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.0.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.77_1613373364632_0.08959462806649299","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.78-renovate-non-major-b70f706f53e0601a681e5f29cfd28005f2b87eca":{"name":"@balena/jellyfish-metrics","version":"0.1.78-renovate-non-major-b70f706f53e0601a681e5f29cfd28005f2b87eca","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.78-renovate-non-major-b70f706f53e0601a681e5f29cfd28005f2b87eca","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2b71413a9006f33c71a2425ea56db325c103eb23","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.78-renovate-non-major-b70f706f53e0601a681e5f29cfd28005f2b87eca.tgz","fileCount":18,"integrity":"sha512-f6iz1oAqDQ0NFxirnjLvmhbG01Rf8b97QgkdzpzQqiXHse7LsWp1mT9WP2/Cl/lDMu9NbENQtmG42qwOlDYWZw==","signatures":[{"sig":"MEUCIE6nExmbJ7eFqzSFNv3FmpJBifKLyCizTdmXqb1T5vPGAiEAuwpWxeZ0psvvubsRjScJCbjmZwecbQahNzvlCLtiMGI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107119,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgKl7vCRA9TVsSAnZWagAAmh8P/1UymqYUH9PdrEmfufP9\nfiHScGalKap65LXRykA2o50Pp39Ym9DNiX0CaPzMRcMB7qv5ncbMPSHGakpm\nZ8FGYKxZK81WRj6gE+OkRvWxNrHHqPTa7fd/Sht8C8zD2DaeOhqWaOT6ucYw\n8Wl7hIIj83XSt9UiU+Y5Vov75BoaE1zQTEhsX4PSp/ZYDw/agEMyBKs5G41W\nhobwD2M9wC+Ihl+nqIy3LGJrx4NagR7qUAK7RXRFFnrLJqtl/TD2GEPtSzDq\nwWmXyRMOkTTgA51G0jbe+hQTGOrxy1EYJ8ycS50r/jyrzvUkTai/6TlZdedI\nK5PFPnJBCtiCR+fQJGyC1YvKCzdpcUM5sq9XIeu0chHmeAKat52xB5wn3+6F\nSBXA+qHniyCkZtpJ1N5dZU7eZJLbW7zDVu1ZdYiP9svNyL1J78OZwzXd/StA\nzCaU32d8oTDNg0Hh5uhnKUg090csL6uG5YddwP+Z1lz94OXVZRC2MVqGxfXD\nN8LEmGzku9Zn9/QectkT/IyR08hoGq45ORV23agrXRomDEUSoip71OLAtIwX\n3CmrOHlofqGFZKtjpJtohSe1yiKqUXCuHaqymPCbK34zL9BwX5m46iItrKDD\ncSnCgvmGCVXLu517BUv8wNp3hgCK/5dFsntF4U7pDs8n46anLd3v9ZiHL//6\n3Gm/\r\n=6whr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"b70f706f53e0601a681e5f29cfd28005f2b87eca","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.17","@balena/jellyfish-environment":"^2.4.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.0.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.78-renovate-non-major-b70f706f53e0601a681e5f29cfd28005f2b87eca_1613389550721_0.4845694570390251","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.78":{"name":"@balena/jellyfish-metrics","version":"0.1.78","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.78","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b3149bee152989ac60154afe8d8fcec99fed805e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.78.tgz","fileCount":18,"integrity":"sha512-wiFzMWIQ9jWbYXvb88nHlDq1WLJFkV/pmsI5srlSyg/Vwttzi2YC+8PTVRsivXhsZnjmOSM+CqarBD4N/OalWQ==","signatures":[{"sig":"MEQCIHu1pMhvwEH9L5Q3OmV9XgQ5uP8uWra3ohUySG+vqaCCAiBauO4EPjiNZp52353Y7DyOL5Ythb4k3zSn+KeLaqck+g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107059,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgKmAZCRA9TVsSAnZWagAA4vMP/3AuXWOxb2g/M8d7wFGT\nXm++gs+dLJ2kKrvm6qxtlZeN4SxP+HjbwYghzQ/o18nNXSqYSuMXsRQTdHI/\n5FvFVUU8W52q4lWagj4IovAJ04CS4ppIHGc9fOmV3HZ48ZnilU6iILpqYI1X\nlS32ufEbtq6AQvYngLkH5MioZKui0nq96M9ZLX0Hi7jG8fMN/wzZAjhYfpxq\nvUSLwHzit8JHUlGeoBSsBzKyeR5By1WcpMgYOQY/+tqMfebR6mJc7N0zw+0v\nhDV1fcz6mcmyUJl0p3vBeK4V8AS1kr9QkE/2XveVRp8hedRBIHFZthok5KBW\nOQVo5YbWJ+UIb327+1aqpWdnH14aarwR3WIuhzmX5B22seeTQDkyTIfFVZAz\nG/YhfSND2sASDhX0EAaFQx6lAbTUK8ZqJ9KhXffPqDq/Q/Gaqo9f4y04TcEL\nWh1APzh3le0SNbAO1nRZaUnEfnHOI8cW+LPJHhY6Em/y5qmoR4ZceAmFnLhW\nsbSLgVDw3/VrOfihhUxSuOP06pcmoy862XScsm1EoSW6Jlge5ZTbN/w1LQLM\nbaNKRehvYtbHUCquBHDEkLfbuOhQlY8svlPsAp31pZeFuVi5MPToyR5ih7Rq\ng4qh/d6IiB+TasoORoNufaySuSIYt0jPWeVq1wQeDAY2orXMFyJDVgvueZP4\n+MPt\r\n=DXY0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"ee7392be8e4df834a69b22a431f0d0eed5f453a7","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.17","@balena/jellyfish-environment":"^2.4.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.0.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.78_1613389849249_0.36342973847815085","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.79-renovate-non-major-e48bfc95a7c00c44b594906aa585e079cd844158":{"name":"@balena/jellyfish-metrics","version":"0.1.79-renovate-non-major-e48bfc95a7c00c44b594906aa585e079cd844158","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.79-renovate-non-major-e48bfc95a7c00c44b594906aa585e079cd844158","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f5b2bf14a284a0ad7a5487a7d7634b16b21e20af","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.79-renovate-non-major-e48bfc95a7c00c44b594906aa585e079cd844158.tgz","fileCount":18,"integrity":"sha512-zs2lpP532LZdZJw0hygxPGPRWV25ihfE8y5LJbpRAqsRLOzIJryFRp3S9cyNOYwaTPVO/6ozZGup5Cn/pHmkjg==","signatures":[{"sig":"MEUCICykq0wxD7WRZH99oncjnrDdpR8/Dk8WxRR5kVcFJtPxAiEA5ymZUf+ur7WeDwuuO+QgfAmDy+l4p8Uww2Vat5V0Qwo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107220,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgK035CRA9TVsSAnZWagAArFYQAIVhoCO3EGYXehknC20y\nwH+3HMtC4z+n+Bm2kHOCyHtPPojtnOk18ps2L6jQoP/5hYECo39HMrudGfwB\nEVihTOdwdN0QwFYpW6wrM0jXbVIKZLraoTj2dEI6fgoDGo7hrEwMevRV3Ihd\npz1PSbpyEwVTL9gpVG2bR+MPZiJBHe4t0HNQjWBQ9MFktbRmOgsTCQtOF2M4\ndpIIhXnPyLl1fZKz1tUHhXGQbL6nwV4AGtIvaVL66ruPCuJe8PqdmWLw5l9z\nZIuXgoEyrN3pO93rvi8ccwhiI54DkO8mIabLySYHsWiYpyim/AG4EEK499+3\nti//bPiWPkVz4buVfhAb6VTL0eZZd50EGrBmg4b4GXcCukOS/icSQuPn4iTf\nrKo2OjrY26SDo7RjUZqI2z1fAHpOmbPfPItjwbMDmUfZKxosCDY7BATSe64P\n7IKnjVMfvkVyyX9H2rn/VNU+KwGtsz7iaru6bvdf3BxbkQyPYfwlvcpPA+Lh\ndkc+LkXsi+kR6hdjSb5s/gM8t6YLE5licekB9sxMboyFUSmybNUwUh0XIkNN\nPlZpiV6iXNHV2fpqKnz/4Nfpc/poUql9X3nvg2y9MsQXaFY1tcq5Oonfx2xZ\nMgFs5s1ouCRuMbilsRHmmHhiJxjxrmQivquiZ7mKK+MfYPIEUOonoQtJvVVE\nfrkL\r\n=PwW5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"e48bfc95a7c00c44b594906aa585e079cd844158","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.17","@balena/jellyfish-environment":"^2.4.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.0.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.79-renovate-non-major-e48bfc95a7c00c44b594906aa585e079cd844158_1613450744502_0.36395284952162577","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.79":{"name":"@balena/jellyfish-metrics","version":"0.1.79","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.79","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"28e2de5feb1a2d109833c036f611ff65a15533e8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.79.tgz","fileCount":18,"integrity":"sha512-80lMGzx8oSD0LPACc9AlcIj33y8pHjC2AIcrutOt5chkYxaBkskICyOHhWz2VPq5+3jvq0Rll7CgRUAecctzLw==","signatures":[{"sig":"MEYCIQCAowmynZfRdgzO2AVn+JmnbWMSrRM6l0F46RVOWYQAIAIhAI5JbZRow6VlUyxN4rsTRcONQygg4y2Oy2CWee1A2Fcz","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107160,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgK06nCRA9TVsSAnZWagAAPGQP/A4clk97hvrviEj3Lbfu\nKl+r6b9SK+c4Vzgg9J+3H11BKCydIjM3Qjd3Gd6tH+1zSyu/DM2qz4spmmfR\nFOYkyevRpGEKdYrfqIv7kiWfTovmY0xD7O7CejSjRg+ykMkVT+bIj8Pon1BH\nx75i7F+pd4Qm6uPa10NYewfOOIyMShsXgu87iuRp3025k4sYJwNIvgP+ZFy5\n79Efx1vdMtK//E9kbW50BuGZRfnARlMRcRvyGTaHksZl4OHhU21lDuIghrQY\nGYxR4lAAEUg/9OZFRfiZtUYEdmYr/jTMO2zJUukmYwevcJOLKpKVx7V9t1Y4\nsMWMECSM67GV1q1Qvr6FqWAYVqKRMvrOYjyhXqewK3HwRMFJCxl4jFvluzMT\nGdTBe+JViBIHsmcmUgK9grNG9ooTudNuuscZrOhvUXrwjOfSK6fPi21WXiHA\nYqQHmhEu+GxMzOaU3K4DM9fsk1+hqKpp3mQvG2FCsYo2dOIHrZd3MGWTKaN9\n7nHkq/tmi0Y3HgrDh+NtNZ3IIIA6liZvV96XzamXN324HIqCtwtodQjPhkZX\nCxjV0kn8vG1f2UYHNcTBSw6tZIZE3ttg67puxcZuC7OWtIoIstZjX2dNhow2\nHS7PBdmO6QPRBYjCZpJHO5PWgvQLSoxG0ds2OW0CoOJ9SDjCxvVbuyyxvE2o\nJpeU\r\n=8ut9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"428e6fb5599c5103e10bc79de4b8c201d2f8c41b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.17","@balena/jellyfish-environment":"^2.4.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.0.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.79_1613450919287_0.2931015867921132","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.80-renovate-non-major-4354576a06659117ca0e824efcc8fa89c43e4cf0":{"name":"@balena/jellyfish-metrics","version":"0.1.80-renovate-non-major-4354576a06659117ca0e824efcc8fa89c43e4cf0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.80-renovate-non-major-4354576a06659117ca0e824efcc8fa89c43e4cf0","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9d821e61e825383718ea7a65f4833eda965e9b6e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.80-renovate-non-major-4354576a06659117ca0e824efcc8fa89c43e4cf0.tgz","fileCount":18,"integrity":"sha512-XV+LSzt+UUq7vzzOBEh4C9DblAoM+CNtex4LXemvJo1DDKphh+TwtYYmxAwLaYg4fc3zVLHtDJCh3+jU1QTkaQ==","signatures":[{"sig":"MEUCIQC1+4CvhPxTEecSaTEEm+Z3MIYmdy09njCzr/jVY7BKiQIgF/sKD6hpU+8jAyYn5Hc2I9YQVpcIz//Hk0e0SiWo3Ls=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107290,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgK2atCRA9TVsSAnZWagAAyeYP/A0oXXxb0k1fOvzFN/h9\nBl82JJMA/ZOJe6RUezxzDVLpDLKGHOAN9oUMWnWDIR+ZIZH3AQ3H/Parex/9\n/uQMHCbMhqHxL759gV+Emi1dFMwKkGsPqs/WtjBB7A3fQe5OEPSuKYZFStqW\n7v0Zpr2cZlcsSn6aFXtIxQcNYY9HiW0G0kAj2hZeze5KiBUJd223aSn4YzLB\nTTFn40Yu+IhomT4/3NBj2mSJ0OjvIL5to8BqciHCmPt4M/gH2xmXmqFqrBSr\nR5hRn62oIJetIR2ASinvKT2DOSono01oSsJB1e5X5WZOVCJpUj18Stri20B4\nME+CR1iXp3jespdlVdD/SXajUgfOdgjIAHXyd3ZXNZOSFDqbWXLIvFgzV42f\n3YjHeL4cbJnhitnRZOycBdXkGE0TlN0Za8m3mOR95KJByTKvvOelFNJ6cnBp\nZSUP9jJ7cHvhcDBncI8z+bsYUwQ1DCQE8vquJpp7LxXGNmpiAhDEWtDIseSL\n4kAHjdyC12HEp07Hr76+q+oBXnbAe5/26tkeEyFqcUhtUY5utkmI6FY9ksKP\ndMnlYXL3SqJbMmiyRAu5j68Q+YhCV+rPg6wE+ShxXY95F5x4n+e0emIrDITK\nvNnEZKN7Fi/wWHAeGSxni7G4kC0rBBSisqtNgGiv43r+Ubgy4Sq45QgTtR6j\nlTRd\r\n=Os+2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"4354576a06659117ca0e824efcc8fa89c43e4cf0","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.18","@balena/jellyfish-environment":"^2.4.10","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.0.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.80-renovate-non-major-4354576a06659117ca0e824efcc8fa89c43e4cf0_1613457069157_0.055972455128476595","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.80":{"name":"@balena/jellyfish-metrics","version":"0.1.80","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.80","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9c7418bf6840ea81c2dedf96d85742580bcf800b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.80.tgz","fileCount":18,"integrity":"sha512-1eO922RPq4Il0DrzL0lt4qpdF5lXT9cET6NodYNMaOYCkGjraJ+LReAgvbAMULhWf7BDLTCNHZHm7gQzDli6+A==","signatures":[{"sig":"MEYCIQCFgfeG2Xj/uaPq2G3sDBecPxR6sH0E3fp7DrupYW4TRwIhAPKoqJuUUBzpikWu/eZyxSiWl05uNZbGs2E0mkTJO+vC","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107230,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgK2d5CRA9TVsSAnZWagAAlFAP/23puPSUQUsUUg3AbsBa\nIvc2RTh4wdSjht0IjfiXFQI6W8vcHJxQoYpREIIwwlvDCZURiSZOFytFOIuG\nnurnHA2T6S2Bvfo0kYNRsbRu5/gKHGsN0cpXQuYYQ4mpXn39yeuh973p1f7S\n6t5dPCTNKAW9dGXwnTwJtcZBPbYQVBcZDN3BHob5pJEwBZx02Dl9BnUf0SqP\nP0JNF+8HHrPCx4zWHmEvXk1/3Xw2UIw/wrLImqO5TGlkQ2ibZzGcOeYwvS6s\nNkXDsof4Zz38yb8XdQy9Ye1J4FqyBxF2V8vU2mhi6n/qRW0D4pzHLqrNCtD7\nJvKkjutohLjkd5oWed9nY8NSCumxxbRX6ulqK/ETwdudhwuIn5HO69AdiZb0\nF5XUnLzf/L0QtfRadLWnUXUGnAE9DNWsxKgzljURPUWfOnJ7ii2zUMs6MRmi\nUNSwfAiDRAbM+6WogLBWdF1egd4x9bOm0QzmpGIEG25W9b8Q6KkT7497G+B/\n3MERCVW4QIIflpTGKbCEKIl1OGYfnbQFvJicWS51HTBImNuFruugx17JMj3s\nl27773iXNijg+au5blr31W1owjB+1To2O7HHf072u7H3GrLhuUvAKc2K5mHH\n6GB5/LJ8IWgr0hxy7w+ySUSoqxmrG0vgLf3+uh3plDwvKfT5DPk/hxE2rXwY\nq30q\r\n=Dktr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"6cefd1c64ecf607466a967392a31047204a85b19","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.18","@balena/jellyfish-environment":"^2.4.10","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.0.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.80_1613457273383_0.5561140348314655","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.81-renovate-non-major-060be9bee70fb1a0841ea4de81e2dd232f3f657f":{"name":"@balena/jellyfish-metrics","version":"0.1.81-renovate-non-major-060be9bee70fb1a0841ea4de81e2dd232f3f657f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.81-renovate-non-major-060be9bee70fb1a0841ea4de81e2dd232f3f657f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"aae2f5f127c4cf91fb579d7b3b1425055258c163","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.81-renovate-non-major-060be9bee70fb1a0841ea4de81e2dd232f3f657f.tgz","fileCount":18,"integrity":"sha512-Gp79nBf9tIPqISFbeSbr0vL0D4Z1ZLJ3xeUJhiwIQqcPwPKiVZFOpRLxUTghZbLIz9omAiU2VvVv++CLb27NUQ==","signatures":[{"sig":"MEQCIBdWUvhO1T5O/SsBt5UOWx8HQpdAk3k0xn+5TmYWd08DAiBdWP9/JqOpIyeYFLp+HoJYmJpaD4bsWEbFKAYgnJ3ufQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107396,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgK7awCRA9TVsSAnZWagAAWR8P/2RyFOszTSyKYYBwZsE1\n4zbWHO5O3J4PctkIeqj5V9l9kB65GJu4f2IdP7W7XWYf13VjSbMB9TTKGnrc\n2yr1BTpf5981FL2Qn8gysVnCIcJ52lr666Ma9kFsKL5mTOPhj6E0WLXW96Jg\n3T0en4HrBmmZhEBh2k2dbq0BdPCu8tW4rdnvCnl1Zh4jR0e8eCDEPw8pAw/l\nHMJRrdLye4/4yLLeZMHFCNqJZMVUlt/1bhtCdq2qocKY0Q6cEtSxfsabWYme\n03HU9tkqah0PV+LhGlPe9zq0FuZndam5HiJlTIfyPxpItF/GJpVo/yZFwt07\nmysjTS9dil2LGMuKFFgjNsqWfaSumJvaHjSJFZbWr+wpB2ukbz7O+SRVn6xs\nsLyg5wsVY+ENM4R4IIT+kgqs3w0oAkaUoNn8xgC39feCwFQ7M1/lwryDGK8K\nJhODDcvj1bzatcctO6SYKia3GCC8tOdE9Wyq3Nc82LsZH86MXMM1r4h7lIb+\nTQP6B9iPnj6GeKeTbc6Bz4CBRA3JJgCnVz3C8aI5boOSWluGk6XhcUzJfd7V\nhaZ2Xta4KfZLFx5J/2VrddXkLQlZLVFMxERaQU8jdQg5CYDzAJnpKbCWazrK\nQpgvJG8vqD5ovF/6Js5H1Pu0UY+TFbakOleHrBzVKADIzKg+rjd5R6h71meq\nqA9A\r\n=nnEk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"060be9bee70fb1a0841ea4de81e2dd232f3f657f","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.19","@balena/jellyfish-environment":"^2.4.10","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.0.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.81-renovate-non-major-060be9bee70fb1a0841ea4de81e2dd232f3f657f_1613477552185_0.30410136289098744","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.81":{"name":"@balena/jellyfish-metrics","version":"0.1.81","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.81","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"43536dd8aaca6076bf8af54f511c8e004c35145a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.81.tgz","fileCount":18,"integrity":"sha512-EXgM83ldVLigNV6478mn4HDcXgKDDXBPGLwn7AQAWwLKNn4sWuBi1OJlt3lDEft6F9/lnftnDXlsvwjot7LxgA==","signatures":[{"sig":"MEYCIQC209G8WmhQq0wp2qnut8EPP8jtC5VtTmeGxOh717azNgIhAIyeNEmJqnOM12NbYHp2bLPfbD31OJy2CgkXxhYRaGYP","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107336,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgK7duCRA9TVsSAnZWagAAHRsP/irotYi8+ZZROamTuQT9\nBz9EKU/Suy+NZSulleDgFYe5WjIfaJ0IxNkFwgGyf+LQW/4CC4qD4JxkynVv\nfpTI0T1NsJWXf2h2GKDZ37IWoOGw79Qf48+TL5/8SZFn65nD77P/2Oqe9lT/\n+MmVkp/+jqA/s3OMqrXaFZ+NlCXoQrVvsN1CvUSwCFYs3wt/mAXB4iuPZanx\nEDXq4Vwhd5X1U5TN6QboKsD9yar5Tk3f9nX1halyNj88e5V8XMhyIlxVan17\nLfl9p7Sm+H1n5rmt/eJ/8ukUnpvzYPd0wHhD4wK557Nt1sFR1nTyOyvJMWPG\nx+GWvgB7EBK5hmQGXQz4LLHs8e9qQ7ufGOvtAnz0Z5oOp/bMocewPGrN7S4k\nmlxYylt9sx5wLDXeYfOGtylEyxsnVRleOYhHRSDO0Plk422HWxVxxkgH+Ifk\n+6pHA3ZOl53ikW4xd2pIDgUrE93a5j3viveiCAuBNJzHui7H+mzQZ86/TzGB\nQHTEJZBzdmgpu5TeMl6D6ke3lr06NnOVCROYKkJqIZYlmaU5mJHTYicZfhnE\nUFj3TicGFl1Y9Ile5z8sNo0o+yw5dASgbWiFPZNLvXMqFItA0MwU62OFhOrS\nrtpDZDdWCzxqZmfy436glSXSEVhHIpi7SpvqyMiCjXkyX0fJVjZcNoKILc4K\nIMik\r\n=a4ga\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"72b05e1359987dafb3b0469a20793c6021065c6f","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.19","@balena/jellyfish-environment":"^2.4.10","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.3.1","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.0.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.81_1613477742060_0.9092790445525769","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.82-renovate-non-major-97bae07df85caaa26176361f7c68d1852855fc9d":{"name":"@balena/jellyfish-metrics","version":"0.1.82-renovate-non-major-97bae07df85caaa26176361f7c68d1852855fc9d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.82-renovate-non-major-97bae07df85caaa26176361f7c68d1852855fc9d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2df47ea5f40c1ccc079d94c68bb970ef51ed9532","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.82-renovate-non-major-97bae07df85caaa26176361f7c68d1852855fc9d.tgz","fileCount":18,"integrity":"sha512-c+MduJ+Jc59Jnn4LSkYSzxi/2+VagT3i+9u9iuSj1+KivDLi2V+GdnkxB96Ab9bfEzW8Ynava6H+TXceuAQHlQ==","signatures":[{"sig":"MEQCIDQ5+ImtTt1AGioKj+GrGoYzjAJhLnyuP7j/08hFPVL9AiBxhR8tLR4qc3F+C1VXNnLooMEU9xl78/8Y3HrQhxWR2g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107465,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgK/D+CRA9TVsSAnZWagAAhFMP/2Wcg9EsEh23IyUJiNNm\nMS3FC3DY8T6fS78Uy0BqRRUZCyLAGM62rKNuCYIbtEGd25XctlqnJ0VfGJCt\nfLqH7d48ltiSWPWFXL8H871F4JJfAvJrL2h1vaIUhQAZYWBkeOcc8/D8wNQW\noA9AGIoOvhayC3/hyUbkVnGKuM/8IRd6Adm1Zv0YneQfbjBZ569GxPLWUmzF\nfNVSG/qbX16uon2ZtmQac/FEUZDaN2XVTYAwphOtTRlpbeCV2ghbqOfzy8OB\nCY/qx8fLL8Qr+R1ztxBdgV1XM9KqAL5Reu6Rv6kNqhrbrHXoTiKy6b5UzH2w\nsQyzxlFkHpGnZdHdoAPlQ4m/xkrQzeX5jvbvmGwGcoO2CbigrtnbmZd8LWxc\n6Qq9OX8ZdDHYDRE9yZOXbkfsDZul3Zg36BhOdvwBz++ntmsog/LABE9N7ao0\nupKN25uhgBQ9+7NUWerd55UtpwIYJ/1dr6xVN4YUstZ8Bfu1cHoEZD/DHqZe\nvlepZATtiv2fXBgJDi0bzFuJSMdFgqlVKdIy235a83quPQspF2ARojONv6mD\n5QAhwIzoOPAwKsaGmmuEqQuZnrzb9hpqpJBXSrFkM11trOQeDs0rjXDuVmKx\nufhFXTehVjhxwMB3hgpk5chp0cQbsbyjcHVvtNr0vcm5eigDQa16G0xLRN64\nNvbO\r\n=qLz1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"97bae07df85caaa26176361f7c68d1852855fc9d","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.20","@balena/jellyfish-environment":"^2.4.11","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.0.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.82-renovate-non-major-97bae07df85caaa26176361f7c68d1852855fc9d_1613492477836_0.46620175938090513","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.82":{"name":"@balena/jellyfish-metrics","version":"0.1.82","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.82","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4a9e9dd09fed30d05e21c6e8eea9ae84b55fbea7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.82.tgz","fileCount":18,"integrity":"sha512-lbP8eblCrC5E+1BdTiQBjdDgcZVJkWAEiEH3EKU5/VYI3jvU62IP+6i5q4cJAcjCh/ye+IMM+1T/0t+pC62mrg==","signatures":[{"sig":"MEUCIQDEd3BeU8tCWizEkYDsEQSjs6HIkjG4qyl9BPQiedfNQQIgOR5JV8QD8l3R6Oya81wVvH55ejlytamOJldYST4tZuc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107405,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgK/HUCRA9TVsSAnZWagAALecP/3h3MAuccRaIPREKnnfX\nbQbkwRsr5DY3oh625IIWSufNjRIZabz2ERxct2+wtGMEj7u0Xrr/+TIFlgD5\nzyCBceqHfQwjkNaPuMEZYUQEHcve0+InvoIRkPkj6Ff7wo0Dp3XcHnsktfvb\nMhxycxuuvBSy07v+Bh586uUSsYdHIkVIO5X8ECBTITpaPS9Gfa0Chx2+CKzc\nCTh+fkRjYH43PAM0SBrXn5lYob1Xf5VgIejypyAnQiCZna68LmKAMeZlVY1J\nP54DlDgl3bP1yQ13tlR3dPSYAv67IWEz2LwkLmyD9O6BQSgNmxzG1THAUN3U\nMILHDeP9Gm9DvpxDcPjXWZQzs0WBFlfSbqJQm2ckAcG2OJVExEH5GF6U6PkN\ndJtjlccHtPhJeRozxG9HIcQcCPu/4B2OEhUIuoh4XBn+efFQfG+WcTZOGKXg\njFUBPGQe1EJ4VF+gNGaPt5tqqsJmmS66KzNUKxyvCPQWr2NGTTFbWDryK5OH\ntkUF8AgmNpVmisUaxEYhamFZdOjDRtZU3UsmihNZOpnL4Ufz+kCJQbAaMcLX\nF26Y9eotfEGrnoXy0hXpCTFE7mz+dzIbRwzd8/KzfjZvhoEet9Cv8tMgydWQ\naF8P3Vlz7LMfPRwJkire7LBWaSWA4/QVr3OO+U0TEe6cbX0QWeCazyEjBBwL\n7L8x\r\n=0p1R\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"26dc33a695c4818f659a1a963445eb0f7cb9a47c","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.20","@balena/jellyfish-environment":"^2.4.11","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.0.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.82_1613492691534_0.3328801420264378","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.83-renovate-non-major-c5e11a9b07ebf8f4d20d0e08f2e7e5dd781f811a":{"name":"@balena/jellyfish-metrics","version":"0.1.83-renovate-non-major-c5e11a9b07ebf8f4d20d0e08f2e7e5dd781f811a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.83-renovate-non-major-c5e11a9b07ebf8f4d20d0e08f2e7e5dd781f811a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cecdf1497bae0d85d58ec5da27f05e849f743b4b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.83-renovate-non-major-c5e11a9b07ebf8f4d20d0e08f2e7e5dd781f811a.tgz","fileCount":18,"integrity":"sha512-+EqvdJP24OD+9JefdPXRDi/QeBGVdYvFqSllTsD7kY3hhd7TXMjUAQCW2CNyWMrIqPpgoMEszsXskp2wpeD2Rg==","signatures":[{"sig":"MEQCICOJphseVeXLA/k8WHyBL2Djph7Pk91zKpkyscNLmuAtAiAZULR5VPbp/5jbJ31TnqthXMl+4ikWvGv9wcDF4XrQ2w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107571,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLBqeCRA9TVsSAnZWagAAhh8QAJmlcCKHUmAE3TLxjomZ\nQbbCZT+3BoCtlfkUDb8mcc+WjguV7MMZa3sGI171lGwVoOX0Hk+q2yH2CuUA\nVqW2ycwVxt2uqc3sz9BnGne+2sK81ZoGpJpbKq/EcLhClAy4yTAD8LOA9DFV\njcqapNZjoXGNqRp4fmxtlQGzgUhVpxpyYF47Evh+K1Av75uTyEM+R43aMGoD\nTY79ZvgBf+t9P+GO0NRSm5rGcQlEXnbTh/2TZo3kyPIqxp4ETMDfpCZgrN69\nbwcm9bxqfxUIEvutUhYdwlv9Ug7lbXOwxAKoygyE6Il+5lJj/Gusns66TI3J\nbeNiAS4Xz41vQ3mun+wZr9CMiOPmtWN+Uq/zUrlbZFY4JLqG4g/gGLJIMdL7\nD2CqlMUBbbTuDCuylc8yb/wt625b1uZ1/yKmm7A9LTBIqR1Jm7IG78POSKRj\n8zZ5fgPXsvsWJ0MUNdwDA+3/2e00RIR6jU3YZz5bZROGsEOPpLODkbhZ/pcd\ntSzFSreK3PSCRjDsEjCUW8deJMzI0WhEQb1Q8I8iNKpFZZ9Ez0cGdEbvN3Mq\nXKm0FDlPcQQShVr1onBvjS0QAlwKFmYFbaSkjTiC/tbQnsz47fKma1uvrMyp\ncIE6cX8F6VtS2vgCklkpIblGPZWoQ8PGQRK+GIonxGA7vn7/60MKvubt8z8S\nEUB9\r\n=9quX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"c5e11a9b07ebf8f4d20d0e08f2e7e5dd781f811a","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.21","@balena/jellyfish-environment":"^2.4.11","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.0.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.83-renovate-non-major-c5e11a9b07ebf8f4d20d0e08f2e7e5dd781f811a_1613503134157_0.6434999583130059","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.83":{"name":"@balena/jellyfish-metrics","version":"0.1.83","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.83","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2d458c4e61f0b5b2aa6aa33413c107733805aa80","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.83.tgz","fileCount":18,"integrity":"sha512-ylAZW6RPJ11BPKC2ToRKyeNFs8GsGqYkBTEoq9RKnsjrCndoSDRMnW5O2PdlWyy+x9Pfoa1tWPBdXB8MZ4wnSg==","signatures":[{"sig":"MEYCIQCuduKkkofMWtDCjWwkK8hneki2jP+hLbcss1rK1P99fAIhALMJfmNwLJOR4t6WxdG6oZXhsBpqvmsz0WAR2cB/dpjg","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107511,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLBtpCRA9TVsSAnZWagAAfkMP/RdKyZzcrsGgSgVmZyA9\nwmNp+d5/s/9M4HDTPVjFQXOkVeFHw+M1Xy7PWHSQJCqkmPwO4DNmMSx7Xj06\nEH/ZWdD2C021ueg/6VmS0bDvy9OKnnQhMBFQPy6A9YgbWDaqwH50kvn35Vs5\nGTMzcaZJAZpWQfCk8JVxgYR7TAPN7z7gbTlQfGZixToXUSHiYEKaUd7QBbLa\nW0CeMCUkSeRiqE82I79Y9Py6KEBxjYO5VsDvCp1xiKSCNi0MDJW1cH1xc0yW\nN/Xb4bBqK2PSDy2R7OlCBPwZB+o2fbkISOzsdVilfSmUoPI14pMhGhTXz/3h\nmzFVdcfKruzBKlFMF0vpp9NpcMMKDTA4SS6mLjpQko2MRMHVPzdTzP/brQag\nUtaAj93QvlJNSPv4PRxm4ISiK+NPedTgsmDwIWKuivnYvHTfjt5db9XtHJH9\nBQpa7ED6wSLtt3HyJ1dGxBKZiWxGJ862YKd4R4xX7V0tCe9JHbD2oLtiqmji\nVHDqtqWESB3nQ5U6cJTVNdpfFDjzietLYTNSWETc5XDK/+m7Pq4hP7zBEWtI\nXEnTLWFGiJRBTRHn2takVrcDCHLlHw7BpCubkoT1sV9P/xjeH9pKd1Ikg1Ua\nrAcyFyZBKuxivHc9t+0/p5X26jO1UQY8XPtEi+uV579ONK7v4HS++L090wIV\nscDV\r\n=Yvf+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"f188c0dc5fd28ede82dbe559879a3972197e70ba","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.21","@balena/jellyfish-environment":"^2.4.11","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.0.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.83_1613503336738_0.5757021553247375","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.84-renovate-non-major-c00e7c54a212d6d937383219cb7de540a0068283":{"name":"@balena/jellyfish-metrics","version":"0.1.84-renovate-non-major-c00e7c54a212d6d937383219cb7de540a0068283","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.84-renovate-non-major-c00e7c54a212d6d937383219cb7de540a0068283","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"62717fb5a2776c54e2a408e03b14c2784c9796f6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.84-renovate-non-major-c00e7c54a212d6d937383219cb7de540a0068283.tgz","fileCount":18,"integrity":"sha512-AiVQ2qFEbJ9HMK2+rhfgsyZi8SDxuiBL51F9LQrsTjYjRmlT5KohdXI+xCJd3C5DkVFgEru4kmvOMijhMR62xA==","signatures":[{"sig":"MEUCIFmG76UYvurNgFOsPvxQ5N7jKa5IH4kq5sY/heBwQO3bAiEAgB886tDj56AM4/WxDc1P6gdbH8z4+CwPf0rDSGdYTz0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107640,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLJJmCRA9TVsSAnZWagAA5xgP/03hDM/FhsZymVbhuX8N\nCIN07lvXvIRFKnfY2EjllrIhTxPitEMpRoGUG3zHdXXk9JFD0tckHUv0tuMY\n5s87bVIBCiyliHUOjye+pAsvECC2BxfwHTBgsUusGlroM7Az4thU2pOfAsTp\nxE5GgXBuOaed5qPEPtuMsRhrFbaKSFLQFFwzAlOdVP/8EdwGLS0N1GgYTNrp\nuAIzYnngtBrobKOIP7l8gep9pig8FZebkKLNEfKWoBiSCDPqFYmdx2gBm4V6\nlogjl6GshEILKRGOOKShyUJPSnGFWMkDSZflwWSCyqp9ZTxa8FkvJsk5cOJ7\nEqhtXDFSXRBBcpJic45SQbyACdypCw5lbhDFJpWzPhkVAtKqwldFHDs8njAm\n7GZ6Ljp2/dLkDQ0Y3rmoZ1xdYKtXPaqDXec/M3JHvu2/FUQ0lBFYiuo9XTMg\n9QIoA1RXFiKdH44wLKx6z2CvofWjdEHV1cuqIHGJxyH5oIE6X3KONvWWJIrm\naQoj/pHo7USYt9kIJhRI+AmN363KsjJS77zYN6nKRJuYV2naXPzo4st4Oisp\nqwFamjxl0Odlsgd2eKK6zza4wHnYsxo0Qf9QdQKNqsJ9U4f3JYrMyOSNnbPu\ntoReTWA09e2DR+/mqt4S0e/oQU/ia+7+HregBRKfWFYPY8Y3CaidsBnv14W0\n4XQk\r\n=BkpO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"c00e7c54a212d6d937383219cb7de540a0068283","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.22","@balena/jellyfish-environment":"^2.4.12","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.0.2","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.84-renovate-non-major-c00e7c54a212d6d937383219cb7de540a0068283_1613533798079_0.6524557634704375","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.84":{"name":"@balena/jellyfish-metrics","version":"0.1.84","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.84","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e046d4bd3e577dfd64749217cb7dd9fc7b0e1ce7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.84.tgz","fileCount":18,"integrity":"sha512-f/QMPFBp1N7Ox19bXf19ZCwe4TEMh7v604qiUKa5sGqkb0MszYAhiFQng1pxENqTuZFESgzrdePZm9iCjL2HAw==","signatures":[{"sig":"MEUCIAtg9NaxFhf/nudxLMRjIrjynbIK5ISaaMneaJbA3EuSAiEAtX1w1l2WciAdbXpCFKfzH6OtdDxr0HJSTwGFa5y5C7o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107580,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLJMTCRA9TVsSAnZWagAA/tgP/jFpJcnoX6cvf6KSYsWc\n8yjXUywHbbSAyBHiMUf5otAqyIwUTfy3i61O5HF6cFq4QeuIzy0P2X0HafDk\nh20CFPMKbD03f/3eHfq4yMDCbLBH8LnS3yFQVMlaMKALpDMYJht1GyTToNMp\nfLHQXHXCOhfrFW2aF9cEfnvqy1nMAa3qEIhDfoxzFHr+2qvqxVUcDGouEInk\nSupz6Aayhv+i+2xil4++mvgezOEKjWh3u+e0hBH1aJF6TufhypSS1om9wN/y\nP0VDlKx6HnmIDYx0YVvLuYsS6sJA94/EtsgQeOngendgKDgX+/SLwzc9jFNr\nzGpgejenBllket4GrMfn+892+tcMlsN6CtBYOL2t8yHeKSWyIVdIAa/EQu7d\nJbytlzn1l/K9jcXmYNcnO+htvyd88DrPufH6Ett6rIfRlCzuJRzbp/t2dXhf\nMFptNDB6MUOFjRuxgZJO1F6WvWpgG8ntawPpHtF9iPMR6e9z+hZEchoEBNht\nCAWrHac/9pyk0QBh1WXIO3OS6F96wsJUb+cSyF31esj49Kp7Ylu6RVEwygKd\ny+D4omzL2Tk2jSXUN0p7iXrkdVlUohSIk37aThq4zYHHkxtIBDTOc2CgUBEc\nEI53PLBKUfKjygkFahXYgYbM4S28W+xszMqrJYAtruPgsviMKD0N/DjOoW5M\nNAWc\r\n=n+4G\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"3c7c84f7af151da7fcea105a74303ccec4960202","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.22","@balena/jellyfish-environment":"^2.4.12","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.0.2","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.84_1613533970407_0.7886978699638332","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.85-add-monitor-link-826c5a4339148a80e0242da93c24af741514025e":{"name":"@balena/jellyfish-metrics","version":"0.1.85-add-monitor-link-826c5a4339148a80e0242da93c24af741514025e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.85-add-monitor-link-826c5a4339148a80e0242da93c24af741514025e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"00bb640f46b41622145a3f53f9eb3e741fa54ecd","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.85-add-monitor-link-826c5a4339148a80e0242da93c24af741514025e.tgz","fileCount":18,"integrity":"sha512-uELZw5u4UlqiWdW+5eBi2kxInAZ/dvkMCoXHHuElmIM7uNTka5pVbLPMJQnmsfB4stdu9NmliSivUYS38Y6Kzw==","signatures":[{"sig":"MEUCIDubxEWrGtmqhLtvz8iXkcQsZYk/VbKuygEUb2g5EAitAiEAvceg34yO571libwmFKzs8PIsBugLxfllCyunzS8a29o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107673,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLhneCRA9TVsSAnZWagAAGN4QAJmD7927kOuZspuhUeLC\nJyYuFJgk8hUjXL0jYVZnedokkO9Jq+k7LppuXYLQHCOK2Hw4zeS4Vf6dZJ9F\nXy19oIC/SjHldPIP/7R1GJtKEZXUHvSoi8cYi8PjE5qX7rnlDYgPV3efNYQe\nHLnS5+cDE8dL8RZuklLcGzrEkKU2RWlbhz30M+4EX+qX1PeJ8QYlbRUT915d\n4vUJE3ajqi4zn81J8IkHVyDjm8RF7LDHPHuUlTEJ0qww9K3JM8E8ZlxQ88jr\nD96ba6a5b6z+9xGzO7nUfLQon7nXdqpmdvduz/X12BYkNm7Q05Dy8d6m4YgH\nlQ6Z+LD1XilW2NR8ilOrububPPPg1jpOlRLQZdG7SSROL4BIQmPixKglhOfs\njKh0o+e77oy6FWXYFpDtNEaBHU8qvH8o6yK7x1ENOSfNtV4NjUzGonLc4/2w\neiIqLlR8Nl4PZpK4lVFardna9qwZadHKZ7zog9TbU5vz1Z8iHjdc5aqTYrHA\n4Bgt1BRg5IY2eAjJ8+ZFwzGAXnYvZZvMKa2/jowCcxKS3XpWDmnp1DnYFO3/\nSi6pS0HbXNkcvfGRe/yYHr1/vT1L78Ee9d01psDzQRMxzgtaallmtDQCyZD6\nzyiuG2OcUAH+Yd7JahA1tDHPLiVvE8Uzbhw+OoZoTZ/k7QlVvX2pLUiaP2Xg\nlwWp\r\n=LY2W\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)\n**Summary**: Extract actor name from context ID\n**Returns**: <code>String</code> - actor name\n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**\n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)\n**Summary**: Create express app using metrics and expose data on /metrics\n**Returns**: <code>Object</code> - express app\n**Example**\n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)\n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**\n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)\n**Summary**: Mark that a card was inserted\n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**\n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)\n**Summary**: Mark that a card was upserted\n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**\n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)\n**Summary**: Mark that a card was read from the database\n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**\n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)\n**Summary**: Mark that a card was read from cache\n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**\n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)\n**Summary**: Mark that a card has been created due to back-sync\n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**\n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)\n**Summary**: Mark that an action request was received\n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**\n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)\n**Summary**: Expose current queue concurrency setting\n**Example**\n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)\n**Summary**: Mark that a new job was added to the queue\n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**\n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)\n**Summary**: Mark that a job in the queue has completed\n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**\n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)\n**Summary**: Execute a mirror, marking duration and totals\n**Returns**: <code>Any</code> - mirror result\n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**\n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)\n**Summary**: Execute a translate, marking duration and totals\n**Returns**: <code>Any</code> - translate result\n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**\n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)\n**Summary**: Measure the duration of a request to the /query api endpoint\n**Returns**: <code>Any</code> - api result\n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)\n**Summary**: Measure the duration of a request to the /type api endpoint\n**Returns**: <code>Any</code> - api result\n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)\n**Summary**: Measure the duration of a request to the /id api endpoint\n**Returns**: <code>Any</code> - api result\n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)\n**Summary**: Measure the duration of a request to the /slug api endpoint\n**Returns**: <code>Any</code> - api result\n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)\n**Summary**: Measure the duration of a request to the /action api endpoint\n**Returns**: <code>Any</code> - api result\n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)\n**Summary**: Measure the duration of a request to the /action api endpoint\n**Returns**: <code>Any</code> - api result\n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)\n**Summary**: Mark how long it took to generate an SQL query from a JSON schema\n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)\n**Summary**: Mark how long it took to execute an SQL query\n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)\n**Summary**: Mark that a new stream was opened\n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**\n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)\n**Summary**: Mark that a stream was closed\n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**\n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)\n**Summary**: Mark that a stream is querying links\n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**\n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)\n**Summary**: Mark that a stream error has occurred\n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**\n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)\n**Summary**: Execute a card patch, marking duration and totals\n**Returns**: <code>Any</code> - card patch result\n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**\n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)\n**Summary**: Measure duration of a promise execution and add to metrics\n**Returns**: <code>Any</code> - promise execution result\n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**\n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)\n**Summary**: Checks if an object looks to be a valid card or not.\n**Returns**: <code>Boolean</code> - validation result, true if card, false if not\n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**\n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)\n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration\n**Returns**: <code>Any</code> - api result\n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"826c5a4339148a80e0242da93c24af741514025e","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.22","@balena/jellyfish-environment":"^2.4.12","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.0.2","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.85-add-monitor-link-826c5a4339148a80e0242da93c24af741514025e_1613634013842_0.20446894670191407","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.85-add-monitor-link-2b273562d1242a6ce014dfb4e37ffd48ecc6ea31":{"name":"@balena/jellyfish-metrics","version":"0.1.85-add-monitor-link-2b273562d1242a6ce014dfb4e37ffd48ecc6ea31","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.85-add-monitor-link-2b273562d1242a6ce014dfb4e37ffd48ecc6ea31","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"01f36d1be73e98086d005bd1075e32a972c4d86f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.85-add-monitor-link-2b273562d1242a6ce014dfb4e37ffd48ecc6ea31.tgz","fileCount":18,"integrity":"sha512-mvaVlqcABQjKb9oGQTePdl6p3OswFhfK9gb3xHJdfDZA5tmQV5Cd4h22El5mSr7ZYtCN62zROu8+jvgSbkOt/A==","signatures":[{"sig":"MEYCIQCUjh3MaGpzedaW0I1S8ROE/9M0Fm45lYCg3zwD7Ku0iAIhAP7qYWiIfEJNN4IzmwyWMSqpn4IhDiwW4wrMEP2cajuF","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107988,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLhurCRA9TVsSAnZWagAAKIUP/1T4sK0m26miSyUPvXe/\n7HUiUTl0Dezh4k0dSH7e3wazolu1ze3ksyF9a+MR6rSsZ+Y6zjMnx6zt1EX/\nN5kokPiGwu1/GdVeeq8sNeCIy0A61oXELEtOUdov3sIp+Wddt1vmFzJRMZP2\nXBdEJ7kCoA8Rmu5d8CCLCYstBmvoqA4q//aW70YdaO30LaPQuq3MsYKyxeK/\n7jQb5+f/Mwq1o5CGLJepjMo9XbdbTtikRALPnfzt+/t0eObz6gx8imGkjFoM\nXvvQGAmL5wQNMY2VEA2/BC6Q2n3X52crSjlHfxZl/dcMM4LsUDmCz7303rW4\nLOjn41+gPUqAdAnuxl9b0n8aZ/3JMalphbw2Zqs1/l/IbRZpmAwGWF7KYTtj\nW5zFNOucxHXt7RQte6iG0VDlPiiMNDwnHbC/pAr0nhNMkO0PAUHukBzDLmZv\nmVPyYDUvO0Xts3hl0A2nQJJx2Nex+sHyn5jWGHY40ocLL7NhzwePQ9rWGowN\n0x47xWrZmcvHN7+9OeBwRJ6yUbSkLigE9PE7lUXI+p97xVH1GmFEEMscLPRy\ndh9EfKh0XrpigtuofkaMN51vX04VFI3aV+tFXUxnrvVjxe5e3jVFFlUYBAQz\ndtX8s/ZFkZacvslCkIPRomEoJS9wJUTiWncnw5mm+NG+K+ibdIE/VdAFWAB4\n98sx\r\n=8ISf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"2b273562d1242a6ce014dfb4e37ffd48ecc6ea31","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.22","@balena/jellyfish-environment":"^2.4.12","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.0.2","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.85-add-monitor-link-2b273562d1242a6ce014dfb4e37ffd48ecc6ea31_1613634475343_0.6081498618644468","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.85":{"name":"@balena/jellyfish-metrics","version":"0.1.85","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.85","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"defda7a75aff492a62b5f9e90f0d997575aec6bf","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.85.tgz","fileCount":18,"integrity":"sha512-rhKtoikD1bK2+xfk5ygERKDyJPFSGziOVnBK+mmwUbTVScStDyR0Kaw5NTvBlVWrvgodXHE5fCBO6soU3pNgUw==","signatures":[{"sig":"MEUCIQDpSdgpOomCNvVPn7qA6mpK5aNjdjQejEiXmc8PzgP+SAIgPNHQQiF8k7Q91tNhbOyLH1B6TugNwiL1zPWXYS13oLg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":107930,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLhyCCRA9TVsSAnZWagAArYMP/is8wvc9DZp1kX86GknH\n1jDst1nIL8yoX84He5/HIXns5Ry/M3cNNNFI8nWdJqun2vvy/xY4d17/ONaa\nhHHTlQnYyb4+2arM/2T/U/nfC7ONrGDJrG+lt94fCblinNgQ0oQQJU2Invgy\nsqgY4GHnxhu95ELdXVMHVp1HE3jQlo2uzqEg9ZBCVcFUK2OQ0wiRBxpgZtVr\nCzLqm5GTJV10GNcXoSZZzeu7rHbX2Fzaiwr2dP5pWMTbwkgGxbh4nZEJbJkg\n5xYAeivfEI/A1gN5zSQX79bZaWjKxo5fC8nmezNzcmdNjq6scJftxy0IJOp1\ngvlSV53Z1SVMpssTMdAXJGO/vmDgisSdlrcW3upshiyIkBycqd2/PF69gYot\njXLpmFAG75i21OGbbOfS6f2uOZXtTstaiK0iIcp4jQnHjOA4zrkl3hN5sLuQ\ne6vAAXcV4mrkixk165JmhqZCsmOZLc3ik93ZYaIfdPp/tZTpG6N/5Xrj9uGX\nieJFAk3+OCTyQdcHBjX4+QuBDEYlwXTvlNdw2NCV0ksueOaxNj2O/fMMNXyL\n0iKW7Z4jrZAxNHWutJgbbT+Px+Qyv115Gu1h7iP2qUj5PB0RBa6cdTp3RDBX\ni/Hk8O0MaUCBe/LbpQTbHR7eu7Mnt4b37wtYDNufUSqWTjKvfmlI7rvp/1Wl\n6zbX\r\n=OpW6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"56a6c3f5d4160b6b304cc537b6d6cd8bdfe10061","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.22","@balena/jellyfish-environment":"^2.4.12","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.0.2","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.85_1613634689567_0.8406152974438916","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.86-renovate-non-major-3289ca40258e81553d798e8a1ff7a23c422583b5":{"name":"@balena/jellyfish-metrics","version":"0.1.86-renovate-non-major-3289ca40258e81553d798e8a1ff7a23c422583b5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.86-renovate-non-major-3289ca40258e81553d798e8a1ff7a23c422583b5","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f4b5c77dd5ce2373ed1eb3d965cd6ec40d910331","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.86-renovate-non-major-3289ca40258e81553d798e8a1ff7a23c422583b5.tgz","fileCount":18,"integrity":"sha512-MygI/funAAHiq35jlzMURJL0fQ2AB9qcsuJNoqMIUGbcGhZYqaSbcQHdjqo49ha/8YuBmE5a+1ABrfslwH7C/g==","signatures":[{"sig":"MEUCICgeoND5mz/aQlbcOxGuRX03AbJpGNrW8Xkphd74zW+WAiEA2+wmh+td/zn8fmF5z7cfg1Fo9CN0W8YvAukiin0GNKo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108096,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLlRDCRA9TVsSAnZWagAAJLgP/2aZQvdnMgob0bQtEv03\nlITFUcoawygX/yqa77IwAoC87AkLTdDtFgTs2e95sfueYH5O9Y9obrh7iKW2\nTbD+/ggcY6xFznMv/IorJNFpMcdsD8+IRLnHE3CFt3bNPcKY/NQwgMxB0HGk\n6/3rxAe5V2uKANn0Newax+40BQUix3f9yYj7CiwsmVjmc08/gtNfEBN87Wu1\ngkqE1IJEG/bta4PxoR5oz2DDVAgUobmNKvVQj2ZTIyEFcWbWBlvwl7sPiued\nECke6pndPYg2Hb+hbH5Xwoy8tqMac66v/gETtE6rkXqk5SigtmyxXUpS8Ck6\nvcZ2+u0cpA+zHBPrzaQShTJNhUhd3562FVCsJoQatDeLV5cn9tbcHjL7PMkV\nFyqOUbPgowBqidG9JJ3YTn5Qdfd6nRLSjIUnxwiLpZIwpYsjhETxYse9yzXS\nZ9+LI5v7aqme367Rq2XnwvXyWBxGG9REc+d189EtMh6YkHDgLR1aPO+6P21k\nRUaaMhImqHTOduL0TNPYOFDZXi4AhMPYMOinf5LTvC7sqG6l/KeFU1tz9wR+\nYEEY2somiiHuMaPvP+86uUaI5hAQhT4vwCdqDd/x6d/zBcb2JQ2xnNBgkDfb\nwoBdxWSn8+K6ZauZXBkgGxuq2AhCsNunhCzIkVM3pzN4Zk/rKIrENNtc7pP0\n66v/\r\n=nzJz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"3289ca40258e81553d798e8a1ff7a23c422583b5","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.23","@balena/jellyfish-environment":"^2.4.12","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.0.2","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.86-renovate-non-major-3289ca40258e81553d798e8a1ff7a23c422583b5_1613648963109_0.5572034268966894","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.86":{"name":"@balena/jellyfish-metrics","version":"0.1.86","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.86","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"989cad81900bc30d443f4d17feb6c7178bd9ef76","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.86.tgz","fileCount":18,"integrity":"sha512-ocaeWzrt+SSbAVXF5esrOZzNcI4Swv69Nmc66S7Pt9VMgd7WRsaiMZlqiKyMO4XGdls2vBoM3tVi8mun13/FtQ==","signatures":[{"sig":"MEUCIQC1wk1IR4tFD05CujxgXgML4q3M81Gmr2eHX76QCS70vQIgDCEM00HBBjN6d6toCBXOmS2KH2EiZ41TVsr9rm+Wyb4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108036,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLlUHCRA9TVsSAnZWagAAgBEQAJqNEasfnSMmLWrBEzLl\n2fCnODNmL6Z9IA3y1teZHOvoZIrSXdUkrq8YGO49c7XmXLF0dQH+QN65a1Pi\n8WnezfCv7QkYAMbDfceP7R5FtCSVPEwcGJdqcOrQbOqdBXaVx4snf23q3mHc\nQ8MzNYDkTnGERjhVNLXPDn1ql54zMTlnE3GRX2P91Eh8U1NCn7SoTehM+znu\nB5sdXESTnEHS7zsdIOdTW7jxVlogiJTn7E0S3NdxeUIAdpEIIfWdfgIOMqgd\n7LVrQyd6UeGJBxJ10EdliJEsQzHhPS5LaUXC0l48P80GT1+7iThSZJVB0nwB\n8itHohlndFXi3jK0cGC4PWaBnHLLpr39z+gs30u0Lt7e5nAE8H/C0Q+ehSTN\nSsaPa5xZJ4nGewONdaNvTmDj2meJ1nxbWcKfNqeWL4wUTphSzXu4/GrdHbKd\nfWxPpGOUwZG+wrqyYul2WOohZFdLCbDgD3qVL+y9mWJ+gKIG+Undv6BrLMfy\nvl14rBx8k0BYm2DEMbjVMpWBIMwYf69S3iCAf0j1Kpaqs4rYdUhUIQe9qzPI\nrgXJbsammTJDUvDZVVcoucNRgqdLYq1lfr2n8ALvp8zcoi6fIdJqgMw2nb9V\ne7ycZ3IgQUUujulgPIHScfXT64CgwUksrOjTlzlelCaWypb8HM1d27+Wjwib\nencE\r\n=ejqp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"3b57bae4f924eda3208c978378ad3214e2750107","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.23","@balena/jellyfish-environment":"^2.4.12","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.0.2","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.86_1613649159379_0.7551103673895025","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.87-add-changelog-yml-d127bda9b5379541a3c8c3f4e102f6164fa986ef":{"name":"@balena/jellyfish-metrics","version":"0.1.87-add-changelog-yml-d127bda9b5379541a3c8c3f4e102f6164fa986ef","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.87-add-changelog-yml-d127bda9b5379541a3c8c3f4e102f6164fa986ef","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"01c10934cd5a3c213e1d76eefec9a35d4eb9c18d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.87-add-changelog-yml-d127bda9b5379541a3c8c3f4e102f6164fa986ef.tgz","fileCount":20,"integrity":"sha512-yXXnWvDWVlJykdgy/Tod7Tlblvhe1G1xEG/x9EOexoEpIKSKSrsbEZOvg1dzx2j4OwuolVdkl5o+ZGgdpbyBrQ==","signatures":[{"sig":"MEUCIQCNxSWjqsNVI0qcZYGmnV0UtSySC03Tr2wqn/NyZB8eFgIgewn1NVw7yw9NQxqZApNyAylJCm+5uTRQT4XqC5yvnaI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108656,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgMMo0CRA9TVsSAnZWagAAW3MQAJmuZsos/1oDJ57PL1Ym\ngS+cDB44V1vmkWNdGxkcGq25eto2Hf8+SVQGWZnZRUSGJLT/6vmupmp6KDzf\nyHCe9qB5CD0g+T+TNR4OSZQPTvO4vmrcCJqH35XLFayLNxAUhJAV9PHuY51d\nqpsK+EVi6qi56smgh4qSSiqz8GPoq4+2Z0vPijhNLT7b88PPSYyD1A+WzQGY\n9osKzmPRZTnmPQOPIB1CeBb8CSx8yw1SuNghzE67r0zHjK9TdNsz/j+e1dSJ\nVbSsWyzv82dvbuNpAJr0bnTAS0L+F+uZGn9NCiXjA1FalmQeYBehWhGV3T2l\ndujo/Nr7mmAchyyK4TFwSFL/+BbWwWKKAKlSM1AqOa/z99tpbZxCMplSoZEy\nuCrgKnAdZB1Kgi3RPXOQXQB1M7euCdZ7lxzhjWngcm6x4NMVblHzzaQQ4dV9\nwOjJh+ixvhqjRSPlKQiZNTn6lNHmtdQe8a8EoyL8XcJh0zRvNIqG5VJa5Xm3\nxQFOHwuRv9L4BLTCSX+rxCRf6xIi4mztmarKBHyC3gBXJYBO9OR7+dztAarS\ncvcTIV44ZGEkbJEbEkk5BmiTA+aB4f9DK7HLqfcn1nmckXANGi7hfVMO/FSQ\naalIoiHIi5RTJCbDxvx8bw1O/bZS2vStuMA/ks7mNvNDGCEQ1yQicGFvbF7l\nS0fW\r\n=B0PP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"d127bda9b5379541a3c8c3f4e102f6164fa986ef","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.23","@balena/jellyfish-environment":"^2.4.12","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.0.2","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.87-add-changelog-yml-d127bda9b5379541a3c8c3f4e102f6164fa986ef_1613810227599_0.9893266513631234","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.87":{"name":"@balena/jellyfish-metrics","version":"0.1.87","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.87","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c8054e59eea59628e50d751328853531085683fc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.87.tgz","fileCount":20,"integrity":"sha512-BPVZN8pYxXeTU4aTMZRfPxYq8jFcS+l7sKnBw56ZJ3M2o1VP2klcNpTgKXKUHPFQv5vC99V4TdUvukb0fAE/2Q==","signatures":[{"sig":"MEUCIQDASf7iDcgxWexPNzoU+xPOMoJPTNerlL/P8mss9u0MiwIgN0PXpXYcROIgSYW5DBcznGUMQFrk+8+1+aJ3cJLWDwg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":108597,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgMM1JCRA9TVsSAnZWagAAn+4P/3r9b7+QiSB7C2ropw4a\nzUTZodh1GcyVMVOpeQPrD/QPmav7qE9+2Fu/NJj0KCfdTCJEmwFM8tho2m21\nKaeC6xisvqT4AiKJrjeS8oXjqIY9YSYNt4X5/fAzSy3cjTk5k1Q6JjKwiaPg\nk5wWg7On1Ovp4Bonk5FMIDmihQvcRj9VzGVglZhrCIWY9ebPUFgYX1worxkd\nQab/yVV3kJL9vRhtdEsgopeikY2dR6EFPPnW9lraHtdL0wQ593ehP8WlkGBG\nNORv3G5zNvtvjKnMQA0gNptFFZOUTE8VPJIlAwzglrRtQNS3SvmvJkeDZBON\nk1k9RELEre6L2Wr7GWbON9LG5lELKLNwFRHz3LhqQ7MTEV0gwcRVzzFm3BdX\njCXQQ/2BBqVEjDtH4cfz7V0h/QYmYxX1HgYpmQpbfSBCDHxju43b8am2t2Ai\nD+1konDYiXDg0ht+pzjr9e+duK63tgr3zX1giNM5GeD8QSCI4I4yb/fA/Rpy\naclS1fvVlHuaI7sbMFB18ugWFx/RQK1J4wj0Fm48Ff7P60D44UGsxjeXbSOI\nh1FezdgOd00A65jF7eBNeExeofd3Diz4BlOWdDWbnMOcHG7+R0XccxjxbkGv\nrfPlrsmXq+gqUtSYxCej50Li5owMTvv8T+o9cP648wPaFQgk4vCjAWVuDCcB\n4lhP\r\n=CQ/G\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"68d612cc8a1bf2c2960121bba6ad09312f10b4eb","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.23","@balena/jellyfish-environment":"^2.4.12","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.0.2","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.87_1613811016528_0.26482998234466404","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.88-renovate-non-major-6cf0557564c7dc3191f804f533e4b1db766310ff":{"name":"@balena/jellyfish-metrics","version":"0.1.88-renovate-non-major-6cf0557564c7dc3191f804f533e4b1db766310ff","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.88-renovate-non-major-6cf0557564c7dc3191f804f533e4b1db766310ff","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"03506a363c51f5f0cb30aecc09e224785873b4a1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.88-renovate-non-major-6cf0557564c7dc3191f804f533e4b1db766310ff.tgz","fileCount":20,"integrity":"sha512-fY+GdzbiyvhdeG5VpjjZgWdkrsLYtefXKj0zOCpSj9kbSk1Nxcn7DfmUIa95XacYzPUnAiwTXKKosx4ibZDb8A==","signatures":[{"sig":"MEQCICczLFpH+K+HARjXPj9aQtFKLaA5hGnJO95RJViCaBDHAiAIgIQ3zEQF60IkRkK3kQS+zmQWstz+6qDjAYG4A0El3Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":109090,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgMM6BCRA9TVsSAnZWagAAyegP/iVgFdAA/O2S9fuxgr6Y\nFSD4nGoA8o6w750hSlLfPlZ1rp8CP6KXmvgjd3II+qRlgziRciK9dG7e9Fy5\nMEwEMrBGBgDe10eG1xh015DiDHfKx93OZE5Ulo5tZfv0ZybCQQck9czG352P\nQnlI8UQr3bZUxNfnfbLgmgu8enVQbwOYwYgHQnwMqlKub7Vhn+wkaDUDHaSC\ndXvtedN4yzM2FdpBCAsGoYsjySiIDddsZsgPp3f6/9FwHHogOFyqFHMu/oLN\nS6aCD5FB7fveEVwKWM/GqDPBDHdYsVLolFa1tVUHvJ0cAZVErMtOm2aRPdKk\n1cob4f47YDbSt90cRSEz9SextqSTKo5UOTJj91CXdIN2Gqkp4Da4iwb3LApi\n69DfygjSFKtushEDi+57MOMTXZJ+4ePCjKNy2r0DDG7w2MElUSKUE/LnSTAo\nzIDVFoxLAcjYwpyMl2wXzVMrkBMehGdtxF2nZFhd98YPUvfSuJeSwHLXD1k6\ni8gT8ds418d/R3a0xGf57dT3KC+z6JPzy07tB2RLR0FrqzfSzgC+76C41CJQ\nLduLF8Yf8Q11xtUOn+jb3fGQMaTEHd9wyqXm2aSTH80U4qp6QpjIvNQ4EuAr\njiWzqd5siF9L7YiTHTfM0FQ5IEsHIqetrNjEAAmMbNQ0Dnlu/r3fABxIwOu8\nGyLa\r\n=oxEf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"6cf0557564c7dc3191f804f533e4b1db766310ff","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.23","@balena/jellyfish-environment":"^2.4.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.0.2","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.88-renovate-non-major-6cf0557564c7dc3191f804f533e4b1db766310ff_1613811329392_0.1984681357456084","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.88":{"name":"@balena/jellyfish-metrics","version":"0.1.88","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.88","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"442bb204d031282a553060d914024b0c0a3014de","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.88.tgz","fileCount":20,"integrity":"sha512-ey0FtYy5MLhvijhu4FHdN8e9In0u7ZHmsUUXiPAo3vmj3Kp1hV0CjPzKy/hwSEHHe2gHpYBnDiPGZCr3b/VX7g==","signatures":[{"sig":"MEUCIQCATURAC1+POY1xxeXseZkjsG75QbcanY7Lcc+Bd5wuYgIgVrQ0RTZWhvh7fzkZk0uyGVeKuTLCXl0vvNhj9KAjcfo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":109030,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgMM8/CRA9TVsSAnZWagAA2wIQAIG0SnSaRmyXktW9DHk+\nYIPEfotEh8n8N17vba3zgOcFBtcNBZC1kJWyEpMQ0wBGlo51K/Osz/8CFuAK\nhloovXRpjpeSfVnJLLM7mvxSbeUO87Fo1/7ZGO3FNq0hGZMtJvvKFjeT3DFj\n0+yIpceHTjVD0pAbQHiq3Vd8k8GFC/FXOPfUNmYJ4lTXO2C7ZS0Y9Y/8DsZg\n4zF9ilhlJ0bjXltI3Jsa+2S71RVrLjyWjrAKT+QsDGbhnSBdTMTICPfGs8ST\nZ9PMC6MGuNYJoDoLyKPzaDaVuPxIQfHF92NAqa24XwBHP4lhR6vtSKXV/Xh4\njElrtByXCBDs4dq2FPokgx078LNcG9JVyceahaP+E9is8XXfftGvcAefVfQo\n3d8WQYFsqJKfVol8LigWXmyhcovjNdaFaF0ha/k9Yz6gqv7YB9fYr3IKN7lT\nygIrnNTZPhMnN1yD9erUVtEi3nC4ZDwykeJ1cLngRLefXNJOHPBohr+rYEil\nAOewSi7eWVdePPp+0xST1P0NoXRIRUnecR9yU+8aRMUGiDUo5s3X0Ytgme4R\nInDeOpFfeXg8ElO+sP2vPQ0YList1lcBUrI9tdNmKFnBy5ZOypgccl9XjbFo\nVhc7rQgbllh/8tcww9f4fpYp54ggXg0llcT51AGW4DnnMp58ln+6KYBLAJxF\nK2pv\r\n=LCwI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"8fb687f8013228372f8b624307315e1661a923bf","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.23","@balena/jellyfish-environment":"^2.4.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.0.2","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.88_1613811519182_0.30816677835757034","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.89-renovate-non-major-42e9c54af68739c4b1a978efb1ae92ea472eb269":{"name":"@balena/jellyfish-metrics","version":"0.1.89-renovate-non-major-42e9c54af68739c4b1a978efb1ae92ea472eb269","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.89-renovate-non-major-42e9c54af68739c4b1a978efb1ae92ea472eb269","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2ae5e5601525ea13a278e2b0b517cfba03de424b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.89-renovate-non-major-42e9c54af68739c4b1a978efb1ae92ea472eb269.tgz","fileCount":20,"integrity":"sha512-d/m6gSUI4Yv3IXU2Tm1UgCGkWYg7fhVd86i+6qcRhn1X/ywV7Y5vgOXZ5P2NbBQXpTlep8gIjPZioQOjNI01LQ==","signatures":[{"sig":"MEUCIDLrx3AntGjMZN9S2ffNag6FYQmOOIdjKJ7hfXlrKBoaAiEAnhFeRjuyn7qkj3CWvUJB9IlvUQrOz5CkOct5+2LFHLc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":109513,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgMNzICRA9TVsSAnZWagAAZEAP/2E8BwOs0klxR7+SZYWb\nN25/5fo9EB1M+mT8xtZjaxCYDS0jr8g5boeqppPbDhWHfXzZQvOClTkNTB78\nB8I7aNK6YV72fZO06NoMWmP4nLXthXjC8/N6JJtmsw5wScpXGJ4SgE3BBDLB\nRMHorvBODe8LB/63WRHhCxwfraXZ0O+JpidrOvbbf7Abs4prTe3RMnU339um\n6ARKyt9ATEIytpp3ahEgYQ/vkUZy0wByeh7L4eXStosOsh1H15J0uJigM9dn\nckpTdtEPJTbNq08WUh+DQL6EC92wH7/XpWE+fi+6KP6g/6z/hDV5WHD4zsZR\n3d/oR0FhSJZMVH69i61QBrx/gmTzyK+uvQ4iljk6rElJU3TWh46+O8uEB5Gk\n7hyCIs4MdbobfzvcecJ0ElodQD8kHjgEbCdUd+Rh1wzYt8AaSUxhgnOwmkIi\nV9J7wDsiF3PKciEQEZ7eWSjc5jf4tF6ibqkWNMxtqlZLSCdNm6bdC4qWfTF/\nq8cyzq9VDh3ek6SZGlschp/cvfgkyPwDwKQ9lgwaxzJO/i4RbfPA2TlJ0fRo\nQ7E5FRoAGGbIWSuvFkSoHQznfdC9KusJSR/eWtidjVaJADnozNXPhnMc7sxc\nBrP7MIw+KGKWvV1L7vPqftjc7T4mN3WoSE2j2Gav5GGDXCyFzjtCuc37m7K9\nA35O\r\n=yXZ3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"42e9c54af68739c4b1a978efb1ae92ea472eb269","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.25","@balena/jellyfish-environment":"^2.4.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.0.2","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.89-renovate-non-major-42e9c54af68739c4b1a978efb1ae92ea472eb269_1613814984197_0.5737549187305337","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.89":{"name":"@balena/jellyfish-metrics","version":"0.1.89","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.89","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"274c29d73e3b07d387a4a5a6ca6afc2fca35857f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.89.tgz","fileCount":20,"integrity":"sha512-tQhhmZYRHNnn6/JQcaftC7r4B9Mwy91ihg+xHHPDZ2686pv0KDdrWFRmIlERVM372TaKL4SKZLojLVmv6AKDfg==","signatures":[{"sig":"MEQCIB5vvM0hxcd/sE+sLMuvBH9FZpI+/YYSjXRAdKX15I0PAiB/PDMnim9jPHda0AFEm85FrjHn65mAstPNUMXTNh1+jg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":109453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgMN2VCRA9TVsSAnZWagAA6qkP/RyMVounKCjtECdk7JGL\nZihjMjiDxtP+LBWJK9Wd6E56hZpc+/YsvnNiDLqXhYvnmXjIL+X7eIhRfYaa\nq6SM6yvycFXR/6UMgeHsW9DMVBsk9JgFcNhYPRp/TNkao7GGe3/jnMvsZkyE\nXSJgWm2/DbUoJzUVKl5mN1HSs35c4Uxl61mWzmmISGr0wa+CjLkNyBiaixMi\nsUp//RRWPfhHfxTe0wZCtsa0XUlOSrsS2f/Km+q13DSn2WOxTiJiFDKOShU9\n0/Ywd8l6fr4Z7fgskdKpErJKx8nOeSjJKfTla7cIXtRrMjzTZoGKwz/EgWHH\nmQPl+bzhsQOelUMC3iFGl3MHUbtzV0qA8ieSdPyWEK4PTXg+pzoI0iunu8aJ\ndkB6cAe1nAUVAhqViTEN05O2X4YsqBl2KjaAHJyNPVh1MxtEyZLx3X5gMieq\nuFRqL3nvhciYZwccyaYvWjU29IukNV9lrHL9wdDGR21UN2askj981dKG+Mc3\nP3yDrW8frWaMCr+nvQN81WBz/BYiUauMlPnghsVI6re7Tz+CNe/+rsjWRGWI\nlTjLmr5QK0foWMGhpTO52yRXdU2CkVDAMMD5oGGHSo+FK2yg94d9Qf18tWGx\ntRI0m/xuOEX5d1md4d0FzeR3TbcuLOQ1CKvZFUdygKBjfh4pud5luPCPEVOg\nQ4li\r\n=wHR8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"df9ef6e4fc90a5c25bb7b49afaf23115b1fa9e3b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.20","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.25","@balena/jellyfish-environment":"^2.4.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.0.2","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.89_1613815188900_0.06364315422020295","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.90-renovate-non-major-9e1219b9dc1e6fd1f684363edf6b386c1c522d09":{"name":"@balena/jellyfish-metrics","version":"0.1.90-renovate-non-major-9e1219b9dc1e6fd1f684363edf6b386c1c522d09","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.90-renovate-non-major-9e1219b9dc1e6fd1f684363edf6b386c1c522d09","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ae0823ba487d59c1fc35cc1e4fe4f163ca3918e0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.90-renovate-non-major-9e1219b9dc1e6fd1f684363edf6b386c1c522d09.tgz","fileCount":20,"integrity":"sha512-GAJFIFECtVKJDAkuP2vwl+n0wd+4OZ7WVTzyEcRZIqi6OEa7282hRqWspsCHXiktq1zzJZ55G7iiX20wVKNeDQ==","signatures":[{"sig":"MEQCIELPEykhlDTObJg9ki1k5ov5YjQypiQ8gZNmJC63rqFSAiAyR923W9AouYjiNahyKUGoPfzvrJM8+i+xtU/3gCpZZQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":109902,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgMTviCRA9TVsSAnZWagAAROMP/i//5nnmIz9zm2b7NvBT\nSgKPPYia1j4DnLKV6rpij7QAZC6BFh5JVX/YD9Fi1DC5fAFCXPTjA1dgPc4h\n4GyOWQiOs6WzCZ7Yw0jToib4M7hjrx0qwlxrXnbKkRRWZFKnQcnpLso3Yqnl\nvlAcNvz7pz3If/0lFcY3CDvvZ/W4vHiDDgRTJz7krZVkudxkYTeFNjSo0RIP\nsXsW+Vx3W1Y3yjeAs+lDrLMG0oOid54ZQM16G5GEc6D+jhj4yVXYUcn2fDjk\nVBWOawDYF6wCjHj0w4sjsItFJYAv8xxuvmhI90qF4TsRgwt4XYMJ+3B/OqjU\nqDAwGYVSDBol4w/oh6/zFNZIVbgT3ZnC0zWen6nB5QeBdeFE+5UkXN6Yz6Ve\n7OoBH9kTP8cmTbR74Oy6DNOJFP9Dml9rTh/TwaUsFRak3erCIb3WtYyrRIuu\nJeAZVfeVk8cz9B9l7PATqj1SibKBxwodM0XIwzOMzR5+Mj1rUjTZL5ImLNap\nUafYrHan7u4Q3IyEjBktoIDVXjQo5rqx5B6IjmKyjgKTKW1sojP9MsmNVK1f\nZNXuua5OWf1xRB8sJBhR+W/q9g8zIWpvPOhZFf77qbIG0IExdc6oFQeTZLnA\nxM2DyVcEgz7hpp40ULQIefodi3dKdclIA419oKEXlMkeFTKCoe1wtSBI+saB\ne7Th\r\n=qyPN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"9e1219b9dc1e6fd1f684363edf6b386c1c522d09","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.25","@balena/jellyfish-environment":"^2.4.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.0.2","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.90-renovate-non-major-9e1219b9dc1e6fd1f684363edf6b386c1c522d09_1613839329677_0.23437805228167163","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.90":{"name":"@balena/jellyfish-metrics","version":"0.1.90","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.90","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8cc5d72b40beedb11f072e1f4567f1532dca43ac","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.90.tgz","fileCount":20,"integrity":"sha512-F2rLTVwOf71cb2tMMPvag2hquyWiQfVP5c+x1j6RNOkhPggCTxH1t46pk/PLBoabtanbd+2lhbsgG96S/w5gfg==","signatures":[{"sig":"MEQCIDxf6gxYksXJB9iVvPVrNsPo31uXmiv4x/cMSoHL0qqDAiAAnV2LkGWt5+VphJKc2ztplpGbQ1nJjv437TTeK7YFSA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":109842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgMTySCRA9TVsSAnZWagAAOOgP/0mBYX5hL3IVJ1qmlqR4\nJtD/JHsDAtz/zF7c/3Fzbwr27XHgRu4/GPwMkiGgWgMuLA11ql9Xkw3LiHLH\nJ86cwYU9zNNcDSLx7YMUDmo526kcBK3/wLKWNwB+Q6lcqFvjypUUIhxMfTY7\nPQZLTwej69W4AkZaOO3Ci9ZirPtv4zMt874o28PpdFA21mCLPzVdEuMsGjn/\n3y2Y/F/IWJYwe6iqmFMsNHHr18gOQYzn98Fy/YZVXGPizTTtwIMwyLb8qk5H\naxR+oFdCbdmJh+fmAr3lPMU7+/yS/9JNUfUet76y8LGk7Qe5eO6KuPiCexOS\n2RmYLtW3SEozF+IsL6Jb2DJP+E+TFnq6jQy9UPIeNytm8+PbeIt6j7bKpLZv\nEbQmwH7t9TAH2CX2jt0R1EuWL4DnKejO0GO6NUCmZIyMxvjl+lFj7u3VpyNn\nXc9CF1eW43Qyoz1aASDY0bxhKOAVC1C33DDHiNcHAA/4Mw3CRVt4TAe1P8Df\nGpLjbkQJ+JX+5UvXul4OiMXfdrawGfgnaf2XtDAFCuBD8vvP0VJaZHyN7t/u\ngMfRpIbsvACd7yvwu65on1lD2/XHbNURN0rFvrFkQBb8R3lc8eIGuUg1IYJw\nWtEzCSonyE1qcUT+P8HIWzA9mdfqPXnnfgwZQ7dx2qu78/whzXsuF98yI2PL\n8G4j\r\n=0GS/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"54a1bc18af0b82548c3d00de0441af37ec051b66","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.25","@balena/jellyfish-environment":"^2.4.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.0.2","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.90_1613839506245_0.8588455810193532","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.91-renovate-non-major-516a088d1ed9c8e3489aeca4fefbdd8e0126e7a8":{"name":"@balena/jellyfish-metrics","version":"0.1.91-renovate-non-major-516a088d1ed9c8e3489aeca4fefbdd8e0126e7a8","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.91-renovate-non-major-516a088d1ed9c8e3489aeca4fefbdd8e0126e7a8","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c47a9b6087d792884aeb9ce4880853c90ba73609","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.91-renovate-non-major-516a088d1ed9c8e3489aeca4fefbdd8e0126e7a8.tgz","fileCount":20,"integrity":"sha512-VvQu/eM3faKrICLiCsBjxFWeUrJXDwVN6crG5g1aCPYfBC4PnqkkHj7IftUWZBMB4JVBCsedhVqnQZ1y7szZNQ==","signatures":[{"sig":"MEUCIEFcoiHbBlY7OH5alM3Ps6FUkyUc/+YpnHkEIFr/BQJ3AiEArE5TfG1ZfQSqPPLOzo6dAAFFbNsDzqjUWnyARaA+uHA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":110251,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgMVHQCRA9TVsSAnZWagAAtukP/iNp3vFilxsW8lFqkLnp\nWnatkhJW5QT7JlmIUr+dEoJrfLnw1nFH8qCPE/TiMhzaDUGUg6YmvFF34KAx\n2R/MMRqgIDWZoJXrajoo9m0dCyM/vu2pHIFa1sEGf4zvfyMWVPq0rKpvH6c4\niJnl3LADteO57QkYXYA8AXzJPnv56zlmQPbxI793QUmlanRD1y6NbFE3mzr0\nSPRe4YWmpzarY6ApD51G56l/nLJov97Y3GXYLapNLP+uVighj/6a0OEHMl7r\nl1pZgNZSZM+3bseeYUnpiXii4lziBoPp2cSgwMDdobo9D9JTBTGbxK9f+Hlj\njaYaCEdGcag1oVQiXKSrO8RXGrKWS1hluaWfvr0ptkAmf1A8fO5mYtrKa86P\nEovHx9zMMfR6wQ+VRayGQ+mxg8RF52kTMvELrMHAyWhtaCikG7CRQX/DGoN0\nbe387yzGY+GeVm6h9wpvq9BMZ2McweA7te+ewdBuEeTbGaueGu2yeVng0lEx\n1EFFMqWRJ2OC6L51dVjZnQgfvF8P9kd+HxfHHGqvLUJA4QykhVxFRDYAHZgM\nryv+1k3jrq+Xdlc1DX3tkQdmlimiM8OobGKqKFzYk1COfmZDTMVeziqLyP08\nYHfMOSSyFti7DF2uq+ajErWtcJVeJDHjtCN0OUk3jaoHyvJpI+pS4y86gNhu\nChgz\r\n=FTpT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"516a088d1ed9c8e3489aeca4fefbdd8e0126e7a8","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.26","@balena/jellyfish-environment":"^2.4.14","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.0.2","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.91-renovate-non-major-516a088d1ed9c8e3489aeca4fefbdd8e0126e7a8_1613844944175_0.6804497684271227","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.91":{"name":"@balena/jellyfish-metrics","version":"0.1.91","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.91","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"dda8c11f33ffc6578bfae8d4de8304ed5da5d534","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.91.tgz","fileCount":20,"integrity":"sha512-X57JyyUglfkWtR2mJjj8a9FHFm5LY0gilsll8B39qdkbAUcrHQHwSjtx+Q+jkYq/w1EY5gxeImiC6TmgEg6b6g==","signatures":[{"sig":"MEUCIQDl5V7XPx6dp+tFWsqEmO9nnJ2SJEaeDYNWp91cnKE2ngIgJJymy5FuCsUvUVv2j87vlXi0pYjvdV1w6rLBoucgLF0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":110191,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgMVKmCRA9TVsSAnZWagAAXYUP/ReXs9qk28Fl4qnz347C\nTLtPQhkJZDjoeGE4QpaOUjawXBotCOumtWy7kRNVY03xz5WAtMBVpvPWbiGb\nLzdu27L5Zv2kI8tHZqbxKGcxuTw8usdLklJNBFre4x0ST8U+TzGvk9VFEBdd\no3j39ncbJzRg8IyI/Nbr/pZLdti9D20WMbCQnebCTFLbSAWSGACMRRSwe1x9\nwvqsCO5qjAx7ABMkH9XreC9aYtGOIxZLo/o+5AYC+yEGMbLwl66Vqx3XxULG\nzDu6clgbD6w8Posw33sUlLDDt8ZK+Njm3PhWJ0iWu3FIZNejRUxuPZfiso69\nqsb4ROGOUa8UFeo6r6Jm1ZwyLu9Nn1BuQIrbfFEPV44GZh2g/T5UxGOBQE60\nynQS/J8vxsOe9nwwG8sCkCUmwocLK6Lhqrvq0qM7aEEimy6ISDUwc/VHdeKP\nJKeGpp9RzuwB/zIdfdmagFAqKf492uK67QATTIeLRDLpQMZjcf77VvCp/4Ux\n+14vuOfEne/eEY/KrxPP33xZBB7h1xCCecBiw0r23dGMV3JKNGRxqU0A2VO+\nK/rP5vEg9Jl8J+Mh9uUVCKQ4NC1pT2gfNGA8v0WCzeMWi2lewyouZyD3YQd9\nIEl1F0BmD4bfGgJb3se4YPc25WVmqcu+uOdJ26hMN/ZFAHHW2ipAvOI3bWLj\nSidj\r\n=nFTH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"a5bf7b87cf4c86345cd1258074f3d41b5ab33699","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.26","@balena/jellyfish-environment":"^2.4.14","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.0.2","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.91_1613845158405_0.9830109009660886","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.92-renovate-non-major-1904708e939911ebada3b0573c2ac51367f2aca7":{"name":"@balena/jellyfish-metrics","version":"0.1.92-renovate-non-major-1904708e939911ebada3b0573c2ac51367f2aca7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.92-renovate-non-major-1904708e939911ebada3b0573c2ac51367f2aca7","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e9ea563e1b10d17c541c308593faf77de1ac0c35","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.92-renovate-non-major-1904708e939911ebada3b0573c2ac51367f2aca7.tgz","fileCount":20,"integrity":"sha512-gFiKdkd49UBRXonTFCrVru2QfOpbbMPhZNO6ddmfa5sERb42swDqefvHhOgfcmsKbBiisYrIqkPiP5SuWNpLNg==","signatures":[{"sig":"MEUCIQCoRklM1MXJT60p1ogBzm/u7XnvZ+mX7TfAoGGI7KubsgIgf8bKpM4ubFbv7IGkEdsRedO8/hG72mPExH5W+wplbg0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":110600,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgMejqCRA9TVsSAnZWagAAq5gP/i/wwNXZedc0ZAhWFBqi\n24VM7v4wnFY5G0XSBI82AYrmO8cy+oYe05MpH6XUJKqtuqS0w4f0+Z8/DPBQ\nckKawESWk4urzBktOdKJJhw8ERkKVSOE3L+iWe2v01RtkO49A6YusEO3vJ2D\nOy7SopsX+vJZQGej1DTrABX9fAQM+MChaTqoqSr8qp94VhKXD98Hlh2WyGXo\n1Ou8FmIrSYVfzDC3AunEDCg70OI2ygi+2DPfUYhCY8bT1H5ruEJEuoDIIzTB\n3eXl+afs4zMwryvA80Ihg2vCWaJGavcR/kt0wK8OJtB2I/4MLeIXISctHi8l\nMefGfhlUJmdTOHn1rpxAhrSsJSLeTgXFWmkKicnt05vzwWgPp20tMpa4JIeZ\n5E+uQr3OPOKu3jW1QDxqURxR1xtt4YIcqNKeanbhkuodEPk/rNRPWvsIIBYF\n063/qHx+cylr+r77m9WToNc57FURIBNeosO1NTLBI/5g394EA8uDBcqA/yZg\n0Wt6IU1nC+odhzzocgW9+EpngRdId9CCQd5Ucbp30H2FKnywg3HS6G7vv1f+\nDUDFGbFYnIK+Z5BBxPGYrpzKSvzOtNpoO/BVfa5xgjaQokXF35Se85Vf0fo+\nVx6elV83kuTPnlm05+1H+VMskg1NtxZ2Z0kgTDTvMACcBy3W3Fq5u2ao5Aky\nyFT+\r\n=gXEZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"1904708e939911ebada3b0573c2ac51367f2aca7","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.28","@balena/jellyfish-environment":"^2.4.15","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.1.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.92-renovate-non-major-1904708e939911ebada3b0573c2ac51367f2aca7_1613883626230_0.9336112638189435","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.92":{"name":"@balena/jellyfish-metrics","version":"0.1.92","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.92","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"977bca7da589a7a195118e4cd3c20eaa262b8c56","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.92.tgz","fileCount":20,"integrity":"sha512-dtgGzu/DKzZqtF+9h2g5P0hjF+/0igOwVqeghGpLR+KxldQfZaoaSrUccFgiqUDKr6ZNCy0caQUHSJv0OzUE/g==","signatures":[{"sig":"MEUCIQDHNJZbqJZvbGS9/CZRlZTKM32t0hdmH9CiH9zy+/cHGAIgYUwwaMph/Anwd+Nh5r5mRq3TE7ON9YuprbFbUDWkbzI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":110540,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgMemsCRA9TVsSAnZWagAAVRAQAJxZn8oRShbgTIrmV2vh\n6YZbOq67SDK5CY65n6HJpO5dlAJu/n/eYYlixbfXnE9blQ8eRVZE7F74OZjT\nEl8WAt4Sdw9mp8uyn1/z/AgwdCH5iEA7FWg8jsN81uBJH7XRVAQaVaOFps+Y\ngj71Opy+p4C8AVqXFv4d1fLRS70ypZHKQOaWWgtKEVLTFuSCoj15Q31KaUf8\neO7IQs+/eFI7tlzG5vZG2EbXfGaCnTu9ZYlrgL3Tvc5J2lR4yStp4E07oqMe\n/kNICbED1gogenoq1YnN9INsx9SWJc/v2h+HqhgURaCKRFkQznU4UAYIsIlQ\ndNTRyXoIeX9Fa8mVDurZlmgCWrFK1OXcMSK/o0fJYWGRrCbjEvOzK+xazL0M\nkKeERz6KUOnQPWI6QB68olDOAqNF072OubR8eKIUKFRyDxXWOvaphi7UtV1o\naFLleHgLdHVMUvZtJggONoSs2/956ewm6T1+eVQrNHs1N5qTUbQJRGrFhusf\nfZWqq5P99c58wsx5Xqoze9cdWcHtimXUnGLPEkxUN/V0W8RJ6Y3inSirHWb0\nwERkbTpk/TB0IqMMW6wtngr+rJZRCQIx04qWBYUUkEDjhFzzjdUBcBNsq+Uk\nfaPKL/wx8HLzNVMxkoUvUNWNIHpR0Q9g6+1Ci7JWEl9zZvlGcBOttOZMBS2S\nDBPw\r\n=sgfj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"24bfb81e713be9778c9556b71d8679d1e9c7a33c","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.28","@balena/jellyfish-environment":"^2.4.15","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.0.9","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.1.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.92_1613883820090_0.7829417484628916","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.93-renovate-non-major-7a842fe0487504d007b03a6bd14794cb95d37e54":{"name":"@balena/jellyfish-metrics","version":"0.1.93-renovate-non-major-7a842fe0487504d007b03a6bd14794cb95d37e54","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.93-renovate-non-major-7a842fe0487504d007b03a6bd14794cb95d37e54","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"05bbc0eb38789b89e129ae86ccfb9244a29ec081","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.93-renovate-non-major-7a842fe0487504d007b03a6bd14794cb95d37e54.tgz","fileCount":20,"integrity":"sha512-9zFsy2VKP/Gx7/jYq7Ym9/UQkuq+36skmu7S2/GvXzA+BXL9KrYJTz6OYO/8LWv/cN0EEnn7hGA1ncdV6CUWXA==","signatures":[{"sig":"MEUCIQDavBVmkabr8llhUCGuhO+loluhtnTqDRQqxu+2iPBSbQIgUJdoVd0Dv+0ORYu5bzL3gO330tMcY1BjTX5d7Zr+vtw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":110949,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgMvwZCRA9TVsSAnZWagAAo0AP/08fEwa7ZlYAdXSTJkT7\n/55uey0Lk/jz93y1HcqyU0q+d8XEzvSrUm7ba1oXYHYjr15igIgl5WoBBAqw\n2gq5DkgfiYdmNGQeJMwGiFIatNGF6MXGHjifBhtER30q7NVyuzU4mYZ6dmCZ\n+iDt2xKw+Ahxu9s3J/dhKTCXDqgrHuNF/35PaVngCkgLIN174CYMN7sTS+MT\nuFShfzFUSO2AD39Wy2At5pvU87vvUyEucqy3jzNLDy1+ODS2N3MqL5P96DfT\n93enQp6PC2sdEgGC3eIyEKTnsCa2OyMjkd3yHcLoX29Sp6R7lamTEgsrpIkt\n9e+fQ/e6QaLlWfR9BIz4tu9Vpnc/dcwEU1gPmLAdghIMtDqc07WGtDK5u0+0\ncR2LeCbNKNCuzigCcdej1PdR20O5vQySYSSnJax91aIOpg0rRFqn3dskuEX5\n4UJlbkkz64ID5o3STz0uEGZ3qBf51FkYuafdS7jboyVRRM3JKK5v4hIhriBi\nNpmOtlu+aCCKsJ+Y5hVJgNGZnDjWSlsj9HPE0OJVr+lXZAYaPBXAFhxr7uyI\n0QhOSb6xBSuaXDyVfR9+DEMxgmo9qJsljvVsq6/H6gGFJMnWqzg40TJhMaHw\nXZ+XQ0joUMAZXT+c9w3qTDdaX0vszLGYvv2NB+exx8mmBOW+gsttLOMdO+HY\nr/7V\r\n=QiXJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"7a842fe0487504d007b03a6bd14794cb95d37e54","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.29","@balena/jellyfish-environment":"^2.4.16","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.1.0","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.1.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.93-renovate-non-major-7a842fe0487504d007b03a6bd14794cb95d37e54_1613954072934_0.1393455779259325","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.93":{"name":"@balena/jellyfish-metrics","version":"0.1.93","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.93","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"12729c2f07a8b90eb0e0d8bd818d661e72e70b08","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.93.tgz","fileCount":20,"integrity":"sha512-Eu5wC3KcGTHsK91s82s6tUKneZVH62PQ6bAsDfALsQPx6mvD63IKpTinUDziqfmGYufTgVK5rOq5zDot1xwkcg==","signatures":[{"sig":"MEUCIEW9cY67PuFFjE/mTzJcckrX0GkTSMsLmfggJhFgIggJAiEA3p99c3Or2zcBS/j2CDLQIlLObH+fWmrBlQb33GItMyE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":110889,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgMvy6CRA9TVsSAnZWagAASv8P/iEbBLc17W9eTGrqvwYN\nRq2N8pBs+LNgDKP8dhFOimz7b7HY9senjKqScE5Yvm/Y9h6o8Nc2PHZJmH8U\nAi+op4BKnNS9YMtZz8b99yDETrrbZZfpGXSgN+dlTTBbfP0CNmcCfN4+bFr3\n5eKavsEyFjYMOQ8sHUKAjf6Xn9njnVciuFW/qLtHp2G+zv1s+GSOwoTXvoJH\nutFldWN/w2OjAwzUCpmccKMb3ISi7HZil4LEMxTyPD8SQJPabybJQydhCxuU\n6ar2Rk431j5JcdBcYgYNVLO5/TC1Crr3ZhJPyawSjdg2P3iBmJxrj3/Ygv8q\nB7H3t7klrPM4bMcLNsHN990K+oevP9q+X9UM68ZzayxN092MSlRrWu5YyMgc\n0bipZrI37BBIUMtCl3hmWDAQS9TeNhRRrtw/IcLkDQi02Y8elA+6Q8vtMAh6\nYHHgE91T+pyAzQaTa8cWhaqIPaVcat55yp7EnAYR/hpH0fcCVgSBOd3amz2Z\nWO9H3wCCj5NuLgYmGOs/8KrvkXpMn3flMJXGKTMThmWfDrZFD8iLkTqINdMz\n6wWtBty8yFCJlafuX551jU6ZLyd9wE++JZ+7LA8ogvNZIbmHsOtjQWJS0RbL\nfo3h9XAbqGRCm/WuG8AomAU2voHTZQxfJiFdb0f2Ptg6b5Vi+5tILK4ShP6O\nuhiZ\r\n=oX0r\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"ae9c5f7d361c86c6857443f5aa069b52d0972cab","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.29","@balena/jellyfish-environment":"^2.4.16","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.1.0","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.1.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.93_1613954234092_0.41027957652407543","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.94-renovate-non-major-3996143540a39d3eb9fe17ee89398d1d8cb26696":{"name":"@balena/jellyfish-metrics","version":"0.1.94-renovate-non-major-3996143540a39d3eb9fe17ee89398d1d8cb26696","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.94-renovate-non-major-3996143540a39d3eb9fe17ee89398d1d8cb26696","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7a0c31593059ca3f6309466a484c1ad9c4cb390a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.94-renovate-non-major-3996143540a39d3eb9fe17ee89398d1d8cb26696.tgz","fileCount":20,"integrity":"sha512-pwDdN0wdUHWaXdzXTmMDd55sfg7+1dFhEJp3gr5rQ99UtyOd1FrGGMx/GCdttzwwzvsVgrvDCQcMzUOCYPzXHA==","signatures":[{"sig":"MEUCIBHU136R0wR7Qwhzk3S4x4vRohR8G2vortUlW/ZvNRj0AiEAqrw/WwnLUEgsz5/DxZY/ne6bTQ8rDSzIFIHM1Kfimak=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":111298,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgM+8LCRA9TVsSAnZWagAAdD4P/0pdhi0rbtV/Uo5IQjyp\np43RF5FblQzCyXG+fAezdehsqy9dodhtBKLcOfv4sU8uQisENU5OwmjoTrKe\njmRjCM4YOH+TvtKlPyOSJllSq4yKcy/5mULH/jfXiUl/FymffnQIdNzd3mh5\n3F7R/9crbKZe1l9cuztguXeB+GGqeTmwSizBFNNx2CvSDpQH4rLEPxz68/AO\n2SNlCQwoEfk/EhsRc2dxIhGoE2mJiyZCIMwL7EoVD6pKbhJasyFjwZQ9j5FY\nP0peBKAQ4xoRIps2HBGjWn8xHTa+RpEPOYWq5U0B38vpJ+a2HW/tMgEoUsqN\nCuh/fHQaW6gcHqL3tEhrxMWwU/Y49Tfd91gz7WGDFWMpviVWdDzrIPx4nfmC\n4NCsleTyybZNf5gWbrzzoVu1Pjv/i6P/k5McTU8jB04IozMbuobBvGv2kKXd\nqRd6OnDSfuoLdMOPXMkEnfVJweKcAKEnvuacpGFPt/twIyS28YyO6ef++KCj\nw/uCs5pD+h7fmo7zKH+shGA8rptG8VkMgPpzw87cfgczz7bsEInqFFclbJBj\nvrdFoynwiDRoxXYuVfPaL9L248WQ+uobjVmIw03aUcKdU2K5keSynwERnu/H\nBRD7DHNguhbl8rPit69DhGLc5n8lUGsZHYhkbCvZTLU4wlcJPdZAc2aK8Idp\nDR5Q\r\n=t53r\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"3996143540a39d3eb9fe17ee89398d1d8cb26696","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.29","@balena/jellyfish-environment":"^2.4.17","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.1.1","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.1.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.94-renovate-non-major-3996143540a39d3eb9fe17ee89398d1d8cb26696_1614016266357_0.8154807534854502","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.94":{"name":"@balena/jellyfish-metrics","version":"0.1.94","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.94","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ac87768f5b371df5a4791e22171d1955036245fa","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.94.tgz","fileCount":20,"integrity":"sha512-GOx7nEnvrKSSLTvjalbG6C0eMldNOnluKPc4Z6M3T5VIiviTmwdnZHMrQZWRV0jy4d4aXfaO2XiSl7KPonQGew==","signatures":[{"sig":"MEUCIH9IUEFXJ4ntxxScRZLAHSjxtPH8J8fEU/B+jQOlykJRAiEAzT/EXafwtG+4WRAHlcy12wV1HROvi3VwDXDYlXttU04=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":111238,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgM+++CRA9TVsSAnZWagAAfsoP/Rv6JB/pr4tCl0OZ/9hO\n/jc1k+8hJFmKbxdewfxZeXSsk47WothNvgQ+t2Y+sDe1Is2qfYoAxoWh4rR+\nebXJrNkJScWVq8zhptZoKzm8sfGmP7xKssnlpv2XXWo1RHS1ZXq5zC70kP/7\nFCxWJMOxFvx3MXD2UDPJUhpfsoar2yF6+vV/3hg50mPVMpGaoQZ1r8pGYEw4\n/Nzlm5kx1cTh7DT/QwbdUuqkeUwhKLARDO1+XVn4f+8EGfiYKAXSy/ZYZW7c\n1HeATAnzXTGDCZ9XxsMr6CeBVpfLHYpbZWoOxP8v1EEVDQu8iBZQKKksL9+S\nKxKMnyP6CcpYGEhKFtPPqQeaCNPPc14fJTCEVCs49zjcmgTBBKmO73CySby0\nFZjOw9xfZzm3eZM0h2GB9PIpu4FvevFPVSxXtjW3N3OMGxvMvYlzc3HIzB69\nZkbiDv20Un9eoY0GTkTVdPqsmVwgd52v8lIJUa/wGfl1SLVJ6MvEY1FkKwpN\nBNkAqMjwNW+Ob9TNG9srZno9/yYlaEe+04/SjMiWHwK37FFtCBo8GuyayLWD\nGJlbVhmjJA/q2Z1eFAaGRrLY2eIhbTKtDEgZ/BqEGOEY32gI6LPN0+yxhc5s\n7Rm8Lu4mjpushXIAcfqXwlad3pjCrMmcKGlwAux5R+HjIcnyocXpCp5cFTLE\n3pL5\r\n=lnbw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"c09968f40301f58b8dfd5d260edd80747923764c","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.29","@balena/jellyfish-environment":"^2.4.17","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.1.1","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.1.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.94_1614016446090_0.48025824290497443","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.95-renovate-non-major-2c72cb832b69bba60f132ff77d342d3af6280a63":{"name":"@balena/jellyfish-metrics","version":"0.1.95-renovate-non-major-2c72cb832b69bba60f132ff77d342d3af6280a63","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.95-renovate-non-major-2c72cb832b69bba60f132ff77d342d3af6280a63","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a605f36bfb7805f6d71e8a98d9e13adc1ea41913","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.95-renovate-non-major-2c72cb832b69bba60f132ff77d342d3af6280a63.tgz","fileCount":20,"integrity":"sha512-u5EfExhFr66vVeWcVIDcL9D24drw9wIx86RXu96WWTP2QG/o0aC2dgs16VgyLkO8NzWC3Zzy5PFZtYz6t3ujbg==","signatures":[{"sig":"MEUCIFOvVxyA4+4+T5f3zyWG19NSb95YI/I94OAg5ZzscCxtAiEAiBj5L2gWQCdBDLYBEn/qQDJ8Bkf2Vbeju+q4FweizLA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":111721,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNBPACRA9TVsSAnZWagAACoMP/iP4cbQIYUjAnOUUrCA5\nw0NdkkPlf98IpuBW2W9pQ/VMh++MgJPJHCeSJHvK8bqlDTQd9K0kUDDA/AzB\nSMv5Hvk/hLOWCE/d1LRuOFro90jZKvqxcQkqk2OnaUbM9wYbIpfCN84lTz01\niE3A+p1KPPmDRRjP0wwhaEUrkuyuT6FS1E4BjKodwcRr6lhvGkzZhwib7EI8\nPsFao/xUigIE0QwrbB5fmI+L/qlTB+b8oA+a8m7/0XidzoQBwv0DJNO4wSlc\ncqn+MrhFCqH3tAafzZACvMuX4X1T8383SwE+jAGLReliR5Okb3Ew7Qii/XtD\ngHSb3vv9+83Ed47GTU4/oATQ58e5dudz6SKs8TWsknru90xCU+MehgZvmfT3\n2ukqF/Yfg3APCtuT4flvC3sivZ7o9nU5aM+XpI5O+1+GCrbCifdIMP3dI1sJ\nlH75hGJ93pt+vneOaMcp4UW3UZ20rC6BnHSKlwZP+rbJPwkiZzds/WXD1SDw\nL/ZSJtzjXJfvtZuiYJOBlUpqMZT/XKA4yktT5YMepN243tJ/NtQJCyTR++dF\naipYMEek8GjOTBO+fY2vMLMVDVQtlcSuZ4ugm7YeVq71lCcMpGkgFqeuCNnW\nkqZp/VCAO+Sp556Nik+QieFHXhmYXNH0H5VoZnz9lyB3uT5/Lt/Tk8yRIYWQ\nHDrq\r\n=jK5x\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"2c72cb832b69bba60f132ff77d342d3af6280a63","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.30","@balena/jellyfish-environment":"^2.4.17","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.1.1","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.1.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.95-renovate-non-major-2c72cb832b69bba60f132ff77d342d3af6280a63_1614025663727_0.8442206793099474","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.95":{"name":"@balena/jellyfish-metrics","version":"0.1.95","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.95","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2d010d9e66d900abfc41f3bb66ca9b3f99bcb28d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.95.tgz","fileCount":20,"integrity":"sha512-1WagR4xtmNoGeFaG9S7Q9o8ogUozDqmY6kmnki/fYYkxlIcZ0ZGbqreIURA/WHZ9E173kM2Z4iPGSZUTg/LJAQ==","signatures":[{"sig":"MEYCIQCgG6czIIG1YJ/JHWK6Ps3/ypS+DmlYRaALSLFU/549GwIhANN7I/r8s48SgZsEZvNjlR+57DlUQw8esXPIJJZD9tCW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":111661,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNBSMCRA9TVsSAnZWagAA1FYP/3syWVbA89Q0Pd9ztM8U\nPE6jNi8fbjeh/UTb1HMqaic10ZIrQIgO8WIF9msFhuRT1OXDkoTQrhKw7f08\n5qSR7YoIZMUQ7gp+Iy6VkZj4SPLAVqeOhufz5gB2u36U3ux9hC3uCNRG0VsS\nidwoWltBgm2ybRU7PC9jGqGtNr11KeY7HvoXKZGknf9H2vfCuvHuyNEAAy/f\nSDpH/vEP+9oZizVFNYRH8WS3a6N6aylj5tIkqHly29rzS7bOJY2B787FGPzt\n/c7lfwLDobA566vT/8eBNrWejx7GVNhxNLrWNVwV11/W1A3nmbRx41IZ1as2\neCjlM6WXlnXKeHayAJrf8AWKh5CiTMob/dMDhJpn+ZnP1NuCwGIwUGqz1TGB\nSHbTyEdgehQLhQLRAIDwU8S6SB6872RC4q5hoEmT16G/4Pnwnh28IBMsKgJL\nCoA9+ZqNcaMD61rzws2Wt/mgvQBCiSZauizt4AiR7nszdizZmjemNu8kcojI\nGVXXXAdtP4XrP2VZvthN29nMWN3gT49BJQONyqpDCVdYfgF91W5JehigA8Y9\nWtqmY6SmvRoaPVCkP3BO+DyuQS0YQQQ9wUfqA6spg6R5a+9ue0g/26BYt7+v\naS5hOgr4bBAFVa1szSh4c6ucdEUr/oAtEMXV6syBHttbC7ayrOW4AT80UTAH\nGXnI\r\n=1ccl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"62de012021607a1e633b5e251eb631f6b5cbf1a7","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.30","@balena/jellyfish-environment":"^2.4.17","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.1.1","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.1.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.95_1614025868267_0.8041121055298113","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.96-renovate-non-major-2aa7361c5d54bb83e2bc0c33d8abf841f58be2c7":{"name":"@balena/jellyfish-metrics","version":"0.1.96-renovate-non-major-2aa7361c5d54bb83e2bc0c33d8abf841f58be2c7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.96-renovate-non-major-2aa7361c5d54bb83e2bc0c33d8abf841f58be2c7","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e7ed7318e3ef8ca819046105b73a8659aea28659","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.96-renovate-non-major-2aa7361c5d54bb83e2bc0c33d8abf841f58be2c7.tgz","fileCount":20,"integrity":"sha512-3rQilXAXVyAbVttMD0686Luogj5VOU+v5ZpjmM8z5MmMN1B3I+fCb2u+r86e2in6n+SwXMzE6FpWPOrES9PgnA==","signatures":[{"sig":"MEYCIQDQmIx+YBhqC8GRFf8C5v51hh0aYgs4+rKTE7tc/xFOyQIhANi2YWoGsLCXidIL/3QuRkFutWmIsqOxkBMqf8UyRNHP","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":112070,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNHW0CRA9TVsSAnZWagAASTgP/jEjP3yDcpFnLUzABxJz\namiJEbKOF2r4CA06EbMHqGjzn0/nIGbdagJtJ+LqcqV3xTeyXI9AeslBaIRd\nFTAK9nYCamOXr2b36vt5UPWJ+1FabEihnl2BAbIEWPPs48YlF3AVq9g1XOXW\nsSQnW017fCDD3VXAVMF1jL0/x+adwR0fxv1RytdtY8kg40/ocXjyw2KwK+Fh\n/n3ZIMHsPb8RFe1TVO1TYGubiszwTZDZKiFAqcmjln6uzvfpqgjCold8TVvU\no1YzQEtfeBBToxZWp0drBHvVZd2dsn2E1D1sT+duTzvDm2e8T6DVtatqrwoC\n0DMIj+Iyq8cxHjcwjyWAymRQ4p2kFKQVGxHGQCbrpDbZbcGzpEWRfRrl01ok\nQCXZsFj3NNZM6am/Gn81ko6fUYzr4CmL+VNsHkUdzMLXB6BXKQgyzqVg73yT\nzlyZLsL9r6ONwFg1vcCQkplj0SdinBK1DhNOVeipFBMSSw+ax61ymI1vptcE\n207OAG45dVbpWSnyfGvt/F+o5Iz6Sy8ZjI6dIz0w8yfauxB9jZ6WRU5RzW2i\nr9I+6WzfjTM7nWy1FmfX0NURaVkhEPo2KqhDMXJFeESa6r0miW4dgPFdl7Pu\nd8dAFPn8l75RhrBlkUw/hjpQLNvsvHnmUSQ0MoXAgYtObPyHQqI/hejXyAMn\n4tIW\r\n=8HEA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"2aa7361c5d54bb83e2bc0c33d8abf841f58be2c7","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.31","@balena/jellyfish-environment":"^2.4.18","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.1.1","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.1.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.96-renovate-non-major-2aa7361c5d54bb83e2bc0c33d8abf841f58be2c7_1614050740016_0.7233103341811216","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.96":{"name":"@balena/jellyfish-metrics","version":"0.1.96","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.96","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"42ee4ed477a0df89243a0efcca14ba1ad0c9356c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.96.tgz","fileCount":20,"integrity":"sha512-cKFIYQthRBdKnYmwPbWn61IesSnfkkFT7cNBgmgyvgqRK/6eVxOKgi5IrPcg1OgRk4jNoJAdT/6SNmrittOReA==","signatures":[{"sig":"MEQCIEgdj+/sv5Ff3uT9JeE85bEeX0YrJrcDbLJD76HTQpv/AiBC+qmKr+V4ncStwEXnj/6BqlSBkEOxvOQ4aklALbIGqw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":112010,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNHZwCRA9TVsSAnZWagAAahAP/1SYiqS+3ilIfnDcz1rE\nAi0J9W5HMck7EiCjL8I8gVO2+L/NWbMg1LaDbk8j2hpbNZMYQelLg5axHINV\n9u9sj1jYT1nOv0iR21oLMGJwEeIedcgUhe/zDd92s57vBxF9RUrzZkbqpwQJ\ngJ9nXF+nPV45u2Jz6SJp4c5V6xEy+lC8YfXcXMHnQe4Ply4XKGaGmuuHp/+n\nSs7eBKYzSykUS8EglJYsZmsJgcVVzfEkeNM/NIy5ht/E9dmvP/O5K9nBMLwF\n1JO8I6F8hpCaB/uJUbuAU/5VxSP3YRNhVSNcsGTJi4FiphIy+X2c9TMuhpJW\nnO9qB/CHqeZheLwSIqvNw/Wtv6W7K8Y3rkVow1ZmvebscxlEmw+6fTgXNTpK\nRIBc4Kh2QLbKp9jqMDAqS0TgOOt+rrNTf3r7bjCGZM7Rb9KtxKKIO760Xt4A\n8UiLafKChZUOwoBZX0pIMt0MQoK+Xfo7sNL6LrZj+FGbBx/RbIyaIALo8dv5\nPpdwau/DpvW1Hkl1fs15RmJ12uFfJVwfvR5Xm1iuaMZJG1nuvVG/OvFtscnV\np4yiGhCb0WWquQ402l9q2YtHjdH6ogcqQwJs/kVzqAxtl0QGZWTUifnyQGyc\n2EBj8UsWtvlozAlid1VvRw/fnuZ7CnVw4mBV001osa/Rf4SXhQ4VmN3BnQbL\nCUqU\r\n=L7Mn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"ff6e90629548a9cad24e56caeb9b6c59728b4473","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.31","@balena/jellyfish-environment":"^2.4.18","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.1.1","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.1.1","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.96_1614050927792_0.4916437488282386","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.97-renovate-non-major-e1f6da79d538c269f0ef410ef23cdeecfa5c6dbd":{"name":"@balena/jellyfish-metrics","version":"0.1.97-renovate-non-major-e1f6da79d538c269f0ef410ef23cdeecfa5c6dbd","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.97-renovate-non-major-e1f6da79d538c269f0ef410ef23cdeecfa5c6dbd","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0baed147f1f17c94d6d650ac422694ab30b41537","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.97-renovate-non-major-e1f6da79d538c269f0ef410ef23cdeecfa5c6dbd.tgz","fileCount":20,"integrity":"sha512-Ya6yu96kZwoFKQj1BspFeJn93I9/LlXgsGouuswzDDSEnV+sSqZ6s6tasAZj3Ue7jebYDsTamaKl1tVFkBdBPA==","signatures":[{"sig":"MEUCIQCm7sEqwrW2PE4eQdKvT24+3EMPzD7ccMtA+6vEh6emnAIgNR3clRzuz2Gm05mrP28/oVB4HCD9+sPktPE3QTe9/OI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":112483,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNNd4CRA9TVsSAnZWagAAcsMP+waXkrsB2rJnZ42ki6+h\n1gxptlSa9WiILEr8vZQ+nDV6mK0xJCQ+hJwOk+I9ja4krf+kI29QRoRj1r1O\nkwKrvKDkXgJuBa02NhLwZz3lmvvkoFfwBphdAlvO+NGEF943OaGBzPoNESWL\nYksRyVc50A3bMb45YZHVMJt4HLruoXrnrmf42RBYEVE+cgCpanParZdTRgHH\nRtBkHI6xsiFhc8zpQMoWal1RUqOzAi0PiUYK8W5DfpTXLMvhSlMjHHdT9IOB\n/b3haEEpwL2k5UrqzEhCKOsV64I4e+YizM2IyvFeUEGKgZ5oS5rplrK+6QvT\nSmi4x4QzC/lqkZ6qFnOZMPrGIXl2haRfZzMp0fYJqi1tKGkIjx4HKIQrPfKU\n5r0f3NTncjAQSqYbJBNlC7a3ha8HOOsu0mecmcUYQJ8abaFVL13RJf/bYKug\nSMp/d4WVVLh8qoa23TEz24CbbjY9uCra6tfzyLXbl0LdJ3R+S9JbwxC0DHUT\n2avkA/JOp4G8h+eIJdl5TlpYAREhZQi5eRTN9TwENQtu//6MlLzJbLu2wjvA\n20uOj3YpyVaZNG8bi0NFgh3G6m32/omEenirnIBGpcbp7NaVPE2gVqo5qOpB\nK/szCduA7OpkF4zxLQ9oDmkjeAG8bUowBtodRyMkcDVCEzXYdxehCiisRxgN\ngEiJ\r\n=+jnS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"e1f6da79d538c269f0ef410ef23cdeecfa5c6dbd","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.31","@balena/jellyfish-environment":"^2.4.18","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.1.1","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.97-renovate-non-major-e1f6da79d538c269f0ef410ef23cdeecfa5c6dbd_1614075768337_0.3501976372982192","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.97":{"name":"@balena/jellyfish-metrics","version":"0.1.97","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.97","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"53a6fa6156062b38d72c1f42b6a59300511844d5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.97.tgz","fileCount":20,"integrity":"sha512-M1es9ueRcd2+zoWzmpbWFF2b99kdabKg5hvhZs64y/5ZkDFHx5+kNhluZvAkhMC7W6aPFW+nuFWTdAtDC392Zg==","signatures":[{"sig":"MEUCIQCCiou8yVXsCBLTk6zs4ShNHFOmOiY6ujETQCWyvM7eXgIgbXVJKP5y3OkAc6yndrYqk6ZGzG16Q6G8IzR2nc+wxDg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":112423,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNNgtCRA9TVsSAnZWagAAByYQAIEHxs2XFXfhAh/rvlw8\nPJ7dHs9ByLWOtIvoxL9osIaYUueL8ZfiouYtYb+d0hqIcfuQQjJMALg2MMXs\nn1CIhFNIU3c10Ev62W5eN28NYBfL01lNU6UvWX9qIwZT06grzzoY1W9SkQ+u\n3IyweXUhsSX7EkN+cNVqgLEY2q42zgxVhQaniCnjmNekO7FQBYsseRdohmly\nyJ0wNazbdlKcjhqVeLyvBqVtB0F+LXJIh96GS6E/Jf/f6jexdGXPcZkGp4ID\n3XWBrA9yfur9K3fbqZEvAms36Zti3a2I9ZXQtqn3mFDL8khLViVJu+0ocSJs\n8hz7kaoxbsvPlKC/Pe3J3CCgS41ZPjY7weJev4Qh8B0ogcyPgT64Ii78fYxI\n8CScWf3X6yjZhtgkagOBK4d0YgCTRPKeInNTKcRIyzmRkjNZ4dGPelZ/D9Qn\nDYLu6TtK1jZtAL8pTD4S3YczcppNT0/J17bDmG+kFpB+0kQxoGWl7HIoY1o+\nxSrwqpYsKvKwJOa9lUCPVYUa33jkIwUM/bbAfrBox/EyotJ7SRpIJK40cVJY\nHUy4DVHuFePpvySBV/MtL+s/TTr0lBk9f3KJa5defBAW4MxjXVi3IFTTyD1o\n34xDPa+6/bzsufeXEDtL+htgbrz9VjMByEkC67vAl0dKGiFJe0YTuLLdE6nT\nPjU3\r\n=ew+L\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"a4d906855d99901df53f531f0ee0a101a1428952","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.31","@balena/jellyfish-environment":"^2.4.18","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.1.1","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.97_1614075948846_0.39882732712655966","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.98-renovate-non-major-7ce04f802998718efccda29205a80dcc27a9d53e":{"name":"@balena/jellyfish-metrics","version":"0.1.98-renovate-non-major-7ce04f802998718efccda29205a80dcc27a9d53e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.98-renovate-non-major-7ce04f802998718efccda29205a80dcc27a9d53e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f31ecad4bfbcf37934e198a95c9019d0679644b1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.98-renovate-non-major-7ce04f802998718efccda29205a80dcc27a9d53e.tgz","fileCount":20,"integrity":"sha512-bt4fMN4lDicH5UTJRgIDCzm0HJkuebxDH3jYt111/OFQSHbTMNR7nOIfWYcc/QNpREphhj6yXnWwA77+Qx2Xgw==","signatures":[{"sig":"MEUCIQCOxmjSZtrYPI4zck6hc0bOs14jLZeN7yqIeNm3YHK9KQIgKcLaZ4PqibObWFUq0le4TG4NMzAnSji+ziijklNpjrY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":112832,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNPDkCRA9TVsSAnZWagAAinMP/ieE2TzXa5yvvCjN2jyJ\n4bLevzBIngRxcMvT4zI66DbNzjnX8arSghHKXJn7IqeepTy1Hu2bsYhQd1QX\nqvwxbdFOTeG1VC/yUiTnMcNNawCK678F/X/ogPK7zBa2+qgFENYGMSPB7Err\nGR3YVn/NxyCmfOh+AtUjNtHRcw2KCvpM4cfiy3U2amzMHkU9lUFrOsUepCMv\no/4RFwdIbKjVXdBSHXMFcjwo/f7kp8I2SJG73gQ/elVous4FtBHk38MFSusb\nBwvPh2V5frWNfJ1XOzkPporamufvDFG09gwnesv0x4svwWpGsFMcmgSKeWPx\nJ5RBDH6kGdvQLIYg0tib2BZJbYRkeTRMVEHKxuBv17d48ITdYRf1RsL7H9iZ\na4Jys+aJZ14kryAVUn0MWl70Ri3ke9xwr9+cb8+A3kXoDiXUMB46uboL+MHi\nUl6FxwQ48ZnWwWec4J1Vl1nugJjwu026yJApukPtf3+EtqAW4rBwxzsO+R3Z\nTKaM396yq52qrVbyhIcy9exfXCI/VWBi76AmkHosPjUbSQRwc/VjjiOn3VHy\n0GNo/Sx/JEqzJ8xiO+FYEzooTlEwIHtpkNgwcmw7k904ukDpqEHaiuFd5oaQ\n//jrygNaKVReOVaqcrZsdRCz6ZKSqQ+8qjBTu88iZARWVfY/4XoiUerj78gR\nf3/X\r\n=p/S1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"7ce04f802998718efccda29205a80dcc27a9d53e","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.32","@balena/jellyfish-environment":"^2.4.19","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.1.1","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.98-renovate-non-major-7ce04f802998718efccda29205a80dcc27a9d53e_1614082275907_0.37276499631125803","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.98":{"name":"@balena/jellyfish-metrics","version":"0.1.98","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.98","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cb336cdbb38a79c0ed7e36ed0428da8e4cbf0442","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.98.tgz","fileCount":20,"integrity":"sha512-j5ZxdtoXC35SZA8DAE0xdAkRD0nIMFRmG8IG71t8xI8JUu6mPpJHHPiLDPMo4ZGc7qVxcVPPgyNt+6lotiPMlA==","signatures":[{"sig":"MEQCIEkQa59n9f4hjP3kkXw80X6DwTbJTL/Lk7roEoQ3h6BeAiBrD7fXUBMGD+2s2SSOVXbl//2BgblYbI3qS8RwOHY/Gw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":112772,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNPG0CRA9TVsSAnZWagAAe6IP/iX5OT0ZAXpeSAYIXBLL\npnjl6/a9RIswyc61R+ZPZyVm6RdA098YBrrNSdKevtUGP6XoS2QI2F+yiAKX\nHjZzCU/WZo69rQGa3NoEwTfRe0eymrhO2w97L/TAvrrR+ZlfKW3rAerbcvsW\nFa8C/yARhCzrfSJsK/ffz74tgxX398Odg9iHJTYPs0KKj/JqJH/goWCb9d0R\nXzuk9yUIeYckG+TLSwUjoIjVBcQEW13YX7fSkuzHulaEAsQQo7xzb8JITmHz\n5dHLH0I52tjMxnjIvst1n5fPMLu15sG+1BcwTYV0bDnO7OeLkpZyY1iPMCsR\ncM6W5edutSpK/OU2rqUqLbzQ+rBCWktauHD8+Wzyg8hNB2b8eRG2t0Ds5qBP\nIif2auL8wWL4+yPgz8QWTExklR2UEwIBrZ4MV+wBicGcmTpr2q4tUyC6q4JU\nAsk4q51ApiRBjwMVrJHlPgEmGdLE2Zb7qyEnKyCNu/+Siw0RsZAvqmKRMDRb\n52yjAgEZlJO/frEJBrWCZBkHT1UY6Nky0O7FgkMAN6jrx1CsD44SRRDcNSsa\nRjdcSFe7SiEjh4TIJxYD9Q27Z2Qn4dfnYTnzLOdTYjRYtz/W1Nr6IH2tChid\ndX3Uz1SPJ7BvHAqtXKTjL0dph7LJMJV5Ve7hKDXjTTVtyoP+b45efcdiyDLb\n7NUU\r\n=ITeS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"94b367a2809fa67655938be8c33a91ac65ad10f5","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.32","@balena/jellyfish-environment":"^2.4.19","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.1.1","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.98_1614082484429_0.008290655935451863","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.99-renovate-non-major-a574bd9742ae5d62aa7d50b8130c22fe199b0f3a":{"name":"@balena/jellyfish-metrics","version":"0.1.99-renovate-non-major-a574bd9742ae5d62aa7d50b8130c22fe199b0f3a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.99-renovate-non-major-a574bd9742ae5d62aa7d50b8130c22fe199b0f3a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d9534d5dd9fc161d05def4be3b7660db3c5c51e1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.99-renovate-non-major-a574bd9742ae5d62aa7d50b8130c22fe199b0f3a.tgz","fileCount":20,"integrity":"sha512-LJjBBJXvHA2sizhMqvUC0TfbCxKG/UW7lCprfpMv4mdG7wmtqhqvg5jPmXsbenf0ldeV7afoYdyjOWNBceRj7Q==","signatures":[{"sig":"MEQCIARq89V9Clz1z/InTQ+0w7pRwDDTVsYzwP0RRd/pm/0WAiBQxkKNwAgchF5cxK1b5LNzBBF+VSGwtrq+hrjrYaFxCg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":113255,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNRu+CRA9TVsSAnZWagAAUWQP/239RBSUVU4NqIvHGhBF\nl3VDZ2kdQYmnKSGXyvtG2/IxlrnEkU9W9NB5oJHRStCG+h3S7pTdf0IPg3Ho\njWTF3F4GWax6tqptGaua0LgSsYJUhqN3SwzFEcwTQ7ZFGEc0p2LzaYXKh18T\nxvapv2EyED++50vjUkvYTfMEJqbVHmoHSYqOmJUJdl3Mrluk9evnu7amZsik\nt4i1xWJ47t1OZOCPu4y5JlReqSq+Tdpqiz6LR/Zhf/ro8UwIBww6gYllk4z6\nzF3cPSnPvkOTgzBPyy44g/sQ+G5ZcrePWF66SAEBBAh5QhaZy8ibD4QvnxQ8\nVv851/XYFiI/CrPwWdQ+U+EW3RkkzHGQ9Ia/4DtbwKA5elWgP651ahHoAtmD\nWlgdeOpUJ1JX6qzMo3Y5MLRsRKvi+DnI8lrGheUrm1kdhIfVj1ZaiPm7U8i0\n3i4e50/Wismr9TM4pj1kdcwEg3lSsof7LRXs/e9HcAW6S7/MEFxx235LQwt0\nlAsqcqzy8Zj5ZmaKDalOZUHNgp1BNl13xa18KJA1X5I5z11yVMK+Fdh6mqzb\ntiNSMB9iA525w25zGsbYMJW+5XdiZQsjglM9M4PSCVBNrG7ntiZnck8IEy4u\n1z2uMpCrCajpS4E7TvaYrxtf2Z5f8UXeK/AnoyIimtENzhQRkI8N04kmT8GK\nQS5u\r\n=6xzE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"a574bd9742ae5d62aa7d50b8130c22fe199b0f3a","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.33","@balena/jellyfish-environment":"^2.4.19","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.1.1","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.99-renovate-non-major-a574bd9742ae5d62aa7d50b8130c22fe199b0f3a_1614093246399_0.624428362007176","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.99":{"name":"@balena/jellyfish-metrics","version":"0.1.99","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.99","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"adc8c7b514ceb699e1fb7fec819f0513604f3f37","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.99.tgz","fileCount":20,"integrity":"sha512-1Y6gOY68TCkFIyWFUHrD/bUA0r3GGqxxZRUw3RT1eHrXndni0As/IJQbXoALSQohz3zmFBDW2/jHwFlzW2fYkw==","signatures":[{"sig":"MEYCIQC3u8oPtyfnf9QsSxNxteyzaBKUIg68RZRkCLvvNGK0XQIhAJNm9fhjMKQl/vtlRJdCLaJ2oZbX+n5qB1DWCGyv9BJ/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":113195,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNRxuCRA9TVsSAnZWagAAu+gP/jhLoXtw0TUprOiUurUx\nYEIGIvEUR6KEiDy8GNbOIOu3S3h8f1BMEz4IlCp7UT3CYOjMqDimkQjX4qvd\nnlV01WclIudywo5M3QoEcJExswohWK3QonelYWD5jQxroqKRMhDmkLJi/PiD\ny3K+LokcSwgYCwmqrDC2VrkcJezgy4l+Ne/dZhKWiw1MYDZTHRzcr7f20DsP\nMeOfw4rtcgGFKxPzw7hh2GwY4aBFa88Fx2GUx+wyfoSash7IaoLrKCjk3Fg6\nQVB68mN5rO8h3XQyZSXLk2NtpfqwEESjlKx/wVDsooB5awC/MzSHwtQfwnT/\n6u3hZLpMuwe2vOeY7FUkC2HzLPSXoo8990kFH86aGEAFTTXV+fkHbLvQlVS/\nXv6OBwIFnKEzeueQsX8HlgY9pQ2G5WDr4VVppU07dqQWC6D6jGiYJluF608b\nKjpq8h9MGXT9fJWwlxrW2Z9A1X2ZpqAimvlffRA1EgsbJnWlagdFWJo7MvEF\n6Owl2Wfn51s1NAxAOyJmUNRRafWLbfi+8sirNRHT6kwslPC1F1d3+vj23dxW\nkNL6rPyrcqhOgL57x4LTuUH2PiV6j3VZJtjlUvc2OGMjiLOIaCxIqzW5QDR8\nrFXlju057B37cjUgGyMtrgNt6ourILCImJX3/634JLfJd1yO/XozUJZi5T0Q\nuJ+R\r\n=fClQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"bde7ed1af44db1a17dfffd646da5d1f5637cda7d","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.33","@balena/jellyfish-environment":"^2.4.19","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.1.1","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.99_1614093421484_0.31428086504769204","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.100-renovate-non-major-4511db9fc45099d1ab5b437af15995c4759ce302":{"name":"@balena/jellyfish-metrics","version":"0.1.100-renovate-non-major-4511db9fc45099d1ab5b437af15995c4759ce302","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.100-renovate-non-major-4511db9fc45099d1ab5b437af15995c4759ce302","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cdc7af6c24900d748d2d0b2fbb42dfe2b20cd931","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.100-renovate-non-major-4511db9fc45099d1ab5b437af15995c4759ce302.tgz","fileCount":20,"integrity":"sha512-a9kgIWBIUDV9WHSCXWjrs2p+TDug4yVUun56SRe5apVWCnX1QYPe5bl3Ys0SMiJMZqPswiAJI1mxG1UIlXsjXg==","signatures":[{"sig":"MEUCIQDaF3HSl0x4AAlqxZZjSU4b1Nb583tPBVGas3j1S8vv8AIgao0ZhNRAsB2VoNXc1wJDgdZ4S6YkkkOIYu+bBj1nadw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":113681,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgOO++CRA9TVsSAnZWagAAFWwP/jLpea0R3aZzNWDgrt70\nxPgeGkfUobrLJOfZgKhZY9s/CsF3L8+0Upm+fxeGuqrfMBYVUaO+lhh5vMK5\nRwPWVK+6TxCFVj/TnUv/unrs7uleHk3a6Uonf7HwmALkHN64cEbP/YQ8px98\n4L3L2l+ndTFTq6ah8pokst0eQdlBK3rAifXDzSqTSITCihblUXsrZDgCt4MC\nLnfMksHAVc3KhJxFQXayHpsTdOu/0ViKjnK72zpzOVX+Vf9nyCoYDbEvxCsn\nhEPpHXt2N+5Yrsy/tuST1wDYLeYUzIlOlsUPqlZRslS+HinmgXWLytKnmZUD\nuJNRL5xkRw5DtOOmBqBkbiY2ATNuHvhxE6eFZkpxzTA/OnUj9B80FB2rQSrw\njgWyFj8OKCtmd2kjNAzpWa+giVb63ubW2Bqc5QWUf6HaZwJ8ofh6GDDOaFTs\nLr+EMAoSpd7jB23wMse/epPhp8+D8xBKkWchP7BEGK3WN9D1OudWxc0Zw4S/\n19K3e48BTUfElF6CLvM9uEfI5ZFOteU5L2tDxWZNCGxc6B7mKeQs3Q7yp2J5\niJhrYzvjcQMo0hpGBYtgFic+UlgE0VyZO0PTA1KHGqhbmMbwOXSRMdzhHnH/\np2GOx+WnhWSbHpR2hqREO+/we1NLQq9FZK4DfQBJ/RZHy5PwRkNDpdyIziP+\nGo29\r\n=OOuJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"4511db9fc45099d1ab5b437af15995c4759ce302","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.34","@balena/jellyfish-environment":"^2.4.19","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.1.1","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.100-renovate-non-major-4511db9fc45099d1ab5b437af15995c4759ce302_1614344125978_0.48464491323518244","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.100":{"name":"@balena/jellyfish-metrics","version":"0.1.100","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.100","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"66fccb45a395d0b7f4b4dc1f75538bc4d5f36530","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.100.tgz","fileCount":20,"integrity":"sha512-qHzuYyAdLkaMbl9JnJiaOlaCgpaUsOFw1uRr9OeXV2DzWQ80jhuL9/HG7moXfHboqIEevCGq5h0wwlcSEqBI2A==","signatures":[{"sig":"MEUCIQDm6/KNs94KNSHvVTpBHaPk0b1UPRVwYcYCHhePld+tugIgOylKWcXcCT/1vzBj6T6oUAausrORyRIc8e3i4Rlf8hA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":113621,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgOPDXCRA9TVsSAnZWagAA2DYP/iskckLq7dqJ0n9nH9YJ\nYOutCNQed09zqOh/w9VV8Ic6xv0ZZp15RAyHIen2CCJ6kGhCNdV1IapAql5e\nPVutgayVLokybUS7uLBImU2GrS/RutSKVvVaY/Z+rrcF6tFbnO641WuaNBGV\no3xRYqwRAZjbij0XJq4nQUUzuYPfTCWOYG+NTl3pqFTrPWUNAkyAynQiPuLl\nSd6HLXPSWg0YkLLALIIY18/ylLWrMYuvSHt+HRGUdLGOGnc/g8t95ghZsFoJ\nYnlGIDuQh3jbGGyFcmbeWbm83F4V9XFfy5MhG6A5UK47MWjsbFrRMX/eVpxK\nkDxjIiwkLb37L1p3Vli5wogzjy74U7AZMQk1m3zDh4F6oTD0JswJruSS5o0D\nkjIRtfEMT1vkqca4agqeSbruMxtJvb7if51UdYtqoA9TDQ48sKGDjixY4QZX\n7z0BzI/VSkTzkTxiZMWhVro17XpUI8038MflByp/tQm9xtRkSpytcNZQo/GN\ntX7Y41Oloj+IhdXmnxc+6wFsz6AiJHdtHGHfSDDewV4TdM33QZUlnjsCN7Ur\ntGRNJdhlmZQaZSbkM8s0HBUU8qSszHCzvlrWgUC7LtgiiXvBXajsC4V+EB7q\nT+xlopvkn1cP0NjOS6pf0vN4pCq9YqdNjTPtpcBIrwODmZX5MYECw//0Pq5v\nR0vo\r\n=Fpul\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"3ee1d6806fdf3fe5055f24a4914d712680ede49b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.34","@balena/jellyfish-environment":"^2.4.19","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.1.1","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.100_1614344406926_0.426174582412125","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.101-renovate-jsdoc-to-markdown-7-x-1833b9be96233feedf9a3dd8ab4cd799847b5a56":{"name":"@balena/jellyfish-metrics","version":"0.1.101-renovate-jsdoc-to-markdown-7-x-1833b9be96233feedf9a3dd8ab4cd799847b5a56","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.101-renovate-jsdoc-to-markdown-7-x-1833b9be96233feedf9a3dd8ab4cd799847b5a56","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e5ab8e88316da6f3b49ca360942d7616bb55c6f1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.101-renovate-jsdoc-to-markdown-7-x-1833b9be96233feedf9a3dd8ab4cd799847b5a56.tgz","fileCount":20,"integrity":"sha512-N4Vety4WykJvBNuyUirIS3SL3QYW1qCuyelwihWby8601Lo01L7oEoC0zthL+OsvSqkE8FdALmrXEkBBfUJrwQ==","signatures":[{"sig":"MEYCIQC47zHMz8A1qsx1iWPcK6OS66Q9AJn7IWvdKzDCPECB8wIhALSo9wch1J08IgZZJ6OfNzbxCeSkoiwDBHy/EKatC977","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114094,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgOYpACRA9TVsSAnZWagAA3PgP/0Q7q1Uuq7nbbLYEJlJE\nlUs9APg5fbAJyfICmg2CINfMtPhQBzMZhTwmVaBhB0HbwDtUfigYj/GMwP29\nTj75+5oM0y2ZGg6/eCobBBToUzxmmmXYibAVKUnRXmswC17GUiVyP0qcJguw\n09wJBrDVumkeE9e3MptL8s7W3aaIaX8azIewXQSKj0ZwsfZf6zcU9iVEYind\norVtZDXVNJvNMomnNkydszF/YE0tBNeWIW5cUGqxlrzrS5AeBMJ99Kj4cCB1\njbz3tDJiBuPCaEjAVvapmLSufCqfp30iP0UhtgppTs3IT+YprLuKgFExskbO\nFyvxuRAcnUNWnEPWsMSxLhveAXCi03cAiYbNXKuCcl4+ovFu2g43+etGSpfU\noUXmDAeBTZbu4AzWIP62Gubm4SilO2OEV+F0HT46hWjdL87OHpcrQX/X6dd1\n7M4p0YZVRmIfZcp9VVTaQsfECFVqQNX2U4XMkbHgnrC0PSFpdys4pQGt1QnL\navPB/ux2HZbHmWq3/S0gyaehdoxT2wzOAi/uW9F+DKwXKzSiom46jb0jLllK\ncsABkZGv3kSTCMTH9hmIVVBMS6PZbyKkzPDQOPX27gq6i/HU6PTnRhtWLube\nGnDXLsG41JHKSWEmyNQRXcfDsXjHty4273ZUBle3XJLq/Y98pDZymMRFBMPk\n/xfl\r\n=pZw1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"1833b9be96233feedf9a3dd8ab4cd799847b5a56","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.34","@balena/jellyfish-environment":"^2.4.19","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.1.1","dotenv":"^8.2.0","eslint":"^7.20.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.101-renovate-jsdoc-to-markdown-7-x-1833b9be96233feedf9a3dd8ab4cd799847b5a56_1614383679490_0.8421781919832376","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.101-renovate-non-major-e6736a3a5ce0ca9791ff90483b41bc28637cfb74":{"name":"@balena/jellyfish-metrics","version":"0.1.101-renovate-non-major-e6736a3a5ce0ca9791ff90483b41bc28637cfb74","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.101-renovate-non-major-e6736a3a5ce0ca9791ff90483b41bc28637cfb74","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a294a99741f9835b1890fb275822def27a3f0f0d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.101-renovate-non-major-e6736a3a5ce0ca9791ff90483b41bc28637cfb74.tgz","fileCount":20,"integrity":"sha512-c110yDhGC8frdnX+1QU9fL6cUpIuLnyzAtTlnhIXZLWr8chQhpC9yilI7Fdgu1BUZ+z+RuEAMHC43DDUqUz9hw==","signatures":[{"sig":"MEYCIQCbFDIwQyCHfgkfctyx8d7V0Ov5mo8SHe+t/+Z5BxAG9QIhAIS+suEk0pa/BX1/sGLlvjr0uRVpqVVUyqofEwIJk8jw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114032,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgOtdECRA9TVsSAnZWagAAQHIP/j58TlFsVK71K5GhO/cx\nPDHZ7hgn4hbFw/q6oZmz2I4XYX/zC7XKVTcuyJMYtcQZah3L0Voebvn9nIZi\np3qbs6Wo/sJeNdcrXdUXNApIUPg64Ux9A93SM6GebwIoIXgQe28bNSB1IlQb\naha8mMs55TxSQ0fo8pjbXr9NZIXQy1h3VLDVF9ITjdq3NgukDh02e2agGs5B\nY2xPYA+WnEsqlpeBML1/9X9b/SsGe7P9UrnwcoDNF+lmX108Woa9+I/EgKCh\nUjoChNtrAvon0F4rIBFMCAsDkTzxTt5t4adsUfcvYf2AS5VlgXSt+DmX6Dsv\nrBLwUmlpGZ3RMbgCujpYjqeZTe59bt1HihZl6YMZQDtza9KbA+ji/yYGidk9\nJIm3AaolnyBohdzk9pFjfx2DFGYtnMd+B+DgIaNzp9gLbT64V0cboL6QMNE+\nzMiEomGcoFe+bG1x3+HYe22fulUf68X6mNs6QlDTxvzYBPh74bJHDM4yqPxq\ncHufmm9+vZSYySbQBNcIn7ePy9kyd+kPjuk7pTWEGusHrASde74f0E/g7cqk\nUrMep8CBqZQMqkkYdsD9786ygsh6bc4o3Lm8z096tFY9ZZs53Eomuw+SV8NE\nLfCcqVRXqdHgN4spDRk/NN5LMREmCci7243JUkeTaB2rOZgiroovPwcW+CHw\ns68I\r\n=Wd0X\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"e6736a3a5ce0ca9791ff90483b41bc28637cfb74","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.36","@balena/jellyfish-environment":"^2.4.20","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.1.1","dotenv":"^8.2.0","eslint":"^7.21.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.101-renovate-non-major-e6736a3a5ce0ca9791ff90483b41bc28637cfb74_1614468932090_0.1591586508224514","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.101":{"name":"@balena/jellyfish-metrics","version":"0.1.101","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.101","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"84b6e493fa9d049ee2b555726021631a6865ab57","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.101.tgz","fileCount":20,"integrity":"sha512-vSyASc2ewrHdabDnJffgdwJVmMdlExpksUpK0S/nAUCgmYvfxMMmVp3VArqtjwzQjNf/8A4kGijUzUvuboXHgg==","signatures":[{"sig":"MEYCIQCoNiwPPNT6cqCqUR0FYSTC/I4L2HqsDfegf+7vHANuKAIhAJkg3I0vPp7mBB/aisVzuQaTrqc7IUib3KfSkD+UKyO/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":113972,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgOtgXCRA9TVsSAnZWagAApDgP/jPIcsUlz7bwg5b3NDl9\nUFY29ZPi9NstvbjhhjHfW4VmqCnQbXX6U+HjR4hGQ160splCal+2loyARBtC\n753Es/5mlfnLRi/XK24uwWp/5nhMJeeepi8J2mi9lEGlGeSYkJI/TUILoMeG\nHnuTQGXSeoOQyQuGSVPHw0SxPo8AvlZE8NVr+bdgqbI22muRxC7d/8P+LebR\nTF7ISmQCdb+ZK3ib3/z6KNxLnQxGXhyEw4CS9mQrga0q9BTr6oTcLTpLLoTA\n47QaKuFquHQ37/BNQpO+tqRfA58ZOESXN/PWQTD9dn+hQsk8D2VPp1aWopkD\nl26+PUztET0+uW2FpJABjJa+SKk1kPydiZT+by+o5PxF2dFvQcccFeZuGu9s\nEPUX2lk1XwJVA0Y3sYZRreP0Iczulqg1/f9XDOYod3rIsdToHRaZsOvoBSUP\neWzAnDNkC1y4IwbHVzJOZoivT/MHYrSBfckAemUUO73qi0x8rXjBd4Zyny50\nrZrACkTD9cxc8EJNf5Wu+k0dFb1klf5eIfzs3wLBKagjJu/4gxrdNz2IiusD\nbMNr8v9kmN3LsNNG3Hs6S3wsgKqxlZYWPtwORqCfbRJnAui7EOnHBkTw1IIg\n0F6NA5zvvJdqS0JXMFEZOAP+ZTGFIeGrGH7Drw5ZNukghqpcybDr+zZtorUK\n2qpT\r\n=QFWB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"eee7f4ad49bf0563c7447343ef0a95de502dcdbb","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.36","@balena/jellyfish-environment":"^2.4.20","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.1.1","dotenv":"^8.2.0","eslint":"^7.21.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.101_1614469142669_0.17440800555785385","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.102-renovate-jsdoc-to-markdown-7-x-863309a5fbcafcfd067f05b9ba2363f0948006b5":{"name":"@balena/jellyfish-metrics","version":"0.1.102-renovate-jsdoc-to-markdown-7-x-863309a5fbcafcfd067f05b9ba2363f0948006b5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.102-renovate-jsdoc-to-markdown-7-x-863309a5fbcafcfd067f05b9ba2363f0948006b5","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"33c3b51e565fd1fac464e28a4d642ed0c2d22e7a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.102-renovate-jsdoc-to-markdown-7-x-863309a5fbcafcfd067f05b9ba2363f0948006b5.tgz","fileCount":20,"integrity":"sha512-2vaQiabItVGyHLY4+1xHjVRs7OTvohW0cHuk74rLY7P3Qdzw8UftLDwRKHgKPfDOmHVr/DgMI2s6XC4vlLF7DQ==","signatures":[{"sig":"MEUCIQCKg7oZ8CD0+1Y2QAYwg1+QeUtOeb6/FfdbFc9qMOPcuwIgG68YUbHxHR6I542J4PrFWguFDkLjosbIFQwwglFg6iA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114445,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgOti2CRA9TVsSAnZWagAAO9YP/2BPdjq/Nkm6kjDXP0p/\nh0ZswWKEy2Ui5mqRN8v+A/1ITiKKhcKmR4hX6ROcl0eTT5wS7AwAmwojn6J/\nny7SlHu5t7JH8rMVtJ30+XftbPV1u/pdaukpKfBAsq5q0CtSovla6MKrddiK\nrIRLIc6yA6SfT/iHgBiPQhv8EQlmoxuJ2xTfwa0IN1VhDcdSbI4fDEKXf/KC\n+cJ6nO52bC/8uUrGGgUq8K6pZ9bFmipiMuVG02gpTHoxFuTD7vP+Rr5Pvlq7\n29XPtacXTx/i3llftvHqTJ0j13GgqhEcXEVhuXTgXlBegHq/51/+d3MB7rSx\nWS7XMWyHJRViuWRdDbFRJoP5OMepgmkKoiAL9AifuFgULw6fSwgEbuorj5i1\nwDPOwT63B8YpJhIDoAzKxjqntRUUd4PBnEW0+1SQAw/P+nLDqRAc6CeVS+qT\ny3ffF/GM6VQyJJUVT0PaKL9MwNHuYaTxi5mdge3mJL6rMZUn1tKCxrCt2DyH\n2anHLGCNnoGJBzICHPszDws6F2G+z6uHb9dnuFcvTMqxfg1/AuwOVOYo2B7v\nPRnkHAkVlrAwQag2pbUTM1sTlDLNontnmlWEPUNnf0E+Ddbxb+eSjWfFuzaI\nzgqgZqcZORxLlAXyjMQ63fPDk0tXrESwFMot4yTMKcfSib1NPsKo4MnwbyT3\nhK0N\r\n=9q6m\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"863309a5fbcafcfd067f05b9ba2363f0948006b5","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.36","@balena/jellyfish-environment":"^2.4.20","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.1.1","dotenv":"^8.2.0","eslint":"^7.21.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.102-renovate-jsdoc-to-markdown-7-x-863309a5fbcafcfd067f05b9ba2363f0948006b5_1614469301784_0.17948701305511583","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.102-renovate-non-major-c128582b1da14b4ee65e618320037bd37d7ede21":{"name":"@balena/jellyfish-metrics","version":"0.1.102-renovate-non-major-c128582b1da14b4ee65e618320037bd37d7ede21","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.102-renovate-non-major-c128582b1da14b4ee65e618320037bd37d7ede21","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ca53b099cec3cb09b4aeee2657e1b8c1215d11c4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.102-renovate-non-major-c128582b1da14b4ee65e618320037bd37d7ede21.tgz","fileCount":20,"integrity":"sha512-eUm5TmxGNpnt1RZo1op0KRQion8N2PuJ/c///gCRohI40Wzy4e4tUgHB56DH5dsLghRxNTjG5dgKtowEblWzRA==","signatures":[{"sig":"MEUCIBiPOsfOwWTj+Uwx67qAqet8V6Y4j9BOmeNVHPEpc3gAAiEAppVXYa9Gurq2F/aNe4X53RHeiP0MtaYf/Eop6UjVc4k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114383,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgOwvWCRA9TVsSAnZWagAAm3IQAJqlMV8SDCsoYpoAvaKO\nEv3WuH/AaR6IAFwzJ2dG/OBEouJT8zUEF7SSjiBmhmv1MWRz57CaPe9WCwbd\ng232NvsOTOcyhLkGmMQwqvlajZVwcKQT6kJMySP8nYraIBy8GR8dKF1Xo9jb\nkYRN/RasxRX5XbqSFYW1dy+vRLbJbRESMb3qn+AKsWiVRY3sogH1GpXgDaVy\nd0siNj4rM5lAIVPqEqqx+dOQK7hxfui1ipyRvUFc75RhiwyzNn9XbxSaAUzA\ntBaFRen96I8rUW6Kjt3PboSKrn3qKUzYxXgR+6NfI7+X0cDVLfW1A0tBG+e9\ndsfiSBgU+u7SqZtt6agI8lJErnuvYb/8te/NG77udhoVMGM+D6l4ZWXyWbRb\nMDLJY0EZe8yvFjgOrTkNrtZLNINj+Gn+Rf4ORbeKknCiDYGyLYt9Y6Az1dO9\nIhQ8XK4jSxTF5Wd5dk7T+y02y+ztUf5J2MN7UvOT3yRsJOMIoTm4bZq0Zl2b\nP4RuvFUidFlmvjS25EiLbycpsdt0QwpdjQYK5/8C4yOm19g1sx+AtsP/wsOx\n3F4oZ3aai5Mh/4g/Az29+hQsQ4mpWCboC3mmJcYDDYbJ+eJqOIpgNIvdUDan\n43J7gX3yiKFnWxheInkKUe8VrpQK++gJZ9BApF0v8nwjFAXgGePEN6TcZ5S2\nUS/j\r\n=v+yo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"c128582b1da14b4ee65e618320037bd37d7ede21","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.37","@balena/jellyfish-environment":"^2.4.21","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.1.1","dotenv":"^8.2.0","eslint":"^7.21.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.102-renovate-non-major-c128582b1da14b4ee65e618320037bd37d7ede21_1614482390076_0.1311267834900618","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.102":{"name":"@balena/jellyfish-metrics","version":"0.1.102","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.102","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d0db8e1c5a423909d0b08cc5bd5e1dd46e79019b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.102.tgz","fileCount":20,"integrity":"sha512-69wal/riBEPeVI6i9xk3aGlWIm8zfB0yAdCa6dI0svUwjogbPxy1DTK5m6mY8FhZeR1OdrDunld9jzaNgSbKBQ==","signatures":[{"sig":"MEUCIGJ6yg2opfupxK0GN/VnSB+ZN7KeSDMPQokxSJgIglxxAiEA3tVjXSEwe21Naee1kuxJc/qNg6VDdSftmZQ2MqpHWpg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114323,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgOwyVCRA9TVsSAnZWagAAxIcP/ibOtiqDF6F5rKTgi3z9\n9pketCxNP9X+h1A9ux2oFOXtpWowNhH6JM5te/CCORbMfX8cGW49YBDqCzno\nzyWH2iDDATcXhWXXB3qE229C6PB4jZKATdg/WqS/7cKwUhtgl6fn/voYbTmk\nvQxDvCTxpA6oWrzZ0H+JSC7px+D7r8qaQaEltV7ZfCCKTyRKzjysCr/ZqYAB\nMOjp0yB7NIAKj16FMwE4bkQuKKDK6K28BLr1l1Zw8dYQ89ss38Dvy9Q3QJIT\nDWrC6o8NNaYXYm8BtjvnwLSNIkau3RMM+N004kxC03y6rSgLJ5rUDwnQxjmb\nWzRkDzhvHnDrCBDiVd7MWB4odThKPGxpiLMMXSpDvrkeG4CJmedkCxUksM/A\nZOBmFaibIHekxIfk3AxN+baZvMK5Aix+/lbgZ11kztDeSJjN/aQtcaHzfLdB\nHca9iO8WFQ+MrgVx/wpx56mr3M/f0saPZS+WAZAEbKMFG6uAss1lCUkTYxgm\nQafLTPdqsKUa78/Np1WVTSRZ6FI7SXpE2/YzaZiMKvERkJF6tKXulueodJjg\nZU1M8l7+g2EbEIyQ4iF3f9iU3OMAFzecuOlXMjAsDpX/nR1agroig6NP5w4E\nkWNCmOZCFdmUdeLOR13FhbSIae0tdLCNG8K4Wqs0XHXejd9qXMJguY3AzaFI\nLy44\r\n=N76t\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"2942141408d1d0b942d27b38790e51c86eb3f200","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.37","@balena/jellyfish-environment":"^2.4.21","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.1.1","dotenv":"^8.2.0","eslint":"^7.21.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^6.0.1","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.102_1614482581201_0.029363204078923566","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.103-renovate-jsdoc-to-markdown-7-x-93bd5c379624ffba46fbaccf02752bf7ecde10bf":{"name":"@balena/jellyfish-metrics","version":"0.1.103-renovate-jsdoc-to-markdown-7-x-93bd5c379624ffba46fbaccf02752bf7ecde10bf","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.103-renovate-jsdoc-to-markdown-7-x-93bd5c379624ffba46fbaccf02752bf7ecde10bf","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5c2c8d5a59cf75120847782941fd928978fb2d6d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.103-renovate-jsdoc-to-markdown-7-x-93bd5c379624ffba46fbaccf02752bf7ecde10bf.tgz","fileCount":20,"integrity":"sha512-4SXiK4VmtPErY3oxnMeokokUOfw/q0SaMP7xUd/hIvRlop99tOM0H2rn5JcNHQ619yAz3ej4Myyp08ZlWa5HpA==","signatures":[{"sig":"MEUCIQCQCGkok+sm9gmvM9WIj0u5tQAB5dQOomrUGyb8pX3tPAIgfiH/IhYN7hvw+BePofsDT8u8m0wb0QN+EiFWIo5z01I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114796,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgOw0sCRA9TVsSAnZWagAA7WEP/28ZpwWBdEi5WV2xk6w0\na2tDqDAX9XjUJIXPFKyU0j7gjqgrZPVoGcaCp/Yt52CL6A2kuqEyXRZKO/ZF\nIXJO4jZVWQApqkgMYNlopnfsFCQ9funi+tKQ2He2RD91kDa5FDcn1e2FHaAu\nZ5u3T9SZatOFAH0+YBjDEZjgolADHYlx0bf6OC+2Sy1c0jCCwT8v4vaXpT0J\nJQOk9taWk3ITQP7UYae4ywQ1oIaWzIe55DDP/tV6v9WciVpYOPO6zLQFLF8s\n+Z9zY7O5a9JutL/nShBrT3FpRkWTCIeGFk4GPdgs3oT3+EXoNCP5N99w6ajg\nCpbwzKxufBkVLRKzYvwg7qrrrllHBEzksI8gq55Zh4G/+5tHQnEvXjDveZX1\n011xv5N8Yb+JFdCcdfXSlJTpuNDVOoQOYwrLmCwrQUq9GDV7rumMTnkuzPve\nXTon2Fampw4V6rVzaGCZCm1T9ksLNq1Dym5p3NZIVxLGqTL1h0pnqqjMBdeU\nGIVu2W5ZZLXTUqmMZfALTTBNP6TOYnY9s6LrHwbbDknorbO2pMIlDKkXYmv5\nWx6JRm53Q0w4exjZlRvNkNjTscFJleSjW3nrEc64CkjWtvyFiseoAUAc/fNv\noSOeMVcnpPSAkH18sfBI+ZKxtyTvuXPGgv3J58QDUZK8f+sRTKIQIN84kcEn\nNUSS\r\n=NO2X\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"93bd5c379624ffba46fbaccf02752bf7ecde10bf","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.37","@balena/jellyfish-environment":"^2.4.21","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.1.1","dotenv":"^8.2.0","eslint":"^7.21.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.103-renovate-jsdoc-to-markdown-7-x-93bd5c379624ffba46fbaccf02752bf7ecde10bf_1614482731585_0.7947880653158885","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.103":{"name":"@balena/jellyfish-metrics","version":"0.1.103","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.103","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a7a695249190003afac59ed9fd7aa6bfd682d21d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.103.tgz","fileCount":20,"integrity":"sha512-FPYmC07opn2ulnhpLhOKl/TIlFSAAdLtgfEe4H8SEMVockpqCgACzQOJrkIqBj+NvKAbv8jouONBz3S4QOmpcQ==","signatures":[{"sig":"MEUCIE81XdCA50gRJBV3SzsbtOgD9l8pxO25NTpiBbY5NmqdAiEAseHSr2dhraYaootHH1yRalc+Zcve8tW5MppxJvKvUjo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114724,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgOxW3CRA9TVsSAnZWagAAYjsP/22Do8TYndTm1ZhWDkAC\nZCYFHtAWhaDhJwg8oWF5j1rzoC7dJXsI1hDDiLC9b3d0UwPuBt6mstJZ9487\nPVSOCRJzBlnqLDNALZRp0ab+71uBVbgNGUi+WKipd56abHNbNEe70NmpYA0U\ntGEnsaHMCW5FH3kNst72k9pVaYogsyDaDnJ4qM9PBrrEeg1QEdwmeUXo/oVE\nmJ4xD2gzWlUnx4nctjCbe5RJYyoUNUZAawPk39BgHeXuS1Fg5U0M2vyzjtRX\nxBhK8aa6GpOHZ+4hdh8O5bXOjX7/gWjO1imKrNFj/Qoa40IaMVjPR6w2qOxr\nnt0P7rIa8spCdSgc55tMgpFmOrfAQ3intSIdrPoY7lspCGPUxLLmNDq2Zz7j\nZJglO6HO3Pmvrk3Qvi/y8R5CGd6xbWD3IfKxLoNVMneaWXavuo/KC1p/zXAq\n1RbrFfuTMiaCh+MulKcRmCODxs1iNyO7FX9LTeFq4/LuMCGVYAY9rrABQ5Mb\n1EIlTxHnukB1CS/8eY3wVndjdJvOE0E5p5cAr1HVfFpF1EevZbZLKSl+5xy4\ntWzDY5hEGrxqYTkkOwDcSHCdKl9AJjiB8jmgS04QR/gINHU36/5qJUM5t6MP\nVLlJKC1qi/IqTgnrJAK7avoE75hEpTRp/btBtGj9+RND4XVAj8mTCh5Axbvj\nqL0d\r\n=D9oK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"1aa448ef5d002d2927a97906cd80858099397695","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.37","@balena/jellyfish-environment":"^2.4.21","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.1.1","dotenv":"^8.2.0","eslint":"^7.21.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.103_1614484918457_0.581640733238062","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.104-renovate-non-major-096698efe1954cd266089e59867a3664a4bba930":{"name":"@balena/jellyfish-metrics","version":"0.1.104-renovate-non-major-096698efe1954cd266089e59867a3664a4bba930","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.104-renovate-non-major-096698efe1954cd266089e59867a3664a4bba930","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"019d44f97bdaac8d21b830a6a7bee3cf6e29a6a8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.104-renovate-non-major-096698efe1954cd266089e59867a3664a4bba930.tgz","fileCount":20,"integrity":"sha512-phYFZLo7s62Gk38wKNhXMHx1t/hRwkKRM5rzgDkgMNYSevLa8z+wbhQQmZW0FZIn55LT1aoGXtwmhEPQjQPzkg==","signatures":[{"sig":"MEQCIFRx8F1Fp7jywH2bsXO4USghseX/CmBZdOmZeXAipoo/AiB8YSH4o8jEDrD9ojTZUIt/9zCzxijMlWPEJDcvjR4pzw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":115209,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgOyWhCRA9TVsSAnZWagAAFoYP/RhGH2khRrDNDQxw3ZlW\nMKpyK9Tmra1wK3idZhcKk0efHps3wijaCl4z6hxPZ+EHvhC+UPUzRwT43wBm\nJnrYqsGizGt42dL1tY3dFCAFbLVeIh+kd/z07Ep5s25qM8iNJBhT4sZMs3ba\nWeIT4ZQto9cu8yl/Oz8waqhYdwnroBA14WbALy7ifm6GDoGVaZL96i0QAc3X\nDdxLPCPgrLo5NjLfH+KfNd9Aos07bEYRNi8S8DvE8TcKjBegI+IgJGPGWyiL\n6zx9NLJ/lpwFyJNg0ZedsHJ5thhO6juObevJhnJh1QlSOic0kL+Nng5O5UUG\nKr918Lfiqvo/F2VwQX+x/lxLrLg1F2vEgNZgRNdZEs2GPBvZKiKIXD8gmH4L\nNov73PM2vgxDM9hYtuJRDcW9OBKUmDrcyya9g/CZGXsMnEDuSG17iuPHEpBs\nVkFLbHdWTxaM3e49L6WQCu67jITXRv3y3AawYsUPIZZPeFhHT9nJUkNQV8DJ\nX1l+byyWKlXU75o9aX5jKcn0MB35xs05jL3dz7mE72fi/gjp+BBtmznXmAhy\nWutewLuNgxppl/SYxQKuyJ4+zY4mzXx0vRg30SSuZ0OkBaYlV1Wday3FNovY\nZBUGXBhQZnrY3SRpseGDkktrz22uzg//a979QO1s08X0gZqjFjdpbpmPmEzk\nQXuL\r\n=Gy7F\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"096698efe1954cd266089e59867a3664a4bba930","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.38","@balena/jellyfish-environment":"^2.4.21","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.1.1","dotenv":"^8.2.0","eslint":"^7.21.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.104-renovate-non-major-096698efe1954cd266089e59867a3664a4bba930_1614488993250_0.872690421387827","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.104":{"name":"@balena/jellyfish-metrics","version":"0.1.104","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.104","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"63be00ab6fe9ef3d62d6196e5eea15100c9666b0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.104.tgz","fileCount":20,"integrity":"sha512-GRZwK4dvo0XY1AuAVw8+pkGIeZWTFi+qsxZgSLZ/kYdAv7U5qM++41Bls64E0+5wPp/zUoDGMTzNh97U9pIFjw==","signatures":[{"sig":"MEYCIQDOXHCH1b5+Y519ZSqtzzNGoBMO/uxwiq1zoYvNyWlwWAIhAKEWu1YqfJmlvo6QLLVCEic9BieISShMvudyr6al3x+2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":115149,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgOyZqCRA9TVsSAnZWagAATjMP/Raz06LGbehV4KJTTMcN\n+oqixkaczJXRRSl/D1IazVywtA/H5eg6MOcckxBknpD6j7d0u8i2br/w0gNY\nAmN+J9BXXEmyUra4wcwOe4ktHHdwtGImqq26iBhzDtera623d1PhfitAUa/7\nwoRpZm8LIx5hpieDNJ9KjP82mmTraMPXVKzKDdL3/gGdEDt15XLEqIfL2x42\no1o2KDLXy5EeTQXVtBM/ly9EUyWCLdiMQlVheDhD11TMNv05tRkiASrAn5Be\nXtPAkw4rcUPRsQEDjjGnKi2tm5F2jjvqJXx7uMOSpomEF87eguThPxWV2cOk\nn1bVv21PNgIyo91q3OAYny2IioVAunmnXCXPhZ2u7+HnylvyWWO9s/irg1mw\nN4xu+4XIpOjtJuyMFZ0Tk/eJ5aJBoOxi4buXWVEBTVfb5rYtp1lhTd2bhNFj\nU/WCH2IvhU1B3DSj+0e3PfjwUqLwh1pRJYXql4fgh4MRtAhWE/sZ5OBDDBA9\ngVdzhPYmIi4Bog7ZrFNhpCFqE0oYPv5ihJZDhMaX+psNI3uaRxGUTK/w7DUY\n5TTM5QQlLu63XL3XZGNFQB9Zt6+2CZ6WufQas4dWjie+ySxnrxFZN/2W+SBe\nv/bLiVaj0dEui6DJo2e2gwPd8mOhNDWd5e7Q6vEA+dJZHpAPNn/kRsy6moFC\n4b54\r\n=FUxP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"256713217fb533fd9933c596157faa5de147068b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.38","@balena/jellyfish-environment":"^2.4.21","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.1.1","dotenv":"^8.2.0","eslint":"^7.21.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.104_1614489194203_0.6441269565670107","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.105-renovate-non-major-9fb18f3a185f6a418f31ffbc231043477b1f0493":{"name":"@balena/jellyfish-metrics","version":"0.1.105-renovate-non-major-9fb18f3a185f6a418f31ffbc231043477b1f0493","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.105-renovate-non-major-9fb18f3a185f6a418f31ffbc231043477b1f0493","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fc3d9a5f4329add34a61fb0e2fde07c4670d7c75","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.105-renovate-non-major-9fb18f3a185f6a418f31ffbc231043477b1f0493.tgz","fileCount":20,"integrity":"sha512-KFAaD1MMmC3vLwpEm0OkrPgJH++u+SBbM93H9PZlsMOyWL0uJeH2kU6uFpUZfbblgnQXqoUH/u6yNypNT8Z8sQ==","signatures":[{"sig":"MEUCIEGmLEqWmwEn3c7BdBh9I8EpYCD8P7r3VN3d7wh0d5RjAiEAzH9r4h0yGkdQIrzJTrJHKnnoLaAM6bZYCSi/j11cW1Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":115594,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPFQOCRA9TVsSAnZWagAAomoP/0d/7c5KRbCkzV5c368B\nhZv1HD1Ofld/g3Qyn8ZOhagvEMx7s+MJxd+/4sn4Ds0zMvLhIjLYyBIx9uDa\nX8yJ/A3fRo3xM2ACGf+nBmVgqU795pcnreurA0CjYJRk3QfvtNJbLJPKWBQT\nQJm7IY6TBYs8UzZv8lagcBYVmr/6ZlTirrn2fgm50HK3xXarTAMgZTlR2UV8\n0BSHZ/kJ378+hYyoscrBaTsNVbutRcUbphVMVwu1wh7RE/8JeKcJeJaX1RmH\nJ/G/AiCqa90JZtP+FDmnz9FAvhBND2yhNhaavRUp5y1qnutQ6gWjVR9lverb\nwN9DHrinMUe80MUNlguYSnbB2FCmHCx3F+0s5BZJA6o5F9j7bq1Ff6o9sEI+\nwqpR538EOJw2/sARs+b4y31UEWJ9mqeOnn10Wtpr+Gaaq5l1a6ZJKkUm1M9x\nx6ea0mg1gcmR8kS0TXW8stE6ofA8SuN+As5lj0PoyMbh7SWb26cQKnGYA6ew\nXRaqxa+O1/X9NlECmyxdyXQggjkcWP+YE3aOT5LBK698RL6TLiDecUfNe5RA\nW+8cjBYaTbxbttFtD8geAbVJ0oLx6ssddZiki5wyAELGjfZVh6ZxVAUP0kjw\nqss7t7uKtQL9dyJhKOnmm+lLiY/yRnWsmDuUuyBgh/lRI6l/qfNGI4R3kuDA\n+cyH\r\n=My71\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"9fb18f3a185f6a418f31ffbc231043477b1f0493","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.38","@balena/jellyfish-environment":"^2.4.21","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.1.2","dotenv":"^8.2.0","eslint":"^7.21.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.105-renovate-non-major-9fb18f3a185f6a418f31ffbc231043477b1f0493_1614566414243_0.0883240001013681","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.105":{"name":"@balena/jellyfish-metrics","version":"0.1.105","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.105","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"695798c14fe2445ea3ed1421153782e26163b159","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.105.tgz","fileCount":20,"integrity":"sha512-i+r3idql0izJ3HcupJJtUg+6nfX7W4ChUdZ01hIa0/BCmxJq6QeAI5dVSdz3OoNkbIgvf20fq7aMQ5oNG9bTrA==","signatures":[{"sig":"MEYCIQCStvhTwtYYsEX3Sw/a7gZDVSSQuWN9agnBh5yIr4LC2wIhAPOLqXejb+Zgqcm5wInmWxAlljzMCgO4H+Shx3lrP8uy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":115534,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPFTlCRA9TVsSAnZWagAAgS8P/1mOaxDncwmtZHg3BAMt\nn4/awv1kZgDM+Lv8oOwfD69z86elx9BEzghkfGb0WCOamsArW+lxbSlZx4PY\nGLOpfykXOT1X8Y/gOT/gUh20wwUDv0ST78lZE+L4PCZJkWsmG8dkjzQB+Ym4\nPEahaYW3sxDguZll7wLOV3PfeJSObgkQESYYP3rbBuJ6C8deLr8iedL9OlZG\nurSB7pbW1UjA0QE8XBsUoj0Do8EkmdS588VeLRRYQdQmBMGzeFID7u8v85rs\nFPqLVJZxDdvQQCfaiaUA1QVD/AAZpxkKfk32b0RQ/sHZYq/dAjv/9GAxACU+\nTYVMw02lpZPPD/sQzLblw8HN7IYd2kmwa2iGRSJGR7GAOguTDOBv62OXoGtu\nCULAghmOrvEfY/hI0Nd3f8GrwAMhhIO/DprTbk+UEcvlwA5od2tZtmtx+uIa\nosNSFafjSXH/mSlkCpjl2eKtIWFIgWekvpE0j/2EinZtF7822j6OHL+JcuxU\nFPQkgLy9wYSS3jY63BwnI/3ALB3YBGoI89eQpHg3z6vf93LGIgnO82vQ10bI\nFVGFJNxPlPDjniPA+St6vdZJG2tswh2sP3ONDiE/VOY+u9mH9ZRgEy43gGG9\nu3uD7UanhSTE3619/P6U5bdZ5Ui+/GXOR+t5IsCKwX76aChkVXOsZeqpMxBi\nLLJs\r\n=LN3o\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"f4b018d9079d0112c6e281840264280e8d8705a0","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.38","@balena/jellyfish-environment":"^2.4.21","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.1.2","dotenv":"^8.2.0","eslint":"^7.21.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.105_1614566628534_0.745947855216786","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.106-renovate-non-major-09e8d0d2aba009107d62987a635c0b399ab1810a":{"name":"@balena/jellyfish-metrics","version":"0.1.106-renovate-non-major-09e8d0d2aba009107d62987a635c0b399ab1810a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.106-renovate-non-major-09e8d0d2aba009107d62987a635c0b399ab1810a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"116a27bf7fd8631a32f469e07c29e13d2cca741e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.106-renovate-non-major-09e8d0d2aba009107d62987a635c0b399ab1810a.tgz","fileCount":20,"integrity":"sha512-KiLNpjx2d5NKfAJbZ2SYlKGTSnDcHDICVPX6A0/lzqnphPiZuH0AC+Z7eKvR/dBD9wAdwPp60MDORyE1Tlilcw==","signatures":[{"sig":"MEUCIGZ1Fs3mx6L+DSBU3ZsyDy0rxl3bdq51tAEUo768j/6kAiEAi7xTwMdn8ilAqFAjphJgbkjMPVaEdD3B4Xy1i/s9oCw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":115945,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPG9xCRA9TVsSAnZWagAAgdoQAIAT2UnPZOZ2qfKDUXdf\n483ztgb0pkixwlefux5LdxM15z9WSrPTyb/+X9OZcJoD3lG/t7oT3perTtGd\nZbgvPJlAMioDoxuWbfdSv7xftGQ+FNi8S6A/LLXzgnHDWCeGg0/YvlFxjq+M\nqAxs6QiIdgVa4AzG3x8j5w6xY9x/TKn0AJ/orm9vHNwvWAu3nrimKko4HtlD\nHKQ/HIJsuTcdONcagpaQIK7FVNbhxUraZwbxalqDJAZKRRTnDFlEqcPinbUJ\nlb+5k+VEPYGna0kUthgYHdi0h4bQ918/Dku1Drg4biKpNsRYxz4dzCxuLc2l\nYi7cN2jjMsjJwQbXIAZgfEllS4gK6sWo04Tmn0HJhBDKl8RGIiqXydVjhTGB\nF2p9CvMPKheBDSv/QsGBKdx6I2MJ0MxmLMlSaugQDTdVRqnG82jW9gd64j3P\nbPVmWW6dIsRZGIZp9CID+UeJ6d5rVhX9pDI2UF5iDDCE+fdWILjU20NygJQO\nV6/5R0evPoUcXTGtV6RGFVd0x83G5poGYdCRAo4z2RjfSBaf66uHf3mj/Cm5\nnyXPOWO/RVITVJJ+S6uOOgDtVbF9okCV4tH934SMzCS0fw7i9Frugiwnobv/\niT0wU1y9kvOdJ28avccBPG3ptIbgJDsahMQ1aik6GefY1ZY1riy6j8meJNi8\ndqvn\r\n=ofvf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"09e8d0d2aba009107d62987a635c0b399ab1810a","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.39","@balena/jellyfish-environment":"^2.4.22","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.1.2","dotenv":"^8.2.0","eslint":"^7.21.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.106-renovate-non-major-09e8d0d2aba009107d62987a635c0b399ab1810a_1614573424526_0.5567452065773204","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.106":{"name":"@balena/jellyfish-metrics","version":"0.1.106","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.106","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"40a865ea9afc108d75b4c1135f71303263d06154","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.106.tgz","fileCount":20,"integrity":"sha512-Lem/aTDMYTHtDdNAWBDEd1E7cmTV7SQZ/UsW4h8y3FSefjCmzBVOh6Awc2m8XYyL6XsHoSYHbHUroeM+qsh/Zg==","signatures":[{"sig":"MEUCIQCT/tvz/CIVDhcrb7ALaXREFwDX+sESXS3eU87usG+aPQIgYq8bIJAQ1Lu05IMudqNb3yt6ApEDPRLlqgMT0qbE+CA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":115885,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPHArCRA9TVsSAnZWagAAdFsP/jvBnqjjuW1yW8Y2BEFG\nZ87JiNFXXbX25GF9+UbOzvWjqjh0kQo42Z0vleXMWNiWyA7GE9AnOTVIo0I6\nPDq4WMuumPiV+AroUAgnGAIYIi/fsT+Smb6ENErkX7gUYQbioF2u4CqKmlWc\nGXNYcuyMqU4KfYhUGLSBP5Ub3atizo9tZgREuUlmZw/2MiUFmPbByyDhmwvE\n+E/BIkG9qwn0DaTvU8OHPwMhy7LvbvUzR9LIXINjJUbGH1EG2vY8v6eYtj5G\nNMlQcNTPh0hOyoBeM/oZU5X7fvL56piTrG5iVCpJiqq258Ybm2RcFxDAd5uR\n4AWUCQTUdo2JegH0Fx5JZbaoUjOjFxCwdqQ7+YaWnOdStEvL0kFMOeEYUNY7\nLpf+P69oP1DaQiemoPr1DujzM6meFJTi9z+QbzHJHT1fG//RM5yMt/Bobpox\nQitWeTgUktnfF29mXDEFihOWJjB/EpL2enwjZPN7tCIYiTCiYPXlJgL7q97d\nXcXoH0M0yQra18i1NyqKw2kGf2RYpH4II2qfy7WvXBpKFxKUT0V9/pAqjs4M\nE/jWFGST6JBynagjLsxV3d4OaZUnbaOHgCBFPbVCAHArn4z/spnQSUpXCtZQ\nrvWr1AVIzwE+di2SvHgHc/YuMTRM+zacdIwSwy9TnrvAT2O8WqXhSPj+T4pq\nnn4e\r\n=F1+4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"7aff146b39d3a2eb3cace83b28b8c1b5adbd99bd","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.39","@balena/jellyfish-environment":"^2.4.22","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.1.2","dotenv":"^8.2.0","eslint":"^7.21.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.106_1614573611263_0.47701558000778754","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.107-renovate-non-major-d054125a3e105869aeb6d3a0cabbdab893089c5a":{"name":"@balena/jellyfish-metrics","version":"0.1.107-renovate-non-major-d054125a3e105869aeb6d3a0cabbdab893089c5a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.107-renovate-non-major-d054125a3e105869aeb6d3a0cabbdab893089c5a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"55782dec4468b3b881b4f9d18413a33f90fae61b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.107-renovate-non-major-d054125a3e105869aeb6d3a0cabbdab893089c5a.tgz","fileCount":20,"integrity":"sha512-+hJzoWVGh/wB7FUf9Uvt+RYKzk+6Eg+9bwsx3/MjjatEicawe/ZNu5c7qh2I8B81P4aqLcy42A8NT4tZmTNCag==","signatures":[{"sig":"MEUCIQCMAVceVhsLQdeAB76796AkcC68ehSRrqTZiEZ5Nx4WFwIgZndCMof5jNpPaJ4X0/AWW8/g+8hDjWB8A7oxe4vDkc0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":116370,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPTqVCRA9TVsSAnZWagAA1aUP/1Irv9Xg2Q2nM57FiWpy\nz9/fv9WVpfUfkZKV7Rg1S4P0LWNjGD3H5WwBcU4FYCX67ENh3761M23uJguL\ntMy6El4LuRfyLDV7IGdLGRKrh+D9b+lATwC0WAD0f9V+/wzHk/D/c+kDsiU+\nT5c2AglULFUjIU3tYjmTIraj4LJRT6aDShXJK3kW86FQ9tyPHgYSxg+jGjoc\nQkLopsK+025HJv1Vmh/JXbj7zl4PuBw3LQo5HXjSwCIutT5DdYg4DPHxviQn\nyyIh+83Egxhs60+g/U1bTFHBrdpfNo7N5DCplsRJ4PTDXDHkmPDbwZjGFcA0\nCm6OAnP/cmNkj4hO6NEcfiQqyX4ecDhKM2COWADLy7jB4+Guw/ZsLkMzc4wC\nF9WNvvFGfN9eLY3On0bUnsEZQZm6DqjPzoSqIovJV33a+oBPRuZ59NL14sw1\nFDFOp756fk/4fdaM5mp3GuANNg/n7Uf7+oIIm20XYdFUMk7c/B6gkKEbVvHS\nqpJUgwPkJuIAEmk5GtbVjuSLqy/CLWouIEtGv9/7wHLk2vKtxSCIF2SMrpX5\npOQ1o35CNM5eDFXu/GEMCL7vXz28hKVIQ8ppO6tBITnG9C+J9QTnCGcWdLk/\nIxCRpdQc6EmGVoMpvCzuMOOjL8um/5e5WOSCxbBVWSXyTMuFVXCcc83hJhea\nR2p+\r\n=+oBK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"d054125a3e105869aeb6d3a0cabbdab893089c5a","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.40","@balena/jellyfish-environment":"^2.4.22","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.1.2","dotenv":"^8.2.0","eslint":"^7.21.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.107-renovate-non-major-d054125a3e105869aeb6d3a0cabbdab893089c5a_1614625428892_0.9837481676180058","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.107":{"name":"@balena/jellyfish-metrics","version":"0.1.107","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.107","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b44d05b47b0a2532f5b68e38987d044be24b7d21","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.107.tgz","fileCount":20,"integrity":"sha512-4mYCtH2bmeLEEqfd+RVqPu7967oXfDApw6MKxFn+KANTIzghpZN5Cshe8r2GyUSpr9fUy+UaIlSH+B3pQRmsCA==","signatures":[{"sig":"MEUCIQCvjTPn2aNc6HmZqrKtKaSPoDVQ5MnD5/TPFWJQCP3NCQIgZZ/gtm4AgkLsqy0+SBBr8BDlbbACTT1AKyB8DIASHzw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":116310,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPTtfCRA9TVsSAnZWagAAX94P/jvt2nf+5Vof1ruVcdMb\nZ62oG0/JlhMLHaj12ik8kRs8N66qSC1Tv0x0iJZ6bcUvXtvPkZrUgs3ZAuJ6\naRpS1VuH8ZrI8L5WFpzsHtxdfB8KQiFOPPR2T5hfAAg1VhqYcENGiz/ldBFD\nE8HQ3nu0kj91A+VBm2VsYF1W9539eegGMGqcP2yXFw/yxiwQxwXx26J5yFhl\n3EmOmF/2jHVLGysTvWfr0LKHT5s1L4vSj/fXCf38l+kNkfvC7k68wqzXk0Ja\nHMD1CVdN6rs7xOoyWmDCoAA7hqvNHmcYYL49wob/06cmmRjUlFI+qU81xGR5\nQhWakc5AiYwXFDSKlqTZeIhrh8AFSGU45Lc+9ma7OeiFnqPYEOBcSp8ua2lT\napaNiAa+r9cFXkxlH0VBFjdUbCGklf4mPuhOZB5FXPD5D0586x3bYTZ/xUex\n34G3nl9htOkkQ6n3AYxv5EdZTqyDetr0jukKuwtUhx/FV21OyMkC+WqHEH7y\nHJ308tqWdp9vcZQFuF8mYxVlUqmuKgh/P3EnTwZI31UG0TX/IN8YB36BdpF2\nXd4HtFFh/TinlhisYKPfRODDqLiA8bNrQK3EUqQ7ElzK9exYqDSuGmK7iUv2\nrgl1M20ateQZ+nRzumFSjIIe2mYhyMJv0wYra7BEBlTe9+CiOF6o1rGg809d\nc1R7\r\n=ZUfA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"a126033feb6aee23549cf66dc271fbcecd9c1258","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.40","@balena/jellyfish-environment":"^2.4.22","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.1.2","dotenv":"^8.2.0","eslint":"^7.21.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.107_1614625630925_0.3855726505484569","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.108-renovate-non-major-2c165ec3e427069a7b5a6038a0ef2a880bafabb6":{"name":"@balena/jellyfish-metrics","version":"0.1.108-renovate-non-major-2c165ec3e427069a7b5a6038a0ef2a880bafabb6","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.108-renovate-non-major-2c165ec3e427069a7b5a6038a0ef2a880bafabb6","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2830e479a8c644d6f5578ddb5ef0f3608302c262","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.108-renovate-non-major-2c165ec3e427069a7b5a6038a0ef2a880bafabb6.tgz","fileCount":20,"integrity":"sha512-W2DB4V0ji1uwk6GMLbB0pwX2YyxlHjuP1052khe0UWdqb0cVgcfJQ29hxPLD9vi0zs8Qa3Jw05ki4tIouRdJBQ==","signatures":[{"sig":"MEUCIQDMYLPJFQtBYHXmIPd5XL4Xzoj4AqFPHL2ZxIdxwxkVMQIgbw9FYxV7ZkaETZrR+nfeuEoSk4y5cdViVKyrifUVJnM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":116721,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPcjqCRA9TVsSAnZWagAAb4UP+wca7RXxh/Nv3LtqfJUl\niL6XKk66v22s8HS/ZEKYHbfS5qzuD2JtJcqgBVkKrUjoXQjzVyYDyG7FgvU7\nK4rTI6cXbikZ3yJQCfgGvtLrgzMeR8Q+WGH/ko7zU51rBiB7vpiD8Y4YIBEt\nJkpStJslgXNwsmn30jqB1mBtiZXBd5UcBvJdddDiKOScuN3d3T97J5+6prfN\nT/wVKUUM4kLd/YP3eecJv3PgrwbabmpS4PwXGXrFQKHaiQ3dj16fKPu7DgJt\nCetuoNcOB8R+1v5MxBqgMfWgktqTK0iRNIqy1Axr+PVruJ77Wh83sppeyfoI\nM/MbKIrgxeoABpqWWF1ya/4hs2G+fe7GxC4WK/yDqFfu0exmBu67yETckDu1\nR8az36MFZrTXZ3rxoGPC0qLKYx1zOtjBDhjhEtVOvIYQ6NgaPJcnNNR8LYSP\nvc8tKpok/CUO3Qu4BUdZmFLFNH2lVAe6ifEJPRzoyr+ux6P+BntreTGZJZ+m\nCnyuMDFX9KAhHvc3X1RmfUod8jcnVinKt284psLzyHD40SXHB6fYLP5xAenF\npNLLmhzVJDkl2Cf9Qqi0LKd+PTrCbNCrbVxWFEauI2Sgm6tu09xfazdF0Z4w\n8pYKqjA6ztlVPr/77y6chf7cDzxtQIIdTaQid1sFtEH3crm9wbrw7g5Xm5lO\nUnkD\r\n=L3V/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"2c165ec3e427069a7b5a6038a0ef2a880bafabb6","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.42","@balena/jellyfish-environment":"^2.4.23","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.1.3","dotenv":"^8.2.0","eslint":"^7.21.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.108-renovate-non-major-2c165ec3e427069a7b5a6038a0ef2a880bafabb6_1614661865277_0.020912982123893142","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.108":{"name":"@balena/jellyfish-metrics","version":"0.1.108","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.108","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c05b5d5ebc7e3eb98c8edb283564e8c91c73d23c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.108.tgz","fileCount":20,"integrity":"sha512-ob3XEt0fji73wOHKveOlFDj7cxellKr7fjGH+9e7asjdOUaZpE4/6Tz5fpEiIAQ39rGzYtvGCSGLCqf3h0eiOg==","signatures":[{"sig":"MEYCIQDTv5liDcgl/YhqUUV4f8oq3fHQraHSkMb+dZE35I1fYgIhAK/2hZWpMMpG8uGRejP/s3tXXHv/yg3AIrwd5UJSt+T4","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":116661,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPcmjCRA9TVsSAnZWagAAeVkP/i23m7gZHF3dXeLN9pfq\n6XgzLuOPkK6A75K9gl4DckL4/1QN4BEmNRJwKHG4sy8028+EuBG/TkYOqnDp\nfQ9v7EcI7FDcxZsIdxPhbUTZ2Bwn0ueAOgDe4Tp53Uxg97sbG0ALxGAscl6Y\n5UJB1xXNAk6McIfC7wW0qJfQzez8cTXfzmdymZl/7RXl2xNHBK6mc5RUp4y0\n2Xikcf3HHnkxT1lVE99z94QNTXpSdR+965FpdlL1AEpYqd9d1yIxRUCGDShY\n/EPzr+XeGaRcYNx7MxxFKGC87Mzna/GmKTXLXFW6Kdgu94Bis0uRIUyNYKCQ\nPz3MfOqEZ6QWCtJN/ilW6i8PHo9iC0mku9F59ju9ggxbXNT2NhOSYC780VwJ\nLM6lB+0Cw566TbovPFbIcneuSBiJJIB5SgKtaNNBPBOwI9hDI1abI09jkMnh\ntMrD/f8hi4HpyA04/9GTK0j4qF8EcOMimZdC/t9VHgDU1wvO2+uoM8XhJSzN\nyCzqvkDO2a+bWaLk2r55BkmEwoYeYOyrD2CBitDGJ0lTula7gK0aCgATiI48\nZ1Ctmhn82aIi6v+qcMkcLJI4i79sMcn2E7l326E8m021Ic+bI55rNOTO32C3\nBjy6rUmj/BZDeuXkClH9Wq9AyM2F2XsSrCTSGNTX5DPTY54m+IuFdjpFaizk\n6YWp\r\n=UA9g\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"d890f2d06be374bc959e5aba529e92f0fba5f0b5","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.42","@balena/jellyfish-environment":"^2.4.23","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.1.3","dotenv":"^8.2.0","eslint":"^7.21.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.1.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.108_1614662050746_0.09987031669113788","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.109-renovate-non-major-483ae69ee1e76cb3ceea0bdf4b7b57ba715ee42c":{"name":"@balena/jellyfish-metrics","version":"0.1.109-renovate-non-major-483ae69ee1e76cb3ceea0bdf4b7b57ba715ee42c","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.109-renovate-non-major-483ae69ee1e76cb3ceea0bdf4b7b57ba715ee42c","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"06d9b296bf0dfaff79ea1e050a6788140a76cf67","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.109-renovate-non-major-483ae69ee1e76cb3ceea0bdf4b7b57ba715ee42c.tgz","fileCount":20,"integrity":"sha512-GABNHiAgGLAT7hEdC3bylOvRh3mXjGtWksCshgvYDmhYKeIcesejh+ICWZM7CEFDsVI5gx2iJTXbS1i34Xeagg==","signatures":[{"sig":"MEYCIQDmpMh7XPrzcYF8hE4w7Nem7xa1OW6VrnFo7MN/z/E6GwIhAJ9PwQprGZ9yKudhHknhPqbc0ARrhSNh1tKuxoVe172U","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":117136,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSH3vCRA9TVsSAnZWagAAI1kP/jvMuDpxF4P5dENEbqgu\nhZYIFzygqLlKTl568vfctWtt/O05sV4dBCW+MkNkQto1/a0ksWe6v/E8dodV\nK2YWEocu7PpXkmC1EMqCEjCOhQerRo4lybWeXke0PPMeJkYsmtfohFDYGVVe\nIz3rA3OdCUltgwW15KqWCsTuGN+2ecNFfJz+y5638d7LQuOQCcNlIxdkA9jk\nVNFHzslQv9iNP7R4qB5N0aAkDRKbKP+TptGQmIc1g4C1V8Dsat9xjRHL5U9Y\nEhX8tkDKbFsF7XVadrPCSUKZw1ftsUOOwhCLQA7wtUKim4DjyHCXsReh8fuq\n+hCleYSpyYlW4PoylvkUln9SCCYTUe6wkn5An6PIof9eJ2P3XZ6geJ/9m8/x\nMq6mqLLhFHwAttd4Nv8zJhhpQMPEKVQEgKWul1QF2+ejA2HT4BC8ffd9v6Po\nPkakRFkXKXWGl2DPkcKEQdX5q52ulS9MNarwb/dymNbguz+JxpHG7GNvwwgY\nKDa8Tf1Sp63UxgXFvZHgc77FNS5S1T1ddKNBeQD3fRU2EOwwa1LoWG570Gki\nD7u8XSB5g2TIxmAtJcLq7uXOAxP4v9HO1R0N0aB4aZzJjqHO1UJnXxEkgLtk\nUNSW4xuTC3LxiLwLJB/UN19/LuKmn846oyZrVOOpmx3eBJaowJ4sYCvyeOp4\nOq1Y\r\n=BkzQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"483ae69ee1e76cb3ceea0bdf4b7b57ba715ee42c","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.42","@balena/jellyfish-environment":"^2.4.23","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.1.3","dotenv":"^8.2.0","eslint":"^7.21.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.109-renovate-non-major-483ae69ee1e76cb3ceea0bdf4b7b57ba715ee42c_1615363567309_0.9709003487504377","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.109":{"name":"@balena/jellyfish-metrics","version":"0.1.109","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.109","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"59b76276ff42a2cf91ee6086e8ee2a565f5879cc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.109.tgz","fileCount":20,"integrity":"sha512-+nu17pnk/ad81N4qu6EE/TEISNu88Czke0uSirkzZ1KQgKdIyD8X8Z3qCiic6ce172A6UfiAhb7KnFnVizZLvQ==","signatures":[{"sig":"MEUCIQDxvLSORG34e2cl6g9I3QdxuG9mqg3iecmUeZ7pafOQKgIgEeo0Qr6LVXh1GjrrpOyh1UPo9VjSOtt7t3bBU1BMMhU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":117076,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSH7ECRA9TVsSAnZWagAAXaIP/iGD9WsdJVlPK7EfgQzA\nZSLXJJVQEVMk/E+HrSWPnYEptygubAoHhQ4UX1LQuMWXwTi3CJp1ugg2Tkd9\ntwGCP59L+LD7S8fO7yQdCCJHO8dTeM/H528dij6ILOE4BLoswA7g+q9HwCC9\nwDKAJ4wZ2noZUWyzldqNPzcKgXZJ4XtdQK9+vBTBcEIR7w4JakeiB3vU5X0X\nrei8WoIl3QMJq32GFqrJAqvPVxyJtOiEhsfdTfX9Bdmnjof0VU7EYMnSqQxy\nn4bg7R1OjRacth2KfmqGadnq8oXHpKw8aNWZc6DfWK6xisrZW6ZXQFt/swfZ\nxI56KkiVdT7hIqjppLueuUVrQ3kBpSckHJTGdNbFMxjR9eeAxiIuHk6JM0Ou\nrM+8v0kTMJAJQCjcr2696f3aXMNpUG/THibjEJkqYMi6oujCPpjI3NqsU4UK\nuuPRdj0WOWf7UV+/jZxowk/YH2mOeXZvyqS5uWq4pBRJLF+/3QaI37J65az7\noJfxwz022Ud1mQZvQZCZ/IcsJw/37840s6or2p9ulj/rJKAr+gEhBPBsKeDg\nXpI2XHt8LviQhzFOWESpSSrmQ3iSwHWm2B17MdBvlrCoKo3t94lWtiV0vlNO\nb97CJ3qquqqcfNzODZu2swJGFsvz9Wvpl9165OvbHDVCdk4bW3GdWGq+5B2M\nGOEy\r\n=vtNH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"cc8a759819e51a789d6cb100f91efa1303b769ba","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.42","@balena/jellyfish-environment":"^2.4.23","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.1.3","dotenv":"^8.2.0","eslint":"^7.21.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.109_1615363779632_0.7262732174113062","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.110-renovate-non-major-e43c186181874ab9fe435bebe0a70899f4a98dcd":{"name":"@balena/jellyfish-metrics","version":"0.1.110-renovate-non-major-e43c186181874ab9fe435bebe0a70899f4a98dcd","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.110-renovate-non-major-e43c186181874ab9fe435bebe0a70899f4a98dcd","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"13d86ec54e5c649d482515c5b4ede1c7bfd3283f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.110-renovate-non-major-e43c186181874ab9fe435bebe0a70899f4a98dcd.tgz","fileCount":20,"integrity":"sha512-pXa6UY19847UdZh5iUDmuYh/huRqK85fr1diUL/37Vi9lvIPO5sVxM4uE6GtqlF57U0dFiacy5fXOCunDUDEqg==","signatures":[{"sig":"MEQCIBdkF2dlCD1Zqj2RDyiilUZHK3g88QhLvTwM9skyc8qzAiBR8JGJ3W1klKvf6DTvSmCzIyoUJ7ZmYCZlDfRPHiatPg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":117561,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSJf5CRA9TVsSAnZWagAAvAAP/RMY+jjY7cgxuaj+H8hR\n9jxqcJfpkL0X/l6X+YA1coIk765tCVVGc17qe/O4K3iZugcVAuxC8xdhGmMr\nTBlywIj/Xp3SghKI4mWlTvxpvKTd6RcEl3hyJYK+eycQM9CVD0j9SSKLveC3\nVZcyHuNQ0NvF9wsGs764ufstI2TrrdX01mXHqo/5GylJSIGAv/r2XFVHnVGu\nSaBuzfppvt9jvSAwZBLdEma9lt81x3fIDN+GoerSsx5Ph+tZdB19UJK1EVnu\nIGNftbbvBtWHT2tGvWSuby5aw5xObiUaIdGsF97xQIVi0DOOaldVJrQr9gFb\nUZvXRoVX00GmgtfwxRNEdlAdPrFSQZ2hYWt0VDdCQ9yMBI2iPX3Dx84p5Xc8\nH1p1tExQMc2/l2vdPYXwFL/ZP8KGpoPjtR6vaHjMQjiIrvYffDMRd4Wy8ygQ\nPSxYXHmvt4Lx+PRO2mveKYfYSjnInsssecpUQ9kjZ+axKx+TOHB5kPLjhH2x\nDGRtfKZF9f10ETLrAbeRBvt0GRQR/Oq1OWx+8/ti6OLIl0r8CEgxnWAMRBrZ\n6T02KkFbMEO5EM1bbT3LkymMYiJ9j818AabBKH32/R03SVC019RUCkraxyvm\n80kLjp47aCZRmNoaKDsVsft5Ljhu5NKUSEJ8KUnseNmW2df8Q2Yx3ybbkwK4\nn4+R\r\n=Fgxv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"e43c186181874ab9fe435bebe0a70899f4a98dcd","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.43","@balena/jellyfish-environment":"^2.4.23","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.1.3","dotenv":"^8.2.0","eslint":"^7.21.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.110-renovate-non-major-e43c186181874ab9fe435bebe0a70899f4a98dcd_1615370233158_0.29587206257945464","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.110":{"name":"@balena/jellyfish-metrics","version":"0.1.110","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.110","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"04cafeb155a2a89f98f4818970ddb86c1afd8c73","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.110.tgz","fileCount":20,"integrity":"sha512-4AsQP/jvFWTQHfNhxWJeu2YZTho7BJ8j7i83jhoeRBlGcJ7qPrcN8wCWRgjQohYh2gX7eLSyzvKXbDIfJFGR2w==","signatures":[{"sig":"MEQCIB0ewZsHgG5LfW/A/KESkSZvLwMeF/IM9YnNIc1aDWDzAiBxVO0EeO83dVSEzXQyUuwyXmowq/ea9KBnK0teKyScQw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":117501,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSJi0CRA9TVsSAnZWagAANjoQAIDGs1HZ4juECD5d0Rb0\nBSpvklEh+FNzn9uzHV86I9GJKf0Hts9DTCiLB9iQNUI1tooBBhtSnOyU0Fvd\nkHXKxTBhqtYYqfStKD0UqVk7HzmCOeh24bck+aei95/pqWCSAGqZag+DkidT\nRyjCbzIi7I6gd5ecFJg8FqB8YxNAifo2kvypfwn5h/2Q272xYtKWiba4poF5\nLW9VOYwYPMs4I708cu3I8B3eazidgI3U3FbuytcEUmG7G7CIkhR564oRH4oh\nPm/2iDlS14yKBNFpalr4G+XtsV/41uYC/32sU7RAXmlz/b8umvwMfgEeMAJj\nMpR0C7zuHzOzG4vDonAKAWCJrMwEIPqZCopBtzwe9KeQ2IJ2HaqxcRS/AnoI\nDGqe2eR0cNt7yJS2aHHqL/29oz2jY8jgJPqHW3EHvzCkcQnjJrY2FhT9yftJ\n8Tos5/0TJhzanXo8d1kP60lmt0si3flJrClcOIrLFLdEO5MxDWUeWjLS+Nxw\nD3Z8RsUFmvLRc36CL4Xy4mzV0bNVrBP8NLhGLS0qj3SBKR+PzDI3K8wu3VOW\nnvZnJfMFrOLjMV1ab3AcHDJ0iw4zOwwtParZ5y4LTTazAKwhBMRVU/Tcr7rL\nOcjpBjxUJGOHtlGVc264rkievp8u3wbQ1aqljBDez+/nbISTkHJWdIO4qve3\ngqYS\r\n=Gyub\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"52f1269b17b7c08fae7e698eeb413ca87206f85c","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.43","@balena/jellyfish-environment":"^2.4.23","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.1.3","dotenv":"^8.2.0","eslint":"^7.21.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.110_1615370420150_0.01523022589712597","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.111-renovate-non-major-29e0bfbe47dd0093abba5311a51df670dcb8b8c5":{"name":"@balena/jellyfish-metrics","version":"0.1.111-renovate-non-major-29e0bfbe47dd0093abba5311a51df670dcb8b8c5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.111-renovate-non-major-29e0bfbe47dd0093abba5311a51df670dcb8b8c5","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d95d66f3c13736765c928d9567d6abb84d16f936","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.111-renovate-non-major-29e0bfbe47dd0093abba5311a51df670dcb8b8c5.tgz","fileCount":20,"integrity":"sha512-w/TCldKhbK/H1guTRAYMKzhJ/fx9rx1//VKR9t2qwwMdtqmTz5DDu4WXBtly/bVwu2Q2khkQTQkDJb3v8pYXoA==","signatures":[{"sig":"MEYCIQCP6nUaMy9q4EXyeRBC1D2NX1RkiDKv7Psoh1x7V8fZHgIhAPdYt7NQ51oRxsRRQ6XRh/ava64nQ8kHRigjt3mmfMNM","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":117996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSV4rCRA9TVsSAnZWagAAoewP/jDTAZFvHsAOM5kiSVvv\nDuvZ7OuVJRNTVNct25Jd2DAjRXk44zIPb7uPRzuLtatbfLUOShIlFVn5a3e4\nHWNd0XoeZv4GVQC9B+m7mOb6YzqZVifZTrqLHUlktKvCsxb7FXfYN79qBY0p\nyvIJAM5Qlftf+MT7TWNmyLEqCthQ0v7weFSVNJon6RYx9REU4lvoNfqRamij\nY6w//Z/YDg9whFOPp03UbqTQ83uitwk22qgRZgmlpsFU9cm0SlMdto351A7K\nQ9GuEU1KnjSlB+mgfe/cjmjsPNjqC9OF77+fdR/BrK1SF40eIaLL0zDo4GtH\nIxdmQyH3/t7mkMUDoUuRA9kiyA2zhIlS1DSziHAjWj7NeO9m0PdueJe4tBp0\nE/weWrNayA6T5B7HPGooemP/QxTUJgr9mHIt45MdNhMwUMG6Q+Y5oy5Vs5li\n6YW7t95qi/i/GMCIom6pkCkgaY8OR0+Aq4L/V1nhz/teNj1HScvXwvxYjSaN\nIHz4vrr3hVTswy7KZyAYG5JDEkaYBgz8cy3OUlbxbK9OMy0bSmWbzOC3ROhh\ntJ7URj7h7xhkvPiUhEm6eoNi0AkL/iN59o0R7XjryIDqFKzkwbNsrJkXDLXi\nVQMDhanGC0YnDPoRsyp7ZGjmQeJKRrgyDeZ7JzVU7NMc9ZPIq8ExvZoUHkPs\ndoCX\r\n=PsjK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"29e0bfbe47dd0093abba5311a51df670dcb8b8c5","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.43","@balena/jellyfish-environment":"^2.4.24","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.1.3","dotenv":"^8.2.0","eslint":"^7.21.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.111-renovate-non-major-29e0bfbe47dd0093abba5311a51df670dcb8b8c5_1615420970659_0.8082840118331578","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.111":{"name":"@balena/jellyfish-metrics","version":"0.1.111","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.111","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1b9c8b370f024e5ea4ddff11ee1c9447d45b7b35","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.111.tgz","fileCount":20,"integrity":"sha512-uLnSSDFUL5npbmaKocbTN8DARezlrGGQPjpQpFF/nEPfD7NwgiYI2u9AiJ6C21i6BmY2AGgqgpz+RnD+xTuEoA==","signatures":[{"sig":"MEYCIQCk2ZpH2UAQ34GywVR6vnm7OFG0znSSLsiPq8rU+aQIsAIhAMLJkeyL7DBRe9UrsjwTNYqKYA8jMDLGU/KSaZMjyrHx","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":117936,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSV8DCRA9TVsSAnZWagAATNwP/i7vfGxSGgCZu68wK1Ix\nDM0bfDTZHnHwCP6axNW/BsybWc/MTM0iIPUq7ifsG5u1jHaP3C2HkL5dbRcM\nVF2nzJZolbsD27UgI+6vqYy/z0OoAO6H0JdPml7GKEvCNzv2/Cg66dGiVbps\nNWuHsO3dcr0JDc2SqOL5aEQwH1xnXKcM3y/EZa+WIiHuR1vYQWaw8a+Elq5W\nMoiDxjKjr6GqU5HCwVbUksWN702cOhp13P4I23NK7J9KXDfhxjNWFCIaCVQZ\nWZEn0oSyEURQ+RAHXAspclrn50stPymxQ4nEKXxatzeXoUkolXrcJIW+/F1t\nMAvbqzP9fs2duwoQjQHdO/ocQGEm14Y5o7u0raOOW+T4ILH3CM+8WZiQyJP3\nzpKRqX5Q9Lohuxehx42y8ZT9ZB6Al2GoKPeNmtdI0snYRdanttUKngeaKxbS\n89QoUMcqnO2q6znNYDSJqsFzTnX9PMKBfYQJRd72d2v+/fQL/P/Vfiy4YQaJ\nVo7AqS2otRhasWqS+DQOoUSWELSoZy68BuitoEaDYRi7V6nr1ZIeEXdT0Ksu\n9Y/YYri18rZX3abT/x7/X69AUfX6ZEqgk1hH1Yb7JwZDGbF4mK7sloCld7f4\nPO5kwypeMrlVyqVDK8D7jbaEQfPZV2uR+qP5bLkrQCSR5TzMEgzSjgNwb7BU\nQDnu\r\n=FRnZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"859776df7014f892f2b0e6ad7575d5cbeb17f902","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.43","@balena/jellyfish-environment":"^2.4.24","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.1.3","dotenv":"^8.2.0","eslint":"^7.21.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.111_1615421186726_0.29870294037170053","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.112-renovate-non-major-d6b4a31d6457865c7ad260ef65754ec57b50f83d":{"name":"@balena/jellyfish-metrics","version":"0.1.112-renovate-non-major-d6b4a31d6457865c7ad260ef65754ec57b50f83d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.112-renovate-non-major-d6b4a31d6457865c7ad260ef65754ec57b50f83d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a49080423770325575ac4950741e0756f70f476f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.112-renovate-non-major-d6b4a31d6457865c7ad260ef65754ec57b50f83d.tgz","fileCount":20,"integrity":"sha512-/5VbdZ7ImxmSjPi3nSMVnRsykULLFt902aF9/Y2H2ohRwWwS1Xa99RviTrsN28xyWEgIpLDV0mDAnXv4h1S6Jw==","signatures":[{"sig":"MEYCIQCBbJKs3lPKkDz1PKBXk00gv1NaR/syYheE+RN6IP29lQIhAO5+zTlW6kdQt+BHLFdFlggrzUHY0BUPPMYmbceT5mF5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118421,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSXl4CRA9TVsSAnZWagAAZeYP/R8zQqhfQJ5kJSKA2OMh\nWYkuqCABgf89jTdmWUcXSw5PIBp/cOdemVg+UCWHjHipp/WIIvazxVtvX40O\nryYakQ/+Tp3Flbcx8doAV6Sh2HLqFH+dvXw6B4NUgMi0lvqAEF0PgTcjM9Kk\nwi6ScHxZ7IiJg/PR4mJkJ4TBouDPZRCiS/AslNlnrzuJH05781OWA5IHIycg\nLqTA2lqEZLvz20cR7N1apfou+qjyd65JJTv+oTL5r8ZrDtS2edJMuRquuN//\nSVCxIKFn1mvjUTF0ASTMvgyKZjpEGpJekQqEoHR6PJJDlGVId/CxzKrM719E\n9Z66sxpll37hdAuWYp06FL3rs10ZqBwhe/vXHuiFVgqG0ekTgB9e5O8h4rCG\n75tCu+YvejK3OEUX31xnryhKzjiiq+zA8j2qfexhXhyERFltkD+5CLyLfgU+\nhdA3WlqJW4NyRto7n/1Jjsb6GQYC6wwIaso2TvNPYS6phgO6LewchUziyKWa\nQjWn/nU1cTePD5Pzo6OFRfebhVDbyduIJrni/VRHKYA/MmExlxk0oNVIlYCQ\ncYdYu2vKdKRNw4lJAufA8P4dNjp2vbQH6v4EQciluxLfQ2A2GpUUlmQ+RXsO\nrwzmUTPFPWXpkZaF3CE8kCkUrhtNsbcxbiHhXWlQV2UCCX65IW1FTf8s8eSr\nO7qF\r\n=wG09\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"d6b4a31d6457865c7ad260ef65754ec57b50f83d","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.44","@balena/jellyfish-environment":"^2.4.24","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.1.3","dotenv":"^8.2.0","eslint":"^7.21.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.112-renovate-non-major-d6b4a31d6457865c7ad260ef65754ec57b50f83d_1615427960287_0.7219472078908529","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.112":{"name":"@balena/jellyfish-metrics","version":"0.1.112","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.112","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"31ffd5a8d91423816c413768bc3ec83ce669b614","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.112.tgz","fileCount":20,"integrity":"sha512-K3doEfgZDgmfs9ijUFpnne7tQDtMnGfldc1W6rY2k1XgTVDHLUCpXhbVLrPnU71R7H3ok4WJ4GYcZW3tNMelcQ==","signatures":[{"sig":"MEUCICw0QV7ECrdPRXvVJgTE5Qota6cjdlDhj4xSFl+WdtJcAiEA9NQWxE06HiXKcOFT+JHhz6O2e6GNk4XlW9NnzSSPY3Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118361,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSXpACRA9TVsSAnZWagAA2A0P/2bvYDT6Dmpgd1AImARb\nZMBwDNvLGGRIVsPobhW1sdVb+QLGvZxwIV45RZSWwRjWrCLkocXaaR+Guqna\nXDCZPBw2yXEsSOfhBNOfm0mHN1b48kH5C4D87pybeK35Wl0BVksqHNe9ziMV\nb85YQbYKfwD4Yf9ZNWRrki2qmpLPUKDSMnwsmdRHivGrpLzyV9L3D8BN6oAR\nVoZNSL6io0B8KFYURya+UkgLAdkv1ovX+Fb+P4OFRzIdP0//7y2TLBrRZTeY\nmmGv8YhBKhRA3ChLedvAwmySFjcfMw+qJwZTpDP/b7FSjUxjMpBgPz+GFiPg\nLkqvXCj2KzqErfH3k+YDJFplI4wtsSs6m9sR9cznImjtIhI/NpxyL+Sf1esR\n5IEr1TfeNP0YNRMMZEE2ZLxTIlJi+82LR5v2LqfV+/FDWl7d/oDMAzj82T8I\n+7DfFZsxJlP43NCBk/LMn6RL57XY5KIC3+UuxS1cBo2oQwoU0jk3z5uOCH0Q\nd9+zXWQurj9SAGC/qlirKcXhmSwzISdLm3MhXXHyTn0tUahjm30cv18vr2p7\n5Pyq3FOPuqji+vb+8P2ZfKsblLvyuUo6KXVbH89vCe6MY1rbC13fUZorDJsV\nJBHrBM/LPhHOX1qMx2Tw0Fde/yjuZsJMPgujgCtl3rcZW73q7sZ37Ui/Vt4q\nprfa\r\n=mWns\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"cece5ccc8a231b4972be63acababca0bc7ba216b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.44","@balena/jellyfish-environment":"^2.4.24","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.1.3","dotenv":"^8.2.0","eslint":"^7.21.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.112_1615428160399_0.6981336116687753","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.113-renovate-non-major-5e5fdb1d23e470d70f11ed83b035e9c6d528a86b":{"name":"@balena/jellyfish-metrics","version":"0.1.113-renovate-non-major-5e5fdb1d23e470d70f11ed83b035e9c6d528a86b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.113-renovate-non-major-5e5fdb1d23e470d70f11ed83b035e9c6d528a86b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"594bab31ab0eba2517fd1245917e9d387e16ef99","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.113-renovate-non-major-5e5fdb1d23e470d70f11ed83b035e9c6d528a86b.tgz","fileCount":20,"integrity":"sha512-q6zGYIzvsJ3IztzGIE46Edol/Y/J2zWAy+6oZ1fct0EOjBxoXGk4c0Iz5fhky7wK1iG9hfw/NQh031FAOTj4pw==","signatures":[{"sig":"MEUCIQC1gMQn+BhlzpI1/PNS8kW4LRFR8w5Ew3c60UsRfCAUMwIgKL5su3FyiFuH4KmtEq3kSf7oYj4uEPhSZ2LVFIbqZLQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118846,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSiI9CRA9TVsSAnZWagAAiNUP/jjU2PxZNA+zRpalLbbU\ncswuc0DLJ5AHxdXXdEYhD4mvowXc4JxrnMTIsCjdmA+totUOW0pPzDKXVz7F\nUzmkIH3kF0DrNaOZlHIEnWjw+q+noHAKoSW1PWOhe3Cq/ZBo5fu8NMRoaIt7\n4cgAeW61dbpUlLFzeOfBKpMFksIy+DEHpI9AXuK8EILlfT+G2bKEbPkXhwYr\nN7rmUOqqwo2FsfQMn4TTNhxF2sLIOFsMRJtlwHVZ9Est/3Y3lfqnruGYzMmL\nuHjFtCk7mCAxYNcXV+o7TXUBEEObhV5UHqmcwKoPegHS9x2IZvqgFibouBr8\nrZJlsQiwmFGh+Pp29QrznKCkBdTK9xJ06rdBihoQ5m300pkQcskr2Gnt951o\nzsaIORItfvWurokXs8zLyrqhXt7Q4guKlLefpvcSvbPu0GYoy9AH/WgnUhCD\nwDwGFL+hSrCfHiIVRo/tf+u7GxotzXYq8UgkaFeNjyBGkm3ssZNziPWGlZpK\n+Z1fbrFvi3IXEe4/WrIiJCIFLq2TjXlcn+02LXp3x1FqvW7geiKrLdoeU9qB\n0z09M6Dbyu8ObezRWmqBgliH4k7YwGIXFPR8301quUhmrlYwx/n5D3lKIq2n\ni7vK5oeBI4PO9CNGOoiaqa1BDsm96v1SOmshshTL1HgjwvZmEZqA89wVQ+Q3\nzWKv\r\n=EmR4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"5e5fdb1d23e470d70f11ed83b035e9c6d528a86b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.45","@balena/jellyfish-environment":"^2.4.24","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.1.3","dotenv":"^8.2.0","eslint":"^7.21.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.113-renovate-non-major-5e5fdb1d23e470d70f11ed83b035e9c6d528a86b_1615471164772_0.6586402968602443","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.113":{"name":"@balena/jellyfish-metrics","version":"0.1.113","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.113","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"38a61921211d4fb361fde0422cda2d9cb0fb12ba","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.113.tgz","fileCount":20,"integrity":"sha512-znQE8JzpufMWByo4tZ/LYfQJywsbCgFo6MVLiLCGfL0UB4ePEK9x42BZwP2BQUqyMYTZ8lF2rc4JnXcxdQKAlw==","signatures":[{"sig":"MEYCIQCBzP7QDH/7MJhDpK46wLVkKAwo5t2OwLnKcZfYQRctXAIhAJpvweKHEQUoiJgKM78GXl3ILGtCdlF5UlImPSmSKXB6","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118786,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSiMPCRA9TVsSAnZWagAAISwQAIFGFuEOTBM2eI0/G1mv\nnqsn3HeH6vePByJLyF5JEetRpoS2hMD4xI3S1C8FstIGMySuusdRSaG4GOmr\nQyjmQ8XPh7knn2y024VRjxLApOTM1DoiLTDavAaUrNQS7Ndu2oelP7MIFmdG\n8w4b70p2XzlvNTw1kwCxXlUaO2DBg8z/ElsQrI7UHt6zATGfbHMaCuj/dhMT\noTS1XTt5HAreq3R6WAKKONZjFAhwLwWf8wsDlAT4CZsY3TgKRggVHrSqOEk3\n7cMLrqmvQtz50M8VJDtjUHgdVfG+DYelleC450W/tGiLIbTnJYc3pfuNS+v6\nV1K9AHaO5DaRIlt6nuKrS6uIIhkml+GtCtpifjCEUt3b3+9DuB657oyPsNJ8\nZWqlTTuAzQL5i0AeWSlWzihOxnyrSQ1Kd7I4QVMXq1H+351Nm6/M2oQ137V3\nl2jKx2VvkBLr7NnVW8HHdRXVCkBddmHQ2EETUOO+Q+Aydha+TXjaKGEUddt+\n6/NN8mnADrym8iZOQenPu3e97H4tkFUz+S8vedAsob3ZI60R/qrt4oo8Hg43\nKleJ4FKHwvO4PpcmF0mZ/mJZGPyjrplR0c1ChlYfY55oWTx7ivAQk5R2zt4j\neNeIGx/UYPA5iWWse2qlF/2BDQkT1CQSp/1BbY35PLHAbC2TFzGfSdEDZBgo\nCx+8\r\n=XQiS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"485d8a902e754e009a5f0b7e014ed7ab81aeb830","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.45","@balena/jellyfish-environment":"^2.4.24","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.1.3","dotenv":"^8.2.0","eslint":"^7.21.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.113_1615471375514_0.3095627542464927","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.114-renovate-non-major-d4d8dea4be736e74b95df8f0871052f4cb273701":{"name":"@balena/jellyfish-metrics","version":"0.1.114-renovate-non-major-d4d8dea4be736e74b95df8f0871052f4cb273701","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.114-renovate-non-major-d4d8dea4be736e74b95df8f0871052f4cb273701","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"71ac7dd8a4ec5ace556bf87283752ac325c7b214","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.114-renovate-non-major-d4d8dea4be736e74b95df8f0871052f4cb273701.tgz","fileCount":20,"integrity":"sha512-MdnLA734joOdxfJRPk7s/TpYUU7JpIwXYtyxLIu6tLEnMQPvACRr3p4t5bzwVhrx4Hhvd9ZLXdW1AMNLQwLR5A==","signatures":[{"sig":"MEUCIQC1UKGfNV2X4M8+TvZuwxHxtBdY8f/w0bwL5pAHWPFeYQIgc8tPGhS/n+hq6YssaiAoI+X9+2tO8Dw9pFQdylFy7eo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119271,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSsxtCRA9TVsSAnZWagAACwkQAIw0A0UifMFxn8eFxBBj\nO788Y1lgP4nTs49v5B+NNunMc3y4+zq1e8cTl9emtXLFuMjcDq7bCuA476S5\n75BjeTuo5pfz5Yh97v16iI9Nq4B9TzLm3sXLyss61g8Vn6pFNoFIz/Omzilt\nvTs2+yWbJV59Bhke/oqWH91PWOxJemPC4ECRk5zD283hlq2eyhmZ5RXlogkK\niCb46ZFStu9p8HfMDPews4QJ2SdriMjgGHNYlkVTqJwn1BMSeFOb7GOTJg9R\n/b3WRwFHOSfJBlx3CKZqBlyJTCaPRbMpii/TfG5xfIFNM459dKr6Wvd/tb3Z\nUZwnZBCNmBRsPnve/FtQyMNyWsTWhORbGCYjUpvdPjrwPBodxf32TK0O+qZe\n7dCyuQ+PxjLYp/PzQs5tn4IUTdcl6LVRR4ZWX+W9Nf2QSKeZTg+DAt1YLRXK\nJixzduPlnyeROhKNpV4MlLPfJP66NwyR0kgcllnJcQ2x6fEB67H8uEkU0iBK\n11wnwVSQjM6FyA77ZVwQd3JLb0Np5kt/KKQ91dhuIr1x0+Gp7Fboheyin7yT\n61rUXjNoVfYz1mqeREBoy4Y1XQWUKeYHWta257XJYLKbrj67MHLCmBtGt5oV\nRsXsXVVVCVdOpSjipU8VobSnPUPycpiyUxcmRXWvs4ievlEoGSGRLtduvBoi\nwDaw\r\n=Yu6r\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"d4d8dea4be736e74b95df8f0871052f4cb273701","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.46","@balena/jellyfish-environment":"^2.4.24","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.1.3","dotenv":"^8.2.0","eslint":"^7.21.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.114-renovate-non-major-d4d8dea4be736e74b95df8f0871052f4cb273701_1615514732542_0.44499412661148185","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.114":{"name":"@balena/jellyfish-metrics","version":"0.1.114","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.114","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9937a01fd78f29ab81ccc6d975d62dfdb8566823","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.114.tgz","fileCount":20,"integrity":"sha512-zLTa7NO1MkCXrC7zBLLuPN9DgInfwSkDVyiABFxz7p4SGtJ4U0WXKEURXPwJe8F/X0SzEK6ahwcsTYWGvjsKRA==","signatures":[{"sig":"MEYCIQDKzb/jXAw1D9I9SAW95f29yw/1j/2K/BYDdf2x5ijt6QIhAKIESdPRC7puuEZEiQWcMKgLlW7W41RsG8HpSjMMhMHx","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119211,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSs0VCRA9TVsSAnZWagAAzugQAIEU5UUEzkTnEigo8U8W\n7hp99yXXQRlNcIceuihRhLJNwjWCo01tlMNhiJbmg5xXgI8cPM46eeAfeyVJ\n6torKqhRMYcKMSs2VuEV8eNicXKmyEjX3VdAC1VMqMmOGn2dcpH+0F0Jhxho\n63KEEorZTEBUTfV6faURy5rSmhsFz7JR5rgcLfjAgskAHo7LMYjTMK71Mwi8\npFg49oAUe04K71OavdNNrtbzzH9Caq+CN7+lKGAYHpy6qjfNhYwXtSLNfIKI\n2T9CMWOmRh8pH+J/Cs/E7q0WA7ZoVFwfBYK6MAaYTYtNDY7Dk2bhIypqrc0q\nndzk49o1QxgPwHgxzhAJEZNr9Ngv4NAy4ZKbNK3iB+z3+FKwYhU26i67zbW9\njrqs1W9wXPf1t1p0TSj3JbapfBfcVD0kbeT1WpsMsxOOpZulqAciuENxQnQI\nr548knghyQpwnTdg5FluYr/RKvz6IlofV5Tn9CeUgzNSw+r72JvniF9YFW8p\n7SizR9XJ9BVYTJAlETpaK4UbUz2GXo7BX3Dk8sdgs42HEUrM2gUdMbJOlZvp\n52ihZVA9SnPnZdsAW2VziH+ZKeMB9CQu4W5928LZQw2oICijkW/9LsY/giGn\ng6xxJwNh4TwDzuoUZ8+9xHX/IlNSW7oMGSHfh9Nt8j/fUama+5ZGuJ8lERt3\n2LhX\r\n=XdkL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"24c9f938ef9e4274e7d944b1b69cc345c03a1cfb","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.46","@balena/jellyfish-environment":"^2.4.24","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.1.3","dotenv":"^8.2.0","eslint":"^7.21.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.114_1615514901134_0.022339552627657744","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.115-renovate-non-major-767dd4fd1b4956c7f6da23bc6684bf90a287f742":{"name":"@balena/jellyfish-metrics","version":"0.1.115-renovate-non-major-767dd4fd1b4956c7f6da23bc6684bf90a287f742","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.115-renovate-non-major-767dd4fd1b4956c7f6da23bc6684bf90a287f742","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4ad5468753603e3621f6e731f3271e3bea9f2e7a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.115-renovate-non-major-767dd4fd1b4956c7f6da23bc6684bf90a287f742.tgz","fileCount":20,"integrity":"sha512-Z76xjrX7Byr6yyYuhpQAf+R/BUjDkB1KbRmgWASaRBzDeooT2RpQ2RPgbWCkd4oJF9ntpyUq5gw06wSfg+Uaow==","signatures":[{"sig":"MEUCIQDAK9FT7+fpcdGM7KrIyEn0c1l0MdedZ57i5FlU9YByZgIga3JVqEXNI20QEigPYu3Pzk/VgfXFs3SgP+G7J8MfOnQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119622,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgTAGdCRA9TVsSAnZWagAA+PIP/jplnDTqv7DffQ6Cczjg\nttbUrDihiMHx/F3K03Zg/U+qNMfxZRh1WjnJLUZYhJDWx+T3SglsdV3wxHpc\nqVcdCQQTTmSGnTQ0WJJ+JgXHcoiwwap2Gju9ou+jITuDi+YfsAT5vLqtkKov\n1tI4DyjPDobfEtOfiivXnRC/u7R1kd2McQFKclgv6ucwRCNbTcUDr6DtpYOx\nSBUPtA5DgWT7oBLfXUQ9DLJ90yVg68rc9WH4Moh0XELkibI/WrDuAa9Iyah6\ney9v+l8q/NpLe6nIU3S+76TRKuG5MQ84Z+g/DT+tfi5X8xqiypJyxxkK36br\n7R/4OqLw/P23epn1UtKKDC+vofrQERUL41piP9gQwk22mRlXO0SXM28kZmz3\nd781PeDnjlkIbZTf2MeBUwG6VVHADEKbjlCvmWFLymO5KnRcPFmgnXprVYjM\nyOcsGZIKWHpXMj4CfxIt+bpXzEA7psQ3ceJnszK0tSlXTFBfEpZ5LtLw9TBC\nAG5cRLjf1dZbiAlAhxgIM2ZoZUXfzoT1/eRbCI8SUJQVC1GxDFOTYq/8Bnhl\nMlJ8VvmUwoVUK2cZ1PSh4wmH8NPp+AjQ4w6rbi27PBVWYtNbEWlyb1n8gu1D\nSyPPJH+fp2cJuMTQ9ly+51kOMw3iwm/7bsBeRdss1+kQrX5hMIebMaub/YDF\naqMU\r\n=V0Hb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"767dd4fd1b4956c7f6da23bc6684bf90a287f742","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.47","@balena/jellyfish-environment":"^2.4.24","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.1.3","dotenv":"^8.2.0","eslint":"^7.22.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.115-renovate-non-major-767dd4fd1b4956c7f6da23bc6684bf90a287f742_1615593884655_0.992292066942253","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.115":{"name":"@balena/jellyfish-metrics","version":"0.1.115","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.115","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"88b7f3858b1d049c38eadf43c6fc668615577510","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.115.tgz","fileCount":20,"integrity":"sha512-NOmJ3z3GflYHPkTkflPGMBw3+VVT/BnfIzkOjtHeBvcf+KQA4VEaULWwkyL17qmjNaRRCBhJIUVaq5lTA4IuBw==","signatures":[{"sig":"MEUCIFzujjwQLa1PYRjl23do9//C1rQT+8hELVAfBilDCqfJAiEA+L0/bqUTdZ+VY222i7wTd47PK9IQ2rQ+m06CDKpZU2s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119562,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgTAJRCRA9TVsSAnZWagAAIdQP/3UcRKqgdgwl8ESBttKQ\npNf3ftRFdSbm4DBQ44AF+lEGNmt/TeOfgDFsiTMKKSVGQNaguCwiwsjsNFrg\n4tjCXoKLjF2SG+HeAxfC80+eaAycw6pf871KhxLDP/LUgDGWkhigi6c0xXwQ\nHF/3hgZSIOgdFuZmK2T0CUc0EYNn3mIN4pU0j1cMoIKlJ/Fv2KMFxGX5yatm\ntTi41e5uJYeizDuafBdOxYxNnAJFx5gE1V2lKx18eLvHysVaefcSe11PXzDQ\nDWPHwZOsurY2zApsvj8OWd8jPjbXESOOR5q8ttjDpP8U6r9qspIAXQ0GS5qp\n0QpAPvwoe1V6wvE7gxA/gfbU7VOO2uynMrH3mqRFRg4As4AHEjJgMQ5RYSiw\n8NbhkpPL+9yU8AcGdjFOODaxTABNcnRlTNi3qkcKBCeq2irAZxxowgBSZEqf\nABmUU3ioZ+lnwhaJMqvIfk+TbvqATGVz36Qj+Ygp/OMT97LGEPbqV3vpEk5l\n2Wp+jgZ8PmNXblAuo+D8lJVJw/PiNB5idLgU6wVquD6rp69flfc+9r9mQ04i\nU5oW3FEiRXaT+/unz0kk+Yzrr7iNqLHRwB2ZTQAi+B0pvZw6J6HYjU9sKQMW\nv8FGBolEutAmT3B5yHyeKbG8mouC4Vq5MtP6sDMeRFyfMYKcNxoXfEv2WkzB\nmmxO\r\n=PUvC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"8754e05e401661d11d78d8f73fd368cd59eb0562","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.47","@balena/jellyfish-environment":"^2.4.24","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.1.3","dotenv":"^8.2.0","eslint":"^7.22.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.115_1615594064407_0.7406281894782787","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.116-renovate-non-major-6ee0d249fa4e7e0ec895073eee2f93fcd2d92017":{"name":"@balena/jellyfish-metrics","version":"0.1.116-renovate-non-major-6ee0d249fa4e7e0ec895073eee2f93fcd2d92017","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.116-renovate-non-major-6ee0d249fa4e7e0ec895073eee2f93fcd2d92017","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"73d81a992bdae31170293e15619151731374dbc9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.116-renovate-non-major-6ee0d249fa4e7e0ec895073eee2f93fcd2d92017.tgz","fileCount":20,"integrity":"sha512-mRwi95EwT0efemCiIIJ2ZWuLoRhiFmnRoDzKgxD8DreTvyhmSDqvg06gTQhcrK9uGE3xG1qnRK/ICeO7yodsyg==","signatures":[{"sig":"MEUCIQDUed+f6Oa44hhwdXzggrBy6E1pgegj06BZ7PhqvfrxwgIgLtnJO7z2yfDGUFaidjHcpfSMD7Qn3i6hyQe2bo5XfIc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119973,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgTCQcCRA9TVsSAnZWagAAjMsP/14hlGPZY7ueadgmHMSB\nbOxoHCaL4oII+CAy2qJwsal0YnWEKdqTnYs8oFADWElE/bL7JzTk8rbB87AE\n/rZ8yQjPa0h8Cz/rM7UrRcKG069Kl1QLPDI2yu7sLHWgFVjtUgHupo/w0qmG\nr6/ZTmT3N3qHVqyzrDKjLFajc9xcKsZNWzUoaCZWcg1ORaLDhX9zMQvAV0gt\nqQadFnpRFj8tplwGZZcZVCuCrz4p3VJeYyBuy6RMRfLQ6ieeNVSrL5ICH4ix\njIZ7F4XZZMDFpUhM+PjwvySU63SlB864FKzLEV/OtPK7QqdNOdVk5DXinfqi\nG8Vh4drVdg6BIdKLypeckeK79FkY8peWQMXudc/MvGNg1W0hMhzy2ih4xb7R\nwC/MfQRjPAkLAwk7qHgQXqGA7/T5iJWjcK6WyDAyf9997Y/w3kwIUKAPkaYC\nuavxWIfhd+vCqDRoi/9k8cTE1IxKlfHsURNDMLq8w7Hx3I92+aPIzhZuQVtE\nyjl2lUElBaVXbOgvkxVlFQHpgUd5vLNxiSCBoBDVfXP7DOW8l4BGPJB8EE9B\nUCtsNWHHPHbDCNCUJXTZRFOZi02IA6CzL2ygBYyIXrQ+1lsWSt5FiScrzWe4\n+H+jZND8Ps5v9pc8XUU3d5ZJldPfm/UhgzWcKJzjoJxMp4K1+nVoDoSE4kJp\nIK7Y\r\n=xP32\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"6ee0d249fa4e7e0ec895073eee2f93fcd2d92017","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.48","@balena/jellyfish-environment":"^2.4.25","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.1.3","dotenv":"^8.2.0","eslint":"^7.22.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.116-renovate-non-major-6ee0d249fa4e7e0ec895073eee2f93fcd2d92017_1615602716116_0.7625252296325913","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.116":{"name":"@balena/jellyfish-metrics","version":"0.1.116","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.116","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"773f21a4d156e36df893920e09556051fe5a97b2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.116.tgz","fileCount":20,"integrity":"sha512-KkwtSRNCmg2i/lIFPwUoGG9eJDZrMzQNQeYBj0fHuEso9ygJxDZqwURXM7ZblTz8EGSc74qfq2nQFI2mNwIu8A==","signatures":[{"sig":"MEYCIQCLfT/dG39IToOcFSS8/lmP8afrrcQe7oRUY6vZvB43WgIhAOdrbPmbZUhWtFyWxrKi8FHNobuJfP1UWXEMklvFT21N","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119913,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgTCTlCRA9TVsSAnZWagAAzyAP/ibPB2uBU2TvzxvC+/gm\nZ4mKZzPTn5Witvt6O7fMw40kykf8UiAxNzWD05Ac+88FtQsKzEj3Z8r9vyak\nFcPyf5IL8lvosNFgelDleOSZ1jrAWCydvxc4M8Nzfh7IbKrsx3JW/CUL8ibG\nk84HN77fSUCYiP65iZrHMH29I2SpXajobsVq4Bq3a1XjqauPxwzC2pdxhM82\n0YFU3zdfbzhegRIWLoqAtN9Q3GFmqE9NI91PTB0lyQEpmpKyQ5lsOwCpkkqb\nggAI0k5uixDkaHIpM56m3X5hyTcHhRSruLt4VaA2Y/T4iZRttC3bckHnIZKa\n/LRutis1ERVctosUW3C+D34oeWbHcNO4W7pXYIBKVROwCpsvSEm2m4sExjgY\nbs5K8UN5Qa3FvBo7fd5XnvbtJ9+XBLR4Qj2UZziJifyerTFhNRA6w4kKkXD6\nOF2xIv81vGzLBZ0x4ZNSaAX1Q8k1A5SGWQ8q1hgvIThXZzKxAY3n14KVq4C/\n9vRreZsucdhiNjBkyaVqHo0zDKx4zwjjpS0Noeh46dPU5OAq5eOT7X2h/CjM\nJXHgkeuijfIGN76L/XUocKaN//C83NQEb5aDIw0SLFGO5gZDD2lcE4Ensk6q\nEUOtQBb7m4zjeeQSjjAoTxGT7U1r7TkmNzTQE3loZ0Rmae7/cc0z3GT+6mZn\n0ldn\r\n=psFx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"b5add9467b3791c80ca588fc46bfcebaebc158e2","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.48","@balena/jellyfish-environment":"^2.4.25","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.1.3","dotenv":"^8.2.0","eslint":"^7.22.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.116_1615602916774_0.02555176232091294","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.117-renovate-non-major-58769e979473b966d9ce53e469f74365bf06d80c":{"name":"@balena/jellyfish-metrics","version":"0.1.117-renovate-non-major-58769e979473b966d9ce53e469f74365bf06d80c","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.117-renovate-non-major-58769e979473b966d9ce53e469f74365bf06d80c","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f9706a183fb8dd8144b56b5596ac491680099932","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.117-renovate-non-major-58769e979473b966d9ce53e469f74365bf06d80c.tgz","fileCount":20,"integrity":"sha512-z8LHe1FqZ9k4oVOKwg7xSMNBGN2b3M3OAe7gR8UT+qq8ClnZxNDUHEthlzYxYX5l332A0PV7SnTrEUjvIdBWDQ==","signatures":[{"sig":"MEQCIDrTdpHASTDSXhsjLbMHjbrrIdIRZw8xuKPKvob9qPhvAiALjPXqUYbvOxMMDjcuIuoFpJAcBHEw+17KHwywz9SHCw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":120324,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgT1U6CRA9TVsSAnZWagAAKXEQAJRR5Mx5QqvsYEJpug4k\nxM3dT1ib7Dnrflybuy3Aj8FTNa/XPJe3AnSfIsaCcAUGRiHAq0XMLCj0lN6S\nMc9hZtbyGjx5vsf5/CKvx0AOxTEHJQ1cYUQmA74GnT0+ovVuZrNJdiLqO2dx\nw3LLD5UqIYz8Oo2Dnuzu1GukZnOaz/yL2lxwMTq0IvA6DPdE3xm+q7i5XQ8X\nh2eIU2ZxB2KlIZjWkDZ/SWGFTNvGy5N3GhQiaMEzasH1gWWJvGaq5VFKx8cA\n1U/RdTTbj0keMuUP1TXqtDBAK9ClrGc20czYmpWIJ5Ckwpw4Qd6AjvthRbdg\nghMpzn2lhuYIFlDOQ7R4grGlBrtMlIx5tFJwUh4pSkd+ans9wmOJU4U+5Vld\nSt204i6uT3aW2esQZAoItrehdpEUOxX7Rh61Fj0fyUwtklh0OsXsFQ7dc+Hg\n3ocHyXLtDy8OZRIigoBe857Te6DEPzBbht7wfhSZjksTkfglnhixaJe9qFOq\noq3XUdocoT5gR2usrVBDmZsFHWD1QT3JEphqber7fInRfnmV8AyTiYArYtVK\nyIHi4VpLGGisPLtGT/3xF3Z4pwd5+Ir9ZrkNAv7Sy1jSrv+HZIbRheolauEJ\nfpusRWK9bu3tTo9rHjkmZPQ6ez2OoWP+cgcPTRv16RyvfrAZGQZVdkc/eRpF\n4a2O\r\n=aQPi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"58769e979473b966d9ce53e469f74365bf06d80c","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.49","@balena/jellyfish-environment":"^2.4.25","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.1.3","dotenv":"^8.2.0","eslint":"^7.22.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.117-renovate-non-major-58769e979473b966d9ce53e469f74365bf06d80c_1615811897557_0.48563457541564814","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.117":{"name":"@balena/jellyfish-metrics","version":"0.1.117","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.117","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c9660f4cb32aa9f52a087ab588868b1f043c1b06","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.117.tgz","fileCount":20,"integrity":"sha512-7HEFDp51SxGvpRb6OixQKkGPM2UaBxxwaIUUhAJ55QBO4VHrrvgaxn45PjFjsk99IZxRxQIaU82PkJt7QBASxw==","signatures":[{"sig":"MEYCIQCtzERgapKJSq8U0hHILllWbCO4uK7SyRliAbFDPObFvQIhANQtyD1sypeCLvL8Ab41Z/3etssyDeSG9R9xJU3MQOv4","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":120264,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgT1YBCRA9TVsSAnZWagAAYCsP/jvTcayd5g3uuJpHmLt8\nwOfpRXIy9P2zDI0/sBeV+qmVhmntIbayUr7ksGV9pzC3iehDnOukG2nLD/jJ\nmhty/hvFeFbx94f3YGO8nIRgrM1zxWOiWRAmIMnP1hybxvXCkScWB5J83unX\nxMlg1BpsRifZugi5krsTmri+sQqzJqrQotdDKgUjeMvDyq/k4k7pqXigP5DY\n53mwn1JD/Y8+Wwdou3qyh2soehSooJ0Aet6gGAkLl1+kJek5Xt2a3mR8yJPP\nUzw5KCQbjqmD+SVwBjpfsWNdMpi1WxVdkZJWnLrcVCHboSlyiiCKoBbN2gSF\nT5OjKE7ZY8pLF2rq4D9T9kxw0CKhVXGm03QJ14dvBZcPanZqbuS0bUn2/OA7\nKsPeJHC9LAOWF2hJ5KXl5GQUiiUMkH+GHK+fvYqxdruSkwdQy1x9Gtex1g+9\ntaO8rj2ZZE4tdTgF9hufI8l5G7o+BeLPl39qPeG1eGBjtNFfzQEeYvVA0M8r\n7MdQ2Dc2UFfkBI5Agi4lXNDE4ID28igEpF0ywqzSf0tC6J00AiQbKHsM5GmL\nVF54FUkbGVSqLaxEq2+cymgbiBqLVEY2vaBrFGtVmm3eS6hul62VtSYQLAiA\nFq+yTSOMaWoqT0VcdsB2zqHcadZHafwrN55M6xYWgU0I3aokj1qBkyUlEEXK\ngqds\r\n=rVkh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"27881a22d76e4d8f2199247015ccea0a069aaaa5","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.49","@balena/jellyfish-environment":"^2.4.25","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.1.3","dotenv":"^8.2.0","eslint":"^7.22.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.117_1615812097407_0.03036988863080392","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.118-renovate-non-major-d88312af46a06edc4a959b9ce993643ffa0cbeda":{"name":"@balena/jellyfish-metrics","version":"0.1.118-renovate-non-major-d88312af46a06edc4a959b9ce993643ffa0cbeda","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.118-renovate-non-major-d88312af46a06edc4a959b9ce993643ffa0cbeda","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4ba71be7e6dbb977c70276f713fe37ae451e719e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.118-renovate-non-major-d88312af46a06edc4a959b9ce993643ffa0cbeda.tgz","fileCount":20,"integrity":"sha512-7yAVdLpusl+L6tqRf9fVsyj2J36QCqZ4ueb+Y35rqQ12PDqoMIXSQDCeuwR1KKCiIw/bVmC7/oYylPncoHWomg==","signatures":[{"sig":"MEYCIQCzSFP7EwZldU5GyArL8NGLqRTJrG1DRd3hBUnh5wTcOwIhAKenj2eDlVtHupwC8E3Izxv+TZ4DjB96OkP79VCEIEC4","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":120675,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgT3zECRA9TVsSAnZWagAA+u4P/ie+K5FyXDZ1yNcAQ47t\n4jHGwMlad7eDvbVY/ijncudWZqrSgvLzX2Tdp13/bWFysSEPKcJChCikUzvw\nB+PxOYGxA1W44jFQtMcgUD2CsEkToVQSeQDB6aW8djdfXRqeL7EcOp0E/ltB\nSubmoTcwqBZ+wOX5NIbXFW6R2XtIgMNFtUfBCUS4/7BGXr6gvsQnU5k1qrT/\nQJUG3geJohShmPWWYnZJ9mRUEwW4fGD17B/+czKX3Tuurp0H6hF8cKMSB+Du\nGqcYzZ7IckLIQ54V2ZkqN1V1ssHeSjEfZXDukjdH/aQGq/XTmJ8mB2D8wi3e\n5BlwzJCv+nxroyBMxdhklZsvs2Rj9v1ZP41ydm4CngdKfLtuFylkT9czdROR\nwXSk1cmKRfpkMiVIto3zrlRKvWIXHiQUXaL0RY83jcxlmqjI238oyTZLBYYl\n1JoRqQzikJlCtFWHWM8zcR+0xBmplKje3vDLLQ0IH7Fii7Gimu4PHv2hsRkM\n3WeXk++XUk5tLEi0zt1NY1cd+cJ7PvbkP1REEl90AaKW3GY+qR2mZjiUvt6l\nV3vOJzr+EV+I00qCAEak5Ro4PIPWSHLdXruPdMx1G0I9+tFMCKA3IHll2zZs\nCJ+SF6Ne7NdBvqafwY4OO5g9/zY3QQhnqkdtyNDeC86W2KnfAy1ntV7G++Pn\nmdY/\r\n=8m8j\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"d88312af46a06edc4a959b9ce993643ffa0cbeda","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.50","@balena/jellyfish-environment":"^2.4.26","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.1.3","dotenv":"^8.2.0","eslint":"^7.22.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.118-renovate-non-major-d88312af46a06edc4a959b9ce993643ffa0cbeda_1615822020236_0.22225891926805685","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.118":{"name":"@balena/jellyfish-metrics","version":"0.1.118","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.118","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ef2caf2f1aa968919e8c6af16abe00f13b3f3a55","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.118.tgz","fileCount":20,"integrity":"sha512-UaE/9kndVd9Fe2J/dKsDxtk5v+j6Y51nA+lk/Da4qJ9B010gLyN5BbH2WgDmSnFtIRP470klu2prnHvkSDvODg==","signatures":[{"sig":"MEUCIQC/kam0bUE8mx+nWZkl9VMR3tYeGM5zOpfbU4X2FZD6JAIgPAViCMVMa7QWm6NwWX7Mm0HwdvQSf0qDqGi9uJXI+zM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":120615,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgT32XCRA9TVsSAnZWagAA/6AP/2rvfPB3968n5g2ppB1M\nugG779k++EUZ32QBAnox6MLnvxoJ2zLhWHJLqildV4RDvor0hbagcGFkce+Y\nTgyxZLJPi90Oxeh1dKqI2CQtqBOrhBL8iORjrZSqPceDpxXb8W8v/qr56/Dw\nhzsqZCJsFRcRdQwQ+ulXugkx5MYnmtuKhip0d9gDvkrQG3yI3LotewRMDPC4\n5q2ChavZLEHXfqXggSRsO1qpV9UbDB+SK1EC8DSQ8DrRIsdy0f4fJfNGm8zo\ndB6SXA6x7oEE0IofHJq4R0A+WaiixUqTybJkfUS0Syj/isJkE/Iv2AuE2y9k\ni9tZmEm+tWRCuBLk3dhCsnr0YKLLZalDV8c+ASeF9xkE4AeAZ2XqBYIvHiKb\nh6NvJWY7Vbpq2ZXbAzD3KMwPOZbLD4Kvg7rOWQfysZX/FK8iMMbODBSyQM3y\n979+PNfM2DPx/Wy7jSDgGb2Rg4uwORyEc7txEoBBGJvFwR3mDwMFEt77Aqxq\nA8CbxIlPqK8NdTnBC9BGOLvldqOLjO2oqOQN33LEWVbZOKPxDyXvrf/EbqFT\nYqJ7yQErygVjYa8G74OhG2YCgL8Ibzo6tqUoFJTJksgpZLTGbUnezvIWTNBQ\naEpH72Sl7E9ZZRGzbpccNZfWk9Yf86KvKKwSV3XFkQ3r7NxZpjAuVSFA6lsi\niEmI\r\n=dmnb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"9aab2c1ab78a8f70e93c329fefbb43837718c30b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.50","@balena/jellyfish-environment":"^2.4.26","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.1.3","dotenv":"^8.2.0","eslint":"^7.22.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.118_1615822230478_0.09596566007662766","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.119-test-env-d39f48033aea729c8e09ca9d30c4b2aad40f066f":{"name":"@balena/jellyfish-metrics","version":"0.1.119-test-env-d39f48033aea729c8e09ca9d30c4b2aad40f066f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.119-test-env-d39f48033aea729c8e09ca9d30c4b2aad40f066f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bc1032432b3a3ad2cea767eb601229d26df675cc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.119-test-env-d39f48033aea729c8e09ca9d30c4b2aad40f066f.tgz","fileCount":20,"integrity":"sha512-itX5/7+BcuNOwcLzHI3ib/rOwZZhJD2S8nW6P6BMA1OqlSE1GRl1IWjk3Nw9lVJni1W9XyhcHG1DPDF2bzqkPg==","signatures":[{"sig":"MEUCICZGeYZUasD8t1sZHWefDTj6eX3jeFDVbA+vMTlQeqmuAiEA+fyo81t6RBOxP3ozPNYy+/HzvhB63F95vROdenQBzkw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121191,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUArpCRA9TVsSAnZWagAAiI4P/3Ni407r5FZguScjuRF5\npNOaQ3oeR2yxeF2rfZOX/gmqFsxjsUYY+jnEyzgEDp1acgxZj1Ieh/MwFfoX\nRgUDvzntp/6fYr/CCXu1YzNwI9sgswtAsRdp/Mfyv1um7HjUT7IPP1DLgO7q\ndmoYaOdn9bv7sjMLK7qGkUgZIBfMQOuvlYKcJXgou0iEfVA+xjE3hFXsV5DD\nu8gHsSs2sctp5h6bT766uiRftljH1rViC9Lzjh4X/CGGJeKTsGxxgbXjxPvf\nYxoTQdGf7nBBiGV10JdDMb2JhGnOYnRqLQIM/z6SGN4cX/c7tPozG5TGlL+F\nhkVXJh/buRiBz9hWbZtnwzS6K8ZuU/IH2jY9u2D7wrwVjfSSyp+u0LkE74P5\nclngXlMMcImimMVsk1qhq6naZkSkQmpo+MwXYBvyrZj1BNknnAFyzsUCHrCI\ntefv4Q1JliMJvS+vXd1IO7iDNZI0g1QCy9DeWD8IP9f1XdYZGJmfDPWbd9xR\nQjm7Wn5t7jjacGobo/35kYSM0PONZzrRVjM9FPOivsztnw6OOaFI+kjfU4C4\n0BMj1KT+87XuUL8j1h1byWDT7mnEieVSUWPPqLmBhON1HkEUsn7RVTkm1g6r\nVBrnpQvvk6R6IcWhAj34332+uMU711nrqXGXAvsgEXAI44tJXEdM6XkiyeQB\nUmDI\r\n=7ILs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"d39f48033aea729c8e09ca9d30c4b2aad40f066f","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.50","@balena/jellyfish-environment":"3.0.0-use-env-c22510a4bdb76bc44eb7fd425cbef8cb77012f82","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.1.3","dotenv":"^8.2.0","eslint":"^7.22.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.119-test-env-d39f48033aea729c8e09ca9d30c4b2aad40f066f_1615858409353_0.6836733776246358","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.119-test-env-32cb7422156547821455c282465a53bdc07d0357":{"name":"@balena/jellyfish-metrics","version":"0.1.119-test-env-32cb7422156547821455c282465a53bdc07d0357","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.119-test-env-32cb7422156547821455c282465a53bdc07d0357","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c3f0541b21a4fb966a6484161c55118b62ffe83e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.119-test-env-32cb7422156547821455c282465a53bdc07d0357.tgz","fileCount":20,"integrity":"sha512-G9NtsATd/m4xcT7zMXT4zzEaJo3f/FeKRHWn/Ou3fzliSrrkrO3yGtIHUjT4eXnoc6cOxtjZSeGcon7nHjNK1Q==","signatures":[{"sig":"MEYCIQDFRo/NjQuQfC5H1p+G39fu4UuqsDJX2cKXf/jbQG7pXAIhALmR6xOY2EwPdOCzyWPp0HzHUsval/2yrtAfQvT/Hwcd","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121191,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUHlfCRA9TVsSAnZWagAAFt0P/2CrggZWhE3ymIKIZ27g\n5skxuPtY9FFjVM35pERfy3u63X6A6KDiGM11FF1gQuCmayMhDgAxB2/Kexhi\n9g5h2i8xNAQhJGlP4OnJyYd1lkHXpPhwaTlPu/WFYO9vii7XR43vgx+JPv/S\nYtygsCC8xNxLrilcg3e2LSymPME45NSv01RAbLVH7D5NlAU7cun6ald+uYeo\ndb9q50EjhGawifyWOuiejK5SfpTq5V+Hjy+fgb4GBKt45jjDCtwvfABo31xB\ntN4ARnZpM118Khq09BUk4lEbPUod0ZWhzAFMSsmciRBRNGOzRHFdtTseNWEK\nZnxI5lbG6+RZ6Y+RJfqLmrnuJOiY3ZgF9zvmWa0iHcxcIBLH0ywi9s65OvbF\nLrqYeAL5GGtm06uogUWEN1ppb9UYr1Y4nMFniCk87X6xhIudRQVtXw1R0nJo\nKTzWbWId2HqwCjdCUPwUdfzyrarCvWT9feXcGZ7jAyqU1zmvZ8+v227SGWQh\nSoKnD1vy77fgVTukRV3v9XZM/rzhJRHPRAYTg67iGfiPLUvNcnP+YONxyoCx\nEWphbOBZL7Tw3qL16vsyO01j7r7qqAu1tXKQ3lzG9vxyPXCdj/O0th5NBeqU\n2ZmseCSPhhC7OkQx7iK+PAHgHJSK9B5BVdQtEHm3H96I3hpfJGd5wbadl9bv\nIBIJ\r\n=atgc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"32cb7422156547821455c282465a53bdc07d0357","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.50","@balena/jellyfish-environment":"3.0.0-use-env-35c18fce3fc89bae2469dfd8e3ea7bf24d00a2ba","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.1.3","dotenv":"^8.2.0","eslint":"^7.22.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.119-test-env-32cb7422156547821455c282465a53bdc07d0357_1615886686812_0.3376483027348345","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.119-test-env-2c62a3091e20c9d697d625ceb65f0a636f845c01":{"name":"@balena/jellyfish-metrics","version":"0.1.119-test-env-2c62a3091e20c9d697d625ceb65f0a636f845c01","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.119-test-env-2c62a3091e20c9d697d625ceb65f0a636f845c01","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4bea91fda629ea9d3e91a49d08f0bf38d5e1d701","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.119-test-env-2c62a3091e20c9d697d625ceb65f0a636f845c01.tgz","fileCount":20,"integrity":"sha512-D6Y4arcc7wYGbwSrKgHQNb/Nf4g847RE/hJrErkEBAxZaf0eM8DpNX9K2ArYp15QbHNmDbxi3n1dto0kUEXm7g==","signatures":[{"sig":"MEYCIQDNinT5GhP6e/zY/ghxo0p1mhMl/99Wov/9Hs3loTCL8QIhAMbPGpLpseVMkn1IShLgYRJQ0VwDnCiIxM1CqnGh/Csn","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121191,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUVmHCRA9TVsSAnZWagAA0oIP+wZz31B0JH3ClTSWU3/s\nOxYY0R4NqBTow+zeVeEbVBDYUElCGtoQpYjrQhdx0EQzwagSTnwWDqNIh/2j\nfQtT2fGY6Sr1m2WtO5/pKd3h1dqmultcpY3A32qzvsejNTyS5/rcNYrL7pOw\nCx4SeuFetbBOLL7GxlIpB1hWBIJjcQjleJDwQ6NGWTu/U/Hnuzn9lJPOln3c\nNtXkvR9kGBgOY2BXyYaEtf5+xnO4CxA+RnXobxmM934hnb2bjUFE+by63PZd\nVvyFkhPsIzZl2PhJUbSlKsKWojcL/vBRksJDdvx9GaSEWbTsfqDqTNYvInj9\nq43AMjp+nydw7YiGi4cMOlZZONSMCCFwjesXeTJhSW5Ypxapu2ONwaUzMgG4\n0cC/QUcKvLciOxt+kxdJhCGEyJokzjozhl/1CHBpq3uZp2NBDGaZJ7A7U+Pl\nBIs4UwhP+UYnbZHnrJrv/yk4VgDIXCMDej6drFpcmuT4LIr8Eb7aBO6cx44w\nSNtGjoQ/PBdJdkV+iqpnALKY3DtVKYRkkahzx44GJkisNZIrFaWpMjcABHNO\n7S9dID5Hb1SipqAWmz44MMq2OAgfgN0drPBSXqk6LNRCDbXg5JOPx+969lrX\nwhesb4zTLBnmmgW0pM+6Nt5TVbWRrUcPZY6RgZtRP53OgHVe96VcnY1DPnTP\nI2S+\r\n=OF7g\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"2c62a3091e20c9d697d625ceb65f0a636f845c01","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.50","@balena/jellyfish-environment":"3.0.0-use-env-b7ed20428860fd0529eee6892dff41c005b8ad10","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.1.3","dotenv":"^8.2.0","eslint":"^7.22.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.119-test-env-2c62a3091e20c9d697d625ceb65f0a636f845c01_1615944070501_0.6946439678839909","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.119-renovate-balena-jellyfish-environment-3-x-e6605a36f40b6304ce1c012f7ff4837eca0191b5":{"name":"@balena/jellyfish-metrics","version":"0.1.119-renovate-balena-jellyfish-environment-3-x-e6605a36f40b6304ce1c012f7ff4837eca0191b5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.119-renovate-balena-jellyfish-environment-3-x-e6605a36f40b6304ce1c012f7ff4837eca0191b5","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1e08da94a82a628ddfcd2192012fa8246443aea0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.119-renovate-balena-jellyfish-environment-3-x-e6605a36f40b6304ce1c012f7ff4837eca0191b5.tgz","fileCount":20,"integrity":"sha512-hPs88fQKz1zgCJIDpmUUm8Y0J6w6AyRsXTgXJi/VlsaUcajPyZye5MqGRdeTvqJh7BmMO0xwFgiiaqBYyGyI/w==","signatures":[{"sig":"MEUCIQCVtDp9fItOVXFg++/xiRwV8dYuAVsoeljUs35HL3EshgIgU4yTezVAKCkdHSU7tYejHr6o2HO/O5Kv8YemTBkOBPw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121122,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUdMfCRA9TVsSAnZWagAAgSgQAJmPLVD+cEqP/pL7ebig\noQwivmcUfmCrcxk8li6nYXLcELHtc6aKhdYOnPteAhnygyRZvmnEyZ1qFmze\n3ufEPxltSVWayjkTXLcsmZAa8AjmPJvh3//sMcERucw37+/8xPO9hsplvgq1\nwSAoEGASZd/C55VB3TH8+0n7XLv5kVuor5NsWGcvGEbSwPhzre49EqmqP1LE\n3usVYiyf2mWJJ5uvaTN13q4bP3amleTe0apXEqS03daada5NiPgCIjG7kb1Q\nk9UxMIbWQuhrP1DxzQfvljduIq3gUJXerewZR/FGk5XHeBDJpPna284VIFBG\nsow4AnOgnexYUc/nPM4C4xCTBhkIu7+vQUQRwdHG/5aP5zLKrm7sfCrjSFJG\nEhfIq2UVDgoglzZXHf9OeIDQljZHj2CSeUkGKV5ZjAKDX2/bNIA2qNpmCXB7\nuibTDjqT0Sf5gu4xrN1eTKO5rXe/SoE0PSeJuGa2J8wxioOHH9DfiRUpJxmK\nSYRqR88JHVL61mJLP5Wo1lDVBe/tBOzc/MOx3IF0tyxDK6b8F3fjuf6sKkcz\nNcelYcj9eFl13LXyGd+vGBG9VhxF9X4IzBUNqRgce4L13TX/UX+tU01FWpOu\nu9//tOS9EfZDouBsjybhcUd8ZMN0WJTi/lhM6sW2Zblt5uTxgzZXWrOk9Hqw\nMQBj\r\n=GTxZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"e6605a36f40b6304ce1c012f7ff4837eca0191b5","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.50","@balena/jellyfish-environment":"^3.0.0","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.1.3","dotenv":"^8.2.0","eslint":"^7.22.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.119-renovate-balena-jellyfish-environment-3-x-e6605a36f40b6304ce1c012f7ff4837eca0191b5_1615975199347_0.13152646634638843","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.119":{"name":"@balena/jellyfish-metrics","version":"0.1.119","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.119","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c0223e86506f3f345e42482df7f5a5da86267ba9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.119.tgz","fileCount":20,"integrity":"sha512-bNgvIv3ZIyfX8jIyPjwKnUvL7DP2Y3q76ICQb1eaon3e96U3lFU5XeYo9H/pfqqlCXLTGgdNeuXQ9rcT81ZjTA==","signatures":[{"sig":"MEQCIBzKK9hWRK3KJjJlJp5sCZYsXDnESFnOT5Z6UgLCKcwyAiB4a+uu8Xwgky5t7pmxyl3tx66jH/LZN5PuFYL0OaUBJQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121039,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUqJGCRA9TVsSAnZWagAAchwP/36MHoVWjtznKb1rLr5w\nv6jLGXCz6pOPfNe5m9u6b3brnTKsaSD+jkGB76jpsCw8GNZbVfAHDvhk4/k+\nWA1iU3VgaYELzU+FrU4LoEW32dzAgXTdB79XlnQSrDnrHR2xje5QGWA9EkPo\nJxWw/DdbNZ5gmEKzJq2hYYXex/ij9y/AUa8ZxE5VfMAkusFf0X2MgBFL85rK\nVoi8osi+7II9uZzVzlqBJEe3DGVkLCgi4aIGsYfwKOlz4P1eIEpbWGyHrz1G\ncVV58ODQ721/kAIuLV0icb9O/42iy54PsI3nMoyDwSDwERk5e49XGWvznQwt\nkD2E39OsoZ5GwutBgQSelcd67kCiR8waFGzfqgyaMnG+HjKsrlGdfZZm3wxX\n2jUYlgvWeHzFpPAl8K4xD1SvMYyymqM46swnGTLUsucHwm/asZU1k4Nhnjwj\n9iNhFo+jADJvYoC0eHg8k2W1ZPbai9gkgFG4+p/hi/eMCq5LIRWjYVxqAAHF\n0InW2auPqH+nxTMiIzxcv7UfG/3THWUQFMLR/ANXyy+zjptYOTSwOXfl+VyE\nZxr9GpsNONGTkRhLrGihV0QZioV2KLTTSWiqJWpllfcud3R3LiVzq9ukUM9X\n08DO3N3cd9W8wTpigKImILKbyNmqASd1V5nCEHbE7mkI3no2uw17dbWQbwoM\nrzTc\r\n=eruD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"2cb4be165d1eb0fd7959616c76233f2951a037d6","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.50","@balena/jellyfish-environment":"^3.0.0","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.1.3","dotenv":"^8.2.0","eslint":"^7.22.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.119_1616028229801_0.708367093080116","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.120-renovate-non-major-ff534e449b4e17cdc339ec6e9c445b80dd29333f":{"name":"@balena/jellyfish-metrics","version":"0.1.120-renovate-non-major-ff534e449b4e17cdc339ec6e9c445b80dd29333f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.120-renovate-non-major-ff534e449b4e17cdc339ec6e9c445b80dd29333f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6030cee6f3c18e2ac0ba3953a27dc5699952656f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.120-renovate-non-major-ff534e449b4e17cdc339ec6e9c445b80dd29333f.tgz","fileCount":20,"integrity":"sha512-A/vIW6Eap/03zPtOu5nTR3ixsRaiqOblQf9H+9iK1wRmUPmk9GkStIx4fjym8jVnQpclw95/LECtgUP06a5MIA==","signatures":[{"sig":"MEUCIQDZZ+RA+euEgZ9wbozcgVIop92buS4xt8LEaKtA4w0iSwIgFVuZClwrxgejR8ZVV3EN/tBGTSPJCT8frqkYZYh13DE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121524,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUtTpCRA9TVsSAnZWagAAG9kQAJlt8Bt7k4wSzY9x89bC\n1I2MjoJTslOtXEk9BXBdHBiACk+HTGclGVgrH8kF5+zsN0qJ/IN6/VB5qS1v\n+CA23eapUOi3iKYnh1luH9x5RkKzyYCjLFroHns35ZIlEqRsWTxO9+2Xs5F/\ndSQ8Y1UBhN1mYYsG2Yl1Rvj3gNT6z8OdQLSrz+DSE6YViCK8lM9MJ3MO68bW\nEao8AgmUr7N9c/joohHKaSu06HoBe3RypX6gCoq36ebCY/HeCrYEhesUGtG8\nnIzM7C2r2mWdjqzFQhNjBvgVamLJN6xniVqq89EgLqvPGzyz/LpzYcnpluVM\nN3qI/4ErmYObXT+izeSeXhvy2jODGMFNvNwL/88rT51EJt0xNRhPqRv+Q2D2\nYxK1zEqLlE6dRHqlUmqH4uRebDW8D5TifCq1NFo8w3fGlRGfHB2+5vew9AvG\nyU9bGmY+a/ADZFKR9S1nYGIw/T+xKgkS8Z38neUYho9sJ3N+PPtAbcmEsNPb\nOyiWG+S9kzqQ1KnMhQ1XJ5aH11Ea6SEa+8FofFe9U1+Aeu8yZPk+rpcHMbNb\nDEu8aFsfSuJswBot8qN7CoOZUrVlRKhipnjynCzR2rCHHURN/Hy5QUBf7tdG\nwtmkfepIrfxsUb687FESVgwIVwKRekkjLP6jaCyshQ8fgGVR8dClb//cVPb2\nCmrR\r\n=2Jr6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"ff534e449b4e17cdc339ec6e9c445b80dd29333f","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.51","@balena/jellyfish-environment":"^3.0.0","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.1.3","dotenv":"^8.2.0","eslint":"^7.22.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.120-renovate-non-major-ff534e449b4e17cdc339ec6e9c445b80dd29333f_1616041193230_0.2514906588301351","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.120-renovate-non-major-21a05d009c3f7c5dd09d02c90a0df7ce1206ad5f":{"name":"@balena/jellyfish-metrics","version":"0.1.120-renovate-non-major-21a05d009c3f7c5dd09d02c90a0df7ce1206ad5f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.120-renovate-non-major-21a05d009c3f7c5dd09d02c90a0df7ce1206ad5f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"43ea4a731cd62344e861b979acaab19725da77f2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.120-renovate-non-major-21a05d009c3f7c5dd09d02c90a0df7ce1206ad5f.tgz","fileCount":20,"integrity":"sha512-eYYYDUv6otAueqUrYStn84zs4sep8RA+6RPXhREgo5kYnz7m0PfeV+51jMzbgblLL/myLKJUOgQsNSbmbFulcg==","signatures":[{"sig":"MEYCIQDgSgzdXsg4ST4/kv+vY6NLq2i/pDIiei8b7OHXolFMnQIhAL50rpyATUnpkMOZSEqLi0HLWhr0ajIPFWnVVTfSISj1","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121524,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUtXyCRA9TVsSAnZWagAAuEIP/A9q3f/etOTLQELUUT53\nv/HriyzyZu0XBjxCK9eudZJZEtBOJj9V21ZfMzb71yJ2HfKjCUxu6stIcVGT\ncbynPDOtV4Fx62tGvriYP3JwCVkHUKPcmT88kcH/B2werT1kJ+4guxXQagUc\nuC3gFfmh20lq5cID6sbimHJbgNjwpagFgGvcNKc+LRphc4IAappJDmkk+A/9\n8tJcdxXCNz8P+ynJ+WFCjo1BCrlnSaE3hlvK1q1Qwd4BDhmZAUXeWFgvQFww\nNqO4ue/vC/q9YLUplrJ6oXiirELzEoCQn2eH5ZdzgCEeo9kf4/aVnpAvIFWT\nWCwYv0nNQzUZ4RsoUkFXa+8v1G9UCsihezDVukJg43iWc8IXi4y4gnSeM7qG\n+2Hlqz9Sw84sDpivbtjRMkZz9R/v6TKrGIj3eza9Uitq30m1gvDRffWr6f6b\nqwSaKSL9iy6C918sWG7AEYsviQZS9JaciICwVaR2RKhI6/x48EWPhvFRFZt/\noMuLYFt/D3X5JTxoC+vqlxZsqMJbuLi7KjRrkBpnywQPH3bJehIBobh53Vmo\n6Vb7V1+Ggy2F5dPM1CHa4Du+0Bd6AJ6nzMDeO/6RBifDqhe+EeoLncxFJ0FE\nTTgKV6VOkxU+y4UDYCkRkIfypUJbRR4472gXYCdInrvWBtcFxg2EJ/6BHpf+\nVxkN\r\n=87So\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"21a05d009c3f7c5dd09d02c90a0df7ce1206ad5f","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.52","@balena/jellyfish-environment":"^3.0.0","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.1.3","dotenv":"^8.2.0","eslint":"^7.22.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.120-renovate-non-major-21a05d009c3f7c5dd09d02c90a0df7ce1206ad5f_1616041457994_0.3955373130774309","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.120":{"name":"@balena/jellyfish-metrics","version":"0.1.120","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.120","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"66a02dd9d48f738815113c6977224fe6bb446106","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.120.tgz","fileCount":20,"integrity":"sha512-faEU09M4Q3PBPBagiynsGQ/PVuhXFIgKZYGozqOWvqQmPV7NI3KES4fMkBgNY0wX3CZpBAQC4pobuqCQ/a/Oqw==","signatures":[{"sig":"MEQCICxRLSobGk8rQ9QyDiyc5ZypkJfQG+UBlxQv8+YdGK4wAiBKaVGPEldIZpyAVzh/uaHZp/N3XDDWdljxyz+GNSR//w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121464,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUtaeCRA9TVsSAnZWagAAfecP/1XgFNF7Jl5GB3rpjs6n\njaEJ15bwED/Spn2/yEM/wIMs9T8ZlRmr0ErQcXYgtocsq63vKfvSpCmA89/U\nfEzTkWNcd1oJP4zhWLBRHLPaSSegRI9R5+muMJ9ahEUNBVIpdNzFklIT7Z9j\nRft0JDyMP0V3teKCoyE3Me8X6mMQlNlt0B7qMPHJzsw/NjEFnh+4TJxIUBBl\noIeM11jdhN9NjSSsfOYV0zMVBRGe+uq+HZ9YxbhMjR1UU6TdEvQSg0n4e4BB\nHcYsMU0PfM4dpPsSY2WyGYH4AMoC2rDEsflPFPcCM1YsTHQyWzMw1fSXEl57\n7sFCdowVCjzzRyL8+rP3bI3i4M6oHmMSTvKMk/b8Su0ARaxx8+sowl2O1aZb\n0gFppvuYKhWFaAPOOnuA1bJwVqkiY7lkTyixFxyWzj+svyeKzAUYB78kKdU9\ncV8Km30g4//X30h/cGqH4UVKoK5317y30XKwnwZu6lmBNSR0SGucOOT9kQKg\n7Z2u25t82J6SVfTbZwhyD0E8xgK9q7en2lmZwohmFQQ5swLMyOXPjTQagBj4\nf/ji5hveAU0UowgYl4fN/637ErRduV3QytZ1rrwOe2s9U8y5IA+Te2filylf\nNlQW2/Vvnh05PDH3VGROX4Uwu4CSXLQWscM/PkeVTveBKaLS4/vCrQEgih4i\nrJFn\r\n=2WWK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"2ed2d1be071da659189c8275ae828ed47b7c16c6","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.52","@balena/jellyfish-environment":"^3.0.0","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.1.3","dotenv":"^8.2.0","eslint":"^7.22.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.120_1616041630256_0.37873670879014054","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.121-renovate-non-major-b24dda3ec744d90ec02f506a6b0b5144c99e4140":{"name":"@balena/jellyfish-metrics","version":"0.1.121-renovate-non-major-b24dda3ec744d90ec02f506a6b0b5144c99e4140","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.121-renovate-non-major-b24dda3ec744d90ec02f506a6b0b5144c99e4140","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ea0326efe36104c05ebbaaa12a5d7edc18d6ee6b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.121-renovate-non-major-b24dda3ec744d90ec02f506a6b0b5144c99e4140.tgz","fileCount":20,"integrity":"sha512-/GDtsy2piXExyGHqAVGawEvBOP56dAlPeNXT0yC9IYJK3DfJpbv+mnFAjcyr82otgez/el105E+QPnvdGgXxng==","signatures":[{"sig":"MEUCIGY+LI0sXE8Jeso7AAo/34PVME7Q0CPIcfdiWqASJHtvAiEAtmkDIy67TIeFvkxtaxWC6Xdt3PwLv9mfC1hUBkICkCg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121949,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgVRRLCRA9TVsSAnZWagAAYoQQAIMiTYrbEzMutikmn2az\nosbuNcrGOt68IHfXu2qnSqqOQ88aeHjuTQVvu8OGHtL3RWU0oQIK6iA5nSyn\nO+kKsPlF28C0EU1/J+h0yuPrElmJyiOmo+SlDwjus+BZp84C4ca78m0zO90J\n9gXR9Oyg34+II9I5D+JN4bSuwpOVPcKt+pPHZyEYfyd9Kb8KirvCezdTgrTX\nTzJp0/5wk+rOLPZCwvaCu8OyjvtiuVS7LNbVid8OtFqaPkjP/LMH9pC29ZyE\nXbs5kOz7OeWhcQDBtFvcrPtrUyGBOmsW+4XNMjV9U7UrbzsKPbiw4vjfTewr\n9nRlDe2WXhEktYtbPwvpTmw4Tvyx0kt6Gw6l6976HHazrGlbSRqUQtXFv0gV\nbmTBG4dAJ8SSfkMM66FHwlUdqJ3tBF83h1Gqpc7uQtVUwVZr5s1bSDOkZ40o\nSgE+b6FZLsv/SxovwSBuyIykVYEImEhB58lpIGfqM1ifloTAA+bxKyGgm8ba\nC5yGcrBYhVqmBmpwLiUDp86RR639K1dYJUC2TclvLw4agHYgH0nmBC4E/F4B\nDrJjY1nzZnR678sMToEHTG54WgK9Z1LicT7Enta8rxdHTPyMs0fo0SfHHxR+\n20TOOfvV0E4lL3a2lvXos9e+iuyh10Z2vN6Yy1rdgL7OoZxyfYkRF09q3BnT\n7Yll\r\n=Dcbt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"b24dda3ec744d90ec02f506a6b0b5144c99e4140","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.53","@balena/jellyfish-environment":"^3.0.0","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.1.3","dotenv":"^8.2.0","eslint":"^7.22.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.121-renovate-non-major-b24dda3ec744d90ec02f506a6b0b5144c99e4140_1616188490736_0.08324623837764422","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.121":{"name":"@balena/jellyfish-metrics","version":"0.1.121","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.121","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"89cc0b74c078fda9ac785b82a338071e6a3cca45","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.121.tgz","fileCount":20,"integrity":"sha512-nH1EWQyyvR2qP8ZcTnpENm5x91MOn6umhiXAENYsAVqwyk5LsU8u6YPR7UD9SgvXKhkFZTppco/Mhsq6e5COog==","signatures":[{"sig":"MEYCIQCo0F5ERIEci5jbHATHuc2yDzBh6a3Mr2dwv70hJXbxswIhAIVasqzQmv3OzA+FhC1MMAamvDJ4LdnzELzlYUCEmDne","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121889,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgVRT9CRA9TVsSAnZWagAAe54QAKTM9Vg1ZW+iBrrIb0bl\nQOsXCYlJBsp/YnvhRsG2L6WPpYYYQR3t8+IDDDOJRv8tDjLQUOVtawWXP7rh\nsRAEkiGnHHh8EQ/yhdGBjNHZt9cW6DRXMRbBNKIuTKqOcZhAzfckgpyDfMXi\nh4eN2t3QepJ38FUoo31ERNJlvX+NbmbojpsssIVVwNfZ+W04ocjCym36KQm0\ndcaBLEM4X0+Y1stBslGh7BbmXaWH+7HY6w0UB9w4kmQY7R5vKtf9hWB67oRR\nFDhGeGHlK/rNEAosk8oPLcXu3rzFBP8RpHfvifHMn1J9oqjgtHdPfRMM/8dk\n5A3RUC+kjdl3kcfjkCwHnJ9IfGkvko9KIoS5/WbFs+epuJWhRKnNocY0+3eX\n3JqihdQsIesJ1pN+/kq3R2Lar7nSS7G6OFh3XK0SoQtWB38IAkedir1sFk/K\nSUAO1fcqSIRDOFJGaiB6mpe3WO8yiiwTarkfyZxo2ZBRLZT0mHX+xuYDdVFq\nwXqZK6ri7t7H43M31BjK5Wsnka4J3R3T5v1AQubcMLyD8R/KWzGUYqBaT99S\nYli3Plt1jlCG7yrEkmx5ilPHoNV4aCCc4LlY7lM1IfNqWpoaXvFHiuW+nlXe\n0XtK5z3N+5OQncLZT+ER0ZjdBydBGRvWvAI1I39NXuNUKebqZ6L33+SvEuhq\nSgRK\r\n=ZFb7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"3a67d5ab3913d90b2a8dad2d8531b00535eb72c8","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.53","@balena/jellyfish-environment":"^3.0.0","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.1.3","dotenv":"^8.2.0","eslint":"^7.22.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.121_1616188669241_0.9956957759693805","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.122-use-typescript-logger-1a1ba306909460f84f65d5de17ec85e2e5fcbdb5":{"name":"@balena/jellyfish-metrics","version":"0.1.122-use-typescript-logger-1a1ba306909460f84f65d5de17ec85e2e5fcbdb5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.122-use-typescript-logger-1a1ba306909460f84f65d5de17ec85e2e5fcbdb5","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c1223daa97ecbe403a33f4f292a521d74ad5f6a0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.122-use-typescript-logger-1a1ba306909460f84f65d5de17ec85e2e5fcbdb5.tgz","fileCount":20,"integrity":"sha512-I3ZIbiomUQuUrDPHn3mQw5ZPFdos+PDGNBRL8j9NYPEMJoSxkjCtXgTNuIBzcZdioCFTPlW/evDkspLkr+0HeQ==","signatures":[{"sig":"MEQCIH6Xz9Ax2b0uEacERwp0o4Hf1h4iV0ebO657ywmge6eCAiBj6/PartfoARaakWrPBODfbJnuUkwUcgLn559Hq6b4MA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":122515,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgVcYYCRA9TVsSAnZWagAAE2kP/iC7eShrY9eT4nj8X+77\n1QxlOOcUUH5WbfezZlkYRMHcI6K63RA6FaYQ9nw/X2oFsvlIecxOq9dTWNvC\nvFT8AhtBFXiN9uUKlFdsZgb/z3N+YsDtjLd5y1KsUIGs0BklQtXiHGH2raQ8\nGRVCU/Qpe0wfnuZQx+Qf4PHc65wzjBVCHmkcSrezRHmtAODklehZdKGJj6jd\nCtTWeMq8f1eyMhOpa19VGSr2yLnfjKAIuKcooUh8mVjePD/s7WqTbjyzSbHC\nFUXG2bNf1Aw9m5apjelN0OAfc6Lyy16KFcXTulUuKZE+DbtketQ/h/ETRnRb\nMvdaij5Y1X+1wmpFfUpK/uylEEbtS9Lqan4gaCEmRXBoW6QgOegxXNlb5Zrs\nqAU6JhMtYrngaTdzAUae7pByAudcimrocN+rS/b93++Ssr9dQlcP74b/4qJz\n4OVYK+zAez4a13CFJKoWwkkFQ1yzsR3qeg5HWpRgMdwkG6sBumxQyoEleF+m\nmP5VYd8gAMlTh6ZYDcawwUX3k1wiY9FP9zT0mQ9cpeOP9E9Boiz/C6h5WRxc\n2hQgd6sgAqDrFV1nng4sj/Gyl+W5tOq8TFdFI1uRZLe+M6qYGAJqC8MLq7ri\n09O1py0LYr1L8qPSV1DbIRm/3lsTmpysV3QPRCvXk8vniNXt9IlvliO0twmJ\nvLoV\r\n=6zRK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"1a1ba306909460f84f65d5de17ec85e2e5fcbdb5","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"2.0.0-typescript-d557c401206bc3d80b4734f0864ba7c222bf5e77","@balena/jellyfish-environment":"^3.0.0","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.1.3","dotenv":"^8.2.0","eslint":"^7.22.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.122-use-typescript-logger-1a1ba306909460f84f65d5de17ec85e2e5fcbdb5_1616234008371_0.09625184766688233","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.122-renovate-non-major-221957a343c61b0ee50442908f3d6c06ba4c8823":{"name":"@balena/jellyfish-metrics","version":"0.1.122-renovate-non-major-221957a343c61b0ee50442908f3d6c06ba4c8823","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.122-renovate-non-major-221957a343c61b0ee50442908f3d6c06ba4c8823","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bae3ab7283ef20df87f75becdaa41c3c5bc780d2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.122-renovate-non-major-221957a343c61b0ee50442908f3d6c06ba4c8823.tgz","fileCount":20,"integrity":"sha512-hpKOCHT2YuIX1Ef8RFiqCGdEuf9qT/ZFIf9Q99AaEGGIbjbNCkEhUMfKptMPFKxyl+Yc2JvV7FNYaf9zJlJppQ==","signatures":[{"sig":"MEUCIHz6h/bJ/q1ZyGb/dY6PBLnCS+2/VJj9jZRnsLRgd3kWAiEA8X58uee5X/roe0xyDsW0ZpY6j5OOt9cSI+XKFBo02gI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":122300,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgV7sJCRA9TVsSAnZWagAAV44P+gM+Huz0dP9IdbwDfoi6\n96Og7DfBpN9QmTX7z46fR5T228firYSqg2+TCJqmMCoId8ag90XJ8AlYBmUT\nhKJ/rGx09SPUPg5FFyZSYQNP5BJaJrQzXVVtvaE8D2CAZyyQXwT/zAciiTnP\nuU44qdVeODNUpix5py+IjfZCoYB8JoibgqpS4RAD/YMxlCeZFx5Nz0Qpcq0p\nMpiP6UFEXYosr5ojTg/VQTO5MguofEeiw0KxprbGHtBxmvwDMeMHpV8MVpE6\nXS8QuA6prUdI5cnBI3RU5dahWp75B7FTnNsmYDoACgo6Z5BI8YlhsaLhdMcS\nVdRYYVeVN3In6WcE286xkG3F3AvIQrDkwR/2ZPA/31Fx68NXucuQjo+zgl84\ne0yKlhZ3EIjUDTEB+DwVziffTasmGUfRE35QRNgajQIPmT5aYSwr25Nk1b0G\nS6IizXxjBzzk+OC25DNHMqHg5uBKWVPrX31geh2CoAEYbMrHJnkpbCBh8+NO\nJ7BVOXi/CltFvV/IFsckW6yd9YucWig5UlsoSxhPnamlkdDj/pCpitB36wVB\ntFah0ELtalJP4dQo7lH7SLNZ6A9DBHUONji3LQo6qidJfj0nORnPbGqpxBtJ\n+VjR5aaDYaUD38B5OXF7rmBf4xliV89VLirCDT1k0lB1UlwQ6NsoxRXohUdy\nGM3o\r\n=GIwr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"221957a343c61b0ee50442908f3d6c06ba4c8823","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.54","@balena/jellyfish-environment":"^3.0.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.2.0","dotenv":"^8.2.0","eslint":"^7.22.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.122-renovate-non-major-221957a343c61b0ee50442908f3d6c06ba4c8823_1616362249258_0.9831147925438215","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.122":{"name":"@balena/jellyfish-metrics","version":"0.1.122","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.122","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0e31c112ed094a05bef96660e3a295f3fab10953","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.122.tgz","fileCount":20,"integrity":"sha512-7wwlSQs9pkgyDsj2XWeaEeg+rIdgUiNTkdzm3Jqwyc/Q89dP7WS/ljky38v59sLruwqEiGhuHmTdrnKOOVfj6w==","signatures":[{"sig":"MEYCIQD/+YRoJ80mKSqUtUmhlNzy6NkOo1ZyOu8oLFpSFfAeJwIhAKHUeuJdE1V0oZpAeP7WcCsXGsTJXWdsG6zvzcSxpFwX","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":122240,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgV7u2CRA9TVsSAnZWagAA6f0P/RaENrzdMUO7x4nwJmR0\noZG7vad1Pjd8EkoFG+YGQ8GyTE4QzVDmtyncXY/su253EwSFX6xLYqKDX71A\n0QU7RzJox5RfWAj7NGjrXbxZWBSv1CA5yTqeSBFMc00zmn5uL72s8gWOXFdW\nkst8ntt0QWRH4DfDTnT+4R6XqG+G31GNjiYDVL1rYdClYagzV+uZayFqsvDs\najKTjZoUeRcf8IilZR3OROTh3V8EusTlmI2dZ/L03bVySqCFrRTO4YoCmy1p\nIcn9BS6z882MmIMu4rfp+ao3E8ZpWfxSMuyJCxbU6CeD7vrLqCXsf2YuTDaD\nLJqaii73YkRE1KQHQP+0mtoaQICn8npW2yAGi90hASt013n94UpULjZVMSX/\nH5rqQcKQC9HENwFgTJ/gxhWputuWzI+enW+E0SHpuOQ29dig3fGMWYzJ0Kgp\nXz0rhTDXLxYZLvMv6nP/t/NzajCMbR7pGAjwSJ+xhoDH1BfZ4NEYXMmg0GUM\nwtCb1OpCC9k7b1oMg4T/KU0j2l25cEWZlHD+mzyNQEskq6y3wKRoMqDN+rq4\nHoU2dbV4NGViYDSooZN4SL3xecGorLOMo5n9OCE8qxAbFKsXZeURmqWFFL2h\n3KLVUDSLR7QCJkrlbV82+OoeJNwtgeD8vxhmQa/33ML/GGM2od1oq8l61Iv3\nOBl1\r\n=lcji\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"be3465c6bea1c7bcb7b836fa9bdba158661b6799","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.54","@balena/jellyfish-environment":"^3.0.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.2.0","dotenv":"^8.2.0","eslint":"^7.22.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.122_1616362422141_0.2673122299180284","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.123-renovate-non-major-013ed93a77d4418bf7826230127b734b97741175":{"name":"@balena/jellyfish-metrics","version":"0.1.123-renovate-non-major-013ed93a77d4418bf7826230127b734b97741175","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.123-renovate-non-major-013ed93a77d4418bf7826230127b734b97741175","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ee44657bb025fc153806c37f971127713b703cd6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.123-renovate-non-major-013ed93a77d4418bf7826230127b734b97741175.tgz","fileCount":20,"integrity":"sha512-b0WcB+aaK/K/ja2aqzIpg1dBwcc9PqB0blm9BfJckxSnpX8blxXcsAjxxXgXKWP7irjj//7bB5w5J231mLQkhw==","signatures":[{"sig":"MEUCIHnqn8Iv4lAYwNH0BJ2q9hXdhOOc9owPpzc/v8Bveu7xAiEA2GymQ9B2Z4/jUut/rVkBOEREPjX+Xx0rzuCQre3K1eU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":122725,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgV9wRCRA9TVsSAnZWagAAg60P/3GdLoaOcH3jrf2Pi5OO\n+OdKZuiD95Wwe5eEOi6pOKa50lxYb6g6Cd5qtfbcLloizt2P1JbtfS/s/sIV\nzbzqnMJZDEGO2IvT3BLUykiR60xYFtlzyuFsh0w5L09bhzlYaoOsb3S5i3vJ\ncQeUfv1KP7yWEipn1Yg/qm9s/g5PWCq+CWb/DE3Qghcw1SED+CFzCjDB1SiB\nB6pFcPbdPJgP9O/pVVvPLfhzkZPm2XI95wEWtnByW6c3CcYf2+Xaz3b1MKxO\nwnafBws4OVpe0TUD0c37iggo3rqcDeVuaumZvJMKBfN14ew+wk+yuohNxVUw\ntno9QP5gM4GHzud2qMsmr5fjlm9Mbh/64uae8VFb3CS+qEhJNzIzNnpquomk\no09ZCBJvXzY5RlJEpjxj8cKjHXuK/aQ+AwWtEa9DHx3kVFYNi1gKE+xAnujR\nAB7bOtm9y/3YttZeEOlesGz5L04OON5fHkEj0bzSTUh0QV5ZuUV25SqMbSPn\nW+9T3LVNpmJk2gvujQc7v/ZD94QPjk6pIHl3yUQxS4WJWHp3OAXwJSu3lIy/\n6mZ1JnQWUpqbfUtljnptKWmbNqereFQ0Dt743PgsRV16K/kwLIw/Zq2E3i4q\njYGEPXU0Gxq1Ig3jkFDJ6+zt/VOFw18SCP9hJyu+ZKt7n84SNn9OCNH48lUS\naT6Q\r\n=mW5b\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"013ed93a77d4418bf7826230127b734b97741175","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.55","@balena/jellyfish-environment":"^3.0.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.2.0","dotenv":"^8.2.0","eslint":"^7.22.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.123-renovate-non-major-013ed93a77d4418bf7826230127b734b97741175_1616370705111_0.21843873315911044","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.123":{"name":"@balena/jellyfish-metrics","version":"0.1.123","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.123","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cb56f19efbe6447afd297913229fb23f81a9cc0a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.123.tgz","fileCount":20,"integrity":"sha512-mkj2msTcP1/G7tNvRCHoYbVH5Mjb6aXBV0rMHLlQp6QH7G0/OMgP8B7OteosSqFQpemr+vz7zJtmvFtwUZfv5A==","signatures":[{"sig":"MEUCIQDLcIH+QCzwT/r7e0CEn42+oLPbpAa8QcuAv4eBMVQqhgIgFJ8Kcys1P2wXqoE1+3cdgfVHQxrt3i//G6zOCBiQlVo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":122665,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgV9zhCRA9TVsSAnZWagAA98IQAKT9K1NH+/OUIuSKDYe/\nsgL8d9u/W2BycVSxDEz0nF3egdotEIr9j9C6OcmDPwP6292/ec8VdlyQ3ZFH\nYOktjr8IISlzIsBWjYLngRvtPMvYG/qJQI4FUboJ2HqgoJaY1IMKTI+kxmBr\nNJzx478eWbowfFroGrg4Ws36o+BN4rsvToBrvdaNcN49B5hZjkxDzGiFn+3c\n/OzR5qHO9OMQreBh0aAWvu37evlOldRC4/2BJ+6fTlQRHje8te4qBU+BDhQr\ny7vnlnXF2ZJYtcASlwpJMtmOeLz6mpgtxjpsjagwLdhZhkq2z+JlYIIi4oXz\nGy/W82svUJru924kmdczwMCZpbOUwkBs8y4lm1zVBf98WkVNkeiI6QNAeQ8n\nrAjLfq07j38JY98AgThn6HAACAhMLB6VU1Ui8QUyYRaMD1+u5QfBKUoRL2dX\njlhXQObMfeN/WhzowKyFgU2Qzhny4Lfrb+jjIkpBvR45FRmZj7VloxGNk5kk\nmDOn8mV0cz5c37J6VNpNgMl8N65ts/XTAbfCRZ1uo7C6xPDEBpF31oUSYF7J\nrODtdLvGa8vfGeSXxLFOkeRUXvp3v6+hvFaqtEvtlrFXeZdrpsvA+GZNemDa\n0NWn9W4U1B2e98eWJd/eX5bshymS2RqBUwsGQM9OaKZkcfemJdW0xVQmtgRa\nxhoy\r\n=z0h0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"a5343c00fbf198ab3f8352da451dc41ed9bb253e","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.55","@balena/jellyfish-environment":"^3.0.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.2.0","dotenv":"^8.2.0","eslint":"^7.22.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.123_1616370913012_0.1614435324669392","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.124-renovate-non-major-ab83c009411894e11fee2cd529fca1f5efc9ba97":{"name":"@balena/jellyfish-metrics","version":"0.1.124-renovate-non-major-ab83c009411894e11fee2cd529fca1f5efc9ba97","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.124-renovate-non-major-ab83c009411894e11fee2cd529fca1f5efc9ba97","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cdc75f1dafa6fa7ca6b2aaa6acd4c936f0218c6a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.124-renovate-non-major-ab83c009411894e11fee2cd529fca1f5efc9ba97.tgz","fileCount":20,"integrity":"sha512-dZrQSYfNtlXfGqevGfG9ZBbTZHr8vDrrLQPWyCZIx+LWTv1mjmFNL8I9BiS8+w6Q7EVq3eGE65yZTJPsnVB3/A==","signatures":[{"sig":"MEUCIQCY6HjA/tDT8XxZj6xPtjgNS92GB0JegRG2qGXLAKGXMQIgEp2xSH6dhCdoJktRIGmRo6QS18QwRZNxzGGNVfwfLAI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":123150,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWGD8CRA9TVsSAnZWagAAGrYQAIJRzvtdP6ObQatP6FKB\nVmRFrGBofUOUToob1/xoYrTSbpAHN3+GDFR/iLdF1I7nJNTcg19pKFZRgoG+\ncDh/01drW+WAryb9PEGgAWADZP9R9rJnn9HtDLmeDVQkGcQQoCjIFc2hHL7o\ndQoNigALse9WBaxTIWGuoP7SWlHe3FrrnEbjWwrVy4FtV2Qz4avK8MNkZ+P2\nKG17BW4lE9ecJZ5fPLTvMCj7bzWINKPfcxxWrM36U8P1/IgKzX1cWkqfrVnz\nDWlhUrsbcQrnz92mkZwH3sqixRceKXlwp5HzZ+dkVLfIO3egy/Go4xJ4DoaW\nFqN/BVKJKX/HjQJgInrlRs5/pn4NmZqnLY45X1kMQXsFxdRkG/m5/1LKC3mT\nG1fPPcwMI6NGUbnbi68udY0b8vBdxCTYbIhgLbz7Nn8MwqliCoZ9OdjnD6Xk\n0TCEnH3ne3F4bvYRUNw8Hfk0Hd7Wrta38s9osHb63b9sinMLjoljbKPQ8mVZ\n0Gw31ikMR7NZcfF5J7N5S4Bl2ltpX0gpyYdZ7dxsqunMH63JiKm7+UP/KnGg\ny8Q0brEZoaft3nB179tpGLjMP1rxXiFDuklCZ0q43+ZbjMG5mP48dd6cdiI/\nEv4Z4mt3rv1tu3tdkXEpzNEP5yjzOSm37rfnEH5Drzvx8U07yM7T6h83b7ye\nZA5Z\r\n=oH38\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"ab83c009411894e11fee2cd529fca1f5efc9ba97","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.56","@balena/jellyfish-environment":"^3.0.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.2.0","dotenv":"^8.2.0","eslint":"^7.22.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.124-renovate-non-major-ab83c009411894e11fee2cd529fca1f5efc9ba97_1616404732052_0.5958809133715743","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.124":{"name":"@balena/jellyfish-metrics","version":"0.1.124","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.124","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"dd14c6818ef4b47fddf55a7ca22e0a796820fc11","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.124.tgz","fileCount":20,"integrity":"sha512-aJ+4b7/4u0/e9LQnz4QaGpW8kmC5yQX6UlM8NH7S6p01FLzgfjEKK6pk+O1+FmBfWQDua/R8dpYyaP/xnAAVnQ==","signatures":[{"sig":"MEUCIQCEgyVZoV859Gi0Hb6TokIc49lpgAQAoMY2pW4R9+kbJAIgdbszfuOwxZ1U+ucpOstzZZRCe0p7dPspb7vHQHWETEs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":123090,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWGHLCRA9TVsSAnZWagAA4zIP/3xPhjGlIvMRiatxm/F0\n+snRFYk0NgbnMwv8n1fqJCp4xm3GSceH10KFskuU1PwYJzPWk0ND9XuT7cMO\nmuibLFl0tIZBwxV4z7/T/t969JrSuYWD+C5JlsbI7jR/q3TK3ICiGeF92gvg\ni1P5anvoSJe7gkKXhHDKWJL9W5mFAl5ljv8enBL/71fuh5EXIIrulX2e3d7d\nxHfVXWoXOaN+QZUw3fNl9UwtLyXKtMsB3WAoxFMov6ohK3eJA3WQpGVvlMcL\ncYyN1uLcdGSGatg4MEdKKU07am49VvRV4mWlDikJg4HxMDqQ8v5zuBK4vufC\nLm138pxQ8XSVhMo912wBnfuyq1/n1CW7lyOgaUcsS9oJAY1UaVPCYr6MVdld\nQliySqMyNHNJxqCLu54zrbA7MsucAvHwoDsKfIeRUOg/7+oap4EbvBOx0Q41\nxmb+fC2fDxvlSRWxRPaFRXfJUaywMjS3MIZyQFbOCvaDFw02sehHmucKCsCL\nCjSDA7Dz0k+HgpZ/B8AGBR8tImJnkX01pECRQLkmGN0gF4c+X4KyBNyj2g/0\nBQ1thDFy7jLxq1GvrA26s+W7ZA5cKfN23pmaX9A3bJFQVclbhl9jDwSbGaJq\nKKD6SsrR9T1oS0dImG396ip4o1V1+yTtJDfCldw8qvVBmzKVJsA2Oi3ydi/S\nuFi2\r\n=DYk9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"890b33329f6e808ae4955dfb4f33f7c36144e276","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.56","@balena/jellyfish-environment":"^3.0.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.2.0","dotenv":"^8.2.0","eslint":"^7.22.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.124_1616404938629_0.9455847927528014","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.125-renovate-non-major-056be838b3086fc23e25edb9e1cd38797bd2aa2d":{"name":"@balena/jellyfish-metrics","version":"0.1.125-renovate-non-major-056be838b3086fc23e25edb9e1cd38797bd2aa2d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.125-renovate-non-major-056be838b3086fc23e25edb9e1cd38797bd2aa2d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ca096d82aa719b7808ba572f5259097e1f9d318a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.125-renovate-non-major-056be838b3086fc23e25edb9e1cd38797bd2aa2d.tgz","fileCount":20,"integrity":"sha512-HQHrU8RMlLHr1ZFdq82mRwwkXXi8jNLN8DOL6qLN5iUS4eAN6935AQVMp/LVXGGL3nM4jDHqEln2R5XQfr2GQw==","signatures":[{"sig":"MEUCIQDPqgYXXQld3NLPLxMMdtCxgmGHR1Mpr4rrNJHZ3vtiKAIgaRXZkeypYBXf3ETWEwHfO9VaPh/Ev8fWKJT3C/fkR3s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":123575,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWJm4CRA9TVsSAnZWagAAFBAP/AtuQMVjFA2EExgHFV55\nOocf34ENaneKKRlZrgxuSMMtd5kCkukroyN8Uv15m5eo5Q2PrBiLudZddnKe\n8r2sj9Qr7eQP0srOzgDTJZg5+Jf/7S3cne9yYSifi1zmcI8o+8Tl9qiZ3qwa\nV+Z/zIug+JrMXybbufNTHkuW1SuC0BFFpome70HWLHikgcJOyazFU8cQGOZ/\nTshQEe4VtC6SRLPY8gpPAy5VfgEUp2fkeJAlefnCqnQVUk+0JtofpNG5bZmo\nvv4wdf+wGTpevAbjIOOF6t0SILSnvx3mXOPksK3cGtnZyLyiyQh2I6mD2H3Q\nejutCNBrYsO+QIly2Kwi+kcwALtNpbJJlO2q/2LNe1KcDdpVVZw63YqJLGOq\nyB7XRREejjDoKvGcGM29Bi7j+z43fAe2xKI0+Epi60GYppQwWkK42MAfLUVO\n9Qd0ANGkHCOJjy9yl8gbRGM1Q65soAGlVnNqNAevc+F+XWg2NE59/XGYdQdH\n7xQJZp/ugEmbSu8jZ65hjiXM+2Rj91Xttpj4M+SW9lqOzzlNGtXAMizyBNS2\n2IcQAv5XJGpi95nYF/ZsavyUcEWoVz2EwMAutXJfLhJHrsvk//SlOs+bYJTt\nwvrKQzCwaSr4soldvTjAL0PzrlQOIu9K5mJgQQi4E2a21FxDoVbWzn5X/uch\n4DrM\r\n=uaie\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"056be838b3086fc23e25edb9e1cd38797bd2aa2d","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.57","@balena/jellyfish-environment":"^3.0.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.2.0","dotenv":"^8.2.0","eslint":"^7.22.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.125-renovate-non-major-056be838b3086fc23e25edb9e1cd38797bd2aa2d_1616419256380_0.18559869541802132","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.125":{"name":"@balena/jellyfish-metrics","version":"0.1.125","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.125","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"be835014241901ee62994ea131d8c86f5a7ed50d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.125.tgz","fileCount":20,"integrity":"sha512-mWCgCxo1fDPUbkx/zf6tyj3/dR5onWljhWdnTtEqMwg+lxwKY2UbaP8VSaj4BEdKYYrPIAgILc7ODAJp7ml/oA==","signatures":[{"sig":"MEUCIBXLid7aTVA0RJO+V8ja7K4JBBLNGbNfivLvyTXIyOloAiEAjr2E9zEyZ4T4uJx6Taw8/ESR6SHkU/C5piHbwb7ctwQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":123515,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWJpxCRA9TVsSAnZWagAAx5MP/2hjxfmY1FcHLbGXTK+T\nXMfdr5F0cNLfBvOJlnL9HrINldEzNVKi6i1rrMq3rtDTi1YkkblAmRJMSlQU\nrexVSdevSrQ8ETnD/tGm9AIKMhxCzgAeGuN1ThDxUbnLCMpYbc+RZmEl+erL\n+iA3pvjEkyPOHbQWurroflWlf4H7wu37jK8jOeS6hnRhgqot9OHtjVC03X6+\niKaYKlkgZU/elweV6T+Aojv/nBfKONwwnjK221bpkO3gUa1vUv6BeJ+TgzbJ\nqGIaQYSo51BJMI6Lyv9vVtxjOL5YlAlmGN4JtwbthVqe1tPqL6QF6VGn0AeR\n8woMOBtLjVrmwdhQOYIwhkPkc/jNbSb2AS6wgdukxIe+sH7Lp7BkSwUzg4xJ\nOshbhrdlDIffrkVW0+KbFwuuxkuuwYOjDL94KnHYRMzrr6TPx1m2SkbKr8F6\nKWur/LwRSLtqzKM9dfLkuPj8joj4JN1HuMdEyJdEbdLJzowsZUjvM8bjmMHO\n8rRIpXiwXA4z91SuR+fRaTJfqJFdCQblxkE+Su2Q/TcBEi675b3XbmIrkzBA\nweM1UabewCIw/1kzl1isQ3/fnD+Qfjz7dnAzHhz+bxZ3IqpOcrWOHROwJi9I\nFJNkAkl6gvO8kN4+sdRLcTa9gr17nyYhlgk68WJvc8loSqkaHsV7Qbvs6mXu\nggyn\r\n=Cy1r\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"d2cbbb98e2fac818ebdeb629dd6ef19650883a71","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.57","@balena/jellyfish-environment":"^3.0.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.15.0","husky":"^5.2.0","dotenv":"^8.2.0","eslint":"^7.22.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.125_1616419441404_0.8455745628970088","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.126-renovate-balena-jellyfish-logger-2-x-32383ac13c82551c7b47dd84d42a37eba341abc8":{"name":"@balena/jellyfish-metrics","version":"0.1.126-renovate-balena-jellyfish-logger-2-x-32383ac13c82551c7b47dd84d42a37eba341abc8","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.126-renovate-balena-jellyfish-logger-2-x-32383ac13c82551c7b47dd84d42a37eba341abc8","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6f514b4dcb3cfe9f8dfff5a1cc59d22e3b8781b0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.126-renovate-balena-jellyfish-logger-2-x-32383ac13c82551c7b47dd84d42a37eba341abc8.tgz","fileCount":20,"integrity":"sha512-RbuQwVHgy2Ix3mL0Ccf6kJVi3sRkHdfxDm7wKo7E9Xh0Tobl2QlhTAwJr7O8MKLn6/4lkVW7t30QN+YL3dcLXw==","signatures":[{"sig":"MEYCIQCgsFgg9EemNiMlxwtwVMcw+squLjjgGoc0GU8oJFVRxwIhALNbZf8MmBK4fKCB4+ZR1YBxqm15Ne3rUKWQeXBWfhwI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":124007,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWNw4CRA9TVsSAnZWagAAROkP/02lmp/suWex6ez3kuC1\njG4z45XmfcNAwJtx43KFuirnHqy8ZwHYQLf/pZ4CPG7CZJ8h2i/UPBIwX++2\n10K3brPfiOL/jGViIuiJYWFa9tdwZif73JRwRf47BJwz5AOCJfdSOGoOW383\nueovBF8Igqzg3N6xB45tgxycUU1AuOSQkshrQsm5UnmFPsqWnknfjB8TRW9a\nXHYrJBzxLKtafQTfryO7xo/l7qjjnn0wmMbriVHpDE1+S9gDLr17tcg1LlnN\ntmYDreDj5QnxhtQSbVWYILhTFW9U3sLfLQNfoxRtOTLeR/pBy2qAQy7cWta2\ndE8xY++uGVXbiDgxEIo6V+FEXLqBKjjz+z2f5cQm9SE5/zlQdhH/P0NfqzlO\ntXGkYHN2qmDeoJecTUiatfbIB8L/WRdW/xhcW1VinAkpMlCk8gZWoSPiYUeh\n808dN/Na2Q38qe0FvQyRpIUhkKHEZKTnyTDfMdKb7cUNqPMWhqq7PAe/G4ka\naueMNA+jim8DM2AwloumAoPiYgbQ6H5aR+mQuTHvOWmsBL8epa2jSyifnE77\nZBJ6suQI8iy3DXwTIAzS6LtkxhvX8rUGOtzx4Oy8zgX7WpjuRLIodV4Ivb5j\n/ERrBM2h0vOqjyfuaFvkvCjfG8400nUvScqKrXSuu4+zXQDq+qeDaHPOCdOC\n2iqG\r\n=S+QF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"32383ac13c82551c7b47dd84d42a37eba341abc8","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^2.0.1","@balena/jellyfish-environment":"^3.0.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.2.0","dotenv":"^8.2.0","eslint":"^7.22.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.126-renovate-balena-jellyfish-logger-2-x-32383ac13c82551c7b47dd84d42a37eba341abc8_1616436279454_0.011213653350755859","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.126-renovate-balena-jellyfish-environment-4-x-2728396e9d625d1676f080165d4aeecf7164baad":{"name":"@balena/jellyfish-metrics","version":"0.1.126-renovate-balena-jellyfish-environment-4-x-2728396e9d625d1676f080165d4aeecf7164baad","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.126-renovate-balena-jellyfish-environment-4-x-2728396e9d625d1676f080165d4aeecf7164baad","maintainers":[{"name":"somombo","email":"somo@mombo.solutions"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2a7f832f1c95c9c5994c34de849fc71f8109769d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.126-renovate-balena-jellyfish-environment-4-x-2728396e9d625d1676f080165d4aeecf7164baad.tgz","fileCount":20,"integrity":"sha512-KpOfu304s0CqmTQiPkdlGzLBu74QiUhZmMy/ONvmCQYFeke/2L1WBDbDQzvtypcw+S5Z8RkBYkv2A9HtPUsE/A==","signatures":[{"sig":"MEYCIQCx2Tlp5lvizupWbS+iPQlRGI0h+S1WNclMXWypM/ct/gIhAM8CI+2F32+dQr6gvMfUJ7GUA5BMUg/Mnr1X+AnAH8Wa","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":124023,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWUivCRA9TVsSAnZWagAAb1wP/Rhb+J8Tu8J+qu6oq41J\nUhE2o5JS7oOExCER0KRL3tHtkFvx1cJjj/KWh7Ugisl/C0qjjSYp32RDcomo\nwNNLf2ukEno1bsrDIkkG8Voul0YQUQaGJVDrjeiGRZT2JF6jIlpEwRgLhvR4\nwwt5QN0szF0oYCvPaybKtfjE//EzOJrQ+27k/5jO1Q0q6e6AJSCfKn9BITx3\nQ4XAo2erFrTHV43ow5Y7vs2lWyY9SC9MrIn24TWIgJ34mY2DFwConHVG+tsT\nm3BGfSfvhlTIHPlzh6NEAHAepBsuLB6mRJX16NXCDMTnemNBVvxY9bNQmEHa\nCd7r3OMGzTh8ArUeE6D9AIxlqtvY1f1JM6yQuq49Z9EiW60lJwFJAH8SpV02\nPhbnpA9e2ZESrE6gTT7uwBorxE+vd7kgAkIF/9Phq0gxqYX3lLvsWQostNRk\nrT6Le3QxfcSw2eqs8WGVJrhGrNTaZSHdgWtQYVnp61VCmoP7hS5qsmdkq83M\nJXiFLQzklP8Xe3yws2srJOzPjJ+5MSoy5/JOJN0nexwT1ZQtO0PZsxP8dLWW\nINZ18HN4OC9Ud3ZaZhMUxhTdBfEfB1we1jAXGz/jil3MUwhvNJlsRbDXxCPa\nFCBjHODMibb6g41Denv0z+10l1jZgDaZRAAFdhUhNpPK+6lO9JqqWWB1tuL6\nzkHL\r\n=3CUw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"2728396e9d625d1676f080165d4aeecf7164baad","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^1.0.57","@balena/jellyfish-environment":"^4.0.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.2.0","dotenv":"^8.2.0","eslint":"^7.22.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.126-renovate-balena-jellyfish-environment-4-x-2728396e9d625d1676f080165d4aeecf7164baad_1616464046953_0.6903814222813158","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.126-renovate-balena-jellyfish-logger-2-x-8530eed84ba956ccb3d7590a08ef594bd687363a":{"name":"@balena/jellyfish-metrics","version":"0.1.126-renovate-balena-jellyfish-logger-2-x-8530eed84ba956ccb3d7590a08ef594bd687363a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.126-renovate-balena-jellyfish-logger-2-x-8530eed84ba956ccb3d7590a08ef594bd687363a","maintainers":[{"name":"somombo","email":"somo@mombo.solutions"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a015d3d412fba1acc88e7fe4a232da0c90becefb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.126-renovate-balena-jellyfish-logger-2-x-8530eed84ba956ccb3d7590a08ef594bd687363a.tgz","fileCount":20,"integrity":"sha512-4FAHGEEBlK2hIJZJnz55YOxTa7MnUL2StJkqPxcjsV54bb4TYL4m/+KgsIaxdJ97cMf1r4ZGnLg8KwiAjyck3A==","signatures":[{"sig":"MEQCIHHyWBtUYjo+zzCE/ALepUECyMv86xrhCU9UBDCdS4o/AiAOoUXzRxpfwvi1j2n3kXd7arI5z3N6GXWQWfuKlFla7w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":124007,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWWrBCRA9TVsSAnZWagAAIIkP/iKn3N0jZIvMqkr3TKvd\n2rEKS+nKYEww1xcPNLyP5oMxJvF6FBdTzwwEbfW9GQIStGi6hOyyTxVMVSLq\nkMCJxCPItO30a7f087y7ZuF9pXcFNyiZ4NonYJ/kt5cmYC9zztx0WxWjMaXy\npHyHJhqgIW3YidUGZ8/Uq+hWT0uiwQRYGe8NEM5D1iGhEBQVINhiv7/bZ48Y\n9PI1Uvnz5gunewvxWLnNLS4G9aBG8kBQwA30BDVBjz3hxHxYQaZURCiw9tpv\nm4wr0ErmWaNAw1tF/52VuNJwvEoPk4+qyG27uaur8zl6xYiICSDUqjzVLda+\nuaUk7qagwk9ju4lKQjcBjUXCFUeDItK+pAGCNBFjl0i631f0Xlkruc5582Ds\nYxCCKTRHcwiQyoICpEJKf7kwBLI7T7Hpjtp2zq8dqoYCJOwFVFy4QJCFMvFw\nTa024Tsqp+OxmVHbSajIzapf/kHopDAA43xZbTiG4rsEZH0k9XgSivHbDIgd\nVtiAPIPUntVNsaFIr3GjYok+2r+Bk+7Zk9Q6Lr49w86oFkuBCp/3BoSeD/b9\nm9pNWZwANOHJ91KiW/26BQh+Lzg1/EZhhCgqZwH2IfMzxZjJ3MGS0exjSYMf\nuHcwHupWk0jS+VBadigJhFzZ84FRyiW8MAJz1qDAMNFhPluQzeFCrNvV6FWr\nDamv\r\n=PVnI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"8530eed84ba956ccb3d7590a08ef594bd687363a","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^2.0.2","@balena/jellyfish-environment":"^3.0.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.2.0","dotenv":"^8.2.0","eslint":"^7.22.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.126-renovate-balena-jellyfish-logger-2-x-8530eed84ba956ccb3d7590a08ef594bd687363a_1616472768431_0.37467008130850066","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.0-to-typescript-12fd305cac38611260db9bf4d6dc87f289bfdc8b":{"name":"@balena/jellyfish-metrics","version":"1.0.0-to-typescript-12fd305cac38611260db9bf4d6dc87f289bfdc8b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.0-to-typescript-12fd305cac38611260db9bf4d6dc87f289bfdc8b","maintainers":[{"name":"somombo","email":"somo@mombo.solutions"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a722f64acc2d0ce04b8f465657f891092ff0767a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.0-to-typescript-12fd305cac38611260db9bf4d6dc87f289bfdc8b.tgz","fileCount":21,"integrity":"sha512-lBhT4mEf0O8L+nlU4gYVrS5tnK4UgOgD1WwndYGl7ZkBMUkLAjLcXkH/L16gXlCICwe/Dauc0yQ3t8rvMTHhqA==","signatures":[{"sig":"MEUCIDhtk6mznejDfNo4Th8yrT5oAZBrXvlN8euIy9Oz16lYAiEAx7HQ53rjfF0S5vIkXUNtJfueNGRwFoKL2UYNS9I3PGw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144203,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWbeACRA9TVsSAnZWagAAf80P/14Y+CtQH77D6+h3fQyY\nK2wX/p9+A0XfHL7wzw3W2foRWyvSYdgbee5heNMZNDFHQUBTWMoYl98eOqPd\nPTbo9kfliB40vTjZEcZ1kVhmu2mPwbAmMaciLU2fNo9lv/QSMuZkdfNzfDvL\n3usW+qhyVc5auYM88oCZt89KKv2uk0WARaRwHNgdVZsKWyVQPdr/Vtz6rosJ\nFwdhaVoPXAcFoBlf1wMVbnzsiK/OeAmaFEKTzidCBSv7RT2JHIc4wL4RU2ls\nU1h8MKO0BFhOF63K+Ixnq6Z/o1hGKnfH/LdSIyk6rSczYDjNQDm1ZEEUYrGN\n7pADCuUcIxu9iKl+is2oYzUUom08RcddG2PJ7VolSzSVqMKhPO2A2DzhjYCZ\nhYGcf1GXf5hSFrAICoSFdi7QTktz2hskESAu3adn73a1iVsdJdurSxdelww7\nRIWI+henE0EQtYCLuYJQGDNKZdAtcI2YAc0sCyv8x4TQ1/y8BSl6Xrf+/t2Z\ntxO/CYIEc+GjfbZg/ku+7a/WshUnGOWymud1b2bYgWUu2Qc6UcQGRc+Sn3kE\nOO6kHBs6ozp1pIaQ7Wwfp/lUaAUpwTh6H6wYSjYbXP/daqaLluxAyida2D2i\nwabO9Qa3CaC1WeogomvalDqZO5dQWW0G2SEUEPidP/yEO5go9CFalKdKQYVW\nmZq7\r\n=c2KN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"12fd305cac38611260db9bf4d6dc87f289bfdc8b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --typescript --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.1.0","@balena/jellyfish-logger":"^2.0.2","@balena/jellyfish-environment":"^4.0.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","husky":"^5.2.0","dotenv":"^8.2.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.33","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.21","@types/node":"^14.14.35","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1","@balena/jellyfish-uuid":"^1.0.74"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.0-to-typescript-12fd305cac38611260db9bf4d6dc87f289bfdc8b_1616492416101_0.2220310973602848","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.0-to-typescript-a9e076dd46ee536e4febccddde8719d20e5e3610":{"name":"@balena/jellyfish-metrics","version":"1.0.0-to-typescript-a9e076dd46ee536e4febccddde8719d20e5e3610","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.0-to-typescript-a9e076dd46ee536e4febccddde8719d20e5e3610","maintainers":[{"name":"somombo","email":"somo@mombo.solutions"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"25e4e29be1ee7fc03ea4f0375122aae8319d4422","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.0-to-typescript-a9e076dd46ee536e4febccddde8719d20e5e3610.tgz","fileCount":21,"integrity":"sha512-qdwxiAqyU2Hfex9Yu34iG4jgMLLRvwRgOLin5JpbqOKjKMSv1ZZHBNg0kyFXMI9oj3XZ863j/MGLCjCyqOlfaQ==","signatures":[{"sig":"MEYCIQD+rfSJ5iYoLDb/gtlczRkQA4oZWgaDy5tmUW0x0QtFCQIhAN75WchxNuANC1ZTGm9GviwBD7MlCKoKo4R28dU01f1N","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144085,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWblwCRA9TVsSAnZWagAArlgP/0eDimU/TvIVcg8ya4rr\nJKfOKYsj9iGVK/yGLv/fmDH+N90MY/riQFqrrBXwOIzQwpXjOitXtRCNarXk\nfY/pRiGXF3M+Mm8adqD2SAHrUMQeA6W57fYtXEBc0xaaMSHcge61NMcE2mO/\n6A4F8GIDkigVkbQwLbtZIMdWes6BD9rmNjNPHk75bcGAxjQ+bcEYAqp0VQsX\nU3CqX6jjBkDMdrnL4VI7jQA3GUExMtQnEuoN6P2TvBohSSZ/j5kQfNtM63a4\nU2Nd3UOEWcYN6L+qB2H045I/jjsOnZ0PhqXFyFrUsd3/oT2uKCdUhXf8vexr\ny8H40Y0KEfX8hJw1+FH+0f6FVHNfVrpDdzBtIlvZpnGZxSLjQ8PF4i1EW7AA\nYVPUgusKwKonu64/0Nl0pMCYf8B3ROMSdgFbGqQPJWnuYYRjaXNOphbU3HyK\nOAO549rxpiQ+6o1+c2J8OEfodOO98XAXRNIz3jKGjB/N5ztMMH6w1BSiViCT\n+oNFU9W/f9el8rOpshaqDWxS9288BG4iHQGadpoEpvNRJezE1WfR/YsOfs/y\nTIxPi6umPCkjtDMcB7o07zFmhtwDfix6VVhf6Ni+5Pqqz/YBOKwR7nWhNMUt\nyM1smY21tE12hF6C3miIQMHXXFIa0xUm6rGU3/Mu+9tEmrVxH6N5h7zuCnyM\nJRz/\r\n=SznZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a9e076dd46ee536e4febccddde8719d20e5e3610","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --typescript --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.1.0","@balena/jellyfish-logger":"^2.0.2","@balena/jellyfish-environment":"^4.0.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","husky":"^5.2.0","dotenv":"^8.2.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.33","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.21","@types/node":"^14.14.35","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1","@balena/jellyfish-uuid":"^1.0.74"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.0-to-typescript-a9e076dd46ee536e4febccddde8719d20e5e3610_1616492911579_0.5165277501594108","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.0-to-typescript-c0f64dab781a9c449e4ea61c933e1b12f882621a":{"name":"@balena/jellyfish-metrics","version":"1.0.0-to-typescript-c0f64dab781a9c449e4ea61c933e1b12f882621a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.0-to-typescript-c0f64dab781a9c449e4ea61c933e1b12f882621a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"72ef912f5300870be10b903d3eb5bbaf94e228bb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.0-to-typescript-c0f64dab781a9c449e4ea61c933e1b12f882621a.tgz","fileCount":21,"integrity":"sha512-2DZZ71uj4fOnLD+IAYS6qIGPRY6kusXz46f9C/iT1xjB0Vv9e44/M7NGk0l327k/SO7Uxh4URER8VWCmej/rUA==","signatures":[{"sig":"MEQCIHHBxG4+KbuA4u/bGaNTDtf5DquPpTFBJaYZ8efed4SMAiBcAOHX2KaUoIdBmoHcsPQdjJyXG8ybZb7opkUsQ9sIhw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144061,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWnA6CRA9TVsSAnZWagAAnKUP/icd+117A1rXEKSOs+qD\nfBUPYGJIsXCF/VJKQlSMBEENk/gLxQmSz5dQg6to92Hlg1rr6FKCzjs4e74V\nMnQSmA9rNR0dlkVRZmgWA7Q7RBQgfiodhNSlEqAyUS9jGorHGnTT/tjWMwVC\nYBbNOWqmEYNfFtqSUiVEI85DYbIo2oFw0IsVf1v8hYqSC8tpXXbMJ8bICyav\n7ZcHdZEwYuKuS21saowRRnoko5bRsgZugBDuogwOgnpUxe8WehadMH2hjE28\n+g+XueEVFHXYOev2TPwa24oeVoxniMahbdEYrfxnKz0RJbwGM6P9Et0elFIi\nEq6aSjp6grUe/5EDLJ75EGHFCGwZeHBAS19mgMvwa2jnpVtnp6ewJtHbizMi\n5uOQXqtkSJi5eb6fTv3gPEPHkWxh3QIUtzYlESq5tTS7qB7Al42rHD7kVH61\n/WHVUeDidVSOu2rX9edzBXO9DnEonvSMagIyvqQ8FkFTW3Og+Qk1K2mSopQd\nxcADIanVOJpQSfAe3N9SN+KWubnYizCFSvFRu4S7LmgAoZQJTSxErxHJbGbg\nErllldhoqPYMC9tVXGkYSfgHduXUq6QoICXwbuBU0WdLkTeqWKiZvxBLkiU3\nPdHa+Zj0LsbfmBRTTr+q0+3ZPumyVyj4mnQVQ8Y+70Dgxyl3HUN0sO5DfU6n\nVqUx\r\n=I8aY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c0f64dab781a9c449e4ea61c933e1b12f882621a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --typescript --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.1.0","@balena/jellyfish-logger":"^2.0.2","@balena/jellyfish-environment":"^4.0.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","husky":"^5.2.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.33","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.21","@types/node":"^14.14.35","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1","@balena/jellyfish-uuid":"^1.0.74"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.0-to-typescript-c0f64dab781a9c449e4ea61c933e1b12f882621a_1616539705993_0.3401619480406355","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.0-to-typescript-3478c8bd491db1055aece936b9ef529a8d5af2ad":{"name":"@balena/jellyfish-metrics","version":"1.0.0-to-typescript-3478c8bd491db1055aece936b9ef529a8d5af2ad","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.0-to-typescript-3478c8bd491db1055aece936b9ef529a8d5af2ad","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b788afcbe3ace3d7b1c5237af623ead106498ac6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.0-to-typescript-3478c8bd491db1055aece936b9ef529a8d5af2ad.tgz","fileCount":21,"integrity":"sha512-l/g1qDc6KP42PkHmfG6XuStsUE2RazfWesFSr5cK2Th2uACBzY7vKByKBKFyb4Sg8je2CON5e6DwDOGS1udLQw==","signatures":[{"sig":"MEUCIQDcBGBT55ZAA3WMi/10953e2Z10l8tz19Pw9BNUM8V9BwIgIaO69Pto106Fi7eSxveWbhwsTu+Wz8TlsqMU69clhi0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":146964,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWpW8CRA9TVsSAnZWagAARDMP/jO6zzN1bbX11d0lGgjP\nZbavcZh39jg7fIMRlYaaGbljy6dYZoYSqTC5qgUrtCLCWDZxG6UI8zXOmxgr\nTr+KxTv0x1XrENTftxOARt3g1EiY/6mtyOx+O9uUGcbRHar0HSgUctKy62y1\naVuZx/1qE5G7CJc7pC/j2Cs3cWV+keItFzVEa3WoDfahvN3RK4wNLYXAEkP9\nc31qWWjIboh41T2zvvSeQwFtNB3kxxNoJQBlsiAvpVp+gL+HU++XTQJyROj7\n7nl1899FTnrsQJYdlxOp02/ymJLIx6Z1BS49SVrWhQpJNtV+sW9ZKC9qguUw\nMJZ/EeQcu6Bb37iID6yOeTp7ovl3/l1TCIJL8NVwontKLORBV//Jju33GQpm\nHPWablApfJPG23DUviUa3/fXLW295LlrRiu9R4mcf3bBNCIkOAkEG9p4N3Kp\nHEFiK0isekzEgl7D3n2XxyUqITyoLbM7J7JbcaNerYVR3xOudQvnY0xJyHWb\n46LMh7SgN1QEHXvMOLPWuFaQ8GIEFpDcLZrQ3z1ChNRqo1V4X0xzWPbOhh3Q\nZA+uOBUMeKjo7M81IvkZcZi3kv+3O1pM9S1lew4Bb+HhAyhDJVk79h3vk+lB\nMo9lXhey/2ekfmBUU0aNvPIveMjEbBNufxfyJBKCM6Vxtrib4te6np4A3QPT\nrYhz\r\n=06cj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3478c8bd491db1055aece936b9ef529a8d5af2ad","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --typescript --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.1.0","@balena/jellyfish-logger":"^2.0.2","@balena/jellyfish-environment":"^4.0.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","husky":"^5.2.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.33","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.21","@types/node":"^14.14.35","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1","@balena/jellyfish-uuid":"^1.0.74"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.0-to-typescript-3478c8bd491db1055aece936b9ef529a8d5af2ad_1616549308169_0.7211633832630058","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.0-to-typescript-161c694be90db14a18441a014cb080aa4892101d":{"name":"@balena/jellyfish-metrics","version":"1.0.0-to-typescript-161c694be90db14a18441a014cb080aa4892101d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.0-to-typescript-161c694be90db14a18441a014cb080aa4892101d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3454f4f9849ff3e196e2bce831ce4064748231a3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.0-to-typescript-161c694be90db14a18441a014cb080aa4892101d.tgz","fileCount":21,"integrity":"sha512-WgIgHdff3hmtVmNwFGDQyt8vX+hlGO9eCnZQ3y/zAMZUa+NdczGfrVtlKF7TMjS6EYmYl5ciO2oRN4OOlOofwA==","signatures":[{"sig":"MEYCIQDasm802qe69+R62g+F6np3hvNCJ8bW5eJ0kASGMS0Z+QIhAKrIk7DOWGYVdPH9jmtdcxpAw75c1jP+MC0SG0AREqhQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":147501,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWpb+CRA9TVsSAnZWagAAoegP/3XN9HrTJUyYI8xneFht\nwBEemrpFBSKlDmX6X52+jJUInnajLfbHDBQuO+ZXQtzT16Qygq7+rs6MLo8j\nqbI7K6czz7aZX2o3Ce6vIuU/IFmUejIBNMSl4ve6NuYGP4JXzdlBKnt8Oefs\nTcumOyFbLPY+NwH+rge3/wl21JKM7gKRtWB+5jK/fm5oOvYt/7C1SiuJjacP\n21wfmFjQGZjeB1Zh6dlxYcmIJw71LzceD3mfUAl9knvVn+Kc+B5hHKhg+s7q\ngmQmYa+7Lkk6lPT7+1LFIrX66qnnw0r0HoyKF6ObvNfNQcjHfPzi0F8MfVg7\nCeZXn8C0bxb55oztJ7XG/i52BJuTTdvVoFzwF/HVtZfTmhBaV95P4C7afHjt\nZjYlSuHtrFqELFAEPgqfiRBz8V+0TBgouv0hQeb5v7WwqJeHNtlM19Uj16ta\n6zeaDbQYf7SHLZ25/wzxRh0a6BcEUoRppP9QnwJkNwkzRHstAoH3/EnNX/gw\nNGcKex8HWKVNuG9NijicAuDRutsTr8c7dd1FV7QHzF0OdxfqJRycuqfsHs1K\nvTDVJfAkZ5XGqXOItmKLbmQsT5kkaJl9fAFfb94R16tFQicx2Q/sZCARTqaA\nFFBBnm+5dqFIlwxUsoT3qiu1bmb2q1j5kTmMaWcbF+J3Yx3U3MoaHShFTCT+\ny+1w\r\n=X2W/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"161c694be90db14a18441a014cb080aa4892101d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --typescript --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.1.0","@balena/jellyfish-logger":"^2.0.2","@balena/jellyfish-environment":"^4.0.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","husky":"^5.2.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.33","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.21","@types/node":"^14.14.35","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1","@balena/jellyfish-uuid":"^1.0.74"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.0-to-typescript-161c694be90db14a18441a014cb080aa4892101d_1616549629675_0.9461480247230016","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.126-renovate-balena-jellyfish-logger-2-x-7c8262a78b42416140ad64f5debb229f568fd62f":{"name":"@balena/jellyfish-metrics","version":"0.1.126-renovate-balena-jellyfish-logger-2-x-7c8262a78b42416140ad64f5debb229f568fd62f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.126-renovate-balena-jellyfish-logger-2-x-7c8262a78b42416140ad64f5debb229f568fd62f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bfabcbaa806facde1f82325159f3e7de61610b51","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.126-renovate-balena-jellyfish-logger-2-x-7c8262a78b42416140ad64f5debb229f568fd62f.tgz","fileCount":20,"integrity":"sha512-Qa7lyZFWulQI/+IewGZjmuwc3sVGJsPXLB4NcNzy6POOIUUYC2vMCJm4xWFOKYkidjUwkyWAWaYD9QrguXNQEw==","signatures":[{"sig":"MEQCIF/SwZb3jYTRauBtGRNu1w2SRlqsOySeG+dCxe+y0vRVAiBf2Yix8eJfdOJ5HlZ6PF3xq1XcfJ7wBi0zs86FfeBI8w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":124007,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWrZpCRA9TVsSAnZWagAAlKUP/RW7vzPm5hPwQhlzyhbN\nHXWTZ3A+9cLISHr6QyEQbi2CDQ8EitZYHmiHc0Qb0bh0AXfJ2EGd64F++tvM\nEXccmCawYsg00hyoigOXLCQN+nhcJfZ6+w6VIm+jArjqIGqlRAEAE8tqS20r\njdCQngtbJ/XgkUlXuxwp67DKfoE0113zgp3iXSHqHd08dvU/cSvprpth1iQQ\nQGHXTw6BtJHsxxcpNe5l3kxXn67NDgXPi/dSH7CuLVbtHdrvdljuV3bTY+pi\nW5XjvuwJvz10XnKWZNJEqiBNAmE3Fa23ovVyueZxtIlk2Vtpy7dfsOCYyP75\nAw+ikRRmGrxW96tbwvf/uMH5cVoOX2gcIZ07ktDTxSFbaH83nbtC2iwoxeon\nUW7m+g7W8S+gW/bIUNuwatpiyUew+0jPdhtyrlZRdjG3T1ZnnYoWh6A8DXH2\n7FxcnyY+HRMHNLLxax7WenHoieS7J/zKrf4Q0GmGJrhk9yOsehMoCjtpJA9B\nZVvvZ33Fa6GLnGczsDbPd8ux/fQai94i2SMA+POd/rNRu0pjn6ZEq3UPR130\nVdx7KLY738vGg437M4j7kSDN5Imo3X9TP0rXtw7ZcNPPRRABMqc40oD1Y7n7\nb/qAIu3krhGg0Af4R0ukdw79VggDSsMiDD0zIj29ZThYaYpNByqM/YmT7BZ2\ndGEk\r\n=pVmF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"7c8262a78b42416140ad64f5debb229f568fd62f","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^2.1.0","@balena/jellyfish-environment":"^3.0.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.2.0","dotenv":"^8.2.0","eslint":"^7.22.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.126-renovate-balena-jellyfish-logger-2-x-7c8262a78b42416140ad64f5debb229f568fd62f_1616557672543_0.09472628195368005","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.126-renovate-balena-jellyfish-logger-2-x-73786c6b02df1fc032f24b8cf043aaabf992054b":{"name":"@balena/jellyfish-metrics","version":"0.1.126-renovate-balena-jellyfish-logger-2-x-73786c6b02df1fc032f24b8cf043aaabf992054b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.126-renovate-balena-jellyfish-logger-2-x-73786c6b02df1fc032f24b8cf043aaabf992054b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"80cc32024e2c0c12cb9903d07221de79659b454c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.126-renovate-balena-jellyfish-logger-2-x-73786c6b02df1fc032f24b8cf043aaabf992054b.tgz","fileCount":20,"integrity":"sha512-Lr0No7VMMdSr7ReApaGsbECOu9SJsGfRYV7qWeTwpNXOnPKT0QnRpFjtV/J87jegtkzSIJ4VSzrIb7UJRIxs8g==","signatures":[{"sig":"MEUCIQCfqeYC3kGsENbPydB0zx05+mLgAEzJFid0sn+1CRFibgIgNjGk5GxPHAwkNNVuQQzizWV77zI94QnluZMs1bGBO0M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":124007,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWrdxCRA9TVsSAnZWagAADXMP/27oM8OdAda3LQfczXfC\njaoBwTR7hAgBlcpwb0CBXHSjy4U7UgkSu7W1QyUjTjHFWxYsVpeivJ4l4lpd\npw8t4506/ZSJq41goHPuqV/DxiRR8Kri9FgLmPCdT0i6DGY1bN5Cc1IWGj9D\n6dw5n9dGKUT3a50RPLrWIzDXm5yprJSXTkyDkxyHr9sBtqb67OBgT1B4fwL2\n0LSWbF0u+gf8ByNqhdtaa3xaChduB5Uhy0MQlzSvmDc84ihF9T3agSXWldFW\nUsHbugROt6YZAwtgT32Pc5fFC/hKJN0jimCg2hzePozTRYYloqbUzLktAZ5x\nYSwbi2Hz2hIQZ6ocNwkzMlRRAXY7xlwt+/sqEiCO+wXrTmLprc19JPVimmgJ\nza7SZNRjiIXWL8A1Zy2JjhLNXCrwH+zO/sHgK7YtTm9Lwn8m1oUDuwPGJjay\n8M12ZWfdkKqna4Zh6ZUAhmaCYOAVCVRn3A6TfkVpoRtM8DQLmoODH2dquBUR\nTXm4SGUCMi1xMi5N4Ljxpndqwf/4vpoqnlXJfua1TV9Kk6Dr6wblCDbrSFFs\n2zAHY3mBY/HVqw0qoonPPsPLgg2BJHrIR8fD4xFlnyUjlOWn5gZ1mUNmMbBI\nbfxTzbJJpQOmm3RMHXVfnVJHQLr/LCmOA0usDaO9l9+1Nro6EomsQyooFqgM\nRh9G\r\n=6yWi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"73786c6b02df1fc032f24b8cf043aaabf992054b","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^2.1.1","@balena/jellyfish-environment":"^3.0.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.2.0","dotenv":"^8.2.0","eslint":"^7.22.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.126-renovate-balena-jellyfish-logger-2-x-73786c6b02df1fc032f24b8cf043aaabf992054b_1616557936890_0.054794148309234236","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.0-to-typescript-44d4e1555f311ee91803f846fd70aa8842e6c80e":{"name":"@balena/jellyfish-metrics","version":"1.0.0-to-typescript-44d4e1555f311ee91803f846fd70aa8842e6c80e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.0-to-typescript-44d4e1555f311ee91803f846fd70aa8842e6c80e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"62a0ec6914bb860148ee47cb3b9e26eb4aef0d16","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.0-to-typescript-44d4e1555f311ee91803f846fd70aa8842e6c80e.tgz","fileCount":21,"integrity":"sha512-NphxuysbUKd2rEUoAjI6qmujqM++MegbJv7LQF0/5bcYfSEX8ree4bBX5FkKD+VVhxvWySlXLE2IWkRKLxdEug==","signatures":[{"sig":"MEYCIQCtuKfCscAn4bgXYK46ZdMzNzBflcHr7/8s5a16VinqPAIhALjeN98h4dZuiJOgDyG9e8RNp9Wu1qUga+JhL7zB9TcA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":147430,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWr9PCRA9TVsSAnZWagAAfZAP/jD+UvGkX084m+fjDXGR\ny8kLMgq+3f+xaIqkCAcB1TsKdJhGVQDr7X1/2qs2t2hKlJdfc5wxv2/cYTiS\nKKGXs1D6o8mboGPRoq/AOyGHaXEFTSGiodRrc2bGQck1NCtFq2r3q/xkD45r\n8GVA9CqPEurhBLWslW5QKtjCnjuH2+sj3vOsKZ+VmY+GU7wNbNFDBDkAK43g\nxe6w8yvddUuYisQgntOZuVNXmfsyNrriGj6KvLuk1tLBxQjBnDxNDf4G8Vv/\n3Nn2Hh2eol2Agu8qjez8h26qsv3Ty87QWiUKLAwdnLn5zmYgfhIj0cbl/qbU\nZjymRpOy46wLTRdnIdMtn+VxZ8oYHkRcCjdyFYuYypWE0sLXNn45XaaObFGH\nmdUskNKFNyZbOnRJn7M0KJUoZlV0SA48JCEfgOciBt7kD+pvanKUDTv6x/7O\nLxvkuFnbnWqtyYlTCBX5y7V+CfRysqTkTZuuqkboQl9bBZyVJ9NzAljwnf1A\nGLiOd3jTuhxzv47xupCkGsnklqT5pHKufNbQsjO69CIrlrIPqqm9+2dfzlF/\np58kZx+N/ugphCiPwNFZUqs5qrv+Yo3+NeJZ4+LzjJhBkHs48lrwauMptm/d\nylOWRxzXPPxl6O+U22i6cWmqaOT5SKPhHuXvDZgEYw5tvqJYktqeWva+qSUp\nXkYG\r\n=z5Y8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"44d4e1555f311ee91803f846fd70aa8842e6c80e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --typescript --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.1.0","@balena/jellyfish-logger":"^2.0.2","@balena/jellyfish-environment":"^4.0.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.33","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.21","@types/node":"^14.14.35","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.0-to-typescript-44d4e1555f311ee91803f846fd70aa8842e6c80e_1616559950634_0.2811247884017416","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.0-to-typescript-ab7a1c566185eb92ad51f4f72a9f38f3d090cc16":{"name":"@balena/jellyfish-metrics","version":"1.0.0-to-typescript-ab7a1c566185eb92ad51f4f72a9f38f3d090cc16","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.0-to-typescript-ab7a1c566185eb92ad51f4f72a9f38f3d090cc16","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2143a05aa3f87b985b04baf09d27f550b5c76583","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.0-to-typescript-ab7a1c566185eb92ad51f4f72a9f38f3d090cc16.tgz","fileCount":21,"integrity":"sha512-QGq8APFbGDzsuWXFnQ16wOI/EDGLsS6EhpIoLPHrjSeuB5JuAWmqHJBgWcpRQpI/Ugl8oL0ExKI8mWfE1/9cug==","signatures":[{"sig":"MEUCIHrdfJnc49/BMkuo9j3VpOfCmvZe/0JeB2hnar/gds3oAiEA7hWYIaoYKDJwYYFzKpPekDu65VoUux8ToOwr+AW2Hck=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":147430,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWsD4CRA9TVsSAnZWagAAerYP/0ZQkeURyRf/i3uJ7bp9\npBcTpP/tWBbMTuSWydjll3/qfuu7yzfrBJbC06xgg3qodyunirkJfeSSIBLz\nP4aSMZv+BWoWHivUkYDIHS0+m/pwTHcYcqNnQyYMX312+D0FGSMoUANkno06\nSvigNUGWr/+LtY2BtqcFhr0Gp9Wg4oOSsKgWyDclaaEv7EhFQv5F90Rahugt\nDAYqb+O3OAMK4/XIDSAP1JuLqge7U1HkxlDlyhzbC5Tka2M6+hFbSPq950Bv\nDJssSS4/2N86t0U6SeTsuPQjMpLBJGfVAs2+m/TZMKZZk3HKbddoERW31KGg\nhWW2DvnGaLBf2n47MuUz+Q8FRSzBUl1qIwqMTe0KIBFt17MoFzrajulvrUQy\nCtI0LRePTJs3zy/q5bvEVZME2qSJN0aLY6DcgPaCgCq9djbxy0imriIqhqAn\nahmGxJprZ1g/bjL32lsBf+RxUr04EmC8lrTaHOJBvGnrsqsEOjjwVzHOPLSl\neOXDG+n1y/t7gkUhepVvE+/cH6BJsPNpLt4e9qJ0Orkgyr0FS6JdCw2Q8PzD\nSV1KgawazC/+XkZ9AGw1RT5Fr1S1GmmFzqm6NEbKWgndDuzxme/X5M7cUAb8\n/m/9o+Iv24X6a+jQlQ4VA8dL3HT8VCVXppKvo92LzXSKPWaW+LFllfwZm2+n\n/qNc\r\n=XgkR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ab7a1c566185eb92ad51f4f72a9f38f3d090cc16","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --typescript --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.1.0","@balena/jellyfish-logger":"^2.0.2","@balena/jellyfish-environment":"^4.0.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.33","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.21","@types/node":"^14.14.35","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.0-to-typescript-ab7a1c566185eb92ad51f4f72a9f38f3d090cc16_1616560375839_0.4701590430075884","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.0-to-typescript-beb3d10f23a1e8a92c49981a96080b002adf5505":{"name":"@balena/jellyfish-metrics","version":"1.0.0-to-typescript-beb3d10f23a1e8a92c49981a96080b002adf5505","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.0-to-typescript-beb3d10f23a1e8a92c49981a96080b002adf5505","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c9298f0aa5d4f4a28097d3f4083d6dc5e8ca4198","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.0-to-typescript-beb3d10f23a1e8a92c49981a96080b002adf5505.tgz","fileCount":21,"integrity":"sha512-ioUf+6/eiy8Y7l9UrLiAL53Dvjn1MduQ55u5yx75E7nI3WtiGzsOZHvFHaCybLMHvh9OLm0xaqyW++PC8zU8yA==","signatures":[{"sig":"MEUCIFTqR7rH7OmlFwoUbtj9gwx7+IDvr2AP4D5HpKTBqp+CAiEA73Y3tND//jjYdig0hDSFUiP7RYSLy6QH6cNY3quaH4g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":147470,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWsTNCRA9TVsSAnZWagAAj+wP/2jhuzHHoVOR2/YAVbb+\nrYowtsyTJPgMcoxvjjnvitdRExlZrZSFqco6DvJjSFRRexwdIk2qAbA3NITL\n/p5GuQbUHJKnVq9SmcJEmlIIwB0FJM/CRpGAgFQEYswo5XIK58lzrBhDKixw\nIyz+Q5TsiZ/4Zi8JNvk34ObqE5yoezZlS/3HG5kMXub2vc+d9E136LA6ZEa/\nYshO+gPYYpCt+sJh/4s058lXKsY3S0WmuRIWbdhBF3VhsqgLJH6+4MPObQFA\n8XLQOMGXHWZyvCrDp2RnP3Zlt0S2gHRhdUFSCjhssAp5V1yQIUtTl5x8y/Sf\nG8FgVXvdawlbLdz24LOaLl4lLXJgkK6RnbkcU4XbKnlhABNK4Q9r4vTySCBN\nhpMmpyZVeYQ9uL3FH8xgyNNerxv4EvJ/SM1yvz8QVKwJ2Jc8pdWOU7ziZR8j\nhCTmeF5oVda91VH1th6WqrPVNQ+tXEV3oq7TuMSvm9fGRets2aUH46al3AS3\nTirW16uFwEm4AXQKPtSKcZ1dIq1XkFeUGiVu4q+6TBUCkkSgiM4SNf1fvp/x\nYL9yqDF+AiTukCFjEmpLbpM/mFhJT/9fmarP5aek2Hrk8hXRnjsjlYYKsi2e\n/II2dqLgdpKzXPAhBtcXA3M7GGirRtqgyCWvKh88x3YzPnnDa9/QFWRIkdgR\nnm46\r\n=CRuc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"beb3d10f23a1e8a92c49981a96080b002adf5505","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --typescript --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.1.0","@balena/jellyfish-logger":"^2.0.2","@balena/jellyfish-environment":"^4.0.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.33","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.21","@types/node":"^14.14.35","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.0-to-typescript-beb3d10f23a1e8a92c49981a96080b002adf5505_1616561356947_0.949560664887485","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"0.1.126-renovate-balena-jellyfish-logger-2-x-1c33eaba4d56c96279242d51c30f91d331594184":{"name":"@balena/jellyfish-metrics","version":"0.1.126-renovate-balena-jellyfish-logger-2-x-1c33eaba4d56c96279242d51c30f91d331594184","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@0.1.126-renovate-balena-jellyfish-logger-2-x-1c33eaba4d56c96279242d51c30f91d331594184","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4f07594dc9f2319b07855cb6931883ed27fb7ef8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-0.1.126-renovate-balena-jellyfish-logger-2-x-1c33eaba4d56c96279242d51c30f91d331594184.tgz","fileCount":20,"integrity":"sha512-MzUHg0uc+29qcV4vVcW9CSNRO0IggewFY7t0tnP3p27aVP8Hs/HGEwzHs3P/+R5YDOHRKjmuSciaqCe1pb0nsQ==","signatures":[{"sig":"MEYCIQCARAf4wJxRq5u+Aa8w3Ws7ncdPjgDcUBbeDElKbFR2RwIhAOybYwWHPIfVLpGNIR/43fZwqITUS7B0Si94wPpQ66Su","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":124007,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWtrZCRA9TVsSAnZWagAAzN0P/2Cpls8n7QQ8a2MdCLqE\nj0tYIR2krZaalsmLQwz+grB3mJE29EenFbmRR3DHPTcWXRVeUdYAapKM1ZhL\n/MLOOfA08qWoKQWCbyCMUiL2oY/WQblXGBGtWQWbDIDU5M1Y8CGqd+Z2bZOW\nGduq4LjFnB8atGtd9eqUFk58hZH4WbBhI0l7uKYXj0ahQmXCV2aJ7gEsxi7u\n9LehTmDuc54WxN9sN4wHquTuTUmjwY3j4OZ8Q3G+QPpTDAWVr1iZEvC5+VOq\nAEQvqsS8uq496HEia4gz2i88TYOyQvfbP5+WxgKeZFtxUIo71pLnMxFeporM\nliWpdzb5QZomBkXq0lZRpKcXYBM51Enypu878ArDymlKR5yj7YDh5ALu1HP7\ngM1ZStecM++f5mOj4YFTgP4dl50NcHxXkGO2GmObeG5qI1KsnuddSxgLQeVk\nN7WfFNsVAgTNJoeAOZesJWN+B1kNQgBD0CgpD0zxsosm/rxk9flpPBPhRvT2\nHwPIje5K1VsmXzZ6Ob2oumzEt6hRLCIZm1V0TsDTyZAVXABwPW9DHy+17mJS\nW4P3OgFb7etfZGBkt2i7P+q1sRZUa23EoSZ45yYjBADgHt4ZE3FWPqAlnkyn\nOSULaLPd/tb9HyAb1Zx/SzXqWZ/5OZmZdt5M2og4Iauzuk3ZvKgyEfcbI7tw\nCxs9\r\n=MDCG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{js}"],"modules":["lib"]},"engines":{"node":">=14.2.0"},"gitHead":"1c33eaba4d56c96279242d51c30f91d331594184","scripts":{"doc":"jsdoc2md --template doc/README.hbs lib/index.js > README.md","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && make lint && make test","postinstall":"if [ -z \"$CI\" ] && [ -d \".git\" ]; then husky install; fi"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.js":["eslint --cache --fix","npm run doc","git add README.md"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^2.1.4","@balena/jellyfish-environment":"^3.0.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"^3.15.0","husky":"^5.2.0","dotenv":"^8.2.0","eslint":"^7.22.0","deplint":"^1.1.3","depcheck":"^1.4.0","lint-staged":"^10.5.4","catch-uncommitted":"^1.6.2","jsdoc-to-markdown":"^7.0.0","@balena/jellycheck":"^0.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-jsdoc":"^32.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-lodash":"^7.2.0","eslint-plugin-promise":"^4.3.1","eslint-config-standard":"^16.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_0.1.126-renovate-balena-jellyfish-logger-2-x-1c33eaba4d56c96279242d51c30f91d331594184_1616567000903_0.901800835467989","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.0":{"name":"@balena/jellyfish-metrics","version":"1.0.0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.0","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9a8096cad389fa1b0ae902145b7f5d50fc84ddbf","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.0.tgz","fileCount":21,"integrity":"sha512-7aAkRQFBm4jTTfP7oHk4sczo7w/fG2OhFfr/tCS8d/Q7nXSBa6IhG83D715SIkUwky1bB8RCmrvZlDwcDe1NDg==","signatures":[{"sig":"MEYCIQCDbjdtkd764WEBtvJuAo6iYVYOvBZkea3iqGx6bzl5LQIhAIv42Y70piIZUJ3M8wjbU/sCvgUzJGWhDlIy1/T6Lgnb","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":147415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWvirCRA9TVsSAnZWagAARyMP+QHnVw6DRzIqMwxPKHuO\nCI45bQbNNHFV6KIOZTX6K87Ziyg2FZwlD3lgZkRdHsuthTt0XNjeYsPaJHV6\n2Q2JffICMo7QyFBYkSWsHijUH5I9fTsubF0q5a6NAKScYMCFr14sWFXOlGZZ\nVxII1ZwD8gq0IaAIssD/ERp2bjMm1l9ZY+Rov3TB/kM+Mh86uYxSQ7eCL2Qx\nucgsARehPMdsVrn5oziW9JAwKJxAdbhUNCid+jzMSLiWZFYaZe+L4+TzIgTg\nj1j455SB5Wzqjk3vjeSc2XlLD9/Zw3NVEhIfwbmlxlXqpn3IQ7ENNaoOWiMv\ni3dGCd58C8wmimoeLBVUweOl5PZFrnWOZOiCPkjy1mGIQXzgyMkax/VP7lZQ\n7w/x9YmEQQARmOA9gOSmPIce8Rz/Pz7jl1JC16DZ7elEa58ABpZfV6o816t6\nx0vu3sImXWD+RH0mIH/iUAlyPZz24gr6CdNSuGUBVZiCUkLFZ3Yfnmgm0IwT\nQdVEZ6pdZlwBGX4JqKuRWmMQJf098NNzVyO9GgrwB/+576WbXaTtj288tXl2\nTswigHfqpPo+HmVT/qejJgRCh8ut6hDwjYUZMECS6GAaGFe6aD9nb5KGC7ZP\nnn5lYFiWRx473Xu0i8qGookhqDv8AWwBtayOowqv1a84q/OQ0X7ZO549M++e\n4JNd\r\n=PB6J\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"88bd0c07a8b1b98778282a90ad9645b97ebbdc42","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --typescript --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.1.0","@balena/jellyfish-logger":"^2.0.2","@balena/jellyfish-environment":"^4.0.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.33","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.21","@types/node":"^14.14.35","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.0_1616574634745_0.9795567484200824","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.1-renovate-non-major-80a28647ed6dd0536e42b92651398e9a3c7fea27":{"name":"@balena/jellyfish-metrics","version":"1.0.1-renovate-non-major-80a28647ed6dd0536e42b92651398e9a3c7fea27","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.1-renovate-non-major-80a28647ed6dd0536e42b92651398e9a3c7fea27","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d0320d752617fdbceb9991795d264750a3f839fc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.1-renovate-non-major-80a28647ed6dd0536e42b92651398e9a3c7fea27.tgz","fileCount":21,"integrity":"sha512-J8zhpFjYEJWfTpMO5H8C0XB+uBJcUmZY9rU4nEdxlCPc7j2DWNH8w6T5Pj1ec9svBlDGT6w7SUOR5/w77Uaa+g==","signatures":[{"sig":"MEUCIQD2QEBihiVx1Fe0u5dsvrpL2uOvJXXnzdHC7Tf6SH/AlQIgRHMZm5pneFfE25bcSIfok6TMBYRs4uMVHvv26u2MrKI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":147576,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWvnZCRA9TVsSAnZWagAAodoP/R+7raCUPA02rygOg21m\nfBaSRuITQ5CI0UD+TBB4/lzXiJZWlXIWSnTXNa7EwZtCHx5uCFO5z9sg9d53\nKbY5rvvChv7NPolziygqwlTrHjNPtF0GubQi8UqTJsrWKHqHX8g7zqx7tNo9\nTnVjM9hA7eER4g0UZxsLaTsqD3Zc3UvChpn+/kt5/e44vQOBJPm4dM7ALkQ3\nJMpXZDz/t9+cV7yq3Pw87Xwde1IEzsE1bhNxREDvZpZ2abveVSgNMSdlLQkv\nqafZqKqFMITEQLZ4mt9HyxiHvj7X9l6zYS7mhHsWnITg4zPu7uKCdrHDZf2y\npRnGcqbW0k8cdy6RTagi1XpsKsspcRmDNwKE77kx2/aaxmdvKBIbDVRoV9r5\nzaDbvL4EzvlKZ+yEqCoecSUfvyoutAleoh36SQ/RGwchhHoYg0UVMLO9C5Lu\nOz5xeyN6bZmMpXugXYkdwUVfc5jDj4RQtrSYlP1J1miKAa2P3jlP9+jCi5rO\n9buLsX5rYxZdnfL+N0/Peohj0COYpLgaPvxjOA6Au8mlnoJYmxzcal31fL+P\nsFd6LvtI1ZxWcDn9+v/TsjBlAUxgPcNpSEWnoDc1gJYPXFG3M9OmoILbab8l\ncaUvsHL+ahtEmRX/bZGPt+hLSQaphtuhsbzsQ+otRgWNYN32aWCK2eSUZkmG\nJyOw\r\n=i+1m\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"80a28647ed6dd0536e42b92651398e9a3c7fea27","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --typescript --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.1.0","@balena/jellyfish-logger":"^2.1.5","@balena/jellyfish-environment":"^4.0.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.33","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.21","@types/node":"^14.14.35","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.1-renovate-non-major-80a28647ed6dd0536e42b92651398e9a3c7fea27_1616574936479_0.3184245820588165","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.1":{"name":"@balena/jellyfish-metrics","version":"1.0.1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"48dcfe2145b43c91695f32bb7ddc501fd19ff449","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.1.tgz","fileCount":21,"integrity":"sha512-h4stfB/GC6VRIfpRH2kceuttS2SNmvljisxT6MTXpHJmttfXEkgSockps+XfbFnSZdFbTOxuN3Aktf1XCkUEOw==","signatures":[{"sig":"MEUCIBCsMbLfrXXw8H5R0BuDKexgyw9a9ABIAC0SsFD4Ae7MAiEA6PVzlrOapc+rR3IzAfSovEfwhHto3Ozdjugx5nVc4e0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":147516,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWvsrCRA9TVsSAnZWagAA68UQAJUcilDJ1cnynLZHTrXR\nZOEaPbl/9xFfRBWxB5vYk3bZYlv+t+y8TBIFAoL6EJpPAJR4LacbHRuvuIqr\nTjeRCT5cdFJzOWhDHXlWgYRTaUUqShs2c29E/iDPda9LuqXnimYBbNnDbmmR\no5c1pJ5YABo85EiDE6BrHXbAuVwQfZ5BvMp+fsp9i+XdZmYmYa4GD0jRSuZZ\nBpKqoCpypMjAXf1zFygoJrh4Lf2oVqjJLmnUvy6UQajUNbqBJ9FfwBAVn2Oq\nhHr4EGil1XyK+dzDrJYuUDTobz3TNcweSZWhmBigqMHHgXmlM/m9RwhUW8Ib\nBL3LSMG/wgXNJJ0qQ6fBSEkugWkIJcLkMUwdW5HLZdzlZo4F9tdw9N7DyNAr\nosiAnSOuR2pMLeg5bDWe5cnBwVqYiLsxWF8X+XRJLqUNdNGAcu5x09560Lg7\nDqsZqPkWS5UhDAOb067dhVRAggeTlzrUQ01oaa/ZoG4XeD8hYVkhHHk4teZk\nGoc/HDrvEtDXQwkD/C2so1eWxJW/EzszewhVpEpHAo8iAmq3P0eO1ApDM0tU\nEayeft9cpXSg+a3etZyler8wAlb6g7Ael4bSoUUKHt/NJh3C1zI1+NCUvfCc\n9fV3zbUJrBShTu9xAGpfo411BUFeS9Q1jdRuqmxS4HIbhmqBiJVqc/HcyfYG\n8wa6\r\n=ZDAO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"87725ee8a275c3a0313998e457ff622c891795ef","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --typescript --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.1.0","@balena/jellyfish-logger":"^2.1.5","@balena/jellyfish-environment":"^4.0.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.33","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.21","@types/node":"^14.14.35","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.1_1616575275406_0.5974261059441899","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.2-renovate-non-major-8252db083eb241313ffb2d0fb6c95a8a782f462a":{"name":"@balena/jellyfish-metrics","version":"1.0.2-renovate-non-major-8252db083eb241313ffb2d0fb6c95a8a782f462a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.2-renovate-non-major-8252db083eb241313ffb2d0fb6c95a8a782f462a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"da17528705a942d32f6399ad875ba0f248ae03f2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.2-renovate-non-major-8252db083eb241313ffb2d0fb6c95a8a782f462a.tgz","fileCount":21,"integrity":"sha512-eu5Ysaso8sR5+g5yDveP/1Fpy6zVjUjUuz6BG6OFYiaeR+wz0Jo/1qKQ6eS4O6dJ00lDeSh1CKCxKE5ffx9MeQ==","signatures":[{"sig":"MEQCIGf5XOl2Z3jnwzKdGcMLbW5KvQSVdjuDwXKJ0QBg00h8AiAixtUtaJt0Aq2Rrx8gPvqNujBpa+Y18AdUrjgCTd3WQw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":147677,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWyVMCRA9TVsSAnZWagAAvkYP/1bmzVHwB49BUZcPaInE\nY2psKTYfLGQyN1att7plquYVtpiwsIHft0u3OsBBHiQdreFCXze0FG4Cgkd3\n3gmn7hyIwGczo1rG+FLvtZGZAsLC674oULJ2RJDyHY6eAVU6ucGllrwZwxfQ\nPR1VA6/m894dDNd23uTc0j/5gNryj+IH9MSgVAXJoPMK9K9hvyfRmgHN70xx\n1X1iDnW/XXwaXyjrg877nhwlf2rJw5NweX2156gHGCjVjF20HLJVlfqrjIYe\nXOyVKLVqSqBHWU0n/jg/EI/8hYM0mmm/RfKY00m924xn+CehOVSCGovXouqx\nh7I5oY+j+jGBmiP8XzjAQSySSC5gWg2Y/6FoPcysld/5WVRCRm77sFRe34Fn\nAV0N6jMmtaYgiQXlEnTX4CrOqnLKqazfWe8MdPkPjyechsm8RgN+RLj6ERQV\nZBQSn6Y3rcacn4nnZjxIGEYAZ9clOqY9Yuugtv1FH6BF181p/8KFWyFhHKj5\nZsHUNUrQ9mqleg8kdRN2eJqndfETD6t/rAY29aD/uA1+wPhsitB9zA0/JjeJ\n79IK5FHJFBg27yRUy1PUHRvOl4QLPzpFFw/iM33g50Y4AznKDOijjdgPb9wt\nBI0J0tLf8u6uRSgw4QJCNzGxZOmiXSRxOl3BMkf8D/oAYnej9IpgdwaiftPM\nTEAF\r\n=0X7e\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nA module that gathers and exposes Prometheus metrics.\n\n\n* [metrics](#module_metrics)\n    * _static_\n        * [.actorFromContext(context)](#module_metrics.actorFromContext) ⇒ <code>String</code>\n        * [.initExpress()](#module_metrics.initExpress) ⇒ <code>Object</code>\n        * [.startServer(context, port)](#module_metrics.startServer)\n        * [.markCardInsert(card)](#module_metrics.markCardInsert)\n        * [.markCardUpsert(card)](#module_metrics.markCardUpsert)\n        * [.markCardReadFromDatabase(card)](#module_metrics.markCardReadFromDatabase)\n        * [.markCardReadFromCache(card)](#module_metrics.markCardReadFromCache)\n        * [.markBackSync(integration)](#module_metrics.markBackSync)\n        * [.markActionRequest(action)](#module_metrics.markActionRequest)\n        * [.markQueueConcurrency()](#module_metrics.markQueueConcurrency)\n        * [.markJobAdd(action, id)](#module_metrics.markJobAdd)\n        * [.markJobDone(action, id, timestamp)](#module_metrics.markJobDone)\n        * [.measureMirror(integration, fn)](#module_metrics.measureMirror) ⇒ <code>Any</code>\n        * [.measureTranslate(integration, fn)](#module_metrics.measureTranslate) ⇒ <code>Any</code>\n        * [.measureHttpQuery(fn)](#module_metrics.measureHttpQuery) ⇒ <code>Any</code>\n        * [.measureHttpType(fn)](#module_metrics.measureHttpType) ⇒ <code>Any</code>\n        * [.measureHttpId(fn)](#module_metrics.measureHttpId) ⇒ <code>Any</code>\n        * [.measureHttpSlug(fn)](#module_metrics.measureHttpSlug) ⇒ <code>Any</code>\n        * [.measureHttpAction(fn)](#module_metrics.measureHttpAction) ⇒ <code>Any</code>\n        * [.measureHttpWhoami(fn)](#module_metrics.measureHttpWhoami) ⇒ <code>Any</code>\n        * [.markSqlGenTime(ms)](#module_metrics.markSqlGenTime)\n        * [.markQueryTime(ms)](#module_metrics.markQueryTime)\n        * [.markStreamOpened(context, table)](#module_metrics.markStreamOpened)\n        * [.markStreamClosed(context, table)](#module_metrics.markStreamClosed)\n        * [.markStreamLinkQuery(context, table, change)](#module_metrics.markStreamLinkQuery)\n        * [.markStreamError(context, table)](#module_metrics.markStreamError)\n        * [.measureCardPatch(fn)](#module_metrics.measureCardPatch) ⇒ <code>Any</code>\n    * _inner_\n        * [~measureAsync(name, labels, fn)](#module_metrics..measureAsync) ⇒ <code>Any</code>\n        * [~isCard(card)](#module_metrics..isCard) ⇒ <code>Boolean</code>\n        * [~getAsyncMeasureFn(prefix, labels)](#module_metrics..getAsyncMeasureFn) ⇒ <code>Any</code>\n\n<a name=\"module_metrics.actorFromContext\"></a>\n\n### metrics.actorFromContext(context) ⇒ <code>String</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Extract actor name from context ID  \n**Returns**: <code>String</code> - actor name  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n\n**Example**  \n```js\nconst actorName = exports.actorFromContext(context)\n```\n<a name=\"module_metrics.initExpress\"></a>\n\n### metrics.initExpress() ⇒ <code>Object</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Create express app using metrics and expose data on /metrics  \n**Returns**: <code>Object</code> - express app  \n**Example**  \n```js\nconst application = metrics.initExpress(context)\n```\n<a name=\"module_metrics.startServer\"></a>\n\n### metrics.startServer(context, port)\nExpose gathered metrics on /metrics\nReassign port to random port number on collision\n\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | execution context |\n| port | <code>Number</code> | port to expose metrics on |\n\n**Example**  \n```js\nmetrics.startServer(context, 9000)\n```\n<a name=\"module_metrics.markCardInsert\"></a>\n\n### metrics.markCardInsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was inserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was inserted |\n\n**Example**  \n```js\nmetrics.markCardInsert(card)\n```\n<a name=\"module_metrics.markCardUpsert\"></a>\n\n### metrics.markCardUpsert(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was upserted  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was upserted |\n\n**Example**  \n```js\nmetrics.markCardUpsert(card)\n```\n<a name=\"module_metrics.markCardReadFromDatabase\"></a>\n\n### metrics.markCardReadFromDatabase(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from the database  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read the database |\n\n**Example**  \n```js\nmetrics.markCardReadFromDatabase(card)\n```\n<a name=\"module_metrics.markCardReadFromCache\"></a>\n\n### metrics.markCardReadFromCache(card)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card was read from cache  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | card that was read from cache |\n\n**Example**  \n```js\nmetrics.markCardReadFromCache(card)\n```\n<a name=\"module_metrics.markBackSync\"></a>\n\n### metrics.markBackSync(integration)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a card has been created due to back-sync  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>String</code> | name of integration |\n\n**Example**  \n```js\nmetrics.markBackSync('front')\n```\n<a name=\"module_metrics.markActionRequest\"></a>\n\n### metrics.markActionRequest(action)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that an action request was received  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n\n**Example**  \n```js\nmetrics.markActionRequest('action-create-card')\n```\n<a name=\"module_metrics.markQueueConcurrency\"></a>\n\n### metrics.markQueueConcurrency()\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Expose current queue concurrency setting  \n**Example**  \n```js\nmetrics.markQueueConcurrency()\n```\n<a name=\"module_metrics.markJobAdd\"></a>\n\n### metrics.markJobAdd(action, id)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new job was added to the queue  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n\n**Example**  \n```js\nmetrics.markJobAdd('action-create-card', context.id)\n```\n<a name=\"module_metrics.markJobDone\"></a>\n\n### metrics.markJobDone(action, id, timestamp)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a job in the queue has completed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| action | <code>String</code> | action name |\n| id | <code>String</code> | id of the worker |\n| timestamp | <code>String</code> | when action was completed |\n\n**Example**  \n```js\nconst action = 'action-create-card'\nconst timestamp = '2020-06-08T09:33:27.481Z'\nmetrics.markJobDone(action, context.id, timestamp)\n```\n<a name=\"module_metrics.measureMirror\"></a>\n\n### metrics.measureMirror(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a mirror, marking duration and totals  \n**Returns**: <code>Any</code> - mirror result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureMirror('github', mirror())\n```\n<a name=\"module_metrics.measureTranslate\"></a>\n\n### metrics.measureTranslate(integration, fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a translate, marking duration and totals  \n**Returns**: <code>Any</code> - translate result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| integration | <code>Object</code> | name of external integration |\n| fn | <code>Promise</code> | mirror function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureTranslate('github', translate())\n```\n<a name=\"module_metrics.measureHttpQuery\"></a>\n\n### metrics.measureHttpQuery(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /query api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpType\"></a>\n\n### metrics.measureHttpType(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /type api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpId\"></a>\n\n### metrics.measureHttpId(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /id api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpSlug\"></a>\n\n### metrics.measureHttpSlug(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /slug api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpAction\"></a>\n\n### metrics.measureHttpAction(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.measureHttpWhoami\"></a>\n\n### metrics.measureHttpWhoami(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure the duration of a request to the /action api endpoint  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | api function to execute |\n\n<a name=\"module_metrics.markSqlGenTime\"></a>\n\n### metrics.markSqlGenTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to generate an SQL query from a JSON schema  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to generate the query |\n\n<a name=\"module_metrics.markQueryTime\"></a>\n\n### metrics.markQueryTime(ms)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark how long it took to execute an SQL query  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| ms | <code>Number</code> | number of milliseconds it took to execute the query |\n\n<a name=\"module_metrics.markStreamOpened\"></a>\n\n### metrics.markStreamOpened(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a new stream was opened  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamOpened(context, 'cards')\n```\n<a name=\"module_metrics.markStreamClosed\"></a>\n\n### metrics.markStreamClosed(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream was closed  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamClosed(context, 'cards')\n```\n<a name=\"module_metrics.markStreamLinkQuery\"></a>\n\n### metrics.markStreamLinkQuery(context, table, change)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream is querying links  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n| change | <code>Object</code> | change event object |\n\n**Example**  \n```js\nmetrics.markStreamLinkQuery(context, 'cards', change)\n```\n<a name=\"module_metrics.markStreamError\"></a>\n\n### metrics.markStreamError(context, table)\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Mark that a stream error has occurred  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | <code>Object</code> | caller context |\n| table | <code>String</code> | table name |\n\n**Example**  \n```js\nmetrics.markStreamError()\n```\n<a name=\"module_metrics.measureCardPatch\"></a>\n\n### metrics.measureCardPatch(fn) ⇒ <code>Any</code>\n**Kind**: static method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Execute a card patch, marking duration and totals  \n**Returns**: <code>Any</code> - card patch result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| fn | <code>Promise</code> | card patch function to execute |\n\n**Example**  \n```js\nconst result = await metrics.measureCardPatch(fn)\n```\n<a name=\"module_metrics..measureAsync\"></a>\n\n### metrics~measureAsync(name, labels, fn) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Measure duration of a promise execution and add to metrics  \n**Returns**: <code>Any</code> - promise execution result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | <code>String</code> | metric name |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n| fn | <code>Promise</code> | function to execute and measure |\n\n**Example**  \n```js\nconst result = await measureAsync('my_metric', { ... }, myFunction, ...params)\n```\n<a name=\"module_metrics..isCard\"></a>\n\n### metrics~isCard(card) ⇒ <code>Boolean</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Checks if an object looks to be a valid card or not.  \n**Returns**: <code>Boolean</code> - validation result, true if card, false if not  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| card | <code>Object</code> | object to validate |\n\n**Example**  \n```js\nconst result = isCard(card)\n```\n<a name=\"module_metrics..getAsyncMeasureFn\"></a>\n\n### metrics~getAsyncMeasureFn(prefix, labels) ⇒ <code>Any</code>\n**Kind**: inner method of [<code>metrics</code>](#module_metrics)  \n**Summary**: Generates a generic measurement wrapper for an async function, that\ntracks total calls, total failures and duration  \n**Returns**: <code>Any</code> - api result  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| prefix | <code>String</code> | metric name prefix |\n| labels | <code>Object</code> \\| <code>function</code> | metric labels object or callback that returns labels object |\n\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8252db083eb241313ffb2d0fb6c95a8a782f462a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --typescript --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.1.0","@balena/jellyfish-logger":"^2.1.6","@balena/jellyfish-environment":"^4.0.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.33","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.21","@types/node":"^14.14.35","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.2-renovate-non-major-8252db083eb241313ffb2d0fb6c95a8a782f462a_1616586060232_0.39381577461161","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.2":{"name":"@balena/jellyfish-metrics","version":"1.0.2","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.2","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5fb354c318d42dd920d349a0d2a5ebdcbce13961","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.2.tgz","fileCount":21,"integrity":"sha512-p/9Ow5tQvVgcKwSNmWSJIuBoJPUztdZFyIl/Tz2QOkR76aTzd5bWgBuwPoH6pjEBtIjefcoPebWZY6Vsx683IQ==","signatures":[{"sig":"MEUCICo4EW7aIUgjtDx3k5Mcq9ABUrJ1wpEraUaVtLqh+rCxAiEAlohGY8r73xMIMO8gdT/c6z8zjsjQxKrWYDCxQTkdm/8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":147617,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWyYeCRA9TVsSAnZWagAArUcQAJq71I62SM93V0rlvr0p\nVxm3C/xOFspusgxF7UEK8yWXnDEpys3kIGUXRwM/bDOIPjiMTEcJLhVdvghq\nhfHbjsof3YmCf2i7nR3nKKnuUOd19CP4FdUaEO2z+XzoVJqoSis2cPjHI7Y0\n88LsdFe7v6dShhdhbon9mU79tvAWzVPN+eb9uOvErPNUf2L4OTKowGYyON/J\n2QEJ1ExWlAbNx9bN9XxeMntNKFVoKfg2TbiMs1yebxH2j3wP4W20dQ0JW9ZE\nb0ww4siJ6PYlChe1cC++sWkbuY+D/0EUF5BEQvBxuveLEcspFUBXoCQgtHSW\na4yQ2kxQlxqGojHnpf5RipfTlsRUj3DNHVA7iTJr1bbv92qwiXVEy4+H09Vo\nMxuh1kt3LrJQX1hFGm5Dza6Oo4MNbkZg+eXuh9DEiCNqkCNcdtgJNHU7TuXx\ntmOzeTfdZWglnpr5X5Z3M+iv1kN/8/OWdAUP4vJ8AfFadaPOhBgGHf9ARn6z\n6zDs6bvBY6uiCKVeyuvxkdLMV/B7HG+c13y2iy+O+LSEPF7NDqRSIrCJSMhb\nih3IvfQMuw/vIUkIAfTLfumGtnfTA5KSYjMRD7gvSIfvNIZG9IB57s6Djw3v\nFSncLlNX9Pd+56Neth1TkHfIJ9wnLcVNCzK/2DWGRfnUjwlDIlfDPyNTnf7i\n73uz\r\n=/YK0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b6b1584e42f65739bb02a27eaab10adbf3226b57","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run doc && catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --typescript --fix","npm run doc"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.1.0","@balena/jellyfish-logger":"^2.1.6","@balena/jellyfish-environment":"^4.0.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.33","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.21","@types/node":"^14.14.35","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.2_1616586269525_0.8809013683562723","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.3-setup-docs-f96925a05c32d0c0bea6f1dc4f3f77a11dd5f104":{"name":"@balena/jellyfish-metrics","version":"1.0.3-setup-docs-f96925a05c32d0c0bea6f1dc4f3f77a11dd5f104","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.3-setup-docs-f96925a05c32d0c0bea6f1dc4f3f77a11dd5f104","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"df4cfa8d3bcba0095119870ab49667849a74b09f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.3-setup-docs-f96925a05c32d0c0bea6f1dc4f3f77a11dd5f104.tgz","fileCount":21,"integrity":"sha512-NRoYe+NLYhVSUBGU4Gj74EO5EpmOSF+22fxCxh2TLIKVte7FsgRhMn1/AfoR5I5dWHkxyrpN2vzh1WM1eP+dGQ==","signatures":[{"sig":"MEQCIE5dgR9p55G1mHb+ciVQCFPAXDsKGERw94+MKNOSTgunAiA9qlF9ZOUJjx1pegVEx+PKzuTUUIbCvYd8KrS4OHlCQg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":132374,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgW+GMCRA9TVsSAnZWagAA9CMP/0rqAousyFVCgWi5k9jo\nowLs98jjoXckFemzq8qDu+3KZANksk9sRpfJ6zlJIcs5zVu4d7Rt40/KPDeG\nD5s5AJ0CqEasmzIi49CLJgx7T+8mgvK/wbLORn7pSsBMpBuCoCuy1mL2kTTj\net0gP1hZ0VSYR6HeZNHpyE5/uDf/pnkaB2OfkC8395lvFqOPu0d9VK1yKPrC\nFZA7fe5Geh/h91NeeOVTp/yg9dg5fjoS0EwJ2vsfU3CGhp6BD/dSi2ehHj5o\nN2W+MX+ySWr2zrXLxu5mcatuyJRZBcphyVAex2NZDx3WYSO5oK4Wg0ibY6xQ\nA5OySjhBLrCpvlHqhboAdJFtjTbMSariZezlY+zBorIEN6qmBBDBElgzoBOM\neJvU60QngTRHm70du+0cJGyv+qN/AeTIsYHmH63KvNNTTE4MtAq3omegMU9c\nXs4OnW2mUeyQHdMYZGFnHdRLOYKFMZPHpCgukPz+IWa/ETisOtXoGPqIiaWa\n8FeH7TkUggwzhwY0cVWkTWz1gIMWy0fv2O5w6GRDN8yCLPEB5wodLrzRwZlp\n/hGtP6relfzuBDJ0ordU03mKLsO9UWtyH7ueyS4Nazrg384ZXV6EJHZCTtDg\ndv3wofzYp3LoGQU5eQVKjVPQfdIJTySKcIhNF2J72hmsSOw8V8PbF8rWMT6Z\npdzr\r\n=9qVG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f96925a05c32d0c0bea6f1dc4f3f77a11dd5f104","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --typescript --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.1.0","@balena/jellyfish-logger":"^2.1.6","@balena/jellyfish-environment":"^4.0.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.33","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.21","@types/node":"^14.14.35","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.3-setup-docs-f96925a05c32d0c0bea6f1dc4f3f77a11dd5f104_1616634252187_0.6398931977149229","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.3":{"name":"@balena/jellyfish-metrics","version":"1.0.3","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.3","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"22c0143772b342235f404f4fc0687eb4dd80e8c0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.3.tgz","fileCount":21,"integrity":"sha512-CDEPf4+CZHzwofKjm+LcjXSYY5yN/hjzArj/d2ooIr5IH/cBBxhkUXl3nHSQrC2NWysgdlwq/k9b3gBkMU545A==","signatures":[{"sig":"MEUCIQDpUBD0tdwOgoOd69qgf7LaVVF16Yb4AVB0vB5jOwe34QIgTXAN3Cegs6VL2zl/AOUGDIkwbNKENMTAJdEM34iKFC4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":132322,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgW+QQCRA9TVsSAnZWagAAPIsP/ioGB2BUlSXFm5cPYpmf\nhn+qUP7cDbQRSDPsiyw87YKLolUaw833fouidEBY/3WuTdPcnp9yrWuYC6bn\ngUrMAC/PH/vOzp8i+PHNySKB8QpXvffROdOGrw67yLl0GzPxloAFrkbydczZ\nG2TihByygSQdMmzGwtxiyvNPk+YnnBZ71FZRfFV9eFOkxVXZ79YiBfrpHOxf\nlcJCLeux2EKrO0l5jMqaGkjlkIDPGae/wUpBe2Baq3Ic30U0FxfVllKhc26E\nw63kKz/T0kuzw2FnletwhInpsXVcgXPzTxO1OrD7t6GH46W30WFcaG9FvuYa\nsQnrnFQp5GYU7j9MXtOb9sjID7Nl3q2PrsW4zbxgDO8Tc+yrkOWu5lRT/GUX\nW1h7kI93Wt6PL2BnNucbFPSTNPK+Bcd5pAGxgD2J22IXV1gSotG4qweaFPTN\nATWWZJ6YedD/ga65w9nBlVhvOc81rp1kmrP4JeHq24tdzgo1Cvq8xR+mYECR\nV6Jh2avF4bc8ekBdCJlIHYGTH9qIci6C3il0iz9gR5AmTbzDBM1xZM+E3TpW\noIH9qD7EJ48E3t/i+aPB3QcDj5AekOWnyT04j2hhrbjhBVCcD+k5KEKsBcMB\nAMy+hoWSzIDkOMDDtj3q8UtWA0KMoJO5nJZ5okhl7uXxkY3rkLj60r7ZMEMN\nLQwo\r\n=VuUF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"056a813b9d78ebcd382dfa1baea4fcc81b5f2d96","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --typescript --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.1.0","@balena/jellyfish-logger":"^2.1.6","@balena/jellyfish-environment":"^4.0.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.33","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.21","@types/node":"^14.14.35","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.3_1616634895741_0.6158153166465559","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.4-renovate-non-major-d7ae5c7de68f2e016580317d02c8a094517b7ef5":{"name":"@balena/jellyfish-metrics","version":"1.0.4-renovate-non-major-d7ae5c7de68f2e016580317d02c8a094517b7ef5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.4-renovate-non-major-d7ae5c7de68f2e016580317d02c8a094517b7ef5","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2878d0be428fa46a8ab754d9912dfa734e38b7ab","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.4-renovate-non-major-d7ae5c7de68f2e016580317d02c8a094517b7ef5.tgz","fileCount":21,"integrity":"sha512-bB9nLbnD2EW4QIVWMfUpd2/ytBVflpwPU8n+LIBgiP1V2slStO7h6tQ76FYFrRI2kNl5i+5sGKbG2hYhP62m7Q==","signatures":[{"sig":"MEQCICKtGtF8vuh4Yt7LPT68BvGuQRM2GZ5tKoy3LqEWJ7W6AiANEQ14USVAbUBrm0Ut87Mg4zvHrMo/xDyj3PuzlimCNg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":132488,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgW+TsCRA9TVsSAnZWagAAruQP/2lMU3/YXjABsq8WcMGM\nNWYCHfMEWzd9Dk+GvF2B5fqI1ojk5sHvPZNzKFYOfnVP0TBgjt10fzh5F2OV\n43dC5B1EVAGTRcz6FOSN/SoD/SrE0IG6U0F6YjHRjlvpgq9dJkfczfVqWyrK\nbenoTK9DWUfLY5qeNVWM2t2umw5SpeHIgNnGLjEJ99Z30OmBB/hpPlSaxZ8O\nqxELlw3rwp0++RgTRNbaTxxAXqlbXPNE96ELMz+XJc0kODjqeEMZHoAHeCKt\nOXfkgIvW2COfL5mU5a0oUsEls82liDwz+q+bytHwB/TOFDiLHVZ5GsUU1eZd\nbkY8HLptRWk1bIQ4kFo3rClqMRyEOBPYMCi9E3aEKvNWueEmbJ5Z+4hBTrqh\notPbLNRNCESv1nBHJwSBfnsFYJulf/3Q89YvwO+XP9YDMh6JdaamIEqIEmBs\nNBKaQU7fE3lhHaiOFwpbHocGjUmahFrnOWA7B48sylJAYAOftGNOiFnNTL3J\ntEquEIIS8baqex4NJa9CNWBKXsH/3hbWUUP1i3X22D7CpqFa3JZFchm8VCEB\n6XOqSNb0aGxU/irmY4vgRULauLKqHzRTrIlBXDzJ1SjjFF0hebGkaLpE5phz\nu6qcJGHYRPsic45/MRLtXg33unQefkvH4dBC17PuQmgXgot8itGp15zdX47p\nGIsD\r\n=3KV1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d7ae5c7de68f2e016580317d02c8a094517b7ef5","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --typescript --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.1.0","@balena/jellyfish-logger":"^2.1.6","@balena/jellyfish-environment":"^4.0.2","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.33","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.21","@types/node":"^14.14.35","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.4-renovate-non-major-d7ae5c7de68f2e016580317d02c8a094517b7ef5_1616635115583_0.2820467744155397","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.4":{"name":"@balena/jellyfish-metrics","version":"1.0.4","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.4","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b6f1c381a92f607f38b2178fc96397158486e2a6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.4.tgz","fileCount":21,"integrity":"sha512-4x8zGTB7KiBAYfBg9p9FBY61AApMMlGsbqJ8EW2BuqEc1HMa3BAgp/Fe9UxgfWtGVsqYDo++QghAuA9ws7UIcA==","signatures":[{"sig":"MEQCIBqvGuwK6rDJU1ajHABtQfA4NgI3ywjPxEyRFJMMYjwrAiAo3xXTMYoTPmCNs6pafITulF/iyee7V5Kye9WDDt//1g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":132428,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgW+Z8CRA9TVsSAnZWagAA6I8P+gJi4yPcnZJtXrYlTugg\nqpQjQTbiL8fZi2zH/bcDGUuHcvekT7jlY1k59s10QEk/7E4Wwy/NRkqku+RA\nC6ayECwQF68uo9VSUZ+PYVFgiQlNKPsxjV++G7C98/ndjxv8i7X7v2PiNgsU\nQpnZorEEP94ide+1rLwJUi1+jF+rV3I5TcdkYDjCByDEdvNy/U8i3Jh6LGiq\n3HQYkaA9Fgkg68YHvrRkqfuZ/UlufJiHTHva8bccVx80YDtUAsiaJ4h6nhIw\nIKuoBUVD5fRDYeq7Sj6ZkbECqrvXBfJIN7FN+Dr6DLd7+VsQXoUZgveIv6ey\nrkM3leNfyoFYfUsmdpAueYy0BwoGgT1vOtezPHXCzcZAL+dkC3KeO6xIPadw\n9PewfaFcT/qzR/naHWWk3sWIax210Z/dnJan8IkSa894Nwf+b0CTRgKZ4R8j\nj2TK2mOVIIaRC7tW5cqw+Km9ADR7SQ/BtkWII1Un7y0cYqJ8W7efoxtpLkDl\nic3KFK3K5TOardszYptcpAVoBYO8sB5NKOIFUhk7BsJhm3gsje1umx7jtb8f\nhViGKoxEkBZg7Vf4tSZ+bRjzIgwj00a6mq5F/ep8kVwWSA5mUekxbatD1kfG\n/at9wUXwP166I/KUEsdw6UX1A5c20gFoUA0kUZ59VJ1JnWpSlw1X2nSp59pV\nfFkb\r\n=9uqo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8684eb44dc311d3d5f9ea43c882ec91fe063969f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --typescript --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.1.0","@balena/jellyfish-logger":"^2.1.6","@balena/jellyfish-environment":"^4.0.2","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.33","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.21","@types/node":"^14.14.35","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.4_1616635516314_0.8999717863540364","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.5-renovate-non-major-4c4b6e4c7232c61869396682401f68b6be43e0af":{"name":"@balena/jellyfish-metrics","version":"1.0.5-renovate-non-major-4c4b6e4c7232c61869396682401f68b6be43e0af","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.5-renovate-non-major-4c4b6e4c7232c61869396682401f68b6be43e0af","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"82a51f4b0114d1c5e59a8ad71a84a2f3faa990de","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.5-renovate-non-major-4c4b6e4c7232c61869396682401f68b6be43e0af.tgz","fileCount":21,"integrity":"sha512-zsWKboxfjI3+OewD+5jSGAdOXzGnAM5LiVhNS0jPlFvWi/sPTwXXKBdPccW8qOtDfnGzmUR6Ag5oIU98OeEkWQ==","signatures":[{"sig":"MEUCIDUjZcs5zshcnj68km3XNHHYr6KCbqalaPg18HvDdGL/AiEAk53Vec7QIgYXw8IzLV3PlxxI452SzVJU6gNOjRmqhMY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":132553,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXAyvCRA9TVsSAnZWagAAxGAP/1ojxSi/JvS2zqUyyBn4\nZ4tu0fLTW+bv8/u/ZpTo1VNgJ9JQ9WPzrIP+Fznh/zEBnIfA7EBHP97T/Cqy\nLqT2ndxZ9s7dz2snfmRoWXA3myQsKs3GDD4DNed3lIGWgNXOVf71hohNtpuV\nnTNZd606FYx2v7T2LPayUUHxTJExBNxEQiUBHuqrMWl6jn1lxPARfYiOAUl5\nHRNDZgSLRZRCHkMO84bwKdYgL20FSSWrInuC0wG6qac5ex5npVAWY8pklYOY\n5z4HLvHWyPaBnyPqZ/KLbUZl2TevZ1G0JGcVmrGWl5CByU3JyoG6WlNE/5lx\nIlRiq591nzojap56KwGcZYsuoFcUX+ofLVpDUUbs4XGRbZlNV4r4oOEgpQFs\n37PwmVko4jMZjobkREWC+42bjeMZPsoBcJjjVuDIn0uxaaav+5Kl6vTZAt2m\nt3sk5/idNAnAO2o+hWgCqbsA+38N+ttW6CLZuLl/P5miOwXubPKGaU3fiCxi\ngTTq3kknZ6nXtnEzkE7/sBO/GXHIZucb/MJdAtAlDVkZ80ukYamjMlJkTKqE\n1FbM/SwIjGQKx2tu/kAj6y9wjed5jKWI8rUIaY+klNx980aS40iRRJB6rm0s\nTDq9R+fihueOCb3FOiB/6B87Zean2uHnPijWSm6/RerESgNORIm+WN9fdZRP\nMb8j\r\n=dBBr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4c4b6e4c7232c61869396682401f68b6be43e0af","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --typescript --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.1.0","@balena/jellyfish-logger":"^2.1.7","@balena/jellyfish-environment":"^4.0.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.21","@types/node":"^14.14.35","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.5-renovate-non-major-4c4b6e4c7232c61869396682401f68b6be43e0af_1616645295092_0.15066205308816505","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.5":{"name":"@balena/jellyfish-metrics","version":"1.0.5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.5","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"abfa1176c7e418fcfe62063d12740cc95843c4cc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.5.tgz","fileCount":21,"integrity":"sha512-mBFRgYhALiaY4wZwmkphG9ZD3n7DItQZItTAAb49EeumYOmaVKU6XT+Tjj1OFqQlsIVFp29gsZtjabZqoQpWSQ==","signatures":[{"sig":"MEUCIQDPPQnr9FjGsB6vjT5dxz4KY868SWoc5moB1BQo7ZkvegIgDxiLi2+Wt5e3XcvkpLtaEKVpnmfhy9InRRMkCgt1mhg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":132493,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXA2CCRA9TVsSAnZWagAAlWUP/0G5xQr604HgbdQPn+X/\npR0IImOnKNSlFhIXh6RYvuMpsgtd4Ug3+ZL0F3z9dqeyYKhaQpuCEpZ37lLX\n00K14JosAMCU8MjXWWeoZdzj2kbAjmJyTkZOZOMeCqRvmEH8wh3qdctHEgnZ\nbIsg1JAMgMctFjJa5F1kEX28LZsoa2DDxSQkGJg4OBGbxf8Z1Wsm7CqZhOTm\nYxRZYaa9VLC1MdsjuR/Uz2w/6UUN/v+DS/6EywUb0s5Df+l8TvV1X31+SRAd\nEsM9mryFO7ygjTMyKxxQgtXu4MVjjCmFyXiEXJMDIBsoPCHO8tKNHyrmayAy\nrckEvh/4sSIsvhanrKdeAhkDy5iofmHKXaegms+Z8IsYEvQUQsx6+kwhFqmW\nCX3dyJgnlyiwop2KZHAFDizZacD2Ogez+Uff8hELjQUe/ZlAQzKHIik3O0PN\nu/t5u9KP+hm+fv85bWK98+dmQVsQTlgY3iEGs6UW3sLBSZ+25snnyqXU2S0L\nFNklyXKclU6yLa0bSCUIlX/3A8wRfhbwZH16VQsvmT1b+1kUSqHnMIqDpKQQ\nlpS2qpJCQ1Qt4RGbeyoF9VctsDJcyX5Jhytq/nXU2AP64QARjwzSL7cnk33j\nrOO90xQi5XAIoaO1dynluCwexAfqW6YtENRRPk5Giqm2qZaY0FNToA8za8BZ\nvgaN\r\n=teiz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"10af85d3a9e12eee2d8aaf28bb4499b087ff966f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --typescript --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.1.0","@balena/jellyfish-logger":"^2.1.7","@balena/jellyfish-environment":"^4.0.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.21","@types/node":"^14.14.35","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.5_1616645506172_0.7528927760766826","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.6-renovate-non-major-f8db1cba6137a7b90f393bfc48972013612b7c0f":{"name":"@balena/jellyfish-metrics","version":"1.0.6-renovate-non-major-f8db1cba6137a7b90f393bfc48972013612b7c0f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.6-renovate-non-major-f8db1cba6137a7b90f393bfc48972013612b7c0f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"338c912a2a2c7f37385ccc1d15259041aa4f1df2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.6-renovate-non-major-f8db1cba6137a7b90f393bfc48972013612b7c0f.tgz","fileCount":21,"integrity":"sha512-37s3ytYOcWwfe3TVUBNSNsh5DZtpKh7nqqHb8mSJV0SoLLdhwN0zcHbNjzKFwvUH5G5AuCECrLlKPsEFl/A1yA==","signatures":[{"sig":"MEUCIQDohfn2Ls5YpWZ3ulMeC7vPcIijLzeuAKlh9J5MlM3wiAIgU7HtYzgDBXLXZ87aCpnJ+QB8rNbh61Gn713/DrA3vZI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":132618,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXF93CRA9TVsSAnZWagAAzLIP/3bGef8t16y0pjil9pHm\nb4DeCvQkyvgZK5aM1f1Y2DcGmpnv0gXVBS1yNEW/5EWKYw/Xq576KQc7ZY3a\n3hvnXfd4KpJQLDcrwFDQSZDA0cho7xDoTOMPHXjLz7SGJR1XXVyMFoppV4Rt\n+H5vqmmUs0arQFCSyO+MC9w+ph/dsVaECMkEoT5oWriIjEoODmA1HFa6h5qf\no6CcMiiwQRPcF/0v15ubDsw2OtNWKVWmOnoFd8bsBY1TFZGxNOQYI8VqlZEu\nMijtBLTm/g+9n9DoGfDMLIbligazw1ulirUtUjragqR+djIbo0ucCyhkEQKE\nxzcAg9LEHVF5JbxgqzB8votN9LiB2HEe1RpNqx1pun+X73gcoTu7X3CZL4O4\nFi3qmTdqIxFtjJVI6sfPlERU89j+mfTn1xWl16B3tXb+oKflUOTmofOQ8TRq\nW9HzlbbWfIzEefE0cc4ky3nONKDtx3MrSm7jTFeVH5jT4hu9RbgTLeGfe2h+\n2wjG5baUvvw3EV1F+eW5w5ga6/uZjHHGZ2aWoKOnZR73jK6OTOZnqVUR71Wx\n8Tu1WJ+AaWTrgI3YWppVnKMp0F2MobNabVudo0HLdjtpsVCBaUrjmLzsGFgN\nTWAYfJN4UoKdrm0qiYxV99/W250ofpXYNmiixCDD+9RoZiN9BilEkqC+Ox8E\n9HSB\r\n=1cXY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f8db1cba6137a7b90f393bfc48972013612b7c0f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --typescript --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.1.0","@balena/jellyfish-logger":"^2.1.9","@balena/jellyfish-environment":"^4.0.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.21","@types/node":"^14.14.35","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.6-renovate-non-major-f8db1cba6137a7b90f393bfc48972013612b7c0f_1616666487030_0.11849282752588297","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.6":{"name":"@balena/jellyfish-metrics","version":"1.0.6","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.6","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"488de223efc8ed45f28176bde1e787bd1ede2703","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.6.tgz","fileCount":21,"integrity":"sha512-/FyHaOnwQx/qbSqpUheFK3a6pv95kpWKRY73vDNWTFk2NEWmrYcDm27kiKdgVzsPYunx+eI/NEbXoj7At+tIBQ==","signatures":[{"sig":"MEUCIQDI0SE7gUQEW/0yas/eS868kfmZzMRvSzBKZbZfgy2CvAIgOVcTusMM7f0Q4Y9z1S04B8lq1NyXOt2WqVTlL51xoJY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":132558,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXGBDCRA9TVsSAnZWagAASD8QAIMdlEUSBt1WMX+Eh5ic\nnVpTM2+Z78qbvI13vzkJi4aY3te0iDj9M+xONG7VKzCZ9oEpwYwHLAq+CQ6H\npUNdJdcJUDqxfppNSr1/R6+hCA2quwVomy0Ys/1VJDGhj1R3pByjlH93pnqP\nAg9G8D3i0ZDupl+w0V/TV8JKAx3YypjI9FM/PWHd9UTqK5K1TY2bneUhPnNz\nRy5MkAUwvZnUsIIjSuXyR/qvJ5nyyq/qZWHDnMf3dcTYO50QofNqh4MufDhA\nc318ZcSXSDInk+fADLfgsQe/16i/6kSr+N7JcuCK6PggDCnGG6+KCI6VuFPS\nGAQGxS5ZcBweFzAYQ6TGY37jaqcVjFC8RDIZwbQx9xl3g5lhmh9UzbKwlJ22\nSxcFbq5KM51qhKuirfTEmoj6XeDBrej6G22Ovy4SJB+NW9J6pEMlr11OBauH\nPgXoEFzxrgSNQir1am7Y9WnRgXQUKGbwY918cV7fDDg8xQvRJiM/JIbZhGBW\nhR9U1Uv5S5Y9Pakymut72ybB8GKpA1xCAecV53O2i4wN8o3vsD70ghOLVnA8\nZwlhOJH4IdIRuxqbTokkoyKihlqtWaLXwKOpMXqs7RaypGx6Bavtjni0o70F\n4J1MnPFMI8p3q359thYMRx3iNMzjAC1JCK7J/E6nlRghcN4eh3+mKeSlxP5h\nYhvb\r\n=U874\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e68f98a1f3b9dbeac240906f02fcfa1bbb8ea0ca","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --typescript --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.1.0","@balena/jellyfish-logger":"^2.1.9","@balena/jellyfish-environment":"^4.0.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.21","@types/node":"^14.14.35","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.6_1616666691064_0.9934267731915067","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.7-renovate-non-major-14af7842d437bbf7435e63549ded21354b67521c":{"name":"@balena/jellyfish-metrics","version":"1.0.7-renovate-non-major-14af7842d437bbf7435e63549ded21354b67521c","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.7-renovate-non-major-14af7842d437bbf7435e63549ded21354b67521c","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b5cc3c859e3203616921156641e795a645bdf631","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.7-renovate-non-major-14af7842d437bbf7435e63549ded21354b67521c.tgz","fileCount":21,"integrity":"sha512-u9O+UXg9e1johWLJQ9D5glw2fcUA+Klk+rpY477zKc7kQRe6/OORM8OKCPPiaJTGddLviPNB1QdJM3ePsgRwVA==","signatures":[{"sig":"MEUCIEBay0z60Z5xlRmCArdFvXV9CFqI8Sclg6olsF7kgmWnAiEA4kUhx73cuch+W1e2pKfmljNwX0x3kZod+3r2qZSTTVc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":132721,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXIQwCRA9TVsSAnZWagAAX5wQAI9UeMiuIYsY1ZKasz3/\nEjrfmSyCUAT9nzRJSqTQREUTkepiXzwRDABBJyu2N5uiZn8dJKUnitAMcenY\n5LD473QHTiozOjlbQ6pCeHJBhtVI6v3is1J0yHjKNfCCk06u7n8hyW/xLdkZ\nZPgjg8/aYM06DWW1+KTDV9BTOVnyL/ft7QZ2jqRDKwSPCmRi4yuCBUW413WQ\nB0dhPmFJvK6ulGzJ2C/i9lTBpCA+X6vLcdVHkIUj8BDic/Ipxdj2GDY5cLFO\n8lLeyhtYJMbwAE4Eb4j9f0se4ZtAErZwTDXrK+MumsSKFDfv+pTl8RDhevCx\njWqz4Mr6E5CddoYCDQRuL1RWdGwh2YgpU0GzExABR68cEYerPTL3KuPhRKTZ\ngmhnUltN68BDo+cKZCSglaQ3FuICJbuL9UyGK84DSZnJ7I8uplkTRtAG7H0t\nKIGJfesbAYHjeV/raNT5wW0GMXO6P8UiFDGEhPxlnpCz1A3V7xGM58YaA0aL\nMwswoioN3sF4z+rSzT+Sa0Wdf7oh07HF6NgrHSRqhpIGReabeX9vqRqPqIxQ\nLqkTKzBsXXbNMMjBBY6sxIH6orfdE4KMrudBgArHl+4VuB+6bRRhrn9THxvS\nRBlx2qCW18bVbZh4Ir14OjODK2AW1PYu1Ve94Nu+zF59j6R87hxlUkEHeFIN\nJ2hs\r\n=MQxo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"14af7842d437bbf7435e63549ded21354b67521c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --typescript --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.1.0","@balena/jellyfish-logger":"^2.1.10","@balena/jellyfish-environment":"^4.0.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.21","@types/node":"^14.14.35","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.7-renovate-non-major-14af7842d437bbf7435e63549ded21354b67521c_1616675888095_0.7800888857033828","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.7":{"name":"@balena/jellyfish-metrics","version":"1.0.7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.7","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cdbc85133377f25ac6e5f162db3a05395ee70bda","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.7.tgz","fileCount":21,"integrity":"sha512-Ajy9b+uS8g8ed0fxB9dvylUOuHJL30INq4Ar3odZwGW2MOKPpFP8dZsL93zEvZUMi4Nasz2BLVUGRAPHXVHk/Q==","signatures":[{"sig":"MEYCIQDKgAogwubLPsgaSvkAVfc8+zVK2FinRbda+KivR+mgkwIhAIGfFo45xqqO8zxXIQ72X1Nggq5S6yPf14a7+DCdY00h","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":132661,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXIVYCRA9TVsSAnZWagAAAOgP/22u1gvA423XccjDXOcl\n+Xutyjr3xRAsXmdX93Pz221fLsMhmfUKXFwChNyPxK5etObkTdCLN2vN48mU\nLkrWVk5sB89tmjlmjazyTwfix15RNcGpiEExgcxjKozA48iZKnMSFCRn+TUi\n1CE+TkgOz23jO8HP+5/NSsJyxGz57BQuDvgU5GU12drufzp7ehsuMHX16kOO\njrp1zBdJ/iMJ/6p9ltHAWBs2IgXRx5tLNU+fRpmQKL9Wfw/dxt4Uj6Yv9aWM\nf+Iy4vkIAf0mL6kUzkKTYYD8XAZDfZL2XGODd4nyfCgOOGLkhY1M0Mf4yPsI\n3rWi92jF9CFHClHyq6LsNsJtKT6am5sdG7zCjjfWHHgDj23kThIYBoywe5MU\nlEtaT0XI+it7TBLEgEpFqF0uXw+cc4aHuRmntsiiw00RKX+DpEqmPIWvb2ge\nzUtBeZQ/nq64ns3CX3+P/dvPtHpP+Rc74oy+ScEKYMrck+0CSOCbOPFOUZT5\npHFBX4iWdR9zTRM4MnpAghVuUk/uULqcbz0EuKfx3t0L1v2UtjSF8aVGb2m1\nSNndneYf8+TYEVt2Tx6K5zWZdvNwtCDooySUMVPEcBrzDpFH8yDMah/0nq4e\nzCJiS8ifIPajKcNDTBPtF3ruF4uKPPSqR8q6R/LtX94L00k6YYrLouGJal96\nQbnX\r\n=aB3u\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c708c5931c7ec2e477cc4f7206d14a282b994b81","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --typescript --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.1.0","@balena/jellyfish-logger":"^2.1.10","@balena/jellyfish-environment":"^4.0.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.21","@types/node":"^14.14.35","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.7_1616676184180_0.5274465676624638","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.8-renovate-non-major-80cc28b0d62560d659b439dd7241beec7018d6a6":{"name":"@balena/jellyfish-metrics","version":"1.0.8-renovate-non-major-80cc28b0d62560d659b439dd7241beec7018d6a6","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.8-renovate-non-major-80cc28b0d62560d659b439dd7241beec7018d6a6","maintainers":[{"name":"belodetek","email":"team@belodetek.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3592cdd4fd208dea1c667302c775a3d1f98ae948","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.8-renovate-non-major-80cc28b0d62560d659b439dd7241beec7018d6a6.tgz","fileCount":21,"integrity":"sha512-qj02T7ci58Z6idrAeqeju2os5+oOzVUSruLwHJziUyDfiC1YA3yUVDjjkVnUnt3zmrO8G3TTzJsjyXjOzQaLkg==","signatures":[{"sig":"MEUCIBr5z8iKgMauaP5IhOE5rgKFczYxWzvNXNxif1CSIL5pAiEAzF7DN8AMW8pqAUrSmWAc6awAOTd96un/skOhW44IOzM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":132786,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXN0VCRA9TVsSAnZWagAAAPoP/1hMRx45dGGuOmQz00bg\ncHwqHbKYM7tSo1NvP2erOcPSKGl2bE6zHO6FRDrSpYvz2+z8c7/meSSSmDgd\nz1xoa7QcLkyt3+SbZHfWPKXQvOeBuQF6zVeyDwrZR8F5euNej6L/+sLzS0bH\nenJS6UfNnJ7RDXvxGP/GA/sBCa4PmG/4XNVbANfumLS6jyVqvH3TNCdK8FBj\n1LJSouL7NoYayWxeySrW1bPIPkkaSyUiM+o6vrXk/ihxYCUd1ybT4O6Y1hg7\nXXryp6mbjUIu7itm2jhdgUVxqQK2mTly5BcTi7QndWd8uJDtb92RLdY8t9/f\nFRumUOQFiaLEHZ8bFKbTvAhOS1xOsojxmsjO87LMr2iz700wsUZfLqd7SiPq\nsoakofb1V72QjXKME2J8FgVlXP6rFZDXtlbGHHK/beduut0oHS6AhgLud42v\nykd5w9L76QkyilXo944tTaN0LOYRo+KlF1K3hUTopXt+jOMAk003KAcZZ+fu\n2b31QUM190aQUAiPR6A1rJAlsFUqmVLx2JQ2X2gsvih6QPPj65OMaeVh9LiD\nO5+IRaJX2SFzDXviPsI3MrFVd0KsGS0lORHq7zyTx8KMIiIYSEWPLPKvdvqQ\n1JIA9bgEJIvFyLkGaegF5nLK6NKiUvzZGqORSc0vZFEtHHUXPCNJdmaaVcfV\nZS0l\r\n=F2Od\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"80cc28b0d62560d659b439dd7241beec7018d6a6","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --typescript --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.1.0","@balena/jellyfish-logger":"^2.1.11","@balena/jellyfish-environment":"^4.0.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.36","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.8-renovate-non-major-80cc28b0d62560d659b439dd7241beec7018d6a6_1616698645050_0.8750048825876826","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.8":{"name":"@balena/jellyfish-metrics","version":"1.0.8","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.8","maintainers":[{"name":"belodetek","email":"team@belodetek.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e514076abc5d51bb848d2317d7b96e9fb4346abf","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.8.tgz","fileCount":21,"integrity":"sha512-lW+YuivV7UEA7OiXGYqKBF/zBG6PbYCmhET3KH+rvWj3g7Ef3KuQpGt9lWNo3rd6KYqzhtt+teFLoIRfHbra/w==","signatures":[{"sig":"MEYCIQDkaVwAegoSXmqmk/ghu03e6YZ8lkyoWmctvN0s2wqCVQIhAKzeh8O9lNWIZMbLzn2E6zklupLQsmMp+HBPVobyU2sk","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":132726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXN3jCRA9TVsSAnZWagAANyQP/AnagE8tNeW0ljUhrUDm\nNDSidf/FvjcWcX/dyZfvUik13te7XKGeeQYvnUoMUXd6dawVs8XsPmJMNDI+\nKGjTJxkxYg5A+npQ9H4KNdKaF8nJv+nEfF4XeQiJ/KHCgafr0zv0//nmRIWm\nUVkh+AHVE4OG1VPIh+fXPOYh9vZAw3kZ4BykzrW4Cs5ArRmv62ef/cJ684Eg\n+8Ky6Lox2S6ukQwDV2J4p9/EbcYW5NzjxlPiBBXO4PZpS+gdU4QDxT2JP1oN\nnKWhORCOwb+TwJz6asvyZ6trbKTiixGiwN3DIeGcLjsCE5NFdMRTrT1j20R2\njVTlRQokpwJq13edCN2qDkI/LbgDf0Dv3EsAXX5ksNo3HX0IHFiE4RgINZOP\nilkKsbMFaQiHr30ciLpypOCoKnhrXKtGrLYOE1BRxhYZ9wd1cNXgpgmP/QbD\nv8lwXetF4xO5vB5L4mjjs+iwFDNkKISp3hYZJoUJXp1tfS0Su7dQZhbCAvon\nuYyqx9adOd0vXCrKQtekhyeLyOKquBBjU6vfDuxVZ5UjnJFFyg/bgPnDEid6\n8AmBALr1ArLwhU9LQcfo2e7LUMUAjNyqBnxOHvefB2dqhGbCo/Pff2gHWIpM\nQ5ZgTHIh7NyCE6V+dugAXjSBTYbmuRcooMCecy31WfXqCT5QC6ttOuC//Mww\n/wuW\r\n=28eU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0291c6001cbeb8ff334f97aa6917d10bbcd3641d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --typescript --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.1.0","@balena/jellyfish-logger":"^2.1.11","@balena/jellyfish-environment":"^4.0.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.36","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.8_1616698851056_0.967481459462409","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.9-renovate-non-major-466d83fa12475d2858fa940da4b7146ddd2ae148":{"name":"@balena/jellyfish-metrics","version":"1.0.9-renovate-non-major-466d83fa12475d2858fa940da4b7146ddd2ae148","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.9-renovate-non-major-466d83fa12475d2858fa940da4b7146ddd2ae148","maintainers":[{"name":"belodetek","email":"team@belodetek.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"14a13e969d48ceb67be963cd8173bf9af5a777fc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.9-renovate-non-major-466d83fa12475d2858fa940da4b7146ddd2ae148.tgz","fileCount":21,"integrity":"sha512-8K9UyVmo5c8NlA/Crt7RSLxX8xsOxlqx+uVDBf/Eze6T7EWXJS3cNxWeVtykgi8DLkWdZZrI4GLDy2ig2hMVkw==","signatures":[{"sig":"MEUCIFkG4Y1g6ghUfKEzvMwHZTU8i87vMGDfon9U0g6HR70YAiEA0lATyn0uyXMbJ1DK6Vj88ISebdhhc7BkqKDk0dw8dLI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":132851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXQd8CRA9TVsSAnZWagAADUIQAJ0apKd6gGdwbY6MbTBM\n8j4TSoOHHY5bjaae3p6Zvg3nJvZMrG2FFcpN/iWRSexVVpQKpBJL+3q8V53G\nn76mlO00pR0IEbBzNHgVdA+pztu1ONx6RnpT7Lz0X8rKDFJKIQSh2cFpeBvl\nEBYCfbLr7DuVzGzQ4wuhRgMBf82iHFurY6tloHkhSE76+7eu5ZAWX6Lp9m9e\nlRKhIoe0FVz0qc6TYAsvRjmwa60qXsmqTivQ3CHp9Mwhe9XQ9xOWvJB+7Vek\nm5ImG/Wrb4V8IaaptR+s8qe7r9w2SzilbUq1W8YvHo5B5iqCI5v0JSM7FLJN\nviG8efugUmpVizAkqGKW2urNt54wN9D2Ma9i0hghXajNXlJsJFMiLrr3xi/C\ndV1Q+l2DHSLeJtDI+2PgzeijHcPDT5PWR03MOI4OCzjX6Vt0j4zXORUWny/4\nYo9Q1v/Lc3w3dViGroPcflbpaig8huuEigzPdFt9QzG1zrOGTWOAo8LYAVOL\nbx+EOsrcfDdA+Bc8OJ+p1rWAZTZX3yLD3QgLavW09q5dfNVixE55/Wzhf78c\n27WtFH/TfcT7B4GisGOJs7OhUrVwyrUqWFN9vYi6+iBTRzC66gpUTkJotry7\nQyVVOwxhI+Vr/E8j8zUt4Q1arGEEk49QLl4astin6EBCics/AaArjVn9pMYL\ndkhl\r\n=HMzr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"466d83fa12475d2858fa940da4b7146ddd2ae148","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --typescript --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.1.0","@balena/jellyfish-logger":"^2.1.12","@balena/jellyfish-environment":"^4.0.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.36","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.9-renovate-non-major-466d83fa12475d2858fa940da4b7146ddd2ae148_1616709499499_0.9985634794152662","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.9":{"name":"@balena/jellyfish-metrics","version":"1.0.9","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.9","maintainers":[{"name":"belodetek","email":"team@belodetek.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6addda4e5d695573488a0a362ae9928ba8e3a64d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.9.tgz","fileCount":21,"integrity":"sha512-8ITOLMQYZYJLBJbA6aYQYccv+Ceh28SjUg4CC4xtZAQn+jaKk2YbAnF8DNV8gWXNhvX7RodLCoJWaamiYj32vg==","signatures":[{"sig":"MEUCIQDkLFYloVY2vBOu9fTSHIoorSktC4UoKJx5v/86F1G1mwIgWNWQAzx63obRV//TCq9++AZEntBvrciY7GXlbRURnh4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":132791,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXQhXCRA9TVsSAnZWagAAV88QAI2QoP9zPCgM8L5obx25\nmWStryY6YL7Jn5EptWhV1zSant+r84QIRXPQiVMCyvxHVhc4KCKv6v5b87Pn\nVOQtILmy/XDi7XHrYkHbsFswiF+L7hhtR96CUAyFK7PBmZm8kxYdKoSBKC7d\nA19WQN2ksP8VLRlWxkGQ3vgnj/mC+oeNKZhwQI935tv6ysLIroK7PHM2tj5U\nzErqRSFMuTnRpDEEWtHfzbvAk8QIiyIG1BY4MO6chIiuBP2HAJm+ZadbfdJ1\nD1uDOM8x1lKZClNpW6osxYYFadkTrfKEstLxn7KYv2uE5RDmjaDq3m8uMHW2\noimF3LfGjFP43WYMar1ZC2qvzhiPPW8ILQoRZqhx5j9/08L1WsNWfMflPnhk\n4/1bbNWpsMowxEfJuOb02w4i/NgXDc7yowN1v2Uo5i7mM27nTk59f6aM78wz\npr72tLyVtzue2gCHLNW96/7NtLAGN8NcsRIdai/jTxAF9cklnhgkWxv9TWOJ\ncFvcErYnyzzgzsljTQiLbR7HrhmrvGzKezGehJUIkfOG7O086iDnSoa/xbTN\nvbBvQMrmdzge8wpJEcN/d5yHlzAVeyNCgf2TdHFTmXdM9R8CnSA8fJ2xBsJ9\nn2lSY+I/uJ3OCyuX5n2wfcT/JlM9v/jAIVqIvn70Xme7bfNl//K89hHnxTTs\nIuRU\r\n=6Xo6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e5f272648ab2580a6f387baeb66b77ec963bff4b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --typescript --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.1.0","@balena/jellyfish-logger":"^2.1.12","@balena/jellyfish-environment":"^4.0.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.36","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.9_1616709718247_0.8477010685713753","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.10-update-lint-staged-299c9b50d04b272cf0b2cdd78e78da23373da219":{"name":"@balena/jellyfish-metrics","version":"1.0.10-update-lint-staged-299c9b50d04b272cf0b2cdd78e78da23373da219","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.10-update-lint-staged-299c9b50d04b272cf0b2cdd78e78da23373da219","maintainers":[{"name":"belodetek","email":"team@belodetek.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7887f3705463cd4a4998e2cf38f930ad68f1be27","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.10-update-lint-staged-299c9b50d04b272cf0b2cdd78e78da23373da219.tgz","fileCount":21,"integrity":"sha512-mLJJSrjCTKfMd/KdjJubw45hdhvBZ0lDoJrO2V0pJwyxugV+fOnCL+y7AytwlsqeBLGXoydphdHVeUQlt2qV4A==","signatures":[{"sig":"MEUCIFFP2KaG/2bLX6m0DU41PL9YVwPRYisPHWZzbhwia5bMAiEA/c1dhRjs19h/ikfiQh4TrWQzzZ7j9abOSCl26Zh10K4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":132925,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXSsxCRA9TVsSAnZWagAA1kAP/jhI3J7tWMGx311M0ekH\nkXziHNks5MjdaB5O+q/31bR2brgQCkMZT4BhJbBPc1HX8NIBgQNpKmNPSqb5\nrrhz6HoAdIZbjKUrPJWandWtUpsJFzog6KuQLdVXmv70V9tUU/j+wS82zcrA\nSWfiD6ud+dZpf6FWQJVve58eokaYLEQDeFxUluuCAkcu32iqzSniePlYLjWa\nULt8lXZ+Rnw1mvwmreLHmZn9Esy2e/3opdFcI3Ab43WmwZXF4AhtpxYRlOBM\nC+Mn/8v+BFNDFtGpF/Wp7Tz1DlAIIUicowmJImUJljMozs3atu8iaLb2Qsvn\njrOs8JfOkyehaC/ogIsUd3414jZcPLt75AtR+TAvIMY3EBfWLYPRwqrgl0LA\nIHt0ZH2K6u2VVrrJckqduXa9boc1lUoPHvxO+Trqf2vbsxabJ3q8//YGfqTz\nU1giZAGNy8rs2IiMbD/cGYuZPKRxjhbGDsGl2Yy2++Uy5gqzGl4l2R+Jg/rP\nTYb67e8zdffstvyu9sdX4LbrJNxKiKU5N6Ka0VRXlb9jdGCC/k1qJGGbYGUU\nc3rCVAlI/OcSnNFQxifQEHSRwQd1Hagu/aEILrkLCqPm7TjlSD/nRNCJvu+x\nW8P4J51Zq8LGsDdglOQvoE//rdFtiauDgKahZhkXhwTQrU1whwucS24HnsCJ\ngUX2\r\n=dqGL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"299c9b50d04b272cf0b2cdd78e78da23373da219","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.1.0","@balena/jellyfish-logger":"^2.1.12","@balena/jellyfish-environment":"^4.0.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.36","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.10-update-lint-staged-299c9b50d04b272cf0b2cdd78e78da23373da219_1616718640674_0.8420584817643937","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.10-renovate-non-major-4d0b67534b51b18bbdd8685e430c8f134f165b53":{"name":"@balena/jellyfish-metrics","version":"1.0.10-renovate-non-major-4d0b67534b51b18bbdd8685e430c8f134f165b53","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.10-renovate-non-major-4d0b67534b51b18bbdd8685e430c8f134f165b53","maintainers":[{"name":"belodetek","email":"team@belodetek.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d9da26bc5df230d2e540af2638d66f71beb5be7c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.10-renovate-non-major-4d0b67534b51b18bbdd8685e430c8f134f165b53.tgz","fileCount":21,"integrity":"sha512-6miYlduKcBqqBKvS4XCuz6JJbLlQKa37E+pqON0NztYVU9OpCs0rld2RRvMSiKuSDCn/KgcLre6vu+P/SL4JhA==","signatures":[{"sig":"MEUCIQD5TNpPHexAlV9IQW3pjtsgFOzJ76eoRhvzub2J2D3aEgIgRrqJrZVN1EoaeDcFnZeb7S2QsTXUDeR9g1qGN0FST2Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":133001,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXVOWCRA9TVsSAnZWagAApjkQAJCBNZs1N9+KrYcv5Ac4\nDWULh0f7YxVXkURs7x8z0k5KTEGrrrkvQSdUY7peYLfICwePDyoWvxGpeAmb\nSSblOXOAKJmB5L5E+wdxR332ehg3QoYgg8wj/hCm5L1+SHZz/UFrVgRDcMo/\nbRCXWUY8VBAZYuXUbCLP0hQ+kesfHUDZT865njY0+mB3pECM/ZmWoMWu8vDA\nwIjctj/sE32qiNR3eEkUr2RwT6sIsHIr+9wBdIzPPXADQW9CVxVi5SEUwMSs\nhuwB/tDBP0qDIDNpoLIXklt3oIkXg/lSZxzaNZKkUNIxLiz9gnw0wkJtyByO\nVWWGq8VTxYKg3pTeFxJxoqW7vA+P13MOStQsniqfGiQaV1xc2/GTwXWPMSj5\nukz3HPHwVhsCe/xhgAXsXqqhFBeFst/igdDz26kE+bF/2U96YHBh7auu13k9\na5xxP2L2wrjZN9PJ99JxRGdH/elpXwwpN6DHKW91PWWx/d0ZLb4m23pcgpWm\n7gXHS0VsN5sfE5ylv06ZT0TfSrVQwmvMUMCCy0YwYSmnp/BC4B32C6IW01J+\nyTfF2JZfhPco47wDbGmPhfZYSojulj1wJexBM83bbkQgQpTzm1N/JubP241y\nBlu+X4vWZVXDQuT7jIReIkHXrnmYAKPItwZQ+0mvap/Bb/XbsTO2BX7Gbg2P\nxIqB\r\n=T1pO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4d0b67534b51b18bbdd8685e430c8f134f165b53","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.2.0","@balena/jellyfish-logger":"^2.1.12","@balena/jellyfish-environment":"^4.0.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.36","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.10-renovate-non-major-4d0b67534b51b18bbdd8685e430c8f134f165b53_1616728981910_0.8073205809663235","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.10":{"name":"@balena/jellyfish-metrics","version":"1.0.10","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.10","maintainers":[{"name":"belodetek","email":"team@belodetek.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0cc4caa9d079fb6388c2ad0e7a809f4809743c77","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.10.tgz","fileCount":21,"integrity":"sha512-goyV2icbHxN57O7Viac7ehWi80qQKcfzHBUb2xnFTfq212VT/oJnjXedk2BSMqR0/wN/TzEv8qV3QW6DKSc8KA==","signatures":[{"sig":"MEYCIQCRkw8vB2g2J/KRs7FE2a2qc49JKNd4kEgCOx0FfYRidAIhAOzcGgevh0hWBSSswmjRMNJJyaNuG1jmXik7WbLMGuTX","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":132941,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXVRJCRA9TVsSAnZWagAAQ0kP/jn6yyNHWDImrJcRVljD\nyVomdXWchV5ew8KkTI0cEAynXLkvJGNa8SmqHksP1FZDyoIX9vcEZvfDczqt\n5J2P4Bu4qqzpqpj5uvUFau0p69ojgSIALTRgUP9evzbbA0lbBVHVTx8zDjPf\njQLiPvy0b18Jc070sA5otgDauetgW4EnDE8di+kGX7fJEuLVMyFxkl00PpWY\nVJknC06wSOxN9diH0/QhCt5LCNnw0auiGmvMhPc/9hV435OGOQt6c+eQelVy\nqCj/Zk+Ay0tzQ0g/tjpL7f0Y79nha/Z3Xm8q0Xg5p1wkBoNziRhpruJkAr1f\nWAcRS4O4VmkmoWkINVU8LkM41/3MvmEUc+Bv4SdNPrf8lhhCCcbwo6vnft1v\nX7BSFofNEv+0hbqtY5iP4S79yCxmr2QpPe48j4ErMYhuOxhFj8ZM6zc3m9M4\novSmMp0BodqgbLZiaINk3rbjhePyPMKElzMJYOYZ1g/6iTVeQeHIKlvh+QP4\nKqhMOsNAgbByEjMLooguLiOP48FAxFwixBvIZa9BTaP6p2DhjrVXo4TXV0Y2\nc+hcRAfr9RtgOY+zWQjDiD1IIs3mA15POsUtq+LfjoAZcZGqbigP1lBWsxbp\n0E6G/tC+nw2kAhH6MBtOc+Wc4daVHD+mwAghhN93NIExz56eT4qUHhlNbkO0\nTID3\r\n=PHLd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"06ff31d46e76897ccd9613895bb7ddc47c4e67ff","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.2.0","@balena/jellyfish-logger":"^2.1.12","@balena/jellyfish-environment":"^4.0.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.36","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.10_1616729160563_0.4405804444871202","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.11-renovate-non-major-a4e66f5f524e133d761489f36102c3defba81179":{"name":"@balena/jellyfish-metrics","version":"1.0.11-renovate-non-major-a4e66f5f524e133d761489f36102c3defba81179","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.11-renovate-non-major-a4e66f5f524e133d761489f36102c3defba81179","maintainers":[{"name":"belodetek","email":"team@belodetek.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2e6e5488f3afaf6238267ed2c5f57b01736c6774","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.11-renovate-non-major-a4e66f5f524e133d761489f36102c3defba81179.tgz","fileCount":21,"integrity":"sha512-m1JSgMOU0v5Cl0iavNo2IkTP+0dZ0Clr3Ibl7ixhgcKWWOZOAY3uOARcfS++vQ2c80oUFHMu3D8ZbuhGCeQEIA==","signatures":[{"sig":"MEUCIEeNz2do32u0V90dXrqJaFHAYPgUA6Dvx1P3v4B/zm8+AiEAkSsuy8Uc3IWbfWUJ58Lj+DpShZLGQDLBRpBnSGXOcNs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":133102,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXXg4CRA9TVsSAnZWagAAKOUP/1hU/4+yJLYms5ly1WP7\njo+wwBQmxGqTMbOebj59U/rvkkTTFaerGLtyQQDSYdhMqqDahIaQnTIvGpoI\nx6MfMxpdwKm4rYf1hdpLLDWdZAm1gfTOnoLOVAZDwFI6+zD0vRSNJ4Z+Rths\nY32LQj0O9wtVRPUA+8C2aefgRDCsQ65P3BHWzhhrfa82qxmwZmTRcYmCXYZT\nLfKDe6QFdybfHBcBAWKEl4v1IOyMgjSCgBmK0C8mNfBqN+mOO1X46KANWgAn\nloYoI1DTr2EuQPD/JGe1RFEomYsN6R+nb1eUK3x2VTl5MFB52LTSulz4QLGK\nfrRABq2Wcg1aVEcknuzfqvT8+4xFcDWGNlVj6O1tfjSin5tlYEGpbhqJ04wi\n0DqJJPjG4Z3pZqKHloM78wr+bqvzzL48q2Wae4qmh65tQ4xSgfEWo1eRm3Rv\nxSscLBlLBNmcg8h1/juEsGmNmtjywTAGLTDsMRyMEwIITricRqT0DclovnGZ\nI0ioKnLOpkd4+E4kpGFQveK1OaWujoK2rltyty8zBZUdBZs9d20aT16b6jDa\n2f44AygEzvkhF108GtfFNwFCbRfDNRrTsrJil/povHB3CKX+QCyIMl4Sfbm8\nkpXpxrKeDyg/6vjYhd+O3vwPZHSzwyPd0WdqD5NHXzzWU19Po6Y59DBSCdV5\ndZiz\r\n=Q37t\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a4e66f5f524e133d761489f36102c3defba81179","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.2.2","@balena/jellyfish-logger":"^2.1.12","@balena/jellyfish-environment":"^4.0.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.36","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.11-renovate-non-major-a4e66f5f524e133d761489f36102c3defba81179_1616738360037_0.44197034846947925","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.11":{"name":"@balena/jellyfish-metrics","version":"1.0.11","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.11","maintainers":[{"name":"belodetek","email":"team@belodetek.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b9ba93d6d94d7a27e7286d002162576b4c57d4b7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.11.tgz","fileCount":21,"integrity":"sha512-G7HJ99cuUD37MAL/PAkxzf2QgS8dfxFhmrbSzFpa6KIYRNyCtVYiS7+6jZYhzQmf8U8hMnSbfEvdmDizvDtjGw==","signatures":[{"sig":"MEQCIBhT+pyK3A4iFvbpRvt6YWkLUiKFXY3zJYjf0OS30uVkAiBkes3RkHdjy1QgfgFkW99cSKar9YMZzXxRDHDzW8s+2A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":133042,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXXkSCRA9TVsSAnZWagAAhGkQAJw48/u8iUFs3o5S9SFw\nCdidqELpDpx8snz3BpjhUS2MHlO4vVjoEYL7qRCPMX1u7EGHnfpR25n4cs6i\nn5fZXnsmnfHWPrDyH6jGMtUCBTJkTN4TGiY3WRdfOXXIEq9EKW/8kKUXhRPq\n3VUIGlsPQwtOClBNoiGG5gwufDyJd1lJ2nRTp+azsECdjSjglnNohqnXBrOZ\nIQelrChf6aUNqWadNmEcrN9KBCDgrpWQ2BqqGaEgC2m3CBGMaXUUG0BO9m6T\nYlzm64X9XcP4b/Tk4UMojXWYgg+9M/LjxVDlDM8qWjHcjTtBfFcXRhmMDMn3\nDWy5tQIN7Swmbz0BMgAmgnolzyjCgjtlC1aXW+WRggtxpqEUezUsNLvdFMZA\nQH4A5NlO1Sk6wk7TfODP3qrhr3NqyEWePuU65PK2ooOV+xzLrzzpHOl4Nawn\nuNOXRU6/iKdgoqN3rAXKKDR+SLhds5IkY2eZOviI3bPwUOMSF8uyKqAIp0Y8\nDdqhbUNITKKdBgJqaW5SSBhSLWWSlJkNZSx/ZLmZYH1GPwXocxmNJFWzFwGz\nggVnmUbHXk0MUSlOxwYV0DPJxYsdwnw4iVz52L2HSB0qEFwDhHvOvhF7DH1j\niT+1McIPMWk4MHShF6vZgJorEysLtymY7dictaD0GeCG4ui7DxxDttQho9nq\nl2dq\r\n=wwkQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5f051d09554627f8318ec5384b2a02846579cbc0","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.2.2","@balena/jellyfish-logger":"^2.1.12","@balena/jellyfish-environment":"^4.0.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.36","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.11_1616738577551_0.6578074088777408","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.12-renovate-non-major-bc1106ce6c2876bfca9d2a251a0305c61246cdc9":{"name":"@balena/jellyfish-metrics","version":"1.0.12-renovate-non-major-bc1106ce6c2876bfca9d2a251a0305c61246cdc9","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.12-renovate-non-major-bc1106ce6c2876bfca9d2a251a0305c61246cdc9","maintainers":[{"name":"belodetek","email":"team@belodetek.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"762dadb9a804017b34144caa40f648c0e073c30d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.12-renovate-non-major-bc1106ce6c2876bfca9d2a251a0305c61246cdc9.tgz","fileCount":21,"integrity":"sha512-tt3lwxHdnngdn317M1NAnjt2eAnk1Rk9gHSjW6Pn2OkYicgsNMwhoohdcAFUP4lEqiLAwCgQ5Z0g8s7tIZcYRA==","signatures":[{"sig":"MEUCICSwTmTrhVeVgSG+1Vmv5dlYHBAb2e14DyDipSP2f/GkAiEAgBZd43HewSCfaVYgte4aOQf1XSuYSwWkQ31AePcB7cA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":133203,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXdtuCRA9TVsSAnZWagAADYgP/iF3slhjg/LYzgCf8+Yc\nV9N7mu0StDHdZ9xZat5ucqkoI/G7NjA6F9t6VXkxxQpSOTFDdc2hdEemvHz8\nZ7zjQlt+pzpBr5t1hOdxG+3CQLniqYDav1u/x3EJct38gj/hdzvuM0oeHwJ+\n/gjaWfZRgjPfoX5+ZZx36sdU4bIc7sccy1/cwGy0cOKp6JxcFVG9Td4Z/iAG\nL2epDL5JNaZv1eeDVoF8R1Zh34QhPxiNvKZlaG6sT2uEGlaLPfiUqBwizfL9\nZLejPq0R2GWg+yTz54EG7tmOcEgW+GyvM3DcsBs8pYLK5c2SJpHfPLc1u69Y\nHUh2262XqneXQZR9f2w0Wy1LyouTmnGkH0vm3Q84wsQc4581RVN1d6qbE7q+\n9O4e59OZvPlnuwAk02HTKeLFLsL8syudLx8Py7FSDr5kVwp2K0ubCPfGfCLB\nvZjKJvS8+iOnMv8hVJrn+5H/4+oWwi0m7jPr+cNdeoyKcCr4Cw8kUdUFYSca\not+DaAz3Vs1xY6rejBTfJv8qQcj7Loey+sUlPATQ6sA+T+uo2eAwHTUdWvYA\n7/+d1by7PBa8lfoy0u8pLmUetOhi54B91OfM79mwR0V5p7mfmk2+f/ixNcKM\nqh5k8rBzChp5uqybpG7UZ4yEmx/B1Tn+t/IXX5DvNuTYrlv941Ec/42NJpva\nJrs7\r\n=gwCW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"bc1106ce6c2876bfca9d2a251a0305c61246cdc9","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.0","@balena/jellyfish-logger":"^2.1.12","@balena/jellyfish-environment":"^4.0.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.36","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.12-renovate-non-major-bc1106ce6c2876bfca9d2a251a0305c61246cdc9_1616763757794_0.9419038677059055","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.12":{"name":"@balena/jellyfish-metrics","version":"1.0.12","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.12","maintainers":[{"name":"belodetek","email":"team@belodetek.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"97d726b556b24de61df564aa552cea6b3a1f0070","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.12.tgz","fileCount":21,"integrity":"sha512-NSKnEJPlxglL1f4xAY2FfE2dBWe3e6bV9UgrbGOF7vIdKaXk4EekewVT5WeQSL98lbc1PxiJgiMcMAM5eHxhWA==","signatures":[{"sig":"MEUCIQD1OD2Z8+/gb92wFIpGHBj/kn4qJeQMM5l7el47RlOp/QIgZB96N/8cDq3HISnWwZKcFqJ/KaLoXvbpQtnVWRe1MGs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":133143,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXdw+CRA9TVsSAnZWagAAHYoP/1u5CZGVRNf05HGHACOA\nIfqc7vhfSkp2bNwOWOh4vUUm0sTpPaS7L6bA5lm9oxL+b97KFA/fn2Bw885k\nnWW9DfOfSBZ90yFAnkid6q1wM+FHuHPNoFLbSDzVsCLVYaLB3ip0RGLQ8zHW\n/P0isvfRvHr6+0gF7Xf0zOcN+LKomY2VBh4MgrEAZmFYi/66JtZIvYwDc0AY\nBqQo5ZlOezpte1ybzEiRfhlSboeaWu7DoXjQIARSPdSXyVUyccS9qmC+7wu4\nsZmirn5wxDjWVL82RLOvmEtBoy1F36fn1PjuHVWHc/uv+xTm4ixt6qhI5RUt\nWs9BdZL2x01YViLNS498bJabpPosJCDSEuG7RNwk3iv/hDxCQq/rzlzA7LgO\nwFCbCIqqeR34IYobXffBM7B12bR2YKoH9z1KU09RfWXpUpGOxKP7BntPeqUh\njF2X7TpQ0AD9T1QThFCmVb4WgdpXEXEF8NgvXIQP6suYL4fqcOADl4ATclpe\nMgznvgPfIZZhbqIZyQG5pLaN0kG43X2dgZaleMLrIRysQl/wezIIMMa8JK+/\nLYIvljgLhEclWUIkhp0ySL4elBYijSD+welaJ9i37LPNoWHJshIKCcySMGOJ\nnLAZBjn/l7IZOda6vIKty8W7MNL+jRVrzwTfbIoFmARpDJ+a5djhAZtZZ3q4\n/ODa\r\n=d6YT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4f5fdd10330cfb6f434efb60d4b36cb97f7f45a4","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.0","@balena/jellyfish-logger":"^2.1.12","@balena/jellyfish-environment":"^4.0.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.36","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.12_1616763965616_0.4517391999704514","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.13-renovate-non-major-50540eaed66e0f11aa301d42f75e28f71f2d07fd":{"name":"@balena/jellyfish-metrics","version":"1.0.13-renovate-non-major-50540eaed66e0f11aa301d42f75e28f71f2d07fd","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.13-renovate-non-major-50540eaed66e0f11aa301d42f75e28f71f2d07fd","maintainers":[{"name":"belodetek","email":"team@belodetek.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b8c4cdce08e03008e8c2134978e2fa43f2531d5b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.13-renovate-non-major-50540eaed66e0f11aa301d42f75e28f71f2d07fd.tgz","fileCount":21,"integrity":"sha512-CA+JLyfOrOtRYoNBxpQqBTFq+xKQvKsKHNeOTJX/0ViFDlMVyuRO8roHMyMV8GMbGOs/8lZ0yZh3myNKosYwAw==","signatures":[{"sig":"MEUCIQD1jbedgnltPJQTMk0IM3wrfHYa96BjWki+HD3cAVUYnQIgcNfwZeCh+JiiVHfPEz552N1jNQ4Tmsz5hEEkQ6uIugs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":133295,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXoH3CRA9TVsSAnZWagAAIAEP/0QHISnLygCPKGKcpKWY\nagl3hQZf2TI5FVhW3tEnuRaOl7mN+SHHF4AwdLGtBD9qNjxI+lzu997i2fqS\n3PeFs6JnqUbBeVioX+jXG2PilBPqGvEEhE6YpmeRNumvPPPFaD84jXlOFe7N\nZ3a5sFHkvWrdNCeuwJlTHCPws+LW3NeZqGFi1sELFkQ7lZDEsRIykGVQ7i5T\nWdZ3paAxlUlSiVjEejFv7wI7BFX3vX3KiBoVoiDPPJQSB7wXWUwB7FwciDmF\nyTu7y/GANWEznfKGamX59Io6ftez3naGTFWtwQGpQ1LLfzWuwcrQ/bDLGMrH\nBzgZyobTF9h2zRNwzWxoOx6gEE83PTjeQjUuHnyjRLEBu43aCUNqSspIyBuy\nO3mIT9P8mPWDls4QBUOMr6lKs50RdnWYbgwMfvxRp2D+6J4JPwHiVXd5hf3f\nbhFmwgWMJBHXgTUf2cUw9cZ/kmf6VjOc0YLqhKfBrIWKQBmWPHeAElhuNvUW\nZo1tfxDkkSOW+mwmogxUMCoJt1QLRP9HHiVYvirRyP9iC8kJOAYHz63aXp06\nk+L38wJnxC86hhQ0v107WfW/uwecwKA7sMWjgBC0QPnJi7+fpo1W0493VBSv\nuPC9Q/pW+O91ck8PBRyD1830ipwBJHXruBnadDg69ediVcexkR7cmc9iG9+F\nZP0J\r\n=+M5x\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"50540eaed66e0f11aa301d42f75e28f71f2d07fd","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.0","@balena/jellyfish-logger":"^2.1.12","@balena/jellyfish-environment":"^4.0.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.13-renovate-non-major-50540eaed66e0f11aa301d42f75e28f71f2d07fd_1616806391378_0.7606429941213486","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.13":{"name":"@balena/jellyfish-metrics","version":"1.0.13","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.13","maintainers":[{"name":"belodetek","email":"team@belodetek.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"51c7a61c44ac41d09f8f180ded455d6ba399771d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.13.tgz","fileCount":21,"integrity":"sha512-fgbAjUDAOmLLopPO7oMx9vLY5Ro35yevBjc8pgLfNugAxFTUxA50wgi33ImzpdF/gAqe83zyU5W4NQ/vi5aVQw==","signatures":[{"sig":"MEYCIQC8d0yxrlkoJ437yDApIwdL0obEvt6JkDLLDOWU44vhagIhAP1smBIakBy4jqTwEp1DClopoXidwHz4lg8010hrh322","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":133235,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXoK5CRA9TVsSAnZWagAAwSQP/2fpz/u2yoaXzsYkshXk\njB9PhN8L+HKrNL1rrBx/2rdr0qWp85xZ8PE+6s4xEe6AI1bU8EgbhXl0Mo/y\naHY8qSIC3SPAXbKB9xyv8mI0LljP33H52eR4ANAipyUfCCSChM1bM9iilmQI\nR+3OuLjt988KsnNG1bnj7sYtBuASNuRjLCAEd03siUlabNYG+j/5X9uSLcxm\nBRje/J9DrvVNHNfnKqjVipMEF7aesolHIRhqqWyi0VYCBp2nbnhqju+zpGzc\nrXfDfTDGpusidMRWwFEzpeaE7vStCSYSsSe+hnjph4rIANejx6XBMLRYgIsV\nooGbaPF8Za8KfqWTZfygPLpBZ0wCrVYX5ydkmj+buJwr5Lu4wNMKKVVOs2lz\ncdZ34Mkh9TkznqpB6jmBSbW/YQ3XweLy3gvPRhq5KubZRd35o5qy8PVvYAg1\nCMEPwWzAt3ySSlS2yBnMP8afGjch14KaZ5vU7ENO7AKzGICx0eSiBruLqs9k\nvGwzodtSp+Z/PHJbtGpVE0GH9JmCM9gD0atZ0pWRm0LC0MhJfIL2oWDLh17m\ntT6KpUfUjCUr3vv+vqyKrEMa7uoPJZ4NCg9j2XYyDBASS8cBeKBizQbjdMrF\nuyaJFoOjr4kKfssW5snI3WUR1LS0Bd4BE4Gk04/tOqD/+7A1ZOE72/Bt7wyW\n+odO\r\n=BVHW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d855fde1801b0765e98cd98bc6a841919af9076e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.0","@balena/jellyfish-logger":"^2.1.12","@balena/jellyfish-environment":"^4.0.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.13_1616806584681_0.6924820124196165","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.14-renovate-non-major-ace0850cc3d47c26f8f409508d03264081248bfc":{"name":"@balena/jellyfish-metrics","version":"1.0.14-renovate-non-major-ace0850cc3d47c26f8f409508d03264081248bfc","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.14-renovate-non-major-ace0850cc3d47c26f8f409508d03264081248bfc","maintainers":[{"name":"belodetek","email":"team@belodetek.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"693cc133b78704ff63ed5bc8e60c3ebc9834031f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.14-renovate-non-major-ace0850cc3d47c26f8f409508d03264081248bfc.tgz","fileCount":21,"integrity":"sha512-8sPSakMj72ZnZsKkR1rZehigECztKBRwtrTLP/FvoV848HuPD1Md9E3vpN7HdMeqqh9t7kk4ZvxOd1FZQueRyA==","signatures":[{"sig":"MEUCIGnFvOFvt5xyrnvABCP898nxvXxka0uoacemHAbbFhXeAiEAhTppvD6dUwdgTx6y3dMKB/ueOmhPp/jvhmehey3OoSg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":133396,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgYW5MCRA9TVsSAnZWagAAyysP/i0vSWReVu5BPhzafBvG\n5MdhUbBxoRtmM8cpQI7kRGEc6jHQVlBS/R1F6ZA6uh7VCWTfdAei5mSppxD/\nJMKOCB22Hs9VlNRKbXMmqQRzTyFvVJC/og5o4REOvK5QruVMB1jgf+9ob9ja\nQAyH5MwN6rq0h87DrVTpIrOC3VUNvsvu/Yi7n/F95A3TEJ5hTkRhKm/EzrMz\nqynmkP1TKgK+aAUftH8CsJfviCrakyEB89WSgv5k67rLXb9kM0oS9iBdSNRT\nNEmMYy4ib3RPzmbOxo/L6CnpldxccbAa7XVqITGg1R7XnOwnwG37Dp3wddxg\nlNUYer2V0NFNhf+P9wiMQ4B4hw76QBqdI202iHKwxJ10aYCFEI+SzYHETGad\n9LxH87T+bwWhrB/FPAwNalJspSHXpoiNJy0KbnM5OrqS9/WNYwcB7pRTyd7N\ngQ/pqaMFwiRtsILlzJEksqfu6l4/qpEnTp6GYbO/NjRrN54+nuOZAZ1398XY\nRRhJW580Y6EYqTRO71V4Dgty40GW5Vm2v8X86kau2nGpOoeVwbVIPgHQmu5L\n/jmCP36RnaogZDY0AfzVNQcUdrzyvM+2wtfnlT22vLnoCuR+8bkG6A5hX0Fs\n6R6kpW1jii5dLcNDqaXAmq57jmc08SFpqtIxuk14dl1VY+GfEi+WXtBxDn0+\nSQOC\r\n=6/fU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ace0850cc3d47c26f8f409508d03264081248bfc","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.1","@balena/jellyfish-logger":"^2.1.12","@balena/jellyfish-environment":"^4.0.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.14-renovate-non-major-ace0850cc3d47c26f8f409508d03264081248bfc_1616997963965_0.25301241256211315","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.14":{"name":"@balena/jellyfish-metrics","version":"1.0.14","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.14","maintainers":[{"name":"belodetek","email":"team@belodetek.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5c3915732d496bf2a2ad57805a8c4f546c77a325","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.14.tgz","fileCount":21,"integrity":"sha512-fUj8tcdEWLmJ/pgPMhzie49cPW67crse8/q5CyPAelr8ihjbuyjt9usqd6mY5MqV7CcT4TCe4j6ihgo7vfu/qw==","signatures":[{"sig":"MEYCIQDPhFE+g/LkYYRuNH1Ye8RQM0SACeApfwhdnDA+R3KAQQIhAO6CfCxUtlX2l/Djz1CaBfgbE0MBS4xYS06dKkgZYh7V","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":133336,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgYW8qCRA9TVsSAnZWagAA2mIP/3Lnm5mNZLwwJbwhoMv4\nK2yTHcidFwm4pUgylHJZ2CP8Pt2+mO0HU0oX0BeCNw3CRsCF/f/opdeuAJh7\nUEwOttZUfG47XPCbsdRs1ud7F/zGC51oTTRCbvSJP0xWGLWfyfiqfKcocNLt\nMmw3znIOSi1mylptIm2N9DGwAtOdLAH8xuyWgb79ofQ67gcCYcrAcxqf4DDK\nuoL+1YjNcZv7PciebOEweui7S3m1zcge9FxPTJjZfqBf9r9eSV/Izvu+MkH2\nH4tWGSWSywIKsqX3zI2cM6mBnzRl6Oi4Xz7tNN4WKtY4wkyP/aBuDbqOXMI8\nmS7P1v3g3QqlV+9Wzz1xIPFeLTLqAHmggJ3L8CkOhOXn4ljYCsjfSZeI0at9\nioAz0qtjHrVrq2PfI413uxZ7buPDZEMWPVy0XW10JHCamXSNAewDa5omFY4w\nIm3MubVMluuIErrmj5VzAaXBvAML3Erhox+j0hNhV9VfdNeBNvT6FIRdikX7\npYd5sddjF89BghS4HZKHHWe3qUiYu5Riid6u8VdeX+knhD5UoezL2/KJ9d0M\nbeQ6OKfDzHqzap6MB/I5ACqP3HeyISzJcYBOKHOuuG8VGWMnst87Xpx7WC0K\nc+NGRGgnNQfqu+X4KzdW7N4l2VC1hQ4wfuY+VJxtP43xC+shTZ3A5b5o2IE1\nh/Re\r\n=2iod\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"1246bee72bae8ecedb7ad340c619359827aff3b5","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.1","@balena/jellyfish-logger":"^2.1.12","@balena/jellyfish-environment":"^4.0.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.14_1616998186406_0.3770455347453989","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.15-renovate-non-major-fd2fd2e3f0cd19d4aa570bb22c9a6feae408d54f":{"name":"@balena/jellyfish-metrics","version":"1.0.15-renovate-non-major-fd2fd2e3f0cd19d4aa570bb22c9a6feae408d54f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.15-renovate-non-major-fd2fd2e3f0cd19d4aa570bb22c9a6feae408d54f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"aafe3f42696534c9ab75851db37b98ac74197e20","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.15-renovate-non-major-fd2fd2e3f0cd19d4aa570bb22c9a6feae408d54f.tgz","fileCount":21,"integrity":"sha512-XuoMMMTF7eof3RWr7T2cS2v5O1IXQacEH238wQI2suDtAWfqboP2c5EQascwk3jvMf+xIyo7jvibCXOmuhu5eA==","signatures":[{"sig":"MEQCICuALiB87t6q4qNdP/h3DP+KF36EMgnKkdVFQzhHMWEqAiAsJTjQrWz6In1KXqt+CqrIAqc7MXFp+RFEwsi6SSbf1w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":133497,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgYkEdCRA9TVsSAnZWagAA8a0P/itEVIJmLzLjClFY5O2+\n1uo7nuOf0IZz3JiZUAVopC9GnbuFq1wfIvvSKhtOEfRNwbtMeI4h5NXDl0fX\nbwPrXHtz6nCXBWrTkp//E5Tiu1JEFgmqqzIJL5pYnGFS+TYmlDObXXlUAKND\nrAyvkVVAA6X1aZ12oGg66zQ+uatRXcqfK+CGzZYydZBG5fiwq0BrHy/GCX1y\nshoKhzv1gFqEbRy7ms12RtiG7fA+xNtxflETXFd70+RqS+z8Tb6TvN6cp54C\nBO6lg/orBI3WrYQ98xe7Xv9GdDzkq9Vh1EwYTjR+Wz3xjq24yiYD+2Xx2QcG\nGQ61PKI9MJo76CweMqrPZq07jwmrl76Gwdyj0O5w0y5hYXqtA/Grwf6zbfk/\ngVOkZtkfaW5bn82wOrSeYAuculZB+pjJzuTzgHo9uEIg3IFGYhW7WA0ikoEN\nXwBcnXGiP1dOy0Wj47W6hAYvOdko8ta6WlnqHNnXbBbKYmi+XXtPcgM2rcmv\n3/u8EQJuOZh3nttqFauxggelF76xSgpPMexaRZdbdhD/qGxHFhmXd0tfJwct\nZz7PJwgcaQuCuU8BgxdHPCHKiDlPYAdcy1Z43bp3XQvgleZGxO4IvvJCIS3G\nJ623ksvzDnqrNUeIKNHUT1D/8RhbhF09lYuBzi50+DvDl946OA4zB218XqEE\n1qw+\r\n=DDCA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"fd2fd2e3f0cd19d4aa570bb22c9a6feae408d54f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.4","@balena/jellyfish-logger":"^2.1.12","@balena/jellyfish-environment":"^4.0.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.15-renovate-non-major-fd2fd2e3f0cd19d4aa570bb22c9a6feae408d54f_1617051933243_0.6836760195570122","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.15":{"name":"@balena/jellyfish-metrics","version":"1.0.15","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.15","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bfd1539de4614c4ab7d1905d15fdd508ec338863","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.15.tgz","fileCount":21,"integrity":"sha512-7fJBJKKTvjwBFRmO4+SmuC4dkUVWfxMpF2Pz3nt/5M3h3Awr22yJVpRa5Iu9PedMHNry/3H5I6WWM37D65abkw==","signatures":[{"sig":"MEUCIQDI1fRLNrLOB0uelxWnnsOadAwFF7h2NrqRrGYLwOaeBQIgZk8PMEh8IC0qVswLBCZNJDusFjiWAK72L5Ioep4pacA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":133437,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgYkIFCRA9TVsSAnZWagAApyUQAJel4h9Qr64QVEjZA3df\nn35LqLiHyk58mawwOk/Sjy29+d6fwxaMX/VYviadZWFPnwqcjGE0iP1/Tg+d\n7ci8vLjowukbMH6I2JRwgBsazRcsyF1i80unjQ7eSc6NYBKn7JHgw+rvARDr\n1FQ9xhiy1zbqbG/pTxeWy5zBoMp1DQd7S33nbkv2EyJYCNucevBb86kX0seP\nGNbWy5CwUUZm3606i+MyGWtzliD4ZTLFJAqdEdG4kKvzFIaoHBklebKoYCt9\ngM/qbUVVY2a1Cw0qg4R4R1zK6oYOdLyIXNjdXKpVHxSYZA4e4afeVqcVj15r\n4aEC7PJ1NKtTU9nThnIbUXHD4a2s8WU1P82YNHCozbC0ckaPUQiXx+2SLkJW\n2c4UzvZ3dbXFbbFWKEcSTd698Gg03Q//eyPKfkI37BA07WOHzc8cvR9KsYgt\nJwvVrExbb911sDqb7BVtyqG0HBBwchM07Pg4p0cfYNsSb2eEqgU/n+qwYPlt\nrnizsRXsO7UWUbeBioKyi0pFo0bG5PaqImQYpNH9l3IvCCv1WBtVWcJhH3Q/\nA4kWCGUIe4pOqRuMxlE1QqnfMqMwXDvLddeK1wJUvr+Fbv3Zlg8IhkzlHbET\nlgVRm7Lz5g1kt/C6uoSsCLFLJAtvoQtMBxx8pvmXcJSaoHgOE+lRfobDjrbd\n+PcI\r\n=ePHM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"943e48c4c1562f7e6eb804d333eac41a42ca7ec9","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.4","@balena/jellyfish-logger":"^2.1.12","@balena/jellyfish-environment":"^4.0.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.15_1617052165197_0.45422462471303615","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.16-split-tsconfig-8e9f0e3cb8a7538581287554dc85a199490b4c8e":{"name":"@balena/jellyfish-metrics","version":"1.0.16-split-tsconfig-8e9f0e3cb8a7538581287554dc85a199490b4c8e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.16-split-tsconfig-8e9f0e3cb8a7538581287554dc85a199490b4c8e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"df9e05028e8d12503f60b4140ab6632f09434ad1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.16-split-tsconfig-8e9f0e3cb8a7538581287554dc85a199490b4c8e.tgz","fileCount":15,"integrity":"sha512-k9PdeVHmu66m0I14cjFcxZrxDYPOcZ85pavaeQGZPovfQRU02IzLEJ43Q9AJNheAPpkm+MZdWx96n7aXKp18Jw==","signatures":[{"sig":"MEQCIG80inauO5x2kQ4ZZY0XdDmn0IIWVbNpS8SCwMXF0EKDAiBcRCu7CLEI2rH5UwZUElu0SsF71ZIgrI1S+FzZqhbgAw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":78763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgYuhpCRA9TVsSAnZWagAA5UEP/0g0p2WtFS0sep7uG0Ze\n8lJUyImWcTRp8ShNkO/HFoLafAQx0AtxLw/EhKbmMfOb7V4qJXSbvQATadLA\n4T95VU2iWr25r2Zo+UNy7l2aszt4JruYWJ2eaJ5Kdo5ZwBALiCiV5yR5rZlh\ndQeDjGNw3C3Dm+7lR7IuewIow4zLcGghQcnPngVBykNu729mfc8++dAHlx28\nD/tx/BLb/iB+/TvifdczJROHaH1R/Fe4isP+n0QnNqd6krY6+mQ76xqKR34q\nCmE423Ti4yiR7AV0j2+N295todbG/hIOfVbiFZ2BEtydnkjtGsjW9XqcZfql\n3OJ5nXGHii5UxkXmN3Gq3xu8m3gqtAOS+wLzjHgtOvdeQQSmrpZoYDYJwPne\nYd72q/H/4mRy595yYDaAO9ciBHvhrNOTFNHvYIgOE+Nc6ctnPNOcRCb3Mq9G\ntRnJp5Rp1Au9sCgitKUD+gF86H2XhBRFIhjxyVYYFahmZESor26AJWu7RzUL\ngvaL6WsxWZPf32gNfQlYdxp1oAwJ2RlL7GUiilL3CrL+nGmBl+EoD24bsadQ\n4tGSiZ/poM2wfQWYvbJGXFuJMKRZvnjvqVznlw85/l8CBKFwwZdJPwc/4dVR\nJXCdV97udUztn8Q/1obENfEATO6aPdsApZJqyKCEtrHF3vXHuZ0eOgsgH01T\nBeXq\r\n=EAyT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8e9f0e3cb8a7538581287554dc85a199490b4c8e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.4","@balena/jellyfish-logger":"^2.1.12","@balena/jellyfish-environment":"^4.0.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.16-split-tsconfig-8e9f0e3cb8a7538581287554dc85a199490b4c8e_1617094761353_0.8529963367197309","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.16":{"name":"@balena/jellyfish-metrics","version":"1.0.16","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.16","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f90686392bf62d57ef901372383e121302d46c47","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.16.tgz","fileCount":15,"integrity":"sha512-ITeGyDcLXWKM7f9vtz+LGHaXEP87BFePjQqvI0C1XFMoI/lLcwuQ1u8IOmNQUzSC4s44nncqtcjCDrQBKodFHg==","signatures":[{"sig":"MEYCIQCF9U5/+U17A6S3hSzvQXjzI/o99bhd6wIjIn+WlTK8JQIhAIQR8JDXpKEC7CcoRjWw5DdZ06f0V1Xjk43dOx+a+cXx","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":78707,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgYuoUCRA9TVsSAnZWagAAd6wQAJDfOWgjGgjViqfk1E8j\nouE/izNEp766Ci5m5/Vbdo7h5ZyRVgDMAeVwrH7LNzTTSC2PqAbMh9pXVzJA\nOZlqujfM46zK17RzYtwrnhvrO5SGpBqph0lUZ5YJzL37NMSPslqpk2zyqZVJ\naay0zoX6zrbCqe1u0HLCNWp9eiocXwC0UqjwXcfOBzmOuno9+OaE/SD15l/g\newrooWv/iD/4eiy0xSJVWodTQ9/wFW0QRnNhrZdvhn++iOosO3h8vIYbX060\nRDqFawA4YtNTTxySbo9ir9GuKPhZkxxikrjdjFmFxFlugGjbckUj7tdfW/B9\nOt+Pm7+Am/Ub2Yc14tZCYt8o3/9x4bCfAGGL7P3nmMf7/LKsF33/VAeTPSkl\nMvbvbdNwbhQNFzz6qK055P+wAuIObX8kZ6trsEaTPOM5HPEm5CJgB8pmxOBI\nbySIP5XcYoBpQ+qTMk0XXQrItYsNN3eHyWb+VNUtlJ+be21bZotEgvVd4ITB\nnLCs0RbLg/7/sXhk6Zi28+DhPQWG1vzMe4ONXKhSW9X3n3RoE+z9xSGJqYA9\nByXsPpjJP6Ne17rKaeOB/el53GRWLV7JtaE1HH6qE0Pp0OnTn1NUXk5HvD6R\nEWb1pThjfDgQ77jfD6tz3/JqcjVc8A6m51ZWGsF+ME2mloj7LVQ1eKY/e0Ht\niiq3\r\n=Q3AH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4deec70a6ee5d85f3841a79fad55574e561bfd7e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.4","@balena/jellyfish-logger":"^2.1.12","@balena/jellyfish-environment":"^4.0.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.16_1617095188116_0.9057667199381838","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.17-renovate-non-major-3d2be600e801d63d1352cc1b11e37be52d751afb":{"name":"@balena/jellyfish-metrics","version":"1.0.17-renovate-non-major-3d2be600e801d63d1352cc1b11e37be52d751afb","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.17-renovate-non-major-3d2be600e801d63d1352cc1b11e37be52d751afb","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4f5fa81645cb9e905ca736379ba114aefa2ed4dc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.17-renovate-non-major-3d2be600e801d63d1352cc1b11e37be52d751afb.tgz","fileCount":15,"integrity":"sha512-vjvphtRY8oxn0xYU4ANlHcOU2kVRpbI81/8c++tOOks4+/weH+R9eJduPdJlA4OyPKEefOYDbkv44yQTX1R15w==","signatures":[{"sig":"MEUCIQC/4PBcFQ5HmNVka9VYp+rFulibt1nHPUiJycXM2OGQiQIgV2+4mtJw35QpkemR9YwUqrjsWYvL11ia+bh1+4pPfsk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":78874,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgYusSCRA9TVsSAnZWagAAEQwP/0JKswctUosQ9Ww+/Rnc\nf6C6XfjqCtH6+7voIUaQ1Etf62blPXs7G5vsGbBIcW1G9IjcMSvL7PeV+UOL\nmcWTagE2+kUe3sODXFqQR+33O2ryemCOznRDqgoox793pkuPgVXPLrTqQ5B4\ntVFRAnfAXRVlmsCWoMSCivM0zK65s46EUEPtsonsjpy55h2He8qE37EaZ3Uz\n3+ZjOcTLxWyKpDVzDeS15dCOtL9/FSLfmX+W7PeSAzTBiMljpZxvEjcBFsyj\nduUA+VKGoIWUzmWSpbDr7zAS90Q+z2jOvFAb/DeeXu/2w5HIMKU7F9/J7HYP\njAl4OTc5MlDzNWR9WiVqwK7noX4/U96bpvpLb0awt0x1BmxxzIt/FgOFw85/\nBuh3MT2HHpr5Hbke5DuwZr3Poggmf57l2b/X/PNoVWDtInZY5kt7vo/h+zoW\niMs0YscJGBdNAGr4NH4Ts6ACeBVvKuPpkjtuRzUmCFF1CFBgyOXy8g5N8XW/\nss9TLqQx4DWWDoQd4ij1wNuE116emgyNWTz0LgLlk4HaNZhV2zLPsexP/F6s\nRRtR3Usrpq6NdMq9/hXE7WCNE0rKiBnYBiP5ehOCzZIiB2orTTJ/F+7YleFd\n/x1xX7/rvDMOpce8G0EpuWA5XaQXpO2JZo0iJ0/CHzeXbeZOm5yD/VPKV78J\n1qWI\r\n=U+cQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3d2be600e801d63d1352cc1b11e37be52d751afb","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.4","@balena/jellyfish-logger":"^2.1.12","@balena/jellyfish-environment":"^4.0.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.17-renovate-non-major-3d2be600e801d63d1352cc1b11e37be52d751afb_1617095441888_0.5311576399662687","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.17":{"name":"@balena/jellyfish-metrics","version":"1.0.17","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.17","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"19c5d6845d3dab53f87e14f5fc0ef5067b17a24b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.17.tgz","fileCount":15,"integrity":"sha512-BPptZCBbGg40lKlFwGurE77x1uwFVJXnzr+h6dmcs0gSIqUKD7vCnZqy8l3tEjpPgNWhMPQB7qyCY28L4cntmQ==","signatures":[{"sig":"MEQCIEzetCXKOLMlxb96TEkuyCMYGgJx2GI00TPGhnRzCvnrAiB0Bb+099EY+W3UDqlU11EinbmijKmjjt95ULmY6MGPcA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":78814,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgYuxvCRA9TVsSAnZWagAAHp4P/09XMQc8AYyTKfFnVXcL\nK7Cky1Cr3M2ByULwROD9mT4qNglVjGoYAvyxFtIyQ/Mxm1ucirYfhVJFxbnW\nUk/nx+tlqlJqn42WDfFIT/3hKt8BTcGPbJPiC3H9b5AUTbp6wKf99+iOxIci\nHUyef6rItWaJLcBbPYvryFZAit8Ex76fiLaKTVZN231fQeFvYcRE6LmN2R2h\n07IPWe3xKWIcEw3omR+JTduAlu9mNO6Q4vlustWoHs+rF9zYLggeDkDe2o13\n4Q8uvK7aBVWGDPbIqAPN2gBXW8I7vV+uBao8eD+oxwsH1eiQ9EPo7h1r1sv0\nRjB91Blh4Wie8gbBO93qephXJwy6T+1SAX+EJEYbmzfJtHADaX63v4915em0\n7BmiArqvgQgmQnzEM+oGajKxDPakJuyZkP4hDMPjQx+05gRYTfyUOop7UYEL\ntrDCKMtDHmufbsDx5omQk6tqJpzN4VUXMYh93j10Dcukbtu4JHXQnB53cj1Z\nxjvUgt6fYAYKD/r4XV9RGSf+XyPlL2fJiZDWwbfukrEN7AA2kclf+62Dy+pl\n4BH2mK4lN6G9kaX99oHoXohUdydmFNeAVtjyyBtXDWYmh+fKa63JGsg/h+o5\nDU/rjdloc8lX0OlXVg2pP47Ig7wW4/IWtyc9ri941faunRWyDcW/z/tp45Mk\nGWnE\r\n=wEXR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"37c2b27142cf11aafc1a65efc4fbd4423b3c91e8","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.4","@balena/jellyfish-logger":"^2.1.12","@balena/jellyfish-environment":"^4.0.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.17_1617095791026_0.886464672742773","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.18-renovate-non-major-856aa07c64928ea76cc643db826849ed91afc699":{"name":"@balena/jellyfish-metrics","version":"1.0.18-renovate-non-major-856aa07c64928ea76cc643db826849ed91afc699","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.18-renovate-non-major-856aa07c64928ea76cc643db826849ed91afc699","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"94b5152dab7e5a48836801845e8302d0d3aac3be","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.18-renovate-non-major-856aa07c64928ea76cc643db826849ed91afc699.tgz","fileCount":15,"integrity":"sha512-3fIEy6qCAm+KL7+ydK2cHFihkJMKyBptUXHUskqxyNtuR9QrMqxwIz5KJTyrV0kitRcF8sSWNMuEqZF4NI9L8g==","signatures":[{"sig":"MEUCIQCERfZKKsI8UUqJl9PJR1CzTUIeC0K/zuzzDuerrZFkTwIgMtFixLLZKOq9fvPGAfI8bqDuQU/tnFDPPoi8b2+KawI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":78977,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgYxDjCRA9TVsSAnZWagAAAQ0P/2dAfq8AGxnrSdfYEAfX\nTLWotI6nkHaA2Rldu+FJetFIc6Tp8OrqLWWK6LpXPJ0qkkn6ekWieNFX1n+t\n6kjdzdbR/eIqNQUvwWK4Rz0Z2tTdzC7AVIzacbi4wM+1lT7wbgjfINmgR0Af\nqvQFcqoZY3b4BnEaxyZOIIFsr6aiWao0KNmT7XnTV27VTARi9CNbmIxcwXt+\nLuRPKFGf6aICGbJmmL8HpCNgGlP8JL8TVsN4ugkAK6kfrh3Fyn1iUW4f71EZ\nTmvAmp6eVMgQYPhvqbdI4krmXM6SQ0XXVFYOOv+CaGXzGDdf6goNFxTfPqgH\nr+uAFBGZxmrm1ERXyhClvbg1D4drgtO6q+R412ernRkQ9Qy1+WTtv2RCpoYn\nF2ef0urdDjS9a5d9hX4fR9aJ3+vZTAJwSmOjyvoqs0vinB4Hjz2X0yR36Q/l\npDer+RP2VqzqVd5EVhS21oIzgzTZIK3mr+Xy3eqcNkCIkmW9rlWW5kp55VIb\necwJdx52yqd5t6ghqDC8vRRHZeGW8l6mb5VftqI8s5j/6vMimsg4hgOBUMTC\nzyP/ZzlkNBohWBkultDwDI35rtJpvW3tXO3eelw6n3oBd2MiM3ZOCKgjwkPM\nQiwW4gyxCpl8Jvyqm6iTAE1zpzLtr+p5XoVDYRJB3rIgRGxj/4YeFx5nBLNy\nwxAU\r\n=58HN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"856aa07c64928ea76cc643db826849ed91afc699","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.4","@balena/jellyfish-logger":"^2.1.13","@balena/jellyfish-environment":"^4.0.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.18-renovate-non-major-856aa07c64928ea76cc643db826849ed91afc699_1617105122687_0.6332854068862039","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.18":{"name":"@balena/jellyfish-metrics","version":"1.0.18","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.18","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b7b4d998526fa5a1a7b4d357345e8869577f9bcd","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.18.tgz","fileCount":15,"integrity":"sha512-y6wzrjOEwmWEnQLkxFWZgKpHeEXbOC7uHaFkO4et15ZlXc5yiUGs6MnxhcNa1Kmvdl621whtkthefnRuy5Pqkw==","signatures":[{"sig":"MEUCIF619/ehldn7K90SDloYxFBVnXwzBFQUS/Pl5m/TqvlQAiEAhlVNue6W0aYX41deFSEdxK3rfsepmH3DwGOlWRKDAME=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":78917,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgYxHKCRA9TVsSAnZWagAAsNEP/RWPjYzcB+yt6/txDT4u\n3NU+e7i698yHs9ddxCY8uopYZkHUYnE6LCGCIhfiQs0TKEisCqTI0BCk5sNx\nNwQnBNuSW/zJG0Pc9bJ26d1jHW+iFyvx76XxEDZ9NONhCAh58Kh9EYAKuPbD\ncyD2MxdiIK04+yKUB+vzPRN4HsRUWs3EtThg7/YCfXpV4XD+xYkYqyeSLQKm\nGcNyA2u3ZfuVMEVQvE0DeYHCIiKPId9EBGgd+rRqckhImgPlEhM8L6pO032i\nrx+GWmxhVf7jz88TEQMx43PTw3c3iAFf1hEOn3/mxZzStFD3HG0dgQ0jBvIz\nH18HKKemTebFhQDZMThLN0rEajyFfB1Hvu8HMQZ3yGUw0II5wa4VF2iMsDZw\nRN0BmDDhJN//+pncX4+ZW3JSVNsQQcytzqClIXx7+f7y/A9nQdNKd2Ixi3M1\n9k2X5Jx3wruimuXWG73msYeqjKyo6HE3vLep9yLy4YT0nAU8ITY7mefO2XqO\nF1beWZnBCkVKQ+pScR6ezhYliXlvtHLoandkZvdrAOr4ctAASYZ4nCzOUvNp\neLCLare+iTqZCWccAN8WrrdgLcU+Y7gEO1XBqZXKMDUWSHWZoozeYgBoS1AP\nuI+cNsQ2wH3LeqZnTlKGoZS15j21l8/cVvecUE9WUBvJH70jIrTgo+AdDh/5\ntDl2\r\n=3MLZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3626d575b3a58ad4d73fe8fa5e07818b824dc61e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.4","@balena/jellyfish-logger":"^2.1.13","@balena/jellyfish-environment":"^4.0.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.18_1617105353796_0.016877644815106674","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.19-renovate-non-major-8c971c90f769e6abee5b13d29f6ff8d3e9d25682":{"name":"@balena/jellyfish-metrics","version":"1.0.19-renovate-non-major-8c971c90f769e6abee5b13d29f6ff8d3e9d25682","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.19-renovate-non-major-8c971c90f769e6abee5b13d29f6ff8d3e9d25682","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"682f476c91a86a4e9948896541b63fbcbe63dafa","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.19-renovate-non-major-8c971c90f769e6abee5b13d29f6ff8d3e9d25682.tgz","fileCount":15,"integrity":"sha512-qDNlQVcxYRQpSVdkuwBwps3PbeSQ1cx/E7qLbflWBV4LBPZTpfSh+GLRLT3BMpIPYIHOHw+TxZBd5bXmHoXRmA==","signatures":[{"sig":"MEUCIQDTuddGrQSVY0k4KMDJtfMMXsUaxdnTkssR0JFN/K0TCQIgBEPB6Euo0t6kzbVb0RliNKefo6n3q5dZeoZZht64u54=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":79080,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgYyyDCRA9TVsSAnZWagAAK4QP/jSC+95TRJ7Dctv1u+fB\nLDAHueZPE/xD1p/uQMGq46se4Jtv9Pfg+6TsUfaTV7PA6Q1arszEqaNqndor\nhKoeccZXkt5WtvrEKiHBGOASjqQdb9b9PHzp2q+nfEyG6ZYAEh5EKbG+zhJS\nijsuU9Pe97mNzwqpeQ09RVwKiyMYhgXz4TKnAWzik6Y660WMquq0viwZUTiP\nxS44pMEZ63wFCw3bznu+zHVWP0Utxqb7C9IDjuXZIv00I6MOGySZbl2oEhB5\n7vHbCfPH7Dh+RUs2Ejl2sMjaSMAM42l+lkMQUGF31xOgYkKDqf/N4d21cvDl\nLxvziLtdIqLJ1z/G21jEJK8MkjwBHo1FEoIogQU4pwKUacrgRQzSZg9EZfA1\nyLRppSGUZh9Tpo9rqwTytwiVK2cYWcn5oB05Pe9DR0VyR3Dwy3w9whwNTYpp\n7/rWzi27/lpgvwXpeOLciekAe7E3iu1VJj9BExBHeU4k1xORkbu6lG78uLAZ\nCRaEapPUjSWpHDCmoOEG+B0EqyoTi09owAzOfHqktF/OVbThWwIM8IHM2HtB\nvTyDtYzAl0Os/VqI/xWgUL2ZvDbfYRS5KzjHqc0vMwNiuF73ZqhiZufIKmPw\nHUnebFWU/ia89FNk3CKU2W+sP7L2IPiPaDRbx4aQ4CldVl4rGgjUSK7Orucc\nNvhh\r\n=K4WA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8c971c90f769e6abee5b13d29f6ff8d3e9d25682","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.4","@balena/jellyfish-logger":"^2.1.14","@balena/jellyfish-environment":"^4.0.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.19-renovate-non-major-8c971c90f769e6abee5b13d29f6ff8d3e9d25682_1617112194709_0.6854986159265835","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.19":{"name":"@balena/jellyfish-metrics","version":"1.0.19","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.19","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ba6ff6e686481b32b02a4577e020081d242311fc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.19.tgz","fileCount":15,"integrity":"sha512-pf43ABujNOtDOYIjp/+IbG49WiNgu1Ibzx0gPkvd0zryMKikSbewPlavbr3O8mIVq7g7SX0xNEHcCcYAJ++iGA==","signatures":[{"sig":"MEUCIEI+vCwjBII/WDgNUVfIs5WqzPjn34wkTM+onXYmF5RgAiEAjZv4CG/sd7SZBRMv7W/WALBH36yIv8VJ7y8Ww4qCf3o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":79020,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgYy1XCRA9TVsSAnZWagAAfbAQAJbq+SvPgYJzsAoSgYgk\nKB1Z6qJ4jzAUFmqgdlm6SqTSqFX3SyO7mySLCk3Kl3rfKQTABcYeNRZWufjz\nPShEjbP85WrYBrapB8mwg3bt7zDQtWwohKTR+p0kUmBmGcBK78u0cLwTGylg\nG636P75G+cWVV3+0Coah3UgHk21uHUgloUaggg+t9h7yiP+E1opqRi0I/tjV\nN6Z3nl5bHkg3NbVNoo1y0RQFTMYlFVxdkmkds1kCjEmyormJDEv7Yr0Yq+Kq\nNU3mpPIdiqnbK9ev3Xfk8eIFDTSd4+REsXNLYyECYlY/6kjHg8DObG2XKOF6\n6flN4URzGypbSVVilzO8EiC4WDKlL+l0bVvBR5QvOnzphRd4xkfZLa0vflaT\n4TqH9QJX2ooICEAf8UDs5g2lV3RmNbsWsXrhxO4BezyRTmGxaHMpeY7w/YYU\nGuXM3bvsudE2QyjVCevybh/6NF5Ojd0zU1tm/zh2/pS7zyzKECukHhkGIC/K\n79kp8mqJG4FIriKkrTK6UX8a/3XvW4co5cbGCNAVjKSKQJyVdBkd3sGsi9E6\nvwC4ql36mP5HTgPZEPUx8Knfmw92JT+ePWWDlNSidFFFdD98igLeC9nb5Zrv\nRu6PpsgITiEtmuU+wOZRWIP219WbcZvpG3MKMnYidnZ9idttaw8701uQBpcd\nZDq6\r\n=diD0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"dd73d2d2a649cb75d345626cd5b4a918b46f36ce","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.4","@balena/jellyfish-logger":"^2.1.14","@balena/jellyfish-environment":"^4.0.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.19_1617112407020_0.8192003666113368","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.20-renovate-non-major-e36e0f08b3e90ce3cf1b0ccb38e1036531f53afb":{"name":"@balena/jellyfish-metrics","version":"1.0.20-renovate-non-major-e36e0f08b3e90ce3cf1b0ccb38e1036531f53afb","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.20-renovate-non-major-e36e0f08b3e90ce3cf1b0ccb38e1036531f53afb","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2904a254d56ff23a790753f31fe132f6ca503541","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.20-renovate-non-major-e36e0f08b3e90ce3cf1b0ccb38e1036531f53afb.tgz","fileCount":15,"integrity":"sha512-Rykeror6pJTBPiqH+GS+ZITnITpfRdocGIWG16YYglSEPHfA92m3YkmJ4ufSRvXdEwmX4+dzIOaiROsxNCHo9A==","signatures":[{"sig":"MEUCIQCbglVaGsi5RIZZg6SqEZzi/YGrCU5XfsoAmki5E7xHdwIgH1ObDvHMqkRL9rD3y7Yon8Ijs6X1OUWg0+5dPRMmr7A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":79183,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgY8k2CRA9TVsSAnZWagAA+4AP/1UJdczX+yu1tzYX2sSJ\n97TMbcea4S4od6VaMO9FgXV4dcyHlCiiwUxLVizVXYtr4zb8+q0dbR6CSE5U\ny4MwNf3MghSzqca2w4XlfFwWFzsBcdD/3fiiIrfaJAqkoPjUtjoKA9iiJB/a\nuwE8Z7sPIs6YhGMJTLV7jV3x2dt7RWXlsDV633TcB+Zpw5KsU6DFI6B/XDrp\nA0BoRM552Yg7IXxJDjBzbWbD5L/p3TdW1qZWCU91Cm/87il7FigS0dLMOb56\nVsRvdKvI7YheW6EWfqZcJAlY1pH0UfyjkXGDsyPMKLFcdHFWGz9p4YmnaPm0\nNKCjnzES45yq/y4Z6pL1wTjBNp6wENt6OiZGDUstsyUc3m1AGAssT/DeEG2t\nE60ThLfYLlBKR9o1pALUxaCk9OUiXJ5LoY+1/AIBgckMDSHSjcSjHQgPgIt6\nMwK5Er/T2rJLUEoQUaw4S1FBcwAOgaBQAE7qh71bRoAQAlG5aBi1pDtZX+RK\n0VxeTEFCTb8tre9IxeRcDRew/3jGx9nbwRm+tq0dFTJ+rABGy0hay7Lfo7jA\nLpQxl8xyFoIMCMdzj+oOg8hSNeg7764blYmiO4ZBlqo6Ueuo2/wfW+mNfTik\n6ApbRp1eyMzK01Xrc3r/JLQmbzkFIXicbbP85S68pIZVXs81y+zWNfiscPxj\nHAEz\r\n=eVnA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e36e0f08b3e90ce3cf1b0ccb38e1036531f53afb","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.4","@balena/jellyfish-logger":"^2.1.15","@balena/jellyfish-environment":"^4.0.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.20-renovate-non-major-e36e0f08b3e90ce3cf1b0ccb38e1036531f53afb_1617152309522_0.652258008470161","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.20":{"name":"@balena/jellyfish-metrics","version":"1.0.20","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.20","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b67ac70b6e9be1fd339da6a8b4dc5266266f5ceb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.20.tgz","fileCount":15,"integrity":"sha512-FNzCPsTE4YYlKUjV+4mQRr6KQ+r9DAZ3mUBfAOlAUIsSKe+ix++0BuPC3bpqMwmC3qi/bYVrXpa8+Y4OPojSUw==","signatures":[{"sig":"MEUCIQChH8vrpT7KGNMHJb1UtHHZQ2JWGH552yx1Zcd1NFZ+QQIgT+T5pqBXTnTRKGTrPofDH2JM+s44CxEOtS6aZ830IgQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":79123,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgY8pECRA9TVsSAnZWagAAZmsP/0CE+RAyHcFsIFfbjCyT\nQKGOLmsN3my+H+WCwZuUTrWa9cvqTc5aS2OE6GzwQ7KEOPq2mo0ZIiRMFLec\nfgg2gemXtqe28nOQeE4OPuSrGX22BPH4D0JxJq8XcduyfvuxJJsjWouS6zvw\nyBVRx8IAKccNlHV1wcbwlVv7MOa0EMDZUfgBTeQZK74WQrRiMPSDDN3XEMyG\nBpQUUkD19m/hMQtxlwNsi4t23NTIIeWiVnHN2VKlz8qbdx8NmVlSx+8p4bug\nWPagCgEXKX2bed/VJ6fzq9/MVZZE05RJc8MjRIhTcJR+7EmJMg6eCUfww3SB\n50k53sg5HPdxtaY6hxApZPKXrORVw2pBXarjqKz/KMiAwKyFOJ9Hcs0JLXwy\nVo6FEBlirjPw35q32mbowkKKNo3wPY43AKEFHpT5s8qGhELpfqQa735LadK7\nJPumfhSiPYK0QkaS9qbgEWP/mDV2fQPQOqHsWxu90aiSJhnqsGTdwgvt4A9D\n97Edh+CBQ50OKj9b4mPsBj1qs1TAvOkG9YU/tF4df95pl/twInjcyiHZono4\nijKPPTHKSMhqyeKk5IUPGcNTT6cQkWifI0ztJeaRYk7qSFUCzVLpAuQ8Fr7z\n86yphRoJvZWAbo5CJ4bJ4gdS+AYCuFk8nLpEFoVjpJRwf0RpeI1HGxU4pwiy\naaLP\r\n=SisF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ffa7e53df29d5c16b72cb95f3490200fcae6cfce","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.4","@balena/jellyfish-logger":"^2.1.15","@balena/jellyfish-environment":"^4.0.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.20_1617152580102_0.5088391494169044","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.21-handle-missing-type-99d5f5812483831888905c20176940f85233ad11":{"name":"@balena/jellyfish-metrics","version":"1.0.21-handle-missing-type-99d5f5812483831888905c20176940f85233ad11","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.21-handle-missing-type-99d5f5812483831888905c20176940f85233ad11","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0dbf8c4a706691eb60ffb0598e36cfcf09fd9582","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.21-handle-missing-type-99d5f5812483831888905c20176940f85233ad11.tgz","fileCount":15,"integrity":"sha512-WM3Qb0sDjWAeEduXffTqBUMONKfhWyU67xwzV9Wj4A4ug5RPJSuLLStZEJQfmbbfyHFRkDxUuJTfHnwQNB8hNg==","signatures":[{"sig":"MEYCIQDBkFlRuJjbI4AodnS5zHyalVHUtWbMXHoQPfu+Bu5iSgIhAIzazwFLvuO+22jh1oSICLV03WN714YLVVKMTVONLGDH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":79797,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZCrCCRA9TVsSAnZWagAAn00P/AjAXtznH00f82ScZlw+\nRE9UZgtQV3cobCVPl5H5M/cczrmes/YVHFyViCyEaDs1uEanNod0PZVaSM93\nhPKZ3SFqEa8L7y3HJtsjcU9CGpOUsAwuRvDJeX7H1YYLm+h2IJphRTKrhUdV\nRDv9J9GF5uK/uocaTMSE++DL9Xbhnu66qkGPfcIjadybGcTHHwHJj0CGWyVv\n1YfuLqFEnYohxI3Rt7E367eb5vS4p123WS3PaL7iTrxIgtPF0sYHKQ+vlmhU\nONEVZhmEGHxiKFoda6Qykgd3dXEO68dUchYR7yP4qwSKYObUcYaItgaiElWi\nHPVAARexzhYLJaftobiKgKRvyNumraVNUpZvmG3TizPIKb8GbX526gRgRoRJ\ntYJ3pztErgcW89kFPgqO1drYVXsn5Hl/jBjW/0OF5b7gxA0a3S+IVXtS/I9X\nSdLJMHIbU0PbPeATymOuFEvebf2GGHJrWrj1Wqw4rUH+vo2Y4wTKAC9V4lw7\nmSygFGjEDZ3r8HwEunBKy7fro/Dwf9kVfOSSqFw6EHVCUC4UnYv8YjVXh+DV\nDFaTwKectl//tcD1VphNDJudWCCqsOt9lGZiRhYs+z6KLX8a/r2sqJlCaoZ9\notM2BFT4lBQ0Tx+pF77YN5YZTmH3hd7RWZagOOVu+wDrKeXgp+myLmtRTXZ/\nPboj\r\n=KqWy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"99d5f5812483831888905c20176940f85233ad11","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.4","@balena/jellyfish-logger":"^2.1.15","@balena/jellyfish-environment":"^4.0.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.21-handle-missing-type-99d5f5812483831888905c20176940f85233ad11_1617177281497_0.9116331071199453","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.21":{"name":"@balena/jellyfish-metrics","version":"1.0.21","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.21","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"001ba47be9468ebe586a5434929a0ca43eb3d180","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.21.tgz","fileCount":15,"integrity":"sha512-00zBwpl3+jeKv1NR8WxOO0pa3e6Yaskg/5j6ppq06Nipg8+xdiINnoNP7u9uWIg+uqxloLAy/3XyTa8GopA5zA==","signatures":[{"sig":"MEUCICKjHBWkvgZ8e/frgAFY55w5uSJqXlQWATlh2YvYE1DvAiEA20sMw9qBRZ+BBy7HM8jktQ+JQ15iASQmofA8IGXDjWE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":79736,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZCw2CRA9TVsSAnZWagAA6qcP/iXI0tN6UN+7ocwAdig3\n/Qqg8rgAe4O3HAglJqonx39N818/bgoO7rtRw1m4+0HDJC6+W+9Gp/8YBteI\nHuTGWDiYD/RPnVfZGbV4gpitmW1au4KsGe7n9u8Ys9grkwjPpKJD49U+PEoa\ngo7DH3tMLmqJw9uYnO0fWKxv4P0piLlbEdumPq8LcSNNrsyMVvpv5KZ/hcEN\ng7na8ECsMfZSws//ev1aBDBzfUdD8T/xM357TE2jm4UiHVqOt8syQpwI31Dc\nVHZnkDpCnenkjfIAiDzmPjUAVyDjgnncCXL1GTa1/jOlkbaL0NvVnO/fKuE/\nSZUytD5tQU/3hVOO5MCTAswo5UnisXDGa0hBafgS3XgnBo0ovE8Q7GTJQRoW\n1IGDHxgBb4sc2nE6IlUEGt3NfFURyErVi+JciPQlCcg5qEKqNX3ykW08qYHq\nQJGicnLKHTPUuK4l+N4kHADfREfvVDXr87pWNUAsZptVZwlWajfq/JoT8nRk\nzM1ySpz6C0+JT3sgpkX35AiqngfravgPvrDGnvKq6LzJYpJRYHm89ciFwOvU\ngSnWEiE84cz8ujflaDG1YWNKtFuXQEa/Xsdmg2VFxUrUmq+QyNPBPBBED60H\naDSYt5l2RUjjGpxMYvFtw/sp5mFwag2JM64R8d3FAv4eahAB1RP2dy96o3QV\nA22y\r\n=Wwyp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b52b258a6e33815cc34c3d81a18577812666338a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.4","@balena/jellyfish-logger":"^2.1.15","@balena/jellyfish-environment":"^4.0.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.21_1617177654048_0.3143098353865066","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.22-renovate-non-major-6cc22d169097b45ca8a104f787fdb9f30dbeb293":{"name":"@balena/jellyfish-metrics","version":"1.0.22-renovate-non-major-6cc22d169097b45ca8a104f787fdb9f30dbeb293","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.22-renovate-non-major-6cc22d169097b45ca8a104f787fdb9f30dbeb293","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"25d5b28b393675752d0d00cf06161f827cea1604","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.22-renovate-non-major-6cc22d169097b45ca8a104f787fdb9f30dbeb293.tgz","fileCount":15,"integrity":"sha512-2VFTEknqmTOOB3j/tJ+FTGUNn+nGFW1cF+rV2waZmEwTd8yusOKMMwlyUyFCeuznGMogc4BlDHCG76D0I176aA==","signatures":[{"sig":"MEUCIAoV5kAZZ1HWIagpS98dXlzMOuCan3CE5oOSpm4tHijvAiEAuaDShq6eKp9YemJ6cj1g9SQYeIwkSX4wEcqa7/sGmCo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":79899,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZEClCRA9TVsSAnZWagAAgwYP/jpeD+iOlQF7v57fZHV/\nfS6X2+eR30fFtduGY1neemzsI6snQ8KvVpMpxeFVDwMM27feuPQ4PfQnotHP\n8p16Vb5Itb/uJPNxCeLnBx1J2XLpya9O4EU52nxgLiQthsFXmEnV1jsehHag\nP33N0kN0rDZ+31YVJxf+WkilEbYKG5mDtgwck5WQHRa2uh/d0RQw2RtXUh+2\n4gXB/krDyxkB85q3XUz1EGyfSbYz9uJfWHnFNaatK80BiUhxzGBE2poZjt/w\nr/Ku60ZbOBUv2gVSXVBxzisyCqrUxaCuB59X0WWJQVwRHCkDcpHmdk3FjECT\njqjMZd5Wg67+Bgc9WvGLopFdTCeT9yzsz5g64ZcNR19RLYJmNxKLXwwCS/KP\n75UppJ4r9vEP5/AeQoO70hRcW40L5OP1DgZ0Cp7zN3veUzZoHgHuzD/No4q7\np8j8r9xt3dPc0DyV95/Wh3RAbMltZF53P6gXv3VfjE3PfJ5xO9DAakzIRn1+\nqeJ6UAevo4e+l5BJM0CIk4e8Qo0uioFAeex8dv/3011jB8JH0Sa4O63GOl8u\niC5DkUt/dfnO/NWu3uHZwD0+p7MzJ2KNnLuT1RB1Pg6YYnm7j5cppIRjhTxZ\n6FK+zb45AfOurb2kodD9egT2hdlFDBAg5TWtp2MfvNZNBHDP4OgHGQsx4S5r\niCf4\r\n=pMf1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6cc22d169097b45ca8a104f787fdb9f30dbeb293","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.4","@balena/jellyfish-logger":"^2.1.16","@balena/jellyfish-environment":"^4.0.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.22-renovate-non-major-6cc22d169097b45ca8a104f787fdb9f30dbeb293_1617182885475_0.3421816244871252","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.22":{"name":"@balena/jellyfish-metrics","version":"1.0.22","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.22","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7cd69661b90d1c8d06bc1ad9698df9395698b80f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.22.tgz","fileCount":15,"integrity":"sha512-Y875ix0LHv2VP0pfuAPuHUOJZTwlIdvVBO8jy91XhJvWpTXWG+Lq2uPlz7qvJPvKcOWX+pv7aw+yySjR3A7Rpw==","signatures":[{"sig":"MEYCIQC1o1/IbJCIQT/dlpqj7noEN7tGUGjTfS0b5MxOu+ghbwIhANeA8j1FOFYDzdLPvyOnJaAuEKhOzjgHkUkNZ1Qaglbf","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":79839,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZEFkCRA9TVsSAnZWagAAx+YQAIm8OpYOC3UoMpgJxNRf\nTXHRRN3oCEcqUOUVqJ1kRuINosTrLtuO/I3z8ELMv/xbmu0B9ag4aI414/3Y\nGR/ucgsDC5uw6+no3IaK2zzMkrmL9G1D+WwwVeVPi0ohLd9GoH+xEYo29/aF\nKqThzvuwUnIfzEzg1pa5m5+60TOJSFGUAxkAUSMHGoi2N4rUG21T2/3CGtRU\njQYRTzm9wE8Is4LPY2o6sNZksHDjfRMTTiKC2kqyTdEbnep3gMHlyNENtpS6\n3HfLJ8gAv1BKj6m7l1+DtwHn846DXpxwcD/VUqzSS4UumC/y5tDlo8tIGxuJ\n4xb0eqWHGSqnlm0Fm/fxdIr+/EyATBq8g6UUR/xpMxDoBGZemWgu7clks3jS\ntGwtO03jKsAadUUKHwseTJCkfYEtHXVQr5HqFVO29rzun/o5FdRoe0mospMS\nJStGymTYM5HzxqKTHXS4ZbvBevU7pvSOReUgXL/EOIk+ya6Cq+cXHUaFNaHO\nwwwM2EZ/1vWDwUffi/sq5ZjWvqJtjzKPpQTLsOq3PXP2DphYCOMoHwxwcXhv\nVNhW+C31Nz3zbg5XzVcf7KUA8M7NooVmTRRc4t5kj2Kz6q6ietBGg2x6fZ3b\nIEaM3qXPA3rX2/u/kkCh9JfoYe+lmYA7v6sCl8s/SZ1HqHgduTPzgKOyG2xw\nGYWq\r\n=JVeD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"83479ace7a38f1c9dc986b26c04656f2ece8a7b6","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.4","@balena/jellyfish-logger":"^2.1.16","@balena/jellyfish-environment":"^4.0.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.22_1617183076041_0.530113034346468","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.23-renovate-non-major-1254af495ff6c4dbc8c3fb92588450090623cf8f":{"name":"@balena/jellyfish-metrics","version":"1.0.23-renovate-non-major-1254af495ff6c4dbc8c3fb92588450090623cf8f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.23-renovate-non-major-1254af495ff6c4dbc8c3fb92588450090623cf8f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"dd583237f3d6effab146fbbf484cfdb23c1a9011","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.23-renovate-non-major-1254af495ff6c4dbc8c3fb92588450090623cf8f.tgz","fileCount":15,"integrity":"sha512-PSFXsf2FLnJtgoFv00kfocD+kKldADQs0WAuz9lMaEX5yvz8hJwOrmD7hvq8uF9vgLeKyGOzoEI6b1bTEZ/iSQ==","signatures":[{"sig":"MEUCIEGOogLB3WvMv/wEMHmtYXZWNYqEHLnY6nfMvEMtEyVSAiEAn8gJXrreaYbc61TVtJWoFNDFIhyaqeJ2wRtu+oLrNUc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZSDbCRA9TVsSAnZWagAAbagP/2OD1l/K6r4lQWk8mI98\nW70WA2wUBYwJKCJy9zjr5tAHtl7pB4XjTEeRCg8yp7Jh1PYDD8p/+zrFq9pw\n6tN5nKNI8BXhwrRPd6CRMVlY2s26dQG2AclAcnOdw+1YoUeYmzHq0nhVO3aJ\nSP9ac5NXGSQLu1ZIevz55YSglxgItM3Ww0264YClOJ9CEGuPBhCxl4DBNTRQ\neLqDrdRTrMDgzk1yHmF2jR6jcrwDpBCWs6BnQ2PWLAlHzrdyFtyJFFAXiakh\n7nZ622IpPTjpo/bJiYxjjzGLdtG4zLuAKN440PD2Upf/A5Az0mt5wH6Emb1N\naddJvYh0X6gPPbz7cwOE/8EDiI9SgrmpGggDrMw+zjpcVSJwpG3RZeTPnlVn\nk0goONrIJInfHpV154JPz4VV0LRVsP375gjvM33R5pPDONkxFPeBerWV9JYO\nQyYuxIzpIR3P0qAvayvYmBtBku3jl7FJgKs4cD+A42Ep3q6qRlC19SoI8P+R\nKft0oFshgswnVHiU2xOsY1rHzTDhdej4GC9R+rMZAom7xzecZy4NlK6fj3jM\nzP1+XeQqL4Mjm3EsaBlmKZ2iXfNxb8tThnjca2fX+E4rOp5cjX7DVumLn1XF\nGe6Fph9Ybk8wbnMRT+fMRZhlZ3ZfHBAOSp9vk9rGJg7aDIyiL6ijgqmJrnyY\nQFal\r\n=ho+t\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"1254af495ff6c4dbc8c3fb92588450090623cf8f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.5","@balena/jellyfish-logger":"^2.1.16","@balena/jellyfish-environment":"^4.0.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.23-renovate-non-major-1254af495ff6c4dbc8c3fb92588450090623cf8f_1617240282634_0.5705217603550992","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.23":{"name":"@balena/jellyfish-metrics","version":"1.0.23","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.23","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6076041ef461b8100bbcbfb9e7e4bb36dfd3f239","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.23.tgz","fileCount":15,"integrity":"sha512-O0uPzEoRhfElRC4IsxBLDtEMLXz0SUNsJ0dEAOFjf18ax14T1IlHJWx4JQIJmP0up2ntIe/hUU6EzTHh54w+7g==","signatures":[{"sig":"MEUCICDMtYdisnvTTR/qsmdTmib8tzLufta0KJKwZQZmlGXVAiEA7FpYOplhh0GcsayZZt4HquDdo0E0UtcI30eeG5IiXqc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":79940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZSGsCRA9TVsSAnZWagAAVE4QAI6YL9g4MGP0ycqoXT5X\nTVfT47U5/vqKcWOCTaCsKRKeI1jn9xZt0KwM1mXZwhJc5XaiE3rXtfrufeAg\nFgp6cizeSHISZXeMrV1hT1ZSvcxuUD2psIzDqEx+IwoALdeQpjlkS9fSbk10\n6RFSBxSlCyPjQRIDf3VIc4HqArQenIsGb/WWCtygNVXC/aCgDPNaGSFPZ3C9\nWUnFmB/f8/35im2GHLMHRJbNbcaajD7nLO35L7RUmMtMfMPRN/rJd9y+Hri3\nNV4zQ3lgl1AKRFYuVi7c9LXeQRkZhMcfPAsYSodqNw3Ar/UlVBBl8QgXipcp\nGbbbvmgNNoKctdRpvNufcmI1YSzKP0p/tL0Z8qNiW8X6GW0fkI5ErRNWjI/L\nLoH4GE0JpVSESTFl8emNOk7FWBSR3F7aMdMl1hDt2B8iizc9UGJ+zpI88r86\nySQ14m3Sbp5kOwi1+6+hX7WCiSZapbV1hBJwxuez0q+Yv+GEptrZ3ra0Xhy7\n02aCYPvSFww2YQ0YIVhPkHLwI1g38N+eUp/LWILNvCkEGlW2ovlF56cmi3gm\nLy5i1c67ZRcewfy07NNQnY6Lx/qHORJUzfG4rMSbcqJ2rL2ZDKSB7nsYyBqI\nARC+NBdJtkCq+Mh7lZ+vjtNvXF9ALfEr01JQbSpg7QKFnYaZjIgGpWqfXrr1\nJWNi\r\n=NIsU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"41d3d210e1fdf2994b5035d148be6b27f73350bc","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.5","@balena/jellyfish-logger":"^2.1.16","@balena/jellyfish-environment":"^4.0.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.23_1617240491570_0.6376265670010715","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.24-renovate-non-major-e18a61950a8fcca1bf9f7d3fd5ab19462568ae8b":{"name":"@balena/jellyfish-metrics","version":"1.0.24-renovate-non-major-e18a61950a8fcca1bf9f7d3fd5ab19462568ae8b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.24-renovate-non-major-e18a61950a8fcca1bf9f7d3fd5ab19462568ae8b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1a742822ff57b6d05cfcc971ffd03e4d620bfa68","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.24-renovate-non-major-e18a61950a8fcca1bf9f7d3fd5ab19462568ae8b.tgz","fileCount":15,"integrity":"sha512-ZeIfbey7nfFGv4IrDOSG3x5VzF5fB5vJeMwbyj7soYZEmI4x2SIoTLULhzPH/s/q2vmy4lYM52EwJyDTj0OJ9Q==","signatures":[{"sig":"MEQCID130V2Dk6hFxDYZ2YNO0Dmq1REFOmLKQKdxjRePUYUTAiADQPWHfSoWbfYPsSkkIKxDbWLJKKHnhvyI5BBh1EFJzg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80066,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZdTxCRA9TVsSAnZWagAAiNsP/RLthOPHKsZuyYHiTmPT\n6y7AY214cNXEv4WY/+PG2y+ALbDVFSWETwTXup5fmG8obqCFRHCTmTYVwZzl\nYcdwzNmk7MuDoIBWfdVaQNSwFjhHjXvDYYxMySfGIMS0Ix9leeBNXDQOrJmW\nZdsYKDJWYbz5/LBrjbOO86KprYKM2c/hLHh/NIJVK1Ppdozul0O3hY/s8PWS\n2oWuu7N+o/nEDLs/eWSXALL4SAtUN5dIPS5weIwP4wmV97JDQLvF2Us7i2Rh\nscPa/6Gtv+wX/wEU+ZK7ubkXWaziuBIre9p9jc82RBhzV3/UfbvE16jU644c\nqJwQicikjnG9dEZfy58LVIvY8lX5gdLwkwPBBu606MlQHp/5pZqgD88Q0zJL\nVtKyxZC5FRHKv0kAr8JCk9SiGt9yOurkhvGz6s8I32VHFU8T0/oN1pPFAE2K\n6lBeUjGqaQCbiPA4Iam+kGZMePJx0XUgqVbD9Sur55Y6ypy8UrirdzwXnT7p\nCrDoesFY/1Tn6rekWPpUchQYTRMgZKBIUc17ttVF+OC3o++QUQzyU9a5Xqg1\nfFCTgLw6lSWmSrBA31m8ImpMj4lJDIgXX3BFrVpm/n1mgEBqk+IQuajS/C8q\n3MsyDTT7RV5Sy4CLdb4b030sNroJ3qED15YXaEOAgMmTDI9svYgV6xs5Khni\nzB3d\r\n=20+O\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e18a61950a8fcca1bf9f7d3fd5ab19462568ae8b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.6","@balena/jellyfish-logger":"^2.1.17","@balena/jellyfish-environment":"^4.0.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.24-renovate-non-major-e18a61950a8fcca1bf9f7d3fd5ab19462568ae8b_1617286385056_0.15819605687917604","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.24":{"name":"@balena/jellyfish-metrics","version":"1.0.24","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.24","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fc2a009d698f7ec94c832bc37b75a9e3977abb6c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.24.tgz","fileCount":15,"integrity":"sha512-tfJ+Zck9/J64Gc+Tl54BJJDR0xoeOLEt1/tXOP/nz1Itgejia+cQC/+V6Go18wlZGxu8aPGjP52s6XOzjqoKCw==","signatures":[{"sig":"MEUCIQD4CH3qyKGH/aTgxfsb2Q0ZfFtQwqSw+ZMrUK4Zn/bFbwIgOr8YoyI3MO7Ar/OMqyLI2O3vt30J6ZfOTPYHc5SILb4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80006,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZdW2CRA9TVsSAnZWagAA9hAQAJAplQzUMcF9VZV5q3/q\nBcigc3eroZiQxNHniD1LSJBEXEHBKBUZb2MktDH1avyeO83ZRbN+7OCRIB0D\nm8lwAxLHUVV8A3hnKdEFv/3f/Ju3uWgu548D36/8fm6+MsASTMwPviLY/UUE\nFcgwVHc4dR9AEQT5RaeSDxsRCw7D44Y6TqWiqQi3jhYxLQ4vWTg3nIv1HX20\neHbNzlpsMPJFANnDFpzuWKCfIQVIWs0kB9pBvb1ywyb9dVUkIGbxpuu2AA4n\nzR9BEIa+R8P5lb1YL0M00pmCayMUvLAXt7wHzNcZhH6ss/o937D/IZ6IqWh+\nhoK4Z8kB09G6sv0IIlYLXNFdxA0mwrQPaJz9+cckv5kvB3e2HcCK1UISbWHG\ndfnvW+Fnd3AoOJb9VVZ13J8EqTgL3JaY12Ii4IMw2GNuVmK9tX8qowwx5Y7n\nNzD2JYoyCY+lVTAzvmpzb3ky8TpQUvsD9oH3ER3y6M4SB/iKSzPoHQ51VfpW\nWp+yFqRIKyOwAhLTgh9/RMczFUcrt5aHI6aZUXnLGOUXD65iWiEPjxh5g2FU\nqHe4o9jhJe+VSyN0JYzZHc/A3EtJ1cKxHcToZHz0x9I6W3j0cIrG4FFe2PH1\nCe1HCxRK+CkKzN8DFGGUGMu0idc8ccrGPhwj/V2uuHukEZH3XTl2OcRgSSbG\ntnlT\r\n=Q5Dg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4949f7ccdadd018730dfbbf344297ba63a688af5","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.6","@balena/jellyfish-logger":"^2.1.17","@balena/jellyfish-environment":"^4.0.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.24_1617286581779_0.9721093378740562","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.25-renovate-non-major-d53dd883882bb8df7ac506abf4a5da0b1def8fbf":{"name":"@balena/jellyfish-metrics","version":"1.0.25-renovate-non-major-d53dd883882bb8df7ac506abf4a5da0b1def8fbf","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.25-renovate-non-major-d53dd883882bb8df7ac506abf4a5da0b1def8fbf","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e594d2a83ddbe62f2681a48431ce3080e0015084","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.25-renovate-non-major-d53dd883882bb8df7ac506abf4a5da0b1def8fbf.tgz","fileCount":15,"integrity":"sha512-rrAfCpJpeUYxPYdE8WBY1K34STkQb5ImqfIsRqp8b/i2G77m1iMQyjEVzxacE8A/b8fW5cm9N1sWRWFl++aftw==","signatures":[{"sig":"MEYCIQCJtbD9uZqneuWmo9BaauFongBsDULJ9ReRocpOq9XhcgIhAJ/30c/4dvZX+FsbQWcPoo9/1T1+OouPHCwH/C+vrDV0","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80167,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZlAYCRA9TVsSAnZWagAAoVEP/2K8O8aQi5xIRPwoY6Jp\nx7os9+f1gbXa1UzHEao7rmvZfAlLSOFQ6ovwj5Y3Qkfsye8TmOzBP4tgSGeF\n43TXxSIjxORbLtigBzD4FDyCKsko1kLjf2z94vq9w2P2m0aClunnCNYauuur\nfsPvKBic58JouwFdOxkdqGUvoo3EGpd0CMD1KvEDq8Vl4QRTxVSUVqIqK/hy\nQkkR6JmPtnY77mhWtdkHp7ViT1JAFiFwFbxeL2nM3QHzfz4B68+eE1MNHumm\nKIrn2DtgS7Hx+NtqBWzntTYj11oGApE5kfgKrR44DWIGOUPJ+2TlOBso9mfu\n6KhQQIatb7XTQ7fpHtJyp5s1Vhf8BLqDt0BB2qtTr7HJRneiNTSg5ERWvbke\nqfcQ+3rS5JSoHF5BjGd127Bl+YFKdBAtVGY1MlSivqBmYuogtdmDvAPqBAS6\nyHOKIlkju6PcooKoavboG4AuMKP7UkwApIvjnf6v2ptmASUJ0t79qtWrpuFS\ndBZdQlXyR7W8OLLI4Wi0Pzadh8MNmuw4yyOMrA1nnynSwIY44Ep8bIJV/0qQ\nKE/RdLnkJrNAzHdqA6VbnDspocfKjtepbIj3/97AJtFG4+1qjPPycSElsBTz\nyQPtQddn3qFnNv4BCKAGXij+gi7QbgDn3T/RJecAdkQxmseZOfPyk6++nucT\nRPzX\r\n=0Sic\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d53dd883882bb8df7ac506abf4a5da0b1def8fbf","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.7","@balena/jellyfish-logger":"^2.1.17","@balena/jellyfish-environment":"^4.0.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.25-renovate-non-major-d53dd883882bb8df7ac506abf4a5da0b1def8fbf_1617317912263_0.29081613858013067","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.25":{"name":"@balena/jellyfish-metrics","version":"1.0.25","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.25","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e47b17c4084f522f06bc184a8df625c8ab340611","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.25.tgz","fileCount":15,"integrity":"sha512-BWOIwZt9Afof/8r7OguZxo55HLv8ZnAZphGCVsNf8mkjqwSUftMZ1WvYnUgj2hDYBgLvtdWdJKvI4NUMgDUH/Q==","signatures":[{"sig":"MEYCIQCoRAlKXXkQs1Ls4MJRfHsWULKU9ZFlGlXlHP4/U/1CjwIhAI/7/QQ++fKjUbl0g+CMObVYXJShiyhyR1rlyzuEteX7","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80107,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZlD2CRA9TVsSAnZWagAA6VcP/3YsAmDdXMKKp0OaUF2R\niLPgsPEGbOTvOj7LCP73GiRuC/2MVcYkBf8vzibxJJyK05ZMi3xPudVNyq71\nGLT9e9+ixxZiQy7043K6WQevkOCKIAWprXvUrH1sd+DyqrgmcdWn8jkpx2eH\n7GbZb5ToAbhXGfT2OFU1Q/khngyV0Zfh0YrmF9zPZqpkZqS5ZmUxYf3+DQZK\nxCV5oaWPWZmjOkGiAKwX31gBV1cPFVeP6VHT0PTF79o0vszsd0DnvIk4XTov\nAPFIcV30I9o3EtamM5aYGqrW1D93PbYQDVWapSDxQIkzs0u+wzrmnioJU5QH\n4dwoaH1kKigs6PTNzv2d2QibGYwDQFA3FEbLu9XZu6q8Z6O2Cp9z8kKpEt/j\nzuLJPFcOULCw0tF9srpWZIVuvx3j2StgroKVKwwJJ2SHZ85/x5nus9qZHIEV\n8MaQRGH/P23fLZY+QPuxf7ZBCnVIztSQ+ldoPKJBAZNF4WKkD0YVDSc8y1Vx\nL92k77igIBXUmtiXLavvGbvp0hkX3Zbq4eeubtxGB9pUpil/soU2TdCjL8Zo\n3Uqw1wuEJbeyj0vU/fmfhvmizqhROMXZNKBkcQySAQRscSMgq29vCoyD2N0Y\nXl6u2YvCmI0oxK2fo3eJQdgfwH37P1oidMLmABUIXO45m2dnmmx60tRj17nX\nQPkl\r\n=+0U8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"fa05a59996d449bbece2b51ca40ef96a86609a81","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.7","@balena/jellyfish-logger":"^2.1.17","@balena/jellyfish-environment":"^4.0.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.25_1617318134374_0.4613825494432646","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.26-renovate-non-major-527ed86c493e75a253eb0cf8994a008a4deb5be4":{"name":"@balena/jellyfish-metrics","version":"1.0.26-renovate-non-major-527ed86c493e75a253eb0cf8994a008a4deb5be4","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.26-renovate-non-major-527ed86c493e75a253eb0cf8994a008a4deb5be4","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9bea21742436911c2c2ff1c5f9a925c0e9198693","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.26-renovate-non-major-527ed86c493e75a253eb0cf8994a008a4deb5be4.tgz","fileCount":15,"integrity":"sha512-Rds7MkkBUiZaovc9Y3KP9MjFNV2X0bihAnCNv/P56+nPcgeZo/lt9bS2xeoNW0OUFxku2hem1IwnHiMp1PPSGg==","signatures":[{"sig":"MEUCIAicQo93813HjsIdLwSL7SYgAVYVzQk7KgBkl4qfhY8aAiEAxArgMVsBT5Zr5IDGF92h6jTUgvK6gW4eJ8ZfDyHkwi8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZn1mCRA9TVsSAnZWagAA8P8P/RmIN3KdB3Xrm3wTqjdn\n6cgE2F9aVK4oo/kxlJTUZjTLQL2ikEuK0m+ZLhVwa2GeBiTalkvPccoGriD8\nVD+FTCFKFRM5QYj71F6e0Zvsfjhjv2mkymSTxSL720TE1rB08A8aecdl/sf1\nu6uNgTc7135qDgIShiXJZNOUZ7g8OLijMHzJKzEyY55QQjwIqiWNTSpBzipI\noypFCCinwyCpbvYfj9DlH9apj2yqNlbUKIR4xIs+0vIxXvfdoZ8vk6QstZa4\nI401n1SfAD8TPYRVpKAgKlZqA2PRkWsY4VigkVO8CDJzBxMAGfDBY42a4rp2\nm+HC0ZP44UqCTkkKa5fHTk/ahxjmbEEmS/gPSoTL1B9GjV/tNkT6TgtLJ8+3\npucRU3UDdQ2dC1U6kf1q/135goTj4tVeALDGdR0LNGnKO5iPdTRyeAYUFVkL\nkerx45VpbsHV2NHyO1/j5I8xSmFBgqvb6wLRj10ddNbWn3h3cRs0CqsmYaOk\noEO3WQ7c/d0VpPat+PT7t1gJv2hEAcora+9PQMK8BrIt1stJF9n3ZkWTrJNf\n+/GGdOo31VicxDZADBuNEZv81RUhfNGSFXe4PNnCjeHMqy/q0cUbwvV3vRXw\nJ/69UMqxTqJ8ux5bXUE8GKBve11jD2dWIoHVpYvYaE9e8/PzBU3MQZYhUxdk\nPH+b\r\n=VBqq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"527ed86c493e75a253eb0cf8994a008a4deb5be4","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.8","@balena/jellyfish-logger":"^2.1.17","@balena/jellyfish-environment":"^4.0.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.26-renovate-non-major-527ed86c493e75a253eb0cf8994a008a4deb5be4_1617329510311_0.23119766291256139","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.26":{"name":"@balena/jellyfish-metrics","version":"1.0.26","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.26","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e7af260b41e61ca4b2303452623815fead0c797d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.26.tgz","fileCount":15,"integrity":"sha512-LmlvikTU3tixiSCoZvqhKsceJeKGlmRfnVwS+y2Ia9JsdspgF4jkvQ4sWxxnDJv8sS/xtrwKiom7FR7dJfa39g==","signatures":[{"sig":"MEQCIDxHI4SiGgzuqBnYUOSjTj55mZXDvY0RdFwrfp/nAcUCAiBRjkpErcXYlH6/BDu4M9xeBFuO5oaIf12ZcU7HLg4kqQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80208,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZn5YCRA9TVsSAnZWagAAZVEP/iTSYFPtIubFZUxZ2fcx\n89IjRp2+i7LAwaPpfVUMYjXdCQB7/EMGSn9riZAjUwOUVfvctiTjTEJse7g7\nXFlexVtlOmBkTS1XsDgIx1FM3DZtxrBkQPPEtlT8wO9XRCFHmac0f97a0I2h\ntKgLKfvpcMzddvrMSxLEWOVm9iv96mTEand/z7BVd4UgXCz5c4Dq40Li6wbb\nEUIkM106PWUIjRrrFiEkTcLJ/BbEFLOEzW50NrbWXQkZ8Jyt1SDyPKm6eA6Y\nLxC40TKsk2yYIFkRPJNIseIjHYuQMJ2myJLIFJFO0MUlC55LH4tiGbG/tjRz\ndVwO+X8LJiM5FxqqXRkwKIWRn2nMwVKhnJvcRuwQdMyTWZK3lnfjRq3ANpUO\nyS7BTrFNJwhBxN7vRYNvmWgh5nJj5bPHkxQtbnAFBVGtw1N5wpTEVrTszZuM\nxLR0NFsQAYQeuHiHby6F6/3/a3OIScj3CAnWWPFBKiQbLMC6ozC2yTSNQrbx\nWF2VSldbZWFh7rq+nshaNojzMFbbKxYVh+7JTStFLK2kU4bYjp4VtWzZkadu\nhoWdhz2rppQ50uGzfWqts/yVBCRxV127TM9KmjvCv1Bvx53MPMqx++o6FwOg\nQ52VkE3OhqZAl4kfz/AE7OoZeQrI1ikSKkIFZdKc2hi5ykYirh8Am4ZO+gyg\nUcq3\r\n=S3b8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7c015f113beb2a9c6c87c08d3823d0f81c36429d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.8","@balena/jellyfish-logger":"^2.1.17","@balena/jellyfish-environment":"^4.0.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.2.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.26_1617329751736_0.24363151492008606","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.27-renovate-non-major-d52a23580b6a70e1a36b6ef7a055ecba732b3f9e":{"name":"@balena/jellyfish-metrics","version":"1.0.27-renovate-non-major-d52a23580b6a70e1a36b6ef7a055ecba732b3f9e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.27-renovate-non-major-d52a23580b6a70e1a36b6ef7a055ecba732b3f9e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ec7d94aca53e1ef71557828e6de9dd079011b43a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.27-renovate-non-major-d52a23580b6a70e1a36b6ef7a055ecba732b3f9e.tgz","fileCount":15,"integrity":"sha512-v3ob+74OwR9HW4BJphCwZIGCLafM7R94dqpP8Ut69THya5g/eqiDhnG8ZTxIN+3fmKRQU4MANdrqPjxuvzJwuQ==","signatures":[{"sig":"MEUCID6GS/uu8hNnIGvLKXFEchxdYBBAXjiQOWM+JtAPmoZnAiEAzaoi8jxjtuCh247WWkPE4IR3zwI6hglsJ5pUs1nm26Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80334,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZ1FECRA9TVsSAnZWagAAulcP/j6yWrt4cM8SNBeCPu/u\nip8A68mNRJ1UpXQhaKNo+ODUNPvIjiq/HoLRKrQd++rP2m1hJZ7dlTFEZRh2\nk2avvagZ8xzFXDFeWd2FPEmENczgctzWLhzvyki1NJGMhVEg2eY6fVQvMMa7\nTD9Tl9dbvaEnY30XvMWWZcF2OMjhyighM0MKonYxlrSbaFB8SdP9KcPyYLnl\nQLm22UUlqtO6ehZDjFoJy1rd2/RICHxo//hja985ecrqY7njfpDGLCogwOrI\n3TjcAK8I0ifzRlOgKd8rA5aVui0ItJaRZi9Hr7M6A0ZjpK6P5sJWfciUGYa8\n5apwk2waaSPyhwliQ0rY25SHhNOmqNzoGVHEPCb+dDgo4M3Lho3zvGSsJ5z6\ns8YaQ22ZAop6AQAHvVmOu6P7eFklD9QU4IpdUPYCHBam3qL45vUQZYVEL4Wt\nBewJp9cxmPHoJqdgKT5RDyC/j0Jld2qnLPLtibWIU7Loa67fzBhltb0lvPvT\n2MKI+mnEB7D6EsWBG/qU66UAKLvrTIqEBXEis4HLkDzpGYkNaJmRSFTVkoEb\nWC+FBgv2ipcEiFUYtZNuRL2wpnPNyq561UhMb6uy1UNke1rbA7s1YZHpdpWJ\nE8oTqQyqIgT4oqJqJdZRsLlN+cyh9BnLP+Zd7LNwCA8Fb91kKhfXuaxBF38l\nJegC\r\n=1Kzu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d52a23580b6a70e1a36b6ef7a055ecba732b3f9e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.9","@balena/jellyfish-logger":"^2.1.17","@balena/jellyfish-environment":"^4.0.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.27-renovate-non-major-d52a23580b6a70e1a36b6ef7a055ecba732b3f9e_1617383748429_0.16548258483763134","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.27":{"name":"@balena/jellyfish-metrics","version":"1.0.27","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.27","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6b4ff4e70dcbba0ba372a730346cb5e04785e140","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.27.tgz","fileCount":15,"integrity":"sha512-l+esrkJMdlzW9a4JiC/kQj2SRaqwbTbJMccIyefnPdyJuFUT/DGeXqTwxZJRamDMkb7mqwD7Dwve01YI5pmHeg==","signatures":[{"sig":"MEUCIQCKjtNPv8CMhQoSUqIGmYw5Qvl0mECtUbMazZmK1twhZQIgP9tzIOlw3+yJBDohIhBn2A+jd3oSp6Pk5OLtuwOxbys=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80274,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZ1JACRA9TVsSAnZWagAAA60P+gNuzZYLY4nOfZjHacv0\nbdFtRDgafYGZokz8NlpCULNqUpj6nVp985kFZRcWsNDAKPXhUIS1G73EznGv\nmzkTGmfoz83DLfW+rRCYAykhAFZZ5cB2beJzJlB6hzdU9lTcUtker21v1Fec\nelyx3K4Jfo5H2dL0b7sdJwEmIxGpRFbDPaZkH/nkzv9ctXNQO9976Zat+QSR\nAbHOLUedV7v4SLz+5QFF3v5eR0ole8BYvIHBpvwzIlZ4CFgPUwnKLn82aQC+\n9abXRvm9efonQso7yV5OcyAjE+0B+VPhKcj+ttxMmFTjJMmth18gq45AgkVY\n3KP/n172q31G+9Hsl/T8Gx38JHScCd50kR3dlUu7PEQ1qNT7xHae7eV9JTVH\n67s7UHN2Q++KYDACyd8uLaPd6kdgQeb5lH0aY94EDMOq1SuA+IBKNMB3BVx1\ne9o0lUw744nf+HAqWrdh4Gt1dMsJzvTIE5Gn4l77l1RSnDPyJOWv0PdQksmH\nw1abCLiBQ+PmQVff7PYGuy4Lr9rAbxReb4WtZDebB7YiIXyrnHaOOob+KhbK\n3izTIV6T5e1f3iXt/kdd2VMj1dMIcA0zogFiWsQ6XlYnNTAVnREiEdMUQKAR\nhHpPXdxGBLZnu2poNwVmYhzk5Y2bs633ls1uBkVJBg9zBDH/tTiw36pjdG0P\nhU+W\r\n=rUmb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"263ddd374fd48911a8315ff0abcf92db3ca006a6","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.9","@balena/jellyfish-logger":"^2.1.17","@balena/jellyfish-environment":"^4.0.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.27_1617384000450_0.19621628851044792","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.28-renovate-non-major-4223254f57aa30f25a31533def1358180737365f":{"name":"@balena/jellyfish-metrics","version":"1.0.28-renovate-non-major-4223254f57aa30f25a31533def1358180737365f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.28-renovate-non-major-4223254f57aa30f25a31533def1358180737365f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8181bb345d8956ff98aba89d94480c567ca1c286","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.28-renovate-non-major-4223254f57aa30f25a31533def1358180737365f.tgz","fileCount":15,"integrity":"sha512-l+BCINLpMV53rLQbMkH+yhpk4tT8zXFcZYmTynWNEZ8An1fBb8dp7lF1ats6JBs0oxafqTuuWtvfhlzi+6toMQ==","signatures":[{"sig":"MEQCIGkYEjH3RxgXMPNC02gn8OvcTP/53hUm6bGTVJQ9V8zgAiAQu6dSjXHVdpsK5DAWqoH9jsCCxrB36wBL1FgSCmbgmQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80401,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZ2K+CRA9TVsSAnZWagAAGz8P/iInR525N4Eo5bLPPtU9\nUIT6iRO2wCMAnkaBwUYR3bOB1NdkvO/WywSG58Z9+HQCMyjvss+pdvWuyBAL\nMCm4H/Gc4eDkK5nQbt9HjKhgHSw1uVbVQChYD7Ovxrrhl9pMh9Eh8xUumWKj\nFSiqyesL55v3kdcAqye3NMNeaz8FYgv8OlcIxtssYY8GhLhQ1ni6uWoeN6Os\nEQ1hdGPRbW96xuUnkM/7wu6QVtkSTxx0RkTeOv1TTCmeuUhJEXgmeuyPA4tb\nByR4vZUtJJBzV/7ky5zHIto5LAfPuZ6vgoRhNiGYSw3QY0suZXbkytUPECjF\nrhSfxfJhSoek0F4n5zTschOd44zy/c6XppHppotVcUNL/9DqDfeSOUuoixja\ndvbRmkE1V5Rbjqa4Rg3IlURFmdW9GlDtRqvmi46yimgtrZxmvBjp+5KAIFVL\nEs3geTCg5eKoVDS/O6S5QcH1hJ7DeTPntkLfXo16v0Iwi9ysSqRaLnsH2pK7\n4jVzk0ULxs+Fq/GdsuJ8e8tJ/2qSGhaZj0J8C9BE66TGUcK7Aj4+cXk/tkuL\nTMUycYmU54N4lqspyYRdSZB6SywK8H+LtTpZWjwxhAkOC8hDOFXFA17LD8cg\nMD5de9FmHlBnmt9pL8TcKFrnzdG9rKamRiEzjgSbHOKuubNfqpVyRFY56ly0\nW2o9\r\n=4E8K\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4223254f57aa30f25a31533def1358180737365f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.10","@balena/jellyfish-logger":"^2.1.18","@balena/jellyfish-environment":"^4.0.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.28-renovate-non-major-4223254f57aa30f25a31533def1358180737365f_1617388221590_0.5824519932668137","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.28":{"name":"@balena/jellyfish-metrics","version":"1.0.28","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.28","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"02dcd9d9f88a476aa2e6fd79c2f050f09532d3f6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.28.tgz","fileCount":15,"integrity":"sha512-DCRZnxAd1RDrPIIZDuYMWlMSu75bjsLx6vxV8aKFi1FozLxjVBh6nXRkcLNnalKgc4PFdGeZvfrukZ5Ot8PU5g==","signatures":[{"sig":"MEQCIAZ7wSKwQFLrNlboPA88rqqWx4UsrtKpSOK+ARr9l1AAAiBlBlmVaUDw+o+ohDeT6Z4/bQ2BRmA37qg5wrHEWbG8ew==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80341,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZ2OZCRA9TVsSAnZWagAAooAP/j8kdpnAPBzgjCjgHgZs\nm6A+z7vqZcaD/QKnZyw+Pj7VFf2nxhV6Jzi81yRss1YdtCfED2wRU2W6HEE/\nw1avsO9Ec7IGS4VPecW3gJ/znSMoxoyq4c9nUhMYEZ4UwlbOakqzZAcT7Znk\noYu1wW7b3tjnM1GE2w9LIpxOCAOYt4dif7oPboCHfogXoURiP7kwqE8cZ15X\n9IOjbMKI8DNVeCBW1wkRf8rOKf3los03yJVo3ZGuXEGQ0TIXeM0f7Y9x4pnG\nCnLvR3o5NpOojo0yQO/H5FDoD3I0z8fzV7hvQT/mra748KCg6AK0GLaD7fKn\nX+td9r9edeMTCFfvRSL1xLGM9PqOCLtYmum+hV1pRALiiIPj3fInCixu/TPK\nU46lXfXFLEVT98l3Khjw2tSX7pMr/W60pBtUx2oOkp8abdRvSSMTuL5AlLKB\nKva8+ZxyzMcy0WtOXbFWYyLwmybs7pDN47ugAuO3djjl/ewpH/rSAkmsaV6a\nU9/eEpZ54Ab4iBaJN8SKGG+z16uyWNtMqY84DeCIIvP9xlP8mhgNCcymk5s5\nkmo5N3K/kbk6Cs+ZqXiD1blnOCpqHl1o+yUIPaLk6s7QrhdSwrgzLt/4py9u\n6/XnVXAWFhFqCIiP6eJZugNp7BVWkMTyaQKa4gMLeUANoS+FdsW2NgSAiaOR\n4GcZ\r\n=TYyp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"062ceb0f08564a486f7a65b4246140203669a940","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.10","@balena/jellyfish-logger":"^2.1.18","@balena/jellyfish-environment":"^4.0.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.0","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.28_1617388441285_0.7205434703163405","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.29-renovate-non-major-5851947ad209cedc114432e978f662db4b11c5e4":{"name":"@balena/jellyfish-metrics","version":"1.0.29-renovate-non-major-5851947ad209cedc114432e978f662db4b11c5e4","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.29-renovate-non-major-5851947ad209cedc114432e978f662db4b11c5e4","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"54943bb4c5869dde6f74d05a9fcc83fa37f9206d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.29-renovate-non-major-5851947ad209cedc114432e978f662db4b11c5e4.tgz","fileCount":15,"integrity":"sha512-IDAl55l0csIYA8IH9Vz2MGnVFq0AMCcFhbLA0CGRha4fcFrw1URneFtCumWtttrZ+aooHCu1RXsDrjOCpTusAw==","signatures":[{"sig":"MEUCIQDyuvG4q+WhZ1mW9FSN8xc1c5xBjjR/BuZQPoC/+wtEvQIgWRy304aDX0grHgsEF3ROov3RdGE2tQVDbTKS4lF07M4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80467,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZ4C0CRA9TVsSAnZWagAAI+YP/iD3YjU2jDHQ8twnrZPI\nQKMZSBE5HZT65Q5p0iaPLNQoKf2s9m9SqkFQLd1V6+eyXiwruA/bQXl7JmQn\novLxdMVFBSib5ocLS/fC7CbZgXNuioWPPc8YzEzAhz+AyU3pUkkBqLL41Fws\nnFC5u9Ybv3gE6fY70JBB/JCT+vadK6d7G4deB+k/3XAKPnvDsC8NeiCRN6Gg\nzbwlOtTUtf6/icV/oaqofNFi9M16MddcrOHmEIPTYabmfKWIFsx/JpHJM/8M\neq3qPAvhjGwqx/A/UMvekohaz35tbRUTYlXm47d0Roy1RIw+2IZ/HXpNgl6t\n3wg5O8D0b/UoSf11If+yb3fgjIjSSnXf01ROFq55TlCiOUa11VnB+wW0+iF8\nfn3LIOt9XMDH9VDBOeWOcNeCdoR42iXAExGtUlU6690wauDzS3hcpxlEhjnv\nUsqA9RqjA+p8ZpGQt934yXEbIza/D/BwI1Ll42ZODggtegzbmgYVOeCCaymo\novtWq2tscU2NL4UexbWwcLKGGDzfapm60RtxgTFjVj6FtwTXsWM8lhPHxNTD\n9Pl6xZ6jVaN9bJiR3/0NhSoATQ72YdkD5kQyAI49wVTBTw+bvKGX2ed7Nsr8\nYfMQ3in4xYCn3UezL7S685qbOjT0DuDsByyEv5I/U5P5gXvJfu/eBkdctGUj\nEZ6Y\r\n=VaK6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5851947ad209cedc114432e978f662db4b11c5e4","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.11","@balena/jellyfish-logger":"^2.1.18","@balena/jellyfish-environment":"^4.0.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.29-renovate-non-major-5851947ad209cedc114432e978f662db4b11c5e4_1617395892042_0.9243292302361736","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.29":{"name":"@balena/jellyfish-metrics","version":"1.0.29","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.29","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"10a0dcd4d6f62d43e05a7e9e9f8ef5cda9270354","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.29.tgz","fileCount":15,"integrity":"sha512-gUhLOsp0aNP5Uos8Me3WMIpirt8YbCjclEVT+EP8zoKQ/T0WsjwdhiDEkITGg8VbKRzAnYLF84qmjUWZUaLa0g==","signatures":[{"sig":"MEUCIE5R4fsgZnhhcHNPwxDWragJpWiUlgI+wutoY+ylZ9IaAiEA4BftiXjSKqRu8a3TE2CLSAFpijhh81Kn7/nxnKX7ZEo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80407,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZ4GcCRA9TVsSAnZWagAAg0wQAIKhtkuY8P1FPuzB7bRq\nMq+ws3aQMydzWjjVhQWvC6u3I0Rgnz4pKcAesusCPOHQuu+INGjUF43VAbzv\nh4cNtRJ4WAacydkibMmwnEipAJbb9Q6ErWZfEA41e9uwIJghv6KTlG0Ivh9G\nkL8aFWLrGutKg8uOcFpE0DfN8kSMu2r7buu3/YjVq/wOYnr4/votWog9Pe3K\n95pBhIA5/nnW6Tj/lNkEkvpK5cMpdQ/XGlSS3d0RtsIEsfF2F6dTKGCzDlc3\nVRoG4y5dnbyC54MSCgLFWCwSZA+PbueV8bAHLoD+7rBO6ekFkyDvrghVxQWh\nByFG/25CRxZbITIg10kRfnGkbBgnz2cHszEbCh2F7reR0WqAEmZqF2j/IBtv\n8Zv0xUzCtz0j2C9K8JCPJvDlnm6UBt07k6IUKxoOkA8yPOcN56mM1QnFJYUy\nOCr7fxRNa4izF2rueHnpyetqUsdv3FDx4jR0nJtzelM8FOWdQ8Q2W0WVdFmt\nwogFsn3eI+xePiyUKCTLIws6mICCHgqnotkoeLkoWMx3+FKxiKGvEu9i4e9B\n11dJW/GOPp25yeH1QOOhLr3AH4lffRq2t9k9NyNN1szGRpzZPKMAJD8NIVpM\nvFaSd8vg8BKaEIvvxw9FUK7P30TGEihxWnsHhY9DeDKwxsdjp9Gj8pygvu48\n/VJK\r\n=/09/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9dcc9e72d93be5b3323dba2c2d4b24fd7485be5f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.11","@balena/jellyfish-logger":"^2.1.18","@balena/jellyfish-environment":"^4.0.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.29_1617396123917_0.9895499106366898","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.30-renovate-non-major-8d7aa1ae622a2c861bb513b219f4c16c298de2e9":{"name":"@balena/jellyfish-metrics","version":"1.0.30-renovate-non-major-8d7aa1ae622a2c861bb513b219f4c16c298de2e9","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.30-renovate-non-major-8d7aa1ae622a2c861bb513b219f4c16c298de2e9","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2b10e7890168a9418a2622403d492e11f47722c6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.30-renovate-non-major-8d7aa1ae622a2c861bb513b219f4c16c298de2e9.tgz","fileCount":15,"integrity":"sha512-s84xOhgqS0tXHEc/nsuWaQrrgzp1e+FEGM4MDVtyMiOnrY+acskjITPAI2eU8NGbu+9Y20+qpvjG0F3KcF6KIA==","signatures":[{"sig":"MEQCIE9suY+Z6HmkCn1iqtu+TIWq6aKPVUZ+xY4SOvPVNOjEAiBpkSEuYht86Kp36ccsmw05a35sae9BrjQ6i0Tk99lVEA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80533,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZ5uKCRA9TVsSAnZWagAAl5oP/0lEwKP27/nNxLod7dZB\nYDK3/JWjdcwKjCAUxu/Wey0/rOZuuaYhZVPLvKNNWDE/FjpJ8hbmh0z76zlt\nD1YZSaJXBRl2J0bax35cdEYVBaxK6UbmmqPxAwxLGkJW2OcGdY+AAYgf5bNZ\nnmz6i28r4JS/hs0t73698kc3n0P0azSUrhK1W1S8p7x4GpPllzLcnkbW/kRh\nysIWDkIhQgf9gBljAIGqGNq22IvTyR5U3LtfB1yeZPZ+lJ0s/BT/PqAyWLlQ\nHNV0engmxVRsc8cza7M8gdbGxLLYUg5Ashk5SPy1XFLW+N5sVKDU/621YaVy\nCR8Ud70ZFM9uvjw8mNZLXH/QZktgQLk1tWvwoT8DqPMPcmYiTyh1Oj6U/59C\n8sdpK21XxJ/f7ivlSxSxMNVeIn7ziUI3hjl5lP844X/DeuTqsGf0+Yu+dYRc\ncODiPpsDhJrlzXV007g7V9smX3vwtqLMpeXkRhcLrGrxhVG7I7h3QekwvtuV\nJ9X1rXsO+CZvO/y7fzUkx5pr7QNnevgcKADBJRNDAWxY3ZHUQx61RMjUwP7A\nDR+EuO2Jt4CGRF6oeOOrDEOlYQWU3QStqW2ABvoyLmuy2bbDs4KyEtmba2Dv\n3wJsNZSLeNRa2d44P3WRhmuuILaSnni9mDXt5qIukmafaM/9RLUYEqziBW3H\n2fUz\r\n=VPjL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8d7aa1ae622a2c861bb513b219f4c16c298de2e9","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.12","@balena/jellyfish-logger":"^2.1.19","@balena/jellyfish-environment":"^4.0.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.30-renovate-non-major-8d7aa1ae622a2c861bb513b219f4c16c298de2e9_1617402762056_0.8412376636229788","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.30":{"name":"@balena/jellyfish-metrics","version":"1.0.30","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.30","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"30095d78a52f6192c3c45a5375fe842d81a61d98","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.30.tgz","fileCount":15,"integrity":"sha512-V6tw7rcNWMp4+PkaUCOKnHpj6fIUI0koWKCKdqgmWCsJhe+kYqZANpZtQt+dgOLObdcltrrcghJFpnhHLiun9w==","signatures":[{"sig":"MEUCIQCN6zk9ry9Z9zVF6ANtgjhC5RYy2Wc9vonkbPmcU1KDXwIgKF2PxzQZ1vPyomSqbAbAx2TFnJHp4yeON6DPstNCLt0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80473,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZ5xjCRA9TVsSAnZWagAA7sEP+wYf0SBQe/OMH40I8Tvn\n6cMit7tVVH60Z3zeceDVvRKHKu7y7nu/YFtbj0Mv+lkZB/xz9b2QrYsf9eFh\nBnAEgZHMfEIp02Obp+i+Fcjz1m2ZvdKI8GQCTMsoSGk/rrzGFyjj/5Z87yHL\n3OzXlRyqgjToJuaQGdP7xB6jYrkm0ChyyybPBCQp4Lg1lotW3qMHedsZchQM\nX+8UgmkEF3Nf9M/oNui7WT9Npu+oULFpMNJFht2IMwN4nrU0Yxk1vZoghijT\nUB5jl3yjjEVQ1rYFAduBKl4AM8LlQ9wtZ6TxVcyJJzSRl0dvhPfdVxfU+dyN\nJRWz7gznkKUrvevDzQHkaIHPyiBxOeChbviltG4M3hIW4p9W8oUHTy9z1aDy\npx8mVQzFHS8clbQFVmLxt3zyByEzHukvXJK46wz/VvdGGnrhTh4s7HvHoJSi\nLrzxY2Ahw2swk3Q97oTn7ZblYqYz90whctcBbuuaHfp0t5ZOFyYlN8v8q1U+\nE4DjBou5Q5dD2VkMjxsUTvnycUvnjayiMg5WKF8sx44pyL7FmhUUyaERoNEb\noj0xx8chABt6QzGNuHcjJjos5LsSpB6rqTm62aF1b6MEFsnvflkMx/c9tR9t\nRDUgsfQQB3y2t8VdOHwh3PeA9jYlPKNnWlagFGw+tedrUSRo6BRr95+qFpra\nhZgS\r\n=P5P6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"67c94a375571e741fd8afc11eed9c2ec2a8d81a0","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.12","@balena/jellyfish-logger":"^2.1.19","@balena/jellyfish-environment":"^4.0.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.30_1617402978758_0.0489502335393186","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.31-renovate-non-major-cb70a8508cb7fd834f4e3ca7b50662017a856da8":{"name":"@balena/jellyfish-metrics","version":"1.0.31-renovate-non-major-cb70a8508cb7fd834f4e3ca7b50662017a856da8","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.31-renovate-non-major-cb70a8508cb7fd834f4e3ca7b50662017a856da8","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7b4454d5d36e42852a0ef16ce60b3b4f27172ccb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.31-renovate-non-major-cb70a8508cb7fd834f4e3ca7b50662017a856da8.tgz","fileCount":15,"integrity":"sha512-yXqOGskXk97vFr58Pc22V2ouuUTeqENRHTwYEeHqcDPnOIW8A2UB3gWOJKGduoWXud5i5A4Yz1WY/Wek2chPwg==","signatures":[{"sig":"MEQCIDsy9pmXNfdtyFfdzmEi997ID0T3tp6jv/UhEL4csAPZAiBHdsCHnu7mPYjdLVqDGHN0kl6mCy2WbHInLmp73lvKWA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80635,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZ7QoCRA9TVsSAnZWagAAD7sP/jEJe90IblsWmpE43j8r\nw1tuC0ae+fqqxi/PxUkw8aQbMOdFhL83oHPY2/rOUOuBQipHnq8Eaj8+Kg1p\nt0SElFln60ilsRz9PTVNLIeUBmEA5v0IQdKUFmeDaFzssx4FPrulJaDMGdmT\niWaHsqn2p1/0HlEJe1LenLRQgFzgbkjxj2XAe7jTdmwgF5xR+mt10J4RSMI3\nEpQr7nY3u9FvIfbSy4pNpuoLCNyxM2n/RKPUVcXp+1VuNS7cP0ZjQSLI8W8o\nvG7IuT1ShIn7rG0Pmft8x0Y9xsvtgcpZfsRBaSS6JdwES37enWgxklF6ei2n\nXWYZcjEGlNLH65jfxEw9kwCahulBB3G3kJX9yUpZx2XhYvF6X/6YXPI+3ELp\n9CCCJSGJWdfY3yfeYMDFdef56yfOzos69MHw7rdgmWFD/7+vnbILoSqBgyPA\nu88xlnJfCAw0+h9ntrYqhi7Fa525aWWWZp9zdQ/qtnar6E0+lL1mZT6K87Hs\njEgZzz2/2+ngn8GyPcF2wsmzFeSN//qmvJVcKwLOS3pEkKm1y/Je8WVn6zj9\nYTByca9PJ6q0EMxc6FIJijTFrO3M+f4JzAEi6XHI56BSTho1qbYBipepC8KZ\nxfgH95YxMlB/aZvBr+fujnB9Q4JWIv3fInuf2GRp3fKQC590LjOkoGt631E3\nIkpK\r\n=VRnS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"cb70a8508cb7fd834f4e3ca7b50662017a856da8","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.13","@balena/jellyfish-logger":"^2.1.19","@balena/jellyfish-environment":"^4.0.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.31-renovate-non-major-cb70a8508cb7fd834f4e3ca7b50662017a856da8_1617409063640_0.3403884201976335","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.31":{"name":"@balena/jellyfish-metrics","version":"1.0.31","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.31","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b9c698941d85fca3fecdd2ff71c8741f5c2a0fe9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.31.tgz","fileCount":15,"integrity":"sha512-oJsRhUQkkG9i+YDFibg9ilmqcgeL5gDtOWgHCH2HEO618r00djcM3oX4vwGsQZm/2IeY3k98U0kDMoSI6rNAdg==","signatures":[{"sig":"MEYCIQDZbUjKdF2soLpSDdhf2li031YawK4H9ne3ac9fnioJJwIhAPBpA0x9xSJ0OMj+JvIhsqAgjr6moB+W7W0pnCd9ukQe","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80575,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZ7UACRA9TVsSAnZWagAAMx8P/0RSUdHswP+TXLL9e1f+\n7hqlWvXPZtj2zvmAc/R4wXU368CcBLvmwhJIZlzLbf6gH24h862m5wIb9O2j\nUeHOxVarZDjaqN/2MewHNHHIIuBVf/QGwWtWWuX6EHnDPuIoYwwu2m5Jndk9\n50OYHZb4zFTUqr6xvIIeRQv6DvU2UAv/jPmP40u4DTJ5A1weU3lo8M3Rlqll\nDDS1Xrmkkm6+4FGY4Eb3L3Aq2KlhmIm4+BkTEZjnm6R+bmc5pSlAgBNGFtwO\n42wEPsJtNd/n7bQffp+ZgtCjGDvbojWdLvMC6qIkYu+GGiCBuPLFZ2BSWepJ\nnznDKYzmZyqCxT/MH3MrRCfAPXIQ4QaPxbpbDhJMIOmq2f/IbEGucZTyCpx8\nQA8+78JdWTAyuES2lPUfenQGhQbQbM5Tr5+8ZGHrs34h3Lppcej0hfFKz+4n\nwOJKphZAht1/T/oN43DQC6tlqPR5r6H4ehG/DNlkVKiSKxPGYWJebuw4luhs\nPIGL/NSiYc1lvK6W1PAgUQoVLf3IPiPCKRU9sF93Mx3fGx2QYeIoIp0sQs7V\n27uQYTqJ6TFcKboK/T99ptvQzL/nWCxXpZr4/Fg7BZD9V3Rd/4wRmqWTt5kU\nQbnYq61nso+9lmUYgC96TQ8VPkI81Irs3M6blUf0/744MoZESk+YMjCcWTj/\n3pOm\r\n=A0Ux\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"55f9d3bebb360c98dec04129db6a391708c191a2","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.13","@balena/jellyfish-logger":"^2.1.19","@balena/jellyfish-environment":"^4.0.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.31_1617409280440_0.9459533415245993","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.32-renovate-non-major-d7b1ec01deca5efd5765d24859457c40115032cb":{"name":"@balena/jellyfish-metrics","version":"1.0.32-renovate-non-major-d7b1ec01deca5efd5765d24859457c40115032cb","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.32-renovate-non-major-d7b1ec01deca5efd5765d24859457c40115032cb","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3bc80c924a8876de387ea710c93a0f0d2e0597fa","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.32-renovate-non-major-d7b1ec01deca5efd5765d24859457c40115032cb.tgz","fileCount":15,"integrity":"sha512-7IfLEq24jsOgsRyPDsU/gNmWX6qQa9ABy9FcK3x/umnlA8mF93WoNE4fTuOb4rQg3YdyKPsQ6aYn5FvB16aSEA==","signatures":[{"sig":"MEUCIQChX0hSNGuggu5a7RlzKDbyaSFkajIXeZyyoaVUBm3aAQIgUiXsRCbbAKwQr+aDGXHn0cs0crn3PskRbmf90sgLcnQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80737,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZ8fZCRA9TVsSAnZWagAAYOgP/20M24kySea4nnuty5Tm\nwVAFc9xzXq3ZVfBzs8PlSxm/73YB4tup2uQzPAwtTL6726PmojarlI1ZEkNs\nwPhlvhRgU4BhKaoVPxArwIBHePqURD5VesrfyHDmmb1GCoY0cnd0Yq8Ir9Cs\no9UdyUZHGlNxYrshhf0rEdsDcxrQUfnueOWPwAvxzORpzmuOf16+GElgq9ug\nY40lr6Rfe8CJd7eQSCBUs3ABsmXc7059M0AMMb6dUHxC3tEfskVQlFdd0P65\nG1ljb8sqd0or3k6V/r1n8uIT4hKeTI9LVagwJWFYd94PLAcF6fF8YrkwI10l\n3x12E2EWddDpBQieMHpiAUF898ApHMMWIOVaen3svBem8sdZvzI3r/9Tmeve\nEE/Skn8dB1yJzUES0elw2yDXOg9INSs31wGTEDSBcp55g+z7TCcsRpzgA0nd\nGgli7V7QUKd/Y3I2snLr5+BOPDpvmHusWDhgCqYVGnKF0sXepy5g8AFZaTm7\nIpgBscZVTvE6PS+KaWuFWwEIW7aXKa6yo90ZceazamuJ3Z5ofQkGc1jAHewW\nBsRmjOpMcHcx2KwAgXCS9no6VMJkSKPHwgP/U/UUHDrGqqoaPvvIC2RArGB/\n5V6mroJ587uRvcBda1/3Gk4yQfX5xBd6AYcAFzQVChkYPTrWUo8d4oPQriMh\nVLOu\r\n=YcM+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d7b1ec01deca5efd5765d24859457c40115032cb","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.14","@balena/jellyfish-logger":"^2.1.19","@balena/jellyfish-environment":"^4.0.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.32-renovate-non-major-d7b1ec01deca5efd5765d24859457c40115032cb_1617414104602_0.7791408620315012","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.32":{"name":"@balena/jellyfish-metrics","version":"1.0.32","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.32","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"609f817aec30cec3e904ea8e02d627e29ea57a48","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.32.tgz","fileCount":15,"integrity":"sha512-6x6IUxMEbeMNfbjJCm2vT0GuC5uUFL2siUivK/yo2R705JeOhh46cns3BVCIpLYi1rMwNEh6CIrhSSCRAaMkTA==","signatures":[{"sig":"MEYCIQCEEAaK4W6c8EP5jc4n1C+WzKZSch9FBq9oP1fUdw4/AwIhAJEe1iOJ4CF72iv5qevkbcfH+xOMcFdNI2Cw8IdqdJgI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80677,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZ8inCRA9TVsSAnZWagAA6MUP/0Gday0AzGjvTCicsmdf\nUzgoBMa847wyd8QZEBRzMWoNHWxhasovmfCZ0oo1Cv4sMcE/eGgr5JFV2Vuu\nnyBsm96ywv8ymNCicyG35dqTs8LQTYIyxJqRMYpv5ToxUK74qhZ7LSHd2FKp\nF06Og5bSR0u4eNLcXSa5wifEgBNF1S3dympsX1ZfNI3TU1gM6lmXbVZcK/yS\nzO/dRFZfR6RNTc8caFsjCQ3DYrtjCfffiPSpnO3+FtsgXZW7OgPxubJqj12f\n2OBTSVvAuXC/oqXULuErzZJ5jOalG8OLmky/SpOVgKPSnG0y8YvEetP6QW6A\nz0ZQ1MG0Cqv+l7sD4FwR7tzMF8ao7vf3fAGAJzCujTXMFDtVx60VzqGcHg9l\nd1XbjgPF6A0SmSgB7sb1zUAdqK9qd+pjpCQaAN3WXKaJKwAcpgRu+0Jc1aya\nfbsmPCO6lZ9OMfNo8u/coble2RaokBvbDPZGWjovjhazuvivr8gKFQvSQKkc\nCHyvS/qefft9FtsF4TWfmHa8QkebxUeoxCmg+pXpSfiHXJIWZPN8/nTSPurZ\nsp7cBRh+irFQjmMO4VoV4yV63uPCAUhc5Ku8kP/icXNE7TvnCds6CksbO3vB\n6TnRZRNrTdYMdyMxqoH86pzbCwtH5fv+MAeqsLKmjpoqQrahrapfrahiN1qY\nuQoQ\r\n=u/UY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"55f0b5a6cfcbeea617f59fade62e7ad491b4cadb","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.14","@balena/jellyfish-logger":"^2.1.19","@balena/jellyfish-environment":"^4.0.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.32_1617414311412_0.10536974306168578","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.33-renovate-non-major-c87ced0138bd14c8e09ae98c9645fe0e478d4f6d":{"name":"@balena/jellyfish-metrics","version":"1.0.33-renovate-non-major-c87ced0138bd14c8e09ae98c9645fe0e478d4f6d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.33-renovate-non-major-c87ced0138bd14c8e09ae98c9645fe0e478d4f6d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"81a3bbe66ed873b3bf1c23f1edc550707078832b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.33-renovate-non-major-c87ced0138bd14c8e09ae98c9645fe0e478d4f6d.tgz","fileCount":15,"integrity":"sha512-3jSXmmvNEEU+/MYIj27FhQ00FS9K3qIgEhE84uvV96MytX4yvIh0sOoh7KaFEplnwWh6IsOr0FiVo6HcI6hgSg==","signatures":[{"sig":"MEQCID6FxZfPnM0z4Cs/Aop2PXLjkl8hQiWI++3aFZl6EEhnAiAjlJhelZ/qyFbiHGBQYtkax3TH8IzN+R4ifQllwI58ZA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80844,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgaFS1CRA9TVsSAnZWagAATdsP/jW2AD8rh5StS8pbOyqO\nfMMboZpqQOedHElNBD9QP7T+HX+qfFND/hYRP1BsHd18v0v8rtvvUlSwV39M\nBlpKaPxh7GaLvKM75cP7wxXYsYQ/8Gzec3k+Exjw6pxu+TkBP+nQKH5Wf54o\nEOGT4fLM3maTXsNyoj1tz6WsUO0W0VwmxWv/+Ieb4fHPLvqOJcn2VSP/anqX\nELbveMqBR66GPYiDkHr0j0E0GML/CPb81VQf4Fi/jy9VINUtZZBbcsblNNpK\ntdEXTN+/XYGsFYb8SxTR7zooJ+k3ZouES4XhEm8isWYkAY+L+WLrt3DylIQE\nczrCn08MPksatsrh6xOIjN+aCcE5ugC6fagyC3l22YDdjUo0G1oPgljDtkr1\nm0U4Pv9O2z6do/+75Kry7YbML82w75DNiX0LGXur5IxqE2SAu/Yf3AHCHhfT\nl3ISC4468FRo/ARpR2EQO+42epUKhqQcfOINcB1lwzICAvNUf0UBGPqiphIv\n4VPpevY/v8T9U7b4biKN9Q0StKolZvSFSnMPLq3WM+mUjGEe6WjRMMGp6bF1\nq5sDicVF0BUOe+jPVObBnzwW+l/dJ344hsiufm4rVMKAPeIJZ+UyVxCbtE0J\ncvrSMrn9PDqmqXcCachLe+iG/ZeHrX46ZFMU7HIMih/TI000QIQK+k4vCFJB\nVN/I\r\n=EuS0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c87ced0138bd14c8e09ae98c9645fe0e478d4f6d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.14","@balena/jellyfish-logger":"^2.1.19","@balena/jellyfish-environment":"^4.1.0","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.33-renovate-non-major-c87ced0138bd14c8e09ae98c9645fe0e478d4f6d_1617450164463_0.2068328448751635","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.33":{"name":"@balena/jellyfish-metrics","version":"1.0.33","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.33","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4ec3d706398b7dadf14fcfe2d4686d7c9ad2984b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.33.tgz","fileCount":15,"integrity":"sha512-8M5ouO4+HGb3UP4Q2jUwtX9NYhtF8QfLllK3Nrnk2zDLzXdIKGYEeTsQBPp4IFprLK3jo5aCASISuRMy0jbuGQ==","signatures":[{"sig":"MEQCIBNioDGBhNq9AKeV+0chyIpcze31LiBtSmcO5x++fXciAiB0nHwEvAwq8QyVUOc92lvohlew7KW9W0CLaW173eesGw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80784,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgaFWQCRA9TVsSAnZWagAAh/IP/0FdnISdSiCQuTgd7TVh\nwki5zL5Q9d9UhU5MFqyG9Xg7HdhhzDWoYDfcalN61zLYb3D0Wm6+nxedvQXE\nZf73gcO8wPTOR0WZelSHi6nXsSnwDYIugjOU63Sf9iguMVyE6aNO86aTzY/6\n0dgVuXzINVB5a0JJ+pMlufveW7dBuzwUCkFGjKcTGvdjanQG0n9tDR5oSEWi\ngmghtiAqZFQn3J+QT5vGQyOhibC/lBexa3qNcutXr9dgjnB1flyhHBrVLjmx\nP4zgCZK03SVt2ADvNn07cY93lebNyUXdyXuwQZ52ALPq1knksYkCfYjyQPoe\nC7mFkssQrZKYcyXxWeNMuvM+6pAAPYCt27gwXZCCsGwt1emCDQVa3DwHZeyS\nsIVCx8FGNLsbv9lLLcLWIh7Xgfnwo3PfSZ2gzXl3HLpJqU/aR9mtsCcGDExQ\nwKUYF2TQL1Fv4RGeyYr3YCpEgnFnp+MlH5GJQ4TGXDiGybZSgpiSEEhdI8ec\nadU+q3gAl3IdlM6e79C2iQ9N1MJ8ED5z6vwKay4AVEjOgsDHMvfF5E07bEmp\nyvvzRyz800ybV25mVBOFkQKzWFFY8GqvmxQOMdzRaQhEk6uz2/Xt6rcYvjqt\nT/vzADI8iNBEtwbN7liach432mitT80Sp9WtyeyHYFKwYSP+bI4XBJGMaYL9\nsJiu\r\n=5PSl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f4ea18825563c069deb5a91f24d27078414182f1","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.14","@balena/jellyfish-logger":"^2.1.19","@balena/jellyfish-environment":"^4.1.0","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.34","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.33_1617450384081_0.05247663091006105","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.34-renovate-non-major-4cc1a76907281254c3bec6f1dcb88154703988f1":{"name":"@balena/jellyfish-metrics","version":"1.0.34-renovate-non-major-4cc1a76907281254c3bec6f1dcb88154703988f1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.34-renovate-non-major-4cc1a76907281254c3bec6f1dcb88154703988f1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bba1a93080c336e0dd93412105b080fb4a52c7a6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.34-renovate-non-major-4cc1a76907281254c3bec6f1dcb88154703988f1.tgz","fileCount":15,"integrity":"sha512-XUdNO/0BZJmO+ojZ+6v65MlRlYO2g3GwXUxGsjHOwqwbDcGX7GoO78Z910sdHkhn1key6YAtyhP96R8y00zf4w==","signatures":[{"sig":"MEYCIQCQYLkyjwc7Kn/yb72lJYdgg8EySzEX2KPE37RyZ4AHCQIhAPkgTFkUbClPCvpaAVTV+n+vb8Minup4dICPi7UtdclF","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80910,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgaNy7CRA9TVsSAnZWagAAFNIQAKLO7dXHdC/5vkZ34prF\nppqkQY8trzITAuM+V2Qbpy20ZYVMgDrrspZl5Lt7liARNbZJUASJl1Cdp1gb\nWbXVy0ZTpd8jhiCyE6q89lmxN+3N/7r9Soxc08CU1s0LWX8DysGen6/BstkX\neiOZBIUHLiQ4N21j52hUFtrbIeL/tp4/AO7cDXOYfU8ftk3TgxAbsR1ieV2+\ncSPQvnIezkt0TKqdK5TIQCweU0zskG8fBAizd4+K1gqjEzHgSdEkMYMaNLl9\nvbNyd3UJ5Y/TnJn50iKW2w50+fyK/2AdCwknkOKqV9cxFTW9lhLc7Dgb0OZC\nOXySi75POAofm3P6bPQgfnF/CF8repxKsydove+8EeBrsS0wL0Ii3kego4vy\nGqjQpTwchbsR51yHkOF75ivAsF7kFn5gBWAfL00RW1xwOJufD/hm+vuK9wBh\ngwdoN2DeZOsMytGv8Igu2ktaXHDHZ8oTyzxLlGNXMBI0XFZk21nqTQgAh56z\n5Zw6DBNL4usxHsZcrAEl1ReAXxqEZSlNW40NWQ8YNBvllZ8jUOuORG9rQ7Wz\nPDLA349DydHR06f1iUBL9hqrUMv3BR3+S/fFo4UPlZb6Gof+QtA/K3WTg0Wu\nrE13XXP6tiwxPH5vz5Y3E8WziKmeMv5VU1laCTyJ9OylriIeW8f6UCabeEAO\ndIn0\r\n=pyoV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4cc1a76907281254c3bec6f1dcb88154703988f1","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.15","@balena/jellyfish-logger":"^2.1.20","@balena/jellyfish-environment":"^4.1.0","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.34-renovate-non-major-4cc1a76907281254c3bec6f1dcb88154703988f1_1617484986765_0.5271874800013703","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.34":{"name":"@balena/jellyfish-metrics","version":"1.0.34","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.34","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9a38167747830278514ff25ffa139d852517e770","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.34.tgz","fileCount":15,"integrity":"sha512-qfFbv8UJK6O4z8ODVN12V3CiNMGwYjO7uKF+YzF442BFODdKPXwjFvFBApsz9S1+hXlArDdWWDtw4392SShbIw==","signatures":[{"sig":"MEQCIEuM5kIMpnM5bYiD3kSvoOegaROJh/eDzM+ZILlJG75kAiBV5uENDu+28EWgN8sFB0oSp3WP3mQPBrdP13lTqekr2Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80850,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgaN2HCRA9TVsSAnZWagAASLoQAIhYG+dmdqWYNRo7xvSR\njP+ZhY8JHDxJCcnfGFVocU7D/WkV2fX/KNB+slCVK2KSsTURwj+4/5j0oan7\nNx+rDA716wB98UMSqZqoJWbhWz4j8U6v3ebZ9CcA56IxCwyinFASBQ+lBSTW\n9iG6ViMDAKXSSCb+gIJ9+CvkVoAkZSg7LuLtZhf2lsNf6Co6ND6gH/3d/vKv\nQ0GEAMczQfEXru9beIFaD8t+fYI+4QZw4ixJZ2S0vbV848tiwmKvcA3sNnUS\nIJ3hBuUlb6Myi2J0uDpgxo8plFSkqXk9bMAdngm94umA2dNj3X0wSyRWJIFo\ndoL8kuIvIYIEQfoy/+2URpQbwXtKUnumJ5/VHHUG+zfs24Rqx+ldVGprYUyO\nlPsUEnKQLYuNJdrwnSoK4O00Rx0V0dw43U/HjZbfvFa108Dtl5Ldfw3LYxE5\nRQ6sy30I7mVQNDqm7/8M5UPCg8TX3Krp2bU2QdukKzip0JU3zTOBO4XCdyls\ndsxk8EHWf/qg/blVL0TMXBCJBRoouqnXRBlq9xp9b9/siGq9DOuk+TE/7KG7\nZspYfXlMVLXhoD98mflPu4Z0SDMNYZCmX9USvSb+JO+hDtE5SkbTNgWdjFvD\nYxkS6WUV0Ba9WchWNkhF5U8w4N6iOi6ppl+2uqVc5QH8+a++cCBfWH5obb6o\nKvKd\r\n=NRXd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"293968c4fc43c0b160d9327777b3a559a0f198ab","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.15","@balena/jellyfish-logger":"^2.1.20","@balena/jellyfish-environment":"^4.1.0","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.34_1617485190466_0.06415852497734931","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.35-renovate-non-major-042738177ddfb75603e72e1bed24e9f695d5181e":{"name":"@balena/jellyfish-metrics","version":"1.0.35-renovate-non-major-042738177ddfb75603e72e1bed24e9f695d5181e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.35-renovate-non-major-042738177ddfb75603e72e1bed24e9f695d5181e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6798af5306873bebbb6a919a34d278517fb90d57","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.35-renovate-non-major-042738177ddfb75603e72e1bed24e9f695d5181e.tgz","fileCount":15,"integrity":"sha512-E/v3XFXxc9BkI2gkI/LjEWXcJGjBR1a5q3MnjJS8EsOfPMDCUqT9OsEK4qgzyAxte/UkBNb6NpTjq6Liv5SQpQ==","signatures":[{"sig":"MEYCIQCP5vEvC8ePtIAuoK7EHS43P94DzRCOXVzmtSkMPz/0kwIhAJJXeabzSUXAt7wEx2bO+YKHk0TxkwWIdtQdv4fInNcB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80976,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgaRjuCRA9TVsSAnZWagAAUs0P/jJYqXMSYVb96wGZTz5H\n284Zmf/pm8Bcx8onBcq206DGVtMWXFGCvG40YXEals1BVoVxyphrXMHgbgEV\nuAqboDiv9g+ddPxnmr9YRhmDtpfT66p+OIEkWQI2GSQhZ/9D9fOsoRpAKlIe\nbWxQcDrQbF5IWEfFZ+aDb+ZtGJk9cYGzGbi+caH2OrAhIJcMjnyr5g5h08Bj\nWsJ2JyFZlV4RpYtiFYXOUthe10zy9e7+Bj/bPN2+DUphrEAzd+uC76+tfBFy\n8AENRRr0OBNKk/fxnIznqdWM0BjEaaXDP1y8fao/Tdgh92Wj90LsWhZJ7FVR\nIrIWzFF5vupYjb/eQnsxTk0dTdA4oIsQGv9m0gOspV6kmD6Er4zrbTiR9PQU\ncmZMH3GSfn7QcL8y+Y+YbPrN0bqnQLWK9SW5AJWmWVEjYRmemj57OCRD108/\niU3uq3Z7PF5p4Xh2T7u6Xgd2a5KmcBjM7lvzzQV8/7ARnlVUPN+Jmg85PDiZ\n0RI9fBpGGXsECGlAFRyuZ+QJbfDu8TOBFHI9MY6vkUQtMWw/HxWAzLMsiwaV\n0V8RD/DNjPMbC01IaIr10BClQGmqEKIe120x1dUPi1cZGeMjpcgEWeVH8EeS\ncncpeTa7X6cX2YIJS8ZMp8nUTo+f93aFYpYLDq+pZWI6ZA48Jajai7JarSOk\n0dwd\r\n=9WUj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"042738177ddfb75603e72e1bed24e9f695d5181e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.16","@balena/jellyfish-logger":"^2.1.21","@balena/jellyfish-environment":"^4.1.0","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.35-renovate-non-major-042738177ddfb75603e72e1bed24e9f695d5181e_1617500397957_0.9259548600872884","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.35-renovate-non-major-5f9629ea80a29284f0655b5a105aa0dfdb5a62bc":{"name":"@balena/jellyfish-metrics","version":"1.0.35-renovate-non-major-5f9629ea80a29284f0655b5a105aa0dfdb5a62bc","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.35-renovate-non-major-5f9629ea80a29284f0655b5a105aa0dfdb5a62bc","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"745b5d787304822b002e4e29f988a082642b7fab","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.35-renovate-non-major-5f9629ea80a29284f0655b5a105aa0dfdb5a62bc.tgz","fileCount":15,"integrity":"sha512-HwffBMQCSARU+iZ+3wi+kIGkEUormAJthmWjSRGyjMv/KQFSp4Nvry2d69voPbIG0f6Umjg8xhNnC3l8OO4HUg==","signatures":[{"sig":"MEQCIBenCF7km1UMonECq/i50Y1Vvca7byj12tfZFqZB3HREAiAl25TJAe5yqbI6zCnvKwhiqOr3coR6vxDNM5IOq/B+lg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80976,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgaRowCRA9TVsSAnZWagAAWYEP/34oF7yc4p1CmL3VCeac\n/JpixhJ+IUELnrNMJid5ftInCd7cnius0xajyMTsSLwtFMJDTzPUKn6fgN0/\n9RcIzSvbupTve/UDwfj+MtQNgKHJOPOey2W9Tdi/u7SuDSSfdQlSXsSqtmhC\nhtZVSjPySRSpbzITXk6T8C9CnE/zc3QvpJ8etTsk/sQMZsrR1o39phP1owV7\ns55biJUDnG5iF3vE/gqyVnoAqr8Q968AfecKyaWxxRxJ65w7vXrbG4n2FPbj\ne84TQ2Hmo9Ayzy047MJXGzj141MYT/3KPVnJMQ/IzU9xqJF/yqk3ybrj4q3B\np2ybLMTwVRN273bIdjfL7gZOf11Et6HkK5NHUj48ueDO9Xwxp1bzBVjGukyl\n++rINg8Zx5yzC6hSN6PfSmIch/pwvM1Ng/W2mBCCH8d06CfzHn0got+sECzo\n0Cj1wLA6mCnRP+dVayOKz/ZiZGe3rxX6MTp/f0z7Q2FSIE9jDNfZEFIIPirA\nl4hF2+ka4FlXKXU5EURXAQMgyI09AFlrx41lmkbsevlLejv4fu9eMa4eUMfx\n/XX3s5X5i7BfVva14hwwSRt+P/GoJU8LYOceBKz9f+yP46NGBPY65msagzND\ngY6yYLj6bDKv632k1qDmTPHiwARXp4bAJO+uOqJVF+bMp1iUkY8l96ETmgWy\neUCM\r\n=2tGS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5f9629ea80a29284f0655b5a105aa0dfdb5a62bc","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.16","@balena/jellyfish-logger":"^2.1.21","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.35-renovate-non-major-5f9629ea80a29284f0655b5a105aa0dfdb5a62bc_1617500719929_0.14210613949345108","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.35":{"name":"@balena/jellyfish-metrics","version":"1.0.35","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.35","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bf3bf2f36ab2c538368bfa87d851223cb97adaa0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.35.tgz","fileCount":15,"integrity":"sha512-PY8NQqQ3HSu26J7OTwPb/mfEJIY0JHfjRg6qNg6cIii9HNVtj8+imWXhJdjJGFJipf5UBzgw3J527WcC5QcRew==","signatures":[{"sig":"MEQCIAgbIdU0W5TRYO2WfqaJ78pYyjmrP2TwyQbUAgRejWFyAiAxlhUl9U599x18OFIxxQI/VEz7j5sJ6MfTcPeZAV9/ig==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80916,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgaRrkCRA9TVsSAnZWagAAPzAP/2fr7DMrnNf4S1mwo8sE\nl1eL1Mka0mal6GqfzKLABILi6Sc0eXthIO0eChPQ8ZHfSYWzWJo2XfoBnPQH\nz7/z4j8fEzguSf9hqgK6ta1RElspkwITc2inpgR2ZVxTAxO7qa/QtGH/hJK1\nzvNgTugMOfxoHEAWzHMLj+0ifiS5thIiOyFj4i2OtLbs0IQ6DQU6fzsbywxb\nJ0uOac5CPBdRtFPj8PRAtyDe9lS0jUjzpWannYePT3WUno6yw3SuHR+KavSG\nPS9cGEGlW9pOPbF9yO1I894vDuOG9vjb+5IrsvI4m0C3V+jV1dbaWdw19fgd\naJKesw6BnyzwRNRZC4djo1b6zi6NTDlWh9KL/r6OD2fgHGslpfePWUGg2xD4\nRWL0FU9NeP19CNM3hqmd+WQMgS6C3kZOsa2f53pqMAlMLkCX9bulO3PmOWGK\nIsdqQlvMiT+I0C3o8oqmhdAXrqXyPhKKdR3GRHdqGZHLb+uryATs1Rq2LOXe\nCjt8PnO+UMoj1/4wsDh+igm3tF3BvNqMdr44lu3LsfLNDYIrMaTZva8ykTJn\nwiPErLBfr3RSgFx62YSd1xODAw9sKHCidoWHoAMCIyXn660bhOGZofvo4Drx\nLWyXER/I1usXkCELiS6DKCwuiJkm5S97rui+FWh3VDwRlgx616KgBY+NAA9Y\n2Nmp\r\n=wZWm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"be50dde42688267016ca32adcfb788b12c79ed89","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.16","@balena/jellyfish-logger":"^2.1.21","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.35_1617500900396_0.2862538563307664","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.36-renovate-non-major-20df2d31ea000157eab4a0f7fc9b70b6db65b2c0":{"name":"@balena/jellyfish-metrics","version":"1.0.36-renovate-non-major-20df2d31ea000157eab4a0f7fc9b70b6db65b2c0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.36-renovate-non-major-20df2d31ea000157eab4a0f7fc9b70b6db65b2c0","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"63e9f783f2cf9ebc512c5172cc3820c98c6d551b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.36-renovate-non-major-20df2d31ea000157eab4a0f7fc9b70b6db65b2c0.tgz","fileCount":15,"integrity":"sha512-COMJ7xGqM4bBZL43jFMdvWlKs6SEB3FRcDS860VqPCpVyt7HMrUNHkxT/82dMk7xCy9e2N2Mcawa8QNl2Zmdkg==","signatures":[{"sig":"MEYCIQDWct5ab7PJxLt+C295HE+LUMDrs/MhyJBqxkLditbiJgIhAKrY6VulahkH5V+TyJw/Ly8PD/i/h04gcXTLPqVrIUHQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81079,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgaS2tCRA9TVsSAnZWagAAksIP/jfLYXRQN7TXAeUaPgHN\nIvCxDlpNHwDbUhIQwwpLMYZW0Qcl+68Tx3sxFJZwQyYd/4YOWZna3KQ2/hop\nx+iAZH6oU+F1GmZCGKXD7DiBUg9jQxFbVBBipSq28vSJB0a2i6WZjs4CIIU9\nuJu01NGHHtiyvlQ7sb7Tia27dPC/9yOv3/ztZzxJwQ+/RDjqgYulxzd//UPq\nNIwNl2xcRgLCu9E05GH5EvonTy+QV7VL0QvB5rGfGS+B5kMxrWbWWCI/cpES\naCD1jppHjjeD3GS/hVZC65qgKgppFa+QcUT2JL635jNZ4PmQxh7lXuGneziq\nT5TP4VIXIddIldQ6Yf/dct7LFuaLdAZzs8Chq2Mk0VOPOE2XDlcYVxsU9Mte\nmoZu1pyaIbuiodRmLWc9Cyn0XHtGPLcJwAvm/QtTkA3laMwwmyPirGFOVmSE\n9z6sT7TTtcErTRUJXkmaUqNpnJ2GPke+uqCgWMVyOX+LSv+hw+OChxTPbVFk\n+V/O4Ad6LAqGqhAFU1sXKBYa62mSZ9EFIxwCxo9KKBdiurpr1B/Z7r3Hb/z6\nQuqjlpUGCMaG5nREBvDmJjIaamV5Yg8KfRXfvnm3u1DClLOtWBmye0u/5QMv\nMOu8G7bSoBUAWKaSTpRO6F9ATcEmDolv0H4SNc4R3+uh4Dq7ldYnmhvg6qqX\n5VUi\r\n=UF27\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"20df2d31ea000157eab4a0f7fc9b70b6db65b2c0","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.16","@balena/jellyfish-logger":"^2.1.22","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.36-renovate-non-major-20df2d31ea000157eab4a0f7fc9b70b6db65b2c0_1617505709194_0.13142322726531375","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.36":{"name":"@balena/jellyfish-metrics","version":"1.0.36","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.36","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5d298d6574314c9cd08a44eda3e1e4262e497b65","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.36.tgz","fileCount":15,"integrity":"sha512-XOodmD3GzKsUKqdxv4PpW+1oqOZ3MmTB4W5QqgMuRyhJqPxlXt3bnQkPkFPDt8Vs52UvKernrP/qPzUXNyPjkw==","signatures":[{"sig":"MEUCIQCcmcs6Hd7b5PCq/3rrM0ul3mhvMeQvgmRVGLFh9cIUVAIgS5pLz1mEiiynme7pNlOGfp1I+tIk8BLFO/9ofep+zmY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81019,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgaS51CRA9TVsSAnZWagAAnhEQAJqQd++K5uYAu/DIIZ/E\nTxgAWjCCkG+4dZB/u/stFyg1rfQEzmoj2IEK1wXm89T7MI/nQ4dWGRnungpY\nwTm8hWBTtXxJG6Ws3ml+6/4LhAL8u93qbuSqVQ+GXJBBHxsMPbZDM63GEdoF\nFFQ0UgtsnCB7b6VUUPcAr/hfb5G0smktkivcfZ8Sh+gKzQ7kl2Sy0TYFh2MR\nq5VOqpZdk3dXY/iTJwdV4mGs6hHlIUw5fMGdVEt/lq1Ao4YL5FFwJOR5gQ3V\ns0eenvXScy3xhyfigzMwkRswbbq9oxsTmhomEsJK5Ss+2/1tikGAwF/IP649\nkeNOLcZCrEWgtL/m1w2TUJ5nOrJrQJdxGYZFfNax14RDKSQc6M4O2F4AxnH7\nEgHLXa0W4cdG1B38eRKUgrP9x5T9dydQ1+eAQJC0GzEXwuTtHW49USJ05Ddt\nA5LB729A10hx1ZXcHNE1Z4/1tU0/EHLQQd7OhDjCt0csS2D7v99EUW9ySRuR\nONLxgTtXwFeWa84C0cVmk2STmn7VjTk76rS+Tz7lhBHg5HlkUXTA8wi0XGhS\nZrm65PYgZ1fgYgGMPB306LlhlEXJOASJJdpCzNYNRu4eOz2yEtwwxbunM20+\nfWzw7fmbCP/ZE/jhG/VhLHCdK62tL/adiAMRrKZC9afChKm7W64CtizEeX6w\nEHtZ\r\n=jetf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"57267db44244c81a91e9e12e8b56e6d25f74e2ac","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.16","@balena/jellyfish-logger":"^2.1.22","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.36_1617505909451_0.9618367861528769","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.37-renovate-non-major-9898201361c58bb6aac211ba83d07a090274c364":{"name":"@balena/jellyfish-metrics","version":"1.0.37-renovate-non-major-9898201361c58bb6aac211ba83d07a090274c364","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.37-renovate-non-major-9898201361c58bb6aac211ba83d07a090274c364","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"08c8bfb26894133eac86740e59877523ba5423e5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.37-renovate-non-major-9898201361c58bb6aac211ba83d07a090274c364.tgz","fileCount":15,"integrity":"sha512-lQiNg+aRm/BpTyV3P6txmtm9jzqj7HVJPAeKAvHV4aTmlZQ6Kyi2FonVJhvHGArQcJOUOROLDnOks1ZuJHv0Ew==","signatures":[{"sig":"MEUCIAmqFa69cYrfDsCpS+dfBp+zpXK+o9Cbbh/wxmjFHkGjAiEAlm4INeFyBjBhw9qaW4CTDNuYyf41Iul2TPzXxFuwvUM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81181,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgaUgfCRA9TVsSAnZWagAAYqIP/RY+vA5zw9auIfEu9g+n\nsdqmwwFm3VkIP7aVp36q1DcRsfQNrczz8I6p1IOOhtDPufMYp+9QoPlOZILj\n6M6gpZa7XeMHW0lxp6oBCb9WS3C6A3EceBPWe+XmuAbTxbWyBRm8V4n2JEOr\nRMnRgcJUU970jx/gbhLQL32m1D9nQ0Gy/334EZ2Rka7piML1Zk+mEdLBz2rx\ni7+TJeg6L1inGR2Z2bDvLaeQKQvuCXiSI7mdl/PGevXnezPhEvIZiz++r1rj\nyLK+XpW7i+gEGUiULSeGCx4L+PzGEfIq8GzNHPAOpR7VvXZwcbkfBF78E2q8\naluE5K88QECuHHnC0Uy1sxlVGbrXMCWxhDvXuFh9/pF+5yLIBIZfuJZJ2vVK\nQbroOANOZDa8RZjGWBt5PeKKI+EECd45m0e+0yMqcAi+Z7Xn7kiRpEd71WSD\nzYBZAG18/0beKn3b3oWJ9k0T+bLCA18st5oe8poAlPcx1dZOEt1FIdVDV6bP\ny8ktqewVPTL+RNaKaDbnSg5RgfMv4FRdYUSJt4JrELAO8hIdeP/+q46DxcMO\n/+xxO8mCYKgg985r8mGgytqrq/ejcc9/QXKha2PyrEsGqqN4qkiYQm+f3iHA\nNUGEpTzB6Or3+e+zrZjX8aqi6WyhbZZ/rESq9i7D9mCbgzvT5uCJPMXzkBAc\nYlM/\r\n=aDex\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9898201361c58bb6aac211ba83d07a090274c364","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.17","@balena/jellyfish-logger":"^2.1.22","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.37-renovate-non-major-9898201361c58bb6aac211ba83d07a090274c364_1617512479217_0.07704913443110128","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.37":{"name":"@balena/jellyfish-metrics","version":"1.0.37","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.37","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cf67eb2cfd359b370b3d85c35a24dcd297a90ab7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.37.tgz","fileCount":15,"integrity":"sha512-VFcdVVIdEwg0kN7GwIpZxntDfmxgjuA9cGI+3EyVaGw/DLnKd0ZBksUGf+3NITW9M3zrABd2l7Oa+db7aDalfA==","signatures":[{"sig":"MEQCIDYb9h0zweKXxrEWgPeFtSMgvMXD/UZdxsPHmsHa8ypnAiAnzeKMum0zzykwLe+jpzLq8lVOfuCrimB36TFveqmUfw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81121,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgaUkECRA9TVsSAnZWagAAOikP/A+n9vcjaTjY4IhUjU9t\neY9tnv9buYoI17jqVfM15YNOWuKJZxqCEIksQcC8SVbzL6GazVSqCvaDFZM+\nNY3fygRVK1woFwBc2cxUEFlv0pMhhYsU1J9UYwvDtPu94UNh6e+RyFKgVap1\nibbEIKHbu7Y/cjD0zUk9BWgd7akVQoSv1zBpyalMFakybVfZaENhC1hfU/Io\n48cvh1dxV400gtNLTGqKYLDDY33zLytE5FOHKSkfmRz6cv4rJyldCaeKTkS5\npNrFA6j1onf4LQWz4WNOUjFVQpncOgAqTnbvlg5UPhCLOGrG0gpq6ge1NHPa\nR0otmSSoKPe+RC424DJH/Tq3KBhazeIEpHzAvw+R1MmlnT0mfFE2WFtvE+ju\nnEFqTZ0f0Rcj1n6Rr/2Ni5c2KkKvhBRfpH2AMNBRnJscL3T+Th5Naqqv5q+v\nEggRq+TRWdzwUQhpvOFSy0V+6R3QvXcMrA4TO3cNhLCrs2sDnSOhVYnerL3O\nufZ92Kn2Msab0XpG8r9in/8k5Ep0Hhg5NtIBDJMxkaAq3zrhSpwq6LKrGIt3\nYvs7BPh2pVWQKWl3opTZO5d78VH3Z2nEZZPkguX0+zf1UL9uj+/+wrdcffy/\ndznu20SqvHLhnYRpCSRPZgiTc8/zjJtOX5wGmQwarItG5HoCN5+7P78EDvmB\nmicG\r\n=0oA+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b6de843a9388126ee372fe0b6e36f31d53e27fbc","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.17","@balena/jellyfish-logger":"^2.1.22","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.37_1617512708224_0.7880614813801157","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.38-renovate-non-major-a069a56c5eb74ce928ff9087d180ba6770dd3a5d":{"name":"@balena/jellyfish-metrics","version":"1.0.38-renovate-non-major-a069a56c5eb74ce928ff9087d180ba6770dd3a5d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.38-renovate-non-major-a069a56c5eb74ce928ff9087d180ba6770dd3a5d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4922a797d72f6422273fcbdd4d161bfbb71a0172","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.38-renovate-non-major-a069a56c5eb74ce928ff9087d180ba6770dd3a5d.tgz","fileCount":15,"integrity":"sha512-D5DKAJGKkJrFp3atXPvNSoGfFb6qUES5/Blr07cdiXNEGSwniDla1ggMa8KRFxwoQt7vGkfxWNkLWp6jFIYBaA==","signatures":[{"sig":"MEUCIQC4zRYmfl7Id8JyUakHw6pOhLPfLuzeCOEfNWYS9YtuHgIgFn3gVlnSZU1r2Hs4djKk12sF0SEJKqW76Czie8CbOgo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81283,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgaX70CRA9TVsSAnZWagAAmjUP/RNKZHEkIUnx8QNhCcpN\nVzx6QJPU5hJ/joipTh3F4P5K8nqvaklwIKbg5yhbH5dE3Lkw0jXPMYEA3+XM\nlFNxKOnPP8vwaLwUZQ2O8W5hq+K8+lXX0wtJb+OV1ejWMRBLUxqKqWyrKzso\n4F+mUrlXv05DH49Dpe5abUQcfllo2kOoB8jVZpBXfy/OIlMjv0tiG94QISGI\nmNHKLElfLzYcoFU8yiLZKExP+V8/RsuO7/mHUHCATTRS5fU4iPZNAWFgDrhj\nvLf4MDU8goPIKg2tzf+2tlYgYUFJ6hp0TTEYkVxs1d3d+NrVNhBt87OgxivE\ndNWYk0UVL0Wto5oxy+IZ0mXVCG6XoUWCzLTIIQm88wjvSV5YUsyi2rfWCjkY\nOyKmjafMD49cFfJ0fPMPJmdjABzrHuy9An6VK9GYgREb2/plYk2ES2glx5yd\naxzH44W88pLZpkSCW5GBj6orrnvxnHfSJv/AcQHLGuzX8eQcz+z3vFcjpJ6F\n4VzHuqPXdJbSE/anpJQXNAeHGaqdHUDKJaGyEoHM7GKIBrgJYRxd4wa06h68\n0+ZXT29RWhc4NY3zlLhlNxSWD4sKAPHUiXICtt+N8poQC1Kx3tBNm/rX78ey\nfmeQGtLu/mwNfPcHN1UOujTnjEgxtPkhn4B0c3Zj3SWMVG5gp0TgRQgsEe5P\n9RbZ\r\n=u3Yk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a069a56c5eb74ce928ff9087d180ba6770dd3a5d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.18","@balena/jellyfish-logger":"^2.1.22","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.38-renovate-non-major-a069a56c5eb74ce928ff9087d180ba6770dd3a5d_1617526515480_0.2586535547327298","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.38":{"name":"@balena/jellyfish-metrics","version":"1.0.38","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.38","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"446316e1e4a292b177c797a1946037e874749030","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.38.tgz","fileCount":15,"integrity":"sha512-4kFzQFty+P0kWgwskXk5l7Lj9rJjQwTe/2UXp9R2zzrobKMP8QxEZvdr02otu2wmFKqR+SVGP1Y3arOwBHxfbA==","signatures":[{"sig":"MEQCIHtwYIR2wK72RwBZA/QM7lsgektwW9hi5kMuHNMRUB+iAiBT9+6rRgK5rQIcY+//kVAq6wlyV+R7iHXEdGdeNxk95w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81223,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgaX/UCRA9TVsSAnZWagAAIigP/jrctaFK16vX3fJlL74l\nYjk4aQovRalSYm8Luv1gLfLuKngbqgaYMUBsFQG/aJJw/QYTDkwmiwHyMWpT\n9iV7IkfExsPjUcOqTUxH1KA3RNk0z7X4xQpispLuJOP9q/MPMlz/Hd1oL/LW\nkWE/L/lRj68R8rsfKIUzxDm1UT5s+A6DkGXLoBaT9iMsm4rWwAxL4ikwA/X8\nCf9YkDwhzPybaQuDm80MMWfBEhdujHPJFpRSfvmCVxHvJcCEE0ENW41BHI2g\ndzJdi07YECzQmUZ8Mycarsa4VDS0xAwOzQxNThZlTT0dcGaOgGNfsURIbVtd\nliKn5k09avIpB5m67afNWlAywPu7gZNP26KBBW4UeUa7HMpA1LjkrY5598FH\n7Yk0GVZZtZvHuJ9gP9KnnVAbYYAZ4FvOsrriDMr+1cENMMI2LtiPi52Seqi5\n/1G6NEE+iXUpiSRZAu52PB76P9jO6J6dOeINRlSHSk51dojbRh5S5j9IHzfp\n+azF15xAaCKGN24Dm9YWLqJXenlbex3D/VLHfCPW/2913h9NnatVbdWIr/FG\nZ8FfkyVZbN0ZbAtHa6VoAV921GfRyH2gfztuivdIi2K/RvP9Q1IH0a1LtekN\ncRY7oJi7Bjdu7K43q+iOfDoyKGM032rvQJnMJ5XVgUbXEsu6PeiEDn05N08k\nDmMO\r\n=x5rA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9733b32260da9f2974ad3cf2232b1a269cf556d7","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.18","@balena/jellyfish-logger":"^2.1.22","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.38_1617526740370_0.5232983971030243","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.39-renovate-non-major-0e91404fb60e4ccb28607420f2ec9f4db097dce0":{"name":"@balena/jellyfish-metrics","version":"1.0.39-renovate-non-major-0e91404fb60e4ccb28607420f2ec9f4db097dce0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.39-renovate-non-major-0e91404fb60e4ccb28607420f2ec9f4db097dce0","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6d83bca0214c14308c42d5e8cf8faed017c84c28","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.39-renovate-non-major-0e91404fb60e4ccb28607420f2ec9f4db097dce0.tgz","fileCount":15,"integrity":"sha512-HEPkCJ+4DZJvo76sUeS6sAmaXqfm2uagIIdrx6Mehy1ME8nmkXSWDJd9om/ftJVlpgEOyl8XRRvX0wZ2qjO99A==","signatures":[{"sig":"MEUCIAMOo4eo6y7b1EbqzOOO9f6tRml91nVNjM9TpLpr71MFAiEAoK5MGZqoSzFfUshz5dXCSHLFsL43cgQFoXCI4at7e9k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81385,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgaYexCRA9TVsSAnZWagAA6hAP/jKwEv+lrCSbuS0xp4fJ\nsb92IMxAzwEytlvdo5F/IVjCNiOGYCbmhWfQtqsCazeFYlVDsasrgOZvBSii\nSIMJx9nJQUWU2XS3H7OgLvw2Gee2oq+oW1AcNDibwyC+gaP5pUXN/N4QHS/P\nw8tiizkSUBh8hGvnb4jm30QLf6kM8SsO5RSrLkijNVnSgwZCL2IdknG+xB0k\nHmiE44XohTNYCwgUDmOF/RpmBiHQrzi6HZLqJeYrE3u3kSmdwne8K2GIjulo\nwqgqgtAUzVosTlA0mNa5/zfdcNBgfn7y3ftRB6UuCwp8OyF+Va0dgz4CEswJ\nfH6R7rRfnWVS8Ij3YXRRy+CG8kVe0Byu6T5rcTaAOuuKxF8vGeflv1cpyyU6\ng+ymaH0Fx6ptcTmTAvnTI0ds/o4AGhAD60gTfS67cU2H9l4OHJ0cLEQRrZFd\n3Mg9urgY74Bz/Jud0+d8pjUnY3X7ja8rrjv06LiqdtXU7qlSVMTaLEXJvy21\n8ODynK6izrIojE2lQBfBo7RXXVD9bR58MZ8OM0y7AUdtXfLJ7kFAjsifECO6\n9rZyEY+xCXvgGy8QweG8Xk8Uk74bJ6XgIIN6AR9x0BsrwkfWM4ywJXZBzn/C\n1sDXK5udUYggXJrTLxmX1O2q5E+GgTnj7ByvpB7/SgCuoK+Z/pySuA3+mEsi\nYhbI\r\n=78Cy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0e91404fb60e4ccb28607420f2ec9f4db097dce0","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.19","@balena/jellyfish-logger":"^2.1.22","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.39-renovate-non-major-0e91404fb60e4ccb28607420f2ec9f4db097dce0_1617528752508_0.2727415019777266","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.39":{"name":"@balena/jellyfish-metrics","version":"1.0.39","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.39","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"244bd2b5bfa10363fb5a857210ebaf58326b2697","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.39.tgz","fileCount":15,"integrity":"sha512-JWEYorC8LS3zsMaW6Yx++2ho01n61bS/im4SstmCd2JrAPRRya56KUn6N9jEgoIEskXHsu4Ve4XjFF2J4Nid7Q==","signatures":[{"sig":"MEYCIQDWet59RPOeLnzRAVMw96JywIbDNgJPpAVzrxKPqVcTwQIhAJH1Bv+9qrW0sQYWCimVxJPpQj4myVppNcBE5P6hadTG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81325,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgaYhuCRA9TVsSAnZWagAA9I4P/2ZBy3qW27fZcOkLb/P8\nyNzibFcIBPUyPO7plZky6y9k3danYjwV89stv9h2Es2sxLLhOfGFm5nJpXXe\nOC54jY+fuVrycnjKaCT9lPfcC3l74hNPBmXzMNEeoYld9yGtTx38UvH+GgW3\n8mFeav1I4r0vHNwx0MOvjjJMCgE7VLuL+bkWyZAAFApFbM3+/4gU2D7Dk2im\nY+Hf4xnE53uNeXFLlmrlRkRsGiNXpTvVnEtKA+oDrr+QRGBHV2MpwtiwQfDN\nu7tnjE9+pOr44lGmyFQU2gUn4O5UZQpoY7IFDMuamXLGJUL2spSdPcHB/Qsw\nuXmO8JFzXyJ2JQFbnytA9L6Jf5ygEQk1VdQMasHnJpJONWcSGHfORrozn+fw\nrfpM4F1sn9H/4i9Qn5SeU6yZSCSdIZuze4oqSx57d3Jnj2Dul9W+E1DYbZWf\ns1TNUDoxwfwp9pUP33Kk2sZbEMcIFgh3ONopLL0naw3vIJdry+W3hfOIoEw7\n9ACEEwa+8xYreiR/PNQwoU0MwBQjvP3D8ST3dL43250pnzO6CyG/1B2HGxg7\nqo2NprxkcxvTRIKjQrWnOzdq3ozRhV/kL2ycVfRaCqIUzcoPPCfMtQulRMn5\nn2DWhEAiDyxwbaPHthu9a07hJpEqrAktDdfFQ4mIXadNbEkZjAKuX8aqr9CX\ni0Df\r\n=xm+l\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5bb7303f077e368671a38244808bf5ed0d645608","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.19","@balena/jellyfish-logger":"^2.1.22","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.39_1617528942360_0.3606868830320631","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.40-renovate-non-major-a3c3c3736e5c96ac8986900c6a849a99c396eb08":{"name":"@balena/jellyfish-metrics","version":"1.0.40-renovate-non-major-a3c3c3736e5c96ac8986900c6a849a99c396eb08","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.40-renovate-non-major-a3c3c3736e5c96ac8986900c6a849a99c396eb08","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a0c92a97c1cb4f747ec9569347be4103539cfd79","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.40-renovate-non-major-a3c3c3736e5c96ac8986900c6a849a99c396eb08.tgz","fileCount":15,"integrity":"sha512-4CMStN+rvbkxuXZkWYZps9682+MPe7b1h0seF87PTe179OTN8yWHzocHB5CVmK1zH8NnoBP5slHgfaG/AUGfmw==","signatures":[{"sig":"MEYCIQD658qfpNih7dcBeMrzsdnX6OjM+4m8i9qaCuifeBwXOwIhAM87VoP2jb7J74p6hwLKgCwonft2rU0MosIrA+RJsLKq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81487,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgakz9CRA9TVsSAnZWagAAUtIP/R5zCgYJR4464H+sd1hF\n7jnxq8CC+WPgXgpIEst91GM6FOxUZ6oAqwl2etce+wLTg0FcD6pB6XzD1RT3\nrG4ITQJaBLaeq7VUvbCBc/8kp8nKj3HZ4E/4GKcWl0VBsqw1qehNOoz7LxKf\nwrNVJEPKvcQ4Z7RK3OA9xtNhC81PsjdWm+1j6tVxinXsUuQpcwUaSBe4/z2Z\nYs0rXaQNzmpUhwa0lDgMsTS2pWlta0JIu9Xx8BXvmouB2eI06jyzrRwCsIR1\nQJ7maR4f9FUuHYOp2WjQnZe0qVdQ60OM5UVtXOTmfEanmbQxEdx3SeliHx22\nzWwB1OkRkuXKLOGf9+SkIXPQp6B1gbmvXH19S84TpYwJZtzW3EQBzj/GSbK6\nMWBtlGy8V5b/2rOYyiL/F8RiphjXa6TjPTghM/Xp42bckKnhUwauTbxoaQ3D\nNcdqQKhc33VYq9oMMxddDhOVx4gVPFjPI9ndXnXgRNVkOGt/Ix8y6vtPrydD\nPyyjQsXK0H5hZZ/azJ5i/xjMmCwkAYjE1BXFz573qjuyD/c/39aLymfxpIl+\nYpmFrbcg752SWRU1sTia8RsqMDb07D+QYNmt6xznOJMCZ3Lya+fzdX227ZrN\nsrBf2YpiuPZhEoVsbjjDK1eBeDNLrnnBPLXOSifgdCqvxIZmwR5VAsnYSkEM\n8o/f\r\n=ygg+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a3c3c3736e5c96ac8986900c6a849a99c396eb08","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.20","@balena/jellyfish-logger":"^2.1.22","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.40-renovate-non-major-a3c3c3736e5c96ac8986900c6a849a99c396eb08_1617579260812_0.16957829827894755","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.40":{"name":"@balena/jellyfish-metrics","version":"1.0.40","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.40","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"82543db085fa3a93cf0dda5b3867d30a069971e9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.40.tgz","fileCount":15,"integrity":"sha512-a7E/H3kFX99qLt/x/XXF2ZadbeQvpip9gFUI9z10R2kiOdWaWh+tidoLRiti79zPXv75qzt8N0xnUSYA1n2yAw==","signatures":[{"sig":"MEUCIQDXkKSHcCwWRSB1ggHs9onqpOMuwTd5c72OXZb5ZRf6CAIgQ+hXj09jFe95aLPu14bIf7pI6USN//s8dGtpjLtpMZE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81427,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgak20CRA9TVsSAnZWagAAm3EP/2O6uUoyiptKbxhCRqgd\n5RGqlZh65slCdqP/pYYR393X5y4I1tCH6+ct9NM6XS9eNxJOTdaDkBULZcWi\nsmjodtv8jk8ewz4BZSbAci6p/lPf5fufup6N6/rMdOP8STYaTRLbWA4YnzXy\nmr96UVj5GAp2MNPxD0qM8j/IrpiEiMxCj5b2OeGVYcaKY/EmV3K15jAZajyz\n01N4DSFdphGkzzC3QcKnCczMzwZPt3pKAuocuyOzbLAYWswEWmcU/0WI2aNW\nTP6tc6eWS++HbfQcLGpHjCg+xUQax72viTlx8/V14nEf6v2/cn5mqaWI8sqE\nIQPwa7RKDQYrENtMAlJEuWE6hYG5PcXoaeIuOkPQe6UkSCTin/sivFM3JgTF\njzNKny1Us5Hs9rc7aZz8QZhsfyBJImS+vayvhSxwC5d+Vm2Cnu7kTb8iwpI/\nJfxbkZVCl2lp+5GcfL2rd7A7RlRLRLFZf1GD++B67R0B/LDr3nOj6K1zo09A\nb/LccwxsnmpByE+COEXPASww2eq1uG2lGJgZQDJyl+JPJ7rpOncR1aIJFe3v\nTZD6zSisQosANTIy+PFi+9ujBOxfMljVqwwdNy4faQ4ROsNfXdxAdgTvQ0XK\nKqL7PtQ+xoLZ9qBpTXoj/EB5tEfbtrNQJ5EUDErk7S1YUsrqe1xs/DX9tOog\nZGmt\r\n=v8PU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"21c01a559734c1fed86bd99edb1db8c322b798ed","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.20","@balena/jellyfish-logger":"^2.1.22","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.40_1617579443664_0.3288442967498406","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.41-renovate-non-major-cac10622ff6ca40fa7c9649c175c61cc8cc1be49":{"name":"@balena/jellyfish-metrics","version":"1.0.41-renovate-non-major-cac10622ff6ca40fa7c9649c175c61cc8cc1be49","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.41-renovate-non-major-cac10622ff6ca40fa7c9649c175c61cc8cc1be49","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b68d1f209afbe4816f70eb9a24f2796a75357d5f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.41-renovate-non-major-cac10622ff6ca40fa7c9649c175c61cc8cc1be49.tgz","fileCount":15,"integrity":"sha512-xxeeKhvKNpXcj9OOg+rVUv5HhZGXBiSnAsjJkPtEAjk3S15NfIGrAX5HYcaAGpOIuFvErTK9EL8MbeyfvKpyqQ==","signatures":[{"sig":"MEUCIQDFj7K1MBGwrcMEPyt8oADA8yGrt7C5CsFKOfAM/a3c8wIgLlTif8V7ZyvBaras10vBimMzRoeM615cqJauzOwp4FA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81589,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbFTmCRA9TVsSAnZWagAA/OIP/AjKeEfqDhnuMSK0d9tb\niJsqO0+V7qLp3EejO32BUKn5z9amO42zQpVG8yNWussUinvmD3SNFKmqA9LX\nLuhHefGQbtMooyiOegkyr71V/U2uprVXaXYGI69Owb16jlHFeCkmVPuO//pz\n99VIDfZx4IYAWTq8iXvFa2NTG9qJ5FjiGje1p8/kVOIbl00riPdq/E8Uzlxl\nRLTlw0RUyLQGcLz/7V7wsrVHV3sJ6SJjkn3caX/ObXpaCXLKiryunjTmLVA1\nPY9yIolkiWzf5oaT5ONVVbe8EXCcSlDbHYCxobC09+x73Hq5oUVcsno/xgc2\nLU3lX44vcMbJ/TIsrTopri/Qb1uJIf+HlW6MIDsJlfE8Cvsy0m7axHeidW0e\nINeuVHVGYOceSP27XyKeTq5mA8oCDNlF05S6Gy5UAva94K34IODZ1VlLPZjS\nxXuh3p/76spAeoQ7GTnumWnS46sWkjastl9wgmsOj32ZhJKy54aIh/VgiGp1\ngf/YtT+s1LYaPNGY8W67V0FBOGGkxQbIHx9yrMJ2h1Ew01oYJR2YzKcbTR22\nh8tj1SZejBNiOMljNgb8enLFAD4gwrHUthhvMJufI4ilXBdWXKN0z+gLXKXJ\n+cBFktoEuRpeBDQb9F5VmYaMuKpORBovPj1xYXGyzf8i+ZTwvs1xIpjwKzLE\nnKvH\r\n=6Pu/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"cac10622ff6ca40fa7c9649c175c61cc8cc1be49","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.21","@balena/jellyfish-logger":"^2.1.22","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.41-renovate-non-major-cac10622ff6ca40fa7c9649c175c61cc8cc1be49_1617712358087_0.6696643318692155","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.41":{"name":"@balena/jellyfish-metrics","version":"1.0.41","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.41","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fef384297dd561be0ed00d3df613dad249288975","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.41.tgz","fileCount":15,"integrity":"sha512-DvwFGd2hvpUdS4Ivvfkw47TDDrhDw6UuwDoi215aVMvYiQm0AuWOpX0YxCrLUjCreLr6cd9ppptU+zX9N7qF/Q==","signatures":[{"sig":"MEQCIDRDSJ44KefpU9oWGE3hMj0V1vIgN3+XU/oVNXac6RZkAiBhM/4SxfsgSYnKQe3NimwUfNVsp8y3/0CGwCEbJDGG9Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81529,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbFWsCRA9TVsSAnZWagAAxq4P/jKfHg8CmNThAeP5i2Cj\nbwFMS2i+yH85KPepNZHr4a6hpJl+zopSARBB5/AWaNxYW+y7PCfxBr3eP+bx\nJXGKIgKvrZ50qGYIiSqr2RortG1sxFbnNlTaJDBTI4vwT0bpn4FtI6DyWRoc\nCQQEn91wz67OmXuor3ZQjh1Qi7OMyz4gBLAfsk4vDQUVf4rSkqiyEcX84rlI\nMayi/cWu+DRVUpk2FPAD7E3ef/RnwqXdkoEQk6JJITpyAITz75oJwGb4hnSm\n+Jy82DhLTKyjXKCNx5+xwD9Nt6u2/3jHUtozZYxeeJGftfrVRVFcruZodZdE\nbd1H91EFnBJnz/TAKc3w5xtQtNHZYeUXLmeE+g6oCoZpAP4CjKkBS8EHQgDT\nXwFap/FWJXhNKrSRf6spbcO2pPuJN+dO4qFC3p9Ng8CJnrN0ZZW1F+wsw217\n+xWO71GLm/94HKSDXjP6KgVOqTzrlGpqqmlwU3p8CYGSMvkXf9vpmFJQVku3\n/gv11WCGFCWr3+oaqEyCvR2l6Xti5yJj1DI05NeBloTtiRwFX+SF9pbCDcND\n/86xag4MJxC9nB9VX6H79dU2cNs8ocqAZgNeDffAd+pSHYZR9+yqvo5lDwlz\nT6wfWRB6xAhVmibzVe5NK68EAl95b7oQVqdch313Vn66+sYiih4qzEzdDxMo\nJSPF\r\n=c4rQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2d9357986ec557e4de6c735bb6a273557cc79313","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.21","@balena/jellyfish-logger":"^2.1.22","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.41_1617712555530_0.025358912459958027","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.42-renovate-non-major-a76274b0556799712f2a8b5c47f3113325e686ae":{"name":"@balena/jellyfish-metrics","version":"1.0.42-renovate-non-major-a76274b0556799712f2a8b5c47f3113325e686ae","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.42-renovate-non-major-a76274b0556799712f2a8b5c47f3113325e686ae","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7addd1acfde9be6bc5ffbfc5bb08fe98ec65346b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.42-renovate-non-major-a76274b0556799712f2a8b5c47f3113325e686ae.tgz","fileCount":15,"integrity":"sha512-sEPKbLMqAdgu11KW5FGlRnvr57eimAbaVlU8YTKr93iCRC6GIPPtFAcdKV3Lf3tOP5OfL1r3H+jHPCWBUNKhmw==","signatures":[{"sig":"MEYCIQCGy6/vmF3Sr1fEasAp3enIWJl06b6vR24p1bJPxpJh1gIhAIcOH2YF/Zud65wSG0/hqCqhwPPJa0DYF4mYttuG+ijQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81691,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbHK5CRA9TVsSAnZWagAAUcwP/3rH3K0VjJZA4K0/rF+M\nVqhqgGkX0RRPMdyY+E5pkBofyauM2RMa2G2zkjc2p+lVnxN/2jNTHIm09KNu\nr3z3IvyT2dQyqiNQuZlEbUZlXWLnzXBtIw+ugNzJzWvJwgU7qkCV53+1Qulw\nXRFwIyjPF3qmiWp/9kNQWXZllYWJBSLyD0JSjFb6D8sTXyZwIHBW57LxSyVg\np8AqFWN8i4ixMpVBQMeNT0/zgrukCkevhLw2/QDOk5H0xGZWh8gfg5BFm4el\n4Y05tG0TW2Z3xC8MVBWLgHGzHqAFjw1aVRhHJeUjfl4bDoEkP8Gt8jUQWgT6\nhcyohdFirq6U/LljnKJGqvsgyKyRQ2PjqB0ZLL0B+alscfAsdyAcYBvizlvm\nlJWDK7K9upI49JB/zfS1PQ16dGCApyGL+FmgJCaAMxi3HMojQM4SsFl74bJ3\neJy0gPWMzqeLBsJSFErq77/WrXy3VKhd4AED5qiwYzZ0ZUURFpIiCbXZorHT\n7C/uXK3Ya5GwBzEVLuWduaMU8HeVQOZmMRmvqJDzj0PRhVknqhb61SyhVAqC\ngLfCVXf7P75RzSJup7tN9Vp39OwcKVS/LDbdyg8SXKUBOUuNY07KWWvxnBj3\nUD0w7vuvNF9KOYmqzYN9DNPNSewN1vhsqCu3gwb6gT2Op8/iGxxgoz3KumKV\nPZhs\r\n=qo4c\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a76274b0556799712f2a8b5c47f3113325e686ae","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.22","@balena/jellyfish-logger":"^2.1.22","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.42-renovate-non-major-a76274b0556799712f2a8b5c47f3113325e686ae_1617719992609_0.044461879436273444","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.42":{"name":"@balena/jellyfish-metrics","version":"1.0.42","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.42","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d85c221205bf717fe6644aa94f2f77c9e5f51e22","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.42.tgz","fileCount":15,"integrity":"sha512-L080JVm8X8wHCHD6lOUUUwlKJsQHpOybldHYJM20G1D/cimzBT69oR8Cjy4Sw5DJnWP7Qnx6VGKjjuAlhmegRA==","signatures":[{"sig":"MEUCIQCu/2Td69FpCI9F0tDkitETpuCUVfgg5uTCNwRBImU1hwIgEozJJzCMc2uIv3r4yf0bCv/KHnLGEo3s3pHfF5FqBD4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81631,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbHPJCRA9TVsSAnZWagAAfBQP/RJFIpRMZDrY+odYvR1m\nVFZlOA6+469kOqkbGBZahBn3Xjnu1NW2rh3lbhc6hLMW7O6Sl6S6dQbo8UZr\nBILtWacpNIKsEjQvg+rQUn9BOqB40v4UzUKSMY9ZxJF8LugFP5U+HYVJv25u\nRdlfFfbo+a9y24pcGF3ltbgQGeMslZyXVxB9bkUMS962W2kz0Qpizbk7l4s4\nk+9vMv5I+O09FxFfPs2XFdq/IcE1JCuO4evibs6lqooy3mM0uOvoVlm2Sqhq\nOxY7dYMc5LH4GuYWZP88ID42yVJz4K5mYY23w5WcIV1enrUY8SEwpMicKhh+\ntE2UWiwgPuRCCpcN0sWf2KMQJKnW2P08jdTXat3Xo0IDC48Le3Q9Ay2EshNi\nuinbwnpmGJ5EiiSHYwLPSVeVEc2IUML7gJC9RE/fV6hSosCxcYoPyIwCw0hJ\nhzBn2dgGQYt8avSeVbJVIPGEyR09fKP8kUhWOsPc1wGKKth40GFKN4foEuTK\n1j5G4+aI+sg9bVHioBRCHfxk2Vzzl9cjHsqVyEq3N7v09u3HuyN4UOpb3lXK\nd6wVshyHu1ABxhVFDTSvf8GwpO6+6AENbEOIFSEGHC9nKl4eiKbiQXGK+E8m\nsoPy8bY5N2gjbt0Ft8nu1XtVhQvn/e1fSGQb8fIooyWeKE3T+OyNJr7wOZbX\nZCzs\r\n=4Ze0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d4d25f7913a220723ceb200413920c8a20b1dfdf","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.22","@balena/jellyfish-logger":"^2.1.22","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.42_1617720265161_0.21482107064027178","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.43-renovate-non-major-f11041fd5f20164609a9dd4452b7cf40da9f30bb":{"name":"@balena/jellyfish-metrics","version":"1.0.43-renovate-non-major-f11041fd5f20164609a9dd4452b7cf40da9f30bb","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.43-renovate-non-major-f11041fd5f20164609a9dd4452b7cf40da9f30bb","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"dfbda52ca58277ef83a16b8ea3ae89d473029378","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.43-renovate-non-major-f11041fd5f20164609a9dd4452b7cf40da9f30bb.tgz","fileCount":15,"integrity":"sha512-ZCgjtJcCts+rMGm/NUsutkkL96+wksXQWyeBFRBXVxaPUeamKPTsGyP7ZqDvo+m1sIBXskyGEBnVHGcGelE6cA==","signatures":[{"sig":"MEQCIHRdcJa97Tc/L8ngpxMqm9WI9/4dVsfb+W7C3goqxO75AiAV8IKq7obVDnIh4S1ooVDmlK92FyrSx27q8b+psVQAaw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81793,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbJlXCRA9TVsSAnZWagAA3zcP/iknxQu98NpP3lDf4PYv\nthhIp9J9umvsEcsR7iX7Jm6FLBy+AoPP0vjCL4JbSPz4OmScbxPnJNeqpksM\nbK/aDHB6s8hfjbCnszD9lNP+jTNhMS9EvG6RO5WM0KRvXkTBQOTxwECyq55R\nzSUy1DEPUz2eDtCw2bJLlKys6SPdGQlMJUYl1JKMtu75BfAR5cMCul+lQvNB\nIneoKwzBQVKWQTiTlVjEfUyeKAczy8uPGHERYJcA6hg+dDagg3dVdmofPS3Z\nHkAcbTahbDTfBng8M3w908BpG2QdYbBnHOJAX6Olf8YqByeMgoBBNYhlmCxt\n6VAwOp78vUrftQskuB++TPTML+FTO116XfzEp3MW7DTaUG9jk63pADVohTR1\ns/XEpnm6SDyTpcpEa62XzsGsS4e/Dvs8QD80ybSkXAl/xoAx9wObR3QxBPGj\nxwzrfufdn58YDl3Us7V1Y+kKH7EEUuvj+inp5V8K4UproLMJ5LA+N6GJ157i\n4TqJeSLxSihKKnbYoufkPGygPQqZnODauSc7zTl9hZKpAu4TPx1zDifQeTqY\nb2/3OFdKWapnblIuIly5M3IOADeispyfRTHtjU0HdCULMQGnBto3EWia15TE\n1BGPVp04q9eZng6Ry/wrfz1Hca47TfWRF7pgPldvwJ6Yefb1bx+gdk+F6E6i\nubCu\r\n=Byuk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f11041fd5f20164609a9dd4452b7cf40da9f30bb","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.23","@balena/jellyfish-logger":"^2.1.22","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.43-renovate-non-major-f11041fd5f20164609a9dd4452b7cf40da9f30bb_1617729878915_0.6684426569599045","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.43":{"name":"@balena/jellyfish-metrics","version":"1.0.43","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.43","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"abf1e91844a3fbd1568b7a167a31a14bd665dd39","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.43.tgz","fileCount":15,"integrity":"sha512-5usdOBCXZE1yNYQzj+bjOtsMQjaqGg58B2Xp04iISHdbGnsCqi1TrTvLJG4q6GcMy+fFVNJNwQrFWMgKviESMw==","signatures":[{"sig":"MEYCIQDtyYdcUWOmCg6xB+Rg+D7TPGkVvJplJNItl9eNjruNAAIhAK779ND7lxnq6GHw8CCm/fdJWhRQBS9PgwrftcQt3Knp","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81733,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbJpRCRA9TVsSAnZWagAAmsQQAJVn3R8wewZwU2vCd80B\nAMD1BDksQzI5aSwYqPFJKMAghDck24MIR0fKpwQqvCGwiq4yq6WAQZMHqFIB\nk4LzthdIS3ykT+SpQoIwkSrINpUQBsvoRLXp3tuhX+yD7PGqfjyYOqNYrbdR\nqUr5opAld4A7hHGFFmfO/0MH7xb6Q6J+zhACziNYXjS57SabBxhYyUYJm37B\nWwMnC41zNBuKBvYGODsKEPhE2MP5gLot95VqRU3wkuGwSTPmG5z9DWJrB8vs\nI+zrPIH0gGqn6df5pzLMjw6MCEw4JkcYnfL5ZwIxK9JB+PIn/WelsdXSPpqy\nHj30rytAXsJ5EuKjDbP9TQNqMzIaB7PL2DRIlg0ksIi5DxaQ9hvtaR+fEPqi\n6iuCggocpN9fa+UxgZj1lrW/xcoVoLfzIceO0YVI7HrcTeKuWe4Ky1pOz/zl\nRblgcfYvuPBUuM7ckn/rdH0ZtZWAwQY0Iz9lBg4tT9zCl1RfqMlG+mN+/Pu5\nD7yP8DN2KWdnYv0pCWmNZNQ8Fzfhq9od7nFCm0Lo5TA7wlFybm2tRjTV5Rle\nP838FQuDDhkZN7xhP2hvQJsQHvyBHSeJL98jG5HFXdQXjxFZJvk2t3xfDyas\nC8iBanC6U3yhKS9zqAPU1SYQxj4eVmxTvnbIXPRPQY3pn5YEOWJofVXjPBlZ\nHg9L\r\n=Ribb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"cda574fa506abd6ace6eed13b81addf8aff8335a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.23","@balena/jellyfish-logger":"^2.1.22","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.43_1617730128674_0.4505236648326645","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.44-renovate-non-major-1f82f5f8cf0a722e8bb5916fcfd9b66b556bd2fc":{"name":"@balena/jellyfish-metrics","version":"1.0.44-renovate-non-major-1f82f5f8cf0a722e8bb5916fcfd9b66b556bd2fc","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.44-renovate-non-major-1f82f5f8cf0a722e8bb5916fcfd9b66b556bd2fc","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"54cc1fd9d76bdf169363874f64ed43f34f3bb60f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.44-renovate-non-major-1f82f5f8cf0a722e8bb5916fcfd9b66b556bd2fc.tgz","fileCount":15,"integrity":"sha512-b++R+ZVTbTuUpRWrHHshq3222v0gIeocOs2P37f76DcKzMLZyqjtQcSICcYvrFhHROmol4RPUp/6scXgd7VNMQ==","signatures":[{"sig":"MEUCIAQFBV5Z6djNPtiVnxZ3TghvSleyaydXbc6yRP42IDKgAiEAo6mM7Dm3gmMCzMCVvSsaCXenCCxYS51eK1XwYi8LKjI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81895,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbMLMCRA9TVsSAnZWagAARskP/2F+S3yJpwBWl3sqgoxK\n5BTVa1YVG+chXSLit+WscnSWFNDgG5WktxoVvgSfc/gMRH/MtvGgPWOI+0Vd\ndsmTQZ7yVmU56frNX9JG7r+DHiT+KfeAwutADhV+yGJQmiDQ1e0i8W6riunU\nfRLUM4tYYtrfCGPgFHyBy+7Elo41QgEklJBV0w1RW7UcoAwZ+kvyzxomu8ma\nw4pWchiN87ILrLJVjPDtEUpVkx4DnAcsOqHo5B0Y8BG+mlEUIz7vik9tPMMa\nS2tYNWFlEn8wraZ3/XVUnVpOLPPx1yNxHPOhUkaWc6m6LPbS/zKMeojflfyX\nwQIs901eAdjKz1AMGR1OPIStUhhhFhv2PJhW7a3W8RaVPRSXNq3D/Lr0qubD\nejlP9wCxAAqi1xNJyJt+R6QT3CERj1TicZClDobyjn9CcGTQMqamKQaIJe60\nEzqhTKVNot01e3SWR1Yrx1kj8nwFB8ONvlYyyys8Z5B6bFyGeTqceuCOCV05\nv38i1mMzEAPl3W81ZxJzGS3Q10qIWXni4yA8D6fOCgidsH4d34TuIo5PB8VR\nmF2bjqJfmRSpaVM1xr/HsYCfkfVJMcpXFZ2kb21GQP+/qIbn8tTUpS6T9Z4e\nAgBrViMHC6P6bT+JP+A4O41F49S6cA5DpbUGgZUUjRxfqUjujHuHcCSHa1IX\nIobW\r\n=4JAL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"1f82f5f8cf0a722e8bb5916fcfd9b66b556bd2fc","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.24","@balena/jellyfish-logger":"^2.1.22","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.44-renovate-non-major-1f82f5f8cf0a722e8bb5916fcfd9b66b556bd2fc_1617740491716_0.06267984877962762","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.44":{"name":"@balena/jellyfish-metrics","version":"1.0.44","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.44","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9e92da1fefaeca36c99b62dbfdcf7bb906215eaf","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.44.tgz","fileCount":15,"integrity":"sha512-17XaUnperPUYN3B1eZZRY9xR6ZNDhAS/YieBjit1Y17Y6EP7QlB7iYpjMF6yPjstEyg4pQboZMy6T2/Ike0J1w==","signatures":[{"sig":"MEYCIQCTgxI8zf5azHCcoVayOuWxOxJ5wm80HLePmWTyA4uBsQIhAK7NZUz9wLLW/vkKcvsWMqryJuYLSYKJP4fI/PRayKT+","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81835,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbMOHCRA9TVsSAnZWagAAm4QQAJr4JEE1N7hSPiqAOnjl\nzMOfstCZcXlHq7iLiVHc5BjKFwcTMLFp3J2aMHFFyQh/a1XKnO8NOItAHmGV\nMicrGnZ9RQ/YMsRxgP9Mylox+5/UiAKreQzu8y3f4SqfpBmpq2APbzA/BtAV\ncrxEUGgf79oxKqII4GXm+jvoQQZ+PFxzvWWxoe+oSBZOdJZx28ZmIji+WFj4\nPQCGK0sYHpD/gs+ivbCVH92R1Kt157FangHH5QvxgjjbO/EyFUhz33Z5g2Jl\nTLfHDJSfEdtRLG2yjGP39M9f9A6kCChNdjyZfrDs1g8UYzVIxeQ6VHNprmbm\nMk632X7to/drx+Kx4oRxoF8wjVD87CrzqJofD3QCEWpEVxeAsU/PlIpt14OB\nbD3ex46tnXZWoLK0ZPOSWtrdvhBwaz1f61pwWGHADiPYhQU0SHvK/Tg3cPRk\n90ZcYSn4UL2OVeg2s43Cc3NPUdCX2Dy51WMi7PWFsTtwK4E4K0pCzN6bbzSP\njmS655aV3MBjhaVBBT//ROXv/KfNHdFoduaS7YQWq5qjiBhxjIZdwbJ1B71K\n1ubdDOwWcs86YoagG6r+zj0tz0sA85Wg+vHMqm7dXwCIaeGUUjwaGE6fG2Du\n6DRiGBdC7dnW+1b7a70MAkwpocB7niL//fUR6+CspPSHr5CjXwmYAPMTdl1v\nImLi\r\n=/2ac\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"35e9de19f2a0a0a08496745b9354be1fa8e6f4c3","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.24","@balena/jellyfish-logger":"^2.1.22","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.44_1617740678977_0.5464793326108515","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.45-renovate-non-major-3a3a8d532d50a1de1bb90aa963e9130e3b510dd3":{"name":"@balena/jellyfish-metrics","version":"1.0.45-renovate-non-major-3a3a8d532d50a1de1bb90aa963e9130e3b510dd3","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.45-renovate-non-major-3a3a8d532d50a1de1bb90aa963e9130e3b510dd3","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a2db473d948aacc0a35c5a8ca627ccf9edb5c295","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.45-renovate-non-major-3a3a8d532d50a1de1bb90aa963e9130e3b510dd3.tgz","fileCount":15,"integrity":"sha512-vubDkdtZ/RrRV4i58v8/hCfllCDVW/y7smxOaArLAGGa3i/ZdooGgpoxUiOiAtJaKLE55B0w5THB7izteSmDLA==","signatures":[{"sig":"MEQCIA9jjus9kG1I0Xcgvy5FiWASyoV2mEdnboduLXVpY9uJAiBFP8u+M3dqrhKgD6hrXiWOwEeqYpWqfp63C2G7VYlT3Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81997,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbNaqCRA9TVsSAnZWagAAJwEP/RKK09pXGIiIxcI8iTjz\n1bUQYCoG2rHVKvyTP8Y2KE5ul3XSd6xl1NeucEAmPEKsII79wIrHecwWN5t8\nD1RNs1xysMBvtcO49U2ene6je7YrpfKH1q5+pbLvCNttAfDuZIQqAhlBEAub\nr2aFdJr7CiDG3ewNr0HgafJAJbQUJY96dmFfSZX5LW9CjA7f9zHPqRMVb0Sj\nmMfm8sEW4TQiKXJA4S/Vg8PLLcr+teSmCDUKSjkY7cKd+TB9/Zbc/x/xlh3i\nmoE8/glXNd42FfT7V1haBWgSdiUIUZcHkS4sLFWRD1OgB1+DqlWbw4gPXttP\ntClKRT+hNKKPSxlxHysizps8L86TRXrTAanr5xklbVvkk6er0DI0deoVXmBy\nSJckfmA76E4YZC/VOVoHRbUwa8TAfvci06wQnqeWiGp8NE3+Sh6xsLk5D77w\n9DHqvyjtnnlRlbXfS1QQYvi6aAJHqTY5l8INiOagh7Ft5q/wpWEqU8Yz2QxG\n5KN7oYvPtUbVKRDj8upHhsrWaObFSy0rXMVm8c+9Sz3vo6K2hGKmJTlQakvI\ncNUddKQYw7mgo25n1HtRotc6N1kq8OVXTYJDaaUMZSMlb/tUZsoTldXFqBv4\nPXWl/7LXOtGa0gpB6YZdL4wK5oYYSVe62HHGz9lAxTi3vx9GxMJ/4alNMTEK\n+8/Q\r\n=soO9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3a3a8d532d50a1de1bb90aa963e9130e3b510dd3","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.25","@balena/jellyfish-logger":"^2.1.22","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.45-renovate-non-major-3a3a8d532d50a1de1bb90aa963e9130e3b510dd3_1617745578043_0.4516444361611931","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.45":{"name":"@balena/jellyfish-metrics","version":"1.0.45","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.45","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c9cdc49a4e7732016dc16ace5a021f0a203de113","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.45.tgz","fileCount":15,"integrity":"sha512-JV+mvtv2EQDOSRjvb36r4MfE77WPITWS7bX9n31c2oFTPbnW+Na1HAIokoiM3VCeqwb9/iYAK3UzhXFbC0EIwg==","signatures":[{"sig":"MEQCIEJKkZuL9M+CrsP26TThQxAJmfCCL6WVFw5r/RT/g263AiBXQNOwYWBJHlK2sSLuIhNdi76vczl9+Dm2yWY97HueKg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81937,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbNeECRA9TVsSAnZWagAAFsgQAIm/62MWtzbxm2H1ddKy\nAGv+bxRmi+5fmaj0fudse/MTRzehdTij9N0e6LowP/0agufR8IK3nvfPGQqS\nRo5fUdOX9ob+c3wuccH1G5W2g6MMbJKTVG7FaZVcZ25PEHBjGwDN0k4Gxln3\nu9rQ6DX6EN0IYzJrOthp/5AB6ungWnwv7cZJrtJC3+8cjXIKpj2q3u8yYkhr\nQCUjBnoeg05cua21BQJ0D+uetTmIOFcYIs5SNUQozKIXabqiFkCDg8HcYAEQ\n2xAcrU/UbRW+603e3bhFr3kBdsSh9rGV/dyLPM9nscdYqeQAMrGgNeipb1M8\njBAhQAXHfVpnLVU/v0gYc8TxxcBWPlIgklJUf8IzhwXTnt68TiYo3ORN1Fud\ny0K9+9vH8Jwvssay2sxmtUzOpqUiARDgDgY0yZgi1NMS2GG9I3+S74Z8t7Wy\nFpi9se968aaIe3IE/34njjd93HlnZYvwLbo5Ois2tp76mmYbETqOGS/meFy6\n/ESjlFobWk3dV9UVcj/GGBy3boCEMJRjtCg/XS/awdoNIqUwtkuidaHtZ+sn\nGhF0r5sfbZDd9KLfBUxG0Vs5XWx62aQO0eQp3rbwT6pxgOtbZ8X0IZJqUSyj\nvh/btd0VgDhzryOrA5/dsbzj1dw1Go2Or8ZhhcK6Bz65xw5BUwlD3atxqSC7\nWwtu\r\n=rEwK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b9be60a49881c39d67e8698da923722fe0f5e54a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.25","@balena/jellyfish-logger":"^2.1.22","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.45_1617745795753_0.23214888201465778","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.46-renovate-non-major-7d76d59690e229c97734bc4e40843bdb04c36acf":{"name":"@balena/jellyfish-metrics","version":"1.0.46-renovate-non-major-7d76d59690e229c97734bc4e40843bdb04c36acf","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.46-renovate-non-major-7d76d59690e229c97734bc4e40843bdb04c36acf","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e9b671d737e378f04f8f8e5a4d1c882d8b144913","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.46-renovate-non-major-7d76d59690e229c97734bc4e40843bdb04c36acf.tgz","fileCount":15,"integrity":"sha512-l0GKY2LSG/dFn0Fjtz6+vxGRYNWRlxYZ5F4ExlEL2YQbQA5kC6gk1FclZBbyplElgeLr6EBav0qHQLoylnYj0Q==","signatures":[{"sig":"MEUCIE1vE5HTm0JiOF8WaUzSlFIEaGyfV2Rs2IOy2iF07faKAiEAq21clBZN8J1uvVgOEQ2wZ874DIrREGeyHEtz3Hj17mg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82099,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbOeuCRA9TVsSAnZWagAA3O8P/3YNctpxXwMhz2FWOu4A\nIv6TegXniFtMkhHZ5s2geLewIL/l5uNHlgqCeBOXg/SkY7DreHGFzrKgZBSl\n722OT2iiu2NMemd6vrEwXD/qD2mSHlTRxKLVCESwCnC7JasXcTJZacNrUWPU\n8dbN99Bm1Ar3OMIiTKEqcjVIbv2Zi5oNRDQa8IcwPh5aJ+41D/eZWXlIiLkH\nycKCut4Wlwc/Zp+af65IOH9d2fvQiUMUIweITyQC45vlr9ML+mdwiVDaem/J\nrQw2IcQ1PyeSQ4mGoIG87YHZ73fzez8c9vc5SqSVvOZnZ4AV3Mc759XGtWlW\nmFufu/wlZaqn8SY2iUxPEk16+u97jke6rMNIdD6YCvXtmkjxyLX4sSBlbxky\noprTbGNm7NfTq6asqI+0liUkWxprO0FlQsNwgsh9ONDCjK2owW0ovQGBP5fO\nknhGb/NQIkgR9aKKUiKSBUasDWGa/4YjW8FZeA1qYCgQyRFG/EoKByXPhARR\ntgNjjUmLl2KJMJd/jsEUrqybwnBwMowB0IgBAxtYsIMKUIb6ZKFDzVN9Kf/S\ntyxUX8Bqi0Jwd1bwOn5HgHHGixwnmHkJZ1YcQGYF8HAHSQQIh6iLzo84vILm\n0ZB/ZhQ/GmCnbo7GrRoDKIoa+0fTRwt/3B12XDuI99qs8KHLEST/WBf2pi4C\nkfT5\r\n=cyei\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7d76d59690e229c97734bc4e40843bdb04c36acf","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.26","@balena/jellyfish-logger":"^2.1.22","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.46-renovate-non-major-7d76d59690e229c97734bc4e40843bdb04c36acf_1617749934317_0.4306237300252005","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.46":{"name":"@balena/jellyfish-metrics","version":"1.0.46","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.46","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2f7b30dfbb53f4334735c55ec19018d6721fffec","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.46.tgz","fileCount":15,"integrity":"sha512-uJcpWg7FmGhC+lvuI9LOVRNGyLSSZ0ePotfyIGeuVNROZARyZIeN0oN+O/SLEp4YFOl6BnlJMz426fxIjTV9xQ==","signatures":[{"sig":"MEYCIQDtXhR3kluOFTB7zf2EUwEMUVZqTGXVZp0eRhv5bTBhAwIhALlc+lxNH/5l8k4+TT4Rv7TyjXYqtE8e90QxV08KqfTs","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82039,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbOh6CRA9TVsSAnZWagAAH2oP/Rxd2NtuoylyiGBBcpYu\nIC7LsMp6Hs84ajDrhl6L25wA1TkdRdSCv9Y5jyONYNncX1YuxNXMs5R4cO15\nEUKWuEcyVzV4qzqA767aKXYLlm0UOb9002xvjzxXthdHroYDHsMuaJX1xRx+\nO6cEhDyOyXDxn0zNHz5tGykPCjl/a2AYGIdhzgcI4Q3ldFa/JXvvFVMBLDHk\nl2KMwbl8ZUPCB/lRpvV90W5k3+GeXvp3BHvDQhksptbTw+4O1CMWVbwIeksk\nnlWwVZDjDqJKpKn0SGqfKfFBQFu9yqNQVmLyh8tAYM4Oi6lXKF3VV15hSzHT\nYw9Py1G808QIIL6sDJ3PyB0ng4Mj0ozDMFgPk/uRr3QtEdcCIdLhY4B5wf75\nEM1vE1ToSOb9GQR24GFYAxwGgboA5bjp1sUL8WpZFxJIZhuTaM1/0u9nnjhU\n5xqzGEus+ff4YRAIavv9Xugp6j1DJl80tX9svuQUE3MeQWEdFj+JQezXuO4Z\nUyLCak3xyRA9TkIQHK9MbsP4XqBBNKA7LCtHkdQUPayeFj1KFL+pEyTdb+sL\nWL02tk9MiEPxe7nxFTpYs6CahuyY+ung8VrrXvnI5Pp2u7H00OlDXO8yae46\ndHRvPXeKvY4VoZLeMInosNNTFwvPskfq2RAkDtNfqGPDiTXmBFvjuYMk/zmP\nDSgf\r\n=jg0g\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d3453f090c3167e161d32786645b96d32461a9be","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.26","@balena/jellyfish-logger":"^2.1.22","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.46_1617750137834_0.2985431526649467","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.47-renovate-non-major-2482e277fa935724d452bbe20f7507a959b27500":{"name":"@balena/jellyfish-metrics","version":"1.0.47-renovate-non-major-2482e277fa935724d452bbe20f7507a959b27500","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.47-renovate-non-major-2482e277fa935724d452bbe20f7507a959b27500","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e5d0795eeed0ec62d2cab643efea8acafa7b3f39","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.47-renovate-non-major-2482e277fa935724d452bbe20f7507a959b27500.tgz","fileCount":15,"integrity":"sha512-Nth072J35G8M+DJQ8osQ1GOr7VRfcGm/S1bXOaqx9V1SgIUTYV3kUUEbMND3jQHMVXOkSCGJS6IDn3Rrnmrkeg==","signatures":[{"sig":"MEYCIQClAAhdpCBt7VIFeyhOB1rcLwW5Gu/CJXA7o3MXK/DeXQIhAPv7LfGUwU+0KeifXoCasEWFCn3Pc2ILjq9UaeAJUu8e","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82201,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbRjiCRA9TVsSAnZWagAAlc8P/ihVhsG3DAimQsw2dZ92\nUiqIGx7h7foZwe4sEqffesvu5PjaVnR8vR3JeIIYeaZfLyj93DA83zhqNBnK\ntmcZbMZ8yMH3MTNlvC3U9ZtLJwUOK2MxzvAXH57WVemx27mZAEEDubEQ0g7v\nwTZe/mwglVqOdQ6n9lbtxtLDiGDGKatnUi7b2fZu3ovfeTCAjI0Sxt0ltmEB\nZIhgHvxbPuly42XX3nLUQwqirutpAHd6Xc5l+cC070hyYDbBuaoCHJfJNNhs\nnwAwH7BYEAgj/TRAjAWG1cI/eeZBFwr6tou/6SMmbK4NMSpLeGENgh4ChdSX\nhXqGHP5CUfZ+jyfAfTNazZrDKm96/JtkPE8LLysRYc9ZQlBXf92PByLKEzkU\nYxGkB/74U3W9/rnIuW9cTIzDaHIOP+masjMM5xuPMrLEVGem8dSh0Z8p8p93\nTXIK3y5DFdvZsE97D/ziT5itzZLrH4aBiLetvMcM4EKNmFXDPUihgkU0qqqF\nbXlAARj89JI1xWK++8hM/Tf22+VJtNq8rcqI54vVzN0cN7K822wmm499XH7o\nT0t1/DJ8VLOOjcg+lAhrNmc643S4J59x1wHNb1EghpLXfe+klszHrFlzSvZQ\nNvGw1BSSDHRC7AgPDhsAR0z2m5zdXYTdBysQEzeNwS1M+glHuMy23sX8q2Ds\naMfF\r\n=5BaW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2482e277fa935724d452bbe20f7507a959b27500","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.27","@balena/jellyfish-logger":"^2.1.22","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.47-renovate-non-major-2482e277fa935724d452bbe20f7507a959b27500_1617762530225_0.4599755231038951","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.47":{"name":"@balena/jellyfish-metrics","version":"1.0.47","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.47","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8c767a5d0f20cd2a447bb67149b66544b3d28d45","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.47.tgz","fileCount":15,"integrity":"sha512-WXIG2fYcQ9YPD1Xrfh9tqni7bUZKlpbmeABuCl+v7wRq1IWEaq0OaIAvIWXFvndBESSE6l4eN0NFbEs0zIoE6g==","signatures":[{"sig":"MEQCIGnC29hJlNgH7qFqltqSmI0wu/Syr8lt+YIwe3AgGYnvAiBZ57QeFX6XRAlDUhnqMZvGldWKsv03WbHBknhEIMNLyg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82141,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbRmkCRA9TVsSAnZWagAAUNcP/ijEJbyaW5Zg17P7YKpw\nCDFsst3TrMBmGm+y0WhK2zh7oGeBijt12GaghAIa7ktO8RV20k4Ot+SJINY/\nhS4YimXw2iNmAC/blToMuPhrF/cG3HWh3HRW8l9G3myIJB68k/aZ2XxPyd4K\ndXbUVrsD9EPjLBCrOGIeTG8XkCztCXOdvIoP81PFx5wPS+JMsvYxB6ZRrL9A\nmpCiaQlQOzejd6E06H8CILOVt5+Ns1+iia9UrYcy9YgX20QL5reSYFJDdOLW\nKNFUgip+ATEec3i9td14MxhCybIiLFnFurdRSIKamUa/CbtEiR7b2IaS7d5Z\naQg+gIWvqTUDKx/t2zrCXjWWoXhaMxNDJmH3ru3El5HCaBHVXOeRLdZRIHSJ\nadC3fo1o9cNuJoJoOxughPzTEyEf3wf9YdVXl4DYyh8mOKASb/7HuwHhye1I\n/0gTGLVJ60AC4mxowGLfq2dh25kJRBCfVF9dSmFp1iMnDUt/4yB0XGwG8eg+\nYZG1gvmquB8U9wP40h7Fj7HLd+DwtgrgSlOvxKObk0TEvhlPbRQBUA9VShFD\neNKbMpCTZZTeTrEnC59++dblVeT2N7q/I9aQZE8ySOWmKfPfH8kKOABeaUbA\niIYKDcsWIO6dUYrlJ5SutxIRWPokbV0m+BvMggsgX9WE/VPpL2J+x/cLw5bE\nPIRw\r\n=dc0k\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2a371f91922098ba6abde8b31f9af7dfbd5ba64c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.27","@balena/jellyfish-logger":"^2.1.22","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.3","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.47_1617762724364_0.2944532860848623","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.48-renovate-non-major-bf9b4c16b6acd4b6ebe5ff6e3861d002f3935957":{"name":"@balena/jellyfish-metrics","version":"1.0.48-renovate-non-major-bf9b4c16b6acd4b6ebe5ff6e3861d002f3935957","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.48-renovate-non-major-bf9b4c16b6acd4b6ebe5ff6e3861d002f3935957","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ac4a5492b954a936ac485301434c7a6fc610341b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.48-renovate-non-major-bf9b4c16b6acd4b6ebe5ff6e3861d002f3935957.tgz","fileCount":15,"integrity":"sha512-uv/gs+f02wwTrNv+1ilneybWYc6sT4BNTZm82unbaDMXfEipcLMlNw0pKtg15iRQlST6ROlVCyN44Lm4fedPJQ==","signatures":[{"sig":"MEYCIQDvdJL9SRWTabgJ0sum9YTGORvvfYn3EQTtRIokoMD03QIhALTFn5AzotUeELaF79+Jkw3f5egvSzYKKFrM/aAYTQWV","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82267,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbhCiCRA9TVsSAnZWagAAPo8P/izgCX1hR5p+3D6b3in1\n/rRg8VHd6e2vLORe2/u4PFfsUESRI9DXUGFTeu0bWj0R8ocarNMBLVwLZLvB\nE9yw4YK0Szjafuv68IV3LaU8IBKAjBQk3oc/5vIAvP10JsKXb1bxofIWcDTA\nE+sw6OdoWaFDM5QcX2LACuOjVg0Osl76AypRNUFN1N+9ddk0NdaFjPrTuSD+\n0viOfYP/uyWpg6g4QG+wAhrNHN8v3PNyqwV665VNYeDRqaNt1ErgZTCqeEGY\nl48MF2QgYTq1yE8o7Vh8SWWVS80AdN/lwrxU0pVAIs5JB2MJRDoH6q3QPvWc\njoHjUuk/4EtYzSXDd2B7fcWf1tkuiNDuTfy+Kx4JszeawSKIM4UnH5/kGQbo\ny2MP0VPdu7St1zazhUpIcdHF8d+3CDhN7QPhcHGEFGtPxzWcP0Gtk4RtvESn\n4Z88QEgVxFc3hdlza4l0Kaz4YZz+MdBvY3SejvcHo18aJt7TSOin/2mdA+OW\nS+TMg6vzvftM3fUn6MM9qDA5a4dYsFE0CV+KScAK2+guKUEwDyiqolb1xgRI\nvuAtN6fYF3D7M0nNt0WAesR3rLbhizHUStSLIeMqwXl7PVwTsv99u/8cQsPp\neEsCefmjD+qzOCWBlwqpnPIBHj+HwgTJv+SOQTQtzaTb64bwD1V+CQNRlBYm\n98Bm\r\n=aRPC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"bf9b4c16b6acd4b6ebe5ff6e3861d002f3935957","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.28","@balena/jellyfish-logger":"^2.1.23","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.48-renovate-non-major-bf9b4c16b6acd4b6ebe5ff6e3861d002f3935957_1617825953736_0.7841428533032586","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.48":{"name":"@balena/jellyfish-metrics","version":"1.0.48","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.48","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"14c1226727feb971d958f405ae7b1c22922ca048","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.48.tgz","fileCount":15,"integrity":"sha512-SfN7Spu+iFtUsFuQjAoCotHj9/GuEbYajzv8J2g2PaQlvUJbUHAns9TqHqseYBbjG3Mgw3tDKRk1dbq+J6qqaw==","signatures":[{"sig":"MEQCIATxObkeos/dabRPpRZXnF0VN6m3YYpIqLZiju0LYYEXAiBQmgttEztqiUWzrNMqhZZgOPLo+0wtZBGkcKHFKj0UlQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82207,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbhFoCRA9TVsSAnZWagAARWgQAKT8SQeREZJSrALg1L47\nGF4KaxcF9Z9pkh4nF4hgaAbLy/rlOGSHAJCctsdMXLl4YrhAPwd/gyluwvkW\nrVQl67vP9MtqQn7CEITKHhv3CZTDSc05nJoX+gOdgYExOkdIacyt6Z8CsgGg\nGNigEG8B3RutGkxKyuZfplxkhOFCdEpfl9yJwGVWHTzUq9p/HiMcClJUJBI/\niU50+9VH0jGxip953C8m27pc1dfvvAdO+uQsrMOOK0EemE2L8CwtEd7oWBlQ\nM3yh9Qxm1lTFt6oGFYKpgIWsBRWnNNqvCnO1dDUp3QHpw4S28D/Ck1y9rRAS\nfvTPT0G/Qn/KNYytFGIZcC7PkNGP/ht6iiOm0kS2tIYHWoa4xYS00c+jV1uk\nea8BYX97RwWNQsWpnCn8IZ9z30Z3pYcY1GMdGLQhYRUgzqhgXssVOnn+yTYc\nNlirY3x8AHXRWAYEU+sTG0e6lTB7NdfcQtgwSz3/8lgJVHyQerYl5MlN1jbX\nRYOaUmUUwXLCulzomcTR8dbzIGLYqMdv2CYJ3HnkuaKJAnw5zcNygvLOS3aC\n4XYHWPT7CX2g5lC6mj1ZxOZBMjBWmJUPh5OLXOJbFF48gijbtsKSArWxeB+d\nuOgKxJ4MGymebvej1G5D57TaHVgYopMaYw8ig7i10KkrFccliV1y2c+6HL5O\n4/W5\r\n=cTKK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"87b8b72e4a7cb9c545346fb61c085f885fc250f0","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.28","@balena/jellyfish-logger":"^2.1.23","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.48_1617826151831_0.4022731009467919","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.49-renovate-non-major-fc68bf4c507342c29303e21c6702b1f17d30169f":{"name":"@balena/jellyfish-metrics","version":"1.0.49-renovate-non-major-fc68bf4c507342c29303e21c6702b1f17d30169f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.49-renovate-non-major-fc68bf4c507342c29303e21c6702b1f17d30169f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0f986da2edb5596593926477a834bc3babf04696","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.49-renovate-non-major-fc68bf4c507342c29303e21c6702b1f17d30169f.tgz","fileCount":15,"integrity":"sha512-4YgTv61/f00d+BMeJ0xS4Zrpi7nH03cQg4hfrsXC+UpRzBVbgkOHzPbmuoZ+bS7wy7iiaAHGysyoEWcMkVCkAg==","signatures":[{"sig":"MEQCIBDdhnunc+8qMbB8fLSDxp1TTtEIJ55fcSsp+kN4K0HcAiAU0cMzkLcw/7ewpbVp7bWGoMVdP2VlFFujnTWhQAjLUw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82370,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgcO01CRA9TVsSAnZWagAAFToP/A59EzNDc9AYvZcpsTOW\nLcVHJmd+iJwkEHvL1aJuwQ72h5Spp9y3a2BJmrucaSco2ZNDW6PORXP3y7I3\nQBqt3Ux1oQa+TPxN3rpv2f/oN8PjSYH95iUmXoAxfVy37QLOaFl2aMCDRJpV\nwreemrogbAoxQCe5mfvnlwC/txp9G13RtZlnSwbBSyT+lN60cH7fCQ9dFrEi\n2B3LX8lwy29X6ekPz4FbjeSZX2kiQOOSDs6dshwqZ0+bw79lmI7zra4ZJnEC\nPre1D1LGyACNbFNYEFi3Sc2NvgRfoTPX3QgaGYHFt6DbTp/nFi2aTudxKMvh\nC+VBF7H/5OkezHJfnXG1a+/7y8YO1hGNQOzEZiS6NA0rd4EoH+LqBfQAGOYB\nAf7kYrlsQOkSTgmpWz9ZI+R1UtpwnTjWNxG0k4cVfQiIXOmw4ng0KNBeTY30\nDIiyMIGx/2fglCyL9+x4UitgWS/9q2nEp8/jUF1gABXM5QphVydZ1bOld0nN\naInu1xLMXxJxedQrejhIluW4sRIcxGqkSBbzJdukC4rm6MSSj1ImWCmq8gtc\nGlynxJWjeFyeX+oGeorqm+twyeRuFfaxVnIoEPJC7346Z4SSqPoYWCq4sHhz\nevBSR/RAqc34C7bXkCFgqx003gSxq8x+Any+zurssOCB1AZ6P+WidYR5xjq7\n0VFs\r\n=pLAv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"fc68bf4c507342c29303e21c6702b1f17d30169f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.28","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.49-renovate-non-major-fc68bf4c507342c29303e21c6702b1f17d30169f_1618013493041_0.904283395023298","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.49":{"name":"@balena/jellyfish-metrics","version":"1.0.49","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.49","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b57c597e8ca1988a8ee3140fca0b3096ce67a775","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.49.tgz","fileCount":15,"integrity":"sha512-/6yHBWbQoqTR67fZ5T0xqprOVVjDMexWZ/QC3DBu1uaTeuuEtaraA5Mf+XBdrlDoPOMjCeFrlQxoAEEVB2cYnA==","signatures":[{"sig":"MEQCIE5NB87fBN5gY1RlZRaFdUXXD5RIf/NEBsrR0WUT0MViAiBtY4Af536fWI3fbezxggyz8rc2UyLwlJXmUOHePRRnMg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82310,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgcO45CRA9TVsSAnZWagAADnkP/AmJqXdNW+B15tPxoCfw\nwa4NBsb9se9raAeP/UASHLjWKGAlA9o99F7nk09tIdBFbvhLWO77x9qxmlfV\nBDnyASUtaVnxh7c2HgsrDqBuBu2Scqum/HTCDt9sl/kv7fgKn8NayGCIUUUp\nUtSVvRNfsgmmXVk/twI9ss5UkBkEbho7KZ1/AKXaWiK/Cd+mi6TzuBd0t+Y2\nTPra4jkuUlCNdvBzCEW1dLcZUyq8Bb0WkFZhrhi/PpC4AAhX8mK+19exTfhy\nOVKFAIgn4Wj9TgafNI5DdrCrVrbEZOv2A7UHODY8PS+hMzzIULGp3LGkLxLW\nWUrl3LUXuTRVEZgF9GI9GrK79c75E3dL0a2gtsgVQWocH3cRHtHhyAmk70xH\nrUZFSrNPK/Q76M023LYxRjz9ZHJ7NoiJgRgAYhE2nkCIj/NF++8AiWdu95j/\nJjW3g7Y+a5v0GO5rM+ps47wM7qj2hb5k1CJCClIOrs//XKot9z3sWwqIZtDY\nbI1WEJsU2vNu3pvlbowatcZwzWAwSqCHlp6EJPQHrgfwdAcKWeaGuxQum+Pd\nGCotG4G5Ub8TqKIH8CcQPCaU3LOMzvUQlBPUypgX+r1H1XnTwkNpOrTWb+Lc\nMjxLzN6QU8pYqKR2OWL7d9yh3t/H5j8RI3TdHO0DANN14B8gUmoTO2I5OeaZ\n2+eo\r\n=IGDj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8ef181c315923167c12f2e973d73aabde98ab575","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.28","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.49_1618013753462_0.21996465275343025","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.50-renovate-non-major-90bdc95b66a32f9e5602c22027abd6ef2573eb64":{"name":"@balena/jellyfish-metrics","version":"1.0.50-renovate-non-major-90bdc95b66a32f9e5602c22027abd6ef2573eb64","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.50-renovate-non-major-90bdc95b66a32f9e5602c22027abd6ef2573eb64","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f8de84f321b2f0a848f64cc79bdfd3de2d0196fc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.50-renovate-non-major-90bdc95b66a32f9e5602c22027abd6ef2573eb64.tgz","fileCount":15,"integrity":"sha512-k9Gd3N7KeJzluvKUIOL4oiBAUHECDQ5Br/rnu6L89VGNVSlTRMBJwuwQ8RRfRMpBVIw0/Ej39G5ylJe7npdzUQ==","signatures":[{"sig":"MEYCIQCTFFJfjzJ9zfvEmbrB5/rwf6pVgYQJfGAi297jheFOXgIhAL7ZlEAku8vXxQsgNx6tOWkhRof1Z6fULPSsRRz2wtZH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82472,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgcXo3CRA9TVsSAnZWagAAQUEP/ReV2yGJtJ1sM4tospTg\nBnvEIZVKJY/ekWpO8dpJQPtWZ+WiiBXJWTR9iJErratgBjfZwv+cLjMf2Eih\n1YdTFuxoExQX5E8PeurD3o6ZsYJbbXoqggRYfTNyvbPCITmLtCEbU4jgfcKW\nqdWPLtX2zCHEH/kC7tJnzggfHjS1kcNiO+uZP+8/2l6OgvRAJhmlsf2sG6QL\nkr1o4n2HAuqwMWnMAWfRxknXvu4s/kyHCS2jtQGDifjb/eEOnW5oBDC4uALS\nb2j37+0dA5K4DV28HpsFWJAEmxAsUQdRIMjXqG0I+RmdT2ugddP7VnHzyZ7X\nAhHjgHmvjvEL/hcfcGwO7V2LzolvA3ZWZSs93zQ5+nY9Z225NtLLuk6ApR52\n7zIiWIevG6lrWVrp0LuZuBNKIVVYerSwT+UYLKI1P/IBKDrKcwTmYQyeRAyo\nplYkSLbyeXg49PIrSP0EdloCVwmB0TWbtkckhH4JjTw3OKlRpzIJ35xk2b31\nnnBbGAaml8WrguqaTWfxsLCENd2ww6rhRm4fO8nFiMi+z68a6dpKWvQdAv+P\n3d4BRcMx5uuGLNRgweAoUKGNZzAmg0GCGxwekxt/d2MLBpgwwcw1QQf4HEHe\nU4RyXVNw+HR5JwnX421yAshEnKzLwIh/1ccySdN83LxV7GOuVc/80wdI75ny\nrhOs\r\n=IDF5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"90bdc95b66a32f9e5602c22027abd6ef2573eb64","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.30","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.50-renovate-non-major-90bdc95b66a32f9e5602c22027abd6ef2573eb64_1618049591309_0.4855074516521467","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.50":{"name":"@balena/jellyfish-metrics","version":"1.0.50","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.50","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d482f1b9020a25914b951238164f8923c05d4aec","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.50.tgz","fileCount":15,"integrity":"sha512-3/PH3+F740pTgHXRgNEXGQcCBwOuhkaaWpivxb18yhsIjUojkA/aq6o7tLlMpuzLN+WmV62fRNoJyFNFcbcwOg==","signatures":[{"sig":"MEYCIQCVi0Ub+xGiaaBlJE5wFCNipJCwpxvWK6B70yoP5H4AcgIhAPYGdH1EtJ7iWCrNyZszdbimYFfr4OHz02sbzl92cfYM","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82412,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgcXsuCRA9TVsSAnZWagAAN5QQAIrE29g9ZQRbDkzjj4hb\nN6b7ANJsGaS+q4GM525CltybrxK21RcmI98PTKBxZkLnZ836pcdenESZPt0z\npNxQ9WvFGqvoBKt929gv2ReUG/uILCRUZbzCdhA2ANrOkmIwkjRzTVH7EUU3\ncxjGfMyo2oRjh6GQdeJZmGwVxoo/smRt3Du+b9x5N29R8oEqFp9X76qC0o2u\n/m8Jr9Zd+Z6QwtB8/oSQG8lthPMcFGplx+F7ckWHj/naZFD0PQSqZ2cRXQox\nwDh8CXdwQP96ANZFtByEy/WCxsGCuXAv7ewn6u9ZGidGiLXlk2ZmtAyiam+9\nOQB6pdy3k6J1uiWh0RszcI2oWTMbwnbZWqWnmzHpTjEpK+IxHpNRY/IUOofz\n4X/poydLJEQILoNN/1GqA0m1WdQxxuiZbr3N7eqG79OQjzgMRyj5TzE8VY/R\nAhLvnO5Ll8B4O3GuIYigSkUYslGDPxVMnOFazm5b1UpTtL8urDsVONGtAOYm\nOnzxKhyN7R80OhUVPU1+gB+oCTFZWWDK6eaIvOClqxrnW6Ps+CYLEQRCulRK\nhRVklZNct16Rb4mE9Y2z5LE4FHFzZPxBvB3BLDhas74D+e6LuZRtpl4bm1wq\nC6Yw8HFocMbVR92MrOOjVqspmsXf1L3Dhvvc0PwSfCytuV/aqAO7S9oTXSGo\ncg8I\r\n=Y0yX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ed2a97d3873e0bb75c9f908c21329fa9b91cf2af","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.30","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.50_1618049837506_0.765316541447906","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.51-renovate-non-major-778b8c9eb6a5439c98a202a4224a759763aa8198":{"name":"@balena/jellyfish-metrics","version":"1.0.51-renovate-non-major-778b8c9eb6a5439c98a202a4224a759763aa8198","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.51-renovate-non-major-778b8c9eb6a5439c98a202a4224a759763aa8198","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e82994180c99ec214e11a198d182cc05832cce27","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.51-renovate-non-major-778b8c9eb6a5439c98a202a4224a759763aa8198.tgz","fileCount":15,"integrity":"sha512-E/e7hD/AcO+TbitQeBNoTpoApbeXFVs4229hZUkNpaIl+Os0c1K/jh2kUx/ycg6Wms0+15AVGPKn7XW23EZpfg==","signatures":[{"sig":"MEQCIDu07JMOMwmEmhX1vLPd7O8IzAaOLQ0BK8JVWUWnRQvzAiBTq0LNsXyPXdEQdXqlVOxedhqgRJh4fAnwQpoQIVCVRw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82574,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgccQiCRA9TVsSAnZWagAACWoP/0MgjN/SqqIb8pmuesU2\nJ6LlRXZCmMFvRhIT314mUlFTv7CZFKlv774jz0K/pL+olYS8Ep2rMffmsj2u\nSOnV9rkRayxWEWayXchCi+P5GMx81CL/VSdjcdMq6q17NOjTAjF2Lrm0jKiO\n/RquRCGKkuKNPpVfnuczjBrxRksncYaAF3DkyNeSzi5LnGquN1VZ5p39cnzS\njoQtrcjE8OWJAUQBNLCu2twFzmw1aMiQ42cU1LFy4t+CXlLzfBXWb2+eEmi4\n+9CtAiTN/zSpIDmkcd3UfGOZrEfEHvZA35XaO628UnmdgPK489EJtk483Qb9\nETl+sdig9vGwqO42M82P1IhbnCg1bYfwXiXu3vVlnGBxKIGv/bM0yezBeDZc\nZzVKx9neVBIfso7mOVc0N+/alR+kLaEUx38Rw/uAb9S0LkEQpkJAQRzlPiuv\nVm+TmZD3zYhhme+ozMyqLSjyUSEiQRZe7YtMpcjMmktiA1JUZGePinktSdOZ\nGpWLR6l1VzUFMCueSOgOs3f+KtbAPHRKC0nBjMHxQwnw+5b3NN6dYy9DSzoa\nQWbCimvkC/9NPZMVl+QLQizsIuGDvXeTZ4cJKVdEqELJM12fjM9DcC0DCS8a\nMTQ2oIwkuM0I7irQ0bJpHw85lkmcEJO43ey7m/x4aXXDC+4HIIRGJlV0uQtZ\nNazo\r\n=nVdt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"778b8c9eb6a5439c98a202a4224a759763aa8198","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.32","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.51-renovate-non-major-778b8c9eb6a5439c98a202a4224a759763aa8198_1618068513702_0.24896142654144526","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.51-renovate-non-major-a11669f9cd6b11fbd0c08983d15dd6c503821c50":{"name":"@balena/jellyfish-metrics","version":"1.0.51-renovate-non-major-a11669f9cd6b11fbd0c08983d15dd6c503821c50","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.51-renovate-non-major-a11669f9cd6b11fbd0c08983d15dd6c503821c50","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6ccf455b46572fcd05a429f35527dd45d553d0b3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.51-renovate-non-major-a11669f9cd6b11fbd0c08983d15dd6c503821c50.tgz","fileCount":15,"integrity":"sha512-bEVJpJebJjbw+liCP7VZvhZwfDsx0Tdz8ccf3R9asWJwC098dnvTC1ao1os2K7y5FbktsOtNMAw2wzxqt6l3SA==","signatures":[{"sig":"MEQCIFvG/Xlvtrp40LptA5HJCyP9JYJ9SdidAabd4kYwb8mcAiBcAVjis5zw+pkavjpkoZ3ucg5nUInrHQwtErrYKqjP3w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82574,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgccVFCRA9TVsSAnZWagAAxlgP+QDoI8bcGCDizcA9ZMN0\n2p08Dl11SAhs4hWwTqTaFSzgYwsUdr2GbeL2bI/PbgXbp196FMavGoEJjTKb\nnNdX8wG4geiAOrnPrpRoFFEFvvkdsa9/KssjLTnjY7mj+rW5aRduMPPuE0EZ\n9+bZDVcbhmpq7BPIStI6391LsYgj9mXY/Pf0i54Y5qY7KikJuN/Kokid5F/R\nKDp08PdQbCsQDnzfff6JStvJStSC0/ZN2mBHidCxIAi8yCG1AhQB9BQTUlRE\nSX+ywb1oek1IWs8Nk7og1NcqDLsIjEF3sPxNj8gNxJhAvkaDIBrk4jUaLJQc\nfC6LuBbbmmLSee4EnObGzkOBnt0mPnoP7xevNQGm4JeRJaMXYFEUKXRRaPXS\nOGY05U0rSQH2Mfgp2OS8ypH7p9yRzsxeqNU6Bn05ym0CPTmAzuLRMZfb2ia9\nnrTuPc8MteyXEkE3vj1u4Rxe6mNmG+Ty5mP+IvZqMoCON6FVZtEE5YskMbaD\n7I46EKHE7TRdHMZmsp0yMArDzYIwtWJ84BR1Ef1hWNSfiAKsVY0PxijE7a9/\ngMvy2XekB7jCLkjsk133TbL+pZi/bDiJH9arUpwYLvC49E7J0b1csO2kyn4y\nWUoXzgNkYZSfzUTXTK8NIV75zWNz5t8FRqu5tTu7LWm4gnQBtDTRKOtFnTJZ\nYGNd\r\n=mmcx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a11669f9cd6b11fbd0c08983d15dd6c503821c50","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.33","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.51-renovate-non-major-a11669f9cd6b11fbd0c08983d15dd6c503821c50_1618068805103_0.29471402091759114","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.51":{"name":"@balena/jellyfish-metrics","version":"1.0.51","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.51","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"62cd3b6f3188e76b27610888dbb90bd604f57957","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.51.tgz","fileCount":15,"integrity":"sha512-qdFC+7PTzQ8GZeQwX46KsERJ6NTHYgQ5zV8F008sI3o9HEHwEi4Srmf5L77PU2epX8TbcedUwWTYdicX1DzXgg==","signatures":[{"sig":"MEUCIHbGKyZTWAvoa/WJPAAhS/zqpNvWb04oWLYEs4Zj321SAiEAqP/ezy3W/gH/lfW2AeP3gpjdE8pkoWZNlQ8BcEXo0P0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82514,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgccZSCRA9TVsSAnZWagAAXXkP/0VjzR17+ROuqIV5IaJY\nQ970UelOdQmHTHBGrkdkJ9bwNJDd9tjZ/ZqPY+yO/Tb06zeKoG9Lq0J8y4G+\nhGBMy3JP8yuoWIGqZGrGofWUOtqK7MfFF2KMhYwnaROCAxTks0IHgWOnAg9t\ntiqOJyrNmXz96SmUoUNvUezomR/Ifdy2q/wpKqsGhm+1KsLiVHb1c07ssJPM\n82n73dOUZ0YMDsYWFTnWVeU01tRN3Lid4S6Vtgmrr/1sOAY9pVkKJcP5fYNE\nVDra7Q5ne3yDpRnxYC8OovbdC17H743P5x+HCPGN6LNIV+cSn1xxpTgmrNUh\nATY8EvnlYuQH6wSZNARZ7hNOEQS3u4VggayyzqMStfUn/+AzHKGzzIQ4qgbq\ntGht+7+BIfc0eNHe/fR9HH3/8OLllINs0wbhSMkZH8jHkyjgs5+AQBxTn4ep\n7yK9H7NLQjiIjT+nfjOpHtB+VFtVSG7UvcGiGu4Hxoun6jUVHGs9KmwBiSUf\ngjpUpsD1qLATg5HliNDTz7s4Bi8pL83cUp1BBFj5JfWQVJD3E3gAR43X5f+A\nsjLLp/0jED7Wjx+iMmDAiudiVbhG/up5uhE7amK+4nMEnnLv2D186De7gGwl\n/ZWo0QgX82EsrBbCFJL5+UMN/s7BsE9lMQoiJ4auNyD6gDpUQogOUzBhI2CT\n7VOE\r\n=oRYG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a2213ab25868c72c470401c147dc7d1319dbd90c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.33","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.51_1618069073874_0.9193193100178068","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.52-renovate-non-major-cf7301d27567d8bb268fb0d9af84c59e611e4256":{"name":"@balena/jellyfish-metrics","version":"1.0.52-renovate-non-major-cf7301d27567d8bb268fb0d9af84c59e611e4256","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.52-renovate-non-major-cf7301d27567d8bb268fb0d9af84c59e611e4256","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c73ec8f664d3a1af80d145544022d190f5ac8e45","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.52-renovate-non-major-cf7301d27567d8bb268fb0d9af84c59e611e4256.tgz","fileCount":15,"integrity":"sha512-BuylXg5IYDuE5d26olDX3rhqb6H0JUGwj7ifTEIrkmNMXBhaS7YfI2WslKILJ+dzMgk4Djr8vYvVBNaMzND2ig==","signatures":[{"sig":"MEUCIQD5Kp4gniwB97PJesK1hWvn3HeV2xp+UJTCZcthU3hqOgIgcw1+TheLQwQ8Cr2vex3EixR4wkgWcZHit52Ckiajx4U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82676,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgceRgCRA9TVsSAnZWagAAYMQP+we3J2f0/+h9yA6C99/N\n+icPC8SGNjwlQ+4+i+QskPe4qs7Ar/3KsV7zovCYCHcikqzjIcqb72hOsnxo\n06WBlF14q1PBuv10EuJDEeFS5l5oDw/xKY+6Adfa3Ka1/n2JmhjA5eAltZPk\nYYGLrbFWVnsrf2qgieMLrKBXmUwYGdrN8mwYnT7w0088PcpfnKAsgYx/r63v\nc9/+Kn5VShhYEzXkfJXecT+TMAwSIVHqW4eQrB3Xopak8J/usXJVK0dFRv5t\nXcGvFtYNMQ+MZmOlBWGaLaiNFhhLry0+VsVtPljrzrZLXY3fcDNDFYeRRVkf\npt0F2AL2XoaYmg74n41UXSfSV9ms0+xvVl7a1fpK1F78H+vq20y+9Jz1X/hG\nhoAdY27BHSECEzeuc0bGaM/6P/nA1sUOtobyqEd0yp75jSDl59A+i1pWqIvx\n9EVl6AhD0nWXPI9AJTA5FmDPebL5ERxPk74n+pj8ftZdXfkpmet/mOHGD+2n\nYvq/L59fXzVYiud5mGCjvnA0q9qR1poY7m+Diui69jeH22J10qiN0ld8EQWa\naMy16jZ9hWHBNORYnBuyZ9EYPRa7grdkA+Ycvz+2fdmouKT0m+9QL+3ljMXY\nT64Wdp01meqFlpFIJbpVlCauY9nUQ/Cji9KaL6sQ8nvUbiNkgUiPGhncExGB\nKHbm\r\n=ODv9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"cf7301d27567d8bb268fb0d9af84c59e611e4256","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.34","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.52-renovate-non-major-cf7301d27567d8bb268fb0d9af84c59e611e4256_1618076767854_0.2694727914303101","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.52-renovate-non-major-ed0c79446f4f172eaa052ca79ef20a01b769bd5f":{"name":"@balena/jellyfish-metrics","version":"1.0.52-renovate-non-major-ed0c79446f4f172eaa052ca79ef20a01b769bd5f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.52-renovate-non-major-ed0c79446f4f172eaa052ca79ef20a01b769bd5f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"22597a8f6e4190d4095475f753092fc4975820c2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.52-renovate-non-major-ed0c79446f4f172eaa052ca79ef20a01b769bd5f.tgz","fileCount":15,"integrity":"sha512-hLu7z9iLtJ/tqsjzQxtwD3pSFIhBkXKq2vSpw4gpRVhEhJyqLX0sFkWH/q73Edhx3VpFxq6SNJuQttRlpANwcA==","signatures":[{"sig":"MEYCIQDQdLj/veT+etWdYXVgowXJEs/IuPFy2PQnQ5eTZIVFNQIhANL/o128HqrfUFNbozlATwXpE2iRSmTULXPgyFJiOpX6","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82676,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgceVtCRA9TVsSAnZWagAAm8AP+wdQuojX7MnSg1qvjlkV\niRA0NtSdhHlxwIxTTAqTf8aa9yqiZgoY0qONQdBkF6utEq+ICnlGvrIg+7ao\nip9DyBmuQFcaH8VfYgPF93TWAT/vXm1b6D1XZlwgUIcva8PSwM5Z11MKjvmV\noAkygvy57bWXVDd2XhqESnzj2ds3V8J2ZBAuP7roGCK+l2T4/a38m86Cz+Ye\nwJgSN3XotLrntUB+L5Eq/2A+LthOSaxfpQlymNHUxJyD4EJPIQphzw5b+PZT\nsJ6JKuL/ADuGptPRuIUYda0WDmZ7srouvl8VgocUu8FlWT7XSSAVqMdE1D0K\n2rmlptFcwLniY7dXZ5kPLQB5HTiu09f+taIKZmz+PdtAnEho6wCctJ/tZIG+\nKq6nbhst8HPEoafx+6Xsb/Bj/UfnLMPc+Lqgvj81KpnDWi/YRNim8cYWZYlk\nV3YkyT6kH+ULolWCYPVLmbWjZYDvXZXWkNMlZcmG1zk92Ve8ACpwVYQ3xobv\nN84eqNVxea4OfNRezPO80M8zlXw5ETAtLpQHFtXvre5x9C1UycS1YF0f56eq\n59TYJ+4G5MoR74dyXzFjV2KYe2GDGrwHmI183qo5S/zBLYD1voYZgLerUy8o\njCYpEH/Fz5l/2QydGPbd2xR2JPxVnsxDr/gXfF6x5/kmzc8ZzA4dKHTMRdfS\nI+/r\r\n=KuOR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ed0c79446f4f172eaa052ca79ef20a01b769bd5f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.35","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.52-renovate-non-major-ed0c79446f4f172eaa052ca79ef20a01b769bd5f_1618077036672_0.9534260305180302","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.52":{"name":"@balena/jellyfish-metrics","version":"1.0.52","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.52","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0f619077da524008d284a7f7f2e2dd3d91a8c2a8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.52.tgz","fileCount":15,"integrity":"sha512-XGGSWIk0CxXXJnquO8KqZnjcBbnP/QqV8A9zowz7QPG2qEEXV5at3/aDHIq+NFnHmPOr2z1KCvtGpcLEJ/8J7g==","signatures":[{"sig":"MEYCIQCSpe3WbNdulu+uoNRdJLU+oH8vajgbOD2QdXhI//ZuQAIhANd35MDBhvlYlPeqxtbghX9TVXF/B6w3Chy3MeERpwrH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82616,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgceZ8CRA9TVsSAnZWagAASisP/AlUJ+wz/VUp7oHF7bKO\nGTBnHkmZlR2mNm+/+f7sG/hQv4Yyv9kwGy9hlrM5KKLoauomqkDalWPBzWv6\nS5pHJzkjArMi/ARDB+HwzjSGxOAGg3d4hWNY2e5CY+3g6WjblNkmu8soCJu5\nytfjLc5F0dyYAchZNyG9kivlRLUwUdj0I0T5K8DqZCqF3PqFxN5LqpUAHehu\nQf+swpsogG2PtbFigXeFETxQTE6ndaslkyk3z4XiirluqEMdXLjvZdqqdgh3\njK2YcZzb383tr/RA0n1RHc5S2TCMTYu8VonamjPd03oB3xNcV0+Q1Acht11C\n0Ms5LcvKYtrU7JPIk0mRsmjLy1MNjrfv1fk1ACEeYqfevWXyyXZImO/BLi7Q\nWZaO5gScXqjgOKOlF6Vt9iWvQUwH+Q0zF+wjoUsADEes039sAlyWA2iAPZ/8\ns29x+kuwAL7D2tfOzO84Mso7koZzlFgForY/3nyJQB/4kKNI5FO+JcfaYru/\n6MbzKOX8zpDKsnb0YjEB3jXCEaA2j8lhKlsMERr5Y/VAJBRWyVNntY07bPDG\nojsrab8SLAwQWFapAtdsWRl4JbqwPsq7jrHoQ3JXVICg4R1iSgJxUJLM9ojj\nconAqJYXRwB4BIbkxWmO6izNhyKiVbtq9gMo/RYjpF298YjH+dfy0MBQuwlG\npLjm\r\n=csph\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8596c22f391e0c475920c82b5cb819fd5c9766d3","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.35","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.52_1618077308410_0.8081081986820846","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.53-renovate-non-major-443e0d2b0d91dcf88a5cdd8a93de252793e4f890":{"name":"@balena/jellyfish-metrics","version":"1.0.53-renovate-non-major-443e0d2b0d91dcf88a5cdd8a93de252793e4f890","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.53-renovate-non-major-443e0d2b0d91dcf88a5cdd8a93de252793e4f890","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0ea828fd34fc68666ac33b9ad9a50a26ada954c8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.53-renovate-non-major-443e0d2b0d91dcf88a5cdd8a93de252793e4f890.tgz","fileCount":15,"integrity":"sha512-J4E5FkmU/k5v710aDHdZFMD/pLt41heslh/qgNu+6aaavPLRCFBKgZbUyw+JDAzxK49Z9XX4CaD8kZJ4NPbSzA==","signatures":[{"sig":"MEUCIQDPr65Kj1TlPHWQHy12372QaGX9Nmz8QERZOG30ic31agIgaumGE/BMgXlLAYEqkVKBFSaN0wa7cHpcoAz9BQ3tAns=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82778,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgcgnZCRA9TVsSAnZWagAARx0P/1olvLKYHlu+/HjTZHkj\nRLoSQjU4+hvqCZqwrAXiP86kJ8n2ICeAl+2Wph4ujCMOPkAs0rM1MdpdEamA\n15eqSwceJl2jEdBStPfnV0/AZV887QRK1Wd11VyKcC9XOEv8keZOP9PEo/hA\nZtIq6Vd2vAjZN/XVE6PUi+gnrJrfJqYcwps3fEkRZiZwX9nrsCfSbaAIgX/g\nkRN3hzuVP59ymyKpS13FogWkpEyVM8kulN/BVZIXyAFrRyWLpfJivkpcnPz5\nW6S2I+BOEGRyZzG2E2nt8PH4mlWGoA5D0RU0V4rkXcc40sRWNKcx/OTxjQ8o\nKaBeA3AJdHTc2y25UwLDvMDbcyiW7SRRm4+cJ46m2wErPQA3Y93rRxxLQ72v\nfg/ZeKx9TkWJr15qGgAJ7EDqlHS4yoDqZrZO1CHwx633twTy77mNP9dGgzWR\n7tn+SmBvxX0m2LSdWPddvfKER5DQFae/k1P0wW+MQVdvqImeU9TDLWbhpHCe\nm4zzZt1RyugLdAvSQ8C+qam4X5MpHuEA2S0BVaoSS1tBaGBZQ97o/fN4fcD4\nmXPpnSuWOHAZCnNIq0Z0c6Il4UkLADuKxOkrDtYU5J8rLvJroquw+W5Hk1Y0\nRK24+2qWfutJFgTE1jO1VyAnD1uuHcJ5oyVJ6Lj7D9q0pAiwpjq9+2Oq+w6W\n3LDs\r\n=JIVf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"443e0d2b0d91dcf88a5cdd8a93de252793e4f890","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.36","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.53-renovate-non-major-443e0d2b0d91dcf88a5cdd8a93de252793e4f890_1618086360907_0.21106691627523055","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.53":{"name":"@balena/jellyfish-metrics","version":"1.0.53","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.53","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"39e4677fe0bdadf463cfdb8e891931eeea814aab","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.53.tgz","fileCount":15,"integrity":"sha512-WqlbM3nuL5FaumiedIAQVc+VGbVrqborfEvIo+7nAeA+m/8oD4atA91ryCmwZntaNC+SytfeYtD9Zm2tTW1sBQ==","signatures":[{"sig":"MEUCIDKm/uwqsnWmoP6L0AyemcStlGCNqL2j0Nf6qmCaoW/FAiEAkSjP+1jBCO1X+OkOEcAFHuPFJN97gDv/nxSoW5gPuUw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82718,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgcgqgCRA9TVsSAnZWagAAYTYP/3gfs/19L/BxexuVO5hV\noGHcIQqRlv5AjE+DFPvCrKwHzJMJwveOdpOkgj0cdJ2wbFbqW1eCyYwfUelH\n3sXIk845sYzJdORGn1Ew98rvZnj/XiwJx3E+x6+HHXG/GzL5JYV53AvsRgl2\nigIBEx8K4+fPzLvuD9TDq7trYDuiqp5y9LAEOHcwEHUP7tfiYsLTgG3mJPvO\nEcC98LX0kaPUFaQ8y9w5SPabP4loEKMVPMvaDHvTRXiL7HFbclE6JF0NgMAG\n9TgtaSVD4lw3k7B72UCUXGBlmlLwEWUQwyg8AodT9xLHW5AL754cJuoBoWfW\nDa0K8wBIkJBEr2mSC3F8X09PM1B/QgazeQUrJBGBqV2cUyJl1YTYpU4UpNDa\nQuOCIOrqnw7aiOULo8SsqcAtAasRsvcTFt7txHy9Hbn34FJ3sqR+gjL/M2i6\nWTzkCtPTQ3JXdraD3OOF5usMxTKtrYSTSSapzEVqgng7f3E69CdvPMfmYl2R\nTxqTZ8y5sRmKivfZUIOUHPA+c53COMev1aV0NnIEylP1WScVpqDaFvFF1+bf\nmyEaOswCL3CUjzBt1gyUndF5Mywpn+qzHCMVd66UDO5R35T04vF7/nSbaCDP\nO+CZvii2hB1I7AM3ZbMTdkG0J/N43PE5uySRPSOFpNEf3HrSnO2EM92CJaEe\n4u9L\r\n=bBSF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c5e9dc1e3d51068a6c66c9108f78e854f2b56dc5","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.36","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.53_1618086560146_0.5084532051762087","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.54-renovate-non-major-6145d1b63660bb407351917474689f0cd7aa30b6":{"name":"@balena/jellyfish-metrics","version":"1.0.54-renovate-non-major-6145d1b63660bb407351917474689f0cd7aa30b6","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.54-renovate-non-major-6145d1b63660bb407351917474689f0cd7aa30b6","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"16b6757227c6c743e52e676dc958309c21c7e495","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.54-renovate-non-major-6145d1b63660bb407351917474689f0cd7aa30b6.tgz","fileCount":15,"integrity":"sha512-JLABLdHH6U3Rl+u0qgZyXMMWarSdhv7l02XDyNZn27+mposc7v6d+4GD5qjS4sKmE+8XY7bjnoef/u915z9kPw==","signatures":[{"sig":"MEUCIQDWiPf7cH0zPEricgBlzG7B3CQprH9kUUGChQLL1PobzwIgG+PljNXr2KYzwhN1jKE9gJ+Vt3RzB8uIRZIV5gJKbpA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82880,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgch+XCRA9TVsSAnZWagAAvMMP/RjykrPdL1el8YJwD83I\nwd/8fZU5TNkFi/8l0oO9LqMue3CemfheOTJwioW9VacCTL5lJnODn76Jsamy\nyw7X0Lj5U79bLXhs6b5qlSMqUTkj/z3Qnwxnd3dRc1SmTzWqyPvQldEkZ/nq\nnrN8IDkV7H4bLx7nBQcK7jpfQLvY1i8S5Ip2RUOtT1RR39PH/hOpL0QmsIxj\nWJot3fi2HXtoV3hHYFoIRIxzvggxTtqQM4I2IB7W8odzKTREI+mLcX7Gj4mz\n8EsDxKKj3JG4w2iKzOTs5grKYwbUeUfvqyUDZgJ7KEwPG7P3CixMkxydOwvI\nj/3JGfBovF6ez0cc+dcb1luf1nrw5eaK3CaaEIWJ/ruvWyCOT2QWSmdv95uo\nhFNpcDtqNU2UxLz56ESCxUpoRlEIcLytipJqMpnPifx2K3aUJuTJcJraw2yu\nldxAXqOyxAaUqVvUq1J/ZmDbK4CN9sgP1XETDYQcJwdYlagCydpazmrowgZ5\nWptOKtK8veuHKJpkMF0Pm9qpXndlj8ciY1u56V9cOphy3Q1JELV9i6k+48bB\nm/DSHJONGIfcqvwstt9RTqJ2rjBh5nYhl8LfW45VG+rGDcwbeLG7jjjJDzWI\nCxMqPByrYGyT2STOEsIkMfBNm2cbIV4K1B3nPT1bmcbvNenwiT4MhfxNtcYW\na+Y2\r\n=CpaD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6145d1b63660bb407351917474689f0cd7aa30b6","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.37","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.54-renovate-non-major-6145d1b63660bb407351917474689f0cd7aa30b6_1618091927087_0.08090211743047337","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.54":{"name":"@balena/jellyfish-metrics","version":"1.0.54","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.54","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fcf816ce342e65a4673b485a964b21e658c65524","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.54.tgz","fileCount":15,"integrity":"sha512-j9k+Th+BiVnp9/x0aDJVgAs6Z5p/goMykGj3DY0ltHz65yBQtGwR5FlaptgPcaazMynQf7E8ZvodP33ugptFlg==","signatures":[{"sig":"MEYCIQCvPIogM+IhStKrnNFP0FbLDj6xV/SXZkeFmU46CGKKrAIhAN+SlK+mA816pmwmonOm2Hf31e/yCCml+/XNPyniOayr","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82820,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgciBzCRA9TVsSAnZWagAAosEP/jT700lCfEWxzj0q4Oij\n0Rm/FU9/BPQ0DIMhxfuc3BQa4Upfwz5+/ZTteLlymRgiZckBd90y8gkP2Pnp\nAvPfljCnyZvQaeuBLEEvQMnxLvdlBzQYPMfTK9xub5BaKsx9zs1xi/+NKZI0\nRwtR/vBBFTLWiOd2RxfaPk2zPJ46kuP0cbDihImUJdfyniKytlxQZRNRJkRB\nDT+ItlHpt0nhPEJPRixCQIPYga31g1gZWTuPJA019rzVsWHvtiOKQvayVkVe\nc81/irXKwqzMNM1InWaDXSECSicQg6gIqlnu4p2lpkcoh8UiR5IuYV3YA7Rm\np1dez6jQCaPkSmTjrm8fnuQpblnWLW214MYizezfmIBFZGjBAflCbo7A7r/q\ncQA/8T2XbtpjA2shehouDUNm7mS/r+xmTL3/tQ1dHagaSaMNMaEHvGTeXQYE\nFBrvBDqGSh955680uqB3L9VpsRvkJtfDcMVE0+ib8ZVN7ErNDJhIH4XLDcI8\n22SQ5lAGlcA9nqP//gLtycdCKbS8OjMbFoR1s4v0pAeyAxuveK2ENucwCmDP\nbRLFre8W8d/eDP3g32XfNiLVtLfy0DgqNBHbu0vHDW5tnVDh98ECbKjO/iaO\nTNGwmW7scX+Ucfrpc5U7/Ve85PNy0ra58GhdvbFeKbwnJx4Yn46YQNuqzSp9\nj7jm\r\n=sNP2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"261ab387cf63cc27efce54c96872c9194d5c69c2","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.37","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.54_1618092146976_0.3201542427272659","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.55-renovate-non-major-bf75fa2c2ff157f5b77467962dfdc9c6fffb6e7a":{"name":"@balena/jellyfish-metrics","version":"1.0.55-renovate-non-major-bf75fa2c2ff157f5b77467962dfdc9c6fffb6e7a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.55-renovate-non-major-bf75fa2c2ff157f5b77467962dfdc9c6fffb6e7a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"09a7d9374f9955d78de3569dee1c8829650b0189","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.55-renovate-non-major-bf75fa2c2ff157f5b77467962dfdc9c6fffb6e7a.tgz","fileCount":15,"integrity":"sha512-59AlyLUX+vzU9RqpKWVcXXG3175bALE8/N6zvVgwEec+9kv+aV4kv5nfPk5PZEV7FqqEnkKlDLCgPWVwdZN0mA==","signatures":[{"sig":"MEUCIEntXab1AOKF5cFUvcOR+SVphhih+NjXVyKhgszYztEyAiEAlx0la3g46Y+yUjBMWbQ3Q1jKJOXD2tt9zK3v2NhfBfc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82982,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgckoQCRA9TVsSAnZWagAAUxMQAIkWnJoQkCCGBLlPN79V\n++V5wg16qHH5yCF0oj/jSBpvxL3oGY1L8UrILuUIVKN/X48faaafuvaNTkNG\nWLOYX2iAyGZT1ujdg7nhaBNzKycINxyUV10gLpTS2ZyPM86fvN1PMtbazeTY\nzGJ8LQDYYn8TYC/A994Q9yF5f3WXMhgwFyj6RQS25DYUdLOBA/mPATn+oMHa\n9giJwwWBcws3Kcu4eT8XHhQbZv0vrTkCXEFANvV3hylPJUkYwZpDq4Jl6uBa\nzykGRy6KW4ZT3+2bkWvtuDhEh1lDcYN9AmUdLcFgfQMDq4ARX3Wkh8Me2BEm\ncraMJRm/xPxbQlNy0+jZ/TbjHmTj/VX07Zm1BXnYZjqib6xWWyvBi6mG3MA0\nrvzHIoXGBM/RTWz8m067p9Uyx1pRJImmZcoHfnqqup0cdEZdyZdsr+70weKI\nxQVn72fMapVAnpNdGeWIFL2uxwF+eVA1XzpwvzmgKSIm0lyjqyyitKIMeS7E\nIGtWxsgLG7LBNfe9lAQclfpjzpW/PuXzrct+JpMNaqA49lwzqYg12zu8LI7D\nWJLYNMzT/JMfVoCFfS7Qd6Lpub3CZd3t3a5b+OHHgX+3Jm8U8wxQ7ix354fQ\nkxE4VTqrNatvoKcvwcHgX0M44OkGJmm7lrB2cNViXWapRsfhridfYgesZrQ+\nVxcI\r\n=tkeG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"bf75fa2c2ff157f5b77467962dfdc9c6fffb6e7a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.38","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.55-renovate-non-major-bf75fa2c2ff157f5b77467962dfdc9c6fffb6e7a_1618102800375_0.041315615704171194","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.55":{"name":"@balena/jellyfish-metrics","version":"1.0.55","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.55","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d6ebb1daa50179b5acc3753dffc1e6afd9f7c407","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.55.tgz","fileCount":15,"integrity":"sha512-6I6HlWCwsF2qHNiE8Q7/b5LcPGSJWOYlyLCwE33ZB6GxdlG4kRSybNtrrq3cXirc+c8FOmh1zhPudjF15wWafg==","signatures":[{"sig":"MEUCID2zko1hWWxKuLHiNN9m9CBj0PJ2/cbSkoyyWDfYYGwZAiEA8Yvt4RpNYKlOiZdpRIuqeiAzdMKTzrqbpbx2VNtgKQs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82922,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgckraCRA9TVsSAnZWagAA+EUP/1xP0ZbtCs5OWddPOuLT\n+l2BKR4ITtD/WqPzKlSWwD8rdIl+2I9QkZvR5NRu9wfU8vb4lNvKeE/UZRz3\nAMOxnhgNsLPKrmF8GSEW6xXKhzbgjCjbuIX2e444a3KRbyImdJSG18cFbrjK\nBZ+EiBGrIt3DlKZz+X1as7l+KFLJEujzpBE9RIamZiM2x79E4GfUF29vPWfk\nRwxUV6vgB4V30PumkDnIXITZ/fzyxlxQoCD1aeWmVpWVEVqsIxy6BXODSJ4H\nql3X7PW5G1zZQZUji5sWrPMS2GiOgQR3zOWHxozSk4qGGiHRyNMu3XQQzE3q\nBehUBYqh5mTjX8Mz0maBrDerLfgZnikixWPwKIZ4Iz9A1pYX5ah+DWKXhF/D\nKFQzTK9eRG/9+lFyqjrA+2i0GdFHFBwqFfWV6QddXHQ4Dpd+rd8V5naB2a7J\nWFOstgengdPaGFrY7S+ODR3EBke1s23pae1LqLt4BGp9JzVKEcYZAKCjkO6/\nEOaykTmJZbLr9AGNH0YUGr1461RP3oBCxkL2HIj2GEf55omp9wkYdVXHSKH3\n7txqroUUkMpo+5hVfmUuzvmUcqMfbRpPrf7e8wIpXoh5kUuvquFJD/Nc8jal\nX0t3UWDVjFU4htlXwjF9AvVEY98YteXIyLY0lz3ocpG0ABuLJ/73SNgpVB0/\n+3l1\r\n=xM7B\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"77f6aedbdadfdd22d169bc4095b1077cd257504d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.38","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.55_1618103001972_0.30703965568611524","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.56-renovate-non-major-f9b90cbfb23ddb1982f4c048863f14cc0cb6a063":{"name":"@balena/jellyfish-metrics","version":"1.0.56-renovate-non-major-f9b90cbfb23ddb1982f4c048863f14cc0cb6a063","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.56-renovate-non-major-f9b90cbfb23ddb1982f4c048863f14cc0cb6a063","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0f8740b64e8d2cfa2960570f28dfdb7051f8fc09","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.56-renovate-non-major-f9b90cbfb23ddb1982f4c048863f14cc0cb6a063.tgz","fileCount":15,"integrity":"sha512-pdHfiftoLP28IhvHA398q9pITttZYKfdwDl+jPiMuYAwUhrrqp/NwIvXTTdonvzPLsSGwGcgrPCHXxsunYT2yw==","signatures":[{"sig":"MEUCICvfA5tW4lgKOfFxcXLhkp4B+hmQtujpF7V4p28HtszUAiEA5Iuvf9cneH67N2pyWHJDn3mvs03Xzli6dPo5JgeJO2o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83084,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgcmCOCRA9TVsSAnZWagAApisP/3kB4i0kgUOzGvggsgqU\n2z79AFk2g8dvtDROJBOyoE1PssYfvd3yz/oQs0g1LZyHw0u9X79s4s0zDtMz\nWmYfH1Ns8ZsHXK6pTTGyskO/PTvw2Lbinu2w9JKLtH8QN8Xt6N4cdapwNvLp\ngXis2tcHdaefIDxbei6bflXdbjM9OTq88XN0nCKCn7H2RqP6mStFVkAwIB//\noYYVCKPNSZoy0CMJZtYOKKwTvwzmE0HehFMbmSfqnEJA2kZZ6XFT8J8ZgBJG\n5uYWdjZfnXraMGIeqMmANJrCsu+dasyJhB/y0k7aSrXCJwv13RgBzy51gygt\nBLbDkqEkfhyisEgFAuII/frR6AJYjxBHWhYi5XRR9qo6bUNqG9JzQ0qKNcWY\nRjItxa8q/fai0uAYixdKbEgQK78bFrofmVMXfjj745YQZRFfOhPmRFS3hEJS\nFVEzY7Lz2PzTTiYu1TL+z9WjiN04JlC0GHzllE/H41UMiNJ4Cbo5e6NIOyqc\nVhHtRN2f1rexf3tt+HbEB+DxyIWr3Iy3H0A5uvKGszFe4qEP00hKrx1Cm9Gr\ntvdxdMEQdl30B4ExgWxpQu9TDS1VtxAk6N2ThU8phrTQt5MSCE5PekOnjqhC\nGtj/Fo4TUwxxx6GC2CrsZjTp4yGuqDyuWvw+orrkuzzbR/jPJWEkCdM11q+i\nbkTS\r\n=Fr8k\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f9b90cbfb23ddb1982f4c048863f14cc0cb6a063","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.39","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.56-renovate-non-major-f9b90cbfb23ddb1982f4c048863f14cc0cb6a063_1618108557498_0.47203008396189583","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.56":{"name":"@balena/jellyfish-metrics","version":"1.0.56","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.56","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6da37533dda8b1259a911b00646f7fa850e86b1c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.56.tgz","fileCount":15,"integrity":"sha512-6ofAJEFMM/ZfK8Mpp4+VVeRYNznx6AGS/mRUdfIqpqjzT2R2Q0Q4AfpZ2M+0mFY40+O3XGZeTQbap0LFJAxMcQ==","signatures":[{"sig":"MEYCIQCm3yD0ZR8RiXH721jSXBiX28hPD7HuvIBIPKn8LeYfawIhAKWOYWrNzzodoRIc5xZiulTaPMx+BmgV2oMN0nIBM5pM","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83024,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgcmGjCRA9TVsSAnZWagAA+qgP/3ciM8S1yVPPPres997g\nwUbngz2FRjAWhBn/dThuy4OaJ26/pNWm/hGk9ZSgqjz+5IYwOpl5oEuSZwt9\n+G6fua2WO6PPwITdltp+QxSZ6eHlDIj4hgQ/gGLQo4vcWk/CtHTDGLEnEte/\nVqkCiMlUcMukupqcdcLtnZEGqwg0UFZnGdYNoKfnnQ7WAdXqPK0BqXCMUw4g\nXLpit6/pKlmeRs1wddedR2oAkmiED+ZYYeAeW7YonLQI5NJJX7AxcBDyXXxI\nLYe9xVN6t3pn0ibusUK2GKgdsabwHNEzDK0Lo1am+SrlLF9+936470T1bC+r\nGjr6sPbAK+Uao79H4HoGjvXWSjqe5Qu/FGp87u7M3WpQp/rH4AjZ5s+ToL0p\nA9yi6HHREWi6Jd9aWACoOkuT26jqY1AFu6MdkecGWgdnpKdMrfATpnLqS6Sr\nKvAxL9fl1cg4mv6X4iFfuRCbv7MDzt3V678COaPrvOW1fjhs1EdXaxS81H17\n2dB62fszcuXlg0BPH9QVWfqZ9lp93lqhSPt21c1srBawKsds4EIP49RfsYh5\nw5mD2aHpgvIu8NVqJBiG+LrwRVHBk6h+HtjwozXq7chIE7StvpUiO2HK14ex\nn/4/2KjdgnBMIoGI+WNNbh7IozuJ+zpTzQvESQ8TVJ/t8/6X84ShxmxVyZVF\nTZ7g\r\n=WbCq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"cb5cc047bae7fc975bfccae01fd891cf1338afc7","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.39","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.56_1618108834905_0.2906629773736038","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.57-renovate-non-major-5002783466c5e11c6fa93247d5d0031065399e07":{"name":"@balena/jellyfish-metrics","version":"1.0.57-renovate-non-major-5002783466c5e11c6fa93247d5d0031065399e07","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.57-renovate-non-major-5002783466c5e11c6fa93247d5d0031065399e07","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"781cf19e07e2b2c3880e8501a6a340b36edcebaa","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.57-renovate-non-major-5002783466c5e11c6fa93247d5d0031065399e07.tgz","fileCount":15,"integrity":"sha512-br4BuQY2jl0ynJ2qYB/vUzG/3iJaDOxxL7Rx82/APRg8wq6ycSl9MCP8oi3+n3OMhK7gsvtKH/79yH3kZ22lcw==","signatures":[{"sig":"MEQCIFSBFyWEFoOR6KnBG3DW6Vox+QSS4m+uVw7OT9/shz00AiA8afjL3SDiWZRSAUTbBGm0nT+0LGBWnFdgcc3YvGMHxA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83186,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgcnwhCRA9TVsSAnZWagAAwvgP/2QqX/FO3G50tYjMlvLU\nbmXjgs0tKOgLqwnVJMkfEALPotGAX7DwIhgHiwWsry+a6U5T1SzBehYH6t+f\nhTlg6KcRgtW0c/GhsWe0J2hHRcVXTha+9BS2SrlSvOdWod2XQOWDQ+W03uSt\n3Plaia0M+6cJgA+DQaRLzkiOFrVdsaAJz55Ax9e/7Pcn9hj4b/epUgqkS1H4\nlNi8/pFoF0zBTt6M1WgDcNUgbwQTERLYBsWNisoIHDy7pafhhbB+a5VX+DaS\nLM9B2p74UGP5Xy2DWTAtkt/6N4l4PioPHeyRnFRZmK/O/qOBdBUwjYgFlhs7\n42I5U90kOaRkoIV5rO0cjvUHnRhUxhDD7nbC3FGne9d4GlQ4EJtwa53b3h5F\n7GDt7h9NmRHM6RzjqZhFEiKPblnS/gllHsbK/MbuhPE4hCwW6h9KuPcKKttG\n+MQP4bRjrHirIT4l3ZXWEoy1qIzwHhvxOy64liXhtv7g+eNY8smXaUNPWEnq\nvH1pzgclgkKCfJs2imRjJ1RPFOFLplx2PpppYQ74zgqbaEFXGCWSaErHy5Qa\nMcApWqJlu25ypGKTacKgurTSj4yW0inq9QY4vKh8ly9jx97yNPQWTDc11kAQ\nfPXOfg+ysiXzi44+3pPSAPfEZIFH9ngav4xa8O1pbHnTv7sb++cQc+3yPgJx\nZ7vG\r\n=Eilr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5002783466c5e11c6fa93247d5d0031065399e07","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.40","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.57-renovate-non-major-5002783466c5e11c6fa93247d5d0031065399e07_1618115617346_0.5865176589435199","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.57":{"name":"@balena/jellyfish-metrics","version":"1.0.57","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.57","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2ed46383bb9fe702ea5feb26a272432cae6cc649","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.57.tgz","fileCount":15,"integrity":"sha512-VJPBlhSmyIPUsasKd0n2DASNcO1m1qKSfPWyTlN1SXbsvQSZKZtJ0/b3ga1Fls40gvrahmMiAcKtNOki1/b4zQ==","signatures":[{"sig":"MEUCIFwPgU6jFp9KXnI16GHx9rzDQVDqXxdTwcKibg6ovLMRAiEA/Ks4Wm84eEYixWlZ2h1KsS598k2ShQH4GcK+C6QgWyM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83126,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgcn0WCRA9TVsSAnZWagAAgRIP/i+XOjHSkJ0uf7q1zDTM\nrai+InzFR5jt/AYajjhx3O4bb/VuCMTwNmrqI34Jn0+UMeI36PqTjZbHyVCW\n+l9a4/IBh5vaKdz/rCpgxRO2xIU3+YortRIT8xYJ+ILWMLox0maQKFl5jXxh\nJlvuWcFYgU66DwYP0WlLQGX/YkXwRAF7jkhMrhZxegLysr6EumBacVVozFOf\nMvxAoKIY+3BkaGJ71VG/TQlvODjpEXj2d9repaU5DcEj5NSg5fYyzos4Lo42\n1Q5Lok+w5egLmZHqDjbSTIFXQ7XWBWxEFyn1C5ao+nxhEoGrkjnFK1PdUgua\nDLTHxDrBo7L5Md3udTPHYgQjungCyedNh6f9aJYVgd+Y48Yau7gDzjaGIbq8\ntA4ca9swZH4szjcV0fDg9co2sBJd5W4Ekx8JEpRfKzUQm7zxF2YA7VhaQJxI\n9W1QgNONwxopnMcvIg1E2kQbI/pqyVwFiuHhEzF7nNf5VHdoVuSxQPMICd+A\nWomiePootnLlVImP52roguztGtNscGoHQ2gWN0dLyBaLNi0AX383elzWCk35\njgDhuNAwOyPGZoMguhWxbFfo8NdVuJTIPhoXOKBU1XT92bbB7ZZWYUGiTxXz\nL9ycOBIpAQm9RawdE1IO+GXkd8hrsMUKOMUWYcp2/GUQZqLrB1ar6z4p0XQ2\nSw5u\r\n=nLo/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"37bde449d0b49be0ab7f3c61483ece311c4201a3","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.40","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.57_1618115862100_0.017073186774687832","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.58-renovate-non-major-47ccd5edb13ae7049b11e0abc89ae72d4ef3ff77":{"name":"@balena/jellyfish-metrics","version":"1.0.58-renovate-non-major-47ccd5edb13ae7049b11e0abc89ae72d4ef3ff77","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.58-renovate-non-major-47ccd5edb13ae7049b11e0abc89ae72d4ef3ff77","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"40707bbe7c27d19739d4778ee75a7226ea4b7bf5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.58-renovate-non-major-47ccd5edb13ae7049b11e0abc89ae72d4ef3ff77.tgz","fileCount":15,"integrity":"sha512-UTQhrjjMo+SKxoST/Bu+cNrwYjD/UoOHLbBRH6qq0LE6gxPOxcIvSG3lRGUoLXjBwCizyRxaWkEMeI8qxybJ/A==","signatures":[{"sig":"MEQCIBvsDAYyAvR7NhhhzHFYLVWIYEIYeoPJfWATTyq/JyAqAiAqpgbIIcHhLpdEfoICdUtRc6GKTcEIes6NT2um+wMOzw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83288,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgcr6FCRA9TVsSAnZWagAAFD8P/1NjT+P1GXp177224Q6Y\n/NU31HRWmQvKLDSCHxbpdDUdDPWwTmULAbER87B15Jb4Kzz8aIfd13hvUI5K\nxwuMIc01oYM+4E/SHpHsjDrFCZgqHrNh9bh/fwebmOqDQTTH6F3M3L5NnUIV\nFlz0vZqv7GF7GmwOrCLGzZjq84FkYfCmrLzBFEcrPpUo808ldEhh8SBmZDcp\n3eStrcdKTZmYpCswlgjfpWaeU/aSRVff06s7F4MSCqCxhLt4s/j44S4TkdAh\n/xPAJwyjnzDoE5Iz+dSkk0/UVYXdXCLvElK1HfZS8bhSiVNpRpPyd9zbv46j\ns+TfaTeHQu6z3HoURxSA5JRmI0UaUGUjkJKHggcQVp84VvivD+rA4dOnr1vz\nXsfhrzKCjSz0DSLHssyeicIXk4qe1IlIlWRPJR4dkanz/TlBLnU0Mhs6XLJ/\nGjTLbVh1pQVpi31yKiOXtyD4/zy83rk0T/xKGrhdad/+3473OStulw/o/Y6W\n3tUK9yttHvQdR6MxTd96VKzwMpj761givitjre2jh+0VgeBAbtxh6UrhMSIk\nFbA5PFeuLN3/kxIZLW8ZIsq0zeYEMcxDRebA2pYjHEUcUMDKEALz5if3WcZp\nUWZRkl33gbRxlLxILSTtVobeptaJ5yeT1G6LKaWtxwyJpHvjDnjCv2OMTK4i\nwxjn\r\n=int5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"47ccd5edb13ae7049b11e0abc89ae72d4ef3ff77","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.42","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.58-renovate-non-major-47ccd5edb13ae7049b11e0abc89ae72d4ef3ff77_1618132613312_0.7977956364154712","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.58":{"name":"@balena/jellyfish-metrics","version":"1.0.58","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.58","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ec84b60b92dc9cffc6b93570df4b7ce8641d188a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.58.tgz","fileCount":15,"integrity":"sha512-6Xu8A9/scODqAHeSyCbIpTq4WhGevTBopjd6AbCMZHFgAr0lPmLvGd5Pz2TwH08kwa6hB2YSSCdOdNmxMoYoQw==","signatures":[{"sig":"MEQCIBL9NWiwGyJfG5uZy+hLI3/hTrhVjDzXjkhsD0h/7X2WAiABOD+xSMkgOi9H4k4bORkfH1/vp1P8Pp8Eg2OMliH75Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83228,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgcr9SCRA9TVsSAnZWagAAqBEP/0MAeq9+Eu7HB+/M7oXv\nEuSL6JxTF4FJO3k2+CjzXwyxWuqKCnO8J1pXdNEL3o+t/8iNfC86TX3jYqix\nB1iavi8vWqySXvy8QHYrw1x9BIOgeYMObDYkSFgxHps/T63m2lfrbOwOYzbe\nltFXODxXLm7V6qNFAw3NFRf/Gtxsn12po1kh/H8prORHTX/X/ulOK9xS2g2H\ndTEt5P3mownRs4DUimYJvjQ/DPuuiAnD27Wr6ygWNkLUmm4D8A1CUdgDaHuU\nG/sQfew2h7O1kxxi8g7vz4BhcxnhDNb2Z8VDOzXrsgeROfbrhML5z/z6CLU/\nJHLttCqiImuVZSfboi+01ZPM17WbBKADrqd2mx9I/WqmeolCk9ylRAg7j+YI\nPUXFS5qmKzrqBo9i1hBuTbN8YK9hkbpJR6qpr36OINouuO5FM2trbNWGAPwv\n5BU5ND0qrAdOgSpj3XbK26aB2yB63devZKcQ7Jy3fOmey+llygFyVUW5P2hn\nzpFbmDlVqi0xsnALr1daXXUrPdsVCbNTUi2O/ht6ox41YETUVgxt84vnzxtj\nSCJq296FRpCZ9mJzzQABYdV9eBihV72UHFaUs28aZOFhO03nXyGrSnwUk6T8\nBWLgtvYnxQRiyr8XJ4dv7NJeSg2u62KoKBCUfkplP2kDfXk8LWEKMFqIP0Kg\nbBqm\r\n=0H2t\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8cde26259104b8e8e8eb47326beff6ac50f6293e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.42","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.58_1618132816616_0.26610808720251633","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.59-renovate-non-major-d1b5b8fcc8a22ba03a6464b106f278957ebc1760":{"name":"@balena/jellyfish-metrics","version":"1.0.59-renovate-non-major-d1b5b8fcc8a22ba03a6464b106f278957ebc1760","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.59-renovate-non-major-d1b5b8fcc8a22ba03a6464b106f278957ebc1760","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"124b75abb00795a59c803fc720640d06fab222d9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.59-renovate-non-major-d1b5b8fcc8a22ba03a6464b106f278957ebc1760.tgz","fileCount":15,"integrity":"sha512-iUDcIZKcZq/4HzX9/3Xwrn1+hHERlSzOekHymdWvvfptDJOoN5CHlXwYR/SFxBXeXuf56AZKgYPYp2n9xxishw==","signatures":[{"sig":"MEUCIQD3cyi2e+EyN72AMOCLhYOAjK9+sSagh2FCX95QBVA5lgIgP0arQ/yCIE2dSJ1X+eboWpEiZfbCj00C/qxp4xeEVsg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83390,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgcvd0CRA9TVsSAnZWagAA2YUQAKPx1IQQGwRD9Cjhg7fD\n6aUia+ITnCul/48hLo64F0LEeYYaDC8Z1hmUd2jrH6UUbSquwMUbWF7Fz3EQ\nNdHO2uJsvsx+FYDtARN6OcLphAWBht4DBaZ/Liq2I+UNChS2Aw6Vv4J9Z41Z\na+hkQrJPqZbDgVrszZEM1qCJxl+UJR/ESy2fwAOyqQKC/OlxnLvYgOHzI57c\nAlhR0VNK+emTt3UYdarpUvodS8BOmAAZQk0+20wpseSWSM376s19NqmiVxxR\n5lxfiGWed1+f6LoaUsyqZbk+I1ht2PDH0wvWZu5aUjGWl9mUj1PojhtYBamX\nf8EfJK3lvHxjbrlQWT74oXpiL7uJOeTpu89HOnZR9TgS9mxT6LUe5Sik3t/S\naLMD01Op5nw0X5K+J6xW77MJsLpMNOkkr7lohcU6h3ruJ1pkEKLAsyN9hfM8\nxVv93nccB63H8cMVGyCQsvaa0I1vx37sx3aZbOcHTfxnxLFrNI6o+R5bXr35\nyTikmG+Aw2rVREzUNWZsJo0WJ7y2TodQWG8EZhEKX4TKI64zTIRwm+Q1U7IV\nWlYOhnZUEjhDOblllEyazFkY4Ma12Hc66ICfb8cD2st5OubZrxCKFpl5i5bX\ne04qlt/IvORiAf/yG5ihBxZKR1ez46wFWmV24pRk6KBZmFtA/+dyBBJvXoUB\nldTM\r\n=t/VJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d1b5b8fcc8a22ba03a6464b106f278957ebc1760","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.43","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.59-renovate-non-major-d1b5b8fcc8a22ba03a6464b106f278957ebc1760_1618147187696_0.5960742229643672","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.59":{"name":"@balena/jellyfish-metrics","version":"1.0.59","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.59","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"eb4340e0f3f1f47f3da6b577be4ad702ffc86bd9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.59.tgz","fileCount":15,"integrity":"sha512-ZXz4IBSh5fFZYs75vZeEbMksz+lXo3RkNgQ5AdDzECEoGAT2hG7hPpiPJA361uw0OjbKRJE6BYD5pA8POdz2Wg==","signatures":[{"sig":"MEQCIEbHRBMob9H0E03l/4PLlNW6TrgOlyrQAvF/15Mxc9RaAiBm8i37uAYvIm30SHaDuKj+ykC+zpkQ5k0Hu94ItmMfXg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83330,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgcvjiCRA9TVsSAnZWagAA3SUP/06ICYJLN+EkU2RjuFXJ\nc682/sPpI90yFYo9v4w8WswieIEkDM47aHYSD7UW6PfvHM2nFuHTTVjoAcsL\nVeq/UpW39+wLBYEk3GJnLXgfbAoYSz9s3+Rs6pkfsnRSG4FUUaW2eCsfVRjV\nZGPtKhIs7tMrRin7h6+R/60tglLJZCp4OoWZNXy0Muu82yuC5cz99MrcL05u\nSusc3+EIwoDKeygORQptneHpX5gqQGz3ch2T8HEgqhG5bwdT049Qg7hbOKHM\nYceMI+qFS2to2G1JvTTUwQkwFY+AP1ZlaoaXAmIWc68c6amrPOEKxOZoJ0XH\n2K94iL1YYMWkJo8yjuJ4YIJvx97fwJVxCjaFn4gLnTvGeCG4OksMY5JKbGY6\nM+9DvzqPS93kRw0T6ihlKRxJV7X/j+T2ROrZuREldcVG+DrkZc+snjbMIFuc\nh0e89rfhOnNKDstyLbIbRbfp+QtlL9WQbcgqCLWJ45S5/zM9SMfhEqi0enhU\n057oEUhvQg61UMG8TAMCEGEGZNy/pHloGfASJ1kAJkZ1oH1618jJXQsQZ2K4\nAPtCPXZPZJwabRGCXs9uqoMM/0Ka+7kBssBmMdmrlWVpaKRh3uaRyVAhhrOQ\njp6HQRtnDB/lQ38JaIe/71kRWWvjqNgB2UELEDEya5T21I9HN2VF1OgCeTs1\nepIi\r\n=9zBr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"67aa3d1ba0049a2d657ee29c184ba03c81d60bb1","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.43","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.59_1618147554044_0.5851215346511391","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.60-renovate-non-major-7de4a76debd4e2265193f504d815c1550f878953":{"name":"@balena/jellyfish-metrics","version":"1.0.60-renovate-non-major-7de4a76debd4e2265193f504d815c1550f878953","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.60-renovate-non-major-7de4a76debd4e2265193f504d815c1550f878953","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f7c50b2c1d3a8f6bb7b3b4af8d654922040123d1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.60-renovate-non-major-7de4a76debd4e2265193f504d815c1550f878953.tgz","fileCount":15,"integrity":"sha512-xAaKAy056H0FpKnS+YVE3Svzs2KvM71b9yGiV5HDieOubxBjrflQJ8mDBdDMndDLtTZ3JpnjgX0lL+dXNjrlOw==","signatures":[{"sig":"MEUCIGcFvRFG28BBMkk3z21rfliyzfGSKCTdaq9xh+69iXy2AiEAn5vjRZsapBfFX+48j5TuBfFWJ1QLwHOV3zIbXNFmr3g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83492,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgcxJlCRA9TVsSAnZWagAA+ncQAIH9Gdfk3+LVb72YyVpf\nzsbAJbF/c3ZN29ICwZKCdhNxgCfQE15K1N1tRRb24p7HLzuFf56BniphVWqi\nfry+weqR7yXfGStZrVYZcOR4gtn6p7ZclQVlB8nedpJI4NPna6sZhwYOv/i0\nFtOZRP2WKj+7+f40G871mkIH16LbQfSLf4NOLuxPz9iv2WFP6bj1g6qUQ+jn\ne+bgwM19c9Epm+kwACbk4iTfX+lrimWhb3nGfYN9dzH0pl7YkkE8UyC/l95v\nNJ2SHLWlrSYB/alIi8NQAwGQ8t0Y6ZapyrSMSDIhVCGKQ2TzCnNE15pW4xRF\nDsLbNCQxKlugk17PUn4y1swk6ggwbk7YrTlB6+c1SJmZqE3h2E1/lBISGzrV\nF9l6OOm2xgfIL3LPjoIie8nWVtI4N20THGaUE+1h8EGbNZFRUZtTXi9bMMD1\nUbD6nqvOGbb+yYzNrXYbpbolrDBXiyhGOMKc1xEPGuPPLjfm0xOPE5lubi43\nHWXR43rKmfI66u/eCzcCT/infFf7j1+PFlEGGBFazAN60FbsulC4PCHfcEC0\nzLZ1arHLf4ChrpNVqiBlonXXyMjOwSsQoP7Vg7YIpJkb8jY7bo0zMV50zCYD\n3dKBuA7cCII/Cnq8WBeRYj6GFWIEZeok3xph53MmDjjrb8KvRF0H7hzvP+QV\nTcan\r\n=fBZ3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7de4a76debd4e2265193f504d815c1550f878953","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.44","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.60-renovate-non-major-7de4a76debd4e2265193f504d815c1550f878953_1618154085241_0.19434822013981856","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.60":{"name":"@balena/jellyfish-metrics","version":"1.0.60","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.60","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"73b1600da4079b46c85f4a678ca4cecb8377366b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.60.tgz","fileCount":15,"integrity":"sha512-Hck51cRSybWflqXzzm/pSXydnUsg4e556nykY7TaY7vG9MjQKlxVD7pMJoh+Xohmw/CJVWRa+xfK6BZKwJgHuQ==","signatures":[{"sig":"MEUCIQC9zgv10I2Q4Ajk72YhkKW21qtqvugQSIyxfsc0Uj80kgIgAmZxqZLId/fgd4FTeOyVfx4nJHfKyHMaZzf4uqm79vg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83432,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgcxM0CRA9TVsSAnZWagAA/RkQAJzSnlgeo+ow7ksqRqqi\n8hCBpk0O1XYGEmkNchfyrkSAnWURbPc0ENLunY3O9rc9FOnQ+vd/kaFfFlOR\n+peMYnESrzrgIfhRfsiJ8GTjPWphYcpr2NYSlmc/EgSkroNcV2UkJtoZSdsz\nPjMQjoVvp3drDejN0DCm27wvsIpW+dtc/jF/e4SGh6jQwpLCAvk9L5bzMP4M\nVIRk8l8ebjDu4nOfiCv1eHYkvn/Ckx+TFFULeWnuLYRc1uq1/cjON4n+CKDR\neiBN/xGIR2naFCrhYxuFUkeFjrSWxiY0ufH2tWUXPnT9Jf1/Z8lp/WPz0vl2\n7yovAaiZfznCIrnEC3vterzhIVrX+9nVY/4gxjKM8I/183j4BJD8q02DKcKQ\nopfuCTk4TL9HoakfqMBiUarTiCa/197tKmoYD12uPDdUiar/JFBZ8NRvppmK\n0mgFpS9u6MCztoJ+yqBujXx0VpnKn1BMZ+LRDVG3/LIzY1bUYxI6HMUPRnow\nHXyTuUa5LTJZx+20wrF7Fzs8s8HEZIrhSNuzRquP+z9DbabhKimMgiPh8DoT\nxFkMa1mYVjjyWJRw/7Pi0T1ragmlnzSnAHDZQ+0B5Y7v9bCXlFNhRFml7kYl\nFtAd75w5QMLh3cgXIItDyy8joa/ATMfXcVmupSBv/Uw3z4aCc9Xl+sQDLnVZ\nJJlM\r\n=WzPv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e9947103a50bc7cc914e43f647d9c331ad69dd7a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.44","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.60_1618154292164_0.0876779176229534","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.61-renovate-non-major-3566b34f0ccbd18b1417afe4fc70138789dd35d0":{"name":"@balena/jellyfish-metrics","version":"1.0.61-renovate-non-major-3566b34f0ccbd18b1417afe4fc70138789dd35d0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.61-renovate-non-major-3566b34f0ccbd18b1417afe4fc70138789dd35d0","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b753e836125bd62c3ecb0cd285c6ccbfb2777c35","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.61-renovate-non-major-3566b34f0ccbd18b1417afe4fc70138789dd35d0.tgz","fileCount":15,"integrity":"sha512-u9+2GowKJziE7l6yjwdibNoZsni7rdR3PMQa0ZbjLDVwWBQV4Eg1r/q1XqbYv9BWnMoy8KQ0enONzP4x3iWy5w==","signatures":[{"sig":"MEUCIFvU0WhSE51Y1hYD8MuijZs8qxd4yorNyeyDq8FSl6leAiEArPPBRV9l9pjZVS35noXoQ4yV4HYwkVNByAfobcN+wf4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83594,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgcyaVCRA9TVsSAnZWagAA1L8P/Au/AlaeqHWxc5nnpkiI\nu92wyrPb7ElY/LXKJ8RSQilnYzeQXTiabfuQ0O+DW1yfd7p0aYUI0K0QD1WO\n/POUdzh+WgwM/I0pXSQMeKsbu9Ga0AG14n7G7z7twasCrdGhed9bSapvDiof\naQyJSkuAHNPp+5QQgQExBTevRUGPt96RRO1OtmOAr1ueOVyMoJfNjP7NIPp2\nI3TMkwITCUwIS+Dytt3OlIO/+tPishKutDMYEwM5lOy7u8ZRTcwInYcFZtu2\nLLj8YHhtWCVqeZP5KKksQJVcmTvVkqBONVeYCIceLtnlwpXRybbhLT2bZqo/\nGEBa62/xsyQR1FpQ76jwcZ7JLYckDHQvWxARXon5yFZeZnZoxqJGmSGFgQLf\nax5SSewZsYpp09h+r8KX0u60zfQMH3dEvYyDIByA0mpZ/Aq48CTYgI02c9AR\nhTHE3YuxaAViGR2jsvWWRWnZlfuWVWprOynFQycXKKuW02Eg1ATB2DJ4VNqW\n6O4kEDJtSGKwimvPQOqEyQp+8YYLr/JA5kQG+F6Nkvrk56Pyem+0I4CtsYma\n+98UIktPy2jTGTTrpk2Tn9yQpHVSv/DRSDjfecIpF2vPEQtK65IGxNJZBsAH\nkx+2F3j8ILhB7BmcPcwvuXIUQgteB29XPa8UFePGtbJTK7hnZq6BNDBxB1Ud\niVOZ\r\n=gVqp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3566b34f0ccbd18b1417afe4fc70138789dd35d0","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.45","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.61-renovate-non-major-3566b34f0ccbd18b1417afe4fc70138789dd35d0_1618159252562_0.2887309501005635","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.61":{"name":"@balena/jellyfish-metrics","version":"1.0.61","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.61","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ca8c8ce96a3718f736ddab4de3b6cbb8721d2694","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.61.tgz","fileCount":15,"integrity":"sha512-uPkCqW4vhKy7b27vCF+1N+0yc4rIpPmzgBrwRWdP3r5KIHVGxSmrBk/ZG4VGfBtk38fWR8EpyFRF5+/fFgIR0Q==","signatures":[{"sig":"MEUCIQDOXHgfSBSB8gF+sdaiIoIxX4zncgaQ4is2sLvRchCb6AIgeAILA365Oh6y3JRVou1x7DByRm7oKQadZ3+B0ixDvyQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83534,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgcyexCRA9TVsSAnZWagAAURAP/jyVynusZ/NKFxKVb/fU\nY9vAvjmrwJ3jv4rBBQPOu4WDf8fDhFfZH9ixH/lAAvsScnPpEk48G8B+9Xpn\nQ+d0g4dtQr8ouBDmypLreow1GMqjq0khMor4h35uAV5Fo8esjxgyPKXpJG0i\nKG98uYW/wHNb3wnpCzQhFQNf11L+BQsAUo/jmoxoB7PAuwWTnbk5iHHYLLqp\nXs3o263rO0hGjX8lr450NoLC/qWQDeFng+xC0lG6R0GcW9K73VxIDbITP3H8\nEMqkuiFMEJ7q5ONLxTGyiQOT5aeakRa/24DCzGRN30gHbbOq7RPO8oZFqsNp\nWkcqR90IkjE6yRgjVXSDbLaT9Eefkdyk6E5ec30vdYkCRpWc8YHUL9hVHn/x\nU9NlN3QWfO/PA++/Xr+0Ld9Qq6GfMz/CL+9o8ReN1TfDhN+RaUBJPfkRVNqZ\nI3HDsRM0Qm+eK30G0mmKlRiP5xKZv5MHZuI+P0mwHU5TgRoKltwWdRQt+8e/\nzZ4ZwR0rqaajn5ypF1aQNH8HHl0JpLSKE+OU+xQRHcnhvHunlx+TzpqpLoEY\n1mbwVbeJZk0YObBsVEIKUfx2YHiV6DtnkUH/p6et+kaZXqCOltGEzC2eqQ//\n5L7eBrQAKoOeMfWUFfIMKPVKlARMrFI3Oj7kCIuMBLaIVP1EpK8o2SG9xLdX\nhlXd\r\n=myC0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a792caf8ebcbdaef8bdaf42a9cbc652c2a8ad739","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.45","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.61_1618159537197_0.9170602042733376","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.62-renovate-non-major-402bce0a705b3cf1d292e5dfa07da8c9f8051d89":{"name":"@balena/jellyfish-metrics","version":"1.0.62-renovate-non-major-402bce0a705b3cf1d292e5dfa07da8c9f8051d89","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.62-renovate-non-major-402bce0a705b3cf1d292e5dfa07da8c9f8051d89","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9e140f69077f47cac315e067a4dfc773ee8c0a6d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.62-renovate-non-major-402bce0a705b3cf1d292e5dfa07da8c9f8051d89.tgz","fileCount":15,"integrity":"sha512-BSgUKUBdwWTMuauKn+gDTFxX2RcvXztM/ByiKWsi6P+9WF0goRcJqotnrB16pbOqtOKr+PCs2Km3CcyL4DZLHg==","signatures":[{"sig":"MEUCIEmhY2xuBN/Ic+HWjehz9PI7jf0dOZL4xQ4g2M/DlAwmAiEA2LdPVVhgBKz6v1u8aDIMRumSPHNqDi+ppz/IM2cZtDo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83696,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgc0VDCRA9TVsSAnZWagAAKjEP/0mPN9hiCD7qQigGh7y1\n0YA1IraAIoihntpdj6owKqJRRSkQYjn4MzKd0HQt34zLNM8cNOK0ViZvUFPM\n3EVEscbzse3U0A1/Nz9zn+1aHqPlByN8SXyMaI1MWIDA+3FznQi82OALScF5\nYXd9fgfpcAQI8OGQhYsvnpJujXFkHfKzlRsLbsR9T4YQTiH4CKjqpNazUO9J\nlbOT8EQCAJL+wzzOdi549SVKSCCayHrSgmy5lfzLsTdG60gD7gflIT/ZsoQc\nf7j2CpVCQ70nQ/7Ag2YvgWBQ6euAvcB5DpFpJmKf5rX0lp8jOVa/zxFBLMF4\nTyTOtXuhR2jB1HalduoDPlK2kjq8toXFcGcDPzWrxxDuYRn0noWnBCaC1aS5\nOG6ErIBVeGQUmdhVe4x9L+XItyD0aM82dCwXc9UkpG0J9umFgbBGiCPMLZQc\naD1aru04pYcnOwHBSeQJlSdiX+iobiochddMdmN8M5rvYKKVW7VEgcvUohWa\nRZc18qqz52UZzxNGHNVmtziuuQnIS7/nEdAC0LSo0tidRo6XhmzqYVsSpa7D\nGuiiszdzMUZ5ahC1wJxdMZjKfKFsZ7rFRK8xOajbWCfKuWtXchFZn6p+5+YK\nzoCsbnSuSINAaoA6lv08jJ6E7/4rtQ+f56KeB4kWarqC2Ldfg2YlaFpMcdyG\npwLK\r\n=W/iM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"402bce0a705b3cf1d292e5dfa07da8c9f8051d89","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.46","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.62-renovate-non-major-402bce0a705b3cf1d292e5dfa07da8c9f8051d89_1618167106679_0.9154448790178817","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.62":{"name":"@balena/jellyfish-metrics","version":"1.0.62","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.62","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"41a3ba170419aa742ef64c25226912ebb0f915b6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.62.tgz","fileCount":15,"integrity":"sha512-Gz+dwb2C4a5bae5ixdbVAZstKZfQpQZb53nRQxmEQPNFhu+wrFgl68xpbFA3q6eeyIELJq318J+cYj4d1z/mCg==","signatures":[{"sig":"MEYCIQCOIzTqG2ddds9apS7StU6gviMqhTSmF+WEWID2nwTjzAIhAJOrVqVhnYtTrkI0yDYezd3WvdCJ067UzGfK/BOAfRSO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83636,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgc0YECRA9TVsSAnZWagAATR0P/A91Ijl1QKVSh06Fhwf0\njUzKr2qp9lFmZDj43KT25CI2Pp72262B2PqGNAoDQ/sMegCnRmqj3ZwKJ6Qx\nkXI+W5iRanau7UMv9ozV94x05L6guTKJ1Tj/LDl3RW9JAE0A1BPPSkSC/KP0\nW3ivBIMoz1uHeFAbpfqxK3yJRxgJ/aUvxDnYcuxeZHRdDK++kfSTKginBP+g\nUeB1k5ZvjjqtHt4vi+QraAODQY7MXNfV8dQ/XjAYECY/x09p7YPV9lafAmp0\nGx0T7aHdhK+VBo/F1X3d+i99xnvoY51M6XsnUq0oqevQ9r/gDJ3DcIGzUQ8A\n5IT90qMMJdXMVfghF2qUwb1AiWc/p6MHnsf3+QoxZa5ismQmCPtXYl9QTqjB\nAJmVhaYUBZUMp8abByu3ldF3p+JX3nw7khHupqBA/ify9+nD2Ayi6TMbNNZt\ndK6DmpK0vNpILwko9w8kiw8lgQa2gi/1pjnbJBwxdfK1jjJkPADKlqx2BkT6\nbLpo3sE81qCl7SAD5ivMlfpqHh6fqmfv3bBJu1f3jBu2cPuZg8f6bR0TUEVk\n0Uj7TmTneB3eJ0kNO8YevyJ4D19Jmnr6PQd4ktfUjKhGYOBQKTFJvb2LNK/4\n+DzuzQG4ylhF2deBnG6OqFSZLm7o/kC5IL/CZZXA/imt4YGBZaLUoe34fnPU\n+HCG\r\n=2H5F\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"122b8d1da38010d6c8ef63d01374085cabb8af79","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.46","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.62_1618167299645_0.11111871774372784","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.63-renovate-non-major-8d602656d5c6bb1253ae6f456e8651a8db91bd29":{"name":"@balena/jellyfish-metrics","version":"1.0.63-renovate-non-major-8d602656d5c6bb1253ae6f456e8651a8db91bd29","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.63-renovate-non-major-8d602656d5c6bb1253ae6f456e8651a8db91bd29","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d1a431a81e16d4926177e4498b9ba44b30f51c6d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.63-renovate-non-major-8d602656d5c6bb1253ae6f456e8651a8db91bd29.tgz","fileCount":15,"integrity":"sha512-mGRscQGlLBkAdmhwgKb5+GcCVAoxaAU4fC5E+Ekff/rqjEx5pVkESPecjGxHc3zgV+fW4pw/7BbCz4rp1ug0lA==","signatures":[{"sig":"MEUCICT29u4dw28hYK65xtbr+P8pa119Z9JdpbSUahF1mPAwAiEA2LZiWHFi03GqJQhwMI/3vn1VbxhQ+IMN8ESwbCWKzu4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83798,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgc2Z7CRA9TVsSAnZWagAA0GUP/0G31CT37Oa33Ygc7DV7\nrncNg07pmu4V2NUTMP1D75eajfQ7xFyqLXwNuUl4YEycIt28A5GHftKaA0Um\nLjSl6ajoNd/KlIxI9XdLKLhgqbyg4Gl3VG+fzn/loadmANiyS7eKtFCMh0O7\nj/rIK/lIE1l3GX9Vpb0rwriAfwit72i3R/HF6V8acLkxyVpoAHbYRFnM2xxP\nh1IOBkDOCtu89PXaHWkxc4JHdrDM/FT0bnRpPqebl7LHDko+HHhSxPwsWNJv\n+0/CYSW+cljZlc49EDyYmwl7VI8696mBxKNSTaUFhVXVeRwx2vHx3opA5nWd\noOKG06S8Anorxd3/U3ACmyzQ4PIia0xUh52LKnm9Q30h8l8s8hRIBW8RT8bj\nJuYiJxKPkJgzD1luugmc19ERnaAL0YzgIxypHsihNMV+c+dQveZr1j9sPXNs\nBg7jcC25q2uFtd31kUl8g3YcAENMRT0vx9xwvRCxTIyyMnL3fSvHE4/d99gQ\neX+nppsmpybyT8EZ9RnTYljlgghUXpQyCcWXmLnIFhVZg7SbOGRPjheoyyeW\nibWBWf72HekEzwWBtd8DJvF9IRwR0uMWoXZzhxK1wZQLC8+rCbWjBIqG8ikl\n6najxPwMBxUp6tnzll0fO8pgFdlFjG+ByvWXSiQ2kdQqPtDMaDuOM4nN/lpd\nPKcG\r\n=MAiT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8d602656d5c6bb1253ae6f456e8651a8db91bd29","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.47","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.63-renovate-non-major-8d602656d5c6bb1253ae6f456e8651a8db91bd29_1618175610894_0.6774438691886127","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.63":{"name":"@balena/jellyfish-metrics","version":"1.0.63","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.63","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"64b2bc3cacc4ef501b1bc14c35c912a76505b0e7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.63.tgz","fileCount":15,"integrity":"sha512-Dy2/TeJ3OIwFX8WUbMKqNsb9hdgXoObIEeK/FxLkxPjX1D57Zp+Hq5coJwW2mnniSCSdbCvjGRW2ISxlbs1xVw==","signatures":[{"sig":"MEQCIHukm3IrfgydEiI1HNowjKuVUFAGLPZGxH9yFwB7m10ZAiACtGwYqn7+r/ToOZyxEoigPMCas+E3P2Duqr2JeCY3rg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83738,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgc2d6CRA9TVsSAnZWagAAKP8P/1ZNAmeijxDdXJtahtOm\njeEQiW4EgYXnLee3Fby1Q2aNLJL/bHnMb8nt3lzI1gh61NoEYUUsyivTqJ3v\n7DHY4g9R3XvfOQWptvS8Zn3iuFVPJIKPIKpPbcb+Q5qbmupn3QROjlLf4NCv\nD2nirncoEX+k9eyuSnOVWidKvg0VfgiY+R7PiRdPySIklFQToqeb2wKy5bNe\nV0k1+RrLOZf27fQvDoiiCRoU0m94uGiUCb0wkwMn2bA73pD7nPWfsR2p/cLp\nsSL1GMAADE2nx/4ZQpb41ywfVWBU9kCwZq1oOelkjQ7Q6vzJnt0vHS3OwUR1\nigibJ8s2pgJaLoh+sg2IUmbL75hsl4D6gVkbZah2NKpCsSP/Ipyswj/KOg21\nZVCTaEkX3Ub+uMvvXMSNLF1K2OMqTjeEEdKHV+0waXZPbIF+E5m1XwgaNixW\ndNaZfzttiPmkynhh10Wh/uCucfH+DtM16Ju7xhgv8s8IoAs77bOeMriqGSpB\nmx49iHa4rhE4HAsPtlukAAjUkI6oT3nuataY7Yr3A7VOkgIcZRMPexDFiNDo\n7q5Y99PU8WhYv+P8AzNy/E9P9X1jLb2U2ISfzcdxNf/OB2zQ7uPgrZ+do7CN\nHZfQBE100mLiCdhcP3WEy9S6KnX7pwhdJH2ZsAp2FErKstlpktAEAznCAgad\nYypg\r\n=TfRB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9c82af667588beb8b4f51dc35b02e68d2ac79cab","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.47","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.63_1618175865875_0.6184930078285502","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.64-renovate-non-major-6b5fd492f99ae2253bf766112f7684e19370b10f":{"name":"@balena/jellyfish-metrics","version":"1.0.64-renovate-non-major-6b5fd492f99ae2253bf766112f7684e19370b10f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.64-renovate-non-major-6b5fd492f99ae2253bf766112f7684e19370b10f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"503d0dd9690f1f55e4b0d23a261cacd133d0da9e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.64-renovate-non-major-6b5fd492f99ae2253bf766112f7684e19370b10f.tgz","fileCount":15,"integrity":"sha512-0J750/r/LHml5200uH2ePYPd5OKYw9MpIrNYSGJgLsBdpX8ftAiVWgChdCecP1MyFr3jDjQT+4X32rh28N8oIg==","signatures":[{"sig":"MEUCIDfhuBYWXbcRghsLZyxxlitKKhxbHDDGACmLlK8IJSbvAiEAlf0SyBqkcqebMw9Vz74m+IaR22B7QqN+yxFFdbYOn88=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83900,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgc4UiCRA9TVsSAnZWagAABQsP/i9ntSW/we6jMMq1SC5d\noj2fcW8lqNk/nrCeLzd56Q3v6gdamOAJ0YmNSgI210WR0V0iFSWGDIFlJCEO\nzx9PBNoWRW+w+R6DN0nP+Wa5k/8B+cCBaDyQM+phAxUFF3K0JMcUMypXj8Nw\nWIiXUjKLYuTRl85uTrTbDz4EwNU7UDCDYW7J+aSxm2xOYuzkHPVYleRQ8MJ4\na0L/JFAo/SQRkujcE7GVxk+gexaonukgxS4cx8zvvzc11PN21ywPvoEXvPPu\nCd1sfEjeYtPkVWm0ifPJMBGDtnSFVoYivA4V+8bqi7vh7kqEF4HvAUt4ejHA\ndG5Isb7bGfOfUqh6LkDDH/aVmKGIGcGsbGzVXOV/jAOKvQaW2ylvvbtmL5X9\nUsAgJVlkhOzcfaPiaiG3lT//dS63bwjtM0q+TeW+TDTZF5E3P3DqQHGktsM9\nYKtRlHj8nzZSxaWtJS3r1+f2oi/9Yusp3OFmLKzRKf0L8RaoSNEdqqlhkaMB\nMiBEnbG49BFJ7+MjUy5/qEs1nEh1rO5vrDy2vgjI4fktW0pQ/LbvCSNga4jz\nJJED1bsLFcWUghjszwLpjX2/CDkZmIltQm52NQmfQMIrEM5rlOcp3qA6JTh/\naBYXox6PKH8ju9sTz4WiDTklxGHB/LgW3KDQASH7OGQSQjeb8f3eqZ4XKbY7\nhQJa\r\n=VtgO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6b5fd492f99ae2253bf766112f7684e19370b10f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.48","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.64-renovate-non-major-6b5fd492f99ae2253bf766112f7684e19370b10f_1618183457596_0.5064072286822132","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.64":{"name":"@balena/jellyfish-metrics","version":"1.0.64","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.64","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2cc846b9743900a1000f9a7010ed9e495c1c09c9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.64.tgz","fileCount":15,"integrity":"sha512-+vkpgvbebtwUJbZMmimI0oooXNPUObt+Mengh5IPz2DcQUhJ4e0rG8LgU0xksN8tpdQLRthaipa1OGmK9QpoGQ==","signatures":[{"sig":"MEUCIQCauzAZ1R7+xRyv57SkUtwltwXS+9zDA1QD/Mq7wRmIdwIgczi8XQ4+txNL4SfPH7i7IHxVYegIkSC8+kVx0EEkMwo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83840,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgc4YwCRA9TVsSAnZWagAAlwQP/0OoyI3sHibSJ7VYMQ2l\nR5D1pkapJzyh8nBfWIHGmTJkU+anvfvfgNuXi1sh2c8Y2TkCga+V3DXJFtKB\nDaolU1SDaBf/GQfmEwx8U0mZwuejCz5C+HNEqTHWhRW4lguqHxx6K+5ANwwa\nyB5rAfa8lGpQe8JG4PSkM2omOoGKmkzsW45k7EY/3ipH58VclWD5oS4HGw5z\n/hLIrlQFfAIg7sONUiC2QGzwYaDEwy2sIonqrVdd0rqjan8+dPRPUXcbY+lY\noayW1/V5XSPNjRKJKv4EE1DeN8d5ZtHgckkgT82Y2K4TdEUmuwdjY5Hlgj1q\nzBVYgjul5CNsWLm8nzUJ0oY8RAjyM8KdzdgFbNLGjNK9y+vYlN6VPwr4qNSp\nn2tYr055iAwhkfdc/M7UrTonwxSMMxHmLqugy4qdyvGzAuaC/gJszQA1xvDI\nICWUf3dJF/AlmwgU15GLjLrImOa4uxyqghnPHFkxbFBdk2lNtdHIOkUuRt/x\n1KIjR0GT6Z91TJboHAmfV/fHctbqzfWYJ4+EqzNuCtLiYfr++csMRJc7oONX\nzur1AEzvHt64xo1Jth06guKVifEiTmTe0ARF0TwhAJ0DzH35lZ254U5C5t2Q\n0yOPXsfNWtFgcnSrcbcgEmWqISf7LRe9BMwxtFbrkeFjYrjJS4b60q2z5KhK\n7IJ+\r\n=Ouc1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"851747ab3c488c43bad3e31e92ece54d832b829a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.48","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.64_1618183727960_0.39249910456935466","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.65-renovate-non-major-71a16efb4a5249a5381c219cc8d0b6ed8b4687f3":{"name":"@balena/jellyfish-metrics","version":"1.0.65-renovate-non-major-71a16efb4a5249a5381c219cc8d0b6ed8b4687f3","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.65-renovate-non-major-71a16efb4a5249a5381c219cc8d0b6ed8b4687f3","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b4ac9b773a238c820f82314001c91f599409665b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.65-renovate-non-major-71a16efb4a5249a5381c219cc8d0b6ed8b4687f3.tgz","fileCount":15,"integrity":"sha512-RlkVUvndPqEOyDxYO6pzujXTux8KkIAwuY6K+RxDwyrRw0JeByfu1pTk2RKBL3AEvs0JVDcHOG0XgQMVetoWGA==","signatures":[{"sig":"MEUCIQCOAJ6AaHQaELHQFNDlhd/pRavWnNO+pynoQWOftisyRgIgKHJdiF2d4FX1tf4ch1AX+gxjykldn+fODq5d8dccU90=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgc7/PCRA9TVsSAnZWagAAVK4P/0xEFUUciLuVsRUmApM9\ntS5flNkGbRK0fVWNZ8WQvGmHBjsmcbL5qo96BC2uQ89piYIFptUFgbTofa3Q\nv9GxX4+01XPbQZuwRP0HTIINVzDzoiphDTWYPZeQdEoE/ak5vtmIqAYtyaPt\neT7NmTuqld/d/n7IJUD7RX935dK1CeAUqJ/HFDyACYAzTkj1eNsZyn+YEzej\n4SxA9XVsbyRPQ9nLVFi2lP4tRDHjcf8NN3skCHnCqjf4NnxgCiIIRj2HoWVf\nP2lg9yDctuDlvVUMgeZitFBuL478xoVvsTcchqgi+FgrZk9fYtlOlZs/4cKT\n3Kpv4NyHnn4ZXmYnERb1VIYZo45K5uGu41cfXBFM4gjV2/nSR7JbeEBXTec2\nwodq06XIbTXyZnUU6dy14hdgFWsJl2SI0fVQzfU/zylL0HLN/BYWFHKfIOZY\nqWTB6H0zSsd5kJufbASHeqlQZWwqoI440ys0iVapZ7SHibBuYfbjNci2uSdF\na3+y5QZ48qJFcPew8E8nFtiFqNA+FkK3zeiBG2mPf4kbcLB4AnraWWVkvLSD\nM6z7wGhFWKXSX6ILkBZ0eyeSLFcdPmeYchskBr2zhJbD1f4nJUtrOTs6XxpL\ncKSGoAPHkQcbTFpLmQJcXSKB7lQUy7yOMwJPj5V8Ez1lBhoC+wzv++i6rVrY\n/Rzt\r\n=yVtj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"71a16efb4a5249a5381c219cc8d0b6ed8b4687f3","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.49","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.65-renovate-non-major-71a16efb4a5249a5381c219cc8d0b6ed8b4687f3_1618198479219_0.9809219511906011","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.65":{"name":"@balena/jellyfish-metrics","version":"1.0.65","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.65","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"294cce5b3e7188a5215edad616680b119b25246f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.65.tgz","fileCount":15,"integrity":"sha512-b7PCCvK4ljjybKtGOxkzEHH7+NCkVMvzpI21/DJUWJ74EYjitOfJBRjvvkhlkz5R4JaV+li2fEEl+W8ctudpRg==","signatures":[{"sig":"MEQCIBLYp8Sw3rEi/Dqlxq4J8vyRbBGu6woRQRp1B3tmQRRsAiALZht/spSar6gqFSEglKSD6xwHDN7dz4k8Iuz/VrPplQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83942,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgc8CFCRA9TVsSAnZWagAAUpQP/is/w+wfhFjV19xFBOyF\n0WNi/XxTZ/chB9ECITC/ymN0amfsz0R9uarY28oSTCJMCNQpJbp3IOG1KBiD\nYk72PTSmj/BTBWc7mR14FiUnxZfm/q5IJDs1AEFsJSby0I1BUj7QB9hcn1LJ\nZarmkxlMlWy3rcCzxDEj8I0FdIUZNbyZQJ4q+sTV6bW/3/Gha6su5tgoimh8\ne01R6fzasfZmnLVfYMZxW+U27sWzlViJbvX25Wqczb38qpWew1Eep2ZNX8Ao\nA4Zv61+p+3UFDvtNCcBknooJzuyr2TkHn/Dn2vjVPs3jRrlIG+tMGLl1IRhc\nHK1T8+3Iwcz0e+nNjscPkVzZrhctKpLFpztbhJ65gOOeltOwQLkWan0GuZyd\n4tR0mYRVlJJ+w23K7m/L2acF0+/eAW9zF4g9+M5Z8FVrPLGq+gzJXc+CIy+W\nc1wSl598LNMdCkGyPJL7eKxT+a9yDu+SQpJyGR9n8JVHHEDp2wUYz5iji8Iy\n+t4Gj1BtOkvBeATsgPTG37ssrXZacaOeJ6xxv4bJZpF2tzPVAWF8sTI0CIaM\nrl/wSI289H/8NUT3gmvccGQHAa89C3Va0L2iGko5zzHyhT2Srir3bMQyJOhT\n+RnEFFUEzpVivVe4413z3BlZlGvrUWdHPHaUToEF7f0KGFg7WOXJTS+Eip0C\nxGWE\r\n=sRf8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"336d2df5855a6d229f4d2ea8b27fc2a897afd3ad","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.49","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.65_1618198661275_0.6769190842475787","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.66-renovate-non-major-ce324bfdaafb2573adcc4966b86235521ac73933":{"name":"@balena/jellyfish-metrics","version":"1.0.66-renovate-non-major-ce324bfdaafb2573adcc4966b86235521ac73933","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.66-renovate-non-major-ce324bfdaafb2573adcc4966b86235521ac73933","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c41f65326b4628c6f3dd1e5e16b28f7d6ef04f9e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.66-renovate-non-major-ce324bfdaafb2573adcc4966b86235521ac73933.tgz","fileCount":15,"integrity":"sha512-+tKnHdP3BzDdMDlsMZZkj/p66aKlatGLui8omzmnCHCUtRCgEZrSe0WML4DNkqVk3vX1LB2G4lI9dy6tj7tfTw==","signatures":[{"sig":"MEYCIQCSsXqDjZz9jUxg5x5pL9mWLXQs29usOuPTvQFFnewl6QIhAPrjSzZ6sGBGmH9btBSijZD6dujdThm/8K4idYusVNit","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84104,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgc9htCRA9TVsSAnZWagAAEG0P/iGAQFVgRaB9nxjJAHMf\nlhyyCMXNCdQwc6tO2kpRxcitbvaueqy0E8L4W0zZxks9/X+7YViV4Q5veq9r\nL64VtI5o1qzsAXaKZpQRDkOYXQbSiBWYR2ehMdm2YayTiJ1LyktUkpAsR4d5\nFnXXHMoAmtXJ5rSPGfZeFYfexhVUHs8dAY9NzVzSIAmy/YiRLAums+UkI8Oi\n1ziTUbDvqNFSuhEfAIjA20RzC+q6ntDJAGni3Trh9U1UgHXTgNgs4fL89LWN\nOTJN6A5neqVEIzKx1lOQAPyNI4MQ9tMZV98izDf1CV2nUXI/ONugVB8VAMBD\nA8YG5EratPoyMHE42OKr+Mja9r+A2feT8/swaq7qnmh9Uo1PZPhe7JdvpvZH\nCj76Rndtn+bTkh+dSCHFgz+Z5TnyGuVqwt4JOTpBhTIL+Mq5zavYDKsdD5LJ\nDno8KTGwGC6dzF+zkWJBE6i1FBmSkiMPHvO7+2l7su0Q8O+1mruXx8uMZqQH\nbSxBlMZuw1vasMCRNpbetmPITBY6094mCiHkF6qHELtEq8rVbCMYLcfEZ2cN\n5IwfvPN7er9ugUoT9A+gQLtUA8kq1vbs4suo+8m0Y17FFw/m5agnV0dc72sh\n7subnyNNmoqfzV1OfVwbM/fQmmWuOZzkCfEzvmi5QllGg31ygs7E3Dt/Xnrm\neL7s\r\n=Dsu/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ce324bfdaafb2573adcc4966b86235521ac73933","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.50","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.66-renovate-non-major-ce324bfdaafb2573adcc4966b86235521ac73933_1618204781081_0.1724792468058085","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.66":{"name":"@balena/jellyfish-metrics","version":"1.0.66","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.66","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ab3075f8e6ffd19e5b216e0d6c5364a1c15b82ef","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.66.tgz","fileCount":15,"integrity":"sha512-Owb2JLoN6//UwjV4nmrPxH/QXSn5S6fYCWXwrSla5LVE1W+108xlVEA3nHk76saTgsASJpbbBvuKvB+Ol6qFHQ==","signatures":[{"sig":"MEUCIDCFmMK4dnEiChgsKLwsIaeLw1UTCGEXiIGV7/KeYLmJAiEAyGGyk9kSry+Eqj4X7v1kXt1kqDC3BnPveOnajnc0dmk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84044,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgc9mDCRA9TVsSAnZWagAA0bMQAKP7cQ4ZdZ4pAn3soAtZ\n4RnpGTlxQiC15cUw+LVC99sMOrrq1euo7Re4srvgnb5Q3CspYucykqv0mbna\noMYcIaE6LmpulR1w/sHVuiyRRuM7B40PZob9bZkdHF++k+ipnGcNjzxF3sCd\nRQ2khTZuYGiE9iMXYtWEMHLGmL3qEHdVzIfDiEcPUWdajXJywofaOtTjcdwP\nadlb/D5c4PYB9c0wA0YuL8eWL/0N3GlUi+ddOEdCg38yI47Hm5Ero6kOuN4j\n6GcwGHkJYN/Bfyr6lqjioiJxTXMC9CmVpgh195Msyz4lJPYsZzreoX85WUGs\nsUlxSBuTpzyRPv9GDJHmNjNET95MXRkC6idZE5clComJpOqxA8hs/I5qieRr\n3SYqzBWMkxB/fTogqkkW3WLA9qDHo33SmEL+p9hkp6v6xDv+FJFzLT0ea4Rz\npdRqtdXT1zW+T2PzUuNSMeTlPOC2/PXLMQuHLIyKRHnzYwBlomwZl1ydCZFW\n55P6VXvwFIlpeMkk+4tvUK9+ylxHmCUCr5uH/MMyMRiFUTFeqrUgsNJ7I21/\nfSCPq05IhTY3jma7RdAlos6UJeP2tA5nCnBi+Gn/aM+qlPWnzpcwRB20RzTz\n9YUbacwpE7P741Fs/evo5J5Lllf9h/r54wf4g2/vWrG9gh5GoamZfcU7J91p\nxZh7\r\n=zmeh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"759e55fad05ccaf792e8c3b4ef5e78d54333ccde","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.50","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.66_1618205058379_0.5169130560093849","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.67-renovate-non-major-a58c3633b829dade9996c204aa0508eea6d838a9":{"name":"@balena/jellyfish-metrics","version":"1.0.67-renovate-non-major-a58c3633b829dade9996c204aa0508eea6d838a9","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.67-renovate-non-major-a58c3633b829dade9996c204aa0508eea6d838a9","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ae495e2ae0025ebe216cefc5375e0a332d74d63b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.67-renovate-non-major-a58c3633b829dade9996c204aa0508eea6d838a9.tgz","fileCount":15,"integrity":"sha512-tYTsd6EBvYCvfgQoTIALxtroDqeV8fh6vZuAayNIg6zNJmOphkh9Fog3mGV0G5CXJ9uEeVjbbRJsZqtKbZzLSA==","signatures":[{"sig":"MEUCIAe+McizkXRTElhGNLxEwG7rpbWXuZBiAMgtm08spIOLAiEAwbDMA/lsrK2+WUyrFLviIv4s5uKqF79ui2/jH9YU3rg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84206,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdA/sCRA9TVsSAnZWagAAuhgP/ial/Ikt8LlJuhUL+c04\nsLF3BB0Qm/01kM2Je3bXgI7ZuGyQpu/iEvhjq+jp2m92oHIJCQ2eeVfXTym7\npOfkEOKQKfmR5H6VAab+haXTZrUY2ZoLWgqxXiKEhIlbqiP9yGYYALXCuT2T\nbKKOcdsgbY17gScyJvHpwrYTj+mkm0KiKhZ4YiM4i1IceLq61t7iH2RPV1ss\nQDYrU0WNtuFXPkehsAr7FlbaEW43sp/JZCe6IYU+kNT3FlNrT4C9wyT7pkRr\n2FebYVWsgPbiJ+Y+ql0V1hX679y8JsQMSWJfkqUtyvqlxwdALd0sLAFWlNQ7\nW0DAnw5eOzZvJfeg9aoe6ceiQoM7TvkA/Q1zMIZ7sOA59aL35M4QPjUu6WCh\nJlj+3RIGAGigdWcMkPs9SPkmToOBgL+mho4+PwMNU5zjmHh8KTdzOtDSSpxc\n7JdfBU2dI1qfsXITGyLbi1Skh+RlkWWlPIFqOSivkfNeQfJio9LBtIadyIJE\n1EbV6DxjakyudwP6k6KEwj7AeUL/nrRSY5UlA2ZQv/JmhEi8NSf1A/74FZgi\n9Eu3rnQMQr0VJXzUzHqNChMv6e52F+fbnbgEk7qAGonZn+P9w2m1TohkJfPs\n22QdyifCQerEMkqMP14Qmml/7vMzI1PDhTzeCSGEtlcsCUB+xkrnFHJsOxPB\n9Apd\r\n=Sfi2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a58c3633b829dade9996c204aa0508eea6d838a9","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.51","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.67-renovate-non-major-a58c3633b829dade9996c204aa0508eea6d838a9_1618218987535_0.6215226912927785","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.67":{"name":"@balena/jellyfish-metrics","version":"1.0.67","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.67","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"045aad461dd85473a9cecc4e0c0e06e2972e7b9a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.67.tgz","fileCount":15,"integrity":"sha512-nh3DTGL2NRV5tR6E4dVpxAR8TlSOVhNOK8w/GEyX7iNpJasqNhUS+Y8fd9EWZql3d6oY3CqmKR0wyoyHvTUXJg==","signatures":[{"sig":"MEUCIQDpHMv98GxWXiwfXMNfFGu+uBeZTYHJCViddz0tTJa2ewIgU5uJswDJ8wiRdbLAkpf9QjdSMByMF10o2yutQF/FS3w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84146,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdBDFCRA9TVsSAnZWagAAuiQP/Rdv9ulSxhST+xXzRDem\nYu62WOtlQjCfuTtqme/ByciHsno+s4PZT8Fi10mZ0RRODizu4rbTdXMScvY3\nMV7QvbX3Bac/hh6koJ/+n+1CUDSSeKuT9EUTcjkTDlaEllZcCjCN7ITyBAfY\nE0Ln47bc1gCgm7FRDy5Sb5jc7Wi4rOzOEHC5MJDVipqtBcROzbCTGs2HUWRK\nG8ZfJUJCtoL/J/ajX8kdYnutNYBdHG6u3zQIia/oMommSEV7HjqNQpYA7UKv\n9NLu49lcplbrh/UOiW12E+chYf8BsS8jN6v4ehNPsWrtrd9TB/Cd4qu9ryI7\nh+t+IyNzdl88hYZOHdJkhhD2EUOVs5f1k1cm+SUjRa9AdayUYowu8r9jzTka\nr0QVotVTA6igXBJWBQgUtomfqS9Et10Tiptc0HQhmlpbmsAoEI9UQZ7bciWW\nYIQdBkpeF9NWS4ZlGZdlpmzMCAbgyA5oB7a5YWM6LiHRXf78V6/mgGDk9FM+\nDuTptLEgf/UnFEKbDochfaoMHkF8LPfvXc786kW1s2PJch5NOpCtushuDI96\nRhSrHEHIkxyVKn26J75l/Usd4iYtii+V+mO/pncY89B2rEg8Y/mex87HbMxy\nMjkWw+iAk9urDkYZ0TaBNzW/z96t+1lX8IKNrO/Ao2dov4IL6mxRimRHVf0D\njOsa\r\n=cgRX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"78370de254ffa59dc280318b2d15bea3faf44c3c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.51","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.67_1618219205396_0.6844658156252057","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.68-renovate-non-major-f9da01b2b7025722036aaf62103bac2c8af5d64f":{"name":"@balena/jellyfish-metrics","version":"1.0.68-renovate-non-major-f9da01b2b7025722036aaf62103bac2c8af5d64f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.68-renovate-non-major-f9da01b2b7025722036aaf62103bac2c8af5d64f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"85b1dd2e94e2a8ce9cc6918e74df9b946ded5f64","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.68-renovate-non-major-f9da01b2b7025722036aaf62103bac2c8af5d64f.tgz","fileCount":15,"integrity":"sha512-FKWzpI21zqzwN2OnOJhA6wFqb+TpycNqQApLgk8tEQNnP+MltiAQhkNFqssYLNmlpr0+r2x0q91sgIY7r3E9zg==","signatures":[{"sig":"MEQCIBENG/JbEWP9VwNtFH+lNJhtRuCOZE2OvezaRFoOrXomAiBqko1lPpSTNOC7gzkWR5lTBiXI0o5s/rcD/7VomB2OQw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84308,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdCfTCRA9TVsSAnZWagAAMIMP/jAuRjqJrAzb48tnq3i/\nmXGrsBjeHPvQP8ramB/DkeiL/RkW6HdyH2Pz6Wy4mrlaQKrMb+SHpziRNED9\nTi1fWrq/2U14Bz3OegXS0mzyNMlRPlzkjXUF5dzIROE3Vn9N+6eUwY0MCFq3\n3eswN1Cxg0SLDSNY3BBgKVw+ZzFV0FrtZleEpsnUcglOhIc7n3EbN0gMF9N3\nHhDxvQDqM3xLHOwydcMBfcaLotnQWfTLSQXzmnJT0oPwpR50bupz3NdIeKox\nrndH587kBz7A++6NSEe3IPbfI9gHmkRnrQzaljzCKlFRYUYwnicYpvc4cq7I\nh4e5O1vhr1yhGGZzIraXgA7ObujEvZ9KYtvQI2blEpRvsFdn4n/UTKvpS/cO\nTW2p2qRNDeeiPXbQPIvyIm7S24gu7AZw1USTEUlKIaxGGpXErRN/AJr9NGxl\ng5kn84+hiWoXzMKkX1GI9BlLfBU9nIXxh4ZPDM0U8axXvWTku4STS3Haw2Hb\nk7Bk1UlJGxkUnaWsJn/yA+ypvtVq6btHlgWKWB1X0mrGnES0G5J5W8I8HhAW\nYKsScSRPbbFunKMr+fog0QeIJI3QHk36SoML4y/v4qiYa6vI+Yk3e/NdAJvZ\n8TEeJX5YybY6G9dKagOvZY3jy85PvZWN1wIwbWc7OmTcWzOEqbfilMR1Upow\nFA4D\r\n=Gdk8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f9da01b2b7025722036aaf62103bac2c8af5d64f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.52","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.68-renovate-non-major-f9da01b2b7025722036aaf62103bac2c8af5d64f_1618225106527_0.6569938366145833","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.68":{"name":"@balena/jellyfish-metrics","version":"1.0.68","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.68","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"dfbc07d7dd130b1d17cfe9af1d81ed47bd4f56b7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.68.tgz","fileCount":15,"integrity":"sha512-tqJqKqTP9zwKud9OAlBiWfBIF9xrt/ZPNr5518Pz6GWp2uo0lQ+gFOJZogrF9PUwIdxrV54V8P2TZLm/Us3wUw==","signatures":[{"sig":"MEUCIAOAaTWdzvLcLHfpQ6HwKG6siXzdgiTO4AiQ1+MDwd5AAiEA4tdgyUIB3ejQn9/ZeaRScXh5xc64WU1L7D41ZKPx2ks=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84248,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdCimCRA9TVsSAnZWagAAfoQP/3etTdOqEjIFNqJnLc5x\nzf+sXsJFqx4BB5k0BPwkL3X1JgvNy4INBwduu6AvitlnxHe5/9Jl9aKP5tEv\nQRJb9in7nEjKWoais8SSsLam1fBtSX4JQdNKOHh6KTfgh0w3RQHSkYNlkDyq\nkxZ0XD7P4fKrGPIkhyRQreiq3xj1Evq8YSgvjl4qC8mNPOsC1McD0r2ZZgbz\n2VuSyc/nlORQ4S8SwH025oHbtcYgnlYUWO60ADs1TBwevCd3bKsDygOuO43u\nFJWY4xghTkwpsX7oaa68d/5tM2MFYYeQG7NLv/toSDSCoxq/1Dmv2rM3E+rP\nXrwV5lG2GM8Dv/Kr/LbVJeffgYtbsjKJvwNJOTnSQnsPN+5salrqYg+HlMyI\n/R0RGudodYuAHvRZ5rTzaJDywKjbsSIuW2FOane1y1eZDdCbsXZQAPOjQZUQ\n6DGSgtaWiemId4FZnccAdWzl3g7Jny7457Crd3VOKHkuFMHcfX/tUrCGe8wp\nyYlDd3nR4o4D3ULMaZhbbQyy4Ivp//gq1wT4zg6nMcEM+Q0hXb7RaoIHUgYD\nMXQBIOIIV3z4IIZXSXhAkV8dZZtgs82noOuCbiWOr6lMQg+6fMsqyACysjmc\n9UnuIJzWRDVwrNu2hdHbhcmkETIfNtoKM8exfK0JC2u+AlD9VkhaiGryi0Pt\nGeWx\r\n=begi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d8f9dea64a9ec5bc68631b0b2566106ada446e18","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.52","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.68_1618225317762_0.4718027993313234","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.69-renovate-non-major-bd81b3aad139c8dce8ecef9a231e587e889dbb79":{"name":"@balena/jellyfish-metrics","version":"1.0.69-renovate-non-major-bd81b3aad139c8dce8ecef9a231e587e889dbb79","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.69-renovate-non-major-bd81b3aad139c8dce8ecef9a231e587e889dbb79","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"444b87e3bf98099c7782617d52254c27b893f667","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.69-renovate-non-major-bd81b3aad139c8dce8ecef9a231e587e889dbb79.tgz","fileCount":15,"integrity":"sha512-cHUPZEowNHPbn638/UlAUCc6HdmfiiP+I2ui7o6IcVJHoiBHoNxAkGHX5f/mxCe3qkVR0NWZHZIiGaLar0lbsg==","signatures":[{"sig":"MEYCIQChHfO/iYbF6AIQ6zEf9zusqINIWpSzlJN6OkWEVzTL0gIhAKxokLUQVqRWAyEZ9LJijrp5YKIzDXYeImfezrgiA5np","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84410,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdDtVCRA9TVsSAnZWagAA7mkP/08LQm7sFYRnXNZBdVGH\nXnv49E3ysrGufFimTP8jot0EXSEL16HY00/jHuDgvoAkeebQdPtgYdDjnpaC\nX/VhiGgVf7eOHXQbD1ghp4PZQ4IXLaFOD0V0zVE6F+gPnrXD1z6bq3q7tFxk\n2PCgk+SPkr9D5SO+lWTyvp8aD2O0ec7ojfBLL7iB8qMBJP735O8nBlPabPQa\nshEr+tTNH+1IoppGPtGsLDzAoDklsYszFEbT7WfKktla7kcf97ZPnjXukelJ\nawQJKuc6cm04AzkEHhmLqhYG/mxLJpxRbxEiL934pTUSIblmewzNPywTSwmh\n4DbmK7PhQeoLpyD7pEpvVB3/SSIs6judzBQ96w9+7jAd7kP93mvT8yUEPVHm\n/XQjYkxBhWhn7Sdc9rCXerF8hT9e3+ada2rn9auCzenj/ADbNSVx2J2ncX9H\nIcHNBmg2+fPs4Vb4aIk8bNZ9jLEJxjB22x0TLl4a1mg8yvzWbYpQ/bqOrYbP\nGxmou/x9h7xIcL7XWj04XiGolNxkc+4tZhjt7h19DgALARUuwOb5iK0MQNEm\naEAKXkQh4J5mg6u+KXIVevStxebDyIGhbEd8r6OSLIZrU3nJt5KnlQUsB6uM\nVFiQF332Th5mk1KBHR33Cf+yFrnF86VqY34KUa1uEUDNGoaIupOY5ktPKKtd\n5Q+n\r\n=YQ72\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"bd81b3aad139c8dce8ecef9a231e587e889dbb79","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.53","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.69-renovate-non-major-bd81b3aad139c8dce8ecef9a231e587e889dbb79_1618230101229_0.5117616348380509","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.69":{"name":"@balena/jellyfish-metrics","version":"1.0.69","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.69","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d6df49444537e2a3ed0a555451adc860f3c8d46e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.69.tgz","fileCount":15,"integrity":"sha512-gJ/muGBitxpESfJvVtxiAqSXfzRGLWgHj+kXfAEh7RzKLt5orBSrAGuk8M48q/YZ/WNWuUuxUQQarJdFXeCmsA==","signatures":[{"sig":"MEUCIQDZJTSsv7tJJDk+nMk6K3KHqmCBsycslykkYBJYrOXTPAIgUaBLN+Dn3V6z7TAnZzmqjg7ULdegEkQ3SldDwqq/04k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84350,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdDwzCRA9TVsSAnZWagAAVqkP/iU+CRqQAWRdhD9weHZO\n9tywJ4NYf33jV+oZfRNjIKXE4dGzSoLcgIUuunjg0c/Cnt5t/v5ZadJIEg5C\nZ9gMxm8me5/snwrL/E/eJRzvt4jbbHCz313bERYzqJ9xjO2E7zURRxdIZyA7\nXJUSenUwR0S6aplWDoT5wqToycEiUeLezUbzy0eDe9ruacsLt4ezn6kJFSxg\nGhbOTmhnGvjtU+h8ypEyNvvNIHRXRJUmQifbbdNXwbYady0b05o6rme58VYg\nVRiqBWH9iB/i4li4slLTZO+BoJmWLPgZ5sgaQed1i0UVCKSEncZR3Uh6R5Wa\nFni1FnIJSTBIq4Fjt5kcwcDGcGbJGVPHuDoBefcP4hkHrARK8IIpu2eVpUsf\nQszCYtqBN1GOjvekS26g2RDn0drYdQtpuETsFVrij9TwXioX7HVkMfg5gAKS\nDl7Wizz7btDUW4ftCGWohEwmPsGokFtr9px7TlFGPtDNbOrNibBXNcUteyG8\n6fwuKudXYpkrcSYocHyyym2KdtO2RyaumjoccI9w3ltgrvqI+ok+CITO7T3E\nRj3hFZZ7NRhS3YniXsbbrlN3os4APkza4sv5TQe+iZmVG62lyNgn1t45p5Y0\nPUml95hWdR6sZKOHFKajJsdODHGBG7RYMVKMTrA6HilQELXFl0VAtlG1z3kv\nA6Iw\r\n=NuvB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"87b4327e39cef88cb82f6d8398501f30a6e7b40b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.53","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.69_1618230322989_0.8956286068317576","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.70-renovate-non-major-b4fb5e0f6ff2ca4013489bb1fd94a7d7ba79786a":{"name":"@balena/jellyfish-metrics","version":"1.0.70-renovate-non-major-b4fb5e0f6ff2ca4013489bb1fd94a7d7ba79786a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.70-renovate-non-major-b4fb5e0f6ff2ca4013489bb1fd94a7d7ba79786a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"132037940726d9227d2d2063efc01c147c3751a3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.70-renovate-non-major-b4fb5e0f6ff2ca4013489bb1fd94a7d7ba79786a.tgz","fileCount":15,"integrity":"sha512-CuonOsQqzd6Fxdmi0sCsOPTKPdUFVa3Nn0FdPin0t47t1RUbQn85SVBowhDB7A7DFvLz7lSpuTLkHV+NcEVUHA==","signatures":[{"sig":"MEUCIHeHHPVW1kVCqeurxXdVGAOh3Yyv043kbuvu2JQ26Y7iAiEAiJprfoQTORAMEMWQdMad0q9Q0LlctUXhokJHCH5CgMM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84512,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdHkzCRA9TVsSAnZWagAALugP/2HPvfBjGr9HiRydhpc8\n3qZewM+J661T26BC8YM6XNNXa3P1vR1/KG0TPXHpkQR7y0BZ/wNpEnq3bInA\nsnIbhLj8/cXQ5WjJbZcP3swYrAF0N3szfTTmkxsoUkjb9xyWetuRQeo8SnZW\nYcOBbHyo2i39ChbPI/fHBr2o10/o1TSr3Wf3ML6ouqoypm15CJQyXajbHioG\nUGSsvIjy/ZyPm7u2Ef+EgDfZx6EqiRJzbzJUjkba0eAaBD/+IArM/pEPWKxa\nbkQgSAAEQCDRrhwLioP8yRIH74Cqmj/Kqde4G8QmdW/G/bLe+dziZCi0gGdM\nxesbZ3sIVbdsRYIUEmPKu5JnXChD0NF1bF3hxlAsHlZvh8jogDipp326XFft\ne8vv7lUK0WaWE7aUZVjdxcbYIps9YkuirFTY+KLseOsEgbxmutq9Smw7wPeH\n1fb5DNtfapJk5k/rI7K1NISO1gjlRJYkR2U2yPB5xU7/yWohNgNi6ghanKzO\nymxFH1B7GZ6HEY44oYJTit/2s8xuMJEX4Q4wm6cSyaXR0PVbnTcTJPoTOLzc\nkOMC2HnsBBMr7uzfZso70u6KWz3MApOwdmlhnb7PH7a412tR7bpEPyEqUtNs\ncPlq1UfnO+CF1gH2oMHNRU2WS3OYhb4t+Zb1qfdkhyTEdII861olwsKs7OcC\nJqoM\r\n=F22G\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b4fb5e0f6ff2ca4013489bb1fd94a7d7ba79786a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.54","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.70-renovate-non-major-b4fb5e0f6ff2ca4013489bb1fd94a7d7ba79786a_1618245938791_0.9349064754074472","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.70":{"name":"@balena/jellyfish-metrics","version":"1.0.70","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.70","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c2852046bb99c5fe8ba7a3163b9c23df3c7f5cb6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.70.tgz","fileCount":15,"integrity":"sha512-URxolcdEBVw3lGQne3DWz8Z03XjT/yDEk46RBhw5PF5LiMTNKymHB3Na4Bg5LGsjJDqEtvaBKaAngI2XUOS9JA==","signatures":[{"sig":"MEUCIEiZGtOTv7C1mIF2K8GbIHyCeLw9A0j8Zco1+ySFvKBUAiEAmQSxcGwzo9e2y1zhAe/XoNOVSCdlc2yEdmotokBf2n4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdHoLCRA9TVsSAnZWagAAB5EP/2UlM9GBD3UW+gVwFXzx\n4gvyKbiNWj7o8zcPlTwCfkbyZgp3bI4s2Cr0i0ggFnZMHAA0B9u6ygzDnseX\nS1ppBSWzrUJk7dlL8df2sj0XBKZRrxfzKYMCLgRt6ORHNS/NvMDo5MRES2AX\n4YlFX2+MQFzQWKXq//HRm+SOG5Ro68pCXTUI1kVjlxH9YOzyHbn6fQzSg6q6\n62boPPNLlkHFAcR/3bpFY1HmDet8I9w5K5JwJ/V3gzz4FFDGoFlxleh/YpOx\n/kGei4QxQi7vQpRV2zcfL9Z3hP9G0pOMr0OLH/wi8VTd00ke10/XsbEx8hFk\nJhCzOciCHFikMHi4PLlex9Q0LAOKKYHs4hPfFYir82Nbs6C9iQwcqlWr0yAM\nqCYW/Vj2BX03v2dRnfxMYj0Jsy675QvUyh7ryUCarWI2j/iY9WZ+M95Js1wQ\nStH3rBk04Pq1eDEg9OJqWSWjc6SeE4TubO75gQLPmrukCrezlPbeCq0yAIxZ\n5l1s6uCGbwPcC6CV4auH+ZNbCvUHt8KwcDcRdHbdfQMgGn3DizW2fQeI388y\nFYO+MlYZ1OITVWXZTvm6CNOwhEGrd1Hzg8wyvmcSYtFQEoyPpsXZ+Wbznkyn\n+O3xJabPbng/KmKa7r9toM413siefAmBC3lhIxLLynDRm12+oA9jZkcAwL0G\nSS6Q\r\n=FCd9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"64091a409202fa38b999dc480e3979562f2c0978","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.54","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.70_1618246154789_0.27186408638521375","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.71-renovate-non-major-a3e130be3e62f864e83ec30e19a53443a5e68bfe":{"name":"@balena/jellyfish-metrics","version":"1.0.71-renovate-non-major-a3e130be3e62f864e83ec30e19a53443a5e68bfe","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.71-renovate-non-major-a3e130be3e62f864e83ec30e19a53443a5e68bfe","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2cc79e66952156321d6c4f0ba272fc409f7b7bcb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.71-renovate-non-major-a3e130be3e62f864e83ec30e19a53443a5e68bfe.tgz","fileCount":15,"integrity":"sha512-W0A8ijP+X5zNQXtPjXEi47LzgfYUuPHLIBjbwpDpXBcniWwu6Sg7Vp4draPLEeEHiBFfbly7CgQ7PHx6KBuOvQ==","signatures":[{"sig":"MEYCIQDn7q1IZm3GreCywWR/sPVDuZTVO0GviCxeMin8F+uvnQIhAIgwtk5Wa/SjroQz3bWb49Tvt++QS65Qdrg2kvjMOqUk","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84614,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdJbICRA9TVsSAnZWagAAMHcP/A1C5c56zHkpQJTp1jE9\nobRwqRC8WRIWF/CoxOVEAUGb/vMLB8phSZzNVqcXZCoR7HZwQkM/Ch+QF93k\nyQgyXRL1HBif+JYqva1S7xzQCrTorGCX99OXnvezDza5Ip/txfLpZPtJQ88Y\nqaSPpFWHQh9yB05KDQvS6rjKPPMe2057YqfDagEQV8ArjfrApGAh7ByYoM1F\nGThqQRdOAhsZR4v4fQDZA2Bup9/Rq6b17hOh1JY3H5QOhalqFW3WyTEgWUWc\n/Dmbb/Rj17w3kSGzMRzMVfYUs89DwRajQxt9lc2Cb/Kq9Bf2Np+tQh/5gnTm\nkJ6uNeTaIyjn2WHzZH7NO8mhVM3rUyRec1o14EkoYAkJavH5HeM+grVxTx8i\ndurwxEHU2cTal944E/BoZSCpcPguZYVgGxhYNsaDCaWvV4bWlaaVR2NegsTU\n8DzhgtEd+EAoX9q+RjLEGoika6jWKoKDT58dzBAGGIQ15DaaBuIOtONzy9lP\n2gmX7ukyQtNk0p29olqmamtSB+I5R0468yEAFq8L4gSFvh1PTN7Muhy18NFt\nGuSOsvcT6p+mWhvM+m8NY7M6PefmfzbEeBpw74YekjioKfbhCdR+J76MaNWJ\nnzIzKtZkeWiApjF3wqs0DSajUhyhEQo8qGHXh0oQEyVqZg+/Fvpy2IkSAlyW\nL+rq\r\n=qL08\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a3e130be3e62f864e83ec30e19a53443a5e68bfe","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.55","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.71-renovate-non-major-a3e130be3e62f864e83ec30e19a53443a5e68bfe_1618253511900_0.3643755775218387","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.71":{"name":"@balena/jellyfish-metrics","version":"1.0.71","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.71","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"03238f97da2bfd9f3c0dd872e755edc52d9a338f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.71.tgz","fileCount":15,"integrity":"sha512-1VZInBfpO+zUxYaTYoU2BG9KIUt4NcspvX09TaxhGZq9P5gdohYLUuneOaqBCpWI3HpriobvzEhK/bHhjpMqMg==","signatures":[{"sig":"MEUCIQC3rJqYKfd9550dHuexM8LYQMAYUftIH6CYb/es82H3MQIgAOvq5guo6Y4O9L7bce5rLhxdHcsUsZOF4YXl01FAbf4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84554,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdJitCRA9TVsSAnZWagAA8pwP/1x09mbAPPI0g+QQqfbE\nKXMphmiPLKu4loeCY6r+yN7iAv5bEymHtT4NYMiNHszMDpY0pIQsjzKcKs2G\nP1RO5UOx0EA/c+i3edruRoRupOqHGOGvayqxH/kEsR+808AL2JTNCVqx+Mfa\na43qkNkgMkgQK4gMXJz4dtNjpHZ8qkKykRF7UuaJEiZWRpwJHxSKoOApTCE0\nlxEIGeSbPngaWURaGZ911sr0DX00K50cUHNGT6w2O70AyR12NCfKVNc2gClq\nObX4Fc19S1LukUPs+wjm25SM1WyxMKoIcGzrNkjsoBIG7VwTzRN1FOY74Jbk\nZP4KtN8OgoitlxxqY4pJVTv1i+wISjZrd73xA7VujVcvTvX41Sqd/mg6P+CH\nxDRloj5ZEA4TT0KhH9ym19Jts0GAZ6YL7RFvMFe4PvasQHOUZ3NqcsOBl2Yd\n3XNqQ4PrbnMs4oufueaZdNCjeZr+nszoMtjTVMFLwC3aXOPe2s/uk6GKyzgu\nLjkFTDPBg2yTa67timtb0rYDpSc6MiFKpOfSVJ7M0zOAVc3dwWqWDunLwGUr\nkSoGbzErr9RJIlNQTOS2bnXpNAfQ39jfOL/T2N92SBJ2Uf1HmRAvEfVOl4F2\nGJGGMO5qwhVpBH3p65sOtpOQT6HFdmHjNwYbOGbHhSnbw0sphznfkEUbvQSA\n9/EA\r\n=wtUv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"cdb5336b93b2bc0cdc374ff6dc05d8563e3ce576","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.55","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.71_1618253997226_0.40058538027565893","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.72-renovate-non-major-522a4b48e4e8a71f86b07b9dbc409beaa5acfd2e":{"name":"@balena/jellyfish-metrics","version":"1.0.72-renovate-non-major-522a4b48e4e8a71f86b07b9dbc409beaa5acfd2e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.72-renovate-non-major-522a4b48e4e8a71f86b07b9dbc409beaa5acfd2e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7e2dd6fc2d1602a05fb3ba5b1fd871d2033a6459","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.72-renovate-non-major-522a4b48e4e8a71f86b07b9dbc409beaa5acfd2e.tgz","fileCount":15,"integrity":"sha512-Simi2ObuaTse+wptmNQFsndAV7vcKoku4/G1aV367QxWqoPhbMr8X04hOf2mgY+qrNk4QFfylOe2w1wXnHMF/Q==","signatures":[{"sig":"MEUCIQCxW6m7irrBHcRe0ugzaQaycjo78JolQl8VesgUANzj1gIgcgjiBnJ13ydQLdk42SYxJevAjQMUfH2XFsqe/bGj+nw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84716,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdKjNCRA9TVsSAnZWagAAkOUP/3O1La9577F+dMuJQ6j/\nzJzbhtyVcHx7dNHjp6jrcDzH5yFAvsKm7cxJGYing0xP5O+qpMYFy9DszvfV\noJoCu/k3Y5ZVHw4t2h9kmwPotemO/zZdCgQmmnhWOgvmnlELxApF2MGZYRqL\ntrMCSiu5ZMgGmvQVqRv4LrQPGA4yzVwnMsTkx4mfXImQ+bffKVs8VXzpgsz2\nlu/q01GU6Hnakr7W0FTt1L1rU9UcWsR9YPKMLK7F49VehL5wJcwb6bZ/i207\n+bcGdOce+QuWO89zx2f57lf99+Yg902d0q5zyHpZf5aC+pkEkF0lni5xlGuW\nW8ZmIHgGzjtRxgi1RAici3J0XEh4MTGmIU17hLQGrGM8xksY2Fy3F/vBKWaC\nk8cWP3Ud56NizzNV4iJh9JUUE9apmDHTNWKHlvs89wucqm9xlTq+bxAbBGet\nm+bqw40VONx7B6mnlrD7hzLaAzlyUR0kbMrutn2jkZ7TLAbdKNaX4IGUVRV5\nuE/d99KXdfAD7ZDDqD3kcK7lGOwbTK4nu7XBqOczJcfd+MVjQ1FttMemz9z9\ngUV4k3TfMjhoBNgDE/0vQeS8asuANejmcYJBsCwKKoA1rYo/QsxNmm2KUwFd\nh5nbhX7kFApMe115nhX1OijXFsRhevM9sHF8iLAqDzx6fkzXS6UrrsOINdIo\n9Z61\r\n=/khh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"522a4b48e4e8a71f86b07b9dbc409beaa5acfd2e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.56","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.72-renovate-non-major-522a4b48e4e8a71f86b07b9dbc409beaa5acfd2e_1618258124616_0.9479559715016359","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.72":{"name":"@balena/jellyfish-metrics","version":"1.0.72","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.72","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"92bfdfaef39d6161a98c3df96ede21b2101c8672","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.72.tgz","fileCount":15,"integrity":"sha512-oEd5p09mBGvY6g1hbpNK26okMZmxrYdkU8EIu6MyIMMyG3CbJpKmjki2DudM3RsUXIsnk0BWUaTbc19IofoOoA==","signatures":[{"sig":"MEUCIQDS8fHQ0Icnsp6nBJSrjW8UacL+Kp7Ix+GlMbZwo3thTQIgIBtOCzTju5r1d6mJ3VLWfrB/q9GjQjEszyT7FMALI7Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84656,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdKoSCRA9TVsSAnZWagAA7TkQAImdbx2WJDQJUWsx8P1e\ntqBqu+bcFoyXSyuo64O7sA71m1MEQ+pEmzm6CCzIZLdCNJ6TyR7EJtBoqwlP\nFx/my/s+Fr1rxmgNUeFDk+9U1CmT+uFwzu8yL3adm86F7IZhOdHWBspgqNe8\ngzhVNK1WSa1pDx+Uz4exWEkPnxesoWuVe7oxDAQIvz8FXY+r6kJlGanK6/ib\nzyP4j2B42jPVz5Ez5Do7q5+aO/kvPCD2Z9YQWxkCuRKA8ip735H4Sku0mkFg\nFMMTmWQyMfaPn+Nr9JWSbI/+UguOaFsECPSe4aUQ5cQCpqpmXhm6HsDQ3koA\nh2B74B3i8h7AJzlbEjHl1QYFU6s7wNREj8bf/UlLnbBdhVM786WAuQeJuT9o\nw2krN0PVRLFWhky2zjWYtDzCQIkOG/p9sR7r6XSLiFv/QYhSQyPYyJ6jGWiZ\nvlqQUJM9PBuvf/KnrbeJsyTt0iGzQf/TxN+ZasLOIf71VInppUEu4NTf+KMg\nEVg5UEwFmLdl5S/4L5WdpBEE7kumLaKLv4gbdbM6h1jIbxeWu5R5qUo68eBu\nY0RiL5pDHSUJ/hQB6uFoutu731hidUyz34cNPvpCeiy0pKjx3bEwBs5cuoSt\nMGTLoFLOLuVUzokLJhP9+QohbFXT8eU2/M63L9jxUccjjYbAy86t+t0vi+Qw\nziv7\r\n=8azQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d95321b2ee731418cb7aeb9b9b418a1effbfd59c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.56","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.72_1618258450052_0.8101620992834793","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.73-renovate-non-major-98e023ac5baeef9d84885b997e0626e482ec04ed":{"name":"@balena/jellyfish-metrics","version":"1.0.73-renovate-non-major-98e023ac5baeef9d84885b997e0626e482ec04ed","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.73-renovate-non-major-98e023ac5baeef9d84885b997e0626e482ec04ed","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"80c712e4e802371de0f3d187555dccd21805bc6f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.73-renovate-non-major-98e023ac5baeef9d84885b997e0626e482ec04ed.tgz","fileCount":15,"integrity":"sha512-vVXP4zsTrMmBJ7kJEOyPOq35XRLI2vIiyuizaYLG1wT1mXY7eGmuS39LSjHgkRe/rw4DY8f6bl9iZqWtOMliKQ==","signatures":[{"sig":"MEUCIGgFtGSsleVFDg+V5kd7fbfCDE4lzvVecGya6neFSVNTAiEA2cCyr7pCu0JJ2iPEO24JPb0835a3eD9+mjAn8/KAs94=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84818,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdNAGCRA9TVsSAnZWagAAAO0P/iQrrqq+W0BhD8+EWgfu\n94xHgOtGeSAxUPAZCUfgAP9ZWJFsJvEIUNLgYwHrIkrrES6omdZZAdhCOZyE\nTRPEf47C6/zIiflQeVzMk4jkERslObRcxNeP3L/XJnrALymZ/r565Xgo10oQ\nW0C/gFl5DYvpD/6P+Yecneb3xgzkn7ThByun14tW5wabSKJUQwth72TvGfIJ\n5kiSbGQJNtM2b9/Vcbs0qSzXnY+jCMP51erkBFO//ixqkkfmxTV8Fupp45c2\n/PEb5vo60/Xszg6ic4DltG4NwXsRPpyUXK6xpfz0ZhYDCkEiLKP5A4MyMWkO\ndBlGAyNRuImpnyljLab8qdyAy0fPHKX8HZuPK/FO2U6PWrHYbYuYrhqUxSS0\nxt+xK5ogUH90i1mNWi7XTGBBRNa/3K2bW7qZsbUgJZbRq79LqXCJPVD/ySRq\noGSOjhdbzu4y5RXEske8ihVnqb1slG9TUJzaxZlz53DU0OU2k46fsxV0vA5D\nOD3UMhOE6YSZqrkjYpuyP2agnDkKdtidswJAwfzIpgEUpcRNmTl0w17nJNnR\nTVH8wbGhUMqVsLAcsxMVWGL+/hrvRB7A751HolmakRZM0iLjfjpJELFrPsmW\nMpZLQPCrilv8aN020O+NEVUA/QeFkvtTClY+LQXecMN81gPGyRNcjnb645H5\nao6u\r\n=Q2rl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"98e023ac5baeef9d84885b997e0626e482ec04ed","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.57","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.73-renovate-non-major-98e023ac5baeef9d84885b997e0626e482ec04ed_1618268165517_0.37490304628817617","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.73":{"name":"@balena/jellyfish-metrics","version":"1.0.73","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.73","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7060632181c2e6a77092abe80b6956b1a8b4223a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.73.tgz","fileCount":15,"integrity":"sha512-Ob9VdgtzcK+iduamzcy4U+tbsOK9JKUnOP1bEikZqKqSf3sqIJw4ImkzPE+VsR1id/6uDTVphJYbFsmnS4ccXw==","signatures":[{"sig":"MEUCIQDIaF1U3WfZu0gLScNbhK8ZkWiNmyM/cKF2cB3XjuB+7gIgaH7/9C4yMAn+4bPJPCFbXIjvxRryGmMppaelpWn/pfs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84758,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdNEECRA9TVsSAnZWagAA9p0P/iyF6wRxJk49BKnuUIlR\nv1VhB1qkQMfkJusWAXRdXFQAU7Kt52rZm3TxUY9vhe41i6lMaWYEk2p+bslL\nUXum79YO2S+Dsj+bdv9uGrXbtjqq0Wj379IaFJie5ZHGqlDdgiuKaUyGiQxk\nb5kLaz5ayK8NjsAt7s+VpDxLHWG/T0oJ7Og5K1tfApkevRWolWMGgtFwXEqM\nTH55O5ECgHy3Sludj/VxAbALi5xoZlss3m9lRg8EY60cYirWCgBfqmIJjfDT\nViqeh1OETXvj2VrERpqC4uT0IBqU7b4ASYEl5E+L8eA9orTpWlcC16gx51t6\n7SiCxWyhumoY+vDGmyFeNokkRscVssiKBSakA3udN1sA88OOyTQscw2DcOW+\nbxfp2ublpA6M8x6iywUaHdSvqSycPlGEcyRBZpX52gcT3ZI5kuASNFtWW2Rc\nPZg7O/QnrZw4jXxOrvYlFwG2CO94YtndhldM4P8AVYcfxjW0WUEkh5E7kHr7\njN4uo9dTUpFaewkc1clMhxUZgqza14GyX4+5lt3rArg4YzlF0SP/EPfgdaUJ\nctU1Um16e2UM8PXJVPhR0XuRh5th8lrRDoMRXrijbJTMo7yz/83g0Xxa3S+I\nQ2w0wfIuqUxBhuFH2PhgakcOlGef6ojBmM5WsGfhfL4vYVTbAOs+X1ziqQKT\nG0z3\r\n=xTBq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"943f1a1f64c45563670418daa80112fa7f28d610","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.57","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.73_1618268420281_0.5596810547887037","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.74-renovate-non-major-ac2ad24e65e943755028a10f99b4d086d38dbb8d":{"name":"@balena/jellyfish-metrics","version":"1.0.74-renovate-non-major-ac2ad24e65e943755028a10f99b4d086d38dbb8d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.74-renovate-non-major-ac2ad24e65e943755028a10f99b4d086d38dbb8d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"aac1ce347de42bcc7a120737d529fdafafd313a4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.74-renovate-non-major-ac2ad24e65e943755028a10f99b4d086d38dbb8d.tgz","fileCount":15,"integrity":"sha512-VwVxylO7SCfAMGzyHYYefpJjiVdPqo5g56ztPbV59HGZQtmv4w6CQclSvR7UJm9tOSQTRer/LZtLvhHiysUEvA==","signatures":[{"sig":"MEUCIQDOh4rTgYIawAJmGTgnEnLuaEYjLb3KHb47Kr8zIgBpYwIgJS9RHJg1rDM1kqcdx7OB1jYzSaCMvwlyPBTokVlMJEE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84920,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdUjhCRA9TVsSAnZWagAAkloP/Re6akmIsTy9XxkuJGZA\nm7qtxUoLncYwzyCyxEqRWgT7FH9MoD0pKKh/3zsyyy64JgUEOj4LV6cGlhik\nYCNoSUEG2R29IcdQmtTtjUdwd/oSS8oS4SDYTqU9RXjDmdNaSmV24IGo4n9d\nnbZAOZf753JQEhJzgchht+KvvlqZPJXbahON4fGdLq0elF2PqnsoGlhjx07t\n63/hXAzNawG93rO4D2pEKXgBLq0zZtlVzXgp2VhHYgkSsIr57sZTV/P95mPr\nFFw10kVfQRzC3FZPTsYdPxIvp2QXbzIwwxCe5snyMaXb1FhPmMYiKqsSuXXE\nr4YKTbI9FyNrWnXme3Pgw1m+v8fSSD2eWZ3dOU7Ra1bACvu9zQXk0RwSJXmV\nwVwNWMzIcYBdBLIYoADPkxEZKODMeGn9DcJtguVtTHOQQlFiQ4CEbY/Yse1g\nCX4hpaOMH5b0Sg81Jy7XlWNp3bWuPt35YmQmio8jPXnwMq6QFG+E5SagUfpT\n+k3tG709Th+RQROAP7Z5iFe45qg166uzm4UzOIHeqpTapgf6Uqcy4e4r5icG\nlwTv2gI69pze6HnDkTI5fr8KasUqPkpaJTJJH03U72Aw6ek055Pe7sbgzuRJ\nF4EZTCWyrqu3U5ldIUcRNYs3Tz+YfstjNw+VSwOoVEROmsJzsatDBTgVin4s\nQnps\r\n=tnj6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ac2ad24e65e943755028a10f99b4d086d38dbb8d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.59","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.74-renovate-non-major-ac2ad24e65e943755028a10f99b4d086d38dbb8d_1618299104597_0.4092474086064495","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.74":{"name":"@balena/jellyfish-metrics","version":"1.0.74","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.74","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"433038eeee941cd52fb2245686535540eafb96a7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.74.tgz","fileCount":15,"integrity":"sha512-ysN7bpIYgp3FoRDFGuXgbynouJkkjIcWf2C0DixjgIa1gtiPo+3KGzi/gJaVRN+OJCuJ+I2SsqKWaONoM3fG2A==","signatures":[{"sig":"MEUCICaYxcsWyz0FfvUGY20oM1l+HJOg/GpvVY2O8BJjbClgAiEA2hKsFh8lHfW6ZNjYEvtSLqSnZafR9lszIrp9gHGpRPQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84860,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdUnPCRA9TVsSAnZWagAA0gsP/Al/jdqr/ZMANffqTRjx\n3WjrxUi2EQaTBLnbsOcBNEEvvO+v6b5ga8FN+6cZDLOT+XRUKRLxM1rqQFlQ\nx3Pzdz5HNSrS9VFYASSpJQoa83SJwEk6c4xoW3uUeqI2NxObpK3AMEqXWiiW\nq3lrbL8pmjY2EisodHI/K1gt8/PYV4tz4g3/6gMy6tFPdH5OxYvOri0LW/++\n+IuWNxzS/ET0l+7m7hsOkjfaG395Q+X9HVmmskVK0x1sf3nolSBgM8S89XF6\naNG/Ey/sU0IjyCi1QjEXfn7pE14yAG3tYxZT/kCPf7F06W1hW1eRo7ua5WpN\ne9yDb+SNT93b98I9+cUDayAUm9yZO88WOa7rtO2S6aQH9vGj4wT/a+O3frpc\n5s2y1jZVHoAVCum+78fELwKsJdMt2671fw5f9samUJueeLgqodoDv9ym78Te\nspl2BifcJMbr5Snn6yNh0m57S8itBejNd2eQXA5bjHV+/e28KjK0WT0RTI8j\nmi9BXk4wySXPUrWC0kbnCXCq+7ThMhmsJeYT6oYZt1azUNCkd7ODnSJ2uVjR\n971/B2jfrxuaVKAnsCy1u9YETK0TDanWcNuA5TzlNm0Ld0xe9Vvr9eVc5RmI\nAxOEKPM2nf36tfMTnawQOV+8QdyVRQQ7x5TKD2YQT3g+3neJgFDoLnS2Du2h\nyY1r\r\n=mDtB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c13d70d5596f295dc7cd63e299e88fbcff372630","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.59","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.74_1618299343305_0.36611851520807304","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.75-renovate-non-major-075229c0a28f5a86812797de307d60e2aa860c8f":{"name":"@balena/jellyfish-metrics","version":"1.0.75-renovate-non-major-075229c0a28f5a86812797de307d60e2aa860c8f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.75-renovate-non-major-075229c0a28f5a86812797de307d60e2aa860c8f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c09b7db9dc8f9f1cc91838ef0513b64321723b31","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.75-renovate-non-major-075229c0a28f5a86812797de307d60e2aa860c8f.tgz","fileCount":15,"integrity":"sha512-+vmGQFeZ6hfaPXC5xt9n2CNdYEXOTiyVLT2uZZo8jGlpw8UNujclGgPocJPT5Z7599wrvWIX6YApYP7fjd8GVg==","signatures":[{"sig":"MEQCIBrmp7Co+CCNicrt7KarVZffSjA1izKKYvosAaTDIwM/AiBROe2DuYt+3EoegRMlWJacgjHIgspedMMBqssXSLJ2dQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85022,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdWT4CRA9TVsSAnZWagAAWNsP/3qr9K/bVfiwiTHTCPXm\n821wNgZ2B23ksP6N6qGA6zJWE7GlQWz97p9ULmZK4SEa07R3dw/iGeOOlttM\nVeXLlRB6ShMQGCydnaHHhFYlS21Hxk/Ph0yLVj3ti6kM5itjs2fYto25C9/i\nRAw63hqN5xEFzilqmrXZRdu2wXj0cOQHeOh3VbTYHKWjHCHGw5pkj0vaULSt\n1vy8NeyDBL4zZUoqP+r6EfAV74YImQUxk8hamUZRjZoDDP1hoB73jkXZcha2\nPsY95jdcoMYs+OGPW98oTrDrBEzhQoOwxVX8EIyTi5nEeTLMO90o7qA5H5Ub\ncANRgiRnCMhbY2O2/A8wy8JBvYLbLCSlC+3QLNP3YmSWyG6wkJgjsQoVk3CR\nHTBq8S0g7l5wbsVZR4AS7KMl0jEpVpH32637b6qfZ4/7G5xHiWgYUWd498eB\nLg7r0W7Iqb/9KuNh+z8cFCI7oeQE3hQM1T7lxk9PlrLANdCDm4srMAphIWQC\nPlWdLAMO6+maoZ0kcyaF7OTz8uILTuZyZFTqdirA2NJc7dPJBHohJnzsTHnE\n6ufoOc6OwnusrUCNBqAgOU58wKFbQbD9NsGgqGuWKp4cQTQ0RR7LP563Pqgm\nkJBWAMNGGP3luTXO4CWnwRojVY0w2p4y7SH23aQRVv5H7xTebTYINvMWgtLf\nRQJO\r\n=fhOD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"075229c0a28f5a86812797de307d60e2aa860c8f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.60","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.75-renovate-non-major-075229c0a28f5a86812797de307d60e2aa860c8f_1618306296074_0.4903887175211832","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.75":{"name":"@balena/jellyfish-metrics","version":"1.0.75","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.75","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fda871899509eb996ffad3fcd3551972799e952c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.75.tgz","fileCount":15,"integrity":"sha512-Sfx2V4R+a8OBamVBOPwlJ5bBSQgRg5wXKyF/40Tej38NnUIj48w/BtmlBbhN5vTCGm8eGi5I8mhHA8tFpUZ7dQ==","signatures":[{"sig":"MEYCIQD1+vlhZ2/ufOqSQivCWJ682lECoFap/yABknAKXWZ3lAIhAIErjADKYwBeuyFiy7vXTXdF38xHFLsa8uF7KEfDnUpF","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84962,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdWX0CRA9TVsSAnZWagAAzvgQAJKrkQWoWW0VQOhjM7+o\nt8kWnvo2mmvubWoLjPPe6tkzDb/Rd0ClgmjiEzFUb7LlMzdEWgTUHy22qpSz\n9VKz5n82cE9y+/uUdUfAn4shCtyOmu0bvikQQnwJhkbALmI6gAeFg2GRvVWE\ngKb86qf5Mvp6l68lsJGdTVuePR17RP3F4Khq1JijdDnLQh4NzPdeFSYAQrfm\nsxo/2B1Q62Veo9rcvB3k0tcktTVIJsxb+irbrz+WSVBT0HrlLdPLaRd2pigs\nvcTJ1XjlOMrcLfNs2S+eQ01wXgrsIlMa1v2mJp72VevvDkItegYOkudRXRSe\nEsum68pOqAEF7KzwgYnciAgu8V5WSl3AZaWD77jQ04sS4gjawPqIO+GZMf6J\ne4xOoeBJ+RqrVSAvuSbUTjYy0RUklWwzASgX/YTdU/DSOsVhDk1Kn+AcrRjm\n8OKIrA7ihUATN6NgICKq0817HQMfVfI1lu9Dx232/sbqey3BeFFQsB5hcc8j\nPAzrfwDXqGapDi07I7xZ3RueEoW+YQNYbQEJnajVAbuGKszUoPhEMU326ktn\nW+MzHDvyVOb5jGuO7NrqrL0p+yvfmW83rh60KHdJiEECGNmtI9C8qQG6uU2f\nv7C3b2qor9gsCairKzClrZRBv8DWWRRgoQE7hO7F1rGTBRRpJTrsNo1fyKLL\nRfxS\r\n=GRFe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"eaa0b8175ddd59fbd7a48c5f0129fe7a1cf9a117","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.60","@balena/jellyfish-logger":"^2.1.24","@balena/jellyfish-environment":"^4.1.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.75_1618306547520_0.3976116715448301","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.76-renovate-non-major-8df6aa5ef08ed71fcb92719f43e91765174ef89e":{"name":"@balena/jellyfish-metrics","version":"1.0.76-renovate-non-major-8df6aa5ef08ed71fcb92719f43e91765174ef89e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.76-renovate-non-major-8df6aa5ef08ed71fcb92719f43e91765174ef89e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3869e0b1ebe169b0ad500d8e4bf0a671b4bf16bd","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.76-renovate-non-major-8df6aa5ef08ed71fcb92719f43e91765174ef89e.tgz","fileCount":15,"integrity":"sha512-q3Ht3jxf75hDBY67BMeuQSNg7F0a2+yrU/R+eKi15L5ldMvNgP4YgsAo2r+OBGzavPNgmFqE9d9YpEdnnrZVTQ==","signatures":[{"sig":"MEUCIQCLc5k0xi9oUowdvk7v4I1qwq91G1s0+MtiPsQ2z3dvtQIgZ5J7unD4mXoXwIg7nGEHiKvE7ojVPwChDd6ftJgRlWQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85088,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdkgTCRA9TVsSAnZWagAAKa0P/AvI2LCHPpjF9hE/CxN7\nDs2NzJThiYIXPDt4kDbsMf21l6aqYH60EFxqZs6jKqlMdQHDH+1KvU83/cEg\ncsOfc7opPCxgDrnSDWmtDhHs9qP45qW1GiqLG0/wmg6iihLvH/mcfv9S43Jl\nM5AXgJNwyhniuaxuIn04rS5dPHbHXN4c1UZde0kia4+7sL0S2eDlkHT9/uQB\nrOvsqNR8++zxysw8y8JSMJq/p3w/Zif2d8Dvocwa7JdGP5tUqUbptxo/F7dO\nd1ldEZWZE8LOdL3MOoNauJDXAz9hujWTbKEz63bhsP4qJ/GJEDlXp/ag2QLQ\nqjuTyMwVi7nl4jy8vXHHOoa7r2zcxGpbL/D+I3415zVYW0Uk0+edxZBW58Rb\nVxVdScThU6a6yO1zqUaQYdcVXuIwVEm391mjVjQMwLQbCdvBOYFbUf3qe09B\nhHhGzU1w1iUeHSP8i+7zLGGDQt8Y7MasA8W+iKjvPG6c3i0jJu/peai6druL\nt2xYt+Ssu9kk0P/LEeOX8Z5RfCWimqcuDYAugV0WkGrSligBd6Gh6vjN/7NX\nukfUuxIiodAP9M6BmsgGKejbPPSzpW0GxxtdvV2DjN0uwEAEiHbf0jmxhXTv\nCk1crL1tELU11xiQemARUOSw6ua3Q4av+MexlocJljciWqB5cbYtZ6aVcoXb\nhdyM\r\n=ovOB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8df6aa5ef08ed71fcb92719f43e91765174ef89e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.60","@balena/jellyfish-logger":"^2.1.25","@balena/jellyfish-environment":"^4.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.76-renovate-non-major-8df6aa5ef08ed71fcb92719f43e91765174ef89e_1618364435131_0.7483403598967997","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.76":{"name":"@balena/jellyfish-metrics","version":"1.0.76","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.76","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"df1e2442d0abd1f8181cbbff618bc1f215367d85","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.76.tgz","fileCount":15,"integrity":"sha512-kLWs5qIqW9BrZ38aLIBhSMbQhwOgW7yMMDhPFjwTnJ39/2NMXY2KrkDTMdWS9pyRmgreEhcXJ6DSzySX7ekZ5g==","signatures":[{"sig":"MEYCIQDKiMrLW2I5uRePr8XN25gc1ZIb0JtRMiRYfhYU5E7BoAIhANkxqnLsGFQmjEyP/IGaSg/VW+1nzb1lKtboJ8qy/LLD","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85028,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdkkECRA9TVsSAnZWagAACGsP/0rXqCczYirIcMF2xZpG\nU10cSEoRS+0XVfcGrbagL74VdT7cJrMUF19UVqeAIdI4S6hWb6T5wLkJZagt\nvbPWegWecnhvR8e+rtIDnp9Fy4fQPmSHsPZrnjUICwM56mhohY6LtQU45W+5\nfSZibYRuzc398U53udG6wWW6d9s8d4DJxHDzsV62LDRa/qpmHxIvTpb/mduz\nq6Hu9pZTb56YBYwaLHexl6rYADvQxR+8z9zYkhg6qYeHr0CmyPjUAvvL+j5w\nKtuPvHdDdRoubJeX/uccQ28zrJehDs5ZetpZOoE5JudDL96iAEqZoK2D5PNF\nizSQt6tiwIDWxXZW3NWaz0TDMUGcO/R840mKgP91FGbDEPbgkg5sJKHmrK0M\nQhGm81BDOuyAEr1arDXTb+u8EKt7XkflRZmg/SY/miWpZrkNiDO0Gx5p+MeV\nXk/16+D27+jmQNcnqwn70o+z/d7oiWqrTSJAenn89ejWu1opcyoPnSVeUOFK\ne4fI7YOjMXOD3HX4BsVd3ul2la1699FFzzAtIavmr8j+r5o37qamyunUOBs9\nd3EdWBQBwIcri9ZSC4jAUnpAYVsQzhqZh9EQkHwawgzTXj2/CQiMgx1OwDR0\n3f98czluWA8Y30X3yHgjaGnS9pZZA5Uhm5KF5m88MY6gIibdpLiOt4TCkINN\noKi9\r\n=3eVu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a43500f6ac9b03efc55189a9c9d9b060ddf4c531","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.60","@balena/jellyfish-logger":"^2.1.25","@balena/jellyfish-environment":"^4.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.76_1618364676323_0.4141703616356298","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.77-renovate-non-major-6693b4f3eea2b213062c58e52c0706f40b4cb4a0":{"name":"@balena/jellyfish-metrics","version":"1.0.77-renovate-non-major-6693b4f3eea2b213062c58e52c0706f40b4cb4a0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.77-renovate-non-major-6693b4f3eea2b213062c58e52c0706f40b4cb4a0","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cca8803211619fdc5079a56099efeeb6bebbdc23","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.77-renovate-non-major-6693b4f3eea2b213062c58e52c0706f40b4cb4a0.tgz","fileCount":15,"integrity":"sha512-uOW7izM/bWMVodTaCRjcDY/e8cOCbz/6wGChgYP/jPJLYTza5+F+GskfRwbUB/Z4WzOIZgAYoBQidEn/XejDKQ==","signatures":[{"sig":"MEUCIChTemSeidvIAKQHG4MoVY8+2mnULfK4b2WfkrgkvqDrAiEAwX99wWUZ66azdLxE3Cu3sHk4QCV/gFmm2PTxMLZCcd0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85190,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdmEPCRA9TVsSAnZWagAAY1sQAImcSrZRytl3og07FZG/\nDDLY03QvfPBaovGqbNn4Cp1rEBJMBeFZhEl6FPTewrqe4Hv+a2ljp5YG/+Gt\nxhmloKBGR/MD6KEf6s2XwUSKk0QV/OgXX5Lxz95g/teNkwdkioXtb6xazDFt\n2uQI1zrQtnIEp+SHkrInfBPpXXGMIWgMlTgdBO9dE7m9xQoxanahN4undVX/\n/HVjLvzPHL2ScUVPTJ0z0i+ShK439vN9lWlZQiZ02caE8Qfm2S5o5ugvcYN3\nTIhhrGiyk4YfQRHGlqDu1umREBMBqioz0wjEnyr5EO9aCU+h4QQALY2rDvfm\n5EAHV5uXJZ8B+LWoEQ8zYKs6YKQjSFDJpGO0auO9ebMH1Zn3VQ7mX4mQkS22\no13bFxFsPUp0CHESukna9tNW/ZTYJa49YeHsLxstfwW2SHyYCRZDzSGg0qE+\ngwK1Mg745EQ/LE4UuoJN1kUaIsiHgUQAKrfF5Gt3CmmIfRfbtql1lwN0Fdvq\nrg5IntXYhMmGu3FcUe1a2xKSSJmUS9p+erVtYS83xjErwawipdxI2O6q9Ong\nKPOLBasT5KLH1mBcuBzNmJm1pfgAhsVH++mGElgsXdf3Ivf3KqsK2vgpKMI6\nqcGmrF59NuxRsClJHeFAidUkqafzYuuRAtcJ2ZT/NtxXcojoAeYxi24R+syf\n1Qec\r\n=yOkT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6693b4f3eea2b213062c58e52c0706f40b4cb4a0","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.61","@balena/jellyfish-logger":"^2.1.25","@balena/jellyfish-environment":"^4.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.77-renovate-non-major-6693b4f3eea2b213062c58e52c0706f40b4cb4a0_1618370830692_0.48106332954223574","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.77":{"name":"@balena/jellyfish-metrics","version":"1.0.77","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.77","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7fe07ff2ae83dce899f22548d6e4d768775f577f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.77.tgz","fileCount":15,"integrity":"sha512-qNY3EMLLh0H9U399gAv+NyEVxt69DUC91GrOdMB+m73mZh022ixdphDdUCv1xmcjQWFiNi30yWVc9j8Mi2CEOA==","signatures":[{"sig":"MEUCIQCbPorKsiyUWb1Vn3Q5L2SrwN8smI+OFtrRjlpBXCRltQIgUmiXGv8t1PvSkcZtEOPZUYnoz7ksbxo72i2csuEcyV0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85130,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdmHWCRA9TVsSAnZWagAAqPsP/3SsehHoTrHexCb9wMLk\nBofm/d8ZJ/JK48LT4lx8N7D8PnYSfe+zuNVJn0a07uKH6yM920zCqCMy5i3R\n4zWhvHdpGxw26ZaGh6CK1AUxaECJVKMj9ZtNAYVDROfEXEqvAFRs9XA3ivcA\n2AV8sX6Ug5vvbMOtaCugfslkH47Hb2kMRPQg6zxe9zW2UXr3SiEc4JA7KrM5\n2McT8Ro9gRPFwDQk+kiVvThF4NEPRPWLvfRe5UlsZ8nYwcZpakEeyl+pJvQb\nSZ5NmUyR4QBmdlnu6E7X+Ywa5ahj9UMETULqTFv3mZXT7qiDs2hlEs6sAWAD\n5BnVaSQ5o/ld/4GrSCpUSL0xdo1Wfi7B6E+Rru9ViuIsy+nNpyaKALDVlSCK\nZgZEqn7jsoDOuzJOhe+MY7E78G9UeXSXqWn52UEktj9b27V+RuTCU6kWydvR\n90hhaeUexvb82l0dAn6FtnB2qXmY2aw9SIr3QIUlg2pxgabz6EqUMXGT/1mV\npyErJHGWUkEtk+T3uLm8Oic22YrM/xAcN8STrFs2vCeiuIV3hBxqjrph4KcP\nUMR/DJwaFOZRi5bcXigbZlfTX7jOyXXcDPP8bSor1rbkRGoBXKtfogd4tXo8\nAoIn0m4APXeCu2dNjWiti0JY9TjilBtEmJD+h4UBWbtz0QzfpqXDcgvE21xY\nvc7l\r\n=f6GW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9014ee22fd6f27ab45390e49c90a895b04bf7e16","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.61","@balena/jellyfish-logger":"^2.1.25","@balena/jellyfish-environment":"^4.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.77_1618371029771_0.6560177413172292","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.78-renovate-non-major-1a6be1fcb5869d5264e3351aafef2050e8a52d67":{"name":"@balena/jellyfish-metrics","version":"1.0.78-renovate-non-major-1a6be1fcb5869d5264e3351aafef2050e8a52d67","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.78-renovate-non-major-1a6be1fcb5869d5264e3351aafef2050e8a52d67","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5f1902176cd038f4a4c32d361998c95fd43f26e6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.78-renovate-non-major-1a6be1fcb5869d5264e3351aafef2050e8a52d67.tgz","fileCount":15,"integrity":"sha512-CJZ1IsoeKPLkj0KJzHWjZXakNORcBVtoBTph/Sb/c57CWcEfS21mAMC1m0/hCFd0UBWP6XbEB5P3hdRtqc9dRQ==","signatures":[{"sig":"MEYCIQCnr3voH3qfKJw/ghBFeW9F+A3W5qO8/ZExlwfbYoqsPgIhAL3Cw9xqUgeyS68NFhuK/3UdxJ7GkmVT6EpxZQ5/eDmz","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85292,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdnilCRA9TVsSAnZWagAANlYP/jeL+zcBky8RITfjs1zP\noKOLkhsRs/Ak3ifZdEpopg9qk5pQIuGW3LWiL90mV2u7QcTzEPGsu3tp0E+3\nbfXDog1wDB8mRYg7FHrxxbyV4yg15h9wcf0jIaH/IJhn2K1DQuNKAN41U3q5\nPD6QNlRUvv9nM0B0szkNXozm7NziykWGOt7nTCXePLfwmwFBhhfgsjq5O+X/\nJoZsol4ZetYdzs58BiRdQKPq/krjqRNSCCe2nn3Nf8j2LxQ11Iiey9Levn8c\nVqhdeO3c6+eBpYXCYtYUZYMEIU3kYbQuKv/94X70WXpUJfOfWS5ZrBVIukWO\n1HuX54pybZrKHBVj+ABJHtlwSwq09p+ngzmY47T0wIz/liNn3R75+HmMzfKB\nb/SC9EnPlXw8zDAVL4f6vTHXlaWl6BXfJ8NmPZtNCvGnCQ8qh2M8nGkQ96N4\n3qMcq28n4CQ3onqP+ZS6ZPskbWObsx2u/mJmorhSlswehB2z4oMV5tpz/fVP\nfpPA9FZdQDRrBz5fL2or542Oc3yixUFO8HBQOZUj8m8FYtcHVJfIDcdmF6X7\nQT8fOhN88D+Hqg5eKNMzp3Z9J1vIpvv4YpFPgItBqoiNcQHeTgdp5xv+FOpL\nJCPSIhL8ydv4BBo/kLbScnAHLXc7RgRml1PXDz9G8UiT0zmmU/M023VHogIm\nFvmo\r\n=mvlL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"1a6be1fcb5869d5264e3351aafef2050e8a52d67","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.62","@balena/jellyfish-logger":"^2.1.25","@balena/jellyfish-environment":"^4.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.78-renovate-non-major-1a6be1fcb5869d5264e3351aafef2050e8a52d67_1618376869237_0.8980839750525571","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.78":{"name":"@balena/jellyfish-metrics","version":"1.0.78","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.78","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f9408d071f531a744a4965062058c34c7f12f370","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.78.tgz","fileCount":15,"integrity":"sha512-VxuWwj9tmeEMUyC68EM2plscJ4rG3TbvUqVDo8WqyACGbNufX9FPG4BF3cSpcmogP18NRYK0EUQLAq3iWbFrWg==","signatures":[{"sig":"MEUCIQDcDfil3V7jeOoop1zBFNkIu/6yz+hsdhBhvVIJ9qmr1gIgT2CnMgC1iueNAOyHYk8lCGv88Wq0VMDlnNnXfwWxtVY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85232,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdnnBCRA9TVsSAnZWagAAuX4P/jr05UVS5PExdLBxjOfU\nl8MIOax+H2QITzamUCWuSCmydGDhUTU6H73L0yBGIUz5OZubNhcNCo8GmG/j\njoGCsX5VljQbdxguNMCxeYm5SLK6toasreAnC+Sj8B0/iNxLH8gD/7YAo8+4\nnFuLvTn9ev4P8MA2NPWfK7dieqCn+phbaZcO6INCn2+cHmbt+EW7pVkE7Fcs\nglDAASvP3B7KfO571BB0V8Qt14IDyX+8R4LiKf42YmORZilEt0RIpe4WGISR\n2IDJVLqLNPRiFtfdpUzkvlWWu4jylOFxgUT/36XV/LFTli0OYglzXEDKmRzI\nr33i/Tj51ipy4RjXGGtBNwBNOj86X9gN4qTw1ohzIsE79xboXLIHC7g9OsIH\nTZK0aVUC+AkvImGzbPvOtu6cvh9vuFFDuNnQIiZnnFfNGSf+PxAdWspZBK2M\n4qypomPyHTY0Rx6yhtEW2ju++EWAY7f5Lyqpd3jxZGKWyJihwB2lZOSE3eR4\nS3qyUZ0n6N2f7LzPL9+OdAUihm2qlsBDRoVUBnX8s+RByMaJYLqrSLaNMExX\nMd/w/RLRV2ao9M72Ks85qPClVanBE15pV1B8zmcTjjH8y0aJgu8HwMDQrATq\nSPnEufa1NPSKH6v9DDIQ0o/uvMPA3TfGCgwxTcnEscdH4FpRK3TrnxNv7lqv\nzLZ8\r\n=zio9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"fe33fc501b1124274cd8a40e620d42e717d6f06a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.62","@balena/jellyfish-logger":"^2.1.25","@balena/jellyfish-environment":"^4.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.78_1618377152835_0.9873665598450214","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.79-renovate-non-major-d3ee951da5c318274c955dcb6ab39700aeb87138":{"name":"@balena/jellyfish-metrics","version":"1.0.79-renovate-non-major-d3ee951da5c318274c955dcb6ab39700aeb87138","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.79-renovate-non-major-d3ee951da5c318274c955dcb6ab39700aeb87138","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"20cb3814a80ffbbf65b997b100f1f4dd9d460312","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.79-renovate-non-major-d3ee951da5c318274c955dcb6ab39700aeb87138.tgz","fileCount":15,"integrity":"sha512-Q14IP1O9vRRCtxsiNiVchKXmrUBm6SZ6vCB1cA6hiua43B62ylAlV7ZVAuNXkfoAGFCB9qaw1v06ozviSnivgQ==","signatures":[{"sig":"MEQCID0VW+ePeuxUJJsqxtuYYSKfWK64Igi9oOHp9GXYPkEZAiBy1COYjQuVyUMbRak61aw5YhfpaxTVPUbT8YqHk5Gkhw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85394,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdqlmCRA9TVsSAnZWagAA1AoP/imwh7gCn1KTR81gd6GH\nNReRzi1tnia/w7UwXYimMmgrEB/K1DXmlq1mC6WQM57y3loPW3CwGZZHkwas\n2JLr3klqiu7prqfu5rCwbv2U4S9VQvKiMDAo5+M5FGIxY/HheVikZSKAI6Rz\nOMQ7CtuVkV06ubGEDnCTzSagmwxOGAK2e4mvo0WPlQ8ZXuvN9hA0Trhz9eVJ\n8Gxt4v1OMtLsmC4h7VVW/nLTKzkVOBxa5V+f7FIid1K5AcuYAehCENPACBsg\nC8hk/ProScTMdP1sqqbSj54S1xVv3RiFee4o1XZ7lqT/URxiZykDQCdZpz7d\nQzGebpTOOpUw4WhstP5+QfrfBxLM/ZBHd9rhZtVZDZHEreAH19ZsLWq3pIML\nA8RmyV55B7i1H24fVA9CTPcKdFNOhWDdygnxn+VdlpbWiho/9dzdBVTXf+VU\nrnbg3HtwsysuodzKzjEkccsXiWQVO3qjn2MUYjs+/1qIgHHnOjoFZkfsNWFh\nIS1F8x8LJ6f3XLzjVBzq0wIDAs2XerKTm+Eetsk8aKskW1r4IVKCzE0kw60f\nWO4ansNbDRkSqPpYVsflClJ+0l0M2ksTRgIE3AaqHBjWZhbP4nWMGsl3er95\nCMX0AwQePgnEP0xmcC5Ej3yt96oJVXDcWmmaJG9MXnrqQwjSo2QyVMoHzG+j\nz1Yn\r\n=3ZeZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d3ee951da5c318274c955dcb6ab39700aeb87138","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.63","@balena/jellyfish-logger":"^2.1.25","@balena/jellyfish-environment":"^4.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.79-renovate-non-major-d3ee951da5c318274c955dcb6ab39700aeb87138_1618389349690_0.47688659252806986","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.79":{"name":"@balena/jellyfish-metrics","version":"1.0.79","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.79","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f2c4da88fb6b1a595ceaba50f1a03d080a49f897","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.79.tgz","fileCount":15,"integrity":"sha512-FhHXlrUNXe4JoXZTMne/ASQLyjPuXCGcxvgzkmjoHSO2kAvY+lN9sP++wvBAGhycDTnh7EXIx6hxZGYITYV7kA==","signatures":[{"sig":"MEUCIE5QMJzZq38Rr/PD2EtHFcNb/5MI7Z953YhHJyaimfzHAiEAmwfVNUn3N+RnKpkX7QT1ZIIUK0D2MMR0OPDh441pMWM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85334,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdqo8CRA9TVsSAnZWagAASIsP/3GhSdcEDlQbeJhnC3xy\n9moFa/SKvrMf3JJkoyPW4Iy9q67SvKfsy5GL0jE104Uhv1k5/6oiC1I3ZpjZ\nC6ThLZv+eTewHj+YaJITipCF5xvxxSYVDMhEhugZS8khmkNaE3WEWazFx1pj\n0fUNE+EW7EzBg56OgOgsOD6KFVnl0V+V+/EXlhoLcG/e7K5OF3hyVDJZGlSl\nLc13ZMrA75EXXjvhBAlDqBRxrTGXmhqqvmuva4H8MJXf7KVNgb9x4I3HZ/iD\nB0LVePr8sZfx4x7uydRqzXv/Kp7VH7RXxAtcYxdgLLSIpZ6WrIuBka1GKw66\n7QQN7gkSPaV631BlNQLqA1BfDWdBvvSBP1IFqjUriWIcW1n+P9MFSe7l5KVT\nU5G24YS8+57zMbMp9IUQxQp1aRgy/uiiJbibmmsrsZFNmUUIBE8LhPFET0Ew\nE/Xzbr1B9RxJA1xZqowtPZfojitXAfg47jdWvL87RV3IiQrJen1vqXgYgc9n\n+m9v96efPtd3pfq7KRCpZ5Y2VZiEtWjl0WLQyZajQ4HsQwN2IXO1dWKMB6w1\nEXCfLm4SyftZerNh5TT7IOJ6DNXz7uwxBBFfoUuScqgERv4N3dj+YfFxIGaK\n0MVHEuqKHwYI9DVGasrsIRatUwpbgd6v3gdgrs8vlJoS5xd89Gm1Ws3Mh6JP\nt5lC\r\n=68XL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7ec785dea77731aece182acfe7497cb0f2829c7f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.63","@balena/jellyfish-logger":"^2.1.25","@balena/jellyfish-environment":"^4.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.79_1618389564221_0.9116818061611509","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.80-renovate-non-major-40f0de4b41e5e3fcbf3cb98f77229261a1539508":{"name":"@balena/jellyfish-metrics","version":"1.0.80-renovate-non-major-40f0de4b41e5e3fcbf3cb98f77229261a1539508","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.80-renovate-non-major-40f0de4b41e5e3fcbf3cb98f77229261a1539508","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"09b95bf42aa1a1e31522cdd67d36e7b259705d88","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.80-renovate-non-major-40f0de4b41e5e3fcbf3cb98f77229261a1539508.tgz","fileCount":15,"integrity":"sha512-c9d9A6DTj9v7EZcEJyo0hsA6vtFu1ca6J86xA/qh115srQryrl+05sOsVLqaOHwq0iApo8g+OClY+r8UdUr5bA==","signatures":[{"sig":"MEYCIQCWoFY7QpO8Bqna29MItuWdXZ2+KQECetY1JY9sNBm2NgIhAM6KcE5IT8tLodlMIMbE0MA8Zji76busYZHt/YHI3DFL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85496,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgds/2CRA9TVsSAnZWagAAmOAP/3nli43b8sfc/2dulOu2\nvEknRpqGkhK0F2mxJF4CxfejGGUV8iFtb8iLwg3Z7eYIo5bp5v7F7rcl93Gy\nnSmla4oOtlx56h2xHMkt+AnmA+WOyPY10C2N0WB8svyPLU3iuZdpZQknI5uN\nxQKsQFvtugDimvti+gZY1/QFkfy42jh3hajiRf0By5zcuuxcf81qtFP70CDQ\nX9zs1+8CjeMCiiLvYGmJO1+OBGQA1jZkYswqtXtQIDmFIphYmsUaX1BKpcGK\nwMp37cEbo3nX0PL8H96wV2P086NwO7ZPGAS0xQ3zqW6wFTWEIqCrHxz2Kr0+\nIxsNrUh+BfwqzwO3q4YOg44dHuYx9vWZxVwYyRGZb8EureYdYjwxP7opE4a9\nuTcfYipAH9I9+18U6m5n1kGrUuDQCSeSJMyeiq/fa/GjQnRVTsVKrDO/h1BJ\nCY/O5b25vALohtdfqCAtL/Rqfcx9kRFOhNfxmBWr5fQmiuvSADmZuMbw0tZv\n30lWlOAo01yk0Mowsm+2+uNyUBvowL4yoCoM4mI7TnsKAMU909O7EIN/a/z3\nu1w4odTudUo3vhL1e2EhSjswNnBtpoF32BrlyseCJZTSuQRPIh9Ykr0DOid3\nYFd2t9VK6IDTYGDvX3W/bnDnoQ1X8PDSHxDgFH8jmSrxraGik3IAHXngoYc3\n0URe\r\n=gIqJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"40f0de4b41e5e3fcbf3cb98f77229261a1539508","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.64","@balena/jellyfish-logger":"^2.1.25","@balena/jellyfish-environment":"^4.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.80-renovate-non-major-40f0de4b41e5e3fcbf3cb98f77229261a1539508_1618399222363_0.3908154933407686","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.80":{"name":"@balena/jellyfish-metrics","version":"1.0.80","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.80","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b17e31c445c9a43512aba3e365d5051397e43fd5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.80.tgz","fileCount":15,"integrity":"sha512-5UO5t8Vk7BN3whL4oPywxaC/75NDy/t2M6+kiikeBjDN59hn2XVlOT5yeNFghNCVS1aPODRzbpOM+K+pZwCtKw==","signatures":[{"sig":"MEYCIQCayKzjVF5qmvZy6Y3Ox0unr5RrhXc6OalOtcx9vnTa7AIhAOWB2ji7HvztSYi0UvxR7MA6z7Jpvf3Y0sFBjU3Zm+LL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85436,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdtDTCRA9TVsSAnZWagAAAnEP/ip2ZA3gz3VrrfTGRrVI\nq/eK+BvMq07EODYscF1PlawMFOU6e+8kKkJBbgzS4QPwsFPer2IUx3TGv/7S\nPHIzsH4p5YuMVGfIaufVqShASws0cLJqbyRNxJ8KCFBSNmA5Umxw1jtY4/Id\ndeTZjIq7l07n9GrzQaWRNxKXbnT9eNmUBtKy6yDpzcxZCoqZf3lOMU4vZ8M5\nHmrWr2O7WGYZ8yR1Ge9CNiH61xTBI2/nCEmclIczyxPzgh0zd5HCghdrsmRj\nq/RE3/QsBTdSbV37ETrC5y9ID2CusZAskjHFMl31AczcGfsbdiSGGpApp+Qe\nXicllBiw0vxDFlMxfpuvs737B12SgmI4kPy61CtJi6LG5rJdq0n2d3+LvPat\nRceo0X7qR1m7eHYqK1zt37dg6TySnEKf9pZ+cGm/3FOfMo1jnRPDCXfLsFpX\ndfQzE897l1oT/qMgEDmXcV4YBQC+xG/lpM5Qhe90boFCewCHes7WeCT30/aP\ngEyHYrctljEs7sn+r3DaBSReeeaSIuNNGXivuIJ+pTvX4agXKa3kuPM2ZySu\nXyhHLHvPVVovgZpPF9YjUqhekeWZBUggnqwOZjIelqeYnwwkrBN6+b/e4yyi\nxiu7gOm6AxD9zvKcvOvHUmlsOs5op8g8kkDUlrlTlWWk/mxij9kfoJDCp1TK\nQfGH\r\n=bp8y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"691e01abb2956d9f68c83e575873a50b00994abd","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.64","@balena/jellyfish-logger":"^2.1.25","@balena/jellyfish-environment":"^4.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.80_1618399442690_0.05607946368174965","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.81-renovate-non-major-ed9ab9fa9419d11cf0bc831bad294ee0287cfa5c":{"name":"@balena/jellyfish-metrics","version":"1.0.81-renovate-non-major-ed9ab9fa9419d11cf0bc831bad294ee0287cfa5c","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.81-renovate-non-major-ed9ab9fa9419d11cf0bc831bad294ee0287cfa5c","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8dd9801acd7f61ff50dcc930af6d3a625cbe2161","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.81-renovate-non-major-ed9ab9fa9419d11cf0bc831bad294ee0287cfa5c.tgz","fileCount":15,"integrity":"sha512-GRx4YKSlTIpCfGMhRYRwPzwX4K2WwWubRlgPze3p9lTqmHwkA1hFSs3uDXGqA8iVDfQ9l/klt4vq1UJlQqE6ag==","signatures":[{"sig":"MEQCIGTYr56StwKP9j3as9UPA7uEaca3XVO95KcMpO8QtDnIAiBRe0TO9OtNirP3YyQsL5MIK/GN2I2ZawVbJViAwwYlMA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85598,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgduUjCRA9TVsSAnZWagAAQboP/2ULkVIqzb+s9GkEBHWY\n8eFAa4yaeOel+qPfN8bcCxq1Xm1ni8679fUSWWZtlhKas9OUlnOF9D3Jse7Y\nAccJe+FU+FpPsYDqNl4MKnAsc0UEupLtWCxLp83iTC0mXdjSWWwt+AlvBkur\naIxtJ1UBU0NRcjkT8snvJaerRc26rCLgNMfrgMkrg2SUg+sOH2ouLEtNGHDI\nAOpm4C5k/BU/+k13qX2cP3VRltaRuL9cx96cJoenwJrTvR7oKS2IQ3MKpMfK\nwHjTvvVSA6/oAzH4H+SUtOyAibpE1iS3LJwNxHi9VH72v+RO3jUEmNOkkRQ9\n1Xz01hZCAR1NUvrrPnbd/Zd8BnhGNVT9hbNhYNkRFMpYc6/tK60yamUdjRJc\n7JuGEFfNqEPUT2sWJ3rXSagLQ79QssZAVlFcwnm08xzUcYQg9V5d6Q5eE6tz\n0qslRf4pDeMB6nX6nTewQgmuqtVWGFe6syuX57QNRz4hqp6pINYLVbeacw3w\nfaNwYqOrkqmoo2CAOsRcFYPhsr3JX3a04FI2TUZ/6NE8+eGEcHE3yd6PzZnw\nKWysmtwKQOm+t+2OI7Jcm/lPdVeCWo5V58ickR6FS2Hdp89qcJEUNkyZFcuI\nitWT95UVUy97RNaBII9LDmjIm0uf/MVHT/l/fl/gC4UanI9G7vUJCrH2b9ey\nka5i\r\n=o5P6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ed9ab9fa9419d11cf0bc831bad294ee0287cfa5c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.65","@balena/jellyfish-logger":"^2.1.25","@balena/jellyfish-environment":"^4.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.81-renovate-non-major-ed9ab9fa9419d11cf0bc831bad294ee0287cfa5c_1618404642757_0.29699513073766726","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.81":{"name":"@balena/jellyfish-metrics","version":"1.0.81","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.81","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1806190c61133c4579a97323a9d77cbec97a9008","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.81.tgz","fileCount":15,"integrity":"sha512-mHi3J2jSM+ErCnW9UNWkhFq/LaNRC/utWAsDvbsiKkYJEu6b89sTg0BghN5IKH+doDoSD5xsiJkB3YMx0N/65Q==","signatures":[{"sig":"MEYCIQDLWKFSlCkj2F/lSJNFXFQ2alQsEp04WuQEVpF4lQ/ERQIhAKIcbp4dN1lxc3GZ6RUNhWzcGsnszo/aV0BzGuVY012h","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85538,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgduYRCRA9TVsSAnZWagAAx0QP/0nHNAQ0aIa/IcPunsoN\ncyJ20AWSaK0mBM3y/jJBqQpZqNsoAmTfN5lJuTjiuG8hLj4EA9ed/nKURISE\njBkFhVz9BniCWTJwHLWvzKIsfSI76WzbnMTT2xIDEEGZZcCjoVaOpPlRL0AK\nUoUHQB8UAWoCZ1VpwJMbmV4sbit42cxC0uF6Pv7gJJhAi9PRVFJfV01quCX4\nWswiiAd1eq/1t8Rej/BCwAPwa1hifgi2wGBLzVT6kfEUlNPXsu3TDdB0+JGe\nl3PbDbAfEpOiGTkaCDfELIsUB3qNidk/L61gN4yW3cYOc2NAZL6eLL9BMYDQ\n6WGG/xNgcxGbjvcjY0Z06B8Wf4bos69nWetWg4yStH2U+kHFuBws8dvd8uR+\nlcIE6uaYx34JaAS74MeY2mYxB8bmKPZLyIwroNZ7puV9R213EOk6Z/jiYZtM\nurtcog/tK8MEmCIdvKDD7OPWl+vye7iJCOHQ71ebQ/WZR/XUVgG5wBI2NlmK\n33vfdYf0tUXaUYoH+3kSjTVvq5ON9u5HCohQr4Vss7IMlmtNFC1zlAwyV0da\nooeq9elq55MTiNO3ohlp71R03OiEygCU4f56axDHl2bx6bWlqceutWgvRGPV\nS+bhDbM8EjiwnfCo5mYz9Q1zfzoJOU7Ail1vBb5DYGfJVJVOejCw0Y1Ha9Ht\nnznZ\r\n=5qsc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5dde699679486605e2186cc73625aed401b04467","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.65","@balena/jellyfish-logger":"^2.1.25","@balena/jellyfish-environment":"^4.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.81_1618404880507_0.23849889875658659","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.82-renovate-non-major-8424245bd3220712dc47827100a76a62567f42e8":{"name":"@balena/jellyfish-metrics","version":"1.0.82-renovate-non-major-8424245bd3220712dc47827100a76a62567f42e8","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.82-renovate-non-major-8424245bd3220712dc47827100a76a62567f42e8","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0302f58064d0e08d11c78175c012164b75135343","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.82-renovate-non-major-8424245bd3220712dc47827100a76a62567f42e8.tgz","fileCount":15,"integrity":"sha512-sXNfLiYdMqRCDQ4ljQPT2YwbywApL0zzYIFeI0l/lDBrgWK8M28kXNoZKcYMoY5ddrVY1fYh1CZa7RdU7KAPvw==","signatures":[{"sig":"MEQCIFUaRV/yIns0s6wqS+wjwWquW400237yhJQB3YZhR1GqAiAvNFzETwF5NldoVnZrBnsZvG8ujRO9HOIA3IcmEMOeEA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85700,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdxWYCRA9TVsSAnZWagAA2LUP/AowehjWRDbYpOPwdWFn\n32+KHVNpAWy3PQkPdA/tlaoASrzRUm6QkRuHbD6LHcfptGbVmpXNEh7t5nbQ\nMj2wkAD/cFbxO3h9FltESRzv4OTDe5g4qsY2PR7o3EappDylAUkO/FyrDcO5\nqlZIPmZwI4FFiTVpcpPXx67ru0S8iYC6EX148SvCZDC1COxDP0UhD7SjCQ4T\nHvyiJIejJL6yhYaVCpnZlPAuuNwsyu+TeivyWF5H8va8yqwxZL15SZAoIWqC\n9IxxCabLRzFdw4K+D3VL5+tz1eXOiL/o1K38KuEJZ2q+2HkDZMszxbH67lHn\nSsBoO/T8ZwlEVBFMAw6ZVFWwd1QtgeXjPTTMV20tYmy3NvqqP1JbzVDxPH0c\nwRmc/c/4GeQPE0D9BNtXZwxDFFGDnEyw74yllxFS56gS0gTF+YW/AmLH48KD\nFPs6UI09IXOCygN/ciM9pp2ih+hnZMC1fQq4aDEnLiVpBIzRbDELPTx7d9BE\n1KpMqHmBPikHZ1lXeXAAIGSUqcXPZnDkaqWAn27QhLHab9zwDKQcYDgfW+Ic\n2rO9ETE+G2L49eh+zvKHoc5F2DsioJw+LdEeAFGKYaQO5hJ0gDIJbplSOweo\nQ0g+9srnu5BW9q1XXUAkz2re1tYlqvrlPcOqhdwHPgpw6/WNM9suOX8NiyHO\nyVlX\r\n=FTgI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8424245bd3220712dc47827100a76a62567f42e8","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.66","@balena/jellyfish-logger":"^2.1.25","@balena/jellyfish-environment":"^4.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.82-renovate-non-major-8424245bd3220712dc47827100a76a62567f42e8_1618417047656_0.8702239271418302","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.82":{"name":"@balena/jellyfish-metrics","version":"1.0.82","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.82","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6857e143ccae07ecefb247fd8b1e1877205a9a98","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.82.tgz","fileCount":15,"integrity":"sha512-F0L7n4tSzJ4Hh22r694vgip4VgGPPRpzJVsbaJjcnvbGkb2u9OEJGXIe2qrmrIqgIsoNwOFqEib+ynNf/OuxwQ==","signatures":[{"sig":"MEYCIQDKboyu0YwBIn04DC7GZgxmYQ1hrWiLjOY6kdtmo+iCIwIhAOISk2zi8gPo/UDWJAD/P6mp6LnVVyUG+78FC3MmRHXH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85640,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdxa8CRA9TVsSAnZWagAAsjwQAIcFZD4ds50IWGnXDzIU\n6XhUwEkihkLFmo+t2XsEQokR/8ntJgqzLzHlGvKVVAtlwrbQU1JyyosQ8Ad4\nSEXukp7OZCaoxG3h7t1GZdEwJwjcCMhj/cKwaLLijcPwSLchYcMRXnks+zy/\nZiIEwEsE/grPrbeuLvT3oPi21rOpy5wpd+c/UJ9d5MATvWbx19069hffxaPK\n7L1+/wLr2+0b0aBq/9xWtVqXcXex0ieZ+FRVKJWCPTZ8EgYDVbmU14/nQC2X\nkmhZ54fhbyiv6+B+HAr39Ho2v8LGSYGJQaf2qKRL3YNUnFlDN+V5udthNbMm\na+pfazk/TSZOKv4PEsGPYWnvAl1cspxL6g8L22wGDh2/Wpjk6BSqjxdym74v\n7WKlqaJH60DBhB/enMHcc2Przv7ZkjHgmQ7PIrX99Sy8PtulTavaRMUZlfMi\njsUg0Ms/6l6D15Jz6KR36fdB0SSAR9mDeWicEu9GaP3cHKGtdH4xbYEnvEkv\nmUyjXoqZrlKO9ZPt/AwgbnukR/ZhsXCB8/W6AZe4KFXVnwHOliVX+bHBeRkf\nNtwMXqzGfbWCVKPD/gZGrxDzL20jreWepwIJdUEf6Z9vW43KqRx3M2u+m+l8\nMvZRIWZ2d9TCjj6swL86UIo6dWfq9Ltw/fAaHF7z33A8iDpp6TCvpFo5uMhP\nN138\r\n=VhDv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a1ba1b2aa63bf080d34fa21359becf1fbb69d3b4","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.66","@balena/jellyfish-logger":"^2.1.25","@balena/jellyfish-environment":"^4.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.82_1618417339700_0.623983475144634","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.83-renovate-non-major-65006aedc2f4155ae8ce494be103f43dea14a615":{"name":"@balena/jellyfish-metrics","version":"1.0.83-renovate-non-major-65006aedc2f4155ae8ce494be103f43dea14a615","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.83-renovate-non-major-65006aedc2f4155ae8ce494be103f43dea14a615","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bfb01a981635faa3d52874fcef5e89d4b0374426","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.83-renovate-non-major-65006aedc2f4155ae8ce494be103f43dea14a615.tgz","fileCount":15,"integrity":"sha512-aiq84xpjMwq8kwSx35LBF0+3A+O2PHco7ZLMF7wRrRijhbnnxCLFzlXLOMGqnpdHz0m7WTEAvwI7N5LcB5xm6A==","signatures":[{"sig":"MEUCIBWUWk7P9LrAntlDnDYq3vDeKVAxZPMrFUD2/VbXz4/tAiEAomOFshhoB2if3KZY7lqYyK1GISVfBgPxsHCiUtgHAO0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85802,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdy3TCRA9TVsSAnZWagAAc/8P+gNULwkGUo0sf9ZrhKBV\no3tO80XkY0G9DTnIgsqBUf8WB7WcIfjp6hKlVb5GrIghuiYH0YWfaWMzkMm9\nvwlJd91JUzV+ABzFaaExmyYiUPm4HzhIduIGQ0bGiS2AfEguZmaNtXlLojUg\n5+fJZs9T9eedyrCVRm/BQC/rkaSfp7pPT6BA71dJezj0FgUsYsdeHiXBxpGy\nihkf8zpV2EMEYxGiHUosFHVmDh5lJLZlgB1BuBmqeMcLIRBttL8Gb7lTXNIN\nLCUGOXOBPu3EGqk1FrtihXGvXgDdiXT/K5ecnr/LeDOHeu5Mcd3Jxz5KPJq+\nVY/Zikhrp+GvRSyx81rRlUNIF7LutDNHmjtIbJfNATt2G/SiKQ7JsNErDSm1\ndbBRJDoQ0dLZ+qVMn8GmNtMDiB3QXVSE6FD8Oii+80RXKMi/a8CM0EfWXHuO\nF1is5S+2vbf5r8R5Kr94iYfoUwB3lx2MgtOci6jEumZRese17yzZD9yGYXnA\ncngBFCXyZSPrM+NZUyzKbAA8p5IMaMiu1nXRKhOd4hHxG0xDhGIsFwDFxLyr\nx77h3UewY43SXlHylUigs0jEsesQowVUpkBV0txa3f88FwpywzjLNlLS8Z/Z\n+xE3iXeTLMFGVz1n6jm2EuoeF0jsXGkev5m37eK+LVxS1HDjyp+06ZzCSXgq\ni+1u\r\n=Kaz8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"65006aedc2f4155ae8ce494be103f43dea14a615","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.67","@balena/jellyfish-logger":"^2.1.25","@balena/jellyfish-environment":"^4.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.83-renovate-non-major-65006aedc2f4155ae8ce494be103f43dea14a615_1618423251109_0.7649450195224827","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.83":{"name":"@balena/jellyfish-metrics","version":"1.0.83","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.83","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5b64d8217e380d5456f5e8740ca4cf966c4149fa","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.83.tgz","fileCount":15,"integrity":"sha512-WBiXJ18QAFyVNj+kKihYrI7QaHAR52esEjxM0tbM9rSXMBQG+2nPlHNwoYRlxxf9v8QrNYC7EqwaPJjeSLxwSw==","signatures":[{"sig":"MEUCIGupd+IOsJHBbBmm865CAsyLZNNC4HO33eIlsVpZfAwKAiEA2BoXYJL14Yt7HGIIGbms1+1zAbzctVcuBc0CFUlzU+I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85742,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdy+bCRA9TVsSAnZWagAAr5kP/A6WeyxFQfuSdwuM7LDx\n9Qzluvt4KaxEnf8b49bGP/6Bi/cclKALf8UcPOkxUkxIRJFfRpljdiIUUd91\nKyTZWrstGD+5UT/X8QW8+TJvBxWeErrfGW4O5DrnUJxMoPtv6mh6fa5KQYBJ\n/hz2YIdPRXXSs5onU+LcAhQvukpSYD+L1srlYbrtEkT7R+z3V9Ol0S6vEUwS\nfnn2iVQhaeV41M/AJhhtFB0SDqedS2dPnReUSfswUT+Mv6nIljbnpZbKKFuy\ngdrWjenNYOdA+RqenZPTSYOtGYuhq05FLdIuchGnieZLUtpn/6V2huZT5/Xv\nU+bHgVEKgOyyE2EstjJ7RaH4k3p9oMUfjPbSCmyTSmDnJVDBd+RqO84ytLuh\nMaQ+1K8I+SzY1YZzUYNRlBcqpqQ6nlXtKNXJeDpzGjuUylcVy/icjLj2/NIP\n5+venS1n7nzbO4IyGjqtS9/25gBSorh/87rCingnSSajNtGB3RosOS7E/Zti\nNydojGyBbBGTrH5/mc8pA9s5kR50nU9mP0TGZG4Bf/PwZWgS4OPR4nHNUTeG\nL3MZjAXg+g5l2P0K+2RVnDZ7iyNZ/KL6GqZ8AVhqH7iZqNt/JH/zsZJcTVPb\n0YcfWj4l63YFaunKc9b6gRTNkX2m1LcCMFrRL7u95LwNinYDexcozNqaUs9T\nmKx1\r\n=K01z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7eb501371d108d90290a8bcbfc69aa9e969ec9b9","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.67","@balena/jellyfish-logger":"^2.1.25","@balena/jellyfish-environment":"^4.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.83_1618423705920_0.10529974898337069","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.84-renovate-non-major-598a3819211509156f829ee3f480fd45614ac09d":{"name":"@balena/jellyfish-metrics","version":"1.0.84-renovate-non-major-598a3819211509156f829ee3f480fd45614ac09d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.84-renovate-non-major-598a3819211509156f829ee3f480fd45614ac09d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"57cd45c297040626242e32a8c96daca0199557ec","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.84-renovate-non-major-598a3819211509156f829ee3f480fd45614ac09d.tgz","fileCount":15,"integrity":"sha512-9762gr9nPsHmC7F1gTUYbeMmK+r9+FJM6cLboN+Gnj71Ir6PSRLjN3sqrQTQS7cO+plgfRFmpIR+Iz8lagx2oQ==","signatures":[{"sig":"MEUCIFDnP/1o4D0wfkyhlMRYDPJnvtJQMbqj7myB+BWfyVVwAiEAsYyKAMms+gaDRUOuCxEqvih0ZwNwb0mASkhDFxLVFKw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85904,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgd0n4CRA9TVsSAnZWagAAOJMP/32Wp2L07He/uC5r7AQx\nBazAAigTldkSB/jUZ31Mmjx+gxz0apf5+znbE2CqmFde/8IC8AgjF67VcShH\nr10Rd8sL+alArzsrVd4ABqfjb+HjXv7zsuBCAPO/maBbLekHWgK/YjAF9H2s\nMpe4aKrEIrUQaMmLvY+8qXRyrPDMN6KW/TytfNPSuHLVtmXU+jPWGt77uLL3\nXTWKbI0G78W7Y2Uw6jmyjkx69CEo3eOUC1TOsK4DWTCnFtTONhLBlZK853mw\nqWzktxaqR3eSYbcIovSX7ZkKLRpEFSYKYiCgd57skjK5oC4Q5rE2IW4W+8lc\ntoOxRQJAH7lV95pumb8SAQomhuhXVntuX1BtzNCvbiOjvMVefcv8uMwmJ+Pj\n571wERQfQ8DCTL2B1K4DwVpHzr0/IXmQAD8gAJtPaYa11NocuDm32Eeao4xY\nJ6J/KOeZQyLaswb5DcyifTSQpA6KoKncEa/as9ysb+NsaWlE5vgtmIPiLvxK\nuess7SDGz04TQrCWRbqaQIFcL8JuCzbvABP4f560SUYxyi9weLCYM9Tuc5pP\nXcX0VTe9P8p4yCCVm7bQOPyZVlgMKBNH6ehk++jEu5Tgsb26v7iJ0Htd8i6e\nUUxryyVCOWpL4pY1rbf4hmRdYpPjxZst/G6ktJ9Oq1yyKYiCt+jOrbvAb1XW\n043S\r\n=WTsZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"598a3819211509156f829ee3f480fd45614ac09d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.68","@balena/jellyfish-logger":"^2.1.25","@balena/jellyfish-environment":"^4.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.84-renovate-non-major-598a3819211509156f829ee3f480fd45614ac09d_1618430455964_0.9166293663887406","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.84":{"name":"@balena/jellyfish-metrics","version":"1.0.84","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.84","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2f6b6ecbbc5f0b6d7942fd837d43942ac027139f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.84.tgz","fileCount":15,"integrity":"sha512-J55t/H9If5ScKvZREfyieF9OQcsOKjV67UYiJ2bAheQcJFpG8s3xI7EwbRytNAlijLU/6wlyiH7lBpNdihCFVw==","signatures":[{"sig":"MEUCIQCcxIjzdUMToktppoGMCFEJq61CBDYHscK8lKmDHNQQzAIgf2KVVJxJrxFBEL6+Cv8HLJojQ0bE5Wj5zKloMdlIntA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85844,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgd0rtCRA9TVsSAnZWagAA/XAP/j1NTcGrfLNVjEQ9UJZt\nG69Zo5rGMx09ekgtMuXScSeEVJFiwy1ceR2SxhwPiW1gwXQq7kWK//YELknb\nXoVLbcBHuNGCNtXCk07uiN4L6JYB1GbZWEr0qgwaCKwEZW2KFYCvRqT90pOE\n23wWtM3J8WpTrDLDlemv8WM/VQYPJNvd5d/M4gOC8I4Q2tLLf2RflbupiObh\neDRH7MaY0UpoR9rB3XlDTReFuxJ0J82j8Uxac444nSRA2Ftl5BHy8gWtlrxN\nrI0B/UVz4BPY34Apji7xIw4OoLQ8pP5SWBe3RTriU3KYcTkc4VdtzeIytnC1\nE9WCtjD7/vH/5TjhW7vsnWlI0/gJ4fXj4ErN2YHGLDOp+9p7Gx2jyhhHxS6e\nFrCjnC96RllFZg4gf85g2FqUQojYLSPMjVDvWtUe3rOUyzuQYjiIREz5bb+3\nqMBylYCvvXlZk3B+bIKpMtyJOmkc9hY0YLELijxlBPEmGuoiRV3pqLryUcZJ\nhm2Aa+CFhLLmRcAxIR8jfrSpXN0cCpIGY9/a2J5BMkxD2tp1jsIzmdsfOHv7\n13nfceOYMsvbQkBIrXnPGTWSczpxXLpRaKhk+klVCqAHdbKQueI99o8Yeucr\nKpEJPQFKJcOOYCvHo9+kEY1B/H+UNzhdQJa1c3OkMHrCo9ekJTh3eNcZPNms\n86Xt\r\n=okvy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"efbcad7878e8be43ee7c7d8054b1cd106c95d570","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.68","@balena/jellyfish-logger":"^2.1.25","@balena/jellyfish-environment":"^4.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.37","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.84_1618430701419_0.24868104053870055","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.85-renovate-non-major-7c9863a7a785d4de81f7e6a6fd65d4d49d1eaac1":{"name":"@balena/jellyfish-metrics","version":"1.0.85-renovate-non-major-7c9863a7a785d4de81f7e6a6fd65d4d49d1eaac1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.85-renovate-non-major-7c9863a7a785d4de81f7e6a6fd65d4d49d1eaac1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2c5eff9bbcee8726e0bcaf7abfa8075d6173201a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.85-renovate-non-major-7c9863a7a785d4de81f7e6a6fd65d4d49d1eaac1.tgz","fileCount":15,"integrity":"sha512-Hzf5sLy6COQ+jEDtor4pJP4+rWgHJAVvrGokyHBe4hUPiBB35CnHGHyhnMPfLUf2wXj2ODPclZxMJg3kJR/XDg==","signatures":[{"sig":"MEUCIFxr7dLlfMTjJV1l48BwXReZZlvnU7ZY6MNg1BNxcEn6AiEAz9ClK7PzcmB2UcW2d71jFs1vwqnugGwgfsMJ8g/BI/Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85970,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgd17+CRA9TVsSAnZWagAAYTEP/jGOXOxLNrFhZBLujUEy\nu+28o5+AZoMEiNIzMDZVG74zb2SV2VwsdA6TCdhypSJmimhWedAY1KUtAV4S\nDoCzlJ/GSxMEIc5T+xnkGK4J8EyUjXfRihbPHyDSUg3nD1XoExXjFNSCdzlZ\nuWGbuGRsZ142b00dfvdVyTsxDwL6ql2a01HFNfXPOJRQ0+wQjSrWAgjgd9/2\ncOoaue63GwV9KRdcEhPYTzW2I33le8boncsX6k7YiId5RjFB6/fvPL50i5JH\no3klWZEtCwi3zre5NzzO46alAOdWDW7xFdHN0hcETw80qWK6fbCGzrfbCvJ8\nS91DjzLUfZDYx8TWqO1004jmn+GYAwNs5Lwwi0+r7ub42IO1swsXAkrp5fzn\n5tG0BfHlHEHCr706pfptMFXhF5BSFLo8k2RAKxJhdbVvtqER1kBasrcVCcmt\n89V3y4rSJloGK9VuZnSXVjf2gIa37+Pb0w++xDvi3nEFp9d2GmzAMf/JSxRr\n4VCEFzBfQGkMIIbWq2cNXp/u1HJx2Gs6EHz/7S9TI0N7d10tNrpus8M8CAGK\nYNQxlUl8nwOXVbbqNJbZJmxvwgrH4v56WufyPeqbNpWwWtClJS2rzJLjtNV+\n6KCG+4xgMcN3CAPEAYQF7CBDVSHVJhX/CsMprOJyEmQQc6QXyNWLF8nhwaCW\n4cKj\r\n=nbos\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7c9863a7a785d4de81f7e6a6fd65d4d49d1eaac1","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.69","@balena/jellyfish-logger":"^2.1.25","@balena/jellyfish-environment":"^4.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.39","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.85-renovate-non-major-7c9863a7a785d4de81f7e6a6fd65d4d49d1eaac1_1618435838424_0.666938545655833","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.85":{"name":"@balena/jellyfish-metrics","version":"1.0.85","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.85","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"91932cfd631405cd9d189d79b9b11ca5142d3f88","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.85.tgz","fileCount":15,"integrity":"sha512-XXkt0ryJLwj/Y9l9HBm0px897/yBm3KBTZg6pJvISlEK7oiTqQtcZP4MjPeAVTMVQW0qHlqN/UxMohpH6+x4YQ==","signatures":[{"sig":"MEQCIAJQcyCXAIL1tFN+3Wr4XyhaWlwOq2b1zM9xFSMaM4rNAiAJISc95H4iRN7shFOjEWQH3wnRcDaTkRWe36t5kJ3cKQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85910,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgd1/6CRA9TVsSAnZWagAAzgoP/1QNi11IO3tVyLIkuWOb\nNws8Gm26lmKtaGGWP69i3l5Ah/UKVJaTMMda3xPq4a6uPZuGk/EVJod0+pQk\nxixGMZlC4KfWhXd97vY1TrWgTuDpv+7Oh9ydhrfGMltxmmxHeUOJiAE/1S7M\nz+rHgCjFanFuZGXb5g/JIFyI+SnkrCUSCnlGartj2U9/3XCnZ7vawe7g6g7v\nu/qzovMzY1SarkTszcyIRzwCAtG2ub2lUw3y+SMNpaBeTxTffV7UI97faF2z\n3A/Lwwy5/Eo9ldN9pcHQN3Z6x0Tg3t1PGSj+GU+VmJ3i37PwMmzTBTUnlp11\nMDS9TyYVJYRm0uaD9KwPaIpudAM4CvFUSvbmr/mzs4+CIxcCofulNAteJ32p\nstMsWkdRK9DUZ5/gQbLSc57DiwjTnp4c9R6Mhq/IxN0tSFWKzQmInzaPJNR6\nyC3ft76E6Ni+s7/ZBbOucZTWXUThLv0jrLBhrrNdOwGoqgO9cptqnu1ahJz0\nVPvI5DX4vZYc/P7+rEucPUZrP7zuSETCCCKgchbBJ94zbBrRSXbHoXhy6bvw\n4VID3CrbHVrIfRBdQQCbrNXcArd5rNhRirSFlBuAjQrjh886KrdR3fRFOfcu\nrIe/9vBzr22WuPhsHeKoverP+m358wgERqlwZctmGZYqj5tOBmPyd6EIcCzR\nQclv\r\n=PSTk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"21ca03412063f51e317f473789bc5c42b75ebf81","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.69","@balena/jellyfish-logger":"^2.1.25","@balena/jellyfish-environment":"^4.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.39","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.85_1618436090545_0.21696747211621625","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.86-renovate-non-major-c97df09dba88ec52e68d461cfc86c7c9e2d06b70":{"name":"@balena/jellyfish-metrics","version":"1.0.86-renovate-non-major-c97df09dba88ec52e68d461cfc86c7c9e2d06b70","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.86-renovate-non-major-c97df09dba88ec52e68d461cfc86c7c9e2d06b70","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3fd2840ffbfe1e6e81d1865b889a932734896c51","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.86-renovate-non-major-c97df09dba88ec52e68d461cfc86c7c9e2d06b70.tgz","fileCount":15,"integrity":"sha512-oqtXqh5xwoDew9zbOg8VhVrYeFpz7r3vjwkvXh9bt8F4lh4wdlFvm6BDZDxznvqqhfQ3VBAkvB42oiLj7PDvXw==","signatures":[{"sig":"MEYCIQD8bQQ01JVIcfDMNcHh7/Zkai8ow4i1NMg2DAyqbEYNFAIhAI0cmDph0VVfGin8wWFKv5t3y1s4z4kYEpFNpwspEkuD","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86072,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgd4H6CRA9TVsSAnZWagAAtbkP/1nZo6Rf+DZqmFI4/I9l\n9W5vqS2gBEB6wlqxTqVKbL6Y37S5nSKTqArQSauUQifBekI27fW7ECt2stRy\nlCt+WLaedDVdI6TwkH8b7auhcQJo9VNcZCHistncmV2GD6t7NSNTzLYBgb4c\nSCD+Fc27AcKFO7eiUb0YvID1jyd9E741WV7K6mNdVYNI15U8pY/YuB6zjLjC\nsmkEjwuFu9VSPt5s3fev49priuupjf2eNC5ZClAOntUUBy695SQeOJhWgQLj\ng3aWhsLpMAS8olwF8rX+o7o1VrqRyEperbTHoqwIWpkp/hgMS19VvbgG5Bf6\nz6vxPYC/fWx1JuUhSTnqJJa55wPF6LnldIgBdr+oiHzrLBQ/jwRBYZ9W0HrU\nBkd10rBVNIaDbyZZrurVZnIhUkt718lt/35JZ51yj0vqlrKTu4RaK7RC8E6H\ncscA9zMTgTFEzK8LZIwPzI4LxvFFYiQV8Tk0SqNy1BR1PdCcCVF9qCjdjyWV\nuPlEFdKXrvZLWXl+7rnwOlERU161HpnMK91s3uafsmytz96bqhTBewH2ks5H\nRE19nU7n5uvvDmkfcg8vBja2goQSdbjb1jvrhW5YYWiVI+avBCa7FEFPp5c2\nugbVz9OTH9jucNXfIoW3XP+0zzypkGAPCayPGjHT2iIVvUyGwq740FFKbuP8\nSZdV\r\n=Yh08\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c97df09dba88ec52e68d461cfc86c7c9e2d06b70","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.70","@balena/jellyfish-logger":"^2.1.25","@balena/jellyfish-environment":"^4.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.39","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.86-renovate-non-major-c97df09dba88ec52e68d461cfc86c7c9e2d06b70_1618444794080_0.4819878490868541","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.86":{"name":"@balena/jellyfish-metrics","version":"1.0.86","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.86","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b05cd4223d171cc05d5d1abad90b116dc79981b1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.86.tgz","fileCount":15,"integrity":"sha512-5ZWNLwGoOj8ClZOmER3/zyYl64+c9tGILEKj0UlT2B1w7w5i6ZxbxI55eLb2HgHLrWVdkEan+KVdjvDDMycHyQ==","signatures":[{"sig":"MEUCIQDTm3N2tEciw0yVPtF7xGQpX/IrTvDuPI9HGqOESBViPgIgL1+G0ovZLZplT9zvyo1l9J7ks+MMjISc++7jeHdUwbs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86012,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgd4MSCRA9TVsSAnZWagAAZ7UP/iy464lKR+qwqPHS/zwY\nbsm8QvemcKLr2mTgFnjwq89+sLs0ldSxHRrqJhPMzZLv3nQu9CxHSxHCPM45\nv5ypTAT7CPnachI64kxcOLeUanzxmLnlgonrkPjEfnU+Dl4HRNqxQUj1gVRc\nZAWgG+hijx8FFfsjPbhhOuizLoew1xmukjAkz3e2bwr/HXmXTo+YFRfX3L/p\nwsnWuwVzD/6ZCqFz0nddss517+DPic33a9zYS0WfYkEBqYEL4XDiEeAx4fe7\nDyaiQIwOFhI2b21zyaOGHuklaGlm1G6TWqQdQo2bfMMTfByxtwWG/CAQdS4d\nHwQy6PG1i8/U/tqgFjhmVyrKNUxDiBNXbPNVO2b6T9KdaRh9KmMSJAX2FwrM\neT52+oZg5H96Ib+StBGsCPpR0r1NPkbKHEqASQkRNnT/fv1aY9L+yflBZnWl\nn3+2JlTXK57DFBwlb0z/AoV/2QlUkLnwZqJpykaISPRUsu7XIQE6MOEDlEm3\nb5NlFINbCqurwf7lDhqTFgHCX6XHS+E4lk8LAPU+mLphBZky8MRn7E9aRTnw\nFh7unUiOHLh8jV50c9DkrC04yZHWqRiaXYrY85IeKwXmkXO2ivQAOfrmCu/a\n9t0jrrULbGn3fsLIKETP2MdFYG1mdN4PVP/iOfiIUANI1zTJbkpJ3spW75Hq\n0Pmb\r\n=NOw+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9c25fa7eebb284eeea360e44a239bbfb60fd740f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.70","@balena/jellyfish-logger":"^2.1.25","@balena/jellyfish-environment":"^4.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.39","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.86_1618445074567_0.6090253821282055","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.87-renovate-non-major-faae24879b832cb1ed68c9446bbad6a344efe8f5":{"name":"@balena/jellyfish-metrics","version":"1.0.87-renovate-non-major-faae24879b832cb1ed68c9446bbad6a344efe8f5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.87-renovate-non-major-faae24879b832cb1ed68c9446bbad6a344efe8f5","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c639ab03371dea1de5457be6646da58e4e688e17","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.87-renovate-non-major-faae24879b832cb1ed68c9446bbad6a344efe8f5.tgz","fileCount":15,"integrity":"sha512-HxZqkkTBV5I6BxAQMowvYCxtgAD8FAUR4FiZ9jVAD8Hth5RH1jrbnYIksHBui/lP5XqgIag5ECYxYH4VwgpHcw==","signatures":[{"sig":"MEYCIQC5oW/YH4x+iOVFL+d5OsYMy+ILa0ewCT3ri74vFK/4JwIhAJDkLuTQMitn0OY4xwOp1nhoRCxVykNuv6Ce+sU8EFrb","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86174,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgd5sHCRA9TVsSAnZWagAAvE0QAI7+knMlcyeaGuMpA8JP\ne1FXUu3+xr4NuNMHeexKQA9fIvguUzKePLKqg0k0l1haPtMDGkjB0QlcsHWI\nbgg33aM/vfq7KiZQKDm+rjweUpxGPZSNSAeRXO3ifQf4/EB4bnoj/8i2LNHe\nmyUz8YROY4psEuXwsVtyYRTcm7B4cuGMiIh4TVp+MoKcB/G7KqxPjCL3LsmA\nk4kTO125mK28IvV2iPFzVg8Dughq9hlnDICTaBKR22zC/MLw3tDKPkNST/dw\n9v8b87CfUOY0S2c8TpiOhWXKhdmzzpzUJnVBudyTR3yo7OPBpxuTxAgvPfUh\nc9Eo4L+MIUUqPILrF07yg6d4h8/ulUX6v+Y5+IqjQK93UrQcmPeXSHw7WVdK\nPuGJ+A7PgZQ7V78mB5amr9rvNKKNPW2fKGMi7HqlunyHV25V9gWgiwzgyC3H\n6OquyGjCoo6kkHCQPTTlrjjwUIwRWpMiBD2io6gOUnU5k5yAgQPoT9uOniPG\nmZv7dsxbk87BogjhGtHwXUVESh0fhEU/flGGtg2zz0arD0eO0a0Rt78ydWlN\nudBrPHwVRS+1/r8YJpbnx7uN4CsMtNsou9FYwAMdMWvg1rSFTi/YCx8deDi3\ny4rJcU+ugya9Hg1WSRKpxCrbK2F8VXqgOGxBvGjVVhhygaAOMGjMJLPdjgvM\ngBL3\r\n=QMp8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"faae24879b832cb1ed68c9446bbad6a344efe8f5","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.72","@balena/jellyfish-logger":"^2.1.25","@balena/jellyfish-environment":"^4.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.39","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.87-renovate-non-major-faae24879b832cb1ed68c9446bbad6a344efe8f5_1618451206809_0.29315307242369193","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.87":{"name":"@balena/jellyfish-metrics","version":"1.0.87","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.87","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5031d4ee4c5c43c6dd26a5cb97fc4c913be31f28","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.87.tgz","fileCount":15,"integrity":"sha512-WJmLe0qyrI2qxUHwCn6kWSkbiwnLops6fInCni5IPVZYlEV+PLmm5+QwIFyiqgYWLeLJsWujOhcjC/W5byD4SQ==","signatures":[{"sig":"MEQCIHIYhxRuf03dH7YlDcp05yEqEcCGHzHNzkfmHUC0Q59wAiA8PsU0X2nERFBqNC6HV7d3XEd3kgddcm6v8juLyc9COg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgd5vmCRA9TVsSAnZWagAAZP8P/R4omAlfzag9Dm84heza\nQssZJxCkd5A8YM0PMsQdc4LAZFK2uyCqCZh/WddDpoROfSHfS6QHLLGcL8Pv\nx7IC0GmeAMZZp9xG0fX7vfy7YEk9P51x96n0TC9AQhv85FWR0xNFeFqzrUdp\nBZCUsSaBIOq/eSkaGiRn9loKjBSqgmo8mVb79V7CHNUSVQFIOBoWfY9jC169\njP4yKwoYgtzHdG2F7aHUGpeltVy7I0EUTful01RIM1OstVZi3qcGaXBSO4/M\nzi5rWC3GyoPD0bT0KfsoXLmcLYTYoB+wq6WgTMlH5R2k2PSumx/W8om3bLT6\nd0Oqs3N23Q6R1Kre3a/vjYjvmlMkHS0kmvyEW+7o8xwjhPmsqmj0uwen5PtE\ny1As8+1WMXbVEWi60WSGQlQAqUjXmSthumK0Nq1Nj9gNe0YXPuJFuCPz7j3c\n4mC7m5vJyO1hfziLmebCEpbbILbRgn3IcirrzAWGHyi9TH6eKemzN/QpjzFB\nO3EqwJJnPi/f5xI6M/GehLf9SI3RU6b8/9/FvAGV+KW+SAnOImmcfeUawq1D\ndgoEZ8CzrmxJ1qlv3gInpJsYqe60fSVq6sevUrAbAXHiLxEFJKdmAIz20aVT\nvb3xTAnxVOpBa1u3tgNUjgJAnSCUiw2+L1doUlMiiKwyU0LkpgGs/oElYccu\nWlkr\r\n=qWX3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"449241a81e7b7899544d20e76d0beffd6be1cdc6","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.72","@balena/jellyfish-logger":"^2.1.25","@balena/jellyfish-environment":"^4.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.39","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.87_1618451430518_0.5229436963278284","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.88-renovate-non-major-7fad2581fef499ac203e32c5f2b67336bdab044b":{"name":"@balena/jellyfish-metrics","version":"1.0.88-renovate-non-major-7fad2581fef499ac203e32c5f2b67336bdab044b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.88-renovate-non-major-7fad2581fef499ac203e32c5f2b67336bdab044b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7109928e6b1c2b061090b93816ce7eb07d9a2eff","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.88-renovate-non-major-7fad2581fef499ac203e32c5f2b67336bdab044b.tgz","fileCount":15,"integrity":"sha512-V0jfRVXpwSS7B1C/oah4h5gqCPkl7L3pRoMQbALI/gtiaRID5NKBy1k7ckckWrCDqkA/v9Vr+cYu4E3SRJ3IAw==","signatures":[{"sig":"MEYCIQDI3/VdJHio4/mzdDedvtDM/qdNeeSB17UuEAXnQzG03AIhAM+GpfUq+8BCQvROoqwKCkb/u2KdLMyTh+Nv8p8QI8qJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86276,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgd7L4CRA9TVsSAnZWagAABWYP/3e0/DuWszciIJkTN1/9\noNAmWp++C1rPDF1hJ8jLbmT28HQWu1XliG3Nl2GQHiJ1BoBRYioR+A13Efge\nyclymwtAhnHQluzBQvZOSb7LOSXL+rRx3htrrJ6ZwECRCaV9ed0/sjbaSUMq\nxwEakO8QduPBCLv0lz+EIi0XwizUcwTC8zPvw1llZsagu8B6vBpJ+Im97+HZ\nndCBGg+vYIdm1fyYlMgw13HsFR95TkqY7Cyjk2ZF+NdwijH+KTQW1uB95WDV\n8V/uDRCEdjCptbAvx1MiNmaPjZajCst91pR14H2D7rhYtglGcJP7GsvB7UA8\n9IADHEOGPCOV2EAL1XgDAudcigo7Ow4L5aBmgOYC1v2N9Ua57tynZtil88ru\na+TG1kUSUwNLsWFX2o2LF2nRQBmTQ9KzJKBGKLkqoFs4DuNqu7wycCQ0rf96\nIV7UqjcI1zvuWNXHci7RxYxgIeSLnUP9x+70BCViHJ40MH/a901QzQw/aN4g\nOiP6TpJJ5CCoYJKGGJ4//Yj4kbt96o/jQMwNXJ4UvWgB5vlTBWvSpWejLdss\nZw/IdTu7E5BNopwBvg9igIj0J6TRpJD3+4qofYJB3cdq5PJ/s+y7neYHj1AO\nckAgi5n+F3hjUp94PImshCZ1SK53KHZgR/VFxgc+Y4NO0aKoHQNZ6boeXQDD\nsknk\r\n=khKu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7fad2581fef499ac203e32c5f2b67336bdab044b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.73","@balena/jellyfish-logger":"^2.1.25","@balena/jellyfish-environment":"^4.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.39","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.88-renovate-non-major-7fad2581fef499ac203e32c5f2b67336bdab044b_1618457336044_0.5250025116427317","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.88":{"name":"@balena/jellyfish-metrics","version":"1.0.88","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.88","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"32c982c911a5962eb84824d8b7546751d3ffc42e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.88.tgz","fileCount":15,"integrity":"sha512-Pw7sEuyRtzIDaPWK3FyPuT0oaeNR8xNEtknENnxKTMvfkKHFAfrIHHHsfsLBgfi2dM0/beUEzUa7Y+WcUMeObA==","signatures":[{"sig":"MEUCIQD5ngDNf5oivRvFRWc9smkKDAtzSnfTmXEjyCe6e4SGUgIgeQeFx0WVu4PiyNKGCconPS5yAqLUgPLRy9wrnjc5v2g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86216,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgd7O/CRA9TVsSAnZWagAABaQP/360o19BT/Kb+yUFJkG5\nql7fgXEZpqCqdlhGmlIH0CzOizEGYXDInAXzDJ+vRo69GVPmbvU5ClmTzDD8\nR7nnTeh6RgjMiBcwZsNsZGKKUQIdx8CiD/sKPQ/gS5+4YNVt5qR57dxI8aYD\nyYTVTqEFSa5GcXcP/1Bp63oi9WDVq2EQWRWi5rc08KcpdN6UjwMmIsZyjlzx\nCGHQ0P7mFTePCjExCjFMHtZGrsr79jZCamJsRQ772JTVZHq7iBdX9m7s25vy\nKKIcByHuv2nAO8SWN/cp26a4er2l37rR1XYB6E/x/7N4uHyHYKZCjRYO0c/i\ncHOki39qYk9RPqheer6vrlC1lEdHJX7kaiBeVRv5bP/IQWrxtahH3fkpBxJs\nFY77doqeM5rrmKpM2nVSDQ5BuuOvT5yQzOdnsGTACGeuKOMCMrHw6C4aYzyF\n3IPxiDvw9Tf1fy82p1vRTdrwOqN+wnwC4FP8p/WUSESoaRHwSB5KlKMPMAA2\nRpny7rcgKxO/BE8iJ1C+atcidRYJubO10gxLLQ9fTOfYglOBBszOKYJ2zvNG\nNlhVM7TfHwPsQJqUK3nfSNm/c9HimwtG3e6D5hKipDL9r7Io+30dDLJMZxD4\n9jeTBF+6Y2gQ9Lc8l9Ju/LGDvPEyu1zVZPoHomKWUdaJhXxCAB+R60hgI6NM\nseim\r\n=UnSI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"877452ea28c60aadd37b0d925f02f65c7f7b851b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.73","@balena/jellyfish-logger":"^2.1.25","@balena/jellyfish-environment":"^4.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.39","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.88_1618457534588_0.013766333756975113","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.89-renovate-non-major-55f7866eb2170d982ccb06c90251745f366adee6":{"name":"@balena/jellyfish-metrics","version":"1.0.89-renovate-non-major-55f7866eb2170d982ccb06c90251745f366adee6","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.89-renovate-non-major-55f7866eb2170d982ccb06c90251745f366adee6","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a4b8ebba0c2e308dd57c31ff906f2999f6a6f7d6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.89-renovate-non-major-55f7866eb2170d982ccb06c90251745f366adee6.tgz","fileCount":15,"integrity":"sha512-w02W7rrvKY6oK2hC+lO/C6wfAt6azVSInLtZ2C5UPmt3bASVH/8HyXTjFVAoHL3U2XAtGtElEynVdh6OZExZ0w==","signatures":[{"sig":"MEQCIAcYRvgsMvWRAFbbRZEh3Nnr1rrOmQdvuhMeCJCJDHR2AiAlzTvvbblMDovxKf5hRBiA+fPW7O/MgM6TeO5pgAWbEw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86378,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgd9EWCRA9TVsSAnZWagAAHvYP/2G2l8XWGkUOiB+5RE5A\n6R6bRDDizisEpV5viqsH1dJVBACVGtkqQRhT0QT+p2jy7BvwIPHuFgpg0Pe/\nD+L5yhHWacKweVhXs4ySErSaKgist8o7oQv07cZKgTnTAm1nLKBIlKhLZ52B\nZEuxSK53gkl8ioYW9osQT+ajzpv0Ni36BQYMt7jm10Cq1oyQkaIGuCUZ8icG\nsGoIlUstP2KeD7gDmrtgqOG/GEd7iIe+EngLtXMaq5yMm5zg3kMou/Omxsim\n++wkuwr5QCwKGhVhb3N3WtWywavwF28DoT/3QOcjSwGQIGGTak6yFWVgMPKu\nQ3QPHq7Lg3JJS6zJVlk+pn0gngWSpItxHvFxUgC0f0/3pdyAXZdMMgQi3mdt\nvHVJqAfvjiGw03ZoZKFy/37c/gfNbayZSvB3XQ/ON5+3l4wvx3eHQDNL5oj4\nHLJkIkuaNnwQZANPaJCaPilBsIf7TYGvWFDm6SicviIA3tMe1+ZTV9c2Zq9M\nMoZwRHEb7EX1r/aEB74YZz58Sa8Z7IGE/u2j9t4fQKb7GL0skAKUhR3O76/X\nDtursfs+mflIRo7wj9rg7b0U3oS76BvWmuwnqEMmleBKGpACLzC8Sk/CRl0f\nCUF907GApqVvidpVWGtGWwqQ3DQQb7q3IRvfhFSF48poC5gOYsFibngOTQVi\nvyMp\r\n=U3yg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"55f7866eb2170d982ccb06c90251745f366adee6","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.74","@balena/jellyfish-logger":"^2.1.25","@balena/jellyfish-environment":"^4.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.39","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.89-renovate-non-major-55f7866eb2170d982ccb06c90251745f366adee6_1618465045704_0.4659684093522174","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.89":{"name":"@balena/jellyfish-metrics","version":"1.0.89","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.89","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4a13835db5f69fcf1a45cd3d10e4bf24b08816d8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.89.tgz","fileCount":15,"integrity":"sha512-4EiCeOwWVElFFkxapL+B9Suo75ZuJprvweQ1bbXXWIy/XQsB8Kw4tGICf2wOsdHyJCtZcopCQRtXbecAwoj9Bg==","signatures":[{"sig":"MEUCIQDXlTcvNLKD5yVGVfWIoQTJCjNIn1t7XrXxt1mXqRnL+QIgIflF596EnVnOsT9O+iDgqH4gHeZDXEUVNGy39kkgmbU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86318,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgd9IcCRA9TVsSAnZWagAAIUQP/2BvA4sUr8/WBthJL/0N\nmjMWlSg8f9P1bLmSQP54xmYgLJsju63bZ51hhsfUxDkFH5Qim0ra8jvYMh4V\n02AOoRw8pzLAWppteVOcsza9PyZGifVSYVsiXaKQmRCjmFGyoMmU3w+oWXPa\nNakbRUgr5/D1KQNd+4RlgeD6zmcp+dy+Swio01/BHbK46cY0ztx+KfrJJvfD\nhuXUQgUIEnPfq2P8+GzaCnRFp8vQnh1MnjOpt4pibro4LyaIAVxf5KpjUB8e\nFuiPUycPQD2CyatvLWQwmSEUC+FNVHwE4jvgoQoVSOFYN/neovBY474cl3m3\nZUreH5dcqglBx4Ct9II7uIEzo3FfUB1/tz8c4GQoHBeW9MhEif7KvL1LCic/\nWAHOhg4XUkOeQ2YY3mWXenDoEzBvK2+Yq4N11KwVS/dhLODIWTjyHDQOxSnk\nDeenUeGJVkmBIo6DD7UOnqgFNaJP/Wf8zLftcIk3gRVMJyRxal1loIVyTIVN\neaPBC29Clv7sT9KuqCgS/ss1QI9XMv8z3JSsJJSHJZxOs6fk/bRaAgdLqVZz\nnxeP79atdgmS6nmwaZ8rFXMJXY8hJGFg6yEcrqQVK1msQfrJt1+Fmsgv55QI\n4YI+4rBVyJHrGrEd4wHChRrTdJCIsVrFhgmHJvuaydOzvMd/G8PiUuLCWMeN\n7juv\r\n=U5AG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"833b62229df308aad8f3ed125271ced5c4ccce92","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.4.74","@balena/jellyfish-logger":"^2.1.25","@balena/jellyfish-environment":"^4.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.39","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.89_1618465308016_0.9050476614749621","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.90-renovate-non-major-2f0e426a59a276c93a36e6c92dc4647bb5034ab5":{"name":"@balena/jellyfish-metrics","version":"1.0.90-renovate-non-major-2f0e426a59a276c93a36e6c92dc4647bb5034ab5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.90-renovate-non-major-2f0e426a59a276c93a36e6c92dc4647bb5034ab5","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6079af80afff2a069fe954d7b5e3af3f22554096","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.90-renovate-non-major-2f0e426a59a276c93a36e6c92dc4647bb5034ab5.tgz","fileCount":15,"integrity":"sha512-aayC9V00BGiZeOxRDVA2mUcpuFCN4K/FOyrcnow5iW0a30Pb8KyMWFqHv54UcCiUg8K/VjAdDK1irI4lYXHK7w==","signatures":[{"sig":"MEUCIGfGgHrpfl9xA9ofZen5HEqFojcCywEoIgk71gp0EGe+AiEA6YJDvZBMQvqYIxrDZEOI7j0TYl7EGncRE5fpQo7xsxk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86478,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeB4HCRA9TVsSAnZWagAAn7EP/jd3mhxpzwwjL3BJDJXm\nDHSvrGwrFVBWOWIMpfbeFzjkbqFREzMvivTFwREPnhH9iMSMdEduYkF0mqSP\nNGON5vS78fohZGTvIhBTyvandlLiCCQI4bJhZJ7n0Oja59ix97J9b6O6M/2+\nRx2OXpBDp0YUSg1g1SM4BAvM5f890oDj3UVyS8vGHgwnpPM/Wkv4dKKLbDDp\nUU2jP/yph2ABqEWa/TvnT3Vs2cuKfyEkyss1u3biCxCfTN6uGW8D+NlE4iSu\nrvjKTe1jjUjyr0y9Ab4uW3BCVaWCVOHMD5Rz15sBSnm0ZY0LxCSFv0di3Oa7\no/Oos7EoPh1EUmoxZQqZvin9JoWmEUFeAAUZ4m4JBzrOSPS6x53C+eL3xW5A\nzAoUOYvMoqSLw/BvVEkDwIoA1rQpIKayD2AAGIA+FRmSkbXROcFpW83rHZBA\nobeGNTTw1WI5FM20Y9jRtkieL/XlFGpZI4EvQRAr7qgHFgHtCfwk+04XqEe0\n+5H7p3zM+OfTKUK3Ug+NNO8242HbxCQ7/uih1laFfy6q2ih3T5dsa+6Rj5fM\nW58XVlnCgyMOIEyqjlElbTtF7aUvwB3UyYnYbaRN5sp/bq4zc7MquqZpA3nq\ncDmXO+Dxnl6yU48f6KqlJ8ryH6kbsHTElS5HOTB6xq6HG87EsyE92fnpvTgZ\nd7TE\r\n=fHgi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2f0e426a59a276c93a36e6c92dc4647bb5034ab5","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.1","@balena/jellyfish-logger":"^2.1.25","@balena/jellyfish-environment":"^4.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.39","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.90-renovate-non-major-2f0e426a59a276c93a36e6c92dc4647bb5034ab5_1618484742482_0.7479896138565838","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.90":{"name":"@balena/jellyfish-metrics","version":"1.0.90","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.90","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7c4503fe0820ba3cb49845b670485b62c87f31a5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.90.tgz","fileCount":15,"integrity":"sha512-HDEOm0IrNzoREzpuGbPb0xmEtXHS1XL6ts+R7XCKw9J4g/jFseyhV64YafbRixFMZ9Rda+/xASoQkERb9BoWpQ==","signatures":[{"sig":"MEUCIBlDfBPtva2RtqEMYY5+7PNXXi8noEFhVhfES//dms3ZAiEA5f18C1ltvyIcPbXOC5HcqfYiLqklMmN+v7tlxUVyoWM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86418,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeB7eCRA9TVsSAnZWagAA6sUP/RvSoVbMMBS6pDG2Ujy4\nfiZsI4D81DX2bdJbRCG1Uk63WTqmN4+4vkQNQHPgUanPlBvVCoKsCQgm4N4K\nWFoXLeMUTbBm4CLV3GLd3iafpZ3h5tX0nCW1Y0Dt6bw93pBfO+Z1Uyohqh0M\n9SxIcNwJfL7h0hQ+lOYl85pj+kFGX0LM9fQQF21issfvRZVwJUqPA91p4PiF\nfuru46k50EyISm91G5eFRm66TAXy+bUrZH/wpYJBsjPbkEdyZqUD4GQeFW/B\np8wVWrVkBFc2F6YzkhJ9ReXIia2JkwJaihL2hQZNvHvz2S5v2uwsOmYwhRCY\nHGTT5XuXnkqB4zN/fI03KIZiqzCAPy36ejOZ5HEXESQ/OcjPD0SF9VGgp7N2\nFbBrurRXc4dL28imHTuzr868M8HJ/YQWtGVkMVKBmthZhRLpwIopuBZ7Fe7D\nV06nZW2m83sESqiSTSlNgGP0/ZSazzaeMl7Tf/DdWXOb35Tgo0KkVneAYUWL\nZvYMHecfvyO8GtRZfZXjWbkC6O4oU7qY9Yb9nDcjv7/UKvp1lKAjkEbWarJM\nHW0gk1W1YemCgnDVqPghlS1Ytz/XoFTxWgfXEQf1xb4Q6mwuzXP/HkEpHAQT\nXsYl0sny4bgW80JDMA0Vih+SiHDite+DiYC3doNzGphIne5vr71pbPAoyh2z\n6s0Q\r\n=T/U/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0d4fd3454d71b89f13131cd640c63ff6fc01ee1c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.1","@balena/jellyfish-logger":"^2.1.25","@balena/jellyfish-environment":"^4.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.39","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.90_1618484958404_0.09853838090712319","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.91-renovate-non-major-554e5735971c315b919511c8e8401860cf023b6d":{"name":"@balena/jellyfish-metrics","version":"1.0.91-renovate-non-major-554e5735971c315b919511c8e8401860cf023b6d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.91-renovate-non-major-554e5735971c315b919511c8e8401860cf023b6d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7e48d1cbe76495b21da1f96de3e0fe9064dd73da","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.91-renovate-non-major-554e5735971c315b919511c8e8401860cf023b6d.tgz","fileCount":15,"integrity":"sha512-lUtcFXqAQCKfz5YKMVOy3dSFcBHXz6zcSCiL2TxgiqwAYm29drEm6Vr0cDA8nhldca9w/toVq8tzfRNHbrft9g==","signatures":[{"sig":"MEYCIQDPvFWF+sqKij5LpiRZwcqRBKn3TugMTH1gL/iUNqql3AIhAPGnjqde1JD1IPaPBckzyEdarCIBEtb/uxhVotsXAEIS","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86544,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeEHkCRA9TVsSAnZWagAArOoP/3p0MKK/on9V2n3c8Hi3\n1HZ2HRPiY6llhZISjXbG085hutjydlQI9nQhiZg5NjFDu8P0Iclx48Ji7OhK\n3nDZaVvSQ/p5WzqUL42TiaZHRdVno+yAmN53fqD+an8kDIxve/tHDP3ubF3m\nELmfqEXPOo2CEqOGNVLfFUT6j5fzduP1N7tEfUsYR7Re7BgZNoPnwsfk+ajB\nqwHAAjBfT7S6oudZCjz3dgfxfyhtHDpcasac514WvRRc7vNoTwf0L6yVIUg9\nE/MKkZn3/ZEfCSNBBbg+PneG4ZvD5296Ji46pWnCSCLdVhI0q9pJcIrpzCtl\n0JS4kA6BDYC9NrvIzNbO3uvGJZYSO7SEFE8q8ysusR5bXYhs+e2NVT0qgrQe\nCeLW4TDOQSBzMgZvC0tGrc3iiHM3HlKntfVh9p5OTzcqqNFv+k7xlg8+Pxi+\n+XPW/rfBaWjJzpX/IOrKgT+C1pSZEMzUi6ZlfJHYIixn9Zpx1H+sDEHcXov6\nTOMKpsPz87apiHsIP2s8DV56PZdeirnzWk2cfnpXUOSoYj1LJKwZd1tKLYIz\nINNIH2IY5SqZD2JQ2iKE9/zx6OIkJL1JFgn3CXCYiX3+dvIMc8Li2UjlaIz5\n+C1VVFgZZE3dt2ECNZPquK2dWSOU37GSG71zdTLpfg+7teqCT1glAwRHfu+y\nw5H9\r\n=1ey5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"554e5735971c315b919511c8e8401860cf023b6d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.2","@balena/jellyfish-logger":"^2.1.26","@balena/jellyfish-environment":"^4.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.39","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.91-renovate-non-major-554e5735971c315b919511c8e8401860cf023b6d_1618493923555_0.7349620245733446","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.91":{"name":"@balena/jellyfish-metrics","version":"1.0.91","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.91","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e24a3ab0e205a4d8508b31021ddc7423e0a04f30","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.91.tgz","fileCount":15,"integrity":"sha512-sksLjU8xwqN6U06lNYgQKJJCbmrvVzUq0+RDkSIjfBHhPJt2iXxiZq1e9oCsyqa5TiT/FeofZR8GCywSmnB4Nw==","signatures":[{"sig":"MEYCIQDcizLJD/fVflLWMw/4yoFmbaVlzgLxhdPg4lC+pgLBegIhAN4NF/Ss4VgHBN3o5RaX+Dfs7ctaTYnvg52GcAkSioLQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeEL6CRA9TVsSAnZWagAALpoP/R8aeQFLGyaS9aNGY9Fn\nDVHwhfU+/DLCV+Gop/evSDdvXDy1n187vB8TOukzR1eRuFT/QhHaVXJzEXPo\nirw3fYPjiAAmmofuVCnn6CSWLvfTOFc5Dw0m+2O25gUz/mHPp5ViQkiDKCob\nkFVSeqnWVE2tgz25ChnBrFljH7F/TsIyQEwi54thv1i1YGNshlaQyAq+Lq0r\n+k7g80VeXLvOdVGClH9frrQzuzkNR01INllu6XMOR9EZ36bcQRQKxQK757B7\nfJXOfXw2Tv7kJA4DdD3ncyrHAebS5NGr3rxXJZyaehQ5LK9pfxEvjd24E21e\n9gCAI4G9fF0n/jinBZLjNfI3hA4oVipqV6jTymoX6rMmnG1XvBqg7zXDsVLk\nd8wWQuavGRSQrGir/IWA8T6bp3A5MEwZ5XnEeKggcA4bua5QlbQCtyNJ8yBB\nRN+viqEd8/FXmm+N4V8/uYjXT4Nt7l5Kz6d7n9eJYm+SMH3GXyJnLskZ3c+N\n1UPvldPNWTuxe75n6T+102Ummr5yAoRthzTNWsT6liYu9r20WpLRIXXRehlx\nHNI57WthU1sGYiadPmdQQd+2ILucoSSjinr2C3UUPC3b+KxcAKPbsckX0T8R\nHB9xqOkSl7Ma0SBUwX/dbDXXQ27bkLrE3/aJgQ8fKrigbiOckO/kb+Bpfg8E\n3dVy\r\n=8lDY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e0beb9e1646fd90588357b05966fb640938193a9","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.2","@balena/jellyfish-logger":"^2.1.26","@balena/jellyfish-environment":"^4.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.4","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.39","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.91_1618494201964_0.02274224983955464","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.92-renovate-non-major-4116298e483f40e10d79999f795eff4d87bed5fd":{"name":"@balena/jellyfish-metrics","version":"1.0.92-renovate-non-major-4116298e483f40e10d79999f795eff4d87bed5fd","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.92-renovate-non-major-4116298e483f40e10d79999f795eff4d87bed5fd","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"71cb0fac867a27aa4a079511b443a65e7bf0551a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.92-renovate-non-major-4116298e483f40e10d79999f795eff4d87bed5fd.tgz","fileCount":15,"integrity":"sha512-6WE+ds13RsQ3NKv/XH4QS5kiDX1u8Kjtv/x1A0grLl5AL5dchRxLoRgPoylP9YAMmzuWkqnuGn0zRybFKa79XA==","signatures":[{"sig":"MEUCIQDyFYM0IVgjGlzFFGYDk/TRKIdPebkWr3nBb11kNgjvqAIgAoRShi7OBCIKXoYvSnewrGBgnlTH4WS+k0h2gbhtVIU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86610,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeHgzCRA9TVsSAnZWagAAAG4QAJfXfG511PUPyHIUJGzW\nIwWndm9EesH4w672e3eoxPq7pNAW9r0OKMTaRWI1yyXRpGxVOARI+Dm1ePe9\nwSXbuEewowzlbftplIq8RkrOm+SRIjoEM4Xmi3l3ye8vhm6I/RMddAnHNKHl\nZ0Qrurracl7AG8YF1RHqHls3f/vt6+CIO5TdJA00Sjef09qfHUjGt07GYFO3\nhuWfep1Gmoigr2QYdmojG69dB046DOWULfVjl8MdaNob4+DVD3pZsDcAOdpL\nStQAGXfjOtoAwuEl80GUDz3TYaPh5FFjUh+EuorgqXbWDaTpDBsTtjaduS5g\nLw7YKaXQDtCLxGVvwVNpcQXXvxAkfaXd2isUt1IkUa0ZDrV+fb7ovWIxtnLj\nQEh1hdNCnqvKHUucYhBbdHsRXp7vQZLbUlG/ZWIiTgOa6hMKYgl8NE++Cufa\n1kLB9qvkoJ+GkuSQs7LUECHFaAcvc7IkCyZAMsgScNOmt9PP3S4iawx/TLrW\nwV1x6fsKCsXCSXX6fnEOrLnldJqxFYqSwFBYyqvn2ED2UutoDWUXw5eIARqb\naUCVp2CkUPC68KDlPyh+WXgHcTftFX7VVdhe6UvVtS6IFyTuvF4EJOi2Gxkl\nJCTmyNCROeA2OZsHygmnjTJP4ntbJnlsGKAaAIHrU//O2JcgUF4oB+0R9uEr\nEwm7\r\n=LFyi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4116298e483f40e10d79999f795eff4d87bed5fd","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.3","@balena/jellyfish-logger":"^2.1.26","@balena/jellyfish-environment":"^4.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.40","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.92-renovate-non-major-4116298e483f40e10d79999f795eff4d87bed5fd_1618507827197_0.9268435898618654","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.92":{"name":"@balena/jellyfish-metrics","version":"1.0.92","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.92","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"784b99debe8b31e9c92f89689811121b9e191850","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.92.tgz","fileCount":15,"integrity":"sha512-u1wmf+XSkfASyBfOns6vqnNNWSR12vih1s/psdJTwVm9XG7GA1lYcS+AGnRW9QKmfvv5IuVJkrPluARla7eGiQ==","signatures":[{"sig":"MEUCIQCtQbouUmUrqYyYyE/PtTfvrv5G5IR8xVkQj3p/jioRVwIgej9dyNAwgAXGukZPiwMo8kNZPx4PuPQ8D8qKViWqGHY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86550,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeHj5CRA9TVsSAnZWagAAHf4P/RqskuVdH4rkeYD5l3x3\nAsykbFP1NJUjp1tnM2qxIzSJsYat4Zd4p3UJnZRbjnw7Rxn3nbCGBRPE9PhA\nPxjOG5gaBozaYcBHRRpvP/EyzvThfQADpWz66JReLzSF1U7l6ojoPVUS1MmB\n3QR0vU4ScWfa66msfxKVoyIrzmGOyNpSF4cKqamIcq9ycTxfuLExArqdiDrq\nfVde8hrXs0RHjbBfVMcG+Me/cBRiufEZP+7P1B3j1AHgNlIWGCDpcSRGE7GU\nV9ZdBVNJvazosHkq7aDSHgZLtKq7ajPRkwIB93jRIK5+fIDtg5MzE2KxzkNW\ncc7HxkTn6xTQMyfLmFC6a4NlyG1l3lga7iNjQECgM03keGehjhIWcpWjSLbp\ny+9GqIIv5xWbTosdF/bZSr0+YLLvfP7LOtZkNJoM8NHgHRhVLWwdFOGavS1a\n4Iib87S65IPAZN/89iXgzIO5OHk+DHM7hrOd7ZL5iCck9djAuNZYyRxE2tCc\nqztkcVbfz/3Yt4ULOI9ID2amS3L/DrkOf2408lhCdWjLeC2veo+uf8I3u72S\n+c/pbakdGmi3W5qDB5I7OHCTHg2iZAqrE3mnMH08sGUaVRVh3ppxyFrK91Ms\nFz4xlXTMdse4GqzCgBXgHJJNRrNaiQeQtheiPUYc+TlACUs1MD+hc2z5EAmh\nUi6k\r\n=wqJs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"34712095a58852369d5471a55c1c4c492f19e7b6","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.3","@balena/jellyfish-logger":"^2.1.26","@balena/jellyfish-environment":"^4.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.40","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.92_1618508025104_0.7869266463238946","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.93-renovate-non-major-1d3bbb69a93ab0164bb7da03c2945430b18c7f12":{"name":"@balena/jellyfish-metrics","version":"1.0.93-renovate-non-major-1d3bbb69a93ab0164bb7da03c2945430b18c7f12","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.93-renovate-non-major-1d3bbb69a93ab0164bb7da03c2945430b18c7f12","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1ed1df5f8f65aa7d1bf2dbdd895f2bc13c2a90d4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.93-renovate-non-major-1d3bbb69a93ab0164bb7da03c2945430b18c7f12.tgz","fileCount":15,"integrity":"sha512-qgbwWWiQstC4JJFMRwZXX/avEtTVPicu+paHWoCEmgNFmXVCqr1nQEicj3vQ/9sKTnKDiZCaV1f76sNsaSKuUw==","signatures":[{"sig":"MEUCIGS6gO5vh+aS9eVhd+OY+QRQDzN02eLjAZPkB5oPRm/XAiEAgyEQQdDx4qnvpzyby+kePSpVLiSZljplHCIoUkU7btY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86702,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeHq7CRA9TVsSAnZWagAAYyoP/0IuEY/aRbtLgOiv5wmY\nmyF0YgYwAFtM0o6pTCU1SwoIpNlJMvX0z02+BbDkMoDMHD8QMgnXEthLIQEh\n0Wvp8bBkh3h05pDX77ofdV0oGwrhJj/8r1dHPHMZfNUH0I1iaCaRPoquZyJj\nMNNvMWkF8jCEaElsoNUm5DzS9MSOU5iYlPcNhh2qUwytdquDUTPY6sBeqWiD\nV3NvBCf/vmxk+UG2Aqo0qdgNhAlQB4FuxQoY3Z+l/cR5JFiutbRMlBG+TjV9\nlQgbJdRq4/5njNZebYjXya1sLasM/owcg14JUbWKaBFsIxWiYcBqDj/6BIuD\n/su39rWtkvn0vBj1U4G0tojUbAABL+2AuhdbZ7THGd3jhOkMSQqw2Cb8hjFp\n3XNAheCrGH6XnyemFS4QVsF6SGM8TI2Nty63Je99A0d3X2TSCOLyMkjWnQHW\na5710OpE1YEJwPM5Ghbt/umU/MJvY4knuJ/wWzAFOsOakKmIxMNmLPeuipLC\nstFAwZLypHTosewMvmZPvfkErR6TCA5m9K74gVs0pq6n2aPbaV/jHycPPWaM\ncr9Vs9fBtLxNXEf/73smJh4jKvfLuoFLpzZtjaPqLdQdT9+LqErFP3388X+Z\nX2yVn55LtZV+OHS70vl1IRewySv8JrMiQJzKHXP9ucUGHwRS3iElRVub3cXu\n13bJ\r\n=Ji7v\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"1d3bbb69a93ab0164bb7da03c2945430b18c7f12","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.3","@balena/jellyfish-logger":"^2.1.26","@balena/jellyfish-environment":"^4.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.93-renovate-non-major-1d3bbb69a93ab0164bb7da03c2945430b18c7f12_1618508475217_0.6407481250279714","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.93":{"name":"@balena/jellyfish-metrics","version":"1.0.93","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.93","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"704ea13aef77a1884ea56b9098a3c28a8dbc7839","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.93.tgz","fileCount":15,"integrity":"sha512-3j58z41gW0mOda3zcbzURLMymLR0cYNoln5dQ1wOYr2NBCVUcoc+kfSwZFSctflPEaxaU4ycKxFZNvjcll5X8A==","signatures":[{"sig":"MEQCIHqsQSOwW0UErr5rEFJG/IJHT+ViuR8Knq6te1zcwdXEAiBVk5xgtenFSGiEhP99HKTAafVoYeiocrJHpt+CVojqFw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86642,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeHuVCRA9TVsSAnZWagAAzWMP/0fAIIgP8DDXw1SURHRZ\nN1OQ4DQQHRTeMPrBSDoK3oQ21AQZPU8PltshbeM098PEQF8jwYmP4Oc0PBuY\n7TjU9DETt2Q0ikovqBlsLsTUpUz6Pzc8HI9KK327LKbpyk73RbpBG94KL+3O\nqgocWvUlA6IBGkugqrO88rY6I0T/ZwQsQr374syp2PDvmw6Q66y/bb6T/zDQ\nrjMWT9aKNN3aYm0XKVrDsEi0Yag3VtP3yohv+asxYptBLhFetV94oxRXdbH3\nXXw0Q0a4AST8m+T9m8bPRPRT4H0A4wuVsJh16GEuQU0oENTRj8VjoMXlY0Ck\nI0N6Ek8suilwkrFpgGqzR2MpY19HbLJg37gJARX3qjw0vby28LEnrBn39OnJ\n8iSjg53il/ybv+I+RiZpq4rmg280gfe7o4mByHgD5cILx5u2wLTlfJPInjNc\nxzKJ4Lt3OhZV8IITPh0CVTHQJ/gww5BSzfPtW09nfwvGa4ieHU0VWJUJ39FH\nizQ0SIOlE6iZNvet8ogAdrkmFP3dGTub3ynKU8SRek2YVcZZ/rIiGJDSAEFS\n4FB5m62Ldxx0oQCazgkCoFvid2iRSEFPvILdzLiyZo5r0w82AMkRBmVggm7D\nSGOKq5f3+Rz05DTOfTHmHX6TcCTzgb5EwZkBKSEwRPkSiz04gMJzLjkZMmQc\nHS7l\r\n=45g5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b16e213b3423627addaf0043c169a83d602a67c2","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.3","@balena/jellyfish-logger":"^2.1.26","@balena/jellyfish-environment":"^4.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.93_1618508692594_0.23359617398239862","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.94-renovate-non-major-6a2299cdc84dfdfc4feec64df771d146531f4e59":{"name":"@balena/jellyfish-metrics","version":"1.0.94-renovate-non-major-6a2299cdc84dfdfc4feec64df771d146531f4e59","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.94-renovate-non-major-6a2299cdc84dfdfc4feec64df771d146531f4e59","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b2873aac4895104e1092dbbfe9f4c61c1c2241f4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.94-renovate-non-major-6a2299cdc84dfdfc4feec64df771d146531f4e59.tgz","fileCount":15,"integrity":"sha512-8xunOpwopkKz6leFOIS9Rn5RV/SCSQedeYgzi6TIR8X4/kVuF2sinCDHLokXBfQ/7cAtAxqZEmSSvvynuj4E2Q==","signatures":[{"sig":"MEUCIBN/6lvndP3WviXUFMPyrO85U79R3rXqkr7Eae+M6RGqAiEA5ll6D7cYA2+oIbarG73FqS4qsrmMW7AB9ptm7+ba2sE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86803,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeJnnCRA9TVsSAnZWagAAB9kP/RKcJNdyLA/NvMBupP3y\nYu3X/SJ4swC1HlwYRNIaLXjOQbMzhBLcJv9ItF1Z8XkzDly6dxcg/xtq1+2t\n3bxYLYxdUVSG7iNxxPtJ5iVYW2X6PcQBMghndTPcwVeTRYgBGVCnXnsmS16Y\nu0pHljzlxtDpJx1ldVLNoT6OpvH1Nd75MrLbLg3Askogt5heM0zZ0pbszV0M\neleuuRZmyQpqvZ7miv32sdwDn8W5DO5vPUp4uJEEjoDS9qgnNh/09db6uC/0\nBsHRzjTTjBGZ0x12D9ONvL8AExGI1pT3tEYf04LGYKNP2Z7chBDcoT50Kryf\n4LoT11/RnBsLWpRE4M1p8jO05ayEVWTVSEerZcLYxaqaDDy0QKrhL1ERVnVV\niUy2wOmtNktEbtSmgBqbRv9fPl771Wscm6sYZ+bTgqBxL/fl6jlQTLHvWDhZ\niQCnVRAHjKZL4sajbjV0mIrO19zykMci2kBJ9N1gb1AlDKwhiIdJ/Hj55hyR\n4q/Jz5Sai+z/9vRssoYpnmdh9fhJQ+NgMOoFNsi1UK4mjSc/BVIhBOuUDFA2\nw1hQmTTK89f3G2HqyLgO6iuG3JQzpUavPEOR0h6cPXSR58/vTcDUYPBfVXVD\n4doVtsZzP9+NPZIdTNioAfmp9w4yHB9WRlupjogegLaqwP2yu/+Xv6HFoePv\nVeim\r\n=4By+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6a2299cdc84dfdfc4feec64df771d146531f4e59","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.4","@balena/jellyfish-logger":"^2.1.26","@balena/jellyfish-environment":"^4.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.94-renovate-non-major-6a2299cdc84dfdfc4feec64df771d146531f4e59_1618516454542_0.2767954703965234","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.94":{"name":"@balena/jellyfish-metrics","version":"1.0.94","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.94","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9cb19373cfed80e960fc3f7373595a1fb4e64b14","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.94.tgz","fileCount":15,"integrity":"sha512-/v6+K/9csf/dxe13FqLLrw+JlPYCNn7ZzJXLI9rUloWqvVQrFHKuUa266KUjrSmk6trFiUhXdjLoRr4+p1ckSw==","signatures":[{"sig":"MEYCIQDaccs0S6Gw+PoQey9O/1KjJfsjPbdO8bkaAZTdPGvXdwIhAPRZG+ZkWom/ovY6pcsiqV0JZ7ThICL/xLa5+nPlLIPn","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86743,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeJrCCRA9TVsSAnZWagAA6DUP/2TejC9jGtQwlqCzruqu\n2qhKDuf6pXFej3I543NalsyeggiVdSrHQeF+GIzp+BOYAlUSXqQtTCuo7hY6\nSlImBuURt32E51lNWGADlO4PQCtdglp5XqQ1eF6Wo6CV/4cJJWjiTMbICHzc\nhg2+NcHpVeQ2iRj87sSr/ZXs9wyU5484Hs8PHgc/TMxD9nECnyGm7GyquxsP\n4ffCE/kWjGw3DO55RXeFMMrAqftHXK73Da9RFg8/vlEZaE4igqyfS58tT9Nq\nINEnJLJCBuqnaoKajqV9YZFAfi+fU0TT+x9lz/fCvvaEQy0/A9qzaeNK3L+G\nZh/yjw3rU7kzvd5U8wBnqWzmBOOKBa3AHdK6exPJ8L/CiGu0X07nWYzBGvWM\niiXzLENlfL1LjtlOwA4RjFS+EIFKMY5xHalQuCTw+Tei/gXW4ZNUxAlAeT+h\nsJENkivV+zCeLgUirh2OTvnzNi5yT7o1s3S4il8XfSkWG/VQmopWM1EKxT/M\nDVXnGR47A4sIF4lAdh2DUTjyhZcIGiHg4K6upG3a4MvYc76RYl7QilXb+qSx\ns28KZ+sIUHqKGfTG22aJmOKA5j/kJI5q5VFG5i+Gfq+WZ0cKilv+qnJu1LNd\n7xEFs4egiiNgmxLdYANsm08Bz3/6UYRGbgt00m+HLLITUvWmDg2qwdDh9Crn\nhUoX\r\n=GZzl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"cc89b33f796eef4ae85b6856d720167a544018b4","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.4","@balena/jellyfish-logger":"^2.1.26","@balena/jellyfish-environment":"^4.1.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.94_1618516674315_0.5179338961435263","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.95-renovate-non-major-5c7f26158e8d5b98e6b209ad2c493ca6c8a247a3":{"name":"@balena/jellyfish-metrics","version":"1.0.95-renovate-non-major-5c7f26158e8d5b98e6b209ad2c493ca6c8a247a3","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.95-renovate-non-major-5c7f26158e8d5b98e6b209ad2c493ca6c8a247a3","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d0947d6a6cff28877e33ba38c0d30704b9992086","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.95-renovate-non-major-5c7f26158e8d5b98e6b209ad2c493ca6c8a247a3.tgz","fileCount":15,"integrity":"sha512-BGpXBACQPoWnjGUNq/r0UmYNXtKPiWAdKk1PrgJnyIptb5XBLag3h/v3p80zjkxoPbFqP3f/sMJhdBRBviXsvQ==","signatures":[{"sig":"MEUCIQCyBUWZlMy2lLTOmHdSGjGf5rFzDvRerP0J+qPS/eRewQIgGTXiminDR2pF+9wRVI2n2+2rOyzyOmZnDP+tqEZb1ak=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86910,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeLJzCRA9TVsSAnZWagAAsQ8P/2Wni8G+hoFKGi+SCCz5\nL2NzYeGR7sqUHZn+/tKSMvWyU5FMG345fSeX4vvkgiQh2tksS8C5nVnhj2T6\ntB7c6uGpyIYoCDGEA/ZUnm+6n9tYIZKiuLq/SroOicz5jM70ZdMt+Yfh/1sT\nnLR7dSwuOAHiRpTfxDqJk7KLicTeLSSU2U3n8UPLfRngqWYx2eew5K/JGgUT\nDKc1zfVTKsXIrC7wDwNrJVi398qWLwzUm3GcuroeyAPX8y9DEel229+4q+2Y\nE3EVS/FrekiQxDvMagR7N0ruygNDCnfPKdx6jo3arB/Lvaj0+rhaghCoxlHV\nPSt6IL9bGtATOX8mZfjOP6lsDA+GgJSrOfYCKSz8/B+w5nwG7E4n73H7oldw\nAVj7nvA6P2ctw+2BaNuGcxcP0Q5D8dp1ZxwXXBecBr+T7j2nDI2OGx+upoFI\nAX0IxMiCP/SuMX9RVHRCbnBLZhEZld8r4tTfQkeoXMgMCYrTU/z7cX/o1y1M\nBO9seqFuFKyT8UZPv0+ZiBGVi62oTEvcT1O9ME+VJnkpDBJoHZr5Gr/0xS1j\n3UNO5wlyL1+HtuQ9nHgm32EM3t2MvonOJvQmoQmEb/yeJjbtVt15ndHDEyaw\n4SgEMgndRHpxbcC2tuAjAaGyubD509rfe1N5S8Nep8/lqZ49hPPjjt10z2y6\npC++\r\n=UeuT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5c7f26158e8d5b98e6b209ad2c493ca6c8a247a3","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.4","@balena/jellyfish-logger":"^2.1.26","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.95-renovate-non-major-5c7f26158e8d5b98e6b209ad2c493ca6c8a247a3_1618522738719_0.9797218094326225","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.95":{"name":"@balena/jellyfish-metrics","version":"1.0.95","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.95","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ef51c92468af6dc234181d5798b4fd09ff70b0f1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.95.tgz","fileCount":15,"integrity":"sha512-5qexxNNs0H1Q3dY4fA9sAGSYFiR079wR/leyXdO/ztFeXjUNloWumty8NG1OK3SRj4e3wbhmslAaITrkVAbCrw==","signatures":[{"sig":"MEUCIQD2B/+pfJShQfzCllqoRvNZu00PIm+e5C31hMZw3tADBgIgJ0tMmvuXkgAHXDDbeNeeFMxwRD9fbQq09/0ipdbf99I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86850,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeLN9CRA9TVsSAnZWagAAl8AP/14gruRKSHC/KTZFWZFy\nvjEDMPWVRvsEwhDpRri4xFYSZhT2AViGSBTyAI83F+to8fxCnIuotkFF8j9I\nvn7mXmvNBkkH2QnSGIaYge7hw8EGF2jJXt2cTXlDNFlA2KW7gRbVEjgylfLk\nz97bOeh2RH+/FUq7ixC/mGULFw1jI2noWXG4bDQa5EvNgBtWpv5A4hhYnwfz\ndE9E5XY83vNFa41vSU3W8jlS+g6sBnBliG/IBKqk+j9B90qsdv5zOWb11Oui\n9RCvCYoWE6MXcA6xTZOWI5XVyZs1QCj3ri4qMT6Jxo/xPvR7n6ctuG3inlGa\nQaS5Cz/aFaDD/0n/dVce7xVBkTZ7ys6QANYrtSGbT4xx++birqp8stdtzh7l\nWWWxssj5+w7ckRfOMBZgY+sAX2TZ82ERDmKhOdxRslrCamp7/2cTfnKw45nw\n727Vi3jRnmgB8MCO8hkkoTAqNaWGEWw5sX29Hx05nKGg3hblfR8yIseCMX87\nYNslaPu7Bqk6y4m4/RUz+OoxYCCNuBV5JvC3SPCUfbhNZRLhHOknlvhg9Haw\ndXlJLfBQW5VM+4tdR4meyWbcpmuvm3Z9T7WBSdjxln05QuZnxmaGu3S+lGDW\nQiRpqNdRG6okp2ZoNOabWpfn6yh5ssU+NOMxayzToz83bqOy9i8o8bbv+Uo4\nSAQC\r\n=gw1t\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8c157c7b06dcb0b2e5812545fa82bf4a98f7013e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.4","@balena/jellyfish-logger":"^2.1.26","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.95_1618523005041_0.7722587402460683","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.96-renovate-non-major-4c93cb96afc7f1347b18b1716d9f7cc26fd1fcd6":{"name":"@balena/jellyfish-metrics","version":"1.0.96-renovate-non-major-4c93cb96afc7f1347b18b1716d9f7cc26fd1fcd6","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.96-renovate-non-major-4c93cb96afc7f1347b18b1716d9f7cc26fd1fcd6","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7629607bbe7748d0d57e1e1dfff8b97d8586b544","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.96-renovate-non-major-4c93cb96afc7f1347b18b1716d9f7cc26fd1fcd6.tgz","fileCount":15,"integrity":"sha512-Z+kVSlqpEWu20jlF8t3/GJ2ZAhPQHlusURHVFkw9dFaPzWwtYHo9KVQHlfQgnCAFPc6pxUpTRCIhijVZvY0xdA==","signatures":[{"sig":"MEYCIQDapmBEw+mNdIkz8kvo+fNTlrcxJcKflnvK8YNFbc6teAIhAPra0TnnXN878FwL0KIN16O+idX9fNTjeINCzodtMIhW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86976,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeNFGCRA9TVsSAnZWagAAlKsQAJy9t2WD9x6H8yhSJTOi\njSLa9ViG0quaPJ82jfVWOiPQZxMi7xQp4kpT0UpjRFa4yGek28mOefcr45g2\nNlH19LJtcOZxdWNKottdfCTVVJVVNK3vsivogOPW9kENQE5t9Ag4dIJq2ehY\nfuCxFyK86QtPo3savf+YN7v63ut/2szBqJYm1RTq4IQWRvN7Hqnc9CVmAORZ\nZgRhlGjRDLB2EXGzNM/b6/rMB/RC5S6EYJD0i1C05DIM59M4xfILMO2iD9sN\nBvSIJzsLQTVrnf7+b0nQNBFa6rgQg1NlfH9mJQ3GW4nYbAo4Wv2qPNPjZovR\n4ucQWHT/MfV7ADQcVqU4e/3Kqlaf7AYjV1AcdI6cZwXmFOR1YeB3j8jvZg4R\ny+yWb/zu3EH6+zSrL4ridiCdHVKB8mdEJbLXkl6pboLtHjPptGJkylnID/3q\nxNFjjdgqrn7M5dz8jbtlHPiasts1DSC46ep16jad64W5mnfEnsnX+gfihl9r\n5YivczDwFm8qk+SN4SI8VEpLWyPoiypojFhHq59o/+m9rmbNEpVBQsnXqXVm\nR1usNls9XcSJYoMUWqiTqT7W+XHb0iQ6VnuePMOanHQUp+MwqZ3U9Yz135MO\n9b7260dFeykhEHNIC6+eZLM5K7cZCFbeeoKg278VnpvoRlRKuhISxZf57639\n5XtK\r\n=SXe/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4c93cb96afc7f1347b18b1716d9f7cc26fd1fcd6","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.5","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.96-renovate-non-major-4c93cb96afc7f1347b18b1716d9f7cc26fd1fcd6_1618530629497_0.7511042310877236","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.96":{"name":"@balena/jellyfish-metrics","version":"1.0.96","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.96","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e223ebfa7c5001931f05d86298afe7a92bb0a69f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.96.tgz","fileCount":15,"integrity":"sha512-5oxVrFdtgERFqzgXQ1xn2GnIseoJEi9jMwVdfRpYFgQZcUQWXg7p5/Kafh5ZJ8PzP9Xxy3UDyROkKwNoLQKE2A==","signatures":[{"sig":"MEYCIQCg8mAHi3MMqFit7n3OX4vasZLnWRcMP07XP4NZowTPqgIhAN3S+DiUL/TZcNS7wgqVHL/Y7EoF+TbjTBrWswTFER7j","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86916,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeNIYCRA9TVsSAnZWagAA/z8P/3V21Si09xRjxe2pnRqE\nwx2WfIGqAqeYOvJFCz9SkaK73EJhjTXGtzKCNaAA8MYBnSMFZiKRERB3rWEU\n3aHF9XEW0hcT9VbxqfqcjlcOMOyr2vqW+Abb+vuUWJQ2BdGw18QU2I9JKaOJ\nueB75H6ZFunrmPKUUpZokPT9JrV/vuOPEdBCx9CmCyYODlbWYhu1efBc49Mj\nJa8JDkaAWQ9ODF9IQ4sYtieY1/+ioWe0AealD9sGzlQqE3jbSPycVOy+QHid\n0UUKfPHUpysBkTwAo0VGgERRpQNzQNYyXA0JBRFiqdKlEHffUG9K5c23zGXK\nskDP+PzzgDdsOskwGZXGm+AK48KdWqe9yxZMQZduzQD8RKtzGXgPcdVHPcj7\ngJ4Y3oXb1tLoAVwokfRNWcV8bpEdBX7neBTT8VPz2tiKD2c4ktcc1UTfxETZ\nfjoDoGlVZfdLMo6h1en0Ydc7rKtKKkPRs/sfoo0N6XtviwE3y/fTAFhkloLz\nbB6EdtM7d1N8k1d5NkPidsgOEPc0eYeOMB7ZVf9yjoszMbByOskwxvwc4brB\nAnBLyXyuRPMOHxs8FsaKi2d/IJjuBOeiIs+HgyWPPjbb3Cf04bMNDfm6HFD5\ntdOww/TaVwK73cDRD0c7CgOUGSAcIsJWDJEqaqJQckkyV0i3cFvs6I0B5Iql\nveBJ\r\n=uA34\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"66593a6237547770f82becf0e6d08991e2bf1ca6","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.5","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.96_1618530839972_0.20368175224533802","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.97-renovate-non-major-8cf75fa0d99da6c6c3f8a8a6cef74684cf2ce437":{"name":"@balena/jellyfish-metrics","version":"1.0.97-renovate-non-major-8cf75fa0d99da6c6c3f8a8a6cef74684cf2ce437","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.97-renovate-non-major-8cf75fa0d99da6c6c3f8a8a6cef74684cf2ce437","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e8eed2b65111c2226af1cc73e5479da2b6377e86","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.97-renovate-non-major-8cf75fa0d99da6c6c3f8a8a6cef74684cf2ce437.tgz","fileCount":15,"integrity":"sha512-Lq6fgd97H373sfSQ8pVeVGkAeXqD+5wDaHkNgJNqCURU184hfCFtq2N5cltEAZdZNjx+gUaNO+9KF9r8WFgGxw==","signatures":[{"sig":"MEUCIQDqDvwCOUwj5Dz5kaFq40oNClTOeWY+u47D0aYdfbww3wIgXnSS8sK9jbN7tU8ASbfi+HMe41j9qjD4ABdgxWXnEsE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87077,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeOqNCRA9TVsSAnZWagAAUXEP/01hP/7hMBucs9d9YzVK\nx6T5S9wN3L12Z6Xl1qPvsz5cYBrBmAVMav73D7iU6I5IF2fZbbE6b9y/5kFa\n3PfbpQJN0RVAzZMZ8GExTV+4fN3Y3EoDNRyoYlncLGE0Cl+EDHi7qdRofNOJ\n28tR81wuWGdqJWPnGn9+6pIU2jwTuNJN1gTGAxmRTV5wQC0q4hihKkAtay/W\ne9u9STht2+rZi/78NWTu9IzrcSHZWD2c10mcmIQQcR7xFReCUBgLwVB5O1zk\nWWSr7iKXbXdiT9BHqTY4BTMhd0qznZ+vyW+Ewjx0tiIjvxcf3lkWiIU+2MlH\n6MxCrUdJG9W9/hIumpY8BNPV3gqn7ktnBGSp/ylk7pXrYdcZRLUBP58H1t9q\nclUGr6F3HURnBB+a5uIEYjDLmcP/m3IvgwaG+0DDe932msMxY05RmJC+QBO3\nc8v7NiDNlsaimLMxLIzYGeIwTudxXAhvGuP7uDYy+ELLss0vHl/HjPECLR+9\nxMSHzE4H6V4M4xrBms4yOW7iE9osMiitAYwnkdH4YqwlLnE5+7HIv4tyVyMW\ny4qmfB6pY2dxs0+HYbM/De2LHAKRt2wmOLDQ3Ei3evlFij+CjZshAOOz7R2s\nR4qQrTekHuJI/sUbyMI4yk8JgBoDxKCrrVWCeTEeFfrPcdkFx8XBUjItPUvt\ntwYp\r\n=7P0S\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8cf75fa0d99da6c6c3f8a8a6cef74684cf2ce437","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.6","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.97-renovate-non-major-8cf75fa0d99da6c6c3f8a8a6cef74684cf2ce437_1618537101128_0.15478369381599277","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.97":{"name":"@balena/jellyfish-metrics","version":"1.0.97","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.97","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9dd3380d87dcd26a7743923405515aabac047484","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.97.tgz","fileCount":15,"integrity":"sha512-84Bve1fQ1oY/IVDUpl/bt3/op+QSDRLW+C/Jr3EtuIOXv4/ZL0ZGJFanFAVxKUFKE7AiLH66j7jVEKiqXQ1GhQ==","signatures":[{"sig":"MEUCIQDL7had70eHcxNlrEeBo21/W3r2eXD+KDSOqFOYArhc0AIgbtlpd+L5VdKy12iVMAEupbFfsmJE8M85d4VdTxrT47c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87017,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeOtmCRA9TVsSAnZWagAAWjcP/3tTh2Zl6lCNPCUK5lgr\n8ev2/vwkXOKcZh7dthl1mPEYkWzuSUOmbd5yrPru3pt6+Z5f3isf+2l5aa5T\nAis2JQPJjoPQRQIn9JgIvXHRW3hhsMrkieQMC0H5mgYF1Q2fRQjDxdCOVPmM\nfGq4R8N9dTZygc2O1ffl0/WVFF+c+GBXXK5LupmDKdKjnq3XX5sUTa22aupq\nhdWe5Bcf1+bNOiEN58QsVbCLZJYHLZb2fpURvr5AvewLws+cXEnDUM32lNFO\n4jJPfHAAUJOPDgynTsm/wsBDJlblRVXZsT4/Lja/Pezo2gZMm6Ngs8w/RmuN\ngiA4GE0excp2iahHHeHAEEnS7lsm3293IcFFaFLkD1vLPWeC3txjWBp+4/+6\nuIIkxU3lAKzNcQD47gVlP7tfP354MFo6AEIa/m5RRThV+FUGCvAU7dvKNPk8\nJK6bR9HxyR3fBQqzBjuBlAx5K3UmsewIodpuNf2KEGoKSBVURIAGCS6p96N6\nRVN+9xuyaR0h5RTiqFydWyUyCGafa8yRRRbG34EffH3mnOqeCHnAZXhYHBWb\nyAZwhEPRb/BZtchtfvHazCgKfj4zEaOmpgRxemA9hesH9ix410YHMcO0dhhZ\nqh6Mns9QojeBrgQ+wOp1e5YplU0sZxZPvsx8Te8IFo2b+CbffJ2qbhRlQ1ge\nUlOy\r\n=Auls\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0ddc8c3619ac38c7b91748f268c8b70738f3055d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.6","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.97_1618537318041_0.6150674700581991","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.98-renovate-non-major-42727f16885184394b8e953551e014fca26e7aa6":{"name":"@balena/jellyfish-metrics","version":"1.0.98-renovate-non-major-42727f16885184394b8e953551e014fca26e7aa6","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.98-renovate-non-major-42727f16885184394b8e953551e014fca26e7aa6","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"60c48ad848aa68d58568d2056be1f6d2b676eec5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.98-renovate-non-major-42727f16885184394b8e953551e014fca26e7aa6.tgz","fileCount":15,"integrity":"sha512-n6ZJh0zsYv/C/9jVICEEGyCc5LVtmWvBEan/8iAAQAEdqNcHOfo0Rc0gKmvcQwMVEYqnREywfFSUEwp8Zoln5A==","signatures":[{"sig":"MEQCIFw0ZK9fqgRotlrwZMPYQbjshCxps84GDueCVYyc8rvYAiBArP+WT+3UH7E0c3i+AkTc52MsXBWKrYDCHiqIkxDahw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87178,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeQocCRA9TVsSAnZWagAAvqwP/j5ZVq2s3+Hsk5Hi85BH\nObmkn4Equ5Tdkso3I2dg+G/i3Fm5UfzhF4g2uQGi/UL5nvs0m8DidFwTP9QG\n9G+PL8yDhIR541funbkiJ9gdSIoxEzIyPhikamkf0vfGoWHhwPzCmIurGp66\nWUOvOmm/6xx1E517Jh9I3F2yrf+3q3R6IcOgW42MC+QO8crb2dz0NRKBOd66\nn1viIBBDupTFHNJFDii2H0HeI3wmVuTwWIghZjCaWxspwCCFY2boZPTDmtme\nrp8YndrOGhS6Wr4yGaCA8Qu+4uT5yTmNQTdp3nk1dTcwJMJ/1zpnkK9YuvhO\n5bqr4wbz9Uq/TIgNEsXD+XCGw8HoWwNEUtvBwpyX7M1iVdrb0TVHWXNrs6DS\nZg1hCld5hnz6ZyQdjZCIqn1gn7Kqp+w7HosEUC8SUPnkOpNwohbSFduePHxP\nxA/Z5PLIFqveEcIkjUC3OgnvLWz6/JY7pjeK7x+g5Lg6KbXJocN3bZ1l1Riq\nclyKPD9ESwjFXtdpGgiCbLrkOAVjMbbFWkZDZZNBLKNwRuA8xhxnax0ZEFep\naybocN4FxSF9GMFyALUelIELbEQwxI2x3Sdv0wCGDZI2uGxuMqbNwLkiFVYZ\nqVEiIBv5BXcfz8nru0+2H5ADK2Ndih0xoQfnGW2ZKYf9EjtD3X7TffWUZ1FV\nCel+\r\n=62p/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"42727f16885184394b8e953551e014fca26e7aa6","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.7","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.98-renovate-non-major-42727f16885184394b8e953551e014fca26e7aa6_1618545179596_0.28364535829649795","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.98":{"name":"@balena/jellyfish-metrics","version":"1.0.98","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.98","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"18d14ab00b9c7b6af90482fb868a471903dc2c69","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.98.tgz","fileCount":15,"integrity":"sha512-x7HaQ3Chwgk1kDTtJYZhRKmsUsT7L/x4gkne9Dgw3f9TUC8lA1jn+F3TbIig4LCvCeL3QBRUUWFG9of2+NXQUg==","signatures":[{"sig":"MEUCIQDo6c/OJ9eYL46AzovO/Pq6w/NCzIGrcX3LvcGhmB1wkgIgWof3bhRB9JjIA8wCCW//g5XCaiwANBPud9eznqvXrek=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeQrxCRA9TVsSAnZWagAAeiUP+wdk14n30n9fROXo9Vpi\n2FPzU+mu4q+hhHMDDqfb8ZeOWbK2aZOdXkdx+BkLlIg6pf0S+V+Q+mUPt7E7\nYlcIlm3Zhmx7oyPn9k4C+OZs7wMA0oczdBsSbhlA8np8QDwiAfbChHK07ply\nnCpYNIXoxmDYjmpfSHVpOJ+x1uSwB6JzDaHvgNLH7iuEBUz9sZ+SPRFQgZSY\njCJWFIS5Z/cpiZjFAJoaCixR0VZuXgDcDNMiChiRgjaOsHyBTNTjXqRqvORL\nifweg12xfvGVSdqljy7cwlveS2SiP5hVYDlU/kxNJRGaGlUgr35dQxot9inu\nDrK45D5foIsQTUTMMQkuOIqsWx+fJHaW3gQPNMatdv6YEcVJ9QksGuASEAOh\nTMYE/cG73Oh5pE/C+qGVJL1lykXvWV2/f2VjkS+sN3y5ETnPTAIZGjYMPyPJ\n4UT1ngvtzH2xDl932elJ2ePR9Gxu1NR324YjwvJOl4SE4YFSSM6xu89XSIpp\nYmrQOGmVSikAC+m9WKsWzw3RWCF1TIV/rP6WTHNEvbewut8BgZhenRXaztp1\nMPya2SjW9mHOEpBpU9U7eBil2ra7Pe2JibAuh/CCV0zS3QlGT2NKVWB0y97H\naI40BJVNC3449qMXykdIOWvkhHAbjEHqYlB40o0vjj0dl+mjOHjm2xJf6qyJ\nP0D0\r\n=HDhm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2c6f822b9b218eb4f5b6bbd7695eab4d7bdb17e5","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.7","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.98_1618545392802_0.38900739457545686","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.99-renovate-non-major-cf41be177e98510fce57ac68a13e3c9ea56704f0":{"name":"@balena/jellyfish-metrics","version":"1.0.99-renovate-non-major-cf41be177e98510fce57ac68a13e3c9ea56704f0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.99-renovate-non-major-cf41be177e98510fce57ac68a13e3c9ea56704f0","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"46a2948fe5c6b4d5973e61f689190a0c2fe93ff0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.99-renovate-non-major-cf41be177e98510fce57ac68a13e3c9ea56704f0.tgz","fileCount":15,"integrity":"sha512-lvZq4UxlejIVC6O9N2o9eXgW7RR1vHuIU75EfpSYFnraVtcRjNjKUzHHTMWP0tNvTDHI6ynropbT6VwIKoxNmw==","signatures":[{"sig":"MEUCIGHJ1xbud93IRb3ZCUnigBGwPe+kXiz5plXw7d+oE6hFAiEA6aL0T5ngkzmQN1ie1jho/uzUT1vv/W2lrCerDH8Pdeg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87279,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeSTsCRA9TVsSAnZWagAAoZMQAKG+IjKgOFyZg4RR74Rn\nvPPp91ABgXD2M8Fqlk/a/YUfI1fK2fqMHNceENshL4kNtnPFGJJdbKTLaXVI\nS2TkA4r5aDJqnJh9mW58zAV53L5HHMFjvl8ZBKy2pOv3ZCln2JQtM/HXCA38\nYiiRp1jV54kGvnpMNES9fRYs0S617tCxep9yMXdqVlDuSoERuWCTlF9sOCSI\nIeb/PtiiuWIYAgGn1AfEFcBWSuxrHUphQnbR+TyHbBaoguQp5emm6Nm4qoch\njbsRpSUNiJ7QW3Altyl1XokX+NGSIk7kFlUjZRwkXzWABtcpdzKwardnKnAy\ncLG8aF2koScmCqTCgzh4QgwZX/1PlFUkn5uvkFqcfc4ku4eu/y9J5Oc1cXAB\nzG1lJpkBbxnc37okkznBVj2JzXQV6tclZVmvqoH7opaoobkEXeDiM5I0aHz3\nJ6iQ+0Ut32Cl8JQ9uF4p+MRrwE9Eugit94PD2pzPweZxk1Uu01AmCfqM+KZa\nYsK1xI31N6jJvy2ry4wDRNhqC3zxCNo9HlAM6Llve9gzZ2rUlbWW6U5pTq7d\n7VD7E4IylsHXnIEm0YfRT99gGwvq4oeTsGLEJqumTK1nYfsQHEhQHlz6w87R\nXwggK34xfYWVQNpHEi0G/pHaiHvOeID3Rzdszxxo4Mr3mfJS0Zh8sCBR+Lwd\nb/4d\r\n=ot2Z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"cf41be177e98510fce57ac68a13e3c9ea56704f0","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.8","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.99-renovate-non-major-cf41be177e98510fce57ac68a13e3c9ea56704f0_1618552043792_0.196897976915148","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.99":{"name":"@balena/jellyfish-metrics","version":"1.0.99","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.99","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"15d1e7d3e138fea3250ecf44f667fa68781b9380","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.99.tgz","fileCount":15,"integrity":"sha512-t3TkSYfs5KF3sKiD/wVE8sakFEUhv4AOWR844j1TLH7uX6xZ2pKOYQtCDUxfE1CiNpCAgO8PZ9iKWPHrv4z4qg==","signatures":[{"sig":"MEQCIFj3kjK0+CI0gJFVf3ARxNWw/SSDO+b9IX092LzQ5yxZAiBW2KypaX3YjkBDh+WbTOuzqR8IC3RF0vJiompK/j8QFg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87219,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeSXJCRA9TVsSAnZWagAAN2kP/2fkXa2zt5Z09GWaQvaC\nRcuD+Mp3OiYrtD9IOc+LW+rUJqCvpuFpzUMM03zGo+2a81Blm/K2BpEJAuZv\nxUdHGHxhothHNk1L28lpLFzEormoadtE0Ioc2eqISqA93ufoyDHoBQyXx5yQ\n3JK05L9T7ODJVNut1cgMwm9IcBO0piXWbfhKIpF7v1GPdRbWxF0U2vKJznUr\nYdLpSivxRL2WjJBlvI7BUl8TAR3xKKBZG/BqQ0kwOEBQwxcFMCzoua1BENtg\nSK44VENgAd0dregwvwNpzU8NqFkOjtjRDtcy+JT3ZtaPJb/P2+YQTWtq1jEC\n80hLfWcnNc2+qxfL48sMf46zCtS4LRO5rFx2EpjsqYcXfLhGKKA3lGEyI1BE\nqdABMldX7wWGm/iHjCWR8mgFe2PAIov+zTg8tQLtYQfNrDzWQW2t9gnhZiSG\nm4Lq+scFO6xyDyNsopGKwj8kw4ldfKB5aUvtAmA7ZLS1rTaRcn3pegnq1aDI\n5Afr0FxvjGuUU7iJXm9J+G/logO50etUoKKGSArpI423hSGTJABydhNkqRNK\nZTc1Zv61OPN3FVTclus8/DBo9dqhorPwKZI3+yrvda8BY8+IPbxZ7gXPeKkx\naJmOFP9h5Z63BWm52wSzwCUQwXS5xaadix7wQLpMlcxNzUwVWGzoNTuxDVws\nN/qx\r\n=ERvG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"af3cb2a84db50e6ca0f0c3f30d6b7eeefbbdcc3c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.8","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.99_1618552264738_0.07370527242054448","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.100-renovate-non-major-808293981f406729a11ffa9b32f6e37bf44e6977":{"name":"@balena/jellyfish-metrics","version":"1.0.100-renovate-non-major-808293981f406729a11ffa9b32f6e37bf44e6977","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.100-renovate-non-major-808293981f406729a11ffa9b32f6e37bf44e6977","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ab673be97caabc028ee8e5368d1715296ea6382c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.100-renovate-non-major-808293981f406729a11ffa9b32f6e37bf44e6977.tgz","fileCount":15,"integrity":"sha512-xAEMtfRo5lXQ0I1vGDPBo62e7cE7Y4e+6DDx8JCUWY/8ETSkQ/lupJfaoI+e4DPRtkfyhCss74nDEzrpoM1Cow==","signatures":[{"sig":"MEYCIQDMN5/KraxfMNmbMaVkzrxz7xnUOaXBi5BUBJPXZhMv6QIhAPydKxsAqRKx0p+zvTTInXOcDi1Ak+Am3w9NT/TBQ6cI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87382,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeWUXCRA9TVsSAnZWagAAN7MP/1a8h4cZlnq7SHv/DrZG\n3f74kyuVwnn07BrLUkVshaxKMaKKZIRiFB2vcSEaOd3weYX1+/2v23qS3WLi\ntLKxXI5ixMB1/nf5x4oTmj4lifk8AK1sPH3osIWhtSS5NcnHmM0nUpwLZP8A\nhTONwI+OzoVXuUAeQca9D6TNMvTVKHc2PmQE9OHVB7NrE4kzTuI8wo0YfLfs\n3Ms3aHZOzt45ByXuYIeODuUO9U+bHaDfUs3pKZTH2/q9XAsTz9WLSCHlZMjz\n+eGgrcMQcVwD97O821zzsyeF5j4IbWcaW18L6YXWBwOl3O0fKucK2sqSgLVq\nsvDMGX7veHdQUc7BXYwMvdoMPI19EQ0lAq2PwypkBtiiNC+59CsbqaVG/RLe\nBecL1AtsUFfXlaupr9TBaD4UuCPzPCwWbJakPn4yuGw4jbdEEjs9L7HzizW4\n/3nx7ZIBdPJih7sywPn0hw+4v6mUuuAYov/39r1CNJjo+gMRSiF0uS95gPwb\nJFovqwQJA9HYKjAljkOT273HTS1OOgTi1djIRbloxkCwNBU975+9XvV7fM9f\nh6t4yPpSoOkfFMK1aUwBf+HfQ/u0rJrFHN115Uhi80KEOtjJbKFwnBzG5ZKj\nqfUTMwEm4Bse2NAvR0CFhr/4UbP2bWSCJQhez8GrMdFKKx1FlW6jiqIni2pY\nS0St\r\n=NFnX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"808293981f406729a11ffa9b32f6e37bf44e6977","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.9","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.100-renovate-non-major-808293981f406729a11ffa9b32f6e37bf44e6977_1618568471168_0.3828564512312924","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.100":{"name":"@balena/jellyfish-metrics","version":"1.0.100","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.100","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"713917f2c5b662693895ff99fc931bdbc677626f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.100.tgz","fileCount":15,"integrity":"sha512-L+1puDSJDhoKMg7neJ187XCJV7TBD+ZJJShkW2DRkhV86Gu4XqRXRqUyl8pahjRY+KQo+yQhFSqsEZWmljZxNA==","signatures":[{"sig":"MEQCIGOrM1GNd55ERv+/n4LRLpIquc50GNU8Bc9VN/IXWvb4AiBpsWCYZJYhNpUoXKrJYaC+z5PgrO+6brB/RV/CkNkYqw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87322,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeWYJCRA9TVsSAnZWagAAw9EP/0KJ8zKFGH65OaxPci+5\npea/2F45Ot+CoC9zspUvrf+cZdRmIFnxXjrXDDlFVKuFxnUBo7GbuA0paoJJ\n6Q2JzjyLmxLMlbumYDlrTcMthznWnPUmcWtNcRl8T3Lv/p/VUAymeOz83dmZ\nLTbZNsM/51/kWLIotmjGHmuQDRfx6aJOaY61ngesTMa756KfW/fkzn7m9toN\nscOgHvc5kdP0BsxQ5WFzmuEdKElE7bbTZTKWz3GuwmXmrFfvPsS9uXy/LYNp\nyO5FkS7KwRfJ6xKJZxAKSfz6XPAoLr9V5XXv1KL1ZTlFD++NoSQA1ep4QULU\nvdRXoYwGafOnILZwGWweANhUjx6QN3gwqtoYom9H9IuBkIz2Qpiz7ySX3wmg\nLfmehnC+qJ/w5VtL6xS8ANDMMXtF0HS6grEYEXMHxGEutQkvVAxTbNCi3tu4\ng8qhZAdyA9pBLzagYcxNJRfLH7S/dX7Rv6NrePAZUhFImy+CcmsZ5L1emej/\nswaGmpyZf6oRRGslb++TzMlWuwxT3rsdJauTMm51JlePHK9553hZgQBM/GZh\n8SJ1LiwZ/jA+mWWJ4Fv+3TFfrNXdcBjlY5lJhurVDvs2ZahTWc6oV1ZY97CN\ntDzIvuVEQ+Q09qIEI6x05GuqiOMrrVrfyjPOgXsjUaMvRrsjxkLog1SCQnnO\nyfy/\r\n=/Tf6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"19a6ba243dfefa1c675c6cf8d038a362453aaf45","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.9","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.100_1618568713085_0.7849299068898481","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.101-renovate-non-major-6d8eb7cd9a84836e3ef498cb6860eba86abef619":{"name":"@balena/jellyfish-metrics","version":"1.0.101-renovate-non-major-6d8eb7cd9a84836e3ef498cb6860eba86abef619","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.101-renovate-non-major-6d8eb7cd9a84836e3ef498cb6860eba86abef619","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"98e575b43eb961aabb492b10373d91449722b5c2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.101-renovate-non-major-6d8eb7cd9a84836e3ef498cb6860eba86abef619.tgz","fileCount":15,"integrity":"sha512-W2+u96vRdT4Ejq83NCDHb2dJjuYMfkZAzEl8xhQI/dCtEe2AdhzDq8KY7c/sMGps92f7I0n7SWXR5QjkLDyu6g==","signatures":[{"sig":"MEUCIG+SDuQ+s5IqCIKO89MT2+oPAccM/fa0nv4N7KKi4+wZAiEApqu8OKW2auiN7rYxqucDQvfe8+dsMsf0Z1vTcjN8Ty0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87486,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeYX2CRA9TVsSAnZWagAAXI4P/Re+rXNcaToQ+03xHqPd\nBKzkjH/K9CPK40QMsHZXy9GNj4g9xuzdu1voUQN8z748uw4294l4XU78Fv1N\nwzuXozICHcGFrghdq0q8DoNenFFieGjeGj5FqvVZXuQvPAZZzjmw1XL42c0j\nelrlZrkHJWS+vbNPtLe8NlJ4wRJgAU3fqu7/E7GJdKc/QKtpLbVrND7Hp+Pq\nkkGxnLzJJGoMg67f1CVs+U8ZPLzW31ZArqb4ug6Gh5fPUFKA8Lkhqgni+TPY\neABpbD8KoPq7ulm78dgyjWoOFVehFqKDpksRsu060NvAJtyjEWu8++UTD6gZ\nhziGPiTfISayIC36ufHoJ+Ivgy9ILLjUurXUkPa8yHRFIpGfeTZ+NhiulzcG\nNX2o6cO6OoO71EVRYvokF+7flG1j29h5Ud6O4hkuJcQoRLXm18/H4Dhs50ek\nddHR40VdAAsnG+ztH68mB6iu+CnK3GlbFoF1LgLSbqpg6ajF3NM4KsXeuN8l\nXTLH0ovV8bVcGyz20LCuTpFMGRhqrDpFg8GvSewmRfggEWIUkz9rxvgdVFuZ\n+iT+3lS1stZoYnFCZ0eTGblYCtVduWiLEyJ9OlFeFoAPpKJPjkWk0Fd49VPS\necdA0jO5Rvv+2J/XXAkoBJnIr3NXAT77VDUlzwfOmX4UOGWKKNBi8DY7xQ8K\nV3VI\r\n=KQGf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6d8eb7cd9a84836e3ef498cb6860eba86abef619","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.10","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.101-renovate-non-major-6d8eb7cd9a84836e3ef498cb6860eba86abef619_1618576885687_0.7231660219636009","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.101":{"name":"@balena/jellyfish-metrics","version":"1.0.101","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.101","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7ce31adb3667acdce97aed6bfea8f125bb349f7d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.101.tgz","fileCount":15,"integrity":"sha512-Ztimcl53BwHVs+Lv5tz3vn8ft+cKEBnepnCZI4LEEGpmwiVqvsYQGeXkNAQNOz5BcgDgDiOgoE6kVM3fvaivnw==","signatures":[{"sig":"MEQCIGqJ+z8rxPg/TDT2MesG330iDmUylQueYvHTiiVjaz2VAiBYRY7hWfBPoWtq5+XRvj+vUF4d7ArIXnl3i8QhYCs+gw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87426,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeYcUCRA9TVsSAnZWagAAac8P/R6y+L1azYJ++0HnoqIz\n30xQA0NpY3TZzT9Gu4In8HWzZxM+AFnOCfwwB7gjAteQ5f1rmF/vTm0m0UOY\nhULn5h4DLLGAYbZBhHlKbiHHjuuaZm6p2c7W+yzKx2YqUNLS92KebckCjX6t\n4K3IPme9UHMNkZgl/VM0utueoA7cD0iS2hZXWGcm0IBV/Mzn2lFoOhs+FXln\nco+uu60clteKONGBPxh/hrowzhFUysJYCeI1fpY6N8MwDM9Ws8NGBUV3dd4j\n8sXGoe05xk2SP92/hkii+eTago1Km/j44kZTP7I806sAHS7gZzP5vhTU1ISl\nzlrzrY18js/ZB/pr764rItg/DggsGFFfjWwmbOzRMm9WoOvV6BlYALnLdgKW\ncqX7rg9wTbD+3Tn/85J+evljkweldW3Fh4RvMShfp2ING8GLhpYmX9YWCtHK\n9o8p2l1WVXF6uyf9emawGcLbu9zLM+IuWfLuM1DjP8EW3qGoZxQG3E3EpA/L\nRbtXVYzdbLNLFEPjtSoLRnLrgrxbADO+IbxniKskPUYlSuhG9vy05CzA0xGv\nOfANhZ0EnbxZ+6W7n5j+GpEH7+j6gg0yvtyeiLK90tpZJ7XPC4F8aYLQnfvO\ngzliG+NzIkBPGy+B7jdmxvQVZE+GTZmoq16N902lnMVUkciZpmFKBFALS4fo\nX85j\r\n=vlD3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b34caaab35fad7bf5390916f2cfbe5e5cc9b4d10","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.10","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.101_1618577171708_0.22137334822876054","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.102-renovate-non-major-aaa6f3f597509d6ef8dde5030b3756bf30abef8f":{"name":"@balena/jellyfish-metrics","version":"1.0.102-renovate-non-major-aaa6f3f597509d6ef8dde5030b3756bf30abef8f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.102-renovate-non-major-aaa6f3f597509d6ef8dde5030b3756bf30abef8f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"99f7175078c35d3c6e64fb3a0add4b374fd5fcfe","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.102-renovate-non-major-aaa6f3f597509d6ef8dde5030b3756bf30abef8f.tgz","fileCount":15,"integrity":"sha512-2CWcXuQP/mhUG2db29rUse3R69XYVzlERiQ3laHuw318geV9G8hAe193AcGsiKICiiYMib34eRDksOfBl2RQkA==","signatures":[{"sig":"MEQCIDxLjmbQDbp0D/T0KhZzSRaa6u8lXZF6pYSjEFGuKFviAiAEgA+yyUoLatiHZO0OzAQLnwnytMmnefYzdDONxYyM8A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87589,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgea5LCRA9TVsSAnZWagAA0ykP/0Y3H+RWKyAaC1Ot2bVp\naTwfGdJICaYpbr2YApiZUR8bCm3rfoTfv6XX/YRN/IyKgrOCbvR4rprTqDFD\n2pmTXHFxaUvP3Ktumm75b5WeoQxQiH7OAyafho0LuujQBebgmSa+0JAeV9Cp\nnTBq8epKpZKT5fbcUNh/HUp5PjZB28ohJXGRZhQAk3vWv80h72i507JOxbGw\noIUNj887WtAJIPlagHj2pDemVrBcJzH0PdYvtcUgfuDyuA5KDsvQkBLlTZ4Y\nLNAqPdU2/WWaIjyLm64IEbnZ7hDvsTbZQ3yRWuUPAgURpvIQXkQvHrMpEzL/\ncZpRHg4izZZADotSAs4T9aakAdknv9p2AELE6WVqvali55LCPiXRmvkC7pYt\n7ZiQleWGjsE1hgjlPq/7bL7LGRsozPIDXwH/Kc17NuX+AiazoNqL+MPpdOWB\nnUeQgvHzdQYC5LcBx/gK3y1s8QkEYD/E2f7tN3VA+eu8FzIsPRR+IoEb1+Ek\n2Ih009qjKEOocIfttkgVGTExO6fOwOCCuAhNDL+d/Ss6nle6OqJm1Ux9bJ/U\nV7bmfQNhdmpR8P385EQU9B03je9SS3zwtDuIlfuxt5tlyC+gMeZaPgUrViJ5\n+ObsGjzC9ZDypCUU/uKpwFY5NReytt+Uf6BDFrr0k7mYh1AcXPjeuzhFugZP\nt0Vj\r\n=yWSS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"aaa6f3f597509d6ef8dde5030b3756bf30abef8f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.11","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.102-renovate-non-major-aaa6f3f597509d6ef8dde5030b3756bf30abef8f_1618587210816_0.536359350418367","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.102":{"name":"@balena/jellyfish-metrics","version":"1.0.102","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.102","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3401066aad2820a69c91f5d1d492214bfd56d337","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.102.tgz","fileCount":15,"integrity":"sha512-5wagkjBoO10xintvnlhGfe2OIlgqnTRp0v/y1gLBb1gk73rsH6Lwd4GhXr4xm7omgP4a71EQiphGgquHTZj/Xg==","signatures":[{"sig":"MEYCIQD55KRh6xDnyWwuRjB8q+SvyZnL6KcvpncCPUuuEgdzqwIhAPzykV+xN7szAJv9msjOPPTEjEiGpYEj2WeRqtaRoTIq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87529,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgea9bCRA9TVsSAnZWagAAQpkP/0+XCGTEn8VfgucMeuuY\nhRXSjIeuHc3nGTzJOWij+0Aaw6uSS7dHDLnt+pQdA9aT69FhbIUSWKyg17GP\nlVcyX2u8TSoAy+xu3h/0UNIwNmMUK4+Hfo5ViPCj8P+gm+6XWyJ5qGMaWgd2\nW+BhJgQjs+/DRm5NskYo5ld+AF4g62ck6nWr6A2IhweCJHFbewZsa+zPA6y4\nZ516S6EwMlZ9a9pajDE7L8SS32kXX/ANj/uSVDlhmptgXwBG6iYUe3tMkgkP\nclYpsTgEzrFDFsKYawXtIIMTx/Qoqn+mPnaXeS7thRlIC2SpQ9CiA/BwLhox\nITURTrAMqqKQEsd3d496nvyLavpMu+2ZKRGcteSOhLs3DtP1ywKyUR+ak7XN\nccgnjlyL8w8uPwob7iJSwuQb1l2G3n8K3b0GQP1PY8sUUhFUlCFb4X/ia4tU\nP71FnKohSXwuB1x6vVsz568tpG6qnQBXfBMWiJn6sgbiISkORfMwsl3SiTiE\nTEK2ae1UALQyT5AWBCV2eXqFfaGWGlCuYYcHJBkE66SJbmiXB12RqjkFfLnL\npy4onE/iAx/6YY21rPXYvJpJnYwdO0Q1+eZRbcqjlrlQ3onBMJgcaYKko754\ngtZgtU/L01RySQioevofidtyOGxKJL7l3MItaPct4gVYCKeFItXSgrP8b7iM\n+1Z0\r\n=Z3/n\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"78aecef2c1d4bb7b632504508603ebfaa135b04d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.11","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.102_1618587483310_0.04317264294262002","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.103-renovate-non-major-94706b3eef8da304b222a3cb15670d6ec4c279df":{"name":"@balena/jellyfish-metrics","version":"1.0.103-renovate-non-major-94706b3eef8da304b222a3cb15670d6ec4c279df","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.103-renovate-non-major-94706b3eef8da304b222a3cb15670d6ec4c279df","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"236d07c8f70c727fc3b0526b8935bfc93c6dbc5e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.103-renovate-non-major-94706b3eef8da304b222a3cb15670d6ec4c279df.tgz","fileCount":15,"integrity":"sha512-LTSucX/Q4LWE1Cak/+GGGHi33WTNpWTJzyV0IWbGtc8YCHD4yh6N8/ucz42Jqg2M4FmEVmGKXsvzDwTSFPk1Hw==","signatures":[{"sig":"MEYCIQC5Wo9MOkIb4OFEY07tnD1fVSqmdgbZR+glmh2xX3WshAIhAJuYloqAQLKZn+FRgKoIoYxmuao5Id6RAANgeSyZJLXu","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87692,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgedbiCRA9TVsSAnZWagAALW8QAJzgOX914jO8227lrYWw\nuhyzei3549cvYYdY85Yoae9VE3Bu00q6CBeaGtrQdaeBFppuNnO/BBtLsaTV\nQdfPc9fbOisaD03G/SX/2mtDNIn9HyhI7+RHTh84bRhWkcUMMONk8e346FFo\nh1tyD270sXeCgxhkHi5AM5UXR6JJpg4FmEphNyggOnuhMg4RFBdGMkaGjUUD\ni0g3pNIJtssYZzD0LJ0YvTbDBewp7OoUFWC3VVqLQVTbSMHD29sJBgPO1gGv\n7WopRY99byaq1QhqolWktzww5A4uYoOH1v1bwlQeVXc0fiOF2L0sotCWuQPv\nYUADD4D/H33yFCawe77Hq1wtw9WjFHt1TCJfMgYlQjjZJjhsYsKfSCQNx8yF\nC5mmvGew/rzXA9taS+FPhXNOc9h7oYJVi0N46aNxpoZ7ldvYTjaP/E1/s9tg\naPWS5ufn9F1vUg/ARYLuSpHJSKItdyLXXPmle5qhXwMk6uOdDaTFm/CsMpgY\nscRCAv5I854Oh/Hfne7ehSKvwu94a9krLI59/ZGvkiT3EAuoBQ2O6KPCHNjm\npxrYqvc1Swid/hXBBVdoIMnCbBd7fFRiH7Q/cDO8+THqMugG/PIIOs5f8Uw0\n0zcgd3OQsRE2Z6kAXKTlMj2pRLSgtCcY5qkyDXj+IPqL1B8MnMK3jzfpscgh\ncnno\r\n=8p5P\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"94706b3eef8da304b222a3cb15670d6ec4c279df","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.12","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.103-renovate-non-major-94706b3eef8da304b222a3cb15670d6ec4c279df_1618597602411_0.4257134178167321","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.103":{"name":"@balena/jellyfish-metrics","version":"1.0.103","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.103","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e480177d8041cd27a1d5727f0e8c5e54b18762aa","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.103.tgz","fileCount":15,"integrity":"sha512-H2DyNZRGvsiU2E10Qo5xDOOF8yB9x+d/sQoGw9NfnzYSatzOFjcvx6Yz8bJPtpgAf3E4Yvf4bCtDQj6RiQak1w==","signatures":[{"sig":"MEYCIQCm7I/ZjD9udKgxmaExee6L4OxLp2AdxJ435YGrd+jEHAIhAMjO+fNSJpW7wxEycYZVcKZeMzPw4v6xThIwPJsFCEjh","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87632,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgedfZCRA9TVsSAnZWagAAVpYQAKO8FjGJayZl2iTcvMly\nE0lGnRojqoimbvD2Wz/JkXiZM+/mgK8IR2ZSy3PhxH+lwBT+Wi0yNv2vTbcb\nrKs0bR6WN456ky9lSdfSxPxDR2GS9lL0vtVlHJ4vTqvvUXU6+ILp4hTHv/mt\niI18oVZfsK6z9nTPINRYV2Px/qo4B8ALmhzF3QxjEiDw7p+1HERjBrpi/ZZm\nB97/11ZuAVbl47l6HQth7Ge5EUkBgZju7d1wFFHd2trS35wKUefW40L8J5Wc\nLMrwQpeYLwYlvqXceu57S/CINyzYOFKK59gWB+sP+ElE6GMYIWr2JRPPfk0/\n3IJpYgJ5TmpVL8E14/4FY9UBnveu9sL5ZaIzn2qa2lDOushZQGeFrDe2AtAA\nNjnUy+ebOQJlA2fostEXBRH6Za1WuhJ4Pm0Qq7guAca1if9zLszBQgHUFya5\nvZtf0oww342x/EgR/1NLdCvVJO5ehXo71KMECAW4V66PqgQgQHjWvfL5ixay\nV7z/ARyesdb+5mDqFkuxHdpqXertl3zqb6Tehz+c1cNRv05/Lbw+uV7SMTxC\nQCoXvQn1uWm8Ys/w3Psj2rV+SWjgN4gPkSGmlbF7S/tym578tuMvXgZKfiLc\nkLvQ2w2aaX4ixb5Hp2JoG+42XKrNGKHRqSTT/7u4rj6fxzvcK7u0SdEZzrjz\nMRuZ\r\n=4ocC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"dd7183d93213944a1f369d034eea82fc9bbafefa","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.12","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.103_1618597848507_0.3561102688098676","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.104-renovate-non-major-36aba06dbe3a899f6889fbdb72864ae748d36e83":{"name":"@balena/jellyfish-metrics","version":"1.0.104-renovate-non-major-36aba06dbe3a899f6889fbdb72864ae748d36e83","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.104-renovate-non-major-36aba06dbe3a899f6889fbdb72864ae748d36e83","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0549148405497345209791f458902687e8a56707","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.104-renovate-non-major-36aba06dbe3a899f6889fbdb72864ae748d36e83.tgz","fileCount":15,"integrity":"sha512-Q9FtgkZSHg8GgLnbVtJO3JkTvYDUZ3deCBoBtH+xqGbrcm5jErjm/tgGHX7EKmj9GKJeHUETKfZhOEx96kqz3g==","signatures":[{"sig":"MEUCIQD1FVnDZ9Gz886MHMQpnoJBElplc34ljEx/Px6SCU4plAIgLbtZ4Tz7qFUdlUfAHYp6WXlx/2C0/JBnFoYQsw17qEQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87795,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgef4mCRA9TVsSAnZWagAAjWkP/jyMFDB+mU6inOmI3To0\nr/8N7cHYJRE8XIumY6BGeTXP0Be7sPAxlV47bfgK7LeirfQABimHjp7LWPFn\nX7lx7ops3Pbx6rKly5MAa/hg/JCaf0NA9e+mgPfD1bySm9MFSwHBO4xhjIBi\nDLhX0Qic7YzB7GCUCiHFLy+8YG8Z3TbPGkYeK5GnrERmBLr8g18EZ2HQr3pH\nvdHR2iCxb6njD1sB0jz6hkPIyok3zL2WZQyAGwCiPqRn/9WAl8E9p3OUfUBd\nYw/6aDepIh0+RHlbCeOr4XctKPLXpQuAgczcwvlu86URFCocD6VyHewF6UHW\ncdERCJ/r0Tec+J+qkeoo4gMCG6610KOk7sdYk3gCTnmigrQBsr5j1VKqKvVH\n9db7aYWJ3APDwru+MgnkA3TERjxUV/sRKcoKL/sPT5agcbu2jhu8msBfrAn2\nj4vkDn2HWQ2zCdEFA7onH8BMIfZ7PA8Ea9fwQ1vE8WDT3yrj/9ajWkiIdI8T\nY1UBgbXMo0vYDPDwpQ58we1TkBhyUy4SNGg1CObd2kH7emTnTDGCniRMGGDl\nH4pWYy1maQfId0NwoTxE4gLm8QuzbL509BNpggWVeEkNeXFRCNHTbzwyb3fz\nTxcnqJETDT6iMhMMGRMaPubNkeGu2VPYzOxbe5NOYqKPjBrITXejW6Po0prs\nkNJc\r\n=yEZA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"36aba06dbe3a899f6889fbdb72864ae748d36e83","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.13","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.104-renovate-non-major-36aba06dbe3a899f6889fbdb72864ae748d36e83_1618607653761_0.558073526759415","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.104":{"name":"@balena/jellyfish-metrics","version":"1.0.104","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.104","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fd2bf97b65f7b64714831b470df6c31f9fa9e427","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.104.tgz","fileCount":15,"integrity":"sha512-n7ZBM6sXjqnNANVUSnNrTJTLVK8zpI75XQ0TK+RsPwukgkw+8HZ4vcrMVgHteNO213/jWY672Wy3Zpyl3Pya8Q==","signatures":[{"sig":"MEQCIBo7En56/3/WZsEKhTSnKAFXgWsQ1Hhu/ceU0C38ax+PAiA/lfM72Jrys5rMANRhNzCRsi3f+VJGyN+l9pAHbXpKXQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87735,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgef7rCRA9TVsSAnZWagAAVoEP/2JM3KCPRiRR4CeMdOMS\nX5lJFKHJbXsHhRyMID9lGpMv/je42Ra7Fi4Yn+odZ10z14U8nYCPwy/GtHPN\nEtEBJEXswPduF4mDaZZ27TSFBeC94VO8i0UvIgFei2FNCg1YD5wuy7ZcBF01\nRyFrP3ziHX5Sp1MnTqLr7S9JDdAqRGbrtW4/GSKQkzncnGRbA2d7WO7iV1Vc\nDQ7usQOBcE+FeaZUGerfRRD2qjd6gdnm9A39hBRphQiiwNTx7YstxDO5AJnn\nkZT5PBg2307l/GAxER2YS4m/eN2+l+0DFWi9Y5eLhNfXYo67dLRoSAhtUZy9\nNvFokZAp8kA0/0z1QATzhagOB+F86UdlXI/o6NJUwQjn4dyi1OjLWKqXCFyl\nNnS4bMyApo/zvB/9WY2mbAOPuiC+tCgNNu20ETzOolSB+wiwHaaDrGCUCJPD\n6bq8mr2pTKLkWwL8ljTWzzUZqE2Ykfgh3qqg6W8kc+xKmyZe9jJIB1UEW3jI\nT397IXmuXvw3/VVvNt3VVRddd2D2FNur5GxKd+8bUPXLZtD+q/txanSglyWy\nu00NTPG0FMlmjdVmbe5KymUZNy5JnHS6Z2IZ1tld/nl6cckJxwqnYN6TQ28T\nLUXnwdLhakcNw9N0JnqRtiRJn2gsGdrm/A/OLVt1xoxI/EEkBHNFRqJA2+Ld\nrxW6\r\n=4BN5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"55cb8403b9b5bdba9d87e385adf492276717c063","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.13","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.104_1618607851105_0.14927665058306694","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.105-renovate-non-major-849fd3f3487f52d0ab03d3768eb67181b13f252a":{"name":"@balena/jellyfish-metrics","version":"1.0.105-renovate-non-major-849fd3f3487f52d0ab03d3768eb67181b13f252a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.105-renovate-non-major-849fd3f3487f52d0ab03d3768eb67181b13f252a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"443959e9cab359001e1311c1ae03284362df461e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.105-renovate-non-major-849fd3f3487f52d0ab03d3768eb67181b13f252a.tgz","fileCount":15,"integrity":"sha512-FkYQqvKiCvXkfyVsnie09FJPlSKYy8a8Fqtw2VOkW621wLHpPRexO25RJxglc9ILtZRAZ9+2J1uYOUtl1jPBHg==","signatures":[{"sig":"MEUCIFVUWdoh8dAlOEjdcZvJDvJp3Hmb+TnuGLARFOXPzP8GAiEAi481/dRJ39fjNMTW2G654vepVT5ew18nfCFfkTy1ZFQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87898,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgelALCRA9TVsSAnZWagAAyHQP/RdWIa2z3p6ZYUr/E1wY\nFFNCEjEvJwSvaUFU5KG5Yd/EeeU3TbGES8+w81BrZ0ng+hxYHJ473SgemZfn\nlW1eJ81JiHLT9WDUFSz0RFBm1mWW8es15f5wZkyz7ZL3k8DNWADktcIwJ7hJ\n5F6PfJoOHdwLkrv2U83p3JlJvIzECfhIasz1F+PFFI97KPbmzd6p70wk54hr\nRjHcJ4ts5HQLW6kz4/kdu3XyvuFePeb3hPayVaxoqWKxGWvv5QNRajr3ThFw\nK2EvLVz4ABWNara7XMrzuz8QR/GjXD6vGHqGpcQNWlqPN2kpLw85R/GWd6jm\nveZEV+08Nnbpw8F9xze9Rpb9WT4eOz2X7EFX+JLwnKQMrvPZLWTjcc/voFR9\nImA9vWn9b33rJixFD/L4a+0eSGEB8votSn8l1WpLgbjhIqGpcaqDqIXcTUnb\nI+hLe3i4WOuzfS/GxTa1bF+84uPqNDWRJmuD1vPzWD/HFVNfGHzAbIWDJvSO\n5aOsLQ4XeVHwKBcW4Lpw3Va5ZyAMcUbRmLpqD4K7DsDrnH+JYUYmMxgQb6RT\nfPOTV/RGVhFwc1NWZJFDhJD1P643tJtN9dKJY8VZ3ipqhz5dK/rMGL9/IxOL\nhKCbBV+4bhsE711PAJmvRRblodJcHBw0XgtwfDODWlzTF/9ZGlI1tOIZdxam\nxJNx\r\n=d+GK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"849fd3f3487f52d0ab03d3768eb67181b13f252a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.14","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.105-renovate-non-major-849fd3f3487f52d0ab03d3768eb67181b13f252a_1618628618737_0.25853872466989536","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.105":{"name":"@balena/jellyfish-metrics","version":"1.0.105","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.105","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"72f44348c59924e78147749925da1ca8f6d7ad9a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.105.tgz","fileCount":15,"integrity":"sha512-I0s+DE69LfnJcwZBAR6aEPciYmNyBoq1Wn1XPqxRgjf+0DoW7UlHNcd+WAMsHbIGhw1l71jQMDVhPiocP+7CmQ==","signatures":[{"sig":"MEYCIQDx6RJkUEfZPwN5K3q/Snr4BNUESPZz8IN4SBA+numwVgIhANrxkp3Qql+ABjkeJRjbLi70Jcm4LxpTEmE+K1kPYlvD","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87838,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgelDaCRA9TVsSAnZWagAAhAoP/i6ixcpC4KEi0RVLTkUu\nUlZ8SKp7BKCq5/K8scCkX2FrDH6pIKURh2BDCOUAN1DkxnVS/S7GYeGWdxxf\nV1Rl5JSZEyhpSNjalOQL7WUAaMA+M/Dq6BZEIsN+ojLHQ0Jw8blCevd+aOT8\nj663aoeG/2CraEHkl4PdFyZkevbOVD/wqV+wji6uaPXG4NvS1QjsK9prSnWl\n4Uk0YkuXcXLvulkSemyvOu+zicRPiHVx4xD1H/iC1mJI0cndvXEzIEBgjAfI\nkJeLr3aSANFitMAHZDJ8RQGZRnm6+YEMVrMtuwHxe1o3xnJEOI7iRfq5dLp6\npiJ/c0hLEbwAXQfxYM+FGkyeSbQ5H1uZoTzl8rY/E4I90LiUeblqvWax1NXr\neAinXfG5UkQVdYZmb34k1c3cXbJK+IJbahTuQqdmg1FhiZ1voul5JuW9aaAd\nxHDMrAY9YytS/PvrbmlhYyBbhAQHlBRNjYrhAOqZRkiRPRvq5N2kuiUOYugU\nff9FEYSM+MRIYTKILYObDS+JYXw3S/OTrbomKtfHlxYXD/mn1lYeUM0oTiZq\nKL0oMNdsuipw5oYXtj0xLL2x/EZnasDopqYoe2Oe0BBE6jzhPjb5SvGvzsGs\nQUjD34QS+1gztwW2aYOZcuWG8L/UL8SYwgPGXRl7ruluqV+Xuo8hG8MT5van\nEVYX\r\n=g4Z2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"98cacee137fa79a82736cee9abbf7aca349478a6","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.14","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.105_1618628825965_0.5909467114212206","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.106-renovate-non-major-90fa8cf5beb6d051e59dac79540430a33767354a":{"name":"@balena/jellyfish-metrics","version":"1.0.106-renovate-non-major-90fa8cf5beb6d051e59dac79540430a33767354a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.106-renovate-non-major-90fa8cf5beb6d051e59dac79540430a33767354a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c37262e4d2df11c21667c3cc0b14644206a35b74","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.106-renovate-non-major-90fa8cf5beb6d051e59dac79540430a33767354a.tgz","fileCount":15,"integrity":"sha512-4Q5cXZMcn2cipoAZ9H4umd3oQccopLvwyb53SBLHh6ke9D5Z71xR4tmA/QP2WJJodfnSyCnzH+/LxNTemv0WuQ==","signatures":[{"sig":"MEUCIASDykoJXMXSSEgS7fTqTMRE4yWIqJVLvDdFuR8zZpdWAiEAvwxptSE9v5euHWSD4bYQWt/EfbtepDzOLeG8WjB4gYU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88001,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgenHgCRA9TVsSAnZWagAAs6AP/A7uGwAfz/Ms/DEQt6LP\n9q28c5KAVsJe0wkLBTT4xGACJuUGr8vT19MjNPfT9QFqnZULOzaptyKBPPIg\nEaXDjNAQ0J8y3tVapdkfuybd8ktqs+1SR5QeqrBqBCMTDlQXyn5GnezcL4xB\nmT77Lr8S9XCi/PaGaLNHU2M3/9CUrLpAUJFiRSNn4ZO70Raak8uhR0bO4ugk\nj4M7UKJKmadQGJy6kuCkNE8Dhd/3XQwfD4ug76Wssojz6Grngyy4z0DcAs0r\nE5e8G8cBEEsVLXtBJvQa7fOCnpGQpLXW0SfEXsB6c94gWwQNR9zROCxsX8UW\nUGDilr4ntGF+GKCVVNqAN8bbtQ8DgO2u6lrUxXsmSXozTmku/Iwevc9UQS8w\n7d4hQSyUsIuOsTM3PGkPmY6DfLUjvHlcitgKX73NE5Kumx33ujJb2eLlU4f1\n+793jTsme9pCUmQcBCjdXd7V4W1CYh9OH/EGOB8nLiCdrG8R0J7ZT6twXqx+\nFxEtFBZyf+B2/KceEQ2LUtXhsJAXLqPlgUW4nWpJBi9+kOp+iRywUP9iUndl\niwS/8pwLJnLCVrhmnjdoz5jVRMXV5FTbGRViURzeOE7rfSN1+Mdk42e14Wf/\nkNEOV87OboRTX/vWURtwgkprgyyFthNVmxB3b7Se9MtYuP0TNz155afYokEj\nkZo+\r\n=na23\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"90fa8cf5beb6d051e59dac79540430a33767354a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.15","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.106-renovate-non-major-90fa8cf5beb6d051e59dac79540430a33767354a_1618637279621_0.47175202835929064","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.106":{"name":"@balena/jellyfish-metrics","version":"1.0.106","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.106","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e6328f7c320609b6aeae2aef7c955ea206c70875","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.106.tgz","fileCount":15,"integrity":"sha512-MPmOnm9ouQ9hAVHykvi1fSFoyrI111ZmvQ1SzsFDvC5eaXyn+WedOurWg7891wMnedlqy26qDcYC4h4AtlsFxg==","signatures":[{"sig":"MEQCIE1vd7Uyo8U7RExHkg59i2Ya6mPvyWsAOyh+R+zkO3n5AiBRlhywAUoG7G5UjO+mqewyTILRTBRpq28QzQWNN1OLWw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87941,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgenLeCRA9TVsSAnZWagAABpEP/isGMInBQutPPFMhFnQJ\nN0VZJuK0sHUDmts5TbO/HUHmc9LYD1N3NWPGp5nPkycYxFsq7dcyF/d98ddb\nQK250AiYvyeI9K14lQzC7JuWUP/Sbw4s5z+aB8aSBz/q00CzbViVD3yYQd92\ntxVPo+9HND86OjfZZbElppjL6wJY4iTLIBNbEnmrv69W7C2OW5VjPZAveWIe\nzgC1HfJrksWfI2jz2dUIn+vqWSrOHg8o1STyxu8Gaei6KtEnG4BeXjHdfzlC\neQJddDz4rA7E3BVik34JWFIKP6LWGhOu057Nkc+UfzdjQ1Jbf7JTvEFneRxB\ncrc4Ses0FnlwRUL380cvq1QWn4dDWUKL1PNh2PBhh8BCe3lpsExT/lvdDRws\nO1DKlfBWGRQjwwNqv8Pdt46QHe2ovOEYHI8CnNrRbzT1jycZXcepJYAs5+EV\nIs8Og1J8F4puHLtEof1/9If0CqU2UjAqIjAwYl6ksz2F70VqaiIPM2olWZIw\nIQYbfK6RS7atwVMQJzrdrDkC9vm1ACItEsxf3+d7zId+J4myjX86j1VLaplQ\nBN8CaPVWXlqNtHEvrPVbkFSSbx5F5SVoVnvSXppCurjGcfB44Mahx4+Gbn+F\nYQCKe2UB3KaMbxGPmXdasjv/gPdASy6beoi+zQ7YImbM4oCud6uO5SnWQRC9\npx/v\r\n=njYx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4904b454484eaec93de15ed46ffb3c831ceefcd1","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.15","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.106_1618637534380_0.33817890310850474","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.107-renovate-non-major-addf04c1ed5536d0c795555c1584c85763990e5a":{"name":"@balena/jellyfish-metrics","version":"1.0.107-renovate-non-major-addf04c1ed5536d0c795555c1584c85763990e5a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.107-renovate-non-major-addf04c1ed5536d0c795555c1584c85763990e5a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"498bd612bb507c9062068be6a6a035a2d9bc06f8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.107-renovate-non-major-addf04c1ed5536d0c795555c1584c85763990e5a.tgz","fileCount":15,"integrity":"sha512-L4b8g/bahU4WPqqJbeTzIh3KiUIQD/aVFscHo2l31VL+hWyrdoSrpSq9qSFKKOM+yLJgEUSX2dQopD7i+nI8Hg==","signatures":[{"sig":"MEUCIQDH07Kb+8x9et2kedoRjaH/i4rfWo8XRSZstLzUe8FaZwIgdegSrzbR/0b3QAeOlCnPrMT+2BayCuN9BDxO2IK9T1o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88104,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeqDDCRA9TVsSAnZWagAAG1cP/iggymjM+xz6DvmD0iFz\nG5O54Fc12EKJ0XFIgBnUSxGonDJDbfz9VbHRK40hYfOBIjsQV8lD7RzDU3L8\ntdvwr18JED9/1K1wHUDR9w1c6Rww1BjxS25UfbUwVF3kIAugIeC6BcKPxCqd\nBXE/vQubG7QP4Hmj5kPKDlGjmh75rYKuJIpjTxuA1eOCoiR8AT2xngrHFI5e\n6xg/hlyLJ/YRC+P8Gqu6zL/0B2kt8gFbnM4tGvfc1LEtgwq+eEBY9zuvrxMN\nPrrsUgYhS4TGRZf58c95Aw4X6wpI2ImRFBdIZtrM+jFE0QBJvmxgqEPfnCgR\n4cSasdMr973lS7sTIpBKb88xw6KomzAVvAcyfduArR/ammGK9u2ZVlV0K88p\nbNM/oC7bkp0TCELUfzhEYA3on6ehesMqImrnkPIkVyccawxlbd7v/hg6auJD\nQznhdQo2bWLJWIYcPhKU71rnN+e2D2KZe472/Wd+hnNRxYlKXP66p5c0TWGM\nWiJe0p0vqz/UvcY48Q1FB7gIoYmCqUgrq9WU3GBXMSOZmt7WB36aN448/AJB\nTdtBHQS933ABJxnVpjrRk9CVSs1kforLH3Ik/CLOOL9Qr6TxD/KhLsh6AgVD\nrO1tgFDcRFa32q1IOOvxNevJcMIR9Poqx7KapKUsGj0YYE4vFoGVUaSj802Q\n4jGS\r\n=0LPY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"addf04c1ed5536d0c795555c1584c85763990e5a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.16","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.107-renovate-non-major-addf04c1ed5536d0c795555c1584c85763990e5a_1618649282505_0.2895797022702087","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.107":{"name":"@balena/jellyfish-metrics","version":"1.0.107","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.107","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fa7e774f8d9b9e627d2216f7056fc1d1e09d7821","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.107.tgz","fileCount":15,"integrity":"sha512-byezJRKOdDTpXCW12/9KlOwU6W40htPyRZAg+nRT1NOqxOXpi60cgWoQ5qcjDkomDE538u++XvobJfqrOPa1ag==","signatures":[{"sig":"MEUCIGCT7jzF1SQyM69+GJLITDfE2BzhdbRP+TZmyo1+nlgRAiEA/PYoBIeu1qq7gKfguR/JxMouOLxOuGq3f1/LUCGgV10=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88044,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeqGKCRA9TVsSAnZWagAANhAP/RnSkhew4naTPvW84XaS\ncMLCKmNKchbmz0W8rG059B9P9umqK/SwgQ8p+sJ0VMFJQCeR36BI/9jWIEqS\ngV4JPRsC4Lltiy87QEwxvwVAllwNNQzxH8yPaefdCFFxPMI0J8qgabYyXeZy\nQZvxVqInCo0Um5z9zhE9jnDq50uL8FH6ytQ5aWB4z6dWjFW3rPH3hj7zgarq\nF7yiE60w7AONTPmfSC/UgOldPBgDZJPqET4orBMIWYWWfg1uqj70vK73TpKF\nQDswCJoNwif/GBhCjpOdBIb8ZSTQBpC7sF29E7IlxJzuh5pXACtx8BaAl5SB\nVdrwBPHUqPAaiapCaWttgFbCvRauQpRfOEkXak9x67+zXF+6kv3NfoQTjXrm\n+IbCUtcz6CU5oWg49D/sPeO4m/WsN/TtRrCBkCfaJUVm86+pzrhv7e7k0dUG\nOBfA3TeebyVfGem4vPcDb6UilraY4z49fHIL42qlwfVul5joVNqpeB2ohSdE\n7WahSOo/ulrivQ7KLESvvztUq1wJJux/0xnxJIxuLW6tG15t8fhQiL/RygwB\nrgxQkVzlbxYaIAq43OMDRJmh2hexrrOO+RZ/a408E8hdOFjSW9ArBAwXLiFO\nBRZ0iauENKuJ1bOP7Z5bFlgP5/hYPGJhOdwvbLjRSQ2rWXK2BIKXs4bVdBgm\nFk/Y\r\n=AXCg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"1db544fc9e7b3b252e581146a661e8c91bdfa690","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.16","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.107_1618649481584_0.5901340000834672","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.108-renovate-non-major-9255adaae024b35ef1e6a3021c9b1430700a0052":{"name":"@balena/jellyfish-metrics","version":"1.0.108-renovate-non-major-9255adaae024b35ef1e6a3021c9b1430700a0052","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.108-renovate-non-major-9255adaae024b35ef1e6a3021c9b1430700a0052","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4b97d11054ef1338b3f6275aea4b51008cbc60e6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.108-renovate-non-major-9255adaae024b35ef1e6a3021c9b1430700a0052.tgz","fileCount":15,"integrity":"sha512-Ba3jWHpmah4bamaM0JligZlhiWnPqP5J3DQjblk0djlviD6jqwonsXbJJbHooTrD12tulTkzTiyfKfd/bV0Rsw==","signatures":[{"sig":"MEUCICuQEj68Og0AaNT+jBrPJ9kscIwbV4A1VJ+65dstupZpAiEAr4QnKJ7ciMdgi0/dbTFYxdNw+yVeqeupbXB+csq9kGc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88207,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgerOjCRA9TVsSAnZWagAAGzoP/1ZDBlmsaU5TpXjQR9rL\nHppBDblUg7IUxHTon3IBUA4Q8gWbRaga3Eju3htXCwV+eo3ymYzGtj1d2Xbg\nVGKGkYO3RV4Q8OHd3s8v0Bjc5XgP5FNMr4K4/uxnjV8c8poJBCJuRePUQXHw\nK8nkSk5DbJv4Wx9xzxJFZ17D/wWy3y0EC7irI6joTsZ1ktBcJs/0jDU02ED6\nR9dj5ZWq9LLJgDPjNsqgmTQxxygulJGKBgxONJ1wYQp9o/Wwgk9a5Xa1huAw\nWWbkiQL4KTD+Xd35cxe6oBIGQ46dxQnHWC54sxf+YW/PsNIyiNBLTStg7qlg\n0RQHaViMnaOU8QwKkeQhbXxtRFtU46RKbGlOWJ3CWuALXbVPQ7F7gH3KxUc/\nla4XItILVABXfjpo0GGmBYxHVK2fdZSDRuXZmOdbOAHEUTdjQWedGm8icNis\nurPeDryoRMee2+0N0HcoJoRrRkHI4iVDkF3Nc9IjoQaq1DI/2w4lWJILtLxd\nCLIvsDRGFye7UKNgr4MQ0rZ6wmQI4bYbKT4w7rR7Wa+C+L6L04EqSTeBEMpd\num1SOVUFhI0b1SxUAr0lL4pKLJUXnGyBkg1pq8y0vfWnZJfkiPftG+G//Ovg\nrD+Wyv+n7kMM6M5WBKzcn4rAmDkiZlvRZ5G7vaD9yqHtXujxg4Ch9+XZh215\nmDNP\r\n=9uNv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9255adaae024b35ef1e6a3021c9b1430700a0052","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.17","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.108-renovate-non-major-9255adaae024b35ef1e6a3021c9b1430700a0052_1618654114638_0.701243047211586","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.108":{"name":"@balena/jellyfish-metrics","version":"1.0.108","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.108","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4ea534bd826ee3fd396700fd39e07ae35bc0681b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.108.tgz","fileCount":15,"integrity":"sha512-sbCOBk009B8nyrtkTgrtr1Suff3z487Kxj38Q0nQdAHJOdjs+A21GzZuUvIQICW+WlQY7e+zUOP9NeRsxT4t2w==","signatures":[{"sig":"MEUCIQChztlTL1t6LR6q6tGDPgUkCffI4/e9tNq+Ffno5T9D3QIgageXgZ3Q+4UfIG0ub6GExy1xoTM7YZ+i90XhM6I1rtE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88147,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgerRxCRA9TVsSAnZWagAAvP4P/jaWWuPduhj9NDbooTb8\nQoBlRzu31Rj6KIF+qdEUBLjvFvA1O5+p6fk+X9oez/7KtFY27GpvIR433V28\nDkNp3821fL1lI8N2kC3yAsQyhn+1WKfZ/E/MmWv2KRJhWYpBnUFfqF3yt2PO\nU4HHz9fsxLr3z8VnI/BLRQscp/HMk1ONgSux8QiFb+Lb36TxYRyVm8yulbCZ\n9Bq1Si0egKKgAg04+szdwZJVoXwrSHzYtyUHpc5vg600gjqlNDYQv35ajIsb\nh6fnWbyc6Qg9etXiVJYI3rDfUIZ3eaYvLPc8zBgz3OI8U0X2t0hBtarnEkO1\n3Vk8N4t+pvXcxBdvcbz28jLOWlmw4EG/ut1DIrIYoXJvhtehpPAFgsKK+aws\npRiOxIwa6V0jhJagq8OZUbf7pzWztlWk/qxvFcHinpSKbn/3gZGDES4T6hsw\nbEbUOnwpOUCqIan1B5DoKVqP66LELQF8W3ZI8g0TBYLZW2D224Ja/x+qMxrm\nie4+/ObyOyr25ABLMZ8Y+M+zjAMNjC3XCF71DTfBK0GZBuhVsgKxTCl8LpHg\n2Cps9ttK0QAjR5/BF8GFg6nBfzxkdjhHi0gkMMmzTX36U2EWC7Lwk9tF2/b6\nIQVkNPkgYG6WrdypugWCX6DPSqMA9/Mp99ClOtU0dpICN05Ge9fncVsD7cpR\naL9e\r\n=fRtA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f327f0d3dd424d04cf458209431417d01a38dcd8","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.17","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.108_1618654320964_0.45682746686687703","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.109-renovate-non-major-3ce6d49bc554180c35af624d71d4b9d3d0540d22":{"name":"@balena/jellyfish-metrics","version":"1.0.109-renovate-non-major-3ce6d49bc554180c35af624d71d4b9d3d0540d22","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.109-renovate-non-major-3ce6d49bc554180c35af624d71d4b9d3d0540d22","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a8e8785bc5b0b1dc9bc78a3472f5a07f587cea9c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.109-renovate-non-major-3ce6d49bc554180c35af624d71d4b9d3d0540d22.tgz","fileCount":15,"integrity":"sha512-UJjfjnUakTjsgQZbZoGqyRAoR1LCtNA6G93fE1yVHQ+yNIlC5KkeHoo1ZKDrfKJ5LSp0nJLPDFWHURn6syAMgw==","signatures":[{"sig":"MEYCIQC36E0+sOx7WZRTgwu8tCBs44uuH7XdPuEVpPSlx0ZlHAIhAMCA9/J3jP99m8Gng1Xyghe1d0begc3DiM/YMTitL3j5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88310,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgetNKCRA9TVsSAnZWagAAj0MP/ibAQkap8yHNZlsZRu//\nLK1Oh5f54DK+6rsX9iHyZHQLGQ925Xnq3/GMKSqh6216tz0l/QxzyVxBzrCO\nymSBQAwa2ywDlnpxIU3XeACIU4jtSU7FrvLymxa0t5Bg+AfgfK8phDRCZfHD\nqx01ALpWHTQYrHHQZYqU+4mt+MhieXQa51hT68k0+JJ7tmpyneFTULd57P9K\n48RnNfv4wDigtwKphVSCVCk1O1Z0seGtDzRQgI6XFTPgsYffPCoBhH9Tn+yo\nsa7XsLIemeM2pbMqcFLAaU+J07AnyzEC42uVTa+PlLnVAX6qmB7HYGUvA8Iw\nal8AunF96KMVashqyS/nLPr2XndzpFdcv/rAfcvXZj51ogWjMN86h8rkIM6C\nCis3F56sklbWfrN33TJHiuk7GEbkxstVT43syN1rQQq0K06kgCbQjcTGpbPx\nblkSZWxlR2r/UPGDstTi7g/PeGc/gAaRvWoXXWtT3JC3oYsrsaPL+UaIroKp\nl+pY9nGFRgW3RctuHsmIigaH9XYlLH2tlc9yxg/IlSdnL4v7BbjTetta0tnd\njvLVmARnzeWDYoCFmgTdwr8s7tbJ2PiUCtoP4KVQEDj0UxWIi3vUU8cVtfwO\nQXvEaKM9ImDHSlb0Xew5zxnRX8gofr/99Pi52Kk3FKSMtBUKj1MZty9+v8Hr\n3puV\r\n=HqRB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3ce6d49bc554180c35af624d71d4b9d3d0540d22","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.18","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.109-renovate-non-major-3ce6d49bc554180c35af624d71d4b9d3d0540d22_1618662218363_0.7593598923448333","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.109":{"name":"@balena/jellyfish-metrics","version":"1.0.109","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.109","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d1bbd032a6e6b82353ebc647dc048a29d0d7654f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.109.tgz","fileCount":15,"integrity":"sha512-gDUggFu6ug0FikF4yWWnl9w5xGLHJOh5QMGbnigHjkwJXPRrQVzfv1RqluJpnBbuN5S3OtPds5ABQ4Hrb3PzlQ==","signatures":[{"sig":"MEYCIQCf1YWP1da51tEfSzS/1L1bhKGE391T/uymWRSzob5X+AIhAMOltCNCRc56ywug9vAXTDeXAZAa7iSFDWOwGBAt3lCZ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88250,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgetQhCRA9TVsSAnZWagAAad8P/13SI33nlV98md61rmCB\nAs2XVcTTc9HpcVq9evJ9+MKQmbV34ztn55Vhk9TCUuvMVm0eXJnAQcwXsg7C\nBA8hii6twBfobJPZznK3B3bkA2X1R8b0lnzD63b+olflYx9WkL4MdNNC15Dy\nDSWvEujf0InslDd6CtGkiAfrE4hHqitvKItbMHqhHQ/TPWG7AY6CM8joB1TD\n/Exusjgi15lbSsQivsHd++uymmPA2yhw0y6aUmVYOUEzs7FlPfvwNwjCvExJ\nXsq6bCOl+Xq0wsRTFdo5H/ujnINc/5e0cqbDMghttxGm/MnX/WkW7GIfH+20\nILhD/kBFxrJaBJas0hihN697bkH3dxQdW3yp8rn4Q5944Hq0Rf+M158evfqg\ns1LhlVA9JJi296IgeWnWxb2MQALhSS1USDvXuPB6NfC0GOrpsKYiM6oJSG/r\ntlqklB9MXLjX8XwJ13csosWChnRSuneJU97pUPq8BLz/u7SlyNH8AJ5Qkak6\nM6yo3aNaEjfAHTx+EUII68I2jEB7ASt2SZ4yxnFYmdHYZVL7X44ZrStuPO8Q\nqR/h8IM7aGFblCRFFoB9x9zRax30ZBDRqBtBBj3RGf2ydUGvKnP0M4UGCChQ\nvSPhzXQsDz/FJ5QNNqb5EhsnDeblfV+57rUOqm40Qk6ccARYN0uLZy7NK9Bo\nr2mi\r\n=DCF5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5fa65e8b65588f99c2c0624926e7a59ec7f98f6e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.18","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.109_1618662433112_0.8248374548904227","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.110-renovate-non-major-11e81ae070191b05cf3f05fc869e9208fc0273eb":{"name":"@balena/jellyfish-metrics","version":"1.0.110-renovate-non-major-11e81ae070191b05cf3f05fc869e9208fc0273eb","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.110-renovate-non-major-11e81ae070191b05cf3f05fc869e9208fc0273eb","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ccfe9221fe55ac1edc7f04fad935df330b695690","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.110-renovate-non-major-11e81ae070191b05cf3f05fc869e9208fc0273eb.tgz","fileCount":15,"integrity":"sha512-f87OdUrNZb8hcJOydTyHeExv07xAi1lOO/gEtQ5FDcl+CAP/wXPC4e9xdOSunyW19hZ6x2PpoEFi+mb5xS8hWA==","signatures":[{"sig":"MEUCICdZGaa6Wt6xpE++T0aL3L2+jAGHwd/eweL+LZsqGfZTAiEA/NoDs3a24LPrmEcFBRLHHZ0VNhXxaCieTH30pvHXEyY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgev3gCRA9TVsSAnZWagAAsMsP/2pFKBjLcpVxdAm4kgNo\nIy/5QTtW+iiz4zTMsn98ZjSa54+LcxaAVhQ1BVaz/E68wyyK0xFbXIvsWBx2\ns8h27XK/Opx/GiQRXM9IGMLnIgs5P43g71mbDd0DsAlBvyMpUfu98/QVT7J5\nQ3q/jJKAR+03CCqefEKgIJJO8HEungZ4YF2P9ZKQ4NZm6NF32p1nD9EWuADw\nmGJeGg+x2iW9jWZzDpT3Q1C5q7nuoxnszBmjDFnZLMQS2FXBKKyg7cVfyzWi\nFG77StJkyU6XJbBNlIQQ/f/K9s8KZDKdBKq2DNseGfXPnxtr2ZkZg37Jztz9\nxBZxyIs8tiY4E1idlQbspxwsxx1zXMmLZcs1DVaR0llcAGki/FJiAhSkaIoJ\n1QgNa+iJP0NdrBbN+RIQ9l3eSQyyACI16mdqHCdQ9i7Ud0tZ5pNNPy8WR7No\nMlZOXR9LeaS7Xo0qPrJ9lD7lLOBztS3wHGI6K3ab2FqW+8gg9vBdXJBFyi10\n2UE/ifymPfR968KcPAy50HOIom0YfHnDS4rZBGnGZDot3MiY6N8fmnsMjhB2\n/CRXtwI3z5X/0d/kGUQfw0kzvm2kkE2iC7de/X+Ekp3m4f4c5xc3roEvdM+E\nOf4XPZIEqsYrDbCgEQ5bEtRKXHH9+am986bK/ZsfZFNDHuLWnqqW4cT/7ras\npqr9\r\n=fkLV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"11e81ae070191b05cf3f05fc869e9208fc0273eb","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.19","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.110-renovate-non-major-11e81ae070191b05cf3f05fc869e9208fc0273eb_1618673120448_0.3203448055228899","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.110":{"name":"@balena/jellyfish-metrics","version":"1.0.110","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.110","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"78b9ce1359fb9b63fc2c3dbf0cc98b01fb7a315a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.110.tgz","fileCount":15,"integrity":"sha512-xbguy6vlW86cjsc1o0gB8C4FsHtAWNJP2VdahtykL/cod7jpRDQzjwW1Bh7YER11Prd2w1c0oPRlxUnZLIYwGA==","signatures":[{"sig":"MEQCIFZEgZC5+P09z/IBavWhYZZYgy6P4+znXkp4/B4f6aG4AiBg+NGZtdS9LGkto5DbUTfMJSIpxPnVcxplbZhBAcx1vg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88353,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgev6QCRA9TVsSAnZWagAAbcQP+wYIBLYJgbn+n9h5A2en\n74isBviYzowUcpQTd4PB8awvXvOV+3r6KDT6eRgmTBBjfTiM2cB9uxespYBL\nZiQDHFhEmBVpJ+9TurAe5zyfhZbtP4htVadnaQ2TD6bcbcMZWgrLkSjy6BJB\nf2T63QIIU53QFP0zczyZyQCAmZLUOOaJ1qAXjo6jPey57QdcOLgxuLHyyjd+\ngogQQ+CdnqyLs6pBB7f3FHWDnOizYF4PJHbL3c3AEoXvkhR5SHeMKsHV51Ry\nDt1Kw6bDEzmnuloTNxODJIGsqmH96sTerCDRc/XlgHNqj498l344ZhsIPZsX\nif2u6HufPRJKmTgcqYIc5AoiJmZQWT8wkoW/mty4/MhCBVmLjB+Wd91T65T/\ng9lJlLZbqi5uLQv2eDyQFZHwvZ21Hsgg5Y7/CKuu4Jry8HcbElR+TJFn9/B4\nZgUdzEpPskbrCs7g2vtyZn1kvXHWmVU6YH5oiLH1I8MJgGiKu05Hhz+vBaQJ\nilgrgru22pTPRpRqbjIGzRrPoIk3AfOFIRJErT+j90q1EpYs1ml6GzbjERG6\nOgApXUus35Al7wpfg7Bs6PSn8dp6S7/UsLiYLM7EnESzY3JEdndLlo1R8Ln3\nvtfO824I3bvY6+PiavIbn0RhnGOlzavS2Y8ts/3w42DIDJFmNnSDWdtVWTLZ\nMmeM\r\n=oE5p\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"129a37ff70b629f80749284ce0d21fba3dc16e92","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.19","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.110_1618673296015_0.020885078250579614","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.111-renovate-non-major-c0f38d22ab3368c9cf32003c6aca4fbff46673bf":{"name":"@balena/jellyfish-metrics","version":"1.0.111-renovate-non-major-c0f38d22ab3368c9cf32003c6aca4fbff46673bf","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.111-renovate-non-major-c0f38d22ab3368c9cf32003c6aca4fbff46673bf","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cd7bc638b91df86d0b466fe95de70fd79d086121","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.111-renovate-non-major-c0f38d22ab3368c9cf32003c6aca4fbff46673bf.tgz","fileCount":15,"integrity":"sha512-Ptub28KSm8uKfHuVeURUPQdTo51j3vPMtoQ+mKzEDSBsjYtAL8Z3fb/ITnz7a7wy+fLrEFzxt+sYT8uHc/RpYQ==","signatures":[{"sig":"MEUCIF+jzSXhcIbF0o735WeSc18ygtss0oYItQtIbL39m2pJAiEAuiwx0Itg2qsbc7HHgs2tl9OxsWqiHTz8l95H2KxH/t4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88516,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgex+nCRA9TVsSAnZWagAA6EkP/03dBRk1l51c/fn4LlRE\nqu5y1oEAi4HqZojavCya2d0wb4nKqLZ2knaTsbMkwBcpUD7RyL20LsyTuAs1\na1aTtNqVhHUExqsKbhhUAc7EnCjrJ5z3SRjkpcNZ+EFRKvkF2kWfgnfIKob0\nu52AEcca7OGDsygNylYtVl6DBzF07ZmP/AP0/aQABokIUqSp0jvpGv5nEUTV\ntbs3ebWTJTua6GSuqdq1dYnXEwLsJxm/bgL0dV1mahFWaRMPZq8E4H3/3FMI\nkfesJwi4NlQUR6A1qCTl+tewScW5b0ycaQuQiW5pNenhzMK3tCbIsupr+dNy\nnM8gmWeiAT2Oi+AdY1HkLbb5u//SMOzvqtoJJ5BZT4weX9cuIpi91WVwzEvg\n11ZPHYxKTG14XghyG0if5bye/dzWyZv2qKirEFhAlX8yAf8Dr4diIOsrYwTm\n5P0fXagvkqq9AxeLc2veLfE6tuSp333w6OsZTKX0DWKoFEqJ8APAzOopxvob\nnhkFAvv5zEnRx7l1NLmAu0HR3NQUjgO+a+vtFyoBbXd5Hy5D/4bzyegg0nHE\nwbr1BQQQl79Bx9UR47EU/lJVFQLFSupHpiwb+ZqwIXPTbxkNQ/jYA4OKlX1V\nEYuPZK+anLhU5NihK6O7Bb/NXCchIVNKu62Xx0W/3PXeBOPPG8j51l2wlEhC\n+Xig\r\n=Lv5W\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c0f38d22ab3368c9cf32003c6aca4fbff46673bf","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.20","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.111-renovate-non-major-c0f38d22ab3368c9cf32003c6aca4fbff46673bf_1618681767319_0.2830418498244909","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.111":{"name":"@balena/jellyfish-metrics","version":"1.0.111","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.111","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"706e54cbde7352249d4af03289f08808d6f12039","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.111.tgz","fileCount":15,"integrity":"sha512-RvAPg+aQ8DhHjP2TtpfKQ61WA5MaDtf9l8u0vFlC+EJE/I2S76IoKIVJHgIf1JSwCavwRBt+qtXpznyWpkUbMQ==","signatures":[{"sig":"MEUCIBH2DrFtYlNG40Kvo3eomcIfU8bhB1N9G5V3mQtmiw0HAiEAhB+MhshPjdMzFP9ZZxKTQqTqwIuQ9weoWS0ldbrqO2Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88456,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeyBkCRA9TVsSAnZWagAA4AMP/RSRvDR/NfCCfwcnC/sH\nvIln6o1lwvYb1bT+gIF7PbH+UbWDJlIn3aVr7ATmGEjWJVcAugZ5MmXzPNEn\numX4DC/OwgHmgRWB1HziAzTn/umTbpwjZ1ZVp8Ys5eh1yXyUCBs7CgLk6M/g\nDkTPzYAJ6WPN/7oUda/15ocH/oxWzGRrF6DhNceScmTLa3WirUMXcmq1qION\nphv+8WoOLJuhzEE29JnxoAso/dJzz0bPB8JYovnbDcD4BUBkOEquxO8yughu\nlYGKjMdVc0lGCbLk8dVj8SDgdZsjy2lAdIuPckgxFvvSsi4Zn9bmiqGqXjG+\n7aI/8DjIOeSonIzbK74+AjrHp8VpYgD5Ywdn/trSB+28vMN08Z1cAmznTtQT\nALqyNRos9xznGjZF8b7VozC9wpshVihWorkOoDFOKK4w88z7yEN6Pzki4Um3\ncWAnsrGSbm1OQKvjv/+0AvFKjiRistbs6JCgmxeOWTXzp8YpwM30fOYBgvEL\nFDwukBBWdBWwfOZMc+3w21DtWROtqQLLASBbYCxhinX79tN2hlwlu87mHELB\nOygLV/filOSA9f9f1EGkSXuYMR6CTol8z8qLaF3zrztw7EMxuBR9x2JHVrLk\nM3VGdAv/pWg6yr7IQn/Pr8AlhtV5zMi7MXnAH6yjnIYERLBRVfOqg4hINMuY\nrCA9\r\n=Gq1W\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"76f499e0efae36aa71a0c400c6040714ee6c3b60","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.20","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.111_1618681955930_0.1828916675482246","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.112-renovate-non-major-58746957fe097023604681ddcbfaad88102a6d65":{"name":"@balena/jellyfish-metrics","version":"1.0.112-renovate-non-major-58746957fe097023604681ddcbfaad88102a6d65","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.112-renovate-non-major-58746957fe097023604681ddcbfaad88102a6d65","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"821ffdd162414935351e89975ac9b81c5e2c2489","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.112-renovate-non-major-58746957fe097023604681ddcbfaad88102a6d65.tgz","fileCount":15,"integrity":"sha512-7nNMm0OnhAIpMzd8efdGleqwkYvvaMP9iicU72vio1BjCtPsp+uTfdtaR2imv8ju+rTw7cMj6AaopucAWQTv/A==","signatures":[{"sig":"MEUCIQCOGPq4Wj3H4E3CcGxwY8NkdwJuAakMqWuICXX9l421KAIgOvkdy9gGi7IJ2JwXr7KX+hta4bDEk1QDAXlp8r2GjI0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgez2MCRA9TVsSAnZWagAAqQcP+wVbolTzvmhTynZzwai9\n3x4rLz2LvE/WmVmhdlkZ1K2/MJoPAA1iSyuosasAKERCbbFPWhEUt36v+Nkz\n6K0vzmxr9D6KaL5cskn0sR4pMqyCE0UpOgQ8kwHTZWRpSQACMlYhOUpkG4N6\n9TJ4Rd1V4SDqa86LMPncgCof7VocDSsFqFbb3buFvElCxnqzqCK3pZ9dlEtd\nfMehzD15WbDO5pNHurzw1z+mg16Dfywz+6DlPrsJw9uuh1aytm+VmMgED+hO\nz/i5N6Rd4zsxEaTEZ2RNhVuIckEGfFRhTg9C1cANVdj4/iDGGCKr/1n6hPlO\nNYffMKQPqU17m9dw1gzsZzUTDxsFqahUTEG0tGlVeyT2S5MNMSH2H2bnh/Uy\ng5PIEtyCYw2t0ceIdRjF6vLLJ1bUBKbyFpiQNiW07v9g+7DzJRvR6AsK4mbi\n2L8LFyFgC8cOtbWPLDxI2BziwxHAlcD/H0L0J2clEaNredS0kaEoP41BhPAr\ndo2Q9WZWZrI2PgbLrDz4QuXxFXr+kPxK8FXNQ+54rVZ8B3u50qswdBxtCGnQ\n/tfDaUL1QQejUPL/Cuvq/1nucEb2cEkZo5xcuT3EO96lC6oY7xc7ErVKpZJH\nMyGClcZsuCp+sL1tBfIh5QPCoK6cOC32j3e+0os97lK0GMUS/VGhrAe1G+Oi\nmQjP\r\n=dxk1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"58746957fe097023604681ddcbfaad88102a6d65","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.21","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.112-renovate-non-major-58746957fe097023604681ddcbfaad88102a6d65_1618689419778_0.9423346784675888","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.112":{"name":"@balena/jellyfish-metrics","version":"1.0.112","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.112","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6e0cac1a4baa5f6f4859d81cfa24ee1ac1cf2810","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.112.tgz","fileCount":15,"integrity":"sha512-eqtJ7Ym06zIwD6nt4QtDfz1y05WVm9nTiAkw/wlZ95hm3UAND6h2w+QLk/O1SwrfW7nWeDIpiv3ZZQKVRIrMOg==","signatures":[{"sig":"MEYCIQD066X0CMgO9Pt3I/cfAhY3QtrQIxqjuwlIJHSTSwtPfwIhAPx9XzVSA8UtB7vKCU7X1lE2jNo8EA/rH1qIsaPG08lf","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88559,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgez5cCRA9TVsSAnZWagAARvEQAJMQDTOIRzy4PEJLe8JY\nLG7YuUWXTWIyhcYDIbgEdvkFwz2P8IPOhnyR4WSnVw+WvVYXkYndm7ObMKwC\nEKVJNyH4I2NjvJCrui0zRZLlI3vkLM/3LgxIPhpiJ6dBILQXMmb2/RRsgka5\n0zc85siqJmfb7HDAQvs/jQ1rmviC+JFjMHVUAdigcbUZ6eeIINpTpVk7T5/X\nrgD53JxPbtVPbZFvvPR0qz48cgydqOQwicdijeKYWzGkMfBeDiqiKzpUAOZe\nf9EJ1I8BitWRwaAhkV4XXk/ipHumMZO+WGKCTHN5gz+E1HgR3H+pkSm2+Vpe\no0TIV4HdJeQWKImiRqwyM4HM0fe0FaBsUZKZYu5Sjtx/UmaAocIpon4t1E9G\nj6Ri7WxQDUlmHctXf03tEZyyN4N9XA15OaCa2PaAIKzVfJTSHitjjCvimEco\nUB9IIC+PVSA9J8xRx2Axd3vSOqvHL31rXFEeoWGi2AM+Pt/G9BBTSrObNY/a\nFFS9ilThVS6mnPDJvb7bX1CfJajm67ekb1tXXmW03ESjQa73jMCqvuOKDc2g\ncjP/epvEQe1KExBQQgxY2QPRDEYJqG7yYE0KfxWjNzRN9bJ4E4lIk3mXjT7Z\nd5FArqEJxeVP2nM+fgcRBNG8IOiy1m3lwKu7Nm1yzDt3izv/MInEVbBHN/0j\nF3om\r\n=ABa2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f9fce29ee9aa473259d018c06d43546dc2e8427a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.21","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.112_1618689627951_0.7079869457346468","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.113-renovate-non-major-568dfd18d58a30626ea6ace10db8e236c4b826bc":{"name":"@balena/jellyfish-metrics","version":"1.0.113-renovate-non-major-568dfd18d58a30626ea6ace10db8e236c4b826bc","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.113-renovate-non-major-568dfd18d58a30626ea6ace10db8e236c4b826bc","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"19828b39207a96328f2b6800c6ed7cedccdaf728","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.113-renovate-non-major-568dfd18d58a30626ea6ace10db8e236c4b826bc.tgz","fileCount":15,"integrity":"sha512-9tQtHrpKvBb0dicrf/4NNzFGH/dg6moLiFmveAtkmO9QfA+wGtgsgVpvTObnsAus+JSzryu9oDJk251vYy2BqA==","signatures":[{"sig":"MEYCIQCueaA1WxSvHTu/XjIJYSERdJCmKxHJQ0V3H4wy596KywIhAK3GLjILlgUrR0MP9v8A94IEBNffMiTOdy91Cc9si5wI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88722,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJge053CRA9TVsSAnZWagAAXH0QAIht+MVeqdS5bkjzgMEZ\nfXRbN6lZHai4LShcW7qu4EckCUO8b8errzoc+swqYk+Q4Gl5BdEGlEW3qvmX\nWcvVuy8X4j3GhYbc4n/HOkiLoIdMWxvmRkEKumKgabYP+J3RQybdlbRpYOmT\nThclcNz/5zdPnOAb9duLreiEYwe891Yqe7KPZva+Sdtd0xLjyyy4sMXeUC7f\nOCrse9w7TBaDBg17zW+eqTmuF97oWXqUgLq/X8iEsix81pYJD5M+KFLNJJJL\nreGql51pPakG7wfCxHiZrkezQ28nORtx7GVJjJbKlBWOKQ681OUusud3iP7V\nt6QNQ5Rq3NcqbFjLZ2hg3dSNrqXvEPDctJwdA9zhTaDDZZowvM0Pds6pKOXI\nMoyUT3iNGrcFfoWtMi+6wlWRMqLyGZHrZb/qgeDBxgSEwLjq2FASu7K0Iapz\ntFdyQgRkN8UjmyMeYu2mENCEep6GUf1O64tq+rr7Fj8z23MC1SWS18+gj2yq\nX+wEHa1TEpzyOJMGafZIUEM8HENRxA7xLvnVTQq0NoKCjsFSLLCpOdQUBynx\nMK/Y4sWJNMHsBGuJtEVfGT4fhX9bri6mMq30MnGrV3cWdQOaEbOroX6bTEom\num40v4g294bo0/fKzMWSqE92ts2kNNEo3p17u+pNphRv1+ALH4RPvDXtpa5C\nZBUb\r\n=nAak\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"568dfd18d58a30626ea6ace10db8e236c4b826bc","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.22","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.113-renovate-non-major-568dfd18d58a30626ea6ace10db8e236c4b826bc_1618693750659_0.4982375942605779","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.113":{"name":"@balena/jellyfish-metrics","version":"1.0.113","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.113","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7c7b48154610472589d0d1e360b09be4a9de4e4a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.113.tgz","fileCount":15,"integrity":"sha512-1CLOIaS1nOaAZiZZvbK3wo6fK03aTqfcvNjl7q44yUm38lVkTEkiVSi8Ty0PrKAA8K+YHteC/NkmT/Mqlhisxw==","signatures":[{"sig":"MEUCIQDqEfFO1HcvmV74eRwM4O7Mb0BG3h7yxhOqvpBaGlvPtgIgW04Ng2BTudYns7XNaaHx01atRSTGcs6DB/Ux59fCw7c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88662,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJge09jCRA9TVsSAnZWagAAGUsP/131n1DU4kPdk/MIslOy\nBm/L3/GRNauqPngRdQyd020xP8KCT5Cd7Qh3yMHgTsDaDYsAoP6gfERLpcHj\n/wSU2Nn4Tc1DoHNY/lo24GIr56xCAVrlFF7MKNi1arXTTdXByvW8dK+984VE\nex6hBpbmPqvkn7M/JxyHUrLDRE6twO7KIHITPtcMmPJsVzL8vw1PeLYkYbl6\n5s0HL1MpOh6d04kd8n2p7Qa83wSndAYfxBlLPZ2fKsPdd4BBfBMfQYD+uVU4\niwl6DQdU5TVnYBrDieovKS3dQzHmJe+ddVz70zz5w9FRe9AZJXPgYVYK5lB0\nCGnHkQrcsGERJBQ5BqX5OINrgkNc7G5Ks7lfGnOm7mpAd8W0EL4ZnAps4SeK\nWhQIXVN188awUIfMY74InOAGCcv7vpWvcLGWJqVyFR3AOJJpa2ONGdTCHIKv\nhCgbNfi+/ev/Hj2QdPcZ2LpZiiwjAi6VffOnp0HyVbWicFvy5msEzT/Eq1nQ\np8EI9O5TmwJxNLIIWDxj22GsCPCuoVzuwn2XHFDn2zvsL9+NahexMGAqeQtx\nuJfUcOGHdkIw86bhL1Ul075SJCZuPBq2doHUHA+ISEQoIsIXatFsQxhf+Ure\n8SxrZkSzg5xqwt5/Fxu+jpNMIAOiAsrXEcZMkO+zIAdul16XEzI93j3l+bqd\nT23M\r\n=HVgX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"571a639bebe61c5125434677047823c04dcf531b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.22","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.113_1618693987475_0.16145702395920325","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.114-renovate-non-major-062b180eb5ca8c113d7753c8845241f255dc42fd":{"name":"@balena/jellyfish-metrics","version":"1.0.114-renovate-non-major-062b180eb5ca8c113d7753c8845241f255dc42fd","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.114-renovate-non-major-062b180eb5ca8c113d7753c8845241f255dc42fd","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"81730b36a849fd1e6681489f1a9ad06cc051676c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.114-renovate-non-major-062b180eb5ca8c113d7753c8845241f255dc42fd.tgz","fileCount":15,"integrity":"sha512-4Hd2SL+9e1txJy5i778tsAYySce67HZSvlEolX1wKK64Ai5so6kbLVk+H7xuE3/P6Fu4acVRNDodpHZqZPhVaQ==","signatures":[{"sig":"MEYCIQCIGvNDcUSxkGalp0lP+unyrs+EDAmXdvafv7nn+M8AOwIhANZe1WZAto2fA0k6ia+SE98cxQYZviX5kHG0Fe5pMULK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88825,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJge3eKCRA9TVsSAnZWagAA3BMP/0REjTHduuHw+wx+5I06\nbAzYnY0EEhM9Z3J0RYbF9rIYBi9HQGZHT4zAhTDYOcgknb61XEW8fakCA9Vp\nff5BJysL2Wx9xuHyHOA9CJcqWv885gBSLaDMEHUdGZjyAHsQzE0hyagubG0t\n/6TFWtAJn+kOmJ3O0SIv78j+1EG2CKgsUEkOnjroer9w7P2r1AkoE6FnvMYN\n4oLia2145zJQYEasEyio4K1h9OVfw46ZYp5nnTMOjsny9emgjUX9H0PygrvK\nhvSy78iYkLzNQ+F7pob51/TMW48/h5UBAqE99jpFOqxIXt3Ze77sJmw0j2q6\nqFMe4WLaEwOqr0P2e5P7psvtlscExmDpOQBMBBLcBDQxAY88G1oYhKGS1DAp\nptHZ8ULCgZillul24NJlwrS71RIpEbc7+f5N5X5deLNHQz9VzaXCEo9KMFdK\n+FB5nYvz5mrCbszqBAyrk/MR7T3fIeZNDlN6LBD7p9Dff6WHjr11l0Y7Yqs6\n2saop+/mYik1zha9NUqsoX3zyrNiawNb6m9rlRVE9TV9KYuCPx4+wbREsFYj\ndzBeZQutPE6693oBXvDzydPNJMXuRP98hV78sptAI0/cocXTVLI12vHpcc9U\nAwM6V3N+nkcsLC0/1xAOK41LU4LeAwlovmTajRoRP840HFgCm3t/oqzosRqy\nzwbH\r\n=fEOF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"062b180eb5ca8c113d7753c8845241f255dc42fd","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.23","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.114-renovate-non-major-062b180eb5ca8c113d7753c8845241f255dc42fd_1618704266197_0.0916213816899143","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.114":{"name":"@balena/jellyfish-metrics","version":"1.0.114","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.114","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"48149c634fbc7d7cd4f2d5738c13f0bbadd4ccbe","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.114.tgz","fileCount":15,"integrity":"sha512-IzbP+u8wO1KSryWb9lBb1rYuSOXeEHmOpD+DhCOamD+DCJg4JoqW+88TOX96o3gsqp6kSb42e/hWwusmjmTkfg==","signatures":[{"sig":"MEUCIQDlAxxx54bx57YlkPiayWerqhtORCSjNP4zlS0zrPSlKQIgcvtnLMPNMa9tBrKIEdDkddagB/38TLPhepzrDpMI1Oo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88765,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJge3hdCRA9TVsSAnZWagAAdFUP/3SxT2pp435mPQkruRqD\nODizRf1PYPaH2oAps/GJffejxiGGyFmz6J/BfLyln275SNEF3BQDRrAx7S3X\ntj/VnN1gkEm2ECNrFvoS1akmebhAUv9OEgqXlw4v1KFF7foAOOtxIiuWQDNr\nsEpATCRJdph8RYSsLAqmTwCAvM/seNRuLE8MKXAj9rbFS7sLQAAX4e9+cW/a\ndE5n2lfEUz/8br/IQ8NwWL0cZ46QJA5khqu8PrJP8wcwinfQQjMEXooNz1/9\ndeT7Wz6kMc7JEr2e1s940kKDqOWhBNml1zs6jWbT/5G8msv7lAwaZA65bH7Z\nwR8wePeY2GNDFQMf5gXkbJLOceaql9RRSqeNDSUOWgCcl9338JdrF5cG73oE\nOTvqqMWoeJfXns+6l3Q+0nX+7uInI9CVOBvP002WeRsL1qv80eXGxPigTbh1\nNKajpiecwuoenH1sBO17QdGcqzoaMf/a98mVWksJdIaQLwjWSkZd78D90NHf\nsTi4mkleMpNyrpR6+ZhFLUDQ6GJzpvV7uyQ9g+J+gNi+wWpMV1D7A7+NnoUO\nnahVNso36xfk8qDOjHS4mYJZYVt+1UhhD4WjDTQhOX3wZKZCHaMrMG7lp+Qf\npLak/fphfMoqJo0Zm+cSh4Vu2r8VUiyXa9H1Bfr09+OiOlT/4075MXmcYvks\nM2uI\r\n=Fn68\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c3906c05137e4975c5ef6a34b8f69ea7cc63bd30","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.23","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.114_1618704477041_0.1915542842610456","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.115-renovate-non-major-073275d91da8a06091193904d068565526816fc4":{"name":"@balena/jellyfish-metrics","version":"1.0.115-renovate-non-major-073275d91da8a06091193904d068565526816fc4","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.115-renovate-non-major-073275d91da8a06091193904d068565526816fc4","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"51d4d98367f82b04ea16ffc8fb946afaeb5bc2a5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.115-renovate-non-major-073275d91da8a06091193904d068565526816fc4.tgz","fileCount":15,"integrity":"sha512-1xFwi4HqPnzWQZNr9j9igOZDOvchxhtT7taVEQ1WvqMVJ/+c22M5YLJ7pj2isu9YmPoPJyshaIlrOGLl/jzvbQ==","signatures":[{"sig":"MEYCIQC0+GYN17yI3jbOM8FmbAWAsBC8gDjwb6Zjl9zU/g1kUAIhAMrlBhBjNbnvVaTxCsNMeTCrLn+GLQciKKEKR9iMFDjf","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88928,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJge40tCRA9TVsSAnZWagAAVzIQAKOeCxVxDU/4/0mnvHlB\nLrJyaagwx0EUTeVGtgLF0xoZ/Vk+nlqiwiBdF0wtgYFvZF3c8wnvgApl1hg/\n1MBYNe734hKJnDMDctuwoyU3sjllKK9aZuZBqjAQQsRyyoP76VUTgdaXdVhb\nCKrvcrnNhq3WcZlzQ44WDKDLzHBd6bNTnm9gr8My7Be0fZrqD58rOZsc5oLd\njSUGnAdvg0ilyOEa7b9LeZviJVcAMpfGXvOBQXWLQVuOw5yKFzD5OEW2MMle\nJ7UOLY3pMq8nqvjqFJnZqbp6UTUJTOtZ7az//f1roF6hQJ6IxSMz0SVzPe0Q\nmcrO08yCPwEwPpPmCkxVOngYBj3vLqskYZ1SLZhZmR8nVofji8948Wir6H9s\n8IyDlK8G6xrFArGQPCLbQ/o6xe2YXD4MUEpIP5B0GX2w0Ul0JixlHlGd3eKX\nEscIbXh2hVpLaKa6rKT9uW/UlS7oyC+NuOLSXE0pZWQwG8W+qCcPyR22Y30F\n8HApHZUFwhy/pQjb0vbT4tltZxsMSXaD2dW/FKDMTN9i4CKG6887gPMLibgg\n5ERRRhj2VUMzkXjc3o2E4SbLcXgtrgF5R8nhUDwDFs1QkuWsBtJcM9cJlF0p\n/bXfYriQahb/FA4E/virlqljuoHEuWxcjiyZkinLSuHjHV+R2Vg/a7PNOnKy\n68p4\r\n=fixF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"073275d91da8a06091193904d068565526816fc4","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.24","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.115-renovate-non-major-073275d91da8a06091193904d068565526816fc4_1618709804690_0.0171866985950353","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.115":{"name":"@balena/jellyfish-metrics","version":"1.0.115","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.115","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"dfcce0705a215f3391f2b70e66c8ee76b7c2c8fa","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.115.tgz","fileCount":15,"integrity":"sha512-71tzeocq6oQxNSRBLTt//WE8UMN/phzSYutpwH+JiK8vOqgpqbUvzoJpdM//mwtDIcbSltJ5YShyQpXZeUG1IA==","signatures":[{"sig":"MEQCIBRVx+9l72GPCpKasju+mu5rwk1ay0lLMe/Lb74mHYDbAiApN5h2+USBWy6/D8B0YAzzmxQctBXuZ0AYlQV9aFRXUw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88868,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJge44ECRA9TVsSAnZWagAAPDAP/2fXTIcC5moD3irnL9h9\nBRudjbt0pnRy7/teO7zotUx9Ft/UMPt9b2R6RTmSWEXElKoWbhrR31IQIAML\nL06MKUV8PwlSXxiZUTLqFhUbZ2rzuERYaxzamnhE/h6hDSG70W9rgT2ZxaFY\nprFekj0xWMmBjPDKzWZYGujy2K7UHBhGzF0q4Wqp8avsgh5m5wh6qtlrDrbY\nQ0Zav68J/EDirROf2S14njZkYX+NgAmtUaJrd7QLWirHc4VkJ9LSDA9yO6+q\nup466JBeHHeG4EurXJOP+w0KWBIzidDwU3Hc2f3QW/SR1EnZ5EqrnRrndy32\nIyx+LnYjbgm36Gp1f/te5SuZstjxV3RY+rkHeOayiODEWwn7K7LkNLBQ5lC5\ncj/EER/d0xSwtF53afnDqh6BrR8QpwE8YxqyfTrCOHxJuCDP95VVxmhJIQE0\ng0I1jWjc0WRmFDUMXxq5hRl2XA6ZBF9mCTAsmI3O2QUPGrtcIVFTFwCssI7D\ns33xU2qAwgevVPf7o2Co6O6wzqJFuPXztPtEtoAHSAOzhdECfdXVpNeGTOpc\nbfRRBI2yPZwtddZez3A8pUCcgOLATpwaYhVLqJIIs7OumBcM/0X0kNdjaB+V\ntjg4hJ+xqW7fyIw4vZAgsamgny8Le5t8EI1wYfAyiNYKzl5GfNLo7RBBpJmE\nBuzA\r\n=C14k\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a809353d494062793919d9fe0833ce27a3f5d90e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.24","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.115_1618710020227_0.02700387384838221","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.116-renovate-non-major-23728171bf216614c95664c43d6cb6fe3aeb8929":{"name":"@balena/jellyfish-metrics","version":"1.0.116-renovate-non-major-23728171bf216614c95664c43d6cb6fe3aeb8929","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.116-renovate-non-major-23728171bf216614c95664c43d6cb6fe3aeb8929","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d3659da8f220a1b6a2f272efed5c13fe8310986c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.116-renovate-non-major-23728171bf216614c95664c43d6cb6fe3aeb8929.tgz","fileCount":15,"integrity":"sha512-H0+3pSIJlIC/DYf1d2Aucjs/HRBM1q8Aj4UOhoSiebgkdsvNiKCy1h8l5hBvPJTT73QRWExmZIIUI/9w+raHfQ==","signatures":[{"sig":"MEYCIQDzN3o+AO/+0dpeZApnsfeLBA9Fs0Mgh9kw7zjOf9cArwIhAKglsrJ0cDK4DGIrpkvrPa7y5Rgybf84PoTh4PVuqxYG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89031,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfDJiCRA9TVsSAnZWagAAFzAP/jJX1oi1i+TPpQLyylwQ\nc8kjt04i7RG2gH7Oes2lHSjNq8AhJdjglLkc3pPIdlKqmokIyl9yabmQX7Od\n5hQkKw81QxTLB+U/YIPUgS5jDJH/rdGKqX8+05ZyOxpzEa4XfMeJylc7iQMG\ngPcihljoCWRGS8Uk85aRN1L9U8JN3pdjIIlXSgKQ7gBzcNUVFuDH3ZgoUDD5\nwwGhGCAfDtmjGjVIYYDyRvqpCkluuYCE8mbmU8sTjSDetoeGjiRMbn9U/Z93\nmonPQeHtk4OHcMmkYGoYCo4JbWOXD+d48uBwYqVP3aFjClcX6yNwHsQIeEKn\n2IItZYIxm5IjwBnGFU5QrS8H2XqXMZqCoS3vMxRqANikbGohlu1fhxQkbzua\nyPGWPGYxN+y1F459gkaAj4rnRNXTTnMRMEkSIF6fnlTddhAMpu6cA/qi6DBm\nwr160YMaLVu+OzmYJv90xyI4QszY6WU1kD/uoQxrbPM9XQwZLbzv/S0V8W1u\ntpS6VWn6jLzUfuox8pPkApq5j0jXKOkRGhHAICdyngg/a/3WadKUMUiuLpw0\nznO4i3quRoU7WsWg7/PCQm815wXjzsCPA1wV5O+mp/pJnxfgyTrBlcMvN/EI\n+CFD+zwM8zAh3NGNCeOEXc6E1wnhmPszMDE9jsoQ+JekhHSNNXAbfyuBTeEC\n7vIM\r\n=SgE4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"23728171bf216614c95664c43d6cb6fe3aeb8929","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.25","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.116-renovate-non-major-23728171bf216614c95664c43d6cb6fe3aeb8929_1618752098048_0.2041588896041442","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.116":{"name":"@balena/jellyfish-metrics","version":"1.0.116","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.116","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1ccbf1695febd80dc27f450194610efc4d287fac","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.116.tgz","fileCount":15,"integrity":"sha512-XMo15AsoYZvEV9AFLlLEUJ8N8mN6gC0ft7ACsaWXXLZAjkv+2hUwoEMgyjKlbWvagZ7EpghOPZRdVi9NV1fH4g==","signatures":[{"sig":"MEQCIFloQiOkt/FSkUe3aIBRPw9Gsw0MZPgFLxEo4Akun1KcAiAlqnafMAxCUYTsOCil1q1B/updd/2/mvQ2EaSK5Ee3Yw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88971,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfDNnCRA9TVsSAnZWagAAQo8P+wfD16SJ31SwCA1T5SzB\nz9L50q/cJZaTmJZZPLvrD5De6BnBVTE9dWXs59ImSRLGmmtmg4HKFbOlwBRY\n7IbLPdKVHJUimfFBZ+DLLrHn6sqaFXrG62cq+Yum6kixldu7VGikLZQo71wq\nU+ChOcFyRf9lTgmqKUxEuuxINsR0OJsvmn72csug86II+qSyTJV7VoDNtUu+\nzakXeP6KShZNT1+/dLrq8Zjkaw1hbyrfFMUzUiBJLoJQmSsz79inMbMQM8rb\nhnEfnQ7eB2P1TVhjlAA4Mz8a8UcEgjgyC6yB4+J8/l11OJNvnb3y7md8JWP+\nK6awWcYMZt3OWRcmxdjy+D5YQ1a3yxxKUO2oPo/60DnCoUfi2auFCYbkXJFv\nnDz4mbUvZdtWDk0x7CgXfHIqE0Z3o30g4P/ElZLWR+0gg1Tv62OXc3KDcX5R\neXoizbKA7tqIpRLJOnzV5RqC6TCkOd/qBDAJkZTZBVhdugMfmI5Xovi7TElQ\nuSPZ8mNE+KMlx6JOFkth5ftNsrHlwWD6RHX2SCfe4SsWOjF+jJBYkiEJY+F1\nO/EZsD9fN5EzNE4xqp9axqckkbxdDG6/Tp5fqt/Bs94jLHfe6i2n0zVO/ISR\nPwYTvHbxZcGTkVYTTx1KqRMTin6i7q4cnXoUk0gOhN/irgD48otYQWkNkcfU\nxKds\r\n=8Wix\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e1c12b784359da2a023ce01928739c7f5263e727","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.25","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.116_1618752358245_0.016938182206599706","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.117-renovate-non-major-a339253ca78f14e2265c3a1627bc7869307cae98":{"name":"@balena/jellyfish-metrics","version":"1.0.117-renovate-non-major-a339253ca78f14e2265c3a1627bc7869307cae98","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.117-renovate-non-major-a339253ca78f14e2265c3a1627bc7869307cae98","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a3f6c18513e1629bd76e959f4d2fa428e7302382","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.117-renovate-non-major-a339253ca78f14e2265c3a1627bc7869307cae98.tgz","fileCount":15,"integrity":"sha512-oMQsQNs2DioBku3YFKpfrPAU4OnJVCPguqA4Bi4/uT/Is81Kcn3pi5RI5kw+uZfUn3uJzDea9RoZokO0e5pu2Q==","signatures":[{"sig":"MEQCIQCaWnQTWwnYajgWCHanKAHiEPjhtVf6QAa+Cenp9y8PkwIfCw4JXG22rKoy8/NI+R2ssAVbzrZvHXnSMpPLHZmHQA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89134,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfFiwCRA9TVsSAnZWagAAH5YP/R6+9W72kwOYBH5tgutX\nYvqTXLkRhhEjbIZIHSWkaCZrxkG1YabMv3vsJMb5ihPRQXQMEQWXdF0CMMVy\nz3YfCh3vfTOaNcIQleAMe6acElkAW3r+mcH6ySarJAKGxV56vg+/T9Z0T2VQ\nPykJGmbEJoJcYaZY65tO9KvQ/DWCeoM5FaIx0zv49JiOMLeJDJ8EHUvIFyjd\niZu/ryaTNpGNDt0a/zIctlGIlGeD0tvXziS2rbTcnXpzjEehQ7MU4/OIAWo6\nim+MUfGtakXp4hY5iUfkz6wU5L/512x7VZx8bHKFmkWaS6byx1ZnLip0rIdN\nZsz6ReCkxcknzYfxVmVAI/JoHCYVf9JTY06j8x0Hd+WSJZTZ7y5agk2CJqU/\nyutrWAf7XeWeaeA8QwYcXdnIVnYQPVib3OJVaY7BZn/UuUfQXREIZwOoPlJX\nPgzxP/FSZ/YmJ7w0JxaflXSaAl5WXspHobsxoNhKA+RlSCbQ3+5EEF+KVqNH\neicSjQ0VScikrcIUVD7ueM8D12/gj2VnmERBZ9kQegrK+ttL0E1RcGHAg1PW\nkc1BBwxMi9WekSxt293UMfWqhDLoZlkzskU1L+EcvBdFQTO6F5icScmTQK6F\notRAYuvErBRhggFR8HMcvTsOPKHZTV9gOmdfLDzYS5g3fqWEkYlOXpVKZ/aD\nbAnI\r\n=TRFC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a339253ca78f14e2265c3a1627bc7869307cae98","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.26","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.117-renovate-non-major-a339253ca78f14e2265c3a1627bc7869307cae98_1618761904259_0.9515635261306143","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.117":{"name":"@balena/jellyfish-metrics","version":"1.0.117","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.117","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9f34c42856d506ae803db96c713305bd2b058d01","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.117.tgz","fileCount":15,"integrity":"sha512-U6AgGupD60B9DgOSih+yUkvhvOBPk0NAt2jyfLRRVexsaJrHBdUceyLozZ0o4ggNSlbp+JfGAI706y6EZbUMCg==","signatures":[{"sig":"MEYCIQDl/ykP8Nn5Pgd2An2kgFRPHzmY/r+NQ0CDFtYATy5gEgIhAMmiti2I/YvAbZ+o0MKZGLfMCF5vTKCAFf7svmU76wIz","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89074,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfFl1CRA9TVsSAnZWagAAcXoP/0pE9L/vnrIkig70LDoN\nGBz4hAmBSLvPXSWnwsE4QktoeW7oPCjoFgptV8Lli+C1Ol8dma98D/DUxaXy\n76mBrvuvWavnvXoijKt05FAmEdb1JTi2D0kdGflJ6zzFw0oSqrS2Xi8Uphjo\nr5BeGcwo8bNFVfdAf9lTSkUi9Xi/b0Bih/xAMs4r55Xnm+2AmYpBsoLQJbH3\nriOY6exkzIbx6IZNExRV8DFk2LK9HDjHqBEpChoftapMSFpDULN129Y5+Eqv\ncj8XyUgfA+bIjtg1OrIESqTDqgCt7+/ePi+YkIS7hQpAVGFL+WMqgfcnIpdk\nu0ni9a8Si8Tmz/tJCpxkv6Xew+WVXPFa/Ao6oYBsx3ScM/fxj/YpCTs8F5W8\nZ71PNA5wol0SqfUyUAwYxIIy6nwigGKJZ0embLFXCGR+xDjSLtNH/f4HYFvF\npL3ptXtGVZJibTevXI1UXJPfdTIW70Zyq0yn/n/Ju26X60nUTzzcadcuK2Kz\nDKXv8IobjywTPiVwD8wMRRJGOtgOuRQdVTRPJxDkMTCMjthStoKG00Ht3nIt\noj8RtEhIu2dS3tbjsL33pQKU3jYKGzYaasQrHmFsMYesdpoDU/5trSs8/EeY\nW2wwPLX6c7eIfIklVz0ijNcXAg8OP1eXystZi0G+vFl0U9/LboKYtK/fcah3\nuKsc\r\n=QOp3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"11743626ad5d2815a485cc5996ebc0ac34a153d5","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.26","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.117_1618762100780_0.21391713884307872","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.118-renovate-non-major-21bf25991453211adc32273d4832e8f74ac65060":{"name":"@balena/jellyfish-metrics","version":"1.0.118-renovate-non-major-21bf25991453211adc32273d4832e8f74ac65060","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.118-renovate-non-major-21bf25991453211adc32273d4832e8f74ac65060","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fe982ef7c6e1c93de69274df8836bb6e700c2537","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.118-renovate-non-major-21bf25991453211adc32273d4832e8f74ac65060.tgz","fileCount":15,"integrity":"sha512-fHMOvvscUBYZ/rjS0aNsfyZFfuE3C+N3DjTeDDuCrzaAQx++9iYfSsxos3M852bo29iqMU1Jb4YKRg4YVN4/ZQ==","signatures":[{"sig":"MEQCIAxrgStzQ9mBBLR4zLYDXCq9/PM3ykXMm4wa+z1TQuSoAiBcJgUouTp5lKyGAjo7+8LMM014RgbME9iagNkjlRVGJg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89237,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfHwaCRA9TVsSAnZWagAAJSAP/i1N8sVylesmVyezFt6r\ntY86FRhBmBDCODEXFnWF87R/hxJUitGLZM/N8Nn+5htMotanL8dAPN7P1Onh\nQ6V7Kyl/O5sT0cMW3GHKSwyA87z7UEYIxQVQXGJ/EvYs28ufMW3Y3XrCJWEG\nYPlTlzvjYdmyua0o/BFsX8DqSbQxHjFdCZszH2h1KMlHr/dpJJ2FJQ0oT9Nz\nyKDax6YA/nGzOZ9gbVo54RvFXdv4RQIyBLtE3YVwdev2aEYLuEv8aYm6bZlZ\nJzARNwnmv75Y5EgTp08s9bUvb+6vEi4iFu+8NDAOgrfG2pQ8wkQAXSPJcQFm\nx20XHYuhI6M82EQ3MYDUnW2EIjZaijOAXxvcCFuy70Rx4AibcOsN2Vby1DgI\nNleAsx0d/fwTm0Mw48ww93FVdNwfkesNJQx+Q0AYS+83YFOcSIwB02ZfT6Pk\n/V84ZsdlsSGdQ598b7ead3PAKvaha17a+Yv8EhlHlTq28MPwjfWlq3EQMp8f\ne+7JphU72xie1UAPLJOr89LYel+bXbpDxY2d9wY26/mA6sLHVcbUWmDBli9P\noN3HlJvbBjVitwHLsG57cHc+G7Rk3xOuKcGKfYqyUD/fFfS8v/ET//NWA51q\n6Cyx33Roh4YJ4XYUrVQSwU6/rhWmSRDtp75ocj4p9SeN9qE+H6UqBsYN65YM\nzGZR\r\n=7tgS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"21bf25991453211adc32273d4832e8f74ac65060","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.27","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.118-renovate-non-major-21bf25991453211adc32273d4832e8f74ac65060_1618770969866_0.01146470989507864","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.118":{"name":"@balena/jellyfish-metrics","version":"1.0.118","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.118","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"dc0bb2effb93656ab2bd30f090a742cff5e56938","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.118.tgz","fileCount":15,"integrity":"sha512-a/FL4qD5QHaSYwVuh5ttDtVz/r9p8TeAP8jHhwCcSuOahf2tSZH0M5BtApEWAzJxPBF3RoL/CFeNGz6IZ3EpKA==","signatures":[{"sig":"MEYCIQDuUfepGAk1zqVSjxMg05jnG8bKo51clP/yI4bFx0fi2wIhAPRLtLbYCMckipJZc+7P4gH7QvXr5RkQL4y4r0PZ5j4f","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89177,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfH0XCRA9TVsSAnZWagAAK3IQAJR5LDOlx0Hp82FCpWXj\n6ohlDFJAzQ+G7XgTuD7+yeHhb//g6uyo0uwSrB+ARxdpQId4WANDIiiC5mFX\n0RcTEWBwnpL7j6OGaLw7AZZaGf1JpMoUTWggNioo+XRvBx8xjujWPcK203He\nUTPZfLzpRQuIJj1xV6Wcr79dLsbnZ5YhzQXtwous865vE+dCIhgV+q/LN+ak\nGwvKCShB2L5xoN7gpCwU9aCtv7yk1/26I0GCwOmLbteT56F9m/fFKqzc36SM\nLka3i/GIa+wpInlVtrXM/c20Zy11yxSkwftlQ/BZy6ze8X4ZGBsyhWIYo5Ys\n/W2UfT/lZ9ZNt7fWDRkKGTtU+RZqUpO3nBLlymHlinQqFjsvqHWybaHn/BkK\nXN3d8MXcYk9IdXyl8I6BKrxtfi0A1MkU6RkCLyn07abwho1A4DmtbdtxjwG3\nonIK8SXITwKMv4DCYLA1vobk7QGUogK9VnHvUaLjkOlGqkdjmZOmtosrL3rH\nWbmvdZ73AuEYYJ1D/5kRLiGbtlZ/2zYH3cFd4TC8dYiCNXTQgpVlIgXxBXWd\n7JMBrkIZevdKupl5BGDdtcvIw5hMfGDZhM1pE3HPR0XErJB8OtN+vhlXoD2d\nISApstfibuKWmrWs6WkV3TEcU/dCxVp3X0OG62zTJiX8BxeauSKH6G8Bdp+q\nPO87\r\n=w7iQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"fb568009104714bda3d970615fc5be54cfbde53c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.27","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.118_1618771223333_0.9443995352437431","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.119-renovate-non-major-a579e84d0ad61d6eadfaf0228f22e9e85f141172":{"name":"@balena/jellyfish-metrics","version":"1.0.119-renovate-non-major-a579e84d0ad61d6eadfaf0228f22e9e85f141172","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.119-renovate-non-major-a579e84d0ad61d6eadfaf0228f22e9e85f141172","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"51b6b0b9f3cf6d55c2b6a69e54cd53c6766c646c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.119-renovate-non-major-a579e84d0ad61d6eadfaf0228f22e9e85f141172.tgz","fileCount":15,"integrity":"sha512-K60BNzpOxt83jxT9WB/+eDIQ2c/SYRnmsGfAr/alkjJEXTEu/FBurc9oQQgF77X1oPmHDvHSV6hslBazLcdz5Q==","signatures":[{"sig":"MEQCIH1RTeMQxEhoGanM8mF9jTLiO480g2IfbxEISspvQc+rAiAl2VLXBz9HlyNdeYdB4sYsC2x44bsiSJRGd0AWHvtX9w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89340,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfODgCRA9TVsSAnZWagAAzCEP+gOJQyCAkzRwy4L91SSF\nBInEYoBcf9wLEwY3ahnoT79gccY0DBvEZNrGqHNwS3fxwXX3eS0YaXk9ZSv8\nvCRqde02vg9jxWAPcnH8Lb+ijfeTHxixO8G40623eFYLWkDtNoknhxLEYECA\nzeuKz5+KEzI1KhQsrF/bNxSWHzyJhh7fRIGlwWVn1kuCcV9C1OgdqITqWZru\nbtN2NHO+tJJ+iVPMTC2Ze0KAFtlXKA1GMSsCJGIoDCWUgIwahw4XJHoOXv/r\ndWvn5mG7thhKjZNb3sC1SpHXzT4+4rxAxko2lgTr9U03vnZgdm9AVUBbFZpT\np9LV76Wc8ruXDA0+gxmz3Kue/bNLHwhRXtr2UQznt9LL7Nd2/pqEJSdpXOgE\nf6FaazqM2x2TQbQHuwhbK5Zd4+qOossWORIQ08fnZIPKuLt/QPOd4ouEjf5h\nVviRyTWfNSIX+fjN7YPSUDR42U1uQwmnu5Vc1Zwm9l3K2wXalY/DKnF7Jk9g\nvbumWRG0sieCFOuGa/AXrW7hU4sQUPCoP1qcHeYHTuV8/zVHZrmWpbhfQaOX\nsr9ifybo2u55DId3wOtiBqxcLLufybjmE5VyInxea8rUmNqmcAHphiHcHw6a\ntFzWWCxIRHhGMHnDH5awMP3rHDmXufORPFzjs3XrU6Yc9cY0IwzSSn2nbwqZ\n1xWU\r\n=d0b4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a579e84d0ad61d6eadfaf0228f22e9e85f141172","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.29","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.119-renovate-non-major-a579e84d0ad61d6eadfaf0228f22e9e85f141172_1618796768073_0.19806421781233285","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.119":{"name":"@balena/jellyfish-metrics","version":"1.0.119","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.119","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"be57beab1a158130ce59403ab04fc75695016db8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.119.tgz","fileCount":15,"integrity":"sha512-Qf0Izl/1X+E0+OWHUa+AI0HZ94me4hMzOGwBcxb7nRRfJuqc6WUE81Aw8pVzL2QZWkQD40ogZWS6o6CUpOke7Q==","signatures":[{"sig":"MEUCIQCB2A/5+3AJbt7OtUehNeeogt0T6xvXbbE1/0THILBZ5wIgP6cRF1Vdpi+m582RUGRiK8ewH6D+Zyd4VDY4sK4v7fs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89280,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfOIRCRA9TVsSAnZWagAAniAP/iHWjg6MP0SxgojUq0mh\n/9GPwO0d9DwSJOfwtg2Rhj5wGUqff5SykQ/t3EK6vqinKbjbC+dweHL3cQuX\n3PrqdClHsWaVK59cU+G74y8VD/6NdiPOopHsiZBnYbEnTD2GCxPnw0SQvNuA\nFJ1KBde1d196DoBIIHtAahiElTt2VzAnVfa4045uoZTemipDvIWgIsRi17Nf\nlTp2DDXQSq8I3zym1SahhLuXriFW/vf7BpmMPUlOxeno6NK9wmqz4ULxKTu/\nbTGeU51JFVqUvFe1HWajWXofWx2ciWMZzn/i53xLEvXlu3I+y557640s8jyd\nl1qApmSvatJQXn9x4le3SBriMx1QvRiJHZQ/XlOSDNKFbZgWI7xR/OLrNSx1\nftZdAHJX9vNB1bJXuOmfrFm7z6EHEX+Bfmd6nN/sFQzd5YEFz+6S58lgBdAX\nJSDU7ZcMNFOI+NYkd6ocnKKEMqp6BKkKOjoIgawO4uA+IJFBiZX/JMOVPv7d\nLWVKM1jNCBKnp/Hj2s8ZAKnqJEYdnwFcMLSSlfYkZgRAK5s1KOprLOLQsvB9\nlItSbLdA5ZipQ693ARSAD26Ez0oZ0DUdW1coUZnsiK95M17bf7KBchH+d92J\nS6Lo284PZDwpz2AxZHtRvBhwla8xHZx1mr5ukxMAaDG9GB5e3qYP3eNyyc+H\nRVai\r\n=M+cH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e4323e5b88befd23009452e79ad25e283ef5ad3d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.29","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.119_1618797072900_0.17118231775731663","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.120-renovate-non-major-5de05040cb5df7567bb77c090402e619a92662c2":{"name":"@balena/jellyfish-metrics","version":"1.0.120-renovate-non-major-5de05040cb5df7567bb77c090402e619a92662c2","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.120-renovate-non-major-5de05040cb5df7567bb77c090402e619a92662c2","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d9ecee92f1a47896710eadbf4ac7f3a3d3cf7fdf","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.120-renovate-non-major-5de05040cb5df7567bb77c090402e619a92662c2.tgz","fileCount":15,"integrity":"sha512-m8dlYJGkc7KSVgfbWHDPMcFd8mU14k4RHz9CPwIMTz204ZnkPsJcgKmfGTdWb2sbCL8DJc0d+38jYei8FoTfgQ==","signatures":[{"sig":"MEUCIQCEGGlSXdgztmGwun9dTeeSR8r1w3s+fUJiy9YB6zAXwAIgOMIuiR/wsCye3HXrV2kfvk11qSRTZjXqojqJAJFAxXg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89443,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfYEBCRA9TVsSAnZWagAASWIQAIp8lRJPoMnsyhysnarv\nfxLQjYltnGWNPZES+dgslJvu8SRj9PMdpaRvanAwEbfcGrtqfg4lfPfKuvO7\nd+k8jGDN+KHi2u6M8bP6Fi8v/IOGr28w6V6FcIu9sw8GNX3AzvBkWhmrfyJC\ngMrFC3C7AS1TofHRrhDWbcoimZsPGX8lQBAbwHhR47K+GwrW9Hj0KIjR+B4W\nsQkKhajiQVXml9Vn5HYbkwDBAuVXipCXVkv7Iv9I4T4C94h4ieTj4T23QMkb\nAlIZnK/nCBiB7Ol7nNMw6YGzARk/5eWhXLUEC/am8qrB4TpWo9QfjRL210PX\n3AC+g94D7rpx13M5hTIUhfUAWx/3b4jaXwgBd8f+hhdWb0gBhb48JmV+3S7l\nCvNwPsi1EoENyMrKNeesoFqJ1PhURIca7tXEIcYReZPVas49J2icybSSdylv\nDi4F62XhWWBuw1gK53and+llCkU8Omgn6GVft7X48+zA34AbgU5Q37Uj2/jM\nLcBGV2Zq3wv66So124b9lEBDU0W8Ne6cuBQgRvlexhgT6ibEnpU1rS50aLPQ\nBjK8Sk+kL/XBKQko2Ju73aepc60w36agAzYH6n5LAJbJbq5C3ido4GX2uoqc\nGzf7p1FP6oIboDi/BOdamCGr1HPBk9dXvx1AM1qV1sjtjfJrUND8A17psRtA\n2mTc\r\n=a6+A\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5de05040cb5df7567bb77c090402e619a92662c2","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.30","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.120-renovate-non-major-5de05040cb5df7567bb77c090402e619a92662c2_1618837761293_0.8684674200961109","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.120":{"name":"@balena/jellyfish-metrics","version":"1.0.120","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.120","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"aaebab193a59d5c63fe8ee6ef06b049077d5baa0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.120.tgz","fileCount":15,"integrity":"sha512-PEl+8L4LpxqDo3RTfo4expkgI+ShifiwiOHCQz+/M9QctdaVQ0OP0VPVWk8//2Jk/ecng82pilaCn9l+3MNcIQ==","signatures":[{"sig":"MEUCIQCWWobW3n4HDe+mjB8JVXyZZ3fuWoMPAi86T5WiM9Q1kgIgbcv9dRUwfCJA8IP687yVQK2KFGthSjxcaRSm6RWYpos=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89383,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfg2iCRA9TVsSAnZWagAA7kgP/jczdwkZXTvX+mDX0csL\nMT3gV8FR32haqCaTC5g/VJDmp+RoZFbj/sHSrc7hk/9KvOH8AI8T6ikvHbuw\n7T/W5G4VQO2tQ/TgiQ6h2oLCZJm2VY1VmdPC6/iQ+xUF1hpyVua9JddocFai\neP7k1X+uoCNjX7zEng6sEL5uxoSvo04sDNnxgAspSY+uX17aomxsHKFqfsEL\nmXfZXNTmj/pwCMXzW6KGJ620ojceHX9xsebpUEwbgfLClO19NFBZgG2oi3M8\npNoPxqiDndXHcCfg5dmNK1a9pYT1Vj0dDhkbg7a+LXo6ca8W6IbWIhOh+p8q\ng8zi03OBE8NVygK9nle60oYaI+eqCVODFwDwmyB67pTWE0QbKTxuzhPSZFE9\nT1aLWwq0V4c2vLKW86tQnwGPFvjBs6NWfPBrbm/EUG77bVYgZt1875bGDsDf\nmNpl2mEGOw7nAvvMj6AvkEShSNCENvtX3vgiRwYkcEgdxPQ1x60PYMlzSbgm\n26uGSwmBbMHTIJxObWivFKmea0+Runj5Gs1EfyB6YmaC7ywni6QX6bxjewfX\nQA0TrtTuByZKHObj3H206CZFC66EYOGwcWMgXKQa2BzV13v3bYUBZ9N3AV4l\nN9WD2foejAxB/GXreXJdy09eWINwVxAPh55bMGrbNHOLMpAEcqjd7mdI5nXS\nKfCH\r\n=ZDQs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"fb4c1f146480defdf85e990621bcdaa16626b33c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.30","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.120_1618873761914_0.2531579792210823","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.121-renovate-non-major-4bf9936b7cba300748226999f72e2a3d6e1f9e23":{"name":"@balena/jellyfish-metrics","version":"1.0.121-renovate-non-major-4bf9936b7cba300748226999f72e2a3d6e1f9e23","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.121-renovate-non-major-4bf9936b7cba300748226999f72e2a3d6e1f9e23","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"643dcfa3ad37e8752c4c9e697fb36750b2ce3e9f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.121-renovate-non-major-4bf9936b7cba300748226999f72e2a3d6e1f9e23.tgz","fileCount":15,"integrity":"sha512-pZfTVH74ehUCOkJ+K4HglSHZndYzn0+gPpifmFJyUg6ztgmf4F9iqW3bMMXljXaVRABfZzyvO6sAXaaJKKfKwQ==","signatures":[{"sig":"MEUCIQChlOEeqLL2i6a58sScoJKa84MpBycFq2EzR7sTvw7s6gIgRkbko5b+W+UD75B9HnJQ/vWehoELn6tZqN7V/aZ/qaU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89546,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfiawCRA9TVsSAnZWagAAV3IP/2SEopGaCRg6Fbec1Dvq\nC2lTjlk3frD0SwXdaVzAtiC+lpjHHxGGk76Vy9+T0TNuIApz+Ow6Z7Ct4MSl\nxJ9RBPxupDFsm4l+6M6r/2/fesLFh3o/kT2aOZKmRq72hMAq3iwfzujQAIe1\nS6NL/SksJk7yvjMn58F0RUh/gAtNwAMxwElE9EhpBbYkp3j+vkVvQbl9Hjgf\ntZIJXNHlRaGoDGDAcNtiT7+Xjc0OLALQa4IXPesOrVTd4c4Ypq5TvXRtmXQJ\nst1ug0VBJdK4iOfTYYoE1WCjFzKckVYQvTQYsdNzz5xEDSL6rSop0R5xSUB1\ntLr8VSYx80cnP0ElOGMYfUgkXAy9i8No4lMr2FL2fTqVCyX516M2ILZIlljP\noBC8ohVDxP/xGXJCH4P0eoCLXBNWksWCacEWDtJcNr0fFbOErv//0RPMUmH/\nNI/qMspahea0YR6ofElNFOLSnXU/xCCIMelONy1BI4GbeQ+8zteu6qk1B202\nUgxE9YVGRiodF8vVeRKgwR1pHEEaPJvr1uI8uL47/EFSCh3JzRXLDBNFAmEM\nANFJyVmCwL5HL5VFQD51aYmnIg30i7xJOEzodEhoKQB9jUS8Pt0cDxnLAUds\nVeDDQzBHAvWrq/+fKnrMoKeU71x8y4cpoJTKvDPFgrtdLpEtTEfI4wTLPIFQ\n7G3N\r\n=CfQX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4bf9936b7cba300748226999f72e2a3d6e1f9e23","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.31","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.121-renovate-non-major-4bf9936b7cba300748226999f72e2a3d6e1f9e23_1618880175707_0.4895583670927235","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.121":{"name":"@balena/jellyfish-metrics","version":"1.0.121","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.121","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"87166abe911013b55ccafa1e5b80bbed90ea2c3a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.121.tgz","fileCount":15,"integrity":"sha512-EOlUxaIwQ3RLkjnJowss8UiS5qARZ6I/nGNyjVcKeg/+ExrKtATEqManFXXj0GMXnGt5gIvKZdO010wQRd5vjA==","signatures":[{"sig":"MEUCIAvV7US279rUwsaJkF494mn14hZTgHK2t1UDUL9oMW6DAiEAuvT8tqQ2DyO91tS9xh2oHNBd6ETDBWsJxBj1BYFsP0M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89486,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfieBCRA9TVsSAnZWagAAd9EQAIDpwiGMO4RFGokpTEzl\nzqpcaV7UR5N6zi00z19upXlFCyO+RRjyfnWB3lcrHI65z3zuaT9PWPwUiHUz\nu/7+2UIsU55Ah4y87cZ88rQaetUaOoX/yb9/a/pJmYf+UKl97GJ/ZGMOl3u4\nUFxy2uywvOhqYZpub7KXceoL/7CfKFEU9Uz+czVbQR75l87dwMcl5bLu2R95\nUUO01XtnbR4x8pFIRqlRe4hB6jWsxaNi4B9eCtbjFDda7QdtPF5pBubP3wyG\ncMKUEG+hSEv0AcR9uWZ3AQeuZpvUMpMunGu5mde449XofIkbP8JDkFaghYEE\nQBsPP2H4DafD+l30ULAixBJu6t22mraC7yIgL31mIdG31QgRdvb54SorqWqD\nxfuRlK1dq/GOpYn5wHNRVomJ3kWBBDfEgDjO8o06wHj5IB17x4uc9LPY+aCD\nXZi1hkW6a0WmReGoH0hJi8k/QqoMcqmRPyFcE5weuH7OT0vUKcqMh8Kr4DJI\nkrdd4APxDSJPcoyX0QTqBEyYqOjNMgDMb6kjxmyRRq6Ms2JtG/1/KaCsIXHw\n9zTFTPl7lbRcnIAUYyup0SCD89B3nW8WEz8SYmqryNBurfTC2dOPGuqc7rmR\nXLdy00Pm+z+hUKuc5FbR3//hRK6P2Oc0qL2biQ5Xg42uLDzvs3kaB8CXzj/Q\nSWzA\r\n=tUyB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d8840da0146314a8945ec87df59a2722f78ed02a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.31","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.121_1618880384702_0.271087082917953","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.122-renovate-non-major-6e1b2e02533b6ad64f6f00d83654bea728e5e511":{"name":"@balena/jellyfish-metrics","version":"1.0.122-renovate-non-major-6e1b2e02533b6ad64f6f00d83654bea728e5e511","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.122-renovate-non-major-6e1b2e02533b6ad64f6f00d83654bea728e5e511","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fb08643d13ec311d23dec368fd1857ccf042da84","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.122-renovate-non-major-6e1b2e02533b6ad64f6f00d83654bea728e5e511.tgz","fileCount":15,"integrity":"sha512-FJ2Hkn//3AcviRrqXmvd8tpgfBLHMPiSLkPI0xe+tuEo70UW95Ipd8iE4Z3Scz5quDx6HGnDt2T1CJ4VoZQvuA==","signatures":[{"sig":"MEUCIQC0laScBwzd2wBaFnpdkEX08uvHB9ivGjvK+TPW53lofgIgFtPr8WxpdUOZdvkkVBsoUqnKI5FKTN2Vdx1m+6qxzPc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89649,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgflozCRA9TVsSAnZWagAAknUQAIU1pMAIkQ4VSUgNUH0y\nvqeFsRKuVRIUQdt0o4zArIUl7OL88xzx2L9uI90bw6MJEPYOIJcNMKZ7ZuNv\nhK+zU0u3bLBcQhYCW8qY/SiFEnmzUpJ558K0NaaYkV0BrN7Luwf0Wo7tgGgf\ncK6qUJ3PcpCQ6cvcge3LYWYylEJXt1lDlINpAGudZTFabFfJnI/xFBqLjmPW\n/u+OUaGCBO3Ody6ZqZMHdUZY6lqfgZvXPiB1+gjegRLaslC+oMlzU1Mw/FCY\nAnHUIsNjw+9wwXNzMxajyLEtdVbIOj1kkITAqAOy5UkPwim85PTo9xyc1GUH\nDljEtBGlK7mCS8QhlYKlIZbMBnUVIe3zD6Mkt9v0Snjte/+x3054QL9Pubbz\nmHGozlRl9/BU0udqQ5SSoiFXy+T5sxqy1Q7WVAR/r2DON6OZRzG+tlWv3XpO\n+yTRcvogWIAxVR6BexKbzrC0VjPczN254JgCBKJiYHwzuVrzd8iS/f8Ov4CP\nUDnlnBdEVvowm/h1UoEoqTGMcQVZRNNUfx99A1CjbuBSsS/tu6BlbOoNyW9E\nXXQmzUZwZUQVL8ZmJFQlkt00d1yIB17Mef+Fzf3pRlxMr5NXyX8mJQHfE7/o\nR++htEZ7vtIa965LFhhe3SUic79JLk+p2Nzaeh7WSpgW3lLuY43tVfKYWhQ7\nsLEL\r\n=o8xm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6e1b2e02533b6ad64f6f00d83654bea728e5e511","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.32","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.122-renovate-non-major-6e1b2e02533b6ad64f6f00d83654bea728e5e511_1618893362647_0.1401708614328907","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.122":{"name":"@balena/jellyfish-metrics","version":"1.0.122","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.122","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2b101f89632a711e2086df1e461bdb35354f874c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.122.tgz","fileCount":15,"integrity":"sha512-EpAoPmzVIfy+rPTE2/OZsae7fbTrH5n/V7hmCDM+RqESnyLDbb1ymBgGDeEKE+f7D8ckg5OCxibqLtj+3WVyng==","signatures":[{"sig":"MEUCIQDPreFbRs+wltvKyHbnMDGySYyKRvDaQL5pvRft5+PXNQIgfiuGKwbseRCwldRmI4lJLIwN5jMZCAu7rSIExy8OzjE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89589,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfls4CRA9TVsSAnZWagAA/0IP/RUhb9J23z2Ymxp7iVDE\nnSFNBe8TaeWqiXBo3bdvYEXzkfdFZNS+sF5Awf0szgfEShJ6wFwIPEAqE1lJ\nkDlXdZcCHiSmEv0DupHxUvmyb/lfl3i0PKblvSJTwTmig7mvugf+s/2ameOB\nbsi2M9ioVrASuNCjEBoyHpNSNhDimSedM40wjxsG97JR2hrPYvILKNvZ1JBx\nNbSjYT3Mq2hoQV1iN3+92XDtsCTomVwuozMbXt9HgpO/waPaKZ9Bisaoos4c\nIcB4aSIhUoLJK9aTA0dk3PlMkzXzhikLo8iock95FaAOoSYsOst/siLg5xVl\nK2AbQe1FmDi/C8FQl4cnWDmAe66CzoqcnZb81rC6vhD8bDHGjCDEjoduEhar\no+y2emM5TTdxyA1OXuMlBt+ie4KRkXD02GKY3L4LGpR8EXnVIIASPMpmaxch\na3ZCNSDiu62eYthpAforfaO7Fwn1fJiH6N8KjEG8TfujOp+oZvrudrNTTrq6\n17bHa3cdk6vQQ6Dcp+wPPc1H41RnaWksY0y4EGF1TdMRzmq60GakhpxKu+CO\ncm850ikIB7QcuXgRdE+e9QHKWEZftgTnxv4LazAK7TdAzIfMUXlEeaq9o52b\nReRgTQ9GNVS9Hzciuun44bxcIpv/10ijqWdH6wB3T+ZmCKjM4dnB7Rpzh1Xy\nzJTb\r\n=2hsT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"446ad50e04a792784d9790ce0f1d249dbed224e2","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.32","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.122_1618893624568_0.435561575162587","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.123-renovate-non-major-49a07f4f713590eaf50beb28e3fcc11d588e5d57":{"name":"@balena/jellyfish-metrics","version":"1.0.123-renovate-non-major-49a07f4f713590eaf50beb28e3fcc11d588e5d57","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.123-renovate-non-major-49a07f4f713590eaf50beb28e3fcc11d588e5d57","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"275fc0de0e8652f6c732807e4739cf7abb6bae85","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.123-renovate-non-major-49a07f4f713590eaf50beb28e3fcc11d588e5d57.tgz","fileCount":15,"integrity":"sha512-Xxsr8yvwzK2Gbw/N8xRjZ2swo4UFJB04GAIOaLJ3nryCOL7SHhmwXgWN8eNdrB9Dr3fvb5giDh/KnFADTplfUg==","signatures":[{"sig":"MEQCIDysXiuBYcU4y+8bISuXVW2Oy2y20KGsJpb42vqy+YzWAiBEvuuwN26FClc6IaN1AjtcUX3XuALmCGKh0MqDy1oScA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89752,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfsROCRA9TVsSAnZWagAAnTgP/i0SJ5QwKyPgb0E1/9AB\nhpBQxzrPpJGvi9bwRK3YfnqX7KkTEoD9BPsKS87JqxV+zawaEOtSzw7pcdLj\nIGWcS6avzhBZD6y+9nXIJ6r+xANZgOouae/0BI5opYKCGI1IihGnYP06Rvjk\nHdbksPwHtIUi775p9TQ64bBSO/40kwzrIDJm+g8MOHzePXdFSacWPY3aNoW9\nD7STSH4d3cKOPG2J2pwT6xrp95tNtPB4FRXS9CDL67YiYI30lZJnRCk84jh9\nzoAYRhzWNNKY2fIBvcmcOQeceYLXDCXA+SHrrc6pnxAZB3YShApNVuNimhJ8\netnEZukI+wTzCtZcJYo1cpWTaC0mPVaGCH1ghPZ5cB/czF3BiXwAQTbBsU7K\nZnbPPBYd8UoZEwJHz7KS8o8b7J1nXBtVn7lYiyVsvl/trtJcNkU1ZUhqv0D8\nu7i/VGLF/xO/asB59SAdHyjMAI9FgtUipbq8dTp/R1b78NpYhvrc+aSBotX+\n7LHId6o1H3yx3kc80PUZWwxBxYOKnYxBU+d4L94j+aEqidZESTYuCWYcIOB4\nsJxkrJOk7Jk3V6Dz/ApTL8t4y4NIEPOnLeF0D9WMAzywhnwUmB5XWZ3BsGcG\n/2SWescxTwg59g5H3+PrtZC4j87s+tyqD5MSdLO3+c4c6Xw4wuSFbbzUQd+o\nxf51\r\n=mlTi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"49a07f4f713590eaf50beb28e3fcc11d588e5d57","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.33","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.123-renovate-non-major-49a07f4f713590eaf50beb28e3fcc11d588e5d57_1618920526128_0.4252446919991366","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.123":{"name":"@balena/jellyfish-metrics","version":"1.0.123","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.123","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"07dea7dc3b27192b0cc61f9d039c9c06dbe3ad8e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.123.tgz","fileCount":15,"integrity":"sha512-OiuHd8UZktLepmGwLdlFvIpRCd3UmPttO3OksV9C99TqHMYTpquc7guZX5EShV0wLKM01rj+hdA5Z6EAAoetxg==","signatures":[{"sig":"MEUCIBukb9vt+plEe9urdRDY36GY9AVoZGf/E4nut865UrgaAiEAqZ+ktczLbG1TXxkbrM2+oxfpLnBYl6DamsaGeam1/bE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89692,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfsdfCRA9TVsSAnZWagAAG34P/0TbJOZGE3sBAb6yXd+X\ngkibInkfN1VUTN1AZlt8qMAJEte/aPfjhFGnRV54IClLa4M0Wq57KvnBAqKk\npe4mOhhTmOLjjEqNFMhdNYNo1WzQ8/pocwX438YG/G/46GZUwaFcBwXX87LP\nAPJdBAxH1QvmtRRPXB4mGt2ls8+a7kME/KuuK07xBxo3Q7oUwd1XN7XCajPn\nrI1b6u+jmcZw8KfwkyLLsq22qKO31JlkaKfwCxQ+dwLLL65ZaEvIXTvu/5Us\nkWrC9HVTCNsBjLs1Yei1wEbL9OPdOdSKekG9KuS24fv3m929JVMJFNRjoOr3\npXkGaPw3t7I4Aq1HbFpL/Sg5EZxnrFBHxXblG/yKyzQAvEkz5tf/AtAZFhL/\nVVIzgqCZxPDzXZrTY5tuybl7xZ8otI08Is5nEWQwFO7ZshHe6aZ36J7XF2hZ\n2EjdTJw8zOYr9tg0wOXl2KAjvYLnqR6/8UFaQCuqpyNpYzgZb1aLtsIUPjmW\n2vsngbHwn9swGDWeq709yRZG7xtWwYjzL97UWY4aB0rZl8L94qIyMW+vTSmK\nUOdEuFrDDR2BrOYPT9PRyb6avb/Lym4C/ocxzqPhVjvDnT97KivRqGvfTZFW\n7eytwrkBH7mG9In1Gj8TFkR/g3BVeK1skaW1UOauwzP5e/igTjl7ITXSv3/A\nxJam\r\n=eI+6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"1472b3e2228e5f739f5615eb368833e4188c4ef5","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.33","@balena/jellyfish-logger":"^2.1.27","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.123_1618921310967_0.2325665039293019","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.124-renovate-non-major-63914304fb3dc19d4b25f60df5faa3e5b5f28422":{"name":"@balena/jellyfish-metrics","version":"1.0.124-renovate-non-major-63914304fb3dc19d4b25f60df5faa3e5b5f28422","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.124-renovate-non-major-63914304fb3dc19d4b25f60df5faa3e5b5f28422","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"67617a9148f870f6c1190ebaabce90b0f79702dd","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.124-renovate-non-major-63914304fb3dc19d4b25f60df5faa3e5b5f28422.tgz","fileCount":15,"integrity":"sha512-Oa1A/amThAmF2ZPMQ9Qr5cfaosMSSmGPzClCDMdku0CMBkUofy/NlIZZ6xpnjsPls8VVwJ2fAGuBRj1KiaSDOw==","signatures":[{"sig":"MEUCIQDRvfPjK5g4ypdGXfjS0YZsMgMDsx1nk8KjfR4FwOHN0gIgNX+c/Z3Sj8dmTmgHYtbhUcaj45git19XbPRgmctGwkE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89856,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfyXRCRA9TVsSAnZWagAAQ+YP+wXqvYT881mSY+m4DKv7\ndiDIaEuxYEUP0ZTKOdfW3A2VveUKie/cPvJ78CV4AZ9rsmihi+TtowgNs75s\nyIKtL97RG91CYww7OQHpdsuKszozvJXC0frlewwmLC1L+yZyZMaWeUVt8UPB\nQYqceicE81cFZZ8FFVwJMuWQHCZVksSarWsoC2sRyQUgn3GfPFO0i//ux0Zm\njJFLFHmdm+WlSE2m1ql3KDz8+TzCAFyS78Udu0iZJO7MpfG01/7z/9zfuyJX\nRnCN8kbgoT0BRwefZ70nsVPZjPzcZN7LFLQN3Q8yZXoZJz1KsMJNP+n9b7Ko\nusU/BfKMYS6xjTFzL/a4Ex71Yudm8pzElgNUpR6rsOsUXVMhXk2MO3jvpXDe\nsgIzXUCn5GWtmZuh7MsNecYauP/wP0DWSVJ+JsYiTKA9GiQ4FohSj7ShN5Ul\nqHrpYGR+YgeS7kLO7PEZ48BGOcwXxZiauSiIRnD9y0hc+Fv6trCG0CmgUcoC\nr2Xp+pZ5UUxdsYQmMDs9iDwMUqMxRSdk/I+iB0st+dH7rExjLrEwpD47fEmV\nBlc+RbGqjfYZjy9Xj2zhfjBCmcImN0+Xkt41VmQnjwBhg8mtC+zfbnAfv5ES\nJHWD8LhFgaYP79PeSm6QmG0q/d32+avh1M92/4/9absdVH9MrJARwICBqr+V\nbCI+\r\n=Med1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"63914304fb3dc19d4b25f60df5faa3e5b5f28422","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.33","@balena/jellyfish-logger":"^2.1.28","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.124-renovate-non-major-63914304fb3dc19d4b25f60df5faa3e5b5f28422_1618945489212_0.2899243939472287","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.124":{"name":"@balena/jellyfish-metrics","version":"1.0.124","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.124","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"98aacdf367c674881426f1234e287c8e6f5fbf08","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.124.tgz","fileCount":15,"integrity":"sha512-0EGRlbC9gCCuQW1IbSzIJ3GKrV14/jH5SzZNicRLcErvg7uph6p73Zpi/W5jRkkjCPnRWdkh/lIvmT4zrfqC8A==","signatures":[{"sig":"MEYCIQDYSjL6Vln0R3LTP8jaKSkDJo8XQt4XLfisf6DS74vimgIhAILcrAXDXyo1PNAIZhwX/az03EpocwvSMARs9AyRRuzL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89796,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfybHCRA9TVsSAnZWagAA1DEP/19geuVzv4Ij0uv4T3Rb\nhDRBbUcNG3eyAzUI+qwVMk+XxfweaU7PxJK6uOF5exqXOoym5tyFMBFPEQWA\nnzWPoi8ncegZ35zIOraK/L8f+DCyko19Y1cZm8kaNeM34+DAUQeAQ8Ydytot\n6/+B/zztKtzrFaA8vEut64mPeM2y6Y2Dhs/LRrBIB3izxao0fujaS1Lb3LJU\nmnJ4CbhDgpsftGljwqf8JgZlJ/VrdQkyqAvjZ5eTEbjZ1nxgs8vf7NWWAHbe\neyVaMWKCYUd79ipN+dmZNMlqxx+s+gsmsTA6FiMTP3A2/MwuHUpOTQDjeZf9\njL32ADqwnNocj7o4qu2wZ657bWFfSqqwbIqVmA27vCkV7gv9bLT1rVcPmHIc\n5XzxtKwulFexFoeQsKYSmGbl7cwDqnDQbAqrZE9fNRbSscFCkdfJcw4JYzAH\nO4wKqou4PepwDNFR44nXK9gmiWz/FVkKLcdCQ3u68TWOzzPSBb2JHHVI7xL3\nPS1AW3UlCofMwKrbv/yweuDiqKhZscLk9XMdb7is8EmVCLstyXUjR+NxMvFU\n4Vzl2TauTmMZ4fAly/X1AlxvWoy+SqseFGBWoUMqErvau3JLTCIIAWjqRg6f\nP9Kp6D96mxxdVt9CVg5U0M8UBEa2CcHsQs6sg1AThdgnWEDfj+PGAShLmQLK\niA+r\r\n=/3nA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"bb88d58e13137ac4851ff19521613c67071fcd31","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.33","@balena/jellyfish-logger":"^2.1.28","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.124_1618945735210_0.1737064223201641","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.125-renovate-non-major-d67ec0e9082154cf5b534098229681fe0d365fc1":{"name":"@balena/jellyfish-metrics","version":"1.0.125-renovate-non-major-d67ec0e9082154cf5b534098229681fe0d365fc1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.125-renovate-non-major-d67ec0e9082154cf5b534098229681fe0d365fc1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"57258ae498b3bab5be8f38fc8321567108ce36ef","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.125-renovate-non-major-d67ec0e9082154cf5b534098229681fe0d365fc1.tgz","fileCount":15,"integrity":"sha512-tEOT5HU6IrhVVAtDDaSSkxLBTNlTjUbZi8e9LyQAhr496Rjx5qVYm4XWeEO6kOC3dp+6oAaX7iM4q/PkWj/5wg==","signatures":[{"sig":"MEQCIAIn0JuHuBlXyUc0oelx0dWUysYQhHJCI4JcULRAG+22AiA9+niPdZiLfMdYfnpAfp6tWjvK/dEqfqE7VcTdGeTPdA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89959,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggAE/CRA9TVsSAnZWagAA9a0P/1cMjQ0EKowFKRt4XK0B\nMQCtAAiljn6V1esJTPFx5Sf0+1yLUgM0gFRpIR99mfT6G8KSe5BSLSkRuBf3\n3S9bmZxvNucyfrkYU9huBFNoEOTe/p7g2MRV35xTnFp0Ry4Va2Mr+Z/GOmZo\nQ6U/FQngmOmBmNhaYirLeoJuxVR7hJR30uzNEwl1k9B+iEog3A+wF9NPMUc5\nJKGhqhJA3HS/u3ZwsJFt8Qgpkwko1+zgc5RTNv8yec+yURQ/ed/7HS7vUmiw\nN6fTuUc5hmWMPU6ttsl3Q2EGylC4ZYrMh6jLbxlkt524G+0ciDjgft2JNuZx\no+trrnDJ+bO3pXICvIlVDXjxdRV2jGbFT4pwKxliWzJE8jJ/8/CFrRvsya81\nwDWv/t2aOezUCHJP4BUq3Ye3Z4x8gCcFBCh63lidUdDu7F5EpzL5UaHId1lX\nh8Kxori2+8oGEGgCHrdAuui3APCQAoc9+Xk+mpQ+NX06Nw90mEd0LoAe4ajI\nU52UCuiAFuDOOuH43zj5MTUfv4pbEGUzGPH0cTeKynL+Bl2z6PZc4L6W6hPw\nLAJt4tTedo3EatcX4+e4pVlpFUnHhgUokGrpHcfl5VbM9rs1dwL0/7G74VS3\nKxOR+/YZdRxQhqs7YMH55cXW9G0fEzOBmvyIriEUR8FpqpYuGu8X7/EssFdK\n2fJu\r\n=vyrb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d67ec0e9082154cf5b534098229681fe0d365fc1","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.36","@balena/jellyfish-logger":"^2.1.28","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.125-renovate-non-major-d67ec0e9082154cf5b534098229681fe0d365fc1_1619001662662_0.15954035589644033","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.125":{"name":"@balena/jellyfish-metrics","version":"1.0.125","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.125","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"434bf8345bb7129553c04f6e0e14d2ecc989f1cc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.125.tgz","fileCount":15,"integrity":"sha512-OkdpS1X1mruEn3/9D4RN46kEU1iHFPvUdCb+ghQWIJuH105P4XHkLNK/oFh/2CQA5J9MYl6zpgE3g+EvGV2RoA==","signatures":[{"sig":"MEUCIQCu67XtvBOhLVFSxfP4v5caOvLFeg29vBGGxswJnYhlQQIgSyybYCkyaEVYdp9/Jh1c9EWeta5zSXvWnL7HPdkoXpo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89899,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggAIZCRA9TVsSAnZWagAA7qAP/j0X6MAaAznB5+ZbokoY\nuGVo+NNMSypCWSm8pi0BM1ANhiFR+NIxNQwwmCJ3uWbNQISjo1Wqbv0RQnXX\n4SlmJktHbJ59zAVPimkU72Ia1vbl82P1++3eiQaCzR8NFOucDrZjgjbFjWA0\nKXPVgc6k9Hf1xxxQjXsHtOzELtgfrmgRziUekgeveQYk7V1rMNwKE7EIpfM7\nc0C+cA2Fm7TCAnVRi9XHEYuPL1OrSksdjcPENxXuRXK1OncYerxIAGb85Ald\n2CG4sJP6FiXqh2QfvFUMffCmGi5bjbIb3Q4m6NOvRGYQRjHUq6QjTC44HoGb\nr5VZinODxtmML6Uo934AM+itCAQNO91AzbaeGCS+aeLt8UOcMC6ya0T0bXTv\nQMKO22w7RXJN0ItG5y1i9XefHf7ryqVAEQvC+x015XM/tEi/xyAzHlfHHShk\nj7eBk4/ODUYqcS1Cjf9yruzZiFU8XQkyOIL+c3MPssnoe+mph8P9XDYvNARP\nM/9X9T2k6/RBR63VE6QU7AT/7yo+8Ziz0sLlmPPyWEj4tQclfaEB4YeFS6pZ\nnbBbMBHYLr/BLGddi8q13yOoUWz89y0m+5fTKPc1EKtTY78khLli4SDBvsbt\ng9ZoDxBrZp55pJc3/Y5EvY38WjttcfomseZY9I1ox6QVuzjfWIJ9eJX0VzPf\n6hQK\r\n=czal\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"692847a4918847878be3b2587194391b2a111a46","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.36","@balena/jellyfish-logger":"^2.1.28","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.125_1619001881072_0.4458898277275152","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.126-renovate-non-major-87ea47fedbb4196123e9aaf7013fb5b93de66119":{"name":"@balena/jellyfish-metrics","version":"1.0.126-renovate-non-major-87ea47fedbb4196123e9aaf7013fb5b93de66119","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.126-renovate-non-major-87ea47fedbb4196123e9aaf7013fb5b93de66119","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a9bb9fbea31aaf435c76e662cdd92d4275e2b680","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.126-renovate-non-major-87ea47fedbb4196123e9aaf7013fb5b93de66119.tgz","fileCount":15,"integrity":"sha512-3MMWoSyEjh29h5oDv5GvRaM2dp5GLKXIi9Xu9qzos7PsSrIOpV40hgrtIhv1WuBl19CiO96LxQ4tpeFI9VVlMw==","signatures":[{"sig":"MEQCIBxKNJI2a3ri6jhWmCcYwRMbxeY/tSK7n3cDAcSBvZTsAiBFwSwbOFvjSJuMchsRgGtGU+WB9ZifOoAcAw0SYGTqkg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90062,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggDp+CRA9TVsSAnZWagAAYvAP/jW+NjT7vdScGXve8xDH\nyoacUGs+6oFeLj165sCKpItsBoueDvx/Z3N1JpQPc7ba+wDSYNiZZnpynFDU\njpg7PQc1Ces16AEDc/2p9NPrI7TOr0PEr/8xP6ijA5EUNcn08FXrdl9DUkX2\nQ1MNceomTKySRkmdkqfLi3I1BC3cTfpXmWTatZKadNujz04zH7II4pUOr01o\nmXL9YDJHPniHZo06fN4tqyAYO584U3XP6RWVl3m5k4vSlIiCZK3V1GRc+rkO\n2Qgbe+CPoJrKOF8Tpneq0sGYjgyfAbth9oSLyMh6qdjY6TxPluXx+KPbceZA\n2Jixj+3UTrAGgUP6HgFHBfoV+B8FWUCtgT+gcRo3N5o0i8b1juVpnOZQUAuN\nms88v6G4L7yaH6GXw/ORUr70JH9/n9hw5Ilj8+prC0ZY4PqLoZZX325d8Lk8\nXhTbdwk6jtJUZ6AgUnxhTq5Ruj3hR7mQW1QAtKAJ/EDNWJo276cPAmKCP1Dd\nEoE5fMUrcmU9lxA4RbivhOt/W8icxx0iMwqcw+hCTCjNdn0/IzFasEkMWmKU\n3SXnivQeoOFfv6rHBWnhWnCmbox0eGT4mIJgiXWaB3nSEYqvvWgpQ211OzHn\nNvEfCJef0poLk1+GdEldpIaoBfs81Ks1ePTnoOaAYDrKicSTlPN2mY9cHjqH\ni36V\r\n=vpYY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"87ea47fedbb4196123e9aaf7013fb5b93de66119","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.38","@balena/jellyfish-logger":"^2.1.28","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.126-renovate-non-major-87ea47fedbb4196123e9aaf7013fb5b93de66119_1619016317578_0.5082453055108782","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.126":{"name":"@balena/jellyfish-metrics","version":"1.0.126","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.126","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"21756d532703575915eaa2dec584a10256552399","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.126.tgz","fileCount":15,"integrity":"sha512-w2I+wiP9u7pJWnMzYiohFcmkDJBeXvKLa4ILqninY+QphvRk0vK5dyTfQ9+D7JkkcACt2dRuL/7KQjHclWi0ig==","signatures":[{"sig":"MEYCIQDicgedd2ITI1/FDZk8Nm6fF5TU5eNCGLmPkGVU8k824QIhAJDjr+5j6ueIV0r4SBgUoAN/eYeMWyMipzA4J8CzyzJV","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggDtrCRA9TVsSAnZWagAAWOwQAIfYlj005wv1xJN15nvs\n8P0FFhuPAyndKDs5M/DNK7Vb6dnn5nA/Kdu08JkSgEJrb5SQkJzw5a7ncGML\nppqL/jyQDKjs6w8RtnXk6KyTkWbBKaMB/VOk4c3BrPHtHslczssxTGyWrkL3\ngTBAJ/WgmuYcOiYoSywG/F4Q9DAQsh0ZSV+qsydplB1kuMTKz8rXlaT7pW56\nxd8PPRwJMPDhXmxyIrzihGXDqCnqLIy3y0yq4bT53MTu0AZKBPh3WUvuvQU+\nq/vFWIdVrqNvf6tFiLSFQ8W2bnai3I+u125C80oWnZJ5p2nttFiP1KHRwzwh\nFXuB72wPdNsj0D5Kwjl29S8dfeWEctdG0z4maoOzWTwTYuAr8TMWNWtwYJqG\njF49B39fzKJ6z7GnMvYUbsdVGKA/XpwbF9prt/XXe/5qbIVLZxvJ9mvDL5Rl\nP2GETWq3WYvHEJbKMrO+1IC5T39EUvwnJBxSPjtFV4mrDmMnnRC6amgAih8k\nSKUwmkni0PdCm+pttkfO5mjaaS532Qg8PNyIvWVYcIzmYgZdOvE1ubS5AW+2\nMYXTldViU4YDwwwDFQawIOZ9y+6eSCElEmUvvYpCY+wXDXT35Eyd8Wb93sFk\nIYl0jVbJxvjQEAUoNcOw4jZZlO3rijd62uSbNnW4LPN/MQB0IQHU2efsmXhR\ngQ6G\r\n=PXC2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0c0e07b50614c343af17d44f33b8c369a44b2c48","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.38","@balena/jellyfish-logger":"^2.1.28","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.126_1619016555020_0.11700490245321182","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.127-renovate-non-major-9a26e3d865674e73bb44313a31da5f767f69db34":{"name":"@balena/jellyfish-metrics","version":"1.0.127-renovate-non-major-9a26e3d865674e73bb44313a31da5f767f69db34","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.127-renovate-non-major-9a26e3d865674e73bb44313a31da5f767f69db34","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"24aab0ae7a69004e27597fba483f7c6d3f09b97b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.127-renovate-non-major-9a26e3d865674e73bb44313a31da5f767f69db34.tgz","fileCount":15,"integrity":"sha512-Uhk69CILZRyrDf592lxGV8TK1sPo8Ohw8hwvmUvaBUw6DJ4rqtJ0Uvbq+d5Rd5hJ1gMZUX7QgjzuHz8k5R3XYQ==","signatures":[{"sig":"MEQCICf4o2UUVyOp/X9jJFg6pHMcMtx/VkXCrYCRfn4IH7Q1AiB+nTo+PeAM0jp95oqe86ifFGjIL6AIvs+PJj7+mKic6w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90165,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggHJFCRA9TVsSAnZWagAAsfgP/R+f5gyDzUNclHa6d+6B\n+ZVSWAChJpgr99zenpr4WKJgMPVIoyjFBef7/Yt6T+kxqmm32m0ytmiB3wqB\nIKKuigEd+IJ/xbtd/X51PrdV84U98S64p1q6zwvysJA0DUWVamrdqDZ//3a5\nzOiQfDpYUTAqN/XScIWZ3iQr99N21EfzGAWqzhh/IMOEa7+tGFCr4SRaLk8o\ntlNM5OhkOfoeY9jzrP7B3PoD1M8q2GUcFYMvL5L0UA/qG1t2qOylempHTrbk\nnTSIRDCx5xnTB69gm71mTkjHvLTv1vAm+Ak7nkjF2Oho8/bKHO+giPYS48XC\nhu4u3spIGTdzOViDXhaC26PdqZqjIG5leCDfP7ZdfUNB0Tgcv+GZtggTwbaw\nEoTjq9rga0PJn1mAqf857f55/1yDIdwKbPEjUfS03jK0AyNCxr9uYxaBwBcF\nmhBkurIByyFqm21qIOVlk2K4PRwBZ121GqgZM1gtX0EXTSfTleFPA3Q9EuyA\naVFTGP1mbaBSa3sjBhReS5GgiSK6cSzAzRJUhXey8cYji/BKwdlJ/IcO3h/e\nCKuXL/A4cHgSVTQEY1Z/LbxNEhAM2e51DIzOXR661seZXMghYk8N586NtCGu\nA9ccj2LbRg08hgp+yFxL4Jt4JrPjHFSXCE7wrc+QBWmrntJLRB7oa4TkNjV6\nMhyy\r\n=rN1n\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9a26e3d865674e73bb44313a31da5f767f69db34","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.39","@balena/jellyfish-logger":"^2.1.28","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.127-renovate-non-major-9a26e3d865674e73bb44313a31da5f767f69db34_1619030596798_0.822041694283141","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.127":{"name":"@balena/jellyfish-metrics","version":"1.0.127","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.127","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4e47ce40e14569207852853767cab33ec2964cca","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.127.tgz","fileCount":15,"integrity":"sha512-DbHT9kXIJIEcZYBSQe9hLGA+LSES2zA4H9931cutCPT4v2tHe2DIp/Oddy1ou7e9GQYU3R5EtQYsveXTuZFWXA==","signatures":[{"sig":"MEYCIQCK+97seK5NsPaahkpPgMLmnFGvLAHE5YNoJdHaky2IqAIhAPQT5ZI1jhDWcuBdJ9UJlwRzayA9wY5nXD0enMP5MR3Q","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90105,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggHR+CRA9TVsSAnZWagAAi8cP/0bN4Kh1mf+A3iiC0jFo\n/MbniuDAbn30prruOJ0p2CU8ntnvCQLH0TxLc7O8Tq3OYIDFwET+aHXffiBv\njgQcmCbvL6IABGt95YVXgOJf6QE2Ubkrgwzcr4pDWn8Gock+cqe2+qyI+6Eo\nvS0k5cpvZ4Ff7hVW0/f0k0rIWYBPgdmyBj+oE7J761mAYPyPiff34TswO9pW\ny1JkhT20UasomSFcC0fU6B4AOISy4IHx8SLcATPplnraZXleGtfRn+ByYpUo\no4GX6Y2EJbelUa4s9XiNwXFDxT+/Cxt1B4EA6/7zkqTCCsllDuxdVSQnbuQs\nuCxk01TG9xGzt/1zRIfz59Ivu/MYIG5TAN50hxByyMurNUPtUvIfcMQmpx6H\naRB4GukNcv1Dy6pX7TczfSJ1lKe0yI/X5qxjkSWAc+4F0pwTBYE9juCosps5\nfrR7ndv9j58VMalNI4ehS4snq9m9FoSzfuRbfDvgMQ97irMxzRrIL2shsto6\nO6rSMjDuJfgdW9f2k40Ao+wMdEgH+Q+Zq0+ZErIwozKjxjNQQc7mnMTWNmbA\n9Cn6OzvxoDRskIBJzIb7iO7aZl6iOtS3HDeVPeUc0M14JvphHli6J4V+VTDW\n0+fODWRR/3vx//lhwd9B3ZMPZbaKcibHqMQwlIyEyBiubg3c5GDXO05nrE+q\npL3H\r\n=eHhX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"03597e5960d1dc195cdffe8f206be972ce268d29","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.39","@balena/jellyfish-logger":"^2.1.28","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.127_1619031166104_0.21542291077328435","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.128-renovate-non-major-0a65cfe6612761ff63b8bc9c4c3c7cc76ab28354":{"name":"@balena/jellyfish-metrics","version":"1.0.128-renovate-non-major-0a65cfe6612761ff63b8bc9c4c3c7cc76ab28354","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.128-renovate-non-major-0a65cfe6612761ff63b8bc9c4c3c7cc76ab28354","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"48554dbcd996bd30a01e7fbdc11aadd869fe5458","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.128-renovate-non-major-0a65cfe6612761ff63b8bc9c4c3c7cc76ab28354.tgz","fileCount":15,"integrity":"sha512-SNds39Dy3FkkwUktvGELmihIg9XLSonwhjy1wnWkM6WNnFz2FJCWvaEJIqkcpK3z4VOu7xIags/r/l7y5t0mbw==","signatures":[{"sig":"MEUCIHYfz91tgMbGW8aa+S8lXTfrsN2Q1EZ2OZb+l6XmDo1vAiEA64D7cauIWoa+wyO1vl5wkkWo74j/SjZfmLM26uVRU/8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggK0YCRA9TVsSAnZWagAAn7wP/33QxkV12ipnTWbiXEZ5\nQULDpZs2KyckJoIW/HUA44Omcr2580b1wBTJ4rPXQh5CrimulETYtyf06/l8\n+lOsGel5uQ+KIJInwBMXYIHmlHRlxhk3Mg8K10V7nDwJXK1tdsfe4bR5e9cb\nJqGA20pMa2r1IX2S89eJclz49CJkpvKtbaICrXDMliOiyVzEo0xj0fJZFHkT\nycQcN196TuJS8zYw8w3suOmgXRgt4AL3LYIxZXKCDote153JP8rRtR9MPZZl\noq8MbPfJpw9Ec4JpzYycbv4efLyw+KdPCjavgLb3R6G432MvmSjxZrjIEvaw\n8I6QRAXnEFq45jmI76WCYR2O2Cl2touqmMEu5UMc4k6OGI8sAdUlZabUFOKb\npWR0DSDO+6BsjkknLy2bhDZp62gruxPWGsUSDLS8sPOl0yqf7UWeG2XBekBm\nVObnzGNqKNORQSfPmlciB+YxkfzMd2FM0ItlZSym4QFLXASJNefaTTwbCHji\n+6gf9ApbtVUiIF7nEfdtv+3FCZyn1gzKqJrgwjfe5QZqkFzz4F1ARjigtk2E\n6T35+UUuXjWLwg8EXfKYfvKfpibElGm+zlXdSSwyLvnK0lOqebRzBQL21bPj\nYHaiV1rr+1N+9ybd3LXliJt5P3aZ3lERiyxrSlfSZoCNjICxp/twhBMiGCuf\nGH9l\r\n=4koz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0a65cfe6612761ff63b8bc9c4c3c7cc76ab28354","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.41","@balena/jellyfish-logger":"^2.1.28","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.128-renovate-non-major-0a65cfe6612761ff63b8bc9c4c3c7cc76ab28354_1619045656352_0.5789575260441211","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.128":{"name":"@balena/jellyfish-metrics","version":"1.0.128","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.128","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5b6f9dc9ce8f216c2478179f23e71c032b95182c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.128.tgz","fileCount":15,"integrity":"sha512-g81JqfL7a7qcQH4LIOPD5jPEeuK+RBq8sJi04j0ipCwa79XHX1wPhT3jvXxUg2CnpsAADEIhIi64Fqel+My9ww==","signatures":[{"sig":"MEUCIF5qXmQub1Gn4p5uTZceHdIpxzJQk4YwAriOlLTcMNBhAiEA9uFODGSUvO56xkaB9pyGhR/ctWPCxpIFuspskGXpxoA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90208,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggK3VCRA9TVsSAnZWagAAHjcP/RRNJP8bKAsvvrGY+nah\nal9hTyW/n+bGNlWv+FBsoSLs5QrZ9Pq7bH1G6yqVI9SG5+hMQG/AUI875MUX\n/YAr1fbfsTKLTJEgBWK6AWrytEUqV4NWrjwmmOs5FWxi6f3LI7vcBp6e3sV9\n/Fo/+BbaNQnjL5tX76rU4oLKHJ970UTHNRSMMTR7DNp/2v3XILmXltStlpgT\nir0JSVoXU9mJXKbkJALW66FTg9if+IczH2UBOf9YDOLfLJHw1TeHU0ezPm/d\nTFgLJBFNwqDzNZvyBRdkjyxI0GfsIJNZOOjL8Ddi1VX1JjRA0AGrCq7b6l2m\nqx0rQ4QsR+rNxcwLJR81Vz+tUxeAkhvcQF+DBivQuOD3EAsXNWbSKKSyeFRR\nw4eXpx3+02XiC4AsRixyhDukUAGiejw2vp/nVnH0B81d554ww2zWovjuOmJP\nPtiaPPPfmgkzY6pbwzxZe+3oMy9XemxPoIzQhnNG8yh8lO5hVuKqDtG9MWPP\nU5x/jNU0VqAyS9RHmFVbj9/8qxiD9IvVj3FSgdWeuByWT2yRxfDXWVaLZWqw\nRfVzBTWbI+CTV+WZD7V3UYSLqgNitw21FxiSFsYKQ4V9GFFNgNokA/qLj8nL\ng+Y2aiemGvNo/TSLMMlI698S/ShaVme7oiLjeiO9AtoEJx3aXp8j0SgBOb9y\nl9GI\r\n=5IH0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6dfce4cb119a412f3bc270d669e6fda923ba1f3c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.41","@balena/jellyfish-logger":"^2.1.28","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.128_1619045844978_0.684903118468539","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.129-renovate-non-major-11719b9e868edae4943f067c70787e09f9abf517":{"name":"@balena/jellyfish-metrics","version":"1.0.129-renovate-non-major-11719b9e868edae4943f067c70787e09f9abf517","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.129-renovate-non-major-11719b9e868edae4943f067c70787e09f9abf517","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d78333e0e88b7625b4b02a4de9410d4ca53fbb91","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.129-renovate-non-major-11719b9e868edae4943f067c70787e09f9abf517.tgz","fileCount":15,"integrity":"sha512-WEYWWkn2oPXSuCQim37rwcQEbZp6zatYqMcyxLSCECE6GIcfycFe/MRBsFFWWtq7cayrHwZW8dJna8JS3niOFA==","signatures":[{"sig":"MEUCIEJ68HLD01MON9Q9Hxlw7eh/9JmMjA5KIcPG8DQQMg6vAiEA2sPL1X6sqJ1BJwj/JaZ7DzvykKGvK6rgqzFhpEuQk5s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggicSCRA9TVsSAnZWagAATBgP/RotvFtfzWKNN2rXs+2l\nEvNg+EK0x8CCxuGQhaSg6jCwYsvHkzPXDK8njSDp7BffD1fshypJR6qkEAAb\nEgf8rieKqxAb8Uad160NzSIdXhxU41CxsSE6bBIFXFwJprYcrNAfF+H+j1hJ\nyCzQWD1tFcz7q6I3ESBOpilq1+5CKfLSk8+LFevfznt4mzrwPbt81l/I2blO\nTIVLVggpkUcO+c3k8gUeNAqVzqqj1fLlKV+29QdhEmXGfIKEvnWdZHVAhFU1\n9g32TPHln2qpWZdiF4GqthZblBfMm4GxVymlGAErVqJec40tL5gfv5onXjUd\nhxJBW152O/oUCq2BZXce9D9xQpLz9MShrkiegoqduEzIcQi4aUqSV93uPH2F\nCk2ViMuTEabrulB8RhrhWObltAOYmHnYUUTuFWtad8/dMHxYqv/8Iv6KVrt1\nKzyD7YOzNQDmloDKscq0wOi9PFdMVHAPQkxRgy6yxv9Mz68ynBRd2YqJNvdW\niqrKrrwYSjetGrHfQOgGdIVwGkK8P0wubAcVwCywNxZsM2/tADR9U2n4PRWb\nbXoCXLGBV5lpCbkPUEnc4gp5G3cG9QMIQTfHE6wn/QEEhizX3jZ17JQKI2sl\njgQiZv1EQEut87236UCRELhMELj2mHhNomF+UTtl6a8fPcQhMBsO8hRN8mKm\n4sij\r\n=78CI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"11719b9e868edae4943f067c70787e09f9abf517","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.42","@balena/jellyfish-logger":"^2.1.28","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.129-renovate-non-major-11719b9e868edae4943f067c70787e09f9abf517_1619142418482_0.7035130052523668","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.129":{"name":"@balena/jellyfish-metrics","version":"1.0.129","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.129","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"98f4001ef1d3dd0d6a9f4fdd63c2e55a9b8315ce","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.129.tgz","fileCount":15,"integrity":"sha512-prLvZ7lgN3bbCCs5L9b+JW527rz/I8S6JitPYHIL7yc/adRzuXdRSmSc/HWm7vYTSv/X0rQFLfSoOn1/gjFHZA==","signatures":[{"sig":"MEQCIC0gqZbANm1YiGok0+1A9pP2Lxs5jxZVm4arWM9gmINaAiAU3ZokizB8v6BVkTAk7T4uwBZlXeM83578QIKF+5vDNQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90311,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggigLCRA9TVsSAnZWagAAGOUP/Rky92+RZFTrndbCrsdp\nGUoCK6j73MJi4dlV1JAO6f0+R5dPXASTbQqhIWDte4q5KuXdv293mE5KVnEF\nOvioFoOpfMNgka1a7RmK27UwfF/502SNi+PFCB1dLK7KazYp+yB/nGl46oa2\nKzq5viBpKg4+NuxVxodmqxa1tw3e8Dzgh/8+AqOV3wJW9I/cRcoZqJXqrB10\nfd+K0n1WEc5Asp4A0d//CqWghkb4omNYbAjK7owvQ3jElEgV4/qE9bhRGS/9\nkz29HB4RyVvKk1WePurdHqd4Jv4Gf8/jEtG9anxnNcFNOdq4qmztZccbCMfG\nNOj7Puqp50EXExekrSS9dfNuXoZxNUQYxnyZ3d8UvHSrYruKJSo6VZeTltgv\noNeMB59tjc68+xBzON+jEWfFV+xz9oroVXQkSNflPKoTOzWYPMsjbDEjbf5n\nNJSV6uogo9unDSVm1z1GgWo5x/zIHBgUoNRXkrAtJ1eiBI/3EsNIdQvY1iXi\nnH9sE4VLgprzH4Nh2oDYJE0ujM+CTh+bamBKv6WZCthUmKQSdkt0FZBFIkQO\n6GPkuapnXS4j2GNwS+o7KzlzfpiXnfGSk3zIaW5oc0hpF1507lsWifTfPgv8\nmkMeH/xli82LfV3oxT9TP4UCCBZeEz9cx+jPnxh3UFmWOOqeIwUapFWc/0pi\n9dF/\r\n=i+wD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a13b110ebddf2c32d55d433c0035e83eb3e72a33","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.42","@balena/jellyfish-logger":"^2.1.28","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.35","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.129_1619142666807_0.2767528492896638","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.130-renovate-non-major-536cb21bf1dbc75b65156bc6c86648a1d5fe1813":{"name":"@balena/jellyfish-metrics","version":"1.0.130-renovate-non-major-536cb21bf1dbc75b65156bc6c86648a1d5fe1813","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.130-renovate-non-major-536cb21bf1dbc75b65156bc6c86648a1d5fe1813","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"606d88d69ce6d6847eb4bee8f43693602a15d47a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.130-renovate-non-major-536cb21bf1dbc75b65156bc6c86648a1d5fe1813.tgz","fileCount":15,"integrity":"sha512-Go/vAVV/MNKvb7SX3GEGC9S5qtAZb45qepiwYc8kcKjcnzyeTRGx54ti78PXJ3yQmI3QVs1PJs108Sb2ELhBDQ==","signatures":[{"sig":"MEUCIQDlKMCaoSPW6hhKzTgdZP6q4vTyxZ7IX//awOCO1MHqfQIgFD4plmuJAtV4TQyFx44w+ml5Fwy+m/cx44otB749cGA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggkGXCRA9TVsSAnZWagAA4woQAJdgj71XbShh/4Xfhaot\nk2V68QDjVX5WPT6wOLqByodzzrGs4OAEFsVPe7V2BR73D//Vc0e3s2YHjqaw\nZPYFhhCZqDm0iqOZIhXvDlS70+XhFVV6u09GxiSOd1Bm1NNGmr1RNx0Kbgc3\nj5Ic72O915bX2l+diD2Blg2E3Vi4KIqjVP75amYKvAPRUdnuU+To899XuMhP\nsGMn9UJaPB7YwG2E4zw+WWu5k2wPtYECzPXbX7XAh6WbxChk7M1nPGVadm9+\na+EkSs778kAQt4RdiwOP66px9QDZBPoTmdFPTpaJ1LvMxaunscHlh0DU3GeF\nF3uH6t7hfol7F2UgVQbSEyc6Hmux1T8+WHMNMPbtisIkMavSnlf01Ytjrt8t\nNERwBZ/8y0T/9abh0Vblqv6g3d6fCkGFIXFW1TgYcR7wv+2qkIodzhdrvzSJ\nztxWBr7oOMvhZnIYKEnXDjgFKHBJ3grzxcSLY/qoVyOqYMY+xd012roAi2t4\nklBz7b3NAzgqYmnzbqzx7ClJgvngZF7YpYigXSPuZqZMYYdnlnsFSYDbm0FD\npzZP4Bbyu6AHovfQ/kx5bGGXO2jQsNr+VuwR49H7acNIxaEPU6hKtBdCSVpk\n/kAXTrrozEl3/eCVSr3r91+shOMW8Hjjgze7V/ZezWIyAsI2Blj4BZ6L+U6d\nOgbg\r\n=RHL1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"536cb21bf1dbc75b65156bc6c86648a1d5fe1813","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.42","@balena/jellyfish-logger":"^2.1.28","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.130-renovate-non-major-536cb21bf1dbc75b65156bc6c86648a1d5fe1813_1619149206538_0.07281485182802627","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.130":{"name":"@balena/jellyfish-metrics","version":"1.0.130","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.130","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0aec811afd9c2b843ce97bbb92a277abca381cc8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.130.tgz","fileCount":15,"integrity":"sha512-/2tpJY3pLfMLixq0KG+n3KOMUoY9/aRap0VOkq6puyiR6yXEkEds+7Yl1tqC8TejHR3jkUaFPzhTGYalkOdO8w==","signatures":[{"sig":"MEUCICALJex3DdRrpb7hBrpsnrz15+qc4IzEiijn4xn6QA1XAiEAmelJjKydBky5wAFo0rK0kXpCE7v5uV306k51DrHVu7o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90399,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggkKTCRA9TVsSAnZWagAAnb4P/0efLLsakF56gE3Nt5/g\n4JarWPnTlF0ojZCI7AjtmsBxQ7m7uR4+ch+jpXcFxcDFnA7tMS4fDPi4mKC6\nnkn0g46lH6tQTcNns6D6OSpBeSJAS34TNOPP+dqA1oPKsTaDWlzBIKqKUQxz\nVXaTjt/ykVXr3gvY7ibr0lxGk4sjnDKBmtKre3YtiL+pjTEiUmFqOoxdvkdM\n0I2hrunZwysv9UfseqwGHUntP7GDQGs9fdv9fkxvOutSCO5o8XCTHMNzjNRQ\n2MqnvbzJl8H2Ymx10HlWql2EwL9Fc+76zrFY7ekzgme4R2ELbE7yVarajzEF\n91yWeGbFZN8lyp/UV6o6jzh8BZRVftu8e6kViztrKSRg32B1e42Xr/xF2TnE\nc3mAQwg8eKX4sjVp6w8EyZoRq8ieI2f1kHzUDytQ/E960YLB34XOrxz+4CN6\nRRWD5QbKciOrixe7EIA4ypNGdv1OeNFaI/gYkvfErZ9RJ/pQUNT+495O8dXz\nXG6DgAAgx0Y7PJm4Wku85fUlZ6cDqrDUP4fJqXxNiFyYwmO3fHRwl/koM5Xz\nMZtT9RUb6CC0rgdFkE5xHgrEAChTs5ht4K3xSXSsi/U759dIGiLxZrWez0v3\nQ7wj7Cb4KzJwKzhCCRpbN18qTGoeP3shlvF5ED+34ceuxQ5ASrco8ZnYGx7F\nPVhQ\r\n=LzF2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b8345b35ec992e3c450c993770a7a2dc74e01b50","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.42","@balena/jellyfish-logger":"^2.1.28","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.130_1619149459204_0.8966162389315437","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.131-renovate-non-major-15dc97e5b334b329b40da2e50d8ff800c7f65d70":{"name":"@balena/jellyfish-metrics","version":"1.0.131-renovate-non-major-15dc97e5b334b329b40da2e50d8ff800c7f65d70","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.131-renovate-non-major-15dc97e5b334b329b40da2e50d8ff800c7f65d70","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7bbaceebeb8db5a7711786ee4db5eaf4b3f4bb6c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.131-renovate-non-major-15dc97e5b334b329b40da2e50d8ff800c7f65d70.tgz","fileCount":15,"integrity":"sha512-LIVXKd8aoNLYp1qIkHpxL4OL4p1ZchlSxdBkfMOlEMTM96Mg6/i/dk0DQLRBA47bFFQMQDyu0Kt/q9xtxRjVHw==","signatures":[{"sig":"MEUCIQD+MIoJPXHqTU0kGPdIWgxNx7xexfPbKubGRXwAseDSygIgLqLtWpvuBdOJwEhT6W+bbVfanl1jl7uOe5ZqQfyodQw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90526,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggl7VCRA9TVsSAnZWagAAGvEP/1TNu2Shobzv08JbjxKQ\nmpXmT11AtSc7qdyeejM1cr1A78mTzvfu/9epEakeRApDi8ihQh3Ku5t70lWt\n26Z1sFEGb9nPmcoKfOt0SrREG2rUDLvPJxDv8MSXrmb0TEUwsOla3NeZ+ck/\nYklRIyYYnt28qWpOk9eqF3XaAcIr3JTuZBaUTUUacwTkXjuiK9ULQVNlioO1\nRkoz+orYG+0fR8k3aN0Bl4xm/wgcdzZoHvS+D+oU7ZUqifT+1bdS9+XGlIaS\nsQ2SLN70dlAJXcyquq6jjVKI3QjuyqcCTP8qPeF06A57VEQGWVCaJF8XIxj7\n3WD4oUxrwNMM0V1i94M2h5DExrttPuF72H0aDjWGmM2PsET+c0cL7BQY04fv\nqE5RFpyFqr0qWlX9z/blB1RI6vyGo4tu6sRB0+BQdWh6TyjR9lfvUKNpo7H9\n1l00LUt4i+nFBmvvVw1Zv1y2PDA9IS5upJequw1akhlwHJcEpuow87AomwGS\n31V0JVI0r6MQZdhJcZW+Dn04MiIkX0Z7pnyHSuQJNSilo2HFItciOYuZO2Xk\nyAaoCr9CVfyQknU05q8RSAh+Ncz9ntT2r+FC/PcMnrYpbD5sgQ7RNqAh45G3\nKVPqY/FeO1ranNcb+iKmgCd8R5pe8a1jGsW0/QrbXtZ12/oCkH5MNUtpmHhD\nwZ7y\r\n=lson\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"15dc97e5b334b329b40da2e50d8ff800c7f65d70","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.43","@balena/jellyfish-logger":"^2.1.29","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.131-renovate-non-major-15dc97e5b334b329b40da2e50d8ff800c7f65d70_1619156692672_0.6258894079160671","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.131":{"name":"@balena/jellyfish-metrics","version":"1.0.131","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.131","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f8e59a1fe92eca7c2fdff80b68b7f1c43531b8df","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.131.tgz","fileCount":15,"integrity":"sha512-3SWvDIr8aFEt2aDum438LDW+9xYPp50iwyuUTWz5n4XoMsmV+dU8oTPvWbp4RdWunPUnpXgQc/sjPlMIaj40qg==","signatures":[{"sig":"MEQCICYNzulGHSLXs2Cbjziy2OGlhWhmMvm/mHOyrgNk0c9WAiBIyKK/8z+hnPVkcF8r8rfsOMuxC28lNSg0SmZTUozYCA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90466,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggmAICRA9TVsSAnZWagAA6TcP/2DOLn0P2shoPKDmL4MV\ntEWog2rm2VBLwsTcI8j9Fq4Lsa8FVr8ZqKiZTQMpeG/axv5KrCFAtY9zZhaP\nkheo/2/yw+JfTh3y4p6936hYzPpmioQox9ihQZ/Ber1Qx9at1LEfzGtx1pvJ\nfz4ZNHdexo0hLS/cNNJbxoPNMl7UT7RjclAg5t4eJ/f4Nk50hAcC6/jfVZAM\nmM7GdrEpPds9iWmOay0Wwi1mGWQwd0kEzLqt+gPD1dulRIs5ati2qD1ScmVD\nT6CpPICpZ/VLpTjWERmssTZqUh69+OKmwsPNNbJHexK55fcGHw+4EmNuK677\nJS8SYiI0Uc+FLWm2bGY8KEHkRqikbm7SKBMcYJboZbItsNkNAei265U/H36l\nrFmx9K6ZCoqh40r3SKQaF58kW9EFAyD9MrW7gyNe/SogJ8Ur3yaZ5DT1Q7Cr\nnsCGc8lj1XfMz/4SRmas63CLjR7rhulEjjCn8Sgxr6+IOThylzrhk1V+jOEg\n8TgNLdh+mB27SosIM1zxLp7nxaNwpN9MA60C7vvmpArqSeyDiGryqgwOMEF/\ncI0dl+6s2Av78EXA5C2sq7xnDDf738rNHw9pDuNZticVaNwWnfz0SfH7OTBv\n2J4Rg26Nb6AVDGsuxDm4KbE20spVDO08/lRVC7vyaw1Ih7f8MWNMU5CuMZrS\nQQkY\r\n=PHdY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d7dde164a8c20ea4ed01fb6acd4b2ab56d748c57","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.43","@balena/jellyfish-logger":"^2.1.29","@balena/jellyfish-environment":"^4.1.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.131_1619156999410_0.46125297721809644","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.132-renovate-non-major-385b8657a924c5ade1d830e2600b45420f3f186b":{"name":"@balena/jellyfish-metrics","version":"1.0.132-renovate-non-major-385b8657a924c5ade1d830e2600b45420f3f186b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.132-renovate-non-major-385b8657a924c5ade1d830e2600b45420f3f186b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6320fd5971eb49e683ee587c7415aa8f513ff61d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.132-renovate-non-major-385b8657a924c5ade1d830e2600b45420f3f186b.tgz","fileCount":15,"integrity":"sha512-rE1MtMjHimRaSfl2l9VVb+FvXM/jYPSM1KJ0MaL52fvTUb7zzBgOGmvhAzD446DmsHCAv8NAKztm8Ehz3V3LaA==","signatures":[{"sig":"MEUCIQCU/zw3Xp7ZZ7M2V42wK/4dObbQ7HXXAmPuqqPRRN8zpwIgXztFnpvHebe7tBHK4M/Yl+7qSEcNXZnqebhD9P+EfKA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90593,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggqm2CRA9TVsSAnZWagAAcaUP/1xUQGzhaDsGgqSGDpnn\ncV4N6y3zQpDq2UHeDd5kNOIQtMdZr6LFx44AxhCBrFKMTaREyzSUmB3vj+hO\ngLI4lOHxRKLtlbv252o48M3AqlKl1yQkS71X0Y7l03kQm8+zj64YVbz9rPDo\nvsuTj83u/gZe9LRA6Z/RN8CSYkDGcQqMN5x0eozdzoNlDZH/OrLY492Kmyv0\nSsVG4QRg3pxAYQab2jfmutXAlIhblaQjl2Qlh1DU6pbv3WTfEuXrJwdx/azS\nI2U4AHim1/eVZgMygh3VnsU4a2i8HiQiQ5oaaSE+ewa1krjG0+ORXfonmbK/\nofpwMPHwWrOu9LBaHSfCYQGccSuUz4AUQdSNZcIp3w3hr2Jb3trFqAKxD+7v\nwIxZRrm7pWn/RPrfIJ3e84nXURlA9qT7iFf8aQ0gQZrGXzv5vtd7kTLXLXwc\nkulp0+gLm3K8jDcljPXSyLN+5ipVmsGL6CGbvIxvxgi/V5zvFt4fpEdpslDb\nF0R9lQj8kaQtXfc0ctS94qFj05+D9R5JqzoNp1ZM3tsNCxZaX5CZ8J85FC+z\nwngeQtFDRaNJ3c5hwu5kshLOt0TOQIRSroUIDNaH9PrsAdvc6EKghexNhJPi\njv7BeJ3mPLdLVjZwVO6JzNM+1zrStlIdXvFxmqI1+aUjg0Ixps8f9f+CeurA\nq85r\r\n=fCG7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"385b8657a924c5ade1d830e2600b45420f3f186b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.44","@balena/jellyfish-logger":"^2.1.29","@balena/jellyfish-environment":"^4.1.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.132-renovate-non-major-385b8657a924c5ade1d830e2600b45420f3f186b_1619175862334_0.951446541738056","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.132":{"name":"@balena/jellyfish-metrics","version":"1.0.132","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.132","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0ad3cf5d050e18ab1959106ced553be43cf68d55","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.132.tgz","fileCount":15,"integrity":"sha512-TgtOxR6LZwy1IHy/HE3cuPrLO1X3atdLwe/9ZMN8kh5flRwmidUKeFUo53RzFKEHQBvICFKlsJ6uso8LzF0oaA==","signatures":[{"sig":"MEUCIQDtUIVv+x0c+Q3CRYUU39G2P9rvqEDjQ5IjkYUdmO9pVAIgS/RNnKRslxBht/WsA+RFvMkx04xsanROUZNy7MXei8E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90533,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggqq8CRA9TVsSAnZWagAAdAkQAKFtcfKKtKeYeYTMatFp\nrN9VZaqEyd+xescBPH0eotIvGAeukbUDA2e75tZ3IFDlaqmM7AcBibqpxSsF\nRe1RMhREgxPdBwCqZHq2j171iI+hjqBmw1fEndO+DOzo377JOWn5Wv6s5J9A\nHan6F6pDQczaT49MWF8z24BwuiqpheZCPXAQxsPT1Vo1l1mLJFLzi3C8zT21\n8QVUzi08tnXMp8SKYZnjjxKioU/MUUowZssqx24QcKf3WlBtnxxYIain1jAz\nKi9wO8U3or3NaoY7ZjEV/v9+AOVFZ+U6xS/AIHJn2cLr5vmpWpYaO7Ozg3dL\nzUZHwwAoLKsOpoCgI49ljWTi/SyOD0WsaJcHDHuue09R8I2EpwJbyr3POsxU\n50QVjHH/+FolP+T09txIMStzbwYEbJI+eecaaVkNAE9hpiuwSMJ+pT8Mw2Er\nCUYS+H9OinjhxNnLe+al7UiZFAouGV6RUw2H4F5a/1ZcUSBGKYGMfj/AcII5\nHHFFoDT7oGXEu9pcwl7pWhYRCDcCrM1t2zpg4++H9CEW3EpjLe2KH1AicHx2\nyxfEB+u89L/N9PM0s4y8Zz0XWjJ4dY0iMqwiqmhsaOvAGPfn7AK2g2dijb8k\n8qgIU82cVpTq+KQazNcSerQcxk5D/mBfDAZ+YKdrkbo4FJT3nIefSAI9KCtk\nUJa+\r\n=NKnR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"1fbb4b1c6102028c4b870ff27917c816931a3c02","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.44","@balena/jellyfish-logger":"^2.1.29","@balena/jellyfish-environment":"^4.1.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.132_1619176124148_0.7612009445659165","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.133-renovate-non-major-2c1b6bcade1b942d76ef0bfa998719301bbc9b9c":{"name":"@balena/jellyfish-metrics","version":"1.0.133-renovate-non-major-2c1b6bcade1b942d76ef0bfa998719301bbc9b9c","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.133-renovate-non-major-2c1b6bcade1b942d76ef0bfa998719301bbc9b9c","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1a4e06ae6ebd7c970980c14996710ba28943b661","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.133-renovate-non-major-2c1b6bcade1b942d76ef0bfa998719301bbc9b9c.tgz","fileCount":15,"integrity":"sha512-4fYzN1lHYm0M+14dQIe/0tAP3yYj0Hui65pcwUdIHH0N7kOKbzwnkYpEjYq/Mpgsxf6t3riHaBUZHxtZnTXTxA==","signatures":[{"sig":"MEQCICFVuwFv7GI/9GAqwZ9xFWu2xoENiI/Ayy2MUAVejUJrAiAdt+kBP7uSQilhK7Dn0m4YWYzQJFUbcFV3AbPWJMJPig==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90660,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggupSCRA9TVsSAnZWagAAFhMP/RkVb5ND5C99RjE/wS47\nwr0MGlteV5tQ5ENArl3v6xbS5Dt3QpFcsaFyCretAKm6C0V3xUwTL62Qdxq2\n0dQ4bX7G1glADdJZGx93cD/p5Rn6cvSwq3WF4VHLPAemqO9biGPv3MUzG8qM\noDoS8VS8VuJJaoyW1gqOapZhDSR/djzk/zoRlYbEAcKfpW/dPeCNA2H9DKFq\n5wEYSxrWFlnZ7MiQX3VYqMDcOh2lVXg0YiBO60aA1CMBp5nco5n50H/vIxpL\npBXiU9xECgaLCVR/quRqLyfRbhPvvRrEm4SGpnRXYsBop3tBH6unN/+90GW3\nzOgx1jyBDXxwyXzLE/HgwrnfxUgF8X1HrdJXwa1C94ueTylalzdjGmW9cGC+\n/P0OEbH9YnsrBcUrfWad5PczqRS0C+z3xnJSkKj0q7OSP3N/DS12hMnY7FX9\ndXampb0AYZlJOTHrIm7pHYa+g7wtsCO83n1TJFZievAAAaBSPwFhPchqen70\n1iIv2+6w/cMo0WtVsNQhzWIRygzewL3mAG8A9aYzkioFIe9hI5Q9bgoFSO4R\nxP3VYT/6Ap5gQNw/ky4dTn9kSB5y0V7n8AynzK0zdkUGgDk0DhH3upVHtvZ4\nE8fB6tKtMFXVo6Q9KXoSnPew48wlehPX0iKL/rI9HUqE0/3791q8m5Jb6TOA\n3vVo\r\n=8F3z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2c1b6bcade1b942d76ef0bfa998719301bbc9b9c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.45","@balena/jellyfish-logger":"^2.1.31","@balena/jellyfish-environment":"^4.1.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.133-renovate-non-major-2c1b6bcade1b942d76ef0bfa998719301bbc9b9c_1619192401881_0.33506991492075455","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.133":{"name":"@balena/jellyfish-metrics","version":"1.0.133","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.133","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c84ba0dee9b00ff497f6e1dde7e9e1e75c206db6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.133.tgz","fileCount":15,"integrity":"sha512-1b91CcdFDmrqVz2c8BQBKv8pvjgFqbA987mnSTHYkQH0jx2Zmk4U4ODAgBKCqL3WFelCEngZeJLGzZc/tDgGFw==","signatures":[{"sig":"MEUCIAcXX6mgXoUt0OE59nyiDgioyp2lVDyUjbtQP1wXcCvdAiEAjfQrRtj0rVDEeK06TIAKq7hlvDR2hK9hwETytkbFbow=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90600,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggutVCRA9TVsSAnZWagAAosQP/1rKGbVnc2o4uL5exY3H\no8pl1+w9SYiI3+EMu7Ez82Vjcio1cRFZnT6gTwWRGBekPnCsXRn0n31Bz1+H\nG0S9AF4kGYWMzKXGxAKH3id/H9lZITt34G/hU2zmpPibheLQvHGZIpfC1Kwi\n8M35hyNxvZi+/1JETkY5U+DUrFM/zv7XrvUKuypPyi1ZeJt4l8EM3jQvTqD9\n+O8iua2l+rTjyPH04/DkGxVefkWBU4sqHGL3fAPAwcXpvNzbK2PeWWEistv1\nmtnLa5wPXzSiY02QBV5OM1TEwHgZn+GwKjjPfz2mq1Cpy984510TcE9NWX6N\noeFsaQAcpsJ3sSyIjAlsmYgVkblsvWzaTitUypJJBzmXRSeK868JxqEHHPzb\nbJUD2YKvOl8BnHzdEktlEhV/g3mtj2tY21uOWUq+6Z7QBzB4AdGHHOXHLo4E\nWJvAV0ZWWVWZeciklHPJrhI1wJPERhwGKK4bA4uVOyMomqmxBdt7iuij0olL\nlhRAowDe1WvRIX0qZYNJ6UuLKZWfDW8yi6gxbQhkbVPIeorUft3A5p7xJoQu\nHonSPj8Laeu9iRVgSTF48gU7urGxvx7tACmOjMozVPqbabAg6gP7oNPB90Ss\nVOghMEX07C8cv1nPFLmbMLJ/BzuA62lP+ne4gTeO2u0gYW6BaloQpfo7w50w\nDwxW\r\n=ZO8t\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"773f975a3418bd490d065e25c0e21351fc95f179","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.45","@balena/jellyfish-logger":"^2.1.31","@balena/jellyfish-environment":"^4.1.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.133_1619192661049_0.002424308561015609","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.134-renovate-non-major-02f8e32e6df51ec4cb19c3908f4dbb2e0a15e708":{"name":"@balena/jellyfish-metrics","version":"1.0.134-renovate-non-major-02f8e32e6df51ec4cb19c3908f4dbb2e0a15e708","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.134-renovate-non-major-02f8e32e6df51ec4cb19c3908f4dbb2e0a15e708","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8e1d6ed1d7dc9f3252619dcf142f9cb7ccdfebef","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.134-renovate-non-major-02f8e32e6df51ec4cb19c3908f4dbb2e0a15e708.tgz","fileCount":15,"integrity":"sha512-dY0245UNXdGUIM0i57Z4DnNifAnvPYmVSnbc0p3WmI1ZrQuHH5vFmOMtYXerS3KrcjTDO8bsfflGaHpIwQqiag==","signatures":[{"sig":"MEUCIQCwK2zXtxBaUdpswWMUB6xAiDs7mfkXbcdpMSpJRDT78wIgXrLmwywSjdiGsjajaXxTQNMtbCn4wpemkqnZrT2bTF0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggw0zCRA9TVsSAnZWagAAiJ4P/jQE9+GgO9HcP2EupwVS\nvhCjfAXFWnTXHk0reQ27eqyPiNRjpXFGAMgUW8oFMMaRlck3eMVS8mT1N3Tf\n2HNEkjQPeRKKhPwA47DCFf31nOwq7DQWWLifwvJ7lFERbJF4HtTQ8wdgJSv0\nqPxfnwk0l69rGjf6zZSFFAQhsSLqAwUyBKm4C2kWI3mlyBMhSsZ+lyC/63am\nLBlI9/7lEJAd/vT7MWwJUTUG/n9zrURkTZjetT+t9nRYvmH8V0arUzMU+eXo\nWDRBmk0SBqT/9pE6mDTQLitYXhOeZg0Kdb4RWMkLmLWheohRZCzg66jng355\n+G3cUthuKMUAV4Umb9RyFULO5832UxwJFhYi2PC46K1zGj8kFEtHYlnCprHp\n/ANx782JDHPat/4rcayuzytqnHWHHdlg/l6DRbQZU+Fze8DR0u3aYu/V+Fl6\n1inCPFkdXiS4Tj8GVzZVC1jH+2Jc+Aj66W5fvffJlwQcfmu/NYFTWIzsYMEj\nMEWRG5z6VSe9iSvRp6RMx/t2rYAeJAsXfzWGzSO5dMa9lI6aynlupM49ipvJ\n6W5T11VQ45zzROXa9tUPHiUXxFDSDF0JnRKAF6Qio5wkkxmQomZVDOSPj/G9\nY6MXH/YYT3FK2pC7tah1Zm5T3mpSJsG8J6E5YeS71h/LsDhJCrW/P4Sgzc61\n4mlK\r\n=vpgX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"02f8e32e6df51ec4cb19c3908f4dbb2e0a15e708","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.46","@balena/jellyfish-logger":"^2.1.31","@balena/jellyfish-environment":"^4.1.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.134-renovate-non-major-02f8e32e6df51ec4cb19c3908f4dbb2e0a15e708_1619201331297_0.861981465932874","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.134":{"name":"@balena/jellyfish-metrics","version":"1.0.134","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.134","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e52507a30e2ba2e36ad9543e202d86c662e29f9c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.134.tgz","fileCount":15,"integrity":"sha512-5dXeOAOaz0O9Y4zqV0itAf/czE44yFU/8lWYbLx8KiM08wx4mnQVuFW8KxEhPaqGHa6tgPqoOb8OAFV34D6/8Q==","signatures":[{"sig":"MEYCIQCBQ3DGsSSLZBZ0uPOhiGtA/EAFdpB4eSyR76Mu/B6pKwIhAJQ8x45VTS2yshr/KmWn8uG8AvSr/jqkwByN+PawDH2V","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90703,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggw4KCRA9TVsSAnZWagAAnNUP/3TXRM7kEh6RCzpnIiVb\ngcBKOJZgtZw2mKNz+Ao8hy7a2Mgs6dw+y0pPsr3G3gC8ynWd13Mx4Vsklaj5\nTtC6m1iiPTql3cjNZ3FUo6DvKBdQlcefzZI6WR5p78GES+ZZGxy+q1Uw3ISN\nPMQxktH9ibzXZiXDNp2m4Pz+jLdr7wUNTgrod9wWHD5UDiw0PK1FqWMXvoj6\nBQYy3kzpkyT3+Q/MOQDpdjBmE58moeW4ghpPBHJ3C54RnoXwXTpBg7yT2NFZ\nM4xcw+0DTfhRSLndNZzi+F7i9Kq2Uhic1rJxMvolkHa5b9SKU9O634KEOvDg\nhZpqMXXFbbd8U5j21+K7x6CPPZZq7FLGBAv7xvOgTyEGLtaYI0E/Oq3YNj/3\n1j6wEWURUMucn9orlZDABRw4rqlAjmJypHRB4XAatIwSdi0posLVMpHgVowj\n69aSHQhRZzcE3Ce6CwU2/qZyA6gxVzmhP9gxtfJpDmTTqI7MU43rYD6Qtxdv\nI+42fwYE0wkqUCg80LXAUBw7jE/GO3VU3orQbD3oDf9llQvesGfzRxOJaAcr\n7IiUkWvTYL48nG2MPsCiz3As6qdRkdCjqLFh7r8qeFDGVdM98xgl5DNEBVCh\n4ckUt0YLdUjSUoXtp9QtS4BuLnoZzOP3RO9mCtWOB1SIrSS45a+2wgTqxSlR\nU5D0\r\n=O7Db\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b2ceedf1933807b72ef7e864c90e04816a826546","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.46","@balena/jellyfish-logger":"^2.1.31","@balena/jellyfish-environment":"^4.1.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.134_1619201546112_0.7846259419427393","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.135-renovate-non-major-d7a9b13ad65b8b9396aa8e13479d2e5398ceab22":{"name":"@balena/jellyfish-metrics","version":"1.0.135-renovate-non-major-d7a9b13ad65b8b9396aa8e13479d2e5398ceab22","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.135-renovate-non-major-d7a9b13ad65b8b9396aa8e13479d2e5398ceab22","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"514183ccca1094dba7872392476d93580b69db2e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.135-renovate-non-major-d7a9b13ad65b8b9396aa8e13479d2e5398ceab22.tgz","fileCount":15,"integrity":"sha512-VaH9zo3bQkBIueqZlv2URfqOO4+Y+HI1zLcFBewYHjRHktzFSeD40wcikb2YMon2skG6YbNKF81yuKf0+2FfWg==","signatures":[{"sig":"MEUCIBeLB8KCedbmxi1Yj4rFXTe5TGqkA28+W4jP2CJb1GCmAiEAyuo5NFPeU0fQuzLHTnXdMTitSCxGBuXszYYiHbIvw8A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90866,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgg26jCRA9TVsSAnZWagAAK7wP/3qXivbafyphekHH6Dii\n+ToQCk/FEJD6KH+fkG2xmtm6wIuNG2OZxfVfNbv+LxRdmEJc1xF0DOUJ27cb\n9Y+UWOUh8Ud4Yiv+2fjP0itNQIwCk+gYHDTXEG8XkF5lWPExCe6xGPQKNlEa\nOtN6JQJiWe2c/Y8Y9+TyKKJOLkfclwRXxr22PtaDoB+adgELe1sK55ULDUCo\nWmgsZepnnQYEdEJKEezJuYKKTxvBkFmAbIU8+K2mgOCJsgiOqXmRiZ2LlfNb\nkgGZIdYLTMtk+ggSAr6BrUO8A2JqkKQxdfMI7dAm5yPdIv1XKoiuwYjjyRmu\nzdjjBDH82MwfkMmiGwKY/WnhneRNZyQcDRKEB2vinc/c+XoIMwBTEdA8nMAQ\nkYaejQlB5AEk2EmVF8Uaps5yfcYnl5G+6GPjmvgCQpS9PcpsIWQfsWbJMbpZ\nZzNGWLDbg4vt4GgXuALCqlu23zhSxGpQ+a8XL/evOuHK6sNiYo8OPonKtPKi\n2qZhyPB2jQxqCgEMokWZ4o5cDqzGB9AsEs9+JrlbDF/zv4ugXYqC9R2+1cC0\ndyXy8me0rcNPSV73HnqfhL20qhiY+yhJzUlDXCuAoggGUdm3LNiGTNwycqPy\nSczO/l1Ujb5iuUoxMbGVT/z6Znvxt9qpstB3+v1a/K3kkai91PnCY1jMV5dk\nD107\r\n=J431\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d7a9b13ad65b8b9396aa8e13479d2e5398ceab22","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.47","@balena/jellyfish-logger":"^2.1.31","@balena/jellyfish-environment":"^4.1.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.135-renovate-non-major-d7a9b13ad65b8b9396aa8e13479d2e5398ceab22_1619226274453_0.5415438957936598","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.135":{"name":"@balena/jellyfish-metrics","version":"1.0.135","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.135","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1e60bdfb09aca92d0c788264c0acde83699f4239","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.135.tgz","fileCount":15,"integrity":"sha512-VzAtKN0+gR6x5bpWj4RmPSsQc7zrMe71/KP6MV96DkS0wPNuFKrMDSiEYsyASyRpnkQa45o8kiX5EiaU+2hSpw==","signatures":[{"sig":"MEUCIQC6+Zn29dracgqrI5AjOq3HkA3U5hJZubCz3B1xNUvTlgIgIdFKU+OFhQaOgOZeuBcGp5Hdc0PwHdY3EWD5+nXqg0U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90806,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgg2+iCRA9TVsSAnZWagAAgn8QAIYT8qVlEE97JTUchs4P\nmrQNCl3bzrKla1AgPvlvkrZCotWH8IBJl3n44HUNRp04DVRyHDbgACY4GLhr\ngJ2xqIxmcRZKK6/qU3FEwV4EldTpvhiy72uhZOr2iW4VtrW3ex11hErUSO3k\n/57hK0Plz+5K1DocKmlwMRH03Q1uoaf5byKISIHqDcUc0XO823wAJ90wowrJ\nDr5jUgl/eiqtX+07Ya0c13iF9yjfMV5MCE57SyfHYefZwALhwT08lZUoPsba\n+quO/SODQ/+L7Vv1Hx9GuxH4pEddkUzz/XdAje1DnrO5p4lscJ91SP8qmS4/\n8hWaNcDUiSfy2pPNwT5y/vRbV24QWkPM2/ZnFYE7HOcwB9BT9+aD+GFXWDAI\nebtSR3wIyrArNTTlmdc/ljHut2+FJRhioO6ERcTd+0pKfqN0mzb7nwhXi8r1\n62PAjE+hR5BWO/liT/XoubHlD+HjHQyr4kQ9uS8GoiU9tCBvg/JMsbDEXYZ4\nGyx9okOGZtsqlLXsk20BWwE0k0Q/N4i5Q9DraBhYpo/QGSJy5+u3DPWDgerj\ndi3gg+xS3ZmESreCzlXExzkspIe5PDxCUQumzLspkcKrflaBmMn0NNTC3H8b\nz46TT3dLeT+MusY8Fu96uRNHQiZIWNUDJD97pYrwc9hyDjdKWkXY7KXFL187\nzFUi\r\n=qa3t\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"32c35ebfa1d35173814f673ddc8be10c15598e31","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.47","@balena/jellyfish-logger":"^2.1.31","@balena/jellyfish-environment":"^4.1.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.135_1619226529866_0.2748210746825541","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.136-renovate-non-major-b65a4bb4c9fa8591bd3c70320541d2af89c34a3c":{"name":"@balena/jellyfish-metrics","version":"1.0.136-renovate-non-major-b65a4bb4c9fa8591bd3c70320541d2af89c34a3c","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.136-renovate-non-major-b65a4bb4c9fa8591bd3c70320541d2af89c34a3c","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"108f88941b354e22f8a292ca620ef89f58905a7d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.136-renovate-non-major-b65a4bb4c9fa8591bd3c70320541d2af89c34a3c.tgz","fileCount":15,"integrity":"sha512-oZc3N7I6qa5UPHcV/92iFZvV4Eu2mE+p+/CMXEYBPOojagFOUIdpKV/6g5/OFN0Ic2GsnZDf2kLmDI6D8KDYpw==","signatures":[{"sig":"MEUCIQCuhfqYBPDQG7KrzbbqJRNFA20fuVUgrByZVZ28RnkEkQIgMZMqzOhnqC11yJB9dq3AFQ0TSYZKnREfvTJ3EGUaXPY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90969,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgg6AoCRA9TVsSAnZWagAACBsP/3WZHPubS3xRZIvatsyp\ni6Y1VeAafU8yW4Hx5YzyLQ452byAcD9ulghTg+91a//NfdkYqyZhvPdKlYub\nbObNturLY8qF0e3jKq6iq27Pj8qPfCBCna72khKk70VcdkwI8+2BraaCSGsi\nlf79oCDdJvsom5Nb21u91hE1RVTpMAdG1G4atCtK/ZGgux/PY9jLotHLInet\nUOfC0+HWwPb8OLIrzZQtv7bm6T/MJAH6YvtiN/lqdQBJ3Kt6FHYijoQyqEy8\n36ZCNSrC9Ie2SJb1h2JZgkJos7KjzW9Lpb2ATFGq+9KNeRIIg2uHK8Dx/C2V\noB74+S77Ns3JN+LNqtpz8ycnskE7czAhc07zYOjBQgqHW8uhG5zqxbc1cdHK\nqvuR6BbNApQQUngq+ZGcp3MVWYXL2WOOCFTOwaRYJg9JmMp9Ncj/F1+a0qUF\nNamjfmuyHhtOL2tih3Cc6DIO3mySsaNdK6hCLcLYmLNrR5KPuKrazx1cUDs+\nbN5On5RfRORoV4snsWRzXZrQ8/D1gVFxYpMOuqOkahOhr9pngJStyrUpIWV2\nM3+992dU7H1Y/WUfHwlH/rI3iL1sxkUTLJ9frIuVMVTrL5/Ddz32ykIlZoFm\nHffe5tT7hsJJC31Od1p+W3I2xxjPmpZARg/564EbosBkFr7kBefiV+rm2IIv\ndDLd\r\n=wl1U\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b65a4bb4c9fa8591bd3c70320541d2af89c34a3c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.48","@balena/jellyfish-logger":"^2.1.31","@balena/jellyfish-environment":"^4.1.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.136-renovate-non-major-b65a4bb4c9fa8591bd3c70320541d2af89c34a3c_1619238951655_0.998370285478132","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.136":{"name":"@balena/jellyfish-metrics","version":"1.0.136","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.136","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3953711e28ddd5cb629da1c48d1fecc653b97516","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.136.tgz","fileCount":15,"integrity":"sha512-eW371fny1/23wA8Hua56PvDGqD/27uBLRcDLMpZV7kEy7Z/yy9im/PElf/ZmPgxvvDxy/UxkHTLOkRW4x93bBw==","signatures":[{"sig":"MEUCIDRYkFzFla+qfsDcA9/Ju4GzhF6D+lD91UlhjdKGZ8o2AiEAlOMYu5YSQKUNcu5W6bgkS5Eg3PJGvIl4GnsWME8HKCw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90909,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgg6I6CRA9TVsSAnZWagAApV4P/AnIA7Il1kBCWHJ1c46O\nc1GdeJCqvxTb1iXh5SYLgxvzClHbGyTANc9/nfc7JrOi4JSSlmP+xvSdQko2\nXdpfNeww9p8mK5GQ0GL7Jj1XkVh0xXWOKPFcHYVQC7VNDQTjLsobZj2e7C6Y\nGxWqrMJ66hyiYRxT+tXtM2ZdQ+3TEdRNpGuJ4bCKe6IHaKCKUYZqdv2/2FXL\ncoIxJ/BkVqSbUJflwpRMf7gxNGWQnkWSufTqu//O1mEIV+5izMMoLyBYeUOq\ntKZuQ9hY2VZ67qAHzFa1Q/SQxxwzub1iExxsg6EaE+cEROT7D3MHNfNVje/T\nuY/JFklb0rIJWlBMW9qEh0Q7KQF6ssf7Js+Zufo4wdncXSmRP09XCk69Nwry\n1tePcFS/mgeyCSdapaaaa81AddXoqEMGcxeBmkNQMxPAJnoIPpr+xOXBAdcc\nlShFDLJUjR6QHFzAwscEqIrE5+a8dUbrnq40/+tFzfc7VO8/1eyI3s6foqOM\nTFo3x8lGsOZe1uRajAznXkHIKjKgyNt8Oq/o9A2coafzd23I6FTOcprSnbcQ\nlZUApRLp/qHnoPGdiWRPH2fceCNiU8V9lnVADumhIGmetzg4b8IArxCmud1b\naQpuXuz8ksmgqE6AAg/yh9oivlzmU32/jxdqpNdQZTpUAz7GEHQKpDzNT/Q1\nntB2\r\n=8nZB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2f91910648eae4055ef7bd43e0f0b80fb4530b52","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.48","@balena/jellyfish-logger":"^2.1.31","@balena/jellyfish-environment":"^4.1.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.3.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.136_1619239481674_0.2022133468569669","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.137-renovate-non-major-4ec7e4c5d446f6cb479767629ff05aba945e8cea":{"name":"@balena/jellyfish-metrics","version":"1.0.137-renovate-non-major-4ec7e4c5d446f6cb479767629ff05aba945e8cea","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.137-renovate-non-major-4ec7e4c5d446f6cb479767629ff05aba945e8cea","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0ee5d378ddf0e565d3e50097cfdb3c3bb5b4584e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.137-renovate-non-major-4ec7e4c5d446f6cb479767629ff05aba945e8cea.tgz","fileCount":15,"integrity":"sha512-naBcgl0fbgaqhi0XFeVj72opgDj3ZkpJHQLyCkGgdc4fk519cSfu3F449jhDm24DblElfzaXLclh2N1fiUAX2w==","signatures":[{"sig":"MEUCIQD3YrGV3HXso+ngf2TNCyAgHCVy6qupUYKf5MtlKnjVLQIgb4LrEU0tw4bhHLtdvKJ1911ULHHaNvoNyekAzDiA0sI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91036,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJghAJTCRA9TVsSAnZWagAAsOUP/jouP1V5p/rjA5Gb70RP\ny8ml8ZxQc5UVLJo+u5q36qAoxGG8YpAGpsSiK8U5SB6jK00Hh8fqEbg1SsvW\no2+PrA6xTiTvpUww4j5XFryS7VjVmtXtH9gm1X1g2VlLtzMNjgWf4pJFdQp1\nlukCxn4Bnr1rtORrtql3CeVnWkps5X4i/AcY3ExO9+3MQVF2bVfEWsld13gi\nKU2xgFJidPz4+yEjgtLXi9ZdIOwiIyPar2Db8qXIppznSOpkIann4bRqZDeM\nMzR75g09GB4DEPvXdcnoheq1PH0mhkgDGIQu/cFSaeYvzyjrY2M1nM8DadRe\nLukp/ldbJ18Xb+k61/aVxgalPVgAPt5/Wmsn1r1QHRApKVM547/W1Tj+WYLI\n8qObkI5CiR1FksC+F1Vd9/lbXk+6WR8L0Ov8LxBkQcmqdMt9oiUbdYkppaOF\nsjcInmPQrIh5V/XXUoPgWw2mbnwQI7Eb7AMEVgt55J4FbGLpQnyCiWMOVqUO\nk991fclsA9x2yLPsmNF+tJxtYXaosDQVhFcxCvol+JKppa+I/G3EmkX8tBxn\nc0v4AU9jRH+KprzXrKs2scjqsCziHTnGy/6E4JpFKvHR1m+zs0sVmWsHpY8b\nGlzDRyALj21JtWsEQSI9UFp+bAUM2gKlekaCKD16PufYwCjgRfBA7eAH5cWU\nxCYH\r\n=Nzs+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4ec7e4c5d446f6cb479767629ff05aba945e8cea","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.49","@balena/jellyfish-logger":"^2.1.31","@balena/jellyfish-environment":"^4.1.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.137-renovate-non-major-4ec7e4c5d446f6cb479767629ff05aba945e8cea_1619264082662_0.08823769569247131","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.137":{"name":"@balena/jellyfish-metrics","version":"1.0.137","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.137","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"59c59cd07e9c7e881f6f69322a0edcf046475814","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.137.tgz","fileCount":15,"integrity":"sha512-fDLxZrtdYRQl+drXB91m29OGIQ7PKz+eWmAzorDjvm1XaAugXbJF8cPtOHBE6l41OfBbci1w3gjZjXDU5+gjYQ==","signatures":[{"sig":"MEQCIGOQx70EZNUg4O9WF2H+DWkkKk32HCxqLo8W0034q2xzAiAHTg63J5VY12c6qUiDBUvq1oxGLLu5A9WhGUJ+dZnbBA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90976,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJghAMpCRA9TVsSAnZWagAABCEP+gPzVeJR0QPV7aIoFvT5\nVpAbA09KsU8M+OvZHGH4y8r5tfY9kkc/g8XNVFChGSffcm8/XLI3TjgIr8JL\nocPxm9QtydJPlTZgJW5KmYRCxRMvZ7jUZjCI3Wd6Y6y/lmgaYrYBMHHN+WN6\nBaseGnZ75Ok7jfD+Y0NgSyP3fv30rpyx0/3uYoqLHdqVpgImlGT5KXABoaFa\nuG0y+IWZklLlIo918JJB8efiux2LnKpZaodhCTWxVH+7vN2ezYqGABJ9Qfio\nxjJ1m60+z4FtfvJ/i5XBh0fGr0LtZky992RRZl7t0xaQm54XGe33zpy2LC7i\nIrQkjhZ4Lu8BaZS34PYpBduEy4XzEK9hU4BQ/MccBnMLq+JZ0nUkAGkRa9Zm\nuYXTSOrArJ/lGX4Jgw/u8CPq+nmCYM4ERrVGM5jsSEYZRv36WIShH5sJP9wO\n6tSCMjELwvnyUq/+jIUlo1t94ryKZWxOWRaeLk5EYfpH+3hL8+ZndWyKZ0CC\nrga+VTam3AMHQiNU+qo/9LUPmbzyh1syISsH+DnH8NR9PKw1m2BPT6K7GOtY\najKrKfvNmCN8qxQAUxPoBxH4Zm7Cvb2tW2B//QEB9gTOln7upgH4czPxAMpc\n+rhoJjLDlGy21YAVJDmJnXchkFVl9MQ5N3RFC96qj8NxZBcWImXTEaauWh/A\naD2a\r\n=Jvqr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"206c3fe9151b861a5fe512815a6924453ec5c2bd","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.49","@balena/jellyfish-logger":"^2.1.31","@balena/jellyfish-environment":"^4.1.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.137_1619264297195_0.6016883796096424","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.138-renovate-non-major-c2c7020b3d66239a67b4e5111bd56b56bccd248d":{"name":"@balena/jellyfish-metrics","version":"1.0.138-renovate-non-major-c2c7020b3d66239a67b4e5111bd56b56bccd248d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.138-renovate-non-major-c2c7020b3d66239a67b4e5111bd56b56bccd248d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"153dd85e4e618dc25f9c3746eed6f13acad2a338","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.138-renovate-non-major-c2c7020b3d66239a67b4e5111bd56b56bccd248d.tgz","fileCount":15,"integrity":"sha512-QCR+kFjOqukJGQI/XVPP6jESs+zLyBXhUMWU1Pu68/+PNsqu39JRwe/CZjjCGvNtk4VAz2SMFcPK2vg2AQzAeQ==","signatures":[{"sig":"MEYCIQCxYCZgKNlgjGM4ZrvEuJ2VmIxyN1I311UJiRN+k6oEBAIhAOPmWaYTOJ30TDP2rLLlGryZ+YkPlFqXKkyIvJ1RMgha","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91103,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJghD2qCRA9TVsSAnZWagAAoucP/RpwmqWYb79xLeFhwFpX\nCjyxVQcljmvsPalQMQXsalDmV93xiYCQo3qCbKHvRzX9ZIvFj7VAWiQdTSRx\nK367KdcdPPNsRnOBgOiya3RJ0A3ZkWofi0ylkthd8Th7tVu6LkN3Pmsi5fYL\n03ahk+j6WiC+AJtlZf2ZWkrzL+ODWdj1YH+WPw1X2GhyG4qPOlrcpJpaSBHU\neAasG9Upiid2EiuKxRpLbR/vKlzrD7wMh2PahREgHa3uNBhWok7gdF7fvzdZ\n0f3HkmGkhA9oJ8lmK4LQku2zp/Gxk3x/bjsJpYwYqPm30dt+Ebo5gOweifOH\nukrY0cirRWFHXSH+WruYt6/yWICh7twP2JqX+m3jGgJibcT3t7fGNCBNJvgH\n3Re7juwRDIKG7nAZ2+5PsHXvpOkZwWkBDNiRH+qq8ZLXLdAQSlWhbNXaIgZa\n5O2HOTO4Dc8VC5FxDRiCGdDZ/E1nz4reVGsmVNu8J1aAm7i1KlL6foVSDfoM\nsPlOrW0SGwepiHf/l8OfKT4SVDdfVC6gy8YnZhXB+r4Axc3jagEh6+iXwbeC\ncIeHNv0Ntok+TZCEAxarYdDhHaFn1lVQtDN4tq9HIsl+rOf7Vlw4tKb+Wlgi\nbpLp9H8wifEYLhZsKu9J+S7M1CMWCVA7gPwcznw8h3R86Iy9S1BbqPbFQv8Z\nzM3Y\r\n=y1Uj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c2c7020b3d66239a67b4e5111bd56b56bccd248d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.50","@balena/jellyfish-logger":"^2.1.33","@balena/jellyfish-environment":"^4.1.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.138-renovate-non-major-c2c7020b3d66239a67b4e5111bd56b56bccd248d_1619279274339_0.3597608115374329","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.138":{"name":"@balena/jellyfish-metrics","version":"1.0.138","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.138","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"252ca198b1f91678c3458624dbd8503b96b9e71e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.138.tgz","fileCount":15,"integrity":"sha512-aBSYmbZb3Z7L5uFnF22IGcYwUpiuqq8+7RImGXmMwFzSRx7tGZ2+9koBI60oSYwyNjFFuS90qwdAeMp04AZcfw==","signatures":[{"sig":"MEUCIAfWumXjVOLZGMyAkDm2w83z0W4Sq4WppQAdXp1T5wxKAiEAr+3iVM7vYT4eFEvixTKpiA0IiOVaneNnsNkN/cbt/bI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91043,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJghD58CRA9TVsSAnZWagAA+lAP/ikFkK+WOd9uP5dFUOnE\nemv/pHy2p/69ap5PTfxKsuqZpdJCw2UKkZHPxhUyqn3Ic9XEuhKLLtYuGM1r\nA3R/8u0lfntbj1setDYetnSK+yyf3Wa+opQpxJOX5bLiSlNmiSCwSv4+6H3V\nzEpiuZap6v1Q3djkFXHG1q88h81HisVVQ/rYymzXvjfmlbp0aEkwNqiQoNSD\ntqvJMjw1s47O4Q76LYVic6Duejy7soAaT7d9T38Je/wEDuylzJptD+TMGgap\n1knZG9y/cud2nNSza3sFv3V79cjb1Axav3yAqo/wRh9FqQHdqUeTdz9zOz8d\nqbcthgTnSs9dwRgTOO5nELmKd/pRCD0CT1KSSAl17V9eopiGyDbV91ATkYi5\n092uDNPO9ptOsyHw5TBgfg/A1UN8eIshtConBamCLYPLn+jXCneXy0ZnlxR1\nhmHvnHITcRLX6KHHVI7UvtgZ3VAH7KeMNJmZeHQI3+T9eeHqS5+GC4Utt50C\ntrmFw8BB/LZSuyV6wUh+YMtQiOAmjXIA9oJE+Y3hjtlaLOeAr58nNLe9+Ipl\nnFv6fy/sZgx7gIhd1bkuZtzyOtkO8T5krnZouYXBCZU5tl11djfg2QzzOCyA\naf4plepUH+D9j1mEesuWUj3VYGfuQExBt+6u+KyaVzJbvMspKK5gBOMUiWyW\n2Y3A\r\n=PhOp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b7befd5c1ae2a77a3f5fa032b9c048cdfb5817f0","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.50","@balena/jellyfish-logger":"^2.1.33","@balena/jellyfish-environment":"^4.1.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.138_1619279483674_0.2958119711603131","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.139-renovate-non-major-c7f2ade8a679a40f1f7715029f251933b03bdd9d":{"name":"@balena/jellyfish-metrics","version":"1.0.139-renovate-non-major-c7f2ade8a679a40f1f7715029f251933b03bdd9d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.139-renovate-non-major-c7f2ade8a679a40f1f7715029f251933b03bdd9d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"dc7fe35fcf364fd78ff8c78247be5020c17ce82d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.139-renovate-non-major-c7f2ade8a679a40f1f7715029f251933b03bdd9d.tgz","fileCount":15,"integrity":"sha512-5feZ0N93OeIDZTttK3N5wjtOL3czaRCPwAkACJQYWuEgq3EsR4r+kmw0hirhpCKYC8ve7IO3ZBv28pkGrkxNqg==","signatures":[{"sig":"MEUCIQD1qRcgNNCgltjKuuIB1ww/5VA5Q3TVHF/7SQiT6lgkVwIgL3yEM6HheUAJUaEFFH0alADnpTf8uen/ng7FK/R4bu4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91170,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJghH14CRA9TVsSAnZWagAAaugP/A7BiMkSMchC7gOcsWmP\nnPMScOgSBjiChDGzPyK5BKhQ9SsLMpiCEyQ/rXSjJ1VzXWkhvGMLoOWZsw1i\nQYzs7E0WR5XEcV0v0CRaRocZCZLfCSdFYHCvjJ1+IEMJYMd7h6q1xHQ2xVdZ\n7a0OYSecYW+G5+zkVglIp3EhVUAPVF5twhwksuZKVfpb43dCVqS7I2glRrDH\n6hR1t81zcywXo0e4qprAqUsVmUzj1zd58MNJdsg7Cn9N/cJee7wHEIqwbomU\njNPuXtJbtHyhKbmzYRsI8Wz/04UvphMgXvYJsgUqbxteEmbPUe9F013NTBKh\nQ0+Q2DJx0nsTMrs1IoNYGFRxZsdn0YcWQWmatYqsQu34AeynwynzqUNPt8mL\nm21qyPur1ZvcKdfjXdUcp1rLcLIl/8EqeZzRgYQfnyTVnzvnsMocT9SpJfVk\nVtXB34/sBFENBhk1TIWQIu1yjfXk0S0Spn5SZ7AZGdE09VgHDI1X1Nc+HEwx\nHWTGfAGQf67vvxGU9vfho/yXwit6YPD3evxTc7FS56GbpRqD1ISBsuvSY171\nTnV6ahazJ5bmZLEJH5cedP4hu7nxrKkGCb2x43iSibx9BGLIlaUIt3LtNrY8\nuUh3AEjREG27c5PDhDFi7Tg81V3q1AmFrutYfFLNzMtKyIsXWe5B744FRWc1\nJuk0\r\n=NbTQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c7f2ade8a679a40f1f7715029f251933b03bdd9d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.51","@balena/jellyfish-logger":"^2.1.34","@balena/jellyfish-environment":"^4.1.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.139-renovate-non-major-c7f2ade8a679a40f1f7715029f251933b03bdd9d_1619295607481_0.08431525264985185","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.139":{"name":"@balena/jellyfish-metrics","version":"1.0.139","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.139","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"69795c18ad1e613ebaf1804fa6d95cc4b5a579a3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.139.tgz","fileCount":15,"integrity":"sha512-CtNZ10WuKcNYgaDHyN3n8bYNWShCHT8E+9zu2TAI6MyQzkDGjpmnwfjUrRBiLV6mMQlT+ufrDhym5Uf0iqZQAA==","signatures":[{"sig":"MEUCIQDkryiHUCKwoSpHljQg7n9gqNOtiGmB+O6CEYKdfbG6CAIgJl0Nnd8zBWh+z6CqiRV0kjCfNbYh6LlvvxQ6WC+0LfI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91110,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJghH5eCRA9TVsSAnZWagAAibwP/iAcXkQKM0qlH8Lg4Fvo\nHv5Uw4dR5wLKF65gTTpdXukY4J7oSsTYo6uIVmigARln9StBWT7fzfbQfFMX\nQREHPK02LGDTtsVU4iwhski3j2h4BNNf4800oYDYXm7uC8RhH5dI2xV67aCo\n9wDn3XOIctqb6KxhHJqxkdT96lPWK3TlsCRFr2xKG53gvRKog+1PX/pZHXbf\nBhC6A8H3QaJ0F9oAC5xL6NkU5Oq0wmaZD0IyBRFt7T1yv32lZsj2M/Jis+q1\nqXY9NL6J/vRaLgjEhWGVD4S3g0zJW4dAZlivlfQ0GGX+kfRLD4q/ytagiPx7\nu7B6/3RZmn+80Qev32PCfKY6329SVYWgvYH8N7Or4Ri1NhAsGprPCsUL7HY7\nuqvAv9DwIVUGgUBQraka5oAnKMhmikulEgtb+LIr1gYEMTKquXCB9FDqiZYR\n096i3TCTbhYzzsQUcZM2+h96nQSTC6G35GOMaNCxeCM082hP21bUcpDQzA2w\nz6gVmlYV1oLKNH5V/l+Xyu6ON91JsLYq9rhRpmLwj6mS0VIZKjAVjwFkRbd4\niJWapW/YYDVoXE1flKRYL3/xbP3hCyWMeSG7kdDk7nEUCrBAeQCffcGAPrG/\n0skma9JEdq+j58DMP7ZYYBqFtcKWSEWz9vzIuJyn/bJEwTXhujINV2OJPDRg\npdE0\r\n=1g/Z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ce1ebc7c8dc544222e641d8ee4d03ae302ad7a4c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.51","@balena/jellyfish-logger":"^2.1.34","@balena/jellyfish-environment":"^4.1.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.139_1619295838179_0.7827266503203663","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.140-renovate-non-major-6ca1ab5b882f401402b43c8cd04ab19ba661bf6b":{"name":"@balena/jellyfish-metrics","version":"1.0.140-renovate-non-major-6ca1ab5b882f401402b43c8cd04ab19ba661bf6b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.140-renovate-non-major-6ca1ab5b882f401402b43c8cd04ab19ba661bf6b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"873eddd794ae26e080c6d9ff31e8cd0aeac0c280","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.140-renovate-non-major-6ca1ab5b882f401402b43c8cd04ab19ba661bf6b.tgz","fileCount":15,"integrity":"sha512-KVKs2dtQXV+8bt4pQgRYaZD4z9yGLSP8L83CxwQY98xSA8pfZ3pJuf+nBPr1kCbkEt+As/VCaYpop6lMCmbf1Q==","signatures":[{"sig":"MEQCIFEN4Iwa2VqPc2bUFuw+Am7dhR/khfXFnOIF3A5QxWT7AiByeA3w930klDhjzoPui4A2MyWfjXNubUlf0N9ki3fF8Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91273,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJghMZACRA9TVsSAnZWagAAVnsQAJDk1kzNhgxux1NQW4Nn\nilxuNUY1xxwxI+RE+GOUZfPsWPPCfQjtJwZbGzShNFyf238/YL3cE26YYdXI\n7L2BChdPYphqv8SM7WAv/EoaB+7HhNm2SxDOftJ+nfMJTR61aRFlMCoKbBXV\nHTNK9QunKuKaOozyAejeFbghTrFvAqzCUXHuazP0cAdE+FqLBzZBKE+Jgf4N\nfhox7QpIZ20GS0OWGWGmK5fwE3siETkfemjuWRUtE0bMGufzMOWrk/03S7rB\nOQaGz5KqZTiG5aiRWV0XL6zHZ+ldg8qTIc+jHMiFqw2/mlGgwyGUnyrG484Z\neYltgzoLXSuMe9ZpuqdzSn5EGEoIf684fD31psCyVYuysZmhTnc9CGtW6G07\nUWSvHqsuxhBgeO12Jtp8Bz7OoFLhz47/4CRqxAgVd8w0TcTg4QyJThNo2NZJ\n8Ar4D57BL0Y8Qndf/IY5+jPphlnmctf31cNerNA8sa9MQvJ4rCJoOCtxLvhj\nhEsinSSgVgKu334Xz7DpFZ9l1aRsFFsLaOhxsKAFAP+TQeitmRodHSBeRJYG\nI3K7YlXp/32ApiGjMTqXrGQTYdvhnbtrANk8mRuGQtBiUndaqHHxzHlcyGwq\nWt5r6O6duUWvrd9a/Km/AO/xBCZoRgGUmbMYmOBdPZAYgeVfEtzYzPYz1Ayc\nB/ZS\r\n=7Cdy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6ca1ab5b882f401402b43c8cd04ab19ba661bf6b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.52","@balena/jellyfish-logger":"^2.1.34","@balena/jellyfish-environment":"^4.1.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.140-renovate-non-major-6ca1ab5b882f401402b43c8cd04ab19ba661bf6b_1619314240059_0.9237884914226486","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.140":{"name":"@balena/jellyfish-metrics","version":"1.0.140","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.140","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"42b6972398fab2ab3b70587cf0358ba685cf74d5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.140.tgz","fileCount":15,"integrity":"sha512-fjd8U2zMLfZ0Qil+w6yLXTDlUWS1uy5g8r/8Y5qdBV1QV0bdI4Y1KquD6uEZtZlOx3D8So5+xRX3fDOv/gnbNA==","signatures":[{"sig":"MEYCIQCRmbMDyH+ak/iESiygxE361tL4O0neAlB+ISO1g+GIvAIhAPrdq16ZgylepFo0BjGSwLIi5KXUs/QPY1vjIrbgg7p2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91213,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJghMcRCRA9TVsSAnZWagAA6IQP/jDV8VUWo6KjFUHZoulF\nrn7hsbOH3C5H+Vl7H9Ef2apDTmyhokOGJMUnhgk7wLa2BG42t/lKQaojQ2eU\nWAQTKDHUx/3LgNxjhkJdgYOzfw0Hv7enYTBES2vnRIBHNoujsMYng9sdqkgk\n7HxoH/S9d4Eq1M2Mt5gAHjhah3JGMPLIT514iMYWu/K9R4vF9YU37LFFD8f6\nxuMSIXX46PBE967ftVgaMJvRelFoN21EMT4yRWHLelicv6MCS9F45lfPdwoq\n+rB2ptCQd8fvQEEoegDDLLeRF37CLigLLjpSVOjhTr7xFRxg/q8XWBhYJhNO\n8fQ8QhdQXf8QOZOZmRDJlw118DrV++Qxxc5K7P51eN2kc4LJ6tu33NOM4oeI\nxEIb4E51kvgFHNnNk5npbRgbBcr+jxLP2p05rBVsAQEheBjIoKU5Qf+VLcyl\njRGHFe3C2EQMpGU1YI7UiJM3NfbKQlpzeOpSMSN1HkBj0YxzcvIPBbhVelsN\neD5gmMGlxRBdrM0Mk9dNvj6mSRTT2kClLy618KZNGJAUU2PAnOMFJP5w5erw\nfpYamwodcFswKEfnYzeIswG3oTSfHlmjFNvWQwUnpO07Rz5ekS75YQwhdveg\nvx/c8Uy0iK79Ibn/tgFsmHIhSHP4pUF+Ra9mlh5/7axllFGLuxL8GC4DKPbU\nNuCe\r\n=PK69\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"73bd1d8fcf9f326cd0a2a452b9cc80c28a426b7a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.52","@balena/jellyfish-logger":"^2.1.34","@balena/jellyfish-environment":"^4.1.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.140_1619314448752_0.03140219275561984","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.141-renovate-non-major-a0ff28c559870232ac61c4c992b226d7b26d5d44":{"name":"@balena/jellyfish-metrics","version":"1.0.141-renovate-non-major-a0ff28c559870232ac61c4c992b226d7b26d5d44","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.141-renovate-non-major-a0ff28c559870232ac61c4c992b226d7b26d5d44","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9562e00aa47d43632df37dff4a0af93ebf9d4b76","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.141-renovate-non-major-a0ff28c559870232ac61c4c992b226d7b26d5d44.tgz","fileCount":15,"integrity":"sha512-ut3WJMiL+CbGCWi1EnGHk3b3oTylgUVoUW8qOXGazPBoy/sAFUd44TuvI7LmGdJdnY7z1nmRuXtepRvQVkkEAw==","signatures":[{"sig":"MEYCIQDPcpy3AdcYpvb9kGhNK4hNcxyTJ/cT03RIu793NUS4AQIhANUTR2fpFQFmY/ledRQQEjLY8EMMktlmgcgXnN8cNzNZ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91376,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJghgHRCRA9TVsSAnZWagAAsJcP/jNZJ79SvhflRaWeztjA\n2fS0cudNQX94DvLRox+FSj3wesHNA437N7St8dKhfc9eY+EOjohS7/MDa8+n\no1wVRZmbrcEJNxd6/sJoD7MRMWN8FLgBcGsPq9MafUx91ha+4Ixb/qPECk3t\nLDpOIF/TLysZN75cX/rq/2icJa53emQoOGCN+PCoLCBftu95PZvNsPWTSMmF\npcl0klhf52V/tY8FJjHgk6L+KRv5nKmTrwykX9OJMDqx6sbKZDla22Ywit6l\nR7AMc0RGnZDIrgb4ePBU2dn220jckKElKGNkmDGSd2k3smMw35lNFHE2dJ+7\njuln21T1DSc6guEoHHMa1k71CVRNOT0OtI7iyBfXGufh0R4p4fe94ixuRDTB\np8P8NRw30GVqL0cRzouwCZTedxhA7dGoSAWA1FuBwWBAleAX3cxA6wjzVS97\nvLPvz2On3qq6EbBuYwgRixONSYjClV1cp5hXiBQUizV6GTegtoVUUr7s5ElP\nFIg+a8XULk772TDkrrhhRTfgLEn5wWRH5Zktz1CMS2dws9TuhVbj2R6nmB9h\nv5dx8+9xFqObQkASD/11clLKaTE2WTBU5ahPuwWEtCQfNJccLVDDBKFwE6Cc\ntYKQ0VVeAheUp5P9yJmieV9Oarrlxlz5I8K7pkINABlZ5c3QqaWX+4TZ7xAa\nrb4N\r\n=I8Xq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a0ff28c559870232ac61c4c992b226d7b26d5d44","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.53","@balena/jellyfish-logger":"^2.1.34","@balena/jellyfish-environment":"^4.1.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.141-renovate-non-major-a0ff28c559870232ac61c4c992b226d7b26d5d44_1619395025380_0.5527775749738337","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.141":{"name":"@balena/jellyfish-metrics","version":"1.0.141","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.141","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6464337432b46ecc366208e93332c70c10939ff9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.141.tgz","fileCount":15,"integrity":"sha512-eI+juXbLrRvLlHiqeDpTt2NW95MyjNm3BbIKBgLA7JeqvcF8/u8EyoJ06NYRwvCjYsmRvapInarNAE9ka5T6/A==","signatures":[{"sig":"MEQCIEVg3SmYei9beeFb5poZxLnHAc9H93ARcny658iz+fntAiB/KeNQ2k5PL9YU3k/bDZjjLL7bGtefZduxZBBbWsu1AQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91316,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJghgMuCRA9TVsSAnZWagAAkoIP/jPDf2rRzcb2u0RpZX9H\ntFjMIsSazWLh/JCxWr/u/GDqFafcX38/TzraSPr3zpQjB7jq4LOnpLT01mcJ\n0P1rivpXZIXa/6gWj/RH80Rnm8ndWCrbo+4LG25jm1kmyYTvyObWEeVfMCK1\nzISdQTmCg6oPzzy3CMp6AJpk8OAXGQOpBugAJQOSqecEt/+v7klHSDn8YLfC\nCDoOkwWIvOHtsJcnCeUaug8E06niFZiGIJ5GhfjYk0nQt+E4bxnKpKt17+j6\nJ1IB6MIpT4xbVjgs/r+XrIUSm3XEqRudUNTWiWKs3/CsfRRBmTIW/g53WKdD\nkYtAQEWrJ2totqwDWAY62LVWfFQcMObPHNGDxdVVaQqPg1EGyhX+JJMt0Ysl\n7xijuhziYH2QJNaD9C1MeDWXb2FIIx5vUcL1mzLT9iresseqladGqfJqGwVK\n8bLuiXmFyLQwYaCDeC8VuhZEdcin75iDWMvSNqcfcklbME2c2rcuGDjImwCT\nQfC2cjEHfqs0Kiag8bPRRtoGbqwWC9SyeOsHtKoUiSr1rIcWYUkUOVl0HWW+\n5c7BeY2THvfAOosVhQnQQRzC4J58+CitWe5Iz8T8jTBJx86qRv1f1CPW8rAw\nY132mi/yb4SWSIchEKkCtgyJF4hVVnBQxv/SNzmDZNWSshFLG8MhhsrbDyEJ\nT+aP\r\n=745f\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e2326201a0ad73fcdd962948997da191197c55e6","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.53","@balena/jellyfish-logger":"^2.1.34","@balena/jellyfish-environment":"^4.1.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.141_1619395373726_0.25528079654623337","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.142-renovate-non-major-ab6684f8a8a107e8114751f3688693d59ed03c79":{"name":"@balena/jellyfish-metrics","version":"1.0.142-renovate-non-major-ab6684f8a8a107e8114751f3688693d59ed03c79","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.142-renovate-non-major-ab6684f8a8a107e8114751f3688693d59ed03c79","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"204a8b9a521dd7f25b9ae4c70885803fe6d37261","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.142-renovate-non-major-ab6684f8a8a107e8114751f3688693d59ed03c79.tgz","fileCount":15,"integrity":"sha512-cWAd6xyOCNPY32L1w0aeGMhSpxykeoFsaa0PSSLs3Waw6saY0/qZ2yksI8aaHXj+QrHYWWLdPohAKFASBgZ16w==","signatures":[{"sig":"MEUCIEg1alOwZy0Cq1N+TQZeEE+krMOgCCy+bxbD2Y0d2TDEAiEAwWajG1moFuOsIiMkIEoHq9/2SyAXjVKbM4kqqcQOS4M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91479,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJghgnPCRA9TVsSAnZWagAARnYQAKH9F4wB/YEnXA4Aj+xG\nairf8bHy9IS/qnnhuUIn9jxZGcEIFQqjj2a7Vvy7+rkRnoJvm2Yhs6VCIzwq\nOmsOnciR7f5r0o4MvUd+Fa4fOqnJ+YiSo0Lw2PTa/f2RxlIqPIVfnajpK75B\nbO8OJNl9dTDarJSInEpmd7OSvk18OYqP5TXGLUYarOaJmyflTuHEq/WK8P5n\nWg4/J+l0Gar1uAN4UHiGkc4EgyJzpc7MBEW617kHGYp0qvCbOp5TZCkgH5uy\neBzZIU639pbi6nsHCjLtvuC6rM1eQxk47vkCsbOB5hQQLY7Ku/q93f3yuk8x\nLUsqPniUiB34mQfbmWLLtAqdT+LWWnkUmKk0UbGPRo4mt78gJJ4A+1WQQ535\nZWDC7nKfm6ff2qxYdtQEulT/F5QGkKmWcDBi2LnZM1vBbXseUcR4z9Xh+wEx\n/YF0XJV+UqxuGmq47MWq0h9eC0xt7p9Q6hFPME+Ovjm5XV2kWzZV1ChJSobc\nj2cN0AUbI91SkbgfM77I+pJ37kV68Op/zUT7NzSVRzwSSTWVf5ucZOp0F6TT\nkWvHBoouDM6w5+0gl6yJbD62E7vXdDsIAkfHwHln/iR9btxJCquuJmHWcEL6\nKFKJqxvgCSoSVNpbrrpkmY7mYDNpIHCIwT3ueA9G4pCi4iL1YwZsErA9rChS\no95S\r\n=05Kl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ab6684f8a8a107e8114751f3688693d59ed03c79","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.54","@balena/jellyfish-logger":"^2.1.34","@balena/jellyfish-environment":"^4.1.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.142-renovate-non-major-ab6684f8a8a107e8114751f3688693d59ed03c79_1619397070903_0.42523622516404114","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.142":{"name":"@balena/jellyfish-metrics","version":"1.0.142","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.142","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"065f1a6e1da0a8bf6fe82676b5755cb5d3877432","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.142.tgz","fileCount":15,"integrity":"sha512-VHNB/ZD9/A9sHqF7u461UpP/DzmGw+Yd631/1Y/z3KfMoID2PEQ4oT6w9xFofNvJqU8qdF22j/vwLDKm5ZThAA==","signatures":[{"sig":"MEQCIAJfb4oCaTtiB+ThO8jDjo2bPTMtyKZrviapsl6Np6aDAiB/mz+GmKoh1HN0tEXcFagPKZE/oCQ1xbOAleY+Z7MZjA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91419,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJghgqfCRA9TVsSAnZWagAAlHEP/319q6uA3AgzYzJNo1KQ\nipIG/BbeHbyTtwL7Ls3RtJ2Dmv2lOaTiqHisZYjJtfFIt51aRfoo2YZz+c1U\nJabKSOl913Oz3+okyzxx6r+QGOOQTOMjPxv0rJdYDeOd+HRIWlprm6x99utl\n4KRd10L1UY3zgaWGz7vanSORS2Pc+SU8sxdFV9LMQ5nzdmyOxUG8F6sZbJrJ\nYDr6VYT1BGISFb25XvIFt3rP43OW48Cji1I+Wqfvf/6Yy3YodOUGe0xIuC9V\nK1Qnlr0cgDbrqbgkbTelDuQ9hEQrBgl7o8NezJtIJHZJ2/NyeAOFvw4FL9oW\n0nPqgEvFly0NEl9T3iT39Hxb0T2mLfesIQhC2kbWsrJjMgWWLGN9gNigT0/D\nCtGrSKTFDO5rg9JQ10pNUwvHc336nBeN4dDGcffoyCXiLq+k/DhUxHw9TlNe\njdlC5+8vweJbmvG75i87XWo+L2tqZkngkmkRL+6fetqVwouG0lv0p/aaamMt\niQ11Dg34b3UtpP9rhehlt7X67vb5o8Vr9xSH77/y6zROlYEJxV3ScaOSZQM/\ngIAm49uyVTvIK4dcEosKR5MXs5a2vIiM7WBcbtwDzOG9OVFNOgWDs3Qftqvq\n3rlQ57n5J0j05Qjw/DsHE6mByuj3i6MZf8BjKBKcVzWRm3mmXE+lqvvWXL7Z\nkAdW\r\n=eNMx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"dc296f8836c14481d031d0927e4b381b896b65aa","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.54","@balena/jellyfish-logger":"^2.1.34","@balena/jellyfish-environment":"^4.1.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.142_1619397279109_0.48143653140406584","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.143-renovate-non-major-a88cce3bdce52fcce2f071ac7c935d64937e49de":{"name":"@balena/jellyfish-metrics","version":"1.0.143-renovate-non-major-a88cce3bdce52fcce2f071ac7c935d64937e49de","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.143-renovate-non-major-a88cce3bdce52fcce2f071ac7c935d64937e49de","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"359daa97bf7bada48eebc75aa04b171d159173d5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.143-renovate-non-major-a88cce3bdce52fcce2f071ac7c935d64937e49de.tgz","fileCount":15,"integrity":"sha512-dEaDN+IJco6vmUngOPSxpVl3/v7RnEVsEtEA8d7qea/6rZ57GQTBmufyZkneK0MkB8vRVlVMGrMVNxqmUM4o1w==","signatures":[{"sig":"MEUCIQCnpF2CnLIyhU/cku/BX0XuqkaMC8NeT8cUObwSTBPBnQIgEm3gSucgT2i065P0rCfkUZA3eDeN6QRZNQyWU+8T/Q4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91582,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJghix6CRA9TVsSAnZWagAAlZ0P/jbPFrp1VwUjTWZMKMfb\nlD4MH0hk4MkIEarZ6q/vLhYgPo1GktJ/MrVMkMzlpzsnIhzHyIMZIQWxz1Rz\nE8Ip2TsLojObF6vKzy0pcByI6cHxMYC8f7fZjeK+9Vl6fAL/iJ3MBP03b/Da\n/+QCmKvjPlOSHxW/YomaKaBTGaGyEZ0wjLOIkPKrbFzKT02GkEkcp/5MACoV\nycPhLYq4r4MrPIP82m0QCx3LXKchTSPdN6VpeWE6X9vr0ZrjAYH4YnAeEAQs\nb+dbahoRbkf4AcZryJiUPNdHJjeZXdpqdDNpm7xsmTiWFXojTTwcS+E3RfOk\nUxPg0FgoL36nLsnwvlU3Nfe1OeKcEERsADlbaxPbJlVUBT/pEgaG5PTYnAwV\nBb/W560N8pPwj8nS5JHzalxY2bo9NE986UEtyLqhoilRtyHSYlwO0s2t/aMn\nJL9+q1JskttTM8hf5efZqLQqZFioyY7tpjjZifn7pTBmSjYykJhNmN2PBfKh\ndjieL+DIthZ3dPzzimDpr59C14pVqi9XBOvHXD8ZzXR2q/CxHrIocQTUaLmX\n/fC4mQ8YiB98jsDcbVLPhbtkywHolfgfuixQXmVoE6awdpdwcWXtzbp6JVWf\nALwqhnb9JtD0DvNC1LQBHpSCslnsVawv/p5a9UsTAM6NgnT+IwcrOM9/iQ5g\nf5hC\r\n=a4JW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a88cce3bdce52fcce2f071ac7c935d64937e49de","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.55","@balena/jellyfish-logger":"^2.1.34","@balena/jellyfish-environment":"^4.1.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.143-renovate-non-major-a88cce3bdce52fcce2f071ac7c935d64937e49de_1619405945821_0.6097449577779854","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.143":{"name":"@balena/jellyfish-metrics","version":"1.0.143","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.143","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ef676679d3a37078b2130f490382f264c39e088e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.143.tgz","fileCount":15,"integrity":"sha512-f8VGZtdvX0i8CB9yeam0d4O4lGZ3kzdl4i6iUXYZakWp4l9gO0YIQNCycgb4wBzmXVLSEsgt9L1LHYBNjmwW2w==","signatures":[{"sig":"MEUCIQDrMPgjAbWKYd95TD1EkNMHqyUBQ90Wg4gCuZM1yKgTkwIgX4Y7Pi7ST7gyMhYkuf2CrSvEcp64xuNfdr79RESc9Tk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91522,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJghi1ECRA9TVsSAnZWagAAI6QP/juRCgEYaMVOfNlahqNt\nFKeTuaGKlA1gaBNNgdzMzS0CwWrxypLSPWifM5lheBjz4UkvdJrHpUyNeMWl\nQRTzON4SaISmlq/lIhbE4o/sz1urdHk1yzc4k16Z/7+pUDvi+KsCuv9NKLWB\ncBMXfGEw0zDeMaaE4jyx/TDwhOaA74yzjBpWKxt58jIslrRPGZdElPo5shy3\nNDKbSVaJ4n44xQAaJBbgsNsmbI+tl925iWVlUUUSR60qC3xbL2q3d7tjtMU8\nQiYAgboUVruOVtGj0MiCjO3WaPfNbWyCx0WaY3IuS7lWLSe7U9pBHKGDAV7Z\nSurg237OrXNgX1CUlrsDMnmVXeKq7GL/2gE1DEHuFw6ROiY1/ZVjtflskuQi\nmnGD/gtmuJCj6r0LkZf2uRQfF+C4dEM5/xjXpWeP1RLiG30pQ1fvbBDpl8LP\n/GELJAnaMhB3HbZ0SB65kO0WC8Wew18+fOjRP8KYqaFkFner0mok7cTjAzln\no3VbaodtHyeZzasCnhLG36XSXqN/uAWrw7E7oVUYBxv3/R8cmQBykAmFZ9vG\nd1cAaqzhN40B/Dah25awLTnLxoEJtTSfZn7TSsRN82f1/eO/Rml+ISKWtUD/\ni0o4BGQldtCpC3+WesgfAyslg4Y8UxPxJY6yE+L41jYWcKypJgXiaCUBiwsc\nk6cC\r\n=Gq4V\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3c1962af7534a1e5cb9ed7d6073dca007174e8ee","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.55","@balena/jellyfish-logger":"^2.1.34","@balena/jellyfish-environment":"^4.1.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.22","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.143_1619406147954_0.6641032418347386","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.144-renovate-non-major-473bae62e1579a476b8b06d7107cf367ddbe4750":{"name":"@balena/jellyfish-metrics","version":"1.0.144-renovate-non-major-473bae62e1579a476b8b06d7107cf367ddbe4750","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.144-renovate-non-major-473bae62e1579a476b8b06d7107cf367ddbe4750","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4165bd920dfb179249d0248babe572ee08f73ded","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.144-renovate-non-major-473bae62e1579a476b8b06d7107cf367ddbe4750.tgz","fileCount":15,"integrity":"sha512-2E07f8s8cLo7v/rgsj4i1YHP49NbpE+u3Spy8/HSPN51/wLP+KUF/XUdN27GfyTy734m2qWBeoEYa1LTdyCeJg==","signatures":[{"sig":"MEUCIQDvfisCN4yn+J4HyqEjzKNMiqbHFGl6+k7wX/QfsykatgIgHlJQoSDicuypvSi3NdnFW8uoQPzdPGg5YPL5oUxSsuY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91674,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJghqIwCRA9TVsSAnZWagAAozsP/12z9/edbPW+PdZmB9x/\nGEa0Yn/uGn5ZKRbnKNvEovuyqwvQ+AbA/z0CE/ClHRp8abPDsXdCEPX2Sp7w\nybJLWqMdqbwBabTGn+4CHMk0fghYN84kCdrQhzXAfb8ufePeASX77jSMVD65\nF2juQjPnGDeJaQhyLCMfox6RfLtuhFcmyY7FRZ/VNRuqyR0suCbMPSVjx2FT\nddkMrMIEVvQ7ffnPv+vB/zLOjCWNqE8lcu9t/9f+C6OkG/mveKGcbfY1GvMP\ntUFN9tfJ8esVv/BMHfNuRI09XmDmGnNs2nVCUnlv2S0ODTe90uANjpgiFn11\nVrLQJ6xzaiZSuNvonhWEYEwQnETbKL+AqVnOait9tXBP2sDPVmm0Lh4c3CkD\nZpBONRYvhZH2kUk9LK4Qhj6dj3JYJeKfOfSl7cd2vViEmJ2+IIU6AOUkGECZ\nqFhbw2kXZMVdKCCnlDnN8sa7RT2bqr188PtwhiObAuEwc7GNBNFxlcdooC9v\nnAF1a98FZgzNw9+19aqX3ubLhRGq9zmwelG4FQAEsi1XMPHDU9auypNiX6IV\nL1/9TuP2+E6Skpkztabsv+lfQEqFbIPeQD/gdq1ZtvxhTePRPLqIVe6KiDVf\nL/BS1v2S0CWDZVGDGseWH1k/S2k/8c5vfhmxuoflOKe3EstIuZ/UgFRxm+8i\n1f+J\r\n=KbPD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"473bae62e1579a476b8b06d7107cf367ddbe4750","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.55","@balena/jellyfish-logger":"^2.1.34","@balena/jellyfish-environment":"^4.1.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.144-renovate-non-major-473bae62e1579a476b8b06d7107cf367ddbe4750_1619436080376_0.2030692836711001","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.144":{"name":"@balena/jellyfish-metrics","version":"1.0.144","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.144","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"85542a6a22f19a0368bde291ec168f22a1cbf8f4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.144.tgz","fileCount":15,"integrity":"sha512-vpIv+TXs5+YIhfppihU6bD5ccJHDAxcAydt/d0a8zuZ50e8lRRJ6AZ1wVM8LqabpWC4HLTDB2x+bsGvzzyz3Qw==","signatures":[{"sig":"MEYCIQDk4Cm0vQR91XY6QUXMfpGO/6ZRfzOj1/6POCDDiIrTwgIhAKzAGyV1T7uQaTe5fO3rfORiqQAG4qTXcau+G807An9v","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91614,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJghqN/CRA9TVsSAnZWagAAf8oP/2g+/91IcZGMJ6hDtCuL\nqHHRbrCStFqW2Lxp3eBivt1K1D+qlBggDeozxP0YuBQVKHQULFuEdS1atS/N\nr3z0ureFjKhk2TGgfLsM/t6+Mf0Ch1h5MgQU6mvXy8WfnY2GuMDBYjzsqLBJ\neygi3otPWqXx6AlZCH7WZEHRGmSXLAp8IZmlrUpSeTrisNFQen7muWeyGjbn\nlpx4G9VqRVWQ5LfbBKcxGVTKhkZIr7Jud3AEGVK82QEArOyDDSw9laDlwDC9\nSqUdDh0uXH4VLQLSsGcJsrE2UeVR6fRzTX1qVqUGHvkKNBxAVTWTQK2tW2d2\n7YlPYkL/0NJWA1dQ++GjpS7NaLrJw4QU0FRlWZcBxMLEYyhWmA8lVGWInjkF\nxpkaU2y5VHqkTwS0ixX6fWq5tI35o7X7BsDKFgD3/iNn/O7wYOd2Tlza/thA\noNeyWTgnlBngJD3IjfEkDAepKfLgCCyAI/S4RAK9CeLus+F72RY2k10SEqAX\nbKtpzEGnrPgv6sSO11QsSlz5fDREsxVm4+auv0WyAhp6fd5oVgZJi8qhkKfg\nGfRH12xA0oa+v8aiCkqrj6Y6lGM+hKmVxyNAU8Poa3mZUnv3O3eh6XM5Adu8\nEaDDrHMyqlqvT/A63bafIPD2celQwi6uv4i5gk7ZYTiI/AyBFd+Jsoy7+qjK\nVlNM\r\n=r3ah\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0966e05a44ce3227b8146f91a197f3494661ca1a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.55","@balena/jellyfish-logger":"^2.1.34","@balena/jellyfish-environment":"^4.1.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.144_1619436415491_0.28594541638072446","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.145-renovate-non-major-b57c58fa3bc141feccf0ed6e0526f8bb8bd9fa22":{"name":"@balena/jellyfish-metrics","version":"1.0.145-renovate-non-major-b57c58fa3bc141feccf0ed6e0526f8bb8bd9fa22","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.145-renovate-non-major-b57c58fa3bc141feccf0ed6e0526f8bb8bd9fa22","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8be259f829eee78e13fa0f0e8671bb3030ea1b8d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.145-renovate-non-major-b57c58fa3bc141feccf0ed6e0526f8bb8bd9fa22.tgz","fileCount":15,"integrity":"sha512-KvporbFAym5kohoU7p5bsJqgzcUpnwu5ipjs6Ryw8FyzR8AB+XHAYnomAlNcBJWqPPXfvtS690+Q979WZcI+ew==","signatures":[{"sig":"MEYCIQDJkRMUj6uxJDA7KQEWYzDUp830xk//fzsyf9OC98BICwIhAMOhPYv9UC+aDyNKWywgwzo/B96VxKNtOyfsYgE+iPhp","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91741,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJghwKFCRA9TVsSAnZWagAA/KwP/385RIwd5qudCrC9T22b\n3E2KKGWew6AE66lH2i0jPwJTW+PUTKIHAs/8sZ+EO+LvLF8a2H6tNXnAoH4D\nxIZs2wDa9u6ylk+LbcBsIyAnrOKr2qmrSZL7ngSleLJX9930Y3YlINoKaQM/\nLpgRHWarIZoa34n7N4tCR1Hio//mG4rtOpf9fu/8cJoBc0F2yNMMHDYvKcB2\neO1p5gjmyqtIaKLclNKNHMeN3WKRZLvD7gP/VjRbPFA5EbYpGGvtnhdAb8+C\n5vhWPnZEifezTo0jvdH+L/5/dslOO0IFF67XIApdKzoNa30QYdRefgtQ7HqG\nWYMNWR5sqZz/GCPDaH3y9DiBdZLsL0+ACpMkbQHjvROaH6Redcu9L7jyzWmT\nu+/dx1kTQ+Ak5DIrXVKsMUzSKnASE/3PhQORCYQC9uLrz1UfWlO0I5bO7rOU\nivDxl23422NiPFNJhgfLauCosCAXGxLMBSzNWXTFCQHNzY1/m766CPB6+r4O\n2fIb77GDlVnF9Z2cdhscVcopCe+H1nI44q7yD42CRdsh91nNQSUccaiILz03\nSz82X1xmLkbtXnpXNdEpnnhs4cWzR5426wOH0wlfZmskAPPo6peWmS1LGs8r\nRFJR6QpN7TJ8+7cODtKWgMuxGKZsDVXrt4OsJDhqYBA8oylzv2gHk9V3/K0t\nzA59\r\n=xrnX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b57c58fa3bc141feccf0ed6e0526f8bb8bd9fa22","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.56","@balena/jellyfish-logger":"^2.1.35","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.145-renovate-non-major-b57c58fa3bc141feccf0ed6e0526f8bb8bd9fa22_1619460741269_0.3788578585544762","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.145":{"name":"@balena/jellyfish-metrics","version":"1.0.145","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.145","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"36ce3f7459ed648c79a0fa170e59de3ea568c551","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.145.tgz","fileCount":15,"integrity":"sha512-UYcXs5x1aYXk2KOLI4CKOMovPIarICqoOQC9FujYoXJuqOM3Vt7GtpxMqb2NYHbUmXWgNV07ud2zlDp58u6Oig==","signatures":[{"sig":"MEYCIQCGBZulxgAS/ASnpCK/uDUziEnuk0ySI/rKEfH1E7GRLgIhAMLeiM5k/krEt7oQvqwD+LpWucvsru1pp1ti8vJwB+Tx","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91681,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJghwNvCRA9TVsSAnZWagAAzkcP/24DgezYJejK8VIAj8Yn\n2XKcy9NXoiAd2hpsakYGp+h17d5a6isjITAUIjnsNnfD3ZbEtLw2FVsVj0Tl\njqA0hfbr8uC0oxBDFA6Slt5xCfH61TPoe4+G4n8UkjcyxZIIdXbkHuSeafPm\ndNBbd5LzHwIaZ1vMrAZV8N3WYIUDX5oq3WVnGJfBpNvZjY0+NIMe6IHuWYNN\nDJ0ZOFdbJgFpuwIS9dkWNwSetbLe0EU0yHSsWWd3nkQVbYVNSY0218JexH2+\nG76ZlOUqfAb4qbPzwEMQcNIaa3f+ntCjDNnzA8O9CkAIFRzGqdg1BfOaH7NS\nMCkrrDK+RY0RSYpa74jqRw59WGxQZGz04n7WwV5IP0iMJfD0r7j7kbuIhcu/\nGkWQ2l0iI9Ann849p2P5+zxN57bvg+k1gMlotJwuGoP13TyVB8wOU/r4aPs7\n4OAcje9npUiUsc2RvBKG8+446FnAlW2/7L+07c6soYkDDLU9rAex/eBtj0KK\nI3RNuYD6wZJgxkD9oIIuCc8l3nAzGXrlO3woQPz7jQi/YyXwpLCUjesHRW+e\nFOM4bzDKnar7yMc+jJ2thjMZoIhsbny3M+urJ3thCryeY9ohHrK8SucNLvil\nCllNe0B90ckeTQFZMeh3hHuBPxsqMEwGJqv1ApqBFi/fHYHNxy7PeT5O43q9\nsSyS\r\n=ifsV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"80cda8cf98a457d2ed64eef34704630c2a86671c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.56","@balena/jellyfish-logger":"^2.1.35","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.41","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.145_1619460975040_0.24824948636391286","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.146-renovate-non-major-95f4b621227135dff17acd1ec36fdf7b35f0013f":{"name":"@balena/jellyfish-metrics","version":"1.0.146-renovate-non-major-95f4b621227135dff17acd1ec36fdf7b35f0013f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.146-renovate-non-major-95f4b621227135dff17acd1ec36fdf7b35f0013f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"78cd1fca7587fc9d5173e22d110903f0c60d1afc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.146-renovate-non-major-95f4b621227135dff17acd1ec36fdf7b35f0013f.tgz","fileCount":15,"integrity":"sha512-EzJFD++xMA/mkiteuFhNkfbOjqqcdgkbzfOM8ur12TWEhKkTMdYYURlzuqeO0UaXBSZJBUtc7ceGCiOMQtWnQw==","signatures":[{"sig":"MEQCIDLTUOhLYmncxzbzIyNnHwzbInTpa3+Z0hMIAJb28tzKAiBIbVKQ+H6aXnEC7cZ0nxviIAKJc380Xn4W3UwLYO6VUg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91808,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJghyFICRA9TVsSAnZWagAAfZEQAJ1yEVDjxmDBxXW3Ra1p\nq2zAZ1alAUi3PFYhfsJmUJKK3stlJP/mS9JzXeOp8+hXS9lMHQc/u1am6JmZ\n7t3r6AMrd70X5NbN7zI1/MCfADVf9gE0ettYyES3pcZ3ZhTsd+FTMu8INay4\n77Z/N1X2SktpMh5qAhle12fwx1kv4D4yHMCn77O2GtD/Il0jKzDJNMnXdNTj\nZxtfq4RL+uRHgGxjK5Zka11QBtgFsbC//20CU1KfmZnSIPtFiyuSVD/So3w3\nwsHPPkizfpdSBhgh2U9lNcpd66CEykF2rok/PfaRkqi+MRdSUy5mExCAcXr/\nD/gEB4f9PH3Qeu9QBavv7aCi/3MfQuzG4/tg3LzehVN8qF8jj9WqKcG4B9fS\nrPW8biLMZhOrlZo7dsRlC7UJdn40A1KLYmJy1HH0MVyyQx6LZtb1NZUp9VcG\nLa7X/y+I71bzR0VHj5Rr0mN+v7CnNb5m+/B0WZFtmb7dV5+yYS7skwp2EKrd\nzXBTwCPKfh9PIWngTtia+zjfNoBy/UG5OKEv+FYoi9NgGVftDZ6KcAstxGCZ\n4UxxXueugA7qtZrdY3Nc5KAMdFKiuludQjh0IJmg/xu64kKzagXkk3ZEdcGH\nsRz6vhQ2Ntpk9wDnb5NDLDBnnk9IP8uzblforMlW7a/By/Iwfxs8/NyWrvIh\nYdS0\r\n=DstF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"95f4b621227135dff17acd1ec36fdf7b35f0013f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.58","@balena/jellyfish-logger":"^2.1.35","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.42","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.146-renovate-non-major-95f4b621227135dff17acd1ec36fdf7b35f0013f_1619468615816_0.4177771474225471","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.146":{"name":"@balena/jellyfish-metrics","version":"1.0.146","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.146","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8050fae84690e56f94d1a6fa630be6beb5c3d199","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.146.tgz","fileCount":15,"integrity":"sha512-0MDSm2kMX+Rg+LmpqpG4bW+fgqRNcRuxLdk1ZLAOIfs9mzK7pWE+vyoxPTD6gUNJP7LySp94VEEG95+K7J1FGA==","signatures":[{"sig":"MEQCIHrJ/Wpj3UuQpmEQFoQSf3pjBwpFxp3QnXlWa9OvTFgoAiA/NpRWW1mxvxCLlKTn5VCSA0X9LjhRAjDCyGJfQimPXg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91748,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgh1UlCRA9TVsSAnZWagAAxEUQAJXnKbCu/C13ffnaA9XD\nesY4E+MBuYHNIP0NExNrTQyLtncudRZazI2NmelIFFAjL9JUftWK5Otm9TY+\nRxnZ0w5OHbdItcNXPuhIhtXW2dG3ZtC1PoFuut/UUihuQrOv4W/cgFL0blcU\n884EnZUC3G1YE4zBa7XrSz9YQmCYCMwT/fxu2gYKE7Exbp2TXF7UyYKaee3E\nrxeVfnbGRXLXVBRNDzi8Avl83HjQb/VqR/6xbEIXJ2nmthjEcS0WKIYIk4VU\nBLLmZRyq6db1tdJ3yKJkyl/Dl0FwQK9uEH4ksfR9kMnwHVPbJBlCfTjmUEiq\nJWHNN5pJqMtfsF1MiGpA2nJXUN3w12kI0RR0qYGstY1Bn+EyF1J3NAcquBKz\ny244dINOxiR7IJnsf8Ot6saN0XlpRxcYvY9SiUVtBpdROz0UhNmAcnVAF2W/\nIw8nmbXAJy+cj+W0spYDoFZEDl2l3BmqZwdMZ57SIVsZceddCPf1nK0j7m1N\nSZRS1yiwiULIpP9I798ZpRbqoH8N29KG0euS0iew2eRS6j1DzHnKV4Ak49DF\n38S3WId/FhHXytFaTTFDA/unqSLBd0igY0pJC2TxpiZMAzX2EoOX8oYvdRI2\nTOJcG6yu7T3V/4R9mA12JW8N63dYtvjFjRulDc5+XjBsj/+37vyg/nLqmVfU\nH2LJ\r\n=D340\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"1ec8d17c0fb61aa20e25ce06696e57582d156ced","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.58","@balena/jellyfish-logger":"^2.1.35","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.42","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.146_1619481892521_0.7202722612555212","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.147-renovate-non-major-45226273a5ca83dc917b8bb65660ab36d787090e":{"name":"@balena/jellyfish-metrics","version":"1.0.147-renovate-non-major-45226273a5ca83dc917b8bb65660ab36d787090e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.147-renovate-non-major-45226273a5ca83dc917b8bb65660ab36d787090e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"479e5008df71c2e701577cd632deffcaf9421c14","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.147-renovate-non-major-45226273a5ca83dc917b8bb65660ab36d787090e.tgz","fileCount":15,"integrity":"sha512-xORcv8zCrEVSRxqEbVll5wPsuC8R1Pn8vBNHDNMN4lJYv9ho1wTzpepDJifmzfLauhyqNPkJ2iePllcozuWaKw==","signatures":[{"sig":"MEUCIGKLtWn15AM6bnzSdJI6ZF2oivlvVBj1iFYry1XRcdpNAiEA4kN6cTHgzWXrgje9SIRvYFHQLYNtQMbapZzw/zX3aCI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91912,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgh2M7CRA9TVsSAnZWagAAbO8QAIMbI02uxhfgHK6m6fK6\ng9HcG2khG0B0LeIUPpQ/hXZnTDACkoa1oie7Hs/a/nlHbdBKKqukKWMyoDEo\nq9o+Wxtw6yBceZopGTnLURJBv6omQoONAIsAPa8XikEZ+r5XaCmDgHvzCv+h\n0ccZ4GRbpKoK4/JSfYOGyAYQ8Xe9YGXj6p9Wq0aGla03hPS0xCSdr7ypGf0t\nmsLcQzLjf5jFNRPS392ILc69iM0qt/3vLiKQTrnUKIAFzMjjiJC491oUYBoO\nrDCHGKOg7LpCtjnm37jN/6cnKbtf75tfDcNjcJHrd3wRhHmlwwxD3+X+oDZu\n9drJp+ptMLaD41woycST30tcF87DXFN2u0oC+daE/FoVyBi2YOGpeyhJSsYq\nL//s8YmtBtG4orPajv3SQws/Irtfr6tINFcjE/xn2s4PHNKBSUyCyRuzLKwl\nUQG3N3bhcHQcvS7j0e4FhxJCpN0+kGR/86N7vELph7HAAU0wHH2Ldo9tsjak\n9hqY/wOd8a/1MZcdxmwkvLVIZ80hKvgwujP98Efm9RiaFFcTkCedZMyXZF52\nJracYcGUfJx0/iSjS8PdRH2w5XOiLK2Wbet8r+cLnDvahu9X0wcFniTinYoO\nKsynIh5u8RqVuD1JTA58UibwxQjtFvSP50q9KIWmpR+kxvE3JucyjHf19TEX\nqdXH\r\n=yPOk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"45226273a5ca83dc917b8bb65660ab36d787090e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.58","@balena/jellyfish-logger":"^2.1.36","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.42","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.147-renovate-non-major-45226273a5ca83dc917b8bb65660ab36d787090e_1619485499066_0.0014031823288012113","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.147":{"name":"@balena/jellyfish-metrics","version":"1.0.147","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.147","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b90a59e16afcd1405a33dbc95d7606a567dd1355","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.147.tgz","fileCount":15,"integrity":"sha512-WkQv3hC+Yi+ks6ARr+U7zdhf9wXmFgslUqQHc5BSBEriLjx/zi6A41MweN3SQ6DnkKypvyo9e2qnlDnzl42Q+w==","signatures":[{"sig":"MEQCIAIgyZcNF+bPe1nXQCcPbV/xfdAys3EVEFDIIDjV7VWmAiAl3ATHVM43Ac5KtTQ0SWU+lW/BOAYkuLgq5E66+uLwug==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91852,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgh2QnCRA9TVsSAnZWagAATr4QAJYP8+O+FYcJhko45AIe\n9VrmBAAnScllruTo1p0+EzCMq7VuN5dEOHH84oZWUa5LXqYLauOXIU1pfJp9\nQYP8Kdk7qKGXcONz/ftKx8StzSVtNwJVEak59W+h1ZiEnWFUGu7XeBgbSeiY\ncVxsUuRXxfm5bsyQAdG9lF7cREizTbr3pECIGfQ2eRYQF5MuIdy67hcXswLS\n5ttuZvy1sSFMt/h/z+kmDLWZFSUO3lvjYAnD4FiH3UH/S9gt6Ghqw43GQs/0\nnLSuYZGY5mu6LTpK55/HPPYQIVXNYhUlKT8RL6QgDEMYVN29kWhzgoCfD13d\nHY4fCJ8US+dPN+NtkuqBYhgWnR9fQfAlF/V2d6N6BY6uOHuSolyUfg7pNiin\nDRI900MAuY849LW5J2Pa6NuPxe8otdvHxsWJ5aijf2RIVzpMcY4oXPMmctlU\nh+DCSQ5PqBivSnA+Y7U9GdWqEnTq43jESPaLJ6Yy/kY20zqMo/e7N/Qcq7dJ\n0Mt90gE0/E45zgY2+FjH5fyrBzGABHAfzGRfm3ELv+IKCJXChcpbhf7LpNhF\npNmeVFmb+I6p/NWz01gRb1r6mT/JEX/V/+JyzWBPWyOZca4MVjpeFvwLvHZZ\no/ggt4jDHt8NWJSwoDXB4u9JRRO41nvT14FVpmuhms1VUa/bAvnYz2+UO7kB\nEBDq\r\n=N73F\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d3e5d8f41db0b1ebd876144c79ae3d7cbefc5c8e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.58","@balena/jellyfish-logger":"^2.1.36","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.42","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.147_1619485735320_0.42756030345345586","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.148-renovate-non-major-6c67a9d903cb1699416138eae46daa7cac02d179":{"name":"@balena/jellyfish-metrics","version":"1.0.148-renovate-non-major-6c67a9d903cb1699416138eae46daa7cac02d179","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.148-renovate-non-major-6c67a9d903cb1699416138eae46daa7cac02d179","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e60030c7eafd32391e95c5b9001b9101f75b59a8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.148-renovate-non-major-6c67a9d903cb1699416138eae46daa7cac02d179.tgz","fileCount":15,"integrity":"sha512-9QhtyFpTF8ixqwtAF8DztWIZLwSVExl62qLPDJCMiQJMF/tt85mdZd5igHecjRPK81epen8YN0jWEG7k2YUg8g==","signatures":[{"sig":"MEQCIGT+nAuaXW1c6UPqUDqtndU2V/SX5m9h+hXc4CX7Z8iAAiAwTt9DQlWUXoJKKjBjLMeKtMfmGOnSY5O9Iyd6JxZCTQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92016,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgh2xECRA9TVsSAnZWagAAOugP/R+170HGnXIx7GND4hui\nKm9VefAqCvF6MdUYj6emzLU84nZc5UjK9lDrG/f/72em2U+9/NKjgp30KjrL\n2IRY3HfjlWOqSt7m0140AYCQ+u1zJKnpO6b8AzLFPyn93UpzuZXgC4XPDvmm\nzOMsfA6bYaRQUYKDkJcFYCdFVflHQPoUYJEpvkWBQLf7SMqawFi+Sb/uj2Wv\nKFrJPgDIqyEh27fGrxrWF+4fVU7+avTBS+LSSy8+mk/12DLHmlmYmXMNWXul\nJ7sVsRhLXrPlBu0w0Jh129rff7Ghi5cWDKWZOt9moW3urjaKXdCRoSK8vZBe\nBo0Pe8oXKSFUd4vqlzJLoWPywgByG1pptGgvwkxx6ncqzC/tIjhl/c8jyu7L\nFf2WNhYlLvxVzpI+gQq9KfT0cbnWWza+YXAh3VI3mRtfBvQNqZDHYhOWTmh1\ncS5imw6CrSQHR8NJBWHy7zouzfVBTbNdlmux6gfT9q8vKW3DgsjHYrsxZ5AF\nh8iGdhamc2OXiTVlMvfogUIVDNTouYDbRFD0oXX90nx/ZpTKpKx+BT2IKJTW\nLLYq019KoU5mf8Y4UZ5M+ovK1xWu36h3JCVMzNDBchgbcZ/AH2epwuw1+bHv\nba7gSXNjuBQ6VPW+nKE/u/EFfqtC00dTZxGqTZ6ir+uRwC5dGXqtFPfOOQxd\n2Xr9\r\n=NlQp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6c67a9d903cb1699416138eae46daa7cac02d179","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.58","@balena/jellyfish-logger":"^2.1.37","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.42","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.148-renovate-non-major-6c67a9d903cb1699416138eae46daa7cac02d179_1619487812092_0.727542855709234","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.148":{"name":"@balena/jellyfish-metrics","version":"1.0.148","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.148","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"23d979fdd788d04fd3b429f9ee9e8305c68b0398","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.148.tgz","fileCount":15,"integrity":"sha512-Jd8Vh+s3+ew17Fqg/Vqhj4RprbrfWZdBrr9fSA/1tiF2U+/JGAEsbPHMPDtaTsj8vOiv9Bar6Jk2V2fJIrcUGg==","signatures":[{"sig":"MEYCIQCHJYGz2ATjRr/1XBpdtl58k2XMVGxOZ7B7W2MeFxM9mgIhAJj+8hHUtqdWxHMD008PP9YT7VlpXQ/EkqfaoqBCoS/k","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91956,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgh20uCRA9TVsSAnZWagAA3roQAJ4r4N1AgPyhKWIU9enZ\ni7ttf95OtLdb/oX1B97i6BNjjQkqlW6NDM7sNIQeeRZUubyKYS/KRN7rayVt\nXfITDo4JQq5Z4wLfAosc/vP+SWv2OePp4N7vJfnRXn9vouMDzSXQuio5oPqN\nlRvSrWc/OwK0OtjAFVRqXS/X83wSFBb7aURvt5HdmDzTFh5JP4cUq5BDBX5P\nQaAlV8IFeyURzokoi70nR79pcBgbSWX5c8Q8Uhw/evvWcu8xdYWBIegk811G\ntEGgPJae8S8CtKDPeGd0JA6ZVjI2nbYju/jKnDI2I2A3sPMh/qWql8k6fcBP\nUDBx429omAZS8Qm2OQBMcw+DbBh4UOYUFDTYHKcCa1RlcXbNRHbc188KdLhe\nkybIkNICp+Z2zojLukDqcQa3B1eI1aDsWCxbbxcEUefdeVYlr2PKSebXBVHo\nmQ2HGnzKztiOIUxucDELnwJNiZPpZSbDqPuXyQufk3Xt006fdEf3+IgyP5qI\n96FT8bAiYI58rwJQ0A5drAkFyA6eQuUpm0tmumSuUjGq2S2zwb3xNCzSvNzN\nVmH9WELtmyR0bQWQxH9D+b7we4CZfBvaudLBCSGXbnj71uB1/JD+qhJt+zwg\nmaeWPFBx0jG7lh2XZrYfbUohPU/KZXyo2qJlRRADG7J/555FFo8wVFLgNSgy\n8g2u\r\n=XZo7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f23d30fb5c390f3a2c50379917346bf38ca0b491","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.58","@balena/jellyfish-logger":"^2.1.37","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.42","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.148_1619488045606_0.7401051571772905","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.149-renovate-non-major-320a018e9fa8844dc0661fc45fe2a0ef922a793d":{"name":"@balena/jellyfish-metrics","version":"1.0.149-renovate-non-major-320a018e9fa8844dc0661fc45fe2a0ef922a793d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.149-renovate-non-major-320a018e9fa8844dc0661fc45fe2a0ef922a793d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b589b794a61dfdc3840ccaa48cf4bfa34da3da6d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.149-renovate-non-major-320a018e9fa8844dc0661fc45fe2a0ef922a793d.tgz","fileCount":15,"integrity":"sha512-Icv8DYKAcBUls4YEyopqJBSmMdtsKStOJO0CgzGekXcOH3HDml/YlhRQsKi4RtFXdGucTS5k/ITclZ7gvrRfCg==","signatures":[{"sig":"MEUCIQDh59tFv65SKfNAGBbMwlMStzAxxxNUl0J5M+jogwcANQIga4rYBOZvzfit6uxsxS8HtRkvJDD4hrnU4fiQFsVshOA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92119,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgh4A7CRA9TVsSAnZWagAAyFwP/04q8rw1cO98YxE5tpyn\nOYcSG2f23euyZXVNhhtEsHDdewJct1W9CB6s0rWxMYlJgP3YvjmTNhAPMJdE\nBNbIh3qvRAZriu6DhZjSCvwB4IRCObRRzZr7AbC86Igdpo68R6ku3fCCfWJW\n6oUUzhiGQm874YsbdddcNYNj/6SoK45R969PMC7NFiG8/1Duvj74gexRbLOu\nwiSHvpPDFeZsyyzxOsq1dn9RtAuHHyyOKn94SSkq5/j2f3Ah5m8WBbfx+DEK\nDDbL0z0zF08ExBibApaedGixNZPEAgVrWO3oxqCUQKF+WvmlePxG597lIpeK\nsiJBezmQCaJweTZXAYAvwLJoLF7LDNEBI3vHi4LRDCAmDayY/tGAR/+axCZi\ngzCm2mrl9LBxqB7ZAXFeglNd8Utazy5VeEedNAeGeTbGAAP0lOu7m5tOceHL\nYz+xMx0EBvwg+L7BJ8DbhwdtdMzLEONvNk9FpH11/7FvhhxPkzwC2y8ImNkC\ncDaGhLetyocv2hHMJKNqrvneKwNMrgZZkGMxsEwX7au/FHnK5C2hKtHKdcc5\nhx/QCR4eXLCMDDAAQhFBDXL9mX8xs7oRORolX9w7ywz4aAf7pAhzdoJQK1Q/\nmNrgtlKJvs0/MmRqfXY7aE45x5w+uxoLTlNd+ewrpPjR5ANSuk7eOuu8fVf4\nTIH7\r\n=LDBf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"320a018e9fa8844dc0661fc45fe2a0ef922a793d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.59","@balena/jellyfish-logger":"^2.1.37","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.42","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.149-renovate-non-major-320a018e9fa8844dc0661fc45fe2a0ef922a793d_1619492923230_0.04196054995632892","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.149":{"name":"@balena/jellyfish-metrics","version":"1.0.149","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.149","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"df41c5bf402fe58f153cc98de9da1b8bc6846e47","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.149.tgz","fileCount":15,"integrity":"sha512-tAHQ7mkxrA3jaolkb4yhoLRHoydRajJwStABoKJRwb+NGGlRRmoagRoy+rz7mfnb4Q1hSr2T0soQ2Q0pwFouZA==","signatures":[{"sig":"MEQCIEofANGPtSL2OqoxVVfTgMGGJHlagb1wPycEphK8BDpMAiAe3ooMt9bUFt1RwqCUGkRzhIefI3KC+K9rdh/6eLimGQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92059,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgh4EqCRA9TVsSAnZWagAAdvEP/00cJJzW7rky73TXovA/\nqvRtg0ATrlvQ1WgTPejzy8ZEHHaLElZQTV4sdO3iIyDvA9OGZcgAUv8HQjWE\nJqWAGrOyRtB6IqSY78HjLVkbcirgXBlr4PQuP7xW0Wj79U+pQD/ilOLlx1w8\noqYGCYCV0nR76IieiT/Ysvw5gRRnQq5JfyOL0lRtKqQYmB2Z+mLy1EKatYYV\n1DJ9Nc+/V0ZawYtJqukaq+LKy/JnC6wbWgoW4n76Tnc40kH7LVbm/Qd+24AB\nVzr8bxbf6wW71HxFUoJyi3y90WXP20x7OVGBj2lwpbb57xGCXCsMV7ULQfeu\nY2zrbDMiOlmz+2XrMwoypb2cvTVzGicoHlGXP/HDemG+vql5fXiTIVARnuu4\nGdkl4eQUr0cwdctojcx35+pcPiFrtgG9a8+abNb5MINIy80az837f/WVU/aj\noD39YLB1UPQ3EjpbjXMbhiec9tVAgLREVoRmJgSwkvAAA5nnROzGyncbpWSx\nDulNPMFQm+0Ux6gW1Iiw6vSRNPIG1btKX0ESATlyP1p9KsvbAaAnglnESipB\nsZ3UdBpgQ+PV3sYPB5NJG8W+VjztixVowHjoaj1Fi73Z7SdTifKKIGz6SKDd\nKb8OJR82QpDwb1SyaR/AbrCt0VzmNmrLrZMaWpLoZ3ndi/s3qDlyzAPosPi5\n8328\r\n=7SrY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e0709b248a9fa1571efa771ba3c55836a5e7fc19","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.59","@balena/jellyfish-logger":"^2.1.37","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.42","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.149_1619493162455_0.9800835818762417","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.150-renovate-non-major-e9c50e91e974a7251db8e1d4d0446e5974bcb490":{"name":"@balena/jellyfish-metrics","version":"1.0.150-renovate-non-major-e9c50e91e974a7251db8e1d4d0446e5974bcb490","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.150-renovate-non-major-e9c50e91e974a7251db8e1d4d0446e5974bcb490","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2c1627cc7c06579f08f188cef3aedc454a15a794","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.150-renovate-non-major-e9c50e91e974a7251db8e1d4d0446e5974bcb490.tgz","fileCount":15,"integrity":"sha512-vtLedAGtFTTFCk2shljUHq+4pW1/auQYrCtp6u7pnw5HHCau9er4LGfB14euJX7sWXxN46O7AILG66dkMvQuyg==","signatures":[{"sig":"MEUCIQCrJFqyhoV5QWwPw4jhCMWZy9OYTMRthxIUJG/bfW5ShQIgDDSqAUxQOPZTJ6T/Buz2tbxgsUS19y36LY52Xh1Thys=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92212,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgiCykCRA9TVsSAnZWagAALpsQAIvosqnY6TOGXldqYEC+\nuqrFhKxBnRTcEom7NuXdSKQNqAMvmGxTCdhRJ+hjYgqVCM6bFVYAdP3wMDhq\nlfY4uBCrOxMzi2KRhi8tKK0VIbaGmLcQwKt4QPy/4yHWC+OOqJ9LguJc+5s4\nxbfnwj2Otbg306stAunP4BfAeLT7SkJFTcums6hBJTa8Eu0pMSb4gpTtkUMV\nt/9F7FXlOuJ5scTKP4/3uWisNhpl41NwmCyulUmou0Hc5mFo0djQ7YQ13Pge\n/3g6vRRLkjs7TqDK/bcgZYyGNvzOlFvxdHZpDcBQAxX6D4fMG7q7KCjiMG3r\n+YmeUR3V/S+UZzCbovWWHmU5IOrY/zzW6QpdGLrlh4lME1vfTE8syJzOPgK+\nWXOwe3P8RT29YyqhqeH6BYj5p9rbpFu/s1FHC2jTEn4JZk17wBHg0Bq6z1DG\nXffAme/VmkLLk4dOel8A6f7sh8E0DqIqMlSJ0Gcf6cLzJjwBh0EF7UXaQt6o\nwGafNfHpvONIFkltmitCltcpDmM6heFH5+jKa8zX21UmYId2VhxLWyX2fXmA\nntgL/nZ+8okmdr2R6POqlVWuCQZ8VT4zkCYsX6n9KjlYUInjBLSto8Uc/AwH\nuGacK02IdEfdydGDT/QZzplPI08CQJSBpyHgEvEcHvfMgP7yQjmnzPTOqD7o\nKli8\r\n=eWOh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e9c50e91e974a7251db8e1d4d0446e5974bcb490","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.59","@balena/jellyfish-logger":"^2.1.37","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.150-renovate-non-major-e9c50e91e974a7251db8e1d4d0446e5974bcb490_1619537059780_0.13379901461119248","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.150":{"name":"@balena/jellyfish-metrics","version":"1.0.150","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.150","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"04374821682b4523ce759e60f8244aec748668be","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.150.tgz","fileCount":15,"integrity":"sha512-9YGNtU0f2g23roGvS7Aps7rNpExT/lWOQrrOvSQQu37IhlAFVgnoXqWNPNysyMME7xQ6B61RSWlDmO1KSHNEMg==","signatures":[{"sig":"MEYCIQDwM071+jqIYm/dDZoGdzwNeMVl+ALRmNFytE/W4KGIdgIhAK50UXWa7jtbRke6+7Y1yke+kHkk7Ib08xmN6GEAO0hb","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgiC13CRA9TVsSAnZWagAAVmYP/33JwM6j8C3Eo1udxgBj\nmM38X0LLcL3+FNnI5c2OocHIGonfT37mv7vXgY/mSBwjIsczB3IJdAKRaMUj\nEg/FsOV6ljOXPN0/ba21sPNM20eqrAyo5T7VOyBcLflilnqRA3AkXAD+ij0I\n1S3lT3wCDhalS4MNiIDb/suPf3hgp/bMwdfy07jp3PZq+lQiTQa766tsHuE5\npAfWcPHOu6Uod7SHTeewcMy2y8dChQMtBISGssVUAwDuH+FX6myjqzsSWDyW\ncjwyxaOiFHMKh+D2jm8WEC9YhAXoze3OHEXKssTgbygFoSnr14Ts4NDetrMB\noj6pPpAeQnvxvlIKk3VJ/yNUynDYVUlkmNUu0EZ8lMDV8BcNyoOZHDs14rIm\n7kruNXSTM0xdPMWa5SBbgkIYA304tc1n0h5Jcc5xZ2f7ZVKSZfVjFoU+jozG\nf7533MhqUQBPqQBWPNfMCSxdY6fJGZoTFrx8zYMMqm3KFmfTN49BtyZ2tKGS\nY1QMhH+dI/uxIWFPxOUgx1DCdoW0+NnKTrnp7lB1yrfkKeV2jSbJjkS6o/G/\nvzkIKjWd7T0HKC1QzcA2y+3iJ4pRZr9lCxenMIECgTty5wjLG8QIBUKAwuF8\nOtkaljiTZyaB6ubpmaGhD39HQzeSr9MFvoRiMPUPv42opeFerwT7+AiqomMr\nhBxP\r\n=AB/J\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"1fd3e708a24db2a1ceee3527f9b82ed1f5042cfd","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.59","@balena/jellyfish-logger":"^2.1.37","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.150_1619537271325_0.9337491420243136","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.151-renovate-non-major-434568ef45b4b68ce5442088b475f183eb1418c9":{"name":"@balena/jellyfish-metrics","version":"1.0.151-renovate-non-major-434568ef45b4b68ce5442088b475f183eb1418c9","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.151-renovate-non-major-434568ef45b4b68ce5442088b475f183eb1418c9","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d114a60cef7079be7bb5da3114a2260ec4d68b78","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.151-renovate-non-major-434568ef45b4b68ce5442088b475f183eb1418c9.tgz","fileCount":15,"integrity":"sha512-R3eWze+zPSrlhhOjvK1jVCkgHmjCprUgSh7MTQZ79x4te6cSuvOWVMee8OZLxoDD4xnACbpNIEBjmBTsmkHmAA==","signatures":[{"sig":"MEUCIHZGPbCIxDHn7whqBymQ0TQhYsVAcN++w2NQuZqRHTWTAiEAvdoLjSP2PP9dLk9bgjWOZUUBANyB3HC/CKRA3YNVg2k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92316,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgiUx9CRA9TVsSAnZWagAAsTAP/17lRoXd2zcTWy1V41dp\nAUueIUIklOVC5NpQ7IXKQsNHYc9zosn7iC9Inh17Usbgm16reMoSApiORGNY\nKETTThyDYxsiE06A1iBCF15nuMmie2nef+chpTdXxjf5eUBeVHzjoUaxa+ZF\nKYWfrMVMeNfDPzZ01lkqJio0ptMhR+5j8nihVe8Fl6ACNuiZGJTm3XT18AnS\nBg7yU15RoqP0GrH1Mq9nCXFcEoYj093pyNW4A4PWOs/4MDRI+hk0OQ2KeeBp\nvdZg271svJHUu7hN9pzTkSpTHgmTMWDU8ZYX8QJKcTtgkv+yN1ylQZ7vIjvO\nHyV1YO7PD0n9UVyU5oo86k/nh5j89D21zpojCJ07BnZsf8Pj5Oggl9bT3HSR\nvOENVi8ZeE/z5ckX+kDrHd2AFQJDf8QwcPyrScQkWE3ldi8HjYuzVa3LgDES\nZF9qQjLuXrw6ypGnKp9rv+HEwxMt76zzel2wsJXguULMiVupzd7/oGWkpi/2\nFgq8d5S65UxEZvsSIpOyXIPYOIbxYEiPEjjxdO7MSTEULdN4TBX5hdBPImQZ\n42dViAKdq1cdec3zIKlaPytVT36uqa7KESwTBD+F6tn4VuIujmSDeQ9JUPgX\nHFVoOKNwhl7p8GKb6GbEvXQK6nkTdLFKVmBaYZoonX2iky6KBLeFQZeYPm4I\n3mCQ\r\n=mQks\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"434568ef45b4b68ce5442088b475f183eb1418c9","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.59","@balena/jellyfish-logger":"^2.1.38","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.151-renovate-non-major-434568ef45b4b68ce5442088b475f183eb1418c9_1619610749217_0.5516398129026328","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.151":{"name":"@balena/jellyfish-metrics","version":"1.0.151","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.151","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5f2ba41d8fde5f401fa467984431959e05dbd5df","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.151.tgz","fileCount":15,"integrity":"sha512-esrnI39rMfRL8UneKfrou7p5i3h2vMW1whHQp5f9UGvfKvzTJMM4rvBlAMIW2yDWGx8xvApaoZ1WpZg5GaDpqA==","signatures":[{"sig":"MEYCIQD7n4hjT2LdWqdxQIAK3OZFpyBfZEkEB8M4SKyobCZXowIhAJVk39o49Cm0T2nBZMfKMwrEXNU+ZUWMqhGZOngXgFHH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92256,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgiU1PCRA9TVsSAnZWagAA9EoP/Rc2y438+BsQSWh99Xo/\n9rJ1JggeDziTkU6uN2wRtUH9/vKgUxktKhMkZqgcK+3BdyI/G4UMaA2jIKmi\nlAmsn6D1wQJJCmo9GciUxklCA59vGdLDGICVW008Cr1bSPAqqlQR7rzYCju2\ntBBEg64Q7EZIErtnEOohDuS9RRTH9KEl4Sf+PcvxYoGgSSDWr6+kVivHovSN\nV6fY+rzsPecg2v26PdGk0VibkNN8vxUNbzAtdbffiYPuxWEWMl5t4wjstS9+\n3AVqMktwOX6aPOIasHPynf8RD+Vu4xr/YbHRUuZOGZMUbI/Eb4zm0s3Y60Bt\nhC4mU+8D2PQHiMA7QcJPO2HoY70OvS6TVkguUz//ApZQAHR3h29e/GSXeJc2\nitG8+AJWzDLihGYtNisnqAtEfn3qQJYBi92RPtDLFZo/t+rQFgjyZfEOH4Ie\nCk9FhhvbVpYMPxTR2qKX/Y0ha/RzxcRJPNKXX6TZuWYgqzMXbWWqqjJo4OC4\nk5rYswFIsmosCCLGgRamPFF9xWPyLVwlzoLpNmCYfc7XU5MYeZunEELPUiun\nTLo3cdp4oNY+1g30YhVf4kG+Lehr4aPhs6hJZJTAycJYcxOMbVk2siq1nmrl\nsLQLGyiGVQlfRmzX6KBChJh0E43dP/yyrbZ6MlKWoL8KpSfdx8qsxmuajWT8\nGYXy\r\n=4OnY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e02c27cdaa609cf47a1fb7b60705286c098c07bf","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.59","@balena/jellyfish-logger":"^2.1.38","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.151_1619610958492_0.30772377734241196","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.152-renovate-non-major-3ef428a1f01795705cbe1b6dc9b3cf02a5a2988e":{"name":"@balena/jellyfish-metrics","version":"1.0.152-renovate-non-major-3ef428a1f01795705cbe1b6dc9b3cf02a5a2988e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.152-renovate-non-major-3ef428a1f01795705cbe1b6dc9b3cf02a5a2988e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7f9a024ae4b7434ee23a49643aeda22ac23fd313","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.152-renovate-non-major-3ef428a1f01795705cbe1b6dc9b3cf02a5a2988e.tgz","fileCount":15,"integrity":"sha512-HZro0G5dFsrj+x3ePywlYOx90Uqyj4b7FfsWdC+mIrNGk4OedxoW6QrikIHdNv9EAS9go6ga2z/7j85DyxC9cQ==","signatures":[{"sig":"MEUCIQCEkjs27gJwQbBtWEPJyIQAiXyKLY0RtWXXEO7Kd7edpwIgeibzLiq6DUCrU6rYJDOjRm2mGqeQHofK3MaeWYQf+qY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92419,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJginAxCRA9TVsSAnZWagAAT5QQAJoT1gUEKvBp0re92sNt\nrRbRiW0dBia0QZesjk0MJhdDPbAwcEIWeyNrYNvEQUowqy2wI9pLlbjIrO9W\nvliT+wYSNiYfyKWR1VJz1jMhAexGdb47fUMldOokE/CI+HZlC0cXG+5sKWRs\n99LTwojrqNSdxKmAL0S8w/iF5jWEcFW4izq/JpTi+8zR44eE8g0lyql/fPF9\n1CQWkSTJ9kzN9qR1Pnct5k3bGvltl+/7YQdow2UBO8sqJSD1mGdODNaOG7lI\nDCi5p/cb7qT2EnnSl/NwitnV+w8HVDB6HQ/aUhJGliD2v/SD7cTIuZJrMVoN\nZ2NNWB1TEJ93Dpm1aka2bRF7zI+n2bSDX1IrJUUTwfFnVhxrWAiodLSRQBm7\nRScWaYnfpfoJi6gN1shS0LOfSIX8mfdjmyR/5IG7uTcRdxIlJONWJg5DdcJX\nR27+LDyH3JecTLw/uRdk+/yd2ATsoHlZlfHfmcQ5CBpN4KdFzis0bnpvn7XX\nLMf1g+p8KQSdT6ous8tjn3UgJDyl2CnhB4Gv6+dm9myXD3L8Nt9KTE9qMJ1m\nbIC3ZOTmRODBrEbk7R0xaGMZXkaFaf/KYyAET5mhTJPBOaWx5LpZxgYHWxwH\n+blRPyfM5VqtrcHSacWO1b0+FjKsOwaNHqPqFjjhSflRFQd8bUm0ceSZF1zw\n/Tv8\r\n=skOf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3ef428a1f01795705cbe1b6dc9b3cf02a5a2988e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.63","@balena/jellyfish-logger":"^2.1.38","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.152-renovate-non-major-3ef428a1f01795705cbe1b6dc9b3cf02a5a2988e_1619685424797_0.645017653581498","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.152":{"name":"@balena/jellyfish-metrics","version":"1.0.152","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.152","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c2c49b5863cd3b54bfc9e610f5dff07cbbaf4e83","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.152.tgz","fileCount":15,"integrity":"sha512-DXqyya3NoqmQYIHB7/KgOfWmOpaHBwD8dfK68+XRUJ38OkCpeLlM+iOROQ6Rev99fL1iTNtIllXqjtBWPc0GaA==","signatures":[{"sig":"MEUCICtubOhoZ3W3iWoRBH6g5Mkp7kXBeujaeVNrQ6YUT0eqAiEA+r8UAtpJ4SFQoWe/V87R4FDEfVcsVg0dIjpSs4lWH1w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92359,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJginGTCRA9TVsSAnZWagAApkQP/04lHO4ywnlOqya6rHSK\nhtYEgJ3VKyeO4KUewLev8fyS2eDLyvnY9yXa7zWd4JuFP2+5iup6SXgeesG5\nYt4n/nnk4fFWJ3Xu1DCBNAxpVfos1ANed+y3VVV0fsYTExBTV2l8fqVp0Fzt\nquhFE21hAgl35jgUqzaWfG/ge6vNE9phQIl0fFjPw/XHMH32bQLQYFRgffOf\nNn4i1mso9Y38mPeb7gtwBfplOA07TrEzDRMYCaFjJC7JhUE7jRPve1V+nPQ3\nvLWEbH6GMGm9VgQH5GtUcky88E54njlTdj1wE6lk4A+NSg13hk53G7yeXizA\njc04eUXOjRUrEssr3ICf+Cr7mbuA776Y9nM3HK2E+YYeiVjsrkAMC2P04RCN\naZJOIrajJXaGHxlA2oBJ5Sj7V6CXZjxap7sUBT3MbEo5PxCVijO73/DuZSBD\nJeLlMek8G/1vGCyf5d6z9PiWS9pmqPqv7wSBoOz+cfP47/3GjdWGJgTjsv2d\nk/cjwF4zgRpLeOFuxcTgbnGZ8It3+ZQAWsEpi//FhfzjRIJmJiRt6LmtgMaA\nUiXJifHaiepAcgzF/0rweeDXPStDos28XkwSKZ509WqbwngAbO5OBt4q1c6D\n2jHFtB6l0F7b5QpwD+jpj1nsM32C+3oKQGN6iELnnLSyIaPqpguC8px7dLD8\nKq0O\r\n=zSNE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c7b2325a2c66948be9a726c26cefabc07c62ecab","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.63","@balena/jellyfish-logger":"^2.1.38","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.152_1619685778863_0.5211084155488148","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.153-renovate-non-major-0eb5b42e2f17ad1d282486a36ff5f3d41a774612":{"name":"@balena/jellyfish-metrics","version":"1.0.153-renovate-non-major-0eb5b42e2f17ad1d282486a36ff5f3d41a774612","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.153-renovate-non-major-0eb5b42e2f17ad1d282486a36ff5f3d41a774612","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"03f994efb2c91767fa038486e1f8a1eeeee4c78b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.153-renovate-non-major-0eb5b42e2f17ad1d282486a36ff5f3d41a774612.tgz","fileCount":15,"integrity":"sha512-WnOFe1xJ720Jkp5MmV0hyJ26TDjg6MBWl2bVAb/O7f/Q2/3av5wQYnEaqzr3LHGF8JFhm+yuvcIR6YpSTzggPw==","signatures":[{"sig":"MEUCIQD+973zh6r/ZSonhCG18vzPgOCASHVYJmtqFWv3pQ/TcQIgf667IF24kUkEWfZUgxrY8xeoPg/jsqfVByUD0/JNths=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92522,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgioDhCRA9TVsSAnZWagAAJ30QAIaD2l5l5SqzHpZKOk25\nbV9RuyG/pZP9PqyVAbZgoDXebaS4N3CuFaw6noftqJAXjCKU7aJETsgSeyNM\nHfjFmnLsTD80R+0pIxgKKsh5A28ZkF40rqlt7+BCpJx/p78zaM/LDd1irhEo\nsonNZCpd5+a1woX/wuyqrPF8XUK2x571VWRNSt5t+0Z0YCJVuHIDOlNsq2/s\nuaQw8chKXXFnuG40MVoRuxgqttRxr00Wy5ExkT08xeLbpxsC0t9+LIrYn9Xf\noNgHFRAkDMJ1a+snf0/Kp2sU1x5pL5mJyax008zvzXP+H/ioZTfzzBa5pHlt\npBS1e7C4G21BhsUxX8d0ZRMix0QiUMbLtRQDLoUxK38xHtuxuXtO4OYKNYzP\n59B90ZVo3KGsfMpJP25Ufl4f1mhXfpeiPLQc9TcPUe3z3lGm2efzzd8ILdMh\n5lQOrVlnofGldofs8+Vc8FLyWISGhkwufdJl/uUKVE1EgPUyO3fevJw7PfYf\nCeo2C8E7rLq08D/w+VaTZeoAHaLNeyV6C5jF+hFiHlVU4A7CfjiV0iMLRWwK\nDULXezL/AmZJr3usSbvuoe3plJakQd2fqFMIdwMrpD1wGXAUhPn66V8mHJQJ\n7RYK8ayQsHsH/YGgbBhhbzaxdoJQAuzJyOSJOWvJ8Czi3iBNyTbO88tYfFXa\n3X2g\r\n=5+Uw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0eb5b42e2f17ad1d282486a36ff5f3d41a774612","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.64","@balena/jellyfish-logger":"^2.1.38","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.153-renovate-non-major-0eb5b42e2f17ad1d282486a36ff5f3d41a774612_1619689697368_0.8650414042015144","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.153":{"name":"@balena/jellyfish-metrics","version":"1.0.153","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.153","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"af4a5d3cbaf1a48cb9965040dc97866db578a63c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.153.tgz","fileCount":15,"integrity":"sha512-FZ7XXnHBQf8uEzrzWl9iyhuKJs2Az3zU4x0Yek+UeqoW+1AtfIbWBez5twRupKMNabg2vObUplL6K5r+8rATwQ==","signatures":[{"sig":"MEUCIQDp2UY1w/FodzjPLpom0rc//EioI/XWT6puUXXM/MVOFwIgVTEeC3NM4waigSca/bOi+iTYV9spKpGuUEWUsWhuIcs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92462,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgioHCCRA9TVsSAnZWagAAj1AP/0zQgzEupU8ioo0Ot3no\n58Xsk23kXESLukNyHQKyBX0Ka0X62IDW34EUBRwuf1KoKRcD+oIoaqN6FWNi\nteMihG3f2efjKotpGrQTnjC9eTakzR/CMH5Zd/OGxFRO7nG8cXWflV1ROAJT\nn/Ob5tszXdMAxJhhFTB0JLZFkzow629+cLDYQAxs2s3SyEJgNZGQxEtZMHr+\nQ+H+0M0kzMYjjbbHKGfriQwS5x0gfyp15T8i9lto6lrQy3GALVQ60tDCwDYj\nMUdOX+i6T2Eekv+shUgQYDtBM80CWniH4dKgmSmJvFYwDlyMzg6od1zGlQp3\n9xuApaC4gkCZWlp8vnPNlASaWeFd7f+UePwhqLgG47rHv5+h+7KEn3e3zS4g\nwbInXFeFhDk+95UR1BvlGymHHhudiePk9no9Yr+mP13diK5dNHV/GRsMSUZm\njj1ezFpm9gLpM+eV0+9GkoUl1TncnzXgw/PURLYqgI22LfuiOX0qVXPPpsdq\nybyMwJD0s6RDAZzOtcUnq7Rkr/AgE4KH2cq15v2kjh6uMQJSPd3R4TB3Y382\nz47ppJwFn/9UsoMAOODvX6niQlz1g4GTw8RfYfX3QgpmyOQWpZd7RVwTejzN\nUAUYLE8L41+2EVZFq3D9Pv1Smk7KOO9Pd5bmH8wco1GfEL8ken39atkr8ltx\nsi2s\r\n=fIHN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0e488777311b8fc43421cd6843d54094a9f72efa","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.64","@balena/jellyfish-logger":"^2.1.38","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.153_1619689921577_0.08500872135504434","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.154-renovate-non-major-49e9f8186f14f10da2ef478ff763793cb9940801":{"name":"@balena/jellyfish-metrics","version":"1.0.154-renovate-non-major-49e9f8186f14f10da2ef478ff763793cb9940801","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.154-renovate-non-major-49e9f8186f14f10da2ef478ff763793cb9940801","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"edb5e1062efe03a304313f439b6c6594ccd198e3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.154-renovate-non-major-49e9f8186f14f10da2ef478ff763793cb9940801.tgz","fileCount":15,"integrity":"sha512-3HAEULIgINKLCDD7lMZG8wqSrO3nfcKPIm66nBmVLbtOtbltH7nLeTwnV/Yn58w0CNRgzWMc3X/TnnkxCduWsg==","signatures":[{"sig":"MEYCIQC/vrs3f5WSV44EmDr21h+Hirll6HMVqXTmtHdImlprUAIhAIEwlXA4F4jHivH1HwrKnwtwxt74oiq4WGn8p5rdm2UL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92626,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgipMwCRA9TVsSAnZWagAAlF4P/jARIkIfMEU5+gtN1mBT\n3sY6HfF4UQAf51NllJQRftEh4MEyktlZ+hbCvTdBaZqmsut9HkGFsvxFv8Fh\nEInD+6FU/M+psu90lD7pKFuuoMMISMWh/b7ETOjLZvoR+VVoi0Z7PbFC91vF\nSG5eMlDaYB7BH8OvRBQmKQHuwTh+urEJJadiyJ5DLWjdyhQnXMm6QoCrFy/2\n8jYUmNchatwAwmHLHpAGEveC2DEO5xalUbK4aQG6T9c1GbCSNvUwvEmP2qW+\n2ts2khAu3EF6u3+FAkx4iNEV+YdxU2wBOoWr+aBxGFNR/3iW+Fcbw1foLucH\nw4/FsgkbiQHKzwQVMdab/QiU9Rkm5+rjawJy0OsMfE1ph+9pk1wf1ilK1Jxe\nFht3gA454LheGi0KTK/Cam9C+1Ca9lGyW9yZ8MpwBFuVJVxDKbzogOia1m8t\nEp2Bhm9u/wVZHnYC5UiU+T3DtTPWAI3e4lDLwn8Mg3pQYAFxYoeEPlwA0HGy\n/8ZLTfMzleKsQisx3uE/2FDASmozldnnvfyHYo1KBlQ+oMmOgH6gMwul982x\n755vYuAmRD94TG3w1JHNlVcL8bIMmZEsl29XdjU37ZiaeME8GY/lAS+39Z73\nwqWqQNIJYzDAzSJg1VfWELHBR0l8S3Wvj0gC8t2dJeGKwJnXNsh9V1LnHVag\ndXVu\r\n=wIjs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"49e9f8186f14f10da2ef478ff763793cb9940801","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.64","@balena/jellyfish-logger":"^2.1.39","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.154-renovate-non-major-49e9f8186f14f10da2ef478ff763793cb9940801_1619694384325_0.645486187020168","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.154":{"name":"@balena/jellyfish-metrics","version":"1.0.154","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.154","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5316ec48296ff416605166a8ca0340fa27e31b8b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.154.tgz","fileCount":15,"integrity":"sha512-Nlnf0sky50z8Kc0S/Km1vvuuI0qavbxwsKjqT++LN8GPbrq04EhpEHXp5YNAqfvy/hnvg99lKaN7rtqbguu53g==","signatures":[{"sig":"MEUCIBqC308XRCsKWA4qP8JNkfeoetYNF2Y93jWFcJuSA3KwAiEAv/GxDZ4//ga9hW5TSIYidrvrHhgCJFAdizsYzBJVvC0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92566,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgipP/CRA9TVsSAnZWagAAEtwP/1FzCo2iqTt8m358N9jt\nn7/PhXFZFfhFh5eeBlXDIrM3G5iG1sDq2j+i9ac0eCM6fDXiSbLJcnOn7bBK\nR6oFZ7sgVHZrpNZZB1v5RGH2u9RRcgSuC4Fr59llr2BmLfen3bcfDWLMHSXs\ndba0IhESNUCogG99a1u2rM0gEks/cqbPNg3wZ9PUxkVQhBSsrGAq3gmU9ve1\nkYcIxQjlCa+wdOldDsmCtrYSV67WpjVPAP9mQO/BlpZswM4YzrNAiZl9KL2U\noSTHOqwEvs/nhxofA/ySHNnLQRQq0iUXgeC1gebUwx5ppDjsYHSuAFPOD23s\nTVzcb0cSk6u8sEUrANY3L+P3cLiaFTdY+IjLnP/+jSxka8RTiOdn+wmToxd4\n3CkXNe56PWUkxW2XkkAvWZeY0O+0aIXD3dDtShxCdEbffyBeDPmCfQQ0QagZ\n8I0Wdio9DyX8BWhmSWw6SDpU1ZyMWNGfe/nUhezB/F+/ciF73hg/AtVkFhma\nhZhuoXuPU6CIIogxoJy0EQTkg+mIIVIwsqXr/Sj76h1LAYzffiJDUZm1CmHX\nEsxjEvIdvh4ZubhEppthobdzGFSWGYrcJAtnqihatrVZmMcNPkQAprc9G7+W\nvalAbiWfy3UzfV9kR2YHKsms15oadHJrN/XrYlBj1IavpWwBPm7fXIaJ/3Ta\nxT37\r\n=Tp8g\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5169213be25b485991c78b3e82678b54fff5d14d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.64","@balena/jellyfish-logger":"^2.1.39","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.154_1619694590566_0.6750035400713121","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.155-renovate-non-major-c694ba40b7d29cd6cf51b4263bec074f6733200a":{"name":"@balena/jellyfish-metrics","version":"1.0.155-renovate-non-major-c694ba40b7d29cd6cf51b4263bec074f6733200a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.155-renovate-non-major-c694ba40b7d29cd6cf51b4263bec074f6733200a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e569afba6ba1af89327f3577065d97b3202b6f95","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.155-renovate-non-major-c694ba40b7d29cd6cf51b4263bec074f6733200a.tgz","fileCount":15,"integrity":"sha512-ubZybcCw5OuuNKr8cdNPNFT5Gzr+vIfzdv3m6NLNtXSvvc+1/8ff2q0ebG0epZYU3wuifFAQwhSAMFvw5/YpKw==","signatures":[{"sig":"MEQCID5DSOaTk0QQX1ExXw00YCuzuH33ygNwJqJevE3Xh3qqAiBTTENJoF8wJBTEOvrVwZx9BJsK4xFjfuMAu4JW37yc5w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92729,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgisUlCRA9TVsSAnZWagAAa7IP/3iOhcVx89AA0Q2zEWNc\nyfJlDj2MOPGUxMNrsc/yLs2nV66F2KaxjTaQQObCG2wgw98zPG3Jfdw0U2Gm\nKyAl00qVP37LCDyAZ4hZdEAOiTsTuh6wcaHmRgnp8Bb4QGTQaX507iLFZse4\nC8N5f3rm/niTHnmBiwfhO4Nje8jgTd13F2XWECVHkiY2jxwhBhFfK/vheijY\n8mJKvOcR47iV11g5LwchWf+sZXVug63NYYvIElBxz8Ses+Er3aVD6KWhvX9f\nF/N2m0mkZiVJnj5gI6ml4a+whRuAj5Sf2pB0u8ef4l/yKcnt/Y7edC/gd3S5\n5S/zFYs77JIJyUiAoDD9AMLvvU5fzu6jPWSXdYQzQMh2PMRuakcx8ymaYIek\nNRIKCxQrAb3UI1NUbTyQeYjemsMx4oCATdGwAZRg9ZRK4vJHPKfss5XDUHQ4\nd3Cvjqn/nvgzj4TRszW27a5uqPJukywpgG1CmaATFVWfTwKA2Sy1n7aHcBk9\nIWIFNBkOGsWwMlJ/zH3ykpgaELejCWwDO9UXl7IOS7m+MQAv8o+mluBilRfF\nloKhUzSsyTE+PMGWcojFKQt7ifmDqkAs8kFqs1weftpIQhdScwrnVoCvReJp\n2husTcYvAZhauLoIEc5tjHf8INC87eeDetFTNvwJvQbyOS4RMZxq8t7koNXc\n9nMJ\r\n=AhwB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c694ba40b7d29cd6cf51b4263bec074f6733200a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.65","@balena/jellyfish-logger":"^2.1.39","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.155-renovate-non-major-c694ba40b7d29cd6cf51b4263bec074f6733200a_1619707173062_0.9462628417849819","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.155":{"name":"@balena/jellyfish-metrics","version":"1.0.155","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.155","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3e367a2620f0fb1558206f064f8cb54f527588c8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.155.tgz","fileCount":15,"integrity":"sha512-nfxcv8jwFJkXBUL+WLltSqJOavUKblPj98RsCcAQqTrIbtdXL8knOSiU/FCh9jFscmPn933R7uqOi+toZFmE3A==","signatures":[{"sig":"MEUCIQDo7W/asR1pqoTU0LK0jli5oXJwMGIlwIBSdlVIajZjpwIgP2oULf5DtY6nFaKtUSBATBpw2nvootIQ5o5x4aZ+tEM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92669,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgisYFCRA9TVsSAnZWagAANw8QAIZRCqn4yxT+FnH9u7/S\n+q5NA+4A8IoNsCfJmzEzaKw2veHEXiKOBEbq1gj3W9kng3ADiMK5pe0JvUDJ\nHKenNkKFphii/A2vG7eFgruUBrfH23wiPqq1DyUMHeMY2/zRicLrwHySSJyy\ngRAKDtlnwTTq9In9thXRAxF50shlS1bUJ+0EE4YAZ/TMVhWOa2VwCKHtr6KG\n6SatTuCmDMzv6mMIEGMmvfHP9Oj4EmvnQfaD6h4glfR7P9H2ChtiHRGC+Iuj\nFoD/ux2UXwGCYfdVDN06Si1lvYQsH09nSRvqbNWwkOs0fUKfyLd9TXWqd8av\nolfJLR17HTZ1zTbOezgKBCrSh4FKoursoiITYLOdSR7c21KrXa3u/tImTsZ3\n8ptYJnJd598m8YmriyXEiw7DsGe6Pnqg7Bz3w0sfjcpTFLUzrX5zv6D4PpfX\nDc9dhrb6ibdaTn+oSCrgavZdv1WSxPKSCq7l6aPWzc5lOFmSYgoMpOU8b+EP\nOpU1PtZsHk2R3K7zjDuVmCFTDRAPOtUdkV+MExXMMf9EOgPmTlwBcV2bO2cM\nz+FSFQ+p2PyzgH/2MQP2FzRTYTUUUAyp5ZbMlXuPFnrQLLbr9zqZ8rrK1n8P\nGdutwL7G+7JRNZeP3ZDwBXFnGpKO5zKkMhAiTUbb3RzYGTeOMe+xc8+3+/tv\ntBbv\r\n=FwLQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0c6b14186e91310c6bb53b9de194cadcfdf541df","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.65","@balena/jellyfish-logger":"^2.1.39","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.155_1619707396929_0.6284236431703407","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.156-renovate-non-major-90751efe7bde4c5a625023e4af3ae5421cfad66e":{"name":"@balena/jellyfish-metrics","version":"1.0.156-renovate-non-major-90751efe7bde4c5a625023e4af3ae5421cfad66e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.156-renovate-non-major-90751efe7bde4c5a625023e4af3ae5421cfad66e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7d7d20a0e86a16729b2763f4a10aa7f0ddbe1de3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.156-renovate-non-major-90751efe7bde4c5a625023e4af3ae5421cfad66e.tgz","fileCount":15,"integrity":"sha512-S8DLDvEyIcOzOFuch78kEqB5clPQ5xrsM06TnG4WbTP0wg3e4eJqKxJ5Nvc2s8P4mSlVBDIo0kfInWAgJtiBbw==","signatures":[{"sig":"MEUCIHS2vurkGGkEfedGV3IDd0nuGv+XYchFuwfQR2YhwHWMAiEA8QvLL2pJ+MBCkvSoXHv5bBzPLnsw+buhBsEPjEcD1xk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92832,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgiuuCCRA9TVsSAnZWagAAhjAP/0T4LMtoKuVbW4z+ZMhR\nxMYHSoyz3mmKOuZ4Inqn56F5mttAuDBzmNTYhd558g8PEg5fs6wnynnuf6yq\n2/gVl8hZFDeOku2hUQ/33orVnTZF8H3bNJ2NNGdApS2rMqvnRsYfHKsPINkh\ng555KvTnEV4Tg0Fx3KCMJTWKqmZPPs7akS/9S8/kRAprlP6xfg7kAmzeimwh\n3xHfePfvHI01oLPL08z1Cj47MtFlFf6Ql/rJrQbRKfDhSdSxCYuDgo4sb7gu\n+DsMCCi7ts2B9RjaUR4ZCbJcGWWuFgTqu5fIvt2idrMcrWST4JG77/35P0Vz\nhaLSD7oW+kNDhOfWIqOanj2n4E0XpFPCe4lsfuutudR/y1s5VOqPjv9AhZxj\nHtKi4/DrxhBLLNPMaqHGM9WMHym8auXNXCLUaTLBICAJ8Qdn7INLZIs83gYz\nQdI8WMhlWCAQTsJ+TrvtJssrrQoAlwscDGgwNf/Qr9ugcUWBARlFubY7qR1E\nW/+YkYfXJ7/vbAfVGhgEBa46frQh/wIhV+FNJBZaCzzSHqa4uHHWfvzVo60D\nqhb0zoj2xxPpzQobzK8mRii7AStQwkWTHrFRkBi9vfANkZwLrYjgqPaWukxC\nN5tzv+J2ikn37lMGQguF3BSBRBowpcF4vR7tJ02GVTNLfK5N3nyw9l3ihFou\nnVJB\r\n=ucQh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"90751efe7bde4c5a625023e4af3ae5421cfad66e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.66","@balena/jellyfish-logger":"^2.1.39","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.156-renovate-non-major-90751efe7bde4c5a625023e4af3ae5421cfad66e_1619716993975_0.46214025733560327","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.156":{"name":"@balena/jellyfish-metrics","version":"1.0.156","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.156","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"098d48ffddd2fcc05cb0a986f57b4454aae5e9fe","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.156.tgz","fileCount":15,"integrity":"sha512-7P0qyDBLiNIcE/pSoTd5m2FV2gudah5JLRRjNLwVt8jy+DQRHs00hqY/WcNLm2PzgLo4iPPKYUDXOlLsRQMRAw==","signatures":[{"sig":"MEUCIQCn1KAggGB5FdVumwNTNuxIwF/MNZnP7KTiNm3IqIRgzwIgQyCpjPdud5BiKx5Be54C3bk282VjYuuUjEVlX28ZOMw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92772,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgiux7CRA9TVsSAnZWagAAmwwP/i/qS19VOTInI2vt9Vxy\nuSny06AGWocLbpN1FoVUfmb/77jY8lTS9FqONd+1bh8H4qflGJawYY1xoICv\n+NoXP06DEXIdRD0nlXzT5zo+dsM2Gg73LErvfnqKUAP001Wb6KbDdAyiP5TM\nT0pF7ytCiQw0MNaUzl2oaC4vsmuz54Pk14Z32RvHkT7DFFsQhO8Y3iZ5Z5yW\nr8v2UMvLoNnFW6t6TYkhzBZuaRYeiJf2dlrJZrW3HOEJ/CLLj/No3PvmQayf\nqltOrEs0xoMSy9BasY9WOk2LPzzeKhLgb+KAMZusqcv3qLYMqOC5Tmy85nZK\n1FtSEzO0f/YmkVBuKx0qlHvCMRJcp/n3KG07Qhq4tahGnfC8i80iW2u52dDP\nOzhRoFWTFskciLvQo4R7GVxzzvS0dKRisZ8p9T6jEgYsbebIfOGita7XrgiX\n8AJLJNWHa9E2X/EdaUAgvb40eE8CUGEbJ4i3xickz8AZu2Wgj3mPOu14nrrQ\nx9YRGJAOncb/+Geq9d3strgT0n9kc9qQ+e1npaSFBg86Yj+d77b3WQ3t5CTL\n/gNlgccgJACcyv5vxctnOZarZGA3JT/5BocBbYmge7Ff6N3WrNvIQlD4XbWl\nHzaxCF/H9bdAq1/pdJuFJbCwQkXm+nVJznRDQgeMVJjCFRsi1Dtr+/8C7vyh\ny0P3\r\n=w8jE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8ab7ec9b1435f5cd279d4d419c3f98d7ac7f11db","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.66","@balena/jellyfish-logger":"^2.1.39","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.156_1619717242960_0.1912602017199725","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.157-renovate-non-major-734f29e33b20b2de19ede60a0cce42d9b923f9eb":{"name":"@balena/jellyfish-metrics","version":"1.0.157-renovate-non-major-734f29e33b20b2de19ede60a0cce42d9b923f9eb","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.157-renovate-non-major-734f29e33b20b2de19ede60a0cce42d9b923f9eb","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"995e26fe5ac7d5d4fd306d14d05168923780066b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.157-renovate-non-major-734f29e33b20b2de19ede60a0cce42d9b923f9eb.tgz","fileCount":15,"integrity":"sha512-Wse1WQsLp4iTWRgkmrI4kBTNTchfpyZz6rySAV7n+8JDEkh0a+0b8GIlk9wodgB2oqSWm2wCBTuf6GmiJoGk4g==","signatures":[{"sig":"MEUCIE/Qor9s0+4Lo5mVqpNv0M5BWyBH+dD6OVWzfL25PAvEAiEAq0Awmk2b58YBiLn4U1zDKQAr6/ThdOj5oBibuECTWPs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92935,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgiwhhCRA9TVsSAnZWagAAO7kP/2UE9pvSPRX81mFZ+Bn/\nG44G/dZscbZnKjc0E2WPxNce4ITcAW9Kj/8B1enak78sl1RHTtX+hp28BJnC\nbcVPs/0cUjeOili/EOqZX8vtTuu45GHDQZoGnB3ATVXnkGkUHX9FsXVe/Ide\n6V2wjebpuWh6xNMk4p4c1ldfjm5WobS7Q5CcBDXrLMItlOTtiBn8c8aCWE18\nUx047n4wKvcAuZjbSQ3xdGRmqH2UqJ41twlYTR7UNopfzEqfqBvFdKQmEgcV\nz5vxCuk45oLZaYgeGxdFQoVwX7aN8hloY0eBKHRDfSGMqxBfz1bNV5yFMnf9\nKPglVHpd+tK4MVhPgpz4nGzRq+YBSeBFk+xziGqZJy/QOzNOS0x+L/9x8k9f\nD7/7tR4LiVf6y7q/UUyl4kfMugGZUKZURuxaPiOBR2YoSnJZ407P5ichUTod\nwpHgc2W8k4K2bEragFIjQIEybUihRLNW3mNYRUWE4m+5lVGrdDYzEwqr4GEZ\nBjRZmKqjiOXdErmJviwNCbWQGgmjx63puaufzwQUEA9er3fB1UFmYFNtxLUu\n3hs58XPuDaIouxqL4A1ZpAprJI5inK3vhBrsZPuROO0AGvp1GjA5MNYQuRu3\n7cJ0QZyxelnY4W67dgBQcFaZrLBBvFSWHfyHLXJMa61vZgJ92xq9/jAOXSgn\ntjyV\r\n=UGHq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"734f29e33b20b2de19ede60a0cce42d9b923f9eb","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.67","@balena/jellyfish-logger":"^2.1.39","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.157-renovate-non-major-734f29e33b20b2de19ede60a0cce42d9b923f9eb_1619724384749_0.3391256001416596","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.157":{"name":"@balena/jellyfish-metrics","version":"1.0.157","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.157","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"de2a87b4dee8d85a8e659eab3c05174a2bb44c07","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.157.tgz","fileCount":15,"integrity":"sha512-GBl4Pyo3XWEJ8Bbmk0ZeKE+x3fRr8cEwWCDu5cSx0Sy4H30hw/qKzk6wGeJpg/6vAvi+qFoKdbGn+wt/j+ihyw==","signatures":[{"sig":"MEUCIDShEXD1K5Xtr6gOZKhDqfIJQ61pzp5oIi+yIDajn+r9AiEA+SzYHpLpac1o+rbLFoSE8M8OS7PTjcWU6lBoQWP1pRg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92875,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgiwlOCRA9TVsSAnZWagAARAAP+wYNGrsw8c2v6nQigHF5\nGJKSdoNjoNN62TaU7DvdJn2OmeniRhqtfCRKL+G42YR0rUG14b1Js1kTr+RA\nQvV0/XVDFOcERrTh4gqbIa2Xt1hirv5xdue0EfQGBUeIPgnLp5fSoxv6+ITy\nah4RiyfpZYH87bWJB8EJ3lhGQBlk6E5M1pNMcg+cd+gsRLlIkhFJcEUA98zK\nQxtJPXE5Sv5POsOCwrj5wiOVQQJYpMnX35nB4BIubCNqi/8VXqVKmXAiNgUQ\nyil9bqx6D9OT/PmXT81r7SA4fDmIoP1RNPYxsDUGAKzbwFG1WpyCqD3D9N5Z\nFSlTry1aUix5sw/mqddyBTbpLJjFdlu2O5E9UaCVX+XKoN0OwDpGmPUoHhox\nqOipVeMkIT9nI/uWzFu/e0bAEt2eM30OFgskbg28uj3vi23jsUV2AU9wj81V\nLfnLtuVAv85qjif/OrU4HWCnMHUKwgOghxVa0T3P/zC89Qe97FmpzN8tH12S\np9cavnltEqqc4/0YAzhmy5JS7xZ4Ft2YO0A0EKTPLTBs/XCu+vqGlwztv0t+\nX4hU8TpmNfUvxpaAE77maG/wOHa89tlopVWbsnHpr3256iLtjJNP2usWoDqR\nhLICYdUUUOJGaaCeaR3dC/DhDEGDHrxTUBzpZoFXBJV9hI3pHRF1q4tFMhhg\nCLO6\r\n=XGeF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a60ba4318376c50a4c0d557be861536fbc832507","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.67","@balena/jellyfish-logger":"^2.1.39","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.157_1619724621810_0.1524561222489531","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.158-renovate-non-major-72ad29b72a2f7ffa905e064f86129fcd3fc1cc5f":{"name":"@balena/jellyfish-metrics","version":"1.0.158-renovate-non-major-72ad29b72a2f7ffa905e064f86129fcd3fc1cc5f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.158-renovate-non-major-72ad29b72a2f7ffa905e064f86129fcd3fc1cc5f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0d5de8335f97b81393d3dbd34584b181c7c94022","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.158-renovate-non-major-72ad29b72a2f7ffa905e064f86129fcd3fc1cc5f.tgz","fileCount":15,"integrity":"sha512-IR9fCV1A/hbsYdLAjhX+zC94amHxfzBTQFMSs3ZaB0pSYyYrtiUG5UD3NVVaZ8tirSGGjMyRokwG9fHfoGbFsw==","signatures":[{"sig":"MEYCIQCoS1xFSNIYo3jHRSGqN9gqQ9ORjY85rSxe6k1CGTlyXgIhAPIQ4epVOyhREKUjFjqX3Mf+SVDEL055JM+96irlHWu1","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93038,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgix7oCRA9TVsSAnZWagAA1+kP/2pkzEaE1lguL0Xghcyq\nHZMuBq1+uVfUtvYUbwRqP4zrnVkbQTgD3iaihSZXGfQNoJuLw23saodDH5x2\njMrac81OdtW8EQczZogW0ctmRxqrvIphU7Nw4Y0ZLAfea4Pb6N/wyFo7oH/u\nzLKxE7kfYXSIWB7JgJc2jD/3jfRR8jewhPWMpnY+3b+V8Nd4qQJIiDgZR6vQ\n5TC6pCaMXBdDvbkvDvgden9oGuMQvNgSb5JizE7436xUgU8CSfT73v2W6P/J\nbQAu15sJuEMHiN8Ymbd6hkDlk844QyAI6ZVfnoBpkO9pLhnj0XElwYXDOjtO\n+bQke+vevPwKCZ786eq9a3olfEyQlNCgvPul3e5BRSyCH2AMa0p9zhBMtouq\nGwMcHrVUfIxzrKjZAkfpffe27ijcwzZeEO2Kw4BSo66wRUfryYZ5UDMMqp2B\nvs3xZa3N3i2SKPSc6O0u+jBRUDijsG5ap13oAIbc9svSYR9C/MRkxvVIQh1b\nZvn78t9uJ/k5NKMo6LG6AUJ8bqwft852eJM5FFtmO7/mYsunbZaNtd7mrpk7\nGeLG5iotZCkkXgTOHqoS2BBqeL/lDkBaBbjczgKJCPmbL95QKS/l49WeC9J+\nCunVm3CZZ173klzKidQ6m4nYFPH0xVb5FEjoNg4X3lMditVeKlUSO2l1Cu0x\n76a8\r\n=UyqI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"72ad29b72a2f7ffa905e064f86129fcd3fc1cc5f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.68","@balena/jellyfish-logger":"^2.1.39","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.158-renovate-non-major-72ad29b72a2f7ffa905e064f86129fcd3fc1cc5f_1619730152190_0.41887027235876984","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.158":{"name":"@balena/jellyfish-metrics","version":"1.0.158","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.158","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1b1228d029a5adf553a7c443868610bbad5c544b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.158.tgz","fileCount":15,"integrity":"sha512-OLfzIn7xJxmYSkNekQTsHNU43RA+vYk4lddev6zhf7oJBI9ac6RVOGpYqwKachW+cf3Ax/DJJPVSw/PVvfeylw==","signatures":[{"sig":"MEQCIASyOcVFTfOu8YRlJ+T211NMv0JizqBbqxBt7hGBIZHxAiB4eyX4ihWPv4zS9c5hJRYqZdMK5DP7CIS0OWQ8vPGcsQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92978,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgix/ECRA9TVsSAnZWagAAyi4P/jZOO6VYUG0CrwsbDUGG\n3dbjAQ36YHa1EaGVwpKvTNirjjModYBdQXxFeZcSXUWYyVcwIst7FeTVMmLk\n/f2mwSKF08aUsf3g9YylvM7YUl2pKn1KJKS9OezRpm15k/0sBjBnBrHHhai/\nd6zYksSw/Wgs3lCGHQqM2qr4u8Gw4QDvVaRID4SrjfZpFtQM9Hl2bYyHcFiJ\nCQxtF1AoistJ2r4BVW1L786yFT9KXfOBK6xH/nb7q7N39apMJhyc4U6ceosg\n6E9tY2HyiQ0aob46RZnVaHOfU4Gbd7xNglTRdeBm0arRq2wrqK3V1PnDVdoz\no6U+s8FSIv2q/5vxK5WqDrdoVGxPZDGxQ2KEpPUDfOfKfTXQfPDbyin4/x8S\nW+GC9FAzb6IYzZmxG4UAMCTwxMaf0qKJus9fmhWXrxXLqxfd3dgYJf/LYkxP\n9Rax543FU98hP9TCcoYupV9cLNPMdZseHUK7rPuV37o8ju1R+QRdhZ82s3p+\n7z1AElK0iF7g/Lr2WUu2CMznUZqJVLSlsNweM0GYsREgpKHVv0Amg/fB93VH\neuYnGRFBfJ3EicHf5+FLd1NvgSunGcNJDJRWy16KYgPFkid46z8FWU9ggS1j\nIGytsQIbuWZFiSffQo/WF2JgkUon+txLlk7pLNTCGFR3W2+bZsFd3PPUPV3w\nBHk5\r\n=Udek\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0cd91601714b5541fb21576f60e189e104dcd0f5","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.68","@balena/jellyfish-logger":"^2.1.39","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.158_1619730372316_0.2996657437357746","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.159-renovate-non-major-5dcfb9b9bcfb87dbc795528abde97530f014f896":{"name":"@balena/jellyfish-metrics","version":"1.0.159-renovate-non-major-5dcfb9b9bcfb87dbc795528abde97530f014f896","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.159-renovate-non-major-5dcfb9b9bcfb87dbc795528abde97530f014f896","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"de6a1771ff6feaf28036e83701ddfdc393b4f877","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.159-renovate-non-major-5dcfb9b9bcfb87dbc795528abde97530f014f896.tgz","fileCount":15,"integrity":"sha512-2WG/xF4kIMAigR5SMoxydw9wM+H+l9qXSDf6hUVunrMmb1qEOclS+/e1oK2LYcvR8OmwqO68NDDf6i88EUYzrA==","signatures":[{"sig":"MEQCICBqYPfl9v0uvIdW9AbPQ3uLt4d7oW7+fpPY8ze86tzTAiBPruJPgpIHk2UZjqtqLrkEW2y4WnxZspmqnqdAdHUNww==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93141,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgi2vACRA9TVsSAnZWagAAvEsP/3MF7R9nrX+SJDgAtkX0\nbR3qc/jD8cwZ+iZl03flx6WCGEubKiMf1NHJpE7yC5ymt/WyhsnIhk12ikz9\n+kS4NWfDFGUZ0uvSCbScPS8kusG8HuvJmcH1JKn+TIaEiaYH7kw9wORhlzyB\nuuQ0YI/2gt3bdBGqxE8avupiUat8Vz+tn4FOy019TjHbFiHbAJTmTId4YZYt\nPO+vQpxXC5CRyzEFPR+S5kVJvRc/6xXTnKkThSl89O3EVjJHVIrav/7hNpPu\nxt77yupgjIoVyLWcRg12KYHv8kDYGQpok8XqaYfF2DG+Xyl2c9LMSbzcVEdB\n0xYv4f2WnbxllsLhYFCgvil7Ca5VArLUES/XFnR/diG1AUt2pybtGGQtp9qM\n2oszOkb7RKbuYwPJKvGn+vNqOMkwBiJ6bacTYJyAtiG9SPTOeZPj8YkdRh0T\nw/st4//2mEX2hVh8AFf6kOOd9/iFTB7sP5wMwQ2U/YuuAzDolrptyZGIx5fC\ng8z0qQF4lgLjB4P50oNR8LrF2j81q1tNHgGWCw2dW9kq5j+t8DQUFFbQw0Ab\nRi/TiJosCwHq49kcn3W/5IFJqIOYDtyNM/pi33hKs0ocvfPRJA5WoWoFMiAY\nrQAhUTXEhf6co5BKfOEddxyd1nA2SVGFrcvQJrISx53c20aB/U8iHgq3DsEl\nAf2S\r\n=4uXg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5dcfb9b9bcfb87dbc795528abde97530f014f896","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.70","@balena/jellyfish-logger":"^2.1.39","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.159-renovate-non-major-5dcfb9b9bcfb87dbc795528abde97530f014f896_1619749823365_0.2109358342167078","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.159":{"name":"@balena/jellyfish-metrics","version":"1.0.159","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.159","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"399fc27690eda398767521605a5eff4f3fc8acf7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.159.tgz","fileCount":15,"integrity":"sha512-O+fKtpkzVO6mtw4OnKgsaJxDJpIL1jvpDKcpPU2u2lRokaBx8azkhr+S8Mox//9w+6xigf7dzTRWpbOVCRKpnA==","signatures":[{"sig":"MEYCIQDAIQOOVOW3mDF+2xUgvtlEXJhTQgtRKgVWT3NfXQzdkwIhAIm+bkXO67Rf5T9DAehW/aHjHFXhpb4M9b8cfr1tgrpS","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93081,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgi2y+CRA9TVsSAnZWagAA2yUQAI5ZPIZGyUFoOdzJ4YHc\nIrs1tmEdORFJHKJpoJ/wwf5P/vB6ZCWSjCowlFivLsmn3WhjZ6rKF4joGaXZ\n8YBZ+F0IvnmRwiFwg95mLNT3Tf94dRPdzuPrEcJE8cSxhjfXNJ+dKClGqV+F\nkXNGw0hVo4mXasyf4TAnqfT3pwIAeDJ85D+tw0guSgq3iuHZ+bVhZfuL9wgZ\nGvsCPNFAxhGyJOAr4VaG6YXYEMCg8zUu0+wvGqfLe9IB4aTUGzLzJhkcJDDU\nDVfmU0Q3SsvqKDuDH+EZnX2xq7gGYZIxVNXF6/pkZ5FWF7zJ+xaA9X6Md4er\nrj0eo8V7VsVsNYA7PuIQ4EWf0KhII/ExBV6+fvf5tbB2t/huuuYwTHmbIbPx\nxxz8QdAuXUgi2T+kIlzHe36PfQ6IbTdDqGTkwMBSx6GGmGzJgncorThjMD97\ng6lq3NimQtDU6Umj5fQJeDSypiQNwq9wCbQfIVDE8B+V7sSocTyJ1QGSRes1\nntGDsB6GX7/JOOT6hfCz/h3gDW4Wi5aduXeT+u7uJ8EHhcqSgihY1l3U+cuv\njHHzQ/VT1wuVs1ho2/4gOkPbp9+Gcj+j5IPsEJO5L+HvCA9K3cRDpDgtRL1i\n/l1L/KhNmI8en3UGCH+eBFv/tidVbuByzW22ic7x0qVFnEKx90Lze6Rg4oZS\naOMX\r\n=tj0j\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3699e5b134449d92eee865974149db78cc3ee96d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.70","@balena/jellyfish-logger":"^2.1.39","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.159_1619750078346_0.6074084777898021","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.160-renovate-non-major-e4150c82e5af902d69a94d4608c91242fc50da4a":{"name":"@balena/jellyfish-metrics","version":"1.0.160-renovate-non-major-e4150c82e5af902d69a94d4608c91242fc50da4a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.160-renovate-non-major-e4150c82e5af902d69a94d4608c91242fc50da4a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2b08146078126f5e5c9d2f0219f1d12130efdedf","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.160-renovate-non-major-e4150c82e5af902d69a94d4608c91242fc50da4a.tgz","fileCount":15,"integrity":"sha512-S+uBr1lPXg4TGJ7Yfk72hQC2F8jvyWEOwF6/DpvxksjBV2ccSHG0PTXfuTf5z+/m+eKCToTe27yIcPm2WsKp1A==","signatures":[{"sig":"MEQCIHOdzwhVqTsFctN2UPEaY5vCHVZ7FXazEAbBdWpvxZgjAiAmJWrew61lUoemPeNZq+uWCt129bMPUPUrY/bRruFCaQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93244,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgi4aLCRA9TVsSAnZWagAAoPIP+wbp0ZyiAPpy1bcKcwH8\nzqFtUVfXNrLsY+bsdN7UlK2zE4TRPWxqamlfm63FS08d5KrX60v8bu/WvKK0\n7AzUicNsXNiPb1VCF8ivdw/cZMMAwFNavD5AVIv2VQOqeUChvgGAYyIRi8K1\ndqXq2QWgDi7z9rxIo5J8ZwQGavCXh6eJVe++NM3cxbuyi2iR4dpJlQHFAaGI\nfyuRibImZdiE8BDoqt02IBNGAHJ/ZVxxLKV/5w01PJOIjeYB5FajFuzb/4cf\ns1MeQjBkZDHwpPd9ZY1CA35hjwiuDuzkIzbYIppwJNMCQ0hycs2pXrzsqOpd\nU5glEYGcyEFXJ8GHlLIBvWsbv+rBZRHqg/HFw3WAEhV/wtQdCk1TlHh/7aMG\n1BhREvo0M/AN1vlgqUonIgIJBPaMDkEaLZb7p1TMJfP/VVt10UFL8+hyQP2L\njbP2cUpfuHHGw/bHxORalhHHReZWlcVzOBJ3UZVzqkz5xWWv5otKVbFRvR+7\n+gTKNsxnEFYMlIpKEo+dPJO+QPvW0zw8Q0onKrSkKqQGlJ1e9GvuBSK0BneZ\nT349vzFFP6wjFh6mhURrnjAEubMApeLFOV7UoEIV/cOxfKVbYeu5YfmLBPNb\nLy0kVxuA0SGQbdif0fEH2cl5BhUcKrbTf+VZqSUiC0roNn2rtncycCjtVOFo\nlTkJ\r\n=PKmp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e4150c82e5af902d69a94d4608c91242fc50da4a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.71","@balena/jellyfish-logger":"^2.1.39","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.160-renovate-non-major-e4150c82e5af902d69a94d4608c91242fc50da4a_1619756682753_0.8211943036498435","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.160":{"name":"@balena/jellyfish-metrics","version":"1.0.160","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.160","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"681a5c7233db5c5a8ca8c995570e09cadd398188","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.160.tgz","fileCount":15,"integrity":"sha512-dwL30RX6VjshxjUX/EUK5gTtkLd4pMCs4kI1sbQogzmrmBrVK7Zu3xog3a5uyHi2Ql4T1eSkd/g5bL2wy4Vstw==","signatures":[{"sig":"MEYCIQCLOBnRPFSsSrWMl7NCLCHx23VcEaLXiEGJdXhju4zt+AIhAKTmgnxdUZD9cbhaO9Jq0hVjwR4CNPrkTe6AkKAxBKyd","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93184,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgi4doCRA9TVsSAnZWagAA1hoP/R7sEYsU+nAWqiUs1xG+\n5pHNFlpu+rDo0Hj47tloEksgvEn0OAhTqNehmDYwDJmxz7ckVkaCGMGsNZwv\nEtKeI1jgk9BVFa+Z3I54+NNDxw4rycVRjqTYxMDdv5iI8YJPrgp/qik+nu2b\n6CIyiS2TgOTvtWyVyuvHQ255blZA5vaDhkNEDDO16cS0kEM75xQbMG1lBhYz\nEPMTkZRBuiyndY1j44+xHWWf5zDn7vsJ92vNsScGm3TrONq1V8FGAKZRq3j/\nzdXNQ40gi0B+xB7aHI8R2Uo2vOAk+ovKroQSCX3B5i24bptI/2pQS8GTzauo\nTP89dvcfLP3gbqH75o2kSLbGe8z2NaZ5TGmvOOS5DiqXBuS29m/c10F3wxhk\nxUIipqJUYHvQ/Lq/qIQyN7pt8VjH2RNdtyUr8rHGtq7hQW76JTz/BgG3mok3\nMu3qDE9XPvbrfFocDR2Vz02vdfl1mQhEaHXVLTKavS4NMiglgjHOzTWGQrtA\nXOiOQa4N0O0ZNSXff2ju0J+S72lejPIt06EN9rl1jy3iT42GanN+hC2YyXKi\n74prku9CO+Elh1q/5LK82ZV4jKEmnUnBMKOO0pOexh/khRQGwSTG+HtmxT9t\nP9Mct96xh24zcUOg5QnxCH2AyHoxFh9duvM2JQKmtvst+t6kev6AZ8OnkPWm\nbl24\r\n=IXne\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ade3196202d97a7ee0a4a395fb12f977dd6e8055","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.71","@balena/jellyfish-logger":"^2.1.39","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.160_1619756903762_0.8131299694871521","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.161-renovate-non-major-1805a070881d8fa2c4690dbd852996ff266d1f0c":{"name":"@balena/jellyfish-metrics","version":"1.0.161-renovate-non-major-1805a070881d8fa2c4690dbd852996ff266d1f0c","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.161-renovate-non-major-1805a070881d8fa2c4690dbd852996ff266d1f0c","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0fbd5fcd3ea67d207d2c259f4f381abbc94547b9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.161-renovate-non-major-1805a070881d8fa2c4690dbd852996ff266d1f0c.tgz","fileCount":15,"integrity":"sha512-10DB6J6Xf1IBekVQtnhpewsUzz8hapKEO0qIdYg7JYT9jDoJ/ob9W6OyGLo3Xk68g5vc4hLpnB/f2qR41Ljpww==","signatures":[{"sig":"MEUCIDWcKYz4xS1NV5Z3kGAaS+fcGFGcfm4ksYFZiOEMVVVAAiEAyb7Zjzcz6Py28VvXJrc97i4Kk5gPdnWryno85hsOx3I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93347,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgi7tTCRA9TVsSAnZWagAAeEsP/3oHZ6XuTh1/ZORMh5hu\nHpNkfd7aEq1PK9oFn4bYadNMfE8RdpLwwW1JckrgRrtXkw/9jldhAx/WuuBc\n+4YnbAvPR0M7ediLXGcCh5vr/Eh8gYVzT8ER0VKpyMHkW8nHYV0bs+yrVCql\n4yWJ7faFw7KtqGbkjZVoXJqDucW7n49f9zt2OOnxp/Fpd6YmFFX24eljyhlf\nlt+PzF/if3+cRi+ONT/5UaksK7N6mdalyUF+SB4yxKUUn4ZHM7nYOE/69Su6\nXYalXrrkyUZCQEfL0IYNDFYxXxMbx/P0K4AZ1r3VpOdAMf25dY1j10s7Ln4c\nsV5QKkB4578RloodFv0WH/wvEZvsnk8Qn+HjMVwdtU0zKIJNJVVOq4FrEAQC\nP8y2UNJRsvqKWS1tXmUbIHBSWS488ntGFIKJVdtElEaHSd97NZo0TpiGyIAE\n2ixxcuECyGPp4sKBLpmHQEKLcvYvnQ/jVyLDmr6L6c6qFllzR3nLJTxVoI6Y\n4cTGPv0tFqR7BekD6JIIELRgMl2fOC8l78jVRN0LS6gib0V+p4QUj69AEjLk\nIw2LKy6UtpzYItNMhpQoEwt/4Z/w8IoPwb21ObpoIpDGRocLXwL0YOPkQxHU\nSnyqYa6s5KFe46IAlfd1pJbHu5rD2Ujsg5k3j/R+ybhyXHR95ufeCJyTemlR\nvGO9\r\n=+yF7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"1805a070881d8fa2c4690dbd852996ff266d1f0c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.72","@balena/jellyfish-logger":"^2.1.39","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.161-renovate-non-major-1805a070881d8fa2c4690dbd852996ff266d1f0c_1619770194516_0.320751083506595","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.161":{"name":"@balena/jellyfish-metrics","version":"1.0.161","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.161","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3c8a9629bf85b92528a568f17e9962ba83f2ed9f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.161.tgz","fileCount":15,"integrity":"sha512-jjmt/ibOtpx2EpIE/hcnDIoY16R4zPJvKfCzSkrsUFcZi1+DPgr48iGS0KyCKxMr/BecQEaNGdObc1vq/5esSA==","signatures":[{"sig":"MEYCIQC9X+48iak5IvgzYGcvPGpU2Bin9EJMzEsGWotWHM6j8QIhAKpCaIPDG550XksH7NFf1j1+Ykm1dhN2GEbUeIVD5fyK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgi7w1CRA9TVsSAnZWagAAMAUQAIN1b5Wy14/OlGyCOds+\nb33040SsW3hE53+Y/tePnA/AVBg6tV3sLsYpvYcx2I/Vk90u846fzxPL/sRg\nPNcTNp/n7IcKdN2JdQwSvmux4UjDj74NRkEHYXENrpkBTmZwqZSG6HTimcv7\nAGbtPQqvLJ1aFoGIFObbI5u7H9xmAdRJ2KwJckoEfEWDr4tts03Y+Mf7NPIZ\nANNs1Trjf9ZooqZ9+BnQlvsZOWmS7H40mkwaWW+evXsokzCpb112yPOU8XqM\nYQjh2w7SxLthRP2maqrn4K+81rCOHFgJmMscGBXOay9yx1SDlAhnpGSVtvcz\ngsuefl/pN03WKE9jFcpLYckGyZ0ayCGyO1KUyDiujGkzC7G/SGOG8LSk1rR3\n8NPoAxOsuD88kkOatD04aims/mQisyYoRYFHAXQRYAt9eqw8FMmtaL+oJbcz\ndrq+929F6RW/GjY3hnRRhvzjFaBVEpzjJkOuWR/63cz7FumAWWkh2oCiw26y\nTJXaCvtX3Y6r7ap3hlmN4ftFP1HIq6K1oJzsmo485u/9fkZFMG6xSAE0zAki\nVTqlPfa5Ir2B8U2CKaaoCnZIqjqaoWdYrv4WpU0xIuGNENwkJLjmD6nI2iUv\nOkHvhaCpbKw5v4VwX+t7rH1KgpsFy0Fky/wLRo+V6qJxbA0AfoBKglKDGa/V\ncL7h\r\n=Jqcm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b27d06bbd718ef2eaeea0f49f37a4dc5d915059d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.72","@balena/jellyfish-logger":"^2.1.39","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.161_1619770420944_0.1514586392572197","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.162-renovate-non-major-a868264fd397d3acc7c4e30bd86c9b58c686e820":{"name":"@balena/jellyfish-metrics","version":"1.0.162-renovate-non-major-a868264fd397d3acc7c4e30bd86c9b58c686e820","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.162-renovate-non-major-a868264fd397d3acc7c4e30bd86c9b58c686e820","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d22f344f6a7706cfed4acd9a3a95c1104693161e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.162-renovate-non-major-a868264fd397d3acc7c4e30bd86c9b58c686e820.tgz","fileCount":15,"integrity":"sha512-U28RyEhBWR7IfbDpFQ2H4I7kkAy+1lUbjc8GeXKWk7hevb1YIgB+76ooIKnlmhHgytjwHF08vriGwyf82J/U0w==","signatures":[{"sig":"MEUCIGLh16kAkdwRdzzUJ1BkSqvbbts8PUnBEST3mX08GYvcAiEAiTu8nngtRWXiLu8mFu6Bp+/X7FMfhiS2M3HLk5PxRoM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93451,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgjDZgCRA9TVsSAnZWagAA7bQP+wQ225SIPmAFT3xcMsyA\nCOH1NfOj2Nd3KTVSBdpQEuVQ4iOc69uYmcU/gzydCB9IwCPgdY/YW/yyyGRc\nyN4GRHeYRW79ZbCRro3Y5S8EHcqsIdLLDJDyqSAXmygpR86gsWl0p3H2sc60\nUv/x5SYlvhkv8DxTIYi6lsqOlRKCKTcA8X5VAgZv1gxuTzcfsvndFjEfMpoL\n9/qgpCOicTrWZHb0OKNfe4K2LYskNlt15ZUZwuM+r/MAdF4RQvZkAbyiAdxO\nhUNysD6SEoI/dNbAIvBymDXg07LiPA44NgRBHqdjRkzxBjDXnLvxO+FK3uhF\nzDeRAL1dNUVb2weWKpxDjv8JJh+n6WhgdtS3HD8OIoimDvkB6qc/8gwQTDeX\nfPERRU5VK4aMNmqgveYj560UK7edN5OM9CvrbmQ6dJgNXft0vWAx6oUjJHpE\nD/Slya8/vEGY3teNfHCUZerYHOEeP9Wdq+NDhul6munFn2Y1NFzc4KkZKgGt\nXFisorGKQZzU5jAetjs7FT44NudYSOd9fSs4IndjkEErGEnDscUnminyp2II\nhJeBN6GZN9T62kTpHMwYkALiQxjBm08cyezHgpco2wV9sIkGM7fpbVPdYq10\nh1XEPHcrG804alVlF2ONi3ZWN3yp1bCPynkyZsgG6oZYVbW7Agu6oADU8cmH\nSumN\r\n=XDGj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a868264fd397d3acc7c4e30bd86c9b58c686e820","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.72","@balena/jellyfish-logger":"^2.1.40","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.162-renovate-non-major-a868264fd397d3acc7c4e30bd86c9b58c686e820_1619801695872_0.26793650734392993","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.162":{"name":"@balena/jellyfish-metrics","version":"1.0.162","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.162","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"26e9214048d7b3bb7a977b55ffd77ad533d6e523","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.162.tgz","fileCount":15,"integrity":"sha512-epyxXJ2cvP78pXMMqXNckzlOR5eBqH2nfLsGDf/3O/hvlOQjJcTTMnHDEjIzWE91u8/SHHzVJcNHkRjiCMXaSA==","signatures":[{"sig":"MEUCID1dqePrJttolo4xGk0c/WUDwCdyaEqjHFvNk4HVX7DJAiEA1N7QubpYU9IDNrMFU7ybLXNM6WUtb5jVLfWF56R3Ahw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93391,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgjDc3CRA9TVsSAnZWagAAQlEP/29lBSHtcr8Zt5qPvPTA\ncWzMlMR7FQadC0blOj2JcmsY4sVg8Pa7GRBh6k8/lV8bAexksxqUaEXWfk1A\n7a+9D1eD6udm7Pz5z7+itI8yHWDJHHjDrxT31jScw7/DfJLmdPscZEDikXyc\ndONAuW7Z8JdLZWJWQklm1yqqk8DCKj+S90RjIvJ5yyrjK3Ud87pWPlPdbVbD\n23HQe+xy5YADNwH4Ko9SKHS04VoFdiKSZZQpQjE+Y09+OmbU7JPjiN9SbTMB\nNUm1UUr2XxrCeWGRRJe3CYPSvMxb0Up7YMfvTPl3WTtXkSdCjperwxglE4vl\nYpvt/iUP79rFfQU3AURHcgTJwyLHYVih2Cy7KJekfjiTWEYTo2QTeBVLqX7O\niXqA2WXz47mCc+fnxngbBFXzfc5zgSDT3Spdn2o40ZBMlezNgAVT1MiFsUY5\nK3ItxLS4cQDWt52/wvpTI12wE0f9TTKcFsy4GSYj1ZTfVnmd2+EUAuJhb/XB\n8QrkZUyVP0fsWELy9+k6s5XWSWg1Vt3/kT24BZBDUwdo62nwD2eaDj/qzpTZ\nCo6l0Ifm73x3+JgGXaBSTcUMoOnCvFwELMxobD4gxzUohG2LFfv8zy8YBuPN\nuPCBRucMEVuw0/Tb7r9q9D6xhBWCn5+ZLs33gY4tPsf45pMaA8GXBGxdwPNl\nmJjL\r\n=wrrr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"665ecda1955841f77aa11b61660a81a936e5cc76","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.72","@balena/jellyfish-logger":"^2.1.40","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.162_1619801911484_0.26236302506234144","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.163-renovate-non-major-57c492761467ed838ab47819eb9c8a42a1172784":{"name":"@balena/jellyfish-metrics","version":"1.0.163-renovate-non-major-57c492761467ed838ab47819eb9c8a42a1172784","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.163-renovate-non-major-57c492761467ed838ab47819eb9c8a42a1172784","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fc712ee02b48be7e312a43ae98de9809a73241e5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.163-renovate-non-major-57c492761467ed838ab47819eb9c8a42a1172784.tgz","fileCount":15,"integrity":"sha512-BzImMpVycS5/DDXb+OybbgvwOKNxUhuNUIgjJFGbE4fWyDhhEqvLeTzhtvpbsisf5OGt64t8I73SPMow4jLXVA==","signatures":[{"sig":"MEUCIQDT9JoOS/hRiAwpXr3F03TQ4O5EOcX2vulHIcHUkoeviwIgTCdE2Bohl6DxIAuafX9CB8th2H5J+wUTS1eL155Yee4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93554,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgjKpkCRA9TVsSAnZWagAAPkUP/2KKsxMBOvpXOapCv0Lp\n1Zlg745i35iwdKp34xWBOCfSHikxhNpmYWKEeIjvz46OxIQnonoyNmmKHbTW\nDtnO7wu0Q9VZm6Aisr2WlUtg65CjwztOO2TOITd/HXT+GjNaxzGWMReV4NXv\nATB+SFj8ySxQVSYjkQd5WI9ThWzlIG22WIAnFo8ubgrH8FSZL8/jupn01qtv\nVtbUZevgPCfAh7a41uHDm3elc6Yg4PZ21B6yL77rUm4C0uEb27vVtruKs5OP\n5z+qTg315cXEYL4tRNHnAhcyJ4DUPFJwbi5yflTL3mQCC5Rr5K8CoYV3ayeN\nlSc0gmXa204JhVDNRrCcoyS3kSbYfZkXH9GGnYf3xReE5d3AiEMEGQ2CO9+a\nCLjkNiTtokJbwWXJqI8u1G6zGSwSkl7Nj5iCM/n6/HigQt3Ng3suerGk2JPP\nlYkAXhq61INxBMYQG9MHVSGXGjUUI2KJbGt/mTQfGgiPv5ICrs+etp0Zxayk\nW9AEtINjU4cKRYO2tnSacxgTjWUfG2JOEHgz1kpsbcHN/FWmYYYAz3feGSkp\ncMmS3J+aTPiyMyI4Y2ozbNDNQ4jjzUAV2qxDJQcFTptQgqKbldhK5Opelj0L\nEJHroXpsrUykhgjtXSFndeUVApHRbAyleV2aqR82ulTARd4kO5fxIrrZWW0d\noitY\r\n=n+sK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"57c492761467ed838ab47819eb9c8a42a1172784","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.73","@balena/jellyfish-logger":"^2.1.40","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.163-renovate-non-major-57c492761467ed838ab47819eb9c8a42a1172784_1619831396145_0.9682870157276171","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.163":{"name":"@balena/jellyfish-metrics","version":"1.0.163","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.163","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c66b440c5040d6cf30bd0d0f50a4f698be6ec685","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.163.tgz","fileCount":15,"integrity":"sha512-DB6rOMCfyqS1rx2LLCKWqy0A45l02d/JA5gbAktT2Etldtp+9vWSbvGuzbdrp2a0qQdpcwTuVhn/SjF6P4WjZA==","signatures":[{"sig":"MEUCIQCUVcKEEAhh9dZf2g4yxJrYddly9dghXeT04pLamGx6XgIgL99r4zS4s6UXZUgpXV/7b5AZrJmYbngtmjROI0zElmE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93494,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgjKtDCRA9TVsSAnZWagAAgJsP/R8hEk1bqpnd+YXpXQd5\nbSJCbY6LEHKscTFoNmq05suAlP4qnIU+i0C+OBX9jb9SED9ykx+gKi4vD9Qh\nnXlPmN3dS8t4hQgNkVGjUZLoKn5EKmXxOn2AiplXOiy6ETP4q921Rj1CgSs5\nsHoxz3OkmoIGKGLT6HmS6KcC8iI710GXUKGyqJhGUJnTgRVFIn3kz/6YAWpF\nug/sjmnSL8WpvwoFsPOADKTx655taYeFOtQ/wne8ZdZ8DDzgIadeTrMd0Cia\nKva0PbV/DtRsIMCuclP9rwzK5Vyrq49S+SIIvvXYT4I2hmn25npvYePAHRu1\nzzBSyx7sC0fjKU1RUAYsz4gb5gggLeIGJywGYBm4kQr42khYCY26ZcJIYd3w\nKcFoWOHRUnfgWBmnXLWTfFBKVdX7cOlneEpMgW2+E6P1AqXgLMQLCC8RSy8u\nPIzAoj9tpyMIKnVbA91ob5X5z+QvlTEcLx9z9AaTaD5XCxXOxl5CkOzT9aga\nfBg4DPFcNxScOWGnSap6dE6siRUiOi3vrUR7TZjGBgx5P6BEnMGHYQ6CPFCx\nLwySLL4KxL7LBMSTdouX28MwYr5vvA3/nXVP1DTJPHDSRI+NYeOWeGs7XeUq\n0taX32PS8OgmPQ55gLqnhBb1+jDFob96N9XktrQzKJZEP6g3XiKWss7VTqgb\niars\r\n=3TeD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0d1075d3a4e1da9495a57a6d6e19f0be7aced179","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.73","@balena/jellyfish-logger":"^2.1.40","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.163_1619831618885_0.9607526982553078","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.164-renovate-non-major-81cb5c05090a6786736def20ced567e6a8da1af7":{"name":"@balena/jellyfish-metrics","version":"1.0.164-renovate-non-major-81cb5c05090a6786736def20ced567e6a8da1af7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.164-renovate-non-major-81cb5c05090a6786736def20ced567e6a8da1af7","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7cb67496f8db4848572069d883652b90b94d2810","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.164-renovate-non-major-81cb5c05090a6786736def20ced567e6a8da1af7.tgz","fileCount":15,"integrity":"sha512-AHRMwqe0/XGiYEGotCES3ilQibyBdSoiY+yubCmFYPTkJDEN2yBJB5laU6Epr/DQux1LVPt20tbhH+JYj8/bnQ==","signatures":[{"sig":"MEUCIQDygiShb6y6YoBGSmNyCXuiFsy/RqfCWyoUUW/0e0LwWQIgYVurlqbXwtfmlnLYC/b5R9T7FdwdNyKd1HRardM2zJQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93657,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgjM8XCRA9TVsSAnZWagAAB5oP/1eMiR6Vct+xToUOVFSk\nm7dZrsGIrqyX5JFMsnEp8cahGQR9mM1J5sgU+r9XSGaqizYmLPRJTkFnZqS8\nSPtTCRP6kpgcez4xa/lUq+a8QKZKjzpfaDhfsY/qt4PzRnGRt5kLTOCbyZIN\nJXMBIhVrA9QUsFAJYtgFNfeX4Q+iQDIkp8r66UK29t+FrrCznd1KJ/r0JJLS\nka4RdGpK/lvEpTGcQUYUOooDvKS0oMXUwDmy9R5cIh7qeZ174VpuxsPQYBS/\nHOYJiaEoQnT+oET+pYZfOg54SsIpxXlRAn6FGHhSwQWzXQGVqr9Gm0FQOsvZ\nvlQClFQQPGGdjZM2tvVmD8WS9KDjrwt2gqjSjX1Pmq2bqATt66ecXpQuxb2U\nmYqxAJVnPwgxh2pNF+66zmeXUqqyBIMV/iwVKGHmTlXXK65fUC0HlasHp4gM\nTQDpm24wJWiLIm3TkJ10kPTu7UhPnVPVzUqiEnigByOY7ewBzu59tVBkuTX3\nCMyDKhN5MyYxAVxS6l4mdjUW98/vzHSH8pn9lX+EH/dAIqEVyI1I+ClG9ZDQ\nCdnwKd4X5ElauNoD8AoqWWXPNp21sSf6t9DeNG96orwi9fOweZ/+DsBVPdxG\nalFaHbp6+4ORobD9y1pedfsitde9xs90Ae8SZ0mCn4RLtqqOAxSQVvKtIjMd\nSoyc\r\n=f5l3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"81cb5c05090a6786736def20ced567e6a8da1af7","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.74","@balena/jellyfish-logger":"^2.1.40","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.164-renovate-non-major-81cb5c05090a6786736def20ced567e6a8da1af7_1619840790600_0.5306556113718404","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.164":{"name":"@balena/jellyfish-metrics","version":"1.0.164","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.164","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2aec357f05090e2b2cdd9d4def84afc8ba62c42d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.164.tgz","fileCount":15,"integrity":"sha512-drkQwROmeBdzJNWwEuWvk53LHtT4LdjLdRqoZndOeMbDwE0wis9LT+hLOYxygqVUkwncwkLG0w5hLsnVRq853w==","signatures":[{"sig":"MEYCIQD0lmtElxnLQeAOwnzOE+GJ2UrM6JwRaRl13Ff57z4wQAIhANDPV/Ni3NIfZLf5xGr+OYKpj9zEJw3rUOpVCBH6DIiN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93597,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgjM/kCRA9TVsSAnZWagAAatQP+gOmFk5MQUkm5UFYdgeE\nCaP1P0nQCXV0uDpqx6uPBRBMfIIduuMK2lJOIHeJKXWB5fxQhil0dvRmPOvc\nrFPBZop6s/Bf7KYhMbuQ84HcaS+2p/oGDmTZhYgMLmBvvK+mkharcVFXvkgj\n4bh9zl1kugN2nCqYW/cMhbw3CCr5qR0jC0eqToU7iMuUV/2G2QY80ZBlo7cQ\nnSp/dSPcymvxZ5wjwKxEhW0wW3AIkkO6n9954i0B9kZRt0BPr+fp1Ix6bcp/\nlbkL4rNi7C2aPFwgoKVg5T3pHLc+ySQjHWRV/RaFhi4/VML8mLKCnpJQ7TN6\nzqx44MiYsxUEc1FHSLgI8H7iTWPGtDh5j2fHD1Hmok3fBhRFq49pMlpkATaJ\nGL4zIGEAlnSAKV3uLZ4A5RSY5qhtZ3WDkwgKc2VkiAPuBKXgMLbLt6JK4eRo\nRxjksvvLqWKhzjJdJFkbjImutvcAtOi+cVAmbht6h6mg0bYnxl7RvbJMpDwK\nNIa4UqKZEBlYk5CiA4ggMMWhHWUBh2aaBjf244mnuUxDBoCjvtqoy9LmcoPZ\nh1VhlcLApatXbmcWhizSslZVgGPJjn2GjtOPdbsI8uX+FggkFD1SGI+hj6hT\noboMBO8Akv4nV+R4dK2pknzjuTYNppbHaCWo0ZeXVCaYzY+eLIkfBvlQ1HH4\nORkT\r\n=xlXQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a487dff2470e54944cb520336b5982e8946e51ce","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.74","@balena/jellyfish-logger":"^2.1.40","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.164_1619840995672_0.2714104872318841","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.165-renovate-non-major-bab6516eae415c08919ea69da7f97e344cf8ccf1":{"name":"@balena/jellyfish-metrics","version":"1.0.165-renovate-non-major-bab6516eae415c08919ea69da7f97e344cf8ccf1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.165-renovate-non-major-bab6516eae415c08919ea69da7f97e344cf8ccf1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fefc8adb5cb868ec90745aa0ecbebc9a86508210","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.165-renovate-non-major-bab6516eae415c08919ea69da7f97e344cf8ccf1.tgz","fileCount":15,"integrity":"sha512-Sn31+EsfJof5Y5isWaR1x3+evKbKrK+IuQnacGlzF75UvL/JekIXiGwks2L+6fJUQrI1DLi2rYDtt/cFQWMF5A==","signatures":[{"sig":"MEQCIBvFU3b7JL0ArC31zR6w1n+tPJ9jl1yXgeBku0lNSr49AiBx/s0yrNl7dZvBesTO08qmRiPN6YnjpFrkSdEui17Kcg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93760,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgjRZMCRA9TVsSAnZWagAAG2UP/1I13UXpc4gnN6X5f/6t\nT7JWsYCdmi87fYEgHw6O1bdeXLoRByTndJAAO1f2DCzBr0DIYdAY1zIstrqx\n4PE/IhuYviXQto0e9G0DwNkZcRpEHpLvBQgbrdf7dDORO/Jav5UtPW0GZFqP\nhAt7hYqWogkdLFoEKonXgCE/EMZM0n7vbqNYJqUXDwTz21+Dmn0YnCZZ5Lm9\neDxF/mGNCSk8/vN0JWEQEv8xIgUgX3e9Z9uwc+0svPMdUgjmNnRKp6LYfZgq\naAIa+RDovbusMAxytIgQXLZhCnPJqwPj18VoRjI1WUGAQ2+3ZR0IbT+PCWW6\nnLqIzcmQWc6Y8+3Ibgd3b1NFRFos0HsDPDcCTqedApmdeDh8+7ICQ81zOhvx\nbNJm7Hni1tJ8TtJfPKHecl58WLXg10zTPnpnvbnBNdM9QVkRK5oqqRtOenWJ\nMLyVtpVRqh0nJGT2cZ7ZwyW9Q9AACt8jxrJXT3YjKKarCMoFZgiAc98fH6IT\ncI/NDaTmZkRIEWFRxmSgKIBjMfyQuKsx/t6xnPKUA0VBtdVQHhwsai705O3R\nT7m7BhB45fG+FSwKHgqFSrOsbBO2kAijGjDz1fzFKGuUYB1MbyK/hQ7lTuW7\ndqzNeXGTvQmYxg5AsId0m4LxlvyjVRvqYu60q6LaOU598wl2K9c2kz2FnLFW\nGYCK\r\n=UX35\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"bab6516eae415c08919ea69da7f97e344cf8ccf1","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.75","@balena/jellyfish-logger":"^2.1.40","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.165-renovate-non-major-bab6516eae415c08919ea69da7f97e344cf8ccf1_1619859020376_0.0460696933373681","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.165":{"name":"@balena/jellyfish-metrics","version":"1.0.165","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.165","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5f140e2e4cf91bbe0ab62a4bc352596705be715a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.165.tgz","fileCount":15,"integrity":"sha512-968cXH/yUg73L0gDHA0xPJNRjrg+BiT78dS0fsFJuK2hvFGBIxc6+q3cmatoXP8HyiQkiQHmFeBWzg7k9mCtxA==","signatures":[{"sig":"MEYCIQDcABuffyRxzfzve9al/6ql82BqjYmtwAn5RfyA2UcKcAIhALwjUw5QNx0fP3GQoC3X0XDU0OloiGJso8kpcctig8Sb","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93700,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgjRc1CRA9TVsSAnZWagAA6XoP+wW7vpHtYHS9K+OIvC8d\nRWBDcb5uQt1nOW/ldfMQDMLzfDWOox2vtRRUYv8F84ahJ1ppQ6/2LkIxS9nn\nzDdosKLBmjqTDVR2V2gmbYrMvfpBOR/Ea0GrFeeRkhj9ppStXYFcvweYKlVP\ns32PWy3ubHrOrDuoTDkb3ovcCzVOcqa8L8bNPBrAGGefVkyMB2WoqWS9Qtgn\nmDdv+Bw0IBEkMperFeVE5bavv4pl+mng06XgG2cdaFJ6AQM3W3aEnA2pvEfD\nxeVMC+kZIrmEwvsdt61Bl30bDjet2Fxhb1CD0Pz8i8lGB7FqhvFiSmb90Kkm\nuz7jsXiQHYPK/6t3H56msdu7ILnWgpEn67M4jEek3/AJmaPg8nX+W9qKWs/N\njI29UX1dH1QCQjrtV8NfaSaMhKXlC7PmawsmRl2KXidBTRLz030FcuLzuj08\nx0dFjkwEfjoePXwC13QkPOFuRLn0776Jbnh+EFxBPDgiPbIyvRHVqyZu+nZ0\nfTIxDTswSjfJvGLaVl2Lq2VwFtkNcVK+YyyumQKEi0h8LjOABEhh9S8Ot93G\n2V64ABMIbYIhHtQacRunIej9XRL4u1mAnEsvelcvcZR/ls3Ca2rkudVhhnFO\n3iwbg/7jFuLPoGhx5117tNx6qyHPhD4sADRdhdYqrIsPYoozWr4cBR//aQhD\nzmj1\r\n=OUH7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"cec9a3b26ac7aef3fbc70470d69dc9614d013f3a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.75","@balena/jellyfish-logger":"^2.1.40","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.165_1619859253336_0.23253491118995906","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.166-renovate-non-major-96f0290bd113406e543b043af2349bbbe604062b":{"name":"@balena/jellyfish-metrics","version":"1.0.166-renovate-non-major-96f0290bd113406e543b043af2349bbbe604062b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.166-renovate-non-major-96f0290bd113406e543b043af2349bbbe604062b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d47a4fcd6c0f6d0c5bf2d0c6090c1756226a6238","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.166-renovate-non-major-96f0290bd113406e543b043af2349bbbe604062b.tgz","fileCount":15,"integrity":"sha512-pKIEaOkGYuzkbI+orC4+DsBewmDMKCXCi1T7ZPDgaBOqhDXme9KV3N4SavTV90k3Gv1T1hOQBP7J+HnqMFQaiA==","signatures":[{"sig":"MEUCIQDqTrPFCfmRipZpuV/54/VL/N/q6Ef0+K6fcG571pt3LQIgd1lJV0MCgE0NRNw53Bkueu4WVvmeiFmnYx8jJLjeU4k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93863,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgjUkxCRA9TVsSAnZWagAAOeEQAJsceifx4T/4Etp1eU2M\nHU1tMB0bFgZnjYM1+d4OwwLCkqpPG0YH0uLAFo9lzQqIz8t7hM1ItaUW1W/A\nUrpT/aJ4+TEaWRKoX69tc6kJv7qDXBZtyojl8Gm0i6bvM9S/Mzh5JxB3E956\ntQ+ra3Kw/27undBhgS7IshtmvaeVmdh9QJt5ldc9nx21wTiHcq0LYyiYAR6K\nC0N8W6Yp3WY/Z6vuhdAkvG1GxFKjpAgchltwnZue5bLaSpM/G3PY3wZxVG5G\nNnI62gDvV8ImrEGv2ABKqrdbO7fVxSnYcxyfo9Kybv/bnaNQ6kdgj0Po/0zp\nbEBqyy4nB0BD27AQ4FuCfvikaB6+zjeV+GlEHOUEtG0s67IHUcgVLJqKdKD9\nyek38RDn62uU0euf/XtIwlVDa7UlJmRhL+EVYQU5IOhOLh5Xc1soZxbPWvnP\nyXmptrwXxgNgCzZ56lhzLrW0cE0bU2QmD/hhEoUfrME7jPwQrEElIRhfHwOa\nqyOG4kNzabrrgvb2sWW0jS8G5myVZ9RXOR7nt0C0iNtjpDVYUWOaAXFR0gV2\n6Cs+M2cNovgXyQkDlHPoooA55Cne1Hj9jRHVvOqIUHnui8r6ZVGJ0KocMnOR\nWJAN9cWQz5gjS8M+EmAjSV6j/9Gwwms1BPYmjrj2DKYW07cyvQJzFQUr3pbi\nZVLU\r\n=va8F\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"96f0290bd113406e543b043af2349bbbe604062b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.76","@balena/jellyfish-logger":"^2.1.40","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.166-renovate-non-major-96f0290bd113406e543b043af2349bbbe604062b_1619872048960_0.5106276586496166","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.166-renovate-non-major-2fbf50fc4274930d20eabdf40d663b0a469add45":{"name":"@balena/jellyfish-metrics","version":"1.0.166-renovate-non-major-2fbf50fc4274930d20eabdf40d663b0a469add45","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.166-renovate-non-major-2fbf50fc4274930d20eabdf40d663b0a469add45","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d1bb156730be4d971ad7d17153c7977d93e490c8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.166-renovate-non-major-2fbf50fc4274930d20eabdf40d663b0a469add45.tgz","fileCount":15,"integrity":"sha512-p2waMYI7TGCwxwwa0IqBBBnurYsUyLtqowBtPExnmNx4At24yX+2eJTDGsj2IZD9piPWNJCKRshOQuaecCviGw==","signatures":[{"sig":"MEUCIQC0lTL9cX1LqC9S3NXTGxjmyDu/4sGWxKh7jj9hM64w1wIgJS6FezAs1SxKdVR7MYGTp2t4XV0UvdZQM9JHGIl4PwU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93863,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgjUpbCRA9TVsSAnZWagAAaT4P/3U2M/LtDd/JJUeZIuID\nr3k9SVRKMlQwWTGoA8KTrBMJYtEagT49rzwKLkjDw+4LrhBvSNhGiLkt8+g4\nws/umJIei3gAz9DNI94pqExBd26w+URwdmwgemrsoNOXY49Zq7L32TSAIvn0\ni7I/QBH/+tthR8I7VSfbKZMjtcPfxtTi8SmsOZBWZAFK/N/Z492pttcNo87b\nU63O/KLKfeiRBtKfAhDrwyJbOYyhVEjJ/TyaRaHVc7TRWI1RQxUvMmdXJZ9S\nFlwJIE+/FZyvLpwYkjsZ4sg9iaP0sUvf/Dcx9q4X9+R0kfyqauO7X6tevoHs\n5glpc4/0UDGv4D91yt48b9e4sCgFsE2CCOThMjgFNFOfSA6Ch33f7jJQKAdx\nCeHS6H39+8V5Fvcsul2HfLtdZljx1WMaawbmScK6rXUEwOx4zzmqU03PEsax\nOg6Jo+vKy9cLlqxtZ2bCYzYPSig/CCu4UWzGptKi8J7Tycg7Cvu5TQaM/YbB\nMnNDlSYGJdOQmCu0WBdHygUORj2YOEfkEpXPNvhDAFcYmFLjMKrbSJenQ+z4\n5AmwTL8k5cOYuVhWsQAVMNTeV7g3N9XmBUeSa3pehEHezAUhQW2KsbDrkEhg\nWoq0JtKyiki5E+FiJbiFZtVaQMcLbpHeQ1StdExqN0FVJfZnPt6QRhL5BKRQ\njhyJ\r\n=+Tpn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2fbf50fc4274930d20eabdf40d663b0a469add45","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.77","@balena/jellyfish-logger":"^2.1.40","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.166-renovate-non-major-2fbf50fc4274930d20eabdf40d663b0a469add45_1619872346568_0.3837006617813181","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.166":{"name":"@balena/jellyfish-metrics","version":"1.0.166","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.166","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"11e7845c75db7eddf66632742c4e2f19c6952faf","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.166.tgz","fileCount":15,"integrity":"sha512-oKvrAcQk8Pnvv3FSwqdcc+nRU1H3WuLQuSBSfyr10vSUIMUZA6kEalyla8fq5HEDccUuqPiAM2egkrBMHbaaKA==","signatures":[{"sig":"MEUCIQCIqn3bZkl751LrIcqlpJBYGcaqW00gpeIiuSN6k+WQqgIgagB2Oirbxzya5gpuZ+nUFLKyKleTO2vfWSr4PEJq3O4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93803,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgjUs3CRA9TVsSAnZWagAA7l0P/ivMdtz5erhoEKT7h+Jp\nOKkoyEP1kF4ov+/1tOgOt8fvN7vg3OeciwROlaV71laIHBdPqbmKc4bVxkJ2\nn9pMoE88gth0xnh0CP3cbKSTYBaTA0hI5yvwgI3ZKFOUuzXqvNUidBT4EceD\nwXpM3urzPV1A5BQPJfktGcOe2Salq09nyb/VAR1gjWInw4uVj9A/biR29RNx\nX4zHjD2jdHtmdXefRabSqiYxDnrLBnf2iuLKi9axsWiix6xSYjuZRBQg5atr\nU1k2NPtuOTE0MtuV+PQA1aUZ26zNjJhpY0adklrc4wTElJvxVEnWKzK3BOjs\npPgRHuB4yZIJ2zQdx/H1P9w+LqisW+0ebCjzwq89CBLOHpPkA4/SF+zcHPy8\nwABSiGFyg8sSL52DHj9Qitl8GPBdsWYljY4ztSg7F+jloO962UhAFM+MHm82\nnvqQ0/th+IMfqW8J3H86c3GTtdRV2h0wg4g1nyfceW75pi26GBnzLPUT5o2s\ngBliVc2BILEkeNx99XLQ9B9groh7khpDTImIAlFeT9BJCA3CiAcK7WxQ0cgF\nMAfPH0ilKKok5KH9MEf34yzZJs2MKyXOEjDN3R1R/uw+NcOjQHsX5XUBZPJ0\nDCB1f5M0XVZAm7fzU6n0wUfvD2RDc1JCgKYm8p53D4NwO10VCqIVWnBYmRIn\nIMuc\r\n=xjut\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e98dcd8e2671711d8c7a220ebd7fb37e7e06e496","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.77","@balena/jellyfish-logger":"^2.1.40","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.166_1619872567123_0.7084389420134802","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.167-renovate-non-major-cea97214ce464e4eb47f5cda1ff621449684687d":{"name":"@balena/jellyfish-metrics","version":"1.0.167-renovate-non-major-cea97214ce464e4eb47f5cda1ff621449684687d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.167-renovate-non-major-cea97214ce464e4eb47f5cda1ff621449684687d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f2a25c16c90c745e6f43ad6c2a8c9b1fa295c54b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.167-renovate-non-major-cea97214ce464e4eb47f5cda1ff621449684687d.tgz","fileCount":15,"integrity":"sha512-UigXSC95EzthiBn9u6wgE5aIqwLIh7gKtM8MaBnALPaZiTpnHYS9voZKBlc2h4FxECF1rRM6LxtXdwvjDuBffg==","signatures":[{"sig":"MEYCIQCzDT3wzn3fK0rZRYyMhrrzHGLb3NMO/Ih/fSVrdH+5ZQIhAO9KI8qFkUFgL4qYVQ89nKaCIONinHkOb7GXwFQ2Dlsw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93966,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgjXfuCRA9TVsSAnZWagAAGDwP/2LVuWluwJ/Adp1DBE4J\n9AorOKQAKhS/f/E0D39V3lAWkYg+CWvZTsERPjAooN3V6BVByNWrd0LswZ8a\nspcNlQWKZs7bvqbQSNyK4VXlHRyhgEApCq4gxYQw27cf/E7/5RM+xfQUgnBR\nY2EzvDniFlhLbczE2U419PbfV7DnIzgRnd6kCKlhfXEecJ3+oOUvn2CmYgv6\nKdd+CwFm5E2SZF85tK4ChhLxdHJiPuoQhzWqlqf98LaIxOh4p9QNNPFdqs9q\nc/8aOHQPi8feGP7exlYRwIlNv/l/ypPMFuDoB83syoleIf0yXGT2bjY+6n0E\nY6JWiH+/gHKwJSaPZ275HrqxwMaT7EDt255ArFWD6R0wBBP+wehMzzLJOZ6H\nslnncBwdjVOZdR7xWI2Uv/Lu+9zYeM7ZUKqqEiCRmjL0yu9qe1oe4CPerEU3\nbAjVjKB7cGu6PAbH+oidBTTXKaJoIy0ehHUKrCwR2kfDVaxUHnYo85oIHTlv\nK2lRtYRUt/QffhEYlBdbVkhFyAM+1DzQLo8m+h21ewV9DFFZM0gRMBe6H7e5\nGifgZvtmV85HHxm/2glka9n1NC/2DHM72wwh92zC/vrlBuOBabT7dSPDpZZU\nIWojAGGlJRsnQMvDANgRlt0/OBgxPqsjbQAdGIJ6RaTLLPZPcVXJitirJxnG\n/a95\r\n=beqI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"cea97214ce464e4eb47f5cda1ff621449684687d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.78","@balena/jellyfish-logger":"^2.1.40","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.167-renovate-non-major-cea97214ce464e4eb47f5cda1ff621449684687d_1619884014153_0.31205955095742954","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.167":{"name":"@balena/jellyfish-metrics","version":"1.0.167","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.167","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"54e291eef0a27f644e49b474611adcee006226ed","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.167.tgz","fileCount":15,"integrity":"sha512-0zAjsXQUm7vHWXpnIDoCsi3YZ2xSPbXzfF94oAW6gtta/pKsUvto/n5wENMfqC6xrgONuiRw/aGRmQtK5S024A==","signatures":[{"sig":"MEYCIQCNyidErjHMGbta93B3xZ1FeMjgd3fmOjI1dVBBL7N3UgIhAOfvXi9MEKzZThAiDMi3SuVtNnAATNWM12142Co3QKTw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":93906,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgjXi+CRA9TVsSAnZWagAArl4QAIQPvqVG4/IB7RTY4tce\nwU2CDO6eM7bwX2O/wKjAQPNtiX8saYUOC+PSUGh1CUJ4CvWbESKoVEUbC/lv\nd5o+fB6vO6FTzGk9N3qMblugn5/PS93cNM6EPqXohsotsDpTGTfE0pTyxpUM\nRx+O3KqKDxFpXHdmYRK14ygS9s8WOiomaaa/P2EG8tF9NfsTx0uBtDRENHhU\nTD2rCNhOOfENYjW0CshsBTz1Vo+3JCHfYJu0yrNOX7iXGGASrmC6LPJv0HCH\nXTB4T2ZEDeK6UnD+rRl/4dIsUMUoDFl0JlZU2WsYstOE+Bq9RoKpbBnDj9EH\nCWR7PF3lqQ0+zqMEao1bBGt4zoy2BRj7UlR+q8fCszyWXSjDiQu8jnChDGes\n+FY6UPj66mum0a9M3glRSBzBW4o4yRMJmxJ/yzTJE38Sc45WzSVTpFe4ReEB\nlX7sTeU/8783BEs8hYg+noSMi3UWaNL2kQjWKmXakA1whCKjHYO3HceciNrC\nfdhAsHx7i3zfBZ56D0VFeNK6+iAFVD+QpRg9gEfeOEQIEm0fmHm4jHknHx0M\n3/RhwudPnkQoeU6+/AB7Wqw9tBG8J/JhxMWdcVys0GLginnxTMhimuxxK5y/\nxoYazubvbha8MWXvYW+ozKAY9q/soBDQKt4e1b2i64zZza9K2nM6/XsAsjUW\n4CNf\r\n=bCOq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8e464525de5263493209b6ca7cc8499a9ab95251","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.78","@balena/jellyfish-logger":"^2.1.40","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.167_1619884222408_0.27148984045661706","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.168-renovate-non-major-98bdb017c234e9010a66daefcef758666d35063b":{"name":"@balena/jellyfish-metrics","version":"1.0.168-renovate-non-major-98bdb017c234e9010a66daefcef758666d35063b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.168-renovate-non-major-98bdb017c234e9010a66daefcef758666d35063b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0524b0959b90ec2517f651b25bc59ee059e2f3a6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.168-renovate-non-major-98bdb017c234e9010a66daefcef758666d35063b.tgz","fileCount":15,"integrity":"sha512-U9UAwXw+oHOx/i/8nwoSJ9EaTlOasmUxRr8XpFU7CvDZ9zygZcnpxxQwIZPL0U4ElOFCq+sv/tMMFBLSV/R++Q==","signatures":[{"sig":"MEUCIHNTIKI2l2KmoYxgIQxXmhMKA9eRjihCQLmX1m6KuXBIAiEAs7hF72qaG+124ohasPA+J9iAnyELqnvJHN+tr9t/SiY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgjYHBCRA9TVsSAnZWagAALi8QAI+as43NilA9DNDlYVvD\nENBWMmCnuogvSjqyBKbD/QnzT/OwBe2N7tyxEoT9Y9UZryZwroRkoUcaYekc\n2umK8cUdDOXZFvDiSXk9pohar6+j6b4NuR2IJYGedKWYAFNUsQnlZehvky2z\ngAjRgpbndbmYFHI3h76mKSajdbYat7mDVI6NyhAso3Wc2YBh/3w1vjS5TSAY\nV0Q8gsIZWJcNW1jemrTsbSUH11EqqZS9doYWZd9+dc+ZFxLZTRIa3/cEEC0g\nmYzzjXPUaC/4+qhNb3mAqemcpZsAe29gvqsmaLef9W6S9KNy7kAqUJmvG3xr\nnl4r4V/I3rJOUfmCctMXw2MYNYH/qxqZ6kwKgDDmOCjZd2lw400AClRQHfJf\n1e84dXmoNJvHMu6bB40uZRN7C8OAH8MNLovW/KwqhFG6vS+xAWDJWs3gLMnq\n9W6xndKwwdNGyRNybrt53K1YpoQJYfZO+9EKrJCqd3wXgAiqtcD/TUEhEZ7I\n7yLb+5GrEziUH+JKJuuAXqq9i6EwUAXyImBWp3P7S7LXDwcQ4d1KJsyJe3Eo\nM2UsanbnBSPJxcS2/xYHiHMTRYjWBjk94cvSK9ew1AKnpaHGuEF4y+25Higw\nWpkvV6/C602+XomRP+GgJ7NolSPLW1/dtOm8Lqy2JENuJVaCtyD9jKco2LBp\nMANw\r\n=D0QN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"98bdb017c234e9010a66daefcef758666d35063b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.79","@balena/jellyfish-logger":"^2.1.40","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.168-renovate-non-major-98bdb017c234e9010a66daefcef758666d35063b_1619886528968_0.5607276005447195","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.168":{"name":"@balena/jellyfish-metrics","version":"1.0.168","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.168","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"02c7c597ae73bc575511b40ad3fa7e7fb03dd0ac","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.168.tgz","fileCount":15,"integrity":"sha512-dDlQOMFcvzv3cMIHXH+88P35drCDdbflWPJLb/7a6ZfzlpzNoGmMDQq1uwaf/E1O97KZ2otmMQ8/S0uxGUiPYA==","signatures":[{"sig":"MEUCIQDpB+DxsPJVcfGkhBpfQ5kexdl15mpKeT9DhqA4Le4vxQIgZxAnaIFV3RcjUBNMd+lumse4khAH/Lf7kFiDvnEdHUY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94009,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgjYKmCRA9TVsSAnZWagAAEv0P/jPkImJ/ENOSG5EkW+TS\nAi47rIDNN58tojC1X5vVDxvAAhkawpO4mWjNOjop4fk5ZtNE5bJKh0duSRMJ\nJidFSw/1HYE2evheSVC+O81k8gAukSU6Bb//wCK4GhDrsnjt6FsoQqdm683p\nPmTlWmWTcCc9VaBTnZ1XD50RyHnPrjjniuEFTjb3Lksew41ZpL9QVdC0GIfZ\n44kwPmHWAqw5jPDnx4J4Ye+ETEv80Kp5WZ7EzHhJ6d+wDOSp9mF27+LddZ/y\nml/avanCVOLei1gwnhanxNDKG3DfpSE03Hzg7kThW5lWe296kHC5kXdAnGo8\nirGx6hTU0/0HW+kj2FhW/W9LZSPIRiTiEXYp++SZnssY/7Wuef7BsEiPnYgE\nvsM2STAU6uq363N2Z7Hu6ZF4YcSAKXpwHMquiIbq76/ulNY3DgI46E+K8h7t\nQHK9u77PpZGhIKQKzahIrn6d5qkvc/bqNyVJnHcnLqzhZ1XVjFv1un5IYBFK\nBu51sPK5zeHCiPZ7EUXGagmL1zvxzbsukrBSJaTjdC75XSZLtszcW28EiUsX\nJOhJRaprx1U6r/rbPzxdqVhMSxw2gIh0H2Czfwo1C3Nini0m7RI/Qeadw0lI\nc7woaPk0k22P5+Ry4FX4v9r4aWhHlTArM4z6QjxO9yIpKAWC5nseNJ4AuPwF\nOlX8\r\n=pR1G\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6181e3f277936cf523775fb9ee71bd43bfb91459","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.79","@balena/jellyfish-logger":"^2.1.40","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.168_1619886757473_0.7322355681692998","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.169-renovate-non-major-8e9e88411dfb03ab74c8471b8471e4ee50febd7d":{"name":"@balena/jellyfish-metrics","version":"1.0.169-renovate-non-major-8e9e88411dfb03ab74c8471b8471e4ee50febd7d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.169-renovate-non-major-8e9e88411dfb03ab74c8471b8471e4ee50febd7d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"23c06d504285a67db1b5c60e1b538e0498fbf8f3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.169-renovate-non-major-8e9e88411dfb03ab74c8471b8471e4ee50febd7d.tgz","fileCount":15,"integrity":"sha512-7omXkwHcDd2DH0IxGV/cF7xQfxk1PJ25M1vKBYRSvE7IrmBhIl+PphSedK3CgvGduONz5Vggs5rTQfY08zZz6A==","signatures":[{"sig":"MEYCIQDwIzT/+fOJoROtfyaaEEyoPDVEguOlLjYdgNmE+5IwSAIhAOROupC8H2Jx8BwTObU4gLwk1GS6YkRExzNK+R1Uppxg","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94172,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgjf1kCRA9TVsSAnZWagAApLoP/2dn6CD9Tjy+6VNeUhxX\nO2ohv2qggrLJtRSX8YfoqQT+PiprZJoK6vfKKJyzIbgtUWvWNjZcG4bcGPdQ\nuwHr04A40EljK0ZDxU1jSh5uRJzYdfD43yMdz78Kpq6Vk1DFVGBnd5yTbP/Z\nFPRKaB3xbnqHfbZdk2bnAeIjUxyalLe4zEmJcCK/qTX6iTSQTPWPY33ZvNLd\nZZmoOiNIonEQc/utk8FvkJn00WvSUljtYQFkCiRq2dWgiZjafO9EsVgJDuSZ\n9T4bgsdXbWCk20P4r4ekGJiQ/LjuUSLDLrgN49DvyVqLzYgNucejOLpt+nP+\njR+RRvQCU9xBBRuKM6ds5v0vYXuYCyZUGwgvey1xfQvbPHFLTHU8YTephuxC\nrg50bodOv+3TYqI58EYMw4wj7pRyj0Regs8fgqF/LRgX2sEfT6sO0e8fNx0Z\nNlzi2Vqk0Bcs4fcYUMKG6DX/gCw8vZXdizGymsR9S7cLl+Kc++HFBEWr5z1e\nSwclcK4/QKCVWBhKjzvWDnfRbpZqyiLKBsPgB5yF3QKmYp4H/H4IOsg0fd7t\nsyZozDG1W56KOZnHh5j5KS/SAXgcy23vcuGmS+UTQY02SF2zjgG3Ab68C0WH\neOcicQE/JyFguH0+d8wZiuv4CbmJTm8H70YYc84fPnwHPdnBWS9rMqcJ/np9\nVTsg\r\n=DzTJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8e9e88411dfb03ab74c8471b8471e4ee50febd7d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.80","@balena/jellyfish-logger":"^2.1.40","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.169-renovate-non-major-8e9e88411dfb03ab74c8471b8471e4ee50febd7d_1619918180121_0.09492670254547853","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.169":{"name":"@balena/jellyfish-metrics","version":"1.0.169","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.169","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b1b0ddd1d4982626e0a17a57c40a4bd53efcec44","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.169.tgz","fileCount":15,"integrity":"sha512-TGCh+bI6bX1hdjucNfiHh9khOjcuNAG02b3nBb37SEHRekZQkroOEowywqZWCQ6XZzlkf6hPFEO8O6oQJ9zwCQ==","signatures":[{"sig":"MEUCIQCXcg+LMtEwxUyQfps4+AsyNPvEJ1ExkjycLUEG1hbvcgIgSyUtuvGvosoq5hNLHZVfpZwiq5iqDQycEHKQ9f/D+9Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94112,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgjf42CRA9TVsSAnZWagAA/OUP/iadNN2nrFo3+xHzgELl\n26O4bSJDcYGQsZrJW8wDBFCfh60fk6dOExeBU9aFW73GAhj4QgVeOzApCeFH\ngiKiOH0h7WwKvP8T7ZhsaH8MOAyz/7zfPlxQkNEd3l+Rz1qwrmBgZUbFo8l1\nhgINIvpZegzlUGkFmw12l7y916bFG5lna91XbhfIp2LhdKn49krT4UVFGsjM\n2sQDXlTQQQXbGZBGLFIaOoCy4qi4sMjYOVpa7et7o7wWaf6JaSq24Yb+G+2w\n0q0hfW0P/mvmPq5wcpytfi6WRYxuI1pOIQgD4HOFwQbPVN3KsetgAyNca823\nedtLSzgr5lGlhTp+iAFPBTO8QkwcjzoEUvTK6UUdU4a75UqJ09G5k8iY0e/c\nSyBB47FzI4w9aIti3BFAroeReIpzVHrKvjY9/JaWnzHfc1dXHY2ZlAXyV+ao\nKM6M9FRY8TuuuHjHmTWswwqrXB+/4zBeEynFGSx09SRpmTuBmlhmajBfqD1r\n1dBe6jtYcI08sVLKe9CV1D12SoA9zeChrSEOW4KbkYPTfDIi2taPUyeDjHIp\nrr1XpdCK2v4CIiMcK4SJyVJnNXqBa99FPoZy/cRVhNaxBEcdSnsiyyYHEUxi\new7xmXx9O2zOpwyKpTODYFSl6zTwnkT69m9/oQ+oWhBKAVvKQNrT0vJOfrHp\nunfH\r\n=ta0L\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8fc09908e54cc52cdba21ff6204462b9fbdac90e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.80","@balena/jellyfish-logger":"^2.1.40","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.169_1619918390274_0.4205570391182476","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.170-renovate-non-major-2d59c17bbe81d269a8e0573d707775aea1fc1a75":{"name":"@balena/jellyfish-metrics","version":"1.0.170-renovate-non-major-2d59c17bbe81d269a8e0573d707775aea1fc1a75","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.170-renovate-non-major-2d59c17bbe81d269a8e0573d707775aea1fc1a75","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"36f54d9346e96a26629a8609ba3f65dd16dd1f5d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.170-renovate-non-major-2d59c17bbe81d269a8e0573d707775aea1fc1a75.tgz","fileCount":15,"integrity":"sha512-rcRe2hDptgw7WIn0ov/5rAllyBi6LkhsSHtywevgECEKt6dSEK5be5Zu30mHNIeueF7IFpapduiptEdjU3RKmA==","signatures":[{"sig":"MEUCIHj3QRr1NhQ4zFf+vcMT059yq86v/tmOhIwy3Kyi/djPAiEA/wj+6RrY3JXELsun5OJpsYyQv3TV/P8I09ipHDZJK8c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94275,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgjifTCRA9TVsSAnZWagAAzjYP/2mD/B6J49kV9Rkw35k7\nsFST0hUWWJ6yCV3+0ddiJfoK7CK2qm/riN4VtNtbbMRuBnSWvbEt5if85vWn\nWXPbcq67ogNxzTDIEpFlF2yNS1c/1tEDDTIzufwRGXgUjtiW2daoMCVrPMue\njFm9MQ35VyqFFBFF/3GVJlqrMiWVFrYALtucGPQI8mQv5adrqKth67PoxMpw\nQZt7Kqz52PGSjHpnx9FqQqYlmROhCB7n5RpN7SsDhTXmj5eiu9S+OFX/Rz7c\nuGFTUfKboxsM+/tp3G0KTXS46N3k1ht430zp7Ty47ba0wB6mAvq08wDxn7A0\ne8eSuEdpKu1JCLysoHrIZrUlJv5Sc4kW570bpWci64LGLCnlTWXnce9Zc1Iy\n32DwghefVUOGfaoiEoUv4JDsX7OoJYlJpLcZoPafA9YPHui47/92VfOWJXEO\nmV9gljTwKopRiXPzy91qd8R0e2ydv2bOXL5C0u+ol78xSll6mMmci0TCvV7e\n0+mKuPuFhyQBip81C58lkl4VUfRB2AHtpmgE8L+Y+YrXKcRQhr+ZKOlFkfaC\ng3YQ4s/XWG4Sq8OSRy0XqcEWSya/nszyqfNZZ100oojZRtwRI0fplN/AnLmr\n73MtPqfwtCFoflb2vxsgznPi4uxJIKVDAv83HMCAIyk4+UGTSCa0DQHPWtvt\nGBQS\r\n=jEX9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2d59c17bbe81d269a8e0573d707775aea1fc1a75","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.82","@balena/jellyfish-logger":"^2.1.40","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.170-renovate-non-major-2d59c17bbe81d269a8e0573d707775aea1fc1a75_1619929042898_0.19208153338110479","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.170":{"name":"@balena/jellyfish-metrics","version":"1.0.170","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.170","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a5a8d0dfd64238f796a343c23cf2efc6708e74f5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.170.tgz","fileCount":15,"integrity":"sha512-35XcqAscqSxF54vJfrkZrXngv1FGobB6Z0gj8Mk/h6dt8PONm5Qbk3TO6vnfKgWkz83jCL8HPoUQMrBx78DsVA==","signatures":[{"sig":"MEYCIQDPgLEHUJtPdwN/RUIxcprLT/NmohxPpos+GLpj53SZ+wIhAJSpZ1f9OH536aOfMfEMvDM507IBh9h9Xft+0w4AUDE+","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94215,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgjii8CRA9TVsSAnZWagAABmMP/00bRdOy/L/y1ocia8qp\nAq/i8fmsgFBPwvFaYpdjINS7xF7D1guqlMB5g5l+HzdcIudBW4igF2Y/9YfU\nruHDwEH5qYSOmyadaofRDSRYCcRwCf4mQ3XgGR6ypwG7xBYiNrNq2yKUu61b\n88iTLZIzGIzINM2KDWRlHzMkz0RyJsLlXDiUVKyktcUoKM0EeEOcbwq7ffr6\nQIqoUfI1LJKGGtWHgQG8Zfm2A8T+LuCODaY+LXJorJGTNRKh+hADhumjWJBq\n8QBpYi7o47r6kA3+0tIpCNK4OVv1nUtBn8KHhEe6Exkgy03Zz1vl0KHthqvD\n4atNMl4QQmoNv6H4aQ4bQdWhZAkco9rXdwYDkiWvwm0A2xRtFZuy/h8GH7l+\nqlcd/w/8UHdquASJC1NpYmozrb/7d4VIHajOuSAukwJYsI66/bvDx5l67Wo9\ni99r8fQ6WVn16RRgAwpam3UzWROU4poENicd5zSTKyllqmr69eOCErBi5rOp\neksRqwGJhqSJw5OWk6O4qmKDEVIJQAVPL4xuQfwtKaz4HVUR1SzAygzdnYCR\nqrzwXGat/StU+D+UqFxjSZEDOL7lfxZa54yni0Lqpypt/okWSsucg7WKG7lw\nkksxiC+wNVc0Q5UO2IGMBlr1BSsXckvCbpfRfXDwXd1gUKuMK5+8Nz1GQ8VV\nnUKR\r\n=/ptd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a27203ce0154db9ddd2d7087456118d403784eb7","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.82","@balena/jellyfish-logger":"^2.1.40","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.170_1619929275049_0.7906796629438526","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.171-renovate-non-major-958fd0bf94a83bbc88df2ba4f29f93054a072786":{"name":"@balena/jellyfish-metrics","version":"1.0.171-renovate-non-major-958fd0bf94a83bbc88df2ba4f29f93054a072786","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.171-renovate-non-major-958fd0bf94a83bbc88df2ba4f29f93054a072786","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e5fb4813b84a052707316e3022b277eac1846ee7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.171-renovate-non-major-958fd0bf94a83bbc88df2ba4f29f93054a072786.tgz","fileCount":15,"integrity":"sha512-oG/QEoQPEt8nKhfQIKKTNMnbRdqHdFCjZ7jnA0pp+59FbfmailuLy0s13+QLX2Y330TjEmq9cVdC6anNob6rCQ==","signatures":[{"sig":"MEUCIQCn5EpvVb1U1fgSJn06ypdqYL3TEtlUIyoJQB/mHuCS1gIgfa+tIezDjYudsABjJdll32A6Q5zyVNb4atvjS4/O3eU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94378,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgj0YJCRA9TVsSAnZWagAAHsEQAIGtOBXeOZO2Um8skyDc\n0EbctclCuVEm0WZaa8zHaKiH8enUU4Azm9SWCdsqGGf5LjwIxO4ax4EMk0ZM\nzHeDjaKONVrPKlFTqmDnuzRCtqD9lkyuitDXB1Qf5E3tZVvIrG+vAJoUrPZx\njOIhOEkx5I7MUjvze0GDb5nZzHzeGAMY0Wx1rMKd64jxYVK6o5KiLpAZtCqf\np6epzIVT7vz39aWrP7a8KQJqPgTTG9qTNSCfgeegZaSfaOWeOVS/y1bPKznv\n67Hp3IK0ipILcBaTa/C+oZzGuj8rSBK4lSln4URS4Nxu7dWDBr16hPWsON+x\nWjcek3FcV9dHTrbiChizx50hK/gJM6L9SZTFRjV1df3/bgUjaFRDk7IC5P+M\n6ICDSJR6za7XIQTgCvb1g0/JX+zCG3Av7zbsZXpkuD5wcRt8EByHxjQ8GZw0\nTh2uY7tk+KAlPFZ32Htm9rMJ58y+fDvCvpfh4D9DLAoNoHtbhuNbE0zMfYiX\nraKBjc5zmLDKB80dlfdxyYhsNoDX9OyLyMH4kPkNr6BoBN+E+plWz3wrIBoD\nmTLWrAj3gb1bSvdl68g7RSeQZnSui16XahPosXIjeNaKl/chokaqLjkccVSU\nTDk9mdvuu3u1QtaMmZ9WvwgJqi503TZcAKfUFwVt/GI1fLVHpZGx/arVNBZl\nYh7n\r\n=qW+1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"958fd0bf94a83bbc88df2ba4f29f93054a072786","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.84","@balena/jellyfish-logger":"^2.1.40","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.171-renovate-non-major-958fd0bf94a83bbc88df2ba4f29f93054a072786_1620002312902_0.9796858702311764","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.171":{"name":"@balena/jellyfish-metrics","version":"1.0.171","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.171","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ad4a46cecb1959d50b8b6f0daf432cfca5a0574a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.171.tgz","fileCount":15,"integrity":"sha512-hi91C3LibMQnO6LqN8qUY0a/FCv//o/6tI0XeKn3eMG07CxgcpoJxDV+4IbmTRZJu6TsFuGg6RS4VlLvl5DsnQ==","signatures":[{"sig":"MEUCIQCKJIlbJGSYZT93nukhVBy4S/hh+uss7h0YBj/BLkW6+AIgYsAuACK55mNlZKO1W4uFzpbi6tdfmOBpUfngxpCXADg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94318,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgj0bZCRA9TVsSAnZWagAAU7gP/0VD+1saxuFL73FMOHhH\nJchR37aswXiyey8GjZIVnCirkaRhgXb31OKTVDMCgiH/B7YjNuWX3dU4bfnW\nQAJIsPI7FwV3QdQyXij4gDQypPnWFVu5uKVlUoA72AUnUT/4OEc8CPOpa6Xa\nGFr/rY+ytmKLTPhQIZB/liUoH+dpOGFdoswuHsD+WcTQFQzyltRU17CKnQVX\nCGalVmo6x/kDnPkWH2s1qSsfg2ph4b+zbFjx2WLKprP6Pu+++gvonE34gwWT\nyqxDo3JorPZToA2KNeWgcwRKuZY/UFgj+b5zrs22C91HirW8R5ymQdMc2Dm1\nZehlJaN7jQUp7CNuesiUpWWZUclBlFT3/rUDrKYcBLaozbmArCtij9QXImRf\nHlzOErn86JqEFO0WxKscrA6wPNFX+STtDNB9zfWhbG7MXr0tKo2JqSIVNT6A\n0K3hw0co1dD/zLkgB+L/iBoncoBckm2eBB+06evzIAxFZrPCsFVcTdyFZAJg\nnAIzhN1Dfl2JZ+KO1Xjryt6fZJd1ueceWqy7ZoLA07gF2vwTLuKqmNx5r8UA\naMksL+o188nzWJQREuKnUNexLxBfSbUc0F14nLfFhAH9LzLBskH3OHTUFUDC\n+dGO2m2uq8Y2Kealt7gJnXe3XMyB2XkLIN9zllK80lCt92SCD7p4IG46T93S\nVFhK\r\n=i1Uk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f893e0f5357f731559a56090d95b83a47e5942e3","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.84","@balena/jellyfish-logger":"^2.1.40","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.171_1620002521117_0.2558858959835406","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.172-renovate-non-major-eb10429fa189670fa1a3df4437f0b7b05705e204":{"name":"@balena/jellyfish-metrics","version":"1.0.172-renovate-non-major-eb10429fa189670fa1a3df4437f0b7b05705e204","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.172-renovate-non-major-eb10429fa189670fa1a3df4437f0b7b05705e204","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0412b4394b51fe1d7213cf347bb70ede186ab21b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.172-renovate-non-major-eb10429fa189670fa1a3df4437f0b7b05705e204.tgz","fileCount":15,"integrity":"sha512-N1grcl3VNHyB37qi8VAgJHCC3de1bKMYU/hbsuxBs2qzn3uIXHRRo7IX1/52Q030NFvzPGU6ndk1yBSnpsDk/w==","signatures":[{"sig":"MEYCIQDrIFhnUl20EJEBMWKvV7kA3z2w7lf2lmtrT3RYa7v1bQIhANZPmWlwY5DwI89TFD6haLLDZzQXyb4a+EPpQnfb4uyY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgj2RKCRA9TVsSAnZWagAAAwYP/2wGRy5EyfU/sNus8EQ6\nv2xFJmJ9MbtLg3ouNswLjl3rD7Ch1nu0EUWYlOvh2AAoBXNAe0SucLqX9mUm\npBg1QJnUwIOnwr6D0JAFxpqrZNH/fJ6WBxWBwJZkU+eSOop5+Sve5CHeCtyt\nfWzLXoGltsbYOMcXdIUcuaCtNQKMUSoipSmGn43+oL3Hwk2KgHQ+mXgXI/hn\n0EFUB4X6tF5uVqDwyCLRMj/VmtQgL8qiajuA0VHVl59T48ACQEjbslxyVgBp\nmXxcj2YD3Lc1HU22ld41dSJV5WUJJ8VXNnN8wo/iQ+Tp10up6EaYNHklf3lO\n4fW16+PYjmOobMwGzyfKd91+dkEeaUvd6ovHRD346OEeB3AQigd+7k6UaQAW\nDX4JFRIQ+Qtzgt2LG7dV3tdyxsqznTwSePk7OiNOAal/ka6RGXjWq1AFU4u4\napwDbk7wnDpLB12Zvj0pxSckxMkueeDEGkGDqSnfSRQJJhjgdwzk/L6CGO6R\nNpUkGNPfp9jVPFisoJCUhh4+g+zokM24cFd31Rgr/uNktXLkSxzo47yeUsD4\nqbfNIpAUh7WIEmQL99MSoUlai2BBPxrmn0SA/s9+OkCEuXajHQridzxXx9LX\nXdfKPF+gj9ZyR7xY5SfojjY6jYz283RBYq7TQ8m0r7NwJYph7eBs00rfhmpx\nG13n\r\n=mso6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"eb10429fa189670fa1a3df4437f0b7b05705e204","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.85","@balena/jellyfish-logger":"^2.1.40","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.172-renovate-non-major-eb10429fa189670fa1a3df4437f0b7b05705e204_1620010058403_0.7278302102675935","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.172":{"name":"@balena/jellyfish-metrics","version":"1.0.172","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.172","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"41df938a3877ec9744ec83cfc988c7ac1a9c5175","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.172.tgz","fileCount":15,"integrity":"sha512-k6BIMmHrjlTWPC6xMBY46mO533mhxx21oHDc6CNYofGTGopaLiYBGU5XYA6P06fsL9RkyjhYqoB6qov7KTlOjg==","signatures":[{"sig":"MEUCIQDEPidCGAJ7dwxfSosNNU9EdfJJzAXLAt3Ji9JWsaIK8AIgXGpwjgRUP/WTKiS7gIAX40fSSbwbF6Oyf5q5UCCn4YY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94421,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgj2USCRA9TVsSAnZWagAAEjoQAJjztZxyQRcPGTq+Mp/1\nUbqeTmA3UaBijOajPHTbmV3aG9LWLsmY/FmTld1FuIYQvV5nFbJM5bcfCxfQ\nwZLwEuLKWRUUCI9pKw5VQKTy3zsxAfbhmm4x1nwxUlCprjm32IQhenhfKJqa\nalcu1gbFPB1nY9ZWDnDBjPhBTSo3Gz8b1rstjjkTDtKl4EKSrSw60/KOJn1Y\ncFWpDZCMXK9ts/Ez92BafwFqx7Acn781NO8oTP+n17cxU09CbRQFJFc9/xWu\ngExWMdJykJ0BcD2AqrOENPkUIdFyARXjI/1gFOJSUuR3CB+IjKDkmV4QERPw\nFiQhGA+ri4fqSUfbyBMsMPWe+Qj/T3kYIuHxrXNewEemQ1zBqUbFRPfZppf0\npiBD7694VhtdJfjkSSiWxE7bF+Ws/E0SeYO8703JAnj8XErUcOx+53cQUy+K\nAy0d6Xaqcx0ET8xBleXirH9fgUQXTSTtoPeTM/OfTAQxd0qP0nSKiRoa5G7C\n6F8M0bxasVW6m25dvnDTwwWK39tB2T+u/XFEdJDDAX+xTB5J8LvTIPmJLh90\nGgy20EIsPRENi73xuqJUPFv3UbfqSQtbZdd9YnElAKX4tfwC+5X22mNWpB19\nZedTOem7mKX2HQL6CrCpczk2EekwFqoEEk4yUwTZL+FVOJwfNggIR2NAGHBD\nvSgb\r\n=DYHr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3d417cd5edcf15d47ac9320edbbd42c8fe4caea1","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.85","@balena/jellyfish-logger":"^2.1.40","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.172_1620010257565_0.8647937945147453","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.173-renovate-non-major-fdc8e067e0a297b23ddd8e26a155adc37ed404cd":{"name":"@balena/jellyfish-metrics","version":"1.0.173-renovate-non-major-fdc8e067e0a297b23ddd8e26a155adc37ed404cd","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.173-renovate-non-major-fdc8e067e0a297b23ddd8e26a155adc37ed404cd","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"22d6d44d96e2d28a0f487db4b48e32903142c422","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.173-renovate-non-major-fdc8e067e0a297b23ddd8e26a155adc37ed404cd.tgz","fileCount":15,"integrity":"sha512-F+TG/fyber3IsIoBmorlHTxsEvSwtfJzyncmw4CKwjA79yV4qa+yQFqnz5pibit/ED0unyvMeFZbCED4MNSPfg==","signatures":[{"sig":"MEYCIQCUCzO7rZMunHJoWtGjkqO+GsvOGeM673yYfPx/Nu5UtQIhAPqXVguLpofJsTPKnSXRCYdbhKm0MPpW+aggBRhbFfOY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgj4CRCRA9TVsSAnZWagAA/0AQAIhJJWXXoG0qfomerWTV\nT+OgSX82inCaOVhnE4oYXLyh4g49gbFeEP45loWWJW3h1QZnLL1MyxHLwf77\nszF/AxnJg+cQ/R4dVgVFHjPvjhUalfc9LR0nDss1vKWGxuzE6jAVya77BDUo\n9ReHc0ejCgTVSrRbBZ7pedyZjwm2C6dsDEYgf40ldggUD5xlg60eOcPBHba8\nj5I1bNI5CtOJqhmyofv8EmSCjcdPVZJ+fTRnVEwE8Q0PeWSRGgMKOYLlovVK\nIbeOelj4ISAusuMtGWEWRcH5S38TXqe+KKYWte433m8aW+6aa7ivUCVIcAnw\n4mR3wfcErNv9dBbhDy0XwWMpKMUPx8uD2TvPGyv9wkUMvM5u8gIPK3BZ7syH\n7NfZSYLr/UVtu+jgJV8b/sK/mKD+nChHDWkitBvHhbt+VmLE5faZ6PDsbRMt\nJK6PDCT3XWR9eB6dyc3VHSBKbFqKUMfh2z9+7bjcpLuFwjN+p1GXyAHVycl6\n6eORLhe8FpYiEEmKgp2EcazJaQfwpesrkNyO0exzN6soDlDiBKFVtvX7xsg8\nwqU1Irh33t4eu13DgUE2RqFUTBM6Q43XjNKKkAGR8BpAgO3Wv+bI2kpqiY1i\n+Oe4EAfMycuLiVOCuV45YpPC2Tb4YfxW5EljMu+Nn2PjEKVXcTmewvLiC3TW\nFhYC\r\n=5kBj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"fdc8e067e0a297b23ddd8e26a155adc37ed404cd","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.86","@balena/jellyfish-logger":"^2.1.40","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.173-renovate-non-major-fdc8e067e0a297b23ddd8e26a155adc37ed404cd_1620017296558_0.13391163948272156","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.173":{"name":"@balena/jellyfish-metrics","version":"1.0.173","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.173","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7114177745ce87f48ab8630d0dc32f3cf36a8875","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.173.tgz","fileCount":15,"integrity":"sha512-KGxIrGJRv2/gEC10MqYOfCp4HkU+vF2XRVMm4KRSuE4yKlfaaP2Dfp5KkzfsYkQqphETABQFf9WzEB5ZpqJBew==","signatures":[{"sig":"MEYCIQCRAwt7udivwV8vdO5QEyVGfoI7cPpPT0nF1U/34GS3+AIhAIA9INm2sVa7/4ZOhrp6qLYWx9vaaBajjjOmYoWWsZVX","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94524,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgj4FpCRA9TVsSAnZWagAAz1oQAJ2cilrI/Km4FLxdtzmX\naBOSYxlNtSnRz+dcB0vlFUdDzJ/uu50Zpfvl7bDsd7vr5JhKxjVrEhthnsNL\nThhPkrDK3OHrfRALXQX6s3JphQPen75j6OR3AC1Ehs4LbnZ/GgcrYxjTnhyE\nz2mk+RAQWGkPMxpOFn2IBrkiYUEaTravTBzOBJA8ixik7xUMK4Q07bIbbvnD\nZR/0wB5+xvdNU8VfCdVW0p4SX3Wem9A08xgHk11OZqwNq5OB/Q4DrfSSw88D\nL+v62i+pYDefAQKjPXAqdXFnExa4vVfW9aJGvArb+7EJWF+o/yhur7qJSHgK\ncXmdSFyCIhsWCDP++9MX2XdcpqpkXnwdQvoyRXe1UK62n8OM89eaNk3sa1hR\nnH7BcoaMRQD+txaQeiVV0oh5UYJnYL/kv6+m0/g8vcnWXQEWIhf2CqipibJF\n7TF1MtiQGh4oAIDh++B08fwqWw/va3ONOuAc0djKmDnV0ynzzYjE4WqJ2f5h\nBKF1DjhKqHDfdbgzMGYZwQL++BiqmUdSKRqYdW8SoEtJ0l+QpzJ9gg7KJO4c\nx7aHp1bbKkjzTZZD+trm+6yimB1HTtfZ0shp1mCIeqCX/yEEnxpLY8YHluXF\nQgph/y6sEGIrguPCQ3qETeBPQPgWHnAOpbrIQ/0OgN5FRSR8JRPjNzG/Wwtc\ngfhZ\r\n=Od2m\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"772029af5da0ccfd08ad333da17b1d3fac3efa6f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.86","@balena/jellyfish-logger":"^2.1.40","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.173_1620017512560_0.5504007046521475","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.174-renovate-non-major-a6fc5fc8e04c32f16ff1dcb86de2eae9b014070f":{"name":"@balena/jellyfish-metrics","version":"1.0.174-renovate-non-major-a6fc5fc8e04c32f16ff1dcb86de2eae9b014070f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.174-renovate-non-major-a6fc5fc8e04c32f16ff1dcb86de2eae9b014070f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f91e923766a974765ca3454683e7b98cd5193bb6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.174-renovate-non-major-a6fc5fc8e04c32f16ff1dcb86de2eae9b014070f.tgz","fileCount":15,"integrity":"sha512-qsX3ZstSVmJBGSXpFUa93IUIIQqa60N89U6YdUADZw3qDjiJ5mmV/GGAPLp89zyQ/7jVjy7HWQJvKQmoz4TLvw==","signatures":[{"sig":"MEYCIQCVd2gKrJlckR/BJRpSSDlP1X8rRIyxH7IOR+Eg2shW+QIhAKZi+kJVrDzBUAWEYdBWicO9AqTplp2eXf2yQ4r+wopq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94651,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgj8fKCRA9TVsSAnZWagAAPhQQAIspP7cO0ivg4fCi3n2L\nsXqDSD6YMmJtKeEvh4zReAS19aTMxCvZA8aeXiXi5A5rUfXT+ZAP6BFGK3yY\nPlnJU28QquT815WHkul4FcHpg34HxLXbWP15UVa9+5Zj8EaNxR5lOgwCxDIv\nyCEsx012gNjTqbx5xDftFRme8nL9rudyFR+fX8H/QaPP0tdyWlKfIT6suFnL\ni/34cxFOkWwiIypY5qVqrYIV7Rj4UIRSi6HOZfTudn5QPoVJlT+C3dsIWk09\nObnFgjFIKVeG9dQKXut/Pvzv97EjLRyoaTf9mCiVYoOOiphwC9Bl/1GUIviN\nlR6Hl4I8RtEnAu3M38MEzR+MQ+NqfcUAB+a0QzobifOsWIlUfApM1o/z8jTz\nxoqc9uadlNkBO2TwQOr9of0xRjq0t8Km+YIsEWOgxnPGzEL/c5UaFq6zKkR+\nlzKsI9+aqFSzuAaf5xOpWg3lVwpB5qOiSDEWu22Tyr2ne7sw/cCDivRTbXHS\n8ghHnWOQTP7J2wHs5P/C3JKmVab7qAcLw8FrWJQ83EPs27hfnxQejbRRKctP\nCpVGMZiML4K9uhH/qb+07GQP8MlgksN9++gG9ekVAJap0v9AuA+bZEkJ8Cvg\njA+bwkG6twmm9g/+o5fKC12ANYqzQQmriIaBSv/WSTgrgMBBx2vQlWhBGrtf\nSkyF\r\n=PL0t\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a6fc5fc8e04c32f16ff1dcb86de2eae9b014070f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.87","@balena/jellyfish-logger":"^2.1.40","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.174-renovate-non-major-a6fc5fc8e04c32f16ff1dcb86de2eae9b014070f_1620035529837_0.7261312287260835","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.174":{"name":"@balena/jellyfish-metrics","version":"1.0.174","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.174","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d4cc8a3407f7e64f9f6caa3935f9be973729b70c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.174.tgz","fileCount":15,"integrity":"sha512-eSAP3WORoKl5c5EGsS3G06UG0u9ExtsjBYToWqzPnm+qxuBf4NrR9BvztFbuD4dSa8XsISKa4AOCkTy6ItQj9g==","signatures":[{"sig":"MEUCIAyCbjElyh7e0rKYrdmk11K39ydJ645rxOqREbsvGw/DAiEA+eONPuhhRg70Hhlub6+sB3HvcZkfmm/S2fiOCU9XTag=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94591,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgj8kUCRA9TVsSAnZWagAAEI4P/0/0Nj/92vho0DAo6T+M\n0DOMlqXMdEZW8Ngt/kKmDNKZhInaZnH4L9tlVxICWTvzvRn5gh5e28ZJkd8U\nFsmv8bacEp2ScSAetASy9W5BoOpxL1uRlae4Uxe61WudnObP1clEI/fRl+h7\n6Zpc/Xm16mz00X72CtAe4npHGX2fB6VfV8LXIhuMgbNR0RI8Ng5oTOGmSddS\nB3Hg/puEvp3UhsAANE3oyBCzs9229fsbWP12AGOq7m5pDlD9ykSXEsd4t4Vm\niuGO9gQ/sP/II94SXNEZttZvTDrbsuW+6Mt/2xAoXF4S1xbPfPbPY/hHb3T3\nwkA039cDmvqI9BHmZRJXFZklESA0RYodim5VtpwLqtVhXSywDoi08lB6L+Fn\n+mW/yxK5ygSMJNh9U4tvYFUgEjHZcpNaOaKa+Ff+S5kEeuWhUs3EcpV5XaKr\nGWGru8BpJmVqwjnUEvlpXDxO+9hqB/GzhiXqjKua5o2sPzajIokGA/iNj7eA\nbtlsKPokNVsfP0RJJHvOGe60N5cUSjcs0OM7r78WG+YtjhgXUUiOguLH7M2T\njVk2/FBgHxOcRl4eAyvQwk4iasrgNqycYU593cgxyngYiYchKNA0Icgwps0e\nvb4imqV4KIv+jHXD2B7A4ryyfsVuH0+bzTlpJe36UrFhDX4fzHbmbMCWHBhM\n6tfq\r\n=G0P+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"072af7a917190e8bf978f450c7bd2b9a8020c780","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.87","@balena/jellyfish-logger":"^2.1.40","@balena/jellyfish-environment":"^4.1.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.174_1620035859628_0.011617341563270989","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.175-renovate-non-major-b1b31ef1d4a760dbab54ea4805cfc85f922b7603":{"name":"@balena/jellyfish-metrics","version":"1.0.175-renovate-non-major-b1b31ef1d4a760dbab54ea4805cfc85f922b7603","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.175-renovate-non-major-b1b31ef1d4a760dbab54ea4805cfc85f922b7603","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"81e238e8d0834894a7672b6cbd77bc150b088e96","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.175-renovate-non-major-b1b31ef1d4a760dbab54ea4805cfc85f922b7603.tgz","fileCount":15,"integrity":"sha512-Di+t8yN5Xs9nuQRXSC3S+FPlHg1byDOEduUZBBFMqkkVJbYq8l/cCNio4MvxBtK0E0lF0kcP6TNfUAo/ZrxXNw==","signatures":[{"sig":"MEUCIGi7ABBsxsglgC/IUVe8mR0lines+0i11XfSyULloxTWAiEAiL+1+dlFDZtKiU9iz/mNY5TMkXvcS8PnmNsGHjFvIng=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94759,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgj9EKCRA9TVsSAnZWagAAmKQP/11FBJH7Xf4a/CaCxIAM\nuAMuEPSedOf99R8oTJ2i3SFqlFO17mKW+XlRoGGZ2CiwExNWPYjGK5YlMfdL\n+vwPrxprwepig8PZBBhvay3SfyPVIqKiIc91RDxarN82LDWfyF/XnQSRVDFH\nOGssHA7dfsJkuRViPaZend666dY1rlKTiFvu93abRFF/ukU1vSBbhuTMvETJ\nU9ZNOsp7iIpOyAaqFq0VeUjK+ZFqhLuKFvo2ZwSk0Qhz5plGMOkbbEuZpdaV\nxdNSpXqxAsbrvi034hT4BY/RmOci56vipQ2+n/d8DlYF+1F+HJGrnmhbDUuT\nSmXo23QdJKpbnF/1hHH52qetqHWljNsy8HF1UGKP4/2wSK42S9FjYEb/RMiX\n8cqwWfQQ530lLK5gjsQjsocUxE50h2GDDnl1kuK7nDgPjweQqJyWqNGLkrLt\n6IWjwbXN9N+gFlVsf9zC8xiJ4Dws6HBzWSF86P4zqgzd0ZB9H4cU9kYTj3mn\nkgwVFz8HVAH/Q5dEuJUhkETa8nEpY/HyG5s19N9znB+qqGiWDsvb8QJodnK6\ng4ok+C5JoZzmeTR5Y5pnQ5zj4JGCIu8Ur+X9urZzk+JTwTyVJk3XwpP1879l\nunu0jKkyuPp6xPV9bdTsC2F6kwb5eLdyKWAOatGJA8/KnZ4ITH0qj4nTE6NU\nzMes\r\n=ei3Z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b1b31ef1d4a760dbab54ea4805cfc85f922b7603","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.87","@balena/jellyfish-logger":"^2.1.40","@balena/jellyfish-environment":"^4.1.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.175-renovate-non-major-b1b31ef1d4a760dbab54ea4805cfc85f922b7603_1620037897609_0.20754222739705708","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.175-renovate-non-major-045f8f8c2fc927505f5d3111af38f924fe490b6a":{"name":"@balena/jellyfish-metrics","version":"1.0.175-renovate-non-major-045f8f8c2fc927505f5d3111af38f924fe490b6a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.175-renovate-non-major-045f8f8c2fc927505f5d3111af38f924fe490b6a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"dd4af65fd62adaa49c46ffa1b5217e626449b47b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.175-renovate-non-major-045f8f8c2fc927505f5d3111af38f924fe490b6a.tgz","fileCount":15,"integrity":"sha512-0xK8Rb9ZE5rJxk64Q3k/w/SesLro3qkdBGM9Vu2igo4ZpGXLgiuL8jc3L2xOhumN3ROnQ1w3qBgNAgxfrE6sOg==","signatures":[{"sig":"MEUCIHiT20ltBfXqkFkYIEj16L0FaGDp6xRz+6mei0mP/JpIAiEAus9j3MlAT1pVJA1AtpmGUjQtRZBjOFER4m53qX6D0tc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94718,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgj+UaCRA9TVsSAnZWagAApxAQAJYf+1Yk6c1mrgbaQ01e\n4FH1UcZ0e3oiT/JvRsp6zDALT3GQ79hkrq/EnmCTlTxKJ7dZhwUpLZG81qfY\nfPALEJyGzESud6J7M6FEK2EmFul1yrrpOccQV6W1X8/AveLy8Sk6NiUysPiJ\nxA4faWiH+F4IBTs+IkVzRvZ4H9LyNRmPQwis76VezWlF/A8Q+Tpg6ys7ELHa\nn///lR45WzusFzYE8NsIoJYs43N8KkJRaeP+4ui+PEq2Zoy869GSMofcBtS0\nbcXl7ppQStjrLXldx+ZuaD1w9lkN628BjqL4zUooRijl9QcuWBu/mRsqf/YC\nXY23MEFVmS0ErIndG2waGgTSWW1QsahcFfz+vzYseMCEU8YtAi11t4X8IoJI\n9jSygPuGkGqip6mjWeUs8ocJrWte1pLxmHysEyM+5ib+DKQ3HMLZq9uRSogy\nrWxQrHuPrn+iJJA6rk1MPMngrr0hoOKiGHmkJru7MBAKhiLPvnAeWA5c05IF\nWUhNdPUaGwcjOInUQD6onIreMts2x6nGNkfvv+yneZW4tesxP/vhj5WADwGt\nNKN/6ZFiWT4KPg24VCuzS/vIOaphSqIjKnN4E20/b/3RQ0jTd8iFvLOz9BP5\nq7ifxY00JpwjHQWcguo5sBU12ZcTQL5fVGIhtreASWydTOHuU+iZsWUx5qNf\n/dAC\r\n=30Ap\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"045f8f8c2fc927505f5d3111af38f924fe490b6a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.89","@balena/jellyfish-logger":"^2.1.41","@balena/jellyfish-environment":"^4.1.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.175-renovate-non-major-045f8f8c2fc927505f5d3111af38f924fe490b6a_1620043034089_0.7186411835876587","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.175":{"name":"@balena/jellyfish-metrics","version":"1.0.175","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.175","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"35fb6c427e25c347bb86df98c249078cb8ea02af","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.175.tgz","fileCount":15,"integrity":"sha512-CNa8bksNMl1xpvYnEQumyCd0eV5T7K9+P4h1/c8gblXtRxrXlO4szMorp9ZhvT5fAum001V/H5Ha8pinh1WbQg==","signatures":[{"sig":"MEYCIQCKT6lx049G+PaCW8zVG7lxRAYdvdR9kqsXpz6NpPXMJwIhAPLk9+pp9mE1mdIkMqF2M9VtAaKMpnS2g+q1KSvN/LzQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94658,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgj+XjCRA9TVsSAnZWagAARqMP/R/Wzb5cHuKFkm2lQCLd\nRE0XQkCYSnaI+Iqlozxy3ZJIA01GXBGFuVSzCdPa/I1HgsZUmU08KSq8RM21\n0M2N+YUVKw3KClEsvKYbvafxe/bncwA2LGWJAyn278O1BPgwAiDQ7lwCdhtO\n+w7kHIE7VD4XU4AVZvh9o/3hUJTTN9aZtWB+1m1ylsirfAcTH9tzmYEQvDGm\nLXW+sqqP3X5l1y5nUahHLKjLB9mHgqumxTmqWzsvCZxilUTZHFptufZqeVjC\n8rUrRQERFal5KxcWvf0QdewnrwS3Em/d6WxQMsIcBOIYk42mZjKfxYBeWbTr\ntBCdrDMVErkpc6hmHxWDgTEX8NlTnxJzR33Q4aT3CERae0EyOxFdDAuLijnB\nepmOd/z/7sDeNJFmU2slzx0QQZut3qX4vBbAdmx4MOTleksS68zsI8F5eas6\nBPLk/3xKKVqgcjhfO8HM+Ln0OagOYe9BX/wpoBfdm8iWJEvTKXySZAhdHk+C\ntiI5YywciU84wkQ8+nv2CwJZNZkmowx4qT9Lg+jJ45tMF0ojyB23TcurqDxL\nLVcknD2/8N8S7RptW4ZWPYf9gyS9eWuZ6rD0W7bQHw4SS8RQvAjZ5EwdPJ1y\nq4A4SDL6Kn1HwnO/VGNvoLUvRpWxjzEtbzHygF6feLOYZI9ncsz8juu0suA8\nbe1Y\r\n=1Q99\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e09a809c324f95998ebdf38286979a6aca66022c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.89","@balena/jellyfish-logger":"^2.1.41","@balena/jellyfish-environment":"^4.1.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.175_1620043234966_0.8635086456596248","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.176-renovate-non-major-cceba3d066793decfa177761525cfa3db0944368":{"name":"@balena/jellyfish-metrics","version":"1.0.176-renovate-non-major-cceba3d066793decfa177761525cfa3db0944368","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.176-renovate-non-major-cceba3d066793decfa177761525cfa3db0944368","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4b068b1219c01b22d503e3882857e1b0b261de8b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.176-renovate-non-major-cceba3d066793decfa177761525cfa3db0944368.tgz","fileCount":15,"integrity":"sha512-HiNMxEdj0LqIpR3qP7xZSFE6kOCaN/3LUgUMLq5gCLOqjkFOshMrXpMXceycbY9gvR18eYiBEphNjfvysGJlaA==","signatures":[{"sig":"MEUCIQDxVs1kNTZLxcv30WQMNG0/i060wSIT6N2e9zgwmY4MXAIgOu3R48FSwmHIHdIzGIBarcO3Bm8VoGexp1VRbmcbNys=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94821,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgj/o5CRA9TVsSAnZWagAAQWcP/R3qgP1XvSaVtnPSTEV4\nr/rNd+A79Amo/lHapJcT5fd0j1cJOgjbL8HkJstEoI6nBq5PBFqUJhWg/kCr\nsX6WBKRmIrqjUVCwK0pK3mb3WZauwBwhYQiOZLYLEJELNCECM77S1SR8hjWr\nyoI5KC/wymmriFtvxjb70FMyrGzrzU7FdyMPhgZBS2Vh138TNMlpXRiNcdQB\nsgGPliuBXTOnz/Mm8fOKaZuY5iNPdIO+sdecEZlB00meJhZqx51L8zxFC4jV\njmyUd95/UCJ/c7DX2HBdCvUNig5sT4eu+8Auil2quBnCvmrK2SUN/I9Orz4z\n0EQKXZqLq4fqsAP3BTc/NetXSLSWaQrodizAJ3KGSreW7GyfR2Xi3nMTPToq\nGLGQCileC8jrPDKHRh7vmAlYV+Aqdq5jtT4grw1Mt2qnbfTph4t9ZLEkvSBc\nA0uExK3dqKyLoVuxDlB6NeCACLgd2jhSy2FZOgx/HAxLixNhW2k4ioHKSBUk\nd583rEjAeRWELnYGeSQgmDjeoYQH1o8qiAG69ZUDUH+qFl702JB9rLW+r3J3\nDnAsn7/ljA2ys6x9RBob8tjchApbIWUCkxZgZjEVEFK198ysL52tTSw4t+m9\nkVZ+Jj1hOYRHPPMXV0TOOARMuiur49sVw0aQebSTE4U6QUVBgdQBb7FjQiEQ\nB33l\r\n=jHFG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"cceba3d066793decfa177761525cfa3db0944368","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.90","@balena/jellyfish-logger":"^2.1.41","@balena/jellyfish-environment":"^4.1.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.176-renovate-non-major-cceba3d066793decfa177761525cfa3db0944368_1620048440918_0.7932273981868048","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.176":{"name":"@balena/jellyfish-metrics","version":"1.0.176","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.176","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8174ab8e6de95118a46875abab375e3f54e12410","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.176.tgz","fileCount":15,"integrity":"sha512-ej2maNQR6XVJrm0sBhHUVRn2YrJCuVQB6lUP5O7pAYXzj000XqV6/X5OiIC6j3x+ixcXE9D4AUz4FhRTat2M5w==","signatures":[{"sig":"MEYCIQCc9is0lucXlQ2/BGAOEaOwfGygEWhAtwIcHpdJC3mLywIhAIuT/JD1zk4YmxDY4tPR29Y4szMxDCslq/EAyeLl4lmF","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94761,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgj/s0CRA9TVsSAnZWagAAAAsP/RhTnVoFxwMwtJmiVcc8\n8FN0i2V3kM+ZAeperoVaTLE2TkSagLNnplSQt9v0vghYQlJoxv1haAlJqroz\nyQzmHkDpsGKWyvZHqf6GWc4jPOx+xbxoba9jDRYtACendEqEN5he2iCxfR/p\nsgw8+WxDqaPYNATshh3fC5lUrx1TNwlGqaytQ5Ebr0p4AEKtNqDGdYgl23y4\nUXSJ4LPTol0fBkeIRMkHNwksqw7EQ9eDDXDP3IQ2uUDV5K1a6YF8OQWYmNiI\nkmIwr2TXW53fGlpjx/HON9rl/wMG22gvIqk/er42ff6hP5CybPhy6uk/DGwN\nxfh6ftS+kqksT/JVeNS9h67cgo6bJmKOHLqvD0ODwkGX7KzHBROhV4SJXbuw\nrhxcJ5aAnSbhfdcNTtjJ1e706xi3GUv8B66nrujt4poIMlV61lsLidHPOlvH\npEtG8KkO/wSBfKsbScFM4WLqbDT92gB8TmNbwNP5nw7H//No1dW6e2NO292q\nRzsp1gimac7Fko2O1Sb90ne6xWQZdlrTfdL+vYM/+SdsRI6yEqkRwZs21HMr\nBYKywU7hnMZQgyh9yIuuCN17X1qUIbXNbhqMUvm2kKmqck5iJZRw8UaD3H3v\nORRSc5b522MSHropCfzmg5Evh0SoxAAxu0hZ5MOVT6YJ9skjrGdHMwZazh/V\nPH1W\r\n=ffFq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"994ff503dd214846d644b39cead3c275ae6e2633","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.90","@balena/jellyfish-logger":"^2.1.41","@balena/jellyfish-environment":"^4.1.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.176_1620048692258_0.05988030769286268","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.177-renovate-non-major-996df6bc11de8c56554810b6fe066ca577135f4f":{"name":"@balena/jellyfish-metrics","version":"1.0.177-renovate-non-major-996df6bc11de8c56554810b6fe066ca577135f4f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.177-renovate-non-major-996df6bc11de8c56554810b6fe066ca577135f4f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8537c7225ceacb1dfc4d678ee2a434ac7f7f3177","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.177-renovate-non-major-996df6bc11de8c56554810b6fe066ca577135f4f.tgz","fileCount":15,"integrity":"sha512-yewFvbuquE65p7csyw2ipOR2eSlawu5W+7IqxraAV1oDN7KwPcm4LF3WeKEWbdordsNK+SrW+Gdq2FRBVxevZA==","signatures":[{"sig":"MEQCICLPb/7usm8H+vhht36zt/LiOLD9fS3atMs7T5uPncuaAiBWLbiFki+anlncyTpLrM0lXufxPpS+IBZjtvmON//PNw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94924,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkCNGCRA9TVsSAnZWagAAYtkQAJUcfr/9ZmPJ1hoBuuaZ\njR8/b1vu0YvlUccS6yVAUpa7ah1/fNX5xeu6SlhyAXviDtf2BFzqRFgzA+c1\nkLoUkOBeQQYUPR704vj7z/40L0xLku4gezY9C008i6TGAu7NJDumY0IfXJXi\nyAmcrj8DZgYCrIuNphqsZMDYYLVTgCCyXBeWUJCYIwMB8bJ3gFKW+Xt+5fwW\nN9hrmEbu/dBNZOCoGGkKHeOnvkPVHC+b6hsfzNdkIXSLo3sfSOM35EfIxbdY\n18A5Vm5L6spILaVu18wECMWxEGCl/05b/PAJXJ3yP1yxtIQwTHy4uUCfZIzs\nD1WqIYsVmimzXSPPLP/+zGi4uHE8ppcAGdCGrOeApiyw/usxeuSE2TKF6b7f\nXITbnFS3MioLW7vbWLCmn26V+Y/1yI48ihrV5PIPQoe0ofqujKE9quG2MqMy\nzkndazuNCPbOAIfGXW9DRuyOBOKbLCmbdtjszYZ3zW0ZW/THO4oAvWrc807w\nJz/dcgcbd7bPy+gzwYa0MJWWWi5eV+EUoJvUvG78pimENLO4p986PiRA+Qwd\n0i+pRcSh5GbLfUZbzLpHVniOh9P1+Do1SkN2DZPE0uFD227Pu0ee/Fa1f6kW\nA4iC2J+Bgw+LnjnTXq+RAIcClhmGFIoD1DhliY0/PordXigibWEhfRuvtMi9\n1JAr\r\n=fgLU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"996df6bc11de8c56554810b6fe066ca577135f4f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.91","@balena/jellyfish-logger":"^2.1.41","@balena/jellyfish-environment":"^4.1.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.177-renovate-non-major-996df6bc11de8c56554810b6fe066ca577135f4f_1620058949788_0.6366426663657829","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.177":{"name":"@balena/jellyfish-metrics","version":"1.0.177","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.177","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"54a2ad135a037e45636e5559b90ed953081d3af8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.177.tgz","fileCount":15,"integrity":"sha512-pAe3gVmRkPGYd7DCbYBWXAEG9c4DzVu+PgoMIiSCMyE+Fa4iUUpvb/vH6epFBKnVQp7Y4sLMVORWU02piXcB3Q==","signatures":[{"sig":"MEYCIQD1h5+BYd5NEdzhljkeOGcSJor+REIJdX9A/vMCjotlLgIhAIbuf6Hgl6qvVgmFVCSVP37qgZNXPMJMrzFvGCED3MQ3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94864,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkCQjCRA9TVsSAnZWagAABWkQAJtx/j2fnG5sjP2tWxkR\nctsnU2jiWmyxmbnbaqImx0NNxvE1bYuu7Kib+TlE881GTFdLDYSmxu7mfyo3\n/YRu+ZHSX9zgxaIZb5A86ZOhSywTLn/K6/JlYU1yteVei4ZwArp0Lf71v1WN\nOGSXEYXIhZMQab0S6mBUjsI68GUppokMULtOdOp8XE+2es3+FWOO57cCSRvd\noaxmDCOK1KdcPd7JGIxGwxEzYBJ8U8rlOknjHGofB9tWcremCkZpzw6F1Kz4\nmz5oVszDktdcS9IKAseeSEM81kMxEQwxMi5ECPB3POJ+CgCOZ5zXdDlMRvKf\n5wQ+i0+C+Nx6Q/o8AoY6fSeMLzKEBXPS7Y43HECSpKOAk08SVgs6bQeHk04v\ntc1zYSGALnWdJc2d5imBaywgDMF/5akcv35onxPBovQjb5u2dG6HgqumKASq\nMft+7LkRoAkGD+d62kfLKXycpZ3UDPDq0vaY0hYgTBUwalQIOafRxYeq0DVV\nVOmeTrt2LiSOalwQQtci2Jf1cvQlW+ZlLjsRH5QuZm8a/d76nfrWT+RRMV6n\nWSu5fdQCDOaodWKqREotWxs2X308GxhSahMKGN4r4ApwcmrjbnVyOzc55wz4\nvs/dxsQlbwWYj8V2Zo5pTIzwCNfhHwJsZrJXhkVePZq9dUKpjBrPq3aJ5GVH\nL97z\r\n=zEH+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d046c508c38167f4729690309663bdda0140dbdf","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.91","@balena/jellyfish-logger":"^2.1.41","@balena/jellyfish-environment":"^4.1.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.177_1620059171504_0.455573158991027","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.178-renovate-non-major-73f665a8031b7ddc0f81e6031ddf9ae527454589":{"name":"@balena/jellyfish-metrics","version":"1.0.178-renovate-non-major-73f665a8031b7ddc0f81e6031ddf9ae527454589","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.178-renovate-non-major-73f665a8031b7ddc0f81e6031ddf9ae527454589","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"56419b46bb3a2149bf59ff30c3965fe5bbf9e468","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.178-renovate-non-major-73f665a8031b7ddc0f81e6031ddf9ae527454589.tgz","fileCount":15,"integrity":"sha512-VZObOtJOuZhBGEthz8fF4BXNwowch4CGD/Go9Y4fPnFgIzonfkk95FNtLklTbspnPEOo8xVdMu8WFG1utrGD6w==","signatures":[{"sig":"MEQCIHyw/PSFXqAtwgPV7lEEN2FcZC7qU10yCtUhwM0wJXJZAiA3ZoXcr+4kBHFEceBXjLfl6EtL2Z9TSm1Ez4y5OohJIw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95027,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkDftCRA9TVsSAnZWagAA0L8P/jN9eI4BQMJrrSPgO5F+\niHZvKOmiZ1cEKwcOe8wLGMx1IxPOo94FmsC+NmgKN9jWHqySxmbWAHSwPuHC\nrHUm/MNjgrI7GcGdjtitain0xaqf2PGYOlW0bm9Rgor1pp/R2y1YgwJe02pP\nx3JyiazIodi9AucSCo5A8L6nCT+yOs7FU0O2O9hx091owi0YKB/0ofoz558j\n7ey+n028YsDg1b1uPGk/OgqlZFqVeHpbW0zKCMDJf8lstm7Q51Z1WH4HPjeF\nia+ArWNiS71SRWMW+qbKnsrHC3+b0uj+maDeBmWtlV/5IxjtGGUeib5yCCqR\nv3S28ZkmIhe7OfLM7SNqpi1kGZP5uOg6XtRhZds2LlxJ/O9aOqK3wdCPNtFB\nTftrKDpdBPS4tpAl3NUCN+PWHXgFiRAsrM4Hpo2w229OOC1JcmRN80bb9Xou\nhzgICRgU+z19eFnk6swUEU32yRHxumYUR1/sRsb6NJvY3Q9xzdKpW7mejC8X\n2yD42XgT0B0Jg9TJ6w3WOX3+Z1UuT+gNgRzhui4CDPzBxGvot5K5ZAiZcpyP\nCCNf7BwPPjTZ69a7Y8qrcOySc+avUzIgbp6MvwZQqwdgEkH08Lmm+1Xb7bgL\npB0Jq5CgR+k41Pz5uDUS1soaoWUBuQCdwGCryp3Ol3Tgn1AS88qAClb79E03\n5k93\r\n=TvSq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"73f665a8031b7ddc0f81e6031ddf9ae527454589","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.92","@balena/jellyfish-logger":"^2.1.41","@balena/jellyfish-environment":"^4.1.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.178-renovate-non-major-73f665a8031b7ddc0f81e6031ddf9ae527454589_1620064237273_0.5533502128016061","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.178":{"name":"@balena/jellyfish-metrics","version":"1.0.178","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.178","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0ed01091949e02dd9ad36c76b2fe4228a35f1f28","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.178.tgz","fileCount":15,"integrity":"sha512-rkRy2WE+DTmdfiMKtPhg4ge99mf5oVkYW/VnTro3fqsqVrRbxG00ClT9xQwwz16a3fOnsEgm5JRpKEMiT3Fnnw==","signatures":[{"sig":"MEQCIE65MKoIWqk3TYfnYGXso0yfrv40v5yyEfFPYdyaD2BJAiBHJszbU3U1B1CGCQhcy8pQA4B+fnR8ryyxpw3ppX3W1g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94967,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkDjfCRA9TVsSAnZWagAAEg8P/RmfGlZVm8tx/CxNGShk\njnCPdFsGwXRYoAC9HtTC8okC/uF4XLzaK1Bn4UUGPxG2ACaMPXSU/3ryRsCC\nMWv8zLZiMQHBW5rYOHG5R668IoAZ02zstdI4keHAp3eGYKatMgQYOIj/8Ad4\n2T2Vr16xLdZXsW42rgTeFJzd1dUNzQOdENr+3HRUpRf0AXy5VVZa3/zdua6o\n6KWpFK0GhVI3zZJwj5J3XkgJagPDMpegzNPwsaBFgbjj1bF2XMwENU2oEIGp\ne0PUbcMxmi3pS6nkpPIuW3XqThzWrImfIgYBx3qOV0gs+KbR1nssnAPywq59\nZOdljsSd1+c9RishGirUpkoLLN7/dAFRs5enazPo9+GI5dydl3C8srP156ii\nd7XtUpgE8RxIvNw9/w/v1iZHIcqMe3KiiQCErHI0nGMUbe1ygjOjRxF5ePpt\nUlEAxlVachNjZM8PRwzPzLQu6QRn3lGn6YtA995IkH+xqch0e6JOMHUBOAtb\n6UCRrBtXam1XWJzEQNS+/4aYXWsK9f0IBxKzWiJswoGKh0Kcxcdm06Fw1QNU\nWiTEwi8KbwXKVcDXcOpfd96FniF5ZOz2rjbfJGsPi9GHtb7DVAxkl0tdLjH7\nxY3JMP9I6atdVvssB0665LhWH56Q/v1iDDYrVZDQpdOaMQVtRnQXDQniMSc4\nzb91\r\n=bvEZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7032aa43e120a3df39d1ba3ee28a74b6846a43aa","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.92","@balena/jellyfish-logger":"^2.1.41","@balena/jellyfish-environment":"^4.1.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.178_1620064479141_0.6273299330052604","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.179-renovate-non-major-464652627c4115aabd56a4eabd124c17333364b3":{"name":"@balena/jellyfish-metrics","version":"1.0.179-renovate-non-major-464652627c4115aabd56a4eabd124c17333364b3","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.179-renovate-non-major-464652627c4115aabd56a4eabd124c17333364b3","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"997d9f3d37d25a637b62747d08cfce2841e49339","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.179-renovate-non-major-464652627c4115aabd56a4eabd124c17333364b3.tgz","fileCount":15,"integrity":"sha512-0pIY2P2f1Ea+xaPPjJN3RFHDZuz7y9NFTKyrWZ753Ex0i8uXxsgLb6WSmh9QzXgO98MTzOQWstJDOCGTJdZaYw==","signatures":[{"sig":"MEQCIHoxZnOK3Hn4DUSe0MH9tO4yei96IOLCFF7Gl+ycQyUuAiB+mtKEGoneQsLZmMbS7rov/mz4iqPIbUysw8XsBD4xBA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95130,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkGRWCRA9TVsSAnZWagAAmloP/0w4ufHXjVt9pnljyQOZ\nQP7b3LGWix3eQYflimZ4eKY+1rmYRbkfE7MJbJd7E0kBMpb7nKvV2uRzPYHF\nZbwTN5IQYAz94iR573BGlKJyFgofR5jC+CcCxENPm9QHzq/4gkhEbMY0k5fE\nMO2YXpVQdtEXQ/KrFsolveOv/XaLXJafWGno9GmgifGjbnfbEq/wpaMWTf/p\nSQC6qK3DlEPU26FBOjtI1tJEH0MgBszOcCcYUVNvWZe1do79itmXeg+27TOj\ndTjpNan3hlnDrsYABUBxiYsdsWTMQIXma0PMpNUJB9lAdXmlTGvrCchS4szH\nVxoo7r/OztEn705YfXOdueKFyybRZk8gpXQmL3yEAMba0yeIaSm3K3l+Q3CQ\nMY3XFpGv1wqZbsjrWch7YRSv7fYnjUZWd6NxPFsRqFpqECEQ/zfuT1gRItjj\nl4R20jgc/m2cbfWXSq0LgWk/mLPtwomGiJEijgRQP+GKJiIR42TVxXcO35ni\nOI1TPariZgsVx/TFhGWwGA82FYLAidPzgmRnA6xK13ih7+BnYLXasfe/0Gh8\n/j83SFclSqZad9cgjOQYlArxV9V+IlMblPi4+KvfgvLxP5GTnNu+LzXhPlEM\nuhM0On3Uvq+OvVL5Uz9+40qIiFAAOG/0+pwF76NOqQcvYsSMf7eUqiazGX1I\nZOF/\r\n=m/hP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"464652627c4115aabd56a4eabd124c17333364b3","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.93","@balena/jellyfish-logger":"^2.1.41","@balena/jellyfish-environment":"^4.1.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.179-renovate-non-major-464652627c4115aabd56a4eabd124c17333364b3_1620075605929_0.10359940277497803","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.179":{"name":"@balena/jellyfish-metrics","version":"1.0.179","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.179","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b20f201019028d5c9e0d9ddb48ba3c2d0ad76312","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.179.tgz","fileCount":15,"integrity":"sha512-L1RTn95H2bB6lAwBAzYgUPBsBiEAcSCWbQX+dHn8HirualPf+whLJ923L67V3FtURgKd/y2XXQI9zBvN6yAscg==","signatures":[{"sig":"MEYCIQCIcOSLefQdSfZYNMum2oW27bAUt/yg3STwtRrjOXwbDQIhANgnasY7WXKFMxSiUIPtVde7041A+ds9/KcNN1SFFwsG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95070,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkGXUCRA9TVsSAnZWagAAuU4P/0sw5OkPxW4HJbLqVkP2\nwP0SrlAT1ERVE/S/hfmYyAC4QHVjKX/sbon/+G2qUvS+JBhdBRJELl6D2nTu\nrx3m2ptUjZgD9gcyCA/JEVewy0lyMTl4Ys/YzSWtWQtkcQSyxtAZVlIi8+FS\nTyt+/kh2N0wibNI/gENs8M+6Su6VuX2ANN0ODRJHP4taNuS867/YnyiKj964\nCuz6ahTbLvv3hYGnqVJA4lrh85fH4ReBGPTaef9LqVxmhOx8EiMdSDBw0GrN\nAyhJ0k8kTkZQd1GqFEQTrfpCa3SCx9yzfTGLmUqBHvj8MtBicvhWLBxyD8dq\ndfcA3RlT83OnQ2cz69+KF2/PI9muWxo/Vk4OlpefG1KoA3I9n0PxnXOCrXme\nbYeHVzxGxgWaRZSQgCskiGlzpZTZnCDXEo/ATpEXsi4jGAenIDWHcet1U+4a\nPGFZQNNDlu2gI0i8trLR2e72/8qBy6qHRP68yTGstwOCqqjikCHdGWDftYhz\nVnHYlwhf5nlN+IqyyMZ+y3rA4Zu6e6bwKhLf9hhq8au/6ssk4vtKbW7hJ63H\npxoQXKbJ1WEU311BfdKR3Ke4VPtIXSn3JMd31Y75FBl1jRTMAhVsfWyvizCK\nlAhYDYEGB3HZA4Vwq5dkPETfMWSe6Ze4E2+ERGUfFpitdWvc8ejgJi5RrdT4\nGEEl\r\n=C3lP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6380dfa5c3a9058f76ae151260e0dea55b0a40cd","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.93","@balena/jellyfish-logger":"^2.1.41","@balena/jellyfish-environment":"^4.1.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.179_1620075988200_0.01921707278333784","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.180-renovate-non-major-cb1e7fd7e530d51cc4c00ad9b23a95e2fa732e0d":{"name":"@balena/jellyfish-metrics","version":"1.0.180-renovate-non-major-cb1e7fd7e530d51cc4c00ad9b23a95e2fa732e0d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.180-renovate-non-major-cb1e7fd7e530d51cc4c00ad9b23a95e2fa732e0d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8ac5d8407e00d78376453c8b252fc364f4996bf2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.180-renovate-non-major-cb1e7fd7e530d51cc4c00ad9b23a95e2fa732e0d.tgz","fileCount":15,"integrity":"sha512-Wl3gtMZO9vDUJwj6PKSQ5ojj1KOCtgD4nkda8fn5JipHJDe6R8Ys+PqSzOKgFoJbjZCsrXm45t0aqXAlKQrGHA==","signatures":[{"sig":"MEYCIQD2/BO1Pdsvpd2BkTO0eT1SfpAWEG8uJh39eM/hyx/2KQIhANifdW61wrvU77nve4n8UScbtFrrNi7j89I44MAgJRUb","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95233,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkHodCRA9TVsSAnZWagAAsmoP/RRDvJmCOfOvzJrztQNR\n9Io/kZTKvbv5jVEOiZQsr60uv6ZVyHcq1p9MkbnaUQCslFJTecmHDy+Mm8JC\n9l4utyNhIYQ5tyS68rtXrLGW+1VUFcbfommO2MAN+vSw0EYc6B8Fp12jp2Aj\nIZO96xKzwu7Y05uU2N61baW930BBe1JNMTzWklj/j1EVVof0MsG6lhWi3XMr\naTHd/rHgLov4hdoZl3IyvJ2l1Nzo0vwTDMbZPa5pYYH/UE9tuao7qj3J7V7a\no3XRJM8y0E0dCqDbXv47V4iutrIaroXxaVHgECUtsyxdSxLevLBCT5jTeeLd\nbq2NXnm/9cS2iyrYLUrfT4k3XKImgpUNoQZt5XdwxBEmv0uXuT7E+nhMJMKy\n0fPJtq1/PoQE+fnYX2zXhoF1eM859Nt6QMsvDz+PIm1nmUly+7Z42kg/gWND\nJQ89o5KbwOvq/W2g9w6NH+DqEA/ogq/vaovUDT9LcASfyAMF9t4KOgjJYF18\nABJLPdpT5nnB4hCma9uagsOseRSm5PF6Sh4YNOCv4Lf0y5FgvbDs+NSAH12f\nRl6m3wq7ZgTz1J8uYcRS4JdYujyzGmFiFc8dxV7yPJisb561UZ0qFCyT9Iyz\nte6fRLncHlHKKFuXegZvWxDEzUJ3iMv2BOBjIRA40M2Nict4QSW1DDmLgy5n\nAtq2\r\n=Ibsc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"cb1e7fd7e530d51cc4c00ad9b23a95e2fa732e0d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.94","@balena/jellyfish-logger":"^2.1.41","@balena/jellyfish-environment":"^4.1.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.180-renovate-non-major-cb1e7fd7e530d51cc4c00ad9b23a95e2fa732e0d_1620081181215_0.07336378334591909","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.180":{"name":"@balena/jellyfish-metrics","version":"1.0.180","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.180","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"68ba1635d74055c5a0313b3cc82f43e3f3aedb00","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.180.tgz","fileCount":15,"integrity":"sha512-Lcz9IVSJ3yLwwFgz3lVYbKnioBJNHRuaYbl1cgddVnWNfC0Y9/3oUJm6EZuP5M/wjZNmjclG8BYEydMa7ypmjQ==","signatures":[{"sig":"MEUCIGzo3qgWWVjkx2Za6rmvJWdRrhs9BlNmydbxoSz3zQ/DAiEAoS3gpF3P8g0xeoif+tJrzPje0lTTpCdoFOq0x1Hrdgw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95173,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkHsBCRA9TVsSAnZWagAAqWMP/RsEWv4Ufj+U0C3ot6HA\nAT1zm3Rv4s//A/HZHhxTfSOeLyfYIFC5hwowXg9pyq44Zb9pARbXhskneIMW\nrDbwQhLcUphm+9lYlbRFzDkjL6ZYbgKAlA+JVNhXg9pxZNGVeDh4FKHU/mtL\nhV4luVZLz2566P8pnxuaVoxIS4EpjhrnHZxNLkWNaes/RVp+VfpHRLYKT9eM\nx940PZ/HQrmoUWs7KoH7vMtTcAAEyIsJ59+cTvLx4AwLS7xt1YpC2WiAo3Yn\ncsyUGvptjnrr9i8Lqb71w59iEnGZErrv+WZfB5Qy3YcMLXK1pyVrWHWNsso9\noi003yTvB/YKpOwcTY/8yngmBbQtijO+yougYjANjNSSAet2sHtK+r74tY3C\nDHpjOSDUWKc5lzbfpd3rtEEAZwws4MgdUHDD3MLgwdNYgw3hcwKZFblIIkXw\nwfGMf2P8FQTe7dlk7YbwNnT0e0Re3UtDSdzVcO1VlMfsnMpKOnYgSUheDZFk\n+pG0llARW1OY5O2iq7dEpeToKQs5eUreWjcmgrpC2Ahz00RvSCbw5t33Iify\nM7rMOK7rEmGdcXtbEBW29BIkixlgLuaV/89xORFhGHrMnaF2MLFhUlsjyFya\nko4Jqw8xRbpM9Pry9svLyF2fmane0H6Gdf9HTf6/XMWwoBdaYVKq2XPVfHxs\nN2KP\r\n=0NR8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c88896d1e4301d6e337b284fdd29227850d50197","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.94","@balena/jellyfish-logger":"^2.1.41","@balena/jellyfish-environment":"^4.1.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.180_1620081408679_0.381053451083019","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.181-renovate-non-major-8104835bf3e615e3b967a56ba3351b9b0ac036de":{"name":"@balena/jellyfish-metrics","version":"1.0.181-renovate-non-major-8104835bf3e615e3b967a56ba3351b9b0ac036de","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.181-renovate-non-major-8104835bf3e615e3b967a56ba3351b9b0ac036de","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3eb37089c7b6f9b241915c1dfedf45cdc978d680","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.181-renovate-non-major-8104835bf3e615e3b967a56ba3351b9b0ac036de.tgz","fileCount":15,"integrity":"sha512-Zy1ymOq9+O5L5/OpBnGtjf6djMx0Lu/GsEuqX9wqw5fC+hSEyvY1gTZSJQG3nGutw5IlwxzRttqF/epP+mDMRg==","signatures":[{"sig":"MEUCIEZm/L6Py7dfZVurcfx1BVgU1gAXLByUmFNQvAV2vFgaAiEA1JL6tc13W5wOcNtenSaBJaNM309p/BgOLMGpXxeqYEk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95336,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkJaMCRA9TVsSAnZWagAAon4P/iv48YQ6NC/jHk1VI8BP\noyC/wYQznbI7O1JeYGw7E8bg5hOKAJEDiDURm4r4yLlcAHRar5039tOpCELB\nHuFxsDQGqoPTLaMcUr+yGIBxJGW2qQlEWbz3VE9XoHcyvTH6D9UqDUTgKALL\nKM9dj5LhxJKCtvtr1UtTEis2M1d9TjCT5M2/amQYUAQF8NlwKrA0v19stYAf\nLCCIYYU5gDNKEKvNRXtQdma8umkopeh9K1MY98KLnurGyQ6jig9BSdHskmpc\nxS+SPbcZre8p5Du3ocPzEHaKDK5Lf0+4K24YBHPz4aamLwffleF07F1UTiUP\n2q9YUnM+4v80XRzhgGeZKhOtRpXrKdNAH3N0kJP3MT0Gmopmq6x9Amye2Gzu\nxI7BAr+luRuvDvDNgzc8t49X4TwX7DzHUGQrazAwPX1OChVpCx5/7gk3DCBP\nDR16cnyH3IBnNm2D4Snw06Ea2ZWh57MM6GQPI23yen4fzSy+NlE73yGR9Fsk\npjNEwIp/5g+4fyTTE3UQEqXTni7mGqnqGVL6HePEMgFgLSyjZmigVl4G3DyS\nh4CGC+7VV0nW72mk5O+DdOQEx46FjJXnm1wRc7hWIcKMSCdC4MfoWUghT0hW\nQLsACrGDEXne3/um/UU9K0OCegdvC73kiW+afyqUKUvhHVakj3Vnro00KdT1\nWN8I\r\n=i6B7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8104835bf3e615e3b967a56ba3351b9b0ac036de","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.95","@balena/jellyfish-logger":"^2.1.41","@balena/jellyfish-environment":"^4.1.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.181-renovate-non-major-8104835bf3e615e3b967a56ba3351b9b0ac036de_1620088460319_0.40137078757928535","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.181":{"name":"@balena/jellyfish-metrics","version":"1.0.181","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.181","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e88927e3ed961dde932703a20e46dd8e8100ef1a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.181.tgz","fileCount":15,"integrity":"sha512-u06PnIfrmwMavaImWcGXcwFh/FrUgqdF4nQ181KDftR//+ar9kjqOP7tjwhcDth+ENeAYXew3uhSJeBLYpGf2g==","signatures":[{"sig":"MEQCIHOqmwd9zClm2Cjqqg3bBZ0T7kPnqByEvXV//ubGy4BxAiBINniGi1I1YZv4m9GUd5uIxlipEY6W5eQzbNa0zy8IBw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95276,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkJd1CRA9TVsSAnZWagAABvQP/i5PK2r+03GWxScLAlkX\nn+drkZHXwN6M6jI9RoFN/rhAocsH79uHJIJixa66kzkWBPx5Bl9CU0lFlrbS\nVA1jn1sMcf10C8uFoyMVjYRKxsgTwUBGQe6NWIKkua7KpEES2AUCIgEMRbJA\nc4ewxFJQIvotbjoFXyIPpZKibUT1weTvMGcKeQL4fuDJeJNpRqo1XiDpp0Ll\nJZvnvUlplwIGl8jFeer/5VdztYfiwnExkQDwa8He7aQusoWnKUlQj4Sc21LI\nbG0hTaKswDda+7jz/m8X+dgGCO0yk0ISZHViMXdKiCZrUdvapE27aUvI1UTS\nCCwoOpg9KEGpG9fNA5glIwFQw8de3VB+UC/T5bRHOLwe9k1h3N8Q8xAavUX4\njfzYbC2WO7qqqH1kkCZamsjk4FWyTM/7dA78QFe6Y1r56Q6+EXVbbqEbg/z+\ngyIWw8kXGc+MwhS7pa7r2Dy9SAX3Yw1M9RqgEuDTLI+ahuwWCqBRJV8fBrkQ\nciV1Df57MrYoebc2RKup9kbCGpAtHyDtvnagLmJXATZqEgYNMzQczQ6EvtIZ\nivHawbJJgfKvBeoV3EyVdJVzdZi32mOIInOwoHUFwo+6S/p5FechKTKtD4sv\n+/Ej7y8/Wc9UUmzaw1LL3lIni6V0Hs7ZIxzw1qWriyBsD5Wof66vabq+4UVQ\nkrIv\r\n=G1fN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"bbcba2868f23bcb5a0ab72a991548c881f8d2eb4","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.95","@balena/jellyfish-logger":"^2.1.41","@balena/jellyfish-environment":"^4.1.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.181_1620088692686_0.7829945456807668","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.182-renovate-non-major-d3404a647e784214395732a08af67ab6a13f71f0":{"name":"@balena/jellyfish-metrics","version":"1.0.182-renovate-non-major-d3404a647e784214395732a08af67ab6a13f71f0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.182-renovate-non-major-d3404a647e784214395732a08af67ab6a13f71f0","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c4b9709ab8e087b6280e38fa7fef35ee243757ff","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.182-renovate-non-major-d3404a647e784214395732a08af67ab6a13f71f0.tgz","fileCount":15,"integrity":"sha512-XT+BR0xv21z8Pf4Yc/DbyLsEA+rqynr1Db//oexnoVfCH4q9p/EEijYshwF3dGh+lP2PC7EvOvpIGhcYeIrW/g==","signatures":[{"sig":"MEUCIEcpLyNelDJtIbeY/J9m0iPL1n31cS00FZvK1L+7btOXAiEA3BmIqdR0gcxY7yZhHHWG3D1EXgvjBONWiSkeV9WMfk8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95439,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkKbhCRA9TVsSAnZWagAANNMQAIFAc/E2JCnp1GDqkkmt\nLZTRcG95K8LeVMKNE7jMRAvwFLSalE4xNnxeCAAsTJKIZZbevS9fAqIYnNjq\nnwnv47/+8Zt2tbtWN2PIedoaY+Crt14+/7FIjhUMFs/QkY4VMWbJYuroFJWM\nKzZE+yiJwutEO+/wOCx6MxlaNJca/C+SxrYngulQRM5vSQhqayVQ7+3CD1yz\n59PkvkoadkSZ2/LEhB+/qAgASoseFQVV+N6bd2QLziLm+pnigXAKHqkSYwJQ\nO+Fd/p7Mb7pQ45ZqM1zdKCxsSzNIjOkENaQFBZvPgMoVHwD0FrTTqcqlKmZ+\nt+TR9s47cq8sXA73QzhONvLlRU5gQEk9SA+OxwdDmmrar0IJdwd8ygvljICN\nq8hNGXPVRKY/7dreEcRRM+W2jPklb+WXqzLNE6XJJGGWODP3FcoZWLqJHQ1H\nX/qjjcR2HF/kt7HKrc3WyBHnLsZNQhUZx1gRYylN3n8x7gRQCNKE7QAvDfMZ\ntQA001jcqDSuLgNYVCBS3AcvQ0VhqZVaCUuVQnJ1nd3U+E8lk/TFl2WPXDbT\neKsK/k/NoAdcGRSQ5GqGe17Z6jLdkxixo252RwQAi/VFgUvlj8JF4CaIYTHQ\nG2GxPZt5AzW6O7q8MggKJpxtAmJebTws84yXY81FjgQ0d95sDj/7UoNVCygD\nLCzY\r\n=PALQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d3404a647e784214395732a08af67ab6a13f71f0","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.96","@balena/jellyfish-logger":"^2.1.41","@balena/jellyfish-environment":"^4.1.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.182-renovate-non-major-d3404a647e784214395732a08af67ab6a13f71f0_1620092640793_0.2048134695102113","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.182":{"name":"@balena/jellyfish-metrics","version":"1.0.182","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.182","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"26af261e9077adf4aad8427b2b4dc1288144301c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.182.tgz","fileCount":15,"integrity":"sha512-qz0Ad7Ngl3YoCaNNfQm8yOtLRtymo2hIjQKpgEkI7XXSLjP/O+3nOs3R2eUWz5IU6A4Wfjm0uT9DU8ioi21JAg==","signatures":[{"sig":"MEQCIEKKtaPvlcqYY8oIP9Y66D6xQEy3aJwtX90wvpgDX8YIAiBPIRz/QH7w2V6F3xdHofvYolLA6rbFUobexLiM8avdWg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95379,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkKgMCRA9TVsSAnZWagAAr2oP/1mlamHuJXK8/UYG/dbF\nb0FYq85ffvWKLhUPPIaaRxd5TVGI+fpuiSsH3Ddw1j1DdxRWQYfkGo9FYRNP\nc3tbRm44GDf7sw1Ql9dKNHXBuCFl42Pvjw//U+ERlYysG2mQ24cgfLyPsN1J\nUtuTnqoAGi3a75WCFuAAfB0UKs5yJ3Nu86ekv+J5nbf7eyAyBdJ/9gE9NKLd\nopenp6Qy3EPW973daljCDvJCN+xY3h2MX/e3l7luzAgBS1ZQ1MJvfp+bn1aa\nyR9QDBWsLundFgukAlYrUWe0ayDFZssZIqD2xISqaH9aZoD2AmrLK4z6/QYM\nNSKf3Kvs5Ud77oL3Av1psjoIQpeTG6YVkjUym8m12t2xnKKzwGdHIaHm17nU\nIQ08K30Wdx7DIig4Apl7Ad160JD8IDaowuqiNyM4HiJKosTH2FQpt5FrWQWu\nEP9dHse6RqizwmB172GYEyDhFxlVW2tSWsOX6VSIi6JzW+Y95ZabhfTjpxAz\nDYXAJwemT/ilLVDftx3k9L8SJ8cV3DE129YrNFPDjJlvWBkKVrTP01HGkCWs\nOkE9wRylp6lKQW33FVmwceojlQRyj/AFbJgOzMFaUIbOB7aHKhbPPla7V217\nwi40ZSCOuj8lqoS3Z2wqAQiH2AERzSzJg8FTJqo3W8/g2nSa5J5bhePB29lG\nvDvc\r\n=MBUC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ce74650da01ec693d4e578c6b6b68e7848bec02b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.96","@balena/jellyfish-logger":"^2.1.41","@balena/jellyfish-environment":"^4.1.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.182_1620092939979_0.5772198878539452","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.183-renovate-non-major-3363bb85b6c81d604bdf2bbd24f8918f4e72a8d4":{"name":"@balena/jellyfish-metrics","version":"1.0.183-renovate-non-major-3363bb85b6c81d604bdf2bbd24f8918f4e72a8d4","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.183-renovate-non-major-3363bb85b6c81d604bdf2bbd24f8918f4e72a8d4","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5c23cae5826e13bfd48efbf464424e967b8233d0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.183-renovate-non-major-3363bb85b6c81d604bdf2bbd24f8918f4e72a8d4.tgz","fileCount":15,"integrity":"sha512-ykUc6XNWs+cWQinDEbpyNdqn32hDZ27wa1pg7YfLA6JKQ5rBDlgfOLOzwWQa6WV70WcYkTI1sIi/vqIu8JvH5g==","signatures":[{"sig":"MEUCIDkH6a21vY1UYaHSKN2Y81oQ/AVohFhzVc0i2CSKLKRxAiEAi6Ek495YDbWDM2CeMPSliKSE/Kb+nSohtCWjQumeOOI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95542,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkNSlCRA9TVsSAnZWagAAEpYP/2Jb8rD0RNMQxIkVbttN\npIsHfXkQ/MIZwgSQGVgvhcG7XC0bzHm/1Xyf6ARecHu2YVo/4EzRkQhz2lnl\nlTI6PAPJDsKuKY7B+m/Ltk6alNfzFlBFKCNKfC64AlLNYvmiNVaZ9idLiLTm\nIZh5pUbbL6XSAU7YP+EiMxcdRihR9me4i2/WkqZ8xQNa9mI+3QjBx7gX2Bzi\nqLGq/H8JdYMw2k18QX5b5S+KGI2YWtbkHl4nkKiCqfiABLX5C/MKAdbbzxHg\nyD9q0Pvp8BS1GxjD8ytPPV96Bc068pvVhCpFaoq093OUmwcoDyURBJAcuujF\nvojsPoO9oPMYjHQYQODyJIkdUT1AMbFgrrwwPk33LqcbaeKtHcovscTT0ZkV\ntQMVTkcaYaafaWLaXfed2my5hKx8HrWRgwnPmDm0Hecp/9mk6dS5AKHSeoMI\nyGG1CjGQpVDjPY+mAonTN3j3Kgdtefx8O6yVcQAro2CjBUf5+z6by1aOE/WU\n2qJkizWCq/tzA+yayLok0Q+oM916jbCZAzbLASRcf4VPXIO3bz4y2vCVLCGo\nWvW9Yu8gQUJqpfz34bAc9kEgZEHTyo+p0Z45ACxxVoQoAfIv28zlQu7FaSx3\nEVQyTJjTLCa+VDDTQBse4RrCoHoDV58mgXOe4mWRgXI5vVZ4WiAGtTjl/qK5\nvDnE\r\n=VVrD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3363bb85b6c81d604bdf2bbd24f8918f4e72a8d4","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.97","@balena/jellyfish-logger":"^2.1.41","@balena/jellyfish-environment":"^4.1.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.183-renovate-non-major-3363bb85b6c81d604bdf2bbd24f8918f4e72a8d4_1620104356835_0.4414543610116226","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.183":{"name":"@balena/jellyfish-metrics","version":"1.0.183","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.183","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c33ed1aadabdf8e497efc185274e45eba1a09829","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.183.tgz","fileCount":15,"integrity":"sha512-0JMWH1Uzzqmdl9FzX2W+6CWg8MEBngsM755r4zvviACP29caTwQn9WocYU00OHx3w/8ng/O+AYuRTF75X1Vo6w==","signatures":[{"sig":"MEYCIQCI+DZlE3mNKFf+xxO3M9MbGvJQNf022LUjXtAn9fkHCAIhAJs3J6CV068RbjDcP9DKs9+KDlOwIXD/SQr6dYI0m49b","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95482,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkNVzCRA9TVsSAnZWagAAYsIP/Rj3pJgjCjOX9cI0wyvc\nf2bybokj/Jhwr7CDV8nDGWwObnSf+eQYG2E9jsulkAwyybZ6txe1A481cGWE\new86u4+2q352eSwge7IKN6e6j9JZf66IKjb2H6+4YskOAxbtNmVBsVg2TPeW\nw1n5xBD02fqJaKLQRCrfX2iz1ayCSPbebpNV65Qar3UebNKvNNxbqiL8XtTU\nFxALyAunE8RFoh70D1aebISoZVqX2+PBESNG7QYROe6MqgUM7tOP13damv/2\nZyn3o1DBrWf4+j9RZQb7Bsw8PokgzoczUbUaC857FHmQSRk6Clwk+UgGp1qK\nexYqo51pVEX4hkPCbKk17BOsCGf2p8Q0EvPkgq1wQ9vCOGPBqEU7rLRyBY7o\nFmaUOqhyVQoFkvM1gFJYr33MtAk2BF/RsF9M8lxwNEXbXA95qKi79xskjIzp\nCyxVqTrFCL8LEodfOYbeusBfAV6OhQUgsy170RT0UDKohVlLmkbRk0vz04vz\noDchDjL5/42pmPRNYq19aUFWDpGsTPe5ptOf1tb3dYGUKsCIzCwN0bxu2zPY\nYhl0SUuQV8bSsTDPS+LBwVEIXoUZdV/6yu+2xPpTCm41bqlyBUwin9qSMbAT\nAxwHqIITt2WEBvNmYB7Zc9ZaBVAdewhxBm59QQb64U10C5RRVthens10F93O\nYUDy\r\n=x/dl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e4b4c999bd1807b13fa5d04f30b4401ab39f5f43","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.97","@balena/jellyfish-logger":"^2.1.41","@balena/jellyfish-environment":"^4.1.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.183_1620104563036_0.20980787429095105","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.184-renovate-non-major-b3817519cb18483bd2940aa46ad7b8c07bd3522f":{"name":"@balena/jellyfish-metrics","version":"1.0.184-renovate-non-major-b3817519cb18483bd2940aa46ad7b8c07bd3522f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.184-renovate-non-major-b3817519cb18483bd2940aa46ad7b8c07bd3522f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"31aa877f2c21485a10001ac545599196f4b6d33f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.184-renovate-non-major-b3817519cb18483bd2940aa46ad7b8c07bd3522f.tgz","fileCount":15,"integrity":"sha512-vtJGFytWIUBx7wXiCIrGlyX/NbCFlkqgneKEFqL+1xTNqzfR/peZMrZmUPJU4kzG2UEWxNWvpmjUBoOQlGvr/A==","signatures":[{"sig":"MEUCICplJ9ElK3JI7EykV5bzqrkEx9BcyNpVojPN3zl9hAbPAiEA298Dtojx/Xp6CJiCzpLMcnRY7n/zE/AUAbuD0SSrolc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95645,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkPgwCRA9TVsSAnZWagAA6a4P/j1u9uMa6QMlfWnaL77u\njMswlB7EKT/9Xr5l8xJ2m41+Jo+oO4wlz3K5c8l/YCA0e/iSwTJgpag4UeSF\nv8rZlcYnUd5bWmErC9IN1tKGZHxT3Kyqmzf/NgL07Ke6H520rkUJCKxc+VgK\ngy9y6tRWVDD6E9uCJWE4759Lsxrix42ZAg55ft8NaZqL0vy/0XGvEjI6fy43\nTClWCV5YXsUsiPgApcrDhppgpGxZIq5ZzMzOZ8HLdB6MBupXkdWDPB+efLsB\n4GRUpC8wjx7ADEpy2Vx6FzqsO9bPxxjB5tvcF6CWzSExoxfP9GabedwEUCk2\nrXLRyDD6CKUhF0Fu6ZrRucmskn9XQwOqcDfVFxRbTDdcWZBNVsFDo8gHPxHp\nwSXWQ+tGsazlQ5WAbcAo7VbzkBVYi9mejPB5yiv3OlCRXqEz32+fTLamb7oS\nFjOb2Ah8zZbbvK4TAd4QhjhEk3R8v52tiQ++dZzQmqtuAc1WVOKj5Tvj3CDE\nWJdmAJFOxQnuVMNIw0Rc5DMiuhZneiUjCJ1PFQiz1HuFVlfZbS+GtLLzJhD1\nIZNY0XFlNz3E2blx6M1FgUrKT9HNBIzVPmpTK27OTOneRyEe+i47xGCwKTiq\n8DVrBMfHRpMf3m7/cb4Z3OYy8NeubURWqSovlu4WLboE25evKXKBT3lZQ/1B\nU8E6\r\n=9X4T\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b3817519cb18483bd2940aa46ad7b8c07bd3522f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.98","@balena/jellyfish-logger":"^2.1.41","@balena/jellyfish-environment":"^4.1.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.184-renovate-non-major-b3817519cb18483bd2940aa46ad7b8c07bd3522f_1620113456011_0.7967835588591998","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.184":{"name":"@balena/jellyfish-metrics","version":"1.0.184","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.184","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"dfd993daf6b594dcf5b4c2b1f628eb116175d91f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.184.tgz","fileCount":15,"integrity":"sha512-a0rY0t9m4LqcfCSzn01EQEyV/dQPExtPvn4pBIlXttj0Ef5D3xl6uIBscJwUxyE9PfXfZ6B+xOAdclGHJBVqjg==","signatures":[{"sig":"MEUCIEwjvBXnIOxHdFrRBNPic10pNeNpG3I7IsKfNHN5gxRNAiEA6rx3oqNClXvmF78LezaSdqKsrts20xpv3uOP6Wyi6EQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95585,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkPkSCRA9TVsSAnZWagAA/skP/2csTjBnm2Y+n58UUKy9\nCrD3VA7l0QsL2anP5TKElUn0q+P8yAep4ukTuZ7hwWsFUDA8yCZUWfzZzZTl\n6KGaVI/hDlzcKnYQJn83bQyLGxQFI9gxfR9qPF5Ti6IdW0txQKdQCdc/tnMh\ndJW+AZ1f20HR79d670CmluCWUDgmogyc6nIKdYNFgiBNVrMAu5tHwlD2pqW3\n0aNELHqUGW10RNz/+KobJJegHdaoKK/wc8DeesHWPHSpI3/iuhSgtZBsIyZH\nk2idocbJe5F99aEAifbkNYNP9cpIxDrC+rS7tPlCRZvKJcCvGOF47UMFS5ZG\nUSOmSKOQ+NKlxS+DeIKbe88mZ9pm8qMD0ptSb3ZElR1K25foed4t0O30E9wI\nzYBK2EENLaMdnW7v5csGHauLmpJ363OfF789z5h4fEnKOtUnXkxwEMW9Akvt\nZmbgcw8VkTfypkWA3iqEt0IVNrwTOvqb2+l8OrQmPWSGOCfxaP11OeTltQ8g\nU1r5EmVQr9Wqu+a6eg2zRDolUZRn162QoS/Sn4c7BdMQLYBOUF4jJRqB/YM6\nGn4w1fH94/8IhUlkgvk3mYxNmGS34IgEYFR2rF2VNJddAI0Uk3olGeERQwl4\n3N8kCU+duU1eTEbYW/weks0E3SSO0qktEeKOhMGZ57IlbafOIEf+iOYlFjXV\nIQmn\r\n=lVaW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b304ade42557d07f0be50dbb6d58ce9047cc681b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.98","@balena/jellyfish-logger":"^2.1.41","@balena/jellyfish-environment":"^4.1.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.184_1620113681632_0.34118503654192045","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.185-renovate-non-major-1290858bf9a16bc98337ca1448e97fa0637e0eb7":{"name":"@balena/jellyfish-metrics","version":"1.0.185-renovate-non-major-1290858bf9a16bc98337ca1448e97fa0637e0eb7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.185-renovate-non-major-1290858bf9a16bc98337ca1448e97fa0637e0eb7","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"546f0ff2f404b4d27a56a7c75ba3faec52754953","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.185-renovate-non-major-1290858bf9a16bc98337ca1448e97fa0637e0eb7.tgz","fileCount":15,"integrity":"sha512-QjAyHNRFuIejXBoORwmq/DeQ3il4+BoYU9AWeqDgq3kNQL2E9Ofk0sBaSvd/EuqJ1K+M/6Wlh+yFFN1g4xBKJA==","signatures":[{"sig":"MEYCIQD9L6JDs8ju+E09e/g5nTDcjvjoLQiJMOGL3vpLSHW46QIhANPw6GFE2mICEb+ij5n0X2SZhOsG+QT/ZF8xFJwbN1Fi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95748,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkQ8KCRA9TVsSAnZWagAAwPQP/2Pn4ALqJWNin+/Qctms\noFEhofxhZyye8fUjA12/V5wGW/U/OHMvV8dT1ecyfI9AVWh0Ngkw3o+/qMn9\nXqZj6e0KP/XvJxgkeA5U4BkAgV8MDNqVnGkMm23dNOT75MXt9MnAr68DUz8N\nMV5hGlXwLlh5IF2YMb0ILxq+EDgtI7qstVGft9Y/gwu/TcCIJ3xnGbVETOCc\nY2r7HRmukvId7JkvoecHGAk2lyynt6OvfskgAdKSXZGGF8/q5KH18JD2eFOA\nnesCT6xJgq0MxvFOpH1jtIcDPTnkY5Nm6wNR6T7B4MbwF/72bPpIsUJpUnVg\nfvyJBYyNRRsI1UlC/33nwR0JzGlnQEiEkx5jBKtjppMwpsBwRuILiMBMWA98\nuL5xRF0aEtfmnas7qf7GmnUtNSheY1dXdthE9WLr+dM0o+MDQSofB/ePwpry\nVtDKJivLHtIGeL6Mq8NOloHz/w/yTTMCFWVaE6gfhub8LyfDBvBkGsLmxETm\nY0FBAkQWFujJB0QN9zCdAPlSNw5mlC3uUtqfuwxV1kcnGLHo+w5honRboq4J\nsGS2FsrhL0K0W5KwiC5jT/RN1z+bJblv/CVesncP5Ws5yOKYsnQXvxa5g3lI\notOGrltyN5mTK7AKfg5P4ghQyrge7gvI95ucbLyQwQALNMUamF+AIZL2lFda\nvRjs\r\n=dfSa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"1290858bf9a16bc98337ca1448e97fa0637e0eb7","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.99","@balena/jellyfish-logger":"^2.1.41","@balena/jellyfish-environment":"^4.1.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.185-renovate-non-major-1290858bf9a16bc98337ca1448e97fa0637e0eb7_1620119306514_0.08033473375845501","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.185":{"name":"@balena/jellyfish-metrics","version":"1.0.185","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.185","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"07dbb1b7c776bbf180b33579a86d13a25d065652","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.185.tgz","fileCount":15,"integrity":"sha512-fvF+BtwOy/XMQB8Y+xbkriTIxGumHq9Zxio+7wyGYjL444vympkFLYpnlHAsS08Mszos1Ci5Yl3g3Uw/asgZfQ==","signatures":[{"sig":"MEUCICT7GlztlZ9uoaVPwz7aU15mY26DAWkBEt3p0kovRugNAiEAr6ZeJyvO5UNKFw7oLqA3O2HJGPLqvUoPmx0/DLzgY+Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95688,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkQ/1CRA9TVsSAnZWagAAdmgP/jUmqRfWS5ZUu3DfBB86\npi+d9dL3dUhakrbD/rYPbTXbyeJzrS/Ryb6BQpt1b3sM5TSlpEvuAq8C5HJB\nygcwJMIU95dHwFHYMQeXkKnP2zSxvVQnsKIaIGvQZOeX/T2xGHvZvnLqMW6r\nBqKrpj813gUX5eNQW0nNl/+42eJ+ZZEMcBY4JS7jirF42C6Dp2el+rNLHdHV\nxrIWVTbUzDqhX1dPFOxdPpN3wThzv0AA7m0yIsBuA56cRBNCf4JCDaCCRRrk\ny7FsykYFcKaNKa+nkJF6gR0mVLKNjMSqzDNX4ST/xWkn8eb4zXLPldh7MWHZ\nP6BQ2Ifu3Kveng3ljrZKIICGkgVeJtAokr7PdA3ErrwtbUWFce7xANXzZW4l\nWCUEbDxIamTvB5n1yHJCngbPLfvLEmrzCBwSZPUFXm0zspiE0y7fdYFRUxcP\nkUDETMoHqcKf3+viVStnsShjB6PA3jvGdWEmRRLaAT+tJljLjEKmFW73cLY5\nA6jE89hGxMv8SnyzmkAGq8FvCZDOdEnDEhRL0FbYLRzYP14hvNC7bsypfY3t\npo7Mdv13leO08C4sPp3JPtKWuHtlKK9SJEGTbbsNHQHdmf5jXaUVZ8Afl0Pa\ni+uKvPQA9QKvtrk3bQ/kI9WpFX00qXSuvDkRYsX7MVNujWCu7rpt4UJg6hoa\nvYm8\r\n=uV/i\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3db092fd1fece44cf2d843b49d5a15273a5f5165","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.99","@balena/jellyfish-logger":"^2.1.41","@balena/jellyfish-environment":"^4.1.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.185_1620119540527_0.6134292326857018","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.185-renovate-non-major-c92fb16874f05bc3d216668ea9cb6f7b88e855c1":{"name":"@balena/jellyfish-metrics","version":"1.0.185-renovate-non-major-c92fb16874f05bc3d216668ea9cb6f7b88e855c1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.185-renovate-non-major-c92fb16874f05bc3d216668ea9cb6f7b88e855c1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6a52d0e7deb1940867465f6cd177f64c132770bd","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.185-renovate-non-major-c92fb16874f05bc3d216668ea9cb6f7b88e855c1.tgz","fileCount":15,"integrity":"sha512-jpdWBS3uwJjv70DHp9hnUHEJZcT/4dVdSKulrOlXCSkNCen9iUwFtm7qToe7h2U5lCTsGxDY+nZ4Ogc1+tEc5w==","signatures":[{"sig":"MEUCIFSK0V46/Lw7aBSorCx70ney0VbTemmD8KDFHvLk8f8PAiEArgVBq705aKEN4VR8MAzqPZjPWfsq63oGEvpkZWmpfJg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95827,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkRDUCRA9TVsSAnZWagAAv6wP/ixBe41JKhbZg2nANR4e\nXvYu+QlpEry30ismg8kRf1g2LwpPplpOXtqYq1WAwIOicxXzcut+oWwu3pCw\nFAAwBpuTXEu8SqHCkvLd8Xem9nM04B0ofhoPP4JXbqyh+FB92XHKKc3ILqzF\no+PThbc1EbSEBzBM6SRZ1Gkp4J5SMyyUdAMGyOx8yoHBrhMtelFHwZiD653/\n25JmKpDioTZpRdnlNFaR7lAmz5UQutlSg+X7kIafVyItCs8b4ZjNq5fLP4co\njwL0WrYMPem6slxxL44uJWUR0QkYv8lZubBp6QbOu+8F6r9yZMoZ+xOqXMK0\nAQg/zl4mSb37ehxhQbBsluLwHTB2DL0otI83n7EblDPhag8vMP3JGdasW6Ou\nYemCt9VyS6zlQqnhqKeT0iMLYB3sUwVRjtRlNsXiqxlFhzmz5l+zjtO6AHBa\nh3k8RCUdutbskV8+8WEzV0zfUgs0njzTj9jYZYFzPC48/LdTUzlr8vDa2WZF\nIvL8xZJ/0GnOulUiSjMrC3HkntRlaHQjVENHrptn0G8MMx3FK0JfcVZYDhfr\nLP4szl6JxUDHQUr3MczXbvrjlhq2qHvRCAxLJnlOsR6vew0wXB7PuIfgDIcy\nOaxiSPnvSq6uPGi0wHItOxS4doyVXJIZSP42+BO/1Vkr8eCwj/ojyKLk+4Ci\nLoc3\r\n=oYBe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c92fb16874f05bc3d216668ea9cb6f7b88e855c1","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.100","@balena/jellyfish-logger":"^2.1.41","@balena/jellyfish-environment":"^4.1.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.185-renovate-non-major-c92fb16874f05bc3d216668ea9cb6f7b88e855c1_1620119764509_0.7740715007762604","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.186-renovate-non-major-1ea50111dc9750bcd4a6859ac3f4c9f5eff7a087":{"name":"@balena/jellyfish-metrics","version":"1.0.186-renovate-non-major-1ea50111dc9750bcd4a6859ac3f4c9f5eff7a087","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.186-renovate-non-major-1ea50111dc9750bcd4a6859ac3f4c9f5eff7a087","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f48d7e8ca933cecd1e9af5f71e3edaff60cc13b3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.186-renovate-non-major-1ea50111dc9750bcd4a6859ac3f4c9f5eff7a087.tgz","fileCount":15,"integrity":"sha512-Bn0R4ashxfL0PTCuWXbzlpUh0SDqYj+IGThwfLpGHkfgKqkU30w2oQC2fDC8Sd+JzCFD2z86Q2Tc743lxT7bzw==","signatures":[{"sig":"MEUCIHVIoqpkPvSzUYzQsHCt2eawKV0m4kOj22mJxKrz1RvyAiEAoBCtwYh7EtFlmq2UGcEMTiuPGladuvkCnBbchuygr/4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95853,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkXYzCRA9TVsSAnZWagAA/LwP/iPnevL5A4mJ9pGVn3yE\no4bMhlYTjx/8BLSy8tesdiSYpqmhCPMmEr47euvVpLinbViZfTcq8HQuahdA\nJNZj+2yi8Zd1g0T+/WTkhY7y7IxOsHkoFwZUoqu3vDHIE3jc/R9Q31Ra43hC\ndFpmo1LFZ7OBe4DS62Eby7bhX4jo/Kni6z4VnebqCQHLPNg9+UE8llwXVxxC\nnQ7sgv6fyVDAgVB1bCuYbeRPJ+MHU7TslYtve6OF/KkW4t0infOtfCuYjr08\nLVFTaVwWXbK/VvyJM/Y94o343pOFY3FrrTCHLXFuW8dupsmj4CdB5f338BLI\ngyfOvSgG3S9p/6sXWXioI5Wu0gSYmDa5tUCfl15ebOLDhwfLkRojc0G7NhGt\neHDEqyjr/vGjfdGW8rFs6j0vOL5fS2+hgIZPIkeY6S5PTMDti2k3N94kdCMW\nTs+s6Cyf59Ytd5FlTSC/WqonSfZQ+Q+0hY+UUtJag9htz/efPbB0i7htbsix\nB+tvoTBQ9VDqn2OfBW5ktz92rtLx6BqCY2HbfJ4dadWjVz6HpB39VKSrkBO5\nhd5fSnZTFWy4w8P8rbd2IxA0Os4yHQ6Kpg3Ihmz4Al6oh5WbxGWYlBRPMpMp\nNos/tsFhsOL7adLM8s4bhwbN3Nop9okYMyrxs7sMP8mtWHKyKGg/RMeMRxmm\nepNb\r\n=Yf6M\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"1ea50111dc9750bcd4a6859ac3f4c9f5eff7a087","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.105","@balena/jellyfish-logger":"^2.1.41","@balena/jellyfish-environment":"^4.1.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.186-renovate-non-major-1ea50111dc9750bcd4a6859ac3f4c9f5eff7a087_1620145714983_0.9460141259366792","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.186":{"name":"@balena/jellyfish-metrics","version":"1.0.186","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.186","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"07725c146e6027fcbacbd05ae7c7a5b862566e46","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.186.tgz","fileCount":15,"integrity":"sha512-yEj0VoLws6KlEzmEsfqIYcC4Q/VE2OiZygQlexUPWGEO4UFSv52/PKIMicTtpYbWNvm9PCyKAO6PAH5YpMvESQ==","signatures":[{"sig":"MEUCIC4RjvnOxFj9ClamZbYZ3Axq0TDHdBm+p/D4rIrJUNO6AiEA5p4YSRgkIyS+iVT5CAVZATb2o5rMIaMl+88MZXljEgI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95793,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkXcMCRA9TVsSAnZWagAAZikQAI1gnK/eC1vDG4Bvd5Hb\nSpeH6toLrW3fG++E9prYv8Wn57swR7a3v4No1nghJWesnvZj1D7bm1jM+feW\nKdj+YWXdkpcY0e9qcoF4kzF8ZWY9Fws1H7hO+f4jG7RCQfgbP6wtA5ykN35h\n5EIw7QLw2cH4XVMgOpmmFyb8KK6UcwWzMXxyGujULUsFP/lNjo1A1VbNhmjV\nZ8h1paQgLjsAeKE4cGzwujYkHCed9IrmnSITOfN3BzIBpkNivd9siqCRs3Mi\nceYu6CTOpa1o8/7FTQJQx8Yqrbz9ETT0bKRF05bAHLU8EORKeHR+xs6sPpRf\nmHFh5j04PpAD3kI/AuT3pqgFoywzXwjzRw7i7VHqwUBd5FwlrWsqlG5pAV8x\nxlYZyOYH5thW4kCWWkUZSx/q/EufyotGJsM1JcGK1X//bin+POxsXLGHvm3s\nLZdJhl7XyT8Fxz0RkP9AQtXthssZtUoH1+kq2DtgEpioLIrN51E0mz2qs7hE\n1lrxclXjzxqQ+hVn+lHSsbfEtsQPS02fjdf7PqEbek627eDxM8BSRuH4fz62\nr/B5frk7UaL8YEJdHJrSRxIAu04dniGPpq6tNvhtZH2X3PgERoNf+ztelQc9\n+iVnaNBhHxOLFKhXW93oCdIfzKNoZakUeGREAYEqPanit1qsFe8INX+UsD8D\n8hhw\r\n=QEPL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a811aaa9f8ea8ef63726e879d9a2ec299c39bc6c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.105","@balena/jellyfish-logger":"^2.1.41","@balena/jellyfish-environment":"^4.1.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.186_1620145931687_0.2542409750263983","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.187-renovate-non-major-f727d68d012b08b32d5abe93e0fabd6a6d7c3ff4":{"name":"@balena/jellyfish-metrics","version":"1.0.187-renovate-non-major-f727d68d012b08b32d5abe93e0fabd6a6d7c3ff4","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.187-renovate-non-major-f727d68d012b08b32d5abe93e0fabd6a6d7c3ff4","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"dda415be695a4d97a21332d7ac9f78c30ecf6bb6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.187-renovate-non-major-f727d68d012b08b32d5abe93e0fabd6a6d7c3ff4.tgz","fileCount":15,"integrity":"sha512-J8aMhCAvVYEkmqFoeF/2JRgq/o+RsJgb9ur467kGKjBp76WTKdFeMaLFdbjOUxntinRLAIARgCg6k5OXqepKJw==","signatures":[{"sig":"MEQCICaSTy7ZKwTTraQ6UzCn/ya7YY4UtEvtcrYVCMltDVwfAiAq4lfi87i3CVw0e+epzHcBsuTHjZ/17le3SvurCCNfKQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95957,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkZpiCRA9TVsSAnZWagAAgY0QAJY95YBBXrTanP9D3qaZ\ngA48B1yLrcUuaMBJqrv/krEveBFUKDZyqT1Gcsf7q27fEpkNSfH9B0UAAq5d\n15VN1AXeDpqZG/X3ctPI/xFo2cKpILok9UMI461pCmBE8lcB3itbEPB1OYbK\nXnj/n0vu9HUfhpsU1uDI6niN0LBOm5Pcu8CUiIpHn/g4fx8+bzRkELHPKPSn\nLbf1dUJPZt8p1opnszpEp07pqg4IRDFleCDTtOvxagkZgWtw7ImOIFZdKBmy\n7XxYg+kTw2qPK8NSLdZkFO0SnxHq5DfTLFkqA8fYDG+lJVN1+atsEl6qsG2n\nt4DeYY6IAfPWH5/2GQN8IniQj7pYDnydZaJAeyzy3buILgSDg7Ag+ijhoX7i\noGWR1bk32h//yxzUOBLhPDYQsLV7kKvBSQnMRhAeqY7B6IIC1vRYBGRD+/H3\nMTyhBXu+2TzpSKVT4W9CBkwb1ds9iMayzWQZluDNfUpGHgfqgQCZ3QD+OMX3\nvlbEwbJnT7w0tWsp/c4/y4akmiyo2BOeE0M3j7pOkKpifYuat6kyTPF3FDCt\nDCY6GR58GfuQg8aaWyRUvLXhIOdbY3NylCgS5kN0Kq5u2N988QzhFXfHmS8w\nztQqCForkIVjPhfWndffUUif+wWlo966zXyFTdtQMSqv/yUuigl9zrAwY/Cz\nMpIW\r\n=dnZv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f727d68d012b08b32d5abe93e0fabd6a6d7c3ff4","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.106","@balena/jellyfish-logger":"^2.1.41","@balena/jellyfish-environment":"^4.1.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.187-renovate-non-major-f727d68d012b08b32d5abe93e0fabd6a6d7c3ff4_1620154977985_0.0262910825779481","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.187":{"name":"@balena/jellyfish-metrics","version":"1.0.187","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.187","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2a4d7020a5bbb04fc79241454ba63378469ca7a1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.187.tgz","fileCount":15,"integrity":"sha512-xcAvrwJ0Q+U9mq9ZMKfwLohgEn6jxuyZ2/jkT/t6m5/U+Ah4siJZhUTQqpDf/n6ProELhLcC1Mn15AI7yZfnUA==","signatures":[{"sig":"MEYCIQDs49xsFc2vhoMlPGP/W5WjnVT3w2qt4ZO4LcL1CV6N6AIhAIOpk//q3okyyZGLyQ3dN23wUwlNzAEQTwrwya4GPQdX","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95897,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkZs5CRA9TVsSAnZWagAA6n0P/2Av1aTHDolIXGHxgZAg\nTyixCCQv1H2M9AqKf/8+NYdjpqAGyIXCM9GIy/ruIi4hRhlyR0HOFgonxUoX\nmFkRcyXupyKIctPeBtKLrggeSN8X6l3AAxlkCAD1uEy+wA8mIR3h127JMPqX\nQIXLdlADz1ZMHVF68te86Ws70Hjtbzs9UYTo9edIV26jQd6OwoEmn4V3ieBD\ng2jFz8xymiJrI5qdlUv1iZmDoTzmHkwiFHx/2JpbZuNXqwNGISjV5FAkvYG4\nP9GQvcGNrgj1LLbqqNpCaUBneUoac3TTAfZL85wKhilk20nnC3DSg7RbVwwG\nR6nrr8SzHGp8yEYmvh/ihcUBruAS8iNHDoCLiMkk5gvwIspMWkIytLizVNJp\ndv7YfnxPnQ9w5/orMOaCHmcr/pklrD4qu/zHHyQukOHyA9JtOzIwYQ8T9lrN\nmzTMNhvsjTpS2K7z1Bsbs0yxd65DQaBm0v8aNXPTbQGRcJTSaAVjlaU6mfrP\nXpbm0qNdxC+VeEByqWEnf5DZlXIYZnv2jy7agKYfR6w9kCDjMg6gfzJraJrw\nGcqnWQxG1KJqX4J63XexCZCrP5sIORTPHDhYu6S2oruIXlutbxgzlP4JmTqU\nUQDDqPyNH8oig2WvMHGRFd23ToyLAC5ChaIsSfdx3UEO4f9t6yUuowr17Jfj\nlllH\r\n=Cy5L\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ee13b96f3ec6a1c3d59c6558e1e9d0f3b4abd582","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.106","@balena/jellyfish-logger":"^2.1.41","@balena/jellyfish-environment":"^4.1.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.187_1620155192779_0.6222639222459025","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.188-renovate-non-major-7a0207d0766cf3a78519c1d94c54ccdb752f1e30":{"name":"@balena/jellyfish-metrics","version":"1.0.188-renovate-non-major-7a0207d0766cf3a78519c1d94c54ccdb752f1e30","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.188-renovate-non-major-7a0207d0766cf3a78519c1d94c54ccdb752f1e30","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"91f98a303124f6fb543937fba11f501e62793be6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.188-renovate-non-major-7a0207d0766cf3a78519c1d94c54ccdb752f1e30.tgz","fileCount":15,"integrity":"sha512-YOdWim34FOsa6dP19q8UEoL/D4sKT0Dv7R2xfCyVqIVc7E9jO+QNRSn1BsovWoQguucwakleg/wzILvtwLs6yw==","signatures":[{"sig":"MEYCIQCFGDbPcOS9CVISj3GpxuHa+0LkAP3t5OCyYN+0YAcSYwIhAOIgz7frXxG2I6JRAJJR0DlnmkG5eKtPaACmkhhXiNZD","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":96061,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkbJZCRA9TVsSAnZWagAA1m4QAJGBr9xHJSZ5KmWmz4ft\n4PrdNiSfg5GWyuIu3XflSPPg7M27iAOzEI7VzjtwW3wfQuwUV09UsmA9IBO9\n+xXbf7HQstBJ2eGLZ9mR0ADTZceKe+YzOxNux/CETmiBq8Gh1xp5HFBBjpKl\nMsVSbUJXwyIsNCrlFHMAusedxrJZ6yDjou5dgxCUtXo5/UczAYSYby0Ouyek\nSrKDOy9MGqydeODlOO1TmD4IZGBXuD5TeQREi1332nZYlCWYmSLgXEyjPIKY\nmN8M0nwiiXxRWvQEU4BOpETsEQEE0O63WWHvkDh0Y1dP0Ur7gM8o4dFrWbQk\n/C9jGbz/atXgOV4B2JYkG60MEpDG7DR88Q0/TwUthHzyVv0GxhY9RKZL6/6m\ngLXFG5D6twPt/LuIz1n3t9eU747UFK4VIV3GLlzIc6D5mecg/hAL/SbS2hMT\nLbYyuA+9rlkaWdKUEdzXCbAnoMil6HuWu63+wWlpr8v0PoJBNNEw6n4fGQ1F\nzxrJ8wYHuO7rPpC5LEQubjZ6nRDfPR/y9uJHvaoQTGNxRmw3iMupB1CKYhro\n5D0rbjKhRnFIzvrrwoiqoZqi49Oc/MttHQu/SszP8UFCYU0d09rgTdSnke/w\nTtYe17UbCQTYnb+C+H7HvKgjnfGK1nUqpRFaqJiq/7wuNgsRXWQJO1g8UlUs\n/of/\r\n=bbPq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7a0207d0766cf3a78519c1d94c54ccdb752f1e30","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.107","@balena/jellyfish-logger":"^2.1.41","@balena/jellyfish-environment":"^4.1.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.188-renovate-non-major-7a0207d0766cf3a78519c1d94c54ccdb752f1e30_1620161112793_0.6187789288722811","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.188":{"name":"@balena/jellyfish-metrics","version":"1.0.188","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.188","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9f9183a8957124a37137f5a9fb5458ec271fe3e4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.188.tgz","fileCount":15,"integrity":"sha512-DYNrEWv4Jc7WWQrgTCzuZqQYgW0Wt9xYW7HxqlLtoXyUA6STu3oX75/oLGcP54iio6YfVX65VXE85tlb4p3zyw==","signatures":[{"sig":"MEUCIEeqpKNs9c7fkklYL+OsHyCY4/jrDb3oiJfyK3lcVA5aAiEA/FV7x/XtRaEwKWwY4Xm9HaSfy38WIftDaTj15BjYIrU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":96001,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkbMzCRA9TVsSAnZWagAAHZgQAIH9gleY8ucprmMTng6Z\nWV1Ri+4debKRSYbLmgT39uvr+r+8VJJErBrFK5mdCpAco5FXrSwbP8NwsTAO\ndqo9obm4yrZoxZVa2ZvdAA0GMUhotZGcEuxHwQ29mkE5wbGRRrlUsUS+M7oX\nuiYw8SykW+lN69XB2x24WA75nBGcGX2fsolMsia8JtU0CLb/4uyLaV1DDppk\n7rH6ExNJ1bNZ2N5m32MpN6uGnqy9tgmp2Z91QUYEDwmcqxqlPidNTdW7PCPc\n6c4qpSv9naGP1Cvo6suUi9NUIghWJWfw6h7rhzE6t8eTSCgugUgJ6Xtf7aAM\n6+XkHpdbv/YS6lum3+FyQOjyEJgs4xRqYktGxGyZrGCq7HcTItUSMbzsqvw8\nrEnvjmB1d1iqoMRY7r792/JSGdsc70D8dvFzqS6dCTB8GxwluzSrUNpFccOZ\nTkjfPH80NVRoYZurR5nRt8jvzkLN+G3cfKbYqL/9kWVBb7Dwxz0RNlZg+rDS\nyYAFcPzMXgCmWPT4gMPPuE+w9K2WjNWTXXO5UPt38VAjTlhl3okBi/5HQ8Wf\nMMr954xtJ7GcXOCmCp2hToPLwQvjjkMchXiCi0YewMITxIh0HHcSRqiit5zU\nuRFUYzqSE85LnKBSHOxuvPhpKvJlcIIX8hUaby5m9anQN87kCZHCQ6HAuh1D\ny0GQ\r\n=ugAv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b48cfda4c4338bd4f19a1544c6c5fbc408e547e4","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.107","@balena/jellyfish-logger":"^2.1.41","@balena/jellyfish-environment":"^4.1.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.188_1620161331021_0.5832686993359122","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.189-renovate-non-major-1adadcc225e03a26cf4f9db67dcb984200baa8a3":{"name":"@balena/jellyfish-metrics","version":"1.0.189-renovate-non-major-1adadcc225e03a26cf4f9db67dcb984200baa8a3","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.189-renovate-non-major-1adadcc225e03a26cf4f9db67dcb984200baa8a3","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3e25b50cc0af78325194db9155216a48d5d51be3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.189-renovate-non-major-1adadcc225e03a26cf4f9db67dcb984200baa8a3.tgz","fileCount":15,"integrity":"sha512-KmoegZDsrU5M050IXcGXiXdpGSbLW2boK3wO4QjtO8RjbKne3j6JwYAv07y0PdsrEcCmehNSW3sjjCUpk8EIqg==","signatures":[{"sig":"MEQCIHHP98vWEskcnEl5D/7mfH/kAZw5anolmDg9+fLMT6PIAiA3wtXe0+2efIvcMkOf0+fKWemj+2Q9XXThbojpLK2rXg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":96165,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkdK9CRA9TVsSAnZWagAANUoP/RRIqlPY/lR7L8IqcyAY\nAUhhol+y8c6QkCIoUPZf1FPSuBBc/szJ8mo8tY9bEvEXJdtIj2G2Tu0x18ZX\nYSC8Hra1g/xI6pFs3nud0WpsMPZ6RkpUvwsT6xHERZCFI6IT49fcakw5319W\nIbwBbkimHpDydVRjS+cM2rOjUsjtcmyU1S5k4dl4PVRWa4Of4xqz38I5a89x\nIGMlDggQV1yFAwEDZWAyH7YXJEt4ENEz7pII1PrVsBYHeA2JtIzvvuWD8B/Q\n6Q4Fny+BKu09pKUTDDxzv63PWvUJDF/Fkh3jhSUtPg+gQOqHCMZBOpFJSBIV\nAxLRUDNxlqXOpgfBfsJ+GaMNPjaA+5OZqZ/XS5pUSwrHZFaIN85vTDLEIQvt\nMcJydF1Ju1fIwBK73Q4lR1eG54RyFQdfY8sQAWrAxYPxk1eLuSzPUgAS8sYl\n1KbbMhmj5qq2a9TJkbAzvVoiMbt27uauvaRpXmuYW5iYPgueCoAyiKJkVYIT\nPGNra7vZXbMkLgm72mGn6hUuxOu9pH95ids5TIEtOGoEAIMSivTrlKX7unZO\ntyXmRWYLWRw27SCVdvogY1ossEaSYxl1Hb6YNWGB8AGpGckAUGiF4LysQI/e\nq7qqn1m1HcVfVtwENJOhvKrp2mbBHf7FKHJmfx1mrB1wddjHXmm13rN+sS6L\nqDlh\r\n=GpY6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"1adadcc225e03a26cf4f9db67dcb984200baa8a3","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.109","@balena/jellyfish-logger":"^2.1.41","@balena/jellyfish-environment":"^4.1.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.189-renovate-non-major-1adadcc225e03a26cf4f9db67dcb984200baa8a3_1620169405026_0.12890595841577124","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.189":{"name":"@balena/jellyfish-metrics","version":"1.0.189","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.189","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6aadd46b66828e0198010d39a2175dfe52a05b9b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.189.tgz","fileCount":15,"integrity":"sha512-MVKElV4c+Vh7nEsKFXsW4nJFv7/a9Za8jevSMoQ1zdWyGPaNuDn7wIXsU7mYUujnljOeP6B6uYllgS29Evh+jA==","signatures":[{"sig":"MEUCIQChFWxuP28BC+8idoCXr4dGr9hFM9Im7Z+vKhAsVlZyNgIgfw8deLvoTgG9bBr25gdEKzgY3roduEMuJBbsl+Zs/MQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":96105,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkdPDCRA9TVsSAnZWagAAUjYP/joi2JnO1oV9tsLKIXp4\nf+7BLZHYS7L9O27J/SEpN4UlOfPRBAz1JVDDrKbz4g3oMOfOgFhHmoIaALGE\nqyaNVNzxeYIuH/2LJpjzfGfBKa4Zs/BQtqz8dCuprh107JqSlk6xNc6no2QX\nTeQC/oWY9JrKiEjO6cmUx8EHfeEJvCbnZeR2t2ZwY9xyrwscuOGEsHBiXzvI\nffXbCLWPqhQ8JB6aTfppbSj5cX0OatHZp86cKUUDikJX043uc93Bilk7Ttb2\nU5BhT7Y1S2NyIRn5g+1ct5m/6vVaLdNOVLbTU+S2tYJbmViiGjMmfbEExL45\nkgbJJkWvQudo5ySWWb+Jr73r5NNG4jY57UDD7RUcVe/lDZ55V6gvP0IP8WbB\nhKYW3AUT2BuUuUsuOO5CL6TKWw7ZKREoUM9/e1IlTWHI6nO7CeKSSc14wa30\niEFNxN1OhJ1lD8PckwoCurlB35C7eXGwKCpJmVJkuCIu3zqdpyO5ChSGTkxv\nHW3c63v/I9GOlzn71nZwPWqWIHFs+oPtWV64/iSBfVYaEADErx56P0JSASsc\neusEdFPppIgmjGfYDNp9Z624xek+rElkMEuI8UOzprcW1WNTuLOE13tVZjI3\nWHoayuxfFOqDyJlyG+7V4psrvdJofyIm5sQW0VdX4PlXAVPwP+H7WUpoutB4\n5sIW\r\n=l3yf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"cf603a2c1368717d81f67141f23b559f1dc0e2b6","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.109","@balena/jellyfish-logger":"^2.1.41","@balena/jellyfish-environment":"^4.1.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.43","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.189_1620169667035_0.5711569233255491","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.190-renovate-non-major-4d1335cb4f1a4ec7258d93e333c3a4c024468997":{"name":"@balena/jellyfish-metrics","version":"1.0.190-renovate-non-major-4d1335cb4f1a4ec7258d93e333c3a4c024468997","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.190-renovate-non-major-4d1335cb4f1a4ec7258d93e333c3a4c024468997","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4d85ebd624131e6353fbfbaf32e38c29b288b634","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.190-renovate-non-major-4d1335cb4f1a4ec7258d93e333c3a4c024468997.tgz","fileCount":15,"integrity":"sha512-ydVPLVzGDKjRC6vi4c+u9kX4v51NzltUe7vDftsUUqu1bXZMZFir31jZuCHyZyWK77N6BF50nR+quFUvlJVEig==","signatures":[{"sig":"MEUCIQDUrHaY9F7TsQ5z8TPqPmnJF0bWBmTz7DQLrHXd3wsvlgIgO1ri6zrXgiQ7Gg7GFTFvi87hN+eeAi194iUk5aqsIKY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":96258,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkeH9CRA9TVsSAnZWagAAmHAP/3hpGzyTDXMsRjuVC4bs\nF/X5VXFngUio2mFjAMa/ujRMER1m6IWSyerWvQWpKr42FxvSM2ybq009gdit\nFW71CfSuoKrF7n6bJpZty76TYYnW1fUEI+8A33/1C4VJKKkapZWADsoJwVoB\n+jh9dy48p0ghhS6AugdxPeK2J8vTzKCxXr/VkgNVEPXsja2MuQxvd1vUJwgb\ntaP1beIlWMYCjdy+0i+R49ctQ2mdCOq3oP3qg/peYJdwyNT2keudPZIMlvYK\nUeBW5BdMNRgJ95YDXmADPC8wg+b2jxEzcbmCELhdCLKCsn/llXtR3YzHrtkq\nM3pMzwhJBBr+dWO8hIohC7lWJpQzKDa6lp0fvV+/Q1utm7/42N1TEy78U2ZC\naCcWKyHv+uoq9+vY8ebhU4Rsfnt/nHSlQJwuzHAvZI8yG15MzJUbyEe30sY/\n0czMr1rPYA4xVAtPA24k39lwNJkW0vbzzpTuAGOH5dOcj7rkuq5d1dSEvgqy\nki9BA3bpkExlCR4O94/85jlnNAw7ufY+6IZCBm0+Afs0SuQdSwc6XUGHBSqy\nUA4zlMkFI8+pIutzEy0tCoTUSr3bFbea4ulW2Yu0VZQV8E4pQGRGe6feP40B\njIuC9asGve9eicoxe7pDA4WWxcPIK2l/J7KNaOTSpleHnV8tT1WObmFFoSk1\nBFr9\r\n=caCC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4d1335cb4f1a4ec7258d93e333c3a4c024468997","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.109","@balena/jellyfish-logger":"^2.1.41","@balena/jellyfish-environment":"^4.1.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.44","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.190-renovate-non-major-4d1335cb4f1a4ec7258d93e333c3a4c024468997_1620173309162_0.987818512400062","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.190":{"name":"@balena/jellyfish-metrics","version":"1.0.190","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.190","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"74b978568427ecabfd86920a1df55473076dc227","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.190.tgz","fileCount":15,"integrity":"sha512-ggSqxmoqWgNzKQBqfjNGwVCh6Y+LU42k3ngrV+UtzzVcbaTKj5UxjU5kvKvzW4jjzvfkaWfmPUhqRvPyvoSUOQ==","signatures":[{"sig":"MEUCIQC9npdrtpMTi4JV6m4nNwWqIEroRA75256mChqQT3Y23QIgZL5PkTMG6P49oD/ti2eqEQkpXiqzu+y9JtoQPzjV+10=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":96198,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkeK4CRA9TVsSAnZWagAA6aIP/jg9MMCkCsOSLMupVYe1\ndJ0CmPUumkJKODNuzdJBdTjXNOqh5Sd9GqtDIZ0EMrKKiMT8oaLbZYdMJ3Uu\nLweKliNOQ/qsjMvojWNdVlHFiHBSklOQTbRFgosNbyAu7NP+JoQrUFg+Q8lS\nxtmFYSznqy5L7xZZh6rFgtnG4eCkkD2lwqo4RUHkcIwS+If0lGLaxorvN0mM\neEJ4GdXGcLxhra19YxzVuy/qEP+/wN3j0sKslzqu1+jQT2tGckSkd/OpGSQP\nOATjR6zASG9cxtPwy1pZiKWQIWFFYsaSB4huyQj+ssTQWQhNunovbnpVBymm\nHlepHFMrFpmGAqNTWhNyIdxnTljuRMBAcs3PsVWShNQvtpz189yoXUyaMFPU\nrK+zYju85yWLvv4rBowRlF3QCicFnyIGfp1PPLDKttVCEb8CyKGU3MDwJrnT\nNKkAs2PCRf37hVkQHzJrgr/1/qMyEahs8filCY1vHrPzhr0JuFwDRvOXxeej\nIM9nfgxzhrxuKec0Vv3K4Zekndtr2LdeCgsoGEdwoSbY+qjvSkGdSN+jW2xr\ng/SzOY89YmovhP1z8i4b6EZwh4LR0J+FZcbtx9kOnyGnfc/R+Q7G+CKbiG4y\nfiY6yBTP/+n8kz2lrMytBCMUosC7zZJ/MULPmIivhNSBJzMPQqcaKQxmLS9i\nfcj8\r\n=Hybb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8edacdaafa2321545fbc45e1eadc344092f75efc","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.109","@balena/jellyfish-logger":"^2.1.41","@balena/jellyfish-environment":"^4.1.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.44","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.190_1620173495959_0.5944638804634943","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.191-renovate-non-major-bfbc348439bcd5004211e7188239ea74e49b5bab":{"name":"@balena/jellyfish-metrics","version":"1.0.191-renovate-non-major-bfbc348439bcd5004211e7188239ea74e49b5bab","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.191-renovate-non-major-bfbc348439bcd5004211e7188239ea74e49b5bab","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3b275cbc3b45a5488ad8fcb946963ba8cfc24e5d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.191-renovate-non-major-bfbc348439bcd5004211e7188239ea74e49b5bab.tgz","fileCount":15,"integrity":"sha512-Wjg58ZFwhapSQLUZ0Al5cQdV0LkPe/jX2npEpnxRm6UUEIdfV9+2X1p5TelWae+d/BC3CC23ZXYuV27krIhY9g==","signatures":[{"sig":"MEYCIQDNWrd4X20KHNf2hVUl8L9wSZdIX2LhYZFtw8UduOo7KQIhAMCKJlnVBtvAmWiz19NfNLumf4VYn20ARStyGgyMsnHv","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":96362,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkmdFCRA9TVsSAnZWagAAzrAQAKSjwoZQ+CCEK5xI9093\n59bUCEpD+V03MVdt0GhkGa04XIP+aeppqxzwTYtsRECgAlDm8Hb6kcAsw7Jd\nzEx3PCVL3tV5Vtt5097X9ILDo98qt5oiTdUaCRnDnVpohXC/V2GFQ3UoiHrr\nisUrridB1C0BlsGHoHdQMFOs5lCxG/TA0ZIe4OgbxSC3Zf6NitU6lMAJ2uVy\n2dllz8+PbuynTOwZzqOyCmjDKigY4RNYy1jOCxaY7erIZGpaFB4pOvUP3p0I\nsY3LQrGqUE6xjst53U99OM8z9R2VaN1r6S0ZdOxvAecPWAV8V7UGenXTDvDf\nzGDMl8JHq43u4HvkqwrLSir80W3t9FDaAJ0IXh67UiBTY8bHLhALZ1f/pG6t\nTEAiYfWQHCBnqGLS5sjaxdgW574cGfbGyLtQcETyj/QQTaQpQlXCY5GD2/FX\ngZMCMwrxAJV1j7bTeZQ0OW/Y1YSkK6mkuYtlZNRLxHU06Pu5CFRHyECsdszT\nIcgE9OLbNyIVc7SZ17JH+WplkjiBMRj1bfsywF2qcMWLTjdtk5tC7CXxXHz0\n2D0XlAiXcjzTtYiPP0lvbBtqlz1++1SFBOxA9wL4aTEd5j+jvKBl8JiaByay\nCrvSsSfOBdsHulA6OXbRB8MDa1FuIkxYcEBQMlFafxgm0qV1FVqQk9SldRGg\nv1sT\r\n=OBIE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"bfbc348439bcd5004211e7188239ea74e49b5bab","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.110","@balena/jellyfish-logger":"^2.1.41","@balena/jellyfish-environment":"^4.1.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.44","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.191-renovate-non-major-bfbc348439bcd5004211e7188239ea74e49b5bab_1620207429096_0.764524783437196","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.191":{"name":"@balena/jellyfish-metrics","version":"1.0.191","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.191","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"79e05c986b190501d48e6f84a4f89dd2759542e0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.191.tgz","fileCount":15,"integrity":"sha512-eVQ7rezflOZdvSbCdjeKShd8qBDFssLQ9GOGA4jMWv+rWRH1orWUM3PinDEMIBL1pb8x/kZ8o1aqnp7biiVH0w==","signatures":[{"sig":"MEYCIQCOBsHg3jnX5+10gGBxNOryNaBksmpuyoCElcHojOcVKAIhAKHYCAevFuWM3ptqkgAd/9afMx2/+QPIR/6P6WCbXlsG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":96302,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkmg5CRA9TVsSAnZWagAAz9wP/3ZGsgj7n26VyB+9alUY\nJ83vrmXTWDHZj/8XGrcfxj2XASgaocqdHR1KGcjPfYHHv3heybOTv+zG0y6L\nsge2p8bmFg+/5R5KV7Nk7ApaLWniFaVn8oocDRwECkF4b1tLZNgRG1VVZuzW\nfhheBwOIqTe8s6CS6HxKKWZoLzMoeKDoDsYLhb9WmfKVaKDwApNPPnRIem/k\nLyLBat1e9ZAfErNcG5NMr/mGxEttVJLcJQZ+J3USRx709O5/15X3gW3Rho68\ngmy80fl9kWPqFYE6hhx2uXnLgnNOR6vgk+b9r++SvmxXAltWomOefB1b7QmZ\nOzD4+hCmwGyGVLPazyqc3GMJJRc6prf+rO5dYpItUHAPCck9YKx3mQenyBcR\nUEY96aj8qxwxfqRd7e1Erd7+imrHmcVAPFKDvxS6Vg5bcUXjKbszNSKs4Thp\n7RL9dt6D9O21Z5wIVY70oi8no3UObL2UAVFjYsa0Ed89reHOflQXVlVACe/c\n4501pXTH+Oq+iHjgforAb0NhO1MMlVv5TuAu2YHqTPNDPj4VKZuit6wwDDPM\nTNUsbt0IvCcRa0gv5hnfwvXsxPtFon5GmUT/2yeKjWVm+EDuw++Bl1koazY5\nBBog61+9iPlhxT0UJ+Ip24S08k4No3T/CuMbqHtH2TnFg1ryelM0phtPmp72\nkPSk\r\n=nxwU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5c65bfa60622c30e27bc7040c90114b2064558f2","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.110","@balena/jellyfish-logger":"^2.1.41","@balena/jellyfish-environment":"^4.1.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.5","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.44","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.191_1620207673206_0.08909829280897008","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.192-renovate-non-major-342d4c16591e7d86deba7677cbd540ccc1ed4d6b":{"name":"@balena/jellyfish-metrics","version":"1.0.192-renovate-non-major-342d4c16591e7d86deba7677cbd540ccc1ed4d6b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.192-renovate-non-major-342d4c16591e7d86deba7677cbd540ccc1ed4d6b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c5bf07a28e6e804c72476cd4afe47596d4e697a7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.192-renovate-non-major-342d4c16591e7d86deba7677cbd540ccc1ed4d6b.tgz","fileCount":15,"integrity":"sha512-jWkIyRRPTirbIuwt4PNIpga9NBkoV8N2XfUEVfOvdrphl7zKexA1XFRrOgXGXgAthiKTbWiQDEsjDajiZGssLQ==","signatures":[{"sig":"MEQCIGZOVyCNFDIli7Nq/OttroabhrZJefNcl9SMa7P93/HtAiAA/jexNCGRzsRCHNW3QbY1jiRcFhomhx/1zZ49MoJm2A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":96429,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkre+CRA9TVsSAnZWagAA5z0P/1uqq73vifsudvFl/QKn\nXQaYgR8CNObLzpwuxNFUtueY+aZLsgvhzKX5hMUKzpHJnaQ9p4HNEk5j1iZX\n9x60vowgUtJ0W380LVCWNf3eO8ogTUSmw21f8kYTpScxdXMEYHQaTV7zcbbP\n8iitalOVXIQyIvfqBFGV5XpfrMVByiq8jSNe79keoSDPzXoBthxopqrDfRSW\nwRGDgfAPmVZdfef1+qzkQmKytspV8mZX8iQ+PBsOI9barefFzG811zkaVZFm\nP1qzRbWz5H4a7LMWWfqvzlnyA4Nv3YcnCWpQFxdhV3DCEHpdxZ52brNFLyT3\nwt3XGhW5cPRUPkGmRHYX51ZmCc4JzeiIxY1L6BTPGTwkFhd13CpuLgwQ9Vwb\nPLy0ohuxcN0oI+sBQMtlTN+l3dj4SHyFzK8fNWqkh82kHIl4KPhfrOeM0YOJ\nSbqiQCG/LaxgGwv14/7pyPrQZu883PLlHlfEbMnRbBIGTlkwjmSEJwUZOczr\nxcR3pI0c22eG6UHY0P1tcuPogihtdTqdWzfSNvoADpTFEVT+o9UlwrN4BQyX\nu+u+brAagEdmsM5BM6+C2GJq2oYCi52u107uCP5wmwu+OdG4FMx409mj8wmh\nWmOJdjN2W5TEh/hug9J33ztk6w1o+zd+sXLzn3mZ82u9R4FehJ4RRXVm2oVb\nAF7R\r\n=nOWA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"342d4c16591e7d86deba7677cbd540ccc1ed4d6b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.111","@balena/jellyfish-logger":"^2.1.42","@balena/jellyfish-environment":"^4.1.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.44","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.192-renovate-non-major-342d4c16591e7d86deba7677cbd540ccc1ed4d6b_1620228030075_0.47129786739157287","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.192":{"name":"@balena/jellyfish-metrics","version":"1.0.192","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.192","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5c9e2ffdf960ad0964a03e82e3632c8428a06a6c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.192.tgz","fileCount":15,"integrity":"sha512-FiUf6HQPCJcrPoWdFpSTlFpD+PwEnx9DCcW0fEfiqhNCMryyRMj5G2NmdkyGHvMnKpNET2Kpm2ocUCs76m1xdA==","signatures":[{"sig":"MEQCIAZbP1aqemUcNh3dptQP01K3cZodtFwM9tU6Ru6p6PFxAiAE6hJUM7CCYnB4zbGCNfUvONxjOz1gs1ajFfG5b6fuOA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":96369,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkriOCRA9TVsSAnZWagAAJNkP/3f0PthFNu2m619QYNeB\nS4yq9Ys87ZeRHqvjpPFbjCtQfUozX2xohk9cpRDaFM20Yj2lYHCMId20QX1Z\nqXVFqnVqfbo1ZdNlp5eFvGJoeAqBsRuHrvFVoTjto+SDwSv6hKZX4UsSZRKM\nAZa1QXLZyjXAO3fIjBNSM3KM/NvcgjbupBw45cC+3TwEfBtICeUdkqUOkQER\nuBFt2mqPiNlIGU6ar//Gr6p9N64xHnjm+RySowb5ex+yUcPbNmrJweNv1CWR\nIHj9JYdEzNbm8z7dzxQV4K3byMGwHnQ13T4ooS1CyZym+C/Xspw3wHRTYGdW\nV78bDpWYz9O8/lI2P611SUTUIspid72T05PQYlHWhpiCj4TLaE+ou6mq0oOl\nUWSJavjJrnLqtWPzQ7QFM4Gp9MgbuDa5ZBReT3NtNkSkHpYOpI1A3GBLh8Bg\nSBMQVmrtZPrqv/uCjnIP503W0XvvVS3jkMV6vG0+WEpVqzkQj0XnCFko13Nu\now5ZmLE1MkdE6BWaEzGbGrjhpkGkh4mmT5eGc0otDFyH2GVt9YGHGLvhumCU\nbPaSfXK0C478oVJDHQZs6KFegOTCEQfFl4UUgwyUncslOG0O6Tw/BNtg7GJu\nJgduhbf4t+GBV25LoceH1hAm+NcoGnMboE1+Pd68IOSFfAyAAaTyLaEFqBOi\nec2g\r\n=zN6m\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e19b692d7ffea821ca4c1353caed54440469b3d7","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.111","@balena/jellyfish-logger":"^2.1.42","@balena/jellyfish-environment":"^4.1.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.44","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.192_1620228237935_0.024369088552661067","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.193-renovate-non-major-f32c44bf5a610f057e3600d66d3f85b565cd3c0d":{"name":"@balena/jellyfish-metrics","version":"1.0.193-renovate-non-major-f32c44bf5a610f057e3600d66d3f85b565cd3c0d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.193-renovate-non-major-f32c44bf5a610f057e3600d66d3f85b565cd3c0d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5deebd525a3329298b96b94b4b786579beb0bd89","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.193-renovate-non-major-f32c44bf5a610f057e3600d66d3f85b565cd3c0d.tgz","fileCount":15,"integrity":"sha512-B1YKk7ZvX1KWPrHISctMTBFFPvJ6svdbSkn6SZ6tMJdFhuXHpDjBRikJVXkiDbRTxqmqO3nmrD3vxvH7sds66Q==","signatures":[{"sig":"MEUCIQDiz3sLqenwAydJv9qNTO7cybi8lf07NEDYgmvHAZ0STQIgI6xRzqOCoeEdYkVUlzCKc0HosdGJCl1oHSJ/bgYiT0k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":96533,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgksmnCRA9TVsSAnZWagAABwMP/23V0lodsXvt0d+VfozS\nsP8LZIca2FzHLQOO6Bk2pcSSOJzXPXxhps9AU9+oudxw/AhfSNqz56GXx7e7\nX3YJ6XWQv5pGAHNc5JhxPODp5L+f8USThr4wuwzWQzOjVvik6guxrvam2Xmv\nvZXDAIBUVfYONhc5UPvnXQiml4P6lKd3TzrDnwcM0CFV+LvFi9txRUCO99Cx\nThN0yksx4jslvWdi4t3zjznc8vllQ7THK07YCf+AVoIlCAALXkjIPxO94J7W\nie9GFu6dZDBnx4WkrNQWKH8AsuACF+6gRUkz4m10+Q0YGCDEI+aB9gbXIXeP\nVXdBPw/9hcYAG3NzfGgc34rLWMt5cLeKSD+JgECb/irsCLQLlvohrv0OyUTJ\nDUNJb5Tz5LyLa9m4FI9260GFMEeknAbcnVn6LhDHA/k8sW4V9Lb+HV9d+NuD\nrcbByK3ld4Fi7x7/QhaM3iOtw7zk6+oVZOY7sXQEDsKP/nN/UKjNtRIUFcRn\nL2kkTIJXPddvUYWu4T0FLPS5GpqqozAm+uy5ELNplXlMGGvggA21MeHynPi/\nC+tvWYbL9BbyzhCfnMAWW4aucJ1S/2oxemIuSefi1/c2Z04W+V+4LxYKyh/R\nuQ62KltJdyf7aNJ//p3ytWe+J9AuJXUSvddcmisDd6YenP8OKHgsT1SHFFbT\nDCN0\r\n=z9Nv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f32c44bf5a610f057e3600d66d3f85b565cd3c0d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.111","@balena/jellyfish-logger":"^2.1.43","@balena/jellyfish-environment":"^4.1.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.44","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.193-renovate-non-major-f32c44bf5a610f057e3600d66d3f85b565cd3c0d_1620232614696_0.8049058952718204","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.193":{"name":"@balena/jellyfish-metrics","version":"1.0.193","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.193","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d88a6aca7639dceb7a192b1c440fabab133d8e51","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.193.tgz","fileCount":15,"integrity":"sha512-NhxPXrFflqdmDS5r2a1rs8pLMynbZjsvWWN82AMdfQbJCdY6sF1xyTgWyWy1ELbgCxIHTho724t6hSpW7zUjnw==","signatures":[{"sig":"MEYCIQCRF07C9z/yizr7fXMeqBr55xftJi2Qdc+TqBDiI09FBQIhAPHkC/XMMM8xWmhjX2Lol718zdBCzrY9B0Q6JeQllFYa","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":96473,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgksrfCRA9TVsSAnZWagAAhXgP/AmadLW4l7E7cHA/PXW3\nidQgZTiQVy6Xh/ldqUHhyDGSHOaRmTew9XGpqXc7k4tVB6Sp3zoB7diNhMTD\n0dkqutBzupiRZcT1kTCWx1AxRYok1nJixXRMvUzzD44LLiDyjDBYcg2MhG64\nv3I5il3sIfnS4jeo5JEeDJb1bN+9/XzhRb9/5i4gHt6Lva3DbIuOws+RJiHh\nKSipz/x1jDsKFgI+/lTGDirjAlaiWl0k2wMFIsyMszk03Pr+S/n/xpJcBhHi\nx2CBoIs3/MVdCjpNzHL8mXiXvkwmmZJJmHuqGtmr62MwPouhX/x7vfc2rp63\nITKRjgQUYlCW/9v+nu8yo2IjjBGn3o5xZAZVfUpS0MLSLsPTwoCKDAyS4fvM\nNdetQoKcyO1zWKKfdPEj0qeZYnRCNh0PCheSGdcE2EN9H+qgREppLkDrGLUk\nth/kWepu9wqPx9DP0SH4j/LUFCB8/o4tRj/dEDZcLAYHEnVtzbtAj2tU0TLr\nYCkPlSYiPHHe8TH/ZK5x0rD+EVUCgiPJzdqkQfgXnXr/vZxwn0juwd2+DmTM\nu8Jn8lpG2m6vaMLweHsqHtBhgMUe7oXD50s8PAJegoJ+2UtjeN0ZvKj7OuxA\nYPOYTdUxhd/SjI9bh90oepc65Ns0EWoPelxuEOTQHL1ekjowD0B7sEjarRba\nflUv\r\n=72yk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6696f1c9eab90898f0356b0896fdada79fcb189e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.111","@balena/jellyfish-logger":"^2.1.43","@balena/jellyfish-environment":"^4.1.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.44","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^1.6.2","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.193_1620232927189_0.9578437051985871","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.194-renovate-catch-uncommitted-2-x-b0bd32af0a33aa1e32758dbfb5f68142e6a4acef":{"name":"@balena/jellyfish-metrics","version":"1.0.194-renovate-catch-uncommitted-2-x-b0bd32af0a33aa1e32758dbfb5f68142e6a4acef","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.194-renovate-catch-uncommitted-2-x-b0bd32af0a33aa1e32758dbfb5f68142e6a4acef","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2ebbabae2321a30d72d1e56b27d0d9bd34da003b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.194-renovate-catch-uncommitted-2-x-b0bd32af0a33aa1e32758dbfb5f68142e6a4acef.tgz","fileCount":15,"integrity":"sha512-i75ezd4BNegzk8pmZyYqsX9BUd0PbmmsGUd5NL92Thl4cxtvI3daSwprleK2h/PizmFTEjXhd09yY5jL41DwOQ==","signatures":[{"sig":"MEQCIH/hnQiZKKlIQZ6cxfgRGq3qGE8DG3IDuKccgw6GkIirAiBxCwCELyCe5QefaKQ23im3ATgCS+vKtOoiVHDutGb7fQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":96637,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkwFeCRA9TVsSAnZWagAACTsP+wa3kb6Gn+AWQeMTVe6s\nNO6IwIl7K5kEj0uMVKUAq7e9Zgd1huCWxHBX99BkSFURw5VKsRKqvx5gu5Qu\nePb2JlcTJJrGAppZvIDl6+GAe+dUN0YDJtRY6s07oNkIQx2JUVNa0Tf4eRwE\n9sU9F4dItc5DtnuBZNGSGpZBWax6ABQNw2+7DfMW5k6a+pHr+fH2GiveuNcd\nlGh9S1h8yS2YoBTw/G5zC54l8I1kbJveAjLXiXBIcBpEz9AtqqHL97g0MpXy\nvKhcpXYBOs5cLPOCWqdq8Z/gZO5P6Pweag0HqiAfXhAcZmqNZNDTXdkXxn/V\n36qxn6EV9W8Wnd1mSIgghDgnbbfZtw1EOkEyPJQOTc+OQs7Br31ctkO9JADc\n14/F72SRV71UY1vFxi3oLkCBCiKnb6dISyXL3CGwVn6H587VrvWiP2N3RKkS\nL4K4lZpD9gOZXUI/WHbNaFDXbhJOMd8qmok5yd3FN8mnmx8wdrj6aNmG20qo\nyfMkTtHxAKDlMvatmdFKQoQsOiJteDvGZpFOBOPXXx/NF4fRGvf9ENdBG4dV\nKdTUkME7O3CdVvV2zKJzVdnDQTCSNOmZ01MpYQFan85FQSFCHvvbBKDHalGG\n+FJSzaFPtWb3zQamsyqKo8CbrRhuh5oL22hACtws3LYNLV19Xu0wEo2hWu+h\nW31e\r\n=iIA3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b0bd32af0a33aa1e32758dbfb5f68142e6a4acef","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.111","@balena/jellyfish-logger":"^2.1.43","@balena/jellyfish-environment":"^4.1.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.44","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.194-renovate-catch-uncommitted-2-x-b0bd32af0a33aa1e32758dbfb5f68142e6a4acef_1620246878024_0.10873949611628309","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.194":{"name":"@balena/jellyfish-metrics","version":"1.0.194","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.194","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"14f6f8dcfb2c3faec6d3788a0384f14d8d9eced9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.194.tgz","fileCount":15,"integrity":"sha512-/LYteRPhkzp9OXxiY765fgo3tX1J9LnQerQuhQJePrNY0+a5sTwJtFCcdhviwwR7LORq+W693htA3utPvaZH0g==","signatures":[{"sig":"MEQCIElFoNKeAHkmnx2oN88cecYuES4rSm3YpQEl/MSilt40AiAruNriVI9nOF5Lq9vF4CeKZuo/9ef4/JFrgIhCzfWzVg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":96565,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkyRZCRA9TVsSAnZWagAAtp0P/3FQOnWpq4l6JnbBG1p8\nbaUfMq5fTuZ0Xt2Jn4mi3UXJbhH8IQgQIEHCtyvR6Ve+e5ypcmphC0NQ5sWR\nj0slyFPWXgcPm0/05ci3M4fzlffMgnWwyICbFiOpg8waryMgQfK4zPLxuESg\ntMuNNezkCBiMFX3gGAPqio/1g/rnOyPBtDsi3gvTxNO9pjYUCMEovcuxH4OY\n3/DhdqmiN8XBHQvN31nB1RTuL3wDlIaCTCVrRBYGkDM+CmNwc0Qn2RksHKuo\nZaI3a4s81RwauOWWrlLjm8oiGWyy4GyIJtUou0FZwPCeSV1vnoLr7oK/tpoC\nWr3tNT1Or72hDO+OQ96TlQRUf0ZagMUuYPbWQa8KKiEidHcsDHxMBBWkZ3y+\n35BNl+CP0My0Og4vo+L5yXxU2/VBqWJlMAncERWjmPSzcpsZajasOKMAz6EK\nivBVbXG/NpEURQKhQmtXUVyyz6b4QXxScobd4bVh/xNlJ3JLG7q0mDk1l9x7\nkaihXIxkoq2cTF7XYWJMwaKd/WRjhTmVDBBBAdx4Bd1nc91J1s+Ok5VZIDOM\nwXZ7xsSQpd/a5uJpYeH2rjyZtlirEgxh6y4nmVa8R3dhWluzcAbU9zixqDwQ\n6l4ldzhIdeLsx54sU/JUmKBmn+7lC8mfeny1U3p+y0ZQr8TbDgrtk/6fRvzA\n5wtm\r\n=4pfN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4c5ed7213ed1fe070d20fcdca1a527f7c6a6798b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.111","@balena/jellyfish-logger":"^2.1.43","@balena/jellyfish-environment":"^4.1.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.44","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.194_1620255832747_0.05203686461221868","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.195-renovate-non-major-5727f66030e3fd96875e3658ece01bf3bc351361":{"name":"@balena/jellyfish-metrics","version":"1.0.195-renovate-non-major-5727f66030e3fd96875e3658ece01bf3bc351361","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.195-renovate-non-major-5727f66030e3fd96875e3658ece01bf3bc351361","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d121758f0ca7b57bc5dc868c47dc190ce2befab4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.195-renovate-non-major-5727f66030e3fd96875e3658ece01bf3bc351361.tgz","fileCount":15,"integrity":"sha512-sjfSp8V6Q3oM9oa/2vL6vmB3xN2tFFhGLWPsPPf+NsEmUUL/u/aHxPvHRkaHANaHXMvhE8s7CJ0xSB81ZnKyvg==","signatures":[{"sig":"MEUCIF5GDEA/Vo3e/aEuToxKl5o2gDwHBW/VF0DzYFotMSJ4AiEA94VUqbUUoCNAxg8bP4iewHc7ar5sRuCoPBsRWRx+EEA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":96693,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkyfuCRA9TVsSAnZWagAAmpgP/2u/97mutkRt7S4JA62Q\npjNvE/g90knTNGyWEwRrCQuK/0wDCXka/oxIof6PkotElQm94oNvgugnkPWb\nx9HnSblZsKT1j1+1IHnhUbWWmLLnAXrofXX9bV5QL/7KNQ8rEzjsEXVe/6L+\nodMTli0Kq2Fn+VZpkYtUZmz9tuyVJVUjBw8S4ybacEPmo6PUWsADXZFxrtxt\nkNGR8dElm0wbxInkw9hTi2SG1vX3kMTPqyd8uxngU3lFXZOJENVVVfYtZUCy\nI2wWAK6LUVobkyqp42YUyXhT3AYxMaetgPg9UGYQ1eSxwh/FxP1ty+w8AnkF\n/gVm3ooEaEjUWAJcMIR7ySNL/9xjl5ETUq4zd4iX520iH9ChJf1Qx/gkFuii\nIUAO9Tyc2LfwFn/wLs59XNgj1DAWaPzjM5AvMYbWmhqzsxzjRzeya+IL7cC8\nD1OU64ZV7exFaO7xU8KGOic5WHH74arwhIzLiE5N6hJjcyO3vIFbVTlccwKS\na+DvZCZs74QGQUDoQib9s83pw3CPx85fGbcmjd1M3tD2AuNVrvDCGUGAyVtp\nxwtp9/OVeRIx9E7i7jynujTq6ZuRi+qJjHz+eZ9dmK1VeGCg092dk/5/9T/q\nEqdRo7hyzCBohgnVWIfQdtTrepA2RB6I+hbVuxbauWpdxaRbYeem1btG2cOj\nSnwF\r\n=Xdu/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5727f66030e3fd96875e3658ece01bf3bc351361","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.111","@balena/jellyfish-logger":"^2.1.44","@balena/jellyfish-environment":"^4.1.10","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.44","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.195-renovate-non-major-5727f66030e3fd96875e3658ece01bf3bc351361_1620256750282_0.9094308750982734","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.195":{"name":"@balena/jellyfish-metrics","version":"1.0.195","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.195","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"de5860b10aec1c9e8c7b6bb42e8d86ff85d673fb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.195.tgz","fileCount":15,"integrity":"sha512-nQec1sU6smjZbGJ1FfOFgRoiAjrHYk0ay+1OruAtY9OrK4Cg2Jtju1TOOjLqeOHFYvAex05rKg4h1vvoKD2prw==","signatures":[{"sig":"MEUCIDTOS3T+z05ae3QhgsdWDdXijxWUR8Y0fS20uxRlEa42AiEAhqvB/hTkV3GEzv1y3+GUOug7JYV2lbrj3/vmisgceVQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":96633,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkyoRCRA9TVsSAnZWagAAVUQQAJ6gBYmDeZ6TyFwdW58+\ng3w9C7vqBE+gSrXlDeuvlBM4HnNUbtQnxDn1n8xjCnVeH6EdwL/tcbcV7E01\nxghs4AgzjkPejY6Lx/B93nzCZQrS9+Ckc6s2K/RzorJxkQzB+8gpKEE/XDeV\nOG6ZApZQH2HeTMQHRMpLDNDYhFZy5CihfbpCt0Fiw7BMpAeVOeQdhSSPexH0\nOFOHb7Nx86UIHNhjciTAYsqR9KUvJQk2+nn48BkOaBeJxMmV7fQRjkVny+J/\nzphJp/OkHwvlSv0+lz2lsb2A1rhytrnZeKrfYizHoFqvkYCClmQ1knTgdwX5\nLBjeuLW1ujgpniKjyNMvabRJeQ+OHNtp5t320n7BN1KYBOXI+FZTpe5B6FEy\nAH2dHAC/bjtyvlFnflUA4L7U1aosCnmvHHtx1nkUxgtQJkfWjcc9dCZQRAf+\nAWN4+j4AXq7UYKYzTlL9o77/vedY/ybaz1J/0qaLcgfLp99orkXixl23erbu\nf380aLoQIRvn7zc62HVKJM61JtQ9OK/ysjuSoJn85/NPvbb5eWPA51Lvw0Wx\n+zd032goj5doFQ81uVaVpm9nxM0OEyFuPJ3B6VPPlaczy6H4YQfr5edocHsL\nUXB+wfbYISOz1dU+T0v8YdWIEmI1OPVz+VWzNcs9mgb0+ghBKoiXKJSTrVO+\nxuBx\r\n=H1m+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"84c61119fcaf5cde029b9e56244b89e4007e5141","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.111","@balena/jellyfish-logger":"^2.1.44","@balena/jellyfish-environment":"^4.1.10","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.44","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.195_1620257297137_0.8351150928643503","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.196-renovate-non-major-e9d5a7b56ae45905c744538ed69e3269c34fc2e1":{"name":"@balena/jellyfish-metrics","version":"1.0.196-renovate-non-major-e9d5a7b56ae45905c744538ed69e3269c34fc2e1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.196-renovate-non-major-e9d5a7b56ae45905c744538ed69e3269c34fc2e1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"44d85abb855d5a81a9f0ccf9f9611f57e050655c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.196-renovate-non-major-e9d5a7b56ae45905c744538ed69e3269c34fc2e1.tgz","fileCount":15,"integrity":"sha512-AuiYnAgouotyqY3eRNsgaSi3Gm4AgY4Qcn4hAv2U42RbugQ2nHxElWeDNFdSDM4TsPAq1uTFzuwWOezCs8WKPA==","signatures":[{"sig":"MEUCICbSxX2frIJzW+mnzZFWPJPtHE6crCVAhkyYBGTndOgRAiEA00AgaqOzo+5MtRQdtSaiw1lKcVI1EphBsr7/mZXsAF0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":96760,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkyxNCRA9TVsSAnZWagAADLsQAI/X839r25whKBQMt6Bp\nh0YMJcmRCZLnHAeDm+oQmKxQiKabL2U3+mgQSs4pmHwsFbb+JCk+a1czfRy3\nwexwruIhXiKTgumPBZxGMMNwTViPnkC2XKu+kg2WI6AHorF4pq9OYHNp19Yr\nTtHYeUv5h7qY4adlC09wgm5Xz+330djhbZbfwBw6Lt5WBS05SxkNyjCp3YzR\n++XFTyeAdnjFCtpo6zap3AHR7vdP6n2D6MDGqJ/grKscDH1gMd4S6MWa/gdK\n62CfEnWnUltLdZn3PTqOhlYMULdB2bS8sUbzk7fa3O66I1zBT8OmpBPmhdLi\nBGsUgEaDNE96JJOOTGuEyADEIP2tnfzHwHQz38CYP4k06RC8MJF9smJ+ZI8L\nkhyqgfqdp8MX2rOBOx31RtKPezJbhcC4crS2JbagYdo8Evl8bs2hvuHO2kbT\nUX4ovthEgCgaS7/Nd17M+a+IO6WMw7kIGA+Lh6aRe/EINCh0BRNQErvSnROl\nTPHHgn2BVkwP7nHNMh7Kzf5ozvCdjXJRo8Wsh997VZdBKWscpYh279K83em1\nWVAuN8MaK+rowpOEr8itLcGuZwgGi0eBxMIXGT/3YSxINrC8Xc2dmwNd3rdL\nr+2QNUjhQtLlNVkJVdAzyVWrAd/GQyJOjTqf2gfxLRLAyHAAEwwhuRUJG5j3\nTJIp\r\n=U83D\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e9d5a7b56ae45905c744538ed69e3269c34fc2e1","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.112","@balena/jellyfish-logger":"^2.1.45","@balena/jellyfish-environment":"^4.1.10","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.44","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.196-renovate-non-major-e9d5a7b56ae45905c744538ed69e3269c34fc2e1_1620257868919_0.9404464812113256","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.196":{"name":"@balena/jellyfish-metrics","version":"1.0.196","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.196","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d80983f0a798c10fe9641df0535ae5b6317fd565","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.196.tgz","fileCount":15,"integrity":"sha512-0d1z+dNemo+eurpkixwqK7RJ//O3I400JTksLe3uPoaYcmbK3Ykg+eyBeHmrprZYKygJh/BqgPdzLJOpefejKQ==","signatures":[{"sig":"MEQCIDV17d2A8BSRe/LdviFJD4GFA/646fIHusA81MvxFzZtAiA8HdiMOXtNSxpsoocOxyrkUG620jkyzif3XxCVYvrclA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":96700,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgky05CRA9TVsSAnZWagAATPUP/0UpzVyn4tbezNfscRsa\nyEOxKgXr1KE2CEtsAF41KJHLmJk2BZQxdC7LhfgS5ghmpgN7095158dp84Gd\n6ZyslFmNwOKTApLW2m+WqHzOvyq7eThG0ZV2llHIgfKnO4LdB+TCZ+qiw4rd\n1dm0yA1hBkJlaPOsELsai/BHsu7YCQhL06iRnBGQaUhoYyQAgIFQATKVp26O\nsW2bL1MUQmG6nnSrBuauYpdpW+iI5Q6Sf/W//guaf3OeeAILAIGjFQJqvNqi\n9RQuqQCulKHXVIHynRPFLw2jSaLLkzP9PKx3tqTuRpZt0rZUSuQzUfoJzENX\ngQgeZP/Ti1bPT46GCRs/sHwd3N+mNJMF+49xnhA2i1uzD5siBLnTuxmsnjpq\nzvShSFbDXae4FrdICcq+041HSX/dlPcgIoAqCw4y0JTMMsnutr8ddwZocz7r\nQ2QtxCHspsMFqUuWJ2WR6IBTmfVsRCH0tx8gHqUL2v58JXoA+mzpSkjKuD9p\nS0Hm0wTHZRC/axWRCANu6Y/qTOC6URHZfahbwrbN+XsuqogiExlWd2l1ISI8\ndem03ZpR3HrSxA9oqaCGB4wg0/Bh/MhHpk4KS+vxeZY9vRhpb5RwQ3W4rXfW\nRNEGeKManDPJLk3HEK/ibbt7QvcXYKfZc5HvUgIDdS6llgjsL5dAMeSTVBsv\nOpGK\r\n=DkG/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"eb7b750e990fba13567f5336593801d3d2c36730","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.112","@balena/jellyfish-logger":"^2.1.45","@balena/jellyfish-environment":"^4.1.10","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.44","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.196_1620258104708_0.5654057007242148","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.197-renovate-non-major-4f16fe4977a095c31f322e5e86af149df29f6e04":{"name":"@balena/jellyfish-metrics","version":"1.0.197-renovate-non-major-4f16fe4977a095c31f322e5e86af149df29f6e04","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.197-renovate-non-major-4f16fe4977a095c31f322e5e86af149df29f6e04","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ad96fba2d43fa341c717c751a81ca7b39d0b1caa","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.197-renovate-non-major-4f16fe4977a095c31f322e5e86af149df29f6e04.tgz","fileCount":15,"integrity":"sha512-zK3HORkY42+X5CNKHpnkRUGYpEsVgUTy41fVE0eCNvsv7yCHcpH4vD28rTMlBa0gWxyOembRbTPl1h1HouMrgQ==","signatures":[{"sig":"MEUCIDFGWb5CIfUuzwrA4WunSxiS+AarQvbi75uTKHqvaVTGAiEA7AGW8vTUY3s6scPDJJUNHypaPqkDpwHRO7eGawlo4Mo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":96864,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJglUK5CRA9TVsSAnZWagAA9tgQAJN3+9PcFSyAUeOaEhUQ\n7FiNqDFRawvw9hf2ChBAtVzC91F9a5FLO/wRP0pJFfHvd5xmu9fKGOIctmTX\n2Nc/8nIyp7HyWJLm7bdpAucY2RxnQv3HGEi6FvOTbhAjcnVdWbT80ntVayYi\nFKR7WzVfTnIF31rX65NvN8zswjwj2+g92QDhWwiY1ue9wcw8dc8AqA6uF/Wl\n34cfTaFFuT2TovCkUKPRYk5z4ofW4iTXvEVfcSOI7AclgDTIHp0pMg+Q5L6v\nqhNgQqcHVxZPUvfdcgi9Pn3axnPHB4XntJIbtGM9VqW0dLcDM4rxlZZbN7Be\n/GZsP4GDHxv3aWeAXmFWZvZZ7O9tWQQe0AL2Mic7oi4qJLnWdKEflq4fzfpm\nbdXsnffTM6xvkKDLG5lEE1YEWsgbLJDlr09ZodZaBTKWxtYm6plo1h8RrhX6\nBMF7ZuN+QPLRk7+t/xCn7xZrFBWIAhRLQOUvRVv5aYS6+a+wO/a4LI/PfNDH\nAjFkZc6rPfKq14NB7/vMRUL1kePJsNPuYJ4de2OIZrAQVnDIpZbAMjU/GDki\n3Y0ZKwmeZb5+4r9Af+jW+flH6b5LPGAmqjzuKS2yVxhvM2MVRttmfXvvqJ/y\nW0oJj6BxoeLQ6ZD+T1/SZPymHBQY0S0TksD3lNfJZzYz4WvNghsf9JSnPpQV\nqjZj\r\n=M1FA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4f16fe4977a095c31f322e5e86af149df29f6e04","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.112","@balena/jellyfish-logger":"^2.1.47","@balena/jellyfish-environment":"^4.1.10","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.44","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.197-renovate-non-major-4f16fe4977a095c31f322e5e86af149df29f6e04_1620394681234_0.14133734463625136","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.197":{"name":"@balena/jellyfish-metrics","version":"1.0.197","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.197","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c54cf805faa718e4ab2d1c4f8ba17a3bdc74c8f2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.197.tgz","fileCount":15,"integrity":"sha512-wA5CGIRKn87RLjDoZvBOhzCyer0zpBKqDBMJqROSvxhYH7ie78R0ytZ1i5uTtVbEZA0rkEQ2HjKKVvf24IUiNQ==","signatures":[{"sig":"MEUCIQDUTigSztPqeU5dK5N2l3ffmHyRFgPuyQbW2ECupL9+0QIgQch41Tard5ke6JPp0AsWcx+CtoVeAzXvbmtSbgIp1hg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":96804,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJglUOKCRA9TVsSAnZWagAAW0kP/1ZB/udyaewa+TDce+B+\n9d9FsciDsbH0fY4TaA2tOTvyZmPf82yR6zbhBPqlOPW6W5+YE4RtxM6EDGl4\nOasdS8PxkFu25As0kx6muFqmMl8WN/RD8atXttZfxD1itj2n2TB0hBwpswj6\nxPkhn4GZzGJ6CRJbPFNXH/oJxnntqd3tbydbX2AQ69Ajd3uM779lprFmxSdo\nbLcllDef1mKLPoEJE9XUjlZ4IfGYj/jfRGv/FF89gbxwajgSTdFEQkjwev19\n0nAuGkNkaVTiRuL+o3J58qbEcCBc70orHGBcCv4GURM/ffxFHvMexO7ZkJhA\nNOVhVGyJnDA7/WNDODml5rC/bzeUbDHqFnqk7fNopHtVSCL0+ztPMKVXVzci\nzuHDR5Cz+pA3eMcxu6WkIqDRN6yHyiXe/ADofvxg/uWdiO0TZmYa4buztyMo\nVrG7BazzM0xkHzoGNwuLhP/K1jazRoyCm9vl1wW0FOYHT/CKu26xyaKIu1gP\nV78PZEqeRpjyLLeKbif8Emv/wjuwUzsqZ45yIwzfKq/mUIV93H1vj6ven7dQ\nRSZv8m/YERsdqzdIoN/+YmGy3TrTJfLvQmFUruZ5p+jX4NgQscy+3WJfvh6W\n3jTDXAcjQuz8d/kd12FMMxkCwOPR+MyNx0GPosxEOnCgeatMLiIoSV1no/og\nqbe8\r\n=mawk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"72ae92691bf2b1dfc8052e41bc7c90b0fba7fff9","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.112","@balena/jellyfish-logger":"^2.1.47","@balena/jellyfish-environment":"^4.1.10","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.44","@types/uuid":"^8.3.0","lint-staged":"^10.5.4","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.197_1620394890132_0.06238587391077832","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.198-renovate-lint-staged-11-x-540a446797c9e20060cd700f4daf2a3cfdb78056":{"name":"@balena/jellyfish-metrics","version":"1.0.198-renovate-lint-staged-11-x-540a446797c9e20060cd700f4daf2a3cfdb78056","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.198-renovate-lint-staged-11-x-540a446797c9e20060cd700f4daf2a3cfdb78056","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0cfc083cdbfe52a854ede57874b73e9707714fd1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.198-renovate-lint-staged-11-x-540a446797c9e20060cd700f4daf2a3cfdb78056.tgz","fileCount":15,"integrity":"sha512-DmSmU9U0CBflUOoo/tZNZAyqauy7oKEZ43YSKFU2jAqILexStapIBUYmcqEEsMDfVYLgBBq0eNqWoqrs2mxRjA==","signatures":[{"sig":"MEYCIQDgClvb3dIuUP7/niy/+/qrHsBlwq6qAM8h3i5f5fPKqAIhAPrUYDPQJW91XR1tyHAadoOktf/3nmlswbNJT+ZZrpOw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":96958,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJglYNOCRA9TVsSAnZWagAAiUsP/jR2CFRQXQjmSURDlimx\nyj7i6E6qyu3eAw0LyZn3FQrJ8p4hUMJiZ86cT/EVm0GGcnJtmd7FGgKM/fuk\nlodxgFZy4EvVlkkCVZvMQWHsbvb3GTCyDHv4zzk5b/lZ2BSt2GFeWU/mEvHi\npTeZEF6ST4uUc23JpnzibcHu56lmbF6qWKR6lG2lGsSy2NrVAlJIzTGRzQU3\no8m62JQ5chhzKHFr4n1IQx8d4rogdcQOr/xH92LnGGv2beA+cJ8/2d3b0TpW\nDdci8Ysh+H+SGOI9Xsy7Ix3gDILbBCHt4+ylfvSGqS0rZZA22mDtWogANzxs\nb3qn5mn59wk2bw8odjdb0a+U8m1WEh0DgPqg0tHb+aaGRJlfICJ3Vik8n0pA\nlcu5VNrOZEUEg8t8GoKEOFH/r9np1/kSTN329cx2UxBEJChjE7KmpKGa6JhU\ns+WtGCyIERMjYbadc16IAAKbfPc8NCqF3ltyys7V5ZEik05+n71YmM0ceiGc\nQDR/Gkt+Lg4rEd1GBzG2LH5u8wl9mh4Nrzqwvg79S0ojkLlK3fIIB9jUAu6p\ng8Kh5eGG4itQYCWZKYbHn4PwbhNrLn0QV7R9Z/Aa0M2uum8QgtXGyQznbRYQ\nATCze2rCMvDb0JyaTkAgrCPE7GDXYTM7VULeCdqF7EwQqQvFZSGRBgA0yaMJ\nTqkz\r\n=4MoX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"540a446797c9e20060cd700f4daf2a3cfdb78056","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.112","@balena/jellyfish-logger":"^2.1.47","@balena/jellyfish-environment":"^4.1.10","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.44","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.198-renovate-lint-staged-11-x-540a446797c9e20060cd700f4daf2a3cfdb78056_1620411214298_0.30580600888450316","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.198":{"name":"@balena/jellyfish-metrics","version":"1.0.198","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.198","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"09a2bd71de55174315f2afee2a6fb893829e3688","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.198.tgz","fileCount":15,"integrity":"sha512-YTc580GU3/J7NiTJT8bmTap8+BRLP39yJa+wBPvlMYOIGELqveAcc01FRTfEmdj2ebmwfVwaBt0XdF9c4OceIw==","signatures":[{"sig":"MEYCIQD7tJRCTY66beJl272AoeNrpdoAU8RyYfOn5RydvawHKQIhAJfavJKepm1ySSIMTQ3uh5AVaI/SfX75GnA+cwffUTmn","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":96891,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgldV0CRA9TVsSAnZWagAAdTUP/3Y3J25gUbWTJ5qa4/Cg\noCOmogvXVKfQ46V9RmGOOw6GP0JoujMmT3a7dHD0Vcv0/WQbuZds1iM8+6bV\nuer+JuwLS58sJACYNcWMO/cWwZwq5T9vMXCjl4xcMMNhSaEUM2OioL5Wg342\nV+xkhTGBVpTtshSqTW56xVEVGf1NuZbh57ajRs1DLRX7vAD9N0jMzLK1xJ3T\nLR88D1aSzZVf7+it4tcZkslayVeCCmyx13snh44QMmXZdGVFujiPyf9S1Yn2\nPzg9lMMNgNEOcEzFmq7klPwZWHkh+vpVXtcWg4vszDLlS5fmIfTdyJNcOl54\n4vev8YV1iQ28x00/FVcyw6+BuLYW3XTdc1yyhho8qgaCYLS59MbjyNIM9Mxa\nc6cUS/4X+nZQLuS5sM8viu0NUkWm2w8HsvvG+eOU/bUro73BC80li5798a9X\nOu3Kr6NqlZDc2QHjTSCyv16CZRjNOIg9XDH6MJ9qZJ0DevVfgR/e5N+CR8Hj\nlFz6YtCmB/0n1BwrAlKrBSPQBKnXvaGn11aG67tsg9L1nka5/n467heombNf\nG0rF6STkVdIZmmcWG9KCr1eayVJoBwZOp4DbJQuaC++zqActl7k9bVECnWYw\nChWvCi9+aJLj/fLbabCtJhFZy+sxsa6htYLeZxWk+xLKuXlEiyeCuFTzIj00\nQng+\r\n=Dogl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0809c2013500c53b805c74127e5dbf96184cb025","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.112","@balena/jellyfish-logger":"^2.1.47","@balena/jellyfish-environment":"^4.1.10","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.44","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.198_1620432244396_0.09042908774332958","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.199-renovate-non-major-7159b98c1513697f4b2ad7d8bf023fb7e4301fec":{"name":"@balena/jellyfish-metrics","version":"1.0.199-renovate-non-major-7159b98c1513697f4b2ad7d8bf023fb7e4301fec","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.199-renovate-non-major-7159b98c1513697f4b2ad7d8bf023fb7e4301fec","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ea3d3e6612df9a3df510c5661e6095df4dd7b146","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.199-renovate-non-major-7159b98c1513697f4b2ad7d8bf023fb7e4301fec.tgz","fileCount":15,"integrity":"sha512-2e3S0lOKJi7KrU6IGwHC8fgYrLet1KewZsI4AIFnac2G42Tjvq0AXmLMvTel0xVox3/9swlsh8dXO4etSyC3nA==","signatures":[{"sig":"MEYCIQCczpL/v/LUaCc/V34MqwK62wxScszvfsvnC/dHgkQnrwIhAJsSyMU6Us++HHef9/PSDHtu4viSiFuB0CeqckJALtgI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":97018,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgleA8CRA9TVsSAnZWagAAaPUP/2g5BiagM6Rm/aBnsnTl\nEwVgbPPL/bFhf9ESmkpsT1JTUtmiidrcnl9RnHK1y54pBH/ljLyoxb5+Q8/k\n59PnmCqMdZOmpMDkxwRYZdQv7Hef8XzWIOdRsjY9T2WyyXuFwH+Kw5zFsGCg\nwk1Xnhc7Ho4zunttkjB7RiiPi3ykIrcIiN5W2D1lI56eU5le9JH3oodQabvJ\nBJD9x/JAlb/Hom8jDWTJHBi8SgH1s9Sslsr3YDE1n8+cDQb7wKKQO3HamYTA\nmmVaHIXQeLyPq21k5P35eF71DSNCDY3sdm2xPPutz2lFK+wDosk66RwLzKdZ\nVPJQUbWHJhyDje8JRgcb1KWObwi60sf0J8KPLcTso188zpjfH7vdT/p8k0wx\nur5mIX2HMTXwJjkpnlULEumHDEWhG1PNn6YAQFlnhTYjlOQN/ZC2N7Tiqw0D\nK+SDWKyB8beApLYINJQ9iTM8Jg1pHDgGwPYcGD+YUVhYjdQsh9cgk7ZZhs+/\nH+X7YDgA30qUgFliw6KnsCoONXAvdvlb2URj2xhSrpUdIYpN7CREWB8lPd2C\nwiWVXho1PMc4kJQitKdvkxkmUILOALMC2l6kIc5gVqiAPVZkRXDDV2lxNZ/k\nm5gkyYA4gPwDnVEFaOO7bxqph91WJ7AE0ODtSvk4whEZlTqmKX8dwwQvJdjw\nZYsA\r\n=PAHt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7159b98c1513697f4b2ad7d8bf023fb7e4301fec","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.113","@balena/jellyfish-logger":"^2.1.48","@balena/jellyfish-environment":"^4.1.11","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.44","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.199-renovate-non-major-7159b98c1513697f4b2ad7d8bf023fb7e4301fec_1620435003979_0.2556874122864119","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.199-renovate-non-major-cca59fb8f8bf1b1a76618dc9c280bb54610e3003":{"name":"@balena/jellyfish-metrics","version":"1.0.199-renovate-non-major-cca59fb8f8bf1b1a76618dc9c280bb54610e3003","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.199-renovate-non-major-cca59fb8f8bf1b1a76618dc9c280bb54610e3003","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"daa512dd0a0c995c225b4746645a2dc4ee1e3d4f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.199-renovate-non-major-cca59fb8f8bf1b1a76618dc9c280bb54610e3003.tgz","fileCount":15,"integrity":"sha512-0GH80sGAdX6gF5PWGNz4A+kpsCPAkUK9xLipKAUO2kahH8nVFyyyin8gyIffqNAef1oDaMt2Dso6kA8w1QkINQ==","signatures":[{"sig":"MEUCIQCvZ/hWKyF3uls91iT8X8s343Z5EmNNZlsnVlOKQZ+FpgIgUvntK1f8IQdDXy/MPl7jznhR8bMWi6dzTqC2DpycvGQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":97018,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgleKVCRA9TVsSAnZWagAAas8P/jd2inS4z0GY6YcxNr1Y\nzfEFjY/bOAGH+ZXUbPNVuwZy3fzZnJjmQIlzcjl4W9qvQpjKzRmD5ICmF8uA\n9vErdIvjYRnIzS18QIH1TwaINo04Y/EHOPa4y2MQReJclre72ZYpPXu3YCkD\n3u+QMBhrExZdh/T9oMr6xJTmDE6ryISS5fqMh9ocLm+FigGNA6NKC8rjSNjq\nwzzP8TM6YVTOM+9ui3vgWJ75gQb2fwJ2hSZX31kT2j5nM+Imqpyp76yDeN1L\npPHX8F6Vb4THXtxvNCxR0/i0Liz+enz3V2hTqUVYHS+CmXnqVo+45cursJIo\np/KVVu37QLavfGZwduhVNl4kKOS9MxFXHhNAZysyKJaYmo5Ju2ED4rtDD0Sd\n6Uz7OMY3kNb0yT1YpF6HfQ+y4QIAuQV+jGBSL/vSyPpmrqU9D+wMlbIxk9IZ\nLtgVXo5NCCypHiqr0vfP/KvyTpdKc9O1ccCPsg9PV9GzjFH1uS/0L8PF80oa\nw6urGhtzzeDU0iq/KSPMUOkUONpOHFI4MV+uNfjedrDcYIf6jKb0mOeSOXeX\nJYSTsCv2HkNKqnSbqbeWHevgFI+TQeFB0yUr66SEw+MH3twDdGcG9oxc0LTy\n9tanM0NQ5ZB4TaAd+ibJYOQCXrxCDh2KB4Pb01GFKXPdVeREEkQuakZnDNif\nGTXt\r\n=u1Cr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"cca59fb8f8bf1b1a76618dc9c280bb54610e3003","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.113","@balena/jellyfish-logger":"^2.1.49","@balena/jellyfish-environment":"^4.1.11","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.44","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.199-renovate-non-major-cca59fb8f8bf1b1a76618dc9c280bb54610e3003_1620435605294_0.2398192933941692","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.199":{"name":"@balena/jellyfish-metrics","version":"1.0.199","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.199","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6317fb3ae6374cd2838ead51d8d63eb6cb01b301","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.199.tgz","fileCount":15,"integrity":"sha512-ez1G52iF6tRtite8lJgCYLsMTHoJyHKFoKI4HmqnP1boCt7Mpxjls78oJOIA2gUtIzZ8Ze0Z2wQopLbMvu/hcQ==","signatures":[{"sig":"MEYCIQDBpeIHGHTp0Z3Mw2Z08yVOTremm9SiztPZNdgeKhv+ZgIhAPa37VIdLy4xP4J7/0QyMIqCQtNjerFnaVk5P7Yp1OHl","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":96958,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgleRfCRA9TVsSAnZWagAABawP/2x9Rv7FamzyXmMu9RwA\n1ype24gzmlAtB5ikNTSmGDkm354dzaw0I34kHC+IOwmMlf/jN+89XwkyFyP3\nHoHsLq7C8UE2qjKIbYjTHzicGkhGHSGNT5InSPzqOZ0+WIwwa8oxyIrgOswh\nbWXQ/DW8rj98DXF+PpLUkePRk9n4EaFyoEf9l2xnmLJzf8VUfb0iwM1s+FKW\nqVHfsVI5avnkMLzneGjRw2y4a5PbVSGjCzGXj6TuKir+dc8NQeb5jEROl7Es\nUQtcU1J1uZf307IatnZXqaj783PyG6LEGZwvLYqXYJjCkJ6/QgH7ByhgoMoB\npxlMhdm66HSDQ5MEbDw7thCHBhcadrXUJXH1K8Aeo1vEBXY8Znbp5sRhpiiE\nT7wzwEAQ8ZBHxqxM1tABEshR3JEUHgTfMZFuWKXERDM5N/teJCCBOMXQeOaQ\nr7drsNMiF1mfokr+SA8U843ke6wWJop/vJr2nOiXv18XWvd4K0AFy1XAsVjx\nJgR7M2jg3b9IpOBkC8fY9WwIzsT6jXGXdZF6Nf7fflDdQQ56v8nghUHrhDbJ\nz0eQJQWEhdolD3PZX4CIVzIkrDMdq4keZke23ks2f/+1Ju1bfh9/mpNyTbE0\nQcAX7CMlUZCSDzZxcjhMTW9XqwelEfWoHoQ1lX2FNeK6djZip1zAVuftSeGO\noj7H\r\n=x7ns\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5dcf6afb3c20e7f68fab86848ab383e4e4a731c8","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.113","@balena/jellyfish-logger":"^2.1.49","@balena/jellyfish-environment":"^4.1.11","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.44","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.199_1620436063056_0.3396855867509172","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.200-renovate-non-major-0ebd8f562fd576169771a8aa1761f913afd2b31f":{"name":"@balena/jellyfish-metrics","version":"1.0.200-renovate-non-major-0ebd8f562fd576169771a8aa1761f913afd2b31f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.200-renovate-non-major-0ebd8f562fd576169771a8aa1761f913afd2b31f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bc2ebcdb2a5bdff6a2e2b5d94bbabb62fb851c1b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.200-renovate-non-major-0ebd8f562fd576169771a8aa1761f913afd2b31f.tgz","fileCount":15,"integrity":"sha512-NI9Ks20rAQcJ/X1PZ9UNXs6DIS8cajySU6KB8JxgvoKcfXEryXBgjn6bxoLbxOT86jfufsFb7CgOoFqexkBn+A==","signatures":[{"sig":"MEQCIGqwNHdH4A5clwaQk6uMZmmWnYgdfpWxqlMro9z+USMDAiAUAlayWmDLBY7+HGdQ6SiqQoE+2kpDrr6nfeuLFV+Axw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":97085,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJglg6KCRA9TVsSAnZWagAAPgcP/3lXHFIAZXAfQh2kksRK\nO4cwoLjJ30zYhNBwnQdsCc1MIH4aAaQJKVTy8UR3yrVyKaRlHnejzIgwdm0b\n9aU9ugV8FFQe5x8cSKHanDRmaecJmhLvy4FtIQbEXaB/GyEMgAoyaGSZfq/V\n7w/nv5QJNpA10INEXLAkvFPwAIgKks23Zjc58Q+Q2DQ40pYm7e8zfaSDumKt\na8bAqSk9ch5pzmV85njidb9KoE1W0iAqn75p1Uz5la05TBe+Y8gqlrKg/OJ5\nU6FZLQwZ/1rMbkVsx39rAPclBlFrnpzPK4F2z09jXv/0FPnkuHQIiyHS8BC+\nm+8eHQY37GyHzLxA+AGejM1L+J3ProgsCwpDkTCD+98Hz0PBvNj4TKw5QP49\nJSYdgs9GuCra7hd7Oei5TMxCqJdMpti5wGGpWzhBHH1fyeHIeG6+BKsNWEUD\nIdKUSUjVpUhh3AqdJr2LFKhTRhEav2aKLd5fcbtAByFdY+5M+S6VlrEG7tpS\nbz4sIT09N1Ix7zL4F1KiHahPOK+WTHTtWXFsnwLrglJe5cuPx4ktwd6z4tH8\nlWWQi59P9p7JTACis8Cjc6GQu/u7VKJiejHii5yJnBWEDfhdrysgnpy7i19U\nWnBJ1Bq8x7x+b4haj3eSDQg5gVtM/ajrKGtROa42WxqCeooKIS/qL5lcw3Uh\nxsVy\r\n=A7Tc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0ebd8f562fd576169771a8aa1761f913afd2b31f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.114","@balena/jellyfish-logger":"^2.1.50","@balena/jellyfish-environment":"^4.1.11","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.44","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.200-renovate-non-major-0ebd8f562fd576169771a8aa1761f913afd2b31f_1620446857800_0.7379719773571418","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.200":{"name":"@balena/jellyfish-metrics","version":"1.0.200","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.200","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"054b5fd8a31e4595596a6709849b4b854fc8b345","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.200.tgz","fileCount":15,"integrity":"sha512-9lcJRRFl3Ju7dbeoJ4iy7mQqqPC9e8RV4EG8nY0jecIbmvHgrxVH+Q/VWx0i37aTvC7gvqub9vBkZGcpNpTgsg==","signatures":[{"sig":"MEUCIQDecZnIcWPajsNcAD+9HL9JGuHESG7rBH9ZXS5GZq/jhAIgcVbbzmKrJlzmPKdZn+5xrt04B8djxzo3SNBFNZHL2P0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":97025,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJglg9aCRA9TVsSAnZWagAAzLkP/Ru4HBiv1Ot1yYr4Oyck\nLrs3efir9UGAZrf0fAbdUJqCD0UUF5xikBl0q7tQxH9EzT7yYGbAAhJS9Fu2\n5l2pLf1V7U9Ue7ccOU5plSV2DKnIBPW9r5L00+WNWgyrSqDzXyvQFhCOuG+O\n+QoGcA6cFDToKwXvLGSX6NUGcfVaMtwGfbWZHcSShmn+fyjHDhC/qgVU0mkN\nKLj4Z2jhnCO8oNAqs65rgNc1lph8v8iHelOddNxg6/MuL+1UmOJxw+W2iddm\ncWkirvH7Wi5sW5cqbfUIc5lzBgMoBEn8qpFISVVFR+L7ewO684hExGzZQwRY\nTNB0kTe3YeyU15pI81A9Fl3KaaegURFV8mQSHAEa8oly2+ytTa/xPA7G50DV\nZhvHJhY1BLgdw+p7wBkp5l3VbvYnEludZr3KJE2yo8RYLW9es+BUYA48UeSR\nSnKCxcneAPtpVlUa0KQWmRWWHE3r9JI5l2HIMT3xxus4FZuGmvEnocqf1XbY\n5v3e6EtMBxUXP6vWS9dZAr4AECDAHBodi9JthxSiqZdVWyPkkE8BDQEr6JAm\no4uAnAOcU7HPpFhAm+TBZ5u1uLTg+Jhtv8J+NW4phTmYTz19pXyQbycTVgc4\nOE1uex18ext3AvpOlw/HonspR2y5lnCkSh0VQrY1Ql0izo23N+lCTIma7lXP\nSCXY\r\n=QJDM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"901abf9a4ab323f3c323f656ddb0723788849265","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.114","@balena/jellyfish-logger":"^2.1.50","@balena/jellyfish-environment":"^4.1.11","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.44","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.200_1620447065606_0.19756907123316547","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.201-dependabot-npm-and-yarn-hosted-git-info-2-8-9-9b77c46e112996f1250f5f3d185de3f954f18ae7":{"name":"@balena/jellyfish-metrics","version":"1.0.201-dependabot-npm-and-yarn-hosted-git-info-2-8-9-9b77c46e112996f1250f5f3d185de3f954f18ae7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.201-dependabot-npm-and-yarn-hosted-git-info-2-8-9-9b77c46e112996f1250f5f3d185de3f954f18ae7","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fae9509098cf7e1516188cc1877b43c0fe3a2443","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.201-dependabot-npm-and-yarn-hosted-git-info-2-8-9-9b77c46e112996f1250f5f3d185de3f954f18ae7.tgz","fileCount":15,"integrity":"sha512-ot9Jd3V1SeJKMWFJR9zPRwrbRpJrvbXcRHokHsfXlM2lI7K/aRVeUna42ZmVBvg0NZk6eW2oWkjYFYU29A13hQ==","signatures":[{"sig":"MEUCIDIb/p0NCA8sLIxUggi+5fFfCHjb1X0Zw8W9ir4oAarOAiEAvJbDM4tda9IQbTv272yoBi6pZbABg9a9Oxyx+OzLz64=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":97212,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgljX3CRA9TVsSAnZWagAAlsUP/A332A/GXTW/dddEprc5\noqmjQcNSnSCbvqNbgUDFI5m+SZecNXwm40NMrqaYT+85TDitS08vFn1eUT06\nRmUjb83MY10TPD3paUnkzOGRsDDy9iT0apXPUgYupSJLV7Getzifl9pqgMfg\nS5ZvsAI1jPy/Y3W89XzazQ9VGjS6Qxi79NnozZ9KMPpxRplZNjf9v8XzaDPH\nb+CgB9fK5FFNYxUQfb/5FuKWO7T17bC5Bg8Czb0r7AQyobi4OqmDm9tbxqfz\nlAnlXzdiyfF7TVdiRRwyBvhQkNYXDdjE4rpjQgUTO6DXwjy2XSBUagWeT+bZ\nONDLI0V2+ITjUcXM/pNqX0uk80vMD4I28p+tRq210moUlH6jJ8+uSrCJp23e\nVKQiivMuCIhw4w7YvPRyLwzb5urUOU7+0KzbFiAo9dlxtTeNa7zY1NfFPo7k\n7kduS78HUTL9csCDMd1cY2lpq0auq5OCD41h1rBeQf/7yImXwplAtL7o5Mgy\nLn4P6BftgXJ9Y0mYJjFUV96fJkHTnXDfn4d71a4KHDy37BhevnZkuM1IwGpH\n7WiswRb7xXEpAASdTtnjdVrhX9Px8GjvwTX8ZdFkkxsskeg6yjh4JUixL/Jp\neyjwvPc9HIRG1qO3kJSoQvbYbxPgZJsDkJFQVJ8+qLuBrthEnCjaKBTsrpXD\nbpvT\r\n=CbHD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9b77c46e112996f1250f5f3d185de3f954f18ae7","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.114","@balena/jellyfish-logger":"^2.1.50","@balena/jellyfish-environment":"^4.1.11","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.44","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.201-dependabot-npm-and-yarn-hosted-git-info-2-8-9-9b77c46e112996f1250f5f3d185de3f954f18ae7_1620456950624_0.3936308547476468","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.201":{"name":"@balena/jellyfish-metrics","version":"1.0.201","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.201","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"49cb37a6eaa6c6e1a2a3704b39ca97f2c823f1f1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.201.tgz","fileCount":15,"integrity":"sha512-Q6t/VX5vWlXoeRAXH3etnjCq9NtBJV1kGcah+njTAgjubAjkLj3p0IFwedO3BzOaEDkTbNLK9wxDeu+jjDi2uA==","signatures":[{"sig":"MEQCIGWOJOI1pVlYfDzfd6gE7baj/hsIs8QN4JaFXcnTQoWzAiBfzOG0JWoF9meCFvyewYApn9GvqPcTy6mOjmPVFw7F8A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":97125,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJglja3CRA9TVsSAnZWagAA8nkP/R54eG+X0/ucnkCqDBWb\nqyjmhBTgGOzIu1uz7WcTeJM3Zs9sBqiNGd+tzJqJIlB55U0jNuaumsrjDVdk\nG8psK4PrFCRtdVfYLOnOf5OOw8obaTndoUpYtVzbyjdjkF0cgW5j7U80V6YB\nk1Eg5zN5YNNzr5+/shFO8ynwSGtNeu6Mj1uiuotIEAB/zp0AafYUq+O5CvB/\ndRllfirsGZVA1VA4GwXueOxpCp8teLIt6UaIkUeKpK50PKfT4LE3FgNLkN+5\nNGlQ639+cnv7hcYzMxLfMx/3QRv0x0DyCZeZVEqUvIPnfnoNPreBOWizkXYs\nwvYKhI7cp8lc2SeTe4h4K0s2Co9asry83ItSgKU0GbxqxlvyRRQcb2Nl8MO1\nIKpFSeLlkN/DBs1BKbHOkRxXDORsuvvIdnZBRbsl//Lm1hSnYGvDFrIpot1Q\nVdQK2T6dgTNQihsDEeefnZm/XdvYAdWSAuvYW5ga4pNXSUoOJL8RnmIx5fEw\n7niBYUVIGx1ex7f6OKmNt8xJikn7HOeHlogjCo29l/80fq0PSf5KGnw5Pxag\nxScr7yD9yBU8xNFxEtjl3dmnxWTYxdsXBx+CS+Iu8jvWxqfBqX8ysosIEYRc\n+PFPgB5IYN51Wxq1XEGrIIPCWBnOLtHyAp6PFFCimGVaWEy5O7SgCrxGSstp\nK8Ba\r\n=HPrP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e004b93011f8c0fef4dd627aacde415c9d19876b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.114","@balena/jellyfish-logger":"^2.1.50","@balena/jellyfish-environment":"^4.1.11","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.44","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.201_1620457142521_0.7953288015445004","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.202-renovate-non-major-062f89f63e0f1bcca763a96582898d15181d3b57":{"name":"@balena/jellyfish-metrics","version":"1.0.202-renovate-non-major-062f89f63e0f1bcca763a96582898d15181d3b57","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.202-renovate-non-major-062f89f63e0f1bcca763a96582898d15181d3b57","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"97b3243b6684f8414d623eb168d1839c84932436","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.202-renovate-non-major-062f89f63e0f1bcca763a96582898d15181d3b57.tgz","fileCount":15,"integrity":"sha512-tMKqA0r8l16Ga3R/Kp7w43mb/D3ruvE9ZRzUXgfMW1MgqCSdEbkmPYCVhSx1Qpeby2yY52m5XRWO4zQu95jo4A==","signatures":[{"sig":"MEQCICRQMeWq892omdgcEXmf39AX5/aBWIhHaiLXdXoIOY1LAiB+JhgAZ/BLw/T7myFVz+co4YL9Xuo7hZaw55B6hQOb8Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":97252,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJglkvtCRA9TVsSAnZWagAAWmkP/jlxNOpJVwFu6Uk7tiTm\nVXQwnjbrKDBKFAPYQlXFA7Zu+YELOWsrRh825Zqcm5DoFBQjxiUI3QcU6MGB\n+o5H59J0NEv+gYsAzYDPNw1t1/HoRZnLDikUjv6S7HhqH7BPKaECXMzBwyJL\ncBdr3oREXgH7FIalO09b0EUxWLLka80bjcbXxACq6B1YNWYWK647sumhZMsA\nEozPKlPjIMU7XUbzjtqClL12l9pzjB69io0sMescQzSBlJxch5cTfVA+uRPK\nJU9zsGojm9BhFkFR3dWK9YA/sShUeswXEkrjmqnDY7Tiwv5YmRuJArZWmSuK\nPrQWA5fv2tDGaELTwQYKvtfpvcFo6QTq9coV5G91SuwbuTy8l+3NKribn/ke\nCHbJkqXsYcyr18cgpHi9HN7gsES5RHe6lzkM+NtVMSmEMQIGrzs8+036xzJl\nqt+NUsGk9FOK8BKN1PFSCiK5tsTgOx88Tvj2HAiNWxlZXSu4JbfEdRYgj8mA\nzi07xBAG4MOZSjEF4BiA+hg/JDrFpF9e/82HjU8AZE6FLoYLNgjBDlWTfGEb\na63JjJc7bT+zePGpvBIow5lWwt/us9t8S6gI8ircxy1b36f4ZQacPOK4AYxJ\nC8YJSh38izFzsaW45lDCUcKBj3I1Lc4Gf5RP9XLlbgCeL4MgnhE8ysolFY6W\nXzi9\r\n=/Cfl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"062f89f63e0f1bcca763a96582898d15181d3b57","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.114","@balena/jellyfish-logger":"^2.1.53","@balena/jellyfish-environment":"^4.1.12","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.44","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.202-renovate-non-major-062f89f63e0f1bcca763a96582898d15181d3b57_1620462573089_0.13649659647201018","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.202":{"name":"@balena/jellyfish-metrics","version":"1.0.202","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.202","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"73afead519dd2d66f51eae2b47caca9532dbcb98","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.202.tgz","fileCount":15,"integrity":"sha512-G+OKFV0pH76rPTMjrtuoFJpeOYu4w2xCoEhtFi6HKlYnFPAui/wLHxOH346474wWN4ETS/23TbvnWbZNXxGQVQ==","signatures":[{"sig":"MEYCIQDyS9Vt1x+OzjuMFKpyh8PB91KlMxqvlcyX2dWbalJDhgIhAMeEmfqbh5oCkoP43FtDee3raeKwLfxK2kh7x4CsREOQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":97192,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJglkzPCRA9TVsSAnZWagAAdekQAIOKkNW+xXZiwO4Ql9VL\nJ25svqfibj/WusM6J+Qmsz8jLQXIGsPgM2BaxR0yQPk/eHozQPXua3Vv8Ffo\nvOzZTl5uu+AIR4rJBxsEzm4L78cxvIzYuQcqw4PD8nhSxj1//V+gZRtZhX+X\nrysBtuMjsl3A3ghWT2bdn6S+4VsLQhWn/AHBM4S7gVqr8vp5KOujIO28+WIg\nxbyqFKj7IIXl0P6FVy/pFYKGPVhjPh4cAyunS4rJEfGZ5qySReYYZ2OGDl4x\nhzmqAEQmBSE3Fz6AG/F5UVftDScAQrWHVmyO9JVyFnGcw2UoY1CS+G9P3IOm\nCiaJLN5mtQ7lJiQxzUyXU/RIWKYIt/rChOqXKa6ntqzZOMfjsdTTFZP3DMtN\nEeeYd63R6GYVMzISLOb+FOBww9LxKYk3eEjjof6zFuWdcrBy9qSz6pDrdfld\nSHQci3hI72DKXudNIHQH6BWtyqvZ9TL2crhuvaCL6eh523vEcH5A1YtglZzq\n20I0rtf01WJllyzmjVrNUwMC47oAYEGSx8RSBttCc7LX1UkMLGwwKVo12jC2\nUOGT3bhUCBSVNzV9F3b6sbKOa6KEkeGJ9BmsOOkrjnuRiBYjDjIrnEHbbNmv\nRGEw7xjMUlSZzw6SUWU2CR55yUZai8TpqdZRWWx/U2PWGr4qv3vACXZ2QRPl\nklNS\r\n=BPII\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c03ffd96cfcf5e5465c73b404bb1776b03a68750","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.114","@balena/jellyfish-logger":"^2.1.53","@balena/jellyfish-environment":"^4.1.12","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.44","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.202_1620462799358_0.009200786344342848","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.203-renovate-non-major-5e6f5234caca86e376a22432961e2a57e752c65d":{"name":"@balena/jellyfish-metrics","version":"1.0.203-renovate-non-major-5e6f5234caca86e376a22432961e2a57e752c65d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.203-renovate-non-major-5e6f5234caca86e376a22432961e2a57e752c65d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"69a8489b678d2e1e8b0a123bb633c6e4b7043c76","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.203-renovate-non-major-5e6f5234caca86e376a22432961e2a57e752c65d.tgz","fileCount":15,"integrity":"sha512-6IJv87w4Sw0OiJapqwLbVu+D7BuWwSphLml+CA84jMWv18roLF7WwneMG8u1A9zXpODlaplsvB/fcWmUq1zqww==","signatures":[{"sig":"MEYCIQDiiVHWX4ZO/rpKOG8PTYt5E4bqh/G7ZkzRqIUyZkDFRgIhAKSVri4DTsLBt5Hhg7IIumhAgKNl6oGyguszY+5pC18z","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":97356,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmOPICRA9TVsSAnZWagAAQjwQAJgoa15x6GHrTT0gjEgc\nEcENK0D9kjIoCOgE1ZCwrIl4A+srKmkY7mMZgPXeZu0bQ1TtQmNJ/BRHAuuz\n+nEvt/9TY4bfXapys1VbyUCe4Kbl/LxZ2YBOU6t2sh+yA94/ob23THsjrf0M\nL46uj3jcOaOgsJI5dZ6diLgGbL/8uRjqDSIQOK1UEJ/Ds1fOUN7seoMFc9KD\nxMHLqC8GcbSzHOj5vlRYw05C7sbHYQfbvoz3gAJxP0AmNkPgNIpOjASN8PjV\n1uYv0cWKvDrwYVFb6TPvSPLH7ugpRy7RX34psK+Uc1a194xws3zf4hIDiap6\nyI9OLe4L+W3P8s0cU00gZkLsgq2kq6r0dOrt3vC4QL6ZryGrKkJGKPPAEMSl\nkA+KY8FctryJqpI3TVkQ7WXEgK3Ec3XaZxk03vqA0pggagO1heSKavQCX1nl\ncCif7AjoBkKpwcW59MoA6aoqP3L+ISEt8PeiEx5lN90BWEIbf6Nk884UkF/5\n+UR9Pu83YOk4rDZXxx0mU/IwYSMK8yAs2hTWWv2nGxgMCuzdOD9KY9d7KGhF\nnjQ/SQTet7v78wqR2kO51F9aSP5iGai2wbMniXlyO7bhxeeS81FDNJTbJXYE\nSxgph6hKNxaeYz/dllGY9efj4myJfMDxzkpUgRhQonqmQSasi6WNwaAU+tIU\nxSfW\r\n=1Kkh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5e6f5234caca86e376a22432961e2a57e752c65d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.115","@balena/jellyfish-logger":"^2.1.53","@balena/jellyfish-environment":"^4.1.12","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.44","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.203-renovate-non-major-5e6f5234caca86e376a22432961e2a57e752c65d_1620632520235_0.7014209925204877","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.203":{"name":"@balena/jellyfish-metrics","version":"1.0.203","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.203","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"817a877339098780335b29a4521ba48976e5a06d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.203.tgz","fileCount":15,"integrity":"sha512-Op2sHH3blGF+ujPgwMMRBiJ4guFmmAJBMO93BvayjYF6xByMX+VqxHO7ZXHWkbzApnu7xX8/FBnArAfXcM0pBg==","signatures":[{"sig":"MEUCIQCtMxzMQg0cB+ofJb0JEAPwMxIEdgB6jE1S2YrkSrsuGwIgPq/Z4npR4zFjADH7jVqKtEkZJ26vaCXYvzzk7OvGKwc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":97296,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmOSrCRA9TVsSAnZWagAA85gQAIHe7wMeswqfUBDKj581\nq0L8V2UME4efDRCBC0r13tyX1yobLxNuJMtfHXuZK/psabVrZg4CP+V/mZgS\n2K8zrC51o3PzgNhMlTeq5e2CIXhQxIYSWx3qQdgnpY7xPjqjFbiIM6mDfvT8\nbb535+T03N/jW42S9xb9kpnzlR3a31/2rYwcEO3Q8K9iCwigZ/ZTFOWTVKpm\nttuhoZYjf5sBXhNcHh72exbRjmWSMu7pt9EJIijhchd+GeODK/N5Jw7glVuU\neQN90tnKDZG60jDaS9XiQXie3/7xaagABL32SiCgEeSjeS0pN6Rt9zxSjpvu\nEozvAqm60/D4tzEIYPQsvmcCX0UhZnk0M1PRrtMgVuWf73qZGOdZAEaRjWh4\n1TvGNPfDDNW5FVW0CDrsBoiAbpVKSbCGN8V3P6QsQCu51i1hibWSb89c21Jv\nuJP1gjA4mSjmqH10D19UtclUwIp0+zOuNMzAlwvZEMBfolkweutXohtU00E3\nhn1SvOphIv/W0tCmNaZ4J12mrhSxlHqwHJt/UAbFe/S7K6Um1ZUWavglxTmC\na0S1CruXyFVnhf0LO8W6UERIhKe7nvhiWwe/RIxwNH5EpsXZkZKh+wUlSv+o\nTMfhXN5LmoUaVs8jqcEgM8lDFBK/mzjWWUeUKX/URuGOMH2qFVrZwRkYTngl\n89N6\r\n=ZzA+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a9f87a55f74111cd4e33a4564224908ba53db23b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.115","@balena/jellyfish-logger":"^2.1.53","@balena/jellyfish-environment":"^4.1.12","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.44","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.203_1620632746954_0.39308319894424226","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.204-renovate-non-major-5f5c3e8ae8d63f9d47ecea34f8e1024929291911":{"name":"@balena/jellyfish-metrics","version":"1.0.204-renovate-non-major-5f5c3e8ae8d63f9d47ecea34f8e1024929291911","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.204-renovate-non-major-5f5c3e8ae8d63f9d47ecea34f8e1024929291911","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fd2ffb924a5b3567c893a1cc7be746338db4a9b3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.204-renovate-non-major-5f5c3e8ae8d63f9d47ecea34f8e1024929291911.tgz","fileCount":15,"integrity":"sha512-nx5ARd4qFRgmaimtndQK9qynxz5fdLoQl3m25HeRe8x8aDB5Mzwx82xnt9Q61InPtI72PV7XksgG4S+DB8eqpw==","signatures":[{"sig":"MEQCICrbHe9kpHBi1W7p8YXoWFqMCpiM6yJsvxjAgTZOjnoXAiBaaJniFsleAAo8/pUwVmONXpGdVbu0+A1SC+fvRAXnRA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":97460,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmRh7CRA9TVsSAnZWagAAZ0EQAIjuE+QdtXsddLs8CeYb\nNeaQFi2Pi+jK9eFSILsH+eyyXOYWEwHKVM4ON2KJRFnL0LOoArhhwoEg90d0\nWBR3wTtZ9hwscJbF9+3juQChKVAJV7iTHXYhVQjoYVNTA8DUVCXrcc6eCQmH\ndMTi5epAOf/XDvmIBh8+YLaMG8O8erhdXBrliB2xkNKfJLzp9U48YmkgZbSj\nXZCsy2e135J28ywCWdkBuQ9ne86/JEFzpHawjauJa805ccg4BIAl0ryMUulT\nMId+dkCMxEuJfcwB7GWZCGaPQP8BVBwv4zt9tW//9W9K+xPK9STYMEZbI2gM\nMJ3NVJ4ztdCNSPPJWYGJheYxK8mQ9ZNgHpaFYhav7B4Kjsw+eJqoieSUPWqr\n0+LoAobHzWWHJN86IUAh3KyJ9oMg3wzfshxcW81wznPdAjPc2GmOzLDZ7/WI\noz2vKedbHanh4Q9cYTyofdMAA7HnpZywh0Pltj27FOYT+S4GL+peUA+SKvh4\nn8BGp70A/aogMHKENPpVpHRhtjY0FjqX1mfDajUoGVWiDcvkT4dm3fVjPk5b\nUcPMHo9a248mz/lHJdEdm8020cwHwSdZWzXapF1xx9qEyJ9HEJ/Uo3G8P+5Q\nwrSebHWwPzb9pckW0CmZHvwEJQyHsAo7K+NbZpcgiATJspw1+7GjckECEyNV\n04Ny\r\n=YDEb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5f5c3e8ae8d63f9d47ecea34f8e1024929291911","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.115","@balena/jellyfish-logger":"^2.1.54","@balena/jellyfish-environment":"^4.1.12","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.44","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.204-renovate-non-major-5f5c3e8ae8d63f9d47ecea34f8e1024929291911_1620646011452_0.8689059275188","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.204":{"name":"@balena/jellyfish-metrics","version":"1.0.204","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.204","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ec180eb9ea2f9734594f18b89c489b751ef6e195","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.204.tgz","fileCount":15,"integrity":"sha512-4ms2MDSjW6yJp28tc/DGfMJeACwO3W9A36txgvnubSq2mTcwbDgAR2e30pawhoLVlGC1N6UUmBaD1A3mIOgnVA==","signatures":[{"sig":"MEUCIDLxzv+9eeD0LN2PhM4u8rHeDAzOIW/wyTNPz7aw/edXAiEAphMy1O/VJo+wgFxccvYcWD1iKDFVqFqvU+mvFVWaCnQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":97400,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmRlZCRA9TVsSAnZWagAAGt4P/1L/uOnsfurfWtfUb7HH\noT7Kb6zu8OVe2e01o8YrhOX611BdSFJHBWeSUzWQlA0qNh5jjvhrO6AYXwz2\nqpcgQGqRw/S+kuHa2aPHIaNPuij2QazG5bu5F/sGkXITRE1gU/3AByl1OT6d\nEW7/fBEr/a/524nFBUEkqCSlNeMdu0MbHnaBGZy+zhfVn4FjPtWiQ65Z4JxA\n9hgYLRRnA+kqTmFr6dBiteZMdjUyLhLb94HPI8ooOAdcZp8tpXKLrfMB1Zk3\naNvz1oOYqRFyHNy+MwT0J/0P5l3Y260aCzMP1ExDCOH5PPjCQWACBM834wpD\nomD5XoImlDxhxtD2+ekl0/wG/JLJfC+D3UMZkOMfytrRdHGRhJva9ybtuST/\nALfBNgB+NEVpiyVqLubNi5jNlLizmTR/8tiaixU8jhpYIvcdjwyH6uo86kQT\nTPd/x3qlfQ3qk48VTM2YRPmcfaoV/DRzEGqknjV+3L7pWKgRD4y6iScnz2CH\npCeYH86IBCwivO453E2pfd7E+6kIHAhmYB94CnVjWe5eV7ORsVQ8rhv22I1S\nbqx+v6enyh/4LYK3AoJzViD2YRo5YamwoOb+jhq1BluLm5CLLSlSo+PqIaES\nX5YPV1Gi7j7OViHlw6o+05r9LudKn9YFlRyE7jDJcQLwgTtjmAt916/5oHTz\njikq\r\n=rCRe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0910744a933a615b782c320db52b670883e39f5f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.115","@balena/jellyfish-logger":"^2.1.54","@balena/jellyfish-environment":"^4.1.12","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.0","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.44","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.204_1620646233375_0.6948767949493333","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.205-renovate-non-major-1f64b4c1c252ddde89b4e02d3c0cab4e23b107aa":{"name":"@balena/jellyfish-metrics","version":"1.0.205-renovate-non-major-1f64b4c1c252ddde89b4e02d3c0cab4e23b107aa","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.205-renovate-non-major-1f64b4c1c252ddde89b4e02d3c0cab4e23b107aa","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4d45c379b0e10687915050466671658089faf225","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.205-renovate-non-major-1f64b4c1c252ddde89b4e02d3c0cab4e23b107aa.tgz","fileCount":15,"integrity":"sha512-3A3/+wxKB9nYqb0LAuc3q8aq1CvojmyldSOleuBI9+4mSpIUzNZ9BuCRZ6GGO6Hih8O/81onWvaTbGxFkvCMog==","signatures":[{"sig":"MEYCIQDwdOK6EGecrSGNiesvVmTWwfmNe/xrHJ9ZJBqqsg90AwIhAPTM3Nu8aLK4lqsvUo3CBk9nxC/EbMVl7ZEp6cDEzO2q","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":97527,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmkGfCRA9TVsSAnZWagAAqnAP/iKXJbefICtLamIjm1S0\nWFnZDNH8zpNNwTt1+aESCNmjaqapMiiR5tcQ3h7lp440/fzlQORmjxXGl+jW\nC865QlBWQhV9S+YKKdBQID1Ouofp6zj4/WIUh+qWwqBqAgsljmLXc02JyV3q\nlhXXG+iB1UwLq4WcMU1BB8paWNonYYos9OwaCBCp/jx8/i/uwo3y/YBVdLDh\naF6yKdMT2QpQtl5JLBaLaIP66cn77t/M7oBqIwriRh4s210NnGS6WkqeW7FA\ne+9S5+/rWniYIxHsCpa+HqCSKpOUbzBK8dUdA/B1N2kyq2mhxmb67VI5MnZd\nW983yIqIl/0qZn2XKn+0LfPUqnBUyn45xcCVMKLgYbwVE3usPIbBQBQiafbt\nAI8QWhAsBTXkSLW54H6olskVeZXbMavpdh5O7J2ZPtlzlbm7Z9StLGOblmYO\nO04qERPmx+gOp79K3h0ugYdaQ3X9UsquNHvEr7DHJzwLwCpVTWZHH5G2tzat\nwHifddbcBRgjTZ61SlLj5NqNRtnH1wrBPBp2oy1UNiaFoc7NqnudRoIdXX8E\ntoSFcN2H2CuZ72LNEVpeTytgHwk8h+EHIHsjHjJXqA6CYLQf0J5iJG2gNp33\nlb4OMaUAqy08wXLFNTh0yRPpyQEx3ZA/vWpvrCVuEGm7q5IHuL5BDISKKwo6\nFav3\r\n=Gu1S\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"1f64b4c1c252ddde89b4e02d3c0cab4e23b107aa","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.115","@balena/jellyfish-logger":"^2.1.55","@balena/jellyfish-environment":"^4.1.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.44","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.205-renovate-non-major-1f64b4c1c252ddde89b4e02d3c0cab4e23b107aa_1620722078938_0.4444076127245993","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.205-renovate-non-major-3a4a9baf84d59b36fbb5ff178b10d77c03091eb4":{"name":"@balena/jellyfish-metrics","version":"1.0.205-renovate-non-major-3a4a9baf84d59b36fbb5ff178b10d77c03091eb4","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.205-renovate-non-major-3a4a9baf84d59b36fbb5ff178b10d77c03091eb4","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"30399ef52424b41da8565759f57b3c00b81ea372","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.205-renovate-non-major-3a4a9baf84d59b36fbb5ff178b10d77c03091eb4.tgz","fileCount":15,"integrity":"sha512-yanFSNlXjlT/2lSZPdIheO0UjCVkHhBFITeT/1LXhbkGTwleKL5ytoKCczE3z2IPYRoFT1ojP6ySxCAhcKeYIQ==","signatures":[{"sig":"MEYCIQDlWNNU5vFhFktiIBFl7WFFeaY4EFXhGtDwl+s/EXlmzwIhAJl0x32xR9tilukzzyV2dI8yEknjFlesxU0AngWRnivb","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":97527,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmlN5CRA9TVsSAnZWagAAs2MP/1gdOOupAp2xld4XqNa7\nTBxgKF+EMGL/urfzIYOTY7nsZjMfSK1+V9c8qkKMOF+T9oCLVucmFehuFMF/\n6yFkIPA6dMs5D9Ybpkz798Uz0RtL+o7fmgQU9t0wwmzZHXGbawGxybpIC32M\ns+IbULgW8jVNPg8KxBSJSzkl7eWqn/frBZbKX1ffowZnEMeqxIBHT4BlTW14\nRKpglRmJpQnv9DUVUBxmLnObX0+QX4xhv6SYpINybOGRsW9Ch9yCLp40Jmt4\nkc5igfKhVpmy+bJWMX1JEAlz7henhvdFxg6ZHeG0KLtwOA6vaZzHlwVYlRvf\n3LNX4OX+d3brPBngavMX3asgXV2YqF7hUgJjH39ZiYW1dNmCb9gb/BMP5cYX\n89mj7Y+9fpmRgc4TQJXFh6ccwVoai8/5GvDcZGDMFZYn1xYbFwiksxyL4vRq\nYrpgv/HpDmGnSGDu6f1dBRajHpQWFxJpDlLCcGSMKJ5KprB+0UVNBhQL+DW+\nxPixernmppBNy7RoTWzpGweQSG+xT8bhBdNlMZ835o1HsHMgO9tH8Bt6D8YS\ns+ZOdA1SQK4VwBKv8LXHhvqfXofrgdLeGbVn7vEangBUcfAhMnJdpcJRyoDg\npBrX35Vy3bprA3UgXjCgTfHZ24X8ActwzeeCnqure1bdFMpfmiqpyOjYXBZ7\nCafk\r\n=ZRGd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3a4a9baf84d59b36fbb5ff178b10d77c03091eb4","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.116","@balena/jellyfish-logger":"^2.1.56","@balena/jellyfish-environment":"^4.1.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.44","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.205-renovate-non-major-3a4a9baf84d59b36fbb5ff178b10d77c03091eb4_1620726649451_0.62031492866227","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.205":{"name":"@balena/jellyfish-metrics","version":"1.0.205","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.205","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1fc1862231575a4145176e20123bf4ac492fc398","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.205.tgz","fileCount":15,"integrity":"sha512-1IIiGLY1bfbDRQiDbyBceYhE0V9G2/aMdQFQ887Qw3S5b0uYZx5JVEG7fJpLyDw4MneOaCddacH/6LNpG54Ajg==","signatures":[{"sig":"MEQCIByWTTUa7DKiW5c74fr77r94JdaZMO9CpUMvykivdehwAiA7rF3rtytVxRvdUi+KfInSgzllQAUE79jj8qqPjWZmyQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":97467,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmyDjCRA9TVsSAnZWagAAQNsP/26Lhk8nj8wt5KiiE4NQ\ntjHWr5rginZdXBZ+HW0aPPOeZX70RrTR7rF10ZzRbbfkp7Va848DQZhxpBZX\n7f4f4Te8DZF7ycU9He4uEBtYWMajWK34Glak1Fese73yF4HKKaQoB9QtB225\nOK/cq4k/SIZYcPUz31jBN9+suN7DksCY5gs5FvveWC2wexD7aQOqlGmFHD/3\n2x7alK+jIw7FrsQler6XEQLA+jAgOSo2LXg4AlShvOsrkXuc6wC/b+VcHw34\nUMn3aJzTw0g0WKyqpV9sqNzldI4BoAluXt9qBrIymSbXszFBCIXYjuXoQprk\nkix0Wx1WhU7x3LQc7W55pkROhPxLT+p3X6vn53ZdjaHqUaioy8Bj8P4CyyKn\nFuc2L5C6EAQEzN+weOFjui19+FR2uiKtDdOZzKfrzhKVu2tT3KwsKtA5+klV\nSZUtknj94XtUFGMdtUeDGYsWTXq8VWIkwT7xSE31v9nReUG+e/ikP74RYG1j\nvMZ95nXxuRKZfNbpgHR+vX2fh3Dr6Ybt1zpVywQxlFrNKMcwiKD5BOBjdWLO\nWYnRu/F/sdmfc9XOkWSPK4VdE7sEFYk4aCRF3Sgm3/YS7A/d4oC4RkgjObS9\nPq0Cl6iRTwESKFNYqrYo3in103lc7Ti+syAmAw1rFZfcvrUuUn2ZleFgpRnm\n22k8\r\n=L02e\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"bdea178d869b033f9e6e61b6e1c9f8ce762e0580","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.116","@balena/jellyfish-logger":"^2.1.56","@balena/jellyfish-environment":"^4.1.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.44","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.205_1620779234440_0.5644402130225445","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.206-renovate-non-major-eea7268770c35daa7d7b9eda7f9509ca0b710483":{"name":"@balena/jellyfish-metrics","version":"1.0.206-renovate-non-major-eea7268770c35daa7d7b9eda7f9509ca0b710483","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.206-renovate-non-major-eea7268770c35daa7d7b9eda7f9509ca0b710483","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a5c74b925af837bd430ffc6054ce4ae9baccb797","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.206-renovate-non-major-eea7268770c35daa7d7b9eda7f9509ca0b710483.tgz","fileCount":15,"integrity":"sha512-jdWIkVLIY4hYtRG/y7TdmWOrG4VIce6nBiFpyxF4zjRqdJb1Jerc/QkMOcjZWq+BrYuLLS/hrt8f3X1NxDSKKA==","signatures":[{"sig":"MEUCIGEtEg7312I6NCphRUoHaKVYqXme+HC4+4EoCItFzqhiAiEAo6oL5v9wOT7J4spq0SBj1asv3OHjozdW2Gzk9uw4lOY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":97631,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgm4wQCRA9TVsSAnZWagAAqdQP/RpowDjyrx1cqTGXcDSL\nDb91iOl7bnT1HIGUhkKQhiz4IAfCALpaU1APhK0K5rnzfeiWHHrWy7hQ9JGT\nTKe8BCN/nTJh6dsCLJrI/MmalRlru+yWr5N/3Z+qyy2wviRHXoqNz9UvJzOa\nzou5jRBnhZfr4/j9+g7LDHHqHC9XOvDgcnC30drnG0FIfXNp1mRh4DP5g/uk\nwZidR/QARCOHPoNGeWsoFS7b5l3l9TEf2Eg5dHYk79M7ZI7cshMjqbd1lLf8\nfZcULzNT9hl9sKCVjmursMFrMvWsgOPO5/mjtCqRDDQvXnkNxkErCWipI996\nQNgRxPHBjZXgjHPnikJUvEUznj1/WgH3018oNCyW032mWSMi1vqrzmKJTByd\nfondvkoS2d0xIayOdN2/NbpeJIi9Ris2YBxDKBY79kF5B9KckWiDZjdhynt9\nFmGiwfFixOYX4pt3Iu5a4VTVlgRxz7Pfi+NMD6rezQvT2bnblfaFDfQ37pJs\nFYWlGttKUcJstqiGm4VOgu1J/YaFpKxP5ze+oCcuevvMcS8lJbgNQytdVO8H\nxFOlARRxUe4VPGqy1c0bhR7eIy4ASe+UTlHIrIyF6XWbmTIFttQdFXiZBR2f\nT63Fcg0+ULLfaAvO8HTgf7AF8lROk7hyYsrzO+B5ZoiuVFnGZJ5qqx2vVmpb\n464m\r\n=P+53\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"eea7268770c35daa7d7b9eda7f9509ca0b710483","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.116","@balena/jellyfish-logger":"^2.1.57","@balena/jellyfish-environment":"^4.1.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.44","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.206-renovate-non-major-eea7268770c35daa7d7b9eda7f9509ca0b710483_1620806671859_0.7468083780187353","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.206":{"name":"@balena/jellyfish-metrics","version":"1.0.206","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.206","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6de9c90a42ec2df97038564b93cc43d6b74518be","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.206.tgz","fileCount":15,"integrity":"sha512-GReQiLH27JPA3BQpTga4LwDLqajD5OwO3pUeC3n5xQJTNFre9thHQkMpfEZ7jOyBp3tGjhG7W0/psV3I6+Kwvw==","signatures":[{"sig":"MEUCIAdjUsRkfcQ59DcDPHarc1HifPGhNSw+FWlCNvwr7yLIAiEAqe4kKhKJkykaoO3i9V+sgft15XUP8/Mn3ATbOIVRaYs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":97571,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgm41cCRA9TVsSAnZWagAAgYAQAJ3GP641x8b6hlvtq3Ms\nrTEGiIJvwrzGQxJCk6S8be87eehEEYE0kCgnroqq473vQKVUx1snLsqiN5PI\nhQHqToRphKfsWZpQArWbz9NnJYNaLoOmWGlmN0kY6grFnIJNRhaQdX9YfW2r\n8hFYQoFEBIdOrDgCFZTU7NSMxmvXxl3ChsfMTAKiChMooRwjSbkKZ/rAXJwp\nRUntCCdQZ290PpA8SgYvD5OGrMY15zG0iR0fSDa5C15bnC7znJruWYU21kYc\nAHhhdxAZ/KOLF+Mp6p8GKlMsKOMWF0HfNPir+lDBwPC7EWnTX8w/MR/hfgWo\no+4JQQEdb8wV+UcCBEy3ZQOkx2r6zNGZtK56fmCYWt+jwqPsfAQ17TH86PCG\nx/ge3OWHFOSZ13p+RANGuAwKwBPHtqcUc3ZKJzk8wlO6noQLWzSoNEKZJjyK\n/iHjRd+1T/M2baVl/mG9ByKFuQqXelLpQm3/g87nTRHihDyzCptnzyLf+V43\n0WbX6Ni0sUwUUBLbbb5W0UBRNm9JwfJbyKb3ei2oc3vgIxY8y3vRtAt+QlPE\nHd15Y9kYIgse7iJE6LbIKwgGcqSgPWA0D4HxSdsuJ++f3Ta5yv1F8yJySk3M\nWz1Ls/AMenbPk7QU7YhK/Wuv5r5lEiCh8a6BOnMwQxElqU5nytRIi5hrY5NG\n1TfF\r\n=UzfV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e76aee900f986ef6328286847d703f4ca70940e1","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.116","@balena/jellyfish-logger":"^2.1.57","@balena/jellyfish-environment":"^4.1.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.44","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.206_1620807003368_0.6977696912908058","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.207-renovate-non-major-cd28676d3f6fc7eabcf15724525cddaca418f4ea":{"name":"@balena/jellyfish-metrics","version":"1.0.207-renovate-non-major-cd28676d3f6fc7eabcf15724525cddaca418f4ea","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.207-renovate-non-major-cd28676d3f6fc7eabcf15724525cddaca418f4ea","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4925d6228d0ef394ca689d4b99c467747e9e6fb9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.207-renovate-non-major-cd28676d3f6fc7eabcf15724525cddaca418f4ea.tgz","fileCount":15,"integrity":"sha512-hltfL0FkAmP50hc6uQtZjvv6B6DDq6A0FaHXAg3scnkC4/b4k/eOL9h/ebfGv4wb8AjOyY9oCgZTFCrVFD+gJA==","signatures":[{"sig":"MEQCIAVGk6m+giKln/CrJ84yJ3NKKOWSNsBL5uB5BMSAEA4kAiBykqVdgvilly9LpljD6rcRsSYCJWiebnlItrNJjoespA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":97735,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgm6QFCRA9TVsSAnZWagAAJ84QAJDTBPRa2M9OYAR8ZiRE\ny5+FAvjgGZ/mtWzHladxMhOcJgcvVxz6elR+OSHUeOjicnaOqd7QtIZxCuIi\nuMpfmlMFqIL/llQe+PlF4vrbzrM6+ZMivtxxfDuQdWi+Ulh92Nbtrv7zYC/v\nuvU0kwq2j7ep7QJJETRY6emtCV9KAI7zRBzvEBqqWm37VuehuNAkWfO9xVL1\nHK2kqbRBp/VwH3tDizCEY21ziee81y2ItUNLicohYMvb/ClSjrTIGCwDJbfk\nIgn7lc1mjxzBNvLmnb4GTb6gahmjNFwTOxf8ss43bo1ZWvKYHGlK/+hYUlCc\nZFyJGnk6mO/2f48SB+FyGZBUG+YrGraIR/AWToQpOxcb8zzgwWTjJk5RocU8\nPCNb9TuPfcGiBSBrWZD8j5g5sm4cPqA7aX/3cXL5gOsVuOs9lgrAvrGiB/7F\nCkM0wDHavG2BzO8RpwV9k10O6qQ+xv97wFEZzzuvlJBX8htSJ7KrnJb3h78D\nhN7/T0t6IdhBVDXpQxBfdRYavk7uU328GVjAqo7lfLrQMBHjnGrFjuTrQJ8p\nbJgMv7mRkmUCr97K4XCIOeiw5ljNaVvHB6DNwg6f/+qHFbQdRgw9h0wwESZ3\n2P1c+lxYutTTADjFuXC+OhdlpcWbM8c9oHcHbsMgZyObXstpByvKC7SFTjVf\n6XEj\r\n=c5v/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"cd28676d3f6fc7eabcf15724525cddaca418f4ea","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.116","@balena/jellyfish-logger":"^2.1.58","@balena/jellyfish-environment":"^4.1.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.44","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.207-renovate-non-major-cd28676d3f6fc7eabcf15724525cddaca418f4ea_1620812805491_0.794279754990223","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.207":{"name":"@balena/jellyfish-metrics","version":"1.0.207","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.207","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bee0b296a6f07954b944cc7fccf378b9c72dc510","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.207.tgz","fileCount":15,"integrity":"sha512-ur8p2IjoFgb7Ey4ZSkRvH1VXgxYPT70LLI+1ULFseBFyP8YA7uXRDE5GMnKNyASfjKh3TRLAlwH2TzMkg4HhxA==","signatures":[{"sig":"MEUCIGjt2ShCPuiv1zCZKxStMmPfwJG6Q5pIYUaoUnmmc/dHAiEAteR3gYPRv2Y7Ll6k/vXKcdlnEOPzvY6mhwPJgncchRI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":97675,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgm6TuCRA9TVsSAnZWagAABhsP/0q82hIPrvLNEYZJLwvu\njfAPuZ4RbE1QUnfNSd3Da4WBV37KFexoYzfG9hQJup8QGDR0rYQ8qmXplsg+\n5yU8JspB/OQlDDOxAl/5JYEKB7lz2au0CqFh6N5fBVF8dOQxpbyBp43ll0/I\nBpASHGdH0q2TpKExse21JAKcSXXAZuk8cxMh9zq8XNb+vR/zpb2Clb3aY4by\nKxIgHb/ffuwuz9Sk9MAcB5rrwMNC04hyuzSp0sziZI95ASXvVf2UK47tHJ//\nqp/w4WFSXtsjY9F8u34mkH+2ZLOGdOB46qXeThyqBCQDcXCuMNF8vpwTevod\ntsUQqV9iwFwf32PeOOSlD2T2Gc2HM+bGOtqvWD4tlBtRxv7jihA9llm9q8hU\n0Q5gGYV0vdEYxTg5qhRsSiEqC57D4g8ntI1Nhu39LK4Ub5ILwILTxKCz/+EO\nVZO2PCcfn9898QMqB0NqucBMEqWVC0B5oRYD3eOEqbzpCBvCy95Cg+IWo2FH\n4K0O5tj0R9oqdIhkvjEdErY6XUNmfNLfpiW9MGe5XZKpIlJ+H8r1eksldPxh\ndKV9XcXfdzkNWi2obUERyDroBA/F/OswzlxX5kM2MpR85GoO/s1Pry2hyYHP\nuUILoa8IaJavwkfm+a0bbJ4IIIhCzfVWjsvFmiiYX/l07p2GrwUjrso4bcSG\nKeFd\r\n=IsDj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"99f13b4e1b80b2767f3676d98dd3589d09df6a72","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.116","@balena/jellyfish-logger":"^2.1.58","@balena/jellyfish-environment":"^4.1.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.44","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.207_1620813038472_0.8239428922576815","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.208-renovate-non-major-4245fbbf98a8bd37dafe905e5f022f9bf4ccee89":{"name":"@balena/jellyfish-metrics","version":"1.0.208-renovate-non-major-4245fbbf98a8bd37dafe905e5f022f9bf4ccee89","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.208-renovate-non-major-4245fbbf98a8bd37dafe905e5f022f9bf4ccee89","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0baf65a74c02e2bddbd7a8bba11b04830d8a3e08","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.208-renovate-non-major-4245fbbf98a8bd37dafe905e5f022f9bf4ccee89.tgz","fileCount":15,"integrity":"sha512-BbJLv57j7Z81ns/i7vtuxQUm4pGltFBt8OIxqq7hjPeXAez04xztj7oMDHVKcaoUcb6ujqIb91WslEGDsRCNbQ==","signatures":[{"sig":"MEYCIQCh8ALI4WKVsCeG1AWdZdzhVpx7b0GG6zUEREfWeYG7QgIhAKBOSa7Mgz8Tr1Nmy8wJEcEkYSIWBoT0es28YqURmYJw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":97828,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnDzCCRA9TVsSAnZWagAAfucP/3SVPG3UghKlIc91Nxuw\ncF1Id2wo7sENWlk1EWKdQ+F8ZY3xnOZepvxsMlO4z2FFny1jX6uosGOBm6au\nzPIBuY9VmjqcENDksXRTOMtFZJw/KhSzMinbRMM8iDrtpmKVKzXP7Pjadvhg\nL0SGDtUWrOjZggJhgjZ2q2he/gw+e+bf1TMd3RS00wEjs+mxF4FEYaAsDQSd\nFx/maHeX1JYpLnydhFl7T5plb0Oc0+MYLTcsB2rGje/HiLT5sy0kuGRsDlQC\nhR1Oh32Y6FeKuZyPwfJW8uD/GeNryrWB1wLoZj9whsxwS1EIAVUzUeu+fiB3\np/HOvk18llVrY7GDMnvhz02zdpxB/bZWBhWgeMMr7Un/FTzS00p33Rjou/EI\nM9+1U9V2R2UfmyL0koVHc0FBNkJ+ZkV+rgzqarwRXkR/GyoofosNjHSbZhxY\nzhLsxa4gvZjec9nURwIhYMpU/C4qk+fjYCG+/SqJ8pSCd4DVhAKcghFf6Wp9\nE7hCYOl0qv2GWtkcN8zj98ow+EZUQw5IAldpjTWAvE6LhRihr834tOxJ+37W\nMwcIbYO+ip15wr6p/au4blBR8lQsbkWhi5jgnk5aViiIIrnDgyFVuKkeuOij\n0bZll3ORFiAjweAjY28mlOYD7qR3vmqgUiQjZzaeXxYMEG1OTcV9e2EkBPjV\nJ/t/\r\n=GSHZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4245fbbf98a8bd37dafe905e5f022f9bf4ccee89","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.116","@balena/jellyfish-logger":"^2.1.58","@balena/jellyfish-environment":"^4.1.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.45","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.208-renovate-non-major-4245fbbf98a8bd37dafe905e5f022f9bf4ccee89_1620851905998_0.2912956356095673","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.208":{"name":"@balena/jellyfish-metrics","version":"1.0.208","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.208","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1c845585d482f7895415855255fd0d4c80e96dab","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.208.tgz","fileCount":15,"integrity":"sha512-G8xG/t/JWBzncwh7CXy/MrSWhWVaP4QcV8gmCLf6h33C4dDORTB67j9kFmdmVk9+qN7oIUVv1VK29XD0PXzifA==","signatures":[{"sig":"MEQCIFi5sQwr4KJ173tgYJXFLXaSfzqaAnswG93qMxSdDtNyAiBQO9oEiGmvvI6kMcVMGEKvcSgP+F3scCJERVYUBo2+EQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":97768,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnD2SCRA9TVsSAnZWagAA4pwP/R1r1ID/2ZMYVOnJVlye\nvUbLI8k6mBt8EVfc0gXJB8CNOxS8B60pEUVNRtFQFz3Za9Q4dHoByAdEgvis\nxzsr5EhG87hzh+OAdL3W1EkTKLDn1wrd1agVh/4+SK30jqaDS4KNH52gWv5U\n+LyYLE7yEuLuNdJwyCUwFvoDijQSCqLGBlF5b870TkdHg+hFRgrsZuP6Zfzz\ndPfUv+fQvNkqW/25d6fThe9QDPHA9WcrUpgwH69W5ahVsBpuevEf9eeGnt3b\n5x/apOni4xRi49wpYvZqTzHY4OyYeSjF2+1ZERWy97kAYPTYSLkbgWxyF01B\neV92SU9NRxlCLzuApdI8uac0fCGloonT/+Ikzm7eXDcQWADW8NGpuZxZtn3D\nNLEjrqxbKVXoQZZEtYLW03y4UpoF0aLOmWatuOjBfJ5K5Fa9rCxA7ybylCml\nx9zxjArlP0o4/MiCPUP8hui9ocNHKklT+7mU+l2Ulv2k7fzhMlHzxW/6k5xm\ns2mUHtFYGY4EKy4L3GOtOBlcekEL/Mvn2Q2rd75CU6Wr6O/6w1SMZfi9s04v\npy8hoq0QFIGi1twJBI0BKFjBNt6m7l/gYPYIwH+sz6uWKM05brgq685HJQAk\nn3PswP7746gGrWvwRzjdeKmGjDmXDzlw3uTc2uA9oBYg+N/KpDdHr3jJwZ5+\n190r\r\n=hf3Z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"78c31ca584e2a9526649089db9edc394fa6d6dc4","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.116","@balena/jellyfish-logger":"^2.1.58","@balena/jellyfish-environment":"^4.1.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.45","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.208_1620852114365_0.265267063856476","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.209-renovate-non-major-3431c3dfa5bdbdd2022dc6c88047c52aabe9154f":{"name":"@balena/jellyfish-metrics","version":"1.0.209-renovate-non-major-3431c3dfa5bdbdd2022dc6c88047c52aabe9154f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.209-renovate-non-major-3431c3dfa5bdbdd2022dc6c88047c52aabe9154f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7edca831d766c7f5a99cc9af888a51d1b3f7e59c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.209-renovate-non-major-3431c3dfa5bdbdd2022dc6c88047c52aabe9154f.tgz","fileCount":15,"integrity":"sha512-Y3cV6vhaVflDkZRe0xTu1CkirAxgkTiaKl0k5tZdzcbVLx831WvDkb5rfVTqJW3uPODOeTwhiNoyBpsOBePdmA==","signatures":[{"sig":"MEQCICaOUYshgMNiGXxtkvzH+7j0tFgYADdbigioE5Q41xqUAiANLXxaHSeo5Nrp2L4HB0gkGrCdrldRvgkztgzafC1Htw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":97932,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnSgdCRA9TVsSAnZWagAAujwP/3Kq5bbAt0NzZzg/riIJ\nFuEuLV1wW28liWjrP5i2txygrCYix8foUCTE+lgTywHNM+vPqPJszMLXKq9w\nXVWy2PliK3T93n411QRN/5ReqB42ui5iZj8O9UjwQ/xqo1JgGeOZg4YizO2K\nrErd6VMAsAJJ2eWCS6hDPN3Am7+e1w/qT2EuGBno883hNea28ZtWVD5aZIdI\nARjt72gS6eYyqWnYDxoOqpat4V4eRMj0bWSiKmnwrqGa4KpjbbRMGe+gnmtu\ntKvf05yV36RgaUZ4wdlU4lA6EmKaUV/N0p1iH6QhNqnZRclykE2Ux1gr2/0M\nXZxKAgTOq4QRSMME4C8TkOQRlc2+uoFCp1BqbsaMn8WEEP8lT++ryuOXuAtV\nHAPHQWjzgm49RAEbusI7KYr7n7Uhu4dv+rJP19Qbf3XpRdDWmt5iVPF/St8S\nEkPFLp1BHWowMK8ux20nMkvbd0yjnbG0Kg6UW6TxfDPhwbcv6YuxNN0TT0Wh\nd81qXam2vg9BDbAfULg37Uf2Cfh3Nz92C6fqf7PSaUhpkuWhMCv6X+QWQL5P\nS9MGGB0O8HfdySrMvaCA/+6nv0rRhYZp69wPyRfmBk0xhmRP1dBzmlPfNLQN\n4wX8LFd1coJ0zlF4RakpfHOt5ye40KcusfIPutu1Xj40QQXvorfsCz8ttX57\nsRYn\r\n=6hm9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3431c3dfa5bdbdd2022dc6c88047c52aabe9154f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.116","@balena/jellyfish-logger":"^2.1.59","@balena/jellyfish-environment":"^4.1.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.45","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.209-renovate-non-major-3431c3dfa5bdbdd2022dc6c88047c52aabe9154f_1620912157009_0.05076715012543076","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.209":{"name":"@balena/jellyfish-metrics","version":"1.0.209","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.209","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"29676c9080fd6aa95753f1fc96e6e749c294607f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.209.tgz","fileCount":15,"integrity":"sha512-7ibTK4AuLAOR9L8WfzThz0MLymPLCW5yq5r+B03h/kdtis4rEFkFtAx3YZAhEJfKSazAWTANq0J9m2XMKjlvYw==","signatures":[{"sig":"MEYCIQDFmyQz5KEbRhzV3wpNl0V3H8mN/Plg/XCJfXqjZrgTtAIhAIjxJD+0i1qxItXNgzEdtlrPVzNIXu+y3m/dAZ/QdeJ+","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":97872,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnSjoCRA9TVsSAnZWagAAIkcQAJ5o8w1baUof9xJ5f9UT\nWYqi4MNxa+g3p2R6kF1D612UVBONbt1A9H4t3AFIHM7YrJc7QkXhFpP397VY\nEVEkOP9XY2LaFCnJFa804N+whM4uyt1mfFBulJuxihSxLjNN0/jITXSaZk0T\nVMrKo9wHk/5tOCjlzgNUSBVXACNZufIEEOKXyUFHnbH65auRVr1x88nDvLXA\nHIlDyk9DAQMqXwAxbcSsMv2V94XUDJBphsKcJfyrI/rgj+Fho6utUuiig2sj\nGdSFDO2zDcZDlL7yR/gw7t1TTYkXG9Agh+/sF/O5XwGUX2G6fdETTTjXezfo\nrx080kAVNsJX1x9t61UsYbl4x3qmjiCjK279Ch3CEUGPoXWLKENy7BhAREew\ncI3mm+n1wgcVdV0/xf5HWA5w14/GbcaIjj3fw3dgTckrGxocjN0cCfl4tw6Z\nMcLGNnYFRPQpgdmb7vdvv7G7D4F+bLjKggkTvvfkrwxo1FjtUZfgEGNJqBPb\nGi4eL6JAtGWorGQucQxRbZNe6vMX0NoxmGS4Ut36ciqMVtS9A3QLToFjavZk\n40o8dnUbnwrCgp4zOH6/mVWzdwhNU21imfbjHfEbgLRlQmZBWHYHZfLnsjUA\ny+kIXTKgDCPHGSQjjvG4ms0Rq8BLnxBckeIMwZR2eDa54AiT0hVk6KovX1Ao\nUspF\r\n=A2A9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"dc100f4c5e1dc1b64a3d743b16a094e0be0c450d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.116","@balena/jellyfish-logger":"^2.1.59","@balena/jellyfish-environment":"^4.1.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.45","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.209_1620912359704_0.8588138213850807","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.210-renovate-non-major-29ee865894fd0fb4e71360262196177f1d1af91e":{"name":"@balena/jellyfish-metrics","version":"1.0.210-renovate-non-major-29ee865894fd0fb4e71360262196177f1d1af91e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.210-renovate-non-major-29ee865894fd0fb4e71360262196177f1d1af91e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0c16a82f194e656ac2db116171e2c2c6520af5fd","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.210-renovate-non-major-29ee865894fd0fb4e71360262196177f1d1af91e.tgz","fileCount":15,"integrity":"sha512-lMIRiq/2J2r3hgiwN/45qgpSAlfUlL0Eb2QSzfPYc7XMsVRwttTqy5qUjCu0QtwjV44fgCMyjfGa6LzdtvcK6w==","signatures":[{"sig":"MEYCIQCN5ipgJB7uWX7hGFRYte2oW4xUA7BN4hkG1GeXipFgHwIhAPEMw3XYy92autRJSE4nSc1pFYdhWf/OTmuypwKb9aKp","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":98036,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgovwsCRA9TVsSAnZWagAAzfUP/0/1uhpSiLxBYxKJRGGK\nSrJfQCa72DuXNsy9NhpgvLIF82rRvBxSXNG9p028YWwJW2m4N6yj71cI3Abt\nv4TYxel5iFUEiOg+hjJDgF5imktaNNq/Wmsh7E3mS0XsyTnR1uv5yg69xPLo\nlee2rZxigZ28l3pJHalGdgPlDMeCGIe5mmgbpRxTEUV2dieKY7TkGkqzGi+E\ns3xBdnHEvyqnG7CRyDvYO7icmpRBQ4TZAyAdIGGHMgXuBE4UFbqmKEC+mSXg\nOa56mAlZ5b/zeNsLQSAQ/fOXtKfW5FagNVM5vo0sXZnNxyY1U1Cf6CQ/lyRd\nloMO/LYbmwu7PnUAI52NPMm+9RORuvG5Y0xZUZtXfzYr7COhZhCMai3whko0\npgIzZbiKvOCWW4V4ZomzauxnLJpNRtZ1NCcQBxDglEJeod1nj5e/RIoOiOZc\nYRdTn0tJmbAaMGHcTnn9fkmvTi1MoSZ9DYQz3kZv8PKboLJQJ8JdrGzqPmlb\n1pPWTB07laR2Vr5HO1vNW/Zlk9AQgqbJ5AZO3ZlzjJ1/Aso2hudbZYMxrJvz\nLtEsl/0x72ZhRBUFPD9i+5Ou+6IqzZ2OiraK45Zsh+irngxjJKjN1QgKggIA\nkfQvjITV2DLk7Cbgizs/2gpRfCDHr76AddoppWy6NRUCVNPg+NDR/03wuw0e\nDYQ5\r\n=lVqv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"29ee865894fd0fb4e71360262196177f1d1af91e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.116","@balena/jellyfish-logger":"^2.1.60","@balena/jellyfish-environment":"^4.1.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.45","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.210-renovate-non-major-29ee865894fd0fb4e71360262196177f1d1af91e_1621294124291_0.15019107414898825","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.210":{"name":"@balena/jellyfish-metrics","version":"1.0.210","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.210","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cdfad0f0699eefce4db6c1741a21efcc29cfcb11","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.210.tgz","fileCount":15,"integrity":"sha512-c24rXrxZvbV+OuZkORUg/sbT5tD0DznlBFCsOuS+4jmvV8UfDnfCnA8lGgkIPQvJdZE/qXJ+d4d/dGw3U70tXA==","signatures":[{"sig":"MEQCIAgBu2Hqme/v2AqwLLioahtttNwNiq0Zqq3k58hyef6UAiAx65ZuUhoQMXaIGt2MEtsw9IX7eWn1gDKarYq3mXK3Bg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":97976,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgovztCRA9TVsSAnZWagAAlG4P/Apo90Kkc/TlxLgEz3US\n7ut5uKgYuaeQBLgUzH2RETXFOo2hyfD0P3zDt0zHjYnv+/s/UUdavMV1TdOq\ndhZnw/i3xVt+xVotkvSENeoIarAlY4TtmFY1QhhpcFJAZRIYS62Iv5zGyUUq\n7hWVQ4pEj2QaOAC0Y+7wf81pEOcEGLOhIdmoQmV79U9wEfJ8Qc5PAGPUobIO\ni93n4cRzA0ZyCmq915BuFT55anCoAJxAlakeHY4iPmcyXHrazEwa5PkkaReb\nxHi6fdkE5YBQ1W+9wEFBng3x0aQXnl5gSIZxORJZaMBtipYPvTmpxYBx0Zpv\nf1krTgK/MLQDyiQx1cE9SMnwsJmXyFZJHqBrZZYpPiZDPb6MOF1q43au6Epr\nxQ7olkj+xNEBkvDRLsdvkth0oiMgr10f+faNAL50XMMKPjoeLOER5Yy7ChHw\nHNfiB7TSFGCbqBxeZ8ofWIXuhhvtAAlw3GpRidYNKro6aqs5KdfRl6ea8ZAR\nCgSX5O2kExPShzxZKEuWBrpkelHy7PFHp42Pcucn3RT6G/SMh+F6rqIuS4Oz\nl4xAlNxY6RzKH/yYSeNVSCZldGK3q0pyE91dPj4WMJ9xkzr/FrFpgJwXApwW\nRmUfMjlUmVWYoEVbQkv5ATUhzNtZ3/wkjhdPo7HSsnPd4AWFt6009lV8aq2w\ndsKW\r\n=0psU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6af11bd2705fad6093487f4fd5978362c0810f8d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.116","@balena/jellyfish-logger":"^2.1.60","@balena/jellyfish-environment":"^4.1.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.14.45","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.210_1621294316906_0.21395490139132645","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.211-renovate-non-major-0130cb7ac3d5d884c31d183f355c34aeb534bdda":{"name":"@balena/jellyfish-metrics","version":"1.0.211-renovate-non-major-0130cb7ac3d5d884c31d183f355c34aeb534bdda","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.211-renovate-non-major-0130cb7ac3d5d884c31d183f355c34aeb534bdda","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fe53426e9d2d69c019ef61e4aeadf8e2ad0b7547","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.211-renovate-non-major-0130cb7ac3d5d884c31d183f355c34aeb534bdda.tgz","fileCount":15,"integrity":"sha512-+RyRkECouLXkKp6qSu4JCV/nYMrz1poKaBy6kJgQwaj8kc8rVycQwXzHiZY+x9Nu6ABS44RqWdQ5DvZK5O9bhA==","signatures":[{"sig":"MEUCICrGi9+opo1kvucSHuiMQo334yNEJjD7NpPfWF1jRD+uAiEA4wLbW/RCvPfdVTMlpB2bNMxilRXYzpbGowhth63UqxE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":98127,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgo/iJCRA9TVsSAnZWagAAjSYQAIQF9GakutKG3S83JZQo\n7MEn0EemJQRWqOoOUoZrE46mqedhO+K+kC/JM66mmxK8oEe1xD5D9DLKTCpt\nAiEiBCAH9n85r1F1sFWdg39oi5StUhYswhc/pBb50gT1U9MRJOXBIOzzoiLJ\nlbaDhlh2SPgPHqToEAznknUzDCpFgwq1JJR6doiDXcqcThlRV79fkC+eME5x\n+uWpVtuSvFDu2BqJ+EqUGYMyV176A6PQ8nJNDENCU3KanmlKLN7+N7HjRwt0\nmEIjeytZenNVqtpCtOkcsNkIUqJ/kT+4Kiw2Dp4cip+k2DjrxWgBZs4p5TZD\ne57i8ML/Nw8F1eLZo2GHiixE7ZeajkM65FiPosCjtOukf7F4JddvuOPFbn4+\nyGg7RexQogT+Jsykq+3mb7G5Ehcuc3yehP5FpP2y97Iln1q8cKQFvCnapKLF\nvJkFKlzeQYulXDk8zATylji8bYxMJdT82ySftIxysKpIE31nQfRVzlnQGKdm\nrOe04G5LvdUJI0devaojIXwwLtsTZktoL3MwB0Jq9IOeGcz+kwphhI8JORiv\nXOQksIVMoyPenJFcNRzmgq1mHq0gdj+2Ls6oy0sL5WCKktJWnjHuOz7Itsbi\nesvY2Fos5HCCKZPk4C0/tS0PWkIFuD8DfybtIhIwoMs4CXJDevh3QrjPO3+h\nOdEQ\r\n=/mIF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0130cb7ac3d5d884c31d183f355c34aeb534bdda","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.116","@balena/jellyfish-logger":"^2.1.60","@balena/jellyfish-environment":"^4.1.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.211-renovate-non-major-0130cb7ac3d5d884c31d183f355c34aeb534bdda_1621358728655_0.2405280672670913","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.211":{"name":"@balena/jellyfish-metrics","version":"1.0.211","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.211","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a95a727cf3f3ed1ad6cf0670525ec4606d58e918","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.211.tgz","fileCount":15,"integrity":"sha512-F6gGBZ6We1evhYn/VIj2WzPo5784m/nwwaCP8FWLogU/5+5nFSbpr+DK+mfNJ4NxJKHTtf+urjg6CXwMeELFsw==","signatures":[{"sig":"MEUCIBheox/UArapO69N/K8YFUGVnf8rNUvJ3tV+twy/AKXaAiEA+eBMD76d495IxJMdYUYQljh7lvsKGjP1RtVItveDDqw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":98067,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgo/loCRA9TVsSAnZWagAAgsgQAJOhkeSeFs6iGf+POYd6\nZxOVxZMdFlsIhZ3loYoUFW3hUoKISFo117QKXq9Rmhw9jdrTX74sIn1L2NTW\n4j8JAjDziQInaOP6WY8Br0zhbXlNu79YmzRIsdXOHnPejj8yQA4gjZfs4AUo\nazQbz9VaUpl9Uimq22+GkduQWxvnDzTguMJEx64turVZhBEzSjINxusnnP+m\n5Pf/cvIbVmMb1jORhITLSlEOAgOtEOUxNcuFXlU2jNJu2mzDIip3HUmuOySo\n216iDlCwHI4s8hkh14+u6FInXVe8D2eMjBVdyvcIlTFLx+vCQrFOAylCG5HI\nxAi9u4a244I2KNTBjdb2lYpTm3KBsMxCdE1LMTIKMC9hFlPqHnqCuJgKewEa\nBIGZnMltZaam1FHBYljfjID6h4L0WYMReEy4bSdOialm6MhxW8x7UMJR/qq0\nVRyvmlOd0YMH+WaredN1t+oQyh7JA0Nsa2mxQ2iFBJE+3VcGme43FzNz239A\nUyrqb6J7dzsEHWhQzHxXL40kjqFPyVlWjaAHvMGSvQgl2ygrL5sOtbhHar8R\n1Z7YLZgXGWxhqK5I8r1MR9tz6CB4t6BQ1a3Fv6DJpilK0afaQ+Kg+LuoxwGc\nQ3L28L5nbtOxaMEE9oNsz83l0NGsdLTZNoWjFJ+l3AQSw2qvJkuyD6bHRs2v\nMXJR\r\n=4iv6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d1e6130a23dbef45c1c2a1b5385a0678f4576fc0","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.116","@balena/jellyfish-logger":"^2.1.60","@balena/jellyfish-environment":"^4.1.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.211_1621358952081_0.008383939837308896","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.212-renovate-internal-non-major-90f4f13ccea801f17ab8b6c82f15f2db15d8fdc8":{"name":"@balena/jellyfish-metrics","version":"1.0.212-renovate-internal-non-major-90f4f13ccea801f17ab8b6c82f15f2db15d8fdc8","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.212-renovate-internal-non-major-90f4f13ccea801f17ab8b6c82f15f2db15d8fdc8","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"260e6b6f9fdddb41ba0654aca0ecc9a5e5e74511","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.212-renovate-internal-non-major-90f4f13ccea801f17ab8b6c82f15f2db15d8fdc8.tgz","fileCount":15,"integrity":"sha512-7jQk+HG0XYQ67lLyfRWlly5t2AT6h4fIRseNtqzCtasW+bhxvOGmT3H0ZCGGGgWli6MBdlH5yS7QhfxMPrJMJw==","signatures":[{"sig":"MEUCIEG5GQPe7MZfIke6mFkW9nYYYgrDf4FgBcjcXMZ5FXrsAiEAp8KK0slRiEOOY9ogxzW9izzZfF8smY5/paQFLoxafl0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":98240,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgp0AZCRA9TVsSAnZWagAASvUP/RzLqTYQQSnbrh2fxGiT\nLZIJ/lxAoI1yaLkS3XE8Um/YiRRLxWu7COfKIWaB/7Y44Kv8qZMQiE9sSxgU\nk79lRhDoV0a70kCDXT1fHonR9LKN5XNwwhIM4Xoq4uRLQkuxyMOWJocH+Gm9\nHrABi+eT4bOfM6Rvl5bMU5rXCI6FgzY5oBn6thVI//3ieOFZ6ErJ2gNiWxQc\nKvTbwOoCs8BYo9iIkZZTb8Ro+rd5tgNP/BUHgDJAPlp2jD2jL6kSum2MO4z1\nnEW4hzCOh4FsEC7MjyIkjYtsZWxytEaujFCUBOBvPym6rbyNtlt5lpUAZoi9\nt2sq9AjIBCaZf0ZDITNXdCmrbxd/FkUO/R2v2b4rb2VOolE5yGU+hcdQDBQp\nMV4NO37SUsufhlGlLFTVT8dfANjDCT3t62rFVpXaWGwAPPNel8xFm/eBbqyo\nnK2c73uvx+2JHtTJ6AGPoVsJ6FxNNAIsvQJ5V8uR8b9yFlFgupqIMvOcCPSA\n6NjZgWn+XrOEmUweQ45cmm0qbo0sWrKxuKoAYBgLKMHpAKYMdpcJ5kE2jECU\nAa6Ond7ixYP50+3bCu/vzMWY6zY9oVeikPc1fCGi/AkB0KyWhGiwdNEeeoIn\nlcouCfudqzBa3aDQPIfXLiEjsQNZtNI2ZbKLB5p37m8su4J9OUTHItUeGewd\nJB7z\r\n=vACN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"90f4f13ccea801f17ab8b6c82f15f2db15d8fdc8","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.116","@balena/jellyfish-logger":"^2.1.62","@balena/jellyfish-environment":"^4.1.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.212-renovate-internal-non-major-90f4f13ccea801f17ab8b6c82f15f2db15d8fdc8_1621573656785_0.19376038427111641","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.212":{"name":"@balena/jellyfish-metrics","version":"1.0.212","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.212","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6ea799a4acdcefd835f1647cd97c5f4cb84b7f9f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.212.tgz","fileCount":15,"integrity":"sha512-qiN5SAlkx31eUQ3gIOx4+OAO7aRUEZ7suxjwh+AzTm5uJ3JWbXkp8AL7dPw2fx9yBSa5qwMzJpY32Ui/1KgMlg==","signatures":[{"sig":"MEQCIEIpk6AtpKrEDrp3PmjcCh+kJrfuW/zwiCD1Vm8ZDtuDAiBjNj6nFNmHnWjLk1RmD9i2bdEiRlOkWTfjKlamd8VlvA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":98171,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgp0DqCRA9TVsSAnZWagAAiDMP/1PhYDWxwsG3vDFFa6da\n8JoCbN2USfdWGqXhO51Ok7UmTBmp5oM1pavP5TgUv7ZO5zezQZLyGFtAVdDi\nHa9tdYdsbPpDMEj1M+/A9w+slm8tnyb/M7HdqZR7hfjGUL4e1W/tt6Bbyp2U\nyo3YvPr4GaOsMiOhfZLWRRu+540Lj1n/5eRDKa4/o666J7qvgvP5YPzY1xlr\ntYNJ9QGZW1aoKF9o8MKZSiA+HqdoEcju2Mcjzolcnsr8qBarkyBiDUTUxG3S\nvfp9DQh/AZ4CVk2LJ7SsURNosgeUTL3g9aQjC6wQ8o1ZPLzodLOBlpHdunsp\n/Yb4hlepO0nDpouIGu4695EEBvF3o++K85BrrPXTmKXumM/ZrZinzTJNXn1Y\nNGaf4Mn7hL7xnOJnWi3kIx9eIYi18BvPPX3COGPGZT42jVSSEkGwW+NRu42o\n1mTMEAmYVJdXfEBeROO4q7GyNJopmIaOylDsKyinuIvs2Dt1snBFrfSj7rfd\nmBqisAwqmaIaPw8EuzVnxWB3zGoHGoJt8eoGx3cozFFT2ZrqaC/9O5Ass4Na\ntsMejkNQtQ0wQCYkTrqFESlfNl3z4fW/tmtw7hqgJoCDUcJMgJBkpMupQhYR\nrG63diuxPkpdF+OPujLVCq7Dx21NsQB6WiH6oQ04NGKEi7A0LcYYIz8IWYY0\nR5sX\r\n=kXPf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7bb2708a676e121df4ac202915f9efd1e025eef7","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.116","@balena/jellyfish-logger":"^2.1.62","@balena/jellyfish-environment":"^4.1.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.212_1621573866069_0.931473365494621","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.213-renovate-internal-non-major-8fd9b7285fe805a3c681bd17a709938f2c269832":{"name":"@balena/jellyfish-metrics","version":"1.0.213-renovate-internal-non-major-8fd9b7285fe805a3c681bd17a709938f2c269832","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.213-renovate-internal-non-major-8fd9b7285fe805a3c681bd17a709938f2c269832","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f61688f6d48c9aa6bdea043866d8003f59d03b26","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.213-renovate-internal-non-major-8fd9b7285fe805a3c681bd17a709938f2c269832.tgz","fileCount":15,"integrity":"sha512-C8W+XBGqA1CzKhiJoGyK7wiZORYVVEqs9Lp2geyGTzjv4JAHqJZC0NxvITZtERz79A7rC5tA2Uk9uaImnwgGYQ==","signatures":[{"sig":"MEQCID26N+oFXncKNlRG/FzKvFbNCLB9/6aZ+HmNTysgNZTzAiBJZohyX/Q7tnzNArGWdfG/nlugOuAiZUvLKyBEu98MeA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":98344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgp27MCRA9TVsSAnZWagAAwbsQAJTGGypRz7TqYtQYWOkU\nB2dN/uYL3j80XAqXbykAa+T/jT+/mE+UHQvIXVjROxIiRkQ1yGn5p9C2vn+Z\nctuPcVQtPlLZyWRDKJoSRq+h3VhwKmzs3FnJWua81yrZtTUbpSUey5s7pxeQ\nwCdufShDVhWlMZjMyrKasKsGtcTY++gicVbS34V2LumQ0KcjN8pwFMRpmv/8\n5jBGvHBaVlKORHHqVwdL7eE/V5yQjLbNgwhekxUSS+vjx0I7yaIPjGia+cv7\nPRSlcRY5fKH9PsimXdw+aMCjY0R5+OP8vCxWu8yClXrQPo3xfjW5NTp+qGpw\nTX9346NkcJZJsR2S/e5GFTxz5okOZCW+3HBXS2+K/aOc1C9IgNwWGNNYQ4PF\n450Y2iNOJMZQF7AM6bEBSiQjMcxg0a9s/LDlNeRc8FxhcJZAzWAlS3A1r21g\nEYZ40As4vU68TH+WzoIUPzKEe4Lrs5B2cPv0LavSFD+KRxXA9TehZf3ElsMx\n0JIt4r0/3Jlyj3sl3Yy/+dQWnf0Jptm4QgI5bB8Arm1AuRY47Kbex1PtQT41\nXHdPwck2T7ubn2ywQaUnSicmDfuhP3m7HTzeBIJBzkKv1KcKgIQmtHUdOG2c\nRiUSphTzd9/JwbwCTHZVTXyJCaNi0ciwSnm18vTf4oN5BQclXjVTYYZOTfWV\nz3N8\r\n=gP3N\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8fd9b7285fe805a3c681bd17a709938f2c269832","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.116","@balena/jellyfish-logger":"^2.1.64","@balena/jellyfish-environment":"^4.1.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.213-renovate-internal-non-major-8fd9b7285fe805a3c681bd17a709938f2c269832_1621585612279_0.6028804162306733","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.213":{"name":"@balena/jellyfish-metrics","version":"1.0.213","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.213","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"af50aba15a3e2b56dc90d3968d3d49914af751f4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.213.tgz","fileCount":15,"integrity":"sha512-p5KwzSQbxbl33ffWjIZAH8jc5fvi+wQpAWwlXGlxa+Hn4W/utrZ0IuaBGNOUPDq8Igb81Jj7ryxlMOTbOWWlbQ==","signatures":[{"sig":"MEYCIQC+DQiBlyVSBQrwILnyeqC4vIM3sFVpVuFXPm83uVPekwIhAPZ34SpenyErl6yrMH+Fq/97gPNwYRhOl7D/EaASIHmk","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":98275,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgp2+MCRA9TVsSAnZWagAAVTYP/1kSDbaRMg0di0rVZ1+l\nSv/pugeCqtItQs+WrDVYi4P2s/dzcMc0FCKkl8xo7mSN69VpMnFbjsddWaWw\nuVslfYmu6BBfdaKkwyDJ4iao1xX/n/tBCf7qOr1BRjN6UKsr/+8XD1iVfdC4\n0rANodjdWdv8wQ59p3w3Puo6kfBsCequ3dJqriQj5RhnciYU/nYmdUnkN/Tn\nTZmFRGPA0OxbuixSrI8jnWWiqOe3M4XfE8T+kqhfdkGtwFfjUgfSUJdPOgyb\nORLLvRGk0Geg+hHsNfAA5wt7BADsDlLNZ4ynpyvBJAmKirgchV6PDYUFieYM\nFVIY+Oxlw1qA9PMYVzWNqn5e1ya7ghj8enPf7QmKbVvarGudL1nWHvIkJJVm\nB6IXZSflq+DCqSKm7WeDCSd5yuquFHh7ZkrTDyFm7VwS9Gp5dh0K62HPs1hw\ntGBaAEjm1jpBMLIRoLJ+CHMwk9TaQP+XZ3HW9e8L06UEvIibiCpmbV+tNd7Y\nFGDIwuFwvJ7R0pC3N7M/4ESAdD3D2rBa7gMVZ7LXvwV5urBLDiToqotBvfYT\nadQW/Btl5tlYFdfbFtT+wxpL/TE05mG8FYnVSInVCyV+NaBQXSeDujKGszxa\npd/77+kEYyPQhdp3YcpIvdua35VQdR3ZuyYv1Oq8qsuRv0WR+EkRQvNkKme7\nU+Sa\r\n=7Hks\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6f4f782a2637ed34d842ed87a9483603c759e74a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.116","@balena/jellyfish-logger":"^2.1.64","@balena/jellyfish-environment":"^4.1.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.213_1621585804255_0.11752642374423905","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.214-renovate-internal-non-major-7a69905cec911cde7c5dc0bc77ef1b7450496b57":{"name":"@balena/jellyfish-metrics","version":"1.0.214-renovate-internal-non-major-7a69905cec911cde7c5dc0bc77ef1b7450496b57","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.214-renovate-internal-non-major-7a69905cec911cde7c5dc0bc77ef1b7450496b57","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"76c39a881bcabd8e5d5005ea96dbb24dd2382ab6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.214-renovate-internal-non-major-7a69905cec911cde7c5dc0bc77ef1b7450496b57.tgz","fileCount":15,"integrity":"sha512-Ush+KFC85p9Z8GO1nIZHLvp/j29cimVLI2zS4S4E9T7ZhQRIjfv8uGD1VnHzt6gOyo/tbMHAKiE8Xvn+6ty7pA==","signatures":[{"sig":"MEUCIQDPTaf8u+rHw/mADyp2y0b11zLHUXod0e3naVPbYsxohQIgQx02oGfnR8UtblCkdeSmEF1iGnfpaG9M56jMBiL9/0U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":98448,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgp5EuCRA9TVsSAnZWagAAZ44P+QHXSZxfhxtyO1RvxhWT\nRaioQaXKTs8SPdZsswQnKzORUpn8bSgE1kKpYAHvdf4seYxBE1Eh0ysNtEzL\nFcpYnroQqtbTnKhLBKOXU2YTzPqZCObiFpeNttzuoTWKFuwxhd4/+OYpUx7X\ncfA61nXhUXlRZQcNub/Cdt6c7fWVWckARXx1uy8d54vH3TNe3ZsVb8baDroA\nkS3IGlKhZFnYpa9qJPLnG+X+tBYZHL/SCDLHKty9EPVr9ePDA7D7Iv+Shuvf\nTnL2HglG77YZuQ33RChq/KFRXsXVmxmiP702zsvjgKFM2uewGJGpBt+JqJYY\nQAn+y9YEAOz9McG2Gkm9Z2qqDYQRTs0r882aVr+mErhhJzfhcjaUnu8ZfSxT\nyXIZ1LiBq2xNC+spuKCxM20F87K7rj+05PhqBdZnuIgaAcjXvNY9tGgbfFF+\nLJgZkA5vNkXIW8X75WtrD3IASQl1Sz2x59g6cs7IE+R8XresNOIlBOIrdm4y\ngN+4G//8fxXXLg1a+r7yK7iA21thYxwbbML3jm58kakH7C1bDhgS0Q239JBB\njb4z2ELJ8ZjwmYF+5pDui+3fXRXDBal8SwBW8J6rIwDZiClOjwv8sTs0sQpL\nC/6El88s2ZBF2B/74G2wuE7qv7ERoSK2uS6HE8wvsipn5rB9DjIYOTrnT7hc\nJbSj\r\n=5IAO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7a69905cec911cde7c5dc0bc77ef1b7450496b57","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.116","@balena/jellyfish-logger":"^2.1.65","@balena/jellyfish-environment":"^4.1.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.214-renovate-internal-non-major-7a69905cec911cde7c5dc0bc77ef1b7450496b57_1621594413003_0.31856332865105164","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.214":{"name":"@balena/jellyfish-metrics","version":"1.0.214","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.214","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e928f89d0096d3d9145e3a7951bb55623f6d06a2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.214.tgz","fileCount":15,"integrity":"sha512-nVfQR7rc71xwm0tWVgj49uTg4pHI/oB26LVWGhAUzEdfIjkrVSevxVlaymLGQN21kbW8Jwmnp6sugYGcBf6Shg==","signatures":[{"sig":"MEYCIQCFamklOiwS4IIWXvNjtO3C9sGRTHjYRTWKnuXcq0KBpAIhAMZ1xplaHmYW97eQRzkY/5x/b/TadQSirP7gDK2epXdT","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":98379,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgp5IYCRA9TVsSAnZWagAAPqQQAIlVfnTqZazGNBKBfuv1\nGFtPZ7h8GCgFNgooubrMpBh7cCXyX9GGbKi6jmv5QAwAvk3eyj6uIGovad3s\nUvks1MupPedqMOXKQfh9xUvEf1CnZTBbB2P4ybiNPMY5etaLUrlA4sDirymu\nlCGQ1xJHPmHabb1dHvnIdh5zPOd/oXSSY80tKPUfH258NSsw95+fPIJoIZZN\ng6zVCyWsjQer4Xt5HVs97TMqWkqcbc/izAJvNK+Z4u+ORB/cPmmc2Z8qiJ49\nNJc6hQB4ZbjdWeHm5CPHrkZztpN62LpSuRNZ1WETBcDw9jQdISqNEcFqmdCA\nmjEfRxrthkuX/3ZRlwN144GmZVlrjKP3gX6UsG1qZqBRxjNryJVYpwEOCf1q\nThubBl3Jfzp6CAcGkkSbbbLsgRT6sm9sokObMXdqiPVG39dWrQD9QPG0Fjq9\nPjfVqwImpLIy+1C9BBY0F4wkx67OsY4zZjQEcBBPcntrArYCigt4etN5kWdr\n3P+l78Tw6i2/zewlqkz2wHTHVsAVfdFB2o5cTLD4n1vEUxwOD+DJZHW1TbMb\nag/zD/X6sk/AyHUnIuExsVSZehJ+VKqJsDbHrYKVbq/mgF+jGfuEpYBbPM3a\nMZLrUWdrqYGAQtCE8CGMzETiucVKAS8mSbetNKOUZw8F9hEL2k0Xt5oYcvNa\nBho/\r\n=AAu+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"29f9b87b8c8ed045f4a8ad34fb24d8af0e5340eb","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.116","@balena/jellyfish-logger":"^2.1.65","@balena/jellyfish-environment":"^4.1.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.214_1621594648491_0.34253049216320486","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.215-renovate-internal-non-major-ede22ddb980cb46b7d1bdbd7bd377c198fcd4ef1":{"name":"@balena/jellyfish-metrics","version":"1.0.215-renovate-internal-non-major-ede22ddb980cb46b7d1bdbd7bd377c198fcd4ef1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.215-renovate-internal-non-major-ede22ddb980cb46b7d1bdbd7bd377c198fcd4ef1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5791c19e8e5210b6f6c516892bdeb328f3de4f1f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.215-renovate-internal-non-major-ede22ddb980cb46b7d1bdbd7bd377c198fcd4ef1.tgz","fileCount":15,"integrity":"sha512-Qa59PGiDcCZJNtk0tU/XnPe7qDRmSn7kmYxV5NtLQw2wbTvmSTs2KP6HcXPH2r2L8r9/sDGdsn3f3P9Til2V9w==","signatures":[{"sig":"MEQCIH3LffNYg/qhjy1+BcHxi82H9YX62Kee2dp2GKABRbs7AiAWILZ0XYjlZLe1lIF2fg1dRzQ8pUbLZWoJBC44BlSLFw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":98552,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgp6ASCRA9TVsSAnZWagAAwO4P/in2eOGTTBBGZn9NSoXI\n5U4uZhfwEoZDGgSRmUULirXzD2RWS2w6WKw/Gs4blhiW9eAuhWt1dwpqH3+A\nWlEA9ot9ik5YuDlAp/OLEEaEldnPDo3N0lt9qulNjqCYPYEXxTpAQ8QWuszV\nrBjEbqUKf8EkhfzqSdTUxgzmizHtYrf2U6iRnI2nUV7lJoXOPjVJD1s3cutb\nTwWSqwTszQfhgujCC+1AkGspC98GRMjasY+Py3U3YN0RAceMZI46BtOBbHMx\nORoVqXy2fGzFFv+Dh9Bi2+vp92YK+SpTbOnjcv/pRA5FNI3CxqMwbBJU/0+b\ngCxMHiCSoY8A//HGSAtytfuYPwZNJlNhQgzZVAWLZFYrVJ6KfiqOmAxfF/nV\n9bPvXdseQC01dAq8jbhX1gbE5nI05vVB8pT5f9emse3fgMu1UR8C+CLNJjoX\nII3wD0WZYoG35PhIXfarKuRrRnJFMq5dqXE4yOovm0rBOJLcZ/yTn6y2HQVJ\nlU+R8YkEQhTqePozNx7rsBdvc7F5ue66mChOlvsV3nWkR7yK8gXm7xDF3wGg\nGBAHEw6PNUND2JMdUOTv/JIopTl8vTTRf8pTIHmO8WWCZEsZO2GhVJKOA31M\n1hj40uhB8hOKAIdGWHXwKs92YsXvYN2InVyrn/MaDPR5kWsjMQ/zBxfmBcUc\n4krx\r\n=l348\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ede22ddb980cb46b7d1bdbd7bd377c198fcd4ef1","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.116","@balena/jellyfish-logger":"^2.1.66","@balena/jellyfish-environment":"^4.1.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.215-renovate-internal-non-major-ede22ddb980cb46b7d1bdbd7bd377c198fcd4ef1_1621598225878_0.24994689445955798","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.215":{"name":"@balena/jellyfish-metrics","version":"1.0.215","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.215","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cd4bfd6f4b3326cefacb0fa010c29cc0f612a9ee","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.215.tgz","fileCount":15,"integrity":"sha512-BFYg+spBa7rMaod1vjXFQVpQwfJxLga8QWqyRGPG580LfjygXUd8L0olwFms8s3m1dfMXzlFVGsq8W/lVUhu/A==","signatures":[{"sig":"MEYCIQDzj8iDc5epnO/4IyroR/zKsxclm90cDp1zTtU+tojRZgIhAJUiUgx7P94SMBKiT1WUK+NLeUuAwv0VfzQYZovtq9Bs","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":98483,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgp6DzCRA9TVsSAnZWagAAc1IP/jfDvrmA/3bV2S6s5KdE\n5QpZ6BAjvansA4tC0uHmq9ZZc2QwHg7O+CbTRsTJ7+VfHUnTrlJ4uMsdGs34\nhPtqhnisHGpBznGW+Ulp0BemUaAdIzydYrTjhqrHVJrxbdx+iVUC6ABOvwhi\nIdr6mIplfNYUAYShALR5hpNA7ENcEuVhbk1ZKPJ6yUFqMXMyrRcH536iK43R\npmzifZXxNtcFVpUZKRJLPkpa2jxHFKWxZ+jqocH43Lq6Pl+ID4pn5ykYHeKS\nutY3xRgjLlTKauxrLo676f0oQcp1LS5r0F0T4S4DJvEg1Xlq0kQ/pZ8O3+iQ\nIeE/1Is0AjMU69PxQqaC3BbN5AtVQ+NzgWFibPy+n0dvH3G8lk6/01uPGR8p\nMVnen2KW/JNlIjFGmhkxtiruWIUsU3kvI3iedEhJywAEM8U5iVFxwfOYM06a\ngE3YTT3rB1uzVqc4FgP5hr421DBohcgaRXZ6ZMgJNqR67ryFczxG1m7EyQP5\natuShIV0T2EC1WtgW364V+N+3dorQKd8vkvNNpIALJRLupdB8Q9QP9Q6TM8e\nXaH+9EqXvwkfLG71MvR6r4TyOsIgbUxiYp+8OhVsGmF0U+Xhjlcu71WCCkHy\nFSPkSREIV1+4WtDnaKuWk7+9kKajOvutvhGZSxDm+BJ++6bR8HKdXj0Cclht\nzQtA\r\n=wnnt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"deb1ba56fbe06e6f95b087132ddea8e0419d0a95","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.116","@balena/jellyfish-logger":"^2.1.66","@balena/jellyfish-environment":"^4.1.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.215_1621598450937_0.04155656437683608","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.216-renovate-balena-lint-6-x-a4f241b4b90f14af28c49c678cea8456199cab47":{"name":"@balena/jellyfish-metrics","version":"1.0.216-renovate-balena-lint-6-x-a4f241b4b90f14af28c49c678cea8456199cab47","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.216-renovate-balena-lint-6-x-a4f241b4b90f14af28c49c678cea8456199cab47","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e6b17a170f8b1370d339454dbc3e54b5854cf270","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.216-renovate-balena-lint-6-x-a4f241b4b90f14af28c49c678cea8456199cab47.tgz","fileCount":15,"integrity":"sha512-2dOrA7Pn5+8XqDyPi5tjg436p7GY8ORoPfG6/SyIpXBHRPV52p4sMUVQrw+oXeAGmXOtYlw9Pj/yM9b79oE0+Q==","signatures":[{"sig":"MEUCICJA80LiG/6K+EZO4i6JJGlEwVizU1qWbFWhhIdj4MPqAiEAkoAXgp+g1aFOKoKDw2XAMr9zvemJWybEHXDlwoRA/oE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":98636,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgqAEMCRA9TVsSAnZWagAAmZ0QAJZf3WJDBjRuqO2aVzK/\nd+XQAGfVRdzgNU3GyW654jn3fgbKQcrquuEIxNRTxvxdVSz2s3d8P0nV/egF\nFq4BcpVQ1IPzG1hdZHE5ayTcZign0yXa0GhrDJno1OsvvjrdIMerfqL3evaZ\ndX72Mp7DV1vZML4vZu8EISlXuenrEBB7I9NR+gPoxCYLFPJIiYA+NaCK+Equ\ngqfYjg3gGf5JUkI8obpcCkqp46sfcYbwk1ZSNSZ4iJRW7sTuQtcvFotQlWmP\nkbPE1YYXQgszwfaa0mP7kqgzz9Kb8d+XUv4SQUy+IGB6Px1Yaqz0ARPrFOeC\nmi+6bsHiiQBigfAGQc004xQ5rt+chc+GQLXx1EdP1SqAhI12QGjRwRwioUt2\nM9n1k4iNktAEDH4+vhF+Riv5cX9rtZPwjmJR0Dm5XM61rLpUST4N+l6SU4Wt\ntEx4RD7NE2IT5BeLGus8fJBzelvJwS23NbYFKwJa7MtqXQcEHOF8Pj4Flb2P\nptTXaQcp5ye74eXr9HFd6SWz4NQrbfPvI7tN/yFnnrzUX7ZnI0wNo3GZJpHt\nIG3l9HCggayJhOdsHmK57WPHqIqFrMuvOfTiflLkI0Zo9qdPr1ohM/Tpz7q1\nvP9mbFaqZwnbpOCvCDX310wJfrskfm+zo1+2sOcpgiv1QpFbWTX6F18uPjZ4\nRvfr\r\n=8sSy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a4f241b4b90f14af28c49c678cea8456199cab47","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.116","@balena/jellyfish-logger":"^2.1.66","@balena/jellyfish-environment":"^4.1.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.0.0","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.216-renovate-balena-lint-6-x-a4f241b4b90f14af28c49c678cea8456199cab47_1621623051614_0.4917541393370577","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.216-use-jellyfish-config-b68cb01976066bd7dc8568418fc97976fd58811b":{"name":"@balena/jellyfish-metrics","version":"1.0.216-use-jellyfish-config-b68cb01976066bd7dc8568418fc97976fd58811b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.216-use-jellyfish-config-b68cb01976066bd7dc8568418fc97976fd58811b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f3d403a91ac0eb4c0d4ca32676d9477905a9c96a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.216-use-jellyfish-config-b68cb01976066bd7dc8568418fc97976fd58811b.tgz","fileCount":15,"integrity":"sha512-DY4bIFubhkyQQNK+2kAOfBt4RarRDeUw8iX0sVfhs4ai6eUMy0RKQEchb/3tCbHhiXlXlHlNNMIDCW5H/ah3Pw==","signatures":[{"sig":"MEQCIFaoPnRd3Ij/VEcGmjwbM9fRhvJdRfRRwxF5BMa5fO4UAiBMgdK4qC305tyI4ZTIKtijj3S5bJthGzqhIh1G3jzJRQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":113378,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgqbV5CRA9TVsSAnZWagAAT80P/2lT8BQKdsNJxWk/LQzu\n/YjO+vHLiZBxQwl90Gy2nR1BR2mcxxGkFGsM2UiDbeTEOTtuWjztb9yCmT1T\no9F/nVdAxA3lH9KVEhN0mq/nauCC7xaFs4zS/8QROhDuOO3TyrBE9wasuncG\nuf/N3l6agfVWFMSFaWE1OZ1qh/Qcg6Qpn6F+SB4w6+RubIgfIqRvDsnthftl\noiY8ttsxm6793LclAPUlugRCfFfxRviSStU/5aj7ovpSKYMd33OLwDXYCNMj\nAwNg9F9AQO0zvUQYkXFlaQTyad+iTYrOQIr4s+XLCnxtvoyIqZAx+QYdyCOr\n70GjTYzeIso9JBJPBGG0A9K3A6brzqjsVxMX+xwOjOCnuX6VZEKtIBszGVQ+\nSKiVX0Ts4dxmE4cPdeSXd1qyrODvZlH+Bk4BWjhy2O9xZ7Ah8TfCiHTXKABK\nkpb16Ea08mcf4uQ7TBQ4nuMDtFJCUTZQ72HFDA4XNQfwUWrlHuWQsd7VTZ3W\nM2Wg3eZRksb3APNX0tv8VRlr9e3m13LIvepDgntWATuPPHHzFeeSeHY5snF/\ni9F3Yr0N0rUH/BOcm3yslgBLrzdnhjYgeTLIUa8zNmwSKRVaVyZ96nbHjDCZ\nSoqKW0/qw+h72SfRs6VymcwGyRxPApYn21LkTT0/d94itYYcX0F8SrO3Ppm1\nD4eN\r\n=kA4g\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b68cb01976066bd7dc8568418fc97976fd58811b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.116","@balena/jellyfish-logger":"^2.1.66","@balena/jellyfish-environment":"^4.1.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.0.3"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.216-use-jellyfish-config-b68cb01976066bd7dc8568418fc97976fd58811b_1621734776494_0.1243658731505295","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.216":{"name":"@balena/jellyfish-metrics","version":"1.0.216","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.216","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c683929e7ba0ab725eec8c100dfc0376d8f690e0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.216.tgz","fileCount":15,"integrity":"sha512-wv7fS6iKMpusqM1J1KeOU+/5awoi3IqcVYj8nVdAwEJhGxaZk/bbpFWeIU13qyN7Xuv+En1g43JJiLZrU6I7UA==","signatures":[{"sig":"MEUCIAVMc/K5kvZQkgQzs8p/kDlaOTfnoL4kLClXPjAXtAplAiEAtf3hnIxOh2HQJpRtxSj3NeLv9pQQU8x/fY1xnKnygko=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":113316,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgqbZhCRA9TVsSAnZWagAAOgsP/2K5V/qzoSpGbIcb39UU\nPwiCbjT710eM98KAbN68e37jOFVGljOB5/kW/UWcsu/dp9hALHkW7SVXZAds\n4U6KVxbzmD5QSf0FjksESwrTnT95BoNZVtxqmUIQfaDdTsw1c9NfZlABBZ2a\nkyINFXJBA7rz3CScZSitaH+ehZvyIMLOYs3kg/W8Ox7VH4FfXn/ixSKlohHo\ncmyKuOlW0m654RGPJjW9WsWczLmHgDj8CXZHCoWjTF+ys1WA36L7ymSH/oS6\nVZ+iYzgq0GrUZKV+KsywumV+F7qYphOVCjtKrxUdcQydF2/bNFbsLXxlzeV2\nRUGWzFoDhVIc0oF2I+2Vu6EN2KjyjKciTI0fegOMfJk8CknsuwG0CfREQhuJ\nlHTtkKJT66DQuEkLinhEC6W0cntn2RZbGPEJkWUBtulH30gnvDoOVq9iWSYj\n+agKdQGbXWYCWj/Wf7sNEAQPMx4EyruKkUwvy8xKh7AcI4R6w+quAaMfq3aZ\nxXGjLp/+846lRnk51Ri/xK2/RHytgHRSiecmKKxWT+WkkvtfNxg02Dfc+HjX\nyrVi4hzewYHHtaOUHC/XCwcx4BHfk/RXKBIgiDvQmjTMEPHKtUvvPDGpAGsP\noK63KyckSjVqzsaVgGt+9+zLOzuExXhQIY/360gwqepihB4VQDmgGt0FgzWq\nPh6i\r\n=V+tc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c23d8838cd3e1f1a30c1e600b630285448f5ec40","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.116","@balena/jellyfish-logger":"^2.1.66","@balena/jellyfish-environment":"^4.1.13","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.0.3"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.216_1621735009330_0.06788534495949516","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.217-renovate-internal-non-major-4989e1decf7dada6a3b75120962bd3132d43a1ee":{"name":"@balena/jellyfish-metrics","version":"1.0.217-renovate-internal-non-major-4989e1decf7dada6a3b75120962bd3132d43a1ee","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.217-renovate-internal-non-major-4989e1decf7dada6a3b75120962bd3132d43a1ee","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c532bc4cbe5246c69a8bf4d64d96ff2f750f63d1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.217-renovate-internal-non-major-4989e1decf7dada6a3b75120962bd3132d43a1ee.tgz","fileCount":15,"integrity":"sha512-0mgxzXwUFvdH5alyw7WuA+us6CwU3LTIRfiPl4U16yr+197Hx70wEx14TaIVcATX3HjVDSo8yvRsDQbX3tBovQ==","signatures":[{"sig":"MEYCIQCC0gDgJxjskKuIK49L8Clcrh17NStvriA+5RLSt2GvNgIhAP2x7VVlbEeXpTIVn77CvJHT5SXIJH1qO5DBefn13WO9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":113461,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgqbdLCRA9TVsSAnZWagAA9pgP/ArH9j+bufhWq+OfKznS\nD3PWxdzEkAxbTafOz0u9SfDFuj1/2tznsQB0ingdeg75qBC7GZGal7VilU4I\nljHMYvwtpShLRWYwCzhauaJQ3/p1TlTuW9xykSv8IcXEIypbuygoCrlLdqUj\n1uatjuNOYGD98BNlOqgM8gwI9CDceOjYLkHUBd+U9Ap4OKw8pOhUmyw4LGx7\n/PgmqI3+H0xhmnK7S33RpUtKLjOl6VmL3KEbXdOfboma5QvGsUSbCwVgckhd\nevv5j8NFXH+CNSuG+j1xuAXBvgsaxsWOqTImBFwpKJtiCvHQ3gSFnMQ6wxMI\n2WHGFUKxxiV5FuELr7WyNlBxzZFuQzCCDccjHjeRcUa46diAmAymfjm4nWBr\nqAORbljWRCvjPGa7ykglEMn1DPRkAoA6s+E1/NVSNvZi/0J7BF4wdRqWjCoZ\nrdnjSeNw22CFUgqW3t7ldALLDRJxMKhCAATYjCaxr0W701dPyI0cMhHEQeaI\nruodaX+xcKlX9MkOWer0/MzSmKSzfSuf5stLd/EwS39+Vo5KTnT515jcJm2h\nGx3XgobFQQ92yTs2784PHmomvFuygVbky0nL6C8Vm/smrg5Bd26m1G/OEmPd\nLySu6ni/qrU54Wo9TgQLIcbeCBTa2yGWEmfRMl2Rs91J/Kku5XB1apyq6eHk\nIQ+1\r\n=P6d7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4989e1decf7dada6a3b75120962bd3132d43a1ee","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.116","@balena/jellyfish-logger":"^2.1.69","@balena/jellyfish-environment":"^4.1.14","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.0.3"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.217-renovate-internal-non-major-4989e1decf7dada6a3b75120962bd3132d43a1ee_1621735242750_0.6807501142393149","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.217":{"name":"@balena/jellyfish-metrics","version":"1.0.217","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.217","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2b2f216fa54b12b1a96677fd324d235704896b07","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.217.tgz","fileCount":15,"integrity":"sha512-TIpSoMmRhEdVud+GfCnkl0aaxnY4z+sgDDAnv+eOmX1BcWmeQkQ0FjCK7qyk6JSODp9pWHjQJK64ranUKTwZUw==","signatures":[{"sig":"MEYCIQCY6hHhMKss6gl7TXXZlRfhmFTBP7YMXtt9CfEE0zwXPgIhAJrCHB5UtSJP6sjk7MemHunC4enGdi/haMSz/J+gt5rI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":113392,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgqbjeCRA9TVsSAnZWagAAf2QQAJull2Xf+B2LwpyeGzXr\nD20eSFg4oItFifovz206qapyk0k4BasR+buVpklYJI3Ku4hGjfZiUbM3UgLW\n8z8MMheUQA++wMXhwjLAguSzt27W61zkiRE/Kbz/rsOm+qggtky7toc8HKhQ\nRJvaPY6/MotXlr1G5V4uLaRKCYCxnyUwPojFPogQQ1APfKRpHsPC7DuMG3zL\nEqOSxZ20saaxix+uvbTu4GK1gRPfqVc9B2FBr9m5wFmNCbYWA7r+5ZRQkVra\nt2i0t8G4xqGUD0poGgsSqjofyArtuzFwmJQyEn3/1b+WTj2PyCCDifEY5Odl\nJHND50vI3uOT6z4Z4IWo7gtahaxvCDLHT/uT3Z9ld6nXkT2VoshuRjHBLfKB\ngeowXZDrORiv92RS7FFLCjxeEjw8J6Xjr8YfJ/N4H/hJZWfNOoZ77s2zf6B+\nNjqnDZEU4igRZNadMhMMKpe4fboEVBXrkgy8mA3fIGF8htDJfukfeWU5X//Y\nQfAec5QNPmraV7DC7WS1Cm2kiylNdCZPPCitwgk4t86t6JVuVKclcwwn79L0\nzVTOQFcy+Az+b2L1DDVCobbpubot9jFbr6z0biXRn+KOji92jmsAubsWBvqb\nYTWt/SoLNHiOmjFF6wnUu+XnRcFM2/t3v1ep8/iEm714C/g3TUn6q1XEziBP\nVST7\r\n=H4wE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"bd046c53f9468c17fb92c52f90006896460584f0","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.116","@balena/jellyfish-logger":"^2.1.69","@balena/jellyfish-environment":"^4.1.14","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.0.3"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.217_1621735646122_0.07528292084893717","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.218-renovate-internal-non-major-459758f2c3f5043228d4ba706eefc08681cc2eef":{"name":"@balena/jellyfish-metrics","version":"1.0.218-renovate-internal-non-major-459758f2c3f5043228d4ba706eefc08681cc2eef","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.218-renovate-internal-non-major-459758f2c3f5043228d4ba706eefc08681cc2eef","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"653cc897d17c0649014cc3c6afc9da25baeec21d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.218-renovate-internal-non-major-459758f2c3f5043228d4ba706eefc08681cc2eef.tgz","fileCount":15,"integrity":"sha512-mwy1tDyU+jmBrPf+t8/1JK+pvdR8/4HjOCvbMPCFQb1eLgxiy6dwJqhvGzK6DaUIrzDGj9zImo9Ak9KEz7qDYQ==","signatures":[{"sig":"MEUCIHUQ+RHHJkNZBWLUPDHg8i1PJNrNi3iKH7ZWO5wYnzwkAiEA9GbpdmUtwiR5fVYcm4/4iqqS42i5Yby6qeEn6EgTqGY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":113537,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgqgl4CRA9TVsSAnZWagAAc08P/1sHs3aCuhrD9wf0PuPv\nVbojCUJd229BfMcMyn2UeriUPKz7gaVfY1WNJPenT/adyridoQuOQ/mJWg1o\ngdbBg2ReR2dpDo/Yz1TPVeu3hgUnowiGaXOH2cODukJrNt9QF/BUGHlSt68S\nGTQRux0VbAXpOIfH9krW9YkRvfqD3RNo2bdpgZdiLkMJNeF21KRGGLi4mnLy\nb7mQRH2x2JBnwfvZASW5ulAZx/ILAhSI14Wei/M1Q6xV5llL5gHG9Mi/eldm\nQ8cr/11VxAWkEBAjM7vjf1LyuKmuZwwy9K8J/x+bswVkY/hL0783oxvP1c7C\n1Cqw7NpR/RPcOihoQWPwtZy7Y3lbpTjA058CliI7rlNTnZ4/PKdYJTMB+eqc\nalrtX0d6hPyLxejHMawqNReErSqU9Z0J3UrgTvtlYXmUzDyfj7aSDFQZJHXj\nnzoo/waGBm0ej85mmLtNMgQVSHY3rtsFmYVsrTv0Lh8W4u9jBPIBTgpq2NO6\nvRWP8XeTra4q10RhYomyYlQWrjk5DQ2+74stPErE2MdL9HkHzdnDlGSSW/cP\nD09J6V7wuYV3o2zhYOTThIw5v+/FPnsjId+mOQz230ema9RK69rUbKlQUMbk\nDkJhQESNuseWN2SvXFTq3U69wjfQHg8q8MDYh7mcBW4neOZ4DHsks4zP1MUz\nQ03Z\r\n=mwtl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"459758f2c3f5043228d4ba706eefc08681cc2eef","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.116","@balena/jellyfish-logger":"^2.1.69","@balena/jellyfish-environment":"^4.1.15","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.0.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.218-renovate-internal-non-major-459758f2c3f5043228d4ba706eefc08681cc2eef_1621756279538_0.968035399426918","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.218":{"name":"@balena/jellyfish-metrics","version":"1.0.218","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.218","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2c80dac5a002c68daf82b5a855a63d9e13d7d98f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.218.tgz","fileCount":15,"integrity":"sha512-fF8QDbhtOxQ/kowMswckWeo4/Po2JWbfvRcx00e7lC257IbQ6XwyuHjDvHmAEJ2k3y4nIlAHTqHP1F9GEU83qg==","signatures":[{"sig":"MEYCIQDvKCWUazzsLXRcLymc2VDEi553FMQfeRsgqKGJlxkroAIhANM8h5w7aARMPkelUV6whbIgoM3+azB40r7jRT3e4Jj6","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":113468,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgqgphCRA9TVsSAnZWagAAUZ0P/R/uhdPziW/Ru0ZTJgzQ\nXK/y0s8mKwBE98NPGuDxrv9p8ARJyLeC6uBvsw9ShTCuPV1NwjIJg/wRBNN4\nwBzOMMD0FmW4Ra2NAy3V5VKk+2MeRGnyrtQoTGSEozSJim3bng7A8oGkbHEx\neHDBZUSTzLTJJfiQ3n3gGPqAHLCKFfvbX8bHnEbLJv8VamJrzAovGyX9rEU+\ndO4NP0gPrwUIm9iD1BBHNCs8hN0GV6kFrmCibH9ShZDdlQ5iubRwPMFiHK+q\nTu1fH9GyTUdms4IkpMy2bxPFc65yyYpzXjFyXcZ2//ckSXrllueFFq90f3Ax\ngxsG+5wZ23uAzMhJVgsDJvk0hImB1g1ChkgK7P7BobERUFGRqdJeMD7nAWyP\nvH21lWiHWDfTN1BO/l6Q033oxagXRFqAKzAw9drj9eQEld7gVivHKfhG8qIY\nRZ9brXiniZ1U+5DXgn9tWQhCgnMh5lfrB+lLcDn2xG4nKGfvNHnDccy1eoFA\nZTSLPh9p2XFbbnWuuAE+t2lkuCr0LydBr3mKfmdJIQJE8091utltQHxKdchc\nBUDxt+VOj4/w70v2zFaeh6HifhhH392tUcdUOH+lG9G5uvs7vW5p1rlB6gRy\nV1uryGH/f9wy++PPbYEriSA6jafOH6nwAMaDrWjd5g+6YT2ACoAGSjUB7y4N\nEpww\r\n=VYUh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"055aab0ad5655da673624ba9f01be56d9960ef8c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.116","@balena/jellyfish-logger":"^2.1.69","@balena/jellyfish-environment":"^4.1.15","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.0.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.218_1621756513262_0.6324012789226001","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.219-renovate-internal-non-major-7c92fa6fb793707b225f45ae3c587f68208b7421":{"name":"@balena/jellyfish-metrics","version":"1.0.219-renovate-internal-non-major-7c92fa6fb793707b225f45ae3c587f68208b7421","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.219-renovate-internal-non-major-7c92fa6fb793707b225f45ae3c587f68208b7421","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fbdba9da2b9602ac2c45f527208fd2ad2cbd664b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.219-renovate-internal-non-major-7c92fa6fb793707b225f45ae3c587f68208b7421.tgz","fileCount":15,"integrity":"sha512-nQB2a1vhcT5jbPTLxvf5RzzxEi30Fa4+F5bq1iJy0j/+YzGMQmJtz4LeLTE0b0TqIvcZM7wpwXF/+0+HaegFgA==","signatures":[{"sig":"MEUCIFlgMenjKRU+onOBFP47j2EyOf66F8EUWm4pfa/igzj6AiEAoKFKLlPp2vP/sXWI2+EWAigxH1mQknIicG90eZFeJlM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":113641,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgqhjLCRA9TVsSAnZWagAA01QQAI5dT2CdtjU+Fc1APoB8\nkhaQIswVhVqZrUpdeZ4TNM4TZ7LZmHfpXHAy6tkvnSUWkAKvp6Tc5UEozrWe\n555wF2zukdG/5hLoniLB11RDKmRz2cBgiwW86GzPWKIBg07vCdshV1r3H2yC\nzA+GHjVNxNGsavzHtLtrqSFibOVRMO354GLhn1RnjZwBVZG/2DrOkjBDU/LO\ny+emjLCl6jCvJRfjCzLjuiWI4L1QPndyc/h7NlbpqJKChVri6f5LEp1BJQMT\nFENqL/Boj/oKkILProfQ4Ujb7tXuvuZLxkXF+r+q9B0hm0BMl1veg+G/IxeK\n9ealBbshosf97QlpxlsHy7iUjuii5P1fzOsDj8IQ26J8S4twrC5c3gV3Sew1\nIRpzv6gpfQ/el4O59bS+smTR2xyKDHpGJBp1Le/BxFhKk1u3JiGWi6oNPPrg\n66hVyWhgvdS7dDHM/yAWMRHQCr78iApUk1vqW2gVcVV6GAJhr/V4A/N9H0Pb\nHqjpdoWFJUKtkYcbGaqyPRUIUZnw8dNTNpvMIZvuKjJKsoS6ZdkpNfNurR4v\nYEV6XH8xsAO3zn/Wd+W09G2XJ+kxEXEqQlRxFyggWmJqoNYRbsdJ5jff7bDO\nF0tbqLnpwduP+tvx0UuolXbPScd4cccpYlJRArCDN/F6znLRgmQzKOJNt7Eu\nMuh5\r\n=/C0p\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7c92fa6fb793707b225f45ae3c587f68208b7421","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.116","@balena/jellyfish-logger":"^2.1.70","@balena/jellyfish-environment":"^4.1.15","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.0.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.219-renovate-internal-non-major-7c92fa6fb793707b225f45ae3c587f68208b7421_1621760202932_0.1010485701117354","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.219":{"name":"@balena/jellyfish-metrics","version":"1.0.219","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.219","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"86d4e2668e2b84262e59832d880349cf8c6a79e1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.219.tgz","fileCount":15,"integrity":"sha512-IKbo18KkftzCNw1vbeDygIvCRMTe910Zlk809Xyw4nCg6AskGpKyzwQCEuUZ1/8JsEaii+5VaI9X08bBmv8D5g==","signatures":[{"sig":"MEUCIQCo3736VdEdXenHB1oS0emH40BSwt1Ggsn5bgxP+qgWrAIgVeWr7vHohUqMZreCJSX696GKalMZCPp2pwdWlPJ9JE8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":113572,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgqhmbCRA9TVsSAnZWagAAfwwP/0QmLkzofWLCktglyxcq\n9jy/aT5mGyc+4XoT3mmd3efqEpwAE+Cti67HqHFCNMpEEvAq3Ms1NXJwpMZx\nagXmze8B32O+3Y6A5E5eSK5zAKA2ib3FSEdbGe2K/Ky/sO8MHYfKDbSATJO2\nbY2679qvnSdN9HdME/BJ5syHesAiQAn/GD8icZ6pFhuunDevrXvZV/8JtqM4\nyyiOCBH+1aIPriFTl8w+ODfu+skghnNSW/2mZFlvpyfHBJTgToX1/rMfBSgA\ncdQsVqnJIHfCw4dadm45fu6vVLcU61q29YoLQ4X7tNb9hgd/kuIRfx3Xm8yr\npDAps7MTWpxfhv89O3AwWW+cOVNuxVdAcI3nTxxqab2fD6AHGCZriRDKNKFU\nLSduwDemHwf8snT4tgvgYn4bKHjb/gbd/fm335359UzoRNsMGejOmTHaD6vL\nRzh5bjroHdP6OtghZAsgwMUwklhs4qCnfJuVUs9XHASE+Sm+4DjH9TUMv29V\n4ONnITj9HV5LL4AOrRV4tBCoJ0UEQ4HOeVAj0xD2pxMwEXbdDzT5BE243giq\nzxxsyM0nM7QxkSWzYyKvGC8kP6REMfkL+SRNMgakAwM60/ZDqqJNV9Z3nKCl\nMVrffz11kUqgDElAqu2/trVlobDhg1fJrrxNY6ABvhwOi5pG7731+pDpkm81\nhGrb\r\n=EmMv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f0ac4a0148b8064090acb159a3333084b0d1e508","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.116","@balena/jellyfish-logger":"^2.1.70","@balena/jellyfish-environment":"^4.1.15","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.0.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.219_1621760410500_0.5846738017991251","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.220-renovate-internal-non-major-c8fa36be3cf8297b9cd076475344140024d2c10a":{"name":"@balena/jellyfish-metrics","version":"1.0.220-renovate-internal-non-major-c8fa36be3cf8297b9cd076475344140024d2c10a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.220-renovate-internal-non-major-c8fa36be3cf8297b9cd076475344140024d2c10a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0512953a744c09a6f0491369fbcc8f05dfe0e195","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.220-renovate-internal-non-major-c8fa36be3cf8297b9cd076475344140024d2c10a.tgz","fileCount":15,"integrity":"sha512-ilDD67F6Fy5wD+2u3kjKovxIXyOpHQBYEMn/WEfjcH8IQYWbZIaGzA9gpyhSS8J2lp3hKgAD6/ht5RK108h3UQ==","signatures":[{"sig":"MEQCIGg/uvY0s3nViTUx8NVaFYqA7bPbBwnVMxVOStTi4DNdAiBDhJtKZzrmO4+xnrSL8o13V7cR2pBqumiNVD1fCRlwcA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":113717,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgqwQQCRA9TVsSAnZWagAAaV8P/jzEgMbz2s45uFRgc/dJ\n9AY8709oXO7ra9LmIRL06mgAVJNkhVIqgHFujL6jv+4B6QxLdMIgeEyfdstF\nAPA6uCGeo7xiFj3JqyX0TNixpsR1Lk6fmXlqHBJ2Hn/b+OWwDVYjuapTbOzI\nUmKBN9kfWO422wlyRxBSDog7Igw8GNtQF7ONzob4Do17lLQBZ3PTv33LB7DU\nTKilKParBM74kY3b131WJ1wzdlwgVkAGUFyX4ukYq4R5758iF+5TT3XYKFjA\n9B6FXrFHAUBrJCI+vP63JdMniAGlXZla3IaPCzo3v/Xdq1fixP9i6LejLHu/\nPH3if1WbQ4w0FnlJHrLZhPZsWYK4Wfsc57q/Cr/w66FAyllswwqouMxBAef4\ncqi7aiSI3JUv1GYudjNx7UrGXphSOLce5z5nj34gHnwc7B2EIKNg/tuoGzz5\ntIgvogXLE1jRiqd0m8dbMl+2sTa6DQpLDtyXp6hcmBauQFnYc3SBWUVtgIyb\n5nDK2akK4IJwUQI4peUoCkQuTqZsYGZ9eEwA/ioTAmoeLJKcY8OfKYbsoq8T\na3jPab6UngvK0kA7rRtC1yMkuhJ9kc8nQneq7dtoke8kFhLzalbiQXActjy5\nZek1pjHw1I6Bjj5UP14LHKkIUgu+zQXDU51arLqm009/Nj50xy3nLlhqpJuc\nSEGf\r\n=mVhh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c8fa36be3cf8297b9cd076475344140024d2c10a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.118","@balena/jellyfish-logger":"^2.1.71","@balena/jellyfish-environment":"^4.1.15","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.0.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.220-renovate-internal-non-major-c8fa36be3cf8297b9cd076475344140024d2c10a_1621820432253_0.8670596245322697","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.220":{"name":"@balena/jellyfish-metrics","version":"1.0.220","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.220","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0b178dddbdb93b7196257bdc10d0895a0ccaf9af","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.220.tgz","fileCount":15,"integrity":"sha512-86FWBR6LiiGbaMp0GzUWn/LGC2tLQDHE8oFhiLZlGuPFsEs6OIgqNYCiWYz89q9flvNdKVWVZeaiv302JDerDw==","signatures":[{"sig":"MEQCIFL9pjG6YrXBBTlhgfvOO59aMfOsUFfcO98Zdn+NJE82AiAf61bQBtGbKkkqAtednlJg2E7VNRN8JvBm8y+xGrZjQQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":113648,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgqwUJCRA9TVsSAnZWagAAjSIP/RFJHHN8uU0C4shU5oB+\nEjK12j3iT8XRftTkBmj7lg3MPTA19inYUKgO22rh/JavfHaBjYZ1gT6ALl88\nN87VlHmFy7DkZ0KbaadDAN4cM1ejcX08/Qr4YTNRRXBcXHWCyxNMAPXyvvbW\n8AfibUr7gxVu64YWkg62Gtwr1aADB7adOuGbujk8ZeDNvaNZ4HQktgi+82tV\nFSgwK0Gpcv2lGpSH+Fwcdi1Td2ARbSYjqZ5hE9OsFX6k/2QFSjy5PHIXKUJ2\nEoKpFEAxVnpcqnUx/78KBZjNnAKcIHJHw6ac56l6NKf0OeyB21s2xzqQjpNU\nwVW1UVXueGcaWAloG0N7/AJrEoPvQcO382Ov3kXaJHm6xAdYhY695hjWaUu6\njaBWMw5KZEzQrXiwcjuF5b8PuM55ZbyQQwzMh8vfsDj8ZVWXyfsdMcF5NjbY\nfOOcdVRau5Hcf5AD9+iqedpHA/OJuMraMSjfFsArgCDT3/ezoouXEbw+G7Md\n9r61aqX08F/Rv85yK5zaSYevTyH+Dnmp++cfUDARpkZM/Vzdr2U94Kkzqpbo\nZmLuNgn6tTYu+Icl5dJYBYlhNPaa1IKJVQ0BD3Gct8GhQIt6SPVwcojbuyGi\nExj9+IdvlUC/7TllTSYBq7EkXM9DM/VLXZFcw2RzvXJk6VtwCaBrT9/uqnUU\nCt/F\r\n=Oc6h\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"148b0fbc471c0e9b7153054c6dccf52a73413451","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.118","@balena/jellyfish-logger":"^2.1.71","@balena/jellyfish-environment":"^4.1.15","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.0.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.220_1621820680599_0.7365047449390958","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.221-renovate-internal-patch-6b9992a554aea4b71e233d28fc5a5fce8e5a4208":{"name":"@balena/jellyfish-metrics","version":"1.0.221-renovate-internal-patch-6b9992a554aea4b71e233d28fc5a5fce8e5a4208","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.221-renovate-internal-patch-6b9992a554aea4b71e233d28fc5a5fce8e5a4208","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"00ac8a65713a0ba4afc516de1fee02f2a1c8563e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.221-renovate-internal-patch-6b9992a554aea4b71e233d28fc5a5fce8e5a4208.tgz","fileCount":15,"integrity":"sha512-alC7LUrUr97JoufAv2YaJiKd3KZmF1OvbcLcDLJGuAC7NwLCiwl/7qD9msJYnj2+8aKONzPBsAC+ZB1wzage9g==","signatures":[{"sig":"MEYCIQCdxD85+pcZpcs8LF+QzfDd4Y8VtsqvkW+S0bMK3eQBsQIhAM6Zv0auBmb40QoxNUVKNZ9QJmPr7ZuVQW013m54V65b","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":113785,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgqzQMCRA9TVsSAnZWagAAcHUP/1UvZjpnlQzyc4WWrrj4\nyIHJU5/HZvkR5sTzXHL9DuzlnM2MzwktGYeou9JaKy4OpMvupVhR3RvrfuwD\ncRPc1/euET7q9ErFDzk46T7LtgBqAMTPfuX/DVARIblVaf9uD8WVl75ji5HW\n0QQHnw9xckCZS01afAPNljRZSn9y4DfH14faDuGaWWm+6kz3hsOm0R+BBFdQ\nZ55uq8T372+h4BoQ695IWnydESbLY1KyIbkQpjM3mjzv5Sz8pjXKRoNuPJom\nAr9iLRPCrVs1Xeg1Kvf37nUVd0vvGYE/FhyOKwVTh9iQ7Gg//QiQ/hLocNDF\n0uxfTlubH+vVsf7T6pOkosc3WC12sduoO/zJ/cEwhs2dedWIBuKAk9kYnumk\nBorSp4Z2mz8NGCIRkpXyAmv9KzyNznJwq/M5hnoBcx3F++n3LlHTWRlFZkjt\njG+QWy//E5CMx3lRFVGHVpY3NfuwUcNF3em+C7K5uoHsg07UNh4QV5LN1Xgi\n9B4ddKKb9828QsNtJtZF0xYjM7gZ42Q9Dzt+Qw5630WmUXILO0ZMTAYkuMgt\nPRmO4mba9D+yckxmOUyQyRsa7+7L2+Xl7kNt6cHHsLffJ2IfF03TsUvnfCaG\nopvu8TohAWIFRJ6kEtFnyHs0ogMO2MfhR4vuG0cvCgNrFWCrrp7e0H3DcSSL\nVvPd\r\n=iDv9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6b9992a554aea4b71e233d28fc5a5fce8e5a4208","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.119","@balena/jellyfish-logger":"^2.1.71","@balena/jellyfish-environment":"^4.1.16","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.0.6"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.221-renovate-internal-patch-6b9992a554aea4b71e233d28fc5a5fce8e5a4208_1621832716166_0.863498213672828","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.221":{"name":"@balena/jellyfish-metrics","version":"1.0.221","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.221","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"450c3cc08e002a8c17245c76c2e812abb54ea08a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.221.tgz","fileCount":15,"integrity":"sha512-awDleqs9aU6hE0h6LZ+s813DJ6qifR4aU4vLZdhxTKgAoW05J6Ky3BNmT67my9ZdNdnG7x8kVYbDoYplj/2SDw==","signatures":[{"sig":"MEYCIQDVCX0bsak0genUpFfP1PeiugvxyxECRtEVrbyRfoP6XwIhAL5rSYCJfCLJ2evNW2XpgPOhVaostVmN3ENcV1dNwRDh","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":113720,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgqzT4CRA9TVsSAnZWagAAF9gQAIN3XLj0wg+Hv8G8hPx3\n2fqoSu8EOh/l08qvtSab17dMd2Vo5HYXdcOVKFAvE7Jm55BEbBfBud2fAAW0\nAegoYOEHzWnJhhO0RZxcutyhR1CaKFTFUDC5yDs8aM8ALJzldnadjgXfdqeN\nyQq7AHNKaYi56ISAFwG4NRdMB8tt0rZMdgDq3qCf+QonSx6Fw/0ejnTTZgDu\nWICmv4E6W+xWNqoGuznEeRHrrfecdD7nYVfW9Kkc4cSRDbLHRkPRKdI6gttC\nmna1oNsalii1m5CPUKAaw1N1IY4gK3HJO+esiE+hKhVhN75T3X7IuTx5JOgh\nbui4huDDVcor4pUjW8HzkoVxazbZRkhdyMGABOgd9SfEIk5TsaSVvIR1k5lH\nQbTOA9Ekohfxkw4rLzvnQabez0dQld5HNLnGJZtNI2aH8klcydc1IRO7DsiX\n1aooRTaCmwVd2y+WeG5kvz/PFuNSw3LKhO0pWgDeUkv3j+UvTuYCUu5EdRLS\nYlzg51dovs9b6MWw1sSrYIdPpvi3DpAnZrbaD6vT3dUt+7u56s0n33QdUTED\nIpgFK8RUuN4c0PJ5kwawyS2f2RuE2ytW7drd27gvG+TSOfJAltXU29Pp9kzR\n+ehjcc0zudUxQzk9VUDE5QLQZtnKpaDEhlXVqPoGDoYjLyHwjOEqEc4ZOm/f\nNsL5\r\n=Ftwi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"cadc23a7e636b0c6e16c0b2832743710bae21c65","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.119","@balena/jellyfish-logger":"^2.1.71","@balena/jellyfish-environment":"^4.1.16","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.0.6"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.221_1621832951931_0.45049187343736974","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.222-renovate-balena-lint-6-x-5758c2a37191f09db0baec49caccdbdb9a889b60":{"name":"@balena/jellyfish-metrics","version":"1.0.222-renovate-balena-lint-6-x-5758c2a37191f09db0baec49caccdbdb9a889b60","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.222-renovate-balena-lint-6-x-5758c2a37191f09db0baec49caccdbdb9a889b60","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f7fbf460de225ded7109612230ddbf61156d7187","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.222-renovate-balena-lint-6-x-5758c2a37191f09db0baec49caccdbdb9a889b60.tgz","fileCount":15,"integrity":"sha512-PUN1vMnW1mDpRK1CBLCvGRnSg+c7tplMws6m2wqw9yLqiUrYGIulECrQNNLrihS5E7nhnlLhxQtJnEiCDh9zeg==","signatures":[{"sig":"MEUCIQDEZit9IHLoIVaivYIKW/3QxFNb6Pl7wWRdmD6gR0zV9gIgNrNi/4cIv/2Gx/9oNAqR0+ut7j42B19PtRKiJBlMW8s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":113873,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgqzXVCRA9TVsSAnZWagAArCwP/37QAxKzTUjT8awA5qKy\nFIMotkL7/Zihaf7Ct0Ne1mC6HjrgIgI1/8IGM21uATIk+L/Q9IqZl02qT50y\nnDjd+2DbRKS1VspXEi5U0LWo+FTWS+9JySUeqbX/iDNXZAxXcVs4bhGtGX6g\naKpbnHdhv+oHJN5SgcRphfgjvV0Cq8qowy2ckS4rgVvGz1ue6DQo/w9Xm+iX\nxVLgfyjnyrvfkrdZvpPxp/vi/T4jmoQcyM0pfzufC8urY/kOuWvCO3do1xIp\nUFa/y/VDU8c5MJB32uai+iM9AZkZ98v3Liwc1rk7x9+kilWk1lnlJTPlzfD9\nT0qRWfJkyctfCWtb8vatpJawcp7Q1IeTcXL07ujVRLuX2nccO2oYSW+gbTJK\nE7zT0CrbZ+zU+wb4rzfI1OLlRQBomca1YvirembvGIbIxlEMeh5nEF5ZZAsI\nY6783aXD0FdnzUXh6K8Vc/yAY8Q5iiaHV+UCmt2N5VO06qTFFRMylcKpucbA\nvq9LvjmotsyadGfpkmRvykFOqPCU/lbhFXvdlDB5Myj3QjmhsqSWnqtA9Eqj\niKtIkemGRyYnSVQDgFYP0Mpp0hHbHnTv/L4zWSSyom6cqRMDG+q36D+IeLJm\nZB3AD6Hgd0qor+kfK4CXe7VhCF4ZXm0pExhNmP5zZaM5NE0SNtKwqJpA0X7R\nU6Mi\r\n=Q/AE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5758c2a37191f09db0baec49caccdbdb9a889b60","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.119","@balena/jellyfish-logger":"^2.1.71","@balena/jellyfish-environment":"^4.1.16","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.0.0","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.0.6"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.222-renovate-balena-lint-6-x-5758c2a37191f09db0baec49caccdbdb9a889b60_1621833171863_0.6231085693934779","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.222-renovate-balena-lint-6-x-46f73d2091c97704b88362f0e71f0bd852d11a98":{"name":"@balena/jellyfish-metrics","version":"1.0.222-renovate-balena-lint-6-x-46f73d2091c97704b88362f0e71f0bd852d11a98","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.222-renovate-balena-lint-6-x-46f73d2091c97704b88362f0e71f0bd852d11a98","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"60f437ad4a1280370c5b4bcfc967810735dbcd72","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.222-renovate-balena-lint-6-x-46f73d2091c97704b88362f0e71f0bd852d11a98.tgz","fileCount":15,"integrity":"sha512-/yufXuRdNhPRfwla39OTQFOMb35eUFqscW2QVYw99gncAQeuznMXeiru71Hg/A5L8A9jqy0jX5t6IZHUxj6Wqg==","signatures":[{"sig":"MEUCIQCl/wgsiu+zHOp7eWlhu34MyhhnvXclplgGasD92eTgAAIgZaIhhclk4PyRDkC23G7+lRZ2V7MRQ+bVBu0DCPFJ4U4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":113884,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgq0gSCRA9TVsSAnZWagAA8NQP/3yv7vGfQVBdIKHU7b/E\nuPE1Ek3Oloa6G1dOpMfIkjrkDUKgwCV225Aba+Ax1CSO2Pnw2PAIy1NgVwWb\ngzv6Y0v73MYI5+4tFhgo9jywk1GynwmOI/4Dyujk4ssTe/t72+AZTBmKuEQD\n8+RxfUeVfIBck+yO0GFSamML5PcI8pGUkeE0hENXthURyYRRkiCN9dUIT46w\n4B6z1TXKIWVpsmYGHIQU/jsz7aeRcQne0zF41mL6CRnYHYfe4XBgOc6U6+QA\npALsfLFXBu1S4hD7t1OowYYMocmQSjMoMXLtcfAZUtcbxINVKlP3ungSGkLZ\nYGlgRIMVD+Gae78OT3f2hQwHN2TqUJDgfzG/CQaQ/m0jKJIi7FdBLVB7oUBU\nl3cVVC37G1uO0N4RBf1kaeUbxP2KrEl0sD2GmhMd15c8x/6oXk28T28YYNXe\ns9TtvpQb2vuQalYvg3S/D1mWJqTqcZwCTLyTWq64lk9fvTaf7M4McLQE7QvC\n83ITuTOAjhf5w+KDam4fpgkvmsLD9fgA3zyA50i6q5OSC3NPRwDbfVnCCJnX\nzBAgkSnL606P4AcRr4aKDT7FhAdPoulIaW4Q4Dq2J0uIyCjkzPH0HFjLlZfD\nNRKcWmz3ghpoXe1gEhECyfLSQMrWcaIbRQ/uylHwSWhH5+0hab85NofR7stc\nWf9x\r\n=6xGp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"46f73d2091c97704b88362f0e71f0bd852d11a98","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.119","@balena/jellyfish-logger":"^2.1.71","@balena/jellyfish-environment":"^4.1.16","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.0.0","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.0.6"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.222-renovate-balena-lint-6-x-46f73d2091c97704b88362f0e71f0bd852d11a98_1621837841724_0.8427189430219242","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.222":{"name":"@balena/jellyfish-metrics","version":"1.0.222","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.222","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f02542837bdd88a5d7414b149497b0a6696e1f72","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.222.tgz","fileCount":15,"integrity":"sha512-aZFsIAQ+3MkIxOdR0Oht1kt6ruh6Ptk1VsdiGYSZUd0TVdaGrdQynYtjtY5M300Nlvf95xhheDGNaRXBgoj/FA==","signatures":[{"sig":"MEUCIQD3w/IK8jFQaEwt683u051eoMCIqmTJ25N7PsoqAznSzgIgXz9owTxhxMez+323+J+7G+PSEnebnht/h5B8RCqLppE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":113818,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgq0maCRA9TVsSAnZWagAAxVgQAIoZ7kwugDFo4r6GlB+P\nd/+CcyKgTt5475paA0gRctETSuIM21hrtFkJrb92G39PPfP1l+HzBSlEcgrv\nwHv16g7iHJ8K77fxayBtyNS24kStm5lVtNh6bCeZPHC0SUNbvXMPkfRkJj0m\nmJaSPP/t+4yM194Nbzb4evFQYPsd24YjrCPajfLS+awbNGBhMsGlErHJkQFN\nm8B17n53AkJWi2M/va5orWdGOMZCjaPzTPqyMMxZlqMfYHc9z1qVpYjFO2RF\ny3Zq7NSIREBsesjprkX6wLKMdfRukImor8vWdwomFdYFsDSRphujHxZyQp/G\n7/jmnofz+vUBs91cFdEoa+bg9SFeB5JMyFr0f93dm+D9FfMDt+ScQc94FjaE\nUrlcU9iaLC22bEziZd0j4s7Mb+6oiFfvl41jpkEttx7WwpZxOsN2EoS6T4vM\n8sRWpnuC9IF1ujtNiO+DgTXkBxT/HoqdDiH0eJUtWOZipAY6E7zrKwBbTECn\nWIzdV1SkTnNJYE32FovLjvgTHjJ8uNm78ju98+jzYaDUj18biOsmIK+b61xl\nQ2jlx5Lct6tbg4w6vGuqNOP00Zk5s/8SPlu8xTmKYKGGZKNQqOH7E3Pa8LS9\np9b0tdB4ob+hbuJR04yWXEq8X0KDWOeXYZ2RrgLUhs1R6nXwX4ucT6sIPchp\nE/0g\r\n=fHqj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d0ddda389abf54a31f4a0ec353a56e233a4f5c85","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.119","@balena/jellyfish-logger":"^2.1.71","@balena/jellyfish-environment":"^4.1.16","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.0.0","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.0.6"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.222_1621838234102_0.6152881497497238","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.222-renovate-internal-patch-7d41b4d2c2c5c63e70b217e00312c0bb4318af01":{"name":"@balena/jellyfish-metrics","version":"1.0.222-renovate-internal-patch-7d41b4d2c2c5c63e70b217e00312c0bb4318af01","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.222-renovate-internal-patch-7d41b4d2c2c5c63e70b217e00312c0bb4318af01","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a7d2a64634d67ca8186a56e8e63c06feef77a258","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.222-renovate-internal-patch-7d41b4d2c2c5c63e70b217e00312c0bb4318af01.tgz","fileCount":15,"integrity":"sha512-0CTBmsQ+SAJN7DaZshiA53ChbceyjxalLzTRULRSdHyyPyuI39tboah1CqCT86bsZSC4btyCtk0hl4Y0EyhPQg==","signatures":[{"sig":"MEYCIQDKCjzRVO8yvEBOxOtUGiRmMImI7hNz6VKW8C00GikKBAIhAMOT7yGJ6K9V/fJP21Vygw5KpVRcL6oe01wFq50QddgQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":113857,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgq0mpCRA9TVsSAnZWagAAMYgP+gIRfQ+I2rpgdoXsehUm\nn8P7D2EvfRr2fojpwQrJrXC+kxxZDbq2pa5dpgOH4FModdTmOIwR1Yjuqoqd\nRw8RQBoxtRolRkPI/XDJF9+Mnw2fwdInHii1VXk28WqhPDpmt5bIR7PfXFMy\n9xJ+8zM680eToIczeTi+0+d2j/iRSAux+Dm2Pzg3SBG0FuNC7VwF+x5D4flo\ncnb7HbSGWXSr/OmBj7IoBGNgPoxcOUHKfNbFNcFNBRrxu4831n8DtDCQMsFg\nyvioJd4q1CbUhB9Hl7tc73Gp0ALrZDd174CvVsBX7L9KOwjIOTV08CLDW64Y\nVNX42i1hauhVNQRrNoAyjuHc7RaCTDolcy8gjvOYOZpUvXZjb/jnyDh1nQXy\nUhcTlTLV9+9AgZTzPz+gvk5dpmg51LWDsrUWYB7O8oFjOcecq/lSQP2vwhOE\n5l1XnvW8v8iVYAUfctH9KHhtSsBiuY0jc66hUmRZ98NgbKDzLph7Cy3p424E\n695nZ4DomcOaBwvhXKOfTkYApnYKjyTLIGz/rgPrvOsbI9d0OyrAI2fPKRBr\nICvg2OAb8k8mA83GyfdDkiY5gfmj1cYg522IPI+KLQPOiJkIY7Nv3nrgX96O\nmKH/ae9eUSbrp2CqS+0wBuT9+r6sdC53r6hTvQjN4ohm8y4cMIg1NXNlhQL7\nUOgf\r\n=9z8H\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7d41b4d2c2c5c63e70b217e00312c0bb4318af01","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint --typescript lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --typescript --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.120","@balena/jellyfish-logger":"^2.1.72","@balena/jellyfish-environment":"^4.1.17","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^5.4.2","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.0.6"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.222-renovate-internal-patch-7d41b4d2c2c5c63e70b217e00312c0bb4318af01_1621838249056_0.7155619193271474","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.223-renovate-internal-patch-10bb4840929fe503e4574e2a5c5647cbb67b79e1":{"name":"@balena/jellyfish-metrics","version":"1.0.223-renovate-internal-patch-10bb4840929fe503e4574e2a5c5647cbb67b79e1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.223-renovate-internal-patch-10bb4840929fe503e4574e2a5c5647cbb67b79e1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"26dc28ab95db70e93e0cee0e55dff822beece26b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.223-renovate-internal-patch-10bb4840929fe503e4574e2a5c5647cbb67b79e1.tgz","fileCount":15,"integrity":"sha512-vVNFRDK5NNruxt07GKCk0+gDRXrK9rreYG1irx46P3/2c6rEIWGxxQOMHg9dcfW0aenKfcNj0MAjWHmwk8DuRw==","signatures":[{"sig":"MEYCIQCBz+SmzCpTDTWEKTjrcqD31K9nGZJA5uya/9FUHzeYtgIhAOdMVuCEw+ejuQtDtnv4ktB6thlvtFcJ3DDdvZVKiM6X","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":113955,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgq0sfCRA9TVsSAnZWagAAOIEP/iWJbXSkUo+al8tAZIrp\nuyaws39T1v0WQiAdiq20muiD3/37NwJgqfu93BdDEBRwffUHNcETcA8E+5TB\nIw2NLh1mX4vZ9R3vm/3xQ0ObfHX6KhMSlFCtMLLqoTfAE9vCJtkP7FXT3WUP\nEoRHCWXrPzR+xTAyc0CD6CpjVj7Z0J97xQkWsYLQnPiEqSGLglk59sWSS6Q+\n2/ObqjieF7qe+Iub+ETeLC9nThRYyTwhMG3oJzh42TzVGBjqNl4QG+isDoXQ\nBV6y/79x4XtCAOWQ7kYfA/NMMdXi87xvI/WO3Vcq/ZWbLGMqotoaKpr/4XaY\nhldbByew52hRdSQBmsxJ8vkmoqOX/VbXBu/Yq2Ezz5vzZP5lhlZr6SUIDxfn\nsCRItDff3hPC1MLIq/7z5lcZQsa8zbdP3qaQ+v2mRKjOpeH/pCsksjYic7p2\nNr2Fnim+d98kGSimSPZSBrq6zu4gzc9mAWIikE6o4Zfit6qkg2jHrtFhXo8p\no8jyTHNEkfanhHKcqX8BmOpz3/kliX9A59obP5Eu8KPjAX+Buhf6BkRGoROF\ng8S3IEWJ5eBB71kkl6NqiWVtLeNs2UZzVhyayuuDbnml8EZWqqFxX7czY9i9\n4QPXnJeogBd7ngiM6nXoJVPsfqb2UOaBQMWfArSfBVGjpy4cpcpJducqzWWv\n6Qff\r\n=dcg6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"10bb4840929fe503e4574e2a5c5647cbb67b79e1","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.120","@balena/jellyfish-logger":"^2.1.72","@balena/jellyfish-environment":"^4.1.17","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.0.0","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.0.6"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.223-renovate-internal-patch-10bb4840929fe503e4574e2a5c5647cbb67b79e1_1621838622737_0.16584468269498331","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.223":{"name":"@balena/jellyfish-metrics","version":"1.0.223","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.223","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f3ff92d75e2e58194df896963e438b1c1b09066a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.223.tgz","fileCount":15,"integrity":"sha512-RyCadeOMX9qiK+lTJXXrrSc/PLki0NwVlJdwbTQvt1PrQaJI5WpO6dpkeJlagnAEwCiMp7ESn2vz0AS6joQDqg==","signatures":[{"sig":"MEUCIFTU5SwfAeZTokXQCBn6wHCvvYhKvz2M88rEa44kKuuqAiEAn8ZjCuLfi5b0bb+fAALcD40VXHQKmDA7/GOKQ6xEzIk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":113890,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgq0zeCRA9TVsSAnZWagAADCYP/jGlAKHjD9jensQoEUkb\nSQD6ZxiSeydk3t7kHICscGsvS9P87fMuP2wO1B92weAYfLiMBV+QDnQRhYGx\nexWEjnBGtCzeSuEVauseYWAVvatO+YeghQ6B54DcVTCUDDicIMsYFToqqRSk\nXwVkhm7PI9N3QKmY6AJUcCUbT8DI/MqIDMaqKJkOCLH7q2+1rIq/Rf9Hb7UD\n+XiV8mEggH3NO6H7RC1ExQpn8F5v4aeK+JqJYvwxy2UVU8/xEcsQNt5UlMa/\naftL4t8bwn7aKllZwNcP7CSKyp5IFJvR+8x0UEynz4dU7cQSgDBkagPD/jrA\n/cdufAd59gWJHxuLXhO4JeyKb8oh3uZ2uozpz2yihVebzYCcl9AzSqqPYBJ9\nLp0uNPQEFfFB7Tu0UBdT3vbBxh/fQQnwNyTZ/ivMRRYU8GFD8/KSPEqDnOVq\n0Cve86H22YhnyKyMQwJVosmF+rwpOPeLzs5Q99gHMS88RmLF9mpYsVO1K2zg\ndG4sppXpfr9LLMQajdZHjhAhumgJYF5RrGwwjMncMf3HZ1L/Y7tbA4mB+/Ct\nmgH2GW+S/kA2sn2rEVuRfQosb1IsIoF1VHpqKYraYEUp0UX/Jqa5veHPispF\nIFZYa6dNhBZb38jfQM3npkNda7NzoMRACxxHkJgeSt9Z+lf3suKUknq1lPjM\nhpzS\r\n=G6zk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9f06729f575e85aa80819ed28cbe6c6282bf8a78","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.120","@balena/jellyfish-logger":"^2.1.72","@balena/jellyfish-environment":"^4.1.17","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.0.0","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.0.6"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.223_1621839069854_0.09654483381823376","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.224-renovate-balena-lint-6-x-6a57e48110127befc1a6c470728ba914b5c37c66":{"name":"@balena/jellyfish-metrics","version":"1.0.224-renovate-balena-lint-6-x-6a57e48110127befc1a6c470728ba914b5c37c66","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.224-renovate-balena-lint-6-x-6a57e48110127befc1a6c470728ba914b5c37c66","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8b42fe5138e82bca9d7f58dd9da152e67779139c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.224-renovate-balena-lint-6-x-6a57e48110127befc1a6c470728ba914b5c37c66.tgz","fileCount":15,"integrity":"sha512-9OFQyBzsnyFQXOodOz+X0+5aEzwS4lxXUqSdktALH8dbQPANxVrNaj7oVUXzgrEiKEA/LkrCuc0eJop44epBqA==","signatures":[{"sig":"MEUCIQDGYvQ3Ywxr37asoPWXcIEKYSxkgf9lVJac3XmScCVhawIgNYPUqcP2jXvu5UbSYwWyv/oK6SrJNSJ7F7MSnxt2Ww0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114047,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgq3L3CRA9TVsSAnZWagAAdpgQAID7cwdrq1Ajobu5wr8F\noX+8cyWGx03UyHU6PGuiVEfUZZyAhJqjoYAm15RwzHmkRJoRs1hHHFZud0/5\nb/Ki89iEPEiVRcp0K9eP9G1zKf47pUKUtbSq25jK/UO1UYClgFCUeCev0zxh\nRJ3q1pmPJhj6IdmQ2ZRifB4BOUuerrAdHGnLHxps5Zj3V84tiBtTRZORGEKD\nurjwj3JCCgMltF9RpqwpJoMeEe+F8uv8F86Fo0Xd279O+/zGajcsw9KQzdhh\nIheiDotnwsM+ZlxZxutDFF8lVE0rRmXouvjw2pO1iWMzNswfKnStJMs2dnne\nB50RaoE7mQ2A5YdMpjWNNfAZJKX613s6rF6IapRlmaLkCHvj3HUoEuBsJon+\nc7rZaiEgtVqWwqHf6U6c28qDj6KCbCpHMe8F2bnssg32yjYFCbFXC1bh2nB+\n1aE8CkKn2vdULs0SNFqV1C8JHRbi/cWhIqpu68Hy7q83akPOmK5e4ZeT1JCS\niF1hEs32q0y7nWqhCXo6XupJnzX2LhQBVQprvFeaZedDIFvvX8EJiMl9fs4V\nPsrWk/WF/uvcvpRNFhPtnuXaJENTmCSnv/rlUMCFIog34VyYZXrY5hyDWGsT\nr+KvEDPmb2ZK39yLm/xwmRDwk01fxUZcPSPGgHDI1L9eImPzmsySRo99mRIG\ny3dE\r\n=3lXG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6a57e48110127befc1a6c470728ba914b5c37c66","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.120","@balena/jellyfish-logger":"^2.1.72","@balena/jellyfish-environment":"^4.1.17","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.0","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.0.6"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.224-renovate-balena-lint-6-x-6a57e48110127befc1a6c470728ba914b5c37c66_1621848823273_0.9671447416782599","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.224-renovate-balena-lint-6-x-d54898428e9659ed271892cf160a6cccaa456f22":{"name":"@balena/jellyfish-metrics","version":"1.0.224-renovate-balena-lint-6-x-d54898428e9659ed271892cf160a6cccaa456f22","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.224-renovate-balena-lint-6-x-d54898428e9659ed271892cf160a6cccaa456f22","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2fb307aac7014f993c501626b41b40e3b61cd0c1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.224-renovate-balena-lint-6-x-d54898428e9659ed271892cf160a6cccaa456f22.tgz","fileCount":15,"integrity":"sha512-H0ufN8Q/YLG8DVR3tFNuMkbSS/Fhyxhbz6tpABQp7Ec9TUFC+ScSJZAjt/ZvqUAVl++cCGrmIQ+UNzhPGRhaXw==","signatures":[{"sig":"MEUCICJYUxcyVBKpD4agy8xrzEUmPPGjZWRhcvDxSCucDKpJAiEA2lxUttEvg6uwjNfkWMcVOKkNj26gw/EznzXmTciibKU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114047,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgq5g7CRA9TVsSAnZWagAAD1kQAIoguMamUgyriP5fzMHK\n8TNKdO5IL+Tal3KQQQ4Nq3i7Ci6AeQLOwUhGf8I8ND114FpC7Km1x/XLSmeU\nFV47ysgIOEpJ/ZFaheJKT/nUy1L5XXKxdf+g7v5ymjr0ROA+DD5CcvqG1Er2\nw4Wmb77AKA7/yjyck41oYSihiL89dY0MRFIPpsOfVtVcACbw5U7vc6pJHwMB\n6pbvdDRI2Cmj4DGBlTpMtu3YxXF7TrmetJbjTupCB9fwXPXa/pd+c7jVtz6N\nMPP4liItmisKGs7uyQyfLs4OUxTfqAM5xBtYeyDeaK1IXL95bX9glyfZ60ON\nurvbv3xKQuGy/gwjBOXY/x6QOV6A8Ng7LwwdbdMOYOyC+Y2bbnopOtk0CCI3\nhQhPK8wcjtGE7YD1Mb5Ij1QucOZrKjPf4FAf5mvFsHk7iJh+rtovhLdugsfJ\n0aqSElVUvYHqiW/ULmeJNZNAFMdIuuTBvyfm91DDC8XS4NqCKrxPLvvKLj58\nW7h2ZhsTFJ+FtiXPXDq8yhCkrRhgB+xuyIy4omZeZJ9IQ+OnFcZmoZwAKgZY\nBKOudekItBnYVQXKPo5/5PfNCK5q8sXIPDOOXOlhObY0Iu/cS2aMT6RK8eQh\ny5u2h6zt73HsUHVYtRbXONO+c1cMTkbMsQ079mQ8dTpElg7IaFgcYyY4SA+2\nzK5i\r\n=ZHes\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d54898428e9659ed271892cf160a6cccaa456f22","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.120","@balena/jellyfish-logger":"^2.1.72","@balena/jellyfish-environment":"^4.1.17","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.0.6"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.224-renovate-balena-lint-6-x-d54898428e9659ed271892cf160a6cccaa456f22_1621858362935_0.8310381003081015","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.224":{"name":"@balena/jellyfish-metrics","version":"1.0.224","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.224","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6ff63d0e16b9a93d1a14a0df571cc78803b22aba","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.224.tgz","fileCount":15,"integrity":"sha512-GGNmd8herNX1pIHiZyEUGzM/8JfNjHtue7t/c/uw2f4xvSpbo99+2IDAmtF5+1ggcjpBy1qWFON37HxwUFUeTg==","signatures":[{"sig":"MEQCIG6zO3rBwMBeSFw0w5sr+RFhJWq9c1M7uwHeqmDDGHXZAiB3TFPjJTM7Xy1eq/RKEc5uFYE9rSFXYjFCupxVPPCOJw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":113981,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrD5ICRA9TVsSAnZWagAA9a8P/3aK+Qg3PKhX1Wg94HIq\nnHFBpBTbT1rGbpBFUH60fKQBSaHeTPYw1nyJdXkgBRGHMZPBJjB1OZL9RTsh\nzIaWizo5zhMKI7EMXY49Ou1FLVUda+RGgUgXJZohpxJOkFXar9/F1K4LhMnD\nds6LHwPfrBg6GMI6ri9yXWD0lVY1JvAmLixnCMI64BrYM99VQ1nOJQkhmc3+\n7c19FKAoyqaYYIflKl/B3Gl9fm5VZfAeRhM8K0wpvZDJ8PbP7dudyD6POo4m\nzQuRLRkZFaZjtwkA/8GYRDlg3sh9SBw+vzKm9JzCGr3rJ51lDkIsI/GRdmS3\nzbe+4eJwaYvd9mdn5MTdZ3BJUQpfRVllL+0apgde8DR6C0dDV5eczt0yIRCr\nJtDL3Fyhw16ThYXLqpOyi6t6HmI+EnmpmHc8rAPpxjXIzvaTpst+plcWG9ZH\nSVlgDWvK16FjbVTD2eir1Wkdfoy/UqvWXBH0OOVoPXQAtAgc94inK+rJPmpo\nNPw9VAU4CWocsbn0G4K3niUG7hjLlXaD6rzZjmq0w9Ywjcjgcbk6/Xt4EzDl\nDkYKWU3Xqb9LsTAKqmimZBloTtM8sZ7dGuv1B/tNIsRtbsHZMsN5OtmzYcjZ\njiB0XCXw7sVk6OSHsh3Kqj7ZnYOjED1PacY9PJIrSeLzaYxVbQCDKrDbbG+J\n9Be9\r\n=LoDe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8c9479da3fc15f4cf78f1e4c28fd4081d548a79c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.120","@balena/jellyfish-logger":"^2.1.72","@balena/jellyfish-environment":"^4.1.17","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.0.6"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.224_1621900872226_0.7519949532992085","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.225-renovate-internal-patch-2cc340aac151dbf3a9a4163a656858486b6e2906":{"name":"@balena/jellyfish-metrics","version":"1.0.225-renovate-internal-patch-2cc340aac151dbf3a9a4163a656858486b6e2906","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.225-renovate-internal-patch-2cc340aac151dbf3a9a4163a656858486b6e2906","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"671215a389ae3a48762ccfb6696e043b88fbcc58","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.225-renovate-internal-patch-2cc340aac151dbf3a9a4163a656858486b6e2906.tgz","fileCount":15,"integrity":"sha512-D+V/OObuy8AvK21n30nwcNKznQByt9FO3FrdzdIRFO8fuW3Xb0oypPjd1pUtqtsfb61yQy0QBfVVfAFBA+r06A==","signatures":[{"sig":"MEUCIQDgWVjXWfJ6lBSuu3WR4nBgp8pFPypXvRIMDn3/OHiD+AIgNr48YFlqSvzmxgDgDd4rddDfOUpy+G5K0KeNuFz+mtg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrEFiCRA9TVsSAnZWagAAZCgP/0XI2p/syq8H0pBXb3g+\noG/kDbZS4NcaI4FPEnUXf45fsbmrGDyMIsezb4fmcNMd6coMI8mNGNXie126\nZ03WpZow2Tw4v9Emr6zEj7syUHkbpimYiuF4yz6cgMZK85U7ehtETlnRQoF5\n4/5WRmTwAuLYFYlupDFKr6nuk6WdYAstE1C83FC6ZxXm1ej28w+viMUSj4kF\nqrkAYTwBARHnJE1FNb7ujxl4DA8q+cErCI6NvYnt2slv1yd/05ny+wTbjZzN\nE3tF61CUzUcwlmYMX6BZ9oFPAKPN56+iT+xDU3wOD+D+6/SMb8GCKHTyoArp\n4ihyqLrhFa/D+tbIYsQ6Vpt94ppEo9Aql8OydW/dJg8QlDFXcNONjxLpB5cY\nFLCmftMVHeR0wMXVVbO4nTanfjZzGjX6SFJtYgxMrEHTy/SgEiQD1drROIEY\nihvmCRkfkw4dVN8aJUDlRReKhwl3Srq+sdSs06TvOiO8ldCc8pVFpgfS5pPE\nW5i6FPkNYHJlUZJkHRNaFBiptaWw1yOMDMN1GuvYCW29xolCaVHPvnZpegxK\nsuV6ZInkTxTauAC0xt8ovfR2BaP8MQK588okFB88e+MyKErc4KZaXSN33A/0\nCVL7HWtPXMflaqB3HdPBSFWoCiUTPE/l/izWo+2oPETlLaTSyVPnhVcVo7HV\nEPCS\r\n=2TyH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2cc340aac151dbf3a9a4163a656858486b6e2906","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.121","@balena/jellyfish-logger":"^2.1.74","@balena/jellyfish-environment":"^4.1.18","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.0.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.225-renovate-internal-patch-2cc340aac151dbf3a9a4163a656858486b6e2906_1621901665931_0.32854753675030035","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.225-renovate-internal-patch-610d62b20ba332538007e69f06e96c547ef5ebce":{"name":"@balena/jellyfish-metrics","version":"1.0.225-renovate-internal-patch-610d62b20ba332538007e69f06e96c547ef5ebce","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.225-renovate-internal-patch-610d62b20ba332538007e69f06e96c547ef5ebce","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3c9cdf138bc03320a2e9a1f8f53c0229dcb9aaeb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.225-renovate-internal-patch-610d62b20ba332538007e69f06e96c547ef5ebce.tgz","fileCount":15,"integrity":"sha512-EN0p9KC2rZCNhMOlmuyF2ffqLLNVibo8Ke/t5tGI7AWK0C1t7NsK9vgzrha9O2ir3nx2murJa805RWwyG+hueA==","signatures":[{"sig":"MEUCIQCzSJ6Tfe2AFRuAUnFI82EdyEcgHaZFjVpsn9emldQn4AIgXEHfuXbY+PhMUNVSZ3ul8668E5vomqNWTb9stvxzNJg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrEPzCRA9TVsSAnZWagAAK0oP/Rbt/0fN70M8JkWKAcCd\nBkSDt96RgdwfasJjxTtwcpEZl4bVRL1NH/Xa2K+2QFz+3x/xok2YqGObzi+A\nNjz5I1FZHC8r7JOSGjtxIIk5fRRbhIJT/dlWCQipnhC8U33Ua5OpOxInNeoB\nqWWXeI8DM5ijQXSKq6m8EVwDLftQXMfxIxbKrud2qZcFGNln6nIFKz5UTRzB\nqjalYxYInbMKg2b0Y8uJRvP9Nvc8Xg9WwEwOeI0uat0jVCZLBS9xDnmQCAWg\nt/RucB8CS5K3cyPlON6fjgPQn8zuegbEHQjMo+BsqXtvU9wADebj/oLA3fqi\ngM33WQgmeCmIAE6sNT5f4zrtYhF32boACRJPJjtFeJGwjdx8oku02HBQxPE6\nnnxPcvpyYZK2UShn/ql3wdILlhWzMXt/AZZfvxV1Y1NvI8BMpbEw5enTfIbU\nyzy7EvsxAHV2izQOL0yBIYjtp3VacHZQlCeQWMDFhTw8Ly6j+rZIWkBHhU4Y\nZv20uraAHOKd7hRaiMKFaGmPZiWHJTLAXTSXo2scySGkqrPAMs/2rMjtVFq1\nMIj5Sabn5GCRIPzdlOne9DVycDSFP+IZobnBq5EU2hjUooVraIyvvWRWRW9y\nu/lO8MPO6DgR7rPkN1MVO1Q/HxsRwC8ALEYUgoIv9mzegFPQJMJZXHtesI+X\neNRK\r\n=PkSX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"610d62b20ba332538007e69f06e96c547ef5ebce","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.122","@balena/jellyfish-logger":"^2.1.74","@balena/jellyfish-environment":"^4.1.18","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.0.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.225-renovate-internal-patch-610d62b20ba332538007e69f06e96c547ef5ebce_1621902322719_0.8900165789800192","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.225":{"name":"@balena/jellyfish-metrics","version":"1.0.225","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.225","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"12d6d3e89d5cee4c423eb5aff792c5d00002b147","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.225.tgz","fileCount":15,"integrity":"sha512-LCu5jpJUQxz/yatXhQgnPyajBtjcTJMDFyGPXHNLbs0zJMeAQdRi4zKWgThZXcJpNeMPpzoPYF1ixcRfqu5TaA==","signatures":[{"sig":"MEUCIQCApxTaKVEprdvarm9GSxDDCrMvhw3AH4oIucy0yCGI9gIgN5T8Cmn0JtMOttEoJUYEHEaNSTln/LWo6XK6KFQATLU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114053,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrEdlCRA9TVsSAnZWagAAtWAP/iSvL68MpqRo4rnmn7Fg\nSCFDIfD0bfYYZRrJBrUpovs0AeU2tzRopHVvpvkXh9LZP6OY1dCV7blI8mTo\nM0xyuppIEd1yCQisrA7lpk5TRucmDJqU6WRXHMWXrLr1d3lxLTulnY8TUJS5\nNDnDA14W/ckkQdMPXCXHBQ6f5JBvsq48i8fGniUquEgH7ymssAyex18tlzM0\nKFJhHO2i7waiHYvmyw83+BCRn6cbKzRn0hCfnFPLOLFbC0/iKPYTOLhXIjHX\nUySb8WY0rhPs8HlsyxeQsp2AVSvaXKUP3VPzlAV+GpWh2pmJ7obQ/yOmKghf\n9tQX2dG6om86jJU9ms5smVlvjyvuJsnjsGUdhRlTI8TjBPP1v6ueNHyGiVCI\nHxx3oLVQ9kQNB9uEMg5GJthsYi5gMK+NL1WZoGcYyXADo7BPkhVVH+m+dRsI\ns8j56GQfnk7R0ygbWJbx4IPDpFPl+4dJ5psiRwpAJ2mq41Kfih1Ul+OGcY97\nrlktPMJkIX4C0YbJtuhnIte5ADWnsnXgg27YW86JQGPeOaENyEymGWX3NEAw\nS+s2rxteuuo5+OyRMToAd009bm7IsJUcUCsaP63J8tT5iowlctofJlMmwShG\nWfqTqE/D8z53kaP9kWf2iSnL7r0t5/RYkZMkQ/tNjJ69Jir+asNwiBFyYA9x\nEKjK\r\n=/5MR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6f842e096ad146a0be2b2a9faa0658694eb9c8ed","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.122","@balena/jellyfish-logger":"^2.1.74","@balena/jellyfish-environment":"^4.1.18","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.0.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.225_1621903205050_0.5121082894239684","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.225-renovate-internal-patch-0fa1975f8e824040b5ecc2f9af3346e22fbb817e":{"name":"@balena/jellyfish-metrics","version":"1.0.225-renovate-internal-patch-0fa1975f8e824040b5ecc2f9af3346e22fbb817e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.225-renovate-internal-patch-0fa1975f8e824040b5ecc2f9af3346e22fbb817e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e94ec6de037e2902fda3b3f862a66de48fa3536b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.225-renovate-internal-patch-0fa1975f8e824040b5ecc2f9af3346e22fbb817e.tgz","fileCount":15,"integrity":"sha512-836jpmO+xddaurLiJYuRkTVTUnoTKp9TCuKC1B4h6zZ803wvhuSEmEMR3e0g7gpaVtMG+6Bnntv8cHANUxGJbw==","signatures":[{"sig":"MEYCIQD/v+HcKThAqHe5FynZWbmIWkGlqllWH8adhikEUp3KTgIhAPE16fBsoSimw9WFCaxKYsMZkZIhyP5SqZQAy25GFoen","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114164,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrEkPCRA9TVsSAnZWagAA8tYP/itjBTT10kjNGGPY7e1d\nGeve8FtrFq7EZRFF+WgKtH8EPUZELT4q8nUYpwLU4+z/lC7G7vlgmN8AXFYR\nKtBeGzG/ktuznxczEq8adLClfIXvOHirih5jWPjkneB1jN1HtWTLNzhdibs2\ncg0ogJoqo7cM2iQyxFXG+fvFQy+5fiblHHj444rrUspOy2YQac6gipl0kTa5\nbA6E4+QDi+Ba2NNq/UkAir6WbFDUjG49FU7g50OzLpfJpjRBqSBQx2xtbf/W\nHar3RUp20KdTrF8lFwuB2Fc0K11U59UjAssOsDpfTth21T8xgBjdBlo3WyBn\nnGhajROlHnlCJI35Bhf0Y8OWlms9rBw7Y7wuzb10w0pYYauj9Kvncm6O4BSA\n2PaJ3qN51XaPHGuLTxhsbkBF7IXOpioeKv1WFkfwdcZlpv9W57f1hgfrto8k\n7bzDWdJYAzokNT0tvYvHUcNlHaOnpO9z7oaBwhtG3HsFRUp7gWLqbf3sWT2h\ninA9XZhZU93QsxaiGLFGCvJ7AJfyPVtVKVgh9XiJxdUR+SA4DnlSQY8SXhr4\nK9aonq2uX2REoUYVkO9Cxyn+G7Xl2w7zURMbDvC+RmRWZFIYlLE9ivgl2iG2\nVBpKpZl6xD8jVL/rSQPDs5k8P8fTKp2ZcyU2m7RUjC18o3WrUi2TSMgxT+e6\nk2rx\r\n=Tamt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0fa1975f8e824040b5ecc2f9af3346e22fbb817e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.122","@balena/jellyfish-logger":"^2.1.75","@balena/jellyfish-environment":"^4.1.19","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.0.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.225-renovate-internal-patch-0fa1975f8e824040b5ecc2f9af3346e22fbb817e_1621903630810_0.166170206270553","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.226-renovate-internal-patch-73457f181ba4dc067eecf04bf02f728091c9b684":{"name":"@balena/jellyfish-metrics","version":"1.0.226-renovate-internal-patch-73457f181ba4dc067eecf04bf02f728091c9b684","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.226-renovate-internal-patch-73457f181ba4dc067eecf04bf02f728091c9b684","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c7c1a724e0dcdb4ff105490a95e5ffb5a9489d49","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.226-renovate-internal-patch-73457f181ba4dc067eecf04bf02f728091c9b684.tgz","fileCount":15,"integrity":"sha512-LOVr/4PenUNmVcql96sIYP/eyEyx5xXirNgewI6LxJLoELf5i6JBr47iTqZfo7Zxe10dGltnGg53yFFhm7Jo+Q==","signatures":[{"sig":"MEYCIQCFKiCpHxHCn35FUpI+z0fLP34WXVuZJXDmcl2yxX4/jQIhAKW/3TC+2YzD6ftf/d32Tu6CLOQ73iLQFX6XPhc5yhns","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114190,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrEu1CRA9TVsSAnZWagAATyIP/Ah6wj1RhRx/rL6kRE9k\noIX9SZFAk0mdlr4K+qOKgpQBz5ka5aMzpC/dSTIDpJT0UjP4pzAuRw8Rgn+g\ncGLJElfIfBDis+Ono/mnvGG3ioijYzCu2seVSBsYKjl/b4EX+mSm8wF3t64Y\n68nXB+NkjlSVp6hj+oZIAB7rTKHFH1hmFBTLxVyd/xn9HPnpJyRTSKz6TuEn\nmkb50RtP6lrT0UcW45g53lP9YhMv6ijBYTQpKXm90KMQnUTDp4sdQIKrzUxG\nVylrV0ltObs2RFz81fWJjL6j9jdAESOB6g4WrFDofxojoqfPJrO41sysVhPi\ngv3lyK1IQpnvH67LvFpwSjBZo7LzMoCQNkGK80m+mYewNmU3TRHUAYr8yG7S\nLbiRUbyZ8oFbDivdPaX4YGt+vmW34vRzU6OxwhgEldY3Fwg7mUFCHXiEwyar\n1K6vDdtSGM2dXsCCVVe3rnH0/8C50hj9Xk3XjM9jR4fbkjOAYRp2cvhN9RBu\nk9zzsVHMSJ1WpTffA3CbhaWfc6b6akLXCC/uJsZSygWKIi+t5CoqlNrfPQxO\nVKuKO16r01JnnNgc2EuyODH6LoHp7vhs7Zw+HkGtMrRMuETP6Beyb6NBa3w4\nw1p7mpQTghXpL0hDcyd4x08B3YOQ0NFmzGsifEEeMFKunM0woFXFb+U63L8Q\nVeyf\r\n=xhs/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"73457f181ba4dc067eecf04bf02f728091c9b684","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.122","@balena/jellyfish-logger":"^2.1.75","@balena/jellyfish-environment":"^4.1.19","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.0.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.226-renovate-internal-patch-73457f181ba4dc067eecf04bf02f728091c9b684_1621904309439_0.6360925528820156","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.226-renovate-internal-patch-56cd13a005397eba0dd79a93f2a25a9c12d9159f":{"name":"@balena/jellyfish-metrics","version":"1.0.226-renovate-internal-patch-56cd13a005397eba0dd79a93f2a25a9c12d9159f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.226-renovate-internal-patch-56cd13a005397eba0dd79a93f2a25a9c12d9159f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a53fca217a2f0178e8f968583ddf40cd567cf807","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.226-renovate-internal-patch-56cd13a005397eba0dd79a93f2a25a9c12d9159f.tgz","fileCount":15,"integrity":"sha512-ehggNeeFeKmIgwKhNIiZ8XD+um45fKb7HuI71W11BL5L1gIUJH/EIzsCO36UJjTySyIfu8b9Kc0pR6UDqH8VaQ==","signatures":[{"sig":"MEUCIFuAH9GgbKoAobn8XEs6HRytHb9Eqh6tTUfnAGyHE/lZAiEAgGr/dTXcw1aOwSY+EQk8+E0bpGZAPaaNuO/as/A0A/Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114190,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrE6PCRA9TVsSAnZWagAA58EP/2+2UiJSa/mQUAIj1m5d\nNnPG24AkYyuyYKBaFJ3XTLcYDmYV++Wx+63Uv5Qu0Ms98TCiK5O4XZDoktWF\nJwccqebIYXXkWGoA57x4onafMsAMbc9P0LuP6V7f3KF0JuC0oaDYWy+5Fjq2\nWKZXNsy51Hgb1Cko32tA61cjF3QmaOw98P8xOelk+i7Qqc8FdhEZrpwLEH+4\nMRBnOZQG6gQNn++VAK7uJVt/WU4aUrWSVpkknJUDh9i6ucYb2DTFUIMN1Fvh\nGcrjJdNtYoP0XJoAxXVNCepZBdQk21LEf7K+UXNWTc529BPAeT1Jzwvuj+uW\nvupmEQMtxKsYdVj7OCB30N7KUy90bjLdjPZT1/rNmJeSoNGknyPlAHwH8h1r\nmTF80/yzJ1xToty+pSLXJM+tSBsQGfl+6nrBQLkNeDZwn/5tSTSqJXcnRI+F\nJrbpapeWnm2nInoPXvt73rQ3rQByOB/kb0EeUTEjTGluNHkzATfDAWHjaIuf\n4OXg31oMI5ycbLooe+YmaAUQA0zKRv5pBUQa/d6Z5pbg03gm4YHuZOMNh9jr\nWxW+6z7jIv8x+HYjpv/NRs+bWDysx0y9HUMJ9/Pq3u77EWw2i9jm2jijbbMg\nCh8qOdX/TnemGsui+SzbxqWkzfKYoPUX7gVSWma/fMzJXV2xoPOYoMf0ciBn\nYfZY\r\n=xzGY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"56cd13a005397eba0dd79a93f2a25a9c12d9159f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.124","@balena/jellyfish-logger":"^2.1.76","@balena/jellyfish-environment":"^4.1.19","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.0.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.226-renovate-internal-patch-56cd13a005397eba0dd79a93f2a25a9c12d9159f_1621905039215_0.07039963990347964","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.226":{"name":"@balena/jellyfish-metrics","version":"1.0.226","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.226","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"583172baac100dd31c719593126145219a875396","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.226.tgz","fileCount":15,"integrity":"sha512-1kckWUb6sjwsNE7Nf7z7tABsm2tWC3FS+vB8fL/KZtFDCogSRUlvG2gkpAa+s/WVQMkh9zekWhr2KPpylGj4lw==","signatures":[{"sig":"MEUCIEDEJQXsSpjHHWd40gv1TlcRuUOWsFn+YHr932kCuCNjAiEAteCwCwITKERoLRWe7ux37qanxT6ZuG/5RufzBPqqcuI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114125,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrE9mCRA9TVsSAnZWagAAl/wP/3IPa5qXdc1+Z9siXn7R\nLzI6WFHCWwIqsYlOVWc0cxW8DcpoJiVpXzFCVXyWkiqeECdDA5zCxvfIyKFK\nvgSHQe2gbwF4wVEY+E9HfvBMi9w5AnxyTjnHRlcHaePhb4tqr1W/6m71rkJn\nD31nBo5csav8OkbhXgFeVEAon65idDyq0txFKK2WRPpDyMZhwYBv6vB30zVs\nFeG5MP89NCq5ciJukTNISgi0w0JhJlze5oTUBGYreVDqSTf8yTJOwNfhMQD7\nqbCQsbUwbvAevAP7G+tS2dbhfDWnOxQ4D4Cruhoye3qDr5/34sEV0Y+mXYPT\nBtE84t+hypyTmQcusUUP96GY1Del6zLMEqkQc1hnM7sKl3isFZDIakM8QzJx\nWXlWkeh+P19Kr80nIIxOdsIM9TnYq7i+Tljk7B3DT1j/wUgzTrFQem3wtL9T\nGuP8Iwqboiyyt/2zNYDo4990Vrf7Jgkf1aDdDIExjnszKL+b+xobpJWo2BTv\nSqj5CHU0/jCqK42eLai8BjXcDIB+s0wIhnLbvXYu1T1y7+FF0maRR0ins9td\ne7kODbNF4kio32iohG3Phwyw8gFJLrc/ZVbpZXVfg/nQ4z38Bwh77OKp6PAK\nBI3p33kswRmgBBkWAyV8fa1GqFX74IeqJKuuM0s5SN4R6AYZ+64MlntiMfnk\nZJe4\r\n=yoZ4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8f8fa375f3457ad28c30fa66e152d1cbfa0e0c4d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.124","@balena/jellyfish-logger":"^2.1.76","@balena/jellyfish-environment":"^4.1.19","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.0.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.226_1621905253904_0.9061931812771524","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.227-dependabot-npm-and-yarn-browserslist-4-16-6-37944959732f231633712fb22736798133cb2842":{"name":"@balena/jellyfish-metrics","version":"1.0.227-dependabot-npm-and-yarn-browserslist-4-16-6-37944959732f231633712fb22736798133cb2842","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.227-dependabot-npm-and-yarn-browserslist-4-16-6-37944959732f231633712fb22736798133cb2842","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"797d5c230bb0a50afb071ea381daf9dced0db5ed","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.227-dependabot-npm-and-yarn-browserslist-4-16-6-37944959732f231633712fb22736798133cb2842.tgz","fileCount":15,"integrity":"sha512-d/dXzTYhTtipwFbNXvoTCQmR0iOZLNZF/jD8qAnA2NLnSyE8qzhns1h4BqJtoBprFRrXR0xuPYfhTD0SzKD69w==","signatures":[{"sig":"MEUCIEo1XrR6lUC+GTC0naQt+QOlFWif5eMCjadLe0jWfLoCAiEA7D/GCp7aICFLAc/RrlokUwV6BXVVvd/2TIcUm0zISIY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114309,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrFBoCRA9TVsSAnZWagAABFgQAIxPsHekO77H6VceUPOU\n06HI+ImOx5MnMYZzr2WQUZ9t/JSbdj/udx/rSyP0fH/vPACg1lGCtBN+QxSb\nf8ZGfuT9zwaRAvwWa1JzcHHCeFGerJcYtY0ewR9vvQSwO+FoM1BuynOd3sfD\niver84s29S1eI+PE8YdT1kFolgmz66QJUagqqTIzS8xCB3L8fUOyB0qcHiSQ\nMVUFHwOrtAjrmAS3BpLY5gWfYpB+0Voi5H1OgODpS1Gav9+OKsFyD3YsMM5h\n6R6X0VJtnYikJ0remUELTviGtVyXt2SHChAw//ge8yE8uV16+fEDKi6Y2lrA\nr/nb69YcfFIA6rmo/q8j7piDZvyzeRUatf/t2llrBc58X7IEJ4H4Q5JUV7YL\nwph+KPYkFeZ4Okz3JYAQzaqDOb/JYgnYyY7xxT98YRlhu32DfWhQzoU0MbHn\nI3GTwb/RDj4QMi5YYtWz3FyVq5M81tkEH3LMQ/0giuvBQTH+BEBVq2GEqDtL\nnEdGAsCnR+f2b2lTfeWNlvbNg33m3HnXR3iuvMVGOfAMjZkLRP7Mlas6PBtR\n0pEsxvktkyMYiZpz/Y1ONnoV6ToXWzXZ0pixrqiRllxwjuB9Oc1QsbrBWAb/\nw5k4vZYXWgLdLKFrGFTD4VXEXWTt3pZaAztylgE0bRfhAZKRb0JPKoR0GpVp\nuX7j\r\n=Samc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"37944959732f231633712fb22736798133cb2842","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.124","@balena/jellyfish-logger":"^2.1.76","@balena/jellyfish-environment":"^4.1.19","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.0.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.227-dependabot-npm-and-yarn-browserslist-4-16-6-37944959732f231633712fb22736798133cb2842_1621905511508_0.20734576175312602","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.227":{"name":"@balena/jellyfish-metrics","version":"1.0.227","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.227","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ace0d2f743aba5b3ac540961d2e956068afb3281","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.227.tgz","fileCount":15,"integrity":"sha512-saAbp5gMUp0S1ZIGsmXmUIvPTAf4ANWHA6REy7Xp1HWsk6RUMCDNA2nFuo059OXSBX5GRr2LTc2S6T+W53S16Q==","signatures":[{"sig":"MEYCIQCnNf8LRk9KsJ7CAX2/zOfRzTF85eff9BzHxVAu+GyT4QIhAJaa2rKxAcnuzurXgM6yKw2R7nwh0G/YZcWLj8VgKv90","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114224,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrFGUCRA9TVsSAnZWagAAy40QAIsvbiraSemoxlzik2n8\nzPNUbsr2X1E/aVq96mT9zhR11sSAZQoRuGZSw/ExcH7nWUlY51EwMp/MhySf\nJbFyPOFhPlOPd+rrbf7CBeBxLClD7opWQCoEhHoGTijNA+RFZhEaqGeB00uk\nHtVeo5UWdZBiCq2+ARag/HAWHLHBTA4n1B8hOiWPk5n1Sk37D+OI0YR+67qv\nHFKw2Q78PJAHAiqy6pcma8CYLXl1B+mixlXYmxWhogTVTjRxEA5+QKLdpdWT\nX/greCpqqmwKpfZ6A2tNTBHI2Z3yZQlZpj6O3SsA4/jovPoaRX6hCg1585oN\ncWni7Tq/PSD4HgEiYC3oo4CToPAobZoAOEBkeyib3jMLPgLqzgVSMtawA/O0\nSNnLcWYjpL0IW1kceqSseL0Wq3seHKrzdbog+mokYEB+0XTsRmdwFdVhrt7I\nR2mTjgCxpx1a7DBDlbgwPeqe8NUIR6a9QjZY/LLDq0pLmEy0F4iOteRyqD+1\nvyc85KaROSjqeJRRArjqqoTheTWOUAlz6dhzEpZliRAK8FHy95YELeKpTt/g\nVmMdOXiCUYw2h6EfdVK7FI4pEPtyUt2FXiy7SHP8myg8E1Zu12ZgwLLhmYR8\n1rjt/mIiByDDxVQ1rsOgArA1gxtlXksStgw8JUXlm3vaCWHEK/tj/9p4IIft\nMLdh\r\n=CmKk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"73163aa6497504464b2783f9676a3189da893ddd","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.124","@balena/jellyfish-logger":"^2.1.76","@balena/jellyfish-environment":"^4.1.19","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.0.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.227_1621905811696_0.3368037623318665","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.228-renovate-internal-patch-77e9f924dad0851890a74032ff0972c7136fab91":{"name":"@balena/jellyfish-metrics","version":"1.0.228-renovate-internal-patch-77e9f924dad0851890a74032ff0972c7136fab91","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.228-renovate-internal-patch-77e9f924dad0851890a74032ff0972c7136fab91","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"95e775f7dc43726bd7e62bf245a182f1a6ada528","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.228-renovate-internal-patch-77e9f924dad0851890a74032ff0972c7136fab91.tgz","fileCount":15,"integrity":"sha512-peV/8riVq7m0OHj6pmJwOKI0cIf8wrM/O+VntKMDc4xMVlisieLRNCEuK5DH8Q0jk58HZb1SgOiJI7lAWqK9hw==","signatures":[{"sig":"MEUCICmv50i3c9wuONUlsItpZv+sa46mXspEsTf/vfulc6iuAiEA8wPQzFbPv3/iGMynSRB4nWDe+CXQS5mCjfYRK8M7OTM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114361,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrH5jCRA9TVsSAnZWagAAZL0P/2EBuk33t7++rif6vhg/\no6o7eXl16twPxp4juczC8xiFxXhmNWoSDIhMD0IsZdFUz6AfXb8n5DaQukEm\nKs/BwPk7tIPj11KXAko5K1xiRvZ/+mePYZcT+M0l7/2GNrWZ2B/YqDrfI3zX\nkKcrq9qXNgjYS+/QMQUv8qZSxfuMrt4ZJCGg2AZIWfBEmuIMpdu/nJQgRuKn\n40cWc4FOBJ+afIs+xtbgbNuqKUhrG06KMHDZDPcmOSokptgqq+bFeTOBpZVt\nu+hft/4A00HKyId8whAZ9ZDxlIcB1Gobjv8ylu86ApCaPmbwF9bs7h1ey79k\nha2Yikb06Ysaknu/izVnArfAt4kpbh8GYz8oTvaohp+gfAl75gYqL05uq26x\n0AaOjqcZEn3+9uZMUd/5vrtvj7aPP8QJXXLtCz3+RiP+X4xv4IIylsxa6CJV\nBSCLj+Jo5Mcj1cNUCGoTwLvNan1iaeqeyA9U94v4AB2xrXeIoI9QaJaX0IXW\nyWRWPs6wR9YZB2Qt9UwvrhBYeJTXjBDWNK7sLri7CIfcV9+S+3ZPH55bXGN9\nl+ofRSzN331QuvsqmkC6U+Tuxx0YZywqK2ctHiTRUOTduH7LP2fjYhdZj/8h\n4l6pAe2zpV8iOE/HzcP+iZoItfONWIMVjoe6RWjlbn7HlPUAQDBSDcHVs96x\nqJwg\r\n=9qSe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"77e9f924dad0851890a74032ff0972c7136fab91","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.124","@balena/jellyfish-logger":"^2.1.78","@balena/jellyfish-environment":"^4.1.20","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.0.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.228-renovate-internal-patch-77e9f924dad0851890a74032ff0972c7136fab91_1621917283366_0.37467705698467824","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.228":{"name":"@balena/jellyfish-metrics","version":"1.0.228","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.228","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"58c01e9ffca8aee3e23eb834fc6077c5b4149ac8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.228.tgz","fileCount":15,"integrity":"sha512-b/Ni4laiEy62Rrur9Smyy22fC/LsCipjZc6DMFGmSD4P0X8R9CVIhhX+x7Gctn77f8yfqcADuaAV750WOE0HoA==","signatures":[{"sig":"MEUCIBbWk17N0IdlG1Zp0I7VwYzMty43mOBV9U1PaN31UtHHAiEA5zmgY/pI6XWqdUKIbwUMO4an1tFMYNd5rA9xHg6UFwo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114296,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrI4VCRA9TVsSAnZWagAA6JIP/iralrzEYRp+3V9Q9itJ\nk3uSzyNo5mbuoLQ3dQsuk4Ze911GeOGIAxGCyksVqjUznmxCVBJ8nGYEiLza\nM2sGBIjvu7kmCu7IbLP4eCsDizh0WVXpN6BR0eaBVgM6xYUVZ6wy4D8tx2FQ\npQynn1Py2A6kxLcrlGp45sDT3GDBjanFTSlY3/YzeNf5ydhUEcqQa6q6iujJ\nMJXDs8g293eGuJJSkpwCile7zEGXKVL8L41xm9G8U79die+alugwJKGJmCd4\n5SLPcetFSD3cX7fKoq3vDktUuCj3TJDR7b1eW4OImLS/qRz16ffE6OTBJsBA\nsMjdmxhwkimQr5VdTWG8KqMATQGKBCUum+NprXXJgZvt1oRbuRrADpZJ31B9\nwsy1ZoNBptuMR1wrg4MRYWnxF0OoZsWe+DPIkFlHJKXA2KNQlEnq1DOp5q46\nOm2IDgQ9+vcYD1PrUxarR7HDx/20RfddeDk5bABCYAMIhb5DA23vHaEMxQil\nujEdK4WYMsNiDe0oORTES/jPEqpkRfzIFihYVpPnByU9gmzS2AufCDwVB6Sw\nL/X9bhsFq/MjsG+tS23nFotxj1W0iyAlTtvzVdP/ccwtz0dLFkPEEljnmAVX\nFpKU92B0QGRmmREJC1Nw/4Tn5OHUw9/3e5ejGEABhKtdMXZD/4c4gAjAjYcf\njvmJ\r\n=s0Pj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"dfc8d2ecfd606cf846bd49d3a1eb30bd8219ca14","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.124","@balena/jellyfish-logger":"^2.1.78","@balena/jellyfish-environment":"^4.1.20","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.0.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.228_1621921300569_0.5501966213025775","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.229-renovate-internal-patch-054b8ef869b0634a90576ddd1dd3128982f07c98":{"name":"@balena/jellyfish-metrics","version":"1.0.229-renovate-internal-patch-054b8ef869b0634a90576ddd1dd3128982f07c98","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.229-renovate-internal-patch-054b8ef869b0634a90576ddd1dd3128982f07c98","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1c5abdfb356555b467e486819295d18c5c2b11e0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.229-renovate-internal-patch-054b8ef869b0634a90576ddd1dd3128982f07c98.tgz","fileCount":15,"integrity":"sha512-/dQQ3eZZKlz80vzCAWrQ9SpWD1hwcI+Ebaf+DXGsjrDUrXWxgDYz6iAHGIIn32H8afQ/ronOOxCcD65vWiagIA==","signatures":[{"sig":"MEQCIAugTo7h/YYU0Pam/mPZK3vdx+rsTfixs22w+Le1l6j1AiAh3HcLbKXjjfqmzqx/oZ4P9DaD/BjWw9+kAcc9hNincA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114465,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrbHxCRA9TVsSAnZWagAAKIAP/3Z1KgVBbrcYsyPXEmdi\nyT91oRsVro5P9J6qYI5H3atnbVTkYrMMvNq+QxN/eF5jLEOalTBij8al/IGN\nah4CrVvYyMRT6XEX8cl9pohbxA0GS2VT6naIq0VZXf9ZIHAyu5ghiacEclr+\nYY82xkqTXlJM+eB+bm73MMzKSaHcv7AcMRCtO/ERpFBVe57BDVr75du83UeT\nidZFTShvh+Gvj3qyMLvHa0icwMyuygp7Uqpc1jJBF+wGn3WN6kPpz0wcV9L7\nBq9omfCyKF0fSDeqA084KkODNPcmEjMXi220ba9MadCCmujyM/kJ0O2tSmQP\n8BuawoCSsNW0qPeAiV/JckiPoIVcEhf3Zv26Hr0dTyzJh2Agm8vm2VfyKJX/\nwld+Pl9hpZzfVGXI8Pfg9+vu2kCIf/bamklcFoHT6r9DyHSvODQHcZjlG7NM\no27Q6b9CNFdVsJ6DwZYsuxJI+fJE/Tl0YX5iW9Zj9n/ON6LAUU+k4qiMAd8q\n+cLc5RjzDtADLYz5m+GDZ7JPtPAa+L/PCom7WFuXK06tXTdI+tqchyf2CJfA\n3ypPmSXxDbuAUdg8L7hjfY9XJFNBMrvKW3RxxcXdHb92coSw6ZCxFLIGgEgt\nGcekXJsAzEgFTkDSCWSij59YcVCoep0bWLOSzW92n06Ee6juj5NkRwbBBW4i\neRyy\r\n=zc8x\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"054b8ef869b0634a90576ddd1dd3128982f07c98","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.124","@balena/jellyfish-logger":"^2.1.79","@balena/jellyfish-environment":"^4.1.20","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.0.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.229-renovate-internal-patch-054b8ef869b0634a90576ddd1dd3128982f07c98_1621996016647_0.19641221958664512","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.229":{"name":"@balena/jellyfish-metrics","version":"1.0.229","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.229","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"74b1de8827477efd810764a9bf29e94e9437f166","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.229.tgz","fileCount":15,"integrity":"sha512-Gls9D9Eu0rb8K2X6gEhrIUnrWjlCiLW/7jZiRqVacEztoCs/WRJrtptlf3j2aJ25KIwkKGJQoZyDR9d5uQ9AvQ==","signatures":[{"sig":"MEQCIGeB7PaIZIQCivnNSGfm89OUQE9yeTCKOEkEasZJB7RwAiBU1op/3L6UnoNHF+Js3A2p+tYcA6HFz05DHawa1PCmUg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114400,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrbLHCRA9TVsSAnZWagAA4sUP/06EAAQHimwHR3M5mTut\ngzdvMZS6cKfRQ+rryyCukGdR7Lir/N3cQJSryTgcmJGjh/jANeA9JIOvM/0u\nbnlSulaOwaHMvJGveFjRSzgD23etkmR9+usBICdi1EryJVYethBEVVUf3Epd\nqwB/z2dKF9pQ1BZ7pWyvYxayJFME29JVZ2n8cilUupwW9GOoq0g6w0IXqXy3\nrZcrY/czEnw1JzKb993UF+iJElbft6tbboIFAOAs4DjaVGlkEfGOMnazHSir\n4rj1hw8EC1+rqA/VN9xt9Bm8xLlqJ+57nrQnblOY1HNbCNw3KWn/LuqNDLRt\nPtivDfGfqmF/aQnAi4xkeb0T4e0XwkPHN6mO+g5Rpy1P1HNNuoQXBIuhLugr\nZV3UJjA/5qVBKipK3+fAZ3sQnzN9al9N/geozqWLeVS9enjQWL/BdU+az8RB\nrQX1u96BvJAV3cB5EhgMz3NVhb6dEuYdJxW0rrNmTnefp1vcUqi7ClvBm/Zc\naQ+g8Vyt9JQD0YAyp9AMCF/S6wa0KcRNlX9WEnr2Eii3T3ZNdTCSzj0yBz5O\nR1f7qNK+EPj2UIBlbiGnYEKWtfZ8UyAoqaVLi0CQnbXQGiqYIV8tpWPpDKst\nbhkAdH4N8srXf/4MSUd5gAr3xFiEqGJowE6p0IwT1L0AmYcHIqQBOK5JB6AV\nOa7W\r\n=KF1G\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"cc604dc5e59bf7c34cdb58d373dfed9eeccefd7b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.124","@balena/jellyfish-logger":"^2.1.79","@balena/jellyfish-environment":"^4.1.20","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.0.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.229_1621996231057_0.3231898847467569","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.230-renovate-balena-jellyfish-config-1-x-2969135983f80161ef48d186f8511df388d7724b":{"name":"@balena/jellyfish-metrics","version":"1.0.230-renovate-balena-jellyfish-config-1-x-2969135983f80161ef48d186f8511df388d7724b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.230-renovate-balena-jellyfish-config-1-x-2969135983f80161ef48d186f8511df388d7724b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fa3a75ae33e68fa8fcc8c048e68079b3e6ed79a6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.230-renovate-balena-jellyfish-config-1-x-2969135983f80161ef48d186f8511df388d7724b.tgz","fileCount":15,"integrity":"sha512-zXIHFMe8VH7FMjLLOW6VKk5UNZ3qC2KMBCGsu7qoPtL6kl58iywtKZgFFdBodSPD4TvTQ1oGX4JvDCzaMmLvwQ==","signatures":[{"sig":"MEUCIBxefl1a36MD6cAgi4Lr7vAQsYYhR5WOhuM09De1rm+2AiEAtaK9C794poByTxkOZuuqfsif8ShJDxnsEy3E1hxMRlw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114581,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgriKECRA9TVsSAnZWagAASk0QAIxEjtBXx4ZrlAfvSJP8\nMXiCrRBTfyApXVNyi8dnlhK2pnFND2Z1KgBbHMEuKeIZtBNzSa5S2DOe77fe\nQQCRT1MULxfyPA/4M3v6tqhJknE0YZY/OIlSNPIXbc/joE2zBg0STkwiJ97J\nDgDcco6GVR+TrrbsmZFNUJSXwcgaF7b0xSEztYsXJeJow9OounpGG/SDsdKh\ngYh3hVQ8TB9kJXcP0DfUicJkk12fdS3/tu2fJ7NqdFAPdHV1LVNt9/3+1Gtz\nXmM/hVRukTqVXKTjPV7t066YWg9GmuSgh3ZsmYvMaqpIkJ+B3OhXSm+l0UXA\nR+MR2nuv9zjVjya/vATeXOfMrn295n4/GXJzHQIzOMF0PVxGf0Rr53upPOrm\nr/3SVn6sLhiXq7dTy55WDQGc5S6lpEar+WhpahdwEKAKn2gXdDyoseEzecOL\n/9ZpKWhnvAoo+x6kC4BBk+mIDJhR54skVkpzsORtKfCGucKQC3EfrekJhJdd\nqwVSnNjdsg9Iqzt1DedtPAjm2CMWxwzDNIpz32+0MjbH9/Qxg98lUVJ0JWiT\n+Avx0jVHDAOJt8HINLb4hPsnl0UcNLgzO7EOGsNa2JsDym6xr0LO5Mxlz9ya\noCooZcfhaEc5bwYJzXE8phn8cZps0cJfXjAbqXJXqETWsjsZzKq9y0jFqiVX\nqJOn\r\n=nlX8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2969135983f80161ef48d186f8511df388d7724b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.124","@balena/jellyfish-logger":"^2.1.79","@balena/jellyfish-environment":"^4.1.20","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.230-renovate-balena-jellyfish-config-1-x-2969135983f80161ef48d186f8511df388d7724b_1622024836087_0.9389014011168852","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.230-repo-sync-jellyfish-config-default-e7ff8633333f3f2c74cef5d8bc7f1090d511437a":{"name":"@balena/jellyfish-metrics","version":"1.0.230-repo-sync-jellyfish-config-default-e7ff8633333f3f2c74cef5d8bc7f1090d511437a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.230-repo-sync-jellyfish-config-default-e7ff8633333f3f2c74cef5d8bc7f1090d511437a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"912f17698719d98a0e9dff3d721122ea11301388","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.230-repo-sync-jellyfish-config-default-e7ff8633333f3f2c74cef5d8bc7f1090d511437a.tgz","fileCount":15,"integrity":"sha512-oCKTLKZt89bYDh580omXsAwIdYD0oW9yaF5ySvBzmCO5QQdbkrFJN8q0ff/mJ9WmrCEbadJULrwNucN0r0Xpaw==","signatures":[{"sig":"MEUCIQDibYHfQhUKfWphyxBhxHUfv57537fXX8O7h3vFWIiIQQIgSju8lHjxmLHUck4Oso8ywLWYL7xvdrh3Q+oLSmQ4Vw0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114573,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrvNWCRA9TVsSAnZWagAA1CwP/3kyetWDBWTKDBV41DOk\nIoaQfEixVJohcLAnAbfvJjtiTk66ndkLQ5L/RCrrV6EcWspM4pFM+T4kBalB\nInXV46Fm3bs4kqPX3m+EnA/sssadLITfxRkF6kTrYZ/mcVMtYd6gxGbmOwF8\nlZIi/254GRQvpqwB9omebkS2OtNq8ohNVZW3oIuZLf6MACHjSx44VPZFpwzx\nC2otOzHjoUdMsmDV5oM/4ZWZpTaScTmNZ/ZPx3gBKuTwrOsg98oHLD3HTBWr\n8jTmwQ+/0dMwLvvNQ6j9HzKQp3WUYfXMAE1yxWNbAzrtKnmcX4lPGuWK758d\nSqno3w2h5kvh4DquCRO+mPQDPClh1SWj1+Ld3Z6+4uoS/mclQViMk5ObIzqc\npZLGFQWY/3spswO/l+ZPlmOVHtowwxRorq1l7Puh531LnN5OXTuCqVlYygWH\nl+kdV0DJAsTaNXQNlhq728Vuh+ABIi1Ojx7EB4OHK7cRWox8PcXa9gQtH2o/\nSTmebBZh+ZHRBiTyjv1tqbCpwprkdBoO2pI9U7q0DeXev2ZZEDNU5wT3jOYZ\nCW6UwwVtTMFiJqaGdInYfGFmbkKEcZBetQWmbI53VcpnvhTe2xhumgVmZtPr\nozZ/tV7aHYFDJBH9/5hWLcma7cu8x5SdElw9nuEVzBt1mRA5O7PNUAyhZ9p5\nnPYo\r\n=cx8a\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e7ff8633333f3f2c74cef5d8bc7f1090d511437a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.124","@balena/jellyfish-logger":"^2.1.79","@balena/jellyfish-environment":"^4.1.20","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.0.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.230-repo-sync-jellyfish-config-default-e7ff8633333f3f2c74cef5d8bc7f1090d511437a_1622078293522_0.19179214821984547","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.230-renovate-balena-jellyfish-config-1-x-f7fd48616685001f4c613cd41a863edccdec4ebb":{"name":"@balena/jellyfish-metrics","version":"1.0.230-renovate-balena-jellyfish-config-1-x-f7fd48616685001f4c613cd41a863edccdec4ebb","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.230-renovate-balena-jellyfish-config-1-x-f7fd48616685001f4c613cd41a863edccdec4ebb","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2b8e8d829e1ec805131a44f2dabfd03221363c59","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.230-renovate-balena-jellyfish-config-1-x-f7fd48616685001f4c613cd41a863edccdec4ebb.tgz","fileCount":15,"integrity":"sha512-rXrMRsdXmsMpEXvXl5geJp+N1ABfyekhJtmi/hasj1HfvHooulMKuu7CwhsH4khtp2rkkVi+zAW9SFbuskq2rA==","signatures":[{"sig":"MEUCIB7F60IocxllUx6Z0u3m04aUxBNFJVRdSwzaqnizBPAbAiEA4otN3dAwlsWdqjOvkzZgRUpZowmfbwxRVlb2zul8zXM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114581,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrwitCRA9TVsSAnZWagAAY5kP/0gRpi8SGFW+/y9at3/R\nFknkUk1kly5hlbDcIPSB+M4sHwbjJazX4/WzS6zHurhFGgv1BlinOGd3CKEY\n9ndbUJKOUf+uJ7RGLHhA/71EUH3mSJO9mOpQB44RbAHyrcQMg8VtfVY6wofk\nHnR/9ob+EYaSZd+P8c4r73mrRxxiEaDhdLoc+BWBUB936Cy2j0eTTpK/u/Cg\nHxyCpiDmbeWJLA6rG7/s61fbOtZGlJmM32MnbQibKBEnkNPyEwCpblk3axgu\nf2QjL6Z40+aRLJwTkKpZwsL+vXvNZgfboQUcYlvEwulhfyllrl+/5pQBBva5\nX6bCNftb0XY9JbHvSockVNluUkO7x6TzMtKfivItlo8SL8enztw/NO1l8umm\nolY7gyfrONIPFV/f0kzXoJkDpbPNllCsDhO+yobXhr5sr0nJsHUuMfwX8V7Y\n1BuOHX406s6WbEkpFy9ENR0mozFZOheqz6qraW8TNnLiq9MzR7o25wBd/O4q\nsZH69dVVhQZugvzLjwpg5FmWFHeTrWZH2+XOWlSyMvKp9HWcR3rlpq6SKtPb\nQTO9ovesaRVDG2KlYq/3BoaeDI3wIAb+6VBpAWMcGkuQ83Z1yiGWzHyXqlCn\nonUacfuCFDecpeRTDR7KqbHfC/8HL1JesJAvGz8FoLd3hcQdG5TLq18l965p\nzbQ4\r\n=v4x6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f7fd48616685001f4c613cd41a863edccdec4ebb","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.124","@balena/jellyfish-logger":"^2.1.79","@balena/jellyfish-environment":"^4.1.20","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.230-renovate-balena-jellyfish-config-1-x-f7fd48616685001f4c613cd41a863edccdec4ebb_1622083757326_0.38120576020079144","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.230":{"name":"@balena/jellyfish-metrics","version":"1.0.230","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.230","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8155b7b1ed82e417c57757ecdc469afc4b67085d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.230.tgz","fileCount":15,"integrity":"sha512-6vzGIMA2J2w3cOmklBWzmrCNVWnVpZxL4Ysml74fiFmey8sTl76X88vcM12KqbDsdvEQaH43ah1Ckk9D9skn8g==","signatures":[{"sig":"MEUCIQCJs7RtQpF1GDM/TY7WmkEo5ZT0K1A57YgFEZ9NszEE1wIgQgWXVV25pLIPfc9YENvkC3ny9nl1GGZ/H6zDpelgZ2Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114503,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrwptCRA9TVsSAnZWagAASZ0QAKMYY5aKO0gIqVRYhfqe\ntRNf15Md4/lgQ/OQFQ2ipFnEkdX894YwNNg8tgca00fHKC7VK/u39x4yYu9A\ntiYNnw4oz40LNFpIG9hdRRdeImFS/BIK12kqAMWJR/NMVncz++5JQg7K9Zu5\nBKzi5dWDxDEjQwS53QXovtD7/SEYJWaNFCKtAWDTG/20gRikGvdfosDA1wxe\nAqDE+fIa3blc6UgQWe2e9Vex8lzJS17Le8x5ZhqHsvrVmL0JjSBAxPYGkmw3\nTkm54qk3k11Lu4j1fr7PQ93hM2p23bmdUtH4p4I7O86DklVctcY0rWSNQiPm\nAK/h6myl0tvrxPXoCRI5p+4zIYqyWUO/9Jzey3TEcALAFl6yRecpp4Ar0YOz\nPSWRmSIhdOi8PouNS8Le3NZW1IGSMsQ/BJxi9v746Q+ZF5mHY1U0Enz/ZTcX\noLGtowISD4iIT/6ZViZu2S9zrh94GzncWz6X+o5eppGOzAjXvl0mxUJ5FoOo\nP0TvifBrfYEc1QH/uR/N9Jn1ikP1R5nvaEo+CyyRkVukignslaw3gPLB9NjC\nMHf9qInzs0It0qstWhIJS///so/oZMC37aFOWcSVe9pjlSwdd0OM2wiKrOXC\ndnMwrJNmEvxbqne7/yKEK3ZklmbvTzsOcD55/S0UJdic32wcCFVJWJ3URPtN\nUyL2\r\n=GWAk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8d678672d5be3a880f8cabfd8a1ce5cb2fcd1462","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.124","@balena/jellyfish-logger":"^2.1.79","@balena/jellyfish-environment":"^4.1.20","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.230_1622084205260_0.6724180424044015","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.230-renovate-internal-patch-4e554a1eae8d5ddcb43b827914949ec5db1346c8":{"name":"@balena/jellyfish-metrics","version":"1.0.230-renovate-internal-patch-4e554a1eae8d5ddcb43b827914949ec5db1346c8","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.230-renovate-internal-patch-4e554a1eae8d5ddcb43b827914949ec5db1346c8","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f43e90ba4af9291f4672e9e902e360de25c9467c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.230-renovate-internal-patch-4e554a1eae8d5ddcb43b827914949ec5db1346c8.tgz","fileCount":15,"integrity":"sha512-fgghwStCg0XPdFfQaXwDpspTfVzHLcKMhUWqB5KzUTn4DfoMIV516dsGZcawyJgz0qB2USMBBg7d46Vq8eQdQQ==","signatures":[{"sig":"MEYCIQCwhiMDXQiZWxlS3h+NzzX3nzU1XxO/bfvjYvsCv3p2PgIhAM++VaLugIsczrlng2hkB0lez2SOqjq6JOdwvl8DpaHH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114614,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrwqeCRA9TVsSAnZWagAA9CMP/1zM6mWgulbar4U8Aj6u\niC35hmIPXiqgSJr0fb6DvYmY5ljLc1obkvNtxOWN2h/7RxBCchVmVRYoKTHA\ntLIc+2Y7rb0a+9I8IOaxbTfLku6Dk5ntayXmU/SX1oW5JgLgqVpQQSr0dOkz\nR3mWbWM7DpOF9OzjSa9TtQa5icYoL/0i4KPo9xohlp2hrNuVYvjk8HMvFvC6\n5q/5qCB/e0ohZgxpqC5w1ZA3etstEGfcK6nHwmVbSvj2PPY9D7z5Mjur1YTd\nxEeK55DI174juxAuc6HalmnWRA+isbHlT7ZouzkGuM2yM5Vdy+Ny3bysQ8wm\ne1ZgNuRiiapTOznj4RTeLKD5BO+6QvDXkFEmUQ2bZ9S+RLs7v7Az09gaj3C5\nF30bD0e6NMXFbSaHWcl/nmtgyYkdJY9lxPJPWT2aC55Iwp6dOmOp64MmCKiZ\nBDcF+DnKXez+T69CHFKCvUZ9718lXnGlENvR5PwIGxC1XtR7j+eTaYXgo6sr\nDrPhdGkw9WknB9dhn8E2tsqiazVmIohArXOfCti8Jg1FDeTrNtsYepwSb/21\nW/7PcThN+KWxeARqf3E/+Im5KE84Co69Tvc2pD0s5AcCyYeNRXVkd7D7Y+ls\ncUHV5ygh5hUJv2WmbWR+x7nP9GT5xzTtcSSIQNxJggkD0fIaT/lAdiXqoFP5\nFDkW\r\n=l8PT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4e554a1eae8d5ddcb43b827914949ec5db1346c8","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.125","@balena/jellyfish-logger":"^2.1.80","@balena/jellyfish-environment":"^4.1.21","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.230-renovate-internal-patch-4e554a1eae8d5ddcb43b827914949ec5db1346c8_1622084254223_0.2619026667031845","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.231-renovate-internal-patch-3886db832e0f3f463db4e72b9ed1c8bca7f5dc3f":{"name":"@balena/jellyfish-metrics","version":"1.0.231-renovate-internal-patch-3886db832e0f3f463db4e72b9ed1c8bca7f5dc3f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.231-renovate-internal-patch-3886db832e0f3f463db4e72b9ed1c8bca7f5dc3f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"36b4d4bbb5f2128397eda119e921669f0d0b6fa2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.231-renovate-internal-patch-3886db832e0f3f463db4e72b9ed1c8bca7f5dc3f.tgz","fileCount":15,"integrity":"sha512-IHrFJ09AyVQo0P8XrLEWw/Hc3l+C62+dOthiBVqEJimz0wObOrUbYnK87tkevMUg5RsbcaDcpYxApS5Fjznj3g==","signatures":[{"sig":"MEUCIAUPkFhxjECHO93PozfAMhHtCRWCyLKohbe+AbqNLoBWAiEA7bnsP+oklQqoGqTX/NRMVrw6YAkCJJffSd1Sp6Qs1oU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114640,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrwtqCRA9TVsSAnZWagAAm7IP/1RfaqJXNExBjzt6CmJG\nLpIB80eTcz04lnAeZ2WYeNdGMzcEVcp+wc3lxFDNveda+CUgzlJi0m7z7TNM\nwTsDbsvxm8IlRw2mWSLyqv2qlLjo/6ow0lapnhjS26SJHQqUjS9ZkEKGkQe0\nhIYFPkGSVqNFeHjUYO4OpXn8ZswBLqC/sLHEYGKZ3hNOW8xgJu7SbOOFIOKn\ntwMkvxhjlLGnm589rVSqsUmjh4Yuf5NSENg9uQoRjry3iMMH9nuaal/1JXFE\n1nALki9vf/wb286zhL54IwsQRSZLpkbz61LzTaq9A+vqyZS1gsGTCANRiFMV\nDfRIKZjACMMwbhZ5bANXwsCW8gcyPCBBIm2oYmn2PM+crceSwaAVS9ItT5n+\nfRUr0wtwdV8aIOGhIRiWYp0PCbi9pxRKghVBlZvdpZ0F7g+N5Ea7InfChJ8P\nE2hYnzdiznpjR/aWFyIX2KhBAiSaJTBhanMEC7wZbaP1Xas49RaAtbW9mUyK\nu/sHbQ7c4eOQnS+35t964fzxcWdArHgcMKVFNQeYcJyOiQ9id699IzIgf1yJ\nBVRD6yfttJZx7VhoWbPN9vzyIMFnqfZMz2X7VbGJHCSQIqW4s5wTGNQBh7rm\nUjl1YyWlcaUDSjFmVsdSArxTwguwcX7QB1SHdZ6yilcNu1GQ4atjEX3y9RNv\neHoE\r\n=6bYw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3886db832e0f3f463db4e72b9ed1c8bca7f5dc3f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.125","@balena/jellyfish-logger":"^2.1.81","@balena/jellyfish-environment":"^4.1.21","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.231-renovate-internal-patch-3886db832e0f3f463db4e72b9ed1c8bca7f5dc3f_1622084457677_0.010014772525375859","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.231":{"name":"@balena/jellyfish-metrics","version":"1.0.231","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.231","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"90f2e92ff88ead1e43035011f94a715fb4b9ce84","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.231.tgz","fileCount":15,"integrity":"sha512-40I8sRmj+ypHZ8BA/VcM30Whbq0c1rAgnNSME8FojVqYWoL2rIgIeQBHALN2Fd2tHAABTYCI2AP9WEdRm2Z0DA==","signatures":[{"sig":"MEUCIQCnbPu98lbNxMauYROA37yB2SorIhwK71QkZp1VpxxQeQIgZtt0YoE5zpW2nwziTO3J5r5hZGlGR2Pwpvg+FwnCzmc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114575,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrw0DCRA9TVsSAnZWagAAqmAQAJZ1K3DFRVzM24ZRPlL5\noIDeb2jaNoUv21MmlMCDchaH9GAZ/4TVGBPUrp4Gc+Rkl/oba8VcguQgb6lM\n0YsqXUBC292pQ25LnGvDBXDAur1rYvdI/PTxhWip9BnwwwHmHoRTk4Pv/9Op\nV7sa3QbqBqQgVmDCtNpzhdSYV0v7h1FaKDQXIWMnx9qZ57HqVVnv8dakzEFW\n+iaUZEImId7KiIo45YB3VTNYev1vCj9pB+dygW8sPJCoUKQ6ynOkRM2cX0f+\nPzsIrkLFSeER7DKq/CbXPdFQKLVQZQ4OmYAk9hO5r/qOGyb3N6x7MRAXpSJG\ng77UjPgQZxtwP2e5M8nDjts5uS0lWS6Xh7o5OG/H1xWRwqmwHNGITLdFBizs\n+Fhf6vH8Jt7TEtQBHD50H2RYbR06elt7AvlLDiPREbmtAHmFa9oMZ38jRAD9\n+LXpIYrQ2tYlySBb/ba4lWhLaDJDtxBJDvVnDry+KqX69sLir9qNI721PxVX\n1y+5sBNW1ZPRABBjSch6xgkqPteQYx1NX1M5SB8Y7mDgmShc+7dYj+0WCtUx\nDDwjtrfNTc+eWnucVVfZuadu1k1Lh6TDDm3WE5+HXkRhqvuWXB89KK6gCAKl\nRzwcMl5v2bfj6Q8N0SjRWODWhERpZGPuigyY2cFwMGJgUcgqYKvpgZhe89Y1\n0Ast\r\n=qAWG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"fecdf98bbd3be5124155e0eaea5cd582f3d5d937","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.125","@balena/jellyfish-logger":"^2.1.81","@balena/jellyfish-environment":"^4.1.21","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.231_1622084867284_0.6221403497145579","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.232-repo-sync-jellyfish-config-default-e94620facf490e1ff3b24d42a2fce106a4946383":{"name":"@balena/jellyfish-metrics","version":"1.0.232-repo-sync-jellyfish-config-default-e94620facf490e1ff3b24d42a2fce106a4946383","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.232-repo-sync-jellyfish-config-default-e94620facf490e1ff3b24d42a2fce106a4946383","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"87dec6fa63edef74471494db06713976c42ade9e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.232-repo-sync-jellyfish-config-default-e94620facf490e1ff3b24d42a2fce106a4946383.tgz","fileCount":15,"integrity":"sha512-ugGBzIalBPLJQGwdAmpN4EWUQa8nmZdz/VJkf+oZriD1sOmtM3sKbOeUcCA9rlt4is3WRS7kqsrpXzNNH/gJFQ==","signatures":[{"sig":"MEUCIBP7GXo6PzDhNeFQqd5mgSF9M4iwk+08S+CJLiThEvc0AiEAm/AdLzg9HIs9fvRH3RXLVuqOr3Tskhk/7fBKNUDSg1g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114748,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrxB1CRA9TVsSAnZWagAAcSQQAJLWD8ZKWBBhMfdDeJt8\nOMIGdR9+94hhAOqtpze9Qk2cxWu7QZBnTwnSHxiAy91k3Ee9hhsRPdqsiSj/\ng1xoREdfA8y0b6cuttYsOHkj2d9IQTTzdPTDe//GzKXd22ga5l2nqiy9AFE0\niWIXRj6sMFkyr/gD8wWA022OXL8KcUMnG9nSc+kO6hRyVY0sCsgKaIowIxZK\nlHS82wBBJUvvlnfoZI0hwz2iEkfK/ZAKbm02ASvJyPWJQ1Lrt22subD4cixD\nwwYt/7BjJLmqvpxkgVJuJyURE+Qk0LtmWyCzeRxlvRrfokqpqbpSqS5pqK6c\nWvtoZhjdP6XE+uFGa1FvZcXsaePuNW1Hkp7UF8xt0IeK9OqLLy0JvGlYg02C\nPU1AHSuFNvxgnIcEtfyiD1FiUs5gKR53Y19lHWSoFmSWYuZ+qVB2Ad9RjF0g\nwRZZmd7larBwLi0AtZCqANFSgGgwlp4t9VTzU5OobeY7498iPEWs9hqafI61\nAguXigLP0ATgI80llCllMxOlwc04/PNd8Wl80Lz5X6gKL0Y2a5fbxiSZbHfI\nAJ7vE8nJoAQjS8jg9raM0lizW/XeaDw0KlwPhgC8WFctXSTZ7a/nz99H9DT/\nrIaV14RaYECVY+r7j4B3SebwHoFAls2JN6gFt+wvIYu8Pybq4pUCfItcBFeW\nNM9e\r\n=7UgX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e94620facf490e1ff3b24d42a2fce106a4946383","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.125","@balena/jellyfish-logger":"^2.1.81","@balena/jellyfish-environment":"^4.1.21","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.232-repo-sync-jellyfish-config-default-e94620facf490e1ff3b24d42a2fce106a4946383_1622085749201_0.9179627383315248","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.232-repo-sync-jellyfish-config-default-b6f515c3e56e0fc545154c76ea933d3188127a81":{"name":"@balena/jellyfish-metrics","version":"1.0.232-repo-sync-jellyfish-config-default-b6f515c3e56e0fc545154c76ea933d3188127a81","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.232-repo-sync-jellyfish-config-default-b6f515c3e56e0fc545154c76ea933d3188127a81","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4acc8c39d3e6f66b873196a233c28f1c868ac700","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.232-repo-sync-jellyfish-config-default-b6f515c3e56e0fc545154c76ea933d3188127a81.tgz","fileCount":15,"integrity":"sha512-y8d9zxFkGbMevhq2HUzCrzuMj06krqVImfvv8e7Cs5lN309DhiseFN84QirP6IzKQt2cGbV6wvpjLK/lDNUuBw==","signatures":[{"sig":"MEYCIQCni9k6RLLjjyILwtYP/incjk3yCZCPbgb3sfwRuP+5lAIhAMuj1tHhtTsVcwdCeMsO1jzo9j184D6ZexcZq4NfECPO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114748,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrxzKCRA9TVsSAnZWagAACQMP/0dLSgWutEVqHUEvNowT\now6roMcc3BuMxfqX0oukKCa5UTF1tgePM5kSK/GF40dGpqrkBKptCKqepI7e\nxeF44Fx0PJdlAMGZIQAliehryzHOoYkVcAREOniX/966V++X7LKLwSGLz8+P\nFAV/vnsPU3hSmtZA7NnC5DwouPvuv1CYMeN/YnQgpj2oqs2dmdMUYlKOZXI2\noFSpLW5eKut/8+PMtDZmqMrvSW8nOzAyRPQopwI6Rg71bHpDxW00AIaPQfGN\ntQJa2CsV6O1/Ii3PgC1MogtPPbTVfOd/OQ5TNbFsd2BNeTOSVOD0ZdctC/dX\nPFWmixprK2cQ2Jf5l0d1aPMpGsqWgnSi/b5d+mrM3W63wfOxs0jlgn4AY+WK\nXx4+9meh+LMBtUFFaqEPvMKKGk4qqEODQT9zFwZCqAo2mSYGOSXIdhNrM+H2\nAYZMrP2qKh2s/A8f4oDpvufjO5v3dl9iklzI2LtBlGXGZKQejihtiM/IBdvM\n/V4T5iAplbrCN3WvwKRFbacsUUrN1UfNHW/kbtaytrYAeXz/G5Dct10SM5cD\nTDjJ05RnrfvPHOyfGZMh3cptmcpZ/9ss+ZJyNYNG4Dkbl6TjIF873kWoclVW\n/kTyyr1eiWLE6XIKK8bOL9T0AmdXAilGIgkDh53ss8d4X7MSJ2XCZgJdutxe\nDxg9\r\n=6PXI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b6f515c3e56e0fc545154c76ea933d3188127a81","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.125","@balena/jellyfish-logger":"^2.1.81","@balena/jellyfish-environment":"^4.1.21","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.232-repo-sync-jellyfish-config-default-b6f515c3e56e0fc545154c76ea933d3188127a81_1622088906165_0.2831105268427043","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.232-repo-sync-jellyfish-config-default-a1766eb6f6472ac9a5d0f11249a8bd0495a154b0":{"name":"@balena/jellyfish-metrics","version":"1.0.232-repo-sync-jellyfish-config-default-a1766eb6f6472ac9a5d0f11249a8bd0495a154b0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.232-repo-sync-jellyfish-config-default-a1766eb6f6472ac9a5d0f11249a8bd0495a154b0","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b0ed7a726ac7120eb2a903d892f0e5bc6b946ec4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.232-repo-sync-jellyfish-config-default-a1766eb6f6472ac9a5d0f11249a8bd0495a154b0.tgz","fileCount":15,"integrity":"sha512-ALoiAL4DOudtpP5NVKA5Fu6WotNGrxbVvQsGG71JPt//Mwdpm8xCNfqTj7vZtMCBQtpVXgKv8dvgcxevud/htQ==","signatures":[{"sig":"MEYCIQCcyAweEFMqJPfvQydhPc2a5xNiCUoMP4e7yO/plMhWuAIhAKmKLaRhhYw6FZGUTcb3Hk6Y30RM1v8sLTwfqbW28nKb","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114748,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr0CsCRA9TVsSAnZWagAACKIP/0EisAgyWD6BMEc34WAw\nWa/qnlk8R/xAm8NaLHZWCUenNAfJkHQ/HkFypMSvMgFqkYSEDQzucAWaSOsO\nzrCYa0Ouwv4FmyKcaErISTbjDmC3k0CLb/lXH8EPbujpuXB60wjb8wiq1LXK\ns318rZGqde3UvNe+9EQ62wYAYAn5SlKH4kmK2GM/PHK5BntdiZtKvXGkXml2\nIfeYQb6LcyKazPc7//ncwZI41hsI9KhaYuGUpg404cC6z3k0wL9TuTBjzaqH\npgza8FpRsbQ63nXqzkJBizAyQQwgj4iTEy5cEY/amtjfMFIQYQ1hL/Bo9wE4\nSWnXKMSGUhnbOZptl9AnOgUeT2ItxlO3C1WF0it4H3+z91ABRqPG8aJQRvf+\nu2DU13auh9gWGi3OOopbNCJfWOiflDmE9osWtJ6pEEs27IL9ez3DM4LMXVGs\n7QBAcPAjth7WwNRD9UfN8T9WtFfOfC5KFx48J96umZdfH06CQoKMoh7xtLvP\nrMEQ7fk7TbnkFySMtWua5RIbZovawAYCtp+xI2P1gdNmm+s0sCaObbCIqvDa\nVPj+K9+5fLwTmmdXjCHEGrMuiPgBLbs+nUz2lTOmIOAetKeG7SSk57SPRbot\nBakzSNSASXzOsHXCmRVbKe2AzfChe1hClkuQU1ta6o7q+mLbZT2BLaAgwn4G\nb6DA\r\n=1lwC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a1766eb6f6472ac9a5d0f11249a8bd0495a154b0","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.125","@balena/jellyfish-logger":"^2.1.81","@balena/jellyfish-environment":"^4.1.21","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.232-repo-sync-jellyfish-config-default-a1766eb6f6472ac9a5d0f11249a8bd0495a154b0_1622098091934_0.46371466414664697","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.232-renovate-internal-patch-880e17fa2dc4ab603fd58a68ec91d2ce7314527a":{"name":"@balena/jellyfish-metrics","version":"1.0.232-renovate-internal-patch-880e17fa2dc4ab603fd58a68ec91d2ce7314527a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.232-renovate-internal-patch-880e17fa2dc4ab603fd58a68ec91d2ce7314527a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"43a73ea6c4013d8880ab6a1eb2fecfe5b22edfb1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.232-renovate-internal-patch-880e17fa2dc4ab603fd58a68ec91d2ce7314527a.tgz","fileCount":15,"integrity":"sha512-xp7ZtrJWIUbSjQBJX9exFLReELs4jxo3dsIdC0oJ9lGCRmE/u+A18jatTQA6hhU3pof7rMwLwX7TkBdlJ1Awqg==","signatures":[{"sig":"MEYCIQDXmKOf4CnTBYuA63uDx+kjUk0VRVa+dJW4zIuL51oOIAIhAL8YN2m960pMmkqAx5pU/7sL14UewjQg4QheMoCateYm","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr1c7CRA9TVsSAnZWagAAGoUP/2SPyWY2ox1NUa1fLRh+\nLC7m+RX13Eqz+TXFGjeUqWBhtTae8N+DdkhcV56HnnZDM51igJE1bhU0WwTu\nM5xMVKz0ALjJS0t6SH4O3uo9CkXImpVgY/aXExlbBRFs2YJ/SlffoyJM6cM9\nMk5tS1NtbirUt3IsobjeDa71hbL5/eS0TW8IqE5E5I3TZP9AGRobdqtmUYaJ\ngwsSbpcD5UyeL1dvMD8b9fCckekySSGzMHZ2Y/+alGYSw7a5ZMMkDNE+eYtf\nmKpkyE5B2rXKjXj2oyLu9o0MqIn84Huga6IEtstKgo+G84W0tg/5Ma2aJAwG\nVOactnnU44Hk2psxcPjA6hadSzwEVTJDgzW1qZEPIg0CXDpEArjEV2OPKZza\ntLxs+MGLdXOyxSJw3TklKvVv7Qp5V3UMlIPN402JEvlimNOahRyu7tRi4Ls+\n2Vd+/6G7SVLhsSl+bDAbmaegd94BABlPwfnMEVm9jQqnXoTNoul9aAQwMZIq\nwgmklGAHPGwteyAyfvPkm2OMVdyJLk6XgXjH8ashWcH55RywNqpD1Ck6lihd\nV2cNwepeAyXCtpGvhGHZGfXAGxL/oZfvWzbqybytoqmGzlFnDg1FYATYTyxH\n/rAHjFw85JwMJJqF/Qkh0BcDDMdL8d28ARrly99LFWcqCd+ENdP+YMPFKIbS\nTw7r\r\n=N/z2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"880e17fa2dc4ab603fd58a68ec91d2ce7314527a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.127","@balena/jellyfish-logger":"^2.1.82","@balena/jellyfish-environment":"^4.1.22","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.232-renovate-internal-patch-880e17fa2dc4ab603fd58a68ec91d2ce7314527a_1622103867448_0.3328005688844644","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.232":{"name":"@balena/jellyfish-metrics","version":"1.0.232","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.232","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"311c0a572f7e97c345462a35a484c19841609516","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.232.tgz","fileCount":15,"integrity":"sha512-SxaeX5qKlW8wyZE1eCzPc63dSKAR5FNa0wGc8B8vIhosWESMo/YqMF6c4hDNnHR4WIU1OErO2fDmtSTatiqvBw==","signatures":[{"sig":"MEYCIQCCXXcrxmJ4Dz+YkKMzuq+hfXz1arGDLZ93wRNgNZRwEAIhAIQp3Czctm8spU7AA7oSj5Q7rhXI5BRAH5WFZhHNZcbn","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114647,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr1hNCRA9TVsSAnZWagAAD7AP/iFxLqDIBgtkNZBkotRD\n6sDmyW0xreyHeZEyxfwDRuvB109rrJlHgv5grpobshoN/9DXXE3Un0CO7DKy\nUKmyZ3/WtXO6P7Il7XxjDT+KpoVQwsJW8ZNg4+7Zux/H9VQ61suK1Q7b4HT2\n6VPusfiLUxcrM1Xs52e7aaeXxHtr8J+Gg3ryvPKJmVdu+47i+kqmxeIB9F6u\nqTW0Z+W2uej9G89d6mwxjD3XvTbUYC6m0Wh1USeaFNfOJEbm5Ho7YpKOqztV\nNutNVYqXi6MABpaaJGKOxSrkqy3111o4veRYyOio+7kCOx49V3R3nAOyZbjx\nW46NNJ7yp7GSIxbXhwXCmwrXuuYEfKu/QNR37Urjtg7l2ESz070EYJZAGs6f\nJxMmPjhIdKgT6c9ACWFQJtmpJvOCXozbF8LUCrF6lJ7+E4L21iAbOxEcmZMb\nGzre3ZZ08wrEK1zXurGDRg7AjX82BtRWGbSU5Siol/owkRfDxjA4SVYsSVYV\npoT27KmHl0AKnZsDxlXakDTLxucKXTHQL2WK3r1/b/Bh+zvCudd2LpXUNlfK\nGkcUB66F6dmb2yIZHUmSEBrcQQS+cF+C9icWIaZZSDOyB84IJRfctTl/eP2x\njwkcn2QlTK7sPiiAV+QdOisZGi6mul5Zjho/PvOXbRY/nDaFlvslDkoOS1Fz\nLC/n\r\n=4bLR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"362d5140c47536119a74bf470f3f76cb8dd8b791","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.127","@balena/jellyfish-logger":"^2.1.82","@balena/jellyfish-environment":"^4.1.22","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.232_1622104141285_0.40314798110692784","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.233-renovate-internal-patch-dc5ab6edbccf946b6e6ebb1c16e429db0dce1803":{"name":"@balena/jellyfish-metrics","version":"1.0.233-renovate-internal-patch-dc5ab6edbccf946b6e6ebb1c16e429db0dce1803","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.233-renovate-internal-patch-dc5ab6edbccf946b6e6ebb1c16e429db0dce1803","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cc9f09598b8c2b57b2d9f0d0ab873c1abacd7277","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.233-renovate-internal-patch-dc5ab6edbccf946b6e6ebb1c16e429db0dce1803.tgz","fileCount":15,"integrity":"sha512-EMUbKUfeMVqPpwDovoOnJw5A2NJ7Vu71nPs//L+xiTt7cy0OTi0WutfZSENZa/A6hfXcrAN1OHUpkv977g68IQ==","signatures":[{"sig":"MEYCIQCnhQto6PErd1Gq1oe1VqoLkQ3HhtJ0f78jRLkkBS2BwwIhALRJdHi1Uw05uO3dN/fgfNkpdlVR/ndUB9SjdRx6S9S/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114816,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr1otCRA9TVsSAnZWagAA9nsP/AmmswBWKG09HRH0eTZw\nSweCXlfHvkk/3bueEyaI99xHJ4k1dcsxJVuhoB/HLrlUfuE96PXoh1xMzlpV\npar+GCDxNT1q//rmNhZ6AJKbmqzKGxIcsIk8RD2y5IECRSQwGGkWAz5/0SZE\n7DjEPkMlOTfO/5IqeRMZuiXHJbwkxwYJjwG41AcNU+xryjhGRhfYhzjwxCEK\nyTWYpHbI1aKzXDHkbAzDo07ODk6TawaaJc7W4bqu7u5yxMdQ5872eaDmdmDV\nO6th2KLYvqXITlWqWkeEMlbjR1SuQPCy2gDjHPh3S5hJ9dZ2Za1twkXzTkyS\nuQKCi2uXqsxpG8KbwRMQToUFfKas366dnKK6tNzi2gFhWgozbTrT0UMr6eP3\n4pcjtyj3gKSRn5UOAOa0fq4z4XoshHCCvNiwrZc76Xdn9peGNqlcVsqDONk0\nt3yqFLCSdHAmprlT5MlHxLo3WeFVmEpS0TF8zfA3zYlD83yqajGGDRY6WJOP\nJPUl02UXJjIPdYzXmn9SyIKg/Oucu7Q+uKO/+29D7N/vtOqW8vy6rnrtKZPL\nxvmqYZ0/KBmaBkxXe3nXYrywbgn2IZL3WqYlr8pj7cgNBQ88paeEuFnWAYC2\nmL7pdU3KPaT2NCpwQRdJAFRfOAXYIPktkRNJG8HsHrK6N0SaiL5LR8nQiyxM\nalFI\r\n=jygT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"dc5ab6edbccf946b6e6ebb1c16e429db0dce1803","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.128","@balena/jellyfish-logger":"^2.1.82","@balena/jellyfish-environment":"^4.1.22","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.233-renovate-internal-patch-dc5ab6edbccf946b6e6ebb1c16e429db0dce1803_1622104621306_0.9911075070187625","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.233":{"name":"@balena/jellyfish-metrics","version":"1.0.233","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.233","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"dadfa56f9bbbaf75b80770444e16f9327f33de28","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.233.tgz","fileCount":15,"integrity":"sha512-e1Nrd9pa7UGCHAMEHyv8scXxLiGu3o9Dfd2SLusHVNSxo/9WDpTi0curi901zSfdurHH+thri9qYhVKA73lvpQ==","signatures":[{"sig":"MEYCIQCgAwYPXXyeU2zf7yro/XNMvbm2ccnSTrp02dFECMpJ+wIhAJl7idq78MTnDzm/B6EYndLTwv0p3jGtcfoIXbrvk6a1","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114751,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr1wUCRA9TVsSAnZWagAASAIP/3sDYTHcZjMtPdKdjz/s\nDSfH052Hgeqr5RP0UBW8i1vWS+nyMSyXDC6eeJMzIE8RClmvyHxGBqlXZGVY\nMX81WpD7pzj5Cu2Tth43f4wHjzjTJeAmqt6cWL4In6zsbATfx2TrORdcT9ll\nUR9G6QgdKzDVUpMkWh/7pfDXdIcjIct4B6N7lppXyp6APcgg9oER0i25+Djz\nPgiT2QMFzFVOkmhZflZik6EFE29tVNRlHD2O3CLYiWUoamKplccJ7kFdHuku\n3wkiLNOAU5Ct3tGIj6nbJ0LeqvaKVYY3l14DUTKrxxs+Rusxf7qxFtyTj+9s\nnOYGRX/WOGMoFGU6JaY+BuMQCENTV+uxUNB6Id6crn1THGWC34hotEHZOMA4\nsBqXhjG3qNjJbCc8Do3LzKnDjwMu//pjpoA2dugEoujyED5xZQmQ14DTWmhC\nS8T8kCuoAxILhhe/ReXU+THX+E8zb58I9UN+aVDxDnXTvKirc7N36vKmvbPE\n184G80t2Br9baSkvWQcFq9J028EnGCnB45q6Vmk6dasIaAhY1ju+OByi0ZNu\nXqhNDy83J9TXsarGpDFm7RXp/uXQj/38md5fdlbydIsuiwNcnEGUTQqV+euH\nd4DRkV6n7R2APT4SpBYvf6NadyS9rNFw7DWLVJG5UJHuvZhNhMs75w1knMNv\nucUK\r\n=OVev\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ccbe089218bce2caf15f2c1cf158c51b82b66ccc","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.128","@balena/jellyfish-logger":"^2.1.82","@balena/jellyfish-environment":"^4.1.22","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.233_1622105107826_0.5132855868317387","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.233-repo-sync-jellyfish-config-default-8645e22bb9b0dac4ec3f9381a9fbd835c13e6de0":{"name":"@balena/jellyfish-metrics","version":"1.0.233-repo-sync-jellyfish-config-default-8645e22bb9b0dac4ec3f9381a9fbd835c13e6de0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.233-repo-sync-jellyfish-config-default-8645e22bb9b0dac4ec3f9381a9fbd835c13e6de0","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"31d7632ced05c899ed0adec57082c4bdb97dc327","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.233-repo-sync-jellyfish-config-default-8645e22bb9b0dac4ec3f9381a9fbd835c13e6de0.tgz","fileCount":15,"integrity":"sha512-l9P7hIgR7FwdtHtJjC9ysHVY6+/OXYMAOfJ6kbbMXG5m/61L3X8/EV3btddozSM4WMal69J3/GPDwDgblKwkaw==","signatures":[{"sig":"MEQCIGzKpQBdMdbYxdS6czN3cDAvd/I8IPOvo35mPQOWxtZWAiBvx6+6adWuhO6Md0TBiMIrhRezIp8SYz7mk3gMz6pOKA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114898,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr16OCRA9TVsSAnZWagAArDMP/j6qMO+lgn1AFYHOAUFc\n+BgYmDHztTBR6zgJFRvTn6k8RzIWmEOptcfLajYmD8taTKJRMxDPDWR+jWSy\nJTD/1eM6VBP/b8li5MWGSwuy7UHrvz87n0VDuIAAIwRVWjSRWvSVKrdpouYQ\nC2p3cFAKqSWJ29wFNX4jIJBPuUq+OKnAQkXV//IncpCsZKs6NGJXuVf6K6nD\n3Gg70icO5ID8BtrRW+J7ZwiM0bdAEHe1SXsJkKd9xa36t5XOmvvmISn8j7tD\nRwxcoiFOx+J5s7jjYViNv/4PBjExY894DHtltIjs3YbOeOq5GPTiLpwOQk0F\nhyW6cUgGNnB41fLzZ83/qbXiapDAtdt94/uQ27PDyvRmQcZLbNkjRqtUnfES\nqGXflMCHha1yzIayj4mXdeVj9Ljq8rZTRdhxpGFveU6vXjypGIch/LvC+6yb\nNzXrmDty2S2KylbXHzZsoMmbQ9aW4c1cHVUK+FTn7FBzecDXsZYm9Fju2Eds\n6Jv3T0V0vXhMQ20aM97uYAVVv+V8vkewU3XT/++Ek0oXZ17ti4jb462AegWM\nxK/jW3HBrct7tgNKQGTR9CoTe43Ip7jIKOx3f40nMIjrLej3mVfp6m5KoP5P\nyzU62YsmOmo6qx0BXy0FtQLq72A95L1V2oeXJagIgKM2ZJeSWSjH8PsdxDrs\n1E+0\r\n=4uO1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8645e22bb9b0dac4ec3f9381a9fbd835c13e6de0","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.128","@balena/jellyfish-logger":"^2.1.82","@balena/jellyfish-environment":"^4.1.22","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.233-repo-sync-jellyfish-config-default-8645e22bb9b0dac4ec3f9381a9fbd835c13e6de0_1622105741885_0.16955737553543226","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.234-renovate-internal-patch-fa4719fe688dfdbe1a92fcfc9bbfb5f84a4bb17c":{"name":"@balena/jellyfish-metrics","version":"1.0.234-renovate-internal-patch-fa4719fe688dfdbe1a92fcfc9bbfb5f84a4bb17c","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.234-renovate-internal-patch-fa4719fe688dfdbe1a92fcfc9bbfb5f84a4bb17c","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"176d48a1ddde35cff0790d7beef0eeac5a431ea6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.234-renovate-internal-patch-fa4719fe688dfdbe1a92fcfc9bbfb5f84a4bb17c.tgz","fileCount":15,"integrity":"sha512-Jh1TbjcXukPCUtf+y9CYAaM5LjWS/H6gfrH5pRFG93yX3YdYlIFHGI9ChoS8jV7DHtn8ydlDYK+DNnKmBQ6c5A==","signatures":[{"sig":"MEUCIQCKPKPHDwhfjnPC7ko92KnUwml1hCHjn+Kmn/2XLyVxFAIgNVH5EFwSLHnG3TcNyAOHOQYBXuGsS9T2Axpt8Y20FTQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114888,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr3SsCRA9TVsSAnZWagAAgk8P/0+KnHwg/7akUm04mR4R\nqmwlJuQAKa1N3oAi9LPXoliwr+2RPr15MsfjQzOCHclqwK6jf/XAzsTaaFK8\nfdeigdS9+eLzlyEC/w5CVZYC22jTXEddBdl3Pa2nXpGBLdvZDzsWV9JNetu4\n3e4FjHaf7aZqfeOlC6GYrSviRKzDZR1dFxs+EleikjbEmWvWzv36rhJPzqvx\nr2EQphSuhOCNkPRO8d1wotfbWL8AoMrnN8BMokvjNVL3MW2Rh5X4zf6Qa0x4\nZ0TOWuDR10kzL7rz2a1WH3NuHMJBv12g4u1LBWC9XmbYoH85f3LLLX8ReJvJ\n+xdNXBa7lMaJ3oO82B1V0+cpQ8M9u/eGVc449COGfZ5rC0DTOf+PkepK9gIl\nujiGnRHNUPSOUYdJvFPtEBjKNdIPuCAV24MvBKBVHsYkLSpmwbDNSfiD2JxQ\n20T+L/f7nW0OJ1vOxJJ0Qd8gFRErW/KTkECTk41LO+g31moa1gIGdTXALYNp\nKINGlVRbEV9xoOhRiaxcNIvL3LTR991o6KvKAtlh2u+iLbTp+q2XHgjaua5q\nyq+UkljPAF5aWx1i8AIP2udtt0KUAhnxZOz+VRGy5HCwpzscxGdfnbISJSIN\nW7if+ZO7MKZbYju9wS6hNtCn1np8w+m5t/0LJ0BvjQXkHXJJfoq6Cg3sslfm\nKjZy\r\n=lbDc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"fa4719fe688dfdbe1a92fcfc9bbfb5f84a4bb17c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.128","@balena/jellyfish-logger":"^2.1.84","@balena/jellyfish-environment":"^4.1.23","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.234-renovate-internal-patch-fa4719fe688dfdbe1a92fcfc9bbfb5f84a4bb17c_1622111403946_0.8353162530535063","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.234-renovate-internal-patch-9470174a3690f3f597f9ac82ee3a67c1cd0800cc":{"name":"@balena/jellyfish-metrics","version":"1.0.234-renovate-internal-patch-9470174a3690f3f597f9ac82ee3a67c1cd0800cc","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.234-renovate-internal-patch-9470174a3690f3f597f9ac82ee3a67c1cd0800cc","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a078d7d1ca2aa429d7484c65f19c9e5efc4d8acc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.234-renovate-internal-patch-9470174a3690f3f597f9ac82ee3a67c1cd0800cc.tgz","fileCount":15,"integrity":"sha512-PTyj6Y7272eFIbpQbbCBoImJ6ALloA23dY8zGjrDXhDvwOFKGSpsrdiAHyvyohCnF8vYrmiTzl7Y2xyJPwfJRg==","signatures":[{"sig":"MEYCIQDtFOYbL1Kpz9OhJpKyapVLhYRnmkDWSr2Y7O/NWB8WlAIhAL+kAcuVh449tzK+qn8K7Bxr15g0HBnkUL+9vLDKfQ93","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114888,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr3YtCRA9TVsSAnZWagAAhFEP/1RuJp2fP+r3H+NtNDsR\nxSSbqUW6Dg4BLK7IR8jDwwc4SdvNPe/Q6CTEuUtZ2KjK4xE2VqOularjEn9e\n3j4+DfjXKZsriUMJXyYEnPjIQ+oNEXPgxVHNuGCWTiuKBVsK14s5NU7kmtRX\nSrTewAE/AgkFwubhS/nZez2i2k51ZL6lz7LALe2pwYDLynsRzw6/5bNkZj98\n3/w2Y+83Ly7+WOpCh643RRsisgbmFgD810o7BJrKCSU8V5rq0serrLWdXf0u\nex0RQ7slJzNQHa9DH39bKACWgPaCRsR6OgrTSPcpBmmY4hnyQxu99Ol49VXd\naRCE40LomfvUDifxlWwKGQWqBm70QsBggtwyXMNcFdjiRrMpT4QE6dFU3Jlm\n9DwXziwXtEQt7/APq5jozmJS34sSgj6ZrHQFk9lPAJ3CqrOfMZym3Eh51JHD\n+hv66Dn0Rr3iPsliz8nzkW3WjHwywdMq9B5rAD047PabQn52gV0MtsOIPbr2\nzIEeSteKXYQCYe8sNA9bdZR1kdWwevDrJZed2v5Mv8OsyltzVvZ5rbga+Cd1\ndinCsZ09xhhLGy3gW1jWUvdMnrqvdxgRODFO1UImcd10FAyOSo7OhmMkkzpI\n0C3tm6hAch6dBxcoC7LX1QRPChP4Pga3tzpbVgiNjSJiXkZegC62E8Fawree\nJYBw\r\n=PkHf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9470174a3690f3f597f9ac82ee3a67c1cd0800cc","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.128","@balena/jellyfish-logger":"^2.1.84","@balena/jellyfish-environment":"^4.1.24","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.234-renovate-internal-patch-9470174a3690f3f597f9ac82ee3a67c1cd0800cc_1622111789270_0.3048346299360529","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.234":{"name":"@balena/jellyfish-metrics","version":"1.0.234","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.234","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2ac8c1549556c195c6e5d6ffe4dc0bf26e1192de","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.234.tgz","fileCount":15,"integrity":"sha512-bFmA1FbBOQmhjyqUknLrE24lt8shyuts7OjvTDeBtzmg8yf/Vyit0ZPBH8is0qRIkAZOj/laf/Y5CI9uDLvUPA==","signatures":[{"sig":"MEQCIAcbPBTmg5mg/DD03UiOKappHgaSpqLpGWBFUxD5WZKRAiBvri5HUzA5dpD7X2FiJ0+3NrOgmwlAXFUlriQ0Hr9iPg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114823,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr3cACRA9TVsSAnZWagAABq8P/2EsP68tPAYJy1XiUU5n\nclm8esR7hG/e4wH9SnUrHnOpj+TM3FjyVIG68v8JkH4EXX43zOQrOSBb+4Zk\nenlMwSPobZqJZzWi/5+z+xLG4LeUhe/ouzpqFIiRBBi+j2j/9ajT/qWFSYJU\niRLJfbVT4C1V61vPUag8RfYKodNELGxVI3ldux73wmSu00kOodycOSPEYG5V\nNLUR0oszgivl0UGbQ+z2SVD6w39g5wZipa7iB3qZljK4qd0dMwN1meSj1NBI\nln7YS8uUEfux3uwjNSTmtSvbhlsiuEXhD/IF5MrNVznekxZfCi1B6w4uI4P/\nwPBcra/eDmH/dVVQCK/sMrfUk53PeCyOqP+IKF9ZkG9fOGpMUj5JwlsBGMa1\nlHIan3UGb62I6NJMprSaMdljjUU/CZo2IvGXJEwEx+uzZz5pobMsiGqy7U+P\nnagJePvOS1aj8wVPb5p52geiA1FDIbAyMfRgvk71OHwD+7u9uDt9Mq77rC+I\nRSOQue+edOXFzDT5y7WaQXNpiA2NrZRA9fcymMwEoFTcCTehOZDdt2WVZeCF\nPm7kEnSGrxT8WTuS/cJeb7ZdkkVGWmERrRm5M+6mSMQg5//Hx2hwg+FoHvcJ\nB6TuuqNhj8/LFO31Fg6kVl6FvV5gUlcJygOz2SaUHyzu6HLhCTZNvnhefHqx\n1YVL\r\n=lMse\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ea022a67ca777cdb5ba7417759b87bdc91ae301f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.128","@balena/jellyfish-logger":"^2.1.84","@balena/jellyfish-environment":"^4.1.24","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.234_1622112000212_0.40542740973088387","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.235-renovate-internal-patch-4f6b9dcee80987040f5584b0a8c1294698277cfe":{"name":"@balena/jellyfish-metrics","version":"1.0.235-renovate-internal-patch-4f6b9dcee80987040f5584b0a8c1294698277cfe","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.235-renovate-internal-patch-4f6b9dcee80987040f5584b0a8c1294698277cfe","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f8196928021d9b5662f500a3a94811182329b836","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.235-renovate-internal-patch-4f6b9dcee80987040f5584b0a8c1294698277cfe.tgz","fileCount":15,"integrity":"sha512-MnlUC3pJNKmQUczuVWa0Mm83KG10t1vAy8it8/PYpRLgLveXOuvkKFgl5ycoVoEKxCjUx1yohLNhOEpQkbTM9g==","signatures":[{"sig":"MEYCIQDCUUc+rZlUY2AazQ7WP4hLqRNW5Bv3SZvRauDUvmjqpAIhAIrGNJ1U/3jl2ppRRRCaLdZT8b2wBD/Od8f1+IcP/7Ke","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114992,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr3i1CRA9TVsSAnZWagAAFC4P/i5Gyv/W6kkXOTKvZ+WC\n9/D8yUJfK5JK1BZg7wwuJo1j+5N3Ykc+6zn3UWEsHjy9PB7SKyzxGkFLlen5\n61p8VoHu7jmDvP5qH/IXTKz8nv5X96pybKZGhA1XE55LacXtc8sIGWvwfgD7\nqpAVyvWOULZSd8wNTu9Z2/Prr5UaRwzaH1M/Hnyk+7WWxDht3ppP6ACCgYAW\nqu825E4ccDcwRvmbScym0sJ+z6aIXttYPV7bVQYSPibE6I+eUSUjnt2+dkhr\ndfZOrLfFt0W7Qnn3HCvh7fVbvYh75WDTlmltV8tNhY3liIIbWXWMppt3Srmx\nzt8tL54QZFQq251b/CUtJrPrYnnmp3qdjpeosFG33tfHi0puBHqbI0wkRyoR\nuYJoeszBE6RrKIa0oLN1DRt/6rBXm0pcz+uk6UNJyLZa3tMY1PccjPH2mSRv\nWywe+Mymzs0baJdmbByg8N0qA/lT2bxMiFbgYMJWWID+0GV3Z4R+uOgzjhdX\nhIzIIAqxcJJWdf9LpvZQ56psTOu+tjXzrI8ThnFzndwPocdX3dgUk3GE66bY\nHbrm24u/ROrD2qw3DGMjg7mqnler3vDbLTJEeO/SZtJat0BxC+8Ob7GPomz+\nYbn1Hgi01UK2g4zsR2zFh6xNZcfKKgJn9oo8dAOidXXHKfUP8slp4vndGwXP\ndAae\r\n=oW7h\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4f6b9dcee80987040f5584b0a8c1294698277cfe","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.129","@balena/jellyfish-logger":"^2.1.84","@balena/jellyfish-environment":"^4.1.24","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.235-renovate-internal-patch-4f6b9dcee80987040f5584b0a8c1294698277cfe_1622112437225_0.019911457615092942","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.235":{"name":"@balena/jellyfish-metrics","version":"1.0.235","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.235","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1807f666513079351bbc99785845274b65f2e154","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.235.tgz","fileCount":15,"integrity":"sha512-uNP+zwKsl2CnmCos1bOVvKHmUmL33wPjbP0Lku7BDEaAxPiebzQQZTgd6N/s2tNsGaPncfvrCwP4NAbtrTkruw==","signatures":[{"sig":"MEUCICFL5dFkjHjmmeYO5+jEyOrAc/WTyRXl/p7k4U+SjQPhAiEAlm4cTobS4NCU0Ki5pu3er4X1WTQogK86jWSjjXe+Ghc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114927,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr3nGCRA9TVsSAnZWagAAELcP/1kJfdBpx568gWHcXnVE\nvZWm4c4s0ZW1THVM5SftE2du9yELjuld5Zhh+lUs5y37dq1VlXL1QbVf0c9J\nuWhpETwQ0zsg6OM0fEezTkMXnPDMIH28+XdX4oABmfw65+8jn1Z7SlHuGZsf\nKqJTj0M1ZCCvChffS6h5nK8GD0FSWSLVV2M5EaD62nuB08GQVOSLQf8oiyLY\nQ0z0Db9Gn5dKwzObQYkF2vT5SmT8p6F8lhsr7oJn2CvUHG6vQ2F7RAeOmJSV\n/vqnK09Lgx63JVrA6gVEf3Zh6+DKjOmfJJLe6sH5B+4VnOsL8Cb/2lY+stRU\njFdUkWJud68O4amavEXnqXgZOwFL3sv7iSr79G03e22V87g2dowBX2bcuzzB\n39X/sectCu90pMe2uxSk+XnQG9dg2TNlbQa85UyOP+wuN2HcHf5+UDXbhxX6\n0l2jU0hwyCvFq/jncVUY4b3qER+meyYnYo9jB/dPUiLJeT/PzHBOvptTy+vX\nN898bUH80vMuhNWk4A7Q4thlWWFR8nzjsfxu0fqIbgco5hPS6KItyWYKlRWf\nZeX0r+HI3WGfMyIoZ7tAEJI6K+TiRkXJY34kSOtPtjL1WD0g3m4tv74y7scP\nasqXR7b12HdDe1+q9z3XGVoL+l7NJ3M7GbBv1osb+zkzZad82EJX17u/LS4P\nK2rH\r\n=/DwD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"eba877c47cf39d1f3f8df55b25404faead1ebf87","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.129","@balena/jellyfish-logger":"^2.1.84","@balena/jellyfish-environment":"^4.1.24","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.235_1622112710041_0.14963863542691724","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.236-repo-sync-jellyfish-config-default-f045bcb00eb221a6bacdad7ee6301b6d99145681":{"name":"@balena/jellyfish-metrics","version":"1.0.236-repo-sync-jellyfish-config-default-f045bcb00eb221a6bacdad7ee6301b6d99145681","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.236-repo-sync-jellyfish-config-default-f045bcb00eb221a6bacdad7ee6301b6d99145681","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"022be0d4f5a5ddf049cd75aa4a1343b5c851259c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.236-repo-sync-jellyfish-config-default-f045bcb00eb221a6bacdad7ee6301b6d99145681.tgz","fileCount":15,"integrity":"sha512-O18QuPOuQ8KVKvFhWgSXAzhu/Brdt15ty8NA5DP3j3417cVpiLCdMuBDSaKximSv+qGfWIG8uAHUVhE7E2DyYQ==","signatures":[{"sig":"MEYCIQDXwNHbY41QEGSpKzMGQ7bTEz3XMcrQlmNHEu6eN+mKJAIhAOEdV5pvsQhBE2oCIsuV5y5Q6GbPxgonsoS8g+emxL5W","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":115100,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr3+wCRA9TVsSAnZWagAACYgP/jJi56RmJRg+lPGn3nZp\nbKtKeioz7vKuRgeO8b/X8AKPSbw91PwoAh2026y+ELxovo9M4QNNjQNK01xF\njKxF2sp81xGcuXGCMHtq4RzgqrJGW6PqquClpp44tu7w9/b+iGIY4l6yalsr\nu5cXt7PTz858Thqe3yQ+sgPurl1TVpsxDhR+pRldSvuRfyoa044/6S/WFFWB\ndaa5686csyLvFkolRBZNvn/+PT6ghVGOxNsvPnXhPRKl+U45+OeXrOAZtHYz\n6TlhkdxNMprjoGYNMhkyXe4XfxrdkaMLBbRSnN1UrpXvhQqovOEXfzVTf9Pw\nB2fsq5BvvlRJ6q4NNTeXMet5KW+0creNQbhKHorz3keo/OZa+8iS3PJckquC\nC7e8tpclxzXbNhnXSVak5qF3VsyCdgdb6e14g4VZ3BHiry8uzj3HOZ+gbNKP\neBL/coPaa6SnDitRsX9gIKzXc/fcQ4567HHnQeBR3xNDQvrxDsCQ3u0VHZAW\nskju0gjHL5LtuMEE0gO7OiM2ZFZuKQEUb+L6ouTTy+wPJQWqVUlvb3D1HuRr\nNNrc7wT0504FW3wQTg3cnt7X0x+rCmmQEEm+6BdWyq1AtuGuO36EtHSZMEYJ\nRubN4oIZ6WzW4Tvk/gAnkGrS6igTswuob/y48F2CReoBf9hIGoZF0/xiAkhB\n6o5u\r\n=X83p\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f045bcb00eb221a6bacdad7ee6301b6d99145681","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.129","@balena/jellyfish-logger":"^2.1.84","@balena/jellyfish-environment":"^4.1.24","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.236-repo-sync-jellyfish-config-default-f045bcb00eb221a6bacdad7ee6301b6d99145681_1622114224041_0.14032904454419048","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.236":{"name":"@balena/jellyfish-metrics","version":"1.0.236","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.236","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"80b35a6953babec8427569c872482513406c275b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.236.tgz","fileCount":15,"integrity":"sha512-D2IebFBMGqrBq77tvVeEDB+Na8F1l/SW/YI4UmAvjJclUJQDu1pZ52ufL5K5GCwAh1URXgpJ135/yK9zWaJBLw==","signatures":[{"sig":"MEYCIQC/do+YBjxeyl3NMLf7Uvx3+XbeXKw9KC/tIzBER0DpDQIhAJ91bYbWK4nr5pRfPO+6VZwJ3p9QK0vrfp7QFxWfxppd","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":115024,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr4CjCRA9TVsSAnZWagAArJEQAJFPBnnVYbel0XkcXRJQ\nTIjMxWL3tip02OhmU2aHWwEkUM/Gj8VGdCx5AOSSlSb2e0t4ta3lZZDGpBGE\nMcvUvDUDfYsKUY1g8KjwmQ48Dn7pLbhn6J1nxvty/nUOPydHy/h5ft8QI37X\n3JETvqi6c3XoPOCqU+W8lUnYeN/04JbVn0yaEd3c3wGwKGXSWoxMaCgJW+oG\n4wG6yEvdYg4lDjgeJCxNgvF2LjMBEQI9106+RPRfildo6QIIhmShduvHv+uB\n6HEFUqAfV6Z9tm/Lm0lLcZPgVKExYmzJyibY6vHkDN9MvmhUFhgun7iSu6x2\n21KwFEYbb0wq9BvelH2Hxpqx3UdTdYH+O3B3k0rrzho1zjbV84I49++84KJn\nHiAgTJEy7kYd2gCXKDkDu2ukiASQoBWW8QWuz9hIeeG05KTLw3IFwP9aFBWd\nL7Idm8bL7Edg8qUidlmJJZQ5mPNJ/xtjK6VtnveiELKK7XPqWLj7feEZOrrx\nxK4W0J7x7PdStBu5RJgprZQAQFJ/gMbeK4AXdxK4SFUOkiAglfGCm1sjlCvb\nXD//znjPKSTgKnlXgKKxcqfpjJb0HiQgxmWF6QPJcOih0KUgCqLhT/FODiFx\nu+z7gparRrsBXSvfoNQmu8oV3/qAnB3OEMrPhwyendauDEuoc7FYOJRVUQSs\nwAB1\r\n=3YfZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f4716f51c97399b5e5ead0e5ed680e74a77a8b71","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.129","@balena/jellyfish-logger":"^2.1.84","@balena/jellyfish-environment":"^4.1.24","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.236_1622114467496_0.2833723379304578","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.237-renovate-internal-patch-b89fa450c68a43f29a9365474370e55b215d3b12":{"name":"@balena/jellyfish-metrics","version":"1.0.237-renovate-internal-patch-b89fa450c68a43f29a9365474370e55b215d3b12","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.237-renovate-internal-patch-b89fa450c68a43f29a9365474370e55b215d3b12","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d7298f0abc8c2bd7aa76a738d302422375b9a085","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.237-renovate-internal-patch-b89fa450c68a43f29a9365474370e55b215d3b12.tgz","fileCount":15,"integrity":"sha512-Kq7YpksM4pKBqh4TPJlkeMp0Nj/Pt/agHGMyvJv1FOyvGjt6n4fr2vflDNfCSL6BtsG3Zc89SYdAc59lyJDC2w==","signatures":[{"sig":"MEYCIQCwvofYKlNwRDSfrUS0DOzvPWbkMMAuxazGr42kFhVZXwIhALLqJpYtAFuTt4FSq9uEGyV1VsT1GT89hUhLcdFGJuEF","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":115193,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr5lHCRA9TVsSAnZWagAAomIP/35DjpTOLN8/6GgXZuGA\nUotcx7cYNKPAaDYTdQEohu0cYEZXZ8MaW0/2UcBtoGs4MVsroi2yMYmOqDZO\nwZk1jt04Nhdx/Ory1JS4CZ/a0CfRgB1UKBh3GbQp+iQjnHKnVYfULG+yYMni\n1zT+ZCh87n2chyINBaThGMQP14CivJZ7z2sxs3DbG6+erOqZHWj8UIUQZTlF\npEWAR18CWBQ6FKFTGFAI1nveGDtCYDO/Jo76ZX6JemyAlzDjaWEHqJhwFGgN\nDN6mND3kw3ZCIpd2IjY4BRoqdZkVvZHWQjLo303RXtohsckIHKX1kfFqNQUj\nsETosTEqR85GkAxs8Y4FaJMYqHLn8cWyhF04Hnr5T7neWo7Xz+UsannWd1Bm\nmTtIyojIeyqj30jFQJGpmbU89mVCJFyaWkEFJCyVLWV7/hPQXGODn35/u3Me\nVY8ojOYZkoQsYXjPpWMNDmQ0+WSxif9n71ihT2+BAoshiFJFNbMB7cSP5e75\nk3pkf2eNt5R4zD33GnOYv7QEWXJXj7nmTmRfDe1UqLuC+BcE55n2pYbcowhC\ntC+KAqMLS5IgFkqE3eDh5kvjskMt+N1lDUjpg14eox82iNxhcRUDZcNRMiLS\nt+SKhne0zdDdO3AhUOBS+8MRBJDYbL2nLxu31J+arUC7RVQwCL6e0sNdDiP9\nG0dd\r\n=givw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b89fa450c68a43f29a9365474370e55b215d3b12","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.129","@balena/jellyfish-logger":"^2.1.85","@balena/jellyfish-environment":"^4.1.24","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.237-renovate-internal-patch-b89fa450c68a43f29a9365474370e55b215d3b12_1622120774951_0.7520081169258683","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.237":{"name":"@balena/jellyfish-metrics","version":"1.0.237","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.237","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d1932f849b1bd57f654decdfe4643e95d7a04941","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.237.tgz","fileCount":15,"integrity":"sha512-BilNrUUuGWV3o2dln52ZNt2+hcj7AcIO4GKIHxx1Tt78BDNmZdo+GGPErmE5JyEM4683V5mhG4mbCE0pF0efLQ==","signatures":[{"sig":"MEYCIQDCr/wrK7fZBBnZ6k3ZSCqt8nXilFRgtUW1GGe9zYc7NAIhAOHDg6Z/N756m851CPFZiUCkqLlVCHbFDNDGgatKcrFE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":115128,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr5pfCRA9TVsSAnZWagAABz8P+wahLWTX1TPjj8MNFPBv\nMJdGT79wzgz5KRluxMRvkUMAW+miaQiVF9/BHc0RmgCh8kkKgHjakE35AlwD\nHKSbarrO38X/K2Mrp6Hru7aJAVjJB0BFIM/lbRN39WZ4DEJOkpQ+dMH0kQXC\n6/oH3b34R4aJvpRUnHfFxxnpCL3+pWqQDRG0I2Uga+iFpCVF810gz6pRydEY\nG+Wa2PWRkWbP1OTXyQNnA1+1hSc/0OAEYYTtL3GZzWhqg0XXjQvzb/h+HaaP\n6U5nNUr3Qgn6waXkXOg0fWkMUiJkoA3hd4fiF/1FPJCx/qEq5clqxu5b5wjt\n4pQ/Ql7vtgu+p+2FhETlBA/ZsmC3Cmero+6UM56nzHHki4LkdIYw/iv1SDV+\n0ZoLDo+bGUu0YzNnRSyN8LBWr15OsVs7QSrbWAITjqozMWKQuUqT+1y56odv\n00Kdv/Eh3qNKFKFxOvm+FESPUgSIncikGcIHm0HwV1X5S1ZRwe1sotOCHNyy\nWklE5/uUeQMpwCa7VqkTSQdrOeECa+nVlQRUbC8Ztip3nx8np9T7D7GhRZmS\nRWrrR99FdX6SMV7dun+uhDRwdF4UFsj7d1MgvVhBok8u0m7gASFKSOBnRzjB\nXkro9hPohCsVeJhJXpMXnTZncMlSCrB03evFsDarqV2cJPpD6YZXc1GUANXU\n6Wck\r\n=by6q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b40a23da486983bc31e06fc995598302b6e475d4","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.129","@balena/jellyfish-logger":"^2.1.85","@balena/jellyfish-environment":"^4.1.24","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.237_1622121055389_0.9664872239921263","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.238-renovate-external-non-major-1bfb11e5d22313162dd6adde9f7a4d7b213f2547":{"name":"@balena/jellyfish-metrics","version":"1.0.238-renovate-external-non-major-1bfb11e5d22313162dd6adde9f7a4d7b213f2547","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.238-renovate-external-non-major-1bfb11e5d22313162dd6adde9f7a4d7b213f2547","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5d98e7e3f6dc8e43c046f9cf678ea9a3da6d5252","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.238-renovate-external-non-major-1bfb11e5d22313162dd6adde9f7a4d7b213f2547.tgz","fileCount":15,"integrity":"sha512-3Z7S212qIOZlsePYLhASm0dCadFS+/mrrS27Jg+irSz/d43iC4IsjBYkm97yp1Edkw/wYtQOU6K74Ml8ecTBWA==","signatures":[{"sig":"MEUCIQDq1/Mo5b4sy9guaADKatB4akjZiCa4jDbrOBYWD7bGUwIgfuIGIKnYWRuO1+euG91YfcMdVYa26Jec7bnPcEsxAHw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":115273,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgsY7iCRA9TVsSAnZWagAAA8EP/3IXygI0nBraY6Hsxvdi\n8Ak8kzjpWjxcbjsiiorrLbW8pdbAkgz7m0pipeU3k3uDyBBdfBgOpwX1zA5p\nLGz+B72ZWoERnaIC4q3t8H3jVBJ22mjj+RJLbdTs9OxeO4PUJy+JGPVfWUsM\nymK4gunbpfgUTAqI972hzJ9d38dv4BJmOU9py/jwvJqBVrEPU3oPSGD5pD7G\nolNS10xaPimtYTZhItnzX1VukzsbV29lCQhA3hRxjbKIIoG8DGSE68fhYWjL\nb0K4TfdaYeNReEuxebsbx6Uun6F/dnJRyWZPT0QjQxMnRm7l8pSI2g4Ewf45\n4ViPbExJJwk5IH0+5setvh/Ziu+NywRg5ioLeRP6ZZJg3emo1tQMIoHTCna2\nPr0zkghPCLksPAn8zGXLYqg+HdwtbFNXUomikH7qQLHJP2879oMB4MJ5qwc9\nIRiRQqft4kNb4wwSwcbBW9xOX5AYzMMUmqbcC1Q/CeUxNg79T8vTM6QnCab6\nluRGeQVyN0gWPO0OG3NuWB/9Kl66Xmqg3knwg2oRQJl3PDVgAfAeQSu+/jWB\nM7DyKNRaZDFlJbpWyoIQ583Mn/knQqBnoEbtykcT/2T5Ag6vRJrUMGZWupsL\nB7n66xAGzjdN+YMEgOcc8snzokpd1Krcxyt+oKQC9UHtBGSdGUDGP4pcxGQ4\nKaPX\r\n=4qw+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"1bfb11e5d22313162dd6adde9f7a4d7b213f2547","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.129","@balena/jellyfish-logger":"^2.1.85","@balena/jellyfish-environment":"^4.1.24","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.1","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.238-renovate-external-non-major-1bfb11e5d22313162dd6adde9f7a4d7b213f2547_1622249185675_0.43766577037478394","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.238-renovate-major-external-major-91b3258da2b5d2784570f7f09e46025008658cae":{"name":"@balena/jellyfish-metrics","version":"1.0.238-renovate-major-external-major-91b3258da2b5d2784570f7f09e46025008658cae","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.238-renovate-major-external-major-91b3258da2b5d2784570f7f09e46025008658cae","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c41832ecf091d0dc8dcae57ff46df4d7aaeaf111","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.238-renovate-major-external-major-91b3258da2b5d2784570f7f09e46025008658cae.tgz","fileCount":15,"integrity":"sha512-K0K4QKgiu6ELq4t5GzH8KDpDnGrmNYx5yF1sFvFH4YE70edvJiEj8NKDkQ8ssnYxYw+1q3o7ZiwvQK7v0Firrw==","signatures":[{"sig":"MEUCIQCohcszQOiji2jwMAmXVKelpgHiNR2MeDObnUYLkSr18QIgJaVz/ccPVqe0ntMIsuyD8ezc9bKIeUIO1EqvIQHoaJk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":115278,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgsY8oCRA9TVsSAnZWagAAljsQAJX60NgzALDICrTzHbEV\ng0dk6bMffni35xev0TywFwI1OMrsS0X8OYAggvvpwZL6c62ksqx1SU8vZa6a\nux9b1GubgPPIiMAiXKPhfS0VFP5mem79HaK6RAibiaoHX/J7xq9m/EC7F5/S\n9Jk3IeNBT2jtRRGQ2qJdARpl1y1CaA6vl1Yjiu5Oy0YdS5gDCGLCnGIdfyLV\numr5eJ1OS8cdyfTrQNwHq8o63AIEfyYCQMQD/V28bKPYkpC038arvZVjNO4z\nv7Vk9b0BtX0CNYI8f+qc3HPtoo2U5mOYXhGsV23lyxwAxT1lWqXy3ZUfWWuS\nmlhxgx6CA0i9yfI+APs7gZkbvh9a+hl1VyEo1yJzUss57czgO2rkfSDLu0hu\nsC+ssEZlHuyIGO06ElEDZwB69BpNruRHdIVExMFvfAWZZ2Xr5sc+LGkhInJD\nTB6RxS8eEAfEU5RBTzfcW7J1BEHLFKKo49qZOK/7aG/O3LK0VeR+AuMmfPm4\nQmV0rVLPNert16klS4gUjSDbBydG198/HCT/XrD8M0AgyPXj9XzL9HYZX4yp\nc+kt61RoHCB7PRuEzdKIogsbl0CisR7paP9FmUayfhF1QVAQpi9C+CgHx+hQ\naCbJ41hGDXpAq04hQrwKa8PcwTrW9KwUWksb41RCsOQXbdfCgcQbhMl+s0/z\nVQag\r\n=IIZR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"91b3258da2b5d2784570f7f09e46025008658cae","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.129","@balena/jellyfish-logger":"^2.1.85","@balena/jellyfish-environment":"^4.1.24","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.1","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.2.4","@types/jest":"^26.0.23","@types/node":"^14.17.0","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.11","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.238-renovate-major-external-major-91b3258da2b5d2784570f7f09e46025008658cae_1622249255760_0.5919561427850704","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.238":{"name":"@balena/jellyfish-metrics","version":"1.0.238","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.238","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"09892e8ea41c709bdc4e213e234e809826f06495","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.238.tgz","fileCount":15,"integrity":"sha512-ExECV+/EkF09uDGnHR6I3nzptoZ24ncGChLrzmYUuMPR0B4nbjCwB7Wy4y5QvIwhjPhxQSAS0L2i34KTpIuugA==","signatures":[{"sig":"MEUCIBya7lAf1vP0bsKgrX7PJbSoauKHhJaEJ5e1b8YNdo5RAiEAiEmpgbJ0Djtc7+kMaDanyTcYmO92eIwVtp2oNX1rApw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":115204,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgsY/HCRA9TVsSAnZWagAAVNwP+wY+85nOUoXxWG9SYoID\nCgs/Pp1HlbeHqm2/u7nIz8rr3MpMsPsC0W/Czpf49bUTx6zPjRvFaKJRzmt1\n59g8YlMksFkFvk8yYV16RDwzxzWFzWqBAKF/bGhpjZxBJDSzrGnOGzgKxJmf\nTchSOHSUOz3zEMkukPDOWQw2Q5mkgNjG7iUOwAcRFkdqfUREVVS3t4OdB3ib\nvpX2VP/RHCMofS8r8SyudTd34Y9SPVZBJ2MJXWPkxYyEKwffsU5pWNuHRP4Y\n3M5YbR1vj8Zk1HY7ZpyfR81WV+OiAUVCz4SzXdfIvlsy+KPEiLSF2YhYpdpj\nHgdj93zBVyOcOaMcMLAVqkdqE9WzLxb5XPfHPBK+QT9/HPTlK36zEslZzhvJ\n8uwIzcgi+C1qj4JCJdv8XAG30Kw7oQobRHRR5c9jY9MGlECdxGzv1yPE3I4U\n12S9JEeKpq2acotV66oxIwVQ3EDb1LNWvSl4E+QeEwGji4B/Y6N9H9oSLdtB\n5g0uH61aghKiQi9myG//t7g+di+BojsFWMRficWhtxxal15wJqyJonsewBSE\nveZQ0NldJMKUEG4HV8cemxp09I6NMlo/Rig/TBKQjY5wiPWgU8lc2wIxtnvp\n4bYrJg5y5yTI/wGHkAbMr9B6ls5EprqFx/hnRWmBywhtK6iXcluMxbgFMuPS\nWG2j\r\n=vKZV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a98ee0a7d99ec15f104b3ab18943183a7b73962e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.129","@balena/jellyfish-logger":"^2.1.85","@balena/jellyfish-environment":"^4.1.24","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.1","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.238_1622249414726_0.6175025534333947","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.239-renovate-major-external-major-e246bf51b5709eff866b4c180923f32be0fbcdfa":{"name":"@balena/jellyfish-metrics","version":"1.0.239-renovate-major-external-major-e246bf51b5709eff866b4c180923f32be0fbcdfa","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.239-renovate-major-external-major-e246bf51b5709eff866b4c180923f32be0fbcdfa","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e48475763faacbee388843a9132cdd1c8c1e9521","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.239-renovate-major-external-major-e246bf51b5709eff866b4c180923f32be0fbcdfa.tgz","fileCount":15,"integrity":"sha512-lqwLfn6zs/osu4rNk76exr6Foh7KGA3N1tW0nnnyH8QThlbRj928Ed3QyRvJL49MkvZB6VfCDcSjdqeL2FCT7Q==","signatures":[{"sig":"MEYCIQCv5DeuqLdpVRu3P31JLCbP8vqSXFUytyEwGEh2zLzquAIhAJjKJc/1JwytD5Gfd1OV+Jdkk7iKojV5QeHnTS/He8YB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":115354,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgsZHsCRA9TVsSAnZWagAAJ6oP/jYRr3Gi6c88Bz3ungfM\nz7E/YTnHBD14Wofg1tlepQgKJQQoJteIgqGLwLLdtaP80zKh3aq1zqMKtyfO\nJxSGc2ovNRkH5LoFHbnl9PCFtkImVh/X7sljT5HjtUz2xR8cA7JTg+DoPEIe\nJCVVfmeGIlmdZHKfMA5evxnIXODmpVrf3pNiiH4fSeW33zcKe+ovsAzjva43\n/z2/H7QCURKX6WE6aRRGGS03qxiqK4m7yaAJrgueRdy5OWXadeugPX1Z76J0\nsZ181aNeCrWeqdCGG0KzlbJ7BoDF7ku3HJgmHStb0JhzftfyFc1cQcj9E/sG\ntyupiB/aOqHcrV/8dN9lXYhwdc38gA1oAgmvt2SS9h8usoJdAZ3kG4ehaENN\nTXOGurf/Rt+AtviG+eqDhiSPvAsdCQQVCyWxN3Hr5bP79TaxlnuFBUuYnQEJ\n8en+Xl4QwghF+WGKdxz92f2scNrdLnARdYANvyaMsxfE3rb8AwWUR708lw+D\nWj/EnbpwvQsRhy8zi/yYcL+8TWxQK1Dtlqi9sx1s85Pa/Yn3OptnxMEuzKT8\nKR5EtMKB80g6zS6XwCfmAduEHFS/v1DgJ1FKYFc9tiVlEIGlCY3sCEG1IS+W\nydByesKFC6XR3FNIliCiPph5MSh1eTUVLBwUvDIrkX/thzappvA2RcUuL+WJ\nJuot\r\n=E0+k\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e246bf51b5709eff866b4c180923f32be0fbcdfa","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.129","@balena/jellyfish-logger":"^2.1.85","@balena/jellyfish-environment":"^4.1.24","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.1","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.1","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.239-renovate-major-external-major-e246bf51b5709eff866b4c180923f32be0fbcdfa_1622249964241_0.6649134929380074","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.239-renovate-internal-patch-36f213015e06911ce57b05802423f3643639c1ec":{"name":"@balena/jellyfish-metrics","version":"1.0.239-renovate-internal-patch-36f213015e06911ce57b05802423f3643639c1ec","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.239-renovate-internal-patch-36f213015e06911ce57b05802423f3643639c1ec","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"39120479851f0e0f1d432ebea9b3c348e23388b1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.239-renovate-internal-patch-36f213015e06911ce57b05802423f3643639c1ec.tgz","fileCount":15,"integrity":"sha512-6y7831bb/i+Ueo+rJICKsvBvWWy250PslZ8exMsxE47NL0m4YxDA+5vVO9fnXI/lAFelY9obou+UgHNQntqZOw==","signatures":[{"sig":"MEUCIQDyRomI5V0Gj94aL2ujLQYoCf4PSmgpWB2vcM4Zz5zF9wIgP1gYTxoMQVL1Q+L/+zrGMjn/bTIsi6JTC7I3BMYNewM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":115341,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgsfFkCRA9TVsSAnZWagAAZ20P/irFEzAPdGraUcQoHIX8\n1EE2IzjFWtZG7mCG4BNC5qg5VFd6XBaDEwGmQ6nT3yv3ut6DpLRmR+MO0S1Z\nwnVxqoW2iHWWZk7V9r2q9jY+hx1aLjziOaTRL2ttwfrf5FeUa4lrUIQnE2i5\nmdm4KHHn1pXQNdjrRKIiegfMK10A6U2IMG5nm/FRypw+PNiQRpnrhthsh1VM\nzIXgmyYa1WOZid5BEiHFrsgcAP/p9GxsnrGc/tw8/MdjbpdJus1RcXxHTWZt\nDiKAirToUlX4uYkbeaLT9IJluGICRYN7orZ/X7oQXn3uOUcjHN/TGG0eMx7a\nZTe6q2o+2fTTmBa7wjZWJVvjfg/UzVx1GKltrdaz1NlGfi9C6OGoFiGUM1mM\nRYjNxorXbkTraWIbWwNOHrDmhxmkVlO6qYZJDk+oTYvJD1LCADaq3xc0YW+Y\n2CfVvCJ2fjEIiYpkf6HdxGQDzed1k8MUn3S8OcspRFmjtVrnQLFEXRplRXKo\nlAhppG49iguiH0ljDZjn8TQP2GTP2jtab4KTc4PJ9H/G0vnzSGKZDTKMnLG7\nGsdq4WetPefxtTPmxbBTbYIZk8Tt//xh6OqunBqjVgR1PSKO6+x7/yHeM8Fw\nlg6tr9GeDDo900KG/RDLrUQxR9Mb6qgCe5ZadzziubIcHrYufgppw8BZunm1\nro23\r\n=iCyc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"36f213015e06911ce57b05802423f3643639c1ec","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.132","@balena/jellyfish-logger":"^2.1.88","@balena/jellyfish-environment":"^4.1.27","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.1","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.239-renovate-internal-patch-36f213015e06911ce57b05802423f3643639c1ec_1622274403890_0.4458691701722386","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.239":{"name":"@balena/jellyfish-metrics","version":"1.0.239","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.239","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cadeb42930c56ac79a4d213cf3e989346f47111b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.239.tgz","fileCount":15,"integrity":"sha512-Pl3kYm9ZwUJ5PdrhGPODRMSLWIl8Uoumid6LBM8mZQ+xhC+UtUTL1vdb4AB3MdW1nbYroCUkNmTPQvBT21+UEw==","signatures":[{"sig":"MEYCIQDTsrJfN7bCOTGKnLxYvUbDB9o6umRSshrlrOAwgUGoYAIhAJ2g/uE896f7rju4sZdMz1roFt3ZJ2ZZgDtm0KXmD4u1","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":115276,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgsfJHCRA9TVsSAnZWagAA/jwP/3ij9OhJCgoaeaZ9oMnz\n6P2Ohgd1QWzF5tpnS7hzMd2N+Iu6UIom924d9TWk2NjSUQSQ8UL9KUajInVV\n3ThgV8TzdCuN/kVL0N6h//WK6lPHwsocM2hZrA7jsrtimCnRQFXmzwJ8apTY\nj56KQvVsA1pmJsvCT6pEChNSEtD8mLFoNK2AyNEV7BB9So8cocRusMW/fDfP\nMuCDyLC7jnD5DnAl5anF2LcVz7LvXeQQTAyI2Jq3HMTLW2Q5M8i/6MB5ueIp\nrAKQZzgAtLEprlHImx2ze/GwLDp7P4NthsWRcTkzDfr2SGtGjOa1Gf8chNIV\n/uP/3pp9ZDk8YbonhdPnUfKkY1HtvS54wizReDntShe87gK2Qsk6Hm9QNLd/\nVDzgoG+biCpn4a0v7pK0Lw0IQosMI646zN9P2tTtekCb012unmKiae5Gg+NE\nW+Vnh2mHZSBT0Q6a/KHs0KOuw8FWIoEJMZHrIAs9x1las6faz9dtiIRfV9Qg\nkc/AFe9ln6eRAlBUXYzkwOp19aWInQEn5ox+2MmuFMJ4iLQ6cnTmmNkfH7YZ\nJ9hxcLToiZsTh/BiyT5SgI7ISYLbav+nOMyoX5mDMJwzBm9Pr4B244w633kF\nHh44AMaqi5e0h4Tmlc5AxD65wuT87BxoLXQy2GUXF9KwD6N0xdb5Ta960w0C\nKIsw\r\n=vyZF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"179538e30211c6c8783b6dd49437be3a068c6bee","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.132","@balena/jellyfish-logger":"^2.1.88","@balena/jellyfish-environment":"^4.1.27","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.1","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.239_1622274630730_0.8333967876240564","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.240-renovate-major-external-major-1ece4fa4f40627d71a27a80ce8bae951503a0340":{"name":"@balena/jellyfish-metrics","version":"1.0.240-renovate-major-external-major-1ece4fa4f40627d71a27a80ce8bae951503a0340","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.240-renovate-major-external-major-1ece4fa4f40627d71a27a80ce8bae951503a0340","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ed7a2a5d894d76042c5bf6827f8d7b29051c2456","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.240-renovate-major-external-major-1ece4fa4f40627d71a27a80ce8bae951503a0340.tgz","fileCount":15,"integrity":"sha512-weeRugoKAHERXLRDmkISMNl/b+3rz9+f0KFhKjGBau2ikGdWUrTwJXtDiXoF/NgzAo7ti8vUaJeFqk1vJEVAJw==","signatures":[{"sig":"MEUCIEZjXoTwiNlz0bn+X8YBPzyK20cFudpbq7HNLpzgQZekAiEAhUa7Rgc2fxsePOxOsFhtSo2LHdQYlWupHeHDlIs0h1U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":115426,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgsfNfCRA9TVsSAnZWagAAF6cP/0fH8xipaidXW5p8Qwfv\nS2f5AQAGScMYFHiF9rqwt7KoFuRH27JY6FXzlB2V0uhsik+e7Waz83g2f6JW\nZQ35PU/UvvBbhlVn14Fi1Hv8HnmJa3ABZBf/ftqZIEbcnITZbDw+4Wg2k7b6\nxN/co0Q/rzDAIglJYC8s34jTnam++GpVs9M4dBrFDsyIcxUp3dRaRl074IWe\nGgzHLv9tYV+WuCYnqrATP3+B9GW2bbGd/kdCod0GB2xjZeqrhr0vL5B+IYHn\nLHvGIyriGQY6uvzI5TpMoS67RWT2nZ0/MsReVcehrt51ACe3ilgt/vjzjOlj\n42SnBll5SGEUhJk+fXrZqznkASp3oYYRAQS5/d6AhyQyTs5m7ZRCBjEnU0VT\nDSTzDfN1ATwo5Q02lR3B6s5jzOvXP5/SBk5Wuir6Nz1TiCHwa4+mm8cFQvRS\npTvVh3z2HFYR630lct1FhOzMXATZKGCkoMdWAxdPgHDzFyzcUSSX0Y8QBD5f\np0TlU5E3tlmoD7Jj2/JWuuqDswkMuRmAPfbt35EPKpni92PSkG/hogHdnCTI\ncx1y/zcVi42+aqjKXC0OaVAOHm13xnusmENr1F0riGb5yrOiKR/Twzo/wH/7\nrhHdV1E3qEjEcwvyyXOluto7bCKEm0WMPi5TgPdHkMPsW9NUM5TXn3Yw6K5b\nKZdW\r\n=hqdn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"1ece4fa4f40627d71a27a80ce8bae951503a0340","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.132","@balena/jellyfish-logger":"^2.1.88","@balena/jellyfish-environment":"^4.1.27","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.1","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.1","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.240-renovate-major-external-major-1ece4fa4f40627d71a27a80ce8bae951503a0340_1622274911431_0.6095377727900397","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.240-dependabot-npm-and-yarn-ws-7-4-6-2f41d09a0aedd3ba9fce4740b3763cc5e02bde09":{"name":"@balena/jellyfish-metrics","version":"1.0.240-dependabot-npm-and-yarn-ws-7-4-6-2f41d09a0aedd3ba9fce4740b3763cc5e02bde09","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.240-dependabot-npm-and-yarn-ws-7-4-6-2f41d09a0aedd3ba9fce4740b3763cc5e02bde09","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2f12c55dee71e72920f94fe104cddfa4079ac9ce","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.240-dependabot-npm-and-yarn-ws-7-4-6-2f41d09a0aedd3ba9fce4740b3763cc5e02bde09.tgz","fileCount":15,"integrity":"sha512-Thlo/vdGHRYta0+5poMpzsdaOX5mT47CXE4I0EbeTKojOlmlk5v7yoBWC9/HM6Ohf+gH26l22tFdAv95OOEANg==","signatures":[{"sig":"MEUCIQDLzzpZ3+qqu7lqDsiAlnkCs6ilDpSEGqM+uHAGsybfuAIgTeksE/q+rajdNwyMbGD54b2pLnLX4DzCim/DAPGJja4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":115437,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgsfznCRA9TVsSAnZWagAAGPsP/3XHdPw6d3z1mBemL6qI\njE4n3BQvdvHkYct2qnRlhj9qcjd+xpgvYpdYHauP+iJVaHVKupPNLQ9taENF\nYnOeg15nfukb1oidGY87yVGQ4LsU+w8El9Bs68oNQGJNhELVME3tF9+Nbx5N\n16xMgocmt2HqcnH1Q5GqJX3TWgxPylsmTnjLW3HpbXdttdNlLd71eFfo1LXI\n+oVSebMCyn68G6VMW25aCgZBPOSjrVOEgzl8kmST5hK0+hiC1TjgFkRkFzdc\nWwjupCUtl5MVtPjVosY0Y7nAUhkoQStclS2X5grlXA8hiCyNRAqvc0uhBc8N\nbWgaPzP/JGzYwZgXMshsEKgV+rJ/5kPrglr2pvE88QW56tQoELAHIyVEMlUP\nQ9CB++DJCP29kNXdKdKLsimv3nsJP/Z+MutBxfrogFIPQksPJF/EbhGaCV3D\nJb8eXi9rCsUJqQSq+EJJ3BXdXNKYrDTWSJirvwB5gP+lF6M/DV3/pBoX2UEG\ndvZ6y5uxZaxCmQhs0RZHcgfIvy6edxFnqQi9cJhD4JEG4riLPCd4cU45sz8e\nZdgNzMeiGzXgCn1PC3qSDsjVP8k75/Md+5627xVz9bzaDYzEcC+7neltROXa\nW9B9/By3hgy2E3Oz6M7PMvzQ1bIqpR1lgX1GC5Wf98TJHMnr+h/jQP3bdarP\n9r6g\r\n=BAzv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2f41d09a0aedd3ba9fce4740b3763cc5e02bde09","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.132","@balena/jellyfish-logger":"^2.1.88","@balena/jellyfish-environment":"^4.1.27","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^26.5.6","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.1","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.240-dependabot-npm-and-yarn-ws-7-4-6-2f41d09a0aedd3ba9fce4740b3763cc5e02bde09_1622277350460_0.7576438137566561","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.240":{"name":"@balena/jellyfish-metrics","version":"1.0.240","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.240","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"991aad1ff5cc5c6283babbb4d8a0084e33958714","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.240.tgz","fileCount":15,"integrity":"sha512-zsa9KfMAR1Yh38slTALizJPxXh09Bw8xP8kzCYlmRTg7s3CNUofePllIGb8C96fvW8cAPpEBAJYyMe8PV49lww==","signatures":[{"sig":"MEUCIQCWHtSv3YbwENMqAfnK0+JKWUZ2HQvFW0vNlvWmsEuUlwIgONj0LYnZ8TF2h1hNC4Sq3TPaPmSECqq46EhHXAIso/U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":115416,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgsf3aCRA9TVsSAnZWagAAZsYQAJzp82zLIYhXNcyCb25V\nvWLaG45MLluvEXlltJRqUBhLHmhU6GZwfOZgcsl21SwvulaelcURFNVzSV3n\n9L/sVEHtXftQz2ddiGkVDS3dpgtq0tLkuVD4gfbTBcnLRcaem8/2YwDjO+xk\nJ7wkg1ZlojYUFH5UWtDH7hpYEs04iJhJW2M+uCjubxP3ucC8aEdbwSmYNbOI\nKrpgzHL0oK4bL96vRwmgZiMhRurBaidPCSwvN6lmfR70XGx2/Era0tiENTit\nwvZsgTyaZvOpv8ozATIabygDBxq/lZYkXuavDSjAH8xU1WjimmIiWykvZaQI\nwY7aJwarGCG7t976zmja5Yspt+YIVFL0nBWj408D+2d+qL/dd+JW6Cksn4nm\nYMxrtZkv9oPvD1jnfRwq4YGjOuEe1xuT7N1gpMN+uoMi3+Tb375AyeFyp3y+\nBwrtF+/tlkls3WZ9LhrOyWCHxMUtnOJjJGujaPa1UX0ROVDbqqVGHi15I9MY\npxQHJI1P0aZHc6kEABfA3lYwibridvMvb37pvJnzVtwOoqL2yUW+GBXK22w7\nzLhAmbWbqMABPUF4DAyhGr8NYnu5XwD14oBFRHVfgVe+wbSQOcuortz6122I\n7+JqiuwpweM7OgwO3BBU6whHGEvq7+oZcTq2aM+21tBZ8Ca+ilTQeekZyLp0\npgu7\r\n=qXZI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5e59c4c61300bc56c0bfb85ff8e9314f7483e0f9","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.132","@balena/jellyfish-logger":"^2.1.88","@balena/jellyfish-environment":"^4.1.27","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.1","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.1","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.240_1622277593973_0.5870226135884358","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.241-renovate-internal-patch-01b8aea835fd1a4084293a5cd236554047f7e600":{"name":"@balena/jellyfish-metrics","version":"1.0.241-renovate-internal-patch-01b8aea835fd1a4084293a5cd236554047f7e600","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.241-renovate-internal-patch-01b8aea835fd1a4084293a5cd236554047f7e600","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"536f583d3cdcf87bad7a13ce7b4bcca549cecf74","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.241-renovate-internal-patch-01b8aea835fd1a4084293a5cd236554047f7e600.tgz","fileCount":15,"integrity":"sha512-ACFBX7IGkO1hVK6No3rzChuTavNuohYKyXz9aDT/0OB2paoi/BwuhNOsWaOqtmfeI2vnY5j81mj3m9hWKTNp5g==","signatures":[{"sig":"MEUCIQCfKeEfRximIJ0R65g2dCRmFdYncmwmLveLDXtmZDyNCAIga036CIogIsyNAl04jbH+VoaU+XkFH8ByTdFzq6WncT8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":115524,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgsf83CRA9TVsSAnZWagAANUMP/jScgqwmgipmAaPTDkRl\nL5Dwdz9pg77l3q320v62St8o3Azz6ZBrul+Gd86L6mV8+AYZjOZ/fJZYKULj\nQp3HqC33J4NgRoFM7VekW1CWBL9OdcqCfOiR2bePH5zLcAiR7h+pvZNfMP7p\nCxmryZWMXtLkZr5UkjM+u3oeidqa2NSQci4XIRqjg8umUyd3/sbH2Y5civdL\nR/U8g8aIVG9E09L3L+RDg00RNzGZ69FnAkyoLBPU2C5fEspdCUdg3wMMujvk\nncnLWoFcRYLb7X+7bur/C9J0FHkcB27y4kU5CF/TXu5ZwaMrNOD0W8wcDDhd\nJAzfusnQwnne1HYs9NNKBuhXKTX2e5BlNU+tnj9JuqbCBbsOGJRuKypo/sQ7\nM8pnm8HYX8r1Ac10/37v1O4GMo3cJ3gk7znyquSQudufgVwq7Pe7cUh1zwa3\ngCFRhzaDs/j/JjHmF1/+xN7J0+tTtAptr1wjJM14gfw6f76iTydG89OyUkMh\ng/XJwTHENFNaUy6MDiXLd5m8HUn04aDBvhOupTOdRyjUS5pwbW4fn4JmfUb2\nNvjYeRQPFZKFo3WYIFkE6R4ciOz4JgeIUCtU1LTn2nMzur+7uO+xcRkyL5oo\nsRcgO6nxt/kGxpw55cC4/nDbYufXt2V3gJV4OAzzFUBVVtlDJUzPxmQ7Xnqq\nXZyB\r\n=APaP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"01b8aea835fd1a4084293a5cd236554047f7e600","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.132","@balena/jellyfish-logger":"^2.1.89","@balena/jellyfish-environment":"^4.1.27","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.1","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.1","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.241-renovate-internal-patch-01b8aea835fd1a4084293a5cd236554047f7e600_1622277943056_0.3895231868967759","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.241":{"name":"@balena/jellyfish-metrics","version":"1.0.241","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.241","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8f60db32b3e2460c91641b235d93074d945ca971","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.241.tgz","fileCount":15,"integrity":"sha512-dLbXTikD1qffyKoOOjUMgRy/VPpgT2l2Co83iGYB14dYUv7UcUp32EAtiCy7eeCd61tHcsDpOgIOl8JsJl1DNw==","signatures":[{"sig":"MEUCIHKTTvnoGss7891GUKLrl2R3z91tBwi6WI4WqgNSixQtAiEAiK3tnvmzuRciE4w0tmhkx/MO7307uMpxzUsB07ZEzas=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":115459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgsgAVCRA9TVsSAnZWagAATR8P/RKc/j1ntscIJdKvq6Ap\nAS7Kpz9NjLgwhZliXmG9xr5ADc+Myna2oCCC0ZRkY+Ugi1xsJJUS/pmvqPzW\nuCnlyay2jq55+7xZO2xYG86uLNuh9DaxJ+r8RVL8cDpOU6A9IwcJQ8hwO66W\nLf8TqtqUdSwTWfw69Yp7BRDp2eP3kCM6gvETksWUGinTIuebNqRGWL4IFg+S\n/yBRFG2tcCkOBzGek6Fy0NzentaJVU2UKen1I7c5hK7Xi8/N5glILgVGIQny\nB4/CLPF4tTTJKje9hr564J5uuparvfoQvhXVdo+8INpZ9QtcUN0kfwuPf4xC\nrgKcKvwZAL6bVbIDmdN6K3sTSx2moTu2VMLyI/GoOV3hWMAGXdTap/akqhvQ\nWhpr2wpm0cjAiiZ/COS5gMG+cVJTJruBt/BiSZW4Yrog3ZNfD/MZ9KNpOMcm\nDWcMeGPID9bS2fmL2gqv1Rjtv1vRg7E50fop4elczYleO9V2KiXFYpHvjJg8\nPUSwaqTV/fQ/gSWZRalbOWULp07nWGt47Fz1B9VgY8GN2d4r7tQgvPrcjzXx\nQltgySUjbfy/FRrDW9lvAyva826+97OkJloWbCSfCv9/5WPBI0zJNrtq0uYN\nCgOETfLz1a/yKxxbnCaAslUvzAMOlPKC8A9iOJ/m5Y0Swx23ygFkfFamEF18\n9I+e\r\n=KP3L\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e318b348e8bdfe96151cd2a30f00db60d1caa953","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.132","@balena/jellyfish-logger":"^2.1.89","@balena/jellyfish-environment":"^4.1.27","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.1","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.1","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.241_1622278165386_0.6932959920456321","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.242-renovate-internal-patch-61f677c977b23a30df290a5e214a32d8a4147fbd":{"name":"@balena/jellyfish-metrics","version":"1.0.242-renovate-internal-patch-61f677c977b23a30df290a5e214a32d8a4147fbd","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.242-renovate-internal-patch-61f677c977b23a30df290a5e214a32d8a4147fbd","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"40d9a585125b1a882a5483f96ee4f83a4623cf57","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.242-renovate-internal-patch-61f677c977b23a30df290a5e214a32d8a4147fbd.tgz","fileCount":15,"integrity":"sha512-omllRBocSN3VqOaoQ30FXnhxqqNpiE3TuGXZ+XPrbBDX/7RewLEcjmVRqZ6prZMADRruk4GiZUcH6ms2C7LbnQ==","signatures":[{"sig":"MEQCIB3sfIk9czJ62vZEHhSqonAYr5eEE3CvwslvLV8KNwKeAiAv4hmOmy4+xmHoGvKXbkFLZn+DcEn/rC8rqs29ZA+yeg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":115628,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgshIQCRA9TVsSAnZWagAAkZ0P/08jl1D1arexTZqpu/cI\nGmHvopiOnAqZzOKKlcFrpXXm83rW/vMhr55lihkmgJO9qQWRfnvx5wps9ML4\n/9I80uiZzbtTYzbMgFblQubwU89eJnWv10cZs6JCgGKLqMuoUzG8S3dt+k6C\nJZ6n2R5XKsRtm6MNTz2PvhEA5xLWpCPvcUam0xC3HwJz0QHJVPoD/B3vgFwm\nzU8N53gEv4z6Xf+VLvH+L1mOGWIbb+6aYAZ65O/WW9oh5tDVO21yCDJHJ81u\n2HgJK6wfiuTPO8I1GmGzb77AVpdlAE1crOUc64Y/llF/SCNBub361qxg253f\n9MH2VIJ/cN8DG88RcUyuC0qQLLWTfm3xpjwkP1Vd4bCJzKEqfFV8y4McyVRr\nGz2I+Lpe3CpIu3+agqLY/1ydsRcKWr9s21XbQYb6sQ56XvylPzYKot0lmIwV\ntVohEypRjbpLPuFF6avPRYmd6p0PR8QGDo3NW9S03Qsf7XSqaxmm/9vHd9XT\n/3iRmBsx64b9XW/Jj1Ce6H5a+HTqOH901eSVa4wvxhOLU8AkvLOfl1Pr1jO9\n+NucLooG3nMrg4Ab4CYJIRhjXNMEsb52WqkqGpaP4nGXqOUsJ/Inu5tQH6AH\ntua66WbDA6S7r5pJ8l5YxBju3LbYehO+njjwDnizwgvnoXTVBNCGrDKZR7iq\nmWN8\r\n=d4Nx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"61f677c977b23a30df290a5e214a32d8a4147fbd","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.132","@balena/jellyfish-logger":"^2.1.90","@balena/jellyfish-environment":"^4.1.27","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.1","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.1","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.242-renovate-internal-patch-61f677c977b23a30df290a5e214a32d8a4147fbd_1622282768419_0.5449659230650716","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.242":{"name":"@balena/jellyfish-metrics","version":"1.0.242","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.242","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"dc9b3a88912fd358025e16757cdef819defdb088","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.242.tgz","fileCount":15,"integrity":"sha512-AAB0yflrCJJFLqdvgcc3T0TcBqU9TarF15UDwu8ct+vodUSepcHs1jotxrOmZO3+f6MB1oN3/1XQ9W4UnVYcyg==","signatures":[{"sig":"MEUCIFlphLID0+nguVXv0dyVKyDABpPuFNB0r6eCZ6vu21VVAiEAkewuWfyonpuczIszdIVTNL9Rfc23kReltkriTjw6k2Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":115563,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgshLrCRA9TVsSAnZWagAA72YP/jABwQJOYfoB2s79WLWT\nWwiDz+07iWQcFxxZFp8xmHXe6M/orw3rcogn+uxbyJ3NeI3lwgQXOc7AaU7k\nNlF4tdSCXUGlYFK24Vhb2ENl18013tZ8ROmj/7p6zpFRauVbaWW9aAIpJV5B\nlv1q5oNzBwaxGHuymjZLTFGgubFg3ggaB52jZL9kPMYVPlsF2y/sFZJ+UCxq\ntzfQDrUVAKzCWF9rr2sT8AJWBkuT5hQmX9whymdjUb857CKuM7FBJqIlI4C9\nnfqoLaUitNxZi9UxWBI+CqkDAOafpDkBKZsTCcqMRx3VX4cjYLxm39z/q6AM\nMRzrXoIS8j3WEhCkXRyI+qNUxJy5+KpXfknpe+A3iHN650XlzL+WnLQICXkL\nqDoGtjj/y9S9HQOaZZHjbfI6Gey9/pnu1g8DG207lFipmXH5C3PivpTb0a7H\nuP2sn4OG6yl516B7v3SYklw5TxpnpxYdcvb81Q929RZZs75a904KixGWnizz\nJAFCoCQhOvEo4W5tDY91IPc517dK/q4/xGLgysOHZ5lvtxuSbtiGE1/uhFPn\nUPsirFyHzgJGWi9p0+zjGihZqmQ6oLmWfCMlkqRkiXoRKh2ncQqrbOYcczwe\nAPXEf5t3qsAtzW1U1Y2WLrbMr2qWWl/T6gHPZcxq0zONSI7neKyh8X2ofkKu\nPggF\r\n=+WKy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6f320d46cba103d5bc08e82298bc3e2354956ad1","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.132","@balena/jellyfish-logger":"^2.1.90","@balena/jellyfish-environment":"^4.1.27","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.1","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.1","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.242_1622282987065_0.026160271164425986","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.243-renovate-external-non-major-7173e98cc086f555989b44d472aea9225675a0e7":{"name":"@balena/jellyfish-metrics","version":"1.0.243-renovate-external-non-major-7173e98cc086f555989b44d472aea9225675a0e7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.243-renovate-external-non-major-7173e98cc086f555989b44d472aea9225675a0e7","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0d6d927ef478b7c0e7002e0805e1054d7da14340","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.243-renovate-external-non-major-7173e98cc086f555989b44d472aea9225675a0e7.tgz","fileCount":15,"integrity":"sha512-2WmkHsc3w8hSnxxbGJnZCfImNyYDRjR3RXqgUIuHYbdQgjSD1NvSmK5vN47D9kKeam9ZOmborlRrOlESxlCdJQ==","signatures":[{"sig":"MEYCIQCAFShtxSaVVuDKMF/ogScldvVZ5Vui0leg5gY6QmxBtwIhAMo1V15XJUaV1l7X/6+TZp2Z+hEPQikXcGb2d08v1YBO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":115716,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgsjxWCRA9TVsSAnZWagAAonwP/1JLxaA6KW2QZt9phjdF\nlpBObdV93m1gpCMOkSS1+su+HYvNosTnMtX69ejQ5aH2SFJESa96FEfT+9Cs\nd7Aah9jfDE5rl7Fq9X7IQNZorsSrKw4BvF3enczzDoMQPHBCl727K5mDdyHv\nIq9qOZyfWUU7lWxDL4VUAnYucLJN/cF80XnCd/IwN0ZGnCRKSrxNbVfFOWJL\nX2ZGz0r8FPXHiCku4Nfm+6VWcD59nxRvYEYR3naYgmDFUI6hGL2BKL6ZrxS/\n/dYjx580BturgQJQ0zuU7mf6m0Pce6fDGU6g/7SAXaLzOzE7QEtcgIiAVU4Q\nK4JfKj+3C4pCPTsh5ulkw+1BJUanZeG9zDGdsObnXTPSBvVyXcN48R5nQc2b\nsSJo62xkMJS/uKUYygw8FZqPyUfsG9+bSpmwC8e+HGuVyH47MsJOrP4fvROo\nmHVz7Jp++qEx8UD+V6/jUBBPSNi9bGeiXyjRXqY67Jw7Ws0aTw9oNs0PbRqL\nf8ujgG0Pw3bwT7iGnJ2L9AokXvhUIYXFbXJ1JQiLywJzwFIRhQsMSojQBefA\nBOvhy7ItEjBGKoRqyFeCzM76eVCzz2ao/U9YFyrwQBmbzAawaaGtPhpVNwjt\nZ3sjr9V2hzCqAFI4aon2EBUQKQQV6HkJUklug5kSsT8AeS/tkD2pueKHwc49\nUSJO\r\n=gVAf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7173e98cc086f555989b44d472aea9225675a0e7","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.132","@balena/jellyfish-logger":"^2.1.90","@balena/jellyfish-environment":"^4.1.27","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.2","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.1","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.1","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.243-renovate-external-non-major-7173e98cc086f555989b44d472aea9225675a0e7_1622293590137_0.07564514474998751","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.243":{"name":"@balena/jellyfish-metrics","version":"1.0.243","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.243","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c6b13e241e7a21772c705bc06552055e4df96764","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.243.tgz","fileCount":15,"integrity":"sha512-Z2VTVU034Ped445yq8BkV9p7q//iuPNjNWiJzWjPgQCghzWJZ3LkfBmjB6uM2TQQJHncVpXdccBL+UGOuOthwg==","signatures":[{"sig":"MEQCIBOZjVW50/s8W9Ew/0PpwtnqGj10Z/S8pHK2rDgpo3cFAiBTdTpiq9/HGI9ADXXhthCqclDCHHbHGlle5ooELUX8kA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":115647,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgsj0aCRA9TVsSAnZWagAAT+QQAIn6uXNN3nLyUjKU7Mvq\nVP1EUEwVwRVcgOZDzLSjFTYuZ59O0wzqyUT1kOXYAh/q+ZD9/WKnwJApgmOO\nfZ7UaC/LWAB06IlVnm2/37JOB9rZxygjgvFfLZmu4NYRrdrGy5vA7FYxpmRv\nHi/oafXIRw0MsesCGc8s9u7GsP3MSDRw0rE/61XgfuxbncywEkS6VDf5mOwd\nSrrvcgEG5cAghEFgLfAehT0uYMEG72r1uIV2rFb/eoLPwVxaN0Em1HnqrKJ9\ns7gc4gDizzvIZ2RjOV0a0qC2KY/ID3QCCpW9kN8sVqw9ySo1ZitqYKP4Frup\nwxEULBiQn/DQ3qJg3bxnf+6zBfQn5GAKSJ4Cnd/7iZrKMFLZ0a06GpaFeRYd\nTiu41QF8UcUSoQOnU8ZPiB23yWVWNr6k2VbNnCldWegKWS0nfhCj60GBu13K\nsuG13n7RPs1qiY24BrZty4in9Mu+HxExs4XT5Se21rNILolXErtPEWWaGun9\nP1LepCIgNNrFrRKd5XVw1fer1XiDH9Mt8aEgicYfmJedbpzKJ49klZSE0b56\ncyaHJmnC2ZM4NxGI5CmHyR6o3sb/HvEbQIoYJGUt8iJw8i+putD+RrwY1ZOG\nOFhVfFrypm/PyQ2NQ9Tam/QM0gL9oN/4MbmUPq8l/LeVVqeAoHC9fNSkMjLK\naFhN\r\n=n4wu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d120384ed4770168dce4231d57dad9464042a99c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.132","@balena/jellyfish-logger":"^2.1.90","@balena/jellyfish-environment":"^4.1.27","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.2","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.1","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.1","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.243_1622293785866_0.7577012123031264","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.244-renovate-internal-patch-3b9d984770792a9c26db076edc317582321f001f":{"name":"@balena/jellyfish-metrics","version":"1.0.244-renovate-internal-patch-3b9d984770792a9c26db076edc317582321f001f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.244-renovate-internal-patch-3b9d984770792a9c26db076edc317582321f001f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d0bb09190135d59f80a40068da7386f54aae20f1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.244-renovate-internal-patch-3b9d984770792a9c26db076edc317582321f001f.tgz","fileCount":15,"integrity":"sha512-27ocPsgopDSl3PLRBnMFuR5AeA+9NipdIT2LrVSAE3wsCgONmNmJSBWYfFWbukb7PS0/es2vAeiaGvx7i1UGow==","signatures":[{"sig":"MEUCIB7YVuTNIUcWQASD0IaVrg6DMo6iCgIN4iF/piDFv6BXAiEAjm27w4QlGCqisNMJozsafpydzHtw5T7id+Pt93AauXE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":115784,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgsk+vCRA9TVsSAnZWagAAk28P/0EVCT4Qd5Th+GhyV+kf\nKCQ+fafumFhRNAEl9f8UJJv7Y0QvyMMenq8NyzjT+73BkaZ+GXkZI7dckGEm\nl6kdf5l4tAnf9thk4CerEoVGRAPFxryrT+2FGiMUolOOUoPe1PZ2SgfxqGIo\nahoKWTutFuHDDM4BsqfkgUtqt+Xtp9p8zuwj+w9VDHMRVbCil8Pl7pe+n0iq\nMfeIqzejEPlpPeQGYroNCoSIzmuYEM3KNRHQFS7CU7UyBZHUotNEeY69daQA\nWmRhmowKcfqJ+Bkwqhp3lEw2fYImFJQHw65PfSKEVusB9QstnmHldxbqYSIp\nCfw64Wwm47+vidxxUKgLOcUR/L+1z0YmzqvwkfDd7aX8lKmAbAwC+rtd+v1h\nv0b40FYp3Zs7j1GJSo4qt+DTHilGgYlEnCPybvoDaoMm26Lm9oDXs5MOv5TP\nt7Q1y5izh7ylHcm/gXHxSNB5B939jo9f7mHVKkCKDS/K+MyQORfItnKrz2gC\nCJhbWvn/EGcHLcUWoccxD0hILfcoS9f2T+55oqtH8gltbTUidfuudcZ+Fl/j\nTgShx0xtcUxMJUPA1FW82L86U+OSy69rD2OUh9+ZzFNPhWwCpo2P/Buu1wK+\n4jjdz736jWrIUahWEv7XEAR+8d0MX5hX7R33TKkmqvwCJEQcdZHV7zegF+uj\nJZXM\r\n=kexC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3b9d984770792a9c26db076edc317582321f001f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.132","@balena/jellyfish-logger":"^2.1.92","@balena/jellyfish-environment":"^4.1.28","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.2","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.1","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.1","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.244-renovate-internal-patch-3b9d984770792a9c26db076edc317582321f001f_1622298543194_0.709033817639656","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.244":{"name":"@balena/jellyfish-metrics","version":"1.0.244","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.244","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ddc7555a25ccccd3481dc89facec4f46c2746775","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.244.tgz","fileCount":15,"integrity":"sha512-l0ltP3QkHbjOuv8ZmKV4JOgGNGldF8Qk56Wh9Dym9/b4pLupU2Co5eJ4FTdkBLZDFGBUDflEPKA21bZ67Y2hBQ==","signatures":[{"sig":"MEUCIGggxWkTiLtRtplRQXoRMwpGHCHNLVSkFYpRWPPFQr1oAiEA256SdzshlerFyUXfzeYfna5eVpLMWJydB8uce1asu+w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":115719,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgslCNCRA9TVsSAnZWagAA5e0QAJGBk7AO/t4MGGO8Sq9t\n1wSj3sZMD5h1w1TQAq7AvCQ8o6Vwcr+mu0RIlDCaBcLsl2GuDrf9/ELvDMkz\nb0Sbhr/XGValGgvSiUwcezquz9MSV3eDVa1WR0Y0HOj68Uii5oSlq1JCnH0j\n+RETrnuNc0XlDk/KSw3+0g32M35D/UfWqOpcq9c78MDtC53t7k8PVnMAS5Xh\n8qGHadf6oimGwk9cuepruh0ZnwzUdqipAYcAWOZXcNi4/oMpGFRlMgN5vHwA\nBsCcu5eagumfuEVnTJTZoSnzx7z72vEfYhxmaro5LcORgV2jUxjYJVd6qXJ4\nSkcdHogbxvh8QEcVXKRLNqAhW3uQ5HEzVnwcEGzqZ45InVABrspvSjA0r2hI\npdasXw07kzHIv3mLnS63qhrLUcp7ooPZFA31ds7P58eMIeRFElx6WnMC8NoV\nia77CSWt3GWbAJDbk82DWDhpSBxFIreNXm9hEQfOliVMNFJN5pDj2G52pUI7\nzsO5QEivavc+mWb2XOVSBXZ2DqVf7edfp7x2dPtDTAIK01YTBMdXaBqoFf/g\njcBocinzWTmevk785IIoZI+JdmY6blxkAijPEXqy7HJ5Mrf5UCrSgxO7stgp\nculPQnMFWzhPj8FETpLaSfl5HtLCfWToV6gaZFk5VAkIvYdmOMHKX9KNFsGy\no/Z9\r\n=Fvy8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0843206263eeda5029ad0b91a39173707548745e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.132","@balena/jellyfish-logger":"^2.1.92","@balena/jellyfish-environment":"^4.1.28","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.2","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.1","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.1","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.244_1622298764683_0.46320729539104644","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.245-renovate-external-non-major-e5cb06377d4c94d344f333a905ff00cabc93948d":{"name":"@balena/jellyfish-metrics","version":"1.0.245-renovate-external-non-major-e5cb06377d4c94d344f333a905ff00cabc93948d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.245-renovate-external-non-major-e5cb06377d4c94d344f333a905ff00cabc93948d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c66b3e69290031652203f91f809fe598a6698ec8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.245-renovate-external-non-major-e5cb06377d4c94d344f333a905ff00cabc93948d.tgz","fileCount":15,"integrity":"sha512-AGTI0EkTsafEO4EAVROomS0mmqbmvmm6WD2mgTC2VTLQAonJAnAo8j5xpizo+vGLRO9VIJKkGgVgpO+jc3WYmw==","signatures":[{"sig":"MEYCIQCEa+e5hQZ01W8v0QEGBiknxKjH4CEFn1+2pe9FKjeE9wIhALrTog+jwB0LLo2k80Htx25attm6mzWJCP/2RL4eLyOK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":115872,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgspkQCRA9TVsSAnZWagAARvcP/AyK+8nHfUkWjDb7awUP\nmeHxvpQFketD0NX55vPDEfrF6s+maZYHRd72A7vZHTiERGeUt5dxyZN0Hdcu\nSil4HsAcyYqKdRV4i6+JzVlZZvMZtB/ToXQTlej0XHjpxsWsYXhiqmzDBAYw\nz9+JB6zh6L7iSpArKN/Br95KzEWXnXKKvTYUsaVR6pM3Eo4R+7sESxOe0aks\nlkMBnrDWys3v2LMGRSTLHVv0CFM8qpxItQChRX2WRXx4FWQgxxh9yquvs/nx\nrHftZ+vLEADnP6zibLT1OnXALyahazX2G1wHmz00czKb9bmTxN5Ta20r9mFN\nrZdhe7Rd3K8pLBJ4NHmALRFbpInsFbXpOghB/VMCbVlBcyekZf0fzN/Ubm+j\n3yCZUZdQNpswkzdKbdDOqGZ/HqO8piB89mZErPuIU04RlbuBOCtMKziOM8JG\n3Ai7kxj9W9zTaL7POqluevltpCZ3dJ9xV24zF3skm213nVWzQFltHpIDopSS\n04X4mICsQwI4sE1HDupgfyz0695lU5mj1vN76+V2xquTa8mIU/QtGC+famZ1\n9Frd1Z3p0iC4/HBbXgWRJkOpQmcSA2xeXcjD6GnDq3F+rMZ4wilM7sr9XKk6\n4F26VFKWuZ1+I/VtD9Zp6iOakzILVQHUOrhPA++p3gOR4YLEhU79LAHa1ZRz\nn1kO\r\n=lEnw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e5cb06377d4c94d344f333a905ff00cabc93948d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.132","@balena/jellyfish-logger":"^2.1.92","@balena/jellyfish-environment":"^4.1.28","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.1","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.1","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.245-renovate-external-non-major-e5cb06377d4c94d344f333a905ff00cabc93948d_1622317327914_0.45622926516460716","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.245-renovate-internal-patch-7aea5b5d4a8b585464ec30dd4f7bb02d03d5250f":{"name":"@balena/jellyfish-metrics","version":"1.0.245-renovate-internal-patch-7aea5b5d4a8b585464ec30dd4f7bb02d03d5250f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.245-renovate-internal-patch-7aea5b5d4a8b585464ec30dd4f7bb02d03d5250f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"22dcd8e1faf63ed9f5651323e31b0c5a40edcebd","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.245-renovate-internal-patch-7aea5b5d4a8b585464ec30dd4f7bb02d03d5250f.tgz","fileCount":15,"integrity":"sha512-IghY4pxlH9hogq/R1X80Fr7KwF4W/RRPrxTieLyJ3GV7vHAH6xjFuRFfOWuVkEytZJrfrEdYfP+3j++dEgk9pg==","signatures":[{"sig":"MEYCIQDnvx7OiNWZCIEcwWXiRonypWxUZPAJwd490DEg4XD/HAIhAIvkZ6BfqET5b1wqkQpdHBMQF66JtwWT01YRoOCaGP7Y","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":115856,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgspmbCRA9TVsSAnZWagAAAhwP/iKNDOFdcVpgd18tAIsn\nAvKTAMq6w5NLl1npZ1F5E6foSeYjfzFRGyEYnZDvEINoagx+yPez8Jk2agbB\nNWMvWS6jhtmG1YlajRdcvNvNt6JDsGHN2yx0r+48K7eXpJRzeUYDB1BPhAA1\n+A2cBHn7oHaSIeIRZbML9QQJGWWiL1DLqg80GPq57iMxKdyxi0URPePUFPlS\nkAyY8kfMc0GNuCmrH/YDNkCOhSqIYwxPC2RSIDvTCc5Zu1qjFj0peedasAOO\nV3rU036D6bLOpQzs1Je6sJgtVpdZXGhdegZZ3HWKGaSCrSHNVXpelM6XaupL\ne7Ne+YoDO0Av8PWxJ6O1XcWFgFwDPoxwinYQnh+P5QssoDrGCrDX0pgoP3d+\nkKafkR68xz3tZDiwbzlnKYokrp2HVsTBC82W0MtwK72SBxdv37bOLp7tbYC6\nkPXnJ+Pi90pRJXnxhgXcNfQY7RGEi2sqgsSrJ8ilfwX9z+WGPSwbmEO+0C7s\nk09EgP4yuLGOKFEyQzDN1NCNbVczy8anPkhgo7KqKHChnLpnJ0hZxMdyGCoa\nJM4wWPCHvLG3uE8wmi1d54h0m6tZIPe0wwjl7yi/XflmrWoM1j4s/h2q37wr\nZkSuvKbxTHu3ixAA0Owf9ApCdbIgUjsb57lJsXXTcPbLTrXbXpUdpn02y/3g\n+TQK\r\n=LLf0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7aea5b5d4a8b585464ec30dd4f7bb02d03d5250f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.134","@balena/jellyfish-logger":"^2.1.93","@balena/jellyfish-environment":"^4.1.29","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.2","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.1","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.1","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.245-renovate-internal-patch-7aea5b5d4a8b585464ec30dd4f7bb02d03d5250f_1622317467066_0.46779258821735614","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.245":{"name":"@balena/jellyfish-metrics","version":"1.0.245","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.245","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fea8f8c96678c76a3384a047d3c2dafdd017290c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.245.tgz","fileCount":15,"integrity":"sha512-cdPPmaNYtRjF8+zfMvomhjeg9Iu/HmtDYPlfEo0J0CEJecXFfQyKwtFzAJxbFVcAnZYgkEo6LMkiuSV77rMK+w==","signatures":[{"sig":"MEUCIEHB+qENedsyRUoxy38snh8YatpasaVYKHHTN1/e9ujmAiEAyGxVKJZoUvJgAcSusexeJonEVtAhF6WrzMlmRtvdlw8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":115803,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgspnnCRA9TVsSAnZWagAAoBIP/AijkF8AIK5K2Mm9tJaF\n+182LYEI8y2qBY9CwlEPcbQUTTktnDWb2mHIAArQpLm8PFDMBkIH5NwujLHI\nock4MmLOD9xccBX+rY9s1uJiYHZXnOzj2k9uCj80nwQaaVMzx9bjt3FbCbS5\ntPUmymVY8LU4RAjmDlX+Fi43LxA6kdT8xzqagogpsATmAAiGdx2EmeemvP2X\nLRCodQjXJrqDOQb8AJrZRdnhvCoT4T8h55bUwJsc/g7jVt/aQJx9XKOZp/Os\nIFK4N0SnvIs3ahfFf5dL4NnfkIGuZzhg0EOjf6HMigvaihMsB1YTzENy+TQc\nv0r+AlkYGHOGQ6zaWv3zT0qIIcQ202ShqV13rCvg+HFMpWiZOGP09F23jBSF\n3sb5VqGypqrvDgfI8ucmxfFdJpw2RzpKV4ZaD95lvxtwh2Yipm1CJZmfONb/\nc9oUvsTkdk1kHRUMzGzdVEYoOybXhICigpLy63QYluo9pXjdYvTwFOGGxVLl\npgGhmHujp7PgL3pPOo32WG1/c0eeXoiuTsWJU5KY2//1KHwr21WeEp2h5vKo\nreCYBBPTxFllao1KUlK9N69yJ4LGdffVTTLdsPpIjCOwATZ8LK8fK2fAaTy4\n9KRxUqhu/WbuLOr+vQApPPCfqbdrn90kJQD37Q+ej76pI7HZKP5uf9MKllL9\ng+Il\r\n=b5Ao\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"dd84f47cf9450db80a33674bcafe1c8a877a3a68","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.132","@balena/jellyfish-logger":"^2.1.92","@balena/jellyfish-environment":"^4.1.28","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.1","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.1","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.245_1622317542730_0.2009718810773511","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.246-renovate-internal-patch-4da32d8ddd2b85b7329ea7090ef361d2da408874":{"name":"@balena/jellyfish-metrics","version":"1.0.246-renovate-internal-patch-4da32d8ddd2b85b7329ea7090ef361d2da408874","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.246-renovate-internal-patch-4da32d8ddd2b85b7329ea7090ef361d2da408874","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9a0737c981ca329e8bd918e6d8edce7e56063e8b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.246-renovate-internal-patch-4da32d8ddd2b85b7329ea7090ef361d2da408874.tgz","fileCount":15,"integrity":"sha512-8mYjNPBZomUdCrVaGgj6LLog4tPHmpqN+LeV5+sGySTG9I3IfNq4Rh3bdHFiiarR29EA8l131XN+MVEMYBL5xg==","signatures":[{"sig":"MEQCIFjtNdwnzTY9vUDOg0vshg8Hk+rdH1TPJ+UJSh/7gArvAiBIYsW1ccM2CV5ribB37WdYZA4Fi2euYuJPmEXjgMPeZw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":115940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgsprbCRA9TVsSAnZWagAApLEP/3wMQi9NDlECP1tBc6ZF\nCDck/IlFrp9zqvSmuLa7up3i0uzckaBSkZwq2WA66TosbjXZeKqiX8BcW5Gz\nPeSoAOsbJWBppismmtfzYgwZ64z3TaPrhDpKYSCfETBY1vFQO1tXAGtrff/b\n9ZFlvQ1C7SYn5pZbZ0qbWdlLC4qKtP7jAZMZJ/kIstEk06pZSUgslUuDoFDk\n99+jMyKSHF45N3iRKsHFcSL4R/mA3DXWe37ks+eHSlmLueP3zcy4FI2amcBW\niXt/kDtcZABkEZlNTmpQfoppWfJ6j7rGj1WiNGyWquRz1BHeDmC603eiwUyD\nsZMrQgWg0ptHRaZkBs39X71R5DBH54FiLi6h4uTYPxHvVlR22n/GceI3H5VJ\np+2XLm9rWTQ+FXN0PvpEpLQThrqN+3LhROxNidwSiC+w8vWUOGtLdenEjQcZ\nVipvTxBUkoImzP4tUQ9zkqIvhh2bKai9DVZIgRdgGMXFNggCEn+UVKfTUlMF\nco19AgHQLxwMQvJy9QoMq5vi+ew6n3Jr/2ksFvt3XFD3qIT9RqQ6Ct3RL2z+\n+gotQ6Q9YQLabRwnsB8BkHvPE2G0fzJ3Kh81yqzdrJ/8eAMfUN5RP7C2ASOk\nmoFa8HqaFLowdQ5ued75dLHGccsfFn4Yca1bZ9vkTMGKNq+sBWcAd4Gs3TCg\nN7BN\r\n=ndDg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4da32d8ddd2b85b7329ea7090ef361d2da408874","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.134","@balena/jellyfish-logger":"^2.1.93","@balena/jellyfish-environment":"^4.1.29","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.1","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.1","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.246-renovate-internal-patch-4da32d8ddd2b85b7329ea7090ef361d2da408874_1622317786924_0.6978803907776046","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.246-renovate-internal-patch-3a8449096f51848f50f6fb2861c266e83143f749":{"name":"@balena/jellyfish-metrics","version":"1.0.246-renovate-internal-patch-3a8449096f51848f50f6fb2861c266e83143f749","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.246-renovate-internal-patch-3a8449096f51848f50f6fb2861c266e83143f749","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9dd691b42dc3a59f5e7bf9cee5f717f674613fdb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.246-renovate-internal-patch-3a8449096f51848f50f6fb2861c266e83143f749.tgz","fileCount":15,"integrity":"sha512-6IEcHDGvOAdw4ahsE0T9gUDEDL5FpyMbvBsUmGd4NugBIJEakCIYAQ3EGODywUzxgFQfGxe+Apor/qS/n4T6Uw==","signatures":[{"sig":"MEUCIQDECN8bcmi766O6QHgVt+iYCtAaK7rh9mc6CPUYphtJhQIgU4HM7IxdWsXKjt94R3HVunagvJA7FxW4LDXrE3B3pVo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":115940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgsqlWCRA9TVsSAnZWagAAmPMP/AmZ4TjuCAPXKxfanGEz\n6qcZxOkM8wCsGSkNB+SjEWLgxLaOnnYvGOsmfQ3tVTaM80HFZMLUsciHc4/U\nrqq7VBD0EaD6OtxVNpiecZuWXz9Iao6H49+ZMw/ozUTrH8uxDLVXE8/D4JV4\nr3h5YzX4TnRubn7SUtTAtor1C//irAb2OCXj8AFcPGYKfcgYu5WC8KLAfdGO\nvA8s/FfjEihUJK7+VZIPmIt47RtH6tWAYa4lsagVCSqHcYkNsKhs0UzeGhIr\nllGy5XcllejrkjAmVHypNvV5QtgO7KUAz+Mrek5j25eOlsPo8JkZUY/MRqaF\njnSqhg1HpbBYG7462n5ZAkdzQ3gN8NZO+kch7Znm4BUtonf/lU9SOnYVy416\nlUxKTjdAYWMP8qaKhbc06Z4PbAYH5fu/M0+Srg2DS+/3ovCYu0RUsZpxiAu0\nIbPr75jILRJZ0cfVL0JSz8S+/IQ+Be4afrhIQ8ivTTydqU3bEnuXL17xQfxn\np0MlabfGnTpF//P6XGyZ0OrBfokyApOWBfjMLXWK6KVUa+C22XzkA8CKZM25\nuFJYE81fE/qcbUYNbcduKtQryPUd4G92t3RBDlK/Gh2pz4ljLKVSMMmiITdG\nqg43JjvAGRivZrOhD4tL3DNO9Uaguu0ygVDl1R9HCKEbH0VzOrb156hU2uGF\n9Q/5\r\n=ZGkP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3a8449096f51848f50f6fb2861c266e83143f749","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.134","@balena/jellyfish-logger":"^2.1.94","@balena/jellyfish-environment":"^4.1.29","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.1","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.1","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.246-renovate-internal-patch-3a8449096f51848f50f6fb2861c266e83143f749_1622321494463_0.5977025330117984","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.246":{"name":"@balena/jellyfish-metrics","version":"1.0.246","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.246","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1e774c341f8d462aa6cb5bf24550154af6fa6fde","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.246.tgz","fileCount":15,"integrity":"sha512-vFUZUtC15gKOupEicR5ZN+s17ANJJ5l2I0TkOG2vWMQTw7eEvajeL9RQeGD8PSFjMWVtB1gqxmCLcj8eSJAnjw==","signatures":[{"sig":"MEUCIChU1g9K7GdXz0bkEDhcBmwlf4SSkODzTI3/6oW3m1DXAiEA/GlpnXx9xKX1FoRsf+wAbZJ/IJzFWDesQrpLJAg8beA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":115875,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgsqoyCRA9TVsSAnZWagAAgUYP/1ktjaapQW7iXtZ16+cG\nh9AQRA80YpGNC/dm0S3nJu5Lq1jddAtJPyUu6SF0KLEt6qYy1SSDN+KRRNmn\nowA1RhhCFWvke0hL6+yUcVjOHS0jvwVXCCPEWjel5NFrml8wselbBPQu+AD6\nd0giZqmhWyeTHM4EfrBOnoyKrI2m5mBFVlsF5l7HaHAMpPGIW5r+N5dYdp7e\nllOHOQV797Pc+UisB0aotuNRgZsrsuKSNKwQ1CFTAfwEu1uiqejv7wfHc68I\nPNbxULRTpLAu4rDj5bWP1eXW3c4YCQkGvxe+4EFxAv4KfGtpKTU9vzOM5l5S\nZO9Cq53bUU9gNjGI0N06zsPy/U4QbIbxViOIrWMQRY0MbyROPaAKoxxFLyd6\njJQ/cYpOtGL5Bm9hBnhfGfBgByuHHqffMqpr8kUk+mZlTwahgFBu0kTU+5oO\n6lw7qN5meZfPdKUKMjVSMkTiTYoR6G2lwR2Ln+1q1g1wPTHDfgytj/JtdSAa\nG+7qxER3aP3VGQZU2yIUJ2tuffc6XfhxSjV2mQp4MTvDKYGTOJqovmLk5KI4\nhRAOChmvkwWxsxoZYg6n2RuxEKj39GSgGicyaUNQqbwNIl0oCKTNxZP5du+8\nRV9Aur8spblzapZAFsGRMqnudwqJjwrZTOfsn1j2FhHNeCid6mQBrforFK7P\nXvOK\r\n=Hxvw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c9ca3180d6a5e73c5019d4611145e2e49a89faea","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.134","@balena/jellyfish-logger":"^2.1.94","@balena/jellyfish-environment":"^4.1.29","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.1","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.1","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.246_1622321713872_0.49204560474469416","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.247-renovate-internal-patch-13a68114abc93300b80892858b60567312840ca7":{"name":"@balena/jellyfish-metrics","version":"1.0.247-renovate-internal-patch-13a68114abc93300b80892858b60567312840ca7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.247-renovate-internal-patch-13a68114abc93300b80892858b60567312840ca7","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7b13c4a01224a6c650c317295ff7d3185c718ae2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.247-renovate-internal-patch-13a68114abc93300b80892858b60567312840ca7.tgz","fileCount":15,"integrity":"sha512-syvdhdbqIkPNmidTCYHMH4W3gWzpDYQd3rVPORjDF/1WAECPzZTNDKprsJ7uxBkgDgBkgGyWe9P0b8VV19aBqQ==","signatures":[{"sig":"MEYCIQDcOYm+5rQ914nqAMNPPk3M73KNoAqgU245oVg6lEsrfQIhAKhyEmUt9WCQJ06kREr54FuLJCMvbXMO9/W6VspKPGWj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":116012,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgtF2OCRA9TVsSAnZWagAA/eQP/2VczH2bY2pZ5MDKaEmC\nK1uW6CvBc0zF17s1/dyu//3za+rK+6WhjGkb6kdWw6kEFQwxmgPlElnOKMID\nahYkRfZPTsIDH8Env8ZFshFDVL2lD42qfQJvttShoD/sDxUE2huEOy3GQZkp\nx90GAx4ect5b/RITC0LFxZ3dkLZksovUGmO6QcZy3G7cxiHvCGpTBCGn9MHZ\nnaLpNNAnM4KHB2FnfeXtA0uSQcdbuAcdNdgqQA9zuJRYfZqSUmjUx6cZmDL/\nse3Edt1S/HlXd4Pv8x32xssyOfuAvgB/qTgp1uDE51f38Sa6fVfYKyhBeV4k\nMuzsfQnZYVX0Hz9cEmIDQaEKx9dlYVejbuOJ6+kvqe4fx6/cl8chV4xoOqN/\nVQgeL9lIDNlG3ZUnskCQp6DeoYRDy3fbQw8OMR13hajuCsmVL+kpnf2PNug/\nkL+I7jgpEp0tDW3B3LTHHq0g1PWNpTi/oHisYSohvA1KilWqKLtTjejcExva\nn0Kb68FnDR9r/X6I3E+d0SWXaiIZgDUyM65zsdHHY1nv3hLhaWzY1WOQ/pil\nPYUL4er8lh9tPWrbtOJRYTaZLnQ/eCHan1RAZiQeeaf8iPdMNivBeTD5kKQq\nty3aPMKcVdJg0cZeYUMtfblJNuo3O8nGREqB2CFCsDcU3DMCJ7JV/zBW/wXN\n/DT/\r\n=yNNm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"13a68114abc93300b80892858b60567312840ca7","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.136","@balena/jellyfish-logger":"^2.1.94","@balena/jellyfish-environment":"^4.1.30","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.1","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.1","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.6"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.247-renovate-internal-patch-13a68114abc93300b80892858b60567312840ca7_1622433165656_0.11146146390689005","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.247":{"name":"@balena/jellyfish-metrics","version":"1.0.247","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.247","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c690272f4e145cbe5b8423116eaf783a039298f7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.247.tgz","fileCount":15,"integrity":"sha512-6Z6eXy6ITDiEyQQpkX67v2UPYjcorVcfF/NiWF1FAgsX43gpNN3PMpinqAHFGsB38kx7a9rdGmMckp3RXuf+JA==","signatures":[{"sig":"MEUCIQDSXgJBX1gYyzaxi/hhxVwt8o3N8kiq/U9q/J8w3twy7gIgG9FSLPTd/PAwzJaNFaVpESzxqVYoeCk6P0TmYJPsVoQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":115947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgtF5mCRA9TVsSAnZWagAA+N8P/06gRKxzL4IGWcF95RbO\n6ByfaohtfchRU6uVGw+nMkTK3RZqfhdR5CDFdg0AZhz6XLkcKgKp1o57YmuV\n1hMXWb4G0R5ds83l7gsh90zsvs7eVQEKh5Nmuob5PlsBqmMCV4E2FUuPosH3\nTuGv8722NG7CW6ZAoArEVptbnI1rqLGEFmx9TekTJ++df2BXoPmBfuUPHFYx\n5gnuQ1e3ShD6IM2TH/V/IT4jTxKbGhmEMr/ElIao47NYwKBXclO9IMjUASIV\nEhOfIeMddakN9jkTnlsI3a52SuArkWNQenxHaaxIdg/wzSeAYWm/RidJ/7vR\nBB/dXWJKGEkzXNsK6jMh38REo01nNbLtfIV5iGAoGIpTKq01TrZO44U9yt11\nvVGv6goagHJW0IJekF9rjbpV5BEb+iqGGwvgbYUvMU/p0Ftr/cXFqPmb5yO2\nHUjKkipg3+9N3A5Et/wFtoMcylD5dnIVaRi948pC0e2K69QOEaJScXIXaOh3\ncpt+qjCgF/wmOHlB3q6RDNYl44Dvx/4fTlc7e6YASioLuYhDzD2IUDLTOzDN\nmgEEezkbAy4aNPTXzmWs4K6HHNJ6gM9275WYWJKwDfTG6MkUGS7vMjBF1IIm\n12miyfbO4ZMA+8ii+Q7cpEWnTeU7bX9rHr4FKrALPYY+8hDZuHyB7CkScfOh\nBI6J\r\n=2/Au\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d7f731cff65a67fab0128e88f3aa133de19fd20e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.136","@balena/jellyfish-logger":"^2.1.94","@balena/jellyfish-environment":"^4.1.30","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.1","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.1","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.6"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.247_1622433382339_0.09457040973659492","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.248-renovate-internal-patch-b7499b79acbe638277dba0621df15d6a6d194fbe":{"name":"@balena/jellyfish-metrics","version":"1.0.248-renovate-internal-patch-b7499b79acbe638277dba0621df15d6a6d194fbe","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.248-renovate-internal-patch-b7499b79acbe638277dba0621df15d6a6d194fbe","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f072f1ed50f474ccecc8c3db2e33ecf299169780","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.248-renovate-internal-patch-b7499b79acbe638277dba0621df15d6a6d194fbe.tgz","fileCount":15,"integrity":"sha512-ywOWdralHJM0GB29ZEPm62+C4jgygm3z0N6wjV2DjOWs6LO0ltmVY4u4C7Ma5aOrlAwBTKdtl+w04pUzcSeQxA==","signatures":[{"sig":"MEUCIHt8gAVznEPSPC5H6bV3QrEGdhgry2rybkX/Rm9slreHAiEA0/0gnwcDNnBXA080A4HCSvgYs3CIrZ0IjY034MOhtww=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":116084,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgtKoMCRA9TVsSAnZWagAAemoP/iQMaJw49aQaXSdFuHGL\n49i+ng3DoSyjFu5dLzohTRlXPBkKqZ1q+WAevFjzRUMe91qDLMHBKK3iDG88\nKQqQUHYXxNBp1Fq09lj74VJLJlLaQIs9NWyF0AlA60X4OizqsdGc9iLIcWa+\n42fHyO2hW2Q/Z+FBkR5HFY7Qjof5yKQNmmlgDs+pPAkb5eOZF4xp6UD3a4yF\n0N2k+lljfXJqFSsZLqAT7V/vSf+coyUq6RJX43JXCd5cVhEd8s0EAwd5flPz\nXCxVgD0A8iRz+HH93Ipwe5yT4u92iqf/1N6rKFx03MFppAXqJCYBGm5buoLU\nVZIPOUBHkt0XjECZXeWr92LtU1S3ebvdqamdzIt1PgaApMbfB1AY7/sZhh29\nv07xPZLr1wHhFLEawfuI+dH7wlo1k27I2OjSi+rqOu+zKqUTtHrMe6SC2la4\nJoy7FSoNp6ea7fshhyuJ+zCaC5BRIlkWMHGCBbIlwJSuEJLe+RLoazCBfG0v\n8PgNYjFayAS4cG2un9SDCEpNKjgyVwnDtXfk5XW3PKU9mWN4Hfff0DdfkvQZ\n04C0f1/fx0vxEn3JSKK+GDmCAocejSIwhy6I9T3kZd0v9W5S7FeYDTBKFrK9\nQiBOBH9Q8dHbd6ijQSNmjx0h/dwOriVHjFhKj/vkfzhxKLXDhWmbmQYYi/xw\nOUQw\r\n=0K5a\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b7499b79acbe638277dba0621df15d6a6d194fbe","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.137","@balena/jellyfish-logger":"^2.1.95","@balena/jellyfish-environment":"^4.1.30","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.1","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.1","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.248-renovate-internal-patch-b7499b79acbe638277dba0621df15d6a6d194fbe_1622452747846_0.17877817845987698","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.248":{"name":"@balena/jellyfish-metrics","version":"1.0.248","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.248","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"573503b58af262d80dee2eda1e64f19118b59e32","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.248.tgz","fileCount":15,"integrity":"sha512-O+HwzkutBsmkJW2bDvResfKVedWH2hqCWG9wU3N126Kjc3XyEwSCafG3Pa/Tiehl3NnEKcLGFfGScLDSDIZztA==","signatures":[{"sig":"MEYCIQCJ+xRLOPHQ3fJ7e0FJOEs7y5yiqGQ4zresNAyfPzHP8wIhALCMhzrcpiA1bfsoYov2j9RnDF4xxTQuxOYBh7v9cn8k","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":116019,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgtKrXCRA9TVsSAnZWagAA7coP/RH3xvLb4Unqe0l5FHuG\nzWd1dd5kLNKcBKMBv2LDT7YkseYEJ/pos8sd6TUvBgH57AG7zKhTgWnyYUhu\ntTyFH+6CF8Xv+9L49d7/9eJWofxTUVJpZHW/2YO2YkVdTV9N/1bAua+r03p0\n0nV08yzdLyCqolbxb8KDzzjv+S/7s0pOYIvc25RGxPdl6hqzxJ/b16TeD2eu\nLfK95OrDPo/muf5zijh3Zm4+LeAVI9zxJ3c6FHCPysjSVJ5pXMIWNkB/cFKU\nSI8NbFN7FQzAsb76pMu2m6uFdKUj3/rMpay/z8894aciluEbUSED4YEHK1CP\nUBzLVE9YFZHFqDxlkXhogvCGMEYYPiCnjTv60nEsp1TjboCJS+GtHg4T8u80\nbf/GfgI93yvqICFk4Kbh0CUarrdrfbJKCmiCkODJGabeAdclyP9TFYiPlGxM\nygfCJVa1WLoOmz9GVc6ScO2o8kZmJiQRSKHEp2QSDkcx8KdtShq1FjutkTD3\nK/dSSgP+/0G3WLwDX3/njyAbHbhMiJgSmLmAQm1ai6N7CaKX5s45MkPGfP5y\nrdEcQWc4o+jNjEn0cyiycDIFHoLT4weX1mX9p5ESc3Z9mH1PRhfCPDRgWF8P\n+RTZdxg50HSDdHj2o60LUyrJFER14n8Tgdjxv1TrviAsxLobv9zZKKx7TcWh\nuthA\r\n=NpgB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"364aea92b33d596d3dc99547307c4920dfa5d834","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.137","@balena/jellyfish-logger":"^2.1.95","@balena/jellyfish-environment":"^4.1.30","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.1","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.1","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.248_1622452950907_0.2004414449460823","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.249-renovate-internal-patch-860957b128275ec09bb03f929393d8470b276f04":{"name":"@balena/jellyfish-metrics","version":"1.0.249-renovate-internal-patch-860957b128275ec09bb03f929393d8470b276f04","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.249-renovate-internal-patch-860957b128275ec09bb03f929393d8470b276f04","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b61ce409449c9538cfdad0e1438db01856e2319a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.249-renovate-internal-patch-860957b128275ec09bb03f929393d8470b276f04.tgz","fileCount":15,"integrity":"sha512-YYKucQz4pkp+Mn0qA0ZsdLWhj26MMZQYUytRQm0CAP/gfg4yAzY/97ASVlcT/8qo07YaV2/1fj0hEcsm1ChY7w==","signatures":[{"sig":"MEYCIQD4abOuJJT4OPTWHtQxJY1eALoHpFfPy0yslx/X+zDlcQIhAJeSPlp3Bd56kJHChSlqDNwBTC8ZZaE6BeByIpu4zgV5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":116193,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgtL+GCRA9TVsSAnZWagAAjvAP/2HeYmN67YQVhKIeo1zl\nIi+sHPtZ31Qh1Nu+kgdL2BzT/BXImz8fWDRLBzivjFG9ncqTqWq8QFaNoHhC\nxMXhxGBaIAkdnVoiFVauVIJ2FgqsIFMPQjKBZWGMSYKTuTuVEYbC4y3BdG2B\neWONYIpGmpeiPdn+vCOYsCKdyOLurcohBSnTyEWkc2cscqWdDw1ACOoOYBNH\nRK9af5IdMT/MTRIkQ0uK0yKvnot3Xx3nSTCvx4A3NHp1oN1arLqXa11fHOgm\nXBQhdMpbQkIayz2A8bWgqQeADsz33JTSSbvsiJ6SUIJIXJM3Vwb/+kjZ6Cyp\nDugHJQsBpG6j4ymP0YPaDvYTRtC9WMRIV13k5wfUaQPmwyylomDO5Lmv7zc6\n3up0eBs9DVnwsxTNns8aFPZjrve6uVRGYfWwFmZxWb9+K/Ppd5YmtkbIaGTd\nq8mYcr8KUSBt9xKi9Is3/1kfXcdgdE3De7mcoJOwqHl8gRFBXQN3gaVjTepT\nI4Jyt26IBkBE+HXNU9fHj7mrBTLK72cndu9NDnJx27urMmnTpSAICVVPQL97\nANAheGUaZQD5iEcgD9luYyw+dMeILDxv1ofYFGOCSj10SAFyyFR0YzD0KS7z\n9KnLuNH7Or8HTyWfqQwJvV0hS9dbXj8iiSj8TAdtNcHcMyXa244sMKlDP6KF\n9hXs\r\n=oIJg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"860957b128275ec09bb03f929393d8470b276f04","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.137","@balena/jellyfish-logger":"^2.1.95","@balena/jellyfish-environment":"^4.1.31","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.1","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.1","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.249-renovate-internal-patch-860957b128275ec09bb03f929393d8470b276f04_1622458246260_0.8758321568543683","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.249-renovate-balena-jellyfish-logger-3-x-508b9d4748ed56acaa88e4a125b83339f632d673":{"name":"@balena/jellyfish-metrics","version":"1.0.249-renovate-balena-jellyfish-logger-3-x-508b9d4748ed56acaa88e4a125b83339f632d673","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.249-renovate-balena-jellyfish-logger-3-x-508b9d4748ed56acaa88e4a125b83339f632d673","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"97a3a9353ca4dcad98e1ba85ff0c95aa0accd9a9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.249-renovate-balena-jellyfish-logger-3-x-508b9d4748ed56acaa88e4a125b83339f632d673.tgz","fileCount":15,"integrity":"sha512-fWffKj9r0VAbOCPfmg9Y+edbioQz0h/7h1P8/0RO8lfsp8IWuzNBITIOjRL1iTZYyAaq9WGp2rKttF5mVw7Wdw==","signatures":[{"sig":"MEUCIQCe9bGRPWaUQ/ZZxWwBiJWDDQYuLyvNN4Ju2qriGcCCdgIgTyAEZRetz0Z0rsJZsAuLQd9HSBliAApQxQav20w3+x4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":116195,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgtL/eCRA9TVsSAnZWagAAGoYQAIiViTrfJDMvGCRsyzm6\ndVuxJB6qTfKVYfrIrQf7O1Unk5GlEHshd35KRvT5U4RD/lrIiV9u1gx6fGSX\nQYabJ70dA7Y0QvloXEOR34DK9WqZmWTTiC2vzE0ihUegNAKQxZG4IABFA6QS\nTlTqXg/z55Z5Ljk+LEoOLj7i7ecfqmvJLnE4Rddjf8jWcEk+0Ez8+SHtbkad\nYhhYHOlF53mnrDevtRQxG0FHapoayZXAk7cIY5WifmYgTWoE3ELMewDbK86u\n15puqv9Wo0bizchW2w7l7d8bxn3MIbElIsMdcw4bk1Mz6CAv9f2c7+HAubfI\nBcN+qiof/jZPOSUjgj3xJbRQt9wvf/jZfT5N5VPH04LqXPXpaYIwDFOEw1P8\ngOk9cigONTUPV/hqXJcEF3GSxeJaGOU0QinqD7tABV0ErPH5ONxOtzLRc6tG\nA7sUzTHc77zGztj9jf+Ah43g33t4vG3ipV+ydUoCjZDBhO5czzgsYLctbG9R\noZYOryX7QIfwux2vFahz3++GD2P79hhbvtT1S0ahXs078mjC8CPh/OylZLW5\nIz2suTiYJFNvKtnVLbmtQ5wM0gc16hhZpoSmhQ7JJz4jBWprynP/W75vbJdl\neaYQC2F8GeZnJ7Q/GjsrXSwCS1sNRI+lEwRMZot0y0EwmtPqJctJPBn3I1b4\n21jo\r\n=Dd6N\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"508b9d4748ed56acaa88e4a125b83339f632d673","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.137","@balena/jellyfish-logger":"^3.0.0","@balena/jellyfish-environment":"^4.1.30","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.1","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.1","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.249-renovate-balena-jellyfish-logger-3-x-508b9d4748ed56acaa88e4a125b83339f632d673_1622458333837_0.010541828861306834","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.249":{"name":"@balena/jellyfish-metrics","version":"1.0.249","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.249","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4ab381b210f586630f2d85ced884d8bfac1cb30a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.249.tgz","fileCount":15,"integrity":"sha512-XQMRFqhCLTZ5wfeEdBy5NoNceHXvgbVfoAt9uNbVM02lMfcw1i0mTFPx0jw2MtR2SeRat797Q+8+2z+j6RfV+w==","signatures":[{"sig":"MEUCICdojGYYQ6Grk63uDD1/XT4a9lw4BCl55enoDNUwKHIkAiEAyxBdueTyNc3V1+0RaVDotkuAKZABgbsnY80W655n1RU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":116128,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgtMCNCRA9TVsSAnZWagAAidsP/isvFWsh0hT6SwAEBQE9\n4S00IODie5CLBUaiAK92svDe//ExawxPpozwvLeOLsAgtuzUFyX2A4V375yx\n9fYVFdTZ5ueOpf9r8H6BYAfly/lBfoRK4MW7qlz5eO8y87tpbLF0uBI76BVU\nx0uRU2lfmlFJpQXQqR8out4z+ohpKupByUCuMVXSUC40XElerfXZ0pLTYLFD\n6EXUCpeJDxO+K0aocH57Z84pHjKIyexdOwtSjStwHCGJmB0QsBUakBow8+Rx\nATgRF5Jwh07VYbSoEBvhkJLsgrmd9Dc1qf8sUAEoNp2GtRswsHzp9AYVAdaP\n51b3pXGQsPsMMkFpj+UAT9mK7jE2RfPDSv8z40bloUrnojsVPkN0WrerqThM\n9Im+W8wKr+grvddPxuev/yXyHvLQvoKDSlfwe5Bke0phzNKs3XBRIoYLUy4Q\n+/YoC3VsPxa4AsI2J2x3ab0XhFQcj7/mNds8B7PCcCB8/xl7T3JK4Tk2yL6y\nUMdorNe9N/BH41NyVPH/FvgFvpXmMBIXsJ3CeneqopjXIZYozq6DfIQBXmOV\nHr/OrDyO+Hah+DVReVjnhDhlqEFJ5L6WvQPA/MbnJ2mHcXHlasZZxzT0BPnP\neJSC78ENSHevIPkwCPpcVEGwIZJQMeFjM8c/f/VvS1Le31SredxLDtB8ufUG\n2ZjV\r\n=/w5X\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"43a1b0ab06df624bacb08a5ab5839b52dafbb631","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.137","@balena/jellyfish-logger":"^2.1.95","@balena/jellyfish-environment":"^4.1.31","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.1","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.1","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.249_1622458508627_0.9922979382331556","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.250-renovate-balena-jellyfish-logger-3-x-358260adf8314934a982aa1b64e8130c2124f55b":{"name":"@balena/jellyfish-metrics","version":"1.0.250-renovate-balena-jellyfish-logger-3-x-358260adf8314934a982aa1b64e8130c2124f55b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.250-renovate-balena-jellyfish-logger-3-x-358260adf8314934a982aa1b64e8130c2124f55b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a52d9087f316f97fa7d0a6681aa78451df354109","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.250-renovate-balena-jellyfish-logger-3-x-358260adf8314934a982aa1b64e8130c2124f55b.tgz","fileCount":15,"integrity":"sha512-pw1brY5EPvQxz0f0CVajUOnbGyNBKAYmex6gVIox5vtkiNb66vWXh6YMa3GB9dbE9swcXjt4Oz63YCgKhY+lxA==","signatures":[{"sig":"MEUCIE10bK5ruHqbLxSkUDF/CH8r1qm4KK2lEjZhUKLDMpYqAiEA9ZdF30OFJ8Q8KEurqTG1oAHNbdTDPVFZrZFPiFh26e8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":116304,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgtMFvCRA9TVsSAnZWagAAc7AP/RyRXWYfvQiYFF5uOom3\nhplmHLGjsE5CNMa93JWq3r1bEledH/0naQIhJGs1Ua90xgoaHInghL+6E0jN\nvrnhBFzmulDAPFZchKvaTSpFz49hqXSJcAH2ivUJBa1Kh2SRj+sTCjUdqgDY\nMvXtA92va/GYKuBHhIxunbjiDDF8FfN+wmYNoxz8zBjUBqBn7s3KQhsZLCS1\nmZ0wIldN8y203g6q5OGK9HnvlEzlWPi04EvJRLRK7M/fJJM+blldxMBH1DcC\ndsP6Xk2mT5qcXmmzcLs/3VpJjXHku+kePsdwMnYITydMLECEPICkWenhzJJs\nybqRPWS8bRyAYuLHc1i2HXwNPO5L0AznOuaMpElwHeoX+OziwFO/wznIA3wF\nYrvg4WZ/mcKhktYdF6CvNcT1UFQMwBfjQk+MX4/Oa22sx+kELcGoFYhev51v\nLG/Ck92bYV/p/EVWL7zyCm/aT8C6KJMXOjWq0yNG4qdj9/3iPUZjZzY1mhnf\n1hsjB1ykfvGn52oIHtEPeT86wgAf98I0qD0qs3p6fg+93je12ei6BWfq4pdA\ncNY542VO2TutFhv/wNONIcfuaD5CnBQkfiHuH02exvjd/Sa/+ufr/dj7NhE6\naMTZ5nEPfE3tVkfY3+3q8+UUznB//b71dg6FpyTjL0R6xCW4q/F6wCmqfTHn\n6RC+\r\n=8Uzu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"358260adf8314934a982aa1b64e8130c2124f55b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.137","@balena/jellyfish-logger":"^3.0.0","@balena/jellyfish-environment":"^4.1.31","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.1","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.1","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.250-renovate-balena-jellyfish-logger-3-x-358260adf8314934a982aa1b64e8130c2124f55b_1622458735471_0.5152280964272768","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.250":{"name":"@balena/jellyfish-metrics","version":"1.0.250","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.250","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2770a5dfbe78b7c3cb26fae862e3784be8b2791b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.250.tgz","fileCount":15,"integrity":"sha512-7iIDgj5vowwEhCXWsC17/j/MSDuJkr3aZjIOmaH6Lk4j2jvu/PJtfzKCGeb8w7QssfoxaVEIqIFMhgIZGDi5Fw==","signatures":[{"sig":"MEUCIDnguOqvq4XdwsCgscrhjEm/M87aJsIH9PqPMFQhvm+fAiEA/jmnYRal7gfsbOm4/R0q6Q/L1nR/WkEz2mPFEtSR9m8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":116226,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgtVI0CRA9TVsSAnZWagAAVcQP/Rn7ZgAYOMAMtwzSz0ry\n7UEze10y7urL2+Qc6Y1fSq7BCvdnuYDH+JGr4552NyT4rmBpjokFD0d1MKtP\n2kaIJZHfnVCgUAQYk5QO/YfxhSO6WbT83Dh6iVAgNrJdWQNx7lWCR74KGBe1\nd3PGf+MbmUNeIcG5PwakfGdGlSynN+DeafaSDoUEUgGEhKLF87pkAtx7s5T7\nXV0woyZ1YEQN/aTusaP60ZYQyefAfuRQ2J+v/j9UY8Pubv5/25b2N2QODGiV\ny1WA4QhY9b0H7PdQ8WiL31hg8W/ejWO7UhA884ZTMVf8OWadLLMudu+psBXx\nLAROFzqLuTmKrx8XbZ9MMSRp7LteOoCHj6xGJbaxBjnGRNCxRd49PzQultkz\ngOgqeYKKbYjryo+x4DEdC4BQgOzlxvNHuB7CjIUh1mayY0DK9H/CSQ8Y6+c0\nnn17SXUbS237yXq+8yAUiiJ7dQMW+aUKN8IaOT8GNb9Ak52zK4nmlAEohf6F\nDbG8wWXlWaRcShQ/APSixVBNZ3yZ0HbBMTl6HIqMEkjUGbl4ZT03utL/ox2f\n9eAJY5fMki9lpEyW4X7xEDW1OlhETSaufttypW75rM6e1l3OOLyWJoZFgRHr\ny0x/CmaQJHVg1/8CGeLXUTVLcfNm8Ab34HhiZdv0MQXJ/vFG63a4cKadBiLt\nQuyF\r\n=WGbh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0aa819e4198863d0392ddbb50d735f0e99a067e4","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"catch-uncommitted --skip-node-versionbot-changes && npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.137","@balena/jellyfish-logger":"^3.0.0","@balena/jellyfish-environment":"^4.1.31","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.1","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.1","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","catch-uncommitted":"^2.0.0","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.250_1622495795689_0.2829827016280835","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.251-remove-catch-uncommitted-f144e6d5ca215c3754b70c511ff92e7441537ca7":{"name":"@balena/jellyfish-metrics","version":"1.0.251-remove-catch-uncommitted-f144e6d5ca215c3754b70c511ff92e7441537ca7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.251-remove-catch-uncommitted-f144e6d5ca215c3754b70c511ff92e7441537ca7","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"00309937be1d9674bb04ed29baef25cd59fb891d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.251-remove-catch-uncommitted-f144e6d5ca215c3754b70c511ff92e7441537ca7.tgz","fileCount":15,"integrity":"sha512-eD3APIHNRyGnQOFOANIxLAmppQAK68qlwqZ1zIK0yG78seN/OXHtbc58widtUFAuf/gWBsgYcQIgXE/65/lTsw==","signatures":[{"sig":"MEUCID6VEdEMeIUcv+cfJQvrtuCBm8undF2vB/7//po5hIhhAiEA7X6HVPg5vAZ5VIlCKXo17wVpbLRMnUNViQqhVVaRcQc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":116285,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgtzCaCRA9TVsSAnZWagAA12sP/22gavfsRzbw51dxOOq8\nl6sWK9q3EKwbP8+cMZeNHaBqkeWt3I1JfI2Ux7ehLLlDDVxQOSoiEZ+1GCQT\nMN86kgE8YxFZYeY2eh9Qicqp6Q39Nb9Vr8YN3U91u6UHH6rRi9XEqzH32kp/\nskp55Pz/ZTvGotzFS+/+5+yFdXi1rkG4MDEAjdDVMyiOUwdi8ZguEwssVHiT\nsqg/Ov8s1mSYYvKy+OYDpLOi8IJGGm8yHlRABcyy472Glpy2KfS3FunfKnCp\nA+gV0k94ruc0YCIgWw9zL5VrBXBwDRFl2zCs0UWYVoYP5a1xPxShZgTXhlGr\nSucRMeK9W5H5I1H8gdXXJmUQgMmqGWdsgK5T23ZRgfyVnpHgJS0d4KTe9HOL\nAvmquvqYZOlGuroUj0RmQhY/crgngfmJp60XYKUgdnpOrXRaaHWfX61ud2WB\nJG0MZdUva51/375o54m0Mrmvy41kue6JvVrwlyKQRMZL6stCXUfmnzP2OoBJ\nPGFDOd34QE0qj4LWv0oeEnjuiDJVSnyrHRjIj+ny17p2sMjeqwEgfdSi3SgS\nfrPE0TFub3WnJCzzOgyMEw2HE+BdE+kikUpF9sPaPGRTCQYgt6bdc2n9I/Qf\nEPIEGRsallTMt3vWoIggIpjcvS92N2ZYOpuzFku2zvnXSTBCxjiNxFD08zES\nE8Y+\r\n=NjP3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f144e6d5ca215c3754b70c511ff92e7441537ca7","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.137","@balena/jellyfish-logger":"^3.0.0","@balena/jellyfish-environment":"^4.1.31","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.1","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.1","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.251-remove-catch-uncommitted-f144e6d5ca215c3754b70c511ff92e7441537ca7_1622618265581_0.08851519818926312","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.251":{"name":"@balena/jellyfish-metrics","version":"1.0.251","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.251","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6a4cf3103d3d14617512dcf3d2336128fca4788f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.251.tgz","fileCount":15,"integrity":"sha512-QmogOvl9FRcbTpUMOmMW+2THpW2aFO5cLXvjt0Y8LltGm4o4v+HzDHObYwMZmmtxcVmdE70Ww2rEaGRgh3xXag==","signatures":[{"sig":"MEUCIGay1Z6Rwjc/srbt6v/Y10PqkufxotYb/c/7nIiqBFTeAiEAs0EDOoprxdHEnpdYu1eeKHZ0wURKf4Go13ff/iNgAMI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":116219,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgtzGaCRA9TVsSAnZWagAA1NQP/09C8cxqMSNwi7/WTl4r\n3G2WCDCWJ3PWUuBPlFN7Vcs4/NvQlfg1ug+TFL2Nl8PEg3RmjJTBYkIx6uqu\nYbl8oP9xM5Mlkhk1kSvXqVEL7tBkc+xn5jlgjY+peU/93/JP8EDltKwJOywl\nL/Tq1xJstnWFN15T4gTXexWzuQMkjJh9mxXC4X3OyvGERq9UIkHtbZEnYvBB\nh6oKM/Ej8dkcqVmxu+AZliqJBv8P5WFgMCUEg9tsq2fYE5VrzRHTxDHIv/fi\nQUW0Ez0CSZSRpCuD71O7hIujyj9Gg8ytQ2+oyMJB65UEqRc8OH+1BlCF8Iwv\nQJvcWFhQfknTgCv1pZqL9VI+oYJBLij/lOjPgoBa4rY8LcLREwo0pMayNVyV\nQJD/uF+9NNdqSIVE7oXTpJazoKGYYK8Sh4erqzOet8SyrLxB6fGl63A9VHxh\naZRNatH98iErYRnDTMgrN31BKtMEMRWB0Lf+/MG20qZUiXF6lLmdUO1iemAx\n5zWIZ27ZdNFVBljBI7u1q5AojujnkMrBzMYo0lVg8RpEmExgWEZ9Ry27ew5p\nbqstYjCHP+4j5NxNZVw2XxyWq7rIu1c/tIuXw000LM+UxolSqCqDDhIceFg9\nUFkF5e12YQdHuaUqUVCfgLvSiUOe8UagMiGgY9hrtCepJY5huc0gRpBiL2vY\nCYuC\r\n=R+ue\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"1cd51d9ad7561738480a328ec4d3f91f8db07639","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["npm run lint-fix","git add ."]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.137","@balena/jellyfish-logger":"^3.0.0","@balena/jellyfish-environment":"^4.1.31","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.1","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.1","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.251_1622618521772_0.5320292910410298","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.252-improve-lint-staged-4f64d6fe5c4a1e122823275f6a0a6ee5d1a4818a":{"name":"@balena/jellyfish-metrics","version":"1.0.252-improve-lint-staged-4f64d6fe5c4a1e122823275f6a0a6ee5d1a4818a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.252-improve-lint-staged-4f64d6fe5c4a1e122823275f6a0a6ee5d1a4818a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e68f67afe9da4c84d5637eb8570437c1ede6814a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.252-improve-lint-staged-4f64d6fe5c4a1e122823275f6a0a6ee5d1a4818a.tgz","fileCount":15,"integrity":"sha512-iuKAjPIlTqXBMKpLuhl46M0dWJaj0Vv955b0REoGs96Jzia6RyLhUQsMi8d0VZLUyAr8cm6EVHNJr5W62RMLxg==","signatures":[{"sig":"MEUCIQCpwENFk0je1Gw+ZpupSTUrBa7aXlq7whyveA/RvlYOjwIgIMSAUXzE60soJN4fxcgqvaJup8dYX1qXEMv1wmus4Vk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":116332,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJguWP7CRA9TVsSAnZWagAARgYP/1vxfb248UECRj5knO7s\n5uLTQAxi+LcsjmTBRFHL7a2qF2lO8aqG0ml1c/1Hp4d3kB7rpAmAmfxhTBPP\n3/IM/Fw4H9u7ACFdSx18kmNIy7mbBpLlISMPZMjn7nKeTDIlHey2zmi5Vp9F\nEDDXwF6XgmbEWZtqskcihpe+d83rKh5ADwoEp9iGgQFRVQPpE4QO06Y6r7BE\nYyFD2X7BAqivtguVwPDyjHVk4fDrQx8c44L/HQt3zdkseXGpQ9FOAgTPFJPm\neQodkSgizBlZ6BvAmtaYKwiBHngfl74jbyUN74fml3wbGO0GfNMYAyTUAaJB\nOuFichubx3resABWlCmTI4O04MPMjRseABD8K30oreKCAbWbKCY/K2OJ7mKs\nPt3ClArM4dAFk+EMAKxVLpL7RmIpMx/pGUsdobffUwm/7NW7OO1fCT3FXyd/\nIpvBJY1goKWl6kIeVSz4HugaD8rz+ZZrN2mAWTnKdvJN470tPuBDjXAShZDI\nioEKKJS9H++cGhzz7YmD/XE4knnYiraGKgL70/rc+6TfNFvwFvB5ETor9jmX\nMKD0bXkUMy1CVswkJXfvnwUZUHXYZjKglcVttIh7nfau2Ba5KgW1k7Q05Iwh\nxECl5WdGR8LRFJzQFfSXFua65ncgKd16KzGwVWFbpz66J9WqCVhe8rSBblY6\nOs1G\r\n=nhbT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4f64d6fe5c4a1e122823275f6a0a6ee5d1a4818a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.137","@balena/jellyfish-logger":"^3.0.0","@balena/jellyfish-environment":"^4.1.31","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.1","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.1","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.252-improve-lint-staged-4f64d6fe5c4a1e122823275f6a0a6ee5d1a4818a_1622762491634_0.19107537114109419","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.252":{"name":"@balena/jellyfish-metrics","version":"1.0.252","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.252","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a9cd42037c1ea7b778d3ed6553797efe42c09a7c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.252.tgz","fileCount":15,"integrity":"sha512-ZuFo7lYNvIHVnbPuVrwAHu1EZnGyIlsO39irhALj78MaecKJLozkUCMk+1yIKpMORRgtUUjyfPeHE1rT93iDRg==","signatures":[{"sig":"MEUCIQCPFr1dgpvdtVDmYbl3pv/jpdjoqD/+OcRUlRYnLsSxJwIgNB76zdfklABexKKGNeLifXtjCfAlJB1NjKJ1GFmL3cU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":116271,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJguWS8CRA9TVsSAnZWagAAhg8QAI5ZJc730SXSTnaL4Ibl\n1zZ+C6yqmddU2tZ9nzFkQ67wu3hyb/fXRjlvq5H0mgHqnKTXpieKkBW9PkxU\naxIuMXrnpGjAkXESRBoiG360BMsGyO421dIVDeVmIWgKHFon/BrfsIZt0k91\nQeicAg1gwd4AkH6HyKWYs7wsDyED6xKI01Z9ttNipzTyX46EeVN2fGl/i1bD\nTFVDk+U/GWFdwlB7RQ6+6xCTmuoMN0vGoJWuEsT2AYCBqVGuAzV7fq1CNQ4l\nFQW3NU6fm3QflPwQh2WgdOW+2efzL2OgPDQLEIwEjDLlvhYlzS+i4fTyLsrU\nwe3/YPibBqtMWO2cEIBpTHdBlBXAdsQNdxi/fB/0uyTzzEmyyCZUUhg76jUe\nMHy3gooDHqUvdvGBznLkvU5GajLhWSDuUqX6ulZLsNPmLu7jkxWYIBjc8HdU\n8yMj2Wt6o/WwO3XNNpu1KD0184h+jlkeCw7jZQZdTc5G+ypVtX1clDTqhU+Y\nbQnRLWMWFiO8/8m6sv18r2XgFpClgYkxFZjXVavmyJ+MRUUq0Ntz7ClzIqI/\njtf43qIneRhDnC5gVeoNixa1hk/QRVlmTtjZ8QWuxyU2uz9kl0nd687jF50D\n7/PqohvL35qsgP1PctmjJKm/KHc+AkofXOV+8AoBy0fN3yMJ/SjScARvnPDZ\nmhvM\r\n=JM78\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0b5dd04a84e8a51567ae613ff8eee7abd9b2a0e5","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.137","@balena/jellyfish-logger":"^3.0.0","@balena/jellyfish-environment":"^4.1.31","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.1","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.1","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.252_1622762684033_0.7765047412556607","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.253-renovate-external-non-major-a84232bd1e6d57938f83fbd8ff63cf7407165780":{"name":"@balena/jellyfish-metrics","version":"1.0.253-renovate-external-non-major-a84232bd1e6d57938f83fbd8ff63cf7407165780","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.253-renovate-external-non-major-a84232bd1e6d57938f83fbd8ff63cf7407165780","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"00d2f38d2d66ead055fe9fa8128c83bc495d0749","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.253-renovate-external-non-major-a84232bd1e6d57938f83fbd8ff63cf7407165780.tgz","fileCount":15,"integrity":"sha512-v6WRXSag9zcetcNAqOiClztf2WV/CuieNoZBT8PaPKc/Q1Pfy8cO4GaMhOfEPZexS4EHsBeRFMTZZmGkm9JJpg==","signatures":[{"sig":"MEUCIGrNWLdn/wgx0Wv2f99WIaNCXWwQanrpG9b+9zgX0FvxAiEAtO17i+tbdMac6Xhj3hN8UkrUEJpNG9UHJZsFnEmc3Us=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":116416,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJguzDBCRA9TVsSAnZWagAA/bMQAJmnMfbzp0aj2th4h+to\n2J5eh1rtjCdKzrBVmlQQJToYXCZko6TPE2wkqTxgZvZu5AmrD/hvul9ejXUk\nvKYTeOfcrmftwGhHKrBUMcQKWyIrHZewx1Avva6RIiMyYL3Xf19V7adZpgBL\nsRHpX9nneR6VhuT4qi0Tz7iyYs1JGPmYVkK4EgGLOF6Gva2WAwYwkTJEzGA0\nxJv6kX5mOziqpzr9NY1qiQiwbskWvfkAck/Zpa+DoC+bBk1G5RkV/1w5c/bF\nlA8W5ebQaUpTn3KwvCYbdF9vGhuG4PwvZFnlydIP7m/esd7YSOoN7xwcZMJR\nXhNWX4bwoJ0Uta90PfMLLQerGIPJ9owGbNprUPRwfDyFra7jGAmi1hlSsYiM\nXhnOUfjXAZSTgY3wPD67Mu2ID2pK4KxXL8v9m/g0HojC6aRDJJrV7BFw1Usc\nKbLcXR7teiKc3Raxf20zn/T74bE8zEWFWtmWABLjeH0vPPFYMSwLEW3S+6wd\nCKr56g/X8UcGCKi/7TL5Ia+jRYcVDteJprNZw7ALbcD0/Y0sckf+Bpv2E825\nOv31roddTpor7xIYtX4apsTKN6rpvubfD2Ed7X6WJzGw5T8xj8KxhTQGtE40\nh/k0JmFAEJyaJgLyT/tTlVvJCVpcTzPJFQLBB8+IYC1X4N/JqeREIcTNPI/r\nndgH\r\n=gBN+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a84232bd1e6d57938f83fbd8ff63cf7407165780","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.137","@balena/jellyfish-logger":"^3.0.0","@balena/jellyfish-environment":"^4.1.31","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.2","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.2","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.253-renovate-external-non-major-a84232bd1e6d57938f83fbd8ff63cf7407165780_1622880448942_0.27733083387139557","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.253":{"name":"@balena/jellyfish-metrics","version":"1.0.253","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.253","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"56ca3a7fcf20650a250aba7f6033d37b125024a5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.253.tgz","fileCount":15,"integrity":"sha512-PISjcUqqHICgEqgZTzZi8S6rXd0f2wP4vwNVkUahu3uOZTXC2s/9/71hBB2nQrLdmCbOWG4qqj+4vQG1TXsAWQ==","signatures":[{"sig":"MEQCIDw5qjz6gU1M3NuaJ21vniI0AO0MGz8HrUkFmj+iauqIAiBm9HH0PROG5uHbFnIBWFO7UKPp6edjpch0/QM4gE0g2Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":116347,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJguzGMCRA9TVsSAnZWagAAi0cQAKQ/4FCWHGf2eyssvnkv\nxFXWlT0BongY6f8hFR4CKIGzGXig+abFWiCQGypPo4bLgkVdrOVEOi/rcJ2e\nc7FRq3mFJiHRHo3lLJSqo154JNi54GcVqbu5bWMyxHrvEnxSSdPaeZPgQ3kU\nzb38Mq6stdx4+TOJpLkNRKt3pm5XRvd+2wAcsuCYisx+lX7oNR2QqjPoUfXm\nEEAeKLaUHibgLgEgmPUtn83BXKr2v5QhoThWEKyDKNXyiasvBjyMG5sWtudT\nGyDwcRPWggSn9Dyo4qpFzyyf8AK4g++L4ZkFhI4oOODAJcF5wWPC9cENDF1N\nY8OWvtBz1Jj8y01IDTNHdGk1V+fZXfOXJnZ2jVfhaiD+tyTmr4qUeT9xTkXS\n4Zx0DJIgosvlN59seI4RYUa7kSh5iEccuD4Fi6GHYi9DvKtIIpGPM5Bf3SBX\nHkRZBaoZhDiqe127RlUSQ/Eds/qrjUTyZZk+SeBobzyAjd+o3L9TiVq4vqSz\nhMDBoxbZ13Fo3/UyrqnjN5bW39VoITZsEA+N6ChukxYCPppGwrD1kzmmi68I\n1fTBl8O8JQoBAfm8jooDlc2MI5PD+IzQql4ptPE4eALAt3gjaROEVJZ74i5w\nSsAORk9P2pPih/8oOVirA7jv/CP02aBjMWuLJuNnv/i8qxzJNftSEK5KjtgW\nnBiO\r\n=6VaG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"1b4d50ed3f1aace18a015bd8cff5663bb4d82495","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.137","@balena/jellyfish-logger":"^3.0.0","@balena/jellyfish-environment":"^4.1.31","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.2","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.2","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.253_1622880652304_0.17318104570140136","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.254-renovate-internal-patch-f75b7ee70d11272b3a14cb7243a4830bc328efd9":{"name":"@balena/jellyfish-metrics","version":"1.0.254-renovate-internal-patch-f75b7ee70d11272b3a14cb7243a4830bc328efd9","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.254-renovate-internal-patch-f75b7ee70d11272b3a14cb7243a4830bc328efd9","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d3f4275e3723d991b6e84cd5b505c48238dbdff4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.254-renovate-internal-patch-f75b7ee70d11272b3a14cb7243a4830bc328efd9.tgz","fileCount":15,"integrity":"sha512-BtwrIGAaX3OjRR1hU6FPkavI3g9RWaV3lqg/fr6Crmn6Pd3ZmxBlfJ2zBb0cO+FAqI7XsKNLL76Yz1WszPoiww==","signatures":[{"sig":"MEUCIQDhSUS+K/d3xhk8cDpycZbs3jk48+JreME+KRgp6LRP0AIgQbeilfNFw0JoaA56EoS0IgBmJIhB1lyMgpcbNXqogAs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":116484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJguzNhCRA9TVsSAnZWagAATdcP/1TeMfI0EadIo7d4wuRV\n77ESVsKy7ifUvSXSKzVETCrbKnBMWZAe11xUbr5YD50IX+HyaFUUKfneqHhx\nKNUclbnbtXD8wrLLw1XEGiOuOqaz9bgo86xN7/Oq7NckFfKH+PSnrnmk8ocM\nJsTFuj0mf7AnCWWJy8DgI/5c275j7O1flzSWEG5d7DGY7bcylAdbeubX8AI2\nOCyMxf4lr9/sd/V4LAwGMWpUG4UQhb/ICEsKgaJSSefpAbi013m9bhDJrjCe\nFheWhB9z5Zw71Cdy+Crv8No1CU0fji196l+6KGbAiHKgZgw2tFRFnk2vzFgy\nuAfk6vk/CtIBx6QtH+3JUzVRTDTV7uulyUAB2UqsXz2qDCSc8+wvyKFtO7Ij\nAdb2WWpAyqun87lgDFr+vRrq3sM919dN6mKALHLZWRuR6iXaZRP/NTU05RIG\nE/m3LWE8aQNE/o9GGTmhf3l7koKButyr8l3qqaqSrglL5rhJq+SakaybQWw8\njQrEtafK/T9J2gzzxX7MBuPitWu6LB2HOcPLRv6pud0wf7WcbCF9YDchIwrx\n0Btjf7t1AG5eU3I13nEhmViWxDudtLZ1MH8Ka7yCPP/vcoAR7H1CZsG83FYq\nq28f3JpQLlLfinO1NNcnKATYWCRJfbR0vuCUGF1urZc3xGmYnE1eoeR0bkKZ\nKPi+\r\n=7N7s\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f75b7ee70d11272b3a14cb7243a4830bc328efd9","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.137","@balena/jellyfish-logger":"^3.0.3","@balena/jellyfish-environment":"^4.1.34","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.2","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.2","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.254-renovate-internal-patch-f75b7ee70d11272b3a14cb7243a4830bc328efd9_1622881121476_0.07463520304352045","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.254-renovate-balena-jellyfish-types-0-x-60a54f9f0eb3d94b981aca36ba845de1f1578210":{"name":"@balena/jellyfish-metrics","version":"1.0.254-renovate-balena-jellyfish-types-0-x-60a54f9f0eb3d94b981aca36ba845de1f1578210","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.254-renovate-balena-jellyfish-types-0-x-60a54f9f0eb3d94b981aca36ba845de1f1578210","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f7871d67092c518875a9c41c2bbca52614f3164d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.254-renovate-balena-jellyfish-types-0-x-60a54f9f0eb3d94b981aca36ba845de1f1578210.tgz","fileCount":15,"integrity":"sha512-+3fp5LPBgDPigb+jvFFOe+USbSBYIrue2++2xrfpBgwJIyDV6FYW01N5N7xEl4EUbL+ZGwYJsYKka8uK8j0M6A==","signatures":[{"sig":"MEYCIQDdGmdMM8214vQENfhaGDgga8b/C7IvHoyTj9YgIwJDCgIhAJbg8miH2xXCLj1EDAbV0eGHaIBkwRqfSLOJzlUIYDeZ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":116524,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJguzN8CRA9TVsSAnZWagAASqQP/jlxgpsahC+Y6eNFHHLL\nci2N0j0OgKZT1EvqbFN62b2tOtsSfoxXMSToT+508thMSJ3iklHor+IrF+KW\nqoGsbpNIlaV9fCKNkPtc/wH5iib8zjcKCKS3dd8jtXRhYBWtpAvQg/9/OjPE\nJ/+o2hifz+BKp733SBZmnp8foP1++HdB/rfV0Wg/Mg3Oh1vptQOJtnBJiuFd\n5P8Y2Boh+U/1FZTOMscPHNYU425UrksJrOVl0ZTkuPYZBht1HR76qDzJ2AgB\nUYFfLH2LeAmLLjeHykkbr7v1rTjGgkSKUWkPxwHJ9Iio7q3JfZSy9FEYyI11\nAirlQSJsRCVhTxNs9gybybIagt97y6bKSDKTWxtDWyYFRFEswfgbgmuuaUOv\n+QQaV1doaLSATlsiLRrCp4w5BOPcE6fZfTTRxdWY38tRzPd0JjXTC0CCRqd4\n/lijkB2V0kBKRje075CYBgWPOn6qpJ4KYH2xxEqC+Clg23LnJuNfA2m/QTWl\nVUV6lnosIubfvWVP2epv0xmhmLoKdUPUMU6Iu8vbzzPfvpzxiRYB30Vjc+yP\nFrUTpdcOSv/KujVzUnmHCXu4Dl3Ysfd3ttKZxxWRJezdppzG/ELJZ0FraMOT\n1HzcvZvKLtDwt5/xLN+VBCIeg/QgGGSFB5Kz2CM/d+IKvsJlXFmdZWxDbqDg\ncp7B\r\n=9LV7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"60a54f9f0eb3d94b981aca36ba845de1f1578210","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.2","@balena/jellyfish-logger":"^3.0.0","@balena/jellyfish-environment":"^4.1.31","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.2","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.2","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.254-renovate-balena-jellyfish-types-0-x-60a54f9f0eb3d94b981aca36ba845de1f1578210_1622881147925_0.25987158864789817","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.254":{"name":"@balena/jellyfish-metrics","version":"1.0.254","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.254","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d5685f760ac8ed8e4b15a2e688fedb9fc57be22a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.254.tgz","fileCount":15,"integrity":"sha512-E5HDPvgQXuQXQbti0Ud/HwqGARCabdu+KdYEkpnWq+RZ5T3RAILCVOlsTtuIM3eF26lU57LBDqVGY2K0Q23OxA==","signatures":[{"sig":"MEUCICx4u+T5txVzgLdLM2BI7VLoAcdJxvdPyG8cPHz6eayvAiEAyg0djX3nYbwvR6gCALtvUd83lY47AHfwuJ4PtBsBooI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":116419,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJguzRiCRA9TVsSAnZWagAAAlgP/ApxrUBsj9owyBjSjfhC\n1WTlOkEM2mZ8XsRJ9ZJBZjCTos7LVpMJc64XsFl7N8wXPDBAVRe6E/DGt5No\nBz430wwoC1UPg+AsiziTmeoKz6AjViRphdSSXBS6f1ZiYmUReg0B0EASQgsm\ne9L/QqXRmetw/jsGZKPpDWB0qYcL1kRcPZ4iR6dGn7wuoPUmvDF7C1h7cQyB\nlV0oWUJGsBCM4GZlOqPWxOyKquR6ys1Tay+WolIhUrNaiH25vWLSUmosHTx2\n18Ru5twJH+Xbz6iTeXIY5P01HgWj1hfyg5OcOQFiunTKRVutpiOFgY8Ix+M7\nG+LgPGeQ1Ux858N6YfObPcZY8DgUargvQOayEnhjyZOY/RvJgx0mONG3/1lR\njCRa4JU8lBKkPmctUgqMmufut2iqaS2xE3cinIIBIgf20arHsjyi9DNo4Bvn\nelYj84UzEeqLzn75oFDRL84mNLuqZooEf0NXiLPsG5o+V+HQBSTpiJ+w2YLf\nyZzP7DL2YRwUBpLEsuqI25c6gMQ4HYKXFvV1RkH2mFycLE5MFm3JqnIgLAlX\nhBCmwkZYQGDVoeuD4tnZTud/vWc38IQhYXydTDg0fq+c81HZYN2MsCethzLl\nhTUqruFq0ih9B1rlh5Yygd/1dfiIAVwWN3uvwWEY4p+yympdMz24i+uPo+VA\ncb17\r\n=OhdK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7397b389b043733a597d66d7712ad5ff75469dc1","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.137","@balena/jellyfish-logger":"^3.0.3","@balena/jellyfish-environment":"^4.1.34","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.2","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.2","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.254_1622881377866_0.9983782973588549","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.255-renovate-internal-patch-8ae6d70e80f183a20b48a56d3791a4642905a5f4":{"name":"@balena/jellyfish-metrics","version":"1.0.255-renovate-internal-patch-8ae6d70e80f183a20b48a56d3791a4642905a5f4","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.255-renovate-internal-patch-8ae6d70e80f183a20b48a56d3791a4642905a5f4","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1b0b5dec5931c34b99e5995cc2b9c2c729d47dc2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.255-renovate-internal-patch-8ae6d70e80f183a20b48a56d3791a4642905a5f4.tgz","fileCount":15,"integrity":"sha512-B7SZoWxkNwpRusGXuFW3pq6LOtnyS/ElJHKOu3l02tZdgEeAl4fA73OzLlon6gFcFWlw1PuUVD8yJ3XLeIW8Qg==","signatures":[{"sig":"MEYCIQD0xSL+i1dfUQlnhl+T3reo+3t9UYaQbtxIXH2CP9osWwIhANgOdiT+l+BjfebWVksD/GdIwhk+PE6bZQ3kPmshdnhT","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":116587,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgu0hSCRA9TVsSAnZWagAAWpgP/026cPQbn67Puk2MLNxY\ng0zdVJ4tV+0IsHG7Ps2p4AVd5XHnWh8l3PEgOtduW6Dbs6rdxBKHTVqrvUo5\nvjgKqOkFFWdR/CX7+LGTk+UDkKZ5dtSubFmOSwX/xWur4FcVpAtHPpWYXmRZ\nEZZwwsj5c6dOobxSBGQvChaiTeKiZohueWPnIhWegQkJF4wXJciITd0quAEz\nwmTC1bDarinQ/3BsscoAgKHginEPm/xP69FG5KAPVZFyWere1UO7JITSsOse\neTglFpH1zLD/M7FI6lqO4uYiac23ZAz776W3TQC59WULBN6NP+D+whTMf+bL\nMfssZ0V0sCkrZL3i10M14jqHeElkyg/cPqgEfye6cG/h/ALXIaTJI1V+ZH62\n9qywl0uh9t91u6+JzSfDd8LUpEH7xzCyQBv7TG10gu4QB6gkVDJFyGaRVVJp\nM/td9ZxGyjCpqiVcu6qv5EGpfTGoMSVJPDdw6FoPA9vWPchtOyUSA0q2tlQm\nNtWdPnIJi2ooLHBt5pegqJRwCYQCt6mILMANpKBj+dAMvlrMEyRrR+hSB+el\nDd5rKE7WFsps1/t/0rUNsXns6AlQ4XjqdmTDCvxTjiwCcmuT55C66c5VbP6X\n7/t8yLHkwRkQA1ZpU7bAYNJ3Vx7aquxBZeweqYv6pd2RljaPVd2UTEDiz1eM\nm5HK\r\n=xx39\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8ae6d70e80f183a20b48a56d3791a4642905a5f4","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.137","@balena/jellyfish-logger":"^3.0.5","@balena/jellyfish-environment":"^4.1.34","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.2","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.2","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.255-renovate-internal-patch-8ae6d70e80f183a20b48a56d3791a4642905a5f4_1622886482511_0.3015126611076684","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.255":{"name":"@balena/jellyfish-metrics","version":"1.0.255","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.255","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"10088c575846ac03a27de18be1e007a5c5079ea0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.255.tgz","fileCount":15,"integrity":"sha512-m19KcZ+9aQGYTQ3Af5HuLAl4RPFLMYSvcbTtu0iPLhivf7Gk/On4EyHCaNctcXnLLLq3J7o2wF51eVCmAR9kQw==","signatures":[{"sig":"MEUCIHBdW6gzz5uI2aF4vQqi9LtJSrMpR11Om4K+GWsdu2tmAiEA6cmPBq3zWgNuqNUWMuTaCh8a0hjLKg0JJUUZ+F2ik/g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":116522,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgu0kkCRA9TVsSAnZWagAAyJcP/AmDhUc5Iis3XHma26oo\npumNK+BI3pZqxUQ6jGyErcHE7KVL4WRKRlzUa1pQxGJNcrSbvm3oZDeT3s79\nsMPwE5e2bbVxA/afeFdj55WHDb6Tp52OFG1AsiCoJm8rEVs8XPdyA04qN/KG\nLGN0nsWMmsXCzzkPx+9sz/KaSJ+M/cFfD8DxDYOsz7HVI/pBCq+OS9Z26Kbw\njDvoR2BTSX+A7UO4pCQ/pDNV+yOnGnT6CDRQtUIIOr6MABiQm5wUg+gXkJ4v\ntBYalb3hWiRH1fYhlQ6SIFBHuIeTrcGZaHLLPUqY30i4lNw2ekPyRCFg4pAj\nWSNEoVtTmh8IKwH+L7wLAAIKzEzlqi0u1C8OOMY7yVdJwC29s6zAX9x7AGm0\nZ2lbOcsMFnifco5vMMVTXf7m/hQWiuLc/oMXOKOtaGtsFnXKu0hAFe/Alquw\ns6kudPy0BV/2LB+6ou/Td9uenjhGm9oXyFSOlM+7Vu19whQtu9bWdr8cQp7l\nhcRBIHFyzLXUVYqALtbrujC4vaFkrwbgxGUyu7NwrbntrLhVO/pNsoHmOCqZ\n8eUnG2susPUZSEyapuQx/OyYPpwBu5b4YalWGl/SrHiTR6PRlwA0CJPNIqC9\nDXlj08Df5laLgHUgpQa4YcP30iFHf1W3glaKB+BxXaFAqIV6Ooqcq3H5ayAC\nOKgl\r\n=Vq4I\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a3b784edffc23a38308d79601355dfd80a60a36d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.5.137","@balena/jellyfish-logger":"^3.0.5","@balena/jellyfish-environment":"^4.1.34","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.2","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.2","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.255_1622886692454_0.42954773933745116","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.256-renovate-balena-jellyfish-types-0-x-901af96d3c22ff794e39bb4ad94356a196a25e55":{"name":"@balena/jellyfish-metrics","version":"1.0.256-renovate-balena-jellyfish-types-0-x-901af96d3c22ff794e39bb4ad94356a196a25e55","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.256-renovate-balena-jellyfish-types-0-x-901af96d3c22ff794e39bb4ad94356a196a25e55","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"be7ab6b915a30e4391605ac69d2821aaf15a0ff9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.256-renovate-balena-jellyfish-types-0-x-901af96d3c22ff794e39bb4ad94356a196a25e55.tgz","fileCount":15,"integrity":"sha512-gJoQYAe6SFT1cVYCv8fVgMgQPFmJNmIrOcG2MnY62LQ/RzhkRLwheuOjh10/a8nyXoio3LsLaEDLgIheASd30w==","signatures":[{"sig":"MEUCIG8h24h3vvacgN53tjh735/16l/LQOBaXl1ezUI/uJI/AiEA2yNpw7GKms2KuXa6E+ohHe6FeVpZG5xKSd0xxCo23KQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":116699,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgu0orCRA9TVsSAnZWagAATX4QAKR2iq4nv0zUrMsaVUGB\nhLG+ThUcFykpHAIbsJpqH+MlvMItYH9/Qr7DIX2v7NA3O8BfB0xw+XkqRfcZ\n1s4RSEO2zepr4Ug6fZqBiPkzGojxYibIt4BIUIcnr1JGXjZmARnP/OSaaju6\nP6wVif0hjutPy9ynncyiKqLFQq9uNZa+7XepGM7B4Nk4pnRnB4hYa9j4NaB4\nT2TjqznwjCYgae+7hZJ6UZb2gaSbyFw84zdDjCzGQOXTkdd74cuPlTf6d0IJ\nd5wS7yNE5d3ZSDAh38f5Hmjc2ybPXLS4fZxC/KjaCNtLYm1eCpnst1cSWb+B\nKrEUqB4AuI+zenf7xW17Dgm4SUBLKv7YlLzX2wvSPwH7LCt8wBCbNVw9G8Zd\ndum37+DSA2ymMSuZiblPkfHE/pjNIgo9WoWwyVbMPWBCesIXEBa+Gox9b2v7\nVqIfY2er/G2HrCQ7E0ymM2mVJLu1dq/gR/Cr7r2IneffcHeEmarx344fIJ7m\ncgXK0F+fKDxkmEIIy7Zr6+SqOONxMcjz6iy9/6otogn2dwR1doS3s0c3vpWx\n1XmwQvqGwkjChDgbZqkfozomDpGf9j1LEfLM2I8mRNvxfk++dKpTydF+JPZb\n0f6h8S5W/3Lj2yCKHaN5z0NJ5WaK/4pWeCK2AjaQa08mVaVWQ2fSH5hmpe8R\n/EAF\r\n=rpfR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"901af96d3c22ff794e39bb4ad94356a196a25e55","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.2","@balena/jellyfish-logger":"^3.0.5","@balena/jellyfish-environment":"^4.1.34","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.2","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.2","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.256-renovate-balena-jellyfish-types-0-x-901af96d3c22ff794e39bb4ad94356a196a25e55_1622886955221_0.08359092140109192","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.256":{"name":"@balena/jellyfish-metrics","version":"1.0.256","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.256","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c1fde53b6886aaca56fa5aed18da6294180a0f0a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.256.tgz","fileCount":15,"integrity":"sha512-74xWMxQrWt1gfxc2lDFWDg+LvbcDYPg2AToFG6rSkkQa4V1vaASWDLQYo9IYEbWJ7jR7xpyEIsbk6x6tYL0eAw==","signatures":[{"sig":"MEUCIQCthXbEFWrxn9XEb3atEUUkIMMC6DyN/zaPzqa7hdT6RgIgbb+svmF8TJZosM2R4Jkzyw+UOaedHDHxmbYvKZXqD/s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":116622,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgu5Y+CRA9TVsSAnZWagAAoKoQAI85M9SjQTuUhfbfsMdN\nkRmRiRmhRuEKmQ2TNDEuwTYmRNq76U/f6ds94fjo6WJEcwq1qDeyoftUPwF+\nP14Wsu4Z1t0ZZ1gRuf9zr+VJadh5NGEmLo39KiDKq4trLeMWPk0ejnL9J3dM\nBT1+hUi6tgOh1bNJDYBGzt2c22OdHGCl0EiP4PWBzTq5kjUkdGKNTzsT/Tlj\nD1CMbA3Wq1bHJ3BS/bq9jxMhCagi2DVr3muYFLBlj+2H0RY7OdLL7CQP/Qth\nn88i/gyhgsF57YhBCvqUGmh1QGxVktWT8/kkD3fJs9XfOlWo7OkZ6nJ9XsWq\nLsVQZrqWPNKKJF+x56K5zcS60ORpHhB/5gPCVg0xStdFY3fCbguCwlByNdBz\nQp9ENEn7joB9aoR4fTAXd0+Ko4YWXTGi3FVV/hAl7pZzwnHZR6WnuUE/C15R\nwlKT2JQ2F7ZBYgm8vjJayEFnmnut/in/cYGdhlIN6QHHrfk1uwGuSPgq7Pup\nOtSDQ3969gSSeeaVWviWbWnb4k5AOfpQJfBwZtcs38RiUhrVzWnn+oS3DGMF\nQdiWrPwFiRKkWTof4JySwGuSpMR7O/SvMj850p0Zd3/tuIDZgKw/cmiXHQdx\nwPryvyW+T5R2FeIfGx3tbkkDKLgnNBLUZiRI3tQo+ZB3SGPQCxxlxx63QaTM\nk/LP\r\n=xYCl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a534e8581d5c734b0ea781af99aaae1568376dec","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.2","@balena/jellyfish-logger":"^3.0.5","@balena/jellyfish-environment":"^4.1.34","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.2","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.2","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.256_1622906429932_0.037326079198228834","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.257-renovate-internal-patch-a8cfcad1dc732f1f690f43ba0871b76e79df7e0b":{"name":"@balena/jellyfish-metrics","version":"1.0.257-renovate-internal-patch-a8cfcad1dc732f1f690f43ba0871b76e79df7e0b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.257-renovate-internal-patch-a8cfcad1dc732f1f690f43ba0871b76e79df7e0b","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fd809f9959d9347d7c1f8ba1b9093ec78ee28073","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.257-renovate-internal-patch-a8cfcad1dc732f1f690f43ba0871b76e79df7e0b.tgz","fileCount":15,"integrity":"sha512-uHxYT6JiD8Rh0TjsU5OTlagO7M72NXpIpa4Zeo8EW/yZlEQsJnI9Mw+/stjDhZs7PKgHqvv2yQTk36ewZUOipA==","signatures":[{"sig":"MEUCIQDukovTYgpzp8G/leSfw+DEBl4VijIBrrWPPge3+wQHSgIgCdTlWQW9RvvTcoh/OCuqXZuaRd3ZrUXyUrdNSarZR7c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":116759,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvQ2ZCRA9TVsSAnZWagAAcLQP/RWWO7Jem3ueXyjjQaJN\ncZ5/opLQNFRqGc7sAFtgZvQNAvcCfhdGuXXedwMX9yCva7WdTcV3aladHJy4\n/gb/yLGGxMW6ofulIsDvoLdCe8NTfy8bRLA3Ei2oaqewIBvD3WtCYf1mHrfN\nplkiFIy770LSmzlHlVfJJ2wPOxv5UIRKAQuSwFQ85HxZdPXph7obQtCy8Mqk\nUskB4SRXSbQy2liHfchYlH0d+cTQSpcmaH+srft7HCkWxRLBx/wptG9MdhX3\n0DtfO1TLbFD7BUSEnlmbEIS4oJdtvxl3LL+5M8S6MzuFuK6nt6ZKoZTpHG14\n6DHg7QL3HVW+X3kLnsKtLKReah+k6BpyVdL9cL2S/EI/aE4+KTzX5nxIinE3\njP4YrxYqI0qpuN1mROGkOnpX5z7SIOXxcqX2PgFbvDcMvxWOsULGkSHh6qnI\nafBBKk/TENfVyzJ1u3qelpilXgI5x06fLzP/p4CRTetM9pgHdKAieZVyN9y9\nn4IoQ+/KrIsc4kqQ3Ck2CmRj2nnpINuL6PcN05Np2QgTaKE8Utouy7w3hxvF\nXmaVM49e4saVDVWG4B6w1I15YWacDX50eYleqHNRTPs9JvfdrvF2nCQBLd0T\nLD11A6AxG9wxMxVkru97us9bqKjV+kQ7BwWG36yVytNBJSt++1zI43Vmxygo\nh3QM\r\n=OSU8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a8cfcad1dc732f1f690f43ba0871b76e79df7e0b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.2","@balena/jellyfish-logger":"^3.0.6","@balena/jellyfish-environment":"^4.1.35","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.2","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.2","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.257-renovate-internal-patch-a8cfcad1dc732f1f690f43ba0871b76e79df7e0b_1623002520966_0.07687760477012984","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.257":{"name":"@balena/jellyfish-metrics","version":"1.0.257","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.257","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"273dee8720a89e0bd6210abf76a1c00c30b80f85","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.257.tgz","fileCount":15,"integrity":"sha512-+rzFcSYtqFJEut1XKMTjHfwflUkBvNsFLpXziUo0z8iAwKBn0RirG9prZOzjfdoe6i25rhQ5sttF7owSrr1JKw==","signatures":[{"sig":"MEUCIC2DWqBz+Pz1vG8h0b4Q/w2ChE5urnke8ASv1hQwxSIcAiEAz/7OdDXvr/GWsvDrY/7YQRK4j5nHrbKdfAQptokAB78=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":116694,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvQ6GCRA9TVsSAnZWagAA8YgP/RhW/AHLVY8Np3UdRzKz\nucWhSLoRVaNl9SfT53550HAs2YO8lBX7qv/e2fjhAX3rzwdIl/1OMVod3SYj\ngQ8QWXl5byWf3gBJvRttgdUM6kIRbDrljZo6pMZHbLuyoDbO+Hp0pcxXzp0b\nKMi1qbVw00td0k9QufuTzcFif3iWUf9eWLQdBNqj6ZHVHu1zKHspXWJqjuww\nNV5fLGG94aG/a0+IPeFZsg3YpclF5ySFO6Sxfq07fjpGS3YKv7Sc161z8w+Y\nznI0LmG2fRbRBWziKWxjXAtGzunO2gpHqQtOicV4ncrssval22Rw8RmDL5UH\nsAYBnFRFe6xoxGgCgnVULVqhs5Gnds+6XTux0/Z41ImThcB6wHSuWw6ksGQj\nzklWOZkHFm84PqLA//VPb7P7LtXIlJcTzfQKtXBQx6D1Uz5JM/4EKA5G/aRw\npcdXIZWGgVWgNDEtrhcbIF24z2sJYj+Dj0zKYuySlW/pnXa6S/Mmq4jJJLev\nWjueeMiFJYaBmSaeQ5bk3Nj2mkrVpropykCI4URuEYYKfCGDcKCs9OGPdR0f\n9V6BcsL6N6z3ut3HHZ9oUyfxw9Znpd56O+wbfIXvha+ZC2IvH1F4PkywjEx1\nHLZZaIfsF+E+DvSO+Hm5m2H+ZwdrYHXRfUCanuolX5Y/G7Kf8JmF9ip39zV9\nZiXH\r\n=Br0u\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7602252a18c8ddce30ae3737184b7663bb5b6c78","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.2","@balena/jellyfish-logger":"^3.0.6","@balena/jellyfish-environment":"^4.1.35","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.2","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.2","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.257_1623002757995_0.35662115347101264","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.257-renovate-external-non-major-5c7455789ebb19365c5ed144174d2a5bf8951b91":{"name":"@balena/jellyfish-metrics","version":"1.0.257-renovate-external-non-major-5c7455789ebb19365c5ed144174d2a5bf8951b91","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.257-renovate-external-non-major-5c7455789ebb19365c5ed144174d2a5bf8951b91","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"43433b66d353beb8bc482762f5bd6056743864e3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.257-renovate-external-non-major-5c7455789ebb19365c5ed144174d2a5bf8951b91.tgz","fileCount":15,"integrity":"sha512-RAzaejbJYDdjQAgKe8vNLRGbpY7VMTc94e7WLbUXNAnMjToHtZqj738+j3QIe/FxCoxCD0W//wMirooouMd2ZQ==","signatures":[{"sig":"MEQCIEouKKHVoWVqWAgZNHBYzch1FZsz36kP15YQiZ6jDsGnAiBrMHyrJJJtUVrHRbMNvfoXMbE1/VRorUbdeTFIVsbnlg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":116824,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvQ9aCRA9TVsSAnZWagAADMsP/RZwe13tbSGwpbvLo5XT\nONJ4UpxwB2RuyUq9zh1ZUaQoVwSrT/GmKz8fHYwZZbn55zNJTQ7fF1oBOZJT\noOqN3h3K3D1Ar6yDDxCcvSgfckAA7tQ6iYslo6O5PVBOR6yIlR4f/sDV6kyf\nabKyb+4lB8JfrnpjjwwvRpWvvzJees1uIkTxh4idjVCQrLSZ9gHw813LptLV\nO40nLdEHbjhwhZw6ODfirQeTSZS9JqUTZpfq9K3flqVEacQt0zN6zt3n3QU3\nfe2fTKXfETeIE1mZ0BLSiKnD54X1QOFMkR5w+Y+B/8NgU0w9uswnfl7Md72D\nMJgEx+rzX+P9bu69OBtwJ5kudgu40e+8UEu61o9lkcePab8m9UkbckyZRvCO\n4l5m7XcNjtr98SEYItQwSmkIvEuAod9z4Wau9HAaQAElNDP2GIq4lToPVrA5\nbZPAWDLjhmMdocbQM3CLcr+KSXdWx8fuD1eZc/hGlAw4A/bKOni3C6E0ytw1\no8wmyCnwHweSGVxkcnQ8N6fV1XQyC4eYwNEekeX8bqfjyWvY463YELi3Tfc1\nNFfB7eqM9YRQz3wm7DnB2LTnpItFzt+3FGrx+Mdbtikc/gKtOn6IDHFzPdGF\nX9D0qBRNJFM6JcqNgB0kGDv/Qy9N7fFnGvgOkxL1Q4/gq1MLLAxXMhRP9THy\n0L9E\r\n=95jj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5c7455789ebb19365c5ed144174d2a5bf8951b91","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.2","@balena/jellyfish-logger":"^3.0.6","@balena/jellyfish-environment":"^4.1.35","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.2","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.257-renovate-external-non-major-5c7455789ebb19365c5ed144174d2a5bf8951b91_1623002970829_0.32781481405289004","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.258-renovate-external-non-major-627b5d4c3174c1776c86f66ae0fdb435a95d7e39":{"name":"@balena/jellyfish-metrics","version":"1.0.258-renovate-external-non-major-627b5d4c3174c1776c86f66ae0fdb435a95d7e39","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.258-renovate-external-non-major-627b5d4c3174c1776c86f66ae0fdb435a95d7e39","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f3a3c54204e3dbd47dd2a8f93408b632dc872f11","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.258-renovate-external-non-major-627b5d4c3174c1776c86f66ae0fdb435a95d7e39.tgz","fileCount":15,"integrity":"sha512-0PUv36SBPt19wTHlQG4N33yEhJ52DwguWR/BXzZ2mwN8X1qh6hAlZFnbEEw/EPLYlrxBWsra+0FoSQwfbHg06g==","signatures":[{"sig":"MEYCIQDuHtCWu3HCUxP9jOBlWR7JMzGxuNIPk57QxUNi6zSOxAIhAL+MqPwOOPwFw+t36DSGt6dF+G1COFwEY0xWgcYf2ftd","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":116850,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvQ/8CRA9TVsSAnZWagAA4ZYP/31jRvoWRN86fnoGCil2\nJpKN+1le0ehC9bYOje7FF0hDBPxgalK3u0o1Xftr8MqJio7GuAv2hghB2FsF\nZ0a7CY1IEMaH20WWp3IU/HGuyYZewxxpoeoVAyu0DYm+cqi4nV9mt0KobIFP\nfyDaO46DBzcUuikBfU1x3j/AbC4xcc4A+X43teO1OwsPprWif/zIpko4WeHH\n/NnNRmSrUQxLD5pXJ+aC5tiua+KIZmVKLlH7G+q891XWsXb/EjH0LRHzZUtd\nOEX9FdDEfY+gO7wEProP3LV2eErVbwn2GGr4UqZFk/nkaQ76XXZgrUjWgG95\nGsJuPl6riPWg1KSA3G7Tvw0xgzqCg6SsEMmVHznqAZY6XEJLwCJJhjQOUpop\n1BMUymtx4WHIlB4F+unt2MplXnOZOlBEk4JTthMNFd50OqhdRN8ol0UsUirP\np1Xfz0pbdcwFsx4RoBTlI6eTXspIKbQwtdK+1Z3x6wYtWyIMpt4LNl1YrOIi\nUhUgmQY4H9sc/k5oLZJFwKDiv24UYubfhcC5TgMSq4eE8n/LXr01EpmEqiRV\nd5nZDa2LBWqWOF9VKHGWeMCk9ClXTv7XSiv0X7ziMDv8etdZBUJwUX9cY61u\nHegq4vbTfzwo6eCvLU7Ith19OsLATAOVzVE+O+Iwrku0NkyUVgXZH2Isiczh\nl+vq\r\n=ayzt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"627b5d4c3174c1776c86f66ae0fdb435a95d7e39","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.2","@balena/jellyfish-logger":"^3.0.6","@balena/jellyfish-environment":"^4.1.35","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.2","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.258-renovate-external-non-major-627b5d4c3174c1776c86f66ae0fdb435a95d7e39_1623003132649_0.3429617811522585","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.258":{"name":"@balena/jellyfish-metrics","version":"1.0.258","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.258","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6ed0628745a2e0104c4ea7a139c00e9079f5fc0c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.258.tgz","fileCount":15,"integrity":"sha512-G7SvG5c4WThjQa98QrOsZpzve3D+F2KLb0zJJ7zko2gskpfeVXhhE3PNbXvl24JydMNrqx0Wk6DHRDed0tDb9Q==","signatures":[{"sig":"MEUCIQD9+DO4z8Fb6pB+p2AUeVsjFKt9Bgg22gDyQejX38ZH/AIgWMAvlA+npWY4uLDDgNw8TmG8RizrfjdmZem2YELZbbc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":116781,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvRDuCRA9TVsSAnZWagAA09AQAJkjb7VGxIQplglzFGyS\nK1gNorZfdaiL4p02SCwnEilqrjD9V0mIautq4mEepEryREs4knts1bDca9aI\nZtqXUY42OT9wzo2lwMOiyUJbrD+hbC4prPt6Rjfs4CEqFxVVX90+WT3hXVYP\npOlEEm9z0HjDC593s2y6bD6mKzQV9sI3/JNKCcVF6KApCeTpSCUvm9uv8Oxn\ni/3pXerBdEi+2zOdesK9lPnqr9jYEKM55rNvo320hiT8bOmkfQW4CfR/ZoZM\nIPFMWgqqA4L6U2+edqcGT0zbxq8ed1JG+SZO/AYJ8hvoARceYeOV1NF9lOkl\nvjMGynrlcpG9HJRxy8eAEL4zJZho7asmgxn6GATl5Ehy+wrMzAw46gZcLIcz\n0bU94PoPIrwQDSZwiZqxQlqLqcwLtFIDuOLpUaBTlB7lXsu2wvDo6Lbcy4Jh\nCl8aywYeITLq3zvI/0B9MT4y8xHveBhh0A02LycIoZWIvyr4CsQmRAgd8dzd\nE0gYWaDmT+PewV+G02rvMXWaCxuasJfhrnhCTI6nrgdGiyJVqlxvS/JfpvzT\ntwl0Ys+OhZ1hL0HnjfPLGONHcjh3GT33ChcHx/G+Pga45BVZQQTWlxfBtHx1\ns2s7GjcMVvg4tuSAt9ZeCceq2JOoK9XBf0K4YnyAq8J85uIzKANi5cAkWfYZ\n39Ec\r\n=vUi8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"75bc7af37a3f796cd8dbc1fc15e75550c7367bd8","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.2","@balena/jellyfish-logger":"^3.0.6","@balena/jellyfish-environment":"^4.1.35","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.2","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.258_1623003374102_0.5564581564590494","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.259-renovate-internal-patch-66982c4881d00fd9115311b8e8128672bda05479":{"name":"@balena/jellyfish-metrics","version":"1.0.259-renovate-internal-patch-66982c4881d00fd9115311b8e8128672bda05479","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.259-renovate-internal-patch-66982c4881d00fd9115311b8e8128672bda05479","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"74ec535dadf87e0d0d13c62b1b354a72047ce8d2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.259-renovate-internal-patch-66982c4881d00fd9115311b8e8128672bda05479.tgz","fileCount":15,"integrity":"sha512-OzxqcbawgR9ECbF4DSG8V9Kv/9IIEmkaj+mis+rdp63vJ+PHf+THxE1sDs353pMjkxVYRtGpXIwClFIGExE18A==","signatures":[{"sig":"MEUCIQC62E7oqVka4Prr7blnCxnsWoLZvMtUfwAH1dPdXOe3SwIgTPxulakF0ZQnUaGAJwsAXHMK5P2n406AM7D517p/4Xs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":116949,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvV69CRA9TVsSAnZWagAAikoP/2aWWP+CRbyfhECcwkYN\nRd4b1iNV2iuwT/PZ3hUZVz23NOj6R/9tAzzfzN5TGtVkQXBTI5NozMh2tw+D\n7k60Wnhe20Uvlzu6v8MCHmyZ7Sz6lgLI9OpLCuvH6LRcW0epTnagtqzuJWmK\nWoMFZNMDQEWO3M+/olfhOkRpTMPopNiUo45JllI+7vKR4DRjqlWCPk52X5vH\nJwCObpfjr8PQWCdJZy/rWQ8llRt7xmb1FuYcUEsn0j7lDoeVR1VgmXYQ+vzd\n1ah95zdUCHJniwfBhXTyyJ5hAMrDGdwDvdPa1rQxZyIc3PovRx1s7ejBCDu/\nYmiQ0HFkXsqFepmbfxVYk/31wJ7Uvj6cp7yEVo3NXttNkDz/OtZ4POeVUvP4\na4flTSsCnSTbClW75+1WGhUvxXs8nQXA7vLdmqGCC2LaT0uvPnyucSDIDkHb\nZ2mPSmUs8MHJep719BUGTcRnFtZdkwLAHs5V32UpTmJ0f0ypz9ccZ8DHWot2\neZyEwGBVgxOA4HXosrdnxzy9ngyJFxzXuGu7K2CaOL5t0XwEGveQMbuHh7BK\n+xzXVApF2VsMv9DduqwGJkU+5Lt3ulpfa6E6yvB0UPqkOjSs/eU17fPSVEZp\nJKaR/OTmxqQfnjeRbtE+PV90R9yrtUlSoOcB39xALQEkRMI1VbgkctfqhLfH\n2OYh\r\n=nRHO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"66982c4881d00fd9115311b8e8128672bda05479","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.2","@balena/jellyfish-logger":"^3.0.7","@balena/jellyfish-environment":"^4.1.35","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.2","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.259-renovate-internal-patch-66982c4881d00fd9115311b8e8128672bda05479_1623023293477_0.5189265948091146","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.259":{"name":"@balena/jellyfish-metrics","version":"1.0.259","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.259","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"eefad734cbe98c6aff869e7246ee7094566cbf67","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.259.tgz","fileCount":15,"integrity":"sha512-kGsTyKNp4N/G4Irxa3yGYZGF642rfFBVitbpYTMj/8x02t9mwJ5lVqET6UwTu+1RTTw9acFbpbduRxKqTm2vkQ==","signatures":[{"sig":"MEYCIQDpzKje1UyI/4grXOBoaAQWsTMxL4R5tNRBTU5A9F6ZYwIhAOKiYuydqE3W+30HcmP5eP6J/m4A9V6nVW+y9eBwd+UD","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":116884,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvV+cCRA9TVsSAnZWagAAc/cP/0qLuU1PZDeog3l2Jnzl\nyOCUXKCkXdCXw+ExiDoXIau8+3LHuay7kU+CL43gzTH2f8IDaZ0SAzhQFF1z\nDN7Cy6W/W2ldpMPsJxRtLNF+Dbfm8kah+oTV4+ZJ+YIHTqRjJwYmRJvcwuUG\npGVgKtTo9wcKHqAn0thrko4CK9tM4wpr7aQaAQllBOMGXSanp4bHynQOhIdb\nPDx0s1xwo/mmmTO3vSyYWDtzPvffLMBQFjO8WFxFVwuZ7dScD3dJ2wcNBMa8\nZAEYovXcA+oIHtde22/YKc60oZnUNC829nIFfZhVBU4Y4nznC/lqMLLI/8hV\ndHRUoO9fe/IWo7oyKg9279dA4oah5qNwDmiug6BnKquzgF3tTPnsd/v6IEVO\ndqXABSmLHWpf+pwo0EBh8VeG4O+Cldej8NZsu99u+NpdWdDH0j/E6vJTSZJQ\n9ZoSVOX/7xu7455/2gIrRldpIM1EpG2XcmxxQOCxtjIY72ug5RFFFmYHrEQf\n8SI6ArMeuban+UEulsAdjMFlstwH9akvs0zanQzFm8nzcnCU17xoKRIxEKhI\nTqWw1v2jKam2bT3lhizCCoyTetHTOy+kXP7EFc+rpfOwmyD8y1YfrYGdOOwK\nOn73S/v9gH+ZmldU2Wnls4liQZ6i2uUDtd9x6Klmp89WatattomBcue3SpZg\nRChF\r\n=f9+q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"17eeff910081c73024dea0b2a0c78963a44409d4","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.2","@balena/jellyfish-logger":"^3.0.7","@balena/jellyfish-environment":"^4.1.35","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.2","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.259_1623023516706_0.6734163064850369","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.260-renovate-internal-patch-47f715c72d313b2b36bdedefd79404e6b0a0fd6b":{"name":"@balena/jellyfish-metrics","version":"1.0.260-renovate-internal-patch-47f715c72d313b2b36bdedefd79404e6b0a0fd6b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.260-renovate-internal-patch-47f715c72d313b2b36bdedefd79404e6b0a0fd6b","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"783d47411437146a137c9844b078f2c7a2f8e14d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.260-renovate-internal-patch-47f715c72d313b2b36bdedefd79404e6b0a0fd6b.tgz","fileCount":15,"integrity":"sha512-2VxPuiwi+dXHsyhGBEe/Sl3VSrYzpRkWHMe8SCv1BaL86rEqM3DcMagwuwic4Fpi9HciHeUYzj4MYzSAWN7xgA==","signatures":[{"sig":"MEYCIQCeJQhXvG31g13NIjiZRqfr9BUCmZOnilpKqgjPOqUwWwIhAPgXTbi4VYPrREen1pHpkoHONoBK7Eannwps4/PwCv5P","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":117051,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvYe1CRA9TVsSAnZWagAAA9UP/j0uxLTRR1nZIr7e9J8n\nhR2GIa1pNxpNojtZMg3aAO+smrjxKEdRk64dalCb/RYQqbB2qJMb74Fo9k2M\nPTYaMfqSmqq0xWrrpuZDHVOEBmzkC7gge/7hoM5NQgwP0u2wBQuKMlVkqpIV\nWG9uZxdm6ytAePYl42A0MxkS7okmymrKg+JNLXOgfQ9qrBWW7hszPiJFt/Je\nYBb5v0lgGefVgJx/eD9jz6fRKlE3ksh0lTMGO6F+mDSboTQ5dFcktBEF8bSD\nGxHzx4ZnHae+WOAHM6pfT1Z4F/UFWQBJ0X55vLBEWTY0WC78EDYQRBAQboof\nkfF5qd90DTcSQnjRbSgbAg2sumVD/EQ58u4Dyk4QVBic2V1mhXIRRk+vy5SA\nAG6lLpnzMKWxddP/0Lddv+n7MTAo3Oz75GpGt80Gt2vqnCdBxtn3U4wAwFjY\n436ZE4J80Uh4gsVBn0wOtv0P8C3OsdRbwNO//G4eOTPvLA8u9apeQTC0Dhzm\nKKAbrAFfawYo+cSALH1l9asXxF7JmG3NVdhpIvfe4yaXTmoGG1zTLcyJV2CU\np4H7dnJy0DzC9uxH9LIafvL9vl0WeK1pE+aIvvrXobT16oWtLuXXxKYsBzLB\nyt2w6ghffkHHVe1iTxeeL/OwjlDL0AIb6LhsGRpusFHmAfbWJRb6j8rfuujz\nJKtV\r\n=yv/X\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"47f715c72d313b2b36bdedefd79404e6b0a0fd6b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.3","@balena/jellyfish-logger":"^3.0.7","@balena/jellyfish-environment":"^4.1.35","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.2","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.260-renovate-internal-patch-47f715c72d313b2b36bdedefd79404e6b0a0fd6b_1623033781208_0.7801501811196285","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.260":{"name":"@balena/jellyfish-metrics","version":"1.0.260","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.260","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"954a67aa8a5b455af46ae27dad90418429871537","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.260.tgz","fileCount":15,"integrity":"sha512-76uBjQbTtXeeBB0DLa8ycrptnKe0eiVcF1+AiDYjQVxXncjyKLL5h2YR38QvHNqI4EcdfJrRfb79O3FKztD60g==","signatures":[{"sig":"MEUCIAHYtVs/MZr+J/taSrccJo6B2xxmKUVcmKid8IhJUbYfAiEAsB7L5L5nzb5e7kDqfRp01J+9cpUYFctekD+41rIXA1E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":116986,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvYiNCRA9TVsSAnZWagAAgzwP/1XPnvoRoaOpbwJmxHhj\nhBShLBRTCdF9E4sXJQsjdZGTJiHKMjqp4jcOWkHqjs/bPQwliSjkhp2cZe0M\nGhZJNjjyFbsNAEBM28LKbQALa3JzCbnEJS/FGehh/zu2w7TuklEjEzKfkoeD\n1WOFOwLJgLfpDIT88KpD2vUR7YxMhgCwdmZN22nf323aIbX4cC1V/ECGNnj7\n/YepRue+X1bdvDFdD1G9co6aiujSvFaG+CeFeCW5IiJUfUNEkYE0bfdYyhoq\nO1FdMMpX+e40uR9JpXvunRt9y7rrMNHqvxqFtTGln+3ZAMPouBD8PPK6MDWF\nZNmsNdmn/XZMmJQ7xFA8jusVknR0WX7pVSrMqktCfmZBL3V06K8phkl0mr/J\ngvVWHrlUkOEAAQ/Jqla9DxE7cWZAc7vwTW/0W9xfqKo97Hoa+Kh0ZiSmOr5S\nAavOwJQqd1S/Aw740rK3MQSG0RRlRAyAU5Au6PLqCBKWnZ8nmAQ1kFLKHfjz\neYFObKCuW+v02bjsPquQzLjfm5bBlgk7ogrPW9U617O4y+5iF7q5DYl+3BuM\nQHIB2rgMJyOEvzGBMJTE+jE/CQnx19xhR/WDf9YxSfMXhHepIx370w6ySlnN\nsUXqfV1laEvZHfEEt4JkP2AV4U795EgJY+KYCEK6Ty9jfFyWyWBoqxrPp4mj\n0YnJ\r\n=gpgj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"37cd549931338a63d954e097097e228ad09e492c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.3","@balena/jellyfish-logger":"^3.0.7","@balena/jellyfish-environment":"^4.1.35","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.2","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.260_1623033996976_0.26518428494826773","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.261-renovate-balena-jellyfish-environment-4-x-3ddc0110f6d17cbb0d81cf7c29d684a935bde64f":{"name":"@balena/jellyfish-metrics","version":"1.0.261-renovate-balena-jellyfish-environment-4-x-3ddc0110f6d17cbb0d81cf7c29d684a935bde64f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.261-renovate-balena-jellyfish-environment-4-x-3ddc0110f6d17cbb0d81cf7c29d684a935bde64f","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"25b1eb5609a87aeb1f5a28128884e89c5dc6a0a2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.261-renovate-balena-jellyfish-environment-4-x-3ddc0110f6d17cbb0d81cf7c29d684a935bde64f.tgz","fileCount":15,"integrity":"sha512-W7wGUqVl+7Ka0l9GZR4gfc7gZzLQ+h28beiOFFHFAcsAkkH97zS44cyMtTtiRFx9VQMlRTUMcpv2Y0E6PBPPTQ==","signatures":[{"sig":"MEYCIQDHaxc7C3fgIQBlysSB/gfygHRwds+KBP6BTgt1/K2J8AIhAPJjpkGAypYwLoFJ6ii46I+lEnEvmJxEwnrEnKZNq9Hd","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":117176,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvtGZCRA9TVsSAnZWagAAr5sP+waflFceYoz9jn6zSuSO\nDwKNbbNubOi63daKUAF/36d+d6ztPAZmv4YNNyt9Pmnp8vnB7Efp2otM/kqu\njLOn0zM7MXgNctlYCdEA5NIUiK15qxBGo+WBpOY/R7PQ76/j4hbySsEVzaxG\nQNiVHdxQc6EoTc/uy65Kbttp9HMYuDH6FycXo6nh/FXbIsMg85jBZ6fS2Kjx\ng9D9gqb8w0/lU7Smy+VDHBKKHH9EJqPvqrJpcmzvuBoay2Cqni1gzCmAOJxh\ny/YqVMkvSMPS+652eTyPTNjH3xZezWx/lGAW1fmPExOCSD2j1FYbQrDTABSR\njfXlvQhoWzXm7v3UEtzwCENkpn5nuQX8wDFi6bo0ldNW2S/Tzo7i5mOffFox\nqPz1xhnmdRQBxsfmIkQK6M3UMHQr2VRMR4f0EunfHjE0cwrtLPuRZHYoz7Ul\nbek8RYbEyyRg7Bg5xg8KZpUzYcZG2bthp6pjd7Qbm4DJdixGtatmjOl3J0wm\nryLM3BaOM8aRzcBsShQuD5KOiKTjETeQntSGM5LL9mx5+0C4tCZXnWn9Li5U\nEiq3zvzdiP/SBpiHuHLa5EwE0ec/45kbH+sie2o8jz2kRYL0+sr4ScvZdsls\n0s59TlPBCkB01b7ApLcn9eN1ud4Ujm0jstX8roOqyYSp+5kaaww+HhsRloPx\nnDRx\r\n=k89m\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3ddc0110f6d17cbb0d81cf7c29d684a935bde64f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.3","@balena/jellyfish-logger":"^3.0.7","@balena/jellyfish-environment":"^4.2.0","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.2","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.261-renovate-balena-jellyfish-environment-4-x-3ddc0110f6d17cbb0d81cf7c29d684a935bde64f_1623118232887_0.2567828489253323","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.261":{"name":"@balena/jellyfish-metrics","version":"1.0.261","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.261","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"99db84acace41aeed5b8aa05da2f6c4849f56437","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.261.tgz","fileCount":15,"integrity":"sha512-as/UTVqtNN/RrR+A1JvRxKcd2B+3VOi/jLd/6kK0kc7UF+XTNgt8fuMlkfQspX+iL/FVKLR5lmk2EZm4J6U/tA==","signatures":[{"sig":"MEUCIQCTuxC3zZri67v+qaUh0lilaap5Pbf+giGKfrfNF0iQjQIgcKFRaQNkp0CgQucAqJdBboMxcrdOizT7FgwlAxsVuvw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":117093,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvtJmCRA9TVsSAnZWagAA7NkQAIM+X0o3h9+YbfuDP+tO\n6+sKUoq3nppa3IcJTBULCKC1t/GHvajiYMfBRPL0hI/XatiSdW1ZNHirSxX7\njxTowTqm/G5n8N0NSEKZEhEYPVGz46d9rjibV9qicTzlsNU+X+zCMJkpgJqL\nTDslgxN9w52i0DvnL7J3/7K4sA6OQvWm5tLnje9l3k4BfcsFUpWYA81AJnxh\n6/Ccw4IVIPFbwlPuM//4mgXpYvmC5jkbgB7d4DaVTnnyMegzvhQ00lMranCi\nP0yMnEkUkTi5eKHlSNvO38+gwG/TnkGkbASbb0d+sDIf6xDTqjUXUoLaXuwS\nmdbvLWgSIUnRVIJoy7qkTT7L9cLNt1tVNHTM3jfIO+BLz0upGnvxvIg0i9AB\n/BgKdyqmQVZ7/AGJR/b63xH9hL03HECQwgh3lBmO15ZX4kZlrQQqJgV+Inie\nrIA2b1CQ0HziPsndQ2RIF8HZ13pwnHHSldibaC6b295VkiCocdVtkIxdO8Gc\nOJashHAZCF9TzqOD0mEtetmf1/Zbcks2wuiU7wOzZpEojGQDFA2wxFCBNN7G\ncBa86WfRtsTqCMhGNZf7vpPatxWFfIcuyY9sRyjmp3cTU8AHJC2yiu7J2M9X\nVoTlEyu/IqvN2YAULxebayPHNgHCNNHTfnCdP8nqIYu+WqkRE5LKGW2nxBZb\nbEHL\r\n=/GMf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"37f76d847d08f68697a5a6a5b33915b15658394c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.3","@balena/jellyfish-logger":"^3.0.7","@balena/jellyfish-environment":"^4.2.0","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.2","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.261_1623118438173_0.2687469583037225","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.262-repo-sync-jellyfish-config-default-a76463696a97c935f034f59f05a4ecd02e0cdff9":{"name":"@balena/jellyfish-metrics","version":"1.0.262-repo-sync-jellyfish-config-default-a76463696a97c935f034f59f05a4ecd02e0cdff9","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.262-repo-sync-jellyfish-config-default-a76463696a97c935f034f59f05a4ecd02e0cdff9","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0dc2104641984747341fc7be542f726a445a9640","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.262-repo-sync-jellyfish-config-default-a76463696a97c935f034f59f05a4ecd02e0cdff9.tgz","fileCount":15,"integrity":"sha512-Kwx3PMRkQA/0IQRbt94JVOta2hTxsiaFyyAq3+KFYT09JiaZReHdSeW1nyqVrtBACisTSf4+lWsV2ZLNVHgzFg==","signatures":[{"sig":"MEYCIQC0RL/XkhpV+21kZXIHr52Ni3IYLaFThYLcdnDMdr+yDQIhAIc//21bxbVPPQcPBgwuUe3+sJMgkmZ3ALpaRk2uulY/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":117266,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvu2gCRA9TVsSAnZWagAAyykP/16kfonWa57IpRRu0zEg\nS4r/QIYrOjPNBhoHJu7BcAeRzHnhS0GSoMn7vXCx1J5rUUpzp+hOizHW8z/z\nNcbvwTFJfmu/bUg30BlyGew0/tQAc9+Sa1selAo02rBPa2XRWIKUco/Xqn6g\nVwXILtu/w7GWMBGcpE48Rjhdb7hRmW+a2C3we3//0qDyTJ/8R3ByeaZD2lAH\ngRr1aa4D11iHQX+H1Y9m8mpFq/rZg0DioZBBt+1xJo+ATrq/DyENGX+fIhMF\ntGmKdlKI2BZ5pGVcYT4JiDaOBDQLJJ+KlR0zFt+dZjjhZHDPZqhqInIUzvfa\nx+leK1yBGRT4MfvutDTwPUt+GoLLr0yhixNvQZjxi3NaAfGe2epeDmb++kiC\nv/bG3meaISds1vhoChcT8XfBszu+uU8VgklxeChBsT34FFE/P79hxdf+0F1p\nadVuW7POTS/9HnRkKIUD2Ln5dUkdFsNh7iFt7KE9ADyVVNLIGBORDxDMfsce\nDidnELpyXQ/NwUc3Ax0d1oUKaJWyLINDjIt5gLvZkrbPsWSVk3sUeALP/eZM\nU/4TKR+3mPAO2rnTnd8nMGK00Fyg/0EUP/ySSAEpPEw5DFjWjC9c1oURbm/0\nga8H+tPkCuNhNpThilzkPK5U+XkHUIymMxVaVgoCoiRB5CJ1cvN8qxED4IMH\nCZh5\r\n=2SQ4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a76463696a97c935f034f59f05a4ecd02e0cdff9","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.3","@balena/jellyfish-logger":"^3.0.7","@balena/jellyfish-environment":"^4.2.0","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.2","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.7"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.262-repo-sync-jellyfish-config-default-a76463696a97c935f034f59f05a4ecd02e0cdff9_1623125407987_0.11707176423173848","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.262-renovate-internal-patch-34e6848df5f4098c702a43bed1c1caf6dd5570c5":{"name":"@balena/jellyfish-metrics","version":"1.0.262-renovate-internal-patch-34e6848df5f4098c702a43bed1c1caf6dd5570c5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.262-renovate-internal-patch-34e6848df5f4098c702a43bed1c1caf6dd5570c5","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e3e39e4ea389290efb7c5419d4d9dc25ab1ff72b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.262-renovate-internal-patch-34e6848df5f4098c702a43bed1c1caf6dd5570c5.tgz","fileCount":15,"integrity":"sha512-yw0eRGO3xXrxJTp67dsgC9+IrLIyBzbASjUB5A6miXvujzbMyQtuV8Xic90q4ZtGl4WnmuVRVUIN7Uy8HinKHQ==","signatures":[{"sig":"MEUCIQDmFfq/zpJpdrJcWiMeIYJ+KDQ3B3i4PeLdaIZoXDr+BAIgeX48MZ2dJkA9agIlK3vJWIGBv1GxSY6/HaAYPBQwwG8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":117230,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvu7GCRA9TVsSAnZWagAAaFkP/RU66/BswZyuKX3zL8KM\nkfdOIwz0uMgPv+KZp6YxDn48tMWFwRyeNoPMGArkl6GuCdmwzcrF9JPckVDo\nkGL/4QxGzre/+UZ3sBWuZ+OVlL97KcgpYYh6Fvm6w9ZiPRsDQrrdrwGymyJw\nIQU0OdIWfGzyXX9Dnd/oQKASXZqKnWKNA/oAMRVYLUjQXa8aqNJmuSprrlQi\nYpkdiVfVN0/9pz8NLYlfd9xKqxfKUY/akCwwZ9JpWVU82ukoCQm6Y4jAzGHG\nqakZWcfrjTMEXCWwWtbfDMtU+vZl01es0pbs1zE+C+ib/0XJQxwUvtimkMAW\n/JXUl38IndNF8EBxVjNrUuU1qpntctNQ7saH5y0GckZEIZA4yJ2i3Ha21/bA\nMizV7uq/a1sxsDaRYoF+PD4UDeBfuOLCrzqC7K/aioKlraXeGrVGT11Z26yB\nvBj//cToklqk4/efYXm39+U0r9xxx2q0i2vXqoj7f+u0fxPZdqX15BSzVcTN\nj63/k4q0Y76hgqK/3nX4cgk5yom0ktDwQmN9PD0cbDnbAlw2EBIrAe4PQWRJ\niFUi+h8jOlL6NiVWhv3sxgYc0/+jeTtg7aDlHhTo155NiluXMGRNNOCbCqm6\ndrguSA1jfBuHqcH4skoELDlyaUOuRY/QrhyqcaJem/WJgbc3olTz6KR5vQWm\n6Gbm\r\n=kLr3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"34e6848df5f4098c702a43bed1c1caf6dd5570c5","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.5","@balena/jellyfish-logger":"^3.0.8","@balena/jellyfish-environment":"^4.2.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.2","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.8"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.262-renovate-internal-patch-34e6848df5f4098c702a43bed1c1caf6dd5570c5_1623125701984_0.9919626904476979","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.262":{"name":"@balena/jellyfish-metrics","version":"1.0.262","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.262","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6923c5d9a6336fbd04ea16f1a49bf52be0ebaf31","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.262.tgz","fileCount":15,"integrity":"sha512-WryEyVkcxmcLu0CiT6CeMcaFY6dejIfXWbszdF2UpqTuFt7rZiJmjnPRHA6KCC9FKwpHuqiybrroH1mFoTNbRA==","signatures":[{"sig":"MEQCIFAqEVIFxg60zOATvSIYjFwWhd6JqIO2ViG2ReXdD1baAiAUAJErhl7OKMAKZ5H+/7pD5/q2NHoFC++HX6lPvCJJYw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":117165,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvvC7CRA9TVsSAnZWagAACKMQAICOibsw6norwCM2I4fc\nmml7ByanNt44SbdrNdLqR364DoCl3gYjMN32E3/EJt3uvQyVw3lj4Tdugz60\nBnq/Tr4C31+dJy8RpP/LCRtTcP1gntqRoxSUVLqzhPhOzeB1V4kzCkB40XZB\n9WsPnSsaDYJor1BdXVLpOznb2WFRYcYTWmeIfXcnovR5WFagRai8inkJW5QU\nWgAofk1WjIDUcuZ2z8iijmdfV09MKVGLaMSB7PetrCzmplT/KnoHNnFaO09v\nhCXG2nWIxTgkxGBB1MF1ZZWt10uCF5R4xfs2wjjlOqcSf/7awS5NFU2TXD8s\nYdbXRVf0OmbTbkbvrLPom11Az8VQx9dRBz6tRj09nX4SCf3ZLcc2OD7jddME\nwU73TKonvYLZ5CqEx0x5NZrls1+1yg71N53go+zpBdQELnU0Im6FnGSDtE14\nvYuL9YCD/OqlLSkvg0uEtNOM8/lmqHh01Gjoqp4LC7oJ4rxmWvnwlL17H3J6\nAb3Rw3HkJdAHCnfuMW8eyhWpSBaW3K+b4zEMKK5bpQ0VeE5E43K03CW0C12o\nG9C2Pm0p/ek9huC4emZ/F44vmX61qslchs23JuafOvXV+51rQ5m6C7cqX1uW\nJZRkg/UI9RZtM415RzgH4QIzqneFFFXQaYIsLpkLr8zu7mG1jDewzMh2OhLV\noaGH\r\n=7EFA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ba2f6f27451d6bca47e2e7a9d33ef6d6fcfea8df","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.5","@balena/jellyfish-logger":"^3.0.8","@balena/jellyfish-environment":"^4.2.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.2","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.2.8"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.262_1623126203516_0.32636635950833015","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.262-renovate-balena-jellyfish-config-1-x-8b2393abfef1a36de9e6c9482592309caf98222b":{"name":"@balena/jellyfish-metrics","version":"1.0.262-renovate-balena-jellyfish-config-1-x-8b2393abfef1a36de9e6c9482592309caf98222b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.262-renovate-balena-jellyfish-config-1-x-8b2393abfef1a36de9e6c9482592309caf98222b","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8e07a6a7ee393d85d2f05d9a24a97b96658768ed","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.262-renovate-balena-jellyfish-config-1-x-8b2393abfef1a36de9e6c9482592309caf98222b.tgz","fileCount":15,"integrity":"sha512-QpadEv4MSyCWvX0zWBXuc1wKn1/c8YnXUhuQwPQ5Dn9+6nyjohqTKa9SQnPPEu6hUFny5Gs9HildbiyUxW00dg==","signatures":[{"sig":"MEYCIQDwaBBjDHOyY5aVisSv1a6bGI/4Q8vVGtJM27jSnT+uwwIhAIZ+wck+x4riY9iDg+kxwbzJ+6vblyPoleoMJaJbXmd3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":117274,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvvEUCRA9TVsSAnZWagAApiAP/3CGDlrHK0kBqU7FE+N8\nW6g/YaJR5rQDXVFqeLG8SpfcUs0pn6eSYTONX8cKS1edp0UmX8P/6ril9Fi7\nawD4lgStVe/D5DrZHgUuiFcC7ljN9jx3aOUNrJGIXCPPTndZP1w7acXRW/zT\nI91gOQJREIw1NkrByp/C1iTj/qGtS3p/jQa0VpXHsncBOdNkE3/nYMBx++X4\nWrKjN6k7Ql8whlwAs9v26ZmobOd1cyH+kQ0x8sMWCntngcFpn74sI7Ekdwzv\nqhPmS43lvEzWpMc4M46hfJFRYTa35RyCH5yVfqAY3bhcXJzqREteK7ZWJGQv\nlWK9M70rXsjt/o+BvAtGEm7881PuFfdOVknFPTCUqpSD90hClzhYZgRExlfO\nC50kTOoq7uLKwwifVx9QqMqBAnM8e52zXev/wXsGRDym54H/94gX5cQhfiKY\nFPafj2G9hDhILtEezexK2TQdD7hZoue9D5zF+hwVxnVJf52oa6HCP1NBcnSt\nPzWhp6J9/mVdG1R+pHoGa1sUYjfaR3XMqyECLroEcb2Oy4VBqeicyzBwwzX2\nsHzic8PETgGl+Ag9jJ+onHQ0ATx5jINc79GMbHQ2rroaTGE/MDrWp6OrxjGY\nfMxFWtHC87+KyHU2k+n+bdTuirY47+htnBRY9XTNU1olxA+qzcASYkQyA6PM\ncVbZ\r\n=0fWq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8b2393abfef1a36de9e6c9482592309caf98222b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.3","@balena/jellyfish-logger":"^3.0.7","@balena/jellyfish-environment":"^4.2.0","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.2","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.262-renovate-balena-jellyfish-config-1-x-8b2393abfef1a36de9e6c9482592309caf98222b_1623126292639_0.9546684381404185","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.262-renovate-internal-patch-918fbaf857fea70af1f15fced9025a347c966f50":{"name":"@balena/jellyfish-metrics","version":"1.0.262-renovate-internal-patch-918fbaf857fea70af1f15fced9025a347c966f50","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.262-renovate-internal-patch-918fbaf857fea70af1f15fced9025a347c966f50","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d0e9f6d2a57c704bbbbd3793caf4d01858b4f1c6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.262-renovate-internal-patch-918fbaf857fea70af1f15fced9025a347c966f50.tgz","fileCount":15,"integrity":"sha512-3aLuP1IQdyHgMbGYevZMo7I/Aj3FMRv8XfRtwYaZ5LwspKb8sEQiUbck6CePzYLX/LauNAIXCoM+2fTLTOJQEg==","signatures":[{"sig":"MEUCIB1UPpqX3HApWikKg2aW7YxerXMvq4pcoKT0FUHBxyp3AiEAvEfnsrWYvYuTNkubEWYcOrtXG0pPyN5eyJkqw5gZKU8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":117307,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvvFRCRA9TVsSAnZWagAAQT8P/256sVKD3vmeZ6ggp1CI\nWAhjf1R3LawBrUdFVd+NRtqY1OfDNPlqGGnYTPLM0Pe8aeUYHTAd6o/otNa5\nn5cnICXBUbSbGUI30ZrnqIJxIZp1rNiGgs7+PTdS3iV7XIvydbebzqFruiWC\n9Pbdrdf1x4+gKOVKNyJXQg3feOKTW8rlJy/wxHeYtjxuepUgR8P8q9yvEuSK\nDzUkh3RxxiqHhoNOzMWBTSBAfOEyME1jWSz/Els4GDtGfAx9IhDZwdHHGtYw\nywhIV7zvVdnmcXS18ctb7SBRbHkvj0zQaTwPGr83rmkb439Em/bPgn4xwQ/p\na6TZlNfG73BgKhiQz4Xtnbe7mAk+fUX6vW96Ysri7CgwelAmdlBE/IKsfvA3\nY9VNaaVlivleg3J/CcjZM81spd/MX1Mxlwyjz+6kFXBhYNQBUu8waG+s8noE\nln2uizGXoGJmganYQAYWCP5ksWJKt0bJ2dmgQeUNRDGlD24vnNGogx8N4wtf\n2MhlIrVeP3LOkreB8JRrpsL2IBgHB0NdUs8wKxPqsoZgzaVYOku6UseGnDMI\nRStILopEJO2m53iNfxycZQDqX1wiohY2NOPYMMj1gWoHSVCnL79qh2UQCJMa\n4np9XNXgiRVE49XS3HSDMOZ5I0QJgwCrSCIxgT8KY38k1fi6JxSOp15Uwdpr\nVLKW\r\n=oHGV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"918fbaf857fea70af1f15fced9025a347c966f50","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.5","@balena/jellyfish-logger":"^3.0.8","@balena/jellyfish-environment":"^4.2.1","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.2","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.262-renovate-internal-patch-918fbaf857fea70af1f15fced9025a347c966f50_1623126353263_0.2876783788237596","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.263-renovate-internal-patch-e75e43c7f7ae3ac6a3e644048d99ec75dcd54c45":{"name":"@balena/jellyfish-metrics","version":"1.0.263-renovate-internal-patch-e75e43c7f7ae3ac6a3e644048d99ec75dcd54c45","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.263-renovate-internal-patch-e75e43c7f7ae3ac6a3e644048d99ec75dcd54c45","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"041d27a5cbdc5e6698daec943255fdc2cbb736f9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.263-renovate-internal-patch-e75e43c7f7ae3ac6a3e644048d99ec75dcd54c45.tgz","fileCount":15,"integrity":"sha512-+2U7DUnrS+loBbi6ix7UgAZXGD2uK5V8Z4Anxx1piK+Bi6u/Xi8lWSVpCIFVfoUvESmSxoZxmX0RxiUzutIWkQ==","signatures":[{"sig":"MEQCID/mYnL7Cje0x4zXCIC23vTrL/k5WIUcp9AlUHnNw2diAiBENKX+6l2gM5mNwhrV0xGZA616bck8wUa2P1OpB36THg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":117303,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvx8OCRA9TVsSAnZWagAAXvcP/3aJFbh2hwl7ERK/ncWn\n7LIF0AJiLApTsPm9nZXTJzUGcrh7XV/BjhXAQtyHSKrr2KiIa4HoXKserKSs\n9IERF6GluLrqYqo6sSn8mnot8BQwlhhHrHDUAUvLpzpkE0qoLIpXy0vq+xXE\nAmNHQsqFplSe54EHb0nP78VGSSYLw9dWY1TQzK/uV6uUTByuwm/kX2gBnadj\nnKh+6MSNf1Rb3EfFRHkLSpHhtsqQ6ZLQgGGH8pkUiWK/7Y/4wMWZXckJlPWG\n0VTs0TCxmQOeLPcujxxDi3am6onGPdfDOUixK1aDSJCuATgBD2IVfy03p/0x\nbJDRdbGoezOlM9yERmgSPOz41JTcxsfOCQ/i0WqxX92MkkhtFhVdiX191O3P\noQ1PVI0BtJN3RWFknUPUs8Yt/Q3i8CsuO3WgAb9NLuzbMH6kcHkHbVTiCK1M\nnHKasn+GwsJw12I8en8dn1vp1xJNZ/MWP5jwT6mN5vUzhdu6Q6/C1PkcG7zT\nVLiIy8/sxeNWqoOvKNOfAPMCmFv2u+umfWJbDOrpqIKsXPG0cbmsiwtvz6/M\nQmzG3Vhlap8EuXE4+R2giOwEjmGcvk39QoQ37oTkNqWSuQkJh1T3EtefzqvR\nmLMOCUwnLpztXDfnYrlYp2LbvH73Ln43UJORsjGIOYUbi4bNwI35uFYJbaJB\nz8MX\r\n=mjBf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e75e43c7f7ae3ac6a3e644048d99ec75dcd54c45","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.6","@balena/jellyfish-logger":"^3.0.11","@balena/jellyfish-environment":"^4.2.2","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.2","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.263-renovate-internal-patch-e75e43c7f7ae3ac6a3e644048d99ec75dcd54c45_1623138062089_0.9233981833719662","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.263":{"name":"@balena/jellyfish-metrics","version":"1.0.263","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.263","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"69766c047ddf78572e93bf7ad7125148a0ea576b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.263.tgz","fileCount":15,"integrity":"sha512-uR6vlw8MeJRKq0rG0kyWuhwyBKdRv8t3cD7SkXtzwQf7VS2dLX8Hr6KGcDvdxIfwU3UBKPrtJBuGxds1lz9yXw==","signatures":[{"sig":"MEQCIDtSLi+RBhj0f/S5yeSiBplQRF5MVZPgCkHmQB0qSl+BAiAy58L83tioJRCjTIgwI9mvrW0GuXZIzg7ytIpYk6s49A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":117238,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvx/mCRA9TVsSAnZWagAAeDkQAIxwr0fjn2xi6Z1r7fCS\np+tOkOQiJWXXKZWogIrRDQBycLOV0c8hsfRDfNeh3sU+aOc4xEZB4YHGat7a\nVJMF1cknlfbdREY1/dznq3tAviPMncQvmn8ApemfsjfYNC+jnhFQVLkUY3aL\nr7sjku/vOhfLDkMRFF12d+SFbNpna8GPaG+VcfN2AdS8G0xcHVcnXDv4HhgY\n0tD1XtUqrh4qSrWmirYlpYsSJRWtBiToXSI2Rbc4aGf1K2dxYaylce5sdgM+\ndi0siHXdDr6hbF9UgQtgipq3CA2c1w8LHl3b9g7Cy/kk8GrJPJeZLVZpfNqU\nrpSOq/imhlFyxYrQYLI2/Q87CN0nyaqVQF11cbFQ2OK0f9tTcBH8ITCQr65K\noCU/bKEfd7g52LXuoDq7IXlo+aq08yM2B7xjJlNjQc8ZLdoPlXbeawf89ocS\nG9tvsRmuMnszKw5o7QwBwVtCYRrSLRp0LtxhCDxA9UJsIm/6o7tmOMjzlW66\neqyt/vIlmVZn1nrqtLIHSQKI/7BoI1lLJHDdCnH8Ya3Z09OxvQ14UaZA+GIQ\nh0NZSiYxYHL8Imitrl9F1clGJm6q500822Vzx6vO+d7odgRR0YNr2z6U/kCn\nL1xXVpre/2+eiWaqKPkXYh/fZfeCepbRwqxW1A6asmREQ16m0U4Q/q5Os6hp\nHgRe\r\n=1hq1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"48b64940be0d08a1ad9b8746a8711c32508b73f6","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.6","@balena/jellyfish-logger":"^3.0.11","@balena/jellyfish-environment":"^4.2.2","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.2","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.263_1623138278029_0.12777959271295813","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.264-renovate-balena-jellyfish-config-1-x-1f4e9b674d3a98a468a490f72fe244e1ede26782":{"name":"@balena/jellyfish-metrics","version":"1.0.264-renovate-balena-jellyfish-config-1-x-1f4e9b674d3a98a468a490f72fe244e1ede26782","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.264-renovate-balena-jellyfish-config-1-x-1f4e9b674d3a98a468a490f72fe244e1ede26782","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"005ad1c55b50c3fb7d83b47f7344c692ac4746d1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.264-renovate-balena-jellyfish-config-1-x-1f4e9b674d3a98a468a490f72fe244e1ede26782.tgz","fileCount":15,"integrity":"sha512-kU2qwxJk7t7OnSteKkggGxZ5Rd6yXKMhdUpVmY2hsgSHBmkO8MJZf7lWL3mLWx/Q/LPlsBgqTS/zmFT2GbGuZA==","signatures":[{"sig":"MEUCIG4i2z5YHqEm5y4jUQqnqsf5E9qGC85xCEQBFhUZlha9AiEAjDhHSUczN4pP8ki2aSrUzDIy3a5/o2kRQRirPGiXolM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":117419,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgwC4qCRA9TVsSAnZWagAAyRkP+wRJzOrSTrP92cwxr1Q3\nvRPaoohMMxy9JIiyyFlWumzDPvp/qcoQ23Pc4GPEdFx/zdHuG1FSRT/tgDey\nibIBHc6UIkqizNksDbnSXNjvuXgxsk38fTkc8ABdmE1zpGBwzdvV5fKHpliA\n0vECd09dwnBwFNcMOhePenCZyF4LMRFt/kH1MBkr29qGYekJak7wdU6EBKJR\nBQEPyq2GlmMKWn4KWqUZhNYG/2fmAbhtbh3hZx5BB1KBqcl7Q+Cz27udocq1\niMJt2C/vBPCRxF1lMZ7e9kicW4FgCUjlIaaJgKJOrIkpKza2/PS2ydgOA314\nfTkuHSu4I8AxV7SRb9vyClxziFzkU/T9u97iK7jKKFrCkEntXVWGbwav7elN\n3gtXWShoPFn9NBTesdXF6RVWkfjKPXDzNRjg6RpeIqEeFqWXAATnWm4TsRnw\nTlvrj6gT0ipVpXzomUPdazZRvm1IqiFHgqb/s0UWb0A/wUMsFuPtdoGKRAfu\nhyaLvDamxTqa/gVRPQCb+X5SkAUC5iUsUiVX4MaDSujEk9rfJXPAAhyESzGJ\nEvl7JfGe6cOOpFjd91xWGPyqn8wf41YHGLct1DCb7ub9Ymjesc1B3TSL2iFa\nF2swAWFbeDoth+OLObryKBo1aneME/MYO6SfIou5BHfUNzoAEy0RVL4ZIQqw\nXSml\r\n=ldki\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"1f4e9b674d3a98a468a490f72fe244e1ede26782","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.6","@balena/jellyfish-logger":"^3.0.11","@balena/jellyfish-environment":"^4.2.2","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.2","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.264-renovate-balena-jellyfish-config-1-x-1f4e9b674d3a98a468a490f72fe244e1ede26782_1623207466452_0.42938434247860857","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.264":{"name":"@balena/jellyfish-metrics","version":"1.0.264","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.264","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"94763d75a19c61e786f79d09b300845b60b0ddeb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.264.tgz","fileCount":15,"integrity":"sha512-psX9lY/4jkogobD0Hcvgtki+9enS4vwIgIuWoS1ZIZsWUuWsJFfsvNUMuYC0U1PB3sRqPjdRqgfiPT26MRECfg==","signatures":[{"sig":"MEYCIQC/zA6miUa0x1mVdQb1XsPCi7k+NP3y3q7WDEN3FOJF5gIhAJ9ZxVo1YufVpBwdwjJDiFnZSOUYaXUSNp58sTpg2jLk","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":117341,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgwC7rCRA9TVsSAnZWagAAbOoP/3jsXC8O8Q+Vy/7sLWTK\n+1iRcbqcZs9hFxUkKB6abJSpdf8uRaNoPBFR0BsznjSyzr5keM7BmUQ5LraC\nUnR22cQ0iTyY6HrRjp00IH8p7BUv0sbbeClFBsKmfbfyqq3km6byhZL/yGDW\ns7/WSw0X3YZ05vANyCNXt9hyE8P3gEGClmXv6M25MiBgskza3rSLGsp9dVcc\nW5HAXIEFZUsnOgUj3wM25qO/boT7mRI/XNvg+iT4hj9srgzFvGeWG8PAIm3T\nl6lBHbbXvZFiJf69f+CmJZtvjUAifUrVu8Ua9OwFU2rMiihGZ/g+XH67GL8q\nadN0hWPP1WscHYeMFCxrvAS96DGLJyETnCKHVr7s7wIL+7iPAzuGzsdw5Yz8\nUK4dPZtlrHJKHzMUFub37wa2e0NUHhefhST4ySMvaMicCeaSGkZPxSiRCTew\nQGM2QSgdfAsdTWLaBYWZUdx1JrzJ6GGRHrndH+5lFUIcLKnht9VxrypOxczn\na0wJjLOTGRYaMdx6RFnNkH9zFy6dKCuRfH52Lrp3aqKQbo4e9QExAdETUluA\nMPA9HyOPXD861d/KC1M0rpaKQzv72OiDF6yBdm5H1vpvBKyZZhX5Ze/4K5f/\nqqOqH3Mv2Gg2NAtDUoi4WIOoZ9yTUzObtHvciY1EyXXFnHIodH7MmxTBq5HT\n0fnD\r\n=BDc3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d192e8da1208ccf7c7764944dd3dfa3fcaf22abc","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.6","@balena/jellyfish-logger":"^3.0.11","@balena/jellyfish-environment":"^4.2.2","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.2","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.264_1623207659347_0.38872567282584725","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.265-repo-sync-jellyfish-config-default-e5f16d3d93ee6c55127a1c5ee5405d7c5426e6d1":{"name":"@balena/jellyfish-metrics","version":"1.0.265-repo-sync-jellyfish-config-default-e5f16d3d93ee6c55127a1c5ee5405d7c5426e6d1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.265-repo-sync-jellyfish-config-default-e5f16d3d93ee6c55127a1c5ee5405d7c5426e6d1","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"42f94bb32a6513817baad483c0468c5909db8314","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.265-repo-sync-jellyfish-config-default-e5f16d3d93ee6c55127a1c5ee5405d7c5426e6d1.tgz","fileCount":15,"integrity":"sha512-NDsHXsNRWXIUy9gwHJsJ85MOuq/gBEeDJFOiWSukTE25ag9TjSaY3W1mZK1z2T86Sm41mbB6CKwRj6QdoxCIMw==","signatures":[{"sig":"MEYCIQCkpLF5GTyZpbJPE97IpjfNGt0APfrg1aEv6F+SyoAedAIhAJbBN4moKBWAoz+ZRmjznI+OOCvDmDOqaWB0iJU5kYXs","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":117514,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgwu31CRA9TVsSAnZWagAANYoP/A/Xi1E/bGUuQ3msLaI+\n0NU60P0VqVnbyI74W0D6/xkbVmR6wou0QfIL9PhjVgFXW+KGYTgQVNyMV31L\nxNBQzQmCStetOhf9aAlKyHREyLbxkHK3BL28Ik4Jm0Y7vKJ38gG5UkdJxOu2\nKN8TDDAcBeeOoqdA9bHraAO+dcBOjNz1SuIKIgjnHhTDvSbVbRWycKvXa7aI\nYniG0piqj63IVKkjpXxhqb9DP6CYnObjbuyeI5lUMAssb+w10U2+W4ma5EdC\nR+ZkPjn0p9DasqfJfDD01ITA0cPiKYRY8At6xM4iZcPAMJ9Gh6VcIM4DRrcY\nw0nAmxWWBCPnfc8DICjGMXB1Ge1zZnp4DEgJziwhy7iXmweCaEIWfnvgtN42\nyvbDR5k8cijwoUTuFwnUp3AKi9TUNzXzbZSgqnEeV3VugJ/EPTZnfgo/L9cm\nSDiEuLR1vkTYXdvEj9aNcNe0me9e0Vm6kCdKK2YIowr4x7bFwODZ8J83zM08\nLSubXDYZ+9hzwDC2p7xM838AFaFCiOa9+fX3OWt9PvKOLNV8k3KrekNFMQxK\n6Mlryp5LBWZfPS2JvY2K58QLPyY0mrfsz2O69gQN9q9v8pF8z+VNgctNCW13\nel4vgIVKWakrT5GpUfBOxe8tBBtTYu2OasQY3P3JUDMdqffZbk5RW/dqsVCH\nCWF+\r\n=7Lk/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e5f16d3d93ee6c55127a1c5ee5405d7c5426e6d1","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.6","@balena/jellyfish-logger":"^3.0.11","@balena/jellyfish-environment":"^4.2.2","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.2","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.265-repo-sync-jellyfish-config-default-e5f16d3d93ee6c55127a1c5ee5405d7c5426e6d1_1623387637636_0.6310427609344016","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.265-renovate-internal-patch-d48945a0599589fcd38a65417a0ef361957264c6":{"name":"@balena/jellyfish-metrics","version":"1.0.265-renovate-internal-patch-d48945a0599589fcd38a65417a0ef361957264c6","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.265-renovate-internal-patch-d48945a0599589fcd38a65417a0ef361957264c6","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"dfa330a5ced4f4566136a5dd02d78a2db6e199e2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.265-renovate-internal-patch-d48945a0599589fcd38a65417a0ef361957264c6.tgz","fileCount":15,"integrity":"sha512-fNHIMRu7Urx/pgWb/l8tuDPZc984IhpVqvhJsH6zYFkLx+oBAd20PzuDvgVZSLXVDoZr+ZqAT4go8v1h4Uf4SA==","signatures":[{"sig":"MEYCIQDobHHYMgYSlhUK05eTAHna8g8pOXYIC2abIot7seub1QIhAJWLMbYYgwfCZuRMebqAOSuEAsJRzn8yQKIRC+BQzjnJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":117509,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgwvDICRA9TVsSAnZWagAASA4P/i69GP/tc3NwQTPyn37p\nD5i3283vy+a7E35YvMkguR6j8QHRJ01VrULunEZ+2TBpOHrYpFmYyqauIsO7\n7GxkSw5zYS56Vjzx9Y+pbPmSbvR9QRysfv0AbZk7iNzyGHLoyEf5P3ubAm/T\n6QgN6Kkh1Gkfiw/oEIr3hSM65uRLKTCPpCb7JaZLJpIlaK8FcmGUZLFVMRC7\nj0rC7LlgYai9C4D3hSfQH5VeCbxq42GNdhIxGPhcVDjOi8iM35h52Bg5vQaR\nOk7Xe6XZJ1zzXgmMGdfIO6RS+kShDyizFODnDPMcr09SRADzkF7JBEXgAia+\nOZQaqAJUx980OPNAYS4asNi5pGQPW5Btiycvqmhn3GU1DfVFtwy3zkalvhb2\nx9FyAzJsxzU+ZVXsNiogtWXCfIvggkkVaoROFe3EQFtjLaZnbVchoIEHfl7u\nls29L5MtY/5RDb98P9uC2YsnZDWb4C609JH8RxNGrtvJxnQ62x4D+6/qGHWE\nmMoBhSZF8Tbl0FDSeaaEN39DM/Cktl2nMBe7J+VKG+OBB4g/rGNDKt4oal05\ntE2tfl0C5SpAZBbJ6OM6zYENbCG2ryV9139hMKus1QBNB6ntqebebKV7D+/P\n6yUSnv8Cz9Nq0inu2rDzLc58VtVH/EVISTaOkKIQWZ5Zki7mfiIQ/OkYORfS\nk3PS\r\n=lJOr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d48945a0599589fcd38a65417a0ef361957264c6","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.6","@balena/jellyfish-logger":"^3.0.11","@balena/jellyfish-environment":"^4.2.2","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.2","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.265-renovate-internal-patch-d48945a0599589fcd38a65417a0ef361957264c6_1623388360629_0.816246667359946","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.265":{"name":"@balena/jellyfish-metrics","version":"1.0.265","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.265","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a88456ad6478495ba54cd664324cd7d0791c8dc4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.265.tgz","fileCount":15,"integrity":"sha512-BTpLN0x/31sAD1IJPIHqlJ0VQ3e7HipRQi9MYTNhA728Td2DAnXXPkibE4y/gPF7TuKHEVRT8H7im4CJvWk72w==","signatures":[{"sig":"MEUCIQD+dVykrHyCRdfAA8p6/qTYD9k/hAm/GYgha5z2gDx80QIgSRQkT1dRylFMskxejb9nnI5so6g2Cv47dteIAIzoGGg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":117444,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgwvG/CRA9TVsSAnZWagAAbtYP/04lG9OGN1wE8YdS7y4n\n3P/6d7Pr/g4Wl6k+vL1KB3+WjepRZ1GH/rLjMvDsaM9slh+mSo5pr7cU67y/\ngOjOm4O15sN9LAI1nvgzBM68HqA9HQ0Gr95IfwTzfqWSRuEJamd/R9O9JRdI\nmAQO3pT03USdfSXfQDyKEwWexjFEGcoxtPUcP5WTKSrdmMipi7QWXQQ3mG6H\nGjGk/rlklPliRy8AeEahgfqcdpZHBlHnD38Bz0xbrWuFuFD2GHriXfwR9mFh\nFvnpzqUTzKJ9eOwsHdC3MZiGI8pzbA33/4WqAEsHhbFNsg5kZFoKaPKCs9w6\nOV6VPU785XGK7TjYiWC+CUSh6049tpt3bM2aYlZ+U2Cf96Cm4gPLmyD4poiI\n6BHrrWGNygdsw5/R7C7f0PJHSEedKddGrlbw4DQMBmjoTUw/vWYTTCZMkBZv\nggb2NT0mwJmUsX0NqXI0kwgsIkI0enW6TCogJq6fqtb42o4jlTWraJfYAxKv\nrvXkjTZaMbz1KQ2A6NYDciEc7aUDbQw7r0Lc87XNFDLNu392dxSpkfa/jf94\nafhGzRflZPzq1uAUrCDaUddAYDh6NRfon+7IhLT0MTtvU864ApKxIUFH+D8W\nA0w6AfbMrJ9SqlVnWcMdoK4lYeLnMsS7pwfvfe+w4KM6D3kT7h1bee9G/t6k\n9duq\r\n=5p7B\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"df0546dade60297dd80a3751a4d0fd2af0f00e6a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.6","@balena/jellyfish-logger":"^3.0.11","@balena/jellyfish-environment":"^4.2.2","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.2","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.265_1623388607497_0.011809552759939113","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.266-renovate-internal-patch-f00953d821b761d6fb4bb5b5a9139a1667bfd9c5":{"name":"@balena/jellyfish-metrics","version":"1.0.266-renovate-internal-patch-f00953d821b761d6fb4bb5b5a9139a1667bfd9c5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.266-renovate-internal-patch-f00953d821b761d6fb4bb5b5a9139a1667bfd9c5","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ef9d4ca97090510d1cbed5d6988778ca9029b139","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.266-renovate-internal-patch-f00953d821b761d6fb4bb5b5a9139a1667bfd9c5.tgz","fileCount":15,"integrity":"sha512-D6wQ6DFwcx/z3dMzmKuDYeD9XCAGRBCx0RsYqJ0rJcaEkL7/mJ1b6T5KD/Jaxm0HG7kMO9NHPXSCKR1ETYcw/w==","signatures":[{"sig":"MEQCIA9OUCWMM+qSdeaVk4SOL2Kva//1cBU9bqBQdKOkyL/PAiBGQmanBhIwiqTrtW3SSk7SzV8i8/Yj6YqyCwgPxRc8gQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":117613,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgwvMbCRA9TVsSAnZWagAAdDYP/j73hv/9WXmwhxF8hq1L\n+TtMuZRrHnIdgu7FuiJ6SovNxoxaSmfXOyvGD7CnRfL54Gy5UDzwEHViZ6KC\nr+hxvrXGIZOcJHvmdR64OWSiukTa3ySGwC7fPYbSm5wuHq1hgVoabsRwE2Tr\noW0sHOS8ojXLMw+fGkD4gmLAKSZZOYbE3aio6iliE2spiFRzNU9ZW7FAL6Up\nO5e8EZQDxfJVYhHqQ5rBan7/qUYV/jtheIejxSvyuyYe5RNHAgAbxoIyBofN\n6hwbu0om1cSfkYjtH0TjuZWDhSQwz9sg7K1SixhpjiA5j2IzgTM8IsRtTqUX\n+orJ7ev4VeZ/ms4QHQJyvbLYsJz3f6Ui8DXyzJni8nkoTLMyc96cm3fet3ge\na5oBerLEbOkh/QXVWISSJwIVIKQW5s6YL/Ypv4IONKQMoEzU/+j7XETRwMJg\niy2vqy72OW1GGaPwyoOVgCFnhgvhqR3qUgcSTC8PxjsI1BQAeokpbPKCGkl0\nLiNRDzWyT9uoXduK/ia6i5NmCdozmkXw3EuCufifWuiviXScyKEAxxXmq+A2\noJkyKhwluaccwbSjBjIrtxVz1x5U81cuTJV4V5hwaudvtjeyIdV0gLnfIdyH\nmUzesyj2jawdxLs8m9Ho417SavcWiIXZPGZ9KWxPwuTNIb/3YPwPlnRGEhB2\na0Ya\r\n=ZUWB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f00953d821b761d6fb4bb5b5a9139a1667bfd9c5","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.6","@balena/jellyfish-logger":"^3.0.12","@balena/jellyfish-environment":"^4.2.2","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.2","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.266-renovate-internal-patch-f00953d821b761d6fb4bb5b5a9139a1667bfd9c5_1623388955180_0.9221236751528759","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.266-renovate-internal-patch-4d065ac54e55bb9c5248c6c2adf14d9195129e47":{"name":"@balena/jellyfish-metrics","version":"1.0.266-renovate-internal-patch-4d065ac54e55bb9c5248c6c2adf14d9195129e47","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.266-renovate-internal-patch-4d065ac54e55bb9c5248c6c2adf14d9195129e47","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c21439714e87f43081844db4b72dfb568a807291","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.266-renovate-internal-patch-4d065ac54e55bb9c5248c6c2adf14d9195129e47.tgz","fileCount":15,"integrity":"sha512-ZcQgAypd7gBk75YilnAyoaLhDy0cjLP7X6e1f6RMnQcPBuy7gPbXGm6Pd4kK6slYxWBwY5BQ27McjaYEjE2fSA==","signatures":[{"sig":"MEUCIEfBuH+G4Qx8KNiWH+h5gduFS2O4Fa38PXR/bVrTtbmVAiEAjl1X8iwwKRxzHdJ4RGMFASq61pzqWQon51iNZ5DaM7g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":117581,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgwvTKCRA9TVsSAnZWagAAPKkP/ihUysrQW7EPNk3NAfCs\nN/fwoP+hubheu6XNEsXThxY8gfmufxQsLpxP7iRfD0Y5duqjB+dbkdqa1aRq\netYgcKzPFhXHw54bs/iF6oXpJpTWCqz/ZXRTXroyWK8/Uskz2FeHD6+65RK2\nA0ijcV9wrUgWPc0/mhaiwK0zHgW9u97nD7CIJz6ljltJ5Hov31nFCE7zpn5P\nGdAYi7wR4GDxK9EiFSMFpqs9TnJ+lPlBA1C/dVyZTf740NBtdV8an1Bwd9yh\nqYikjFa7K4N0ZWYxYcO7PzXRIpx6Tu0Teh8LaIgPBS7TrVtrgSocnbM13Upe\nKIskvBZrnYh4SqABZJaySnfPBx1kU5bpQ9j9IUy8fpXXvuG6uCr11Bc0+v8f\nqyISCSkLbF1+PXgufCWMZBIK6QuvbxK5/yREEW27mRWLHnUr5Uac4xXFnYZ8\n2uEk4gTF2pxB5a8qF/ZIE8WX0yoMznMdYD0ghd5Yciq/YWJzuDIhIV5dioYt\nShHb91ea/3eaj1CNnFXSmgLvXVepQw+xciuu1ePiSsVy38QGPfMn6sFvG0BF\nho0Lm8GseAQlkamoDX1PBp0fLk6NaBwIZIY2BsRm2P43yjj/GRY6EaWGTK3L\ntJb5RKDOD3hvdwH3qV8OW4qArrmfGJVHUKnqiGFw8KKT+Cv/ocQSe1UlKKiH\nWNzP\r\n=+nUn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4d065ac54e55bb9c5248c6c2adf14d9195129e47","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.6","@balena/jellyfish-logger":"^3.0.12","@balena/jellyfish-environment":"^4.2.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.2","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.266-renovate-internal-patch-4d065ac54e55bb9c5248c6c2adf14d9195129e47_1623389386177_0.5066951421979597","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.266":{"name":"@balena/jellyfish-metrics","version":"1.0.266","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.266","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c79ed7274247ebe6b649996849b658294a8b6894","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.266.tgz","fileCount":15,"integrity":"sha512-W3sQjL6kD6LKaSTgbsBUR9b7CmPQgWeqEVFCmthTlQwzuVQp8qNKswIgaDORnWne8CME+VCBGqV+tlV0sAgSmA==","signatures":[{"sig":"MEYCIQDGVhr5iMbdb6eRavBrqaFdI+SpG9ni+ooNswSX8ZoODAIhAPmySW1FbSlvOOk7U3l/r/nujUQ90P1UfjgIzd2wxW41","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":117516,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgwvVwCRA9TVsSAnZWagAA+fEP/2nsm+V0YRgF7A7l4iOS\nyZXjDLwqICMmhZKK+7ywJiM1Wh64AKUF1azxEBue7yfmVaSVAH8BiZPGiIh1\n8IllKYPqrDErxmT2gL8p34hiZCF2ssq4k793pcYuhfxXu7ZozZgHyYAtPu12\nqD43dRXgefM472PpAP9QK10ejvRCwObwQYIUEEuhOXNovoZktZx79fz9f0Mw\nbWSZyDkc3qfPN3YaT78E5QmWtnIuckcNkWzluGU+SygG+Uqz7cOPqQLshW64\nWfajZIZUreFikU+g7MP7I31/2SD9L12kmaA056s8RcwJ+iZu3KcRsKUGbtD+\nEGGUvn9EuSe9Rhii24yGQqOL0s4uEVQSp9CxqSIdA639VqUQG/qc5rOwKPGL\nebXqKceASLfobf9//6Q3K9pAlU3cISz2TPfSx1SCpKj+qyOwj/yGgR/qy5pC\n9xlTtXeLfBkt+PnNAujVYgSSt94VDeRfzSBOzYIVJjHOVvMzmWj0uwgwk3O0\nWxIg8QDynntuLw1OgAio6pv7gY7LfolGTpciuMiKnsHBPHmH0DUqtyMRkj3i\nuVpPgdViFrNYR15x+/hfL3ITTSym8XEmVljqgXoWLyKIloTOFytPQXUK/9xT\nF63gnjFF0+YcVEg2egCLk5OhPz7MGxb8kdSm2fHS9zCXLcl6EL+6HZJChMaJ\nF0hT\r\n=3Y+d\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"118709795e1fd6424cd8db9a2c257b772262fc4f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.6","@balena/jellyfish-logger":"^3.0.12","@balena/jellyfish-environment":"^4.2.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.2","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.266_1623389552257_0.4240544672750379","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.267-renovate-internal-patch-b1a99777c6dd0b6f2786add40cb8dce4479fee04":{"name":"@balena/jellyfish-metrics","version":"1.0.267-renovate-internal-patch-b1a99777c6dd0b6f2786add40cb8dce4479fee04","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.267-renovate-internal-patch-b1a99777c6dd0b6f2786add40cb8dce4479fee04","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"72262baddd833645206073670d8ac9c84e8f5cdf","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.267-renovate-internal-patch-b1a99777c6dd0b6f2786add40cb8dce4479fee04.tgz","fileCount":15,"integrity":"sha512-cTn1d7aEaYmpm+gVRsLvJ8ZbI2OX+eqmGllSxy6b6kNkGJ+AcCSMi2ODKK1BRRgV3mvzE2byspDcG37wKGZfpg==","signatures":[{"sig":"MEUCIBjMPmvC7HwbGI60s6vLacYmX9WNASKt+3+7zYaTSZUEAiEA4HCOehaJF5cz5l/EMSohOxnOP7hFfxK3akhsNhoYBsc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":117653,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgwyidCRA9TVsSAnZWagAAEcoP/Rh3iUItx4WUQTI0Ud1q\nAs0rIFYhCLUeWwYa2NqIdu59pUrJ6nBhjd4OosgxurAG5krLAzorVQBgudBa\n5q7mdVhCYtHc3QLyocuAvbSmYujO60rPk8Oa34U7qOsu/rCXQCf0yEv6VFfs\nUgFDYE7REsq9wVxh25xQwINPVeOQ5IoL3+gK7w9DyfTCEaHIhAQEA6eKWdc5\nCMGmziTJb1DPfo+Ut+T+iqMa5AiAB+3kyE9G/A0PHyyvWuqkhQF0aPppv5Tq\nGbi1NgpWq6ZnTfdu1dOLDstoLWAwCS4LMVXCkDsTlRaQiWjclZ3L+sryVBjn\n0nH4J2kIrlYD/s5RzEUYDe/MQBOw3iSseWLq+2Zky6DMoT1BnDHXKRMW68Ll\npQwv2BTKMkYhd3zVdWZSCebQ9qNdoLTfnMqeb9whiIWpWmiRjg5Yuhu0ISs0\nzmkXU0+jQWrq/cyHJKT9F4ibI8rVThsPjh9WIylD/w21OWz72guHRVnBvXo5\n49UlRr457KdPMys+8MO3sPT39fDoQjZ/9kPp87DL1vPN/aR/3UmV8EDaVYi8\nTLo1otTjC3g1zJzlFoFuS3ouS+E+VBAkfIW85RxBSS+ndCr1BCYolS2mI/Fm\nv3hPfWMxf4++a86PozsPK8Io+mWv3oRnxRYMpoKsRpp0ZtyMaS6RpFK2lAnr\nVJYj\r\n=6rFI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b1a99777c6dd0b6f2786add40cb8dce4479fee04","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.7","@balena/jellyfish-logger":"^3.0.13","@balena/jellyfish-environment":"^4.2.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.2","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.267-renovate-internal-patch-b1a99777c6dd0b6f2786add40cb8dce4479fee04_1623402653619_0.9891345423890954","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.267":{"name":"@balena/jellyfish-metrics","version":"1.0.267","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.267","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a490b7a57cd65797bbe6145e09f6259b811dfc07","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.267.tgz","fileCount":15,"integrity":"sha512-w4Z1oqfJQCr8EuchbS/dS2il0SLb7yZuI+YFWnzTie6KGU2ysF1Xlmwa9ruDndsaZK4/joKNmfObbuyWrloEgQ==","signatures":[{"sig":"MEYCIQCxHd9eMQYlWo1VyIF/DdFSnmbdbWx2Ekutaz6QE0vKNQIhAOo1+MWvkJu1WJN2Wuugg/wznX33T5VVwWDNS9nXNkl/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":117588,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgwymZCRA9TVsSAnZWagAAPO0QAJ0DxfC2xtOLndXAWOdp\nXjeycq6HJ7gp7NBkYZ83f8b3mPnifWBJVR3EUO2FovpUx+S+Xuh6m+ywJnYc\nh2h7+FSqYjuEmLlh4vukJDK7g1BSVG/Xj99EegbKqw8mxdOL1g4i/3Gp6y4P\nlfVjwnOYnD2r/MElYXg1XeEycJ+5AqodwzU0p+dNNWTQLAqDz2EFaHc0RbZp\nq2WmOVg51q7nD7biaOn0KOCmXrwO+Y7mTA5VREdzvvld+5WA0FS+IgkfJFuO\nVo49D6nos8/mKTMyAzJJNk0P+XLiQ0o+IELZFCahLgW3JaO/EXoADfr8sx3n\nhzZIyhZOlTV8+SdULNNyl6Z0z4ozlsFC1zq9QS+90ClmnPKgW7Bq3q7l/aQ3\nlxZbA3VAikKXYTFlC8/fW1HTdxWK6BW2ufmakUCWJynvLjNOZ07+IqvHSbKB\nWmvW2CaJ8hMtb/zj35H0auoKQ/lLCTJpGvXNl//XL6IG/biae5n7A+5/dIvE\n+ToHnQv6JR9ppMAUudGJPeK2+cftYnkxYS5NLD0KYWa9WBJXFEZz/twV5jqK\nvQYRZt/Au/QlzL9eaKtPNnjWt5f4w86Uu9SpEYgEVtV+5FiPBl6E0i0/v2Io\n4y8vdfpysf22orCCHo6cgUR3qv1w7w6+d1huJ7kykopcq5AX3f65e+VlS9Vr\nTSWa\r\n=/bT3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7a47d8e2b50fd717d4e32805efba1c533ca77e39","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.7","@balena/jellyfish-logger":"^3.0.13","@balena/jellyfish-environment":"^4.2.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.2","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.267_1623402904887_0.8406554173898055","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.268-renovate-internal-patch-07779bb7aa49e337cc1ba64b16b0cc684d9b6dfa":{"name":"@balena/jellyfish-metrics","version":"1.0.268-renovate-internal-patch-07779bb7aa49e337cc1ba64b16b0cc684d9b6dfa","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.268-renovate-internal-patch-07779bb7aa49e337cc1ba64b16b0cc684d9b6dfa","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5e2a4146d8b213be7b2543ffbcaba634a19cf0a0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.268-renovate-internal-patch-07779bb7aa49e337cc1ba64b16b0cc684d9b6dfa.tgz","fileCount":15,"integrity":"sha512-VZGEmUX9qDIHoex3TXQYD5a+JJlqLEaBPeOkJDqaJrvYPIDb6reyDQpj+rboQZU0L0wLoFYDL47HJ5tarRtfbw==","signatures":[{"sig":"MEYCIQCeg60Wp9x33ukH2OK12GwaV6j5TLkg2MKGihWYxb/N6gIhANUSvElGbPEMrMx7208Eg9LgNW7SSkPINARcauTCh1d6","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":117757,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgxAhNCRA9TVsSAnZWagAAha0QAJKf6zRNw2pda3WeqW//\nFscusw0+D2NKM6bODXqt0j0nlUrDA0t/tg+BGDsrID7gWfAfNm3YOcKu8F7T\ngWDpqJBIMJGIpNzxGm9r02GBbreKHs7NP1UDj/+uYPH8EO03U2P74J4YPPEj\nknZ6HTD7E32fmU9/y8U+/sCliuYfRkzwbWu0npJRVEZXCQkKO+gCl6/kVscv\nnqgmzmXcOZQU+9F4b9IQhqC+EAaMMY39O3+jBtwKYr9cenTWNGNxW5CEm40G\nuCPcrmQzNaKDz4yRlz9h24b1jhd/E3SlRB9AHmkpp1oG0BgC3OKNOjSbHczh\nRbFPQpFsRufbZ0gTT/kIRlr8l6pGhPceVgh2tPLzKvJ4DtqYrnrbHxbD0YC2\nXqAFEOzPqKjEaWH4tGh+K75RN0avnyzWPd5sVW8qYKZl4fes7xy8EL9aJXTB\n0aSca5vOkdVYTWFnhBtDZOzAxw4DO5hat5MbmquybwcgP58SpMIu8Wd2/CpR\nBaswDSQ1PzDGv7KkyzdtpBN76Pa2CmJ4KzVoDKam27AsAw3hA1Dtg0bSjU1o\nVmhmFxC5btdNhMjBwqDoy8AfbLI5i7bZZ5xq4c6v+Ud6Z3+evDIaHpOzKrqE\ndVl6Aj4gGoOSNQyR9nwkto0YTXkienqNYlhX8NYWzlqJG8sSfbU6/Wrm5Znd\no3cu\r\n=Pe3m\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"07779bb7aa49e337cc1ba64b16b0cc684d9b6dfa","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.7","@balena/jellyfish-logger":"^3.0.14","@balena/jellyfish-environment":"^4.2.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.2","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.268-renovate-internal-patch-07779bb7aa49e337cc1ba64b16b0cc684d9b6dfa_1623459917093_0.30932162314948264","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.268-renovate-external-non-major-993cf97e3bd773706c645e655e221d1726a3e6ea":{"name":"@balena/jellyfish-metrics","version":"1.0.268-renovate-external-non-major-993cf97e3bd773706c645e655e221d1726a3e6ea","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.268-renovate-external-non-major-993cf97e3bd773706c645e655e221d1726a3e6ea","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"70356d5e4dac0d78aabe185311a1f84d387b9fb7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.268-renovate-external-non-major-993cf97e3bd773706c645e655e221d1726a3e6ea.tgz","fileCount":15,"integrity":"sha512-0rET/yCmnh8+2XQAsIC06txm7Xgf6ushGCKQ8GTqN+CjuzBK16WqlrPUfjwmrv8HhfN0zJBWkKxzGvzHbcwVVw==","signatures":[{"sig":"MEUCIQCJgiZa6MqITVJ5Qit6+35bMv1TfeNxPuSbuKMhockbrgIgFliCwMjOaOZKj/4gBbA9LnqpplAuIH5JZTChWKUQQrs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":117749,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgxAiOCRA9TVsSAnZWagAAC/8P/jfPhtC8/fzZ+fcn/g7x\neuXtTlkQhfBfGfSb1XVJ3WfgV9P+tGjcaEgACsjMGhVbVNsJDzf6tDlOhHQt\nWHaiuBZwNSAMCL5X16fEpMWCPxgAsxH2X3gtR2pxgi7MQzStZHpwVT27XQ1o\nrH3MKid8/Uh/tTSoYWDn7ndEBX77SeJPuytOWRyUYXQ+bBDBnwxMUc800dnw\nIlsKk87E/o9kHHYB61L1CsNEVthwZLRv0Tpm1JaHEEcRjy4ishxOcg8Qd4qX\ncV1u/h0e5MvyKoA1eee2AEn/OuvoyHELV+rK8ZjEUYhQ6WEud2vusVw9iDui\nx/ptZ+cPoeZj8qUqsZ+CS/ywx+2kra/MuADzFuzFW+yOXNnRlUc1JKT9Qw1s\ng+mtVEDXYbA/k02KLS2116vyp97AXrUieZ1ojMQP0jnNT08WhqR2nSmJNbnN\n962jv3fKnqlcrpdxiw+3PM3oKZgI4uddywxG+TF4/U61otw+KXRumWgP1wzI\nRPmkDgVICgm1Tx0rtAk2zxRJEQcTrc08Z3zAH5+dc0g4PfcP7STan/FAnVWj\nDmvYJBSfj1IIQMOK9Yaq4aLUhTzIEdWtgMH+Jf1VF2zOM38uZnZHoNTJSeut\nE+sMs7SwvtOGDcQLSKLLs6sIEtSEMWamXVe0Ap4G43NSwSlsgD46yBdNp2KN\nPNsH\r\n=WlqM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"993cf97e3bd773706c645e655e221d1726a3e6ea","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.7","@balena/jellyfish-logger":"^3.0.13","@balena/jellyfish-environment":"^4.2.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.3","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.268-renovate-external-non-major-993cf97e3bd773706c645e655e221d1726a3e6ea_1623459982609_0.9585565193886647","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.268":{"name":"@balena/jellyfish-metrics","version":"1.0.268","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.268","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a080e59ec58023ad1782335e1cea4fbd677aad63","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.268.tgz","fileCount":15,"integrity":"sha512-z9tsDDs5eFPxPCMej4T9QeoXmZ6s453BVPCWvvhBnI2qANQj4kJvMeAPCWQq6aD2tDfc03F5DRbkqKu615BqQQ==","signatures":[{"sig":"MEUCIDoB8/rRFvez8IB6Iz114T39i9f+YvXoh+bqjFCyVezfAiEAr6pj/rNt6iRu7HzXcokY0SLJWRx7+Wj5gWPq6S9c2LE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":117692,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgxAkcCRA9TVsSAnZWagAAyhkQAJjv4aPuODFW/BSvdXP0\nxnPrzC7/riMXwL40pNm4ZPbevHrAkXV/GDYDrCeMPAuraKWzJR4/9VYkmGkB\nyugQk0ISWJoqRqusPOXLMyAJJFWa7iVpS4/mnP8nqka66pp1xw/Gc5FSQQAA\nL5iZ0zYwVyXfiGnNRV+1hTTCXhoQCUVptDhp1M4E0lWAP+1pgFTrxWt01Aui\n1eR5dU+5pTSjSofArhLTPN4zencxceJJjgFyTkUpvV1Og2HULAl0SHGU9egZ\nuADJrydo1QFqNexfu9fDDxVNOS0dDYY7iMjxRWsUfifAO4qFL5L97ErCIyAh\nbfzK3DoQFML69a3KxKCB5WG61dSRbvF7xnL1UQWvh7WT5oxhrr0U7l9HXh1u\nhlmDkxw6ZOobOPQzvU4iI6ySAuiQ5ckQ4kJZDpv7EWacZ9VPitvlIBuD5c2K\n8suZGGNm+B59e1AIEi96RAqRsQg+N/DSdMTEMWUl7THZjYKzN5ONwHiEyoOD\nGP2UMs+EuOX5BplkBkNhA0VcsXklXyXcXZQsDC8xiKeejT6pVih9jgUB7QGO\nXeb2TDV+vzcxgWWEQd0cE8mfKkkNxzyv61dEPqdmM1xEdTd3EnhbBm2XtmVC\n/kcgnyXboetgK9mYn2w2afffuSzEgSv8ZlxdPq95/4l55Fr5Qq24lTrgFiiL\nXzXb\r\n=QdoL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4f04e6a7742e8c9a72c1ae784b37927ac9ef7c6b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.7","@balena/jellyfish-logger":"^3.0.14","@balena/jellyfish-environment":"^4.2.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.2","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.268_1623460124149_0.2272137769179836","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.269-renovate-external-non-major-b41d3114805669721ae7606846d2b617cf7a0bce":{"name":"@balena/jellyfish-metrics","version":"1.0.269-renovate-external-non-major-b41d3114805669721ae7606846d2b617cf7a0bce","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.269-renovate-external-non-major-b41d3114805669721ae7606846d2b617cf7a0bce","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"842eba664f5984e839be84b3bfe6e9c5859d9b88","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.269-renovate-external-non-major-b41d3114805669721ae7606846d2b617cf7a0bce.tgz","fileCount":15,"integrity":"sha512-2X1z1qE+Jiojlv/A3DkK9sZp00RBmOlm59+iEK7iz3birwacy/3CjRfOKR60+m7ArXlGrEu/rOmKofvZBqSHZg==","signatures":[{"sig":"MEQCIE5GR4EIenXeOeCCa/ymIjrHOnHpLUbt6JojyHWGsmQ0AiBytVRQOvyxEVdXy9eWpqtiK/DKqGHdRt1LqvbkErZ58g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":117853,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgxAoFCRA9TVsSAnZWagAAnHsP+wXBPu30bQs1QudUTSgD\nIXQryWlJ1XsrcJW1wXbgsZ9KjRt9jQx2mqIHH5k5cghqx7kvNxHeDXToJps5\nW+HYzdrfWv36E8oYYNbzkcLfDrzaU4CYHcQLT5GmARri1eoA6qaAVc6ussQ2\nL1tnKn/1kgZUvlz3lFpczPM9DMOuFUEflrc8/Okw5O5VG+oV4aczWdaapAbv\n2nyu+7SoUlPvwmwVjMlrjkiSj+J1ShJOHFXcGi4kXsKIp0auYUAAPzp0Z/MK\n6T5j2pYUnnJMSWUHn76w1SDkVmvHVFQ6Ea4XsM3Oybam1CzNkaOCIV2Az7Cl\nfkl7ZoreDXtmrI6O845CrgxC2IHBOYOdrjiDgJUOC6khcKXO5ppchtoE4z40\n8I6nUf6IYqE98qMjino4nZ+9Wd0JpFcEgdq4CorMnPwkAsGXarOdEsWI4Jps\neK5Gr1E4r/ccjczmTlJcSmZW26K7vSFtkvqmQhOadovzjVR3cT/nBnAdoa+P\nMJ6PFX6aA3Rv3i+zPUoMkdB5nMcOjwYLRUnzZzDUoTHWXe38ipxJTEEFD1GI\nzHRfw4Tc/PLi1w0AgnTuV/VyAaHK2ZBi3SPxTMxLe0VZ4IQ4wygZ1KTBBotV\nD8fVpUJimpw9DqVu3glejSOxXtVOTE13MiuPK0HELpcGfJpupqOpUfm9uAAB\nQGIU\r\n=CPKE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b41d3114805669721ae7606846d2b617cf7a0bce","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.7","@balena/jellyfish-logger":"^3.0.14","@balena/jellyfish-environment":"^4.2.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.3","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.269-renovate-external-non-major-b41d3114805669721ae7606846d2b617cf7a0bce_1623460357377_0.1375131831058085","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.269":{"name":"@balena/jellyfish-metrics","version":"1.0.269","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.269","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"19e8a8f996a19c1d4185dd76673411bb049ea9e1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.269.tgz","fileCount":15,"integrity":"sha512-V5YrGUZxVz2P+eQqMZmikL3he/E3CPh+JQyQBNhBS0a1bpfRo5nTBVhVmnOqdQ4yxK07IDCcGqsAIqLqBipQFA==","signatures":[{"sig":"MEQCIFZm1/0rdLKI9dpOm1l3DX2MWfgFBSmt9Nz1It1bFJ1UAiAkyQor8F/ucyZlHsTyXloTf4KQe0wv0OZvlDSb+S6A9Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":117784,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgxAtnCRA9TVsSAnZWagAAgcgQAJwvPwz4TZI7aQW/n2t0\nabLJ6SLODy2HzP8xyoUX/zLzBKgiieFWOa8kihfzk4XjHIiPzz3VGrkndn3+\nJtybia3xej/ASC2r0RbdZ3l2Bo5fpEXitbgoJcaxSBWPq+m8sANsNdwwACKz\n0InmC1OeG1/05GraTPFfs0lAB/LIPyn468HAkqZfHJAaci1CbVQfPupQcUmr\n1K7AU9hdmdk/baZVg651E5VDr3+StMR9KfOrWK/7obL2a5dLxXv8P8F8XjrB\nWhrWxoDyh53lGEtPWS4BsXA1EUanXzYseGF3ME6fWjRA4iGpjMOeDRmFQfUV\npXxxTnFA05PB8glgRHPxCMKAlUMCksNL+weku/+v1V8EHcrC7aafeVskgrue\nlu3sPCpjtXnXw8sLWuUSO8CnCYiue8VqkmLinq1aecOl1SlboSQNlwWUhrSf\n5OGqHjYM5mMLCILGCL77Jh5M0cqSx7S241UeFmX+Ly0OurbvGU20AcNoPnO2\nc8GmGbpfQ/THPu+glvfDwZ+hAqllDzztHtHioub0c+HF9/labSl8UkwqGkI9\nwPGZmygKhHhn37TNBqOoqrjxFSOPA5NXp2vNNw7K/e/xh8ykt+5EXHBYpFHh\nBM4290VsboRVWoSgNYNGomA0Pvp32vF3ACKev7p9tIfIGXPUOS/ZprvtpfOr\nekVW\r\n=ZOMT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"389d8ebb491c10dd716db0414b8ff890f2fefde6","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.7","@balena/jellyfish-logger":"^3.0.14","@balena/jellyfish-environment":"^4.2.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.3","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.269_1623460711216_0.0632758093638004","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.270-renovate-internal-patch-2c62c113fb3c9b7380737e8a2b5bdab06e55a0a5":{"name":"@balena/jellyfish-metrics","version":"1.0.270-renovate-internal-patch-2c62c113fb3c9b7380737e8a2b5bdab06e55a0a5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.270-renovate-internal-patch-2c62c113fb3c9b7380737e8a2b5bdab06e55a0a5","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b9ace39b53482dd1cbee4fe2fa0ac1d6d99c81fc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.270-renovate-internal-patch-2c62c113fb3c9b7380737e8a2b5bdab06e55a0a5.tgz","fileCount":15,"integrity":"sha512-F/kzteiavk7v3e89TXcY6WzE1Z+/pPE0+RVcW87auMSa5bErerxzfn7Fqq9gWQ0dr38KhzcKX8M4gOz316vXdQ==","signatures":[{"sig":"MEQCIA47hBEPdgwV7he/xnD76hwV7+/I0KObcZF/2CAJO7+lAiAHQRiPyR4tj5kds5FC6nRUeJLHwaBGA7aSipE7O5y7Ew==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":117951,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgxHCwCRA9TVsSAnZWagAAoAwQAI+I9zAvotrE7Ufzp19D\nT8C8knvZgX24RGr8MGt6dQ3aJLxHrgB9WzhMjZVulKz26XxxbeeUnGUVbY1P\nGvYbQNwFAblpLbS1I8fbOB81dKyIyFLL+gNl0mUDNahzfuVwr1FmrGQrv8Wt\n2x5xjfgcvh6S0gTZvPgiVJsU1L4A6WvKzlXRyMyE0MNzNVGMbh8ouJHzGaLD\nj7Oa8d3x5QfdDH3mx3P+T4cY72sfIl4tZbgVH/BQTKtS7qNLwnK25RvJNGbD\nLhdksqq0ZjFvgGZMmf97L7sCkzCxPhA6XlU+BWryAusl8gBIIeM0YSeHkEA/\n8mhSBESCYrsfGlHLCUa9ezMMeJ4ZFO1di6NyzBsTBAoeHzY5XqEAZLvGmg0N\nDiFcnhWMwm9UfjyIdvRWC8Oj43xfE3+2/SjZB65IGKc+Mp9BR+MgAzLdQbcq\nZSb2NMT7vLk8PykeKJAVJVlDDUZXeMyYi9+MvMCwua9k5qBjj60K7V0+t3CP\nPQzconA4+vNpmuXR/3Z5h6h92jKdNzofGQyBCCBS0+zzMuwwievY83MVSNg9\nLayUK/CP6IsWm3yNcARpeYKYpdbCWn/xEgdLtEN6KTKZ6uOCtoqpf0/ggfSj\nhCKYZlVphuarmoiISQMmf8FCGpQVRxMvqFlsEcY1rPK+qYo8mG1/NHFNRkwE\nIpVd\r\n=7U38\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2c62c113fb3c9b7380737e8a2b5bdab06e55a0a5","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.8","@balena/jellyfish-logger":"^3.0.14","@balena/jellyfish-environment":"^4.2.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.3","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.270-renovate-internal-patch-2c62c113fb3c9b7380737e8a2b5bdab06e55a0a5_1623486640546_0.2672953770121653","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.270":{"name":"@balena/jellyfish-metrics","version":"1.0.270","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.270","maintainers":[{"name":"nucleardreamer","email":"nucleardreamer@gmail.com"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"17104adf94041f7eb826f249afd0836e9fe75196","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.270.tgz","fileCount":15,"integrity":"sha512-eJdsx019thRWXEfvUbszitiqxrzyectplCwPo4wMJ6msQn1qEENq1IfV87RYLxrzukjKNXmjEOEUL7s20bYNYA==","signatures":[{"sig":"MEYCIQCd2hGcIXd2/6O4XPyZkhnbm/+bnRfs38Vg9aoN4wT/kwIhAOlnuxm49LOVO4ijYq8ZiWGEcAYqqlwcI4HMSxSE1Azt","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":117886,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgxHGRCRA9TVsSAnZWagAAcvsP/ifJHcvEA/e3RCBXUiOY\nprxCTsnW24Rbp3snQzDyu6A68Idk75jDKsW0Fhy9C5hnwbacr6pvKfngmkJI\nkQQ6ZVwqlKe6Y+UApPboPUExTvGa9xisz0jPRGMw0G6k3AWOyxq463hfG/3O\nkFGYWULnNJGzFAAUbq6jejD4+/iowTRp+HZijKAjSZW3ScushXA5JxAh0ALY\nZl9RV0b+Si3r896FirwqD0gXFCpdvDXvzbDwTu/PPRs/V+5WhZKOjCM4j44B\nEMQRaQ11Zzri7BAw+gnFddYufgUYY4w3q40PrJDYdYX3WdpqU9l1zUH9zxK9\ngHZ/sbxpup7CwwmnCa9WuAny1ryA3/DENscM5O88AIJmfxRnqHFed+LpFD+K\nW6myrVAcqR6XXeSxe4PDA0fy3yhLFBTavURzn03tSMJhv9/UNm8esOrgM2ZC\nBQNGaaqqi24pLWIyEfmkhFq0DHzACW5seymrxvWJQGz3qYhBApgwzeNf1N8X\n0y1z54R2PGN2vkcXBdwGjRb078tiCOmo4fDeKC7lTMcpCvvca43Ij/AxLXEc\n8btS3AwCKLEeTu8ACTEF5RtyVZ4MAh99wHhFR29wvmW1840ou3vgvO995TgJ\nnkihBtHUCGPj9wHDMc06txh4l59nCSHYga+kH5+ZG/dUZPKbkZINKO4lg7dD\nOrF0\r\n=CEiu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"64eab559b914dff26578cef9ca8ac9589ea9e742","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.8","@balena/jellyfish-logger":"^3.0.14","@balena/jellyfish-environment":"^4.2.3","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.3","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.270_1623486865360_0.2574223398008526","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.271-renovate-internal-patch-e72cdcec7be293eb22dc4b535661293f112a986b":{"name":"@balena/jellyfish-metrics","version":"1.0.271-renovate-internal-patch-e72cdcec7be293eb22dc4b535661293f112a986b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.271-renovate-internal-patch-e72cdcec7be293eb22dc4b535661293f112a986b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"08ec74b5dbde4507a80fe0312b122817a3330399","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.271-renovate-internal-patch-e72cdcec7be293eb22dc4b535661293f112a986b.tgz","fileCount":15,"integrity":"sha512-MDiIr3pF3tB5lAvUB9NJ0zt30WfOv+trYEf0E5eGXYqS5MelnxsvCDMJunB5SgK6QyoLLuvdDt8D02Uc3KhbZA==","signatures":[{"sig":"MEUCIB8gv74MNU6UqYVBjBrEERhQwlUZU4szO54ptD9swYmeAiEA5+wx0vqd4s37NwRKty9dwDfj8xs4SEixwMYS82cY0fE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118059,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgx/MhCRA9TVsSAnZWagAA1+AP+gN2MushdCQtb3ZuYM/8\n8GH6/O4Xn7auZUZ0oKoXLeR4rHPZm93CgQPoKf2+a/MfSYT+7aeFcV9fM0hc\neVI9gevXZ0yoAzyns+NSSwOUHIGDMD7K5iSBJV/i6kxjcDNf3aiXr+17kZX4\njJLA1FlMYIJzUE0PpoWg5a5AGSJ7wifLGkB1VxmrRZeq4i2NQeT0ztowYJRq\nZDgC5aAMs0dxeO9TweuW8wJ5g8DNtLeW6eoDqFG9rOHEgOYoYc7KtfYHGSKD\n2kWLOiwdBiKECfynJokIkbXEC4NQ4UaJDPhd9BCPOloZCNfZx1miRe9+aIsZ\n/WccKbVosWvvWFQsw2WL7nW4HbH/jO7eBA7ljpaEy31K1c2aXbMGK4KBbEW7\nrKKdcW7uaIAkuROyI+DHiLbVnozvkt1x3dQMrJNclAhCC/S7D9F47CRXfd/f\ns5CarbgSVW36b8RFdIlPm0tGyzTqrbVaJZzIG1RBINqLHdj0I+cHSclSm0ZE\nUL3viyFM7I3ZV6euIoRFNKWxSuRBvlxNPbnSBP7nopXpuAVcj9s7NsZh5MNv\nQPO3cZc4m5t3lOUV8pIwv+fOmhp2dgA8YdqrapQOgwAm8qKiW8V7dp3wsoGV\nBq9xFXPCucGhhfa5hMfJVqEH/0B9MpOeBXNp89yScoHBmPtJ/xdXqYSDZImy\nppuj\r\n=1mSY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e72cdcec7be293eb22dc4b535661293f112a986b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.8","@balena/jellyfish-logger":"^3.0.14","@balena/jellyfish-environment":"^4.2.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.3","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.271-renovate-internal-patch-e72cdcec7be293eb22dc4b535661293f112a986b_1623716641235_0.5612113638714413","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.271":{"name":"@balena/jellyfish-metrics","version":"1.0.271","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.271","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"db6f8138320d7b76c7359a6f5ea5f4adb989cb54","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.271.tgz","fileCount":15,"integrity":"sha512-dCwVSyngX590Qlo8yoh5SolAjzBA/6CiKcUFE2IA0Mr8Qb9SZyDpaW09HiQSZEbr5owtsz3GeTbc/ZbYzzZmwg==","signatures":[{"sig":"MEUCIQCZuYGvvLbaadbnXO0BCLBeTZbZ9Z/z2UYlGtSWVdIVEAIgGGkymwGsiEkMQodagZHTr1HBYpg4BS0ut1eY1IoRloA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":117994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgx/P2CRA9TVsSAnZWagAA7UgP/137pJPiUwnYra8QwiGx\n69/riv4jM5XaFaC4TZwm/+Wl2tGztmqMTvGRE+JIwpv7ysmspCuyKLjpRoKa\nQ89tfH/FdES+cUpbYRO/vLKOI8X7dlxeb88rGIQOcRhDQeYy3I4ThlfP5ZkR\nG9uA2zdv16a9JQ1adrWaAY6+CsEYS11J/nnLJhS367AXlcSuG5tMUq5oSwz0\nLBIQR+vm8JJMVj8u9dwEQzRHapiFY3BqNHRHX3qF+WGQESvDoydhgu/7zqWr\nxKnVXY0o4TlbbHHtVYhdjsNDwpkGoMY550obzRKymiVmKder+f8rI4ZoZg2t\nSMk861H50OQW4JG8FB1zpkoIqLGk4gA5f+EGNncogPTtwi/flcydmOXFekNp\nHawbPb+mm7CeWjXZlVbHMCR8jdHn5QZ+StkkMHAjEv+xUtY3IgDTPlNu2Q8k\nKUEskBFRQ4BpaMku9y7XlDhhYE7DpbRaB9Ek9lIkYjv50HrTJL2+qvd2lHH6\n422meS5A0KQr5kCTSfxQfcEg0pAvPvhk4vrphprulsCy5PSAwrPkiiX8NUs0\nhyr0QJiBUaSoLymmTUx2gLvd3MrzkUg3siGZrpD5fRcgfr9EBi8mN8M96K4x\nA4PlUraINLZIii0tXFuPuqnFhqva3i5O+744lSr+Od5Z6WxUAYROnv2TIY16\nl1dD\r\n=uoxD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"36cb40ec60d03d254f0ec0300049de8704560b07","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.8","@balena/jellyfish-logger":"^3.0.14","@balena/jellyfish-environment":"^4.2.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.3","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.271_1623716854303_0.7048475344122964","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.272-repo-sync-jellyfish-config-default-4963ac890c2a18de78df7c75c59889306e61a70d":{"name":"@balena/jellyfish-metrics","version":"1.0.272-repo-sync-jellyfish-config-default-4963ac890c2a18de78df7c75c59889306e61a70d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.272-repo-sync-jellyfish-config-default-4963ac890c2a18de78df7c75c59889306e61a70d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c6b452bba02ea045022a5f9e27199ffe8eff4b03","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.272-repo-sync-jellyfish-config-default-4963ac890c2a18de78df7c75c59889306e61a70d.tgz","fileCount":15,"integrity":"sha512-XrqV9d65EHZ/xOm76fza2mUvsGovrLHnmb0Rj2u95zQG8Kwz0IVB9JEzMbACD3d0q8gmHcOZIQ5hND/ViRxjtQ==","signatures":[{"sig":"MEUCIQDzAKDCMXZIX/G+qK/MV1X7ZHR0OKdoErk/HPDCCMjnywIgaAktgnB105EdGqh6go4x1GDH0vRXMJRAbCuSP9eNLb0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118209,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgx/wmCRA9TVsSAnZWagAAEkcP/0n48Cf/Td9TPjH5s/Lr\niuP2ijAlIcO1cQg4991i7C8YoLLG9waCqfUzdzaJw0xtrxAzIcDypV9VL7aY\nNbIktLfOEmKKmUQ7SfAW/qZfLBWJBxY8QSm2+E50LZIlXxicaK1mfbsGCldM\ncrefuvwzjAeykruUsZscPBU+iPbi2zj3A6DFekPjZaztAFk1uekMzLh7+oHp\nkrK+i08yYUfvCHcHSf57Gdkr4DFzM9memLR2WnvXVgo8LUtEcX4l/r4RJekZ\nAuq+VquP1wWeyM20UXKyr7ocUJGvEPmfQYtvXZxaetgh5UiHa0MtX4VgXI1O\nkZelZ1J9UA5JnLgLrsFu0x22IMM4lJ4ElN9XMCTl4DAug018nD7A2682s+aK\nYtseadf7/RgBsgMKwbweuiV9w4BLK4n4saX2LvQn613bbf/gqAGdIOxjtoRt\nZ8NFlbFFk0/iDGWlLgAzG4tVpuWym0fbPVBa24y1fRpD7DeE4A4JSdYq2CYq\nA+lZDeIPQ/t/JqpRY3lzkn57buGmWXvmvENYMfCxaGPtVl0aA9044dCLlj/o\nJH0YnqNtxK3H/PwazcW8PQjAG2TOPCtPhhL07rtLxDCBlN6lDRk8Woio7en7\nnwpqeZSEcpbLNF4rPwaLe7boV2TTFs0OnMdwBQa/r07V5Dc0ZappaIT9DwLK\nAalC\r\n=lJep\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4963ac890c2a18de78df7c75c59889306e61a70d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.8","@balena/jellyfish-logger":"^3.0.14","@balena/jellyfish-environment":"^4.2.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.3","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.272-repo-sync-jellyfish-config-default-4963ac890c2a18de78df7c75c59889306e61a70d_1623718950800_0.226720087813975","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.272":{"name":"@balena/jellyfish-metrics","version":"1.0.272","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.272","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"189e0bd33a9ab0f7dfbc1a5827956a82d158041c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.272.tgz","fileCount":15,"integrity":"sha512-A7B8R/Y9mpeqRCiQUxVHcforQ7YWeN8e+n++4mQsCbPJu6y7SNBS4kuLkscUf7yCWwo8UvZPlZfIxjkymzVp0Q==","signatures":[{"sig":"MEUCIQCOADpO4/ug6bmJCYCrtCmnIPS8ZQF09klqmxaxlWdwEwIgfQfirGCGzn0TeJE8fghUnjVlJo0l9VQD/5agWKKkU1s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118133,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgx/0cCRA9TVsSAnZWagAAqnoP/iyh4Ut5W2CxKm4HTAeN\nDbYzvRp2p0W/kZPmDgJCpJY52NQuJm6d/IeniyWszI4skE+XGUtHLOtQ5yJm\nTnp7CJSMJ53xTlVeiyai4xiw1KS3xylRzdEyuDhMs8Gj8/zSd8dEKWpX953s\nLycG7rJK7fJQsTCcaSgjJvv1HIbl6AX6X7D4i2kAEp90WOZq9K0TQFzSkxjG\nM/MgKZ8YUTwaRqKyTgBQk8/nMnSYqOu2g7uxXFJF5FaNlREvJYHRtgf4EpQ5\niZhAhD+wW+fvbH2SOJmI5/S77mDc3jvVyUGf6osZUJ1kfio5PXajwakKmfAd\nStIcGGxI5VuyCHLNZytv4nCqDpeOM9Zkuzx2WGbdH2LpHoLtnNxMlzmwLsDa\nzIkThOf0QgS5NQWmUumfUagk8R1+1/kwLlVCJJa2IQ+2zQuA1wNjTKhwrNZ6\nuHxJNLMbX8NpkJ/+btgYQZkwvhjaxxCaTALy9VTA7H7Fvj4ss4mFejXIeO8L\nHfhqJp7UrjhbDQRpYHPzSw6eO+vQQvP88D+w90MzXysx7bTXg5V391jlC8H0\nWBBEfO2VZWIw3pzG9roennQ3GICgQw99eqzCHPLUjmyOmwfsGvtcsn4gp9Iu\nTKPFSV7IVITFkCD5YOjYDa4ovwKKnQ4gKUyAVHMirRLGHjSrrCTn2iCiWyEj\neiiQ\r\n=BZ1W\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"bfe13a1d2ef702313f89a0d1c9d19b43771f03a1","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.8","@balena/jellyfish-logger":"^3.0.14","@balena/jellyfish-environment":"^4.2.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.3","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.272_1623719196155_0.2755883544661939","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.273-renovate-internal-patch-171e8253554297ff9e4094223400ff91c72a15b6":{"name":"@balena/jellyfish-metrics","version":"1.0.273-renovate-internal-patch-171e8253554297ff9e4094223400ff91c72a15b6","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.273-renovate-internal-patch-171e8253554297ff9e4094223400ff91c72a15b6","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7e1523b60865a7c9a2a614298d0a9202dcd3047e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.273-renovate-internal-patch-171e8253554297ff9e4094223400ff91c72a15b6.tgz","fileCount":15,"integrity":"sha512-gkGE885INENYbcu2I6ii2oS2V0p0KzaPxJK9vClaZURzOB0gJDlH0BT6B0CZwBhkus7WgndYZaUYxrapRN4RLg==","signatures":[{"sig":"MEYCIQC2m9JgtHp5bl5syg71bUFyrWYE7BUuNmA3M0YcXQkTtwIhANQnrbPpY0BWrVi6vxoMYI4kEhhEE24YuRN6/qJ32apM","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118302,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgyA7lCRA9TVsSAnZWagAAcXcP/jdBNxnBJVH+VYBLokXb\nPjDOFfqRICBMqXrKClyhQocmcSnlfqxzo0KIlwSnJzAEZJB2RojP9We+TMGy\nskP7Yp6YT2XpnepbYv6WOLbUtTqnPnGyDWxc+ZfLRkatpzvbVGkP13Arzid+\n88jeuJh02Dgmk9hoqJXUl192AT7FI4nh8dHtPQtry0LOEGuC0+5hG8YsdK9n\na8ELSH6jFzPcQ1aVH2pXVGHmEYUw+pKB9VQynvLtL1GU5DE07DBOW5WU/LvK\n8WVu7fhJaDCN8owGMQw01LQPZ8CBDm9HDZPGffoJpXyYmbxV6c85MnhGCbHC\n3RpziExDzvCg668Y1esRi/dyajW8jenyfx7n6QKOjTDfpSqImsg2U2OwP3iS\nlPIBCHqJ78+1JnUg+tKg1YkolPz+5lCAWPgGNidQfzYmhlWHGbB/+bhTklQs\ni12iGbTenvz/JqnAKWtU4AXISz3Jb0plmvIApVmZZ0+ql0oiKyJt2JaO1bms\nlI4Z9jKLutg+wwvn4TY6+gH0Voe/YJWlQ+Xyi0ueSd/9KomhYLjQ1MRwzn0m\nQsRkda0eZnWk+Mw/KNoR2oukF9Dl3KsiAkDVgEB9pclOCG1Rq4JhfGs3ns8E\nAl6r4nJbjbaVBN8PLfUoDzUTc1tJsiKCy6fn/MK4fnF2iDhDqCqXayDdOJ8x\nHOMG\r\n=al3Z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"171e8253554297ff9e4094223400ff91c72a15b6","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.8","@balena/jellyfish-logger":"^3.0.16","@balena/jellyfish-environment":"^4.2.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.3","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.273-renovate-internal-patch-171e8253554297ff9e4094223400ff91c72a15b6_1623723749116_0.9048127036378033","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.273-renovate-internal-patch-cdbb2aca8a9f420db3489598d460cc1cbe53057b":{"name":"@balena/jellyfish-metrics","version":"1.0.273-renovate-internal-patch-cdbb2aca8a9f420db3489598d460cc1cbe53057b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.273-renovate-internal-patch-cdbb2aca8a9f420db3489598d460cc1cbe53057b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"25e84d32822de0ad0f821556ace34fe875fa1a1e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.273-renovate-internal-patch-cdbb2aca8a9f420db3489598d460cc1cbe53057b.tgz","fileCount":15,"integrity":"sha512-SDkD7GrYXKuB9eIHPbEqRWo7S9EuAvlbsA4rfWNVAJ+oAYN6809utEp3e4TOgDdBNwBKZge3ZWCoW/BhYU5XZQ==","signatures":[{"sig":"MEUCICltrKvF7uqX9UJKUZZ+u7DjU6ckcfY45dhDVYJC0bmjAiEA50dvJtZhWvqqAtLtPlyue/XdDc3Cwp9zw9JMYfXrJpU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118270,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgyA/7CRA9TVsSAnZWagAAdawP/1IXEjFhZ4+3yqyJtBP6\nAYWk5ytYMcQx2MbR7nYRa572t0nCtevEIJ3IQIk/heS9IOtS8rPgXJfguqly\nIHykecGIqNRPWv6fnMUOzHqnM8rwlDhk0LYyIUFN1uP0Q1/fvei0PRK9rLAt\n++TkZUXql+eEZpf6RPdLV9Ykmn+VY1GEfaUw1GKYE25UPadTDYyMXZjxPZuW\nW688yrXRHwuwtc9OSvsOXc5Cd1BQ1ZIOOTwWHFa5qwugpk0TiWlRTxN3rgMM\nWAF2i3TkF1CoQY6xT8yAnEONulcFnOyNm6rRn15j5nTtiVuDMu8CL1YtnjDi\n6tKoCAh2nCtgfJ6k6WEoqlK46Iq3Y5YMt8W4Z7rjf8cbaYJ/+DRAsY8EByks\nJc97ejV5L41B2EczGWQL5auQ87KpXA5ucPVEq8e05NBzCICSG35NeWpxEmBZ\nEvOxSPZQKL5dXn3NkrP7ljAEOo6WgxwoRHJ81jWPHNnObm0UHZ5Uj0GdYUrV\n0Y+wDqBxZ9EPkEd1ccgL88ZiwJHPho9kWSK1Fsml27oRNwdikLdunplxrswg\nHZHrhw6pb4PwwP557E9QmxC9NpdmTJCGtjvnRaWYMcm3/9ZHK2BWz+yfvLcF\naPygn0VrYMnNE7JofXq/74SWufgStEXA+y1ypC6OkogOePkL+3k3agb/bH4t\nbW8/\r\n=f09G\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"cdbb2aca8a9f420db3489598d460cc1cbe53057b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.9","@balena/jellyfish-logger":"^3.0.16","@balena/jellyfish-environment":"^4.2.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.3","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.2"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.273-renovate-internal-patch-cdbb2aca8a9f420db3489598d460cc1cbe53057b_1623724027474_0.447891774486465","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.273":{"name":"@balena/jellyfish-metrics","version":"1.0.273","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.273","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"87bd24b0ee037c06d17df1a411a0a0b29878f9e3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.273.tgz","fileCount":15,"integrity":"sha512-hUdE5Xq1ub4CIG4K6O0tuHQHusaS0eezEwaB3YT9sw2M9I80hWTdcCWAQvZh3dz/ZJDtbISmZ/Puq0eOiBQ57A==","signatures":[{"sig":"MEQCIG4bxqYXhP+dRitgbMf3Ozmtk5xkg7+G0ag4EYebmfOpAiBr6y/mAM2bhyuwolOloWBALxlQsN57HvAakfkUmxsonA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118205,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgyBDSCRA9TVsSAnZWagAAqXsP/A17E2eM98eIECCt0ykO\nRluhhzNnJ6QpdOOFhQOAK20l+2LQz/VQykBeMHjWWRsadNH8eqKURZD8QdK7\nAohKcHOawGX0mrn/yhWcPWRlmlQ2bpm8f2bKYCn2j8bQ8GJyb4hFhkOIMgSF\n7+2Wk7KHnL56V0Ae45FBZp6adcOrnHja0x3lOpkBnhDpaevhTUmetFQGLBzs\noGp2yNvv7uNeqQCnAY37dlRj/Dl8fBRLQQAvgXADyugEQ+aXc6FuEm52Rz3w\nZwPbapqpa28pNwblmk2lLZU4dX/rMogyf/+aDH+Wkly5u0X/yIEUDl9xKgx9\nPnNYXsQ4JMFpo5Fv3045RblBNKedszcrCFZpRfZ6p7nFBvT/Hut+23jR1IeT\nzz6moRUYntpNIILr8ywmASODQcd36flZSclUerfM3I828dYgqwNrWsY/LY6J\nmIvnVQLB7NZpG4wCkdpO6TBS/BeAUvPTChI3MPZn1qCTi8fDU9BuWnjN/0OG\nCBGbnhSOM0RfaP4g68utpIlomUc7iKHuwH2OuFMBdqX51eGAL4EQ/4jJuryt\ncsiivDVoDteWPZg13netp0gk+ENKdDWtwu/ZAVqQWZEDi7NqHwyzsoDN9Gm2\n1vRZnidOCGSpwOQxAzF+nEWdsCzbraIUlDkUQIefWnUL0Qrdy+we59gMIG87\noRXD\r\n=KLds\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"20492dd44637e3f62ecf91c045154cc69c10e9be","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.9","@balena/jellyfish-logger":"^3.0.16","@balena/jellyfish-environment":"^4.2.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.3","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.2"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.273_1623724242007_0.265264356749326","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.274-renovate-internal-patch-dc1005bd1cce59e142cb1b5710571fe599a54233":{"name":"@balena/jellyfish-metrics","version":"1.0.274-renovate-internal-patch-dc1005bd1cce59e142cb1b5710571fe599a54233","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.274-renovate-internal-patch-dc1005bd1cce59e142cb1b5710571fe599a54233","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a1d2ff4489e3de89e687f42504c77a521fc28241","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.274-renovate-internal-patch-dc1005bd1cce59e142cb1b5710571fe599a54233.tgz","fileCount":15,"integrity":"sha512-genrGvp+DgGXc+7tgtGvMB7joqvZ4dZj+HboMknvnLQj7Gd22B6PSHrGfqnYH3e4XxVlWOVbxO6jw5qEcEJC9Q==","signatures":[{"sig":"MEYCIQDVzB2/EcbBqbdyyVz+c6yxmtcZB8OqHtQS+gaGOqt63AIhAPjH0ZdFhke4EJO8STvi4gpsjwxfuRm1SgT2yut17OuJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118374,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgyECzCRA9TVsSAnZWagAANSoQAJYn9a/YO/J4wY6RHiRz\nuwkFE6jWAPw9rPtxg79q331T51OKAe8+q34ZWKwAlQAo+671GXhPhYXd0SNF\nuXjDcrYOPZpV1X0tjpqG2tThK/XxGBVmNrqOIP9TXUoB/vkoFN8JAfIjAnjf\nscGfuFT75p9Zn9DdbquNbNMexWXujDDzXxwbRkJyhgGA7LFRgJTsqhH5CXeG\nk6RbuHM7b1YFIs85ZUbAjEIgY5XTDiW022awKJ7jHmelZHzoUF4tLaM07Ylk\nKmH+/EaOZLzeTFAkmsyvq3YlIfTjphRYEJ59yWLs2qFTD9eTq8YwaTQtqM+N\ni9+wxc2E50fQ6lOGxwBVBKGf5DWNXcsppq25IBEY4bq2QRreumFXBTxVxjF5\nGCuXe2O7yeiQqlleIX3hLu0UUEAVX42qKM1Fz9FbTsrgpp1SggiHXNj6aoNu\nt+OaKBYhhTG6hty/+c+pZ1eBZ2olPSqXFjGcGB7FhPJmSDNwuH/IfdPzsq2x\nNTi9EJCkOG5tNmlvPTbU42/Vp2VpZjD73WcUFiCxqRXZNew26PaCH9oCwgfF\nsFT2vQDcnJdr3W4KUCQ3OaSCsdUkF2y6CXGFkmuVUhK7IkHTJItt0vOdwxhq\nSgUxD+yjvJtHDFe8r1QzlRCMJSliRFod4QHnfpkwG5GKJWlotMIJzbY8HUkL\nDmw3\r\n=5uUG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"dc1005bd1cce59e142cb1b5710571fe599a54233","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.9","@balena/jellyfish-logger":"^3.0.17","@balena/jellyfish-environment":"^4.2.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.3","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.2"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.274-renovate-internal-patch-dc1005bd1cce59e142cb1b5710571fe599a54233_1623736499779_0.148543651055828","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.274":{"name":"@balena/jellyfish-metrics","version":"1.0.274","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.274","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9d176a894125b1d15d0ee0574c99cf2929585976","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.274.tgz","fileCount":15,"integrity":"sha512-d0hmyd7wxhBsWvlcMpCsfGekhYqZCM/kzgWdKbl6dEmI0X4k8MKxprENjKRw9/PsOO3K5Kt4c/8e1kRr01IOTQ==","signatures":[{"sig":"MEQCIAx7zBkhiaOyouZUXt+UlODVmLJJ0EclGl2NX3P2PswHAiAoxg84cEOuZZ6wbQWpLP/2KTb+j7XufQF0A8Z4J5XtgA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118309,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgyEGaCRA9TVsSAnZWagAAjpgP/2uCLI4+lS3A2JfAbEIi\nBlHDhpCutNUyd7dAX6GGTOR9T8W0mQVUWcSNiqMhgu+kiEkFVXwS/zn4w580\nZZf1SMSYJTn6MoAGmQA9VZbjy2BTiP077G7hxkb9tDAGVUiaYZPRdlcdO4MI\nz0GaIeSlzPIl9TRYbVNe4QLn33Iffa6Dt2TtcjfTlkzj0zhfbbIurhZklCkf\nfZwCwTO+qbKc9rPBm/FKaRVtlTGl1K5JTXXYoVB+KAS/ybiwKFmT5m3ISfVv\nssYokH1BdNaA4iq25CZk5DLVf2Pr+zU2VyBtBXzYSiTGQHpRZsfFDQcDDfKA\nkWAdybSaIzDX3ZgImSiofq5pvQ5I2Z6ohtmN8qxCEYPb2PifAFOP4Fsh02UH\nMSFbC5iN7xsdAliCPo2tF3yX9MLALOwbl7oYPy9/y4yvkPYDxFuD8uDj0+W9\nrv22EnzjxNQUgEJCD6Aem0h0Ut1OQtIJk2QxAdZ4XcJfJ1DzKxz480yrj4TS\nvqwu8S6XGXubMen//KbpusJ3LP+F7in3Runr5FqIxi4O197Y6eXEa9xNkc31\n4v9asJ16dmZMgf7RphXvh6aQvxeizxPMsbrGBTvNQUsDZHpX1684C+EWvaCA\nl7HuD/LBO1pTYetImFgUoxKI7jx910v34N3azAksCLPIBUW76cdasEuTl236\nq74W\r\n=BQPd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ce9789f5c52c2103090544bb74b2019d4574df18","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.9","@balena/jellyfish-logger":"^3.0.17","@balena/jellyfish-environment":"^4.2.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.3","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.2"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.274_1623736730423_0.4426289731011621","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.275-renovate-internal-patch-5da934bcb57aa2cb2c267f031bc95440076bc0a9":{"name":"@balena/jellyfish-metrics","version":"1.0.275-renovate-internal-patch-5da934bcb57aa2cb2c267f031bc95440076bc0a9","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.275-renovate-internal-patch-5da934bcb57aa2cb2c267f031bc95440076bc0a9","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7b953cefd3ac53afa74f9d7ee73187c072a6a527","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.275-renovate-internal-patch-5da934bcb57aa2cb2c267f031bc95440076bc0a9.tgz","fileCount":15,"integrity":"sha512-ftHtrPSPpZA7IcqybaK/B7DstYLr7cjOKizxoLQr7Mq8aHLm6Z9nX9WPvK9Ynai376dBf6eB9oVfzv4nU9Xhbw==","signatures":[{"sig":"MEQCIHUR2Eq8artHSuNdsU6dVhC+Oka/i1tTMxaNrw3NrKU+AiA8gLgP/sskbyM/BHj8jcV91yEZnHPs8w99Ouer4Pej7g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118478,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgzVKBCRA9TVsSAnZWagAA05wQAIGl6YsmtkBhmG2WWmFj\nWeT04zbx/DiZrBfYDUA0O13+7sxMj0hrcZ5j+JeyNlu2H9pknTiHRzqnu+fV\n7vgP5oRDuCHiF85d407flEHMTDDTFy6oIQ2PO3fu8SRMBz+Wt8H1xenu8k2n\nmdmnd5Ml6WGybl2U8VvrVX4ZhQoBnH015eaU3jVXg+dCCq5lodWDUvXyTZGS\nxv8pxT9S7kVYqm4NAVXQU2DZ16KQbjGRNsZrylJsjrm3pqGM39+k08EakaWF\nwxpy5p03+uJ/f3Vk0QbbiKyDp3Ewq0asGaWR0OaMASmDd4tb7cqmqVFLLk5J\ndJEVroX8J4EtUDN7dlniB85x7ncT2JYl2ZKI9kSY64lIrIFkLt/wanA46m2W\n0ILAFrN4T57qBvUqsS0LSEDQ2iX02LMvo5Rwzx1wS7PvqnMqgh8HTQ0ZW/up\ngGTGA/u8Vw+wyV358W3gI9kyFck5VVjIWBhxDMZ6oL0BYJ0ruchKK+3mWJuT\n0Hu/V/QQ8qAGV95iLMEXnsLmLDS++Qd69PPMQ3Z0M7v90+wlcW/ZGdLkc6GC\n+fBecF1qrCeBj8mdKZ2nZG/GrVvJ84BIHZu9U3eaCIIkY4Sc6NQVOvIlXIYU\nLeXuko0px5s7IksrNw3TopsBHdXGpqSw1DrC+ostU01+eN9yuHcTbOQyvfgj\nQBba\r\n=E+s1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5da934bcb57aa2cb2c267f031bc95440076bc0a9","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.10","@balena/jellyfish-logger":"^3.0.17","@balena/jellyfish-environment":"^4.2.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.3","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.2"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.275-renovate-internal-patch-5da934bcb57aa2cb2c267f031bc95440076bc0a9_1624068737528_0.45862300966251635","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.275":{"name":"@balena/jellyfish-metrics","version":"1.0.275","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.275","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7ae945a3c2c4ef0247981a4795681fc07b814f42","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.275.tgz","fileCount":15,"integrity":"sha512-vwoAHsMPxA4NVnuSqOXmCLkwGt2gZiXQWw92Bb0Sw4he5qtSwdbXjCT2E/z614bjeSVnWCecuPMIGz3RRBkEdg==","signatures":[{"sig":"MEUCIQDO1e6DegQ835t5Y7iatUC+h9VxvzOmAJJ/CDRsk60AGwIgcanRhqoh+cafS7qvoUi/csguGM2wQmgsE0Zj9499evk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgzVNXCRA9TVsSAnZWagAAx8AP/imC+HFq7LDUlhBqymWn\nHKz1phu//VkvDWqvS/h4S5B5vuU4+gzmzjQp3QEDeHGSSFu32HVMuS1Ze3k9\n+ohC+pgXb67D7dgi95ix8XTTcbNRr2MM1+sGEXL6AusJZIJlFzaeTWVCxh4D\n+HpBg98Uv3/6/4RGYHnsvM+1rdnDumB9/jQgeEQ6VFsnmvqS5yAsUT3GL4+z\nmw5Ii504CNGo1WiJbvuiZCAdjkglUefoaB7VDLMYh5GB1IYo1kg7HaSFrQ2g\njzKhHH1yTP96GAIESGSrRsyF4xKh4optOOuaTRL0rtLeK0hBLp9ZYKtYEnwR\nR27BDNaaxEvbuVKtw6n1qAlm5+aUC3iIqMhzh9WSYgN2tt3a/fIQC4nTwAoP\nU109tbqAK8pr8vPu7jO+LbqlLNVOG7fqBMiOVRQfLKOU1pri4LhrAKFnl1Up\n0MaztwgTFQk8twk3+F9A+PXXwwCiKfOUouAzNX8p7gOnxj0qiQhZo0C0PmAh\nxWNcA4KFtuuMk0/Cr6AeKVzbk7SpMlmMHu0ls/lTYordtVqEm3Uu1kojsRAe\n7e2Ny24lQ+HFZJo54ABcZAys0sdTmsbdPr++6IfOE7npSz+Ad2530CFkdnFT\nr/9RXq5Jxmjjm81HN+sjDXSxijO6V/rBRAE8CeaSJCBpkcXE4WRnk4X8jYra\nt7Q0\r\n=q84/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ab188e6760d4ed80961e6e773297ef64f3d9cb89","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.10","@balena/jellyfish-logger":"^3.0.17","@balena/jellyfish-environment":"^4.2.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.3","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.2"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.275_1624068951453_0.9769002500290134","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.276-renovate-internal-patch-6abc2b5d483bdb6fb39adb4398893eaefc04b58e":{"name":"@balena/jellyfish-metrics","version":"1.0.276-renovate-internal-patch-6abc2b5d483bdb6fb39adb4398893eaefc04b58e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.276-renovate-internal-patch-6abc2b5d483bdb6fb39adb4398893eaefc04b58e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9f5a11810e18b17537341c0a1b65b03d689e809a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.276-renovate-internal-patch-6abc2b5d483bdb6fb39adb4398893eaefc04b58e.tgz","fileCount":15,"integrity":"sha512-SlmOAC65GDtWqIARFFKJ+VHkuSlm9cCnnMXvCO0RFtb3VSWyXSpr14krnlTG0nF1F9Zwgqlu1MwiZ/H2wdoJ/A==","signatures":[{"sig":"MEUCIQDhFpDAt33JxAKT3c7K9t7J8zn9islWt5ez87nNcftN/wIgMc4jlgygqQn9rY9+hn1Ub0bIuevLjyW6Cs77rLZe59k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118550,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgzcSMCRA9TVsSAnZWagAAMaUP/1ANTY4cLqofIIvGkzqd\nr5PWgV1enYTjP99pk6kApF22ZcTVNi4yiUFr5goky+bMz4Sr3W5L3AyzbanN\nG3QL03zF+TZDuWezYj7+tOHCxhzg3U623VmHB4FM+7q7+DIN+WZ0R/9gMzgI\nPWE6VoZwhLnwn5tsMdd6HjPDqlGSlcW35MLha4JlmnUc0LLW/JvtL3aLhUyF\nHunlJUZi2F3aNPm9TRcNb8KU4h30jyIL6wYDDgJm9FbCqgftcwPuayzpJ/bH\ngYHyI70RKzDCL+B0P0pZBfbqC55pP2id1uDdMwRqcnGAPcVRuXAL8JWsalf7\nt5NDe3VhU5PyQq20IwGz5JBfNGBC4E/sNPuvcjVnbxCFdMUe0bPCvQPSOz21\nmx0hxEQwsTx4taA8F1BmYemuRmcszOXD205kmP+wpCOSQqARiTJpBp2bTVy2\nqrXoZsceCLN60BVYCE3UuE3vlW8izDpHivTLHuXxvrvUpUc5o4V5vwsyUcjn\nrng5DGwmOJyrUHbHJyP1XWiBaMikYxaNAqcwrs9AJSfFyUDU1BxauveYQPYg\nR1+W/B+OYTGuJg5xIeCSPcAs9r1Nu3rNoGir1OsI20M8Zs4Q5x4LG0T+TwgQ\nzwPm1L18tUG1dVokYtzRVlsz450ddZZltpZnPp9b5XR9J5LgvAqcbA653sJx\nZbtF\r\n=LJln\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6abc2b5d483bdb6fb39adb4398893eaefc04b58e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.10","@balena/jellyfish-logger":"^3.0.18","@balena/jellyfish-environment":"^4.2.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.3","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.2"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.276-renovate-internal-patch-6abc2b5d483bdb6fb39adb4398893eaefc04b58e_1624097931499_0.7741968283939014","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.276":{"name":"@balena/jellyfish-metrics","version":"1.0.276","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.276","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"dbd2fb6240cf1fb042110791777cb383e24de881","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.276.tgz","fileCount":15,"integrity":"sha512-ftMZa9wreyeMeYIdhJ8JU7Hl4KZzZUB5hyvlMFK42RQw0JJIntRCbYBfaSviwrBodSgtV9ITAYoV3c7Dy6019w==","signatures":[{"sig":"MEQCICBEeOvBNgD97PA1H+eVVx5RshN3AwqNBvai537whzEeAiBbq4xwppI3jTfP9571TXfFHak+X8QqjhO9mrqj28zE7g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118485,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgzcVdCRA9TVsSAnZWagAAnlYP/2PsylOZwfKk3fQiE94Y\nhclcU0oDORqhExLtZYFjJuJjkm30+nPDQw/a61cvAITeAD0SpTYTiQx78gxW\n41rusSl+eWnx+SFFjrFgyG3XZ7S7+aJ7xfpx67CXIwtytLILxHkehz2OQjNx\nQZyXtkMiydWkV9yew84FYEkedjBWlDZydsT5pQAZBd8p66Ob3CuPOB3L4Z0R\nFThbH3PrHSvIYI7Y0xGiIWuP/W5/bqXK0HpiW1WYcj9wlj1QN7gGr3gLuUz8\nPzLBCVftHSNd+oOcmgZlepx9atB9Ys6g11SlcWumaZ4C71tthLCLkx86kpwf\nzI0a29q7Dgln+0WwxyQNLiwAFlfLc8BGm1tX8QrLSgQKoCBGCXsv7L/C6xer\nilQp3Kiu28Sa6FtDcxAvt9ou8thKcnWIwKeT7IO+7Mnxwglrg6XGdXqH3+ca\nowaIWVOd+5cFhK/LYSELREMPJUJ0RnUCkukpd3NTA8XAAz7pOafgen3r2dpK\nYZDQsoavf2i6tKtJzK6GZGK9vvQHsKnZy0VP/Ie//ow1EHgJEILu2T/Rd8hB\nQl9UFMOhuz2EUhClofBZAM5LrT/3Gx2RtTlaFI0X/gPMRjmjwvy8UElLWZds\nghn1Wc2UWYR3EsAiLXnn9hzrHI+QzoRUkIXmtWai+IIVy2FCbUajvK9oQDNu\nJdnX\r\n=ahfU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7886f534d119cc4c1533a106aab179408aac7f1c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.10","@balena/jellyfish-logger":"^3.0.18","@balena/jellyfish-environment":"^4.2.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.3","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.2"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.276_1624098140868_0.06756295290644543","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.277-renovate-internal-patch-5db901e82bb122a064c8aa44d58173e2a01cbb38":{"name":"@balena/jellyfish-metrics","version":"1.0.277-renovate-internal-patch-5db901e82bb122a064c8aa44d58173e2a01cbb38","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.277-renovate-internal-patch-5db901e82bb122a064c8aa44d58173e2a01cbb38","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a59fa86da7a67763b805b547be9f1d82a748e8e6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.277-renovate-internal-patch-5db901e82bb122a064c8aa44d58173e2a01cbb38.tgz","fileCount":15,"integrity":"sha512-9CYEFOoZAX0HlSc0WqX3iZ11TFjM2YJz8bVHIgcrzV+OuDOJFwAURHZEpA9DXYZRg+niuJNYHIwb95P85o8xRg==","signatures":[{"sig":"MEYCIQD9SBDBLftZC9wHVJmPAnNcHsZf3U7GmUllXgUSmqbC8QIhAOQKIxD55Vvtf5hGGd6kzfjPLxzvPzJBXu4IOP9x3anG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118654,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgzdYaCRA9TVsSAnZWagAA1q8P+wYjBB5RGfrN94uyYfda\na/ZTl798y63akCEh5vu9gfC1e3IeU+VoeJieJ4QdFdvcrZS6P395g4dAnCij\nQmizZXqhBIQqu2tV+4EEm4w6Gc1FZPiNF0NFySH2jf9B0yGv4RaSomecGVk5\njc63mDMYMYW2oRkNpXhsuqTKhvJJPeLe/Mww6LfwCUVOdvska/6u+6AsPGt+\nnnSC4S8p1ea6Ui07DnPHAlyt2p0NpA84OFaE5Mt2vuAVEls44BNHXbKn2Sww\ncz+ey7sOWK5sSVWcWjqWMNYisGADcM/ytIm6e6O2eI3bwekZ0K65VPmYso7v\nVlF+Sr5s/QyBGkelGZs9ZgSQG4XM7xwz12585AND4doiGVsRIesNMbKYRzIu\nmiUzLvbVA6XFkbpk3o9G5SYtycVl9yDyYidb7G71o2mf5/FkdlYH9Asb49jR\n2ISjpKUYaPlu7REQ/DwzMdf5LrATcSfvuISQD/TjPFOHWQUNqTs2iBxrGybw\nJ2hy1sdj54vWxakbpkEqReYAaBfzQvUFw5OmYw71MV+BpCI4mkfcW4NTWo7Q\nc5EXMrblTfDN5Kn14IQ3BP6ELD5Xhq7IrzoY/tBn+fGTOXiXtGDegvTjUnh4\ncBf5dOwGTWv64uczYEtW/L4Dr1K5IsA+PnE2mdkys1IUlWvao9Q2Zw0r50TB\nUsJI\r\n=MxYo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5db901e82bb122a064c8aa44d58173e2a01cbb38","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.10","@balena/jellyfish-logger":"^3.0.19","@balena/jellyfish-environment":"^4.2.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.3","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.2"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.277-renovate-internal-patch-5db901e82bb122a064c8aa44d58173e2a01cbb38_1624102426095_0.6670908327658895","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.277":{"name":"@balena/jellyfish-metrics","version":"1.0.277","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.277","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"febcbddefcd5161bcbc17eeec557d8df87c57e43","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.277.tgz","fileCount":15,"integrity":"sha512-yMw2PF7122nlctSrZ+p6JzOGpsizBbe/GQcRvoQaI38C5lLR8vgAZ9QwR7B/+MaC23vVTCP4yYsAy0v31HWHXQ==","signatures":[{"sig":"MEUCIQCwGvxmmkhvpM+ORxGiMiYghKWeD+z4xIaSAt9SThvKYwIgEi2fsVJtSKQ6GQKyb9Z0ZnrdM2hmhjuG8TD22+Ycma8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118589,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgzdcLCRA9TVsSAnZWagAA82kP/3BXsFrhuecCtWOwGhkw\nXg0yACc7ibrKOL2IAmjOQTTKUITsY5S/g1x7PXCJ+d/iqwhApSdKGTmRjKb2\nB5vhnqD2ZoO67k8n+z8a4Liw1rqqTe0qH8WMsLbmabAtSbEI8pJD3sxgG4ky\nxIWXXMzgYEHiFR/IKpp7pidf7u4RbRVSmGniqz2hsSCwroyzstNvuD2PHC+6\nIGg4wgz1ufWrGTDTI8NraW0eG+LqQVZCsSMq64E2IAQOvqocGtz5FbzBC4tE\nFkPe7vJypRPP4ZGZy10lv6Wp6NsojpQWA68+Es9shfUlQl8q1az8sTRLx8Hq\nBLKNN5k/5hd8IPX9YdAtZMYh3005GitNB/Yz3r4lujREpTN+Yq+5OTLt1XS7\nPY+9vz6NMcr1d2YIR1lJQGA4Od811TYkkfLkRmfUkJc0P4WzyCdnl9gcawKX\n0+loYf5GkIkMVMNCJZWQi0YLRf6tbNtj31Jc6yv2dQJTFgqD8t136pMIY8Kn\neZl+pRyTkupE+GIIIQNlGInQsUtgex2lwtmOjPkI5i8L4ecTTMs5hl9hpGbK\nNB65hS0Y2L2NdE7GsElvJZsZDTuZCw7fVu7gijqjpkIXdhoJ9e6T3zzismue\nRZzq1W8bd3Ybxb3DUONPTBR8ecLiU4Ado4B8DcpxbsjmMvBv3VemHDPWFf/+\nUTyL\r\n=R83V\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c8e9cd1dcae2a08e72c0d42dcc4c6204c0b9b129","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.10","@balena/jellyfish-logger":"^3.0.19","@balena/jellyfish-environment":"^4.2.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.2","@types/jest":"^26.0.23","@types/node":"^14.17.3","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.2"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.277_1624102666627_0.003041473817956719","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.278-bump-typescript-8b5523923eba1e3a639f333110be6f6b2d1293ec":{"name":"@balena/jellyfish-metrics","version":"1.0.278-bump-typescript-8b5523923eba1e3a639f333110be6f6b2d1293ec","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.278-bump-typescript-8b5523923eba1e3a639f333110be6f6b2d1293ec","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"af6117890d862b0d08953fa543db76662b04e3ab","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.278-bump-typescript-8b5523923eba1e3a639f333110be6f6b2d1293ec.tgz","fileCount":15,"integrity":"sha512-V0BKfR73imGGV/6XHf2poMr7F2YJD/6atLjua3sjpCKHik3OsHozfj07K+vD0rtKQxcaAFDP5iFVxiu1KzYwOA==","signatures":[{"sig":"MEUCIQCULqoylGwFWmhlQa27b4XDP1mt/aSa8rh172RD+92iIAIgeqs72ZNiGuGGiZwUPHjXAUOur3lrvycE+I6sHtuTF0w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118715,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgzezECRA9TVsSAnZWagAAsN4P/1a7Wl80XspR3Y6imhC4\nC8xR/MgZoQaNI2wKTtZINzfrRPZrXc0BSGA2UARbeBYmiktOCz0DyyefGDhT\n8HoCBfKguczykqsUi9W26N7Pm8zsqeiSwGf3TxUSh2rZt6MOyMwXyOMQicnb\ndOMEBuLb2VdgcCJmWqas3e1Ivf02vqxRnAuZYA5EqvWq+sYwcFSIEHxM3zfC\nV0CO/UBqHWDIAYQpqPRg3hqk+iq9dtCZfdtxngbzI9k+EIxGeMJ55/Y0HK4f\nSBLvxaaJZ51F67UlgGz1qX4dH1ia4CPy03mszdBIJIMsk8VBiQB9k1rzUhpx\n6E6G7al3n+ze7Tc/77kyLgy2sJ4wBbfEptC4WfTRZqaWqOuz2178gUrLozV3\nDnmaLLstnvq7VeEdAJkVmMouV74Gf7BIuyvV3RQI2dKf4iPNoWRh6UnEGuYj\njJ4oENpsXz88HtkI/6iJB2VWpXnHNzrlrNcWrgM0bOgMpe3SSbG0DGf3HEGL\ne1V9Q0+fnzQQVKrb+eIojLyCzA6U2DBR4FHHK6ElAbnEAcnJeyZ2vTQ98PMc\na3W+i1xsE4f0vmfalMeokSw2YnUHIKZMH4NyU9r+dSuZalsAma7ZyIcL217e\nh/fhn/FZFIT9dHsSU6y7Ht2WJXR7ZaWLgTI3uef9Pt9a8HN3CaYKSk9jnVVB\niLp7\r\n=fQ2v\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8b5523923eba1e3a639f333110be6f6b2d1293ec","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.10","@balena/jellyfish-logger":"^3.0.19","@balena/jellyfish-environment":"^4.2.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.3","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.2"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.278-bump-typescript-8b5523923eba1e3a639f333110be6f6b2d1293ec_1624108227646_0.5189839023384046","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.278":{"name":"@balena/jellyfish-metrics","version":"1.0.278","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.278","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"85698d96535733fad502d8f53c9945cdf74b2f60","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.278.tgz","fileCount":15,"integrity":"sha512-FIrBh9s7TV+rPBzmgLijXShe3oAM/hvElijhPihrjgUwIDyWJfqropqC58PAJUxK0gqena85aqROcQhrx9iUbQ==","signatures":[{"sig":"MEYCIQCxb7c9WTKLWMkJnQHNUc1EUr+5wRmLLrFBAU52QiAmWQIhAK013iJqRExy3NXF3xVjP1ZLxdnRzsX+pSheGZl+vxCG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118658,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgze3HCRA9TVsSAnZWagAAp60P/jCsWMYZCPyWk7G3VeVn\nYH/M5wT4iG6wTX4x0OnX294c9nlYfpoTYO1J8h9babCEfkw2MDR7oCHXTcTg\nR+A1HnR1HCEfBFAGZhqkPBX46Cg0b8kTtvEeZUsTWR7F4pDDyxJHYIOqToVf\n65wv9xQy1p1EaTbOTECcCdmKPBHhKwktGCC18T4lyjxnGGUq889ICO3F3st3\nms15CGH3eZLeTPbcoJtB9ImYhA0tvVQZtS13ahbzZKWUCPMAm5ZSWZObxKdE\n06ONi/5/v5wR4Zl0AQTScn9kYrT318+utqxQaxB5uiF9hgKhAT4/5tbvu27o\nFHINc5yXZhrvMxdw6+jYmIr6M0mkgk+oKr+kd1OpDUh6zSfisupWcYqx1nl+\ndv+pCijaWvf7QIiEeDssNowveO3iPW4BM9i5hZGt1n19IWxYJtFFnJypogdn\nVuAdYrcpP1Z59puWbMKmNrQabqkdEivoeKO14Yl+W5dGkNwuc1CzHGiSL6ut\nl/xjqoBUg8hcj5ZDIasZU5CAzyOibpQEzvD6DCEClM1SyLTKXsNXRQg46to4\nMPbVKvUw3PVeqYWS+iPNw8PrPbavuje0MKU8+M8Tgrk3oJKnMkFhAwyPWLdp\n2+j2Obrno9keVVDqIt+irAFbjZQc/Fp5VH7MF9e7KwKCgVGDLnEMXn9HEtE/\np5od\r\n=U8cT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"dbc311a5546cfdc3a607a3aea352d7f3dd70618b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.10","@balena/jellyfish-logger":"^3.0.19","@balena/jellyfish-environment":"^4.2.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.3","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.2"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.278_1624108487008_0.9090422041483639","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.279-renovate-internal-patch-bee6a1bdbe75ed4c435d5fc82f096236fe091e2d":{"name":"@balena/jellyfish-metrics","version":"1.0.279-renovate-internal-patch-bee6a1bdbe75ed4c435d5fc82f096236fe091e2d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.279-renovate-internal-patch-bee6a1bdbe75ed4c435d5fc82f096236fe091e2d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bf8dde7c2e800fe0dc783554ba52490aed626d7b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.279-renovate-internal-patch-bee6a1bdbe75ed4c435d5fc82f096236fe091e2d.tgz","fileCount":15,"integrity":"sha512-xMqynVN6YA1go78/5p/rtRyx+C5aX6A3Eu2MCEaESLki1CdHv+u7UY3i0ujwFqSvhJJJ9/MG4ZllFW3ixL3j7w==","signatures":[{"sig":"MEQCIHuq+Ys8VNqasC00hdDAUxbWFi7FWVw72XVj/yB4iGhvAiBAcaW7ThqwvNGN5WfVu9fK1uW9+sUD6s0mONetTML1ow==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118827,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgz1okCRA9TVsSAnZWagAA4AEP/RpwcpjxjNebj0mZLbDY\nQ9lULb3U4A2skYxlGPtnPgT5gnX0XAV5pOIn+TqamRbOgxhUd1Lsp2tjWk2N\nrp69kR3++oVIY962IGlHwLgclLbij9slHYiU2+AAcomFmSyO/wVaofEV0Jer\npuy+UPTf+ySdPa7HeLl9c5ngAQwhmoQF5J0VAOz4I9JqALj1um+GNpC0d9FA\nYvuPLijNDntIYwM/S6QjC9kBXQlNkP+WJ2XmWmjRr0pGr8gr2AmmGn1DDD/m\n9KlSKA18BH7JjgS6s9epxPasTACgTddgdROEmFXAP4VbIEUtZWWnGTR7cV4h\nI/xZmLBZakurwDgswFRhLlkbUbFPdneI3oTY/nD+NDREXbF7PXdzT4BBtPvv\noGSKN6cB6WIMbYrEeRqt8YjWBJvYhdJKNDi99cy2OFAM71N5c5cCTnkWhAYb\nQZnhka7jehzwsKxz2boWQrh6gCP3S+TkDk5tx30u6wAA7HtibkF24FMIsnpQ\n+c6CaR1QhYhOQs5RMg7Tl0i077pVWRAmi0p3Vp08jVrKFEtE2hvCiub0/bcq\nI1uSaky0WTilfPM++KW6xhc2gCle3Vc+zhz5sSY/sCbuHKVCoMxm0kKwcU5L\n5eOx7OiLmFWQ7xcgouknz0T4sUBkzWbGxufDjfCGEqx50Df3QNBnCBvI2jjC\nFmBs\r\n=KZbj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"bee6a1bdbe75ed4c435d5fc82f096236fe091e2d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.10","@balena/jellyfish-logger":"^3.0.20","@balena/jellyfish-environment":"^4.2.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.3","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.2"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.279-renovate-internal-patch-bee6a1bdbe75ed4c435d5fc82f096236fe091e2d_1624201763968_0.6921073054564733","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.279":{"name":"@balena/jellyfish-metrics","version":"1.0.279","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.279","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b97bd0fda57c661ff88e42fe565f54571c24927b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.279.tgz","fileCount":15,"integrity":"sha512-Ca2PWho62X+/+Hhko8GXmN0ESAMzktIssFCA19KpAQp2roEEr/1IyticNeZHejJv7+nWpWa0PVBunAFpW5gG+A==","signatures":[{"sig":"MEQCIEfvSrJhytMtiu5yRKOlncXpXymCQwcvx3T2bxu983OKAiBbuoknmWdEPX0e2CN13psLU1ewc4Xd7zYozReSBESZqw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118762,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgz1rqCRA9TVsSAnZWagAAnhcP/1OHbNtU1PsLnO2eCTuk\nbfvUfWnXCz49Tn7jbXnNfF7hxtCK9RohcVqaM+Id+/xmvSsG1d/QIPxoxZAN\nsLORNNsp21QIvWg5CsuirRGOK+pxXHpYwCACxpn3Wzt94++RYzfPTpjyKqL/\nrW6sT2r/0AtMy7frpm0cCC/KrH1wmQfhWd7kT/t5+B4KzQW14RHxPa1Czz/O\nT2Hdhnx1aCknJljXHIFAt3n2c051Mbz7G9TNpjSjN3jqUl+JoKl+Xx+bb2Si\n3nW9yquAY2KrypSPR3A7xY/we8HZ/93H40kKx96PrgfYL5ABYbfOaqivpFzt\nH+Z/EmzFAWppys2YfLsmlYqDMDWoDj4W3Zn7KMLygOuXRrS55P7yOej9oD/Q\n6KX9gAjuTYzH7zYVuVqcxUmPtgXkyjIQe1Zev2INDXLabIHgoh/CiYvQCaJI\nesfiRFyL1AqboOL8gt8a/KOHA3YkqOigOkJC2MeiVUpjEhpTwvo9SOuoMyFJ\nUUZIB2dCx7sqXxgJGME7bOjBObfum+KDoyQM4iiSWxm5L5ibNJZwSrcAhQqs\nk3s/aTmTr0LIZULPAEX47KcmBTW8n2ux2Tll6REJnq3ENFpk2PgmrdBNaMbq\nSBsVnJh8s24M2lSywzx+Nvswb6DFVsc5vnjIvjGURfJX/Ord5RQnQvHm7GzZ\nin14\r\n=z9tA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"bcef85ecf0272893d2c6b9123b58aa58a03d87f2","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.10","@balena/jellyfish-logger":"^3.0.20","@balena/jellyfish-environment":"^4.2.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.3","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.2"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.279_1624201961730_0.3884566353781682","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.280-renovate-internal-patch-3c7608c289ddc7f35ecbc0f9b0ec7124bc3ee3ae":{"name":"@balena/jellyfish-metrics","version":"1.0.280-renovate-internal-patch-3c7608c289ddc7f35ecbc0f9b0ec7124bc3ee3ae","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.280-renovate-internal-patch-3c7608c289ddc7f35ecbc0f9b0ec7124bc3ee3ae","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e681b55501327cbe272fa8317a6167f9b1151aba","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.280-renovate-internal-patch-3c7608c289ddc7f35ecbc0f9b0ec7124bc3ee3ae.tgz","fileCount":15,"integrity":"sha512-SnxrbNbHmxA7s0l1oLZuhZTZGCafD8iSpzOne7EonXrklNDpAEl7DW+/uTiXhqwo94nDSAD47TSrY3qXflxiNA==","signatures":[{"sig":"MEQCIAt5G7wle2G+Ul/gi+lm1zjaASRdp7gPjSJQyXMTgXq6AiAooY3r42ag4Uo/AbvA8XsVK7LCHWMihMaRguZEjX38IA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118899,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0ZWACRA9TVsSAnZWagAANOoP/1yG1UezzAcSjgrKUw69\n7xhMSo1UBd4PAXG3ZjDqNwSsfSEm0nma14oHyU2xxHQVMSluJubv2JoaYAfr\nPJg+oA1fqAJva/71zov2ni55goN8i6S4V35k4OSIRUTZ6AXlCNSQP7ol04pm\ngeOOT1UhFMnH8PflTk1P5Xxd9FpC1txKXXUPTH6DiArMdMVvk1j/oZekHUqS\n96BvEElP+AiPGGGUq1i0nWKtgVIgovH2oQQoFqVtVmFin+FiPYLrZRpTqGHU\ntaN8ZqcUZYdf6xDnRmP6q/Hkls5hEB3rugkcHgTGdGN/f6tsLJMljJg902pt\n8KDaOS7ghZgjuiEvJvCSnOofPiACAePzHniHFLjVYBHQBlQYtvOhNkEIbxrM\nUobepu6Xhrx47k/zG37zI4m29RFOlG8kTuci8ZQ2re516Yy8WWGFCtGFgdlv\n+Xp9KPpxmhthpO1YzqvUzgPnN4hcSmDhBOnSVHeNoZG4d+Zx3Gl5PFcqBzDu\nU8we9R91OomKw0biXqxo053iB4BzZ/R46svDjEY7Qlp0pxRD8We3yvyZDXjY\n1eZ1qWP+kPPu1fecOiICeTRiJl5I5jgl94DVx2RvXpltTTs4+5CpXSJ0ADcO\neQ0QNX3aI35NvSjsPOesPBTeyv7TMJ7a6828LcKmzGETRMZMs6rgQh3OVuvt\nyNUi\r\n=Kdb4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3c7608c289ddc7f35ecbc0f9b0ec7124bc3ee3ae","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.10","@balena/jellyfish-logger":"^3.0.22","@balena/jellyfish-environment":"^4.2.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.3","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.3"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.280-renovate-internal-patch-3c7608c289ddc7f35ecbc0f9b0ec7124bc3ee3ae_1624348031559_0.042103400568179516","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.280":{"name":"@balena/jellyfish-metrics","version":"1.0.280","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.280","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a17054303e4faf0893c6b106ffe5644137e6508f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.280.tgz","fileCount":15,"integrity":"sha512-xH3BhJ7JCzkFLe70W8D2EBxuHZyVN1+uxd1pVCfTpvioctro2343NQ6nr0oDzfeT9mpzMdB0LWbyUJ4zg6Egyg==","signatures":[{"sig":"MEQCIHFaawAiGF4hoyvv76cAxmvhJqQzxHcjUY61Rg3z1S4rAiB/pDI6IeOh4PNR2n/tZDT9Qx/Q8NGWM+bKO6Xvv3bMkg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118834,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0ZblCRA9TVsSAnZWagAAGqMP/2W3OK7xszyJyPdFIX3+\nTiecPHm0JsjoQ3JxkjhvfAU/TQhaMYhPyNFHZsoAN8EVpbnkpT00Z/LAz2nA\nGzH5ONWQlxvrbkz6WoRgYQx1cVBONgLu32VFN5qeHXrJ3Tqp2EyJ8qpPZhle\nAoFm3U7vFt1FOvx7QAAI3wOljy7H1iVxPWulS2oGZPWDKy+CiblRzXw5rOQM\n7NOulle79QaZMTSLbJJ3lX3hEzkPR7/cfnep4JUX7Yp9gYBBGF2Bpj6VdI/v\nRgxmT4Hz0o5ZSkpQoxudVoABq3xshGtTaWa7lNzfmTORyspMGIn7HnGjkPMM\nOsY9LNo67l0OpdtjWvrAD4lfUdKgHOJ7myt2Ol91Cktq5arBF0nMZPMvuUUl\nkimjiIrfld+nosJHlL4CYV8paQXjOS6MRAAuCuv8r+ALWrSjnmAX4p0lE5HV\n0uls5epv4qbMeW9QXVl/K4QueQmNe5Ifh9NXmeZ1C2rdctuBmX8l5pZDtJXX\n3tdShb73T8Bso0g7C3+7IHFzvJk5gZm4DsSZ7VgSQatMb1crFx019QeAP/qA\ne2aZKru820b8gcwebktsmeBjkIP9sY7+BRJJSJy40gp3N95DAcaVnahaKqlj\nJDnYiujgajLNH57J2Fy67VkbYzMK1MZ5jqdFfYeAPA1S427klfL7cz/xucMw\nZgPz\r\n=LhJ/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e21e9668c15f5b6b2d82ce112cc4608df789e2a1","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.10","@balena/jellyfish-logger":"^3.0.22","@balena/jellyfish-environment":"^4.2.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.3","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.3"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.280_1624348389156_0.00988807545338477","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.280-renovate-internal-patch-d9cd6e024363647e9b07d3314cc9da4530f8f1ae":{"name":"@balena/jellyfish-metrics","version":"1.0.280-renovate-internal-patch-d9cd6e024363647e9b07d3314cc9da4530f8f1ae","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.280-renovate-internal-patch-d9cd6e024363647e9b07d3314cc9da4530f8f1ae","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d3afd5d2cb5717d3d04f07c7af3d3f51cc87b2f4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.280-renovate-internal-patch-d9cd6e024363647e9b07d3314cc9da4530f8f1ae.tgz","fileCount":15,"integrity":"sha512-VqiV9iZojhhtQwrEZd/7BymPxAv7yvteVUARdauCCchuaiwsvV9fevXL+u9jttk6K/mxx2h7stFARM7Hko+SYQ==","signatures":[{"sig":"MEUCIQCP138ef9PZe+6/CvV1u20wv+sUlVF0ru9r7zdDJIw9cwIgXtQdknWbFtqOj0OI6V6HmptIZ50wOQGNsGUhJy1b6aE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118976,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0ZdnCRA9TVsSAnZWagAAGGgP/0vyR+QxpDSl7vcHQN6v\nVvGUWB6NN4NnqGfqAHblrbVVfDW8Mcm8NIg8O5NI34E6UDoVigeKqSpuOEMy\nXaTcphw7VrJP0swAFgXMddD0GdAdbnO5EBEXHntECF8mf5BAX/HgTR4f6yiy\nwjtBhvFPJz2iy/LAYOgbXfvqIkQ+afz2Nu6xc28PhlGAjKldTNrim3HHphqk\niTWidamX8OGNqKTP8KnZkOA8CghOvEiUZpccYTx+8RL6cAH/8WLSqErY42EH\noPVFkoQwN2X9AoBQfuirDgL/NTZNnq1Zd73mdLaAYlSy5irxlu1sroT0uRTX\nweMAaHb/NHz81ut5r7NjgJY4DpqOOZ2MCdH0xAqQ/PcsW7C0PhBC4cxO/z+X\nyrzlylQ8lZc90ZXPfGaCELZVhGkBjzQrZ7Fe6Y+UpPlu5YiH0JrU/16wusXd\nhBKAlCvjUwxxX52RS04Cgokie3/teePF1cZ663580gpWD70m3Q80z6+RjG35\nF5i93osN3pF9hRGMW/sx4ldh6CsMIhlE5CrfwcH6R8mxzusrrJC7U7FWNgPR\n8LOHQr2fMv0UHhSmOmkfTZDhjBcSyWwchtOX18InZtM8T2zIpLtgnh0zZmsM\n4/GmL+2BMf2P877PFb7l1Twv6YX7wWdcNLWdwUfK3IU10BLWSMIIYrsocKKb\nKf8y\r\n=jw0V\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d9cd6e024363647e9b07d3314cc9da4530f8f1ae","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.11","@balena/jellyfish-logger":"^3.0.22","@balena/jellyfish-environment":"^4.2.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.3","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.3"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.280-renovate-internal-patch-d9cd6e024363647e9b07d3314cc9da4530f8f1ae_1624348519115_0.009601848107414934","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.281-renovate-internal-patch-bda78084457de36c1adf6b922e735416d6da1297":{"name":"@balena/jellyfish-metrics","version":"1.0.281-renovate-internal-patch-bda78084457de36c1adf6b922e735416d6da1297","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.281-renovate-internal-patch-bda78084457de36c1adf6b922e735416d6da1297","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"171af87ec3b463bda413cab62d7b398f379b75bd","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.281-renovate-internal-patch-bda78084457de36c1adf6b922e735416d6da1297.tgz","fileCount":15,"integrity":"sha512-Z0M/6IaXSybwrHNjRm/IjwDU1CDTRH/yuvrYJgmUm01I3hdzaQ1W8vH0Eu3GJwtH1XIiVQ3YonNpTucnbPABig==","signatures":[{"sig":"MEUCIAaY6p0g6g/FMsi/eQmH/aFqnmmoFYYLw2ZUtVe/FyJCAiEAvF3sYwZgEDIQFkGNt+pqxWzDMDw8x3vJV1Xlby7CSbs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0ZhkCRA9TVsSAnZWagAAFRcP+QDC4qem10iO7kQEZIHB\npjB5lqE32KwxWQ8zC4IM2+nqPDPn+NWpo/QElpxdu7ObHX+eOL/5eRfv6Bg+\nYgZcae4B5knste1FjCwbY89aQJAVT4a0CJ4R//ASIyXTkxyS4Ob6+PALi+0j\nTXEGLvVPf4bMN2YGFvjnSnttGknMbsdI6SaHnTw8WuOhsop6QuKI+1Jb0YnY\n0YvS6TCjv8muNJRUJbh51+Efcs2S9fsisuB3PYgRpQBFEiE+nB25TRFHhzHO\nB1mLPn39xcPSpQqEqJ6h1g0vlP6oH2V4n3VxWrsxMAKc/fxJjWfW+vW5ThQ2\nFscbWOtQRUXGyGsHXVrd4047ULO5NRQxgg1wRyeILHJnolxxEOnvAy28UjzM\nnSU1TxPFRIpL783MKuT8XJQYpz5WSwA6ON1VdDay8JmkKFHRsmo8jyucpWOX\n0aCbI5YBPgGjdqqsgfHNgp40A06BG2GDO70FV6kOmPJheO+P2Gz9kKAWu8d+\nxfgXbP6XD4XoMLRAObEn4nhBO66T9SBU9Hc84QPSn3CmFe4K1Rs+8tRMNq90\nwkGcFRNoyMSO+4dj5xv3xOpfKGN8RM3qICRi6Y4edkEAKJCS84n42F9Qjk1A\nDS8DNs2HyJudsQIcztzi4V2DcFODhsGtFZwBC23leadzsvrXnbNOA5rI1ghG\n9SHM\r\n=hvMF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"bda78084457de36c1adf6b922e735416d6da1297","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.11","@balena/jellyfish-logger":"^3.0.22","@balena/jellyfish-environment":"^4.2.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.3","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.3"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.281-renovate-internal-patch-bda78084457de36c1adf6b922e735416d6da1297_1624348772301_0.39064844743408256","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.281":{"name":"@balena/jellyfish-metrics","version":"1.0.281","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.281","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"358ffb4c1670efa9b10b40c910c2626cd5cd2648","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.281.tgz","fileCount":15,"integrity":"sha512-3rDEbkYQ4P07bHNOoA9+vx76+vrYUzUI6D2OTc7GhBw8h9av/gB4CKfupPeETfP20TKyBTp593jXbv55q3eJsA==","signatures":[{"sig":"MEQCIEA2lDMQUkrv3PUqrce76+rxrUuV96ZT/J0GKFWMfv7SAiBZNmOusRRWTuBJ7KhsuVyK36leTNH1X08JggAmnKvqhg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118937,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0ZlgCRA9TVsSAnZWagAA5tUP/j9zsqjbOWIgP+CsxAq9\nyPkNCywewfaRhY8EPTmC36okvngbQjL0cg5beomWyvss41oms7D5Nv/iz084\nUpLI3v7Sop4ry9Zy2WyKO/Ko05Y4Rxq7msByBI4W31d+gfRVXTuCZmTjf/Ac\n9f5oTXOQu/nULtqbXGyuDDgVssfnfOfo4tUSwdfST2yBXQWSnPWC568/o3QL\nd+YjKU9IIxT8ed7JCCPDQ1pujSvlMGXUkhAydpH9UHonSJGC5XBbduzgEdwl\nh0X3S8zc661H3YtIOLBoI6Auk0c1R3aKZnrWGADXoO7tRGIc19lXiSfCqOAQ\ngFcKhmHr4FbritgulJD8lGCuC6hWwvKgw0A1w7u/KYbXoSAAjdMU3Mkiv0It\n+rO8vV6eK1vM+x0YTkkDbP5ayLkjE+sF5eYaPrVHVb9qfMuv6Fimc6Cy+IQS\nd/Bq9YIfFS1spEahakeMP+XMMlgWj15IzSKXGWosSuDk7Utsya79MvglxIkO\nv3YDIcLonHc47Zs7owDsZPKVQM0nWZ68VMcdFrxhCfeixeYknk2tEIns2zwO\ngCjVmsIFwe7+hNc2WNYkalyxkDAznHE0nNMPM7bO7fehzKMt3FZBejRLq6+z\nEFqgKu8HDjHkvCniMvnbM5BUlh28jyq/hHHIQTMrvq3LMgksrRqjOeSh87Bu\nT4uw\r\n=vc2X\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"fe9c935fc806cc9b719e895c6a318163c7111a90","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.11","@balena/jellyfish-logger":"^3.0.22","@balena/jellyfish-environment":"^4.2.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.3","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.3"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.281_1624349023884_0.2144700725062425","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.282-renovate-internal-patch-36bd0e3f63109ba8ad9727c7cc9c81ab8366bd39":{"name":"@balena/jellyfish-metrics","version":"1.0.282-renovate-internal-patch-36bd0e3f63109ba8ad9727c7cc9c81ab8366bd39","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.282-renovate-internal-patch-36bd0e3f63109ba8ad9727c7cc9c81ab8366bd39","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bcc80f7993e21152fbbd3f9d2a8652b529146f6d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.282-renovate-internal-patch-36bd0e3f63109ba8ad9727c7cc9c81ab8366bd39.tgz","fileCount":15,"integrity":"sha512-rH2AzBYNsGKpsyILilPFKcpnZYNGl/0qxxf+NhYReR45av3biI/DDKOOsfElRGWCGrYgbP0fifXfdAKGZMyZIw==","signatures":[{"sig":"MEQCIEy8G6CNSGWgeYjy8WmoKILzqOxpO7WGASBVGTZcVlJ6AiBv2B3gFTRS6tBEY9LMAILzvfEs2cvXn2wwHU0/PA3h1A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119110,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0nWWCRA9TVsSAnZWagAAMRoP/i8ZOcMeShYgaqKwucQm\nmMR8lw4gpVQY2YUq5pKlhrPBHSMRT83NNGCllnodApsr5nnIkUZDqJYVsJbY\n16cOYnHwXIkJRAq8Xd0yz2qwclvR5NGAOnNEnaFpue3Wy8Kp5xZl0jK7ZSrm\ne0HPnNvXF531VGf3n4OGvz5+TISF+l280GBCZUCv32uVvPlpT3Vh4TZch1Ed\noyBuPd6YyeEfYQ27HKcsJrD3XHNO70Di9Yd0cVnLWyvljKFt2syH1BvP+WBG\n1HvOMJ1STSTHddXPQieUDFWHUuANlR6d9CHOhTnM6IVw3ujwVZLGXlFOpFXq\nECy4M4lWVmPrhKSnGfhMoF3i/iZflgiKAwgyCYA0g+TsZDi0GImIVBfIXBRL\nMshn+sbXgu0aPnFkZa6TpZclINMVGIbSYxQr40FT3PTVKZeATr+us6hWtvm3\nr9HfJMepwkLFS3WXBCNZQV2PaAV3trQOrWugWisxhv8hsprfDpvZeuWst4BB\nWbylvT+e1CX6j5LM9P4fQ8xemZfbhaEkTWDuoPrXgtm5ICX9zP3zxanNAZOE\nm8CXOto6rUxkPUHq3QWro8EaRX7rhb9e0KmIhPix0qg8Xuv/EAIOyaVc1GWL\nuxt7SVXgmqn5uVsH+mMfJBFRmSiojpamd3D5CLrwRiSSK2TCwJrcmbsfTmAV\nm2N1\r\n=sJEl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"36bd0e3f63109ba8ad9727c7cc9c81ab8366bd39","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.11","@balena/jellyfish-logger":"^3.0.22","@balena/jellyfish-environment":"^4.2.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.3","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.3"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.282-renovate-internal-patch-36bd0e3f63109ba8ad9727c7cc9c81ab8366bd39_1624405397859_0.8725978312402558","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.282":{"name":"@balena/jellyfish-metrics","version":"1.0.282","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.282","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"09e94931db79ca45d75d94efa329193c46d706fa","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.282.tgz","fileCount":15,"integrity":"sha512-nuINF3R6GSknDA9ODPZ84H9wUKrt4x7gUDHfitIuy1vrLP1kLPrKo+5XkATbmstye2qDIRiREXnYgfqNkbANXg==","signatures":[{"sig":"MEUCIQC+/+o9/rVjgwxF55gKJy7MYkAinMRVNoO10qsIxozHfwIgTPWBefjojFYd4O6QHj1hLpenhJV9fyYckPzKFw/GnFw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119045,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0na1CRA9TVsSAnZWagAAG8wP+wUztpRXLm7VaQuYLNH8\n3x7ZzlD9cZ6GEmWR+kQjD2LKuQy2rwQBPtNI7NEMNQFcF7CuOGHj8d57LXCx\nXh+RxMnzcYygtBWjiJzE+i/1JjEN4i4S/7G1sJk4oyHxmv2xheZVHkkgN/n3\nuEXcSPWY+KtdcXNWVmZG2OgLg+QVcjHoERKPlShxpJdCNx4fy1c9RNZnq0ie\ntQNsF/VE3cJtAo2472yzGAwV+tPYhRzwAM8+mf1H9hPUSu+I6vSD/XRQVhLS\ngeJ/dXGcLNAYNw/AtlOmHSB11fFbEPT+jSq5PBCBO3okAKtb00NKAU16NS1v\nW7afN9VNkQOySJTGnqDjd9JU6v66xEdyXWnAjmUu3kJ4rRuYF81oCvLmMjpK\nqwYsfcMAc3c0gs2Ea11oLfKVpCVkuc8J1/k30+01qTl5OU5gQ2/tuaFrRWx5\nFdroLTHS6Fl2FPLc2ervTYopbZPbaUjKWk+CPr2Y7Aqx9FSh6vtMYObnzlPL\ngGCQN+NqfXOmP3KI20VZEymPYV5SkZNO2bYvOzup2kyO1w+kLV8lP3iYmgaO\nGPZqF9DnZn5n5JimGfVSkI5ZKmdpdWgdfzrLkSfGFJU2UfUCWeb815R1AZ9q\n7eEJFRnfUW8UyvCOfjSmjoGdRxEziSUaq9hmV7sCNlCbScwUo2ZhxgsSjOYY\negHT\r\n=i4UJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c8acc05e3e4d64a5c68b86aa0a0d76407e4808d2","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.6.11","@balena/jellyfish-logger":"^3.0.22","@balena/jellyfish-environment":"^4.2.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.3","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.3"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.282_1624405685242_0.15833146970526402","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.283-renovate-balena-jellyfish-types-0-x-4dc26cf62d1778586ba12b85c9ee91335179e391":{"name":"@balena/jellyfish-metrics","version":"1.0.283-renovate-balena-jellyfish-types-0-x-4dc26cf62d1778586ba12b85c9ee91335179e391","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.283-renovate-balena-jellyfish-types-0-x-4dc26cf62d1778586ba12b85c9ee91335179e391","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"66ba57dab9a71da8a5315c20602e177dcee83273","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.283-renovate-balena-jellyfish-types-0-x-4dc26cf62d1778586ba12b85c9ee91335179e391.tgz","fileCount":15,"integrity":"sha512-5TPwelv8vctjI/8L98zaCBdwviyWCXP1Kvn+LmaHMbv+ed7jADlPEXhrFjv4z4nPj4+rkImclVoBWMjOY9xtoQ==","signatures":[{"sig":"MEUCIDECOrGwzmZRAzL9B5ik+dFMnJ66ct9bmMvwCVq6Os/LAiEAowhIoLLgNV1+wlMomQtoN1P4q62HwRPz++mg2XkAyLs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119223,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0ne2CRA9TVsSAnZWagAAclUQAI015yhFWeZ/5/RUj6CL\nQQZuMvcicl7flMMFd13K5I/ETV2dL4mEN24+igpBMSs0aCWERUAaezUXz1VC\nl0hPQouA0uo+nl6kQTVdfPbOsxe7NyxpEN7zIbpSeO4HXlS4xW/zYjPihbWZ\nNix8MsZ8rX9vdsd0kRbgNXvhC24HB0CC1FWLFLiJt0arnPwndMv0KKVPXEzX\nplUSMX+vi7Bn34tBH7OdIB2935TYSL1GXXxQhC518kIrJZrkSNmv7BN1o9U4\nzsH5x/80pUmoK1ihfySR8g00oJD6b3RVwaX41OFBxI/xKvs0I5LIVI5XJ3XI\n+5t0WU2TafmVZpoWWUqjdTjPOWhxCoGR47RG51gfGCH/nbprueq9bPkxM6vb\n6XYSpcAjzqc0u5ZPAEBVoJwO6JtZdgA7ytWZowEDlVjFxhJQQwTENHWOYZs4\nY89oAoqMBZ67iOOLc/c440RBmLchB9rRcZsDVOD+D3eR/uA3NZerJZsESW+w\nxPG2/h8eKr4TnFegd9TgsGI4NfoXK4z5HtDUEYLrx24rAlUdJzh/CR9/bR9Y\nhm1sPL2TAGOQQyLy70jgYkVNLJKQFjxqotASnNM5x9N9EZtvsa6jsj5Hte6k\nZoAzRRKAIL/QOIHKfqPaTWBeLg0hgsGvXPMK70m4CcG/l0CPy4/6i8CqwXcW\n05Dk\r\n=vymB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4dc26cf62d1778586ba12b85c9ee91335179e391","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.7.0","@balena/jellyfish-logger":"^3.0.22","@balena/jellyfish-environment":"^4.2.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.3","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.3"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.283-renovate-balena-jellyfish-types-0-x-4dc26cf62d1778586ba12b85c9ee91335179e391_1624405941581_0.6450756678666345","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.283":{"name":"@balena/jellyfish-metrics","version":"1.0.283","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.283","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"81fd0ebcebfb390b9f007aff95d689dd70bcd94b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.283.tgz","fileCount":15,"integrity":"sha512-uX2/9McxPAVJ+zJWaZdC0BI1rloBUYdT7B0wv+UZLNz7DwDZ6rGtMQDyGVZ6bUM0fsQw/cYFDWCogoD8WOScSQ==","signatures":[{"sig":"MEUCIQDhTNIk3vunRnFW2bgBfGxL6Tiup3b7z4YWrrjFyU0RsQIgWC7dMIs3LTEuJZZuTz2YFdjJYVvR9F1PGE4zLvnQHXk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119146,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0nkiCRA9TVsSAnZWagAASIUP/3erA4i4p5yWYFrM04fs\nBTUT0CE8n0i0Nuv9cRruT1sGSiOCWOE3MdQtmLvaG0BZXxXZ+Wdyke0qzZHr\nCtn/2ZDxnxZJ/BusM0mxCzCn0AbmzvzNo3X7Dky0XkqJ3+awcn2s2Js34uga\nO7OAak2jnP/VrU90Ks3SrzM8GneSXJJ3oSiWzyrbKrYDQ4MqFC9K5tJcH84q\nNiy4T7ep7kxVJpHIaYFglVitQ9kjq0KKQa+m5mHuwA56kYc/bvIUXZdjGe5X\nnylD8AykGtPEGwprUpFo8fkrkcb/O/E27qHsMVGO7FxJTV+NRF1Mchv8tywD\nKI+UUIPEDNXONPQ/m5Ay/+K7/d499kkw8mzcbs4/d1N2U/thdcSEM2HLcj3i\n2OawiYfDtH5zU20r8WHHL3AzarYU4AaA6so+avDsusvDN4Q+PekFjvy8ZB/B\ngeTXfJoGVg8L6PBQl8LaEgovqct7RbV50sWJIx2YNOjwh0OyICpuMf8trUEi\nFDWuCdwXKuKIuGynvsJtB47dDO39IlgNJs3ffd9b9lDfriQRNC4Sr5mAvg+4\nK86D4zxEPTvVxrr2wylbhTM5N29skzscrUJwjw38XOP1iUlA6cJ6P49GOBVv\n5Bs04ipg1hB/SAvtDWocANQ2ec34aJEqC+0huzJKwa/50cjMzeWnTHs1zarv\nt1yX\r\n=h8E3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"540a44f8ca9e03463fdf6419e524c7f63a0e766b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.7.0","@balena/jellyfish-logger":"^3.0.22","@balena/jellyfish-environment":"^4.2.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.3","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.3"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.283_1624406306138_0.5970532973948113","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.284-renovate-internal-patch-e688c02664868fa6931c09c8b2518529ca3ff69c":{"name":"@balena/jellyfish-metrics","version":"1.0.284-renovate-internal-patch-e688c02664868fa6931c09c8b2518529ca3ff69c","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.284-renovate-internal-patch-e688c02664868fa6931c09c8b2518529ca3ff69c","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3c22829d47b5be779f2737b6aa22deddaddc58a2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.284-renovate-internal-patch-e688c02664868fa6931c09c8b2518529ca3ff69c.tgz","fileCount":15,"integrity":"sha512-yLm/PaFKiFqiQUn0RJtibQK/9g+7kpPTvIGXd8nyhce74OZIegijOv52Ws7APOm3h1Sjx+QhXQbd51Hf5TL0GQ==","signatures":[{"sig":"MEUCIQDq6sH2VyMF5mgvOZKn+zdSgtbWOIup3uNOOzLD9srFEgIgMgkKpRBERn6k8Z+9lIH7Iwv26GbGCCsoGjFNXYVuqjw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119315,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0uU7CRA9TVsSAnZWagAAyoUP/iZmqjtp6bkYpEHYKCrJ\nciFxgNy2IqioVKz5GJe0wdNJyzbxRjkJmaHXeoPZfZm7GLPqv8jgKXO5RxPm\na2Ef3TdqMceFHE/llXAxXxtTQuSnbVEaJGn519/2K3A+XMSHPs2jzEfuqrtr\nlcXfnFyCMDweyF0GkM2l/Cbp/PUgPOLo3DjViGd4IKuf1aQKk8WokoNZUV+9\nCdfSBpjDXQlP3z0ZhTMYMnS2salSlKE0sGm2M9GE7p65BZ/Zg5oOp7D6AOLh\n6cErcXiRcTCsy2cUQQYK18DmbSJg0WsiryaiWsnxz7BnOYsfyP+ALTGkpRq5\nnJEedsSmk3P9hjR9ExaPFh/ZCzDUiDyy4YD6fxXTrclzuT98YPWfd4ro+A8w\n2wrYGdceHroDBf3o/1Dw5E3p7xh4WzbSiSaAKTZK+TW5ylSG6Fa166IfPrGi\nbOt+Z+53Z85n5rvq+CQM3wlfD1dA2XZeiBiP5SYok9QEM6SChLFbDYphNq4M\nGc1jfKm4rrWioBGD2lf/Oe918gXeW+1m5JRlAaxt9o2xz5JYOj90Vp4LICgW\nlT8C+C6qPabTUk8zK3T8KnRzSX02IM6ZJf3yzhP6Vb4WsnSDBO+ci9DNkedv\nNJIHheOho13QpfQArEEw/QV/8l7lqBl+hjnqJ/T8lwfRW44nSb89SqsGDRRc\nJHF7\r\n=mlY4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e688c02664868fa6931c09c8b2518529ca3ff69c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.7.0","@balena/jellyfish-logger":"^3.0.23","@balena/jellyfish-environment":"^4.2.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.3","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.3"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.284-renovate-internal-patch-e688c02664868fa6931c09c8b2518529ca3ff69c_1624433979198_0.8645623962610465","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.284":{"name":"@balena/jellyfish-metrics","version":"1.0.284","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.284","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ca11975591a8a39435c592cb03938b1297fca49c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.284.tgz","fileCount":15,"integrity":"sha512-lWqeY217Y8JW+gyzbpeZK5B1F+XTosyVhE4l3BARhKmoEj+amrxR/RQXHj2owy2XqHcF7WHZtpGTjn+FyYLeXQ==","signatures":[{"sig":"MEUCIQDCx0aMqq9gBFGdhJmBiW/fY4q1Vy7NUJMlI+bFlIuCVQIgDDX5QHh7JHuqgK59qaHKRjuRqg+rNvNXLpf61h9Proo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119250,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0uYJCRA9TVsSAnZWagAA+8cP/14tG9e6jT+xNt03ZEPH\ncmrzSA87fL/o7upkew2VASVnGSNgyJ8Kq9B6R5m6Rxg0IGZzHlaDRFUOYgpE\nTKTh6wTtjdxcZp/maTOOUERqpeMmH2GAiTPcC6vBGfCU2p2SPhKRytvJIrKD\n5TpeAh+ZH1fvfNQ6AKNMMYD1wxOgHmUnSXMb66Sls09uCWRcVkwBcyoWUcnP\ntoCpvBtga2SYA4DgUipK0CCWyUEwZNvRzDQXK3QlPHysrrH4K+u3bF9LT/DC\ngsJggNUjFF0Y8qM2tIFi+x6rJgO++GDfeBlxbmmpIF5rmFmUZEiM+XtBFA+n\nzJtDM1a8RmR8JktTgHKEPXav7YuJaGEDUaq1oy9ct2YTpNCi0LkyCjrQBJQ0\nFX4dPtewz3aGKX+VF3OHwhh/jR1Yo1Zgb7xF7rRdCGsyJC422Tmd+fEThLHS\nqWU4rbY/L4p5UoERBKGUZ6z0y2oN27wUjwd0P9jNewbsDDXabKixRDpvLBtt\nfg07A3qIg86SIJ1StqLN1cNhvN0u5SNji9UHw105YKsm1FMw43p5sHUuKSAN\n7SxzH2MOMVLXFtz/r39qLEEpfwpmo25s4cQdP6Pml5D6cMmEEk0gviCO2qcr\ngKPrhHFDREvaY9+RAGhHXB+npqWl3NWvuTjiQx8PhGQa8mRwO1ctKW2nIcFr\nsHpi\r\n=362Z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"43134698f183d4b3d48d31ccbfdcb6ae9833e202","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.7.0","@balena/jellyfish-logger":"^3.0.23","@balena/jellyfish-environment":"^4.2.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.3","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.3"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.284_1624434185034_0.5683659909890317","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.285-bump-deps-ccde5fe9060f5091c33d3508197afa0fa6e640dc":{"name":"@balena/jellyfish-metrics","version":"1.0.285-bump-deps-ccde5fe9060f5091c33d3508197afa0fa6e640dc","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.285-bump-deps-ccde5fe9060f5091c33d3508197afa0fa6e640dc","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b4ebae72eec755c34c81d036eae430a3109d2467","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.285-bump-deps-ccde5fe9060f5091c33d3508197afa0fa6e640dc.tgz","fileCount":15,"integrity":"sha512-1GKhRniDAFPJmtp7wbV25TAETbHJhJFVUFwg8nXxxRk71Aqn3nSxNgD0ggkkRBPMZpczSveN7zXRLmPQpHSNgQ==","signatures":[{"sig":"MEUCIDrTurRx/xlhjyiy3vb+RoMfOegI9nviiBXoYfCe8nxPAiEAhxoMTdRS2NKuSEQRTK63O6HbrA/1nJvZmq5mBB2dNd4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg08QnCRA9TVsSAnZWagAAq4cP/RuwvdVmpBRZCuVG1j2r\nT/QpoEZXnJDanHpgMcI30Foit6GpLtL9UWnh71g7HH6Srm4Iyf2xBWv1J3r7\nrwa721W1dEKMbz5nNrQ3HlPZ1/WopOXvVnjjvKk7BstzDM8KxljQw5NDMF7b\nGq0sx/4VbGGX+pr7GN6QAwCT/VDZsdmhf3r7qPLVjB/RMqAm/K3J7siJEyim\nEpRNli1gYFsLm2nos0im72R/6eSuipwSUUAMlYU2iRXR56r4carz2nmZyTJ/\nxt8cQxdo9AvWWKbyZlditIZdJ/lK+l1c4q6/G7uihmxJyGkRKC1kRPhzuLzV\nN1ebZPp5AkuFmUltxDY2kTCmzGWHcXL4KGQXFEbXY89IzWH/mJwYxy4m1I+t\nOJSrmqjLc5aUgBAuNCw2cV7EuezJck306vuh52i+AqVNaq5wNRPUqc3n3poR\nO1RL6qu+fR8zYhVASFGw9EOfSbNWNrv2VqPmOw9wUMIpVKN7/ujVI1zogU7o\nU5xfmfVV+L/AjtDzDVaulcuxwfjGHdZpFJFjhI/nKC9V+8swZ0BKhj6QYa1c\ncwAsCyruTXAkPbmFp37QU1T/cM1EVFdS67ofVMkl0f2uE/ij3nQhHwc2Gj4q\n774eYT/WlblO6oGjkEiBHYt8ZniHxxshy1m/WRoO7VZjAL9gWOi5oMw/14qI\nBvbw\r\n=yVQH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ccde5fe9060f5091c33d3508197afa0fa6e640dc","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.7.0","@balena/jellyfish-logger":"^3.0.23","@balena/jellyfish-environment":"^4.2.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.3"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.285-bump-deps-ccde5fe9060f5091c33d3508197afa0fa6e640dc_1624491046624_0.09449417358134382","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.285":{"name":"@balena/jellyfish-metrics","version":"1.0.285","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.285","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d5b11651991f2210375ab969038f8d11b845c984","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.285.tgz","fileCount":15,"integrity":"sha512-DftNWlF5D5nyE55OG8fgjhkQj/syfjpp1BSfD9HJIJr1uJZwHeMqTsvhROCF0B40emde2Zy+OFShnHOAW8jp6g==","signatures":[{"sig":"MEYCIQDWDB4hDfJVFKzn3zzB7JftNkKZ4PpPtEtjXwg7j9+h0wIhAKkJQWxK9VC5T9mAuHLITf9IzVtCm+suhN/pn7blCuA8","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119320,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg08UUCRA9TVsSAnZWagAADigQAIvPN+h1LEAIQD28qHJ+\nAXhOItZJiFk9v79MZ9S7rXHaQSLv7UIw6KV/3BHt0zkae8RU0MmH5nZgfZHv\nZfrooSvIkn61oSYtjvrla6etkY8rQkLJCXBIHKAhdVULxn54nUS2yiMC7jQL\nh/Q6f3KTj0zm8BYd8UtWAR5dj5QzKTCXB/FazCn7Eb86/AG6nd8M5cC7cmfL\nLrVr2/ltSHW4BvHQ+2810soYETsyevV7cDKQi9DxhzmzyAEsmSn4VGsypVvV\nQe9akVAoBx34m0eeqp1epg+jJ2ECjT88V5LgBjlWp+PlTbOolD12erHNW3tl\nGbejDnB1SFRUm5nu6erqyoBWMlrh5pxHPUDcwPaUMgZNd5fznyXGwr7uOIFD\n3+3HG7gw6ioTFa+aCtzGQOt8S4PGxC9oLIekCcKOGNwxk0De/qF495ZShyPj\nhdf+vvKwS/X9asiMRO5ND2eV+TaRgWCmG2m37mkEzAwYSKX8VFAKuUGnfTvd\nycJBXarpAYOy1D0ow3KttKeHxHN4dAj2f4kcaoN1q13FFpxXEufYnFUpmFOQ\ndzL3AaqpjUrIaIp+dGQf1TjuW3CoFQ1FkMTcdh8hks80//CoBi9aLg0gmqa/\nIC+wGkEYgozgze3XteMKCrW4EiFobqgao5hvOAEYG18YsVMmKnLcZvCvvnv0\n7/tz\r\n=5hfe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e8fb3989455c357737d3756aa756948d8151dcfe","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.7.0","@balena/jellyfish-logger":"^3.0.23","@balena/jellyfish-environment":"^4.2.7","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.3"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.285_1624491284394_0.6487191901892269","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.286-renovate-internal-patch-58f07927eec342c6f8166929d15acf35c0eb52a9":{"name":"@balena/jellyfish-metrics","version":"1.0.286-renovate-internal-patch-58f07927eec342c6f8166929d15acf35c0eb52a9","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.286-renovate-internal-patch-58f07927eec342c6f8166929d15acf35c0eb52a9","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"98d461de67caada0f9f59575ca02f123cc2087e0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.286-renovate-internal-patch-58f07927eec342c6f8166929d15acf35c0eb52a9.tgz","fileCount":15,"integrity":"sha512-SEy30pfcKmjiL7PK6KMaH6oBiyD5sWOycDfj7WM6HbymjNQBMnF5Oc8xN/2ov0c5J+tPhWcwvsXb3Nz0Ku/YxQ==","signatures":[{"sig":"MEYCIQC5vyBXWF0VTukF7ugFbM5u9QiD0v+hFZbRlKA4QypfnQIhAJyp/h+fWf0nUSqVPh4hDSRoCyJnzxt453ov2H3QbfSe","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg08baCRA9TVsSAnZWagAA+f8P/1SrL13yeAx8dXo1gedB\n2aOuTZaCaqwEZjK5iWgNme8NYLjla3gnDwRBOAZn1VLmzDVXZakTKf1y3K1h\nOHF2flhDpwuZDuWsXK5jN+D2UWVyAqXB6Yg+0POSTr2qhf0hnz5uD+L2tZbt\ngaselre1gs5gEsJoL16+JZ3AMPgHFou6+UaTRYf7azSgtiiBAotc3r3JF3/k\nTubwxHzsE3JiPk2L2+uR+y+fb/yIY+zAekJSJ6KdlLpfgnCBZ/IvN5U5ouFz\nAd+w1PeHXrfb5t8Cgk9nKh0hwHb7iQZjk9Z4aYqEKYdMnRmbP8r+S+Ae7V3s\nRkxjVl/9tl8tiJZtukZ0sJJtcGnXYLH2UDcd1cGmmGT/TW8KG3ju/tQKv+Bl\nwYKuD9aSa7onVoBhdwDdi2UaXZspu34BTujWQBpZYfKNGzRdobJAChvXLg3m\nh/iQdd8SAQn9mBoqpbOb9hhpxFxP+z45ZMMq7lfDevaEK9nWp+mPzNArVSuv\nRx2ZVlh3wbZo3bu0iJCQ0schMYCMancei6lwfmyhhibisSVFxE0uUOMhAMSm\nAXxV54zS83WKTTJzJkxo1WY9OZm4U7FMet/5mefORt8qy9bn7keWF1fJJPBh\nV+y1+T+XJ7t4Mh9Rybs5YA9U9G52CidQTX+oq7qenu3z21JCmgjCusTir28/\nQjUo\r\n=P3tp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"58f07927eec342c6f8166929d15acf35c0eb52a9","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.7.0","@balena/jellyfish-logger":"^3.0.24","@balena/jellyfish-environment":"^4.2.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.3"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.286-renovate-internal-patch-58f07927eec342c6f8166929d15acf35c0eb52a9_1624491737791_0.6871962096436048","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.286":{"name":"@balena/jellyfish-metrics","version":"1.0.286","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.286","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5f68df51280b555c2c06d39e176f4de6bba13602","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.286.tgz","fileCount":15,"integrity":"sha512-3qE+SOs2HsgMkOmgt38AbmhUhqTRRrwFHaGSbE+PMHse/+gxTMYZ83IR/i0JmQZ2pk0q8zHo7ElgbftNBgagaw==","signatures":[{"sig":"MEMCH1ZTae4ZJiP9i5RUr3oUD1jvQampk+ubsXiII4kJAdsCIA7A69ISmOU10Zj5+lF0N7TqFS/i153W8aoPkzH93kO3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119392,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg08fXCRA9TVsSAnZWagAAt9EP+QBO5Es7YLW3h1u4x3Ql\n1dm/r3w7fsbGb8HtMDtpJXyd1s9fnSVkgdH+6mzuA4PgUa4l/qyQZPa05KuI\n2LnyaqKUQ/YlU+w40NEL3fqwU85W7mGFgVYYSE+Xs5FL3yoRLR7YxCTNYf2G\nI+IE/mTHKPq08lX0XhhiHlu72J84fEyQBC81Vf1Xl34MZsTTnPAdy3cLu9xP\nZNAgiSyj5La7S5Bq8Cti6C8DBrzVdba3rqR7HCjxamH1VWCur6X4uV6Bm1Mx\n9G5h0JtkOh8Dhp0jscDGKvkd4I7vkISlWUZsJ54KpjsxwXEqGVRCn7Bv5rHt\nfu1AALSRs4NPCHO8h/HnhZfM1V5JMkHVRD+OXnzK4YZPrSTunxjWJG54zV1v\nSmmh+5LZjtZNEyVsL8z55AEYFyTpUXgFD2LE2JukyG6bRJw1Q0kB0OLn6eIt\nkFiuYLcMln2oKJzoX1PW2B5uNyj9JcX4syIE317MELK+MdTxfZpMcCbTsHTV\nWUMYandAJZlGq+DATHmvwd1/uGbg+LEhzAKOcfwwlhbNJX5Vg4Hm3ypVxdrT\nduSKJ33bs66V/YRMlifhUzgkhIantT1vsw+XXtvTgM+62lEHCROXVeGfXS3l\nSZTxzkd1wiTQAFm28qIjuvZyMr3VV9qz0Y9SyfQ/3A6zgAezeB9wJCGrh8GM\n0nXC\r\n=O3Ez\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"76fee56cc1b79d030f8147dd9cda292eb2dc374c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.5","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"12.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.7.0","@balena/jellyfish-logger":"^3.0.24","@balena/jellyfish-environment":"^4.2.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.3"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.286_1624491990227_0.08126470761552818","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.287-renovate-external-non-major-04583dd5468ef01f2e8aac6e085ddf390979e781":{"name":"@balena/jellyfish-metrics","version":"1.0.287-renovate-external-non-major-04583dd5468ef01f2e8aac6e085ddf390979e781","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.287-renovate-external-non-major-04583dd5468ef01f2e8aac6e085ddf390979e781","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"41da476b909460b9a0ddeea79ff542fbb61d31e7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.287-renovate-external-non-major-04583dd5468ef01f2e8aac6e085ddf390979e781.tgz","fileCount":15,"integrity":"sha512-cqHle4I8kFX3zaKsLVc+Y+oWZzbmQGTAS1p75mFQNuvv9hDGvA7r0bDJMIqkXnijuJ+tIrjwF0Itlt8ivMp6Fw==","signatures":[{"sig":"MEUCIC+9fNM+aLbfdN37JnRpGPJKd3qswaT5hnWmHDjSsoMeAiEA5Hjcj5hAvCK2TxR2wLo952j2WTjCmA7MmKC9jA3YpgM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119547,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2slJCRA9TVsSAnZWagAAxcQQAI0tZk6pmSP58hEjPy0I\nkA9t0UlIot+8EV/Xe7RiL5EwhzvvE0vZog/YR/yXN1+Tt8TQX3X65PBeN4B8\nprO1jsioFP2b396R95sfNGn6B0HacJdFep8J0roNsJfFW5OEIhn7ZXG2hKDy\nRvZJl75zR//tSVL9W/g/YFyNywx2vLIDZgo6D7PUxrsN7Jf2KFO4DYEUz+ec\nLZ3PwJ9bnSkpTsjakQaaGAVJmhcON7KdgVG2rl8wQtCGz4YIVo3IbjMIuwgN\ne2Or/GBS/UpbwQREOyn3rMD09dAHCE34pQseVg2q8ZTCPv944k3ODzV2chp6\ndY0JxZp1QrFAov3HB7XC3DiLdNnJuSg1tS/NNLqX7VZyQPGIPhdNONI6zeFX\neblQ4uwl7DOI+B15n3in+icUKJlI2JYTvC+OZAfimxCyEJVVg47G0sbUccyf\nmSUoraXMVQEQTz8BRryDjYUR4mR4LOr0lhdFedOLiNd1/9fMR8zuckgPq4zt\nmjUoP838VX1NoHDXzoyNmuYO4klINlFzq5JTrwsdOvvByHNdoZtcsfqCjYBh\nYDqShYaU2WFk/Qeo/3pR/lzB+SZVAGY1m+VFVKjrAH7/Z+pSXsuS633AIskg\nPCrQhGM6jxLUFgnM8VS1O3CrbxP9sijy9/y3L0zMHGdP5gK04nhLxMjIRQNf\nLLWj\r\n=nDe0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"04583dd5468ef01f2e8aac6e085ddf390979e781","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.7.0","@balena/jellyfish-logger":"^3.0.24","@balena/jellyfish-environment":"^4.2.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.0","depcheck":"^1.4.1","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.3"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.287-renovate-external-non-major-04583dd5468ef01f2e8aac6e085ddf390979e781_1624951113334_0.9816232815019843","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.287-renovate-internal-patch-7d620074e37e84c593a4677c028f622e40e6a978":{"name":"@balena/jellyfish-metrics","version":"1.0.287-renovate-internal-patch-7d620074e37e84c593a4677c028f622e40e6a978","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.287-renovate-internal-patch-7d620074e37e84c593a4677c028f622e40e6a978","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"794155b892efc8ac16d3c9d20cf08c443fc0f55e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.287-renovate-internal-patch-7d620074e37e84c593a4677c028f622e40e6a978.tgz","fileCount":15,"integrity":"sha512-mfKzSwtWhWOYr/kkBStY4nDOAEaHTYxpLljphkKB4GTx7TIOSXMIKacs9N4OaRUbeMpHgksfiDni5t/3cIE/1Q==","signatures":[{"sig":"MEYCIQDiK9EVeL3XF1NF8lRgJm7X7MTa0obMMKNcQognngcpswIhAJAYaHOSYorliaY9KBqMm0Gv7MliaBQ4QgrVqYXDAKnR","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119561,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2spLCRA9TVsSAnZWagAACEEQAJglB6LnWZqWjuFwhCnA\nbNLd6JVkYEa2qD0igeB0VELX6aEA/WGeT3Je40OFjAjlMrr1oh3o2wr7aTXk\nHH+vy9yuV6MBhlxVOmp7TPIH5MSopjFUsttxVI38qJZCndlAmUm3a9oJHDs6\n4KPONVZxatb4ou54ZUKx6UzvOu/skEkDbuw3CnKCFLFKyJLFVeqERO+E0K79\nggdpBXVHi0h/kGvxUUH4vc8nXq/WeFPfXP71d2QJVY3Q/WZTxZmZZlhboy0l\nCKiDDRTXxifegjLNfUy/HCwqSJj1JnZK3HkVJqiqvd2f8zxDBMQzGevaOxyB\nifFSaobJPMu3/a/M5L5WurWUD+XAlFVKCTv65kll+vzfK3BXyuiUVsMP0PMg\niWsh0dHjrnpYo+SuSqGNJiEefxmUWBYm6my2Mgu50a3bhomede6Sab6XCjFC\nUjxSdTvz/LvDS2Bq1oZ/QUxeacwJDGyt4S3NNzRDVhCgT6ZfhsYlXHoBAfL3\nSnixA7Nn6EU6Vpt2royV/jziudJKQ38p7GHrpX/tTpVBuDQ0LXMiYOaE2W1k\nt+ZRjed6xtJ3Q0798PdJ4QIT2t1pgIchXxQm9B98dCXA4+oMcW2cTR+hEXyy\nngeiGIZJ7tIlYJO9o0g4CTE4d/m0UDsUqHagJdiQQP8no/7yaCh3vOA+nhW9\nX8l+\r\n=JdCa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7d620074e37e84c593a4677c028f622e40e6a978","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.7.0","@balena/jellyfish-logger":"^3.0.29","@balena/jellyfish-environment":"^4.2.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.3"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.287-renovate-internal-patch-7d620074e37e84c593a4677c028f622e40e6a978_1624951371425_0.6906057763743332","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.287-renovate-balena-jellyfish-environment-4-x-273e0f66a89d053a6ec4e1872ce257b950295a31":{"name":"@balena/jellyfish-metrics","version":"1.0.287-renovate-balena-jellyfish-environment-4-x-273e0f66a89d053a6ec4e1872ce257b950295a31","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.287-renovate-balena-jellyfish-environment-4-x-273e0f66a89d053a6ec4e1872ce257b950295a31","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bf46d43d64dc50eb26253f4044b117447a971fda","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.287-renovate-balena-jellyfish-environment-4-x-273e0f66a89d053a6ec4e1872ce257b950295a31.tgz","fileCount":15,"integrity":"sha512-Z4ALO/+eQurQLNU7YiCqAYA6bFMqML77hbQ/NI8yzVIchEfou/PGX1c7z2ODS050tpcCwaL0zzSRV6LAkfO3rg==","signatures":[{"sig":"MEYCIQDxXcGzG4KyUYF59WqnolUCeKLWh221ncwwZjv8sZ3JxQIhAJzAG45QHUjFxf9pd7+thJj7qHkBc10cafeGunZFdr7H","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119583,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2spiCRA9TVsSAnZWagAAL2EP/0zjutA+ZZ071LUGYMWB\nOu1hof3P4OZryIpo8vB3NbsnfNPRsghPqajIhiqW+hmm4au3nFFk1CmD+rpG\nnnzqQsUpPPSs/NzYGG+XDRn580GC2YCEVMhUnvju/NSQoyYIz54HigM9sXww\nECI8PbyAgfdVVs0fbwu9X8N4TnjZqeO6JvBkw9I4E/ZuvDV2ovHyi3DFr8iD\nFPmfJ0sY+d9qVlL449UN0lGpe1Q1OQa7PUhy80tohzZSo9HJQuzfOAGBWRFV\nPESE/AedzBmXkeTvu2KoDt+wTqD0Z55H6ptRYC12M2HF56/5uA0BdRvT8QFO\nmNAIWS64EI/HphTsvLK/OQhMsS5nQmW2IIbTUHyyB9AmdoEUUIVoxT/rMmqT\n/vPixnjLMGUQ2NhOAgYlp9jsjCUmYVkbFHZlUy7KhsE9CXroq8wiWBURaUuJ\n7Ql+N83oz2GYWJ7qsq+8sF79aNfPNzwFabz8kDVPfd45fr/os9Pw5cDE+he3\nCvjppxpEKFMI3gmkVXSCg4X1p6f58piS8SJga7I4l1Zn14nVCuDCB56a09h8\nVkJqcHESAFTqLN4he1D2UtZDUbiqaE85Q3wEHWeQbxc3Ti0reCWXM4gbRz0n\nv3yiEBmi+Irit9ku+S0IACF3D9hAS2AYuucOWI1N0J2VSXw3gOyKEP3wgRn9\nJQJP\r\n=i7RG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"273e0f66a89d053a6ec4e1872ce257b950295a31","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.7.0","@balena/jellyfish-logger":"^3.0.24","@balena/jellyfish-environment":"^4.3.2","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.3"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.287-renovate-balena-jellyfish-environment-4-x-273e0f66a89d053a6ec4e1872ce257b950295a31_1624951393490_0.5803045196693075","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.288-renovate-external-non-major-ebdcd844dc3de181598a6e77dfeb2c77fa038bb2":{"name":"@balena/jellyfish-metrics","version":"1.0.288-renovate-external-non-major-ebdcd844dc3de181598a6e77dfeb2c77fa038bb2","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.288-renovate-external-non-major-ebdcd844dc3de181598a6e77dfeb2c77fa038bb2","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b97fc446e7be06b00746e570ae592c18aac69c63","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.288-renovate-external-non-major-ebdcd844dc3de181598a6e77dfeb2c77fa038bb2.tgz","fileCount":15,"integrity":"sha512-Upyy6xLlbnh0OnjeGgbFMsIXdul017ol9i6HbbffuWFws2S1aqbPr+7ZDytdN8kf0+rXhhhM+w9V1SaKn88csg==","signatures":[{"sig":"MEUCIGvMzfZPsC5TWlWUVwmzq94JfzzR1W2CG0RYDbWpNk1gAiEAlTUu9S0A9xFhrwrFhE/BRo8vFpxC/0zyJwUuCGsBKQw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119640,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2svZCRA9TVsSAnZWagAAFawP/iWLQ6kDV6GbgncJYsu+\nvZr069j779WvDL9Nv0bqFqkEsACC1Wi72IzsVdYAqHCg0yDPUyivYZ+FUqa0\nmLnMsYXvpPAsU1p2A568wbTfPaY3evOdxBWCqpU+W0ZRbdZ3TVNd+9EhlO1p\nn4iLCu4wo7VmCyntIIex2mX9CRnRP3stsUL7Xek4stiZRz9QR1MCA4GcOio6\nMgFw5YMIgbTOVhxDAJJlF6oALa5UQqBDXLkEowvZViUez+VRFuAEpoJ3TDqz\nSq3S79YYgaAqzm9Khr2NoGJoqWH/cqFj//gZyLmn/bdUwX4VXUXTpqH45+kV\nWVHTGDSARUyNlNFJpy90i4Z8tYOKx7MS+e/nAQ4noq1pfarBJozHTt/x/TUN\nw59RxSec1wKlO8+4UgJVyqmRJMG7w71xKd52PypTAikhxetZGGtla6vWlI97\n26eIdwkMPd3kpeKKDNv2mOD54cTMXRJMzEE9wn7nLwgsRCDEH1G10pVtjnMu\nrD5nM8vDDolv5Chev6JfrsthZO4bv/07JWu4hOi0Bi6uuhd3pGDTbLeNu+xa\nUZANf3pExf6LP4eGO2enXqFvQ482WC5fu8ci68iadye1nfBFMg8obD6a2EFP\n+3bX/npqTCk8ySgw4YghXPRIKX8D0p0izCaDtoR9gp+8gckqGBHaGDaM43Y+\n+vHb\r\n=TpZ2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ebdcd844dc3de181598a6e77dfeb2c77fa038bb2","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.7.0","@balena/jellyfish-logger":"^3.0.29","@balena/jellyfish-environment":"^4.2.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.3"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.288-renovate-external-non-major-ebdcd844dc3de181598a6e77dfeb2c77fa038bb2_1624951769474_0.34077083707595146","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.288-renovate-balena-jellyfish-environment-4-x-a42d0ec578f57364374c90e069e9530675ac6c7b":{"name":"@balena/jellyfish-metrics","version":"1.0.288-renovate-balena-jellyfish-environment-4-x-a42d0ec578f57364374c90e069e9530675ac6c7b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.288-renovate-balena-jellyfish-environment-4-x-a42d0ec578f57364374c90e069e9530675ac6c7b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a425b82039fef4b442983f59ad7dece33da951f0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.288-renovate-balena-jellyfish-environment-4-x-a42d0ec578f57364374c90e069e9530675ac6c7b.tgz","fileCount":15,"integrity":"sha512-1LG6eE/aNR4GFPIw1vHqWTL8ZiO72QdyHRMHTLZi0/aNMZ5KlT06O7XfO1cgizDoBHbmIsJArRrmo1ADuSUTzg==","signatures":[{"sig":"MEQCIDx9AO0nhmoLUf21PcA0RouWr4mifGWh84pdQ7wq7nJfAiANxeqAuFjZ1exY/bVLc99jFPmRtSl3fs2oNdtiUVDe7w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119687,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2sxRCRA9TVsSAnZWagAAKrEP/izpXLMG53HeuPxDzfDq\nWBelaFqUKQd3RjPrrehkQ+s93qCZwyLrm9dGbFK0W28druxIdn2amyynoc+x\nCWyV8vmk49XHbJADNW4ja1Z4qtebHwfspEQdS/+xKyzrhjCJF2Yi6SQmGw71\nc2uCOChHNeljMgDt765ZGuOvdBLlaSmKb9P1WFPtgbkKrBTi9MFGcUmAVnsd\n8h6n6RLcjS7y0swdxu5vN8YbbrpvXTT96ZuCP6+AKbYpJXSKoMy3FVBfNlCz\nqIzrI6SEdMkR3oy4arq+aQLULDpnEPe5i3+5jHldusSyQnJDAva+cBdbi+Tw\nAPw0FqPGLO7ghRC3FygKaGOXSeFO/OniB4Qi8VrVxhEGi3/68AKqkpRaMOzg\n/h+nBZMMGO3SS75syYqVPBXitZoslLQwH9SevKGcB5Jgn1gigUTqwmZ7hGKl\nqyH7JThD8WTv2ewPwl7IqcArILdIFmyzelKrY96oDDfZqX4y/XLqTXH+Qd+x\nqspBuSekuqrMqf51XXB3ZsOhJhtUP5gqzQ2JJeEKXr1SDN30yATYCOK9GDUp\nHDgZ9AHw69k8s9KYEo9Z8rQ3b9fZppTKJGQsGAJFv29vB+YuUEfy+Snvy4KI\nbot+26cBkfaqhsKDzuoLqRy9RZpG8gDPFFL5cUftxwf0AIfrG6B1WVue4U2a\nbh54\r\n=HWJP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a42d0ec578f57364374c90e069e9530675ac6c7b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.7.0","@balena/jellyfish-logger":"^3.0.29","@balena/jellyfish-environment":"^4.3.2","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.20.36","depcheck":"^1.4.1","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.4.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.3"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.288-renovate-balena-jellyfish-environment-4-x-a42d0ec578f57364374c90e069e9530675ac6c7b_1624951888930_0.584969988498725","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.289-renovate-balena-jellyfish-environment-4-x-5d7ff71bb7de6adfb942f63edbd1cb6cefda97a2":{"name":"@balena/jellyfish-metrics","version":"1.0.289-renovate-balena-jellyfish-environment-4-x-5d7ff71bb7de6adfb942f63edbd1cb6cefda97a2","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.289-renovate-balena-jellyfish-environment-4-x-5d7ff71bb7de6adfb942f63edbd1cb6cefda97a2","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"40c325799796e026a5db6dc42b9078d6bf778f7e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.289-renovate-balena-jellyfish-environment-4-x-5d7ff71bb7de6adfb942f63edbd1cb6cefda97a2.tgz","fileCount":15,"integrity":"sha512-qyKQH389Jgk+87aYNg+cjJ4T/n+OLX+U2+IlZ2qVrFbEnQyXsc78CvNHAI6qVVkRV9P8HcplnNBdEzbpSRUU6w==","signatures":[{"sig":"MEUCICMcmZk+5tDUc2r2/ayFNHSI2UWqR7TJVPlrJ4TzGxsTAiEAlYm9N8u44LHa3/eL9prbUiihSYnNh30aw2dcE+ZiR7k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119762,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2s3vCRA9TVsSAnZWagAAmOAQAIQR9K6xPJg5Vgh/BFA5\nZ3OUvs3jkbRqExjOj2y0KTQRmjqrCCirNa4AIorYi9uwjwVpoFw5Y1TYhV6q\n0SBdQRpeGNDHxIvUojJ45UFTxmZFR2rlkGSnUrl9+fnZyLgN7YwkT2nQMd9O\nBpnEjwq1VWYZmVwAWgKOQ3/VoCH0ZrZ/wgBUBvCcCSkWwYCECLZySWzAJWM7\nzDUhkI/x7gyPjgXdW/fmHB2QTewXv68t7n/04CIr1Sf4EmWuRi//+5bPDrMb\nuFR2xZ6LVlfG7KJTP8D3okXt0dc+M7StymAUzJBaMUWKW5vguwLMGk2gN3ev\n6MauQJq71IgYcfkU5+LnwfwCrDxuZ+Njd87HagBc0RkrHqHjAePCvcB5S9L6\nbpksOqkAkl1GlGeTVIJPleT/mBCAmnlpcAMH3v7Wtelvbj5a0X0rlqNZ9bOn\ndU2Xo6u85HupUxmMrFlrNxWubrGA3LoJe9q9ZhmWKvPxw/re56DGNVbm0BrK\nbCVd84wREBRiGKndooeg4zgzlYtxAVj9YmT7Zm+O5dCtvZnQkOV//lvsSi6H\nWTBuwWy3amPsKzz5fCGo9kIEuW87ki0VLi76Oea60T/8i9ANKN7Fc71kcfBL\no8ogLruXI4x+YY4kdzlz53hWSgSXcElp9ckxQCpyAkVfFTgEHYA3cDGcGhuJ\nl2DK\r\n=vxCI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5d7ff71bb7de6adfb942f63edbd1cb6cefda97a2","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.7.0","@balena/jellyfish-logger":"^3.0.29","@balena/jellyfish-environment":"^4.3.2","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.3"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.289-renovate-balena-jellyfish-environment-4-x-5d7ff71bb7de6adfb942f63edbd1cb6cefda97a2_1624952303424_0.6625726479580469","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.290-repo-sync-jellyfish-config-default-86300207b2f9aad6733f860644792767ec1e84e3":{"name":"@balena/jellyfish-metrics","version":"1.0.290-repo-sync-jellyfish-config-default-86300207b2f9aad6733f860644792767ec1e84e3","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.290-repo-sync-jellyfish-config-default-86300207b2f9aad6733f860644792767ec1e84e3","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8b948811c9130d0100c94211ce4f126515b64e36","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.290-repo-sync-jellyfish-config-default-86300207b2f9aad6733f860644792767ec1e84e3.tgz","fileCount":15,"integrity":"sha512-PU8q/f9pxt8TvWDwiHsiJkvrhIzJBMZ9ehWpl5zNSR6h7aU83oqDC3xPoZ4I5uS24uSiwgYlAEDuNPNQ+vx8xg==","signatures":[{"sig":"MEUCIAMivUIuOwoMl17BeqWBs+MYCXEFf6ps1iuGN46KHKH6AiEA/QfV1e4RjcG05fLc93I2f84mPOw5NULrvtzMc9Y/GBg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119852,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2u/kCRA9TVsSAnZWagAAbbEQAJzqrOfWPLtYkLKM+ain\nFF0Px4aSD573KbxOkGDV2zqDMuJ5el1iHOrYXZi07jdCX1/2UHcwWMsvAQ35\nP9zBExunJrg/OBh+lIF/7blhoCavYmWM0D95gTMgRBjbNsFmpoLFUlC6kwaw\nRPVb433Ecz1GrwuJN6C2A5CmdEvNicwS7yIPtqmA/fjtSe0q9/ROdxj6RFMk\nIz1Je//JTiIYFp/SAU9b6dkYnCnjGoaBhDj1QrU2nOJi7fQ1AaQ+TMPKkyVM\nZGGA3t+MOsNdL8DqLV7hBXwgMBvuTzQ4K075F/5DTO7MZi0sP6AbEuPCZdgF\nhWWSSoU/tk7ut3QdtmVN2OtqojJDg7HCQEzn/gYZlTz3wpxx26YoxfI0uKHy\n0/an4Oju/LdxVE76OZEFJtcb3+ow2e/UveVcafzKpE++b2hnfR3nHXKmtHXx\nlpkS0Bqfu9f4FuhlayIGDUdTBuRnYyA4ic5gJfjfxEUI4iGRGKBh3Aw+kHb/\nxPQmn+xFl5sSt4FxJ7Xc4hAGJ7kE6MOEM/7m2BHN7wWecYWf6dY+VHOpWL74\nCF/ufy0WJCQL7dCsSz4wG/c9a9UD+qKZwjAcTijEzmF2oof6hXkTWPv7UrLC\nEQ3bO+mRTbrdWMvngQQ1/oGr8WR6ZA1VTeVbeQhg+ZurYrXKzkhk+QqlxeGH\nxbk4\r\n=3MTt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"86300207b2f9aad6733f860644792767ec1e84e3","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.7.0","@balena/jellyfish-logger":"^3.0.29","@balena/jellyfish-environment":"^4.3.2","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.3"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.290-repo-sync-jellyfish-config-default-86300207b2f9aad6733f860644792767ec1e84e3_1624960996405_0.7265578748443808","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.290":{"name":"@balena/jellyfish-metrics","version":"1.0.290","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.290","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b030328073f60c3f78803b8232c3c59abeb190f5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.290.tgz","fileCount":15,"integrity":"sha512-eD7/663XJErvdeehJsZO4wgqaXe7afB34w55TDn/JwOMslU8mBrqaCMB7Zh8sXzHGs6YTeC4WiNHnW20bECO6A==","signatures":[{"sig":"MEQCIFIMS8q3JMhUBZBqW1XHUKGc6e1IDnN/eKSNRSqya4a6AiB0pBSY8BjiBbupI4DSgebZ/5uv0BwPjXh1dCNgig20MQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119776,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2vIOCRA9TVsSAnZWagAAZjMP/RUG/0iXw+Pu5mfCSpR0\nQnkHtSyyFmEDiFPiXAJJlnoZ+MwCNZ14XpG42vF3CCzx+b2L7t0wYljtZNo7\naH2IpjqNPQFX2nGAZy+Mlx7S1ytICzA8UAWKW+ud7voUNa6YsP1jUl+a7HzF\n4OH7tjGJESP1Dvhaf/QV69wbHD7e7vyIng0M2fGm1G3nTM9q/kIvzIS9rnfv\nfa48Z0Ykl7V3DXBHihS0qrXWdE2OoMoM4NGj5/54wnepKrAXHZ079Rz6bzMp\ntQq7HJIt5sK+lfV1T61FJ5T10gL6Na5AVrTSNdtPlrtTIr63QGefoLpHIVz0\nb0ZxcUrKZDGuxuNdjkIT9Vw8j7WEN8gAmnuxsOI9/yNtbJUhElIA8LqpemN8\nPSI3m6rvI4mrR9mI3iA/fVqS8qd7A+FwGpEbYNHY3ZNl3ai45TDmXk/x4e7U\n0khKerrnscLRg0ilD53RZkg7QkibZFVv/2nT6HtcGwIRqYcymLtQze2GHXqb\nbL85daJ3JsdTz+X63ZeMGeobpkQXcXilIYhGfH2ZDWfmayTPZ/U1ChdWXV2H\n8+mChyzkfozuBeG38BrKEih0hYOu4H5fvKOH01CEEupKjWWxM20VIL9H3ZAN\nZC7xiCrRgwpKpgnjwBqJGrlc+EjPYaOL99ExQFO3ywM+jF2Ampag51qOMj08\neESE\r\n=g8ex\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5798cddf483a9e2f2d0ac040c6517eeca09e777b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.7.0","@balena/jellyfish-logger":"^3.0.29","@balena/jellyfish-environment":"^4.3.2","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.3"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.290_1624961550215_0.2633784791390834","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.291-renovate-internal-patch-9eb7b91c7dd3011da991bd21d694737d71371778":{"name":"@balena/jellyfish-metrics","version":"1.0.291-renovate-internal-patch-9eb7b91c7dd3011da991bd21d694737d71371778","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.291-renovate-internal-patch-9eb7b91c7dd3011da991bd21d694737d71371778","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a08d03cb2d0526c58e28a9842237ff292fca6de4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.291-renovate-internal-patch-9eb7b91c7dd3011da991bd21d694737d71371778.tgz","fileCount":15,"integrity":"sha512-Ud0D9GkgqIs2fQOD5FpzDVqO3nwd8YI+18g9I3daNB/J83tTuxbbz7r3d8nFbCh2psCBd9+QAucxZzgPojfPtg==","signatures":[{"sig":"MEYCIQCOnucp4LZ7NwXCPn4206pboQIdcIiCbp9BKO/w952jtwIhALlBf62zUQvIu77EyP4FQdni/5NhMsjLBX6zcucechY8","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119944,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2vOECRA9TVsSAnZWagAALwgP/R+8+cQwQQ9js/lQi8e9\nZnXiHM0WGfYlhD7yPAnAbx6QxROTTiHVIzy6Aq/1fjm3/NEdz7QBz9kn9+J5\nWcvN2OkWkHnMlc4VzmE/iz79zfyzvbqYEs1NR52vClHGo0Cwwogq1Z34egvI\ncSx8Fn1aANhAz1AO02DYhrWRXHk7vg0UZrfAhKnckEVHymhuiyAWW9ZFG6k0\nfL0J63SsS8U1ImxCVVYQIih5kX08Mc6F5dVnZ5CQr5KlSLr6Yy0UcxaAUsFf\nTYVQk863mXSwsxhzsWFBpatHuSWFABXFv+gOKfj37/YraVeM/728bY71RL3W\nXb+7XMjesAQ1wS9Cj4zRWWCYl+CL32ArJetouj15L7DFETtNY4B5pig4mC01\nzTEyJ7jVlqL7KehaiuqeWiD3f6ob2Smy372he9QB6Sje4j6IE9hI1BEUHTBg\nT3XKIwLSxb4wrmR0gKyB/ARcVKvPnp9cDCs7lYDLtoQ1DnLLF6/GyThgHkFz\nzvMCZ0hrakuZYtlOiXw0tF/CaTZIhAlkEc+45Y3VK6hER99zhpDab1oXHdAO\nQBPDgu97VHFD/WEMd/twJ0LN0s3fCO3OOK8WPyKFQaMsp9YOpXF06Wv0dxme\nyuY3GBlHEVwteXIdJV0/p50ri7vPy+bEdW6+7DoCNRr07toxHCMtEYKVjowd\nPweU\r\n=Z0yv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9eb7b91c7dd3011da991bd21d694737d71371778","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.7.0","@balena/jellyfish-logger":"^3.0.29","@balena/jellyfish-environment":"^4.3.2","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.291-renovate-internal-patch-9eb7b91c7dd3011da991bd21d694737d71371778_1624961923631_0.44217100944680543","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.291-renovate-internal-patch-5baab794c96b91895c655c98de4057d1424eeda8":{"name":"@balena/jellyfish-metrics","version":"1.0.291-renovate-internal-patch-5baab794c96b91895c655c98de4057d1424eeda8","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.291-renovate-internal-patch-5baab794c96b91895c655c98de4057d1424eeda8","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"feae1d289c273d950c6c8733f34f3c5adb437e4a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.291-renovate-internal-patch-5baab794c96b91895c655c98de4057d1424eeda8.tgz","fileCount":15,"integrity":"sha512-XZ2hVLgSEKZtOkhoKfj4hDOryclqSNESQpAKJPbMHXJbk7eWESjFkRvuzZ7B0p+/Vn1gn1Ny1EbppjW2sZynhg==","signatures":[{"sig":"MEYCIQCSAAExeHXhG/E4GX+REBSjdzjCsZnRix5kkM/z3zIXVgIhAMlgLdhNsGuRiuQ1y1VoOwE/mdVo9drk6UuY56RUQ8lz","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119913,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2vSWCRA9TVsSAnZWagAAAEMP/2RZNAjH6+mqFpZ3vr1b\nGD9uEflzvJr4+oa70DMJTbDX+VB0QeWx6DhakMejpvdN4OqIiXYxT0/sQlqS\ng9ymhCBgyRziEpuIy4N+DTP0MtOABnWWkRV8+djGRyu13s/HjYZdshe2Yrai\n0uJZNAYYsrs0ujIqCRVtRqKnasX/u3g8A45hAP9lVSk22EzmZFzz4PPQxIlW\nLEJJB/3k+VIjfqTuUcPnI2q6f26m1ScHFNKc5+5NJx4A2QWCWBxPQOQRP87q\nh4eIZl5NHiqxk/PRyyebMBjeJth8GWtQJrUffXuKqf6Ty/S452Qo4qXa1CHH\nlRDdOr1kAnlWCX53S52cRNAFOQf3fm3WugMGCFZ2uKLfcAeKzJ5Qmm8IL/Rp\nj22TtDOiRCv/O1UvAkyVXkFVOGWr666nCCoD52rhrHjJgMwzdatSYFsRLClE\ngLQCod1P3+gdU6Dm92YmoN0FWnw9p5ywKAz4xoN6fFN+snwjixcHA0zDHms2\nsWh+12a1yuo0XaP5elfMLHNIvm0vb9JbtM+FehDlxFX9tLr74bIbexJs4dZe\nlufdbjQtt3jcC3p6JcBk733igvof3ObKwZZwvMMgqAvAL00G/o0piEOFItat\nL0gJV5/KHyDRZePuti2prz4YIRgpa7Ak/ceUmlZQ7pYWfJekK9JNY34UC2s2\ndS1R\r\n=MleF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5baab794c96b91895c655c98de4057d1424eeda8","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.7.0","@balena/jellyfish-logger":"^3.0.29","@balena/jellyfish-environment":"^4.3.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.291-renovate-internal-patch-5baab794c96b91895c655c98de4057d1424eeda8_1624962198507_0.6820038831818722","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.291":{"name":"@balena/jellyfish-metrics","version":"1.0.291","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.291","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0651b821bddd25f252fccff0228105eb0ae0e065","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.291.tgz","fileCount":15,"integrity":"sha512-E0ClOvg6UAAfw6XfIrLGKblrjYhLFsLcfAYPos0EyyWTN07lCd3tuWg5TZrAQDsiXWWppCv3kr/mLLzHPw4bAQ==","signatures":[{"sig":"MEYCIQCvV0vrB6pZ1eB4XR3XZErTnOp/U9dufHUvd6imOiqOdwIhAKN39+mVB6XWvZcTrAm+OphyIuzoGPlqPXvcnOoC/OXl","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119848,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2vXOCRA9TVsSAnZWagAAeQEP/1A2Xwm+Jp0+Tzb/0rGX\n4cWqk23Q0/+4LJuOQCCDbiNtXO+yuyBoQc1uykLbyiH2sZRbDKrZTzIB02Ar\n0l9gzrJ9R1v3Gfkn+SWRiW8tiOK9OZSkttC3F4rIe5YNESQLQO1zpQN+1NQ+\nw7NM9owsOKAHRfCIeiY/Daot6HHsCjB4i69nWX3jwkB3ktubcKoUNn3N39z1\n7nOldPIKzr9NlhK36oEX8ry/3GuSaWnDN5lcwokF6TLaIhr65eCMExT1XrKb\nQG3SvXZ8UTJttycCIhmZPt6E2QUX/3QJSJ3kuxtBe9IjgsOXhbvM9ra4+y1M\nIDktT4uvhErbM0B5ZM56lnQ+u4axCXpC9a2kaaCTjmb09xUDkbzoKxOvJ//q\nK04Kkalxy5/yUTl1q1gdKZzWqDxdOQUg0sD5GpHnZLnhVqgt0ETLrd7kmj5t\nf6VBeCfGdAU57PWdwcU7aJzDJsQ92KTRPFqrEnwfUBYD6dj8lyEWu/JM/dB6\nNr+spzBcsyAiKndlEHn/KalgklDwL7cxEYJXYFug+HEwMloe2HadQvkHAyjp\nDk0SGy2ZqOS5yQHW8jc22LbtGySdWV2t3FblkXmqGRyOmcIIFUuKehGd9Zva\npIOd14onzXVXGegkomT8rGyjr/CBcaELH+kkW3/C8xkv0jDkMqW6dNiqrckS\nDXTS\r\n=7dr5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"952eb6ef30591867123137a03a375c7798fe0b2b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.7.0","@balena/jellyfish-logger":"^3.0.29","@balena/jellyfish-environment":"^4.3.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.291_1624962509961_0.5704027540895849","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.292-renovate-internal-patch-20261f54aa50c84a27c4b83fbc5ebef8202a3d2b":{"name":"@balena/jellyfish-metrics","version":"1.0.292-renovate-internal-patch-20261f54aa50c84a27c4b83fbc5ebef8202a3d2b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.292-renovate-internal-patch-20261f54aa50c84a27c4b83fbc5ebef8202a3d2b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4b2426db50b52dc8638b6dd5c3e5d67ec3fa7c1a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.292-renovate-internal-patch-20261f54aa50c84a27c4b83fbc5ebef8202a3d2b.tgz","fileCount":15,"integrity":"sha512-+C0OOwbk8s81KIc+80n/LFp33ZoThXmw/aQKWutsuTdrDnSd4okWqqP4cqi8v9BDrHOUzX5PZDwr+oCS14mINQ==","signatures":[{"sig":"MEYCIQDZyYM5q2ujzze2paL22AR+6IHqdTR5LKqToROLXoUZdwIhAK+DILLtUVHJ1v1kNB7gWzY8JOxPmX54pgtv5X4Mcj8Y","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119985,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2wmRCRA9TVsSAnZWagAAu4YQAKIiwUCmBbdtXGnbiETL\n+1oxqvzf/nrlp9BYk/yhZo/gLdVmRMj3jtrAgrNukOBfQgvjKkSUFaxHTpaU\nKRBvt2C2hHVUE7d6r+Hm6fF+wCgEg+3trKaYF8FYiLF0o+V5OwQU2iHDaAFh\nHboYTYJdNcnJQQurNZC6gM7RO7Vmljj8oegfVItrhODQJn9RA0fWJ5x41XnM\nLfMtZU7lrQUHWZzKvO1Jg536bPsOO+Be2vroBi5FlTJr4cdcgQII8bM4PQ22\n1d0Wa73UBqsNpOtG9ozNCmeSZ/4UyDNnIUEGrzCmzu/aa5k+Qy1joN/SnMen\nOfwaxXYY9IGi4u5CsisxnZkXIrioFyZN2CU87xNpXd4y4o82EesXg/i5RZea\nNuKSXauTALFIlcUpDHI+IuFdfdUyFv7q4BtXnqijGE1J2xtX1wdZ/4qABKHx\n0TA9/Cqfj9qA5Nul0J79VafhMSiQNFach7a2J0KAuidvB9Ypl91fZ4bWOF+Z\nIIWKKyJWQaWDrsj5NMmWO3a00qCV7lnbhZ/2bNaO10aFyA6zsnuyrtguviis\n+TefVglH63FPebs6gdUiwWkQRNAPeTjn92YM87UVemVkfox3shj+mDnPIPTb\n+e2rin8BYzCwhS2Hjq7ddf6Riz47m4pEfQS55c6cQU+dCryJbEi1RvcNLNoY\nNPu1\r\n=CSqM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"20261f54aa50c84a27c4b83fbc5ebef8202a3d2b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.7.2","@balena/jellyfish-logger":"^3.0.31","@balena/jellyfish-environment":"^4.3.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.292-renovate-internal-patch-20261f54aa50c84a27c4b83fbc5ebef8202a3d2b_1624967568583_0.99973334854214","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.292-renovate-internal-patch-f2a020154c9778e5a451f4f160098cf0a1c03a77":{"name":"@balena/jellyfish-metrics","version":"1.0.292-renovate-internal-patch-f2a020154c9778e5a451f4f160098cf0a1c03a77","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.292-renovate-internal-patch-f2a020154c9778e5a451f4f160098cf0a1c03a77","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"dcec5d4142db4f516cd141f285a0f627f9d10be9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.292-renovate-internal-patch-f2a020154c9778e5a451f4f160098cf0a1c03a77.tgz","fileCount":15,"integrity":"sha512-CGpJO9cm1ECgi8nTcdiUrLxNaDHL3bvy11PxLfu+XoTKy2xgxXOZDmt8tGUmMdeyD3QM5uvq5FTIK9Sqfqd1gQ==","signatures":[{"sig":"MEYCIQCyMCceHLHb3AljlgRrwahg2KgtoFRa4eRy2aEm0IP8GQIhALuVcH6hlbftFTZ0ZFKduH2xZOFrDqcKL7C61czjQm22","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119985,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2wpGCRA9TVsSAnZWagAAtj4P/jftp2TcB7m7Xu7wF3dv\nVBKAcHDE6fpw8p32KR1GCF5vj2BNwH7M409Eye2sA1hqjL8CKpKHcbyEj9kH\nt0SE15zY+44GJA67QWtqQ9KXYztuWAU7UE8DWEvWUTWR0RrtxpxYKdl//rbN\n3IMBBGLXI2RuZhjmqTsAuZJPghV0thHMMTxFO1WvD3kuH6c4EWhCUSHgVG6n\nSXJ4iEKRBJf0kpDjcKkCX/8x+yMsJcRZUn79xnlKJlLGmuIzdmENylfOkk1J\nIzYPdKaQEMe66FswOQ6WoOfZwCUoLFRQowP8o4EWHEi0mNoJ62wvgD4ubVra\nq+bxlF2YRy/COEwMBoWgv7WbzAku995gSbEPVvbHEUfvJU1DoIXDx2DKszeD\n45clQe3OyioTGsMWYwLGh43Nd/VGhZvY8vws5YMDyzoI9+AA2bQ5DhDR6J0V\niJOgpzw7Um15sEq6RNvGM1h4tPGGqG/r6XY8kRcp9PoITgHDXi+zHa0Tb4qO\nAQQl1MgWJAEh5MyjkNa8NK6wZzeCs5tdEpUoOFyUYwXW7sejW6oDvsu7GIfx\nZvRzYMoAPJmTodbBJUiv9VwLrWST1nBfrhNGRMDiqGBw/7mFLpU9FAVncaiN\nQkjpH6LWNTVAWrbIL55FZ/l1aEDzHeWnzjM/Dih2PFOvz7xATJg6pCWXYlZH\nFg0r\r\n=IufX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f2a020154c9778e5a451f4f160098cf0a1c03a77","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.7.3","@balena/jellyfish-logger":"^3.0.31","@balena/jellyfish-environment":"^4.3.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.292-renovate-internal-patch-f2a020154c9778e5a451f4f160098cf0a1c03a77_1624967750078_0.6965742869082983","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.292":{"name":"@balena/jellyfish-metrics","version":"1.0.292","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.292","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4cbb708bf13083d97460b0a1443edfb53290d58e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.292.tgz","fileCount":15,"integrity":"sha512-n6kyb6KwwoKQrdr2qq+9CsgHpXFqSOOtbiTaI2P/dK36ndNuDmsIwlVcyrlVyN/qgB7nw9aMn989ds6bO3RcqA==","signatures":[{"sig":"MEUCIQC+nuJHV82HzRuMTwvbw0avNa55RPhXFl7T1MVzQrxf4QIgPxugcCCf0Tkr9rQim1XIy8JevOp1Vq1ZlAhF1LJjGjk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":119920,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2wttCRA9TVsSAnZWagAAOsMP/j97WipDx9cuvPug6xzy\nog4SPg0Fd9Om46egToAC3yyRdcZj+19bblGmMKsc7yPiqyiCvRtlX9AuI0xU\nHLmPFPuA/SvtE43CT6SuSae8BZF0PbgVK15tOL6ZgtdQLErLKhQICQRjUklZ\nsnDyrHk8k1w1GH2HpOz5tFf0PEBslz3rp6vxkWUEttXiLxVJpUFfVdj6Y3Lt\n6A6zIEfRC1fcPP58CcFcgNWZKbEw2vUBeimxad2tNk5jqddVTx/kTv6/RmH1\n07HKyd9TCBq/sF51E5yJ/3F/k4H8VrREyBzM//mQtE6URpGbMFrJdqWbFmwb\nMBqiC9JP7JuPLbhFdRl/AhdowxjDR8L8YE6es1DbLwBY8tdvAVol/Wpka2y6\nU1YO8+Om30JsVyfKDgzFJXRB/rlBRatQNONklHqweoNRqAquTBzB9Lj3bUiz\nPBbdPDvMQRc7Sbh9M9fik6NhV5BBtoXxB0TFctgc8hqD8D4m5Z08x0sKXmUL\nB+FkIWzDlQzjwuqq92VfyR3+ZBgqnMGVMvSNaiXUUO1GIc0oBj94k9uvvqT6\n6L2BlE7HzVxuVAcfbI75sYUiSrjV3+7tWUfa3Mn2oOI1H5kx+TCiuah1hz6y\nQxC7YovSyUddXYpc089nbxLZiAx4iv6G9lTe9XnKPmFo5cIHGOmSBjsPIss+\nMZl2\r\n=lGxl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"823394edf03599d939c764ca65243cc1c952a478","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.7.3","@balena/jellyfish-logger":"^3.0.31","@balena/jellyfish-environment":"^4.3.4","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.292_1624968044681_0.9925982905158808","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.293-renovate-internal-patch-c055fa63ace7b2ed0517d9e846bb37e3b03a6a84":{"name":"@balena/jellyfish-metrics","version":"1.0.293-renovate-internal-patch-c055fa63ace7b2ed0517d9e846bb37e3b03a6a84","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.293-renovate-internal-patch-c055fa63ace7b2ed0517d9e846bb37e3b03a6a84","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d16e3af7d8b64dc59f02b219f4bd847949716ffe","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.293-renovate-internal-patch-c055fa63ace7b2ed0517d9e846bb37e3b03a6a84.tgz","fileCount":15,"integrity":"sha512-fXg+edTHIZiuYKvCq7vjaykG8GoCouxMuY21kd0E4AaGwfoGk6un4aGNdIPkmYRij9wVkc9VgQnYzWHPihJ93w==","signatures":[{"sig":"MEUCIG/ysXhbW9a/O/bZuBYMAmUTI7WvlX8Hh4Fxj6l5JqlWAiEAqfkT3f5Mmei3/eyBUlBsjaK09VFk0UZgLRqy9bLZKps=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":120093,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg275fCRA9TVsSAnZWagAAhUEP/3jiJ6O2lVPaF+Lnm4d8\n0uGEojEzQ0J5dhfWJ/u95oNctFaTjj9CSSa0M9yMb0CxffQuNlEbJwjVe2Zt\nWZ0FD0nb1Mtemsmx1VDpEC7kswKsynoTVyxLwmk/27TgO0untnpI+o7TIE3M\niQDbEsA5sNu4/QhKHHFshlS2tlZ6i2vzTChsyHkQ+1NgtZuXQS5goDxzqRfa\nOBffaefqhPNM4yYj3YuPCtAxIxbxNQvrEDKXPHbCDNlM7b9Zq+MPZTxon6Wq\n9CIzvs4noX3VftpgQ2c2H6xqPJGFslhwWaUw5Dn83NFucmpxwbuyVdme/gkL\nk58iiNjU5ROk9nKV4Y+452IFMvG/lgA4KdRgxaX5Xvr2WQWglc7k80E/Ew47\n7994dxH39gF9atw1o9wFgyU/hk11E6d4z6tuHIzkJ/tcbomwkocs4tTt+wHP\no5OJFAlnsnarHGuzyYAiPNGj+gn7nuRAb5eOPEXIPuK0ZahFLbAsdM/V3Mnn\naNc9GPDiTHVZQPm1kT2PrJr9+sbQwx+gsVBfw6oa8cMyLHh9476qhj7NFkNB\nSpOzBsrLr+771g1VLTBo3RXjUDUuSnk/n0sn579+WER7kYsHbQN56H+GEtYx\nA4HGqfGnMOXZNCvPCuwRR0/h+UTqtdR39H+2FKV+nWQUGnvSNw3+pqPsTiek\nEYHe\r\n=wZZl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c055fa63ace7b2ed0517d9e846bb37e3b03a6a84","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.7.3","@balena/jellyfish-logger":"^3.0.31","@balena/jellyfish-environment":"^4.3.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.293-renovate-internal-patch-c055fa63ace7b2ed0517d9e846bb37e3b03a6a84_1625013854575_0.014764853444064308","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.293":{"name":"@balena/jellyfish-metrics","version":"1.0.293","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.293","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7b83707182aee5d57b5c575ff0563ee8f6e95389","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.293.tgz","fileCount":15,"integrity":"sha512-5MU7/bfaQY9szx6/AU0Qgx+dx+HHeJBaj7KzhIv8TQrC/hxSYx9LMfCmTpVt7qnaY2KBsKo4K306fLT/Mc3YDw==","signatures":[{"sig":"MEUCIALjez2kjZbs2+3E6LpbrTpYq9USFj8+zqsLAueTJtsJAiEAju5drZnsThEdfdf67TVbAkGFZW25JgiuTuhn4Xjaz0w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":120028,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg278vCRA9TVsSAnZWagAA7cEP+wQ2JUo4yl+/QQ1amPpc\nr0EKtvgYV4RWAHUqSPbQu6peps5H/8zzVL5SCz8qT0vpiLNztitmZltudig6\nc+91q2V+oxVzTw+y4L882QnQMJlvMBeJYRgneczk7rMKj3JdDRCMo0SAGTRy\nURrqYM2rJ86SOADQg+0niJ8c4bIzYa9jEZEw2qxaOHyGJmLETFw1ajBT+NJ2\n0QI8MpvYr3pZONxuavu3jLVzzWuEiysrflmfTuiX+P3bn23i4z9+gkYuz5+D\nJxTocMiM4yUtojTFi7KMLeASxNVjX+pkqaJ5rD75YucX2XHX7c5PI49WoeWf\nM9tT92X8skvO6eBzzYe3o/h8FuaaDfJhSi11hjIoG4azYujk4uzz0XLhR4Dp\n2jC8LTY6D4yzrYSeQ5IXGx/FtB7ART8Plnsq7YPvZQTrs/xJB9MLAYNijTF/\nkMPyYrRQ3q2UYN9sYPzLdPEIFIUxUl3VVNTtsheHA5I10BdSKk5rEdQjZJsN\ngoWf4BO9kDZHr0Lgy9+t+6qkROABdb9rAKkt3v0Gl4itw/0eugkFhLZAUtJu\nIV9MQ/klVCwhNMJxNG+u7qCR3aLNXk5GC2Rzx4bhqbeD4h2ROPuzU/g91eiY\n7b7X7n1W63TltfzHAQqxn48U9lk+ywBR2UHcUZbMj6k/0eEkwv4qCED1lNGs\n4DEn\r\n=54pO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a161697e84a5a9b568a6cdbfe7c71a778dd3e509","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.7.3","@balena/jellyfish-logger":"^3.0.31","@balena/jellyfish-environment":"^4.3.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.293_1625014062706_0.9998384141675858","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.294-renovate-internal-patch-80aa639b4ddb1603704beb1b44d77b90191f961a":{"name":"@balena/jellyfish-metrics","version":"1.0.294-renovate-internal-patch-80aa639b4ddb1603704beb1b44d77b90191f961a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.294-renovate-internal-patch-80aa639b4ddb1603704beb1b44d77b90191f961a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f652f623b9ed51c8f7ab9f2f695b430b877a9464","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.294-renovate-internal-patch-80aa639b4ddb1603704beb1b44d77b90191f961a.tgz","fileCount":15,"integrity":"sha512-I9TO6YMA623HcM3YNDvTiRmF7qVcDNzlzlnl9Mz6htKIWbJcqiZoxjHumWS/f86JmpoqodD3msBwkrk0UwSctQ==","signatures":[{"sig":"MEQCIBwwxqyZ1wcgeWtyWw0q29oO4Ajt8nf6XA23WUPNpAdCAiB0T2yVyUUjc8S356cQfx3+kApk+n3mgTyaN/i7Wd41Cw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":120197,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg29y8CRA9TVsSAnZWagAAf9wQAIstMNp5k3L1Uz7xCX66\nqbARSR7lFdEfZMXJh2KRJXN+PRHD5qZOM0nGuDOYsM1PFSYp2suJHK/prF/s\n4aySZrt2wPgnzN/U0Z4iew1xsxeN+VeiPySNWdHbpJcJVWEnBz5wYSoUugSK\nKuJdCdp+d3Q55+oaKyNEfsiqp+kJ5qlq0Rlk3/pV79glsAyvi7SgpDI6Wqq9\nikh+EKF7JdWcovtCDrBQg6bXyf290oXb+kj5eVNOzBJMbM7u7IsfdC8+8EPP\n/FrdntcOYxVHuw8gSYtjYHiUEuEym1y0wSFtgEDz0XAjFZqeV22GvIa8/0h6\nZB/z7y75s97YiwoIK8D7liQgtOWMP72DFdNqoeyAPfhU83omLE21NZWEdVWK\nJBdjFrFGUPcxw96+aLE6T1keOLg0NQYtzLdhuFeh4nEIfLMfJ7u1V+R85JdX\nhpv3wzXjhONiUcEYSIaA6NT5axlCLWe54MLCGA2UidBOqJAeVH87gfQ+r1F6\nFiiNsiJrMt/ZUQGAHeAl9jezIc6VhOdI7gQc3rrHVEK9EGvZSX71mZuPj+Q0\ncBRNi8Jw1rouQ9C4kehRTI50ut9Y4s/jJSxYCRIgwM+k038ocXWhKc1HxUjG\nq6f/4hmJwocohSsq28At4KzisyNWIPA7i3tJbcqQLGuobdtREaQZrsvek2ny\n16a0\r\n=c6BK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"80aa639b4ddb1603704beb1b44d77b90191f961a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.7.3","@balena/jellyfish-logger":"^3.0.34","@balena/jellyfish-environment":"^4.3.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.294-renovate-internal-patch-80aa639b4ddb1603704beb1b44d77b90191f961a_1625021627798_0.6808597542327728","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.294":{"name":"@balena/jellyfish-metrics","version":"1.0.294","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.294","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"21d33debea64f99ddc9a859f6cdaed8aa1075c35","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.294.tgz","fileCount":15,"integrity":"sha512-085xRV9f5WE/XKQRNf3XA1c0d6ieILTJdeS8x+2WktuyQFfUU2qHxSByUCDHWQWhc5mA+1PqCFfrcpNIGqeC/w==","signatures":[{"sig":"MEQCIEqCX+Fn5yfum/UIgdarw4aRhMf1NaRA4IuPpYUkiTBVAiAwa5PZXOLEGmdormQtRRxM4B3tXBkF8L2UCev69wkQ5Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":120132,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2914CRA9TVsSAnZWagAAPcYQAIbHvjmy5fqFDsNuldzR\npUPmnBf5hPl9xzKYz4nfbcGvsn+MlJJiknimXr1EvYAzZj0KaXDRxY07/7OF\nEBuD46JBSzMiS686kuQ8xq6ztr8aqbFBg+7B11iM1oQe08mevN+sTpyh6lMQ\n/VOUNMNYQMSX8awsLmNWFTORqedkCjSO6kzENkJhNHOPQBoOEUyjBfgI4WA9\nmJbp+ONu5LulvhjBc0+VCN7iI7L0hTdRnfDHBdLLHFyZl1Lk1Rf73ckx13sK\n0dZMh7GMeWq8Wmc0iC52lGFgc2u1w5sGVUBBCtQpwIt4BXRUlyHVlT2qr5wb\nCL/llF0Xt4PT3ATDGaXf1IPPbOrkjdqVZoq1S1TC6VsP6FoU2lnzvL0kNOd/\nuBmpCbXS+f2wgnaArB3BmLcwiMf22elyBavdGXsrYQHB23eso05RJPEWAA1w\nUuFoM5iO1gTL5URQ+iTvPSrW3Qnv1aUIWiZ0pU7+zX/u1pVudFqzBaqjTuhj\nPLDat6/Vhyo7kO1ZcGqTNiDNMS7Ql1IjevSOYs6hcZnAiLTp9dGkSkDVWrhp\n7izpOeLF+fFK6WD+ekWOrAaNRLNW+DFoKMO25ob+XMZpDZkDVkR9H2lfyffj\nHoNXkZ2VMMk+n4wtpjaCAwrVGWKocPJ4TrBcJ/Zi908VREqcfV5/6ZoaPG8k\nlXuA\r\n=eq7n\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3fce95f6071f468f3feaa279037ef12a203efbd3","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.7.3","@balena/jellyfish-logger":"^3.0.34","@balena/jellyfish-environment":"^4.3.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.294_1625021816050_0.6188232866309533","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.295-renovate-internal-patch-ca4f1c0099c51a9e84d20b9b41742ebcee0e8a6f":{"name":"@balena/jellyfish-metrics","version":"1.0.295-renovate-internal-patch-ca4f1c0099c51a9e84d20b9b41742ebcee0e8a6f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.295-renovate-internal-patch-ca4f1c0099c51a9e84d20b9b41742ebcee0e8a6f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e25ba1ad98e7e1e557005ea5fd76fe81e710ddfe","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.295-renovate-internal-patch-ca4f1c0099c51a9e84d20b9b41742ebcee0e8a6f.tgz","fileCount":15,"integrity":"sha512-AQ1DjjbF6x2xleCRU5s+z+Yxaf7mSFr7KRM3hbLB6YOA5kphwXcOfdFhDzV3C1ZnXJVM9zQ+enOs4egKERE0nw==","signatures":[{"sig":"MEUCIFVaH/9jvAnYqg2Ho9BP3ywpQNqDFaiHGtGxh49REL14AiEAhRUP8i0KQaw22fKdhu5STZwktknUbofIMNTqDQOLJ1E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":120301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg3rt1CRA9TVsSAnZWagAAhkAP+wd1br2SmTw2pGCFCFCb\n+ab9TLu1bU40+Ah7NRkxIZBbl/eS572llq/VVcbYG5pU3YbN3ilKDTdnLhWM\nL0hhqhAFELtzlRcxuq4BghrDO2VLW/C/SgPyFeEclc/VurODgHyVdflcO0j/\nWuS/RcEGbDHnQohoD/Y9sUKTwjkf2OkB2T3mnwwPEYcjETqcxwSKf7xOtxN6\nyAhUKKBkvyehtYbhdiJNBl8EqVOFtW6S6ggFLVkJFgbo2bz4dyLoXffOCIyA\nK5Yy+3A5SVSU4+n46zXn3ft/myyGHWX0cxgO64tu5M4WbUlf1dtTPjwsd697\n0CvTA+yqElD0SlscTxIjlYg+KXvdhn2zHDfbo0xQAK1Mu/Z1sh1cdMlRTZbO\nMDs1lybPvp+MNFpK156IUJdO+FKFOngMHiOvYzm7J1RzSy6EZ0blR+hHXZKv\n1j4eDiGjW7XGbB0fFw3iHIYzsQ4yth/fL39+6Ul+/ie3RGHYQ+xLcgsX0NxQ\nVMeQcO3nda7GSMiV/Wr3G6a9NMYu0RSmLhnvGm3CgB0pxo7Jwj1g1X3EGhaF\nY6c+toIVzKwflPDd5TGdOzbAIX0AjOhZyj3H3NKXxO73yngnz7ba5TIzb9sE\nkDW1Jf0urkRzS9nnvt3FNUGGnNHHv2wPHS7+xdybOZNIzCxLN3lW4Nzf5BoS\nFVkg\r\n=SfL9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ca4f1c0099c51a9e84d20b9b41742ebcee0e8a6f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.7.3","@balena/jellyfish-logger":"^3.0.35","@balena/jellyfish-environment":"^4.3.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.295-renovate-internal-patch-ca4f1c0099c51a9e84d20b9b41742ebcee0e8a6f_1625209716693_0.581501450866184","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.295-renovate-balena-jellyfish-types-0-x-2258dfc8852fe3eef451ba0096bf32dcd89b9efd":{"name":"@balena/jellyfish-metrics","version":"1.0.295-renovate-balena-jellyfish-types-0-x-2258dfc8852fe3eef451ba0096bf32dcd89b9efd","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.295-renovate-balena-jellyfish-types-0-x-2258dfc8852fe3eef451ba0096bf32dcd89b9efd","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3228847f5ec2bce614a0f4f8180ccc2e5dc74796","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.295-renovate-balena-jellyfish-types-0-x-2258dfc8852fe3eef451ba0096bf32dcd89b9efd.tgz","fileCount":15,"integrity":"sha512-Qn0rNzoW3dqWQuXQAuntRdFuPnFhM0NQx2A+BcK3aGLuUxSyUxUThIRGiMEumSNBIEgw2K9GIqgE2lrK+YxKyg==","signatures":[{"sig":"MEYCIQC0/sy/qhqqJ+CEleoB5eG5+KG5w6pA24RB6zWfwjoNogIhALNLAqaHUOXBxeXxBAYaxZd461cpVZc1OTDl+hlP7P09","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":120311,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg3ru3CRA9TVsSAnZWagAAGa8QAIhOg/92bNMYaEZt1RAZ\n0Q8XrDI/MFmIiTwuFYVEcNhSyF+VnM65RCUkYAR+JryJHB7TMT83g16SdeOp\nuDJ7JjAEB4AejxWz4lCLQH3lMii5ARTslcd8pmonVZxL0GsnESwZfxarneuU\nizI2zgAznjoZc1rB3w7hGNgbHrtFlp+Xn3uE0wDfM3H/L8VW04EstAo+mnB3\n3Ux0dqFC2Fy+1YYhjsfBRWKwbrJlYn70TD9efP1cldlQ73R4osTL/GBxcbep\nsi17+3jJpOWZr0jOFNQC5Owl+J7ebBkaVPVKtNDKKMDDBIUWJlDHH9mRY0iw\nG5R673u7/jR9qmNmyOYEt92dKgf5R55zmHT4B3V7u8KXQ37u94sDOSku28gS\ndyw80U+505HI0iU83V8Nlqx8bbofzj9ApVwEqgdmTacCZj5HPuQNA1G+bdgT\nz7BgQG+M6/zqnIeJdxUp4C6wa7zaTIs3mY3uZXjlSQfW3YEEnBkJd2x7aP+4\nhNdNOfzf/3WKEsrIdVhYHq77Ztx70F0fnQUeisSrpr8dSz1zQCbuDhf7FB/f\nlLqXDklhZG8AS5LNLPoOwiOybzh5duvsr5vWEuwrDnM6TxxdGiP1gECb4N6d\nF6n/OnPLTGkrYsFbj2Smr8q7R9dmtUrxxo3PrPOm4bRHBtXTVKmp5yCydFEN\n9ShK\r\n=QRa/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2258dfc8852fe3eef451ba0096bf32dcd89b9efd","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.0","@balena/jellyfish-logger":"^3.0.34","@balena/jellyfish-environment":"^4.3.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.295-renovate-balena-jellyfish-types-0-x-2258dfc8852fe3eef451ba0096bf32dcd89b9efd_1625209783348_0.724986180273097","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.295":{"name":"@balena/jellyfish-metrics","version":"1.0.295","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.295","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"14bde1fab473bd91c568c40f2f1d57d04b99c2b7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.295.tgz","fileCount":15,"integrity":"sha512-AL8rYh+osME/t1obDrpA/2OLW/yRjU/7fPvsHo79fAGGrCPKLSZgY71XhzVPi8jxf9qgOsCsEIj/nXauAJd96w==","signatures":[{"sig":"MEQCICKqJSYvgzGcluccfKwEItaGZNV8FKHqePSxWamouLJQAiBUsqDboEsouwFI8nYfRZR+MoW68ZkOgIyMml5BkTEa2g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":120236,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg3rxjCRA9TVsSAnZWagAA7oMQAJj68vJHGNEiobmIYxmK\nRvJZuOtfBMkv+NAfIGEMIGQzAatUIU/wK46XZV/3x0NeKC18gazPm09nwdf1\nAnqEvXgXMQCrdnr8xuwJw3b3wbWxV7+a3Npv6hT6nOyPk+qlFxg/6peJuoch\nkj44DVh8J3+0HaSHNaeb7BL4HIvOIxq59tYmZtuRpJtDqbtZx1H6M/JT/XWi\nPx37bUsygVUGrTggqAhri/MBTcKjMyoSmnLGfzq7n7zvKInL/N+CrQd2zEir\n7jdSnMb80NxBOBAMtcRZb9rILGb+B1OuODrYynOJOgT1Sxk3kf9veoLilvBe\nHJ7SI+sJGwetHKFrvzG5MoP9RWPn4NeqCuw9IrN8W36N4Rgrix7JIcPsL9VO\nPwW8f8faZWQvvcZRtz+6BWRMM9dUX6IJ7Ey9Y/KRKNrWTH0Zv6EC542z+Ma/\nlHohka7uXK7IAP/LbqYfx07WvbfC4TgIMXePkGZ4o+2DkSmc9c8Rt6Ma9h7g\n4Jt0VF+xIpVp/fcAW3mlZlsDWnHNzR4iXPM+ZVyD2ZUsxbpLNAkqtB3WKp7f\nhdlj8ZjLFq7pyZuIUxuUlZ86/qFhN2szOw0H+JY1bHUF1XzPy8qEQ8KvcBMn\nl7wuMlrTx0LxtD1S7z/k5/nDSjK0M6rtkpBrYuVKFzK3QCATLpz0X4du19GU\nf9oP\r\n=RlpV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"dccb67d5fd668360d4bbbb7a75fc3cc5e558f3f9","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.7.3","@balena/jellyfish-logger":"^3.0.35","@balena/jellyfish-environment":"^4.3.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.295_1625209955037_0.8985980679649319","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.296-renovate-balena-jellyfish-types-0-x-10b17d236eed3c9edf3fab740f7025c56d250aec":{"name":"@balena/jellyfish-metrics","version":"1.0.296-renovate-balena-jellyfish-types-0-x-10b17d236eed3c9edf3fab740f7025c56d250aec","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.296-renovate-balena-jellyfish-types-0-x-10b17d236eed3c9edf3fab740f7025c56d250aec","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c9207ebd92a4b9f7fa5562b79d24c3d145064db8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.296-renovate-balena-jellyfish-types-0-x-10b17d236eed3c9edf3fab740f7025c56d250aec.tgz","fileCount":15,"integrity":"sha512-I6IALqFFdFP5o2uBtcSiWcfJC4zvBXL0VFo7ZdtdgCtb9CMV9qhUrQ5xVoDGiRfaYc6QbluUC1LVLNs2mmkuCA==","signatures":[{"sig":"MEYCIQDt7WBmJNB2hH1yWlCzmwDmhGQyP3vFo/mcXdzI8YUBmQIhAPEyS1yNq2iZz3q8u5sHWoJcyIoNVjLcyD9MWRKAA4jZ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":120415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg3r2UCRA9TVsSAnZWagAAxhkP/iyWT2pTXjM7fLnJHOyj\n0nVRoDOpD6hQHDU8rM8HKJ+FH+LSk0VamfdpK60X1GjT/j4p85gWK4Xw9lC6\npvLbQZ1MWWPVWo3chHXo/4wR18FXi0e5gl6hswSM8L8Z+e6QSlkmu/GDZ530\nacQCCC9jP8Y9pILJzk5W5IsImhDWmssDAwsJmvLJ2gZV/fp0t4smem5xGuf3\nIedAVLc9IHDd8zLsQYwogtGK5rHOSzVMdxJvV1PBKwS5qgr2w0vYK9z6XVIV\n6pAf3NO2gPJ2TYYNUXauJ0YzoCbjkHImh/FE6Ry4ZdwGbK6WrrIS1tydhG/E\nUp7fiIBb9idk2NpXG/YORTxBd5LWoVO56HpoYWozy6IqwSrZZV2h3bXgaSDZ\nx5F+PTAX6FshzOH5Tamb8PWjfzIb1k01zqUDAc5madhcnA/zRdg5MDDMNVbh\nFao3/XR4xRQaLomawSDC267eS9XG1Ft1SzvtsI9wyl9xlLqaeRcekLwnrtO8\nl00eDyfizEEXDYtcDZ0NFT/mtlLtXViIMVxlsyoisNuWxwv4JSPIENVb6Gh7\nx5CBmsJgCwDAFUPQLBhfK/SUwz77qVXRFNtZmMWwxk8EMRI7UfIbWk+5BHzn\nQ/SudM/5+3SWqNSOpkC5dDnxiQLULCcmnpYXxofjGk4T4POANfrAuy6XnxZY\nMoyP\r\n=pxYS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"10b17d236eed3c9edf3fab740f7025c56d250aec","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.0","@balena/jellyfish-logger":"^3.0.35","@balena/jellyfish-environment":"^4.3.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.296-renovate-balena-jellyfish-types-0-x-10b17d236eed3c9edf3fab740f7025c56d250aec_1625210260062_0.4392756465851757","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.296":{"name":"@balena/jellyfish-metrics","version":"1.0.296","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.296","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6c8cba7ee3560cb534fa09ae4197158d5a6ed355","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.296.tgz","fileCount":15,"integrity":"sha512-2s77ikZ6pZlTolLrkSuxJ4W+c9KXZII7oK4xQKT5nyXtA/VumU9MLgNp0VyZvxPt8K0ur+uGf+PK5GaVGGbAjQ==","signatures":[{"sig":"MEUCIQDmuV8HUtbJxGLyArSV89HjREh6Ee/Dv/OfJwlA3t/hUAIgMVSmqaRq1eR5raPqKP/QofLqeu8gFIL8wrapjItiwNA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":120338,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg3r7SCRA9TVsSAnZWagAAcm0P/jZZ3/p2ewFpE58fJtyW\n3UBVwhpDoEGtYSBCvfycjTtgJ61gc1RTrpkTg8ct867XBLqxbpUuSQv3CT55\nkBaxF21HAY4zkLnn2UzVCZHD8PtZFAuUBtjBnMEXrRJkRqLBY5MK3rGpchoA\nIIhofBVvEe2OXaowQqdXnP1QnKW3KLL/KjoRRiOlEdB7B2vlLpgLfyPJNpiI\nuaH7VrkW7moFeWWSiQE46312+FyegBcaVLYk9jvaP2IrLR3pgu6pke0jQxWg\n5QuA6PNTzltHph6QbCyVxUeP2HlQ5NZvdjGyawgbeQvy+LxDK5IXYR6eWxva\nukA5dTcWRE60cRZig8AbwaFdwHr7Had8LGv/UUpqA/uDp+PAhD+7Dw2Dqj6y\nCut1yOXglEgvLr1l7J0qaNzEIa1v5q++uQH4EEB/0WKDLGc8qcoSveGrzTBw\nhre6Sqe5gQFz1aSCl8LVWmyuOy2VCpo/luHzsuLYsSC3w7u+qfK52UhhRmP0\nL1Q8ApcS55BmOHYZIMLBEHJ/jjsUZybnHh72gMUqH+onWYWrKG/EBesZJ5HR\norfzWjicy4EwtK+RSin63ldATBwifk1vYCTMfosB/NMF8wJYVa+a+hWnJNF/\nuoT28bcj3Q1YO3UWjWC9BUsvMfGylmXYEf3e4SFgitA6Tc401WuElb6XCgps\nqPpC\r\n=35fN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7cb2155a9966112e0dd1da0ed4ffe0c9c911e11e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.0","@balena/jellyfish-logger":"^3.0.35","@balena/jellyfish-environment":"^4.3.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.296_1625210578207_0.5205431071921267","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.297-renovate-internal-patch-0301cde459ce62014cbe65ff6544b013ffb25d4c":{"name":"@balena/jellyfish-metrics","version":"1.0.297-renovate-internal-patch-0301cde459ce62014cbe65ff6544b013ffb25d4c","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.297-renovate-internal-patch-0301cde459ce62014cbe65ff6544b013ffb25d4c","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c64e6e2803d70a37448094b2204723482e62d8dd","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.297-renovate-internal-patch-0301cde459ce62014cbe65ff6544b013ffb25d4c.tgz","fileCount":15,"integrity":"sha512-E6o+ww8hw5xeJbP2POqWy9LXuHZla2ZfzML7PSsig7Kv69fOnq42BfV3T+uijy9VONGXDlI/eICVZSUPfHpXTA==","signatures":[{"sig":"MEUCIQDLY/Tshxj5cSR3iI7PEKwNsHCCDFReqvNcjb80GkSHHgIgPD65UzqJLvTfJTaoboLXsX99StUAU0knyjzD/123dkc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":120475,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg3s6TCRA9TVsSAnZWagAABFoP/322LmyCHH9ehbn/4nMy\n6Kp+iAcwQT5PLA6xM76DLy87n4UW/BIt+mqgr2QyhiHmgxPP1Hk+AsFbBcgF\nc02A3rtOb4uxYkuLAA43yJRHnIUtcoJEzypmFd1ylIVT43/0QN2kHzZGHH5U\nmP/3yhETmRkZrCmuqSj2KWQnPYUBvApFlso4D2iNc7T1zNZ9By5eOk8kXijX\ncPyanbr8+y/495Wz/XeX+9b4+wnr4Jt97zoGe5r2tPtRlmeKz+SaasiwPd6B\naHwdTzWOY2YNSedX7DSSr6UrJx8hFCTdADW7XYtAgkoYyHf6wvtScLZxwcSZ\n3QSgFU8lof6Qi+FsH7DPdE4/MwgtHOkK5MeMO1LtX1YY6Tu5AhdWry89SkrK\nx8DyGxdE1JKKhsJF2l8txqpqRbyr+rVcpJyok5kyHB7JfAyOT9DBigJsbZ1J\n+pCwUJRQwMCJjD8idqZMaZ4EEwW/R837OyJ6ICei4nGsXFhqDiJWfDbyh08g\nm4z1jxa2MADHp03zrUtwVIb5pqldDjfsoABs6Ev/T2FfFlqI05HoLhMW9LSF\notVRyT35Ru1IpGvgBGsu6S4aBjo2P1AFKvHuaki1Crk/ui9ta0NMimXiRxBd\n8KupSNuh46X6EcdJuVVR+zbUowFza0yvYEn8aqU/zOxGDQqp14WL/gYWJeSA\nN7XN\r\n=13Rk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0301cde459ce62014cbe65ff6544b013ffb25d4c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.1","@balena/jellyfish-logger":"^3.0.36","@balena/jellyfish-environment":"^4.3.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.297-renovate-internal-patch-0301cde459ce62014cbe65ff6544b013ffb25d4c_1625214610821_0.6125227457533542","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.297":{"name":"@balena/jellyfish-metrics","version":"1.0.297","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.297","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"951f7f4be9d08959c7c2ab3352b559eea42d74e7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.297.tgz","fileCount":15,"integrity":"sha512-TWCdzXoXIAGH4EK449N+GjSzsP69sGJ/H6KSlFB74+B1Rqy5xiBe58c0N2fI/3dZIemSXoYJgO4l/eiklS+saQ==","signatures":[{"sig":"MEYCIQDX2OFKK7mkgjik22cZlWBOW2qKc/62Sqpdl3w3abv7cwIhAN3IVdGoxoxKUhV76zajxAs+QalXGPyktpHqLOjbweS5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":120410,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg3tAUCRA9TVsSAnZWagAA0hUP/RJyLTLkhyDTGQ9PyQ1k\nQ63LrHvNN+mp9IjvOJMiiN68dtXNPwE11NycZrDJ6PMUA4K5k6Rja0ThKU5D\nKAge6bvY5GolQi7GcDqRPNPaoDlOl+q80j69q8jKAHyybjKiQhxM6fS6azy2\n1IRhI7tBfq+U8lvvat9GMnAei6emfWNhZVYd5g9EPvni82+MzhJCVYn7QVqp\nuzK2l0d4ptAFY6Vp7H/lV1wCUjTT2E4RX6S7U0arFNlfNe0wdexLChadSspX\n+uW0F0d9V4SphtYxfHqdTsGhyYvjsRbg6b+dBdSZjiLJxlK5uFltVR251sDO\nnnwzJZrjs+OCf8ZXULgB9MPg0vAtCqzoiR7HT2c52jKAZzqIwuToAGRuJXPD\nv3hLt21naZ0WXr6aS6O3xMB2AJiPDMq00bnWhJ8RWPt21lQ5o23snSYj9c25\nTyYtT69K18RdEiN6iNusQPqW0+4lp/IE2MVFwbYbPXtWpKnmAxyWkcqpDjd4\nQIXkyVpKNph8QVyI6+jwEHudnrIvEyAu0lcDzifDNWsTBXGUVyHN0T3iZm/b\nBXkebWcpexnWTkbmmn/z0TmYpvzcHmg15m30e6DdlcmnnAAIWH84O43ldUig\nR+JpkW0rhYJ+gVEDuS0KZhGloIZ5dxd79txzmtJLKmKCqrVdZiv5pI7G3qgk\nD+ul\r\n=KgwA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"abec80646f440bad50124e86bc4461560ba1c7f5","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.1","@balena/jellyfish-logger":"^3.0.36","@balena/jellyfish-environment":"^4.3.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.3.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.297_1625214996422_0.6496222047155211","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.298-renovate-balena-jellyfish-config-1-x-f4b5d5f9e806e4eab2b1882934771143d10be675":{"name":"@balena/jellyfish-metrics","version":"1.0.298-renovate-balena-jellyfish-config-1-x-f4b5d5f9e806e4eab2b1882934771143d10be675","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.298-renovate-balena-jellyfish-config-1-x-f4b5d5f9e806e4eab2b1882934771143d10be675","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d8d5c60be310b06d5738e676e6bcab3dc8bc67f6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.298-renovate-balena-jellyfish-config-1-x-f4b5d5f9e806e4eab2b1882934771143d10be675.tgz","fileCount":15,"integrity":"sha512-mnaUiTAJkJ8fSzfSShjqQY2nUusPXBhLVscV93XXGyDIFGuemVMIYVGcnjd1GCXZYGgwTwOVinsP+3P0XYxiqw==","signatures":[{"sig":"MEQCIDvMYWIOkqLU/8MxaucnvUdiF/Vka5l1h1w2UqQn01zYAiAX45+lEtBVwSWPX3SBnXvEq5g1Y/zlEuKskWqwlrfIgA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":120591,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg3tCCCRA9TVsSAnZWagAAsUsP/ROUBvWWb9Q+agY/j0HS\nzFCb/J+jil3lYuEMq9QaIIy2CWzzGRJ3AbqVv0rYEt/BEgODnpf6H1BYPxj3\nM3KxmEz7/JnFiwXuA6xBoWU5nbnK7t0Vn9IVtPYcvwbFIof4dTDA8jPfREpq\nf2xcdkzU0xffjgkqi4X+WnK2Pw9q0OMbiqKQkNpxCRxOZCjiFfTWc9Hx2yYQ\ntxlp7J1IIDNMtpRhL5AmwjTxYhb4SDGzlZOIvuLzt2QHM7+CXt0Nkad5+3V4\nJj7yxQbXbIbYwM106zxoIoN9vtewGBlgZRE8/H5d4HdowASGcQQwQIxbpkoq\neFg/ECvXhFGWZ3+DKBg87Nv6aIGv212a4YIWIwns5OAG+wDSo28n9A+w1bX3\n6BVeyJkgShUD0JOS7ii5CVcTwxyDN7pWXmC67fC3BRL9HyaPhNc1YAfsC/dN\nW8VIz+l0HSEL22I8iNy9EqPjsN5EOERyA8E9KpNCYc9yLxY90Uv8wdvnkdju\nAEYOg4UEdm3yozyV+tLk+i6DIlFJ7X2POkCCA/BFY1+GczMfL7Ym6ZHXVjaD\nP3QwO/hkx53a8DI9TCDeSi8mkqb7boWQQF+eKrGs6Op0MgLTiGm7akV4wZ7U\njCK6C0vh442Wp+RIUTA22Pg19xsTxELrwH0aVvVyTw6iDiq8mAELHkC1fLhY\nzmnC\r\n=bZ1K\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f4b5d5f9e806e4eab2b1882934771143d10be675","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.1","@balena/jellyfish-logger":"^3.0.36","@balena/jellyfish-environment":"^4.3.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.298-renovate-balena-jellyfish-config-1-x-f4b5d5f9e806e4eab2b1882934771143d10be675_1625215106152_0.9697237646876513","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.298":{"name":"@balena/jellyfish-metrics","version":"1.0.298","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.298","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c15ed3dc549775b9cc06fedc6957bc85243ccf05","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.298.tgz","fileCount":15,"integrity":"sha512-ebzioBCWdfavBSFv1QA00xNvW/mxZ0R04gHXVXeiTnbfdA37WNIHB+sPOO33Flflz/f7R1rRO1q8+QEYHhQ5Pw==","signatures":[{"sig":"MEQCIE0IgBGVENXogofpqpeLhT0ComawdMP7W1jsM2/BoYVvAiB9gT6XdPJjk3ljPeMxJj1fqhYNs3q9N2BcEYJoMEp4mQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":120513,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg3tGcCRA9TVsSAnZWagAAZxkP/1tX8E7SYy+WWxvL8rjS\n22pFd6QVXNM5h3HaI7238AHbMwUuo5jPex/vJ5X1q3Cb3yLgZIIMsZOnODw0\na0xNmTxJ8f8O6HOA+AK+cnhyskPVzQ60vP4v3tB8iIl9GryXZCuk+cAKowqc\n0PdstGf/2xOe6lx0WY0F5Mg1egxWcUuE1L5RzPi1UKwue8M/XTw8V4l8jZej\n376qLDIKMUd571TlaebigDdI7bYKHgAfM8EUD0iSJ8Bgje8AXmpPu3qV1/N2\nIaIt/+5+EyE/QvnkaF1OrbeDsyI+ZJEGpnHbVtTEJYYlwiswXV3g9t5m4gU+\n89RqkvryHeVWHEMPhfVMR31vHWHKVr+hcr52Jehhm95GE7lc8+eoOeFojwgJ\nTD/3iU0kncYx6kl3zQezE+foVumcsyLxPugvcRhM3VBJc+fYPzXvkjbQeZbu\n6ZGAz/2sUkrGApZLrc1VaUgBp7rlcMdVxVidCKmVMuXnoOr68Cr/l50+XV52\n7hi/84AueajMCUIuaOZZzmE2BnCqt1KDWnsjawFso8mWtJm9W0MKX2c1wIi9\nhOcKH50XrbOmTh4Skl7M6b+qi7Skkg1R0ximtKyEM2s/+5qS430rEgnfD1bZ\nuZ1OiCx1LIv32hrgr+wjvrUgIwQdJrUMS2zLD0Dn4CvJn5f54wlEWDiMT7Zz\nHUW5\r\n=UI7a\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8db07eab95b8f2dd3c88f5f93d72648037ca781e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.1","@balena/jellyfish-logger":"^3.0.36","@balena/jellyfish-environment":"^4.3.5","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.298_1625215388396_0.4717302485907424","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.299-renovate-internal-patch-05f6e7f04d2445d1a71b28b73df59d024036e6eb":{"name":"@balena/jellyfish-metrics","version":"1.0.299-renovate-internal-patch-05f6e7f04d2445d1a71b28b73df59d024036e6eb","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.299-renovate-internal-patch-05f6e7f04d2445d1a71b28b73df59d024036e6eb","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"af1698c5384531c75cefc06b35d182e30ef5b44e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.299-renovate-internal-patch-05f6e7f04d2445d1a71b28b73df59d024036e6eb.tgz","fileCount":15,"integrity":"sha512-gxZeEeRGUqAd3kndEIELpQ37gGI+uaZlBaXxPk5xkUD+oqLnyD6hdafwZKdKpmDHGnqxffV9f3tQrY7B+VLtiw==","signatures":[{"sig":"MEUCIDAbglvPBhcf/Otw8uSIZk3l7kXyPtwqj9/3RFasyiS6AiEA6a6CcshSov+ZnfGTB42IjYySyGiXA8xSGRonFoyRcW4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":120650,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg353RCRA9TVsSAnZWagAA7KkQAIqNROG8Gec0LyoP7K4j\npLe++8DtDmdgt897Wa0a6pEw0JiuGEhCXw0g1ZrauFoxYPueqcmrALB+xoI6\ngNDk0qyPl+fnvxLyRmCtkAhMDpiaV05GPcpsJuFt7eLiVs2lqmVTzzP12+be\niU++o/DK0/mdU2PUxxk6d8yDUBbdjLDctgk6Iy/ubvzFl4/GzYF92nRGvD+3\nvM1HMHF3At+NZu3X0RMmjohCt1cGNa1LtsZKK1YN5bhtf++CtQ7T7ilpLqrJ\npHU5PbjeO1afPuDJwpx+c1WWI4JD7e83o9Fc315r1DaNAitdzLpu8nJYNqBy\nm8SoNenm2JbQWDZv+x6ZirPtk1DIRLH7apT8DSo4wzSvFhHle9uHGb3BZVta\nvFL7IrNjbcgy4OUI5sl/rv1/ZkRmc6rZ8AtoRroBOemUqO6lArAFutP57gMK\nQMUxeBHNByTZpDhAvLMCJkUgEEJ7Vm9wErJqE5XTb8E6XolsAvBDwpcPaPb4\n5nn2oBvMI09tSNRpp72G7nV5Iiu4+70TWi/+6IVoF/J8682Oiwhk5Dyrmluu\nyeaZtI9knuUsNBDx9RuccacF2KYbCqxLZFE18tBgsDtIZnTsr0E2bOXRHXpT\n2SoQCQnSaTdfTHdf4E6QnOr1dtN2QmEMTRv2hHmSXiB9kL8MQ36oCTkp6nDE\nV5pt\r\n=TpcZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"05f6e7f04d2445d1a71b28b73df59d024036e6eb","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.1","@balena/jellyfish-logger":"^3.0.36","@balena/jellyfish-environment":"^4.3.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.299-renovate-internal-patch-05f6e7f04d2445d1a71b28b73df59d024036e6eb_1625267665251_0.29025750346075374","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.299":{"name":"@balena/jellyfish-metrics","version":"1.0.299","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.299","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f301c7347abcef1d7bc2bffc6eb4d6dee85585ff","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.299.tgz","fileCount":15,"integrity":"sha512-w2rCReW3m656BJtuLgFNnmH8F4hc8zhFpzEeNzQVSeaSFkP56WOjtbe3XOavBOtbgdqje6iQ5lXt2JN7c0ZLMw==","signatures":[{"sig":"MEYCIQCAzyIYKLm5eI7S9lPUpLs5gWQYmH8/pInRzLXQYBf/JQIhAIxQJRSj3vhdL2cszD29eP9OnmuD5eL8DOQEKiLOT2ai","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":120585,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg356wCRA9TVsSAnZWagAAosUP/jJl6VA9Sbss3TLajq6P\nZLto/GlILRJLUdNdm1yhQzT3dSjJ1ByKWgPE0kmWfnxRnC9rEXO7G5edfJCY\nLa//Je3XUQsaQve8JNDDlhdLm3CgRJbDV2RsMjj05AkTT6wKJ22PjtEa6AFJ\nddeZqUGf+fEuVJs0QHFDtaSzefI8+xqs6Q73OTUuadKT/CBpoE0W3j26eEZ9\nN3xu+9CoTTRP98j/lHlJX4izXV7HBkoS4OaVU7RTqOxacCvM6ozp8gcrReld\nrdYehh90GxHWMaWn0tqFhNUD1vp9eCn7SNRNTVdDcwwhMR2Eh81MjciaTOg+\nZpj/h9uhmwvasxSymPBsWkMtOXB/0CXZ66ccdFS4sYgCjw2XTl7bnfB0ZS9Q\n5p/aqDEZsfjWEy7k3QSlpSuS/Y7iocN68hlYfirqmTUjuvlx2tcg+bSC+ttT\n9I3Q/oQF/n+PXblw3ZDFNrzk0gSDAY7pCgcU4bH0H7t+esYzJffREoqZdwZq\nX0KGQRYmk5RdfP8Px0WcGi6R/HT4CJUQU0g1djQaTsXmxSHe3Aiiy4N/GaUS\n49lxk+2q2ZCGsa5Cz6UoHZhBoGQsosY5/vunrTZjbNDk2zGQTfVZkRN2wF+/\nc9O9XM9JsVGYxYqYmy9al/aoQDjLmClXJe6k9cas95LMa6MFqcMkwMHi4gm6\n1M4u\r\n=NkLE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3be10f919eec9ba9dad0fa546a3994b71ce5bb64","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.1","@balena/jellyfish-logger":"^3.0.36","@balena/jellyfish-environment":"^4.3.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.299_1625267887535_0.6182650919410466","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.300-renovate-internal-patch-ceb5ea88c1a4aea2a298e969b39f6a23f9e37a9b":{"name":"@balena/jellyfish-metrics","version":"1.0.300-renovate-internal-patch-ceb5ea88c1a4aea2a298e969b39f6a23f9e37a9b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.300-renovate-internal-patch-ceb5ea88c1a4aea2a298e969b39f6a23f9e37a9b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"76ebc83b1cfffd7f8ed1bf665c0c0339ff2dc686","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.300-renovate-internal-patch-ceb5ea88c1a4aea2a298e969b39f6a23f9e37a9b.tgz","fileCount":15,"integrity":"sha512-JIO+bcHxdmHQ4Jc1BkcUm80gKO1+qeVc5n9eEwPHWzgVjqN2RxdDqEeXsyp7y5oxTJUVz+ZSb10K2Z4QlA772g==","signatures":[{"sig":"MEUCIQDU2z3P12b0ILNYzXs8+rj9odHdtCH3LHWLL+hxIXyCIwIgU2qNwXwoR5l7FsC3X3dX+UP+rfij0BSe5edJlWEdZmY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":120752,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg35/pCRA9TVsSAnZWagAAuH4P/0Il1ee/7f0hM0N5rAhC\nG1mY8yLrwbaQKjRnhAdPgIaF09x0y/K8jQo+enG9GwTpuNpPJQmvNNyWKf7G\n5s1xlnQ0GyV53zyNrqC4Xvji1j8mIXmyTKoG6ec0WSfTnDsGSB7Ms+wVXyQQ\n2w+i8My8AR6791dh4r9DBZaLNAabUD/j6EOnMdYvjwup6Niwg5YecadhMmGn\nhBSUAF9ifWUytSEDRymPiXJflEGN9f3A6hOxzrirvO0honAPs9o04ACB6jTY\ncEjUgGomNOXM+V4cEySpqzhVzfqEsnjyrn9giy4T51CcgcOT0ar/+xpuSEoA\nl5eiUd9HxD3ok1ni25/KZ+8SxRbPj7YNxOoqeq2EQvckCP1kuigCQTXdomyH\nVNfY2nvOXRgMQie0qcZvSrP5ETvnIUSLFdwRV+SSBXeKccwLMEnKYSAMl/Mo\np9XV4VWKCyvpfDsbNm5JhWGxJWDXuE1uQcGAYkw/ByQlqB7UXKTzvQPq5FzM\nS76xbx5B0B5OVCAh/972qVWFmTFKfcAqy1uwrhYsOt5K6sovW/aAJAJMWIld\nfFaFTVUXgz4CsjZl8YxTahN7d8jxWkhCQxP9v/YKlHSrA+4JHkDgZDIDZAVL\n904A7HBJKEK0/7cbxjlnVT8waq/EICH431M3NtuhB9JwuQgsZlGFQzsD2cpn\nty2D\r\n=ZGbC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ceb5ea88c1a4aea2a298e969b39f6a23f9e37a9b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.2","@balena/jellyfish-logger":"^3.0.36","@balena/jellyfish-environment":"^4.3.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.300-renovate-internal-patch-ceb5ea88c1a4aea2a298e969b39f6a23f9e37a9b_1625268200793_0.8990865213756172","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.300":{"name":"@balena/jellyfish-metrics","version":"1.0.300","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.300","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e3ba7b11be42fcdfbbd40a12c565bd781a724bad","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.300.tgz","fileCount":15,"integrity":"sha512-iSBtPKgMuPLwstIZB5Au4DG/WWMBMk28yL6iGLzq0Odc4mcWUzpVqvdYKp5ibMoNesPgSPGBbcZPChfcLSBFlw==","signatures":[{"sig":"MEUCIE8qknGvg5qgTKxHK3HJHilfjnJzczAgjMsAf6GrLPddAiEAwBMtK03V2sGjVzygNy5nhGNoQ/rga/F4Td5XqzRuCaY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":120687,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg36DMCRA9TVsSAnZWagAAym8P/2O4KJTif6uoQVXfQ7q7\nlGOh5WvNgZ/Z21FTTT/WxamLrM5W3f/THRLp5pdBP9qq9MecPxTXnB18yHMA\nfeJWRPwFXmw3CDVLqiMy8bZyn2eAiUexoL+j/+T5Evfp1gjt7SddW+C96+4O\nh45+3mkYqaK/REk1juvHnqFU/u1xSEC7DlrdhkozBz3Bb1NN3LKOHepInDvC\nDG0e+eQxH6mMqCbP1ZGjVWVZoobXrHCZQ3omlzwyqt6CdzlaYiW/kbk0To3T\nwh9VdJj4yYxv5pZkS8QlAqq0OQYTR2NGUMPc3Y+tWc4XQgdfd3hoMvlyPP0v\nmO64IGUjsi1F8b/vn99AweBLTrFTr9UpnKWCOCFa78NLfrtGEUjkVMhZxTar\nTRRpC81NvCexipbbDliy8VPI+aSrNFd0TK7p6LWQ8oTp1hzbekmJqlyM6HS1\niPPd1R5AuxFD8KUSzW4Nt3TsvA1xG+oBDlNIqmxy2KZNtXMFLVoe7G+ksYOA\now+baD43LAW6esD4RlHoQGj49gJs5FCJ0RD2J69fRmncmmsa/DRePNZZx/An\nSaFFcQLyi2CQm2tit8JRcnny5VLpleW7l3w4r+PAuwGI5mq5alm3HqYqk8Uo\nT5Q23xnsfLAFD9/5KwUQtMKB8MaWy+oOU8hfN8eSR8BxGSEtTUW1QpkV5LSA\nGhd+\r\n=zMg5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e201722520de2f92a0d25a754d18e6bfcef66d71","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.2","@balena/jellyfish-logger":"^3.0.36","@balena/jellyfish-environment":"^4.3.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.300_1625268428330_0.7723615080743593","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.301-renovate-internal-patch-a5d91f14aeb54fd9d6122a259486cf94167ec6e8":{"name":"@balena/jellyfish-metrics","version":"1.0.301-renovate-internal-patch-a5d91f14aeb54fd9d6122a259486cf94167ec6e8","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.301-renovate-internal-patch-a5d91f14aeb54fd9d6122a259486cf94167ec6e8","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"64c9c37f0817e9bed548a41beaabd2b5fb278f59","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.301-renovate-internal-patch-a5d91f14aeb54fd9d6122a259486cf94167ec6e8.tgz","fileCount":15,"integrity":"sha512-Q2Mhn+tWTxMQsYjOWuxLG3f1dFbupRd1Twur0k4JI0StCfLlQ0c5qiKGCEMXogvoMKjAGzXQDn3JU2fgKOz/2Q==","signatures":[{"sig":"MEYCIQDjAfthNmRklfQCILHWN5nbkx2ItJDf85IOTK609ZUBnQIhAOBWpEEjZWuQg7IjWEoI4aZ4hsHlxMQM6uPu7Lg3n2q0","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":120856,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg36JmCRA9TVsSAnZWagAAj1wP/idgkFcJJUV4Cg9/UoLK\nVgwSy2LysJeeIggitkVHU4bWkKcT3GWyX0pd6bvtk29/r56g2jiAuz6lyepa\n7S+h/zOudhjRr4goFflMuhf98BNc2h8vCUvMfGOVA4qhjlmPctQsNbjimAKv\n+s9//3zYue2lLFd6RFa7n1Kfl0TiVXnhrwrfH8UuHR4XGHqHvD+hApET+pPT\nW/qKFLCFK3yvotYCzUXPBN3siALlcam7TCAaT6zvdnwsdRzQwErsJVyV5k+N\n5/ZLx/1uP8ycQSbOyoZsKPB8iW6CWVe3mcaFUOTAZwrEEwZBf7TuB/P7c6h8\nLLumAyLScTzvF7tLBgKGCvgU6Qqqxon5kfdZ1wtF9RNd/DlYw3bdDgYhIkQK\nOntwV0ruvSMRjSRUYlKmru12wAEUg8LMQaf9wEC9Pi8pePrsJMMG451CdQEH\nGYcAAe3yb1eNP3gFbWKmKX5Y5MPSlaplqqPmIYT/nNhvnKYnLyXHSZ3ypQBv\nVSYje62wFqJTK+X5DRYFfs5zmOhmpbHVpoC+3ZGjB4RdldNXI4cmvKHg50nY\nOyiArLHXtAjeLTKRFbEbAeaPPlvCdu//oeWoJ4kp4GMGMF2j8qrN/Dsd2QKs\nu0SF2elhX0iUwFOzkcMBl1OxnFyDHCuYnrxS23gMTEEwwaUtUZplXFyFTw1i\n8Ttq\r\n=pE0F\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a5d91f14aeb54fd9d6122a259486cf94167ec6e8","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.2","@balena/jellyfish-logger":"^3.0.37","@balena/jellyfish-environment":"^4.3.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.301-renovate-internal-patch-a5d91f14aeb54fd9d6122a259486cf94167ec6e8_1625268838269_0.36413874146292535","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.301":{"name":"@balena/jellyfish-metrics","version":"1.0.301","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.301","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"65278aaa8331a2c1c557662ff83905133965388e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.301.tgz","fileCount":15,"integrity":"sha512-NuIwzyvcpISi16XtNUubxSIEJVeYObr5XmSfohKowzoNHBhz5r0AIwTTtNemp107tgTMEexES9k0ev6RAkWzAQ==","signatures":[{"sig":"MEQCIBC7XdcP1ZL0TclE5vstzd2r0sG5X0qB6IyrRMaFsRfGAiBI+b1sdYibXzek0WT0ipldnc+mhIIt9W1wknWDFmXv7A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":120791,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg36NBCRA9TVsSAnZWagAA6GQQAKSB/zdnLjGvirXrQYeg\nnm3V17Za4Eb7AAYnfXAXbMFIZJTKtxEX7gIliP1Q3q1RCjFg7GwXknoVJ22U\n+yQfnl/COMNFHtEen0Mj+2qEUZhz6CSUM+qnQh6eKRz7Fm2aTc5gim5Yxur8\nrDOlxfqRTWzXND+jDl/dYrFMpubROeIZXB0ah0JQrKvnqvl3pqb7fyYKy051\nEo0frmvq+Y6k6k8UOnDs3gXkT+nQGVEmcdx19njN5JtWl2rGE9lYVStMvFNA\nndTaYtQOrZyIpJh+IT1LLzYVDDJuk6lqbbQhgFt/hoGZrAhCzpe2nVSBvGpP\nupXSzyRjGKuqW+PnDKLJXqBJ5btguRb6KbPCChFGNxBiw3JrmJrtunDJEFed\ntejxL2A6o6yc7RNPSU+ONqBTjfs+ZUyB/P8MEBsmWRZ1R456ntzJ4tmn/vml\nvq7rxlWj0d6VBZUu5xJ5C+F3GmrblovHBfEv/U01cjhwf8nQ+0S6LzePeHcW\nohoopZShUYAiOl5dYTUhe8+Zs6ccE3hEsJMEZs01JUcLLiRLtrxS522zDmGC\nrxM0ir8CX7BVOcahNPqTKhGU++GfMoIkZdWCOF+Mo1R/aqoUhZYu+ocvk8M5\neXHklHxOS9UFDPLiRDRA5HVqeGTw/dW7OvW3Wfuu8B1cjGWRqsSTHwxbRsfC\nLXT+\r\n=4N0Q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"bfdb486c3a3bb4c2cf248614649b3bc9ef200b70","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.2","@balena/jellyfish-logger":"^3.0.37","@balena/jellyfish-environment":"^4.3.6","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.301_1625269057312_0.2169701925814589","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.302-renovate-internal-patch-7d1afa35c3152a4870df54e01ee3c379badff4f2":{"name":"@balena/jellyfish-metrics","version":"1.0.302-renovate-internal-patch-7d1afa35c3152a4870df54e01ee3c379badff4f2","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.302-renovate-internal-patch-7d1afa35c3152a4870df54e01ee3c379badff4f2","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6ff3f269c692b6d25a68526a379d549a2f4448b3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.302-renovate-internal-patch-7d1afa35c3152a4870df54e01ee3c379badff4f2.tgz","fileCount":15,"integrity":"sha512-QgDPIKqZ0kZuGCP2rOLNx4xirW4gYcOjGfhUkY25yWETO6loFL9pH2LtJefPlHiQ53dh+SEJIB/+a6wcxO0qfQ==","signatures":[{"sig":"MEQCIBpqJeivIevY4Jg1FYcTCdt2f+IN2nBNAXewN8sOFAvdAiAbOcXhsUuryytMAu1xm7U/W2PRYCHMVpMgXL+GajHwqg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":120928,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg37eWCRA9TVsSAnZWagAAfCkP/iwjjDugqCpwRQnxJQ9y\noP8gMF197RNFOkZboZZceQun4TRV41Mhnnhgaz7gvNYLHJvsGXedI1DFy/+6\n0bdpXUvvrg86zyqAzL/nMJRjo0xu+euhQp4fAz2qGWV4ZKJYmsq3wkp+T5TD\n4ObqGfQGaspCCDg3dzy6OSegOnK7cVaTuuhR0XNG+mRY79hPYd0FeErFGohJ\nJJmh5eWGsUDy85ZdEuQYMEiwgAIjekOt7mVjxBg1D7mGA+h5K7gxZCjQVhhQ\nl6dNqKDVXEIhrMguTQzaVmMd6X2LJCaXbuoINvGr+anFHZHvTMbBgNaLX0Dq\nUafGUoi/geoQbh4uyGW8IxZ8nsj+eqzJBiDiUDBkulN3iWe+MIuNNUJ8ObDf\nhv1jWOZxruKrBCklRLIpTTbN1ktQlDKVddMoHKUHxTnW2kyFa1xqQqTgeNC6\n9yyYP1R10A/TGw6/AmQBmmX/+AghX6l98iB4DSzcqTbGGEh5aWf+F2Mr27Zz\nSl+RU1AQ2TqPGGcFG5oxAVxQJ8fnAUmH/GbeQq22kUAlQhLFNASVHe7tSk1o\nG8yHIArSSQ1zzj7GB51Db6qG4gOyQ8jOE/VYPhiyiuItzFAF6n/BGxvXQbOO\nQppaCW2/4+iJn5gF2eMp0f4+3sJQBDJrFA3e+FUJDIKxuaE892U8onq7cBmL\nJCJl\r\n=optC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7d1afa35c3152a4870df54e01ee3c379badff4f2","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.3","@balena/jellyfish-logger":"^3.0.37","@balena/jellyfish-environment":"^4.3.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.302-renovate-internal-patch-7d1afa35c3152a4870df54e01ee3c379badff4f2_1625274261997_0.9167149665915144","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.302":{"name":"@balena/jellyfish-metrics","version":"1.0.302","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.302","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"23f9066d4a29e97ce85b59f1238919eb6d8ce15f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.302.tgz","fileCount":15,"integrity":"sha512-xwHA3Qux9BuxEtXagVBzuDZhO6psjNzmLBGgWlOF395ECc7oMHVvVYZ28Xrr+AEDgFJr+8brhl0OPhic45Vj0Q==","signatures":[{"sig":"MEUCIASvLoZEq1ebDghBnCvJot5I5R78Vbb6qUJY/TBPc92HAiEA2Epo8dmv53Wr1PKs/AxxjCa1IreDoERiPCvK/NPHhmU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":120863,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg37iGCRA9TVsSAnZWagAAHYgP/24Ek7cOF6FEa1+IZ/jm\n85W9jp0xv2fIwqbjj6I0BYjOdmeDtIiXerdrY6Z0GkbZSpAuKenibJI59xgZ\ntqv1AtJdhhnYeH7u1Nh/j35ULIRnvvCC2a180ya5hZXyXGRrIyueGjABoadq\nJqJK/ZciSTQr0an7q6qFQyxwcLbAAdujLamLb57WlUxeVY+3vY9vDGzO3ZaH\nnotjPzyvDheRFTuq5a9c0IqX5cFUOrgMF01B0TmUW9tjEiY9z03SezD7/ySF\nciMeq/5xo1688qpxKsDpjp53Gow9L02hkETynz+S53nTA6xR4UEDx6XXKgKE\n1r4gkrQzstisNwY/dMlYXRQcBGwADCP4v3Tf+nj2QSnEMQRxWgtCosP0bZ3l\nAreO4h4/gpCLDFwnXC7lrOUXnrFhHXEEeD2SziEu4v9Nl3ZVb3skm2oUp9c+\nG7OV5dsB8mjhv/7gLXF6aDhzhmHJq+23m1cesgA08bKXc4RXcni49/rYeuz2\nnOZpoz1pU9ejwb0kJD+Enre9WdHqboyjRrWjHXFZ2wN7+ftE0MJ7gsAsfsjG\nkChhChMvQUcqIz7y5qhLE+7xmR2+o/UbpAaHcoHGjcAIQypTNx5NXIose1Ss\nhZJDHPEVLT9yxUeGfBzM8fVQetuGxoKE4gP21sPpFJPihFgJ2a9uOAIlMtIB\nBZeH\r\n=FvZz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"97723fbb83ead7305056fb0881e59189876157a9","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.3","@balena/jellyfish-logger":"^3.0.37","@balena/jellyfish-environment":"^4.3.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.302_1625274501789_0.3880874829857801","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.303-renovate-external-non-major-07a7176291ce65d8e5ac4fdc494fd72cbd635bd3":{"name":"@balena/jellyfish-metrics","version":"1.0.303-renovate-external-non-major-07a7176291ce65d8e5ac4fdc494fd72cbd635bd3","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.303-renovate-external-non-major-07a7176291ce65d8e5ac4fdc494fd72cbd635bd3","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ff7bd8607cd73d01fc042da6857d5f20c0069326","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.303-renovate-external-non-major-07a7176291ce65d8e5ac4fdc494fd72cbd635bd3.tgz","fileCount":15,"integrity":"sha512-zKGqKFq2jrhiMikKWLnANMZ5FcK7LFF9fSPef0crO0fUa1wfdFR477gXRHC9CXkavx+nZBiJbRRp7zaQEDaH5A==","signatures":[{"sig":"MEUCICmv3+v6Un6tv3jGUc2Rx0T8eI0C+K9EBvdeHeBeatkFAiEAunPl3jW49jsKuzL9u60xyXUPvovx5LhdViGcmte5kWg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121008,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg37lPCRA9TVsSAnZWagAAHl4P/3dkjxg0NMKeHFQfRNXC\ngpOCUd5ZCLMyuzrFyQMtXiw8N+IgaDZVt+Gi6Nqc5U74+zeIS8hT3LE55X2W\nogfJjCxh10qraI3uz6Z/avBy2afNAGcAOftfyazo0nXZ0NIUMjWYQgtSKyqo\nDydhhh2gE/752vDWjHraindKE0krqAkeUbOsocfxGxdQWSfAUW7MiCGNIcU2\n9C+F5G0BlDmXWhvlftBp1n/0YTJkbfgnWiKG44qYbfAW4eAHU/+Xwc9C9Ihs\n74HVgiLx/OJxMac03XCslcZWduJnKcqdVtKTcAwWzaztvybeFmUdaMd5ZLrH\nGmdRbBfY1/aeYc0XJdo8Vble+FqCg4jHVT5jqpBd/y0adN/icRvpdw7nkFQ8\nps6QjcMLenzZHnIRyqINKEqNRGxzQ1Nm0TsNBuXi439Q3ek618gtj8RDBX7f\nt0HjNjXh5HFE9XSabCJG+WT6QtE/+rAgYju9yaUEhkWawrx3o/e1/+dIjHVp\nHmhQZZ8M6pWgQX6319s4BiiPjxPWjnD1r1vIGreM8IFxYrKSaUcIvY7RU0rx\nIt/oNENyI+DrpY2XdUR1W5rh/0Cg8uMQUSfsYhOuYuuns3SnIU11A9aRtJD8\nc2Qh0lwx3CuPNqX6pqXOpFiyzj8CPMxitstNcUycEtdSysxaXgZ40wDLLk9G\ngL+7\r\n=vDWR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"07a7176291ce65d8e5ac4fdc494fd72cbd635bd3","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.3","@balena/jellyfish-logger":"^3.0.37","@balena/jellyfish-environment":"^4.3.8","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.303-renovate-external-non-major-07a7176291ce65d8e5ac4fdc494fd72cbd635bd3_1625274702910_0.040656104067213095","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.303-renovate-internal-patch-3fb3a0258a0f26ae79b3d07041dc8e763a4b5a32":{"name":"@balena/jellyfish-metrics","version":"1.0.303-renovate-internal-patch-3fb3a0258a0f26ae79b3d07041dc8e763a4b5a32","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.303-renovate-internal-patch-3fb3a0258a0f26ae79b3d07041dc8e763a4b5a32","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"dcf1beece99e3803a347cdec777d5dd37e5dfe9e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.303-renovate-internal-patch-3fb3a0258a0f26ae79b3d07041dc8e763a4b5a32.tgz","fileCount":15,"integrity":"sha512-lrFyt/LVHBHMuEyEyabnnw6WBiKyeyBwbYkrd2niiki4ZMvoD/x13GxWHnvISBJJKzKiqXwJKoQr98W8i4VW2A==","signatures":[{"sig":"MEUCIHZoZXIqzrJTEWgYkeDOmwEpEpO8TMue4fKd7yG6L/RCAiEA21j86sALoKX3ZyrCYLWbQNwOiX2oTefRQygknRbCEt8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg38R2CRA9TVsSAnZWagAA03UP/3x0Z1j2m4yK5IdtHzRn\nF717qLOjmvBeeM32MjfEDXf4R+IRY5cwCtUwx0L5wgPaQ20h37Mqt4q4CQcE\nhhpFPJv+Cwvm8j/6IxeIbRGULsjjjOlvw5Jq4MXNEkyEJd2WtjobuE9TAy1t\nkykV6l4uZzFzU2wdDG6ZdoyoMaPIaap/3pEb185SkQHJI/x4FH/PUMVryj9K\n/wq7kjpFP7v+14P+nGRaks/YU4WsgA5AJS5mCsD0+i4eP5vG4znoexA5DV9E\nLg+4OpGiAKBOkWrJOTO8oPzjhNW5GDhSxhwnpUCKPZcWMOUj9Sx+KwGjlyfQ\njRmYQH0G4c+LPQX6MPNax/k4hMzmVzxRKfjXWrUCu+Eazj4D9r/S9cgaBkf/\nZwycDGOQlrHPcXaa/s+WshHj4RtR4ID48OT+YtIP4wSrVipSDnKGTj0JaOBA\nOZFZdbnOyRhC4KxtBAYxjEPAHfAVsjAE3MxDIAPfDJnp+FIw9cxCyqGyRLJ7\n48ar4V2YvH55Ew9l6aoqjQywmzRi3An2Dcz9I5nTnYlaM0ZaSD78eN0yvkFZ\nkFf7TZVaKeFSGGj7urNg/3wBcjCKspSk+iGKMbKSH0C+YyAFJ1RLxoXD+r+E\n0YJ2hx955/YOvX+k+RL/aULe36AIAuALMQOrn7beNe9VVYCcJusQebhXWtj4\nOrKW\r\n=C+Fl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3fb3a0258a0f26ae79b3d07041dc8e763a4b5a32","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.3","@balena/jellyfish-logger":"^3.0.38","@balena/jellyfish-environment":"^4.3.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.2"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.303-renovate-internal-patch-3fb3a0258a0f26ae79b3d07041dc8e763a4b5a32_1625277557462_0.9549965508656288","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.303-renovate-internal-patch-cee6215976f5e88f508b0b38633fa0ee55405e9e":{"name":"@balena/jellyfish-metrics","version":"1.0.303-renovate-internal-patch-cee6215976f5e88f508b0b38633fa0ee55405e9e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.303-renovate-internal-patch-cee6215976f5e88f508b0b38633fa0ee55405e9e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1021501e2a6a363f9d105f2e51fb82b43f1db3b8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.303-renovate-internal-patch-cee6215976f5e88f508b0b38633fa0ee55405e9e.tgz","fileCount":15,"integrity":"sha512-7c010c9lcbPLsOCu2MEYFKQW7NJCFGda6VZdH4iKa+DLWPQnOJQplPjsbKovN7nCdngotE86eTfEf+m2y4MvXg==","signatures":[{"sig":"MEUCIGxcaIaMURmmyEE9mNBUXGk+tj4RWXTH7MfbJ9p9daBDAiEAgAdnOTVYd67plwUfP0HJwB6n2/q+H3q8jX78vFXJ/Zo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg38W/CRA9TVsSAnZWagAA+rkP/jPH/RV+fiFeTlzhlh5D\nvJY2A0L7jfawggDKfUKP0/Mcf2qwpMytD+ZCnvgfw7e5zvOweFwF5YkakqEP\nlyDfstSxm9nqNv230oWJXhnkfewSL53z2UMevte9W0v6+bsjWQchq8RXdCDX\nnm64I1xDj79YszkVFeORRAbiUSMk78sT8Esusy1U1wtGqwQtQ1VWOc3QaSvN\n8xxcYAG/VncSuQzOYidVHERDJYbjtMYJdNUUIGZqa9EgfJBP6CoYRecg6ib7\nTPKdQqjWLOs8Wql5ONPDKr234RcPBwGCZq0ORDY1cV7soqdxNwiMJSQ696E1\nIpa2v4sQxDTEj0zfr3T9eV3fyFnm2rPYeFjMIH76LpQjIMpVwpuDAZB5Ngvf\niU27mctFdBv/ZRIRoWiKsRcc/DJb/K3tX2uz9Ot3faCQYPPn2iE0rssc8kf6\nkYZBQvkYPLPxA4yFA3OkwoTk3nNTEHVvu7y+PUqXdUXDQcv6D9s5ESihc2iy\nLKwT/hkAyxmhc/LOJ5ZfyVKenu3vw4GgvruizQPIN/HFA2FQY2JAre0aK7xh\nOVd9WTc5utZ8I+xyPmDQ4q44nHy4DrZcQTP8jf2q+15HIXjRet8j4llhpgrW\ntrvnWFPu85cUyd+/6WX3dEDhVBncSEXD9FfNvywG7mjET94qi1SNKeREMDNS\nfMe+\r\n=s9ID\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"cee6215976f5e88f508b0b38633fa0ee55405e9e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.4","@balena/jellyfish-logger":"^3.0.39","@balena/jellyfish-environment":"^4.3.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.2"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.303-renovate-internal-patch-cee6215976f5e88f508b0b38633fa0ee55405e9e_1625277887431_0.47307655184708586","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.303":{"name":"@balena/jellyfish-metrics","version":"1.0.303","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.303","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"220da2f8957aad1e4442561c8be05f7b8d043e81","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.303.tgz","fileCount":15,"integrity":"sha512-QHvvy4PNtMElJNJ9anhVORhujGSW8szb1o6or4fqIfthSgTsPlkWVMYtrtFDPj0AcA1yjHDnFiEx0iyDFhMDNg==","signatures":[{"sig":"MEUCIDMdqvOCSYN7aEou8zGUEp6B5Yd+vUkOP/nPpf/+tD3aAiEAyhCQldDuECS/Ne3gGeAgw8YWXIg5YSgQ2JRDrC2PQkQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":120935,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg38a6CRA9TVsSAnZWagAAtp4P/2RuEJ6qnCjepbAp1UN+\n2wnn6g7lkcb6E9ROYfCWlFeAPn12flloUozsP1sSDjORrEVlT/EA+auhEF6W\ni9ls+WZMXIj75ao1r3HtB7NyW53b6HfdKPALr49nrM1fLGUc6TENvp9fStuS\nHqGnViLvJ347pr/gUdmHNXlrN+np/vrN7qPgkhJeZDaaSANQrryGk9ZEaSEG\nCFiEUQ3tdxftbfkDjAiiA7aHl674YyOl9jEUjYorWRWMt44dAMvszG9w8Vef\n84SQIMMV610KYmTMFOjGIlzaCSHQC3Sys+OFKpFhX0F8f7orw+cm4pwSlUN/\nf0I1bwfGQr7yl63DM56uILg52EBWCcOfczO7FraGh/t7folJK+ImiTEOaRTg\n7rVeBNGGmCo+NfgLF/8KK0MLwJjSGLUcxbWQxybu5N+7sOXyugm8+VmGhXZr\nXZaWmn5r9vStIIDZbP6pCGRDLEK1qn21VM3VbTq3tkWJPJvIaUxPqHNfrANi\nXVBxJ5xKjzk2y/ExeMws3ymqc5XLESszpQvH02d9vxLu+O1jmRP58xsZYO8Y\nQnUEzlHkmdh+ZwitfzDWnH7+NcilZ4oydSuIaWvPdupjKQLhZA7yBkb5tdMd\nSBvB3LTEbjONaqoLG2f0pwEeCrs2Ad1egUNfGUzmAi4wvlZI033CdUowxU3u\n6574\r\n=7vV4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"aec66c261db1b806f55d2428564a21434f95b484","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.4","@balena/jellyfish-logger":"^3.0.39","@balena/jellyfish-environment":"^4.3.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.2"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.303_1625278137615_0.9093793978961784","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.304-renovate-internal-patch-03c134047539a8e02eb98dd28a577a3bbd2349e4":{"name":"@balena/jellyfish-metrics","version":"1.0.304-renovate-internal-patch-03c134047539a8e02eb98dd28a577a3bbd2349e4","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.304-renovate-internal-patch-03c134047539a8e02eb98dd28a577a3bbd2349e4","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9a943d3cbb5f4f5819d7d650bf81a24e888df7cc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.304-renovate-internal-patch-03c134047539a8e02eb98dd28a577a3bbd2349e4.tgz","fileCount":15,"integrity":"sha512-Jlfb85nzzKnxIa88uHiDlctMaTsoAsQpcqCBthEa+aYYsb8DeCdFu72uwYdipASBasg/ze3yTMeE12MXSo04Fw==","signatures":[{"sig":"MEQCIGb4DWojVrS2vZ7Xwi0znV7cGP8W9DLkBQXzn0GNbfJaAiBX9ggjsYbzGWwihnNs8i2b7bMkIt/qA8z2GLIOzOPJsw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121104,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg38eBCRA9TVsSAnZWagAAfYwP/0NQcMqJbqHOTxwDIbhs\n/sSXDaTalvJgMCP0nH9lYtvJ7TuJoGQ6ytAkBaQvunBN0pi22XuxeSkGsv8v\nZ60HQbuEvtVjfEdfJKFwokWnHk6Z+grjc/5Cmp8O21Ma4abUkFXH6n3gSQBy\nItxmL9AZbZ5VbzPLzTUq6bGoXVI1qXdedgevMObYuSOpdBfB+fXmbwumwaXy\n8jgJQo4kphMr7w3nuP85CEWbR/1K59oQ+zNJEqCUe0NwGH+qgWHGf3crECDL\nijaMHxFz7yV12L+gy629NAlRCpBsm/SLQJaPBHCt6H/+ArVU7ouMtlJcxE6W\nLtnSFC5BWkiCdN1uczxEPvCS+8Dz6jb/r59lmBp7CbCtKP0Ht/SzRbrYfj0X\n2pEBTULXHd47nsXZgK/ZCeHxDS+QaSUCQoXmmcx09S+VhhuwHjcyx1ztiamR\n8z1tFHCkWAtcTfRJY3RKdB6yB5OA+x6tLMQfss/gOyBNjQ8v2gEg//v+te6Y\nCzEUPvySsIE3Y0SyipG/IM5grnoJlBJsU4MYfpi/DvCHPEXmiF3fwOb2Nd26\nHja0qYi+mILiGe6ktWi2waO29mOQfeg+DDJklOnxJOQoEdFKgWICPAjp2dXM\nZAl0Xgc8KDzzDP98+RfkaaGGTA08RO3X5GbjB+AM3A19csZWSkYlANJr6Vn3\nwLYy\r\n=N2KY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"03c134047539a8e02eb98dd28a577a3bbd2349e4","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.4","@balena/jellyfish-logger":"^3.0.40","@balena/jellyfish-environment":"^4.3.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.2"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.304-renovate-internal-patch-03c134047539a8e02eb98dd28a577a3bbd2349e4_1625278337115_0.41941421824469804","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.304-renovate-external-non-major-1fa06716312a70655be6a757f25d965b72783ce4":{"name":"@balena/jellyfish-metrics","version":"1.0.304-renovate-external-non-major-1fa06716312a70655be6a757f25d965b72783ce4","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.304-renovate-external-non-major-1fa06716312a70655be6a757f25d965b72783ce4","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"63b4b77922dfa092715f3a9a5087dbbc7bfd14b0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.304-renovate-external-non-major-1fa06716312a70655be6a757f25d965b72783ce4.tgz","fileCount":15,"integrity":"sha512-qeJgPIYODGI9szADoB+erZC++zMjHLm6p0HPXaz9elbIECjqC6N12RDfCPldP4gWqlyKw3qVaDIkYjcEqsefNQ==","signatures":[{"sig":"MEUCIQCh8vv8lfRvWxFYxNYUO39GsP7++oZnVTgA+ucFjjWqYQIgBoCwNFIe5O6kpBI033PX2uCuRGF6Nt/ZBO671BN9YeE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121080,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg38h0CRA9TVsSAnZWagAA7IgP/30izy4E9B1jAGYJEN2q\nHIpzvQ79gYixuUVfSNSDCAvyQMD1Fx3W00zQhdJm1ENXr9UvqFXmQY+wCDHq\nYT1E4wRqcddI7mJwAoAuUUVsVQkDCiFoWMgv/RHY7urnRSsXD17dkA+gEgT5\nO3xMxNNOoX9BTuxomlctsEs5qnyzciqTmIwKwUHS7akYXdRuw1vebEc1wXBp\n/O5wsFyH9dN0u7mswsg3c64dEpR/PZUDQ9XQS4YJH0zvY79v2GTR4N237GvL\naNZk1QDQhEQ5oxbuUpuUeAITDfKOc6NZarHniZ6ag1rbqZs9zFEGdA2A1+26\nVNdat/xaCO85s9kisalk18euV71GqvlZ8mGvRWMEXAbgxW4YNwBaZOnnKt+r\npNBtMA3zida1diQsJGYJm9PIWTHagH7VDwpFvwFGN6vTtiLQ6vyfbFZJkuuW\nS2B745AhMHIUZysjv9JpdJrZSl8zBy9S48T26hjUZilR/zLFJN+JhTO4Y5ZR\nKU3SwhGOGSEdAj9iCxT//c7abdMckgDxhABfuCWXeofAnBnyKOSc5uGJCujg\nu0tnBRR/SEVZWXeQl5VdJDiH29g8zq79xucbiWiQkgw4X3ZY7YvFPwMhH+Hn\njh/Ns4wpMYJHi6Coj2D78uCORUOFlhh8iP+sM3dtvYHX/QOOgmElpiJfcGcx\nA8Ev\r\n=qbSR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"1fa06716312a70655be6a757f25d965b72783ce4","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.4","@balena/jellyfish-logger":"^3.0.39","@balena/jellyfish-environment":"^4.3.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.2"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.304-renovate-external-non-major-1fa06716312a70655be6a757f25d965b72783ce4_1625278580000_0.6688066506336976","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.304":{"name":"@balena/jellyfish-metrics","version":"1.0.304","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.304","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"355176d2dbe9b0efc689ef30b3c6036eceb1420c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.304.tgz","fileCount":15,"integrity":"sha512-/nb5W68/9yAoQt9Kmqrw+S32e6x9qu0pXfN9FHi6pjWP3YN7ejWIGCLaAkgHCnMrOhKzZx+UuXfIQB7fMCdanA==","signatures":[{"sig":"MEUCIHgnMlAJW+rX0ok0AhEPB/0jpiUAaiQoT1quZXHK9e1gAiEAqVZ6JFPLLC0UkFa+1kWEvJpfzEDUVW4c9AQaHImz77g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121039,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg38kZCRA9TVsSAnZWagAAwiMP/AtLtND21YfEO6mINj02\nwCawHRy1WEqprWJFCj8e5uhIBM6SdYK/K+jgwfeJwYqXth4FMH9KrFmKv3Yp\nZUGiaIXo2QRIqIbCDW2ZWBzu4BB5rGUYPcHs2H9C634xrvRoVBdOfwBd1uMB\nlEuAqc1ItGlQqIczAJAxPHqlR7bAAlUORY4Qj4z4+4OPZIxgmLWWMfllJbGa\nuojLz45As+aoak2H3NWu1Pt/GtFXNW+NcFOx4qYhFrylDYEoOlJ3cFCMDN+t\nDh6mbAdOWfOurn//Bbss6PpFyBDTh3knll4iu9vhFa+djkh4IHikS4QZ9FQW\nGLisVmtvnO8ESPJSWX/auVtNIj1qOFVEhXVVaaNA1gCFd1CpMVgHP76KzPzw\ndrCamcB2VgN6i4jN0choebFXtAVIWHkl+LrIvec37isGNkpsJZ+KPtPO5RoE\nF6nDvXD47lClUhtBdVSPn/Ph1zR31uUnxnllE4h/YqyX9mz8QG2nLvrfImVy\nT61Ub8q8y6/klKqWp3BS2FeqyWshyjWbcjWcViEgxI3urDhGllASfD30f0mM\nqWIv4qYive4/ethEnoVFf6eUIGqnuFsLba+C/Sg1T+s4EUCdiWBklESVqkXr\na7hCCNtS4J/NYc+K4yJyRfcck+NW9zjGjfOXf7b0AKSG6utCGCOt3/LfgFoy\n8JDJ\r\n=734H\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"030ff73659365025212ebd787c08a30297c7b75f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.4","@balena/jellyfish-logger":"^3.0.40","@balena/jellyfish-environment":"^4.3.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.4","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.0","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.2"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.304_1625278745495_0.3313919305852324","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.305-renovate-external-non-major-503b1d71b86d15f4728adc9b6321c02c516ca0f1":{"name":"@balena/jellyfish-metrics","version":"1.0.305-renovate-external-non-major-503b1d71b86d15f4728adc9b6321c02c516ca0f1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.305-renovate-external-non-major-503b1d71b86d15f4728adc9b6321c02c516ca0f1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fffa11d8232619f8b185cf5ed070bb0a006a6b33","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.305-renovate-external-non-major-503b1d71b86d15f4728adc9b6321c02c516ca0f1.tgz","fileCount":15,"integrity":"sha512-h8Lmn3r7YXgQ1p8nsuua5sbuBJN66HEfGzMIsNbJhZg2q+vVempIu9oyCHWJZ5DfmEhDQja7HC6n4CsHe1BhEg==","signatures":[{"sig":"MEUCIQCi/da41hbgv7JFFP0nQ7FIqiaum30/gwdB8XPy+HdergIgfxDgrVHTZ9w9BLtHwQ4t5ZaKYOYyO2nxghZ/6uSIb+8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121184,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg38nVCRA9TVsSAnZWagAAt3IP/jgyRxRU3AgpORTlK1WP\nDzB2aTvYl1Cgwd10elMKWmDmyT8g6c2X/pidfAMpn4oKI8JSS9pDdALIJbVl\nr3gwPnOk5+soTNsiuqObvk3/ifCMcl0McXEYiteaFLL8lkWYrftIDr2q2hQ4\nrVIRiFxlEsuRhJXVA/ZVJJsfm33pXLlu9MXK+SsIpfAsUfxBrI0Xfz8nYB73\nU51BkFlWr/NY+GFjXz4pxjZO6z8igWz34T4SlbhUCaCY4HmiHkL94wsVsPBv\n0VXwPvpEteP70ipc7GmMmMdM/+atsqe73NBZDTxleXXlO3ghULBewe8Ea85H\nic70pkFH5+QpCd9vVEt7rJDnt5tM3DOefrl125FVYDkhf3n+TTeuilbONfq5\nn+sa3HefE+mIo+Sf3WHjd7iUfPaqdUNJHYH3KAWRl2Iq1W58WWYJ50vqEa4p\n5xpZHs5dVJ0y1XIlIccR49NrdMrwVEH0sBLemN4Uxj7W7S5j26/ux6pzGhPx\nqpy4Y1DZvGB2lAbnjPcPGYGzTbAtH472T0iuPcPs+J+DDLBDndznfzjACzmp\nSzjXDJfSJKeyGEHiiT9FwomZqI6G0AwDnF1yJT0wBvf+EFki0f6b1punt5gS\ngVMemCBW1FaHHtIZ0fyrpC1zgQE15DuquhSDfZIEVe6XhGAIeItXEvRsg/7W\nSEVO\r\n=87u/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"503b1d71b86d15f4728adc9b6321c02c516ca0f1","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.4","@balena/jellyfish-logger":"^3.0.40","@balena/jellyfish-environment":"^4.3.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.2"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.305-renovate-external-non-major-503b1d71b86d15f4728adc9b6321c02c516ca0f1_1625278933002_0.17006303859842253","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.305":{"name":"@balena/jellyfish-metrics","version":"1.0.305","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.305","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"25b2034b7ee680a29aa03e1016616c5a0bae71e9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.305.tgz","fileCount":15,"integrity":"sha512-9e+0daBrhyzV9n+HPgutQuj7DaohdpjoifTu+kQtFEA/CsQ7PcpwKzh7UobflZ31zyMOjbT1sXq+FNJOLn2bTg==","signatures":[{"sig":"MEYCIQCtyf/6B240tNfuNfS53iOQ7poY5tgTSrVD4GBF4ZqCsAIhAMCU1pHsOQ5RSGxrY7bIuiaQ0Zw6UbYmLZ1GTQIiPHcX","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121115,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg38tYCRA9TVsSAnZWagAAV+MP/1j1YNLEwWP0Tubs2q34\nxOxXS+ZQhh1tR3CZb65fxKCk9gD7NXX2LDSzVUAc6rNS6jTabsacI5DwItkW\nbmjV7YfqBPB6EUa5Ps4JNZ5dSlQxz9nnu2AiC3JHMV9uG5yKPY8OIYSCOqPs\nnzqeJUi/jBxvBSDafUGsoRDZ9DI1S7DWHb3FFULrhaVnyfva5T+8KkIm6/6+\nWcyUChwglYAJsD/tcrW825ME8/zwQIu1IHo2RVpr68K7J1uPLk4o+y9Z84d8\nM7O/a7c4scATLgZryjEoFCA/V2ZU/3ndixtg1sUr9gt8LkIzf8dIdaMRn0uR\nP2M0zxRa9DClDPaRs4fNEBWSyIxI+u2jMniPD3EID0TmS3NnedpEcGWNkm2o\nQ1xQm7S2zxNbk7EHd+zQtPk8z3QboavDEDigLWcxo4XAbmodD7VN5f7RA6jB\nGLcdGz5LQ4MkoqwcbWPx3CLkNd+8Mz2ir9c2ZdneT0De1DE+cerduBsIP//Q\nOLen5h/EPHBX23u296m9+mjCShvFEX3XrbScVOL8jpyBXGMEVtBpJToWMHXN\n+XVtymD0TtnOrRbZkyvWPLFGTfC85SuG+HBou0hhZUF6nSv0HdXlp+/5FuQM\nulwJzbvH6xqkAfngmxK/dYQnSsgv0xWjvsk2kISwdQIkkWTDi/4fjvpCqAXF\nbxqx\r\n=MqaX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"20d8f7dbe60ba60f91b49bc709c5712c5b31ebbe","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.4","@balena/jellyfish-logger":"^3.0.40","@balena/jellyfish-environment":"^4.3.9","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.2"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.305_1625279320329_0.043166183277982606","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.306-renovate-internal-patch-0f6dbf45198cd532df2e2c36eb203185b5fdac77":{"name":"@balena/jellyfish-metrics","version":"1.0.306-renovate-internal-patch-0f6dbf45198cd532df2e2c36eb203185b5fdac77","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.306-renovate-internal-patch-0f6dbf45198cd532df2e2c36eb203185b5fdac77","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1da9955cd5101d0a2b3c40311e9ea2fd7fd4f849","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.306-renovate-internal-patch-0f6dbf45198cd532df2e2c36eb203185b5fdac77.tgz","fileCount":15,"integrity":"sha512-/+fmNnyJJKXEVgxaQr5eVXqwEYeeYZjPbBCfLimOqEJPdmFbV1NFSUpi/Nfj05fKCXPWVh0AOtZugSGqPCdAXg==","signatures":[{"sig":"MEQCID0P9wyTWDESTjPMedC155yC7+hFQJs9yDcqyIVL6665AiA3Wkf+WjWemU/eQrSbIreKSZSPkyXYwbmtKQ3mL3BAMA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121253,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg4nnvCRA9TVsSAnZWagAASiIP/1eqJEHDlVPEZHtLG9vK\nDjWkFuNCDfeax+2XFpoXh1/RKLBFLCdRZVIlMd8GAF3bn8T6jRfc8HlzdIs4\nmIPGKWeXc7DZiXsH9KeOOYJRXw0FaZWK2xQpAeLh5LAyJNUF6sfTMLy0JLxW\n4e6aZP5zLlNdsNn9PxnJ4acOvSXvlWghpdp4LmpC9ouYQOfBomhLE1j2nnBi\nvzrgGfgnEPFxlK2rR85KrhlTe6GqVP2uXewSgpR+YhB1BAHErtvXoZQsTL+P\nR90AiFs0WX8z6ZYPBzpK/HR7NGP6mwsKeTK8KwmT9v27zCTK83wWq1Rx7l9k\nBo4tCvVJG2GDffNLUru6zS5hVaBN0TXRwDJMABrZ5xTChbqWrX4FC6Y/ZQZB\nhz1JrVnMy3cjDPsX5utZNzib5kSEEj0ykgO+GVd6k4DXqK0v8hHG/C8wMhJU\n0hWWP0dVqW2DzM9FZGp4KVzd0rXmZXY1+29sbrHq/iEAko/AK/9Q/2ea1q+E\nCgPVjr8/xTVLtrzGUFHcmIIiTGFBjfthvnJDPjgPAPjJOnl4s2ZxEQLoCQeH\nB99mOwHntaZFFCGfrLJEQ5TwZ3ioGSm2au/8j14K4EKFg8UCAZYBBUbljn2g\nI13BPHX75XkOccI04+2Eo9jGkSJ9vgIGH/H7MVPaYzEXU62aiCHg3vNzIx/w\nZ0Pn\r\n=k3dw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0f6dbf45198cd532df2e2c36eb203185b5fdac77","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.5","@balena/jellyfish-logger":"^3.0.42","@balena/jellyfish-environment":"^4.3.10","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.3"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.306-renovate-internal-patch-0f6dbf45198cd532df2e2c36eb203185b5fdac77_1625455086997_0.9437416712911819","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.306":{"name":"@balena/jellyfish-metrics","version":"1.0.306","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.306","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a86855f9a7c990e6c00eda3a25637ffcd66ff12d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.306.tgz","fileCount":15,"integrity":"sha512-lCCfAQBITp+o2HdQVjcfrfp544IHIPkC8i1KwyMTcvvQ7UJVKSs6QYnR1d+LOv5SgC5ghOQhZktlehYdzBkjrg==","signatures":[{"sig":"MEYCIQCORSsE5e33ldNmJBwqYkNDaIJZFCO8dQBQ6jL+ExYnQgIhAJ2qA0ZN7mFUDu9ctBcpC1JlsVBG0e4tb3lfxn4HtHR3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg4nrTCRA9TVsSAnZWagAAs8sP/0KSQsSdznYQONihhPUv\ndZ/bNtITPr0ebBSOxL711AM46v8itafEB+fyV5OeGcXgAbRhQ8QgN89NjBX1\nlVv+qUlAqYJNhbjrYjotZyTezArclr3D+Ne4Lv31bIu1rx1xn4X58UjmngUm\nbTwWyc7ZqQWdXwMdDlxXTDvqzX97ZbwV/Qy6HW4FEglGb89d8v/emhUugq7/\nCeQ3O3DJi2BdOitBVfR420MndENFEC3vMATfIsI9CN/fYMfMpB85qYTu1wex\nFNI/JE7TvHBi3lshlXztQghAUU8HcIB2v2urzNxPKykRfbJH80UwgmrSTEjF\nWyiKOJpHhYmqRa2noQX3HYDimemNdzDcYRykdmTRJStaR3tvWr4papmPJSVC\nAEE5vN9z2F6w3U6xaOvq/eMnwc+VG1wTe2MLQZIJD9NeA0PfStBgWS6JVAt7\nQ/0cta4R5vd0etvxlbM6OVUp/eRE5Raz7h8oDzq9N99RsR6pwxLHKY9ae3Oq\njRw+giGAfxN3v8TzRH0eVSG3OndHEQF/WizlKBNmoBBCnpcZQwwk3L37zV3L\nQGrm6gWfewUW0OS3cbvBD5VA2+ami9wd8iZg8/NyH76rm9KihuRjJYyovFoY\nnuDo6xLE1ph1V7FSDqfzyiAjaA+a9Ld1Ig3sVvZ1smI+8vXNBFnYkOpoMUnN\nDZ1S\r\n=t7bh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5accc6648ccd877b312fcbc38f25f325e5ae1ac3","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.5","@balena/jellyfish-logger":"^3.0.42","@balena/jellyfish-environment":"^4.3.10","@balena/node-metrics-gatherer":"^5.7.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.3"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.306_1625455314622_0.8779461112214815","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.307-renovate-internal-patch-67daf08414c1fa796f2bbb10f60a7a105f25c564":{"name":"@balena/jellyfish-metrics","version":"1.0.307-renovate-internal-patch-67daf08414c1fa796f2bbb10f60a7a105f25c564","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.307-renovate-internal-patch-67daf08414c1fa796f2bbb10f60a7a105f25c564","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1a0617459600d751ce4408a0aa2b9467f7dccdcb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.307-renovate-internal-patch-67daf08414c1fa796f2bbb10f60a7a105f25c564.tgz","fileCount":15,"integrity":"sha512-X4PC/yYATgdp/73LyQb0YIrYsacFAtohSG/2bRavyae6/Ds8mdrs+VI/2f/PhD8NFrmPJXG1i/2kxCiGL02Fjg==","signatures":[{"sig":"MEUCIHMxqobC7+BELYnMHQl+HC6a/arUbLmJSq7l84+A9B34AiEA6GBL/TBGR8eYkOd85mRGKmEI5+PY5bNfvMxswGMcTGA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121430,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg4x6BCRA9TVsSAnZWagAATzgP/0JPCn6J2iWZ84M0QFby\nSiIIXOBbugF/Pm9nCKUo1w6syHreMbDFVvRQ5sU+7L1PXKREgkVbvIL1bmT1\nQicWD9Ob6pNvM3k0ZV1soumbVrxH148w2nSvYuP1XF20jk+NKie8ChJ9a+bO\nhojlMqSxa5pSOOXZt2QgoqklnQdLKrTl5NHDVlCnb5X+fYHwD5+AY8eUQwQs\nmnC0a/qqt5PVM0FOtYyYw76Y2ewuNdNUdGO4103vU9otapuurOgFI00gz/59\nHLTkw05VrLRPFu5ku1rqS3GihDLEXrkyxaUrSikw1qG/Gvw3w6eR01HpOGa5\nQfBrpXRt8JYfVnn4YrvxQolgXKLExzLf/qKuY0FxpWP2m8lZomkNi0xDm4Ob\nMpx0aAkjBABWKkKzj0c5dc3pPHOhCgz4thM5g84brH0o5ndLV3/AYw/Q9P/E\nqslQ4YpFfaSpoBdTH3UgDsQBGfguSZMjlmnKtTRmbYnNvMHh5eDWxUqlDvyi\nn5X/TV0/eaYOHcwi+1A8M7VNinxhQunItcqw9ajhTdA4PpgfI69ueiVP379F\ndZvFDivH/RQ04CjgpiM7NUY+0DYHJNtNRaoh7UGBy5YKPDf5atmgr9IRLclI\n1+r2ihG6f4rpgSW1xRgu1pjxdmflPB9ug8lRxbirW50NU5U2MEdNX1dRVyuD\n39f6\r\n=3AAL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"67daf08414c1fa796f2bbb10f60a7a105f25c564","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-05T14:57:11.406Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.5","@balena/jellyfish-logger":"^3.0.42","@balena/jellyfish-environment":"^4.3.10","@balena/node-metrics-gatherer":"^5.7.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.3"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.307-renovate-internal-patch-67daf08414c1fa796f2bbb10f60a7a105f25c564_1625497216786_0.690106701117192","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.307":{"name":"@balena/jellyfish-metrics","version":"1.0.307","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.307","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5d9b57d4a31787645090b536e7ceddc2f38b6d29","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.307.tgz","fileCount":15,"integrity":"sha512-UIR7VKTKUlPEqNRieOaUkcRbrH9lqSODi5UqlZ24oqY1GXWCxZUFmyoAHwQDUJ29U7HRTaWt02wPYeDC8iJJAw==","signatures":[{"sig":"MEQCH2MAB6QdAL81Qb+mAtwwf6MFO+LwG4n9D8Guo/bZBcwCIQCjErki3weMc+STh+iRQ8kHaetlpN+aowh7ItEtaJQIbg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121365,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg4x94CRA9TVsSAnZWagAAO60QAJu1BHh0rSLpKZzCD61Y\nleBTglw/KsD7tGhDGyHWKVpQmxPU0eymSCGNj4StAUA1WsXgFj1Gk0uz8coJ\nDliON9cPDMrYk5koWpzd1BWXfdHQ9RUYd5p0ld8C4AUOUNCL3tmoPbtxxY8u\nNyTI8ctSyK3lRFeTpw/6TAH/rmXfGj6le53iyzwQrgV6dYQ10JhEkNsy0izB\nD1dqG1YxL/zsIcgWwqFGz5gd8Jwwm04xwauhFsAvhzo7BPBIUz+7vehQPib1\nTJrD8OQlfjVVJeJpn8nOwl+OSXxioUqmZp9ZM+oKu6mT5Nfukd8Ms6my9Ahj\nx0tCGGV0fbbe5Si0gi2G9MhRF8I2CoYKfT4y6LVwjgxfyzhYaZ0quDp+lg3b\njiDdxod+fg6J8VbrTuRYSt7Dw+sHIuKGqDo40MY9wtA3ktcATMtj95DNvKcS\npfOv79e491beusGb8IcJy+GUclicTe2YxA1rIbPOnaxxrm0ZH8DKMnV6qLOg\nPZP7LikXlEybFuv+SSy+coAUyKuPXcAHiU/WCxdayuoev6JTMvYbVMbA2O+F\niniUlBHcupQyUCZAK+BVXqFbUg2iC94tt/ZggVUVs6d0GVz7NRCTMXp+wk+G\nGzN1jd6jFKxDqvzUeK5jvuP5tQvT06u1l74/rZ8u/UomH444Tu2UfbwHGui4\nzYE7\r\n=jZp3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4296160b3d7ddaee9dfcbc549b573d6c397bb668","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-05T15:02:41.766Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.5","@balena/jellyfish-logger":"^3.0.42","@balena/jellyfish-environment":"^4.3.10","@balena/node-metrics-gatherer":"^5.7.4"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.3"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.307_1625497464225_0.1822170202909732","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.308-renovate-internal-patch-28f74c5f05f1b62590c559610f7163895085a459":{"name":"@balena/jellyfish-metrics","version":"1.0.308-renovate-internal-patch-28f74c5f05f1b62590c559610f7163895085a459","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.308-renovate-internal-patch-28f74c5f05f1b62590c559610f7163895085a459","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d7e7e030a5ff59ba8d94b2106c67c4da94342bb6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.308-renovate-internal-patch-28f74c5f05f1b62590c559610f7163895085a459.tgz","fileCount":15,"integrity":"sha512-YaBNNMBJ5al5FCNPC8hElLwKFlyR4z82TQQNebZRLJR+damp0CVK+DjGe/1Aw1ZlZ1F1Lr40uvB711DuQtvGaw==","signatures":[{"sig":"MEUCIQC7cBQqX0+ombAhz2ArdGv5h/m84qASOCBGz+NxsgLRHAIgAs0JvA+bvpFOx2FLbJFpjzGUP2zqrX7b1yailwMRG50=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121538,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg4zmKCRA9TVsSAnZWagAACcEP/j+/iPaOz0Gib0XdrTce\n7kWji/0PQbQW4DZG89f4/7Q7zvrsBQvR+9XGfAF2HAOiWFHtrlyUq8E6AwNE\n15IBIhEcaRnyIx3ZNWI8uGhUmJmxo7dSaWaMHG+HOiMFVsq/KkIxakpt4FMg\nfytJffRd2TMj63AyJgDlih0Of7dr9+3u4oNaF9sLNhLMXebQljpBG2QRFxCm\nSR5hfliA2k1ERMF+X9QopGuNyoxM9AZhkQwUp0adcwf9WsJshyl/wl67LJez\n6sUTeZosl+yIPxfxpKXcZesaL8DKW1neFm2lSFiFSBfiC8ejSdVJ43XLuBMl\nMsuRlAm2+e6dBvg/k46bDfAPUczTm8m5WVe8IgluTTaGs2FluIk0wg6CaJVI\nFKXDxMXR8JgIfk75PLuN07yaPJQ7F4PrvT0MG5gD/Cyj8WWidHSjZJAesg6i\nY6f4QGQN5ucrga20ehgafN/Z9LaJ+GMI5pvIBiQsvGU0bHQDZjg4oTqnZc+2\n/1hupnXY54VHdY87ryB8DfnxCjEAjr/59uaIiqqZC09lQ47G940+g+u4QffH\nB5wm09OhHgYiNENB6JJatm7gqOeztz6xxPPt39fRfLxk/sEY5Xo+d3dukOw/\n/dCoNys0OMVHPNh5powLjMC1jqOrwt/MqZhY7zw4XlRUFtRsLDOPvBnxmt2g\n9unI\r\n=/wEm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"28f74c5f05f1b62590c559610f7163895085a459","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-05T16:53:23.499Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.5","@balena/jellyfish-logger":"^3.0.42","@balena/jellyfish-environment":"^4.3.10","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.3"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.308-renovate-internal-patch-28f74c5f05f1b62590c559610f7163895085a459_1625504137677_0.9316520844063898","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.308":{"name":"@balena/jellyfish-metrics","version":"1.0.308","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.308","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"585c918b09756a49a2fddde73536a7d66ffd9edb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.308.tgz","fileCount":15,"integrity":"sha512-ZkWEjjbpZikI7f7DH/vA68drd23jLMVr5WY9GOs7q+DkFpxZn1/efR1sOvyY5Cq2QvYirgi8A0YL4CXCQL4WZA==","signatures":[{"sig":"MEUCICy42wrW8ywr3aZqcwgT6elIU7kH6Cqm+M+cZ+i7my0sAiEArJcrmigrnxEMdoAt6AaLN8iDV0JenDRWoSbJWYtRmFI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121473,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg4zpyCRA9TVsSAnZWagAA65sP/1xMUCoKTqsLmo4YmaOa\nCydNuZ3Lui3q8jPH/unFQ5d0CFdaF/cHTdqfR5fkzVxWAtO5T1hEeKqwbLuU\n7v9YK345H7zTVrMxKOScSp4A3PEvhwO5kEw4gPxl8QvkOCHbQs692rdEBIpB\nxT6ZCYDC61NC9GjahMqY1g9IVApCnWfAApG7mhSFkl3RhZyU+MWi1DOfN4k3\nhPwOBf3em1t3QeyBh2uHT7bFUelvReGGeiFqlofK5JlM9m33JZcppSh2iLhW\nZVd6ule6hoMmwUgS0HNU9rQG4jSvHu9n95UquI7edwlXxz2psf6V4bkyDkTZ\nORzUT8xV0rDOY0w0aAhCK0zey2PJIlt1YlIkoBBfX1qAKvN47rYZwZQaMF6J\nVYBrgIzRN0i9fA2XnKRVa75ko3iUH8A0ITFeRKOv8z9Dh24mgS7OBW/Un5Zy\nY3/C/XQl4BFllorJlhnQv+7Of72CYIxqf0qj36GqFjwUQn5BC8U+5BfR87to\n4rZdnENKG6lxKW3uaMJeRTFXb9Lp1yTKCF2hE757uJ9bfFN3F1dV4TLo0Nn0\ni/chRAGyddWP4JZuraLj96lCu9TQaJyQ0xMaShlv2isFZFG+WvVRPz1oY/kY\nyqY6WdqVm0pbYXi+OWzHGC3gICtunvRLXzvvwg7Py5yUuyWYA0qvQcDkkdl6\nggp0\r\n=QYQt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e6e3b665d2160ee13d973d48f81311d69c8ce064","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-05T16:57:45.151Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.5","@balena/jellyfish-logger":"^3.0.42","@balena/jellyfish-environment":"^4.3.10","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.3"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.308_1625504369893_0.9222118542542261","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.309-renovate-internal-patch-57484e6b4fade4515b0f61ff1345c4eddf0f3ffa":{"name":"@balena/jellyfish-metrics","version":"1.0.309-renovate-internal-patch-57484e6b4fade4515b0f61ff1345c4eddf0f3ffa","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.309-renovate-internal-patch-57484e6b4fade4515b0f61ff1345c4eddf0f3ffa","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3c47aaa3e0cd963cd968e4e2a6b50dafdda679db","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.309-renovate-internal-patch-57484e6b4fade4515b0f61ff1345c4eddf0f3ffa.tgz","fileCount":15,"integrity":"sha512-IpLjxRJ5SNoyyTd/C9okSZw1Lof1Ku4hgrctO1mKHjwA8/QYhsjK1OAZjXKJxB6iw/tmQwy1AM3W/ZBidCOuvA==","signatures":[{"sig":"MEUCIQCf2i6nn21Ri2IgC0CVBaatbjBN3xijEgeXkvTzIUuwDAIgIK4L8xJlRLzNf7z038sAzN72HwAwnlZDAjgSOAyDm5Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121647,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg5O0FCRA9TVsSAnZWagAAmwIQAJuJrINMY2t5Hc6V84Kr\n2UpbGdoZloAh/3T3gUC/14vcEk9fEsL8TGMw/Bqh2bu3G9TvPG/GQ07JME8x\nVNQ1tmzsT/wn9uZ3njspNg/fJKsHS5TEnqnjUaL1CXug8XQgSvtVKnwQ4eXh\nIIGhWhdBYYWFUPVJDqFtolaH42fHiMjO6+FZ3lg4X2xzJFuaVB/4/0EJnt6N\nVlLm7PjgFPq2cHn2UznQktN5kMnm5PTJrfInW2Tk+N/b/c0DHB83zyAkEjgV\n16j3ZdnMZDBLr8PmlGrMOa4LBM0hGyInTCRlNK4UH67kQscboRQEwbtxI4hW\nQqrJEj/uzXnfwiny3GJQSi/nElsw9KqOgKL0rNIFwGY4k8gXMiNXsQvHSzF4\nDJpWJaaAPnvUAN8CCqtNV63gwcrSX4l3SfTJGYOS3UhB+iRzKnMKHpfQPYhQ\ndi0buiQ/Vto+EAA8RMK0pgwDmfwL4K+MEPX0k5wNSlpVA6SCshWFr/I3e2RP\nCaR6dxbdKaVZycxr/BvSxYK1wFy5QhZj89imQil/Ke5oW9jaUHR++JhEKRSn\naGikC24Xs5uHmTOEGtEzIuWmqDpJENLYKzxY3ail/1Efgk+XVBF//25DiOEM\n79coNmWNUOy9dDKNTkZ74q1ZinHl4zWUNw1eP39ruD9efaFu+6RBAq7s/spu\nIt2h\r\n=Xplj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"57484e6b4fade4515b0f61ff1345c4eddf0f3ffa","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-06T23:50:04.641Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.5","@balena/jellyfish-logger":"^3.0.42","@balena/jellyfish-environment":"^4.3.11","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.3"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.309-renovate-internal-patch-57484e6b4fade4515b0f61ff1345c4eddf0f3ffa_1625615620707_0.0039335498688193304","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.309":{"name":"@balena/jellyfish-metrics","version":"1.0.309","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.309","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3106f936f2a4d8f42b08f6f644d51818ddc44bac","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.309.tgz","fileCount":15,"integrity":"sha512-kPtD6Nm5OTR0hnNnyn72ITcGnmom4X18z7aLBWCBqy9Ld3Ue2DAXSMvQp5anCMAIVWwIR7RpLEI6eMACUt8DSQ==","signatures":[{"sig":"MEUCIQDejqc60bdpyuPY6oUs8JcNGkZm+BG4ad4HefR6FuKfpwIgR3IUQMhcLIoW1HSZbZ+gVjnBjG7U2cIjQyaJGYWxK6c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121582,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg5O41CRA9TVsSAnZWagAAufcP/iqEqVzcW0/39JSGmZhg\nqNPZngT0Ka3m1fLOmco75ReEMi3ABpKa4oLNzzL2Y4dcqBX42LU6ocBewHtf\ndEgEH+Ean84ZSBMQhScN1iVRsi0D1RxQxnw41ovQWrZekdbuAUVy6IURGKl+\nBUUeUno1SwiM6tpsXGR/bLT2ls+PZiv9kE/pHPUPTf2VAMootE3jhchNhYTB\nk/SBmxgxPlx61ZvfuGjyVeJxnAZGZWaPK+PsCstP93ypqVJabA5XV2v3Pa89\nIlEy37k8b19xHsvJ/qsFFnpHMbYAYpEbHFbdVr4WvD4QtybW4TxdM5YyqILr\nBdDM52Bs29DH8duC8ipilJ3G4CERg9eXHppawHjpSJmgWcSwfmiIIYLP8y2d\nHbI31BpJZghohuaYPUV60swhiKX6VGdCsEZ62Z2fD3VD4c0aq8aE1Rbhq0q9\n9Q+nC1C9Kp85zXOsk+mFsPAQ5x037vmbvht/u4ITuY9hRPDQ1M8STkCLPZFd\nVbPpuehd1TUei2c0XwI/S1KeW8HRmg8H0roQcOFH4PGwEs1mXejK4kSS/jr2\njYmQ7K3nwAGt/a9fkq/4z8DRkioQ+4+0s4fvRDs3NRvuFDs1Lsyv7x2lwf9C\n3H70i8/vZicIFyFNEhND3sCF8JGTWIvwlnl1IgBpvSoMIwLCham4tICCnecu\nHCXp\r\n=u3+b\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5acb2ca02f0b14b8643a99bd323133612764c248","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-06T23:55:27.446Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.5","@balena/jellyfish-logger":"^3.0.42","@balena/jellyfish-environment":"^4.3.11","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.3"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.309_1625615925091_0.5801058452283379","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.310-renovate-internal-patch-e07a45c475c4e0fd76ca3105e8cb7757860b2aae":{"name":"@balena/jellyfish-metrics","version":"1.0.310-renovate-internal-patch-e07a45c475c4e0fd76ca3105e8cb7757860b2aae","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.310-renovate-internal-patch-e07a45c475c4e0fd76ca3105e8cb7757860b2aae","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3465a2cd625a081049f4ef93c2c408de8da0f4e4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.310-renovate-internal-patch-e07a45c475c4e0fd76ca3105e8cb7757860b2aae.tgz","fileCount":15,"integrity":"sha512-hQgNMnfsBjhXRKtcZ+e0yTDUwkJk4WexL4llZYMz5MN8w7C71rapjwtctMmYm6oAjJ+GG1B5k10GhliOhCsPiA==","signatures":[{"sig":"MEQCIEDCJuszgsoR5ZICpFjJ7VwpzDBwwaCWUlXf08ZblNQeAiBJ+PjBJ6mIJDyOay9wJJrlXZmQj0sNE6Nv/HVH+HCJhw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121751,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg5io5CRA9TVsSAnZWagAANfgP/30+WMTFC3FlIWHDs5o2\nZ3hv07+3NpYeWlGGMZJvd/G6FC05gdQmUOV9G+97+e+fKEsezxUsuifVRdhp\nIFTR7o/5Xxy/r4mFWpIXjRUBI7WD9R0V7LjcK6uGEdlArzhoNKTAEcSEFYiM\nyJF6m/PQR2GMoDqqAW3UTskftw4SX4DnIcFrouBuUpEVCb2bT/7XWhtcmweU\nhhe8t+Ygs1RPZV1hqwo4XMIPR9oP9f9FjCKvnlFZHyykvoFQs4kxsylNlroW\nILibcn79VAnk5a33VkDdk/2tSIPUiyXIVzW+Zd/G+iDAtXcGn1zX552m0SrU\nmMbZXXYBB9+4TXazdtnA5Kl8Gm7wuZ0/Bs0Gy+dd++YGfRtc8S3AByEw7g6L\n6mTGBXigp+gQxZNaBigACarCx4YSU/0I6RXtDvKepZAkYrSKdgd/AISJLGZ2\nZeFIeUeN/53mh02Z/Mik8a3zlzdGDzaCGzWLiWnirCUfzY6FTLsuMkW/NEbU\nZ7YEihCaiJ5C83XJBSZmScIaDscH0DZ0/JOIPcnnRU/6s7vsoWJniV2YvM9v\naLvdOTzXP1cnoOaCQ9Ldw5PQmcQneBe8Dl3pyFnYa+MNackiDObzQ7DSqdJ/\nHIeN82NYW2vrNCLiKBhZVXm9LKXCSEu0zuVEYzorsBinKp32eg/ZnzEu9zUI\nNdbj\r\n=dgNJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e07a45c475c4e0fd76ca3105e8cb7757860b2aae","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-07T22:21:12.754Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.5","@balena/jellyfish-logger":"^3.0.43","@balena/jellyfish-environment":"^4.3.11","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.3"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.310-renovate-internal-patch-e07a45c475c4e0fd76ca3105e8cb7757860b2aae_1625696824762_0.12920946178299997","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.310":{"name":"@balena/jellyfish-metrics","version":"1.0.310","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.310","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"989f0806276d6cdf366e554f344c3f9be3a8eede","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.310.tgz","fileCount":15,"integrity":"sha512-dy6kcc5qWiTFpHKXF4ueU8qqy38eC/JXjE+V0Af8c58P1q/ILFvn7N0x6uwvRSdRhZIkMnBKcKGmxuoIqF+nwQ==","signatures":[{"sig":"MEYCIQCmJ6bx2yUmSx+9MMx5NPh9JR6BcZWAdQitob+HRC57HwIhANm3ph0QLNUNLyhT3ZEP49MfFccPQ04B4ANklP8aIOh6","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121686,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg5isVCRA9TVsSAnZWagAAsyYP/3mq+48xXHUhp5NtBX23\n42GSDTmrg3kWDnVKQ3vaW4EHU2TVk8Jo9KDFeN8CAI0elCLtB3EDetCDVzgn\nZibZN1KT1d5uaxfFnmn7GeFFUEK7lRtx+ZG4awTPYEomU2fh2509G5llyuqH\nvm4b5gH3vy8U+/CQYI/VTTkZNKdyqufSNiBMSSUFDGPk5cHu0+5fBof5el76\n+nQ9nKnUVCTOWGRc7WRUN/q4/UqPuFlB2a1Y2FLSCNwE+TgPYIZVSBP8WzDX\nDbxaewqRjjgzoQ0cfBc5RaHFs5jZvhDBIU3KH4IxwTviYX++rEE4uwg/Ly6+\nlE3G3iMD/5/t/qgaa6MDEr5HyG2by6RvAdWRO+gaAVkdb6dguTSejf59MI7p\nlVp6KrVvSSogtv09N7otflSKdARYHKtcR5lz+pNDurWo6swcRANq1mznA3aI\nvNxLEz5zcudfGt2N2YM4nI7hxVq/VRRe3rTzRktJk3HqvBgmlDaGxYF6K1EE\n4M53IiSXqPsCOCJ/k/YBzjHCtiq4wGwaOWAKCe1vYB87Jk5gbubzzZfe7UG4\nuxJsgJfZ+r2ALv/wVr7NFeHGlWLet0w2XCciu8+bTvph7WxpUmdXO/95951H\nRPaEPiJK5OB7l25cMoC1hC9hs4owZDxzchq6ufWypD/10aNjvFUHtHldC4/S\neDFP\r\n=cQwg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c2b9fc4e29b40c6c201bb405be4e638832de032d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-07T22:29:02.028Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.5","@balena/jellyfish-logger":"^3.0.43","@balena/jellyfish-environment":"^4.3.11","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.3"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.310_1625697045248_0.9035248184059506","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.311-renovate-internal-patch-b99f54e5f185ae5b04ca41b990145d9d8a1833ff":{"name":"@balena/jellyfish-metrics","version":"1.0.311-renovate-internal-patch-b99f54e5f185ae5b04ca41b990145d9d8a1833ff","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.311-renovate-internal-patch-b99f54e5f185ae5b04ca41b990145d9d8a1833ff","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fa7a8222914d174e566b8d41c95422a31f84dbe9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.311-renovate-internal-patch-b99f54e5f185ae5b04ca41b990145d9d8a1833ff.tgz","fileCount":15,"integrity":"sha512-A8B+VIDvF3ayF8fXYCDA6NOAfdz9KVr1RvDGkiL9IyxHhLp3Z5YO6R11P2Y5OfW/G+fnhIiQ4R1POHjD+g+Q+w==","signatures":[{"sig":"MEYCIQD5MVSw3ZrgGLdWB8w2h7O/xE3i4t/Wwf9RrWlh52OyxwIhAKxjjryuh1wJFYh2zMcMUH4tYiIHRd4qzVhICJmL3G89","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121854,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg56isCRA9TVsSAnZWagAAQhkP/3mTbuB4JF7aDqYIQhCm\n62pcoU1lAJNL1bOAd4SaNzcWuffsEoEc4RnLHLm1GaP+ygiYqOtO0Zc0gSwR\norNyFPKzGeLNb3t83TnTzgnfWzSMpieBO0g7kJK5hQBEvFTiRGbGffecu7EQ\nG154sMSxPxy/e9qD9lU9JCcsygZ02W+rpaukXWPHDkyItJGlkSwz7/lA8OdF\nLMo1YOrmqkbm61W8436V3qz/6+AQwpwNODGcg4mn8/WRyDFYE0watoc5nesV\nHpHEUbmvNrA2SvJAQzzaGRutjeMC94rXtfPmCjsF726ilt1L1c0yZ+Hjyga/\ndor95PyMzGPY8QK8T7Bmf0DrHfrz6nWe/eXWWvIwcnEm6Eb7B87F52zV9JTH\nXi4nht/spy+VDh/Uh1JHbJd7yNsJIJKu9rcT5Lp3CKfIDfU/1Uj1X5Ie/BQ7\npQKHTZnALLPQwDfEHnyZBmH8l6e5x/Pg3roEggilzi1PUR6wfRDX8JR7G4po\nHOI9mmnyiTovIKqe1kh1BKxBFlIe+o5nAATlUgHkAyZvxIhgYBOYnFmRA5Yg\nxdNyxo8+tu5nOctghe4dR/9nxuIFeqBuG3Oxu790282iJxI/+BFpB42wbj5k\nLFSrBeIJwC/pPKwlGxyQbzZsbrHHlKnUWcx2Xykrhut0P8whMlMTHuVA5GOZ\n88Bd\r\n=PFoN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b99f54e5f185ae5b04ca41b990145d9d8a1833ff","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-09T01:35:28.215Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.5","@balena/jellyfish-logger":"^3.0.43","@balena/jellyfish-environment":"^4.3.11","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.311-renovate-internal-patch-b99f54e5f185ae5b04ca41b990145d9d8a1833ff_1625794732333_0.029183497702031103","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.311-renovate-internal-patch-90f46f8f285f214ae080eebcd8e8f4b5100dc2b7":{"name":"@balena/jellyfish-metrics","version":"1.0.311-renovate-internal-patch-90f46f8f285f214ae080eebcd8e8f4b5100dc2b7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.311-renovate-internal-patch-90f46f8f285f214ae080eebcd8e8f4b5100dc2b7","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f6ce4dbed8b2af8467187e462fbd197082da4173","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.311-renovate-internal-patch-90f46f8f285f214ae080eebcd8e8f4b5100dc2b7.tgz","fileCount":15,"integrity":"sha512-WOu68aIZiyRk8BlzNtwaH5Mm13hqD3OlK5hHYXIhJdNHpjzDvs8pP397kBYCmtO5rzUERdDor8xwxq5ko21GcQ==","signatures":[{"sig":"MEUCIQCGDRAkDqxGgqqjKJBABcP+B4eq+j1v0dE0Zl5kt7EFLgIgX6ti1s7gAe/R4HchZ3iN0Hdn53+kBKu31HAR/szABOo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121823,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg56nJCRA9TVsSAnZWagAAaDAP/AuK3IQg5SnQlCNbDf09\nlUu+rBGgM9GDSP8NhD1AkDsp1tRY1WBEOq5N/mr1NTJtIiwyuJEpufPxFzs2\nxWMAxhHUnfHwLFUlk+bZkgUbUw7W9aBX1ymtDwwdKvbGZT6CGeckhpvPapAZ\nnK9HwaX1r1J13gn7sXyZ5npoLK8M+XJk2kLFwcWOLewvtOnOsyAJtbBoT5N2\n4ccYWvAePv1dBAYQqdCkFPlewBrLs8d4U+Fw+FN5stO/tGzLGkB+o41yvBvQ\nHagt1Llc0JmboknTW5vHTvXOZsr4qPV1QKcs4Q8khAezTnjO7s5yOVIBJ1y/\nAVnuMWKee+xVtbXeg9hxXg4fFyeDKVsS6UQ+/g0fG3OwGk5tkf1dQYmj7H3f\ns6fKz75FUZxXyMUhBaEKPBmQXWzOpys2mVW+QwgHhGqkiGfUELUQDFK3z24b\nhbGu3bBt4400DFQywo1lJu2bJvtF+SL8nxmd7+tXlcLcyin0ZKBoanxsEyqq\nc4pF5w6T3L3uCG4QVlugf7rOCDsOH4fkl0VlXVWLoqNxOoKMxJ3CQyUEjCb5\niwVH2tDqyjLZWviDZ76sSORzNIrGtyhiYtWGCUQNSN1Tb1S3si2Uz6bFDKjo\nGS0wBuxYos27NAQOU2MJ6bR4lr1FmuA85DEWrlDjtumsrs6APTwBj8RYVW0C\ncH0Z\r\n=JZIZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"90f46f8f285f214ae080eebcd8e8f4b5100dc2b7","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-09T01:40:46.828Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.5","@balena/jellyfish-logger":"^3.0.43","@balena/jellyfish-environment":"^4.3.12","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.311-renovate-internal-patch-90f46f8f285f214ae080eebcd8e8f4b5100dc2b7_1625795016922_0.15217995501749004","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.311-renovate-internal-patch-17a56bca884d2316ac7e87c29417460bc94d4076":{"name":"@balena/jellyfish-metrics","version":"1.0.311-renovate-internal-patch-17a56bca884d2316ac7e87c29417460bc94d4076","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.311-renovate-internal-patch-17a56bca884d2316ac7e87c29417460bc94d4076","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"91d13f841507fa842364d6c1ea2307fbe931b577","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.311-renovate-internal-patch-17a56bca884d2316ac7e87c29417460bc94d4076.tgz","fileCount":15,"integrity":"sha512-Zj75ZqiEAzWN4fWBdWvtGARLp9jSlrv7zQXmGqLTjbHVfKnvFrA2dMb/8jj61mDWzAMEkM2RsQUgM4Ck4wPk8A==","signatures":[{"sig":"MEYCIQCSYAOSSzJ9RDakgSGkuwp1fHQJwMDYffJpb9VjuxlGBwIhAJnxPnoc+93HiFkBGcVZO6F0gVRAg5kfSmmQLviAl9et","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121823,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg56sGCRA9TVsSAnZWagAATbIQAJoLfhrrDn83o6M0ZbyO\nhyIgv+aguwTnLZklBgwUBXYxMyYnmFQgEl24cSka3+4UIhoYO9XXGBIo7aSg\nZt6GV+LNv9nZHWrX3LtCfDBm//AXcU4AcIE6Vvp3UQkCTS0JocS7YMDC2E76\ngVRi+nelv8GZ4LBG9E7bgsoq4ex6Q2yzfomDUdINjdecS95rvSC66c3tBU9a\n1yBio66C9VH82+/BxPuhhLWgZSLFD+wH3nQWs98TAIk42Pz8lXHbT/TBjeqM\nsEZHog8wb3qdWsyL7rNvhuwpm6lyffwvDLWj81LYctdnKka3H4lACe6ge90J\nVi5jO8/es9PlmUVIv54ytoPjCyLf3NYiPJpu66lwxX3213/YnbhmkgSzeTAi\nlWzeeM6i2q9bw5QmzXho2E0UyPqKzSrhWeV8M70iE7MWRq6QAN9uEzMWJ3ZF\n0vGk5e4TciLWH2A29I8PGY1WsuU+gaZ4xfkznrvJAikY2hJis0m7hgY9aLXQ\nXLiuO8pmfLdosvkmZhRc3lF87bwrfxG/1Zx3cYO0ANTJnMcNYuIGJ94YKHGG\nw3Rjop6L4EvtJD7OavtUJuiiNorQk9njKy9D3FcEAGkfOL3TQA5BUtlYLX1R\nb58uAOO00UTzqqaIQmA4Iq8bZYkekCjELEvJ1dyoeQYeYU4yATZrM7Ywuqwk\nwgJu\r\n=6Mud\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"17a56bca884d2316ac7e87c29417460bc94d4076","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-09T01:44:47.439Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.6","@balena/jellyfish-logger":"^3.0.43","@balena/jellyfish-environment":"^4.3.12","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.311-renovate-internal-patch-17a56bca884d2316ac7e87c29417460bc94d4076_1625795333438_0.8619477752976905","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.311":{"name":"@balena/jellyfish-metrics","version":"1.0.311","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.311","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8b336d504e792afb24bf179d84217f4844e40fb9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.311.tgz","fileCount":15,"integrity":"sha512-RLfL+b7L1CUv0wMvCzW9CCAKpA2Z0cIJPcly73feW7G+A90JW27xuusRkn0wH5K7Mv6ts6WSwXJMDr1qmMb9sA==","signatures":[{"sig":"MEUCIQDb9ILG2dhRW2vagF5x01w1thjhbLSJx/4CGZeXwbFukwIgXmkx7SrcmRtnxu7ZYKiLDiVa5WEtgcDRt6BqXV3CH2I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121758,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg56vZCRA9TVsSAnZWagAAra0QAI5kbtfevrK5J6w8dh3c\nWBCKPwtmk5VX3rYrZU+KbmKtt1cmuUyguOBEtOSW6H9t2bMA1Ir3JB8iH9cX\nSdGYljiQfTYOVViUpUQMIJhwvyv2sQFz4xnbiq5NLFXlkSBNNqMvJA/ANNl7\nKgupO0RNut6naUZiWZVWYyZlykdloNzPBM26As+4ry3VTXLlzKIITkcGHBKB\n7uTdb0uNA9bG1+kfB8IkgOi83eovDvZcq/7FeiZ/tdqLdKH9PPpEuw/HFu0Q\nx57N6bV2yDv3+nEWLZXxvm2WdNEnuWpVir4yheJHrfuxu/n6mO3Zs56OJuUo\n0bgdwYXMF3T34DhYtoh1QQx98bthIj9BC/tGDUY/oCtl/9VT+Q96OS1w8evU\nPlLcmsKBuJoaTAzXmkYmBhdAJSUW/YXwgB3aT2Q4p+cE3LgQbKso2GJPT92G\nRFY2IlefmKjUX61tDDTDP0V+UR407tzRtNaBA15bcbO7nw7SCns+CIiuhf9Z\nUTFVpMLK2NeR4d1J2k4c83L9qQY/y4zcXRSZDXYnDaZD2EJknHAkOvqHOBf2\nrG9jiPECkkROl3FIsCAEkkiFNtHE80864ObKbPgFrNC2GF5xN3N/6m5xOd/d\ncW/jaSCxwl76GrPItKoeV19eXxzmifilldw/1LCL9S3tegGJsgp5Qrwhp7NN\npS3p\r\n=MPYt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b9362579db518d3e9830cf211300a01c11cf8690","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-09T01:50:41.714Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.6","@balena/jellyfish-logger":"^3.0.43","@balena/jellyfish-environment":"^4.3.12","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.23","@types/node":"^14.17.4","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.12","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.311_1625795545103_0.7334514411999562","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.312-renovate-external-non-major-9ab09d8f29103a5396356769af8309c1d1168435":{"name":"@balena/jellyfish-metrics","version":"1.0.312-renovate-external-non-major-9ab09d8f29103a5396356769af8309c1d1168435","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.312-renovate-external-non-major-9ab09d8f29103a5396356769af8309c1d1168435","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"688b953b46b76b496109412e9eb5894c3c23871d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.312-renovate-external-non-major-9ab09d8f29103a5396356769af8309c1d1168435.tgz","fileCount":15,"integrity":"sha512-P9r4CNJX+rtdoiAEk7q4qzKOOhAmBbqZKDHZgcAuij4ZmKM9U2oalLub2IA33EBhaA4l+pe7NqMGhyoV6NOa/Q==","signatures":[{"sig":"MEUCIBbxt6lYA9fZt5Bf4Klq1SE6xid5JWR4rQWtujtMdoXMAiEAwu32a/B0FF0czcRZl3IFRy/Nzsp2DdRfvIBz/sd0irE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121903,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg6PfDCRA9TVsSAnZWagAAiagP+wVXk/7Y6ONPtyU/+KYX\nAUkJTJ2U4DxBYYezePcrZDgo44FiX3seYDCvHloKhNJl5Q8qzaFA2EZOiyNp\nGBvaZndFOn8vMZ1xj4mgxVX0MTlcklrfZqi8Ko/QKDvhADeW2Z3NXotAyp8H\nHw2rDG+BWzei9YrtegFHxL8tvj6hgdeXaMlP6DNnSgzr8zfGke3mH4pn8YmV\nmOR9Zc/f2SfD0eSoTA19GgiHKtE/+Iq/9VEXJJyfvcmTpMUH/o6pdc8cF1sh\nr7stWE6CJEqMO4pyTZVPhE0tFwm/ypvXzhwotNHgslWG+B+uyBb4yQWYteQU\nCXPdgSlY+cvnVdtNYDvFPJH68GSGt0PpLqtzqtFRFyVhVMsWS6ISb6MXl7Vw\nmVqtqd9tasOwuxZBzc8wythu0Ts5ulRSG7bFeplT4OkZ1NddDfGux5zqGaXQ\nonRX2GazV9pBgDWSquTKSbeXajt29qhjvemIBUIpJmbImnZOSyJTUG7BVG33\nBb0oSd5EPDQFz9hiLjle5riJ+RVHG7jbUVtMDKDQSgSg6djN5fj5Mqlqarz4\nvBhCRBuM2ZtQVFY1yxnATTPu/WHxfeKsMTXZne6Bzr1G9XfIhxMjAKZo3E40\nSimnM+H5AYXg2qqE1Bnd7WRatmg2RJ2eZGm6eZfE48kmNI7Brq8Ki/a3MFHG\nsONH\r\n=NojU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9ab09d8f29103a5396356769af8309c1d1168435","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-10T01:25:05.528Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.6","@balena/jellyfish-logger":"^3.0.43","@balena/jellyfish-environment":"^4.3.12","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.312-renovate-external-non-major-9ab09d8f29103a5396356769af8309c1d1168435_1625880515309_0.06391483833824019","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.312":{"name":"@balena/jellyfish-metrics","version":"1.0.312","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.312","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3c05ccd1b638ae70688060c6410cc69a76131bab","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.312.tgz","fileCount":15,"integrity":"sha512-2RS3o1xcqTUjH5oNBKIjBeUtpGYdCUQMUfBych2u/bPncqAD0hsJ0kXRbHVKp8o4EHAECaQ6jsTc/Er2hVcEOg==","signatures":[{"sig":"MEQCIHYbORK7v2mIIIruBq+13lsajfr5l8o3fDy2/WQnXYaSAiBREVbZUEZFeRKl46MpgWZSWbQnvVcptJ0rosivkKakdg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121834,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg6PjZCRA9TVsSAnZWagAA6xYP/RedFwddJgy4hT90+eJl\nl5W8yShwqcd/z/xvTm1mWpj+zEBlqjlFuOiyr0ltlKgVdva8DJAfjqTUaKWG\nqCufXBinufcTBC/R88v4khfLeQUmwT42k+NXFoHCnA8lynO9YBE8/7FX4Ooo\nb+K3zKyjy4Z62uDv4h0M6LNQXY9/gxRLB1kLu/IxOTV+4/YzVggPwN9P8VD9\n6jQieclLO0+psmSVA44niIXQKNXO+esomyP1m+sD1Y8gjzseD5pD9fnNSCS+\nGO73mUDzIlgFB7qXpcRhHYaI/lCpuE4ldAV2edjD80HHhSomhBQWnvEgXR7f\nvjEDTXsMNjOBh0F4qcsmsW2wGkZc408jjyjF+TuZKJ3wIb6DvFLF+1sbhs/P\nmoYCY4nQoL6LYHOdvOTMwzOfGTaB8gYUDEPJg0IEYtsWsEtUrmZZFg//2cTN\nTLSV9NNHkU+XLdeQgEazVMUAG2WVRG/Uli4IM1YXvnSACGhwFuAf1O/OOCm0\nlCdO6c7DLOgZ2j4Ij72a5Sizz/pQA34fOq8FKoe/WUwMSY5RvB6lWDn5GHHW\n0S/ArBxlke2DWbXQ1GQPcMxxTTK+hZhnB/vmY517AjgLrxYrvyc1t1W4H/CA\nI9veol9a1yW355HukgupLv7oInrcvb4OoOZQaoMMNPbeGxy19hqlyFcBjU7R\nW4FV\r\n=h0Pj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c4160ef5317709eb0ffd5bf53167a50faf2f41d3","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-10T01:31:22.435Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.6","@balena/jellyfish-logger":"^3.0.43","@balena/jellyfish-environment":"^4.3.12","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.312_1625880792957_0.1858555461271416","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.313-renovate-internal-patch-5157c6ce8990d217c006f1cb795a3334c924c0e7":{"name":"@balena/jellyfish-metrics","version":"1.0.313-renovate-internal-patch-5157c6ce8990d217c006f1cb795a3334c924c0e7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.313-renovate-internal-patch-5157c6ce8990d217c006f1cb795a3334c924c0e7","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cc937cdd003261d07882b8d6d4ba5251e53e0b7d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.313-renovate-internal-patch-5157c6ce8990d217c006f1cb795a3334c924c0e7.tgz","fileCount":15,"integrity":"sha512-vzmtLTh86ry9ufTi+X5zc/xL00hX73RDXQMncaNYGRC4wLbmj6UiscM1g96iwp3naWfrGYcGYXuqmL9d8/U4xg==","signatures":[{"sig":"MEYCIQCLooKOd6AfN6No0Jh/9Ewgs0dzFdIHyBeB18UuI/S6ogIhAJDxqJsdNPRwo0858QideXbu6D4ceAFdbp45x/iP1mNi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121971,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg6PnACRA9TVsSAnZWagAAroUP/iWtvNdizbICO2xbubgA\nXNTURZ03lA2OH+aHvOkVIwTw+p06i3NGbD/pADaJmXxFLHS/p7cnGwtu4Ozc\nBtM8HRAcXqt5T0YHeVZ6vCfoo6KDEoWenNQ8g9DoPEq99uED3vchI1+hEZ40\nK3Mcva/IRq5wp8V05LHdazv3ulQ8T1g+GA1d+UwH7sZnOd6QaCzUmIVePmBx\naFyvOY68Ze0JMlISysr+B/GEJkCEO8lyqYB1+H5VXqiYu5dOR21ufAWIqzDF\nygxL4iwe+suiH05rak8e0VbtwcrJ50BBOm3yi5XF2a9SIPEHHzE8MDLK9cZv\nosGtJk/MozWneQDbQOBryc8Dv6GC36JWdJGGsQkbQtLd2KP+ACanU8WCtWVZ\nxQkb2m4n+Fu/7QjjqtnwAp9rx4lY7kRlZLZJHgDn8eERCXJyrMgGoWH0iE6R\ncHXcIjowdqli1TGL293HgN0QcUUfE7JhmFoahIJzZqEMYZkspLIJdvpsHAJk\nY66jAEsWTIUM9pmYa+18tnf4AH+E65Fx9qMIxXdNEdUtsN4zJs6Yi8g+Ih4/\n4km+wvrtGntT1aAvkmA4f2lB4rDklo8buFX/6mH5fMrt5V14J0MYZ2jYwYaU\nEoOODRngInQbgKXg9tWXG4GD9xQvHW1sZo6QYETN9m3FWnRKMmoJhTb/8mfL\ntdLo\r\n=FxiX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5157c6ce8990d217c006f1cb795a3334c924c0e7","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-10T01:33:44.467Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.7","@balena/jellyfish-logger":"^3.0.45","@balena/jellyfish-environment":"^4.3.13","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.313-renovate-internal-patch-5157c6ce8990d217c006f1cb795a3334c924c0e7_1625881023717_0.9308810355919439","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.313":{"name":"@balena/jellyfish-metrics","version":"1.0.313","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.313","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f267badd52ed8841406866d44cc438d7a28de808","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.313.tgz","fileCount":15,"integrity":"sha512-uWPx08A6d4Zn/+kvnRz+Rzz9GRMLpo2H2oxadXtAmf9I1BLFmgZEjj3mjlBhVA4uF+2q5ePQYlKfMMV4SoCp2Q==","signatures":[{"sig":"MEYCIQDCsTfo7BU+fkqoK/1iZszc/H8aWL/o5bWw6F29VEamYAIhALxuHqueggPyWsaFuRRemYnZGq9SyzMlUEzHKJ0C7THR","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121906,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg6V2tCRA9TVsSAnZWagAAshoQAIc8Z9CMLA+DC5/b2JIQ\nOm/zoy/eKpXCVw2QUIUyvK5/7wxd7/fRN3uRsNToKPMoyPeeL/TURzVCE6v6\niYEoqWO3mHS6i0PSMZzIelzzCVkUoFTwzod23M+JiW1mlN4He1I14hKahtdw\n9jhZkCaqz4jItwUXyYoB1BH6HiQ3phgRWM7RcDJtRCZ5H2zvHPsFooCn3X/0\n9mnIXDO+2bbTAasDIWsdAEy/wATNArVK5mhEhz4+QubfZWlGB9vAj/JcCGHV\nWSY+c38vbop9SRTmlyBPTTxr0gnm+5nU9E0J6yQKroOgL+m7O1gv9goerhb5\nEJkKt1E0x6DVVKwoDIewKgKziqefAKfZZ+EC/Vl7aGamjN/5h7VerRdt+qs/\n+LQa1Povr2flx3F02SyjfhcT0nsDRfak59c9cA7drNHSAoLixQMluAbbSYSU\npW2CBppu4ycHdff82qeA09nbCCA0JwXtE03jTC6HVk8qSg7VnULt+puj5dQq\n+XhmmMjCqA8f6QOMUnfvKYXAuiQmmRc7gXXN6T14Zskq2bWT/i4fFYjFgP36\nAjMg2BszHjovRlu42OsMYVU9IzDKVGxFTrxyPEV/J0eqUauz4GbZrZgSpJDb\nO/oyfpdSt5zwMKVVPGEx7VzdbpyqEE0aQtlBJY663rjygghZlnGTCR6hgnPW\nlRHy\r\n=C5n/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b4cea4d32d1409e523128ae7ec669ce130e4b6fc","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-10T08:41:41.956Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.7","@balena/jellyfish-logger":"^3.0.45","@balena/jellyfish-environment":"^4.3.13","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.313_1625906604939_0.9191391330628045","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.314-renovate-internal-patch-9cb10695a2ce490e4041c63821714d41acdae238":{"name":"@balena/jellyfish-metrics","version":"1.0.314-renovate-internal-patch-9cb10695a2ce490e4041c63821714d41acdae238","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.314-renovate-internal-patch-9cb10695a2ce490e4041c63821714d41acdae238","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7016028f61c31d9e361a6b9f37e7a2fb8bd3e6d1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.314-renovate-internal-patch-9cb10695a2ce490e4041c63821714d41acdae238.tgz","fileCount":15,"integrity":"sha512-KtfQog5X7Gw71XiuOMquF9f02yM8vu0TbaT/DWcEqjhE/OQLSxAnh1/wWjcKuaXw0X+CEMHaUPv6GnbBFHvwxg==","signatures":[{"sig":"MEQCIBhoMaSvkVCA+FDt+dbo8lnlynnQtp5DnUNkwkJ9CE7iAiBzplmkMRGeZ1tO6Xsf+9GblfXKb75G2y64yDky0YGLNA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":122075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg6V8mCRA9TVsSAnZWagAAL1EP/A9bnn4KiOLtZMMEJ9jk\nppjCXyajJqlF5mnKrcTml4JXw/TnnAqCn8lvuMgVxNBKcoKMV5FpnJKY4awU\nm0+QNJjbbRgcqix5M7txMfMOwbor7wbYLg8//WTr41NgRtRlaatERCwmKfVG\nk1Ccr+L4shnf2LtzbR7XqoS8kLnO0ZpbV6Yd7Zz9IaEtjlalMkxg1vF4/get\ncDO0T1iApT6EgAKruXCt6xKOZTrnWnwqkEYvktIstG+Wa0F6sIXZuWHmC/JI\nfYIsdQ/5+b3SvZyxId1iL1/ocP7LhiLQrGAOhtSw7QdUnzsiLmEUXTeb2oxQ\nTxWDoaSMl9x4xXaaR1QAI5IvDLmU6zojuOogygg0tMSjCzCkeJ+ZhKvFvl+S\n4nOKveNw1p/FO5l0v8UgsCdkKbq9FnZGzvzPDwz3jRhhHMVp9JhgHKykfSni\nBueQhtc5GM1s5GCRDXtS2StuQuVM13XpEnQqaGh9fqR5vfJaGmTXX1Etw6As\nkwMH88kxk6fRzwdd0RJBp7bYgd+wYrlH7lVb3k7x7IWCx3IkUqsBb7e8NRc5\njhVcUioyO3P99izSbqfYurt+O5OJvz7y8gUI3YLC67j+HyDxi2+LCJLlYBG9\nxf08U/tOv72JrYWM7mIbSSWZQ5o2gfTq6csINguS1zt4Z8glXhaOFYvwTo6d\nxMfT\r\n=aCKy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9cb10695a2ce490e4041c63821714d41acdae238","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-10T08:46:02.051Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.7","@balena/jellyfish-logger":"^3.0.46","@balena/jellyfish-environment":"^4.3.13","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.314-renovate-internal-patch-9cb10695a2ce490e4041c63821714d41acdae238_1625906982332_0.9284909612171524","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.314":{"name":"@balena/jellyfish-metrics","version":"1.0.314","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.314","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3bb9bc6093f5c1cda001ce6a21aba702c483f778","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.314.tgz","fileCount":15,"integrity":"sha512-iDBp8vS4ld85w0ximkIkNEwAh1hT6tlPvR9KM54eDo7HOLs/f692NX6YvFn9fwwScgdzc6QkU3uwBFNBSJ3pww==","signatures":[{"sig":"MEUCIB1fyFEeEtSGdo4nidwJOpoVBP0nr+K478apYahZOY2XAiEAp6OgZdgQzrWcAp5/SLUq0f0rbua36z3gSds73JFZg/o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":122010,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg6WAECRA9TVsSAnZWagAAmVUP+QDemanOF7NIx/Xuz4/H\nntmwnsrole+vDi5CW1iUgI13WI6JAS0dEuTDXOodpTbuDjh/idedcuT84rQ3\n/2gIujrChbf1JV+SxZhyMAa5rHz5p84We6jVP2BTDMv0M4/9UXubosVtmyQ0\nWior1y24N4LS8gIxeK7hYsWb2Vtx0IvgvJgsdWRUP9TOTFP/1aSwMbjhenRH\nPAwBl1n0O8JPexX/CYCyGqCEDXUxZ30owLxrHls6oTqKARp053n+YBLRU1yE\nV9yfvY+88znxp5C9wXYYl2kLjOskGpzhUpfg9dfT77m02DnzbGcF8PlY5VdY\nvzQUg/FWbvQqcKJMGd1q7hZ15Wt07DPaf8aopinIpFlikuL/RGJPSo2rDrND\npLyIqv9jGuyW/ad+eiFksbc6maVarCm8oiXmCQDcWBHsE0RBa08Q1kcOzaR0\nTAQT5cyL8lq2/41QjnQBaf5CVHbm+MpZ87L0JTYOOEtsWiK432EUh5BFIUXX\ng6UuavQOpivJblmECLZL9CFBGZF8lfxE1fLx3Tl61Py4LlnAHcpOBl9+lFgm\nr70fTUG5DPHY+M0ghWALKISN58yAm/wLESB1Yzr7JnCyHLLy2pfzsY3Xo8Bz\np5KeuGOEIxv/ETVg62h/cV5Hk+tip8QexBt7ciJQu4NwYUb/UsnEUhygpKYx\n38Kc\r\n=Pb6y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"46842d4df88e94ffd09c53365b870cc07f3b3980","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-10T08:51:43.473Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.7","@balena/jellyfish-logger":"^3.0.46","@balena/jellyfish-environment":"^4.3.13","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.2","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.314_1625907204240_0.5830725060497433","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.315-renovate-external-non-major-2617dac45d5fd10d6afc8bc20cd10d7ca73da17c":{"name":"@balena/jellyfish-metrics","version":"1.0.315-renovate-external-non-major-2617dac45d5fd10d6afc8bc20cd10d7ca73da17c","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.315-renovate-external-non-major-2617dac45d5fd10d6afc8bc20cd10d7ca73da17c","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"dfc8db3d7ceb6477b4ec1d67b022237c3a8c8ec7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.315-renovate-external-non-major-2617dac45d5fd10d6afc8bc20cd10d7ca73da17c.tgz","fileCount":15,"integrity":"sha512-FrAhSoZdK3f9wCR+lz6hPGE9KlrTKufOqkSIm46t5SVI6O238XccXRH/zcZ3PtjxrtdPrjtKnsJqHCHd5KIJSg==","signatures":[{"sig":"MEUCIQD76suh7kgUMdiyso/tq8ahIyq+gFmYJAZeJBBqSZJJvgIgdCV7Zpml6uMuJuC3C3M1p/zd9UpdH1AylFqcPUSP98s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":122166,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg6gqBCRA9TVsSAnZWagAAy+IQAKJ/ynbmE9DBdqUP5jRV\nz47uxKaRBEkudKzh5aTD1CKc6O0p7nqpo5/hXpOnoZMbG+ik9EEVwALf+Nxl\nuBbopSRyePEbxUfVVv44IVo9iTjfsELmHFpYzPJaah3Pp6YuTW8jGZOx8l38\ntwXIBZjWHGky5eGyAVUi5WkiGTfwVI0YOzb3mN9L7ML8ms92qxZD1TcsExvy\nEEB1eubz79AdhxXf0p46wKa+6dPCr0qe+WAE01KiiwlM356kykanNakQQpDu\nFefgDhrl2J8gawMxarKsaxRTU66SlDxfzKnUqICgHEfQDrsW2ypdOnNYOuLT\nqp3ONaIec9Vd0394R1IEAhJTAQQbYY95KYuvLd0FdueKMfxPbu4jjwQVZF/p\nRFUSvsXx8Xozcpn8YwYh12tO8BdbEuOyAl4i/YGTgBpDvSvkOIfU5GJ9LC22\nt5+PyDlZlLPuXVfg2Z/Tqn4fR0PTz/ku2O3c1RmctwKBC4O+3DHjGumPYFqX\noHte2ke1kvdOpDvxKnUAs10DqN3Ox87gnuBrcTNtjNds/vf58sQjY0WqVK45\ns+SJ+NPC4RoQmlWATUwlBnIm3uXWQk4Nt0jVZq4pKxCZcVRgMPZM/yn/vH7j\nGMTVcbss6y4SIqqJHzDkn4+iBXWwxsmrk3AnEjLBvPBZGdtp3h7dep5PZdky\nwyLc\r\n=oNfB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2617dac45d5fd10d6afc8bc20cd10d7ca73da17c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-10T20:56:44.798Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.7","@balena/jellyfish-logger":"^3.0.46","@balena/jellyfish-environment":"^4.3.13","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.3","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.315-renovate-external-non-major-2617dac45d5fd10d6afc8bc20cd10d7ca73da17c_1625950848990_0.07107013144630603","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.315":{"name":"@balena/jellyfish-metrics","version":"1.0.315","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.315","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"556c22fc70dcbf252fcfedae1621a16b419598c8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.315.tgz","fileCount":15,"integrity":"sha512-XCk4IygaUvKOvjTbGUU5HoNrjN9kxm3vWvG2wlsYhTAeplquoeFi7enCLKQ5ta6f/g0hdlMmd32mpF5whL3aOw==","signatures":[{"sig":"MEUCIB39HkfLqb4Rm9B4mShCOAljRqqhMwJw/PobKd+InFFoAiEAxu/bptxv/NLqVhv3lbVMCQrZivTHDGU7rauIBMq8KiI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":122097,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg6gtjCRA9TVsSAnZWagAAlLAP/2FLF2m+30dsShOPBcQk\nbY74wXSLsbgWNuO6uUO+P95y5O+6uPuBUY3MTgobCBcbBVKNsTryCRTmvGED\n6B9FHt7P1PiQJFMJp12Sxnxspd1hbeGb+kVHFvUqeZZtdjzskqNMpCpHoi1Y\nb+eKhp1PNi+u33k3xoplHjTwKBvEq7K2g7/Y4+07cQ6rfxqgD41ftn/ixfs8\nsDUGP/tUjc6IFCHNpMSYqKOr6eUGollaN9BNXuNAwXlKlRvhQYvY/XZ1G1vV\ntHkW3WBkmni6c8F941ptaHedpUMovO9j83/AL/rvJJwUC5Flo6Yue3X4Mm+1\nJMzQKR3BhiXY9nzu0DYvHfKOsTRve78bW+lbgTOYSERqjo0D891qXcOh3l5/\nuIc2QlP2ErAbnW5AYl1eBWVmFvE9vacMMihcJLFsDB1mtd2p7GIMsnvjvQmS\n+r0VO0Wxvm4O1IWJeA7xV+KKaWnMUuZwhlesgdrDbGkhmf35fnCBuH68Ijqt\nRLT3MFAIeSRFlul201MpfjXUIFthyzv7nloIWJZSVCdTdTui30UaHq9GEkFi\nYS8EapvZCwzf0Vu92njWjGNw38PYBm/pTbWNNB1Y2hitsjb6CehSNbFCtbjc\n1TFBzazLGUOmAXLvQby/W93DQEDCSUNe+RhM7HBQl1eEco0E7jeF9bqU6OXH\ncx19\r\n=TAgE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"bfe4beb21dcece6455c92e992f30e3c9e5b8a5a9","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-10T21:02:09.517Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.7","@balena/jellyfish-logger":"^3.0.46","@balena/jellyfish-environment":"^4.3.13","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.3","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.315_1625951075262_0.9472428448831449","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.316-renovate-internal-patch-8e8e6fd961aaa35724018843712d0b566564ff74":{"name":"@balena/jellyfish-metrics","version":"1.0.316-renovate-internal-patch-8e8e6fd961aaa35724018843712d0b566564ff74","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.316-renovate-internal-patch-8e8e6fd961aaa35724018843712d0b566564ff74","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"aa8f3fc1991c19b9ad91823ae94493689f1a8eed","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.316-renovate-internal-patch-8e8e6fd961aaa35724018843712d0b566564ff74.tgz","fileCount":15,"integrity":"sha512-o8MusA1kVAllUJocz7x6nAt7oDAiBH0sXRXEzik0TxIkZmum99xq41GfeqY0IvwYxlWgLPFNDfiz96vd/2C8RA==","signatures":[{"sig":"MEQCIFKaNhve4uMR6umstgrSe85pTPbej25HRWxYL7nFBo5OAiBWd2y+qrtK38aAuewaMpGILaG/8xknUVZAalsVO6A+RQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":122266,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg6g1BCRA9TVsSAnZWagAAF/cP/1qf0wEt6/HSWAExB7A8\nvIXypR7pCPSXOaj7PolFQMiYT3oDfhe0VtDqWt89TzvkeRQkr9yFonVG+Yv0\nmMoutN/PF7dzHGA8H6LNkTeb86kr1ToY20teuEYuZX+KRIY+svwRiY82K9c6\nvLjKa9+gjd6VK/r68FsLu2w85d3MzsJIPgaRZV6BJJYQuZaENUbRk4/myyjs\nnaFvLW0U4Sp7gy+Ym66OxA5yT8UcamgXx+8TDvYjKFEqdzAWkAnHseatnw9G\n+73v8p10Sk9PGRFv/DW+5yqxurZEPQrSYX1vSXsTY/NJnYVLiSPrSsMYS8m5\npDt2SRgtj47ahVntmsAs75rd74fWgsaLTQQavmT6Q01d3wt/EljjPayWBg9G\ngdNCv5zW6x76GeApdKy2l1Cn4bQ4UlkjZa3wakwbd1paKL1B2R9TxL4UrVZL\nnu1kc4f1p7A/urHHVehEzL/veDh0hHLV9fydIqaC1joXH9xmX2zwEbz8yXtM\nQsDPJDBryr5CFzgWnhTzpHuL5IPyxtvB92gsTwQTENNmjAhnEgWxEr9wgmqj\nG3LgAXdrDM1/TYhN+rj09xwJHyg7WohIpCG7i3fRUMoA6ZHDsTkyoK8ch8te\nI5dwULxzhf4tn+K2XRL/Qm54QwSY1foQ5XGuwF9gakYKERBljcK5SU8x+ryi\nhJK/\r\n=+7ZP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8e8e6fd961aaa35724018843712d0b566564ff74","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-10T21:08:24.424Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.7","@balena/jellyfish-logger":"^3.0.47","@balena/jellyfish-environment":"^4.3.13","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.3","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.316-renovate-internal-patch-8e8e6fd961aaa35724018843712d0b566564ff74_1625951553186_0.40635307916616936","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.316":{"name":"@balena/jellyfish-metrics","version":"1.0.316","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.316","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"987174b6a76032600e3d9f7d88e4c5146f2dd237","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.316.tgz","fileCount":15,"integrity":"sha512-LB0FBFI8O2iA/UIoAlVhkIEU3eJmpHV6BKNdra7ZR4gj09AENFToVFDJmY2siSCewD9Hhay4sox5efY3rjZJgQ==","signatures":[{"sig":"MEUCIQCGVAFOxWx14YkiL3GMoTALRNVMmCq3LL5Zz/tZ6RGUZQIgOXrg3BMNiO6A+oMIrBAyS8EP2rFuAjln+CB+7X5DonE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":122201,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg6g42CRA9TVsSAnZWagAAbIUQAJpplMaBIUgvVDoi4dLZ\nIia03jiHQA92v0KS6xZLiCxuCgxd32XeClhxeZDOIQtVEVoqyX61wqUGseZj\nyrNseBZzB2tqcckeS59mLiAQe8wBwvhtWZVi520CT+l8qI9XL/TXk62hSdwR\n6Lpmzkyk76p2QHrY1XMtOpKYMdvJd5YY4muvmuY7KOpI2haf/YwoWr0OwNmz\nmZ+m15/Y90YJTwVmiL1V351jWBaKF6jcBSiQr+1km0AWPuDPJMdUantVqDOv\nTwheT1wDoeSKRJR+V4auTEL8o/B8CEhpPhtdBQRrtTTwD+HkwkRnXW/wMipi\nNhuBcv+KETBDJcucLuSDgeSfsdcAM3wvFqriYsDFe8q3N/igiLCsjlWSa3IU\nKlXQ0wns4Nvc3gYrBO/xWp2l/nrZ8XxCwRDGVmvo6if1wU1n49Gk9o+E80PI\nw415j+k1j8c8rwwol5uz5s5sUDNzg9UZxhdZsFY88teCEHYLKcQw/XAXfzsO\nRTxSHUXp1jVwUvB04dJjNpik56FHThSlvpEI8Tr1Ia3PeuJit8/NwInTUxxd\nEWP9uqTX8UzvDiMfIhQ0Yn5mkVQdgj41nLDjStyU3IO8Tw0bhdnoOAbZZybO\nvvqDBKMv4zW8JfizMad3O6XZ5aFYEhAs+Wmz7lxAjtYzMgdnt2iym1Ti5YM/\nU1Qd\r\n=WThj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"692d5a8e366ee84ea3b9a14a9451714a8fa2fb5c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-10T21:14:51.777Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.7","@balena/jellyfish-logger":"^3.0.47","@balena/jellyfish-environment":"^4.3.13","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.3","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.316_1625951797730_0.9709781063738476","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.317-renovate-internal-patch-7d61cdced0827c50f51650a900c0edc4142fd497":{"name":"@balena/jellyfish-metrics","version":"1.0.317-renovate-internal-patch-7d61cdced0827c50f51650a900c0edc4142fd497","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.317-renovate-internal-patch-7d61cdced0827c50f51650a900c0edc4142fd497","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a14ba3afa945fa42eaaa380504579e91b7cd171c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.317-renovate-internal-patch-7d61cdced0827c50f51650a900c0edc4142fd497.tgz","fileCount":15,"integrity":"sha512-o8tqBEh6JDf+Jpt520EXoJETTKQ1QWrooJPZMMKnwf3/izp+6XnJpgnmNEWN2nof3+B/Fydbo9ivJnSlBbdKCw==","signatures":[{"sig":"MEQCIFzHmEMRhv1CmhgWgx0pqJsOojj+THpfGAKAliS0fDZbAiBE/zkQyLTaQuIeK5wvkobzDjTd4u4lApzS2y3HhA1Cxw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":122338,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg6iNBCRA9TVsSAnZWagAAJ1IP/1NPFGc7hYMKMk3u+5m1\nrWFo1Jesh5U8H6Cur4tGheMDErNH81c7vSlFKGQhcIW26pDWvwXcoqaE35aO\nKjLCS8651NbNfTncXujaz9NZyr9s6xGWq2vyXOgijFUH5moYqMS/Uoqj7fSP\nG/hOWgX4L9lLYmFypyCjRIi+srGxip1yDEa+pp/zKdRGGw3OopRWIDXsBLiy\no2OkPGZsporVMxcXtHthKLRi0zuuTRwCFGyQV8RS/oBCBjo57Crwd26ox+fz\n4CTyluM0S1H1bwnEtGeIHRYbheS+0b+pZ6DwadbK7NZq4S08hc0x/RgYw7Es\nsZPGxXTXjmCx/N/bn95goYwP4+lPzNI5yrD16DXSyvTUNY5Tc6QJYO/5kETx\n1/Ro6bHwcbIRL2zO/wiq4r82PphGPAY9S7i9xOmfITVrXKqcVJhv+bHYfd6w\nPIwNHCGB89Wacf0/JWjWzBp2b5ywTFkNcJPPYzfOX3Qw7IW7uZKnPuEHtADX\nQu0gLCqFrWx/tS0ZVPwVg5rZ4B0qV8ANhUFVbZkFUQm+yxXCUmXVgKOc18tW\nbZ8zEB5AGtMS4ibioScFejc3wFDrPXzAmBubVEk8rgcqt5F8NCPVtJnldmf1\ngRG3gXwGtsp/bW9yF98SoAU72dFqt9r87YcicMk4nGVX1NJ1ZgB5TQ8esRrO\nV1FE\r\n=2MDt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7d61cdced0827c50f51650a900c0edc4142fd497","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-10T22:41:46.519Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.7","@balena/jellyfish-logger":"^3.0.48","@balena/jellyfish-environment":"^4.3.14","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.3","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.317-renovate-internal-patch-7d61cdced0827c50f51650a900c0edc4142fd497_1625957185272_0.39013638044498333","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.317":{"name":"@balena/jellyfish-metrics","version":"1.0.317","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.317","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"48f7756ec0abc33bfe0af5f725a35caf23342bb9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.317.tgz","fileCount":15,"integrity":"sha512-zfi222vDYO+H43pRhaZplTW3UVaIP8RZNfC8Va2nCkFAApg2eAodJGjdIA2v9Tf9GL/T48yE/HPSRhsFNrjebg==","signatures":[{"sig":"MEQCIDK2w8/EghyJAgHVPCwfWkzLDHD/k3AZUMFCgBLXvWykAiBijDSlLEWD/KWTZ09fhOvYAfn+kWuEK733cbCN3lfYqw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":122273,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg6iQPCRA9TVsSAnZWagAAVNIP+wcskYDf6+GhPNuZmwsz\ntkHEsRZKBVU69KgY/xzUhDlwxTmbUNsFkcgktMBCj8ujI0AJQX7dCwrVtlqE\n0qiUun8+W+ceaf8oaDOfYLWXtp+1+FKMD4zIfiDnhxFyriNy7nQ2WDWLS8Pg\n0b4UNjlSxYotp3pOqk28MqG4SjIJWuNBw2id4deB8K8unKS2FJ6P1GntRNYo\nwCZWkWGT7cK5wcA7yBU3FUEnRS/t9zfm1l3Hc/3MLXFwBugauEUWG9Vs9RYt\noTsEGyMaAjwZSsN6savPkZsEAubPWHxykSKAGk2YNMpPjO5FiT25ZKWj6O12\nfWB2s+30EmqgDhYq84Z7cv0AMkhiKDu+ZtXUU8NeG+ZWX8ugtRjy9uXWJAHP\nlMyjLr/I8jYHV8FGRpmPx0nLBBtbpB+vXVmhmCzUj0bOJsBTiWcUQgc71NKw\n+GsBliGD4hseahLdUh172tFMB4hVyaGuQZitRHgNrz0gHiFSNLCHJg62ttgX\nV2Vp0iqzLfz5GCxBJJz50tH9TAkycI+QKLTTCkimsW5XbquAMtPnD30+v/Lt\nqoUNjHmYgzUUBiIGLkii4cNfHFwtPorjVHK2bumd/S2kGf7q9mriYeIkUG/z\n2i9xELKuskiINB845yzLrXTOfaeQTOapjonh9wCOpCI+H/Bcbd4YfqTK1k8E\nVylS\r\n=s/Cb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8871df5949a08c2d4c8ec2f664516e358afe2d31","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-10T22:48:11.902Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.7","@balena/jellyfish-logger":"^3.0.48","@balena/jellyfish-environment":"^4.3.14","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.3","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.317_1625957391161_0.8425442330769333","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.318-renovate-internal-patch-12baf7b95ff0902f2d22dcd535f77db8fb589cb9":{"name":"@balena/jellyfish-metrics","version":"1.0.318-renovate-internal-patch-12baf7b95ff0902f2d22dcd535f77db8fb589cb9","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.318-renovate-internal-patch-12baf7b95ff0902f2d22dcd535f77db8fb589cb9","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cfb1dbe712546e1f1e4e98b7a4720fc3c8001c03","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.318-renovate-internal-patch-12baf7b95ff0902f2d22dcd535f77db8fb589cb9.tgz","fileCount":15,"integrity":"sha512-S+YOk3SNr9ZcPbPSUHEO1ZPHtivFbDBc27lgdG2XyBmNb2uteJ9eH+Q/H/izuo2+HoenbgCxtCErAePv0k+6EQ==","signatures":[{"sig":"MEYCIQDyJRPLnpVSC4GzpH96bKYsi+ss1bjh5YK5BmyHJYdCMQIhAI7l1EsR87sY4lucBfmEKWBGJ8pBd81eFbKEyfikUoD7","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":122442,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg6lNxCRA9TVsSAnZWagAAo7MP/jjdvtansB/FJKA0qCue\nSThqa+hqtoA5ZaGldGV/zsfGIiYT0V0lzMWzpy7sDg3UyFbtkW2UHOJWWhRe\nMGBttP6pk1/JG8kDkBF1BxioRXrcoerKYTJbATJKfLqSWtlMG5AQ+4YpgIK8\nGX67zWF6kCOzVcCxpCCcd75uk3gJhdb5jvVO3IsT4udaCoq+cIdQNSW59ORc\nTANgxjGZOEWQhEBjTZxxl8zmADl3bfHGRKn2THnSkUhfVW4nhoBl0bGrNa7V\nU8ZLkSbOH4qjWndZqJ+YWsMXAkIEO/je2yOPxaofKodgQTOZi++m/upEQ3lu\nw6OcZy93ZDNiRsavP/Xt/u7Nq313yML999VZlQfiUhPORMXU404/XtV5ppyQ\nfow84GCoBHCDzQ3rNWMuJzXZTClac+l//8/Yan8PqvL0cW8ifxfmz9RXonq7\nxSU8quTqF1dzoypf97TqaTTeUmQ7X8pXaGlSmymztQLjQJ0b63dtWlh2Xxix\n0GLA1UK0GTiJ2skL5PuVIY3kwizaSWlYJjCGlGn4DsqRzP/bBwqXXxN6hf/Y\nZuj/jHE5SuP0Vo3A+VAtPv/J/rYYiAvXCkOP3X+8FjOiqOqHk1NlE1VK9Ihj\n8jAiYQo5Jj2xExyzMT3G4+h07B94vGXdidrRfORWU6X4Ad75uY6+LQ0p4f8H\n5GQJ\r\n=mjsz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"12baf7b95ff0902f2d22dcd535f77db8fb589cb9","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-11T02:08:52.836Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.7","@balena/jellyfish-logger":"^3.0.49","@balena/jellyfish-environment":"^4.3.14","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.3","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.318-renovate-internal-patch-12baf7b95ff0902f2d22dcd535f77db8fb589cb9_1625969520617_0.005435702241438856","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.318":{"name":"@balena/jellyfish-metrics","version":"1.0.318","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.318","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8d8beb2c61ff6e29d3930ae8fa79acc6fae1086c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.318.tgz","fileCount":15,"integrity":"sha512-keDAYDhJbkh4UhdZvjv3Wb77L1IEY4ClhVBswUqPuUhYFZgN9kmgW6pPwj42X1qqgjPPiZ4u9WCLA5Nv66mjew==","signatures":[{"sig":"MEUCIQDoH8W9exReksAAQJucMukiXx6ARgzPjIdTze2ma+jUSAIgF673f4CzLM9YWq2qn7d3yZr9q/RdNu62TD30ef0jcwE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":122377,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg6lQyCRA9TVsSAnZWagAAOK0QAIgbKCdviMOEILdiX6s5\nZ+jXuLYolVBG6Y4cjciQ4Wq/WBYrbwtoeGmFwyzesuSi30Zds6iGZLY0+tJa\n9dVODCFj6ojrffexroP54ge2cUBlWMEopqhWtyD4tTFWpN06mFZLMFerUGPz\nZLw+fxge2bEnPZ6M4E6BfgI6z/ZBVUvOuFJ1DZEmJDIVhd1kts7nd4Wmg0s5\n5y31VsLR1Ss7mYN8qPI5EloJM9zrMEnlkGJcD2pyoaimhzXj4ZLp0wJdB7R+\n42vri3qXuWK2hXxIa5hD3fvNNiFAl9Oszlb6yhpRPSLvmgW8VEkiP/18dR31\nN0WxDObGRO5L9r9sBaqKIQClwH7wq1h1Kxc7EKIQ8AINYB9G5454F5NoJW0C\nBNMKBFqDGRznASI2WTY99TXsUEQai4tsFCiDsg5W24FI5tSx+48a6PKnz4TU\nQB3vGjM9GAcoaqM+e8eCL/c9ugAN2z0pdmhLwHmQPUFHEzglulZqHRmwprko\nqXSHexdYx/FbhUgg3HJvDjLdM/AoTBv8RX8CLcr3cu4Md977XYuO2wqoIEvR\n83+XKyYHy3nYAj0c5k9Kg4YlDEpOagDfG4P4MXiiwbpqW0KdAjHbfb88qdXW\nt5wmGLMOqPlfnqmRwjb9y4vbjEmntKpLJUnT2ofAXiO523M3vO7zM9uMb8rY\n0Vbj\r\n=5Gua\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"99aa5e848e85c16709bcf6f5b56da5ee0afd33fd","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-11T02:13:32.066Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.7","@balena/jellyfish-logger":"^3.0.49","@balena/jellyfish-environment":"^4.3.14","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.3","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.318_1625969713518_0.7459154540959445","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.319-renovate-internal-patch-47ecd493945922e2005cdeffca3ba7b1f71fe56a":{"name":"@balena/jellyfish-metrics","version":"1.0.319-renovate-internal-patch-47ecd493945922e2005cdeffca3ba7b1f71fe56a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.319-renovate-internal-patch-47ecd493945922e2005cdeffca3ba7b1f71fe56a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1395bb52ca7a558f1449123bee3ca3dcc1c89fd2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.319-renovate-internal-patch-47ecd493945922e2005cdeffca3ba7b1f71fe56a.tgz","fileCount":15,"integrity":"sha512-VCuTJDKwFv6g6T0RRDg2cA+kCHWT6IIyzzUoL5JS7skjEfeMSv+HVJ14PIEV5CWAP0yGbBtEACyD61hw54jhQg==","signatures":[{"sig":"MEUCIBg9vx/rz2EyOKzz8Ik37koajf/MXN/ml6jgF3F8DUU6AiEA1bKQbFUQy9UPyyUDenlrmZob7kUpdxkOBei8wSgWPYA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":122544,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg6pZ7CRA9TVsSAnZWagAAh7QP/iEmzDgjIjWDmISNrUyn\nV9jY/YckCipqAk6hGYltormOHDFx/5k/L1nL7IUMBzt08EVZC9j0iajQz+mw\n4a3Ci4klko9vY6Z79+kLQ2lWi8kRP4rmsAeAAvvbitndzyz+odYEO0Pe86kN\nR4Hz5EELp7ZoQlvVNg2DezPn+6A1/R22q3nu4I00NoOUIbC3ilqI3yl2Ncks\nSe8kvushikdX+FWR2xTYx0Dv+JpBpM36RqoX2clB9Ua20KLmH1UWZ1KoRTgt\nwV/R5eIRVt7LZFPRqM3gDF5HfLG4tlxin0ZNERqrhzxpLEYtKLw0cgpsnWhg\nyXKEgojyYDuxP6BJfMFFxAs1EJvE/oXYExgzhkUjWaRtg1jwatBY+9fDYLX1\nBIMY9hkWo259HYZVVf2YT0Ar1bbNqPBrDAzb1YKPsP9Q4KBz0wfBLiKCkOTw\n97XDoze5YYzvUbwtLHFJB4zDd6KqJM3byfHpGsIP9QEpmgmcMCe4eA7kwzqe\nMFe3zBwrl01/sp3gXy2UuaBLM5kDuW6nvY60AeCwrtFaXra+MWbA6VvrnlBU\nL+G8QrbM/bheIGNIk/5bWMH986ueJK9LJ/A7NX6ITTyMimWoDp25GEr1r8FB\nS/K2RyRQ3LXbSSfah8s+h1v+obdJfuz0GmBUA1rmYQUqG9achEyfxO9wZLk5\nufLI\r\n=msC1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"47ecd493945922e2005cdeffca3ba7b1f71fe56a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-11T06:54:51.837Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.8","@balena/jellyfish-logger":"^3.0.49","@balena/jellyfish-environment":"^4.3.14","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.3","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.319-renovate-internal-patch-47ecd493945922e2005cdeffca3ba7b1f71fe56a_1625986683292_0.2171490968802885","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.319":{"name":"@balena/jellyfish-metrics","version":"1.0.319","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.319","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f9a27ca8ec45127d329e4d50e725bbc36e2c34af","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.319.tgz","fileCount":15,"integrity":"sha512-8eRtVjMxlt5ureC5r2Tq0W+wIeafatAhhhf8AS6v71rplwIo3QosZfoIcF4QYADCWgkGY7S+rPGH5gICbXlzTQ==","signatures":[{"sig":"MEYCIQCoidrSZ60gr3/DLG95tUnALbZa+A6n5atTioXDIShgkQIhAONPjWNZcJTJsQ1OtTIe3W6xIJFX49X/YNiX+fGgWBPj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":122479,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg6peACRA9TVsSAnZWagAAu6AQAIdgyuBS8gs6IousFaaP\ngNaTHk8m4S/6LlvY/GkLAda1WHTHwux3aPVOiV5IfyRlbY4cHwhX7HFuRrtU\nWgFH+cGfLZOJGXuKvrnpeDJjOtO6yddI2n6pJ8WK4UYud6cw5ObnP3Eoqeci\nco1LHydmCVVaqwaLMWvTj6BelAkb86NkFHsIj52lwOHYsfjZFjD6SRXsfa+T\nWPzqw+ZIrpvwroV71oTppip/01vCipUy7UH2mIKF1PF5iFk8xjCc9VLFIjte\n6baQ5RaWVnZ8lF3lyi6kjFbOTW3Fd1WfsigaksojbalZH7fwdkD6KOq0OdQN\nZsGR7FAy47H8NZxKB8HN5UkP74XqeF5LFDLZ66z1eYEqVVaPvrrNB066TQg4\n+JxtqhOD84P9L70xsax9ltz77rHqEmD4L2/Zubj0TkMsnMw08Ju7Zw+qcpvT\np3R6E2m1/qazC/j58YkOp8PuViR6gXaR1Jrk1pXpoPhCstzNBQnhMfLmBguk\nxb3D5nQa4lGPNpnBwmS0wkLP+so8Jpt82J0Myo4QqYjQuUfXRXZ7+rRVw84u\nMfcEu4ISyKgAXdM9bjfx7I42CWqvF+Gj95Gvw+yScg3HfQX19yQfzlCP+QFd\n6pj563sBVPo54EnfwvTsYZdZxZt+AqqulZQhE5cqo1Bc2zUzs4WdMxCPsmaE\n/gnb\r\n=7CDI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0717b0397749490e75b24aae977b69b92f11ced7","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-11T07:00:31.818Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.8","@balena/jellyfish-logger":"^3.0.49","@balena/jellyfish-environment":"^4.3.14","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.3","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.319_1625986943631_0.6317566248622806","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.320-renovate-internal-patch-6e395b55fce89eea3fb8f532c0dda78626807949":{"name":"@balena/jellyfish-metrics","version":"1.0.320-renovate-internal-patch-6e395b55fce89eea3fb8f532c0dda78626807949","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.320-renovate-internal-patch-6e395b55fce89eea3fb8f532c0dda78626807949","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7060afc3b6d30056aa0061a31e9d43d5f709f88c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.320-renovate-internal-patch-6e395b55fce89eea3fb8f532c0dda78626807949.tgz","fileCount":15,"integrity":"sha512-iP27tnNyiDzgQNaR6EkC+Ol+ioUGL6llBdXsTGP45CdxbUJEBIZmgZ9CqpKUUtEC7vcwx6b2iuI0Aqxoc6uHZQ==","signatures":[{"sig":"MEYCIQDpGQzVZu9srKUqkZJSMf9s3vom5MGsy+iYTKcpp2EBQwIhAPCcbVt8oUAeOLKjYYc5ew/A7jf4AAxV3GPzPDOWBKaA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":122616,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg7m5PCRA9TVsSAnZWagAAiNkP/0bHG7hQ1+FrL47Z8eKN\nDHcyp1asF1N/nnjfAOkuFFJh7BnVsyDjU5kMqIE/MC9xVy1aoySY10K3lAD1\n/bWDh8Wik9CFgnKSLXJ9KbQmKZCC7Ot+s6Wse9LdpkiJE6z0/5HF4BCqv4GQ\n7gbypTfsKbnW51nRGqKAkX2EYVhD8juB8VMlPGCtvgMO3tAQnd+gSEn7K56N\nXEZiVUPfNn3FGZNbhP39Qw4VtIMEKwmrVzkfK0zGDW0Jm++iFScaiUzaEE3f\neKHxSWor9W8yUfi2X81rK0Qp5DLya2FcB3VOOlNEOzn5xekqb2Y85FkHFgU+\ngyw2XLx8k4PMZ0P1OBLyS2lqa39NE6Pl2kNtxcxo+ApEVBuMki+PTdWO5M2f\nnDUhsMAH2yXzWy8ILRxoCRZw8sUEQKC9CuPV5M2ZTnECob9dz7Xj9vgBlPn9\nuy/xFoHRB3Cglgv4Y/IzYfNvGBiXnWpldpt4GHI98eMDflmFRJCi1NJJgRND\n1ZO08Rps7Obyz1DnyFZsscVK8L8oXhOaWluvlrODOe7VmpIpoieE5oPBDfYV\nCjUGcZ1PkKehdTgiD132AKeeBbrcmwM/R689tctwuCDrwtWJWSwfQr35HAk7\nVcaVRyOUNhThfUC7RCJJswlrBD+ccx+G9RUcUOj9+QziE5WntKQQC+o2T78/\nNPiF\r\n=RJtr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6e395b55fce89eea3fb8f532c0dda78626807949","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-14T04:51:41.916Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.8","@balena/jellyfish-logger":"^3.0.50","@balena/jellyfish-environment":"^4.3.14","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.3","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.320-renovate-internal-patch-6e395b55fce89eea3fb8f532c0dda78626807949_1626238542833_0.5549717697229228","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.320-fix-jest-config-6f1e2bbc5e1264dc0dceab59768d0a26a0db07d8":{"name":"@balena/jellyfish-metrics","version":"1.0.320-fix-jest-config-6f1e2bbc5e1264dc0dceab59768d0a26a0db07d8","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.320-fix-jest-config-6f1e2bbc5e1264dc0dceab59768d0a26a0db07d8","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e5f6381d35a2a0116132a7c4c4626e5306316cc3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.320-fix-jest-config-6f1e2bbc5e1264dc0dceab59768d0a26a0db07d8.tgz","fileCount":15,"integrity":"sha512-yO0pSLmXLSQ2nphzAga9adPy6+H9j76gX7prL4TPvbjiZ9tsOViwvjnXSYhMk1kQ3jZE4ies0JPdDJN2VwbvGA==","signatures":[{"sig":"MEQCIC8q2OwZ9VrV+8Lcm0AJvIxYxEqFVvSQxm32LIYfkOBpAiBL4yxMFWuN23/MEBVhKlgHFSt3mApYNG0sC9tYChknCg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":122599,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg7opjCRA9TVsSAnZWagAAj/sP+weHUYVFw2/yfMzgREF2\nMMZFDu0kOhVVNgzMqCfxTznhZfYLfylSuZbOyZWFNdpNUIOGVJ/o14qSz9/F\nZjluYEOnHAbTefD0D9D5TI/soc3x/r8oxvy+LBo+4RYeszz8OfyNzacpepRF\n8lo+6vgmJJLmmeR7AOkDytYXiKGlt+V7HbFEhZozgcplW1WZUlzRA4OX21Y+\n5Ap7Gu42+/gy11+Sat2TpWdz/uQEbh/oNJTbZm5/xV3VP3nJBeBvnPKlWeW2\nKApczl65fLcObbe6tyLmFLzC4YDVcfJvK758CXr5ADr9u7jlxG/Nvmx18z2p\n93ta6b09jq+CKO2u1tRBlzaafVf5gkbUGxabxSifnXGT97eS7Ri0ogRCoBE+\nRH9hk62aZeQQtavn6reMOuRVnwB+vUl7ln1i+8unlIhR5zvUxJ/h05RMy8ef\n2chQpKJ/iINTgxy99Svupps93Z5mKw4DDSel+AGEMxxhdwDYrOW7sEyIFIHj\niRD7e4KzQH37fcOxmBdKDa6frPVdxwo61i88Ji1eEEd9RDomo+HURiXV9D1b\n3w9fNUJG/p3RMoPUHaDAtpapTyWJAjWh47Vy7iRSHxlGV24gn7B8sxDImZJ8\n2D8SsJxQua3AXI0yDSlDZjg3Esq/U7Z6xTavn+SHV1h/8LwMz1yWpRlQHbiS\nRgtY\r\n=g7Va\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6f1e2bbc5e1264dc0dceab59768d0a26a0db07d8","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-14T06:51:58.072Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.8","@balena/jellyfish-logger":"^3.0.49","@balena/jellyfish-environment":"^4.3.14","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.3","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.320-fix-jest-config-6f1e2bbc5e1264dc0dceab59768d0a26a0db07d8_1626245731051_0.8779419371694952","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.320":{"name":"@balena/jellyfish-metrics","version":"1.0.320","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.320","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ff7285e146310d123918f6ad0b10894494cfe7f9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.320.tgz","fileCount":15,"integrity":"sha512-ihQhFJRoWXgvfVl3JRMRQsnWg8tP+jJGVlj9SY3brIsC5YwuQ7/RLjM/baXMl28aR2L1DbNbxJ3O/2Kr7czCiA==","signatures":[{"sig":"MEUCIQChjlu1amgaiEZed6vndOeNCKdxy9TyIGule2S2TdYO8gIgGJpyc55El5R4VFzfbPCtIkC3HhTFU3nGh+mJTuCdtEk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":122542,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg7os5CRA9TVsSAnZWagAAob4P/2IIw3Zy8I2IyBb9wyJA\nmLIDce4otxDAj9zx3oPnwn1IxhqCqdmRKbdxdlwW5b/Yw9J7kijtOt0vcnIg\nGEm1KmVHUZSMUPDL/KI/cJuMe9avbzj+UcMzyGt7/ng9kuDpfOLk3s9OL6fK\n1Jj07ZOMEWpguEMgRVwMTgsBNTYKEFw7I5e7mul3xObZc5jUMT+d8JbrcuoQ\nOBfffsmK70cusdFOcQOk0v66afuUTgxv/6yJfS5IgX69KKddM+CfxihNJEJE\nzFjkvuEi8xQMsT/KQ/ny5HVQUparUe0Cg0xZGRNbyO/XNNq71KsfA2QZGluM\n/jI+IpGvmiRwoPmJeuNgCqjcdCsCEgdt0g9U1DQQ0Mj0fLvTGfqgqFXJYZ0G\nxw/71ME47SX2BVr3dwdYzc1NferWaqyjR4kHjg/vZo+HNjBvKPrJesl4ODj8\nyDbbLLy1zsARxOAdCDpC4OVWnGEqwlvO6gs6r0/pbSSpBxDiVgE0daBfNPoy\nraTAuB+vYtukXyS8txMjN5rKbyWV0/kTLuEYp8NyN7PZ9lrYVUH1uAErglFA\nyVtKJh6pvu/t+MiQ5rse6ulkyf7AnAeUKjgznzpJUEMqobp5/NP4ccVpUrSD\nqvEdzqwKpi8TKj4cYBYjK+vivfoIoHTPsDcFnXEOsBZuLWxlLNxnWLU8wAIm\nGl50\r\n=Mh8J\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2e5336c8a50271d4f1feb30f8dd6a0e73bead673","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-14T06:57:22.120Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.8","@balena/jellyfish-logger":"^3.0.49","@balena/jellyfish-environment":"^4.3.14","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.3","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.320_1626245945395_0.7321389505774449","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.321-renovate-internal-patch-51c6af05acd84b7a0e11bca867ab23c64aa01c1d":{"name":"@balena/jellyfish-metrics","version":"1.0.321-renovate-internal-patch-51c6af05acd84b7a0e11bca867ab23c64aa01c1d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.321-renovate-internal-patch-51c6af05acd84b7a0e11bca867ab23c64aa01c1d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fdc9714368ab34212b9ed9d65a020067e5585384","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.321-renovate-internal-patch-51c6af05acd84b7a0e11bca867ab23c64aa01c1d.tgz","fileCount":15,"integrity":"sha512-2GJPcgJ/TdRQTd5aLyrdhu0HBC5enXX2se1fQjZtn8kYTUurvmhdmwVqvHn7OcsgY8Rvips0pdNxem5MPcJBPQ==","signatures":[{"sig":"MEQCIGLzC5gpzLOaA7dBFTN5XI/WgGZ4s/3Y/ffCPzIRNSfrAiBRBGa03UBJ2staRaeyCfzpala7FEEwS+3YSJMKhPm1Rg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":122679,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg7oyjCRA9TVsSAnZWagAAGSgP/iEKlk0hH089BiD/vJlw\nBIDEVz4w4QVDExnMF/n2tx46eCmwRQRQpGeac0mJ1cHcy/s0Z0Ww3zCUd3Ln\n8rKf38QqwQC9oX2vbegqlp3UQUi6uABzLsr4NRxdXMr4soboQ5Y88WLwa7Fq\nQyFaD4h93roYRIYuCvDd9CzKhALP9IQQ/hFgHJYR6D7gove5uKVXa/a63SX1\nCweZ5wmACvtsU3xly5HH3gUwwpK0tMtXxP0mIsLKTvtZHS2EJDAdcV4WrJR+\nfn2ZzaLm9dCV6L4ov/t4mSpNB7JM+spnt1iYdCAc5HsNiyUIzKaky19dQUzU\nt8B94Ib+Dn+FsjWawASraGle5YILBzFbSzis8FKw6i3RkozXxPDjqxPZyzNC\nIMvQog3ZsPhYaD+QtVtS+BfTr3FVl5LuBP/9nuJmgjgWxtVDK+VeA190Xz+c\nda0NDOHXr2SD4B0493I4p7J8d88O4Ed1zhy3mSB6o3XzTHIczOK/dSKIgqGI\nzxfxK7OWFkOIUVvf7YZm+zkPUM6/dzXGc4jsToSci6wqFOfoqtmJEZ2/cuWi\nklm4Q5VcqnOBMITbegWykMzJatSsvlhobVOKfSmq9X6OfG6Kb9q5KUAlZOTT\nwbPzEQ8kAAJfv2UYLcOHjynGB07IeDzSYa+TMctE3xkHZAGlyPnVRf+/Kw0W\n93jt\r\n=qI8a\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"51c6af05acd84b7a0e11bca867ab23c64aa01c1d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-14T07:02:42.447Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.9","@balena/jellyfish-logger":"^3.0.50","@balena/jellyfish-environment":"^4.3.14","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.3","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.321-renovate-internal-patch-51c6af05acd84b7a0e11bca867ab23c64aa01c1d_1626246307088_0.6583552392085967","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.321":{"name":"@balena/jellyfish-metrics","version":"1.0.321","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.321","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"baf942bdb96e1bae1a22b094beb09e02aa1c7051","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.321.tgz","fileCount":15,"integrity":"sha512-vM7bP1rocxsqIsLCBrQuES6BH3X7uIfWKMxkDqbuP1pLLcWJdsOzyaheZsfGYxStJhi+xLSEU8HAVCCBtoddkA==","signatures":[{"sig":"MEUCIQDd6pwPmudFO8tufSxSVnQSUi0deuWLdNGRiBs2pQUF1AIgdCxzniGIQ1Sj/E/cXS5xmYuxBUAAcIiNdJYLM3MXv04=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":122614,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg7o1pCRA9TVsSAnZWagAA84kP/0d2I7/kHqI8f9VmnLZO\n4MNlA9CX3jqUpogEE6hcaWS+PXjIxc0PACqRkaeDnlLJc9YOyT+z503MHRTQ\nsMzNVq5VjpeEpNdwd/+WisK3LBs/5APLShM3KLB2C/7TyyvuQN9xrawnxkjj\nmyrZpWUCBkkj8eMS41xPVom7sC2Wg4d+ZNoIXFIER2aOWh/8HF0UqNT/Gx5Z\nI1EpsegTEfFxKHF+3C+JFsapOP6pLWLQUFPRPEDZlqkPWdwrXyTIc+BeL5u+\ntNZl4NhxvtXbloCYZA/X8Ju7srWlkeC9o7Cz//dAwZRVxZ7Q8Blg9flYbkp2\nOBZEaLPWaUFLQ7b0cY7487dvCxL1R3ODBOcObLfUw5p6MwmUuWZH29FuwIxh\njs/TG0tN3w+veOwouSgKVbJIx8Tn4eYcSIj9Ai1WjEnR8Ck/iuxU2xp10gev\nniwQv6O1uWMR6BHhvTk9LikI1WHxgApaowdXC/gwLyxxur78zm5TL2PZVAzx\niuWnCi9k5Uz+lcOmdMj/NijXzjKjELY2O7sW5vW9CKnWikAM01hQfE+GHxuC\nAgqSXDivjdTI/Ac/bQhVQi12Tu/JL2G9g4hU95aottXqXLPQwsTD2u8wbZpJ\nWkyjnnrRR4FT1wBdFP/WOENak3/ORSe3H/vbBHwwVTpiYx4rhzFrxLY3zDoF\nW7/S\r\n=EEiC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"14ce0863bf3851f12e184a53e9f84fd165496fc6","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-14T07:06:43.382Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.9","@balena/jellyfish-logger":"^3.0.50","@balena/jellyfish-environment":"^4.3.14","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.3","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.321_1626246505196_0.6909324443415441","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.322-renovate-internal-patch-d8dffd3be6dbf73343030943d26263a794a5588c":{"name":"@balena/jellyfish-metrics","version":"1.0.322-renovate-internal-patch-d8dffd3be6dbf73343030943d26263a794a5588c","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.322-renovate-internal-patch-d8dffd3be6dbf73343030943d26263a794a5588c","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c625b4f365eff111212971c89fd90825ba021a44","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.322-renovate-internal-patch-d8dffd3be6dbf73343030943d26263a794a5588c.tgz","fileCount":15,"integrity":"sha512-75e8liG2atYVU+Kp3xxoG1mcVB51pY3E+K5FBCIQ9GaanETlyjTljep8efsVDE3YHKRjYVBg7IqhvHH9sTuDUg==","signatures":[{"sig":"MEYCIQDVz7C2zIVZ5GVR0aq309f2oqDB+CBJiI/Of66eln+NtQIhAJgLUDY+2PFLGdOxY5DgESWq0RND6xHYfI8j4EjJ8QCN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":122783,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg7o5jCRA9TVsSAnZWagAAW7wP/0rtLCWBUf7RTLsLN8I0\nWbZucBG4odKG3MXcabKcJ/hj9Bjw0JQKMpa9d9K9YFGwNVPuiBuHszdk0sQT\n0VyyN+pzIPnmIOMTwjEMNAQiaMBGU6/hKy/XdQ1w3VZMUMLhBT9UIxl3n3s6\nker4GNPlg98ccMdseGPHfc6XRvuzOr//nn+rEPY9AoGCI0k4NUBheqsl58rW\n9ydUnJAaZ0HYe2O6yDi/Zp1b/n+6zRVUJlZPITVG86HgutjxGOGKfYr3gKCj\nwkjRdVek5inrQxasIbXygRR0EUnMBgNv2BJ4Wg9s9TXgUrBaBUmdUC3hP1//\nI/EiEtpqSfRLzrJA9rWvIJLaRQBKXldP0qAaWdro4vc5AhRukL2eLRtRakez\nCNB2abkXfOlVTb0hM9MY1muojCE3CcBnQjMRXH9htrgxHARR8hp4yMFAR7Mv\nODwBlq3V/io6OrG1s4GCPYehMzcq1Ka5Ey3Qd8uP3qHr/FsWFwgVS0uXQMyJ\noOpDGamSjKaI/xptLK/CBwCp0GCarqYsHc2JOPGEC0gEZ9EOooQNjUmZoNxv\nMk+4oi5vwaqr55M1LggniR5fdAz/DrSJQVbQQdNWuIzWnW4nHLInwkRvptif\n9qe0ICizCBWDxQPzA2Ex6Yra5aZ/9QWI8rXz8lFr55rYXKZs34EyU5mdx6dm\nhAt7\r\n=1R4+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d8dffd3be6dbf73343030943d26263a794a5588c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-14T07:08:21.750Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.10","@balena/jellyfish-logger":"^3.0.50","@balena/jellyfish-environment":"^4.3.14","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.3","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.322-renovate-internal-patch-d8dffd3be6dbf73343030943d26263a794a5588c_1626246754833_0.33949413675638107","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.322-renovate-internal-patch-56919fb1474752916f86128db49cd3e211d96267":{"name":"@balena/jellyfish-metrics","version":"1.0.322-renovate-internal-patch-56919fb1474752916f86128db49cd3e211d96267","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.322-renovate-internal-patch-56919fb1474752916f86128db49cd3e211d96267","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1141a9488aa3923b76d842375f513e425c9430a6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.322-renovate-internal-patch-56919fb1474752916f86128db49cd3e211d96267.tgz","fileCount":15,"integrity":"sha512-GrjSrn1B7TMlJtddxKSJGO5/CQyHzWv+z0sDf0IoP7oXsiNwkQFNz9ImZtbCeHq+ZOMl6SsVuO8vXbyV9WR9RA==","signatures":[{"sig":"MEYCIQCMhKgel16y70/RTvGZo5tIcy051TA2ztl8TMabq6E/IQIhAJN+wKlFbRXNLNWla1ZIpnbg2ShK0cMfxUc7PLw0K5bO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":122752,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg7qP0CRA9TVsSAnZWagAAjbEP/j3WkVZClDvRgkAhQhHl\ncA2yOILFfGAdgPusNi5XhVIVG21VQ/Lm/JStzPiqnc2XYxasMjib+inO3OBR\nONDsepyRz0xxhwoJa4OagF/kvzYd8pkcHK78qDM6j/1QRsjnPkQueb4ZPPDe\nfEeIXuSV8iMc27O+2Rvh+d8vg2DBZKrF54wgRh5EfiyiAXzVDN156uIr0nNp\nofFtU6PGIHNuHq+vxXwlJWTR6ZMW92iVUshNCC/99w05HQOtNHvcSbWihxok\nLXD1+pf3jMmLNiNNfS0TTEdQKC7MQJI/EOTfWupPmoTM+PzfyJ4EbmBqpW9J\n6cFIDVeFg/r1Iw2Ga3ue3mr1mkkWi1f1Ghx6Dp1IQlxHkmEbX8ZOdp8NpGDD\nlJs146KERegc4ogmZA/LsDekPUF+Lve1KqlmqrZRPzF+ubkTDXnOUGuLvwLo\n1eSBR1scRw45WPe7pkSYD2dcLKQOr1tLqBrNIhHkiKZxJoy1SjsLzgc9QjQc\nQhMuSjImlBKFcg2rt6/OQXxYCRGjR+t88s8jdMFlJmPBt+6Bm/EsnzYi7F0f\nuzrcMW0PfAz6twwRfvr6TeAiuutIh52q9hqCrFERlMYlg8wHivuazOj8iOI3\n+Emfw0Iwpm6eXTWNsLd4VuciKnTFpkA+oQ+rBgbe5XGYHzLe6sUOQc/zKpjt\nceZw\r\n=MfX7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"56919fb1474752916f86128db49cd3e211d96267","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-14T08:41:17.540Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.10","@balena/jellyfish-logger":"^3.0.51","@balena/jellyfish-environment":"^4.3.16","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.3","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.322-renovate-internal-patch-56919fb1474752916f86128db49cd3e211d96267_1626252276083_0.6854880832174088","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.322":{"name":"@balena/jellyfish-metrics","version":"1.0.322","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.322","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ac886e226f790e35b227b71465c44e7f2f975068","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.322.tgz","fileCount":15,"integrity":"sha512-p7ER/uQtl0VgzjFPMbYLS7tzcleq6BKuHjFrHaP2Ee6zBdVv2JMGJvP8cZWFwFsV16ypubdDpswxIv5U4R+NNQ==","signatures":[{"sig":"MEQCIAyB6vOZOO/5WxvjUDx9MnHPjWlpq8He9OoZBq7gKMpzAiBjZaasq2lc/dtXfDGDTiXmQ9389G4vB9x71Y28H37/Lg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":122687,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg7qT6CRA9TVsSAnZWagAAJEEP/3FuM6juPdiGvHbcaHD1\nsW2agEJvJhmpi9PIbjFQelmgPN8pYlLQfm0i9YEQx9urCRl3Prhid0ruagqx\niPAWkZj6E1JUYsKB6l940ITA6dkqLwZAjV/QGUidKm51VzSwAqjADRyujvJ6\nxEMbOpQ03WV8Nk2xvbr5tRMLZn+PjBO39wvEeiogQDvD/sHRDPCTc/nkPWCq\nGVTFoyWGeftdAu/W3BPG2qD8T2JzJPNFMlo2hxLZGI5PaqVJVd/JXQ5EuhmQ\nHf8xmzexIBZ7XNnFa2Hb9KCRWP+M6VAdBWaZGItr32peNPKitPGkz58HTEiL\naxosD04cKtilvKWyFvglcedPrHoJ3bmGE/wWV19VyU7fpo+16c9sOPBAsFPI\n9SGVSaACOyyIs6rvxzivLroPYNeLClV/nZmYKjS+pPVk0zPM1njG0h0Il6/Y\nhhWQ5o9XcWHmg5sjfulWNDC6ukMqS4LZYN13lxDxfQWQuEhPBwwdLTNAW7XL\npcwnwwV0Lzw6TkZNUSA0gJwqGe7s6xfDTx1xYgk7C//J4EmiuWzNYd0RY4Cw\nTR0F2ARCw3CsRHqsmE45hmwtAe2f+NosC8XgR22WWn8mLA5+gObJGDYDTH3z\na/fIt1i9IU9I0ezlNf3UMvpa4isQp11rj2zL1sew7pcv4Exdx5xPwd65MX9n\nW0gf\r\n=USNI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"46542b2afe03c8dc52735e78f4981dd0fb18899d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-14T08:46:52.488Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.10","@balena/jellyfish-logger":"^3.0.51","@balena/jellyfish-environment":"^4.3.16","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.3","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.322_1626252537590_0.7399857277326747","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.323-remove-whitesource-badda0f52d18874df5ed97db8c74055a5f2fe7da":{"name":"@balena/jellyfish-metrics","version":"1.0.323-remove-whitesource-badda0f52d18874df5ed97db8c74055a5f2fe7da","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.323-remove-whitesource-badda0f52d18874df5ed97db8c74055a5f2fe7da","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"06f0e14dee037d3abb3860d2a96b0a80aa0cfb5b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.323-remove-whitesource-badda0f52d18874df5ed97db8c74055a5f2fe7da.tgz","fileCount":15,"integrity":"sha512-e3/RimMzJTuDp4XcwcbhVptTxemwsxT7vW6sulh0FZLPrVr9g248fYXXYxjwo+PbFfklP5E4UjHGujRK1R5KZA==","signatures":[{"sig":"MEUCIHY+xn5tf8ESoZKth7Xek7wQYkiQDjCf/ifVHNSb97JNAiEAq1Ipvx+Pbt61gCAzuQvk0pKsk0gD9e0qgW+VR3nZ5Jc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":122816,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8hdbCRA9TVsSAnZWagAAByAP/RjLqCPd+2zv6Qynhqb5\n42+gjQzbvMet7kUxz1YyjeTrzFfQl3goJVtlzJUC6gU/7RV4cg/b063pSM3h\njorhgoLOW9no5rCbdQYBq93kNk3OJx1IeBOSJZH2W/zRS7beuh/N62x6pmHB\nZgyiivzaXX4JC7wWXAxeKWYCsvbSNgpHo64NYz6UL4iFdGVna6wkh7t8lG+G\nlavJrLouXYW6J2dZejsVb9TRxti52YFixGessdaF9Xla64cutRjvrC7YOddH\nRlaYBBi5vGRIBOS2kCkm89dNUgASdZjhwpe0eFXh10Z3YlWmUQJyLqIuT5+F\n9Jbr/SoDeKIIEa5Uw6RCVJK0xbFQPkDwdlBSFzvmVbKksmDDHL5IT9zrjENg\nfaMljlG4aOn0R/Xbg7L2MU7d6ig6e/OGagJS66N0BLDfNqvk43wCK0HghITe\nQiLsvkgJtgW3X+wR7KraaDEB8adOUOefwJMgfYHXw7V0ikv25tDpNkQEAUkp\nLp3QgKfC7cTA81KwhXt1nHPyXGkDwSakzd+OWVNK5REVr2H9U6fmBjz0JLRv\ndWLVSCX8OIbshg7Fs7DSngjSMtZTKiPFyv739He3EP8fqt1dW9UymsGROaqc\nUqkImuwwr5GynxHdv8ZllwGl07XXH+osT90I/HBAdQ3352biVg8eQg0uNATL\ns6KR\r\n=+AVK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"badda0f52d18874df5ed97db8c74055a5f2fe7da","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-16T23:30:11.945Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.10","@balena/jellyfish-logger":"^3.0.51","@balena/jellyfish-environment":"^4.3.16","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.3","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.323-remove-whitesource-badda0f52d18874df5ed97db8c74055a5f2fe7da_1626478427787_0.07046903094443202","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.323":{"name":"@balena/jellyfish-metrics","version":"1.0.323","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.323","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0548e1f963310953d524470aac9fba8fdf766bfc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.323.tgz","fileCount":15,"integrity":"sha512-gJUPoi8bFLimG9WXG8AKklBOB4fLEjR73LKSJVB6e7nPwYOZJcNvTeb5Xgxwd24g2G/1mzW43K4pRE9I3VH+eQ==","signatures":[{"sig":"MEQCIFnBFiujCbJQ0xLWe+wJji+4pUbt0dpfs3+5TDqGtqwAAiBDW/gTwSfkZXsKGu7pwS5vKNikN/6gkGhSa1g5xfclfQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":122756,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8hiMCRA9TVsSAnZWagAARbwP/iyfkHd3Cv23wxheLgZC\n0h2O1VgVYY7bJnyOIeaK5pFNC1EzWfCINMhJHniGd+V1qi98SMm7Nc46l/WI\nsCUO4w0adAF+v3FTgX5pvpCSlCh2pAemJ1wasVZ2ukV+B52+9iY7qTTyTugV\nbEOHS9XtO61nk1uSXQpPHSOzznjLLzeeO6sBXUDZ53jtgC21hgcz1gN3r5s6\nchDRjbfhvFLz4T7Hnuc7lruVdOHgnJOUUOlErSd727yvMjNHE44p5WyhI9Q4\n2D4kVAaT0AVAbZ9VkrdmvRVaX/v1YXttYZSwALSweDlGiYo4YZBLsxLH3nXc\nTeXrCAWba6je3c3pGQXyLn1oFB+DbKRv09n+D83qW4fgDZeH7lEmL/Kk4wdB\nVA6rDj3Kvhj2wc8bEy1ZmYlrxicR4TqX1SwK2hAvhu6QCz2eUPtrtyINTthk\nlRZ8GvzzGDiND0c/0y1WLGYzZvCeZnO68vcH04F53d/PwIigFEZgYWj0M6jZ\n2yv0eY5EA+FSqlWYtggcmcbDbE/mZ46rYywLcy/ADi9FL0tqYq1BUVQvmVN4\nXB6v4w23ezGeCBDLWA1oCbSUhCmBkslZP5jN4QVbWDdlu5o/KIbV2IZeyvhG\nYfN4X3IqakpyTOzu4Ki7xvj2PmVCayXVDBMYkbYzzemfikuAQaT0b6TzV83B\ntuPw\r\n=irPO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"534dd797a4359173dc54af6090451ac2a2a10df5","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-16T23:35:32.376Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.10","@balena/jellyfish-logger":"^3.0.51","@balena/jellyfish-environment":"^4.3.16","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.3","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.323_1626478732271_0.8839285792424474","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.324-renovate-internal-patch-398fec6adfe17e018c1634d6d74300c1cf0a27a2":{"name":"@balena/jellyfish-metrics","version":"1.0.324-renovate-internal-patch-398fec6adfe17e018c1634d6d74300c1cf0a27a2","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.324-renovate-internal-patch-398fec6adfe17e018c1634d6d74300c1cf0a27a2","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f862b7bbeb7592357eba7e6145d20ff89f600f5a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.324-renovate-internal-patch-398fec6adfe17e018c1634d6d74300c1cf0a27a2.tgz","fileCount":15,"integrity":"sha512-PN4mhJ8iDqx3tZnj5qGJ6l/ns9KPiPoO+p5ujCQfVKj7XKNVEabkDiKdFSsemct+0y2ED13j8Yes6LmZ2S6P2g==","signatures":[{"sig":"MEYCIQCYhyHB2Xaefs8U14tjEz1s84VqGpkiWPeN02uUyjmBfgIhAOZEfIMoKFd1HFlFBNVxa/lEdmdFzCmMZ6FCEyAaBoOS","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":122893,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8hntCRA9TVsSAnZWagAAe/kP/igXiNgZstLJ6fqz7Poj\nJcIEQ/+4v23BkwDIObcTdhkchiYJEmqOOMeWHwxhayHbsE3BZSroT3cg7nKe\nkX1UhrOGrXMVCrXS8rUoMeks/XTedUlgx1kXyUzZbKwcxyqLla8ztrVig8/+\nlMRqoR/61rEDnsgA2vU6r0+s2KmQXRDbkTHkbVNEAgVuOgt+JynMmf7kQDUR\nY4lc0Ny3jFasPcSIbVXz+L1Nm73z3iRlDYh90nIzYOzdJ8cMd2FNDMBHpjtG\n9FBzIIOd9OXlo5pEVl9purXLJXIUzGaN6M5fRyr1W7Sq541PK4STBJGqFM01\nS0+kTzrMqMvPKx4b0eTRyxnNqFqHQGcc2nJ+GBFqCm6uEug4DgxsIwL04P3l\neL9d94cSIVvg5WWVFrsPfj4dXkz5WMSOQ4HAtVscALyQHtY7cUL0+EUfxIWD\nagVOa94111XZIL9bLueUr4YZjYfwgtJCB7PzXCB9l+Y5J4PW6arwdbyYHHOA\nTni6WEjy0XhyI0+SORFEDFNnq6elsAJttYaGES6eBcfh3j3xsgS72uWowumJ\nphnq8ISbtEcosjwrPUOg5YF1uyod/7kJjOPGUTNXJm3DYjWavManqEESl3nh\nPuzce9uV+AXaVUbv7qFwn0t/HXrJz4fO28+1XcB/yb5+p9b75tOmK7ke2h9B\nuYF4\r\n=5mNk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"398fec6adfe17e018c1634d6d74300c1cf0a27a2","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-16T23:41:33.511Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.10","@balena/jellyfish-logger":"^3.0.52","@balena/jellyfish-environment":"^4.3.17","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.3","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.324-renovate-internal-patch-398fec6adfe17e018c1634d6d74300c1cf0a27a2_1626479085483_0.7800713478103594","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.324":{"name":"@balena/jellyfish-metrics","version":"1.0.324","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.324","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b6210cfc4be6f1c9077065e6551d05c38f0233fc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.324.tgz","fileCount":15,"integrity":"sha512-5VXKiYUK6DNt9W+Btlpysx/JCX5QPphWrwt36p+vp8Bgd/mK78Uqx/+0X3gwYyC5CSKoIb+CZWDpFytS5ZFUGQ==","signatures":[{"sig":"MEUCIQDa/AZsmDzNKpVqWFpsaVhZiFIiLSqmprW4oeta9Er30QIgFyiwPPxhebBmo1HiyEr6JOGOiExvIQZdPXhKVqDa3QY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":122828,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8hsvCRA9TVsSAnZWagAACCgQAIITbRaiWSUnFB5s0Wvk\nfhOuraUlhlrR3TY0eLZA47urltz0R6e0w9IGlF+DFazlgpILiIn8XhhpfnZH\niUj5EHiB41p+YwAP/Z05RcdYnXLishRJ92GZLZX7Ft8c+dXnUmiaA10GmFWs\nCNXuP8QJfF+Ni/f3ywHB4Lbpz/7qDjIi/S2rDresK6QjpFWEyfMKkDzqWEqR\nr8lp2k6TSfj/fU3fEFrrxqqg7r43aqYs35nZ0/rqbCYyzcrLfjDcoxpSRxKk\njW3TpDvo3FfnGX9XdnsdfmDO86qgF9PLe9JAiPp+jCpd0Hv/iEtiBP5Xv91u\nfXunfcUeDWZ8GnZG1y7cNfelrv+H0b91iUSo0dwhlbQhxtXfxhJFr0YBvg0t\n+/p8oqNi87onkKoyRcqPc5ZdGYEo1szLCQV5pZDmiwOlid+OaOp1g4tnXZVv\nTxeDmXmC1Pwkqh3SeyhlJnM0x2qkkTmLfvfa+mglBQeT+2SbwiUO8f+OZ2Z3\nWcKNOsMQIIxjeBVfShurU5wcueMXQoq0s6Az6Mp2LRSnrV5IiiZrSaapJONa\nZOqRKJvJcS5IhjDFXfo2xXUvSmEDHw1fgp0F/xRRG3TgRR/hvy3n+FNkCMzA\nY8vMsUAGTX6+t2wmXa6AJEk2LCofGf42tYOY0kKOmLHM+sEdpRS1e1SWKfmG\nAIOM\r\n=DQYh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"1ca7ea4fdb8f52ec5fc46b40fdf09c53ebee2a4c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-16T23:48:23.262Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.10","@balena/jellyfish-logger":"^3.0.52","@balena/jellyfish-environment":"^4.3.17","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.3","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.324_1626479407145_0.6838804757270862","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.325-renovate-external-non-major-99b00f9c5f61e62281a4866e63b245f9f7b8daa7":{"name":"@balena/jellyfish-metrics","version":"1.0.325-renovate-external-non-major-99b00f9c5f61e62281a4866e63b245f9f7b8daa7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.325-renovate-external-non-major-99b00f9c5f61e62281a4866e63b245f9f7b8daa7","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"010bdd98de16f530a02731cbf0e96333aa1193e4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.325-renovate-external-non-major-99b00f9c5f61e62281a4866e63b245f9f7b8daa7.tgz","fileCount":15,"integrity":"sha512-Zl6GjRD4XFXtfX+VKirYg6EcuOGxWzCs5xyoX2RddGBPmBmgb0D6WRSi2SGjY50zKA9ogCo9oOWtIre8T4mPzg==","signatures":[{"sig":"MEYCIQD2r2v0aNQQ+QmhsRhSbr4IQf/9wwRUfSV+OrwKCrNXfAIhAJiiL7RvO35/Zky6sXUKmnFcUggYmT7M3z8e8yywzuhc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":122973,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8itQCRA9TVsSAnZWagAA9bgP/ie21bAinNH9+17OPLpA\nKcxyoRgDD0+rH4VQGXakndQzG9FdOW4NY7jNKBnpmIkPx/U3Rb7zAoa58Yct\nSGeE8LOtnEc9DFjsBoctdpknXZIir+2zHk9+wcNMTrZP8TpWKvEVK4gQsKbo\nkaXkGwOskEaEx3J+zV0s4ZfRuSgTipMT2rERdP2AvwvWJ0C3jJTE9fB44i1Z\nZFuXujjZBM7JJelRy/TIgF/cC8z7II4RiAf8oM0405Oe6HSg/XwlsQrpYTLC\ngIv4raeaUhBUT0Mb/XoLsEdPxrjJBg/oQay2eta8RQ4QnzHHUPwuyfN5s3S+\nRx3C9D2kJa5uNS5rAbDy8nT7jbep7YpKONCHdHuw8lD0NV7oEKD2ZewvwDI7\nvTztm4gEmJX4tn5rK+v1QobvvEmZZyvWEhm0HuuzfNtQDQIBbjuPsfA+CJjJ\nll9Zp1R+SqSi1d/pFWph9Yk+QPTFcaBiSuj/4HYFiG3MOrJ9D1K6femTACzq\n6kHeRO3h6J6QwQlhgP2dXey3a5/vD5JkKHq5+6UOZ77rXy51GhkXEoIM1Iya\nL7EDyWpw3nYCQyajxx2bKuOx4cKjOZRA8mMOAZJvOC/Cd6w+WPaisDEainPf\n+uImZq1HJmtOtJRGS7jKvzN1/CZHj1EZHAX5tT2TYOH2wMRcYmf/KnSQs8Pb\nCGhr\r\n=DfoR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"99b00f9c5f61e62281a4866e63b245f9f7b8daa7","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-17T00:54:23.648Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.10","@balena/jellyfish-logger":"^3.0.52","@balena/jellyfish-environment":"^4.3.17","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.4","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.0.1","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.325-renovate-external-non-major-99b00f9c5f61e62281a4866e63b245f9f7b8daa7_1626483536556_0.20405054004848","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.325-renovate-internal-patch-199fb110383a65df327625a1e8e3c5d79f552cd0":{"name":"@balena/jellyfish-metrics","version":"1.0.325-renovate-internal-patch-199fb110383a65df327625a1e8e3c5d79f552cd0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.325-renovate-internal-patch-199fb110383a65df327625a1e8e3c5d79f552cd0","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a14c8466c891f39fc2dc9ae5ba8c466049bbbe21","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.325-renovate-internal-patch-199fb110383a65df327625a1e8e3c5d79f552cd0.tgz","fileCount":15,"integrity":"sha512-IbOATBIw69vIjBZ372Ml0+5LAXwjT3qV4t+SHm6DF3Tx8p8iOWWOaB6shoZjE/H9oRhfQ1U0YvqJ4cL9u1PtKA==","signatures":[{"sig":"MEQCIDGYHcAwPc2uH3UalkWmaQJSNX22Co1Qh0slM00DC3TnAiBGOV2NakUTqYIFQf3OLsFAwtAwR1JncwPbAIETAdUFUA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":122965,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8ixVCRA9TVsSAnZWagAAjf8P/3QXqZg5VCPZDob4ilPU\ntfep5lzEki4sqd7UUjJHooEjuv6UvCJ2aLmdpI/iIAvzzVePQ90VXTC3lbK/\n1isQ6tZWIzDgrIZkOuXTUcjwxKHnqHUNT/Y1Of6gLHefl/kQFxPO3/tpsdPG\nPaRWr4rg/Xn40vG4ey6CnirCx8cZqvjj6ewKFAiI+3RcQieRqmGwNs2jpMlh\nv02zxgVD07ZIdo2bEX0vGtrIjyCesk9OzqL0C08WspPX4fLhgaa9FU5BD2ne\nKMA4Tt/lOjVCVe4+hsOSiTL1GBIiaNz0OFd7gShD85Cv/MxmjQ10/d8L0Fqi\nD8xVqM+v6H2d1BQLmSbNVHgA3ExHw3J+FiQbQqJb8Fyhk4/heJzBSgentwWN\n2hOnJi6nKNvl3pe+3yjz0L6ZyCdYl3wWy8pOnMyAINzFpRnMKVJ+IwJVtcgz\nczm3rakjd0FK86HbsqINoR0awjafgQFfqOJDTcUxgdurD1S1mcRpUokt2abz\nztBgDKMF6C7Yf22kqabulkCF1Djyu+wC1Oln25UJUCKM3xT63n8smXG35NDh\nUlu1rkdGDE8ghK2rU2Mz5JnWE0sKTru9MzLC1t7lFPPrfSCvWwjoYl9Ts7vu\nr7I0ATk51QcLdMxBV9m59cSqWs6+17zoj/idxqLUg0G/YiwHLNDxP6xFdETs\niouc\r\n=4Mew\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"199fb110383a65df327625a1e8e3c5d79f552cd0","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-17T00:58:38.669Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.12","@balena/jellyfish-logger":"^3.0.53","@balena/jellyfish-environment":"^4.3.17","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.3","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.0.0","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.325-renovate-internal-patch-199fb110383a65df327625a1e8e3c5d79f552cd0_1626483797611_0.9206579345634824","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.325":{"name":"@balena/jellyfish-metrics","version":"1.0.325","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.325","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"754a5ef738ad8a6242f73903194401681e19f43f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.325.tgz","fileCount":15,"integrity":"sha512-YFiCWNcKYLu97HbgMLazGSMMcGFmgJxDY3sAm1i+PVlN2dTAbhvpLwHKorGWyxnow3+5QyP4WT3d/wz6Uv8cbQ==","signatures":[{"sig":"MEUCIEcUOi7x8x6vn21VjMv14J9lVl+ggPKkImTx5tVk9YU0AiEA0bwXId85+eZPoaptFfzizfsXxzjNboIMH69WxNHOvvQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":122904,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8ix4CRA9TVsSAnZWagAArJIP/0GaV2bPsdPpwFz5Myp9\nHhJxcECukeNR0lGj8+lvyT2B7/B/HhwDNT70kGXNzQzPu3tvm6GnxvjReB38\n51HdrBPyStheTdXhIIv7hoxyRBn3NiFZ6I3Xd6nE/czFA3a3t22xUlvMEBRz\nkyD6kUwo1mRL0Ijmk4V4svcGtJs6/h1ZGnbGnLmu3s9rx4s0mracQtl6YwGv\nKF5JmvWMyqZf2hJ8tTXz45KZpqdh3/Rgpgxq5bA0AEBXsPUsthU5wyGOk1wr\nEquqxXIe3MCR2auv7msjB6t5GjvYL0P+S8jRgyn1VOSX8tcVu0aFucSD1y92\nVLEYcwBK2c7S2/2Nit9BibBHT837fG/LYSQO+z1jQpFJA0JEUcfxE0D1LTBs\nu6kQxCTx57jUGJ9hXH9Kr0YgRcSsdq2Xxy1ttS+OlCpSzn/yajas17PxntNi\nFyZYErKNvQ29VfSwxcqG9vAChzxbH8E2klj6lvLH55AGLi8lU8k7GKwmAPPe\n05sScueryqoWrJKqeYVFMK5NOHroUPjIS5X+pL7BZ6co2KOyB4ev6BubMfpd\n5WJjG0X4EL6oWV/cNADH3bU2tWsxGsf60eEM9q+u+UPwWETnGq3yKCr2afxU\nPCQu6ZgfwdQAGxUuyLRNP+aSZ3emiAJZ3Xf7pfPtlv51R0vnEz7vaBChNyIO\nceg2\r\n=7iBA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2c86913baec8d9e95946c41d641e314bb4205c87","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-17T01:02:03.206Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.10","@balena/jellyfish-logger":"^3.0.52","@balena/jellyfish-environment":"^4.3.17","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.4","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.0.1","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.325_1626483832493_0.45750227609445937","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.326-renovate-internal-patch-be3f1f57049b649d718fecda52c050cb114d02cb":{"name":"@balena/jellyfish-metrics","version":"1.0.326-renovate-internal-patch-be3f1f57049b649d718fecda52c050cb114d02cb","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.326-renovate-internal-patch-be3f1f57049b649d718fecda52c050cb114d02cb","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"86ae181857e18695877f40744c8c61251a9ead43","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.326-renovate-internal-patch-be3f1f57049b649d718fecda52c050cb114d02cb.tgz","fileCount":15,"integrity":"sha512-HIYB1tGyZrmTLppQHPmwZ7G4hvS1FDpb+PxdJRj2Lj9afDiybgzJS8HWp+6IRDFmQ+eK6dBuOPIgVr3naJycXA==","signatures":[{"sig":"MEYCIQDhMcw0F16ipcYgJNNOlJU1MEYfh6AaRawzHW0tLsyO9gIhAP1zcYxjwvHKm3+eaz4Kzn92COixOEDjSjGjTEKvwNqx","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":123041,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8i1eCRA9TVsSAnZWagAA50EP/3eAaTF+kzClq6XRjzDD\nnRW2FwNMThQ5O4t72zDBQ5nXpRlpPzlkVI/dyLGJqCRkWJThlTVw2UZdcuGZ\nlhQnEOqc+xu/pwCsTjfpVbzDx9G2eZv/vrVHlgEMJraVRQ75LBf484lWUPD3\nETdXzjMovJ3nzk/US5PB4ZPZ1aEovSXmYbaHYzenoX0tiLE+GwNlmwb2bGqU\nVGu6kLx/4lBhNmXRTkVvPpmVhnKMT1vJomwRZ7ihctdK/Wjr5J+1q2CGaTWO\nonN4sV0ulo/cC7G5vSIe2pvpvDRQe2prKPBzAIZGifEQKcgZWraPplXhN9y2\nECl/LwnnT8cjuA53jxzGCQZNhNMMXNSnU+Kvh6zagBeFIc9+6vC0lw79vI0d\nZGsIcY6RKeGBvKs9LuviAnkr9LN+72+A1VIxFAB+5gDPjyCdMDSpxKjU54+N\nG28LsIEIlF7d6JpJFaCGxTn8ovhTe2YOpuRo1eDounZT+N2IJcycdGD7HQ6L\neMP6LGNILBVZV+Zp7w+928ALiSffI5OUuCOID5Q/uracT14bioSRKjCdFoL/\nWKLwziXw3wN9cd+NpdQhcHa0S44pwH1q5yzBodKFfDxKfrK84IHv4wjqWSGP\nEJNR5/MdwNwe1O8FlU/ZiHxbF4/y3/hCaJmScBqsHcHULNydKzZtfl+b46Xb\nu+fq\r\n=igST\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"be3f1f57049b649d718fecda52c050cb114d02cb","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-17T01:04:13.388Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.12","@balena/jellyfish-logger":"^3.0.53","@balena/jellyfish-environment":"^4.3.17","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.4","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.0.1","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.326-renovate-internal-patch-be3f1f57049b649d718fecda52c050cb114d02cb_1626484062184_0.8926616626284563","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.326":{"name":"@balena/jellyfish-metrics","version":"1.0.326","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.326","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b613e262fb139fc02e5596abbd4f6c99955b1b13","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.326.tgz","fileCount":15,"integrity":"sha512-kNvl3T34i+osONeXeEkG2NDKPNOWJeedOzfqbsl8zj2z5/XvaSHXA/5sn3y7DxBxrEVbRDQ2FJmbbQ02oCAY0w==","signatures":[{"sig":"MEYCIQCHLRU72HxCxfb7hdc6ZPo0uRF7j7/Pda0GaYT7m1uiEgIhANm92zdWrVIlE7B+czr894h3d2APZV8fgTLR930L2ry9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":122976,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8i6tCRA9TVsSAnZWagAA89UP/2fJVzLvADwoxXzd7f7e\ngSksRfIvNDcXNNYK1/ThXJFuqy5NQV3CgcDhtt59zADSIWx/nfy7B/WyZD9i\nZ7A2wlK4OIJlgLxr6B1THwqIGcuiYPJvcKCSVmWOxfOHC9pW2Xz/WUoyTkzS\n+XKPnK6NnGoVGHFCxfFUem4LfCxxKJw+cSsNUhQKZK75CtslUMHUKiN5Z4c3\nRNcEGcHL7v+ohbbeSxHRplTr+6rAi127/1VYJqIM6T5Ek9CasT6GDpDWnhON\nL76aFeKNWyXAzyGpGk6D0brKgf5FyGpRuUZwgjBqKd2kQpdEcAJi7gLrfsS5\nLiQEEL/VwBMMxGTveAF9nmFpovwAHgv8hTndF+gCX3NWWfG71MRygYOx4q26\n+ZwTFtGWlq7XHrZvFxKpTr81UV+GiuEDkefJFPSaM6CA2czv0XTss7I3CAH2\n8jDM2uDkid1Ik0Yr7LjXl5YYEFQiUxRzlvMh+UvDp7e8rHbhQaqNakaru5sw\ntOWSED1eq7byFnrJdM7+upJOUk8XmR3I63ddlax5cWkidzq7mqOPDHbO4k33\nNvmwFEcs7yaruhhIJAnJMGekeYFTHPt/Pjrezz2Lf8hAWe2Uw+x45XH1oFQw\nfF/v6Mp/JNMycGfe3QTPjxl+g7n2ihfZsfFsCG92Eb4onKkFk5kE6ajY40a3\nQMNR\r\n=mz7q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0cb063ea6c2680cba421532318ec6bd944e2285e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-17T01:11:09.470Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.12","@balena/jellyfish-logger":"^3.0.53","@balena/jellyfish-environment":"^4.3.17","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.4","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.0.1","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.326_1626484397509_0.9949854026697851","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.327-renovate-internal-patch-21a95b9cb29734855799b2d954bdb897e3680c0d":{"name":"@balena/jellyfish-metrics","version":"1.0.327-renovate-internal-patch-21a95b9cb29734855799b2d954bdb897e3680c0d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.327-renovate-internal-patch-21a95b9cb29734855799b2d954bdb897e3680c0d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8f2421154997dc167297d37ddb88f7ecc752252c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.327-renovate-internal-patch-21a95b9cb29734855799b2d954bdb897e3680c0d.tgz","fileCount":15,"integrity":"sha512-t4svW9lGBdpQfTzawDQNp/dkhNEPxMGvAysL9cP1/9uOsPIcl6PMph+BsuBwqSJSSB5JXROpcHdy77yEdtgowA==","signatures":[{"sig":"MEYCIQDTUVihVAKqNJLsF51ihNli/ZLU0AB0UwzxLM4eGpcmuAIhAKk4enV+ppslLRPzK6bsbMwxTHtZSSmwYRi7BEWVkgbA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":123113,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8nukCRA9TVsSAnZWagAAsicQAITcChHzFC8BvBEgMYPi\n6oZA6x/Z/vSR7a3Kcl1aCbvNbhvwY3RtVSe0UIUzEvQ7e1jNJLlYlyz1IERN\nHlEtmbfzAJOWHjHbT9YYi/T1tPBtmQ1R2X2sNXym8Y1VxWvhFTskpn6ul8GR\ns4Wn02Rojgqu9NxEbIB2VkdLmbR2fSLGakqEYbft99ROXHL6gSi7bd1IBjc+\nya3xQyNlAdMGuU6HOsD4VDLwYThtpyWGFPPYaTXaS4U/RnPXmtF1+sIiPOi6\n6PWB20JtUBLTBF+tOCo2Ivu3grYI1aXlDt4++6TR9+IICCNoxHIEyWSRS8ep\n9StWADbx3nETB/bqze1Avy85VTQ0kxTDirkYs5R38HszOsAaihK2kMSsG12n\n8ze1vCBwJw7p+mI9YWnsNEL/wM8Lc132BsMb3BQMLR9GUy0STh5F71+XvlO/\nWvXjooow2QF/y/+/0uUHnxjE5k6I0FtbeaGeephMwhSSGKyF2NjoJgNobtYz\nUlMHKJv+yfWllDSj8l5X6IBdlPsj3NJ5UO89d9dz54BS6Ho4MVpuBwng8gVl\nr+DC1dKzqX7iSguSZVujSUK0U4vc3csYXCeMb2vH3bLdu+0GBdHxxbQ5qUSd\n8dYNIt2dYqJRYpyFibXkLRXWm0PbaHWzB53Kk69gGu1jr05/6DkLFoIiICDr\n6FKy\r\n=uZgv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"21a95b9cb29734855799b2d954bdb897e3680c0d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-17T06:39:02.297Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.12","@balena/jellyfish-logger":"^3.0.54","@balena/jellyfish-environment":"^4.3.18","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.4","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.0.1","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.327-renovate-internal-patch-21a95b9cb29734855799b2d954bdb897e3680c0d_1626504100841_0.24451761407230288","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.327":{"name":"@balena/jellyfish-metrics","version":"1.0.327","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.327","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5e8c45b91706d4d9eb14d3219054c4614383ef70","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.327.tgz","fileCount":15,"integrity":"sha512-/zsNkJwd8tG/ebT8gyiD+k121ZnnFSmgi4vsDdnNjdXHS+V/MNVUOi0hDMSm/yDj7slfnJZJpb0xrjh6HOmYxg==","signatures":[{"sig":"MEUCIGEnQVmGdz8r8estVe/4mb7RnSjEHeHMb9P2xFNtlU1aAiEAvumTtUNKV0/kSCXbKcPQDlEHJoZ7wO6alo9v6IuNSjY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":123048,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8nyNCRA9TVsSAnZWagAAQsIP/jP4rRbuc+3nmVnpO3my\n3L+50TRSpJl7/A6sErVGiM9cUn7Sd/4H8CVIU6ymTq3sH+N0TizI4+BMbeuN\n9n+BVZJpPa8PhtlHVg/HDZD2aOLhD/2/dd8qn4Gpmwcc2mF7wpXoAUODTGeH\nDDaHFLJ+ZhZhxWiBPtUccH4bBz6+0AB4532shc0Q4hw6WBv4DGohykeeBzWM\nXnHZwnR6a5lN46sOU+2D9ZwKc9kG8lWauibp1VLvjMBOxr/OEO1HiSU0DxKv\nYpxbLSLSqkvQ/ZLcdD6UyRy0ooJT+9SzLiDU6pv41LtfFOyss1/XCoxzGJNr\nA0jtRNJi2kDI7v4fdhqVYR4Y2lPug2cigY8FBWzpCxBXcenUGipPXxOmnYd8\nGlPM6j628NnwhWhZ/oD8WCIWcIf/dg3E9eXVz4qF8fheeKRlTYpXgCW2rdU3\n/QyqpH2Y0OpNKZ8fi6iCTO1sxezrZoiEJVFVwyKmYIO5GdWcYVBP776URJsf\nWNdKRhNZK9k4c2F0BoK+mqB0gGdy47fyuclX/OXg7naG7pGybycmBVpnuOL+\nH5U9IubA+UPwDEo45gHaDqjy05A173N38cLROhHRgWYCJV7Ob0P00tS+ld5m\nVHbii251ELx6ifYdHbUV1ZbCuMEnjwCI1yZpyoJ0bkdCp36ly4YuQ4QcAYv8\nZGQv\r\n=1hXV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8e7034c8567b09ace8f5de78cbe817f3c1e71483","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-17T06:43:41.672Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.12","@balena/jellyfish-logger":"^3.0.54","@balena/jellyfish-environment":"^4.3.18","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.4","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.0.1","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.327_1626504332961_0.49018648759750394","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.328-renovate-internal-patch-e78777f954f12553a8479c5f1bbff11f02cdb70f":{"name":"@balena/jellyfish-metrics","version":"1.0.328-renovate-internal-patch-e78777f954f12553a8479c5f1bbff11f02cdb70f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.328-renovate-internal-patch-e78777f954f12553a8479c5f1bbff11f02cdb70f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"242d9cb36bbf07a967e8da604fa460a4e3948b7a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.328-renovate-internal-patch-e78777f954f12553a8479c5f1bbff11f02cdb70f.tgz","fileCount":15,"integrity":"sha512-Dhqzpoc51qU2rpu1gW98Ur/rpsDHE55pKbOEy9vfhKXG+np46qJlfHLXEGhBm+8rHDJ06NagyRyv9cm41IurhQ==","signatures":[{"sig":"MEUCICccTD4Wjv9YxqS6h4TePu0xX3umBg+qirV8DP1ZPM84AiEAzImYwvxQy2a+wdX/5WGmtauZ1cffng9NjMZzXtlX3hM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":123216,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg999TCRA9TVsSAnZWagAA5sAP/1JN1KjknQr1W1TMIMLD\no0kaSTSBP3er36wVZh01th4tOcczi/qELLJ423tlcF4b4g2HMgOd8J9UdjqW\nEnwEeZi9Vv/4nn5w6uBE990rC9dgx1vJRbLZtxFhzLK+Yjt2QjIU0TBKJDDI\nzkdEBWtJHPkSKYQtkMQhUxjMRilMSOfiPtB2LgNp4iul5gT43m7p1Mh9bcMu\nm6CgFnpmX/1Y46yNd0wUu5G2YAcGgU9EhYzT0gzrmvFrUVeEyzrcYvwWpptn\nmmmEj7fcFJwIQvBZCZ+vlDxq5R3ZQqitTY9Elx8b2h6DHXEuF+zUOvhXeowB\nT8NS2BQL5MXHmJ2CuA/YJTo2xwEHMq2KcEH2CKixxwi9pG7UWfpkUtkDKn1a\nsbGFX+RFvKfoNHFuV2oOltP/a5509FWUdp+5eB1roFKo6JgaT/uQCTGJWhmV\nDoHl16fSrerlfqvpYG8xcQldkmMJCltmA9xsxxUyLUqlL05DEIIQQKL6e1Aj\n/ejmpXmOih65TSrA5qShDvdjfOVTeTiiqaomRvTbIFzMSzXfQfTMp9F/j8jp\nBQQykZaGnn/pPgjj/gL54g01JoAVt7l+I36bvsyGZ2x5NBp14d5PX9TGOw+P\nNmP62x6nRoWpSx6DboYyIlt21JiAH5h4ve5njbSKPrTCZzBFVi0oZnR9hCwb\nHvIN\r\n=qSVK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e78777f954f12553a8479c5f1bbff11f02cdb70f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-21T08:44:57.843Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.12","@balena/jellyfish-logger":"^3.0.54","@balena/jellyfish-environment":"^4.3.18","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.4","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.0.1","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.6"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.328-renovate-internal-patch-e78777f954f12553a8479c5f1bbff11f02cdb70f_1626857299055_0.9847024871629564","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.328":{"name":"@balena/jellyfish-metrics","version":"1.0.328","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.328","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4b1c1301b72f3d80169101ab2a122b80f9e7b6f3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.328.tgz","fileCount":15,"integrity":"sha512-hqAVF1+/ggGnQTK90NrlNj7tvKeSWpO8fwABxRMlXIBt0B4z2uB3y8MnEdVNxh1ei2Lo7yaJwHLq8iQZ+a6Bmg==","signatures":[{"sig":"MEUCIQCQTD0wVKR/biNax9SmT4NU3GEaBlMEnj8nQ8Y63N8GegIgeRXQ5gacVne5NjbG6qpIgxsElmhnlHnvFXeFDxkBXHo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":123151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg9+AJCRA9TVsSAnZWagAAmWgP/2wK0i9L8CQ2q0pjKc1G\nzOFe6bIAPWrVUINvgusjsIHKWEsw+z60aY1SjaHlS4rQZO//ngVMS6UveCSb\nasZp0jkMjzAtw/rMYbJSs3tnIArS1pbLkYHhUoJhLa5rvfySkqkPmPwzU9I8\nmBins64SK5eEu3UHRSv3j+AkaSDGmiBBZBKTkJQkUtdvY5snd1rhF4QlA5eB\n9GPC/Rkra8ZvDRzGttYTwKlK4L5VbMFDPQ9Br6AC3f8RIPcQoQ86hljNzUd8\nHDMTxGdPHZUNHszs7AVuYzCdeXz+y9PXwJVonyn6Sy1IPKl7KdufE+PHrTdR\nRJZS7EDQim1TT/p4p/wJTvzM4SFDhmGeRlg+ZwrfH+xkkfDOtwbPWGQlWS03\njDyC/EUu81UmmVH0GEgD6Regbd5AODOuO25hAHkPdfStgnnY3XXr67CuaNTD\n56rSNN9Ug7HpwSkc/R+4BGi2m/J8bezLf0+UEkZllPd6LeE+Fz5ZRrVDBOxl\nvLyyiQ2AIAw3+lNT5ei6u+TVsylaZdhj5uN/mLs7TlXMuOiE8VVIj6ls4dTl\nRNFO7eJh2fSO7Y8HxOZH5OPxFzvS6/nydFbkU5paWRKriPm6RGUKU3oRy2ny\nv7ABb7bQQR7eT2j4sBIi0/UxDzZ3HmSdF2BNULO8QFKW4kyJeFribl63V/rj\n59n0\r\n=XcTZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"22ec2981ceab3f1a72f8e0d980cdaa5d34fb90cd","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-21T08:49:41.266Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.12","@balena/jellyfish-logger":"^3.0.54","@balena/jellyfish-environment":"^4.3.18","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.3","typedoc":"^0.21.4","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.0.1","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.6"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.328_1626857481760_0.08292926871869843","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.329-renovate-external-non-major-54e3d19cb43faf6e29e7e9b9de86d9e60ca1d096":{"name":"@balena/jellyfish-metrics","version":"1.0.329-renovate-external-non-major-54e3d19cb43faf6e29e7e9b9de86d9e60ca1d096","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.329-renovate-external-non-major-54e3d19cb43faf6e29e7e9b9de86d9e60ca1d096","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8f68e77a097adcef8bcea56edcf6cd2ad1c53a4d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.329-renovate-external-non-major-54e3d19cb43faf6e29e7e9b9de86d9e60ca1d096.tgz","fileCount":15,"integrity":"sha512-PhPlwdzM/Svqhii7jh7avXy1pR7xHFL8LhmVWuBg8Ta0LKofsTKez7oRi332/9rKU07/TNmrz1w0MlcfXlt4PQ==","signatures":[{"sig":"MEUCIQCSQvAVH54fjxIMlNXcD5sqdvwrm1lvnQup4d/zMWRD0AIgZm2AcsokfSFNIzJnLx+T11NS91TERM54huPve0vAfsU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":123296,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+2csCRA9TVsSAnZWagAAgKkP/jB0iYVHNC6tjd9cneBm\nWlTdv/vYp8SlMuSeoRl+X6hZipT3VQfPWpEUHqaEAlmhT+cCMsxfjcV5GxP6\nicAhS9QZoT3uYXinhjy9KzJs0K05ZYJLlczaEbDuuTYpa7FTDOmWbwItIjpl\n8AzrqPSZH1cJiam1dOmpbWfcp97uSSqxVcdaPztfxdYLymo+fsUGKlxgh8EH\nPKqMFKad8n4WCK9bRlQ+wN5+bWeRlaXpLsXzjK30Xu8Vym293TUuDYx9RYzu\nyUvF8ZBynL4HYNGxLCZgZC9NpbRKzOds8gP4h6i5ulhzqRVWp+MMDrHdcckW\nmvJ3mXYo4U23ZWekPJLOy9wj2V7WOTpItZyhBXcZBraKyL/n7mSyGQUJXMWW\nT6KWmXkGo6MBhcIi6FHQHetpNhaeBCh632g3X5j2cZCLKrQd6JyNcV+f7zFG\nsFJplnpeXpJIyE+SMJ+/aihxR0/7ITXCCCGNVlgjVCkb6Cr80MObyYVJDQ1l\nj2RS2yNc39UyNZ3/k8MO6LJXPvt89fdJp8ERNT3PZAQcTZm67avJMyFegqud\nwzkgH3p4N5NeC1s+ao1JynCw1QCKnDchKfUf8X08+TKPJEjbZeDYXxMLTmCL\nBie5Qfa7aGUT71L33A+wcoEQXg8W6/+H+7DSd4k1E1IhtCAsOzu4GVPG2GZz\n8C6D\r\n=OHtQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"54e3d19cb43faf6e29e7e9b9de86d9e60ca1d096","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-24T01:01:12.842Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.12","@balena/jellyfish-logger":"^3.0.54","@balena/jellyfish-environment":"^4.3.18","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.4","typedoc":"^0.21.4","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.1.0","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.6"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.329-renovate-external-non-major-54e3d19cb43faf6e29e7e9b9de86d9e60ca1d096_1627088684523_0.07526806904238392","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.329":{"name":"@balena/jellyfish-metrics","version":"1.0.329","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.329","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"affb6bebd3c6b2ecba88f05a59329170bd6e4def","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.329.tgz","fileCount":15,"integrity":"sha512-6Tk0AsWpfFYfgfMeg6ORTicq8wtL+vkNUzwvv6h+w7JiOdihPJWNuJxVUd/RDiY71mB1ixDNXE7E5RpXnYnqTw==","signatures":[{"sig":"MEQCIBzZ5T958gqkHeCPqUf40Jrt5Z1axWwneOqGsQ5OCFaFAiBPBA465DONLFToTn+hfcPD9RWDq4okvFi0z7aKKYhdbw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":123227,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+2ibCRA9TVsSAnZWagAA+vQP/0Uo90lG6NRfIrD4oY+x\n8N7v98W0clc53HvNsvmric/MiJe722ivwE/OMRjEJc3zItMHzgJSqkmgpxJx\n5or+jGsmLaGpHU46wgMscOno62a5d3nr2CCOhh7lOzD+LajXgOCR+Hr5ZXDY\ngmO95aHD4YMSkY/0f9vQvtGlzU6ww94Dru7VdQWzUUziNyunryhjjVxanB4c\nv5AgAgjbY7naX6wfFj6jQF/3ea/rdCy3Ena1e72KDCOHQl7cmGA5HdfuP8zu\nrr1JW3zAdEPhoswoIUaYnDfMq0c7zmlEgHjzl89uBQ91u7dWqamVgResJiQA\nPN5XNnjsXvimrkEt05ErRirMKEUuCnNVb0qU+q3B81GPpLRYG1Iu9sH+p1x8\ntNqlelVpf8lJGv8KeGXn0d3g2Ga3kgiz9PoWeTJP38YFl3I+L79RZNHvVsi7\n+KY8Sh5zFCqg0W8Z21btcg1ubyzvbz8a0YoXT9odQ9aBlfyIdMPzVnqmaL/L\naem3ZnqShDPDNUROaXZZQE7XxxLZ8ifsX30oOxYHQfg56D3ROpDERECI/DWN\n/4eAfSdAcIzyaQeWZo20xUG30zI5Np7CqZck4YPBK93XjkcGlCBAvyAvczTL\nGNqIJkooYFrbVcIzQsq3YqIulzV0CnF5nFhmj9Uodb8tCU8zBH2G7n6GVD0m\nxrRc\r\n=pt8g\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"60bc52d1e57508038752a6a376fe89f6387b91da","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-24T01:06:56.225Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.12","@balena/jellyfish-logger":"^3.0.54","@balena/jellyfish-environment":"^4.3.18","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.4","typedoc":"^0.21.4","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.1.0","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.6"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.329_1627089051841_0.6356346491710181","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.330-renovate-external-non-major-c60fbae40e926084d713adfb9940c4a79710be9e":{"name":"@balena/jellyfish-metrics","version":"1.0.330-renovate-external-non-major-c60fbae40e926084d713adfb9940c4a79710be9e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.330-renovate-external-non-major-c60fbae40e926084d713adfb9940c4a79710be9e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"decd8891db159006b2370aa3413e3a931f310868","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.330-renovate-external-non-major-c60fbae40e926084d713adfb9940c4a79710be9e.tgz","fileCount":15,"integrity":"sha512-zTcdsZpXsVrBBWSPw1jXhbaDyDVunQ7ALxiVULB2RkYm8aOFs0AmUFUmUHug/M654gF5eLuHb9U/0sE7eP7Mew==","signatures":[{"sig":"MEUCIQCVyMYK/73T4GO7RqSmiu7cfVRT03A0rrylWHY9evegBQIgJgJXjB4uy8BQmAQdQxu8zQReygpsTuAEw5CwGtgr0gU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":123387,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg/AlGCRA9TVsSAnZWagAAMZQP/3E5Kp4DhP4kD6H9Br1P\n4TQxaUgdvkMwhA+mh3DobJ8j5GaNqEK42eKIaCq3CYOi4cr9vYkquw2ZXymd\nF/6cPC58Gvf118+28BlUTsMNuxEzpX0JxzUxQ1QgjgCmZg6komSMljZHMVUS\nrgCv2GcRxRzUICQN1wPiHI98DhIEjycF8vyzWoCKom+9iE4CWjCtII7w1pMP\nZizlV3FRhQSJtQs7VjNDsBz/2WVdIAHQMv0XUMgnDjkLiRv5vKIlErLPoMX4\nKf8MDHK0K0wD/lDVB+ceKKuy9GnbPxTJcRhuQdobnSNpKiQ8Z7QQyE4nxK0F\nF7n/+uXilfWMKv4Zvd39DOPAjNd+dJsZCDx17J6V4/wwIVGwQCZqT6rc/pkE\npYZmJ9nYhz1kd0+AQ1BkTKgm+4ae/wp4gSi+UdcT9a0vFW06n6rpJeWhDp43\n+Heiv970qS2JUKumKH7teUAh3hBRIu0YNkvU8YXc1dA79uadTjjO+0mDvKRR\nqR2LDa/ikqgsSugU71683gRdt5UkPJrkOCTiXos0VehDBx/9r8zK3IMyCLiP\ndbyNpiznNGePjpNyTZE+wsy7cVxEVUtw2Aa98nf0SCBfeMHOSWsyWfulAC4U\nHMEy3+4Ma+NnSAN6qCPfVDovSOERLBk4McuDQo9RHV4WAJKBGIbql+0RCY/y\nZju8\r\n=AA0l\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c60fbae40e926084d713adfb9940c4a79710be9e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-24T12:33:32.607Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.12","@balena/jellyfish-logger":"^3.0.54","@balena/jellyfish-environment":"^4.3.18","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.4","typedoc":"^0.21.4","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.1.1","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.6"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.330-renovate-external-non-major-c60fbae40e926084d713adfb9940c4a79710be9e_1627130182628_0.10392615152101303","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.330":{"name":"@balena/jellyfish-metrics","version":"1.0.330","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.330","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b4acb34d6f030891cf977d6c80076a62d65d4fdb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.330.tgz","fileCount":15,"integrity":"sha512-LwFL1Mi+V6g9QNl0725bueOj6K25M/4NddOXxrXBplPjls+mJqkp/YV897LPwW4kJAru8clg049yrmrPI6ezBQ==","signatures":[{"sig":"MEUCIDKqyNo2sUpWanle17oG4XXI2G9zys7ORoTQpjU9r4hLAiEAgT29oashvSOPBWdhy/5uk7Ol6PvvHKBwABjw8qGxkp0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":123318,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg/ApPCRA9TVsSAnZWagAA0mcQAI1MV99H8W8T5dRRdGbE\nqHYvtLDOepgcndyEAvsvzEqo32QiyyZtZpJag6ohlSF9TuLpIbeurGrCExsx\nbhl+9c+FGPch+JBEpiq7uIctJ9Iykk5vbW6ZFxcaRXbiPv46Wp38LVXkD6HS\ngnFancWEPRVNE/QkP5ClSnKGiaovJgyRi+LJH+uOP0ru+7PZFKfqfYclQMON\nw/gtgge0KuZjR7NMXFQNFOM/Gw6mvTQTRjEN66QpfOe6dU8XdrldnmsxaN7K\nHKPPvMftycfIPN+fupKnJwB76UeuQItYyQKxRxYKN0ykkg2FX89bGOdzHyRs\nIdovFmJxo7/aXgCGwJU5aj5++XRbAGmSGn4+gMJxKbtqE2aiD0jL7XwksFmz\ngRXlHkPfenyCIRVmi4zF/N5+CQy0ePS/Xg3OOnCnSkUwTcVZI1myAirSGc01\naHPC91oqqxvhUmDIrxKvGeHyPadumSZQ4hqU+5YnN9zxNBgJR5TlOoA/HrsB\nwvlDCkMhDSgoHU4jXtuk3cCPhq79fATFj6MigYsLTZKYbTLZS9KeDsgydBon\nvolU8C8obCStv8SywtBFR3BUUwq0nA9NKb9h4cvcDvMuIheu+c0gLuFyvXSk\nnu+cQpzi8mP8quBqaWQsfhSnzPrz8552BFxocU6pJwr+gA1n7eNtqNHNatbO\ndP1F\r\n=a1Ww\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"314be8ee16e2bce5271b19b87b4005de8eb2316c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-24T12:37:31.295Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.12","@balena/jellyfish-logger":"^3.0.54","@balena/jellyfish-environment":"^4.3.18","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.4","typedoc":"^0.21.4","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.5","@types/uuid":"^8.3.1","lint-staged":"^11.1.1","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.6"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.330_1627130446944_0.17731520768660802","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.331-renovate-external-non-major-80516dec99ca5f22a6938d01386fa94f82e06507":{"name":"@balena/jellyfish-metrics","version":"1.0.331-renovate-external-non-major-80516dec99ca5f22a6938d01386fa94f82e06507","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.331-renovate-external-non-major-80516dec99ca5f22a6938d01386fa94f82e06507","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6b8ac6fb0089a60a9dbe3f9c981972ce393d8be1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.331-renovate-external-non-major-80516dec99ca5f22a6938d01386fa94f82e06507.tgz","fileCount":15,"integrity":"sha512-X2bXSF4lGo174avtkezWtfaitVAg8q/c3EcZx8l8cniJ2KdAd95FTfUMqMH/B28RAzjqqa2UgGGgGKF0Y5SNLA==","signatures":[{"sig":"MEQCIGDo8IC7M79hsUnTlkNy7uEtmq5WT5N0uBD/aQMStSj6AiAv7GZ/5qsMzpx65NLOAVXoMhRQYr0+fTtqlAdtCYVCNg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":123479,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg/G15CRA9TVsSAnZWagAAVSAP/1qUw0lD4Cqu6lKSPTIm\nZDdBs+qQX4rOLvZkiA6Sf6jKUMv9F8wTlv7RZNSyXERVp6+lvFITrUAPZFPV\ngQKt7zyY6BHwpkBf4qW5sPVDhTre/VCt5sV3ultniAFsZTTqFZwNmLNGlju/\nhNt/oM+g9K7e18s+2xyM7Bdr6TVZUUoC3KWurHdXeEUDQtVtiXqXfjBLX47h\nDeQe7UUSUKexy2y0j0hS4HxHkToW6gIEALfMGrancouOeejPNf8mBPoCfJDw\n9+GlNciHdjl71CWABuZHyF2S0jp/TbmFiIesVk+VNlyo3oj9MaAUu/ldadri\nNDLUnc49Dy6/q1XbxuHiy2NOkgXHkPEnOWsGVt6v5dfxIdFy8DkOHhER5IJA\n5db69syWBKTRoIPq5E9WLv8lrmmLoj5i4RUR3X94U3lLTxAqdsgEmh9g4VLn\nYP+FOHebnnRu5+2aXyIaTtAVeGgdnAx7giCCOJALZr07gkeuZy1fen+6DYLd\nTSkrFe7QAIBRGVmaENtKzvJWFt6eZ7GR1Hob7zrUP2PBl2kqyF8O7B71dEsv\naR1UtC3+A0ssId8wxRy1PPmW0fLCKKoD3Of5R3CaJ4RQ6vE5c+DM2FNs1SQG\nIGEkDyWqkphbxTNeQOKNQ9xTsWB0sY9Q3CSkbgAOW29KbuURhNQcPHZ0eqkF\nM/R0\r\n=t4AY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"80516dec99ca5f22a6938d01386fa94f82e06507","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-24T19:40:06.811Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.12","@balena/jellyfish-logger":"^3.0.54","@balena/jellyfish-environment":"^4.3.18","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.4","typedoc":"^0.21.4","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.6","@types/uuid":"^8.3.1","lint-staged":"^11.1.1","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.6"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.331-renovate-external-non-major-80516dec99ca5f22a6938d01386fa94f82e06507_1627155833553_0.408728235325563","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.331":{"name":"@balena/jellyfish-metrics","version":"1.0.331","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.331","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e80b6b13eb41fa9f99cfa86dedbe7725765afa6a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.331.tgz","fileCount":15,"integrity":"sha512-zkw3fyXtpaHLrME8D23zV0JJ/O9WvhhHkQaNGQ1V3dOwdRFnXNzfyQ1VGVWxQcv44/9Da2l/eXaC+KEta4Ea6w==","signatures":[{"sig":"MEQCIGrIOTvTwU7pKvyZZOvkHQ4I2sEaXklMjnc+yJkZCyBEAiAETRp6ayHwq3vBsAweTEhY8SlaLO6QhYUdNkridY/zFQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":123410,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg/G5LCRA9TVsSAnZWagAApsEQAJuuK8tBpXkEXByRxDTc\nUdRzFrPbCUFXDu1QQZGlg+SFN0XJV7ariKLU8PwO4MPHsPxH7D72IyiizoiV\nt849AKTNBgkGOAxftQGTdcIio76dCx0B+I2Gal3p5xA0hH1c59QYFFqudsI3\nRZzfgrtRmvirHiSn1GMA4Vz3i2blo9qxxbotfCZKY0VaaooPVHmP2kMa2D5M\nHZHJ3hZ1QOZLAhQU0WqLwIA7BPXyqXGWs0GnqWU8VnLtbGAaZa0slbXgF1GH\n9l2qPvp5rGcvLmtwOAHONUF+19wuxJrvqV4iIssuq2TqzMUquMpqNPRf7IAB\nOAVd/aFnD575+mo0t/7FQAKZIIUl26frE6cBGOiwdcn2O0ji2rwyGx6hwfyS\nmYCi2GEybWbStBAYtOWCuAPJ1Qy38cXLPUgKaCcXRU19ulm7eBuQjuaaxby+\nWOdKVlWcBf8OGQwO7rhf2tdnPP6t5QjUFis/PsXq05fn2zRnTK4e0BS7mUYH\noZzMiEHuZRUBOEr0wF75+UYw4WHfeJZmwlkX0DxINadzZ2urUZFEg2qK2nkC\nL63Eu2KgSBe33rk7MSaWxFfJIeF1MjTqDcTofEAySTW6uCZxjDr7FVsMjtza\njGN4OCXgbObpamjS2eU0U3m6x1pacqENLsCP6xTqHg0Do0TXQRmEVLsF8CdN\nuH+s\r\n=+7f1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4b43fdd36eaaa538718981cba8322de1482e689f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run unit","unit":"jest","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint-fix":"balena-lint --fix lib"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-07-24T19:45:41.697Z"},"_npmVersion":"6.14.13","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.12","@balena/jellyfish-logger":"^3.0.54","@balena/jellyfish-environment":"^4.3.18","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.4","typedoc":"^0.21.4","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.6","@types/uuid":"^8.3.1","lint-staged":"^11.1.1","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.6"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.331_1627156043723_0.11784509370189822","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.332-h32-unify-script-names-eb1cad74237f06791080f5d4f4139f4bd1e9b975":{"name":"@balena/jellyfish-metrics","version":"1.0.332-h32-unify-script-names-eb1cad74237f06791080f5d4f4139f4bd1e9b975","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.332-h32-unify-script-names-eb1cad74237f06791080f5d4f4139f4bd1e9b975","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e6a7a703d17f7a61d3863a002dd452899e3567b5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.332-h32-unify-script-names-eb1cad74237f06791080f5d4f4139f4bd1e9b975.tgz","fileCount":15,"integrity":"sha512-1mO5C/9sSujFBhtfSsrn9h5SzIr3mfsoVTwAxGm2lg4jrphsB3Uzrj6UlRyuW9ANeYaJ1zGbLFSWBcdrusqEFQ==","signatures":[{"sig":"MEUCIQDfi1Jxmmh+y70YorGQ+uBESyKINHTOy52lHIEbZABiLwIgabHX7Ji0L2d1QVTMAfuQyVXY/EzI8GsJ4Ty1PmOpu5g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":123573,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCxmACRA9TVsSAnZWagAAwv8P/jpIJ14Yfwn+g74+x61x\ndYokJlMHSKezqIEim5GLJeC0h8HLBEevIJLE/8dhVm9ahBv3n2FYrsLjgYvx\nZwKDAZVhk9GHxfnjePrfiHplVOt3TKTcxG7fN0CrrPkRmcgpV7nGA6qJsizO\naRR6ksbfy7DdCqowXOvQKQQ+tctJ+EJRuOl4O9URWBzIdbZ+TbNnxLsbUg6n\nl+fkLEPHFtwSAS1F9FfQakv+WpHrdRbE9CPLk2aEOWkYgzmdxdr2pQskyXBp\nE8TXNHnzX1PMvUw2ACXsM1WevXgolN6iZbZBrWE+jAJAIEicng1dwnTxmHq1\nOlojIGLbkEj0C09mvvF0u8Jh4gF1aSXjmaOhoptYd4gGTxj3lo4JxUId7dCZ\n69Hvys9dhDExpEojdQoqwYQ+TyTl9xfV/gulV2jWGNxiCXWZ/pFC3BkX3FVu\n15QRs5UjqPRV14OZ5K+icaCsAqHsA7tJL8PR5Tqqp+8M1AQmZKojkIYQEYtb\ncRMOHOIxXchlFEgIeCIoWjOlqOCXkLjwZekc5K60Vc/DrTdmkQSmQSNvoQWe\n5vk9zzf5h2FNP961BKb1+E3bDCGBHP1AKeJrbMII9GRPnOxAtnn3aAoLlY8w\ndC8wxDzEge6AS0WDZMgGiDOy8IRG1bgBp/au1IFKSIaZ6Qei/LCPL9YzFJjL\nBAAX\r\n=+oM3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"eb1cad74237f06791080f5d4f4139f4bd1e9b975","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-08-04T22:46:00.345Z"},"_npmVersion":"6.14.14","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.12","@balena/jellyfish-logger":"^3.0.54","@balena/jellyfish-environment":"^4.3.18","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.4","typedoc":"^0.21.4","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.6","@types/uuid":"^8.3.1","lint-staged":"^11.1.1","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.6"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.332-h32-unify-script-names-eb1cad74237f06791080f5d4f4139f4bd1e9b975_1628117376310_0.5704506768295117","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.332":{"name":"@balena/jellyfish-metrics","version":"1.0.332","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.332","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"736aee67b484d6a8516f14be8b64ff48fad627d9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.332.tgz","fileCount":15,"integrity":"sha512-cGtfU4b4sivAzrhmtLnMtt/5FhP9hJkO+v4tQ2Y6iYtFSCaCIigmXYDpVbAAC62+i4hMb6MWNb+D2eBEAbyQUQ==","signatures":[{"sig":"MEUCIDyhS+QhKQF1IxJoOphedA1/8QFuiHPTdVJkRihyawK/AiEA/y18LEAFB5W54W4v4ti8xZ6Lj3C0qDN3s6rdwC+tzd4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":123509,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCxpmCRA9TVsSAnZWagAAEy4QAJw7hE11sjnXTihxeNeQ\nh0uGCcWqor8B51HiSAOdO+El6R8oC7qhIv8WE5CwPcr10oayanJKZU9yf+Hc\nr3YfjUgZY25VSzDBTfmBfU0VH5L11T/4Y4CJb7bqpQh5HdGa4jV/UnYHf6fU\nA+1YYCH210lozrbO4jByaZKIg57lgHv6Sv0MqixoGi6HIDkmdlzfcgUV2s/0\nWAmxCBHxu4XoYMGWWSmYluarrnbLiPsTb1INO8Ec80tHzpkp/gE/e81g9WhY\nKetV11pCw+85SAi0JcN1uVa0x71rmHY9N7trmE2poTsXYgYZZSt0GHJi7bfo\nFfbqtNwTRaznDl0lNQLS7iwHlweR4FuUFlkrSGALcGYBS0UK9WZvAw5vAhGp\njjtRVX5JZdFcAmD77Iijaoz+1URJugd4Mp6G2RquxTw+QrQQI2tUOwusvlPc\n2Q66XOcLw0TgXXc0uWEK9yZqLAadf//dr+GKvxhnBOjxGMvFTDzyAJ3nn4V7\nM3jX1GSGURJjFnOhhCbdei7k+c1ucwacykl/XBFLQW/8IhRhCncBE+1CJj//\nmO4t4SpP1yw40X5Yf6Fktto659pfx83FIr4PHeABNLOphWUfKBr1vnJErUJl\n07Ne3UCQxjWyRINtaIfY1dv2ZpBLny6uXeFM+72Y42QAE8YBGWcvpmcwf1zN\noDII\r\n=sG+8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"724e53e780d1bc0f9561aa0db70bcd11a51d1aec","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-08-04T22:51:43.686Z"},"_npmVersion":"6.14.14","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.12","@balena/jellyfish-logger":"^3.0.54","@balena/jellyfish-environment":"^4.3.18","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.4","typedoc":"^0.21.4","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.6","@types/uuid":"^8.3.1","lint-staged":"^11.1.1","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.1","@balena/jellyfish-config":"^1.4.6"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.332_1628117605936_0.8657906904977275","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.333-renovate-internal-patch-17e327d65d360bb8133b8167d87dfe6ba76fb2da":{"name":"@balena/jellyfish-metrics","version":"1.0.333-renovate-internal-patch-17e327d65d360bb8133b8167d87dfe6ba76fb2da","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.333-renovate-internal-patch-17e327d65d360bb8133b8167d87dfe6ba76fb2da","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"aced23821b917dd37e88c1dfa176396f954e99a7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.333-renovate-internal-patch-17e327d65d360bb8133b8167d87dfe6ba76fb2da.tgz","fileCount":15,"integrity":"sha512-NUHggrhUm/S+IoEPyQoXqiJe/gE4h7KEVLwDfgnkQdqFVehZAnvpkomxjIYB0YXMY9tt9il4wQflgeglIz1f5Q==","signatures":[{"sig":"MEYCIQDCi0q/tt7eu9GubP9OiUBxBp7GLAHqLRm14h4hsObONgIhAJt4Rhjk/MLZVrdAiXUulLcvo06zfOJn2yOVrzSVuxFc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":123646,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCyk/CRA9TVsSAnZWagAA2G8P/1O6xmjuFx9vxPJuorhL\nLcFbv1yM3FRFQkWsqQr5UT4Xcp/52S35EljCi2uxa+yGeUcBrgQt9gsgOctc\nzKHsqZ2Ie/TUQFvirSqTNzP5mpE+xZuUIREqs2ou/mWbbmLmmP1MLhqeSgaP\nWhEIg+iO+x6XiKJO6t9/J6cYqzWeQzfXOgUAacuc4TDcorFv5Mzzu788zd9s\n9209yCDiW42s+klvOLlj1/GY+XR7ZntYU9bqqYZABZ2D44LwahXTDEpv2mKn\nGr6429ddGRq5XA95uh1Gozy1Pu9swBBX6OENOaCWhpfDOHeiDcZyfqn6wMJ6\nx/ojPb/pHfwgWdpiaw9D5QaT3q6NGHQUxAmXXs9l4EWxp3urr/m+H7dzwvsW\nLR/k/mDUt1oL+WLmJejQAEikYMiBYEbykO4p2EhHlthnkcWGsYskaw2beHKv\n/Q/tyVKzuYzldkieNcbkXKcOW/jZwsPEukWXXMYHzj/X5rSsBxqg2YJfYs5G\nfyYYTDfi+kvGaW/OcaftUZ5Hg7uFptLszYoxYgnjAZvdTAEChtdtCts+f8ff\nwqlK3xzy9NLgMXk2+pIP306f4HcN6nTIxCddAT4LAJZz6tZ5H4uSIUYHIUz6\nVkCTOTYGmuccpVdkinZF3kPPOzPH0HXkKyptnyb7UFoG6cIDXvdgs/tz6GAU\nzwIz\r\n=NaMz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"17e327d65d360bb8133b8167d87dfe6ba76fb2da","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-08-04T23:53:32.712Z"},"_npmVersion":"6.14.14","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.13","@balena/jellyfish-logger":"^3.0.54","@balena/jellyfish-environment":"^4.3.19","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.4","typedoc":"^0.21.4","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.6","@types/uuid":"^8.3.1","lint-staged":"^11.1.1","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-config":"^1.4.8"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.333-renovate-internal-patch-17e327d65d360bb8133b8167d87dfe6ba76fb2da_1628121407396_0.4412466334572729","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.333":{"name":"@balena/jellyfish-metrics","version":"1.0.333","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.333","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9f18f15c0c6c874b016d928b894a3384ea86c036","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.333.tgz","fileCount":15,"integrity":"sha512-bbrrIgRqEdQZibpeeQXIchnDBaCCHu6rMU+B1f/3nkAkE9t3Qc9EAhpMRxT0Qz5nNxZnFHmPuZaH1I1hXlzOsg==","signatures":[{"sig":"MEUCIQC5dZoR5Wqeqcy5to40mtcb7sNYzFoqVWdSf/Np1tGdSAIga7AYaOndqHHJ9GF1PH6gNzFRg99Wav7VmiqJqn0y5Dc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":123581,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCyo+CRA9TVsSAnZWagAApNwQAIhsOjLdpWY8e4M5EYYy\nvXLbZjYor8D/L0t/5m4AZzrZtdXZ9P6Vm7ygWRRb5P3TZ5yVMhRelTUBT34Q\nJIxmzEJFva6/BFLuMTfVlMv3UacKOlg59BcTGKdC4Szt1OS84mBi+ebKp8wi\neqrCtrRiID/004oB+oSkFjhUUuNwG1VOVHOB6jgC60LoLcbi0YiUR5gaq8ga\nNW3Sral5BGqsaGfiqeWXXOa9Wmbj9pi8q40HVm80oe2J8gD4HPJrnEp7613L\n9WVu7V6rsIcJl8B9Td8J5h+pZEPDtvNcJdtodTPj3+QhSOLX1U5ec4hdMlP4\nGSnuUpY2pDrmTQ5T0ZvTHVXbHsBcoRETNCaMZm9Y7+XykZ0y9JELl2VP5CXl\nLT7Sm7E/yEcqfeZVS/VDCB+gmp7h8AQmDg5W9ahx/bdiOG27R01Vur7ghDR0\nRiUr3HPMCmtNNDZw/4DskCxVvB3NRjfpyABIUkvehz87uW0DirHBOSfJb1Iz\nwWfz1rjfaX5gbFQKgMjgf2FW3pIw8x8uhY0iKJpk6KNXCjww2ErfPuzkLE4x\nBsNcuPNTxVxmwhmb/glH+f2dBYaH6qBAMpSkjTLLXhwyALX3waYd1hNXoEar\nbkHJNyeEYCzTCDi1J9+TVd8wVeulLLiDv0QNe3qAhZI+JyvYwL0TOEBGCQaV\n6Ktb\r\n=KIMO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b260eb657d80333721bbb480b512ab0f5b6f6416","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-08-04T23:59:23.635Z"},"_npmVersion":"6.14.14","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.13","@balena/jellyfish-logger":"^3.0.54","@balena/jellyfish-environment":"^4.3.19","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.4","typedoc":"^0.21.4","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.6","@types/uuid":"^8.3.1","lint-staged":"^11.1.1","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-config":"^1.4.8"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.333_1628121662746_0.9878072086200833","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.334-renovate-internal-patch-f6b3a81266e31b7c3070bcc719da00a97afed506":{"name":"@balena/jellyfish-metrics","version":"1.0.334-renovate-internal-patch-f6b3a81266e31b7c3070bcc719da00a97afed506","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.334-renovate-internal-patch-f6b3a81266e31b7c3070bcc719da00a97afed506","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"de5c65226f22d34c9a05e537bb1e47622ccb8a33","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.334-renovate-internal-patch-f6b3a81266e31b7c3070bcc719da00a97afed506.tgz","fileCount":15,"integrity":"sha512-LrZIQie+il5uWoM2/MJk85Kl+cAiEX+TbrHdVW/S0SEWXcqqIdm6LEzgLVde7FWdVTGsz99BHTeDTZ28M3Zncg==","signatures":[{"sig":"MEUCIFIWav5/9qErgvDIfRzPPBJWMnkNp5MYmzC+vBMFSDoQAiEAgX+EkLh7ZKd946fCeiYej1DlKdXOqfq9flvrQHrE0ag=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":123750,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJipvCRA9TVsSAnZWagAA83cP/j/Zzy3Q1qymiuntHb5J\n21SuiPvzrHvNDBscB9TsEE9OZoBV32Arc+rScoMSIvCxXDDeZk7pynIFGarF\nNsubTQB5iV/s2Yk7V55+2QxoMpO7zXa816OZp/eSOzSQfsvoqBdO4qntwrZG\niDGw3sLmwCil/F4BumZO0ZG5U2DfZbSx94YwgXDVqB5m39w1czfXf7srEpJp\nCZD+VrsXGhSP0/ZR+AlTP6HocTRpCBUhQp9F9QC7bG8XTPrUII0S7gFEI4v8\nxsGdRlgG4kL6UrsZrL3UOpwuYw6RBG9qIHgBcdDoG8SG8qmzYH4t8/ZHvs2z\nd7lgDI/ImnnGb80qtNybALq1bw0LqhnPFDf7825QWeXfKaQ7qXmY0h23Ohjd\nhKVByGq73D74bTuDq7HutOsbqBPLnBO/H3hWjgist2uEVS8QcWuL3BLxAHUd\nNGtxnjRUWLm1yfp2fJlj/JtBIvyuleBozy99g7W+7Pmt0Qh0FZ35p2SHlYfS\n+Mm3+DMs+JJgUX4oEuhfPgpglYPiM6JdToLLkMhyaShflzD8FuRnYD1aQ9RC\nImIc5dcq9rb2K0lomvnxfIAx+Y4dzRQLVryMkscOAeDxQF/CRa0w3ANxbzOd\ngrItlCoMw9aH9itbacndO/NrONXzVY22oo9pSF1K/rshF1QZVJm3724VaE7H\nltqw\r\n=gio4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f6b3a81266e31b7c3070bcc719da00a97afed506","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-08-25T11:30:30.994Z"},"_npmVersion":"6.14.14","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.13","@balena/jellyfish-logger":"^3.0.64","@balena/jellyfish-environment":"^4.3.19","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.4","typedoc":"^0.21.4","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.6","@types/uuid":"^8.3.1","lint-staged":"^11.1.1","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-config":"^1.4.8"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.334-renovate-internal-patch-f6b3a81266e31b7c3070bcc719da00a97afed506_1629891183310_0.4733783359898154","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.334-renovate-balena-jellyfish-types-0-x-a2610b33b50e700af48d169afd88b227b09e292f":{"name":"@balena/jellyfish-metrics","version":"1.0.334-renovate-balena-jellyfish-types-0-x-a2610b33b50e700af48d169afd88b227b09e292f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.334-renovate-balena-jellyfish-types-0-x-a2610b33b50e700af48d169afd88b227b09e292f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d60c1bc2f61cc61842d1e8d3c3ad10ece8741996","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.334-renovate-balena-jellyfish-types-0-x-a2610b33b50e700af48d169afd88b227b09e292f.tgz","fileCount":15,"integrity":"sha512-Md7i/xXuGzrO8SuIfYK2kaqKnTWKm1b6ipF2L2SUhi/F7DvFfaINW2zKhS/vjBYGZcl9giCFFUg0gJHNx3Wjdw==","signatures":[{"sig":"MEYCIQC7ncvI8ux9FGl54mR0T/nfRJk5wSrCw/b8D3fLiLhhOQIhANDeUypwo51oSL1YKbUCoHF0KiOEjYGn8p/S7tHWp6a1","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":123759,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJiqJCRA9TVsSAnZWagAA38AP/1E5yxVBDcR/Neeeg2Ac\noCdCzr5ry7Qtpq9L7/w7Y6QSS6Ky8BP7cJpkdjZs9fvTHUsh8cPgNyTiVSSs\n+dQ6AWe+o/fMMJ+UqdK8QBuAK4HlWH+eiMW10pkr7t81dcSJYHNoiERwpm9w\narUEfMkYLLZd+zvzYFlLad6RdN8aXX0Yy+yemR3u1BDH7Xe3o75OYtnyO3R+\nQyCavcE5gXwTAl6e8uFtrc5JjIYOSo/XkIsyqQt74e5Rs+pyQHqtwWRNRMjE\n3JKy1PYuUn4Vnd6daHulsakb5VnCKHLO7g+gl/M40isjtXTdW/cZQCq5Bj86\nj+LSFvcbnXC07SgEnn5occwhB33QrukevspGFUWiIkaMfh8Ck8codFuFSjWZ\n9P1NC3RiNHRyaeQ4qAh2yJlwKDxxKjpzaK+kQjM/8svioG+0ZhPl+/SydlIO\n7TrIhYJYXthQskvMGocaT1/FDSlPZUpE2bAzIy7ZdsRLTgDBNfcMkzQFc/8r\n9T8XF6XIsPtvp6cqVxgo2sGnvVpuZnYerqWGg8SJwi2QC6pSkDIKs7ckIN4d\nUC+uOnFtxyAt66cs5rdUnNh69oYM8O5CRcbx431EBtUmx7c2b1i+2QM5RVJJ\nZh/oMn3dUJ3cYVeoOEgikeXShocwtLxRiLaq4e6eq/AHkW5aV+r5FeHGvlPH\nZ/mu\r\n=/SRX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a2610b33b50e700af48d169afd88b227b09e292f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-08-25T11:30:21.726Z"},"_npmVersion":"6.14.14","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.9.9","@balena/jellyfish-logger":"^3.0.54","@balena/jellyfish-environment":"^4.3.19","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.4","typedoc":"^0.21.4","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.6","@types/uuid":"^8.3.1","lint-staged":"^11.1.1","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-config":"^1.4.8"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.334-renovate-balena-jellyfish-types-0-x-a2610b33b50e700af48d169afd88b227b09e292f_1629891209652_0.08292459201406333","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.334-renovate-balena-jellyfish-environment-5-x-50c221f148afd2a02e16552b52497a754825c55d":{"name":"@balena/jellyfish-metrics","version":"1.0.334-renovate-balena-jellyfish-environment-5-x-50c221f148afd2a02e16552b52497a754825c55d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.334-renovate-balena-jellyfish-environment-5-x-50c221f148afd2a02e16552b52497a754825c55d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a68fc6da5f9aebb9d45ff4ad4d7eeb204fb4f913","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.334-renovate-balena-jellyfish-environment-5-x-50c221f148afd2a02e16552b52497a754825c55d.tgz","fileCount":15,"integrity":"sha512-ChfF/GqUkOhnj9rC5Ht2NRrDBuLpt5IsCTD0Kjw1lDKEF+BOwq846mIEqxd4xMzNQHNSI29WWIpOxW2c+A92Uw==","signatures":[{"sig":"MEQCIGmYiRgF4jagS7VonN3JldtAFUsmY55W6uQ7kFLrnqO5AiANy0/FRymDe4vmC5X2wfTSB9tSZPvdTOAbJ0do74nHGw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":123767,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJiqaCRA9TVsSAnZWagAAms8P/ju2Q9u2QWxHfjpvhKe5\nmJdSH2iPy5y9SwTxzhrA5o9lxInVClmRoKZkbnFCh0BwbN+q/Lds2RiyfBX1\nbghbF1nyHzNT3xXyLkgqDnbTH3Bc0rE2bRJcBeR5J/KtKq+DsSDM5XSmjFDK\n0SK/zZOlcuuxyRV0wqaGsnJYt9kRKc4d8rOGTp1fr+YYIh2ssz47RrBpIdF+\nhmiroMi3StczEq8ZrDSplv8F1R7P8ONeU+37u0xf+RYyr64HaaLbdBQMoUws\n97TRsr5p4J1vydYm2CCcNu2H85cHNQJ/1wJ9RCLz4FwxDnBUgsaCbGk69Y+Z\nnL4ezfDiY09kVGoNqW/K2bvYGIvEqbWyh5EE3VXDbmr4mcpiVNbAh1d++qGW\nrtFJndcda675Q4xsUiU5oKZEVE+n09edyTR7MKkfbpf1gZ8CJYVI5EprdO6Z\nh/VkauqvUocYssTNEhVslq2h/VZKhDSKYmrbI+iqDCoxyp21i9B3IIb6GwmD\nZLn+SR9dIeh6t7r50HVC6jqndQszFvs2q/Qf67dTK46WN4I711BzoNwbHdKu\nrqHmC5fRgW497hyP8zvUbhyOlbV25OqydYtFbNAU1kH3bu/cOps9gGd0rRx3\nvhPoisEwJHUIfWnU616A0bKAgGIA4nRt1N1nnpOlP+Su410bsn1jmDWaMqox\nEnHU\r\n=3lwW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"50c221f148afd2a02e16552b52497a754825c55d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-08-25T11:30:52.053Z"},"_npmVersion":"6.14.14","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.13","@balena/jellyfish-logger":"^3.0.54","@balena/jellyfish-environment":"^5.0.3","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.4","typedoc":"^0.21.4","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.6","@types/uuid":"^8.3.1","lint-staged":"^11.1.1","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-config":"^1.4.8"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.334-renovate-balena-jellyfish-environment-5-x-50c221f148afd2a02e16552b52497a754825c55d_1629891225802_0.9484888480697731","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.334":{"name":"@balena/jellyfish-metrics","version":"1.0.334","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.334","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"80ca1cc027a181f61c2595029dc6739b1c9b5c44","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.334.tgz","fileCount":15,"integrity":"sha512-AWpS6ECedwhWXsau5L1U3g0WrS0topQl6xfQLvH7rX0ALdhQvuiZS9uLh520tZNkX2OXQbMAC02AdcmVZ3Pc4Q==","signatures":[{"sig":"MEUCIEp8i0jYFpLZ/Qds9/jJTMkb0zCgJv9JCDjkKn6uL8LgAiEAl4vSSH5CBKTeXxkJGis854ug0YU9yiog+O5UqSDAv9U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":123685,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJisqCRA9TVsSAnZWagAAIl8QAIVfSOy7SA+ct+gpiU+b\ngBf1x09OVQQGUDJ+9a+qVTFTss4mw2bfWesSt3EBsFO5GYaXwFHCUW7GSEdV\nEOo2tFEjMW9N/HDLaxONMj+PeAuDyW6HQaWfGIPdd8qwnRx4LlyJHOARm7cw\ne5BY96t8Hujplz68ApNQXmiIT3kE8/P3EDWVrwgFVA0MmlsVX2tuRfImFcRk\ndEroT4A0nRGtYHszPSAObs9cU8oAQqE7ypjfaxyohqAneriaGcTnaI+R2tUO\nO4T5/uuAsSuiI5NkMTkpzoZnTmyjXzQtcfgaold6U0FHZ879Y2dbrIrmzcPT\na9Z1HAhIS7/Fid8EMghtMc+AdIlqY1DR++g9pF2ydE0hTzeI1vQBakXHF+1d\ntRUoC+aj9jOqcAjHUR48a8Glwx3RJYqrw4aV60SlCgjMibhQLupIyVPw/18m\n5lAXkMkzNQfbMiX0h1WGl2XgNSh1DMsuhrUwg/lMEe1By37i6KuQfaZTv374\n2zPvBe9g7RUp1kTp3uzKp7bAl6vfxmWchjoAe/SW48o9meXH5hy/0zZrz93G\nKPR1qZxCEheqqQ+JjBjVcWWuGKqSlZP+XuRVIUnEU+B78MwjvoFKUAnzfpy/\nfSFAiIOmLXY2ZA1gCqxVp1NTgg6PdvX3ggZxS966AYuGIra4opWJ7NBrvgWO\n5pnp\r\n=aCMt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ee5f90c566665736d494fbf1052bae56b5f83301","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-08-25T11:34:07.292Z"},"_npmVersion":"6.14.14","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.13","@balena/jellyfish-logger":"^3.0.64","@balena/jellyfish-environment":"^4.3.19","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.4","typedoc":"^0.21.4","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.6","@types/uuid":"^8.3.1","lint-staged":"^11.1.1","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-config":"^1.4.8"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.334_1629891370658_0.2056070217832835","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.334-update-renovate-config-d8564d683f404aaf4b0b71f985318d56da581ec3":{"name":"@balena/jellyfish-metrics","version":"1.0.334-update-renovate-config-d8564d683f404aaf4b0b71f985318d56da581ec3","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.334-update-renovate-config-d8564d683f404aaf4b0b71f985318d56da581ec3","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"45e1209f89ef2aebd593cafe4a3c81cf1acf6ad5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.334-update-renovate-config-d8564d683f404aaf4b0b71f985318d56da581ec3.tgz","fileCount":15,"integrity":"sha512-/pFHmQ1QWkxP0D8fyQ6uSRRjq5bSDnF2p5OeAswAQKNAEzCYrmbN3XPJ9qTK4JcoJr6w5gFqG19gCI7lVjZGnw==","signatures":[{"sig":"MEUCIARHxxiuN2o8zWHD0f9hi4Wlf4PXBEJHL4YJN255bSLLAiEAswA5Nm1dKPtMI0ivkUGWgmdoni72EVvboIwEw0NHB4s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":123732,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJit8CRA9TVsSAnZWagAAKL4QAIod6bIcpM0jIncXgxBi\nxm6XVCw7y4DGttfIqAVJGPckXOprZXdzl53BC3c3X2vDm3HtWlFGiNGwiwBV\n9UIzJVxWOtbDjrM2m3ZljbLCqbYkvC4MmZLaUGGoW36r/23uycGYZeWuemHk\n7mhT/vdYULDahsqJ6nIxhqraf6sMIX/OJ2EC8lcEQtEHRf/ZfYKBcvVtaAlh\nespgqVsSWr1Q9ItN4k0cjr3O4zJnZFKgNQ8OYr4mriXsT2b/3u8Gt3w/T6TX\n3/zjbjb9HaAroXcQfZ3lFi7X80as5ERRxz6JXrXmw8R5n7MH8GNrU7zddjUp\nO9kEPVuq9KXmsItA6mpaeCHACUpN0tlkfrZRDDotpZcysCa4HwERoGowgmjV\ni8UsB6uOV6M1CE9N3z9lcH1/jlAfeUvnpxSX+ANorPORdfr3sRgLjNy5nm2d\nwBr16gnnJ3T0ye7/bdV2AWwXrZX0cjyJEnuhi05K9mLRPEhQaovHfBNBZABy\nswxEy6K2oQsBc8b1nfnc4e2DtSH0vCgwK5MRrgzjEWlbne0Hh3wf2Qy0w7yz\n+M7wytC6XXTPoEkLJ8UuPI5UqmdWI+eCuxuWPez0ck+8djtNU1F1pDLEZ7Wj\n7uXdpWofRbBs/eCIlwCrNTixhNZPjLJ7qS5d4DNqG2F3yYCuM6X1Hwgw1Bk1\n1di9\r\n=huTM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d8564d683f404aaf4b0b71f985318d56da581ec3","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-08-25T11:34:30.939Z"},"_npmVersion":"6.14.14","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.54","@balena/jellyfish-environment":"^4.3.19","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.4","typedoc":"^0.21.4","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.6","@types/uuid":"^8.3.1","lint-staged":"^11.1.1","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^0.9.9","@balena/jellyfish-config":"^1.4.8"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.334-update-renovate-config-d8564d683f404aaf4b0b71f985318d56da581ec3_1629891452155_0.3331297306790557","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.335-renovate-balena-jellyfish-environment-5-x-017a5a8f321026b80b5fe80b4d86bf05916eff74":{"name":"@balena/jellyfish-metrics","version":"1.0.335-renovate-balena-jellyfish-environment-5-x-017a5a8f321026b80b5fe80b4d86bf05916eff74","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.335-renovate-balena-jellyfish-environment-5-x-017a5a8f321026b80b5fe80b4d86bf05916eff74","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1357dce7a66948929530798cad0f6052e8eecbd1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.335-renovate-balena-jellyfish-environment-5-x-017a5a8f321026b80b5fe80b4d86bf05916eff74.tgz","fileCount":15,"integrity":"sha512-jn+tzjToD5+eJaM6zXbY9Tax84dqffC6QBspIFy5lHk7hi0Yq3hy+toPvYjfwwKcbBE07DYHFMjghCt3GHTnDA==","signatures":[{"sig":"MEUCIQDU1rpXE7IJXcG7OlmF4Ag6rFSB/PujKLQPxKFC4vP8dwIgb9OsI5Ex9gbIT+l2JjTrH7YUrokMy9AajgeN1K/QGvk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":123871,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJiw5CRA9TVsSAnZWagAASeQP/RZlUW7C7xjNpC37Hfh8\n/WBVmsG/PEoRlHz+/tD8sjADGDW0hJqAGN1BpsT+C56SSK+XZ0h0RwDK8RSP\nJaHmTmXB8JAp8ZMnuUw6EqMVc6kTagjYZ5udPRfUH8ptFCN4TrErsyWcfgFY\nNoBqDzZTiFU+9NA/MNXov3u1qrj6he+xFdhvedqXSgqxRim0LKe/Yc6Y6Qsq\nNUeOsnqq/IieXvQf7SLPgpywbCTqnP5BKuXaZbIh1gsM4Wtf5PEELpUqCxr1\nbqbsf0LbH6vbUcvI2umxRqQL1PVRewkRNZe3HCZ4DUtmfsSJqAp6M5hyOBVo\nF7cU/Rgwuggh4EU/3b3bjacKP7NYHrgCM1YsLv1xq6WAktX2nYzbnbgUGbBv\nAya70udgKUE43d48m7CCwFdBA4IDN/k4hwXh+H+4duCnz+yFr5ZWDyiiwiVe\nuC+uFxw6P7b/MGv27lmu/j15XdzGkj9Co8WT7rmkKttxqwCin0zncXlF43Vu\nmwDodFuRM5qaF6v6WbVeXlfPeg0mFx0N/LeHFaSu5fTdfWCrffRgQtIEc37U\n2jV7fP78IraFMWTeHForA4Sv8s7D8J1675nd8d3FdBKrs1ZeyYJdd/xifV9S\nPzWUQTVwpYgWXhEFmgRAuEcSE8hS4F/mADRnR1NybxcTmcMEHPoiaAb6BfDW\n42UF\r\n=Zuge\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"017a5a8f321026b80b5fe80b4d86bf05916eff74","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-08-25T11:37:21.115Z"},"_npmVersion":"6.14.14","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-types":"^0.8.13","@balena/jellyfish-logger":"^3.0.64","@balena/jellyfish-environment":"^5.0.3","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.4","typedoc":"^0.21.4","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.6","@types/uuid":"^8.3.1","lint-staged":"^11.1.1","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-config":"^1.4.8"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.335-renovate-balena-jellyfish-environment-5-x-017a5a8f321026b80b5fe80b4d86bf05916eff74_1629891640917_0.22360801582827783","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.335-update-renovate-config-943a55802fd966d49317b5d10fd622ce5a363ba6":{"name":"@balena/jellyfish-metrics","version":"1.0.335-update-renovate-config-943a55802fd966d49317b5d10fd622ce5a363ba6","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.335-update-renovate-config-943a55802fd966d49317b5d10fd622ce5a363ba6","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"421ed82c44a116f3c1dd21756f7bbac5af6bad41","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.335-update-renovate-config-943a55802fd966d49317b5d10fd622ce5a363ba6.tgz","fileCount":15,"integrity":"sha512-b0uj1CWDjJfFLyyteTawgFPx2Yjn0GRn0CrqBcHZU7frOse3Uk9A+gVHwp3DbtsRCW8z4d6EgCfPE/JFI80M/w==","signatures":[{"sig":"MEUCIEwzkYSwIlBxiHfT3dTgzQHMINvPamtLnXtkrzc5cgwwAiEApYoKDOknZtcw4zA4Oh3WplSeILq2/ty3rqZW8G9lfMc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":123836,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJi2iCRA9TVsSAnZWagAA11oP/0i1c4e5TSYWyEdKg9Vt\nxD2yY1MzOeDdluRAxPayGJoA62TMs1vqL/udyG0ijYTHQiKIFDI3srSL9/Bw\nAawXIz2k5Q2L+awSaLsYQrp/VkE0he7cS8Uw7FDiAFDLRvW3SdHlekuaZEv2\n9+UXbhb9W+ycGz7wsslzNwvH7tFXOmPGYqyo1BpegxdfXrVmzxjos+H8JVot\nI79UG1kyI+D3p3n74kFLXWdIKLzWjAMSRI0wsnzyvC0leV6Ji3Z4eSgmaDZJ\nZEjsmDTlZdGfINUBU8sgmnB9JhnzEn1+SGq8DU6u9j3p8E7VJDJzpNf97FF/\ncI2nP3M3H57XXI/2zGN29PGZF9/WmcLVTyL/MddBQvl+GOKKTCSPrGhJTTU8\nPWg7EZSisF6MlOq3YzpU9lh8ji0l8gyO9O+d8QAYjGFydD112i9rxl/z471M\nCYBWt6jCs8eGiaUx0ZWwpvMda6PALv3CAJOC8uNXt0wKvVrB+8VUaRLYuXhP\n9qs2QlMIEPgdrEsNO9+L87a5fbQtmtEXOF5wFA4AwWL2Vxzpp8CEWBpSe7K5\ncfjyxsXwV0UPKmn7EmbXm843zLQkUywfNwlS2yHmu/FWMdvtjNwsEGokI2pd\nXYvZ5S2/0l9Yk8QMOXmDfNJ2srDQcUJgLWl5OWAK/eQ7nBYnLWC3d/H7fs+B\nSXRG\r\n=VLnd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"943a55802fd966d49317b5d10fd622ce5a363ba6","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-08-25T11:43:51.510Z"},"_npmVersion":"6.14.14","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.64","@balena/jellyfish-environment":"^4.3.19","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.4","typedoc":"^0.21.4","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.6","@types/uuid":"^8.3.1","lint-staged":"^11.1.1","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^0.9.9","@balena/jellyfish-config":"^1.4.8"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.335-update-renovate-config-943a55802fd966d49317b5d10fd622ce5a363ba6_1629892002411_0.7068030702806372","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.335":{"name":"@balena/jellyfish-metrics","version":"1.0.335","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.335","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"369de9561aa4f951edad0504e20db12a489c5625","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.335.tgz","fileCount":15,"integrity":"sha512-lxA4zh9zkAlzlzQYsX16YPcxdsc9EIaOx8Dlt7hMXP9uLzo/imI5JovXRBUhSow0VjBgqBvVR3UURCHfE9NELw==","signatures":[{"sig":"MEUCIQCEKbdMHm2weYFCcktISRjavhObj6EWAq3zyvgmP+eFDgIgLS11akWsSLTFmstpC2HdlbIJtNqqgF3r3bQP3yaR5lI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":123772,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJi5eCRA9TVsSAnZWagAAuwEP/305dKKSpckysHyu8BNy\niww06xBQ8GTMH6eL0GaCcPi3mDvFL0xDVos5ZEt2o1cOM68goEDZ65lz/v7h\nYsSF0ToduFnLhVJ/vhRHCQBmOtYx5wE/VujbQaataNg3rQGtJ8lAy03YKuEJ\npyFi1A44hC4MwCe4THw+S0PWrXm1Nu3zbfvpQzrlfQFd3T2CXlAaA1nhFGnh\n9oANOx3YO/D/ac/DZjbUOm0Wfh6CFjBJyr1x1bzd6jP15SW6RJEX8o1liUgO\nphFwYd9ocw/rH5qm1PX7tCah2T189nFE3CyTP0Rl1ryYOGyetvI8v2fxTijG\n+6ZD+maURqtqJPW6706fXyiyLnQi/+FDbR6NzrZwZZbIoXJt+StAt/hgrOpw\nc8+oXNRisTYyoI0YweNq0yeisxi7lttrzjoryF+lueGoQrn83CuO6flXZLzf\nD+lFuoukqNlt0GykxngwsSf38qVtG39n+qOLGbnnuS7Cb06vn6+VCWDOZ21L\ntAZlFv01o/JJlksiJqGzFD8NNG8G+SPJLWH02UtkxBNnTIu5Ybg2hQlMqfFg\nyPwSbHZzoOY2hhYq9tnRPqZpet/Rvy7Ikw8OqiotRFWtJN72Z/BtbuWlI61L\nB8dDmUwcDO5r8hJ+ns9bs+QDyfHpTWvvcVF7lBKS+sJpFt/m0nD+dLYgrXpB\n/3S7\r\n=CGQH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7c18907e4eba44495d9c9c6804c805d6dd47bc9a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-08-25T11:48:11.352Z"},"_npmVersion":"6.14.14","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.64","@balena/jellyfish-environment":"^4.3.19","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.4","typedoc":"^0.21.4","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.6","@types/uuid":"^8.3.1","lint-staged":"^11.1.1","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^0.9.9","@balena/jellyfish-config":"^1.4.8"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.335_1629892190325_0.30831483533024495","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.336-renovate-balena-jellyfish-environment-5-x-e376025cb7f03726f73789ebbf1cda869f75ad6f":{"name":"@balena/jellyfish-metrics","version":"1.0.336-renovate-balena-jellyfish-environment-5-x-e376025cb7f03726f73789ebbf1cda869f75ad6f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.336-renovate-balena-jellyfish-environment-5-x-e376025cb7f03726f73789ebbf1cda869f75ad6f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"94d7ac6aa8ebf0ae0026fd1865acc5cfe444fe4a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.336-renovate-balena-jellyfish-environment-5-x-e376025cb7f03726f73789ebbf1cda869f75ad6f.tgz","fileCount":15,"integrity":"sha512-FtEE5mhHCOvIK7v2YjfUhh+ruPI1VcePlTeJTFvKq5vpdAsygx92VYB/50U8LiyRco/HbTAqewee32OKMAff6A==","signatures":[{"sig":"MEYCIQCvqhlQ1y6TnmXY6hhVE9xibDFQs0eSyYI/1kNSNaKEMwIhAKsPqKklFPNsjWGDCrko6BRWg8m+8PH+CQKKtkDrWyNA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":123958,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJi9ECRA9TVsSAnZWagAAmwUP/iCrqGrIWduoLNV+B6Qw\nqKl3OZR6/UU3rVC5R9S0xYF+YU6bi43oyhEl9Kpwzy+l7WQNBZhtaKMWx/qu\nk6E6iP9QgIRA0qp8iQavyzuK/ESBfcPHFM8nsNfbEilx0L7NxUf+0SwI+1Qn\nwAr96mqsFIryTtRrrCnFmPoJtRiL8CT5h64G5BYetOH6Fke0VUuJ89yLd5qw\ndqAe/krMfYJu49Wv3s7/Pg4qXHNyWe/ldMFmLdFI6boU4U7nXdw6e7Jxjj5e\ncuNZ7HVSH3vPNz+VmCPz+D1l+US+VbDRFrVxOIBM0IkCLdQdfljrtfNqEShy\nsMcjFqZW3BAYoardmtm2uC95i1dFgvu5ybl1k0Ziyo3Q4KZbqZaLzdgP0/cI\nQFn/FpcuNB7WsD8Wd9BU1SlU8iiiEQtp4yMKGIHV0QBLopaGxzwokgl/GwLF\nrmljo16Sxv8uOe77k+d43w6bDdmylGURWkxvbbCqbvuzf7O4QpomyXWQSf5X\n92+EXao+e01TJVUJUEpRggHw+VqASGC7D8E9Y0/P33zOC/uV0AmKV5BFZhRr\ntLa/tsHTuJcwjBaCxazqk+pcvd9NifMZ79QRPnawxyNdx9FAYoh/uLIIhGkQ\nizZO32zByER3c+V0qD8d+763TVnW2FdY3gyhzQeEAeqNpQpVoVoRAn3d7uem\n4Sta\r\n=222c\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e376025cb7f03726f73789ebbf1cda869f75ad6f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-08-25T11:50:41.105Z"},"_npmVersion":"6.14.14","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.64","@balena/jellyfish-environment":"^5.0.3","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.4","typedoc":"^0.21.4","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.6","@types/uuid":"^8.3.1","lint-staged":"^11.1.1","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^0.9.9","@balena/jellyfish-config":"^1.4.8"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.336-renovate-balena-jellyfish-environment-5-x-e376025cb7f03726f73789ebbf1cda869f75ad6f_1629892420513_0.35682724494540863","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.336":{"name":"@balena/jellyfish-metrics","version":"1.0.336","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.336","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"35c32d877348575b32429e86c40dc912118781c4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.336.tgz","fileCount":15,"integrity":"sha512-XADMCPo3ZDiA0PlLHKFMEYYyl83LEmLm9xhMllxt4vVrQgyQ85tKAluMzXfjpDUFsFrYddugFJ9cV8R/AfyckQ==","signatures":[{"sig":"MEQCICr7sMfNKgEqstS11c+KRgCCrLbnNL+92zyaFyN1aKKIAiAruUFV/4TlAYksUpghjb6gUPC97wJ3WFXeHafdo0EKAQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":123875,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJjPUCRA9TVsSAnZWagAAjW4P/1sbX3BibDkFJFPEOEBf\n4PM1vN36yFBP9g4rZwHqXErvXBOR178of7yLwkVf1ckOYYILrU2ulwdQb0zW\nOPf/ULWjhXIIaEtggOVD+ni93Kv3I/5ra7Oh3Yjs2rjssYdQN8wK9mzEwBkd\ncWqEhzo3mQt5rUw7oWej2I7KIe1BxmYJtOBtZugkYUAIZw+GK+uUebyLohhv\nrFu184KxP4XTI+nCtuR8wEtzUcd0yl1n8SZwIr8sq6st23MzZre9WHnVbfB1\nvulVypV243Sh4zm0KNIhhaKepN7CqcGFi+RZM97Gy/EW9L6zCt6JuHmHfYQw\nE8hwz72VZfV24882T5orRqeC0j9OYQGRf/fXTsixMKOQaRu3PwQWVyMbANTS\nsg4AvinMfSAqk3S3dOvPhHpCFMM6Q08n6sF8+7xgEEaDbOsvLk0p5kpYSI7v\nigdlaGBCbcFSDaX36v3UIoCyr8O/v4sdPijh/vOzit9JJdgg80gOalOeR09X\n4jI3Wl65JDV+UwHMS3N5Ww53mDHB4ShJRSkxIWU0fXqFu+QV03jiEOhjr1Pb\nkDcOY8cm6w8ZKL6GRK5DjNMAX3NIIcGTGeL8Lk69zNXgNu+oE3yudKsyA2Bf\nlru9SB1JlSyAkcrTBQw0yVf7rIxGD7k6AXczAv+W+Akqm0tBWBlDWxJkUlqI\neE5x\r\n=j6qK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ac14d996553e9192ea85fc1f4a8d953ce73fe019","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-08-25T12:11:30.895Z"},"_npmVersion":"6.14.14","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.64","@balena/jellyfish-environment":"^5.0.3","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.4","typedoc":"^0.21.4","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^26.0.24","@types/node":"^14.17.6","@types/uuid":"^8.3.1","lint-staged":"^11.1.1","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^0.9.9","@balena/jellyfish-config":"^1.4.8"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.336_1629893588399_0.6431896222381355","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.337-renovate-external-non-major-3ae501b5036c166bf073bcce2c06998b195bd4f5":{"name":"@balena/jellyfish-metrics","version":"1.0.337-renovate-external-non-major-3ae501b5036c166bf073bcce2c06998b195bd4f5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.337-renovate-external-non-major-3ae501b5036c166bf073bcce2c06998b195bd4f5","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e7284eac00e31f441343f99b940a6ad5270fec01","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.337-renovate-external-non-major-3ae501b5036c166bf073bcce2c06998b195bd4f5.tgz","fileCount":15,"integrity":"sha512-qA10oBBaks44zDDJWzK3tA291A+FncHciGsaZD9HDtUdz+UQlGATa/UijyyfSdCcxzQcHC8RlCBVtWqxid4ltA==","signatures":[{"sig":"MEUCIQDlE+4dbrC1KyzYsl/oB3cYSEWxK5NWjuZSExzEqnucOgIgb0/Jzt7liAf/X3maf7eDiXCOaJEiRiQNirV8D7zmLeQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":124161,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhKYliCRA9TVsSAnZWagAAyAoQAI+KoLK6Vd6zByBueHHi\n2XIsDC9B0Nw33mK2IHAJCI21IS3Te7QOqYOJqnFptUp3nn1w9Uqrxq26iEog\nndo0bEngoIjcdmfHmAYES9w6N+erYKxzutMjTnI0qze0rMMczW90Xe9jpVex\nnZ4tI8QSKGaDZ9UyYpPEh0N/Z0dgcAHNNe13+Nnakdwnf5iyh733U4aeoHLW\nZxDc45NP6sWjSMs2dGXDwJSWT303Zs4SIq3gw/V80dbh0WobpTi99w+UTegp\nQloIJT6vdYA+aRM5AhmZAW4i95GWI4rJn+r0JUUHAY4jadPwcm1fPfGeZ9Tt\n74nmB7zPmPkEzGpmOZWMQQGcDMW8O/i7VfS2rnzmhrbPiEopKTJhjTyRLKhW\nrKjylFsPVcNWIcecUs0Q3XbjHW/OQJ+0KFgBIbvDratLasP0McmFtIGBdDIK\nRZtEd+o2SUnl9MFenTzVTztqd3Pf9/D1ZgaE105YqVfr0Jg6HFxVtJttHOaj\nstbfYGE1N1lsnPk+fWpvYCJ0XnX/Ya8RQ9KVK1pspaNdTtAxHtooPXoXYQNJ\nMIvXHqaaXW7SIqFwbyzaMc0ZY5c5upkr9Rm07IDdGNa9CeyVgjX+fEekE2Mk\nzKupMqICksy5HUELPHy7N2kXyZnBSAxsXmXnrnjFQH0Si6BQFtWDR4/iAv3Z\n382w\r\n=y5le\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3ae501b5036c166bf073bcce2c06998b195bd4f5","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-08-28T00:52:11.441Z"},"_npmVersion":"6.14.14","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.64","@balena/jellyfish-environment":"^5.0.3","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.5","typedoc":"^0.21.7","depcheck":"^1.4.2","typescript":"^4.4.2","@types/jest":"^26.0.24","@types/node":"^14.17.12","@types/uuid":"^8.3.1","lint-staged":"^11.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^0.9.9","@balena/jellyfish-config":"^1.4.8"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.337-renovate-external-non-major-3ae501b5036c166bf073bcce2c06998b195bd4f5_1630112098803_0.18182163349731173","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.337-renovate-major-external-major-7a53ffb51db4b4ee3ac5eb524c3bf66c89b19394":{"name":"@balena/jellyfish-metrics","version":"1.0.337-renovate-major-external-major-7a53ffb51db4b4ee3ac5eb524c3bf66c89b19394","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.337-renovate-major-external-major-7a53ffb51db4b4ee3ac5eb524c3bf66c89b19394","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"88c91ec7f159ba8be523719fe41ec46595b58cb6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.337-renovate-major-external-major-7a53ffb51db4b4ee3ac5eb524c3bf66c89b19394.tgz","fileCount":15,"integrity":"sha512-SIugkEsSenn+iu7O1WUMTw4EhH0Hf6QwQlNov2uLggG5RnwFQ5S+aopw/GDZ7ke0aBIbkMBNoB6/uBSbHjbR9A==","signatures":[{"sig":"MEYCIQDs+QzI0tzLJ+LKiokgTSAfPy3ef2GyK9/Ei8ayInv35gIhAMfmB+qGWXzmm0cyiVbbvfTv8wFuCjvVGA/XrJHpsTLA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":124172,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhKYmhCRA9TVsSAnZWagAAJOkP/R6NzDKFZOVT9xXlpyLc\nQavfjfiCdko+wHEwYyAuftl/96SB1S00N2U8NeZ95j9jOj7Pj/dx//gwaaUq\nUf2spQ2ZIsELeNNo5GJh1ooNVShRBPrHciPLQHUaTHgmYrkaJ4lPhP2LyEKg\n94RrXVfETNemSxMxX44WeSY74TsjLTTL6vzT8vwZuVjWT+/JqOv3JFiuWHWJ\nGV4wjm49KRoXFlgIw1jDZ8G2t63ShUsVbwWsfKAVkw0rHcepf7YGyaU29ZXc\n1aujHCkbT/y9ZuPvg0w3eL8XjmlW0AdkxxLCTDi8FLrnFvnvvxc6JuVqhZNY\nsQHWYw7pfKMxXEc2BeNhn1JFPTx2KbWOTcvI0puglG6NMQzNly4Ob7pQhOjw\nP5REE76i+0jofq17Xh/Xj3cgFNSxSLMFH/osk/SnTxF2uDMu29I420QJbiqz\n78fml6/gjapzda7g4VtxyIR5lQv8z4BVsPzlHb18Iw+SA5mIu7qu6L3qErwe\nmDw24Subcl7agLKZH6FzVR7ccJpC9fw0ribk7Tq8DKExHUaL4Lda+T9MRVX+\nyRYFV0pQ6RwXTrakAjL/pK/l3Ud7dw1uNEcl3wdWyNtgNdpdSDDBwA5MrKal\nc1KhfMX/dNA/mCgPMipUtajjXN2zOZa6nqXWa8VMzTwNTJ7HfnFs8+sd7y02\nmWDz\r\n=F6Lz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7a53ffb51db4b4ee3ac5eb524c3bf66c89b19394","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-08-28T00:52:31.017Z"},"_npmVersion":"6.14.14","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.64","@balena/jellyfish-environment":"^5.0.3","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.6","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.4","typedoc":"^0.21.4","depcheck":"^1.4.2","typescript":"^4.3.5","@types/jest":"^27.0.1","@types/node":"^14.17.6","@types/uuid":"^8.3.1","lint-staged":"^11.1.1","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.5.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^0.9.9","@balena/jellyfish-config":"^1.4.8"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.337-renovate-major-external-major-7a53ffb51db4b4ee3ac5eb524c3bf66c89b19394_1630112161707_0.06626137159634649","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.337":{"name":"@balena/jellyfish-metrics","version":"1.0.337","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.337","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2f4a53673bd851733307264a9b4f626186de82cf","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.337.tgz","fileCount":15,"integrity":"sha512-TMRcEo+7JcX4aW0Mcy0rwVrxQC80YV/9jkmr5MMGJsXWl0ZGcO5vYBrHxKDT6Im3Pt9pnKEhCa8hFcyqM8pjCg==","signatures":[{"sig":"MEYCIQDUuQBjiskO0PVw8YotZ8epuNhXm82F7Xkke3az0y+CjAIhAPDkgQWfDH6sT/AIL4DIu+88TPwF5DOxDAdHQjPe5e4X","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":124092,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhKYpnCRA9TVsSAnZWagAANrcP/iee5w4InsLMljx1A9eh\nUaT6KyGfSO1X4ZhHW/gPmv/YfQk/Jco3GwcvxqjUQWwpeGlF+xBVymY7knil\nnZMN0+KUg/yDGqdUYqk1VN/q0VHbnKFKJuVhUDbmkWo6/8FqCxSXYRrBzbpw\n9YvUFxu/NvS/l5xI/hhcT0aRKL8i5x+TKulzAYukn/j8iq49B7k3s+KFZpSE\n4j5LK8vXD1vVZnFBCz8sgTQJNKcGlOu15SvyCecp2wEG59vJGv//aE2B3oec\nZ9B1Qq7Zue2lUwCtQysm+dUnz2AikReKOMeF79EuvZimsOIztsui0kmHzPF0\nr6VMrjg8dA7KG+7YV2kkm6YpOLWpiAXyjiw26bNxsW9A6mbWkXOKS7v6WGty\nr+l3l1mlu5ld9yWIafqaV5eN5myeFXHXSGay4drbCUP4VJ1uzb/hvXVkgaCN\nvfCJ7TqrWSYp+41reegJDTjUp/DnCQCjiyrU0CaLkMrd7O50C1RX24yq44E8\nSQ78aRWal4oTHF+g/XDP8eqyyj8uU7Cx5Iz4nsfQdf3lX2KS2NyIX08FXgvp\nQJOxBfFiKn5oG7CNCPbcVi4K7tC+GEcudXfcP6qK95yTPCoCgmVdHs/DZP1v\n1lGkSC6B2vmpFog8gw8Xn2ZR4jSTv8sgWhjhwFpZci1lEMgKF6BebL5WU4yf\nhfHy\r\n=Rggr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"89ef022a56566521a1f914cf96351ca8db625907","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-08-28T00:57:03.053Z"},"_npmVersion":"6.14.14","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.64","@balena/jellyfish-environment":"^5.0.3","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.5","typedoc":"^0.21.7","depcheck":"^1.4.2","typescript":"^4.4.2","@types/jest":"^26.0.24","@types/node":"^14.17.12","@types/uuid":"^8.3.1","lint-staged":"^11.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^0.9.9","@balena/jellyfish-config":"^1.4.8"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.337_1630112359031_0.041316897733474134","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.338-renovate-major-external-major-63a14e90978d66dde3aba31a0de43c916f4efb4f":{"name":"@balena/jellyfish-metrics","version":"1.0.338-renovate-major-external-major-63a14e90978d66dde3aba31a0de43c916f4efb4f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.338-renovate-major-external-major-63a14e90978d66dde3aba31a0de43c916f4efb4f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bfab7048e0661caed47b40c96b7590a3130fadbd","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.338-renovate-major-external-major-63a14e90978d66dde3aba31a0de43c916f4efb4f.tgz","fileCount":15,"integrity":"sha512-WWMj4HPB90Q+B8DqQOVIDEeS8FqbfAM7gg5tKyAoKXez4ePFNUEa0HnjHrAAQYZd9c6RnLUEAWo8fBueHs+Oaw==","signatures":[{"sig":"MEYCIQCLcsZChSXCEvt6V0oaV+09VaQcEozk/DAWhgPnjIIHNwIhAKdl3hcnqLVvbJWZAOg0mqyywsl+C2Xz1KYmVRoSosM4","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":124249,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhKYsZCRA9TVsSAnZWagAAXyMP/1lahw5qcqWxg2Keo+yP\nDUEjP4g+xmaYmSzmLMSNf50uR+sQ6o95LgL24JRBTOS6n9KecIVVoYsbHTqt\n1h0E4jnF0ORcGicJRFdTKWIXg6UFrCRhMyvOYlZkx2ee8JvF97j+RAj8qywi\nj5UPbRmBeRmEOAukiAf4xxV8NmaMlp4MC/PSZlRt2IM5IfXuS5pjJGRZr2Zh\nuSSoSMV+o5RqYC9v0OXQz++RdguGgj+rx82cNND0S9ZWY3xkNXB/lZBK3ch+\n1cJl2X9s2RtyGgjGGCRUl2pM1/JMhOpv83d7S6kNfPThW4exAcvEfg1XitwP\nQT/sYUjGHOYOVuI/6QmHPVhn/MyLJm3p5mUISj9OgxkKujtDqc/LgF5jm2jT\nlFJhijjKolv3Z3jgjSJkQh6EHemcq2YYPu/7YPePHeRTV2FVlsHigHtzcTPr\n+oZq2Tj8Tk6C6hnryatRWJrbS4CMcOlBeRJRQ1jGO/HXjhG8LskoisJIt+gv\nb5SsrgLGw/+Oi4717yM6dsp5oNsqHY/8hWT4LvBJjCChZ/oI3Ouy4xXEH1Dy\nzTz7pZK+GACsT0kTJRsp206gLN9dTRha4kmtt8+k1Iu+ZyLDULB6n+A2P2sK\nB0pLWJmGCEBim4sgYpMd0DyIw0SultV4Iguamkdc3793otau5/QnfqP+HQ7J\nhbsP\r\n=tKqD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"63a14e90978d66dde3aba31a0de43c916f4efb4f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-08-28T00:59:31.656Z"},"_npmVersion":"6.14.14","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.64","@balena/jellyfish-environment":"^5.0.3","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.5","typedoc":"^0.21.7","depcheck":"^1.4.2","typescript":"^4.4.2","@types/jest":"^27.0.1","@types/node":"^14.17.12","@types/uuid":"^8.3.1","lint-staged":"^11.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^0.9.9","@balena/jellyfish-config":"^1.4.8"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.338-renovate-major-external-major-63a14e90978d66dde3aba31a0de43c916f4efb4f_1630112537199_0.7142806159081498","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.338-renovate-internal-patch-fcc98241809e068562c6dd50e1ba17fb842e5741":{"name":"@balena/jellyfish-metrics","version":"1.0.338-renovate-internal-patch-fcc98241809e068562c6dd50e1ba17fb842e5741","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.338-renovate-internal-patch-fcc98241809e068562c6dd50e1ba17fb842e5741","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a34b1a9cec5043092defcebfe143b8f48486ced4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.338-renovate-internal-patch-fcc98241809e068562c6dd50e1ba17fb842e5741.tgz","fileCount":15,"integrity":"sha512-ptOav+k1/WvvYLsBYNQQcCA26Uy6swMjVVHe5vIiIcxkJV36zgepwYMukXKMEXhpRgrV4oXtiJ1UXSkrqyDV1A==","signatures":[{"sig":"MEUCIQD6elczpLmxZXbdG5gJWM/Zw/Z1cfexxiqIThniHTBawwIgJhrLM3vsQyV11a2xHPbk/JfZVgSaUmAD7yDyLdl7FeA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":124261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhKZ9KCRA9TVsSAnZWagAA888P/iax52KEBVsc68RWIEW7\nXlyqrSB3nNod7A0TiF21u64VCnSR7S9xSH8Mgt/egDV7oluffc7B7Olq3ARE\nWnTs2Wx0uzVk8GszwllVtkMygzOFEoO1PsfKv/wDVFuMUTUZEshj1yci7+EH\nJFEg/tSRAxiy3VRvxTmR01ORxFUvpZUGNcmwNjBfUN3ryerrfRsXU8hnFQ4i\nAcDBxYlHn7Y9qqpxONV4LmsC6r89PXrwpR+ya10bp7ey0HZSgla1YPxgJxPE\nx66pGatrSwEnNUeqr0tmIUoJDfdK8SfH+D9/EhEGPFGmJtmnAhsNk41FARRY\n1oP9fKzAE2tsWr+gE0ShTgahni4MiK/3iGCi5QswpTd/swUHOxt0E/OoRHs+\njPogswWvjEt5ygRkzSYkJ3h1fF5aOki8d40r06kMykakTJLJEPFqVqN3LwKL\n6ckCESBLneOaezinGrrStb1cVo3tAelyX2vEXha6+Q/dnD/BXbxH/sGnsx/8\naPG3PrhP1ZyN6qP6nLKKNcQ9H/TcFSiAS1dHWgPk26Vo8mYp7p9SJgRPdnYe\nymWJLpQo+7Et4CJbkqpd/gtMj+cEnDy3ivdQxaHXMznfbnjk0b/cf108E0oA\nPfYzKnI22UakGt6S0VW6tnHh/k9ReBkrSovGJON9OOcKckHnT60cQOAGFG9z\nH1X1\r\n=RE4i\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"fcc98241809e068562c6dd50e1ba17fb842e5741","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-08-28T02:26:11.933Z"},"_npmVersion":"6.14.14","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.65","@balena/jellyfish-environment":"^5.0.3","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.5","typedoc":"^0.21.7","depcheck":"^1.4.2","typescript":"^4.4.2","@types/jest":"^26.0.24","@types/node":"^14.17.12","@types/uuid":"^8.3.1","lint-staged":"^11.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^0.9.9","@balena/jellyfish-config":"^1.4.8"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.338-renovate-internal-patch-fcc98241809e068562c6dd50e1ba17fb842e5741_1630117706461_0.5297622079111544","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.338":{"name":"@balena/jellyfish-metrics","version":"1.0.338","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.338","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"45e632d483b37a1960bd88d7e25890371e93d35d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.338.tgz","fileCount":15,"integrity":"sha512-qM2vGu479OVX0FcEZln2xgMcygNoWK23L2pwF2lzkiQbySSkXBB5tJ9SU0JFQgFiW7HTc7ZqhKHSo+1gj3Mn0Q==","signatures":[{"sig":"MEYCIQC/5KdhMgYbC9gn74Lkl8/IP+v1XZsuH0Va8sPPyirKcQIhAK0+uYUTRqt8pALB88YzLTZOMoaL8gk7DKjnrF8zg8cy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":124196,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhKaAlCRA9TVsSAnZWagAA9D8P/0+No+pZ1cX5J+Eg1LuL\np6YgNd7zOAfURIGKN0jBbO86xpmzZuGyERd4V7OXJm2VsRAObtmIv1/BT9d/\nUC+uqc27N+XLAoU6SZ61kAvnFJ2I4W2GOUuaE/s1GAVIAJ8oKOn7Zlil5nfo\nFf9Dg3CuUiqgv0GY3+uLAdKproKHA6SYqx7wXt4viSoDQmexYgG75StcldLy\nTaBdB2W83eLqTRNy7N8l2CEMnLAEQu0aI2A2q9saDOzEbvfo6wOwr9hgQd2Y\nApcpnE8+G4B09Oss8AETozav+H8FSRfODYWc7qWeC33/s50/3gp16IF5jYE+\nLHVaMb48k0rrQSf+ajcKHDeab0Mb2qH5fMYpXT8vo2tSGpiP0g1RNtkhDCKe\nOqBZ3KAHeQ3mkpvOfqVlkebfkZ1gcaFxK/EA+reXIBE2R+jcipfkwxTE2lw/\nKjmIttxutO21BqrhF3FfKD/nyLbw5UVC+pM0AOX7RASEVSJffJwNOrkCxwdz\nMRgBsUPZNXgGK2WLIXDZIRbgbs03pJeGX+2hSYPp0CZToGNE9ytsrCx/8xLo\nTy2F+ujMaFHddHoC4er5uzuopMYCBFYT/cQju02ArdmIJfbRxuuvYqAsHkQf\nzPu27Jr5/fY/ntMf4mD8OEEGQiCxSNNX83ot8ZQFX42bHmejKItHnAU36Ond\nGzpQ\r\n=gHZz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"617eae6dc159d4a29e532fb556b365e1e4f77d02","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-08-28T02:30:20.999Z"},"_npmVersion":"6.14.14","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.65","@balena/jellyfish-environment":"^5.0.3","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.5","typedoc":"^0.21.7","depcheck":"^1.4.2","typescript":"^4.4.2","@types/jest":"^26.0.24","@types/node":"^14.17.12","@types/uuid":"^8.3.1","lint-staged":"^11.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^0.9.9","@balena/jellyfish-config":"^1.4.8"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.338_1630117925550_0.6201516442370592","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.339-renovate-major-external-major-2a28b9757983a0097240e9412ad01d778e17e19e":{"name":"@balena/jellyfish-metrics","version":"1.0.339-renovate-major-external-major-2a28b9757983a0097240e9412ad01d778e17e19e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.339-renovate-major-external-major-2a28b9757983a0097240e9412ad01d778e17e19e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1b20bd5b7b91e9bc7621be1b2baebf73851b7b47","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.339-renovate-major-external-major-2a28b9757983a0097240e9412ad01d778e17e19e.tgz","fileCount":15,"integrity":"sha512-8KU7R2IU3Gvj4ToXmzOHs/wHdHJTZIykPCHCyT7rC7NH1Fk9meU55LEnvdL5D8GvpjUii6HCw14EVQh6j/JzSw==","signatures":[{"sig":"MEUCIA0sN/Rs5JRd2uEsrCoTahXfZ642okFXZtuYhdFVfziHAiEAuxdApHm0byfsOQgNizM+k5Bl36S4enwT0DVhy3P7BP0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":124353,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhKiUwCRA9TVsSAnZWagAAaOAP/3i0ZJM63CQRJRrVAqxB\nLNy6Rs+W6hn+8YLPtZosNFxVTrwdSVRgU7m8Nn17Yjogvic8z4gAy6LuQsIr\nDuo7gVWXqMxCBJvoNpyyKmzS+P0Y0vuUrLGi/UjSRvb5PSg7N/AVH+Cco3fa\nRKXBVXRkxKyzPnFUG0EM7F+1i2GIuXHzCd+wv/RVCWRUzeOoOSoh6qeeN8yh\n54FTjaS6mSutwcTvhkHC3jRsJjoYnJloSjvD/ecwoFy5GlUA9mjqYUY1mI+6\n5R47pCUqf2z/IQeHw+7ib0TeDTHLjGKJLQMgVH7Hqu932Hgz/FEbh9OoQpO0\ncnF86ILgxUu8mFlZyrab0g0T62ucs43qfylTnrHJfq33le9a4Jy+4U/KrjsZ\noSyzq9aVYDt4k1FHNvfduw6GnE144wquAdxsD/nkG0ZhxCLwXnQEMR8wgpRx\nx0pc+0oSFB13zGp11BkfTZJpITUV2um/OPTMqyPsmQdGPlBU4NI+I71zBIXH\nwqNfjmVklRm+6aWz3Vsu9zISEWV8+jxqLLYLpR1rrb39KaNrRILOOWIS9zOS\nviwCrzQl+Y+mbrwwn2NQpE3iqfeiZQySuehGyaFrEYt6vPB0qH+QWWynszRk\ntTKlXwzZTt8LQLwDQbjktVx4BS2ybD3mAyT9oMiR4jqvaQcxXJ3Y9u+Gjcv1\nvl7F\r\n=rzUq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2a28b9757983a0097240e9412ad01d778e17e19e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-08-28T11:57:41.697Z"},"_npmVersion":"6.14.14","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.65","@balena/jellyfish-environment":"^5.0.3","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.5","typedoc":"^0.21.7","depcheck":"^1.4.2","typescript":"^4.4.2","@types/jest":"^27.0.1","@types/node":"^14.17.12","@types/uuid":"^8.3.1","lint-staged":"^11.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^0.9.9","@balena/jellyfish-config":"^1.4.8"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.339-renovate-major-external-major-2a28b9757983a0097240e9412ad01d778e17e19e_1630151984316_0.2852105579201849","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.339":{"name":"@balena/jellyfish-metrics","version":"1.0.339","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.339","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f241948381269110bb671e8106d7379c92f88d95","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.339.tgz","fileCount":15,"integrity":"sha512-zbcC4alDv04IS4Nuh5yTYEDz3a2Ngrdd64Dhmj/gxTV+II3r568dDfqyNhEgupctbI5uoJnScwsR1svBiEP4IA==","signatures":[{"sig":"MEUCIBhtV2exSLwVVrIipnjl92tqhloVaMextJuNu7mUembmAiEA8e5dSYICRKThTuuLEAAOy9nUEg5BdTsZqW311chiVRo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":124282,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhKjBSCRA9TVsSAnZWagAA8AEP/2YBHtcmqYHjHLpMfiMc\nY4nqR1WpU1Ff4hXPWZ19DTYWvdB3GK7vw6eZ6r0hgIhQB1zVG2IyIaKKTU1o\n7t57/T3pf2JWy7I84PPosruw/8TJLtCiaSP7VmxqrB8BVhB10XvsJcto4l2x\n9iFtQ3yfD8QpW3BtUVBW7d3+Gsg1Hkv1clX11EmED5TU7mmQWWoJBP2po1YV\n1btPNApPuhpqSlqejD056LOcGlP4eKDkG2RCawKGfyLvIzgx9i79F1eFU3Uy\nwlHeB7phqwBrsVcTJv9Q7MrPauVlzHXURXRsjx4HLXE89QpV0iHjfrrCWdFN\nh+y4LyjRr6vpOoLbeA+OfKRzMaI4NSbnODBl8yvvj+1KK0V53QnrHprgnVbB\n2qMpN8bHkkxqw7brAacnyo844MjI965/IjLYJSVq4CPMbHQF5VL3590aeret\nIdshaEXIq7NnPqllaCYbHzUB7as12086AqeJWet2IlBPi6WcMmUbcZyj9auD\nSaKIFGPL0mpfauzGg2CVTgcLRZDvrxF2t6CBV6kO+ClFa4gwQuVAJosPvkmj\nkBHlUEYyx1yEdfRawVnI+cjjTiL/U9PTa6zlzl90IE9dXr6S6KkXNQk0eb/T\n9TW/XqUlYjglXVl9YEX/OShehiKLoGgZwDx+6FeJW7CVQQGCAy3QnTbyWZDz\ng9G0\r\n=SAbi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"50fa27a0b9b659ce8eab648391dfab42774704e1","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-08-28T12:45:05.026Z"},"_npmVersion":"6.14.14","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.65","@balena/jellyfish-environment":"^5.0.3","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.5","typedoc":"^0.21.7","depcheck":"^1.4.2","typescript":"^4.4.2","@types/jest":"^27.0.1","@types/node":"^14.17.12","@types/uuid":"^8.3.1","lint-staged":"^11.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^0.9.9","@balena/jellyfish-config":"^1.4.8"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.339_1630154833978_0.7466397717767792","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.340-renovate-external-non-major-9e3ba793a05adf42fdb55ab4fb1e86bec901aae3":{"name":"@balena/jellyfish-metrics","version":"1.0.340-renovate-external-non-major-9e3ba793a05adf42fdb55ab4fb1e86bec901aae3","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.340-renovate-external-non-major-9e3ba793a05adf42fdb55ab4fb1e86bec901aae3","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a90e0530144a796006df14e127078f34ff595a6c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.340-renovate-external-non-major-9e3ba793a05adf42fdb55ab4fb1e86bec901aae3.tgz","fileCount":15,"integrity":"sha512-d34Mn0np6XY4NIDeX22H2xwS4RcyY9zLntp7x9WBeBboSetGwrO0WfFl4LjCKNt6CtuB/LrDkgXQ3RJWEMYkGw==","signatures":[{"sig":"MEYCIQDLvRh3Pe2cMosAjRjEIZiKIbRfG/BQLMSw40gNvxll3AIhAIYDN2ByQrR4giOW4+YUMqj5NqcgcUh78nw1rHEHY30Q","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":124438,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhK7YgCRA9TVsSAnZWagAA6dsQAJ5B0N+RMwCi98PhoZbU\nx3hcZc/GIKVaeygFbTBg95PUY8D1CPrnSokPAFsybde2SSVEfK55jPmdKP9t\n9BVEdOnor5WMtMf2P9lzVIkhBJrvhiECmM+YB6bzjxnR8Bw3tw5Fwm5TaiZ0\nT/BRBLfCwlAIHgc2767DZjGOTdCJSBb3FlFAkyBTEavS+BcXWPgGhzeFuzRl\nNKTmj7Eu8aFCKj2x1U6bVW6xZ1Mwe3H+tRF5wsL1U4/QDrFgeOGwukkDsuqp\nSetL814rU2AEwm/WEYnOOg2WcQ9KHRpHk99I6mAO7tez7fWq2kN6hSWUGsIw\n5n8aRwQF4X9A280MNvqkd9/HiKkFtPB99AqanTlRKiP49weB9YMRYXO4F0g5\njrek8ZfHMwIN4NjorNMRjDFYJlvMy/LL0nq0d8sgc8221TJpiBASspCe2s9x\ngwuP6iRQFG1cQFUAnCOd/872Rw1y3WQH+zFGjMdA2zuczZ18y9dIysqvM/Sa\n4PVQoE0/z803iYxpCWPpfMG3+5dAU1UVH16kIfyOKvURXNLdcJOLCcsnPl6O\n1D+9y/On9y1DQZm/0fUUXjdLxe/ZMzIddDygpBd7G7kFUYKhhG8yupCJtNcZ\n5ZCYjyqGB9ZU/ur/UWF3yCxYo0gijoO9KO2l+rnmiYdula9qHKfWLeyQviWy\n66PJ\r\n=6Y2L\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9e3ba793a05adf42fdb55ab4fb1e86bec901aae3","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-08-29T16:27:12.218Z"},"_npmVersion":"6.14.14","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.65","@balena/jellyfish-environment":"^5.0.3","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.5","typedoc":"^0.21.8","depcheck":"^1.4.2","typescript":"^4.4.2","@types/jest":"^27.0.1","@types/node":"^14.17.12","@types/uuid":"^8.3.1","lint-staged":"^11.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^0.9.9","@balena/jellyfish-config":"^1.4.8"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.340-renovate-external-non-major-9e3ba793a05adf42fdb55ab4fb1e86bec901aae3_1630254624405_0.06425367355650202","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.340":{"name":"@balena/jellyfish-metrics","version":"1.0.340","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.340","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"328267534a158b3363b68210c070225625e09988","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.340.tgz","fileCount":15,"integrity":"sha512-JMUyDN8E7TfBBVVGT2er4TmgGP0KexHhule/Rj4g5E6gacYoKAezJd/oC/cIj/JwHeQMyoZdC+KL1aUvQhBdYQ==","signatures":[{"sig":"MEQCIAfxhzZhs8o3NWi9I6COYr1ThodBrkTVo7kkPZAIxRFdAiBqrVU+SGrjMsk6qTBs8jEDCJ9K3/Bwep236tCnfVfrJA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":124369,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhK7b+CRA9TVsSAnZWagAAbwcP/1JJaiCVj1ui+Zu3h5lE\nUH1zkpqaTbmitJDGkXOokgBhi2nAVJ5WjYlET2NxsXvhH3G3rmFA+6ME5gw2\nOn7IH/vrN6oh4/SYDe+kE1NlTbIWpz1hkQueQDbq8Zj4f5ofvZXrzD6G5xMr\nyhULyjosdovVAuh+C4Rr8KoP1m/T20+PTz/faorQ7J3OQsQD8xJndhYoBJRL\nUfWNOAnwEn1W1ZE1ImqNTz9OpkdSCozXfndF0fGxYNdjffhXD3w4rThtcTBL\nqWESg6ku29rcEchVBBYHiVaP0gwmgeDMr0RFBd3qg08ecW0M3epjhtqDt231\nuJfrNbk/4tSSwosgzrSdCCBfaHom8KJd5IRJxz1F0z/lqFZVTOy6RSTAay+7\n3rY+G68MG6xrD3uK0yw0huKd2JCsfJJgY31tW406j19CTLTrJiTua2SOsprY\nVjbPXAmgI/uin43H3CiEf+4L2i1ZLJS1GELC62X+25vU2cDKyMRm8syogeeH\nljPSnuvDZjgLJjqKWMfbnKzJz14KR35l6p1quI60Jd1LFBv8BrnTqSiB/NnJ\ndx04TxmGakqrOywYCcRwfTZdn6LrVtWYrykqEKShhPY8YekMgn5TP1fyxyVE\nOP5sPjxB9UGYRhsh7gpStqkTrJuHICpIkgVhddHkSy+bPWSPwAjJ4x2MCqUu\n6tZV\r\n=NzvY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c0201faf09fdb02833e36e5f90c8d9aab0fb6bdc","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-08-29T16:32:21.309Z"},"_npmVersion":"6.14.14","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.65","@balena/jellyfish-environment":"^5.0.3","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.5","typedoc":"^0.21.8","depcheck":"^1.4.2","typescript":"^4.4.2","@types/jest":"^27.0.1","@types/node":"^14.17.12","@types/uuid":"^8.3.1","lint-staged":"^11.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^0.9.9","@balena/jellyfish-config":"^1.4.8"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.340_1630254846292_0.4410874244984","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.341-renovate-internal-patch-cd720f8a321f3155a21b574f67a467d0c6fb9c6f":{"name":"@balena/jellyfish-metrics","version":"1.0.341-renovate-internal-patch-cd720f8a321f3155a21b574f67a467d0c6fb9c6f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.341-renovate-internal-patch-cd720f8a321f3155a21b574f67a467d0c6fb9c6f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e10aa5cb56960a1c49dbb89837e35df02cabd4ed","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.341-renovate-internal-patch-cd720f8a321f3155a21b574f67a467d0c6fb9c6f.tgz","fileCount":15,"integrity":"sha512-7RdjVc+Kvt3sE/OsuZ1PdAQyvT5VlppSTyFQBtA90tjiilASyKYALlIgr66F8iMO2fZLgZhspXKH/CKTJEMl2g==","signatures":[{"sig":"MEUCIQCCgvNGYt84pWazumvNnWuMT/s79UBIpNAKl2wVVzRMAwIgXQ/c6fDsuu39wYqIKF0s4YgZbqK1bLQ5m2ILH2GYmFk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":124538,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhLKmnCRA9TVsSAnZWagAA3osQAJZYG+jco2zyiKIC7Gu/\nXL1V1CZSbAanTPSqbaRoWg694WmD8/fHaj49TFbXrFrM8tZnTKlO9K1Br7qa\nzx/0VDsWXR38ISDQUQV7sAJ8AYQFglImUqjszuongRxmFkoWal8mdk0KRVCD\nUcY3U3PGx983sfDCr6HKu45UAOfpPh33wt3tpzccspfXXbZ79wkJKacZ7aa5\nI6xw4MawtFxukYyNPtC8ad7bqECE6ZnBFPxdbp9Mka26uncHlD6UZqa90D0u\n4j7chwIHle5woh6DAInWeVtZU/VAlkO2tOoFxwVleEDVgpSpp2MTJ6FyrKVF\nXie+bumf4Dor8K2N9IHKzNVOKK7pL+4GpQCuhjEpgw+e6A2NwkTqG+C8UxFg\n7c/o+PdM4v3oUNOox8kkOF0ZD85dk2pLQ0IYDM9+lRsWyss6WRCbnADTNMm9\nlgdoyYgGyIlb0JppATJF9O7mu0Sfdy/nr3jfgVPbpJbKTn0t4ONEiMUcQM6n\nCFTh7YWJFdjo7azbBEQars9kq3h65XgnkjP4FW9i4G44lX2/VBalTNcP1o8c\n0a3lNkgZG1pyW0qMxxHAmiqok9hQ9TBD1Mo16Bx0lthLCNVff49HUEb/I2Nh\nPW+uoTCUJJONO/4jDpO/aPccNrFVSwsbIj1noU2XFsbWMpWv/PbZlZ9upabi\nAtp6\r\n=8GBT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"cd720f8a321f3155a21b574f67a467d0c6fb9c6f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-08-30T09:46:11.484Z"},"_npmVersion":"6.14.14","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.66","@balena/jellyfish-environment":"^5.0.3","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.5","typedoc":"^0.21.8","depcheck":"^1.4.2","typescript":"^4.4.2","@types/jest":"^27.0.1","@types/node":"^14.17.12","@types/uuid":"^8.3.1","lint-staged":"^11.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^0.9.9","@balena/jellyfish-config":"^1.4.8"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.341-renovate-internal-patch-cd720f8a321f3155a21b574f67a467d0c6fb9c6f_1630316967048_0.2815367951630783","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.341":{"name":"@balena/jellyfish-metrics","version":"1.0.341","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.341","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b64e5404ebe3e1a9d5595994cc8d6f33a0fb744f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.341.tgz","fileCount":15,"integrity":"sha512-K3h8hUoYQtrNuJYHBhE8pHtqIroFE7uCIyGCPvalK2uUZqhjLMIU0EKlwa+/QuKGsi0gR0c0NpRFYUYdYLg1vQ==","signatures":[{"sig":"MEUCIQDYcG6prwwBYnr+ZIR8MKjTaWJVqNqgeOxXYkqS/avCGAIgO5ep07VIqGYVZuAAJ84hSOjmlHBxSNt2wHxB9paGoMA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":124473,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhLKp/CRA9TVsSAnZWagAAJvgP/jR0emIEUhYI19jwkaY1\niHUN8ICnKCqb9H8Xqp+zskXnStPZpfpHxOWYFp26MALDYJyvc0D/8PVGcKl3\nLsjQBoRVPMzuIamzYkaYQea7S8KWfhvD1xpqK1NPaCoZG3x250trpT39MWaA\nGdzGspF/1j4TWyGpYuh+1zyWGVDCIcYCVe6qQPyoKzTWy7aZhuHMwxQCmO6u\n4oBJ3P7fA4P0L9zxaktpWuoxWkkK6gbVbPuC8ynrWzhXHPZY3zGRIsL1kRnF\n3Eg6gQcT1PHBNYVQyUj33gNLdQaQgr53Wdb3Le6ifPfTgaPgen4M4cPH5rq2\nQ1Gbf2dkR+ovtK2ZmQUx+1h2ixBBv9YMp5050pVrwQubirL7YfjhkOc1phMX\ns5/8uAiEfD0L1WcThKHT2NBqcISbE6e5dECjUELdBNT/1Vnfxcle6G0ASHWY\nTUCx3p6A8FlnjvYWJ+zu6Icg+qEek+uEsTbKQOKgEeZu3OAy0Pmwiv0odL7X\nEMrdt8kAxT/v3lNhwQ//cDWg43EOJhNoBK3eTKF01sC55ZYr4HJZCOyGN00/\n4ZG8jj5Pbj2kMOQ8ts45Hna3K99Mu52hXu1kOfaQkageteOsbLldvOGiroIG\nGcyrd55baMe7ZJHiCM8shwkKiKkbFuB8Td96pwht7cC/9xIsxA/gqDCxysQZ\nC4Mr\r\n=kC5d\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9815ac789f99c318630311f6887ecf1302a30c89","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-08-30T09:51:06.571Z"},"_npmVersion":"6.14.14","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.66","@balena/jellyfish-environment":"^5.0.3","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.5","typedoc":"^0.21.8","depcheck":"^1.4.2","typescript":"^4.4.2","@types/jest":"^27.0.1","@types/node":"^14.17.12","@types/uuid":"^8.3.1","lint-staged":"^11.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^0.9.9","@balena/jellyfish-config":"^1.4.8"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.341_1630317183433_0.7755810139899963","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.342-repo-sync-jellyfish-config-default-62441753685cd320b144ac45cb2b4e241ea14279":{"name":"@balena/jellyfish-metrics","version":"1.0.342-repo-sync-jellyfish-config-default-62441753685cd320b144ac45cb2b4e241ea14279","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.342-repo-sync-jellyfish-config-default-62441753685cd320b144ac45cb2b4e241ea14279","maintainers":[{"name":"iayanpahwa","email":"ayan@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b600b128fcd9ab37f52ca950da2a4069f369bb81","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.342-repo-sync-jellyfish-config-default-62441753685cd320b144ac45cb2b4e241ea14279.tgz","fileCount":15,"integrity":"sha512-yKdcIpwAusokCPK/cFQ4irsyuO39IckrwhDYFJM1o3sc7JFnv8DBHAiEFcS1ZkNtah9FZWVPfwhaBoQ9aMaZ3A==","signatures":[{"sig":"MEUCIGGd/jEeWwcHxLgAFHfxwjZltAnp+Wl3fCZTQ9Rd3+OWAiEA3xJU5Y25tM4iYOaoVrIBAMyxF/EjCI5tPTcb2Ugw9NY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":124642},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"62441753685cd320b144ac45cb2b4e241ea14279","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-04T03:25:11.069Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.66","@balena/jellyfish-environment":"^5.0.3","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.5","typedoc":"^0.21.8","depcheck":"^1.4.2","typescript":"^4.4.2","@types/jest":"^27.0.1","@types/node":"^14.17.12","@types/uuid":"^8.3.1","lint-staged":"^11.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^0.9.9","@balena/jellyfish-config":"^1.4.8"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.342-repo-sync-jellyfish-config-default-62441753685cd320b144ac45cb2b4e241ea14279_1633318115099_0.672160225743669","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.342-repo-sync-jellyfish-config-default-fecf7ef61a5bf675fbbc520f632bccdc20012357":{"name":"@balena/jellyfish-metrics","version":"1.0.342-repo-sync-jellyfish-config-default-fecf7ef61a5bf675fbbc520f632bccdc20012357","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.342-repo-sync-jellyfish-config-default-fecf7ef61a5bf675fbbc520f632bccdc20012357","maintainers":[{"name":"iayanpahwa","email":"ayan@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"eaf4314147a9b191774dab1fdbccf1015cadceba","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.342-repo-sync-jellyfish-config-default-fecf7ef61a5bf675fbbc520f632bccdc20012357.tgz","fileCount":15,"integrity":"sha512-ifCvQPqkT9V9WXTi8aGpE6QVBQMDgIH18KSOer52BcoKRtv1AD18o/zLQuqgjpnYJEjv3QgR9eiMZKTlyffKdg==","signatures":[{"sig":"MEUCIQCrWjK95f6DDodZ0siTpSGRiqgFw6V/u0irZhXcpj2g5wIgd8qmmsrLoCLU3x23BKCMSpO274ZmEVjdCkUplxT50vA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":124642},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"fecf7ef61a5bf675fbbc520f632bccdc20012357","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-04T04:27:00.920Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.66","@balena/jellyfish-environment":"^5.0.3","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.5","typedoc":"^0.21.8","depcheck":"^1.4.2","typescript":"^4.4.2","@types/jest":"^27.0.1","@types/node":"^14.17.12","@types/uuid":"^8.3.1","lint-staged":"^11.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^0.9.9","@balena/jellyfish-config":"^1.4.8"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.342-repo-sync-jellyfish-config-default-fecf7ef61a5bf675fbbc520f632bccdc20012357_1633321818720_0.9142136744690268","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.342-repo-sync-jellyfish-config-default-f8cf1b9c3830bf496929111c90da32ebf4e7abc2":{"name":"@balena/jellyfish-metrics","version":"1.0.342-repo-sync-jellyfish-config-default-f8cf1b9c3830bf496929111c90da32ebf4e7abc2","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.342-repo-sync-jellyfish-config-default-f8cf1b9c3830bf496929111c90da32ebf4e7abc2","maintainers":[{"name":"iayanpahwa","email":"ayan@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8e0112ba155946f09955258b4cd65146ee0cb2b3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.342-repo-sync-jellyfish-config-default-f8cf1b9c3830bf496929111c90da32ebf4e7abc2.tgz","fileCount":15,"integrity":"sha512-Ubpt7C/eRXl/wNcuoG9U+FyXCTcAdTb9GkfjAVtD928pGzPW0f+BhgiudLz/1GOLgzaa/Lgtg+ufSOusgy0UeA==","signatures":[{"sig":"MEQCIA8YqqcFRbKux7sA2lM11KE2eqveTP3p5qK0jP8i3GPZAiB09ZLr4ZFxqxYLFfICnd9NevRJdiAW16Gl5fXTrsD4Cw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":124642},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f8cf1b9c3830bf496929111c90da32ebf4e7abc2","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-04T05:08:42.042Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.66","@balena/jellyfish-environment":"^5.0.3","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.5","typedoc":"^0.21.8","depcheck":"^1.4.2","typescript":"^4.4.2","@types/jest":"^27.0.1","@types/node":"^14.17.12","@types/uuid":"^8.3.1","lint-staged":"^11.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^0.9.9","@balena/jellyfish-config":"^1.4.8"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.342-repo-sync-jellyfish-config-default-f8cf1b9c3830bf496929111c90da32ebf4e7abc2_1633324316455_0.13252863530639458","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.342":{"name":"@balena/jellyfish-metrics","version":"1.0.342","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.342","maintainers":[{"name":"iayanpahwa","email":"ayan@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"nazrhom","email":"nazrhom@gmail.com"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9f4f045b6fed4292c10e1e074531a3dca155c590","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.342.tgz","fileCount":15,"integrity":"sha512-McD5sYs5HUVEcnyTGdvVmFYSrj04mzsbZ51+EAcMIbO7F4CgwrIK30OJkE9S/PTqFuyGIPUD0y2ZTISSj3jUYQ==","signatures":[{"sig":"MEQCIBAkjc6KVJL2g4onpJh8/5FAO/2PQecgOGlKbtyynZOSAiBCejzDc7XEFHaBvSzj7OGNU8Uxi25leC4BxVHR9lF9TA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":124566},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"559b73108197a33b6dde61d61c37ec8582248cd4","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-04T23:58:11.138Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.66","@balena/jellyfish-environment":"^5.0.3","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.5","typedoc":"^0.21.8","depcheck":"^1.4.2","typescript":"^4.4.2","@types/jest":"^27.0.1","@types/node":"^14.17.12","@types/uuid":"^8.3.1","lint-staged":"^11.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^0.9.9","@balena/jellyfish-config":"^1.4.8"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.342_1633392001180_0.7241367893596404","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.343-renovate-internal-patch-5a9ead0fd583ddf92a9e7994da6b744bf9bc4ac7":{"name":"@balena/jellyfish-metrics","version":"1.0.343-renovate-internal-patch-5a9ead0fd583ddf92a9e7994da6b744bf9bc4ac7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.343-renovate-internal-patch-5a9ead0fd583ddf92a9e7994da6b744bf9bc4ac7","maintainers":[{"name":"pranavbalena","email":"pranav@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"51352fef70e02565c3f3fd0ee23c8a9fafa1bb88","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.343-renovate-internal-patch-5a9ead0fd583ddf92a9e7994da6b744bf9bc4ac7.tgz","fileCount":15,"integrity":"sha512-3yVscscnW5CYaPAlStihKrDNpxHQInXpWi5LIHnwOLo6u8RrQuJKUcfRyK9AkX41VoSPVlw7bJikHsaXwFXs8Q==","signatures":[{"sig":"MEUCIFB5Qh1FXK1hPRy1AExzPg2dXSc9gLEXrC8USzFuNfr3AiEAkLce5+hrRpm5aB4FZeSxjFAy++a+CSth2KScmSBaDPE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":124703},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5a9ead0fd583ddf92a9e7994da6b744bf9bc4ac7","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-18T14:49:59.094Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.86","@balena/jellyfish-environment":"^5.0.4","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.5","typedoc":"^0.21.8","depcheck":"^1.4.2","typescript":"^4.4.2","@types/jest":"^27.0.1","@types/node":"^14.17.12","@types/uuid":"^8.3.1","lint-staged":"^11.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^0.9.9","@balena/jellyfish-config":"^1.4.8"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.343-renovate-internal-patch-5a9ead0fd583ddf92a9e7994da6b744bf9bc4ac7_1634568758469_0.30840647259602605","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.343-renovate-balena-jellyfish-types-1-x-4f698954f84ba6a8c17b1897beaa0ae5f4830591":{"name":"@balena/jellyfish-metrics","version":"1.0.343-renovate-balena-jellyfish-types-1-x-4f698954f84ba6a8c17b1897beaa0ae5f4830591","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.343-renovate-balena-jellyfish-types-1-x-4f698954f84ba6a8c17b1897beaa0ae5f4830591","maintainers":[{"name":"pranavbalena","email":"pranav@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"01c1f4b683cdccb12b21d56a96d5b81d482880ef","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.343-renovate-balena-jellyfish-types-1-x-4f698954f84ba6a8c17b1897beaa0ae5f4830591.tgz","fileCount":15,"integrity":"sha512-FCdbx8tZpvj+tmGLHq2ci/Lqu8ZhrpO1xECBfQSL+gOSRT5oJLo1O0S0bAv49d6HqFbTRDMOW0TWzHWmYjyZ0g==","signatures":[{"sig":"MEYCIQDrQB+dp7v/kfj+I2oHp9qtN5DPjHusTVE17YZHp8aa0wIhAKa3+SD9SBUIB0OkI8GSRrnpwJVYA5EedtOqTrZ74o6l","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":124741},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4f698954f84ba6a8c17b1897beaa0ae5f4830591","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-18T14:49:58.924Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.66","@balena/jellyfish-environment":"^5.0.3","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.5","typedoc":"^0.21.8","depcheck":"^1.4.2","typescript":"^4.4.2","@types/jest":"^27.0.1","@types/node":"^14.17.12","@types/uuid":"^8.3.1","lint-staged":"^11.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.4.8"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.343-renovate-balena-jellyfish-types-1-x-4f698954f84ba6a8c17b1897beaa0ae5f4830591_1634568786103_0.687248648536215","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.343":{"name":"@balena/jellyfish-metrics","version":"1.0.343","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.343","maintainers":[{"name":"pranavbalena","email":"pranav@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"170e64ed48b1473249e3234c394e1b421f96b760","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.343.tgz","fileCount":15,"integrity":"sha512-KwyZttxvlF0W6Gnf6Nr4l0SUCH79viZK0M4a+5P6NfIDtPW1FKTxhLtKRGj4JCJYGo5KpQJN/l8vKvTiKwnYQQ==","signatures":[{"sig":"MEQCICOuda10AOO/K4UwZyPAQc6LTLrGGkW/yMu+Quy//1duAiBdVcN06LRw7kaVlWUSEmiPiZkiwWT8S5RyKy90lH9EYA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":124638},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8fa9842c43038f97b8caa8bb96381bcd0b052077","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-18T14:54:48.837Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.86","@balena/jellyfish-environment":"^5.0.4","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.5","typedoc":"^0.21.8","depcheck":"^1.4.2","typescript":"^4.4.2","@types/jest":"^27.0.1","@types/node":"^14.17.12","@types/uuid":"^8.3.1","lint-staged":"^11.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^0.9.9","@balena/jellyfish-config":"^1.4.8"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.343_1634568993020_0.32377626689581596","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.343-renovate-balena-jellyfish-config-1-x-6468cc4760e8a2ac69eda51122e924a15b3c353f":{"name":"@balena/jellyfish-metrics","version":"1.0.343-renovate-balena-jellyfish-config-1-x-6468cc4760e8a2ac69eda51122e924a15b3c353f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.343-renovate-balena-jellyfish-config-1-x-6468cc4760e8a2ac69eda51122e924a15b3c353f","maintainers":[{"name":"pranavbalena","email":"pranav@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0a41d036021fb41c7d8ab37e15ad80bc5bbb930b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.343-renovate-balena-jellyfish-config-1-x-6468cc4760e8a2ac69eda51122e924a15b3c353f.tgz","fileCount":15,"integrity":"sha512-e7iMWAkIwLKVT5Psz3rkqifvAZHrCdW0orVyK4aLnTLtpRS43Tyo/eUfJtw6jfClFtQ68R+3e/LBt5Mww5VIbw==","signatures":[{"sig":"MEMCHwame/OK0nadYhCZVUhLHer384ls07G3FQ4ElEXeCikCICkNWH2Qij25K20dD49Af50ZthVqyRLFQ9TUh/W0nqR8","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":124793},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6468cc4760e8a2ac69eda51122e924a15b3c353f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-18T14:56:32.273Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.86","@balena/jellyfish-environment":"^5.0.4","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.5","typedoc":"^0.21.8","depcheck":"^1.4.2","typescript":"^4.4.2","@types/jest":"^27.0.1","@types/node":"^14.17.12","@types/uuid":"^8.3.1","lint-staged":"^11.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^0.9.9","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.343-renovate-balena-jellyfish-config-1-x-6468cc4760e8a2ac69eda51122e924a15b3c353f_1634569265139_0.0542579515072914","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.343-renovate-balena-jellyfish-types-1-x-50ffe2e846378e4e59db23f22ff7c33910e0d59c":{"name":"@balena/jellyfish-metrics","version":"1.0.343-renovate-balena-jellyfish-types-1-x-50ffe2e846378e4e59db23f22ff7c33910e0d59c","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.343-renovate-balena-jellyfish-types-1-x-50ffe2e846378e4e59db23f22ff7c33910e0d59c","maintainers":[{"name":"pranavbalena","email":"pranav@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b4964597e2198d8b7f4615abd66651badc1fca88","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.343-renovate-balena-jellyfish-types-1-x-50ffe2e846378e4e59db23f22ff7c33910e0d59c.tgz","fileCount":15,"integrity":"sha512-50nBQavNC1TW0lj4qFe8kXyQouludfDT49I3HmMuL95K1UEgjFoCwgU7Czm5Fcj/BykTV7o3K+EpMNBkb28cMA==","signatures":[{"sig":"MEUCIQChPGXb4kSeb0imGdGiwXLCQvC+SWwBfC0o+QXUzlOgRQIgKKqDt6h3bLpadOqqz6e3ey3xnt7u607yggaCNKZYG4Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":124787},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"50ffe2e846378e4e59db23f22ff7c33910e0d59c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-18T14:58:58.549Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.86","@balena/jellyfish-environment":"^5.0.4","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.5","typedoc":"^0.21.8","depcheck":"^1.4.2","typescript":"^4.4.2","@types/jest":"^27.0.1","@types/node":"^14.17.12","@types/uuid":"^8.3.1","lint-staged":"^11.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.4.8"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.343-renovate-balena-jellyfish-types-1-x-50ffe2e846378e4e59db23f22ff7c33910e0d59c_1634569274898_0.7318603562014945","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.344-renovate-balena-jellyfish-types-1-x-db0c0eb4538180df8f2c2848f6b7779838b291f6":{"name":"@balena/jellyfish-metrics","version":"1.0.344-renovate-balena-jellyfish-types-1-x-db0c0eb4538180df8f2c2848f6b7779838b291f6","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.344-renovate-balena-jellyfish-types-1-x-db0c0eb4538180df8f2c2848f6b7779838b291f6","maintainers":[{"name":"pranavbalena","email":"pranav@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"56ff8269d804af9e1da4f8a61dac6ceae0c5df89","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.344-renovate-balena-jellyfish-types-1-x-db0c0eb4538180df8f2c2848f6b7779838b291f6.tgz","fileCount":15,"integrity":"sha512-1R/RVDAzMJEFeYclipeKk2dESWdsCefRPrimmruUfkCBWghQlDZzy9oYpvgWR1DfwFlGMuuwy8GMCvqiyYzLAQ==","signatures":[{"sig":"MEUCIQDlZ1uKM08aFLrO6roSJklGiNy4yN2C7u1aIvi2jqmX2AIga386OqXl5vcmcwXPLzaGrZQsvGXBetdkO7bJ1opdJHc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":124813},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"db0c0eb4538180df8f2c2848f6b7779838b291f6","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-18T15:03:28.789Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.86","@balena/jellyfish-environment":"^5.0.4","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.5","typedoc":"^0.21.8","depcheck":"^1.4.2","typescript":"^4.4.2","@types/jest":"^27.0.1","@types/node":"^14.17.12","@types/uuid":"^8.3.1","lint-staged":"^11.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.4.8"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.344-renovate-balena-jellyfish-types-1-x-db0c0eb4538180df8f2c2848f6b7779838b291f6_1634569584318_0.41784911853460427","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.344":{"name":"@balena/jellyfish-metrics","version":"1.0.344","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.344","maintainers":[{"name":"pranavbalena","email":"pranav@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a8e463b640dcb747aba302ed6e6d6dd3c5c62ff0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.344.tgz","fileCount":15,"integrity":"sha512-PCn55aVGwgbwLBGH64Gr7dh68+01G8sT/B3cNaOke9ANLJyWgkuQYIff5reHw9UkD8oJSEs0+biUbCaEtV8Tkg==","signatures":[{"sig":"MEQCIFZC1tCxOzxZjc5XsRh1dBrtVbvWOwu7uDV1ctyisAWSAiBhYpV3xAcqaolCXVHmKKWvDSXma5i/DSAAF0McHK9FBA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":124736},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6928a7a9477c1a1a703e0316171a5cbaec549b8c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-18T23:12:19.070Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.86","@balena/jellyfish-environment":"^5.0.4","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.5","typedoc":"^0.21.8","depcheck":"^1.4.2","typescript":"^4.4.2","@types/jest":"^27.0.1","@types/node":"^14.17.12","@types/uuid":"^8.3.1","lint-staged":"^11.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.4.8"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.344_1634598841601_0.692407935137753","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.345-renovate-internal-patch-098aaad9c38f7ca29aeca976b87531c932413044":{"name":"@balena/jellyfish-metrics","version":"1.0.345-renovate-internal-patch-098aaad9c38f7ca29aeca976b87531c932413044","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.345-renovate-internal-patch-098aaad9c38f7ca29aeca976b87531c932413044","maintainers":[{"name":"pranavbalena","email":"pranav@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7a8e3c4577d3f6ed07ea51eb65311288a18d4331","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.345-renovate-internal-patch-098aaad9c38f7ca29aeca976b87531c932413044.tgz","fileCount":15,"integrity":"sha512-f0ltn6iXqcHA/cBSssoWwOdZ3BvKJnDZtogE8DlvPg+xo5MDwvv76sCVOHptDjx+3+0ltE5eZ62KBwrwgNyM8A==","signatures":[{"sig":"MEUCIEgjsQGoHjZf9Eidp++At6sXpsCh12oRifrGFgOWQ2w8AiEAyGGSkG87aY/CtU1T19rYzedNnzbT9hiGhnfiLf+WQWI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":124909},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"098aaad9c38f7ca29aeca976b87531c932413044","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-18T23:14:48.751Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.86","@balena/jellyfish-environment":"^5.0.5","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.5","typedoc":"^0.21.8","depcheck":"^1.4.2","typescript":"^4.4.2","@types/jest":"^27.0.1","@types/node":"^14.17.12","@types/uuid":"^8.3.1","lint-staged":"^11.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.4.8"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.345-renovate-internal-patch-098aaad9c38f7ca29aeca976b87531c932413044_1634599138681_0.43830947802000986","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.345-renovate-balena-jellyfish-config-1-x-b7b1028ee7125e1d25bc377cfb0d9a4408aa5a43":{"name":"@balena/jellyfish-metrics","version":"1.0.345-renovate-balena-jellyfish-config-1-x-b7b1028ee7125e1d25bc377cfb0d9a4408aa5a43","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.345-renovate-balena-jellyfish-config-1-x-b7b1028ee7125e1d25bc377cfb0d9a4408aa5a43","maintainers":[{"name":"pranavbalena","email":"pranav@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9f6ae9b1d042bdeef6ee93522b176e54facbb67a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.345-renovate-balena-jellyfish-config-1-x-b7b1028ee7125e1d25bc377cfb0d9a4408aa5a43.tgz","fileCount":15,"integrity":"sha512-nP0A/nNlntIVDt4cMvedCFWHZKojflMX1TBaHDIc1i3oakeHOWjqSFsfM0+1NjbycE1926C3hnHDD2UrW8tyTQ==","signatures":[{"sig":"MEUCIENa2yuKk/kUIcl5eOXA4HIntraRstrMkHypEKvpxAuhAiEAviVwT0HBz5P9cWpcZpNGU26oszSUNQHiKfTWSTcv6l4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":124917},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b7b1028ee7125e1d25bc377cfb0d9a4408aa5a43","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-18T23:17:16.109Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.86","@balena/jellyfish-environment":"^5.0.4","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.5","typedoc":"^0.21.8","depcheck":"^1.4.2","typescript":"^4.4.2","@types/jest":"^27.0.1","@types/node":"^14.17.12","@types/uuid":"^8.3.1","lint-staged":"^11.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.345-renovate-balena-jellyfish-config-1-x-b7b1028ee7125e1d25bc377cfb0d9a4408aa5a43_1634599269060_0.04906242292508067","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.345":{"name":"@balena/jellyfish-metrics","version":"1.0.345","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.345","maintainers":[{"name":"pranavbalena","email":"pranav@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"81ce38432ff03c51055e0aa7def375765b02406d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.345.tgz","fileCount":15,"integrity":"sha512-BnUWpXvVSMQAGeanOrkZS+ypp/J+oUDEDWQiiYKZcqKL630+ATdKgOp7/G421obNT696Erm4dkcOLiFHcw9BLQ==","signatures":[{"sig":"MEUCIBH58Siyp24Ztw5GhLIdSyM+Np2XiIS3Ptk3MWYpWH5JAiEA24h0wzF6rrPppv8eFiEUq2EpKNvbnxiYscKutATrXoo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":124844},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0e438f49d5047fcac943229627f1f191170d3559","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-18T23:22:28.884Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.86","@balena/jellyfish-environment":"^5.0.5","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.5","typedoc":"^0.21.8","depcheck":"^1.4.2","typescript":"^4.4.2","@types/jest":"^27.0.1","@types/node":"^14.17.12","@types/uuid":"^8.3.1","lint-staged":"^11.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.4.8"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.345_1634599451456_0.33050280838066404","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.346-renovate-balena-jellyfish-config-1-x-40b88f64f16b4f0916a85dcaf9f6a24763a781b7":{"name":"@balena/jellyfish-metrics","version":"1.0.346-renovate-balena-jellyfish-config-1-x-40b88f64f16b4f0916a85dcaf9f6a24763a781b7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.346-renovate-balena-jellyfish-config-1-x-40b88f64f16b4f0916a85dcaf9f6a24763a781b7","maintainers":[{"name":"pranavbalena","email":"pranav@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8ed167b652e1e89e4a337b336927d7060231d2da","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.346-renovate-balena-jellyfish-config-1-x-40b88f64f16b4f0916a85dcaf9f6a24763a781b7.tgz","fileCount":15,"integrity":"sha512-SQk/ORwu4dMwQRLdmTk46yH8ognTFs0tKuTHYmdWrlnmfpadUtF4+gCTFmvKhBr06FMvn3YtDcfugyZGVC+xjQ==","signatures":[{"sig":"MEYCIQDID6dL7PMfCQ9uup+bHZjikgfFJr2YxPVu/9cqb3NWdwIhAKvPT2nc4Hpbb93ipra/baD5Rnwneu9tCnp3sxEIF7KM","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":125025},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"40b88f64f16b4f0916a85dcaf9f6a24763a781b7","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-18T23:26:48.953Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.86","@balena/jellyfish-environment":"^5.0.5","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.5","typedoc":"^0.21.8","depcheck":"^1.4.2","typescript":"^4.4.2","@types/jest":"^27.0.1","@types/node":"^14.17.12","@types/uuid":"^8.3.1","lint-staged":"^11.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.346-renovate-balena-jellyfish-config-1-x-40b88f64f16b4f0916a85dcaf9f6a24763a781b7_1634599789890_0.5126303479352456","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.346":{"name":"@balena/jellyfish-metrics","version":"1.0.346","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.346","maintainers":[{"name":"pranavbalena","email":"pranav@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"988675d176ce0429ec7e636163541d4113ff8358","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.346.tgz","fileCount":15,"integrity":"sha512-96Fb7fwSJ2k1ZuKygNHRnP/bxT3Wyaw3Zr6+bP3jepIQoypAfsWgaY/WPv69p0ocdb9i0acsMSDmWgWGuBvJvA==","signatures":[{"sig":"MEYCIQDfuR+qNedi6eOe7AA5lDBN+sclsHRnTZouIsdufrSWSgIhAIhsiC+SJlS4VWTVNR4O/TPPSsc89Zay5Hdu0eOhVPkJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":124947},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7cf4977649c23c09c26b5d4f67701798fc9823fe","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-18T23:31:40.216Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.86","@balena/jellyfish-environment":"^5.0.5","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.5","typedoc":"^0.21.8","depcheck":"^1.4.2","typescript":"^4.4.2","@types/jest":"^27.0.1","@types/node":"^14.17.12","@types/uuid":"^8.3.1","lint-staged":"^11.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.346_1634600004405_0.552728926946839","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.347-renovate-internal-patch-7a8f437dc72f8cad84107a77556d5a6df214b187":{"name":"@balena/jellyfish-metrics","version":"1.0.347-renovate-internal-patch-7a8f437dc72f8cad84107a77556d5a6df214b187","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.347-renovate-internal-patch-7a8f437dc72f8cad84107a77556d5a6df214b187","maintainers":[{"name":"pranavbalena","email":"pranav@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"23b82bb7473c54cffc50266d963f3d06258443dc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.347-renovate-internal-patch-7a8f437dc72f8cad84107a77556d5a6df214b187.tgz","fileCount":15,"integrity":"sha512-VP3TL4wkvTwSTFnZUIzfAqQn3j/Cb5XFsF+sYD7Fr+W3+8RkLkEC1PpszJ+FeeF8x6HqYXMfBxURgx7YTfy6gg==","signatures":[{"sig":"MEUCIFOyYuV/h/qQFFO4iPGk3JjXMIppfu04KBJpWEC3egdrAiEA+EAakPUv+UdjGVRXwfEnpSuU1hvdDn0UGa0Elg64WRI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":125116},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7a8f437dc72f8cad84107a77556d5a6df214b187","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-20T09:09:48.830Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.87","@balena/jellyfish-environment":"^5.0.5","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.5","typedoc":"^0.21.8","depcheck":"^1.4.2","typescript":"^4.4.2","@types/jest":"^27.0.1","@types/node":"^14.17.12","@types/uuid":"^8.3.1","lint-staged":"^11.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.347-renovate-internal-patch-7a8f437dc72f8cad84107a77556d5a6df214b187_1634721183073_0.3635935148743923","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.347":{"name":"@balena/jellyfish-metrics","version":"1.0.347","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.347","maintainers":[{"name":"pranavbalena","email":"pranav@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7861e1d4b9cdd5eef32376c52f1bb179bef1aaba","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.347.tgz","fileCount":15,"integrity":"sha512-xLIhc1oTJqyUpKgPoxsh4BYwrnIK6evc+Govbhf2A5iE0YJwbGJ7YT09GBvqZxRXDUqrK41kYtAHGDA2dzTfJg==","signatures":[{"sig":"MEUCIQCIu068Ucgqt1LlUA8oz2+E8Uh/SVbg7wMVxY+9olALUgIgHEun2HxR+EyJbUEG795opqTCzANITrRz93v4/gE3B/4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":125051},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"afd13d26fd07e9bdc88dd4f04211d52535ebe104","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-20T09:15:29.271Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.87","@balena/jellyfish-environment":"^5.0.5","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.5","typedoc":"^0.21.8","depcheck":"^1.4.2","typescript":"^4.4.2","@types/jest":"^27.0.1","@types/node":"^14.17.12","@types/uuid":"^8.3.1","lint-staged":"^11.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.347_1634721440075_0.6333449886310194","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.348-renovate-external-non-major-3941b7e92a13459fd2bf43ab7e0007178b87961e":{"name":"@balena/jellyfish-metrics","version":"1.0.348-renovate-external-non-major-3941b7e92a13459fd2bf43ab7e0007178b87961e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.348-renovate-external-non-major-3941b7e92a13459fd2bf43ab7e0007178b87961e","maintainers":[{"name":"pranavbalena","email":"pranav@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6d6151702f6baf7a9e1f70afdba717a3f0772fe2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.348-renovate-external-non-major-3941b7e92a13459fd2bf43ab7e0007178b87961e.tgz","fileCount":15,"integrity":"sha512-isZng08E7z881/CmW1m+Hel3VB+BddAHadgEdPyhF0cl6CieSF9CoUos9gM8uPj0MrjtTMSvUq66QOYXun8WGg==","signatures":[{"sig":"MEUCIC60+bpZed1ZRjoBXWg901gZJo78DR5bvZpTQvEoUMXDAiEA6D84MOp+DDwXOd9/YUpEdseUVsc7EIq2GgZpOOeINaw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":125196},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3941b7e92a13459fd2bf43ab7e0007178b87961e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-23T00:47:48.652Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.87","@balena/jellyfish-environment":"^5.0.5","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.6","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^14.17.29","@types/uuid":"^8.3.1","lint-staged":"^11.2.3","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.348-renovate-external-non-major-3941b7e92a13459fd2bf43ab7e0007178b87961e_1634950212380_0.9792570138171621","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.348-renovate-external-non-major-64230c9f559f571a6142ae43e0ab537e807a6af3":{"name":"@balena/jellyfish-metrics","version":"1.0.348-renovate-external-non-major-64230c9f559f571a6142ae43e0ab537e807a6af3","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.348-renovate-external-non-major-64230c9f559f571a6142ae43e0ab537e807a6af3","maintainers":[{"name":"pranavbalena","email":"pranav@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c378b8211ae7d3f982056f22fc20a833ed574325","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.348-renovate-external-non-major-64230c9f559f571a6142ae43e0ab537e807a6af3.tgz","fileCount":15,"integrity":"sha512-/+HUfrjnR7OWvi46TgpHvT7qfDTROHb7QynXxgSpZHTn22AbfyyvGwcHMdN9HK2tucaQO00s+nH6q6M1ZssBFw==","signatures":[{"sig":"MEUCIDI/7dxjC6+qGvDA7l/AEwbtPJgzmbc7ZFkNfdvCUCB3AiEA4/uDsuQ0LDMI2LyStD4QgUW5/bWU4lpPXSeP80aA+yQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":125257},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"64230c9f559f571a6142ae43e0ab537e807a6af3","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-23T01:16:29.878Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.87","@balena/jellyfish-environment":"^5.0.5","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.6","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^14.17.29","@types/uuid":"^8.3.1","lint-staged":"^11.2.3","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.348-renovate-external-non-major-64230c9f559f571a6142ae43e0ab537e807a6af3_1634952069489_0.5651274650239886","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.348":{"name":"@balena/jellyfish-metrics","version":"1.0.348","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.348","maintainers":[{"name":"pranavbalena","email":"pranav@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"920f333a9cb52183ac31db208eb8ea7a51987808","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.348.tgz","fileCount":15,"integrity":"sha512-Hwjzp5Xb3jUeeDzMlk3Xkgb7TMMkD+iCgGeqCXWmkirBVGo7oxwMXW+4ZzC21LFZnbV8Hvk1kfXS++aSl1T+vg==","signatures":[{"sig":"MEYCIQDeCNWYFsTCb6RI3D38OSaJ7P1qAGAMIgGERlQm2kMCpwIhAM28zegiIVWQH4C2wXQMVkanLQ35jQF2SNFbdC/UHwUj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":125188},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"525affaf426bfc2bdd1a73fad92674f7f2bff44d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-23T01:22:42.382Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.87","@balena/jellyfish-environment":"^5.0.5","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.6","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^14.17.29","@types/uuid":"^8.3.1","lint-staged":"^11.2.3","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.348_1634952294064_0.7172724522673071","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.349-renovate-internal-patch-24a97225f6726f8c36a9605d6bdb898f35aff05f":{"name":"@balena/jellyfish-metrics","version":"1.0.349-renovate-internal-patch-24a97225f6726f8c36a9605d6bdb898f35aff05f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.349-renovate-internal-patch-24a97225f6726f8c36a9605d6bdb898f35aff05f","maintainers":[{"name":"pranavbalena","email":"pranav@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1910d1c244b78f432dc3a867d53c793f141f25f8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.349-renovate-internal-patch-24a97225f6726f8c36a9605d6bdb898f35aff05f.tgz","fileCount":15,"integrity":"sha512-f0nW9Cbav1ufzXcI6QyvIcd6J8dGQz/Pddv3IwzpCzk5mSw4xzGl3CljlBpQSH/dVJln6SlP1e+vTMdHwk5ilA==","signatures":[{"sig":"MEQCIDrJVewkLAPZi5KT/vggVkU4cWaIkU2+JZlM5+/DkYQxAiA79zD0pkDdkf3PJ7H2qlG7cG3uttJQ9Gm5ITM9/d9/DA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":125325},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"24a97225f6726f8c36a9605d6bdb898f35aff05f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-23T05:18:19.091Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.90","@balena/jellyfish-environment":"^5.0.6","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.6","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^14.17.29","@types/uuid":"^8.3.1","lint-staged":"^11.2.3","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.349-renovate-internal-patch-24a97225f6726f8c36a9605d6bdb898f35aff05f_1634966514521_0.5743008765418072","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.349":{"name":"@balena/jellyfish-metrics","version":"1.0.349","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.349","maintainers":[{"name":"pranavbalena","email":"pranav@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c9b703c240abd9bd7b4d26d03df0e07596eb8556","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.349.tgz","fileCount":15,"integrity":"sha512-zKB08Jlx5if1bHYOLvobmO40Gemq1fD6PdN29CpcM/V1qzfcvalShzD6OODBcLkqw9/QgScdBlTcoDGX2LQPmg==","signatures":[{"sig":"MEYCIQDLBNL0VFo/td4SbkA8gEi8Z8IUZwjR5JHByWaThKlHUAIhAKBuLS82M5Kug5N75tKBXhqj9VltXleliI4MINfh8T2s","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":125260},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"09ba091537e1c8285f7dc430c960c1cf282b496f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-23T05:24:08.840Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.90","@balena/jellyfish-environment":"^5.0.6","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.6","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^14.17.29","@types/uuid":"^8.3.1","lint-staged":"^11.2.3","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.349_1634966750630_0.13530289313014654","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.350-renovate-internal-patch-024884c22ffdde0114fa40aa32ae12a49a6ccdcb":{"name":"@balena/jellyfish-metrics","version":"1.0.350-renovate-internal-patch-024884c22ffdde0114fa40aa32ae12a49a6ccdcb","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.350-renovate-internal-patch-024884c22ffdde0114fa40aa32ae12a49a6ccdcb","maintainers":[{"name":"pranavbalena","email":"pranav@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3ce3aa0db0a59a0e998e500bed0724a84135ed8e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.350-renovate-internal-patch-024884c22ffdde0114fa40aa32ae12a49a6ccdcb.tgz","fileCount":15,"integrity":"sha512-Ja0YR0D1ooYix6YRq1xgBOJFPcLHL0pwLygD0gCdIa/BqxiK7++abLyKOOzFuSffmf8U/cHxK55s48EzDlJMGQ==","signatures":[{"sig":"MEUCIQDTajw+OaGVOA7UkbuNMdSx0btbCAcRbXA3RmPMTSGj+gIgUxJRKHCq0tRSvI1TQyzm2iP5vuHklSPW874PMxwlSZ8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":125397},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"024884c22ffdde0114fa40aa32ae12a49a6ccdcb","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-23T08:36:18.984Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.91","@balena/jellyfish-environment":"^5.0.7","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.6","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^14.17.29","@types/uuid":"^8.3.1","lint-staged":"^11.2.3","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.350-renovate-internal-patch-024884c22ffdde0114fa40aa32ae12a49a6ccdcb_1634978337874_0.27844615868848344","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.350":{"name":"@balena/jellyfish-metrics","version":"1.0.350","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.350","maintainers":[{"name":"pranavbalena","email":"pranav@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8e43cb320891affaf49f5de3fee8fa7ee57654f6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.350.tgz","fileCount":15,"integrity":"sha512-rF/p8vilK8dS8addl6PxZwMG6+hwTeN1dkBPyWLkvWQiQCiXsIOGzpl2U+zhTcN1bfOOnEwHAOu0IsEWW/VYPg==","signatures":[{"sig":"MEUCIQC2KxIiXu9zKDBkVK9hX4jDuqwwEnxVjfA2mVXdHPIWBgIgKcWH5XNqHsr2XveKPq+V7MHgLkKdLknlLM4fktVzoEg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":125332},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9472085dc8bc7e7158ddccf9ef8fdc4266dd359c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-23T08:40:51.708Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.91","@balena/jellyfish-environment":"^5.0.7","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.6","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^14.17.29","@types/uuid":"^8.3.1","lint-staged":"^11.2.3","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.350_1634978588564_0.32964348355673234","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.351-renovate-internal-patch-80c5f2611073f4acc00313a06ed39b2f24bc5a8e":{"name":"@balena/jellyfish-metrics","version":"1.0.351-renovate-internal-patch-80c5f2611073f4acc00313a06ed39b2f24bc5a8e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.351-renovate-internal-patch-80c5f2611073f4acc00313a06ed39b2f24bc5a8e","maintainers":[{"name":"pranavbalena","email":"pranav@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a4b8c310b90af6844e5c46c8af131ab298c2d5a5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.351-renovate-internal-patch-80c5f2611073f4acc00313a06ed39b2f24bc5a8e.tgz","fileCount":15,"integrity":"sha512-uFP6TOH4IYJtmtOU0y0PwM8+MlzIeCdv+cxLRxJZbkmBWizmaN2DRGpxfD9RCy/IkvngboTSfPg4btIAuCDWyg==","signatures":[{"sig":"MEYCIQDNtbGiE3i904Y4KyWFpeSl89ef+Xzf2GM41sNNRuU26gIhAKWl5xsqSeVpoZjDJ/r59MMn+EFRbNrU9Iu8FJLabsZ6","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":125469},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"80c5f2611073f4acc00313a06ed39b2f24bc5a8e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-23T19:30:49.477Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.92","@balena/jellyfish-environment":"^5.0.8","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.6","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^14.17.29","@types/uuid":"^8.3.1","lint-staged":"^11.2.3","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.351-renovate-internal-patch-80c5f2611073f4acc00313a06ed39b2f24bc5a8e_1635017674539_0.3006585186796613","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.351-renovate-external-non-major-2519beed7a5ff9d32e97a22800eeeabc752db6a5":{"name":"@balena/jellyfish-metrics","version":"1.0.351-renovate-external-non-major-2519beed7a5ff9d32e97a22800eeeabc752db6a5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.351-renovate-external-non-major-2519beed7a5ff9d32e97a22800eeeabc752db6a5","maintainers":[{"name":"pranavbalena","email":"pranav@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4dd5f3f7b109dbe69b625c4d462655c1b234df79","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.351-renovate-external-non-major-2519beed7a5ff9d32e97a22800eeeabc752db6a5.tgz","fileCount":15,"integrity":"sha512-2r4GZdBWOUCvk3cMHEXt1YJrR/0WqU4ywzLZXc4mxn33FRJOqSGFiC0cGRl0UFrcJ8/EU9p/uPiC1z/wOG8sqQ==","signatures":[{"sig":"MEUCIQDPnSzrOl8T9ZIklsPDnAbW2tqsuzBULzVsFxyYrgAiOAIgI5md0hpThapVsFdgme+Oy3yQR0Tih/v1v6mWT+nP1gA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":125492},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2519beed7a5ff9d32e97a22800eeeabc752db6a5","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-23T19:31:00.090Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.91","@balena/jellyfish-environment":"^5.0.7","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.6","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^14.17.29","@types/uuid":"^8.3.1","lint-staged":"^11.2.4","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.351-renovate-external-non-major-2519beed7a5ff9d32e97a22800eeeabc752db6a5_1635017698196_0.6021500014991898","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.351":{"name":"@balena/jellyfish-metrics","version":"1.0.351","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.351","maintainers":[{"name":"pranavbalena","email":"pranav@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"907b47ffb0e7d3fca89b532785da7c1f626a7776","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.351.tgz","fileCount":15,"integrity":"sha512-35irm4S7TilJmaszfeHtfoycEQcGALyNcWDJX1XL3KZ1XBwnaGPBbojCjBQRgcRDPCSH7NiBXQQuEa9+4JMMtw==","signatures":[{"sig":"MEQCIEfFe17EqgPrd3YDK48A/oqJy8ZceBu2AqZc1Y4BZQSWAiAnnCgqPwSkJVulS9oSa1zd7qnwo3dotHHOc6AuPtCRUw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":125404},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"049e2a62013dcabccc6e1d29ea1204d360e08829","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-23T19:37:09.008Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.92","@balena/jellyfish-environment":"^5.0.8","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.6","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^14.17.29","@types/uuid":"^8.3.1","lint-staged":"^11.2.3","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.351_1635017941326_0.39350868002846195","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.352-renovate-external-non-major-91aa515f5af1e32ec2528e13d32bc4b8d75154b9":{"name":"@balena/jellyfish-metrics","version":"1.0.352-renovate-external-non-major-91aa515f5af1e32ec2528e13d32bc4b8d75154b9","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.352-renovate-external-non-major-91aa515f5af1e32ec2528e13d32bc4b8d75154b9","maintainers":[{"name":"pranavbalena","email":"pranav@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7cb2ca0327a1bba8f776052cde4867a8e9908f87","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.352-renovate-external-non-major-91aa515f5af1e32ec2528e13d32bc4b8d75154b9.tgz","fileCount":15,"integrity":"sha512-MMJD1psTqiloo3k4S1g/IeZQTjSKaELBwo3M4sfNgOQ47ktFiy3Dk6iTti0fuN+/DvwyGzBFf2q13TrE5QrMew==","signatures":[{"sig":"MEUCIBS3HbjwmGIIIwUvuw1u2fJ6dYDsaufAt27X5iiNJHh3AiEAt2BPrYbQr/c49Uo0yGgJ+fxPkd73qwU2dTYr1ylkdYA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":125564},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"91aa515f5af1e32ec2528e13d32bc4b8d75154b9","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-23T19:39:39.528Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.92","@balena/jellyfish-environment":"^5.0.8","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.6","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^14.17.29","@types/uuid":"^8.3.1","lint-staged":"^11.2.4","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.352-renovate-external-non-major-91aa515f5af1e32ec2528e13d32bc4b8d75154b9_1635018121722_0.29846157001778506","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.352":{"name":"@balena/jellyfish-metrics","version":"1.0.352","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.352","maintainers":[{"name":"pranavbalena","email":"pranav@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"405599f0098f3e65244165449e4b216348daacf3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.352.tgz","fileCount":15,"integrity":"sha512-YDK34tBMo+HT/907D83ivVlXJCfYyI2imhYnVI/3W3OjCQFru9H9SV6+ku1WTGFdNBdbj9RnIlVYIttBC40w6A==","signatures":[{"sig":"MEUCIQC3houg8tAfo6tv5wRH4MnNLQsMN9xsYW8B4gM7zhJfvQIgChM1MNQkOrCa7VijKt6yaSF3aDS3MN+hecsZq96i/Tg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":125495},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"445d1e5be98af023a9d478f7b1fa544ddd60d692","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-23T19:46:57.725Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.92","@balena/jellyfish-environment":"^5.0.8","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.6","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^14.17.29","@types/uuid":"^8.3.1","lint-staged":"^11.2.4","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.352_1635018523699_0.024908631462478237","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.353-renovate-internal-patch-fbf96b269fd4118a0a351628207a7d127ffb9243":{"name":"@balena/jellyfish-metrics","version":"1.0.353-renovate-internal-patch-fbf96b269fd4118a0a351628207a7d127ffb9243","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.353-renovate-internal-patch-fbf96b269fd4118a0a351628207a7d127ffb9243","maintainers":[{"name":"pranavbalena","email":"pranav@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f0bc9cddb87fd8cda5f75fe373517e6e90023faf","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.353-renovate-internal-patch-fbf96b269fd4118a0a351628207a7d127ffb9243.tgz","fileCount":15,"integrity":"sha512-ELSovPjdixDetYHH58z8vnPDXiTVarHkqUXnZPYG5+UyPQrld5BlpTw+JN08rrjKQC9RFM51X+/IjllxfXQR8w==","signatures":[{"sig":"MEQCIEyL+s48Uf/ggvNHqnAHeDBYa+3xJcgTRNCFkI6ZW0EIAiAIawybPzUhVU1fN2zMXKZAhn3iIqIDYgXRe7Wu7tsSpA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":125664},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"fbf96b269fd4118a0a351628207a7d127ffb9243","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-23T21:43:48.096Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.93","@balena/jellyfish-environment":"^5.0.8","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.6","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^14.17.29","@types/uuid":"^8.3.1","lint-staged":"^11.2.4","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.353-renovate-internal-patch-fbf96b269fd4118a0a351628207a7d127ffb9243_1635025634380_0.5484616824664694","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.353":{"name":"@balena/jellyfish-metrics","version":"1.0.353","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.353","maintainers":[{"name":"pranavbalena","email":"pranav@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"page","email":"page@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"45df6e38b9864013c42cfaa4628a87d4de7ad14c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.353.tgz","fileCount":15,"integrity":"sha512-fBETQza3+7DnU9mCkvgBQY3kCr0mS9QP4u/Nza9BdS+Pfx1AOswAKNX8ieritiEXcRF6AvJY3RrqTujMMui0Ig==","signatures":[{"sig":"MEYCIQCYlwSX/ZR6GdmyXsI3uYHgNsMI4Gi7No9VCQQGnJhwhQIhALFERKGJtqxwMbYJzR+xxOJMgMQZOSJM5lgWL5rzTbsj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":125599},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0148c8a0546b40c482f23f7d36d9bac4c0e788ca","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-23T21:49:28.574Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.93","@balena/jellyfish-environment":"^5.0.8","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.6","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^14.17.29","@types/uuid":"^8.3.1","lint-staged":"^11.2.4","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.3","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.353_1635025882494_0.3995273359472038","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.354-renovate-internal-patch-3336bb68113f77b60f2083019feb8beb48abd049":{"name":"@balena/jellyfish-metrics","version":"1.0.354-renovate-internal-patch-3336bb68113f77b60f2083019feb8beb48abd049","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.354-renovate-internal-patch-3336bb68113f77b60f2083019feb8beb48abd049","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"10bdcf2b58596d1e50ce6d10922f18ad8266447b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.354-renovate-internal-patch-3336bb68113f77b60f2083019feb8beb48abd049.tgz","fileCount":15,"integrity":"sha512-0Oeppp75k4jpmtOQtsyKZob81fE83YzW2xneQrHFY5Y/MMSFTARwTrmSllxji+24Giky8IP5vxQ1pitKfPCbyw==","signatures":[{"sig":"MEUCIG+JHHP0Ui0w73LENDl/MEHIeEDqEy/YvGq7mRiQ5nN9AiEA97q/cCIC93RgxkKp14YYWyKZTxtTkb0AZ+K51b5PlUo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":125761},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3336bb68113f77b60f2083019feb8beb48abd049","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-28T01:24:19.608Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.93","@balena/jellyfish-environment":"^5.0.8","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.6","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^14.17.29","@types/uuid":"^8.3.1","lint-staged":"^11.2.4","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.4","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.354-renovate-internal-patch-3336bb68113f77b60f2083019feb8beb48abd049_1635384461047_0.3242420930155374","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.354":{"name":"@balena/jellyfish-metrics","version":"1.0.354","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.354","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b1743d086ca476f0282dcbd2bff24ac40fe507f4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.354.tgz","fileCount":15,"integrity":"sha512-0053penREMbDkEfdvt7jKAfl852Ga7Kxr21JPLoFGOQA5KSYGqk/yt6gBh19tauor8dOftn48gu96kCeSOg0Ig==","signatures":[{"sig":"MEQCIGhCAIqYmES4l16fPltE0Bl4p4J23XWgCq1CEVbq6I3gAiBf/KBT6g9IaYBjCrN5/PM3jToOOk09qd/5r/dY1YbCfg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":125696},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6f7e6276ad4373287fff179b3a63654d3767676e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-28T01:29:29.884Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.93","@balena/jellyfish-environment":"^5.0.8","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.6","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^14.17.29","@types/uuid":"^8.3.1","lint-staged":"^11.2.4","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.4","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.354_1635384677276_0.2003985532421122","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.355-renovate-internal-patch-a2dcf9d0323750061eddc2aad13d07542d86b5eb":{"name":"@balena/jellyfish-metrics","version":"1.0.355-renovate-internal-patch-a2dcf9d0323750061eddc2aad13d07542d86b5eb","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.355-renovate-internal-patch-a2dcf9d0323750061eddc2aad13d07542d86b5eb","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f5fa3e277e736cf21d7991d6d9b0aca9b5b38e0d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.355-renovate-internal-patch-a2dcf9d0323750061eddc2aad13d07542d86b5eb.tgz","fileCount":15,"integrity":"sha512-529graVpySd2YMnnwHITwpfRUGJhg6DEoMMpeN7DidFYNF27ENiuzuNCDUlqMSRM2JO3TDstyiURIERYqXPS1w==","signatures":[{"sig":"MEUCIQDmxysI0F+xfsL9fyBkp9lAv5kFN4hXowkGxQ0WLcMqIAIgUVZNOrv9BueaaSI7oLzunZ2HHuPUCU4Eryhi7LeyKKU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":125833},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a2dcf9d0323750061eddc2aad13d07542d86b5eb","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-28T03:35:18.754Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.94","@balena/jellyfish-environment":"^5.0.9","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.6","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^14.17.29","@types/uuid":"^8.3.1","lint-staged":"^11.2.4","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.4","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.355-renovate-internal-patch-a2dcf9d0323750061eddc2aad13d07542d86b5eb_1635392323985_0.9184749491627284","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.355":{"name":"@balena/jellyfish-metrics","version":"1.0.355","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.355","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bc60c58e094e78b3bf6ede7986eee6e7b5eea604","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.355.tgz","fileCount":15,"integrity":"sha512-2V8tziS86rMvfVBvyhye1eyul77232raGCTowZ22JpWlgYIbfSaUS4GsEx333yylA0FETv2PxNBBc3ISfuMEcg==","signatures":[{"sig":"MEQCIBUvO+xTrz9856ECl2nNA+msTFAtsjgHrm3bNqwYK4f/AiBE8zu/fN7H0/K1Nei956c8U8WM2Z2+XlQR2mkx90gi0g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":125768},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"da5417bb59c5cd33fb779d9722a54841a8bbd2ad","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-28T03:39:49.753Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.94","@balena/jellyfish-environment":"^5.0.9","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.6","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^14.17.29","@types/uuid":"^8.3.1","lint-staged":"^11.2.4","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.4","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.355_1635392515179_0.5675707603033842","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.356-renovate-internal-patch-64a1a946caa06301a3f4533e3c03c15825ea2217":{"name":"@balena/jellyfish-metrics","version":"1.0.356-renovate-internal-patch-64a1a946caa06301a3f4533e3c03c15825ea2217","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.356-renovate-internal-patch-64a1a946caa06301a3f4533e3c03c15825ea2217","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3857d348a74c8a845154414b6ab2eed4904aed87","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.356-renovate-internal-patch-64a1a946caa06301a3f4533e3c03c15825ea2217.tgz","fileCount":15,"integrity":"sha512-f9Ey/PDiang3iVHjkf6CfhzpnEwdlt4FPXjQH2KOZtP8r4zuqOCABEnjoKO7Ym2W1DHXZmf8jjDoumYuNTz2+g==","signatures":[{"sig":"MEYCIQCGwjzVmf0nq9MG2lXr08+2qzPu/kwAGsDyraUTyZN91QIhANLnan4fNX9KKbz6xnCoBEOJsV71khHO5qOWod/4ZJ2b","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":125937},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"64a1a946caa06301a3f4533e3c03c15825ea2217","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-28T05:51:28.256Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.95","@balena/jellyfish-environment":"^5.0.9","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.6","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^14.17.29","@types/uuid":"^8.3.1","lint-staged":"^11.2.4","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.4","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.356-renovate-internal-patch-64a1a946caa06301a3f4533e3c03c15825ea2217_1635400511641_0.22405419931162407","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.356":{"name":"@balena/jellyfish-metrics","version":"1.0.356","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.356","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"75c04b89a0cdd8ee00a45bea703ea98f7c8e7001","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.356.tgz","fileCount":15,"integrity":"sha512-DfFQCQ06SCnKbsPieKPknakMggLRoY+f2dTDfYR16xN4TDciff/ztwXuNr37TYZGH2zqTajed46NPIWxdB6wwg==","signatures":[{"sig":"MEYCIQDTaw6Si4FotKEBKOb1uIw2W59WyD/30nxdrh1yF8y6jwIhAKFUtk3+MMsYgzVhjmh60jLfkWh0wt+1e1uuEOXd//P9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":125872},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0ba398670bbc73af95de35aef9de652b745a0316","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-28T05:56:58.821Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.95","@balena/jellyfish-environment":"^5.0.9","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.6","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^14.17.29","@types/uuid":"^8.3.1","lint-staged":"^11.2.4","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.4","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.356_1635400731463_0.7722585162462774","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.357-renovate-internal-patch-ee25c00bd315b98f98bf3c432016e02aa7e4ac5b":{"name":"@balena/jellyfish-metrics","version":"1.0.357-renovate-internal-patch-ee25c00bd315b98f98bf3c432016e02aa7e4ac5b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.357-renovate-internal-patch-ee25c00bd315b98f98bf3c432016e02aa7e4ac5b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2cb8ffabafbcd8a76e665cdc97ca9e80dabc46d8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.357-renovate-internal-patch-ee25c00bd315b98f98bf3c432016e02aa7e4ac5b.tgz","fileCount":15,"integrity":"sha512-NXg6AB5mB6Z1sDk1X3oUTpOOANNGor4mGJRWZhD1fkrI7oDUExEwUeKGoYMs741LD2SNrw5Xi8pnfW+ZexKqjQ==","signatures":[{"sig":"MEYCIQDCHLeMRQrzbMRUxOkUCiAZKSvaYuGYpM+t2chWf6MV1wIhAPjPvptkY/NxEpYwwv/eSDffqAw+9Moyj2tb2oloM1zs","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":126034},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ee25c00bd315b98f98bf3c432016e02aa7e4ac5b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-28T09:47:07.280Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.95","@balena/jellyfish-environment":"^5.0.9","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.6","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^14.17.29","@types/uuid":"^8.3.1","lint-staged":"^11.2.4","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.357-renovate-internal-patch-ee25c00bd315b98f98bf3c432016e02aa7e4ac5b_1635414676542_0.12887440901972935","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.357":{"name":"@balena/jellyfish-metrics","version":"1.0.357","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.357","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2df433b11bb86ce3b42744a5e10066cef92e94e4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.357.tgz","fileCount":15,"integrity":"sha512-K27nnIvLhENPA76mbwQA4TT4FWx/2mWRVRYye1RyQWutm+ofD/iAzhk0niGP3y8Y+0TKatYMObfd9st/LqV39w==","signatures":[{"sig":"MEQCIHZb0gyya6mstYpXbZ73D4aPaZKJrISKPIIpFWeWkamWAiAKrsQjNn/X0M5Ybx7YhfKGUsM3C+Cto9azC8u04FNjlQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":125969},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"678eb181c38e5658019dd7f2fe4f47540f724678","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-28T09:53:40.665Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.95","@balena/jellyfish-environment":"^5.0.9","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.6","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^14.17.29","@types/uuid":"^8.3.1","lint-staged":"^11.2.4","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.357_1635414959214_0.20828792251555783","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.358-renovate-internal-patch-98d27883d0d5962485160b52dd93133a5734accc":{"name":"@balena/jellyfish-metrics","version":"1.0.358-renovate-internal-patch-98d27883d0d5962485160b52dd93133a5734accc","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.358-renovate-internal-patch-98d27883d0d5962485160b52dd93133a5734accc","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fb3272d2c0574ffe3acb0687753eebf5ab30976e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.358-renovate-internal-patch-98d27883d0d5962485160b52dd93133a5734accc.tgz","fileCount":15,"integrity":"sha512-jUxZj6MmZqMW7UUlr/PJGq81HsFoSogamK28X7xKZ2slT2EQz4Gk7sd/MlFlUSzXIARBdvIgIfe+MC8wE4Y/zw==","signatures":[{"sig":"MEUCIA8Rx3PGLXVsJn5oVJBDtIJCGxMCB+CdBIFkeFaMCWFlAiEA+ZI+xU7UShLEtjDrqC0ZKZU7GgxjuiQa5zQ9md6OmRA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":126107},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"98d27883d0d5962485160b52dd93133a5734accc","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-28T11:20:19.024Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.96","@balena/jellyfish-environment":"^5.0.10","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.6","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^14.17.29","@types/uuid":"^8.3.1","lint-staged":"^11.2.4","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.358-renovate-internal-patch-98d27883d0d5962485160b52dd93133a5734accc_1635420216639_0.2674866464682757","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.358":{"name":"@balena/jellyfish-metrics","version":"1.0.358","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.358","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d473c61635054d0a5f4c358c3af85079797dd8e9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.358.tgz","fileCount":15,"integrity":"sha512-RxGk7FZ+aAXibNwWtixJ22uLIAqIAO2EuA+kTxgz3bZoaxDq0fvoRpmvRMlT6iQFbKwQNMshBhhplAwTCP58sA==","signatures":[{"sig":"MEUCIQDfhY6u+ZxGCPIY0OFtEywEUNOLzVObVt1Aetn0/QhXpAIgdoebseJD+HSorZIZ0M02QhFJnqb0bX6+C4OK8jf6fYw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":126042},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4e91a53cc10cd5bccc6137c468c4eb8a4baf1373","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-28T11:26:19.160Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.96","@balena/jellyfish-environment":"^5.0.10","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.6","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^14.17.29","@types/uuid":"^8.3.1","lint-staged":"^11.2.4","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.358_1635420486385_0.22591855280992745","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.359-renovate-internal-patch-8a8b9f731a37e92f62aaab90bae2d6259bbc16c5":{"name":"@balena/jellyfish-metrics","version":"1.0.359-renovate-internal-patch-8a8b9f731a37e92f62aaab90bae2d6259bbc16c5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.359-renovate-internal-patch-8a8b9f731a37e92f62aaab90bae2d6259bbc16c5","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bd7bb11ed7e99b36ff96f48293af298f82a1a255","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.359-renovate-internal-patch-8a8b9f731a37e92f62aaab90bae2d6259bbc16c5.tgz","fileCount":15,"integrity":"sha512-ZYPKYxAhJwKIIOx3nLAg275cGcIUVzdtrMOKIdxSXf7ltFt+o3EaMT38eEVmX9nJCv0NDJmLQ5Eu2Ou948jfyg==","signatures":[{"sig":"MEYCIQC8WejCF4rOnaV1p9Eu6EoN+lfeCkHS5jKqoC3MjNubXgIhAOt04Uj8Y7SsZLMsCU5eJ55SxMvpJvK6bQf8Bzgxo3D5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":126211},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8a8b9f731a37e92f62aaab90bae2d6259bbc16c5","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-28T13:47:08.436Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.97","@balena/jellyfish-environment":"^5.0.10","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.6","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^14.17.29","@types/uuid":"^8.3.1","lint-staged":"^11.2.4","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.359-renovate-internal-patch-8a8b9f731a37e92f62aaab90bae2d6259bbc16c5_1635428992158_0.5817941300417722","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.359":{"name":"@balena/jellyfish-metrics","version":"1.0.359","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.359","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1d09929d52d887a9e0d7ad05b663e677cee032f1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.359.tgz","fileCount":15,"integrity":"sha512-42yzC5GtvaOqvIban7BnIiWwVq0qUQSsvg8n9uwn/7YMKg5tLFwCPbvoYey2Z4YpW0+HSSxCbi0AN9Opozup1A==","signatures":[{"sig":"MEYCIQDGqAUJw9jC/oZOY71xv5gVDAIeTwua8vauFln+EsqL+AIhAN/HpUBji34LZpZ0kJGkvASm9DUTy7D9e9gY2+D/VXN4","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":126146},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"277cd0891380c1a942d645ddf8564df3c3cc4929","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-28T13:51:15.315Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.97","@balena/jellyfish-environment":"^5.0.10","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.6","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^14.17.29","@types/uuid":"^8.3.1","lint-staged":"^11.2.4","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.359_1635429221185_0.11496540740424988","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.360-renovate-external-non-major-6dca56c4fab73c99d622cf345c7e63ca1e77cea5":{"name":"@balena/jellyfish-metrics","version":"1.0.360-renovate-external-non-major-6dca56c4fab73c99d622cf345c7e63ca1e77cea5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.360-renovate-external-non-major-6dca56c4fab73c99d622cf345c7e63ca1e77cea5","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d5be5a0ac782d11b2c854e25e1e379b053946f83","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.360-renovate-external-non-major-6dca56c4fab73c99d622cf345c7e63ca1e77cea5.tgz","fileCount":15,"integrity":"sha512-M0u4nPjIwWyhcgh4DjwYgiX2o70XOroUIRNAF+gXbDB4VWrwmpuG9Knayp4VadudpnmA+b0WBZIpVMXXfaghtw==","signatures":[{"sig":"MEQCIChZO+KUyvYQCNC6wR/SIoBntobtTsMP2zckQcQwk81wAiAFFDD66AI5XbVQQvM/lKyq9JhjUCRxqjtbwiqHpJy7Qw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":126291},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6dca56c4fab73c99d622cf345c7e63ca1e77cea5","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-30T02:31:19.314Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.97","@balena/jellyfish-environment":"^5.0.10","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.7","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^14.17.32","@types/uuid":"^8.3.1","lint-staged":"^11.2.6","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.360-renovate-external-non-major-6dca56c4fab73c99d622cf345c7e63ca1e77cea5_1635561298663_0.898695535201333","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.360-renovate-major-external-major-ce96dbd9ec213cc3fc5918e5d8b1ad05b7948db7":{"name":"@balena/jellyfish-metrics","version":"1.0.360-renovate-major-external-major-ce96dbd9ec213cc3fc5918e5d8b1ad05b7948db7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.360-renovate-major-external-major-ce96dbd9ec213cc3fc5918e5d8b1ad05b7948db7","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bfe0ec40d57d7de7c96f1d62eadd7e1d9592033c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.360-renovate-major-external-major-ce96dbd9ec213cc3fc5918e5d8b1ad05b7948db7.tgz","fileCount":15,"integrity":"sha512-sJV6j6RxSHiIl+S+9NSJKl0HEI4KyqOyLiT5U10A+1EzTQwX5HzRtglZiLk4cU++8b2ErD8QNYmQ24sMSG7GGA==","signatures":[{"sig":"MEQCIDwBZCDg4rebH7//uDLUJqhOUea/4mdNyqQcBpTTeg6xAiAPGW3IHESENN+bDH7ru7MVcE/or2A9DCRQFb1xltzeUA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":126303},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ce96dbd9ec213cc3fc5918e5d8b1ad05b7948db7","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-30T02:32:58.684Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.97","@balena/jellyfish-environment":"^5.0.10","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.6","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.6","@types/uuid":"^8.3.1","lint-staged":"^11.2.4","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.6.1","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.360-renovate-major-external-major-ce96dbd9ec213cc3fc5918e5d8b1ad05b7948db7_1635561339191_0.016307725269906648","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.360":{"name":"@balena/jellyfish-metrics","version":"1.0.360","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.360","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7ed921a8d9981401702a47b524691af08366d90a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.360.tgz","fileCount":15,"integrity":"sha512-HwSSv/xJNgp4bPnGcBsvmaHgS2rvSSDGInJXoNV+L3K5jB5ZfvfsM8VkcMpvTqjqmQnBPkJaBTTd04ywsOIdiQ==","signatures":[{"sig":"MEUCIQCryGK0SW0fSQtnEDxHuil7/91lcPDy/0UVjRVfj8UvAgIgJ0JoiqNoPhOUyvv185jKDkP377GhsZAp5xa6kTRu0Sk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":126222},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4d29f19ce94e6cc9b9ec09abf5e722c13442cc33","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-30T02:36:59.345Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.97","@balena/jellyfish-environment":"^5.0.10","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.7","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^14.17.32","@types/uuid":"^8.3.1","lint-staged":"^11.2.6","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.360_1635561526009_0.8926553923018754","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.361-renovate-major-external-major-59eb1d54bfc8005806e3e655f2318c8f5775425c":{"name":"@balena/jellyfish-metrics","version":"1.0.361-renovate-major-external-major-59eb1d54bfc8005806e3e655f2318c8f5775425c","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.361-renovate-major-external-major-59eb1d54bfc8005806e3e655f2318c8f5775425c","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"114dfd84ab092e33e262f85db41471820cfef126","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.361-renovate-major-external-major-59eb1d54bfc8005806e3e655f2318c8f5775425c.tgz","fileCount":15,"integrity":"sha512-L8nmk6AZRWM7j2YugCEUSKfFkyHzeEzKI9A4e9jAmmnOtOW2cPe6SCuL7/ah4kpwYQLHCCHh4UkpNZ2qiYq8zw==","signatures":[{"sig":"MEQCIDcx7CBGOsBSReBtWYrKlsw9cVM4LbgtBQ7wKbjveU7RAiAvwl418KGSzkbkHM454oARf/Ef4jfkP8gh3UodeMNT4g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":126379},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"59eb1d54bfc8005806e3e655f2318c8f5775425c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-30T02:40:18.440Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.97","@balena/jellyfish-environment":"^5.0.10","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.7","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.6","@types/uuid":"^8.3.1","lint-staged":"^11.2.6","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.361-renovate-major-external-major-59eb1d54bfc8005806e3e655f2318c8f5775425c_1635561828127_0.9121009759568821","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.361-renovate-internal-patch-710747aa736e967161edc85e4e529892eea04019":{"name":"@balena/jellyfish-metrics","version":"1.0.361-renovate-internal-patch-710747aa736e967161edc85e4e529892eea04019","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.361-renovate-internal-patch-710747aa736e967161edc85e4e529892eea04019","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b000a37180fc90863754d67bc6078c2b3ecd28b1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.361-renovate-internal-patch-710747aa736e967161edc85e4e529892eea04019.tgz","fileCount":15,"integrity":"sha512-MHU3wS+A8fMK3+vjifgX0GBr3Z3MEH5KrWEfZjkYAJ+bfBYzAIsysji5YHo564NvTn5YYmTQifmsid9THGLB8A==","signatures":[{"sig":"MEQCIDRa7mp+vQw2YtASxdh1vQBV1psE9F4Ztxa+WGc4d/YmAiBVZLnK841AOfZpbYBQf+GM/agZB4Kn04HYVCN5Le5NPw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":126359},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"710747aa736e967161edc85e4e529892eea04019","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-30T03:31:28.723Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.98","@balena/jellyfish-environment":"^5.0.11","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.7","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^14.17.32","@types/uuid":"^8.3.1","lint-staged":"^11.2.6","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.361-renovate-internal-patch-710747aa736e967161edc85e4e529892eea04019_1635564904839_0.024092044747181962","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.361":{"name":"@balena/jellyfish-metrics","version":"1.0.361","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.361","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9e02525e15fe88476064415ba10b642b96a89c98","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.361.tgz","fileCount":15,"integrity":"sha512-CPYDAkh0EBBNmP3I0SHB/6MnQSy0z94XGCEIEtCY6O8DgOky0VtSSvH0ldZ0jReccNxJ2zgHN51nZpP9x2B7WA==","signatures":[{"sig":"MEUCIDcoxsBiN1OD1ztYjwPMWkd852myLCM0Loyp1ABRJg5PAiEAsgaNj8XHGmANEi7xRrb7VSL2sMvnpS5HM5l/Gc957vA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":126294},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"64151f903e0f4915f7db8f7ec7e5b1835430d7d0","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-30T03:37:38.662Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.98","@balena/jellyfish-environment":"^5.0.11","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.7","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^14.17.32","@types/uuid":"^8.3.1","lint-staged":"^11.2.6","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.361_1635565169056_0.08884366580457836","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.362-renovate-major-external-major-e8d0b241ce4130fff215de5efcb689b0ceffb1a6":{"name":"@balena/jellyfish-metrics","version":"1.0.362-renovate-major-external-major-e8d0b241ce4130fff215de5efcb689b0ceffb1a6","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.362-renovate-major-external-major-e8d0b241ce4130fff215de5efcb689b0ceffb1a6","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"94e8615744ebce7b3a9c387b348fb51d47771c66","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.362-renovate-major-external-major-e8d0b241ce4130fff215de5efcb689b0ceffb1a6.tgz","fileCount":15,"integrity":"sha512-/wwAsDsalBVLPajVMKGDZLt3d/wMTYNr8Bymf10khP+79HuYtuvYTjCg/jFSYC29+z5TTnsIOxz8uHifGfcczA==","signatures":[{"sig":"MEUCICzVFoDW2Ti5r/1owqCFmDLzMYcCkF+mMUfzmxgSJS83AiEAgJrVI3b87/tA9sIGgfzYCvRY/mhKZhzlDuczkWIcbj4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":126451},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e8d0b241ce4130fff215de5efcb689b0ceffb1a6","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-30T03:39:28.124Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.98","@balena/jellyfish-environment":"^5.0.11","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.7","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.6","@types/uuid":"^8.3.1","lint-staged":"^11.2.6","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.362-renovate-major-external-major-e8d0b241ce4130fff215de5efcb689b0ceffb1a6_1635565348609_0.7686639677342948","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.362-renovate-internal-patch-1be8bf8328c0823d4d5267ce2b5bba04614cc680":{"name":"@balena/jellyfish-metrics","version":"1.0.362-renovate-internal-patch-1be8bf8328c0823d4d5267ce2b5bba04614cc680","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.362-renovate-internal-patch-1be8bf8328c0823d4d5267ce2b5bba04614cc680","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6a5ec30a25c0da3eed3c5dde5fd4838f34fc7dfe","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.362-renovate-internal-patch-1be8bf8328c0823d4d5267ce2b5bba04614cc680.tgz","fileCount":15,"integrity":"sha512-Nl/IlQeQE88wQKNlKYO21qp8uBHQgm8s6ZOP//QWGPmyyb50PRJPBG4oktjXuhh2i3bq0Mt1RwKpOBg2mIXAMQ==","signatures":[{"sig":"MEUCIQC1pVHh6ryoDKztaCwC2iOGM7WsapKbLtdE2D26ptuvvgIgG7sY2HYsqBBDyVFAxk33wd+WJGtWP1aCMUcDA0lMlnM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":126463},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"1be8bf8328c0823d4d5267ce2b5bba04614cc680","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-30T03:48:08.806Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.99","@balena/jellyfish-environment":"^5.0.11","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.7","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^14.17.32","@types/uuid":"^8.3.1","lint-staged":"^11.2.6","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.362-renovate-internal-patch-1be8bf8328c0823d4d5267ce2b5bba04614cc680_1635565898678_0.0710441490187097","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.362":{"name":"@balena/jellyfish-metrics","version":"1.0.362","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.362","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5dcc9df222e3d91cfff3486cf03796484e7c95de","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.362.tgz","fileCount":15,"integrity":"sha512-UJxsTd6Q0xnxD9taiG6pp5rGeAquYScG7uP0mFVBVAhXmKoMpacijiCYkpuLY+yCV9MX6pH6AHMzJqmRc+0new==","signatures":[{"sig":"MEUCIQDS8+uD7jzOexQSI89aW4McoroVExPeFuyqDI9Mt0X5sAIgambBrKGADbvDFMC2LbG+FASNwkMGO/DFzXuqTpuKJ9g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":126398},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c10d942a235bc68061ff3fac08f6fd5e8a5b5fda","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-30T03:58:29.469Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.99","@balena/jellyfish-environment":"^5.0.11","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.7","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^14.17.32","@types/uuid":"^8.3.1","lint-staged":"^11.2.6","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.362_1635566446589_0.6884883224628766","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.363-renovate-major-external-major-c532daacd23f01375d342e864b1ada9f14cbe619":{"name":"@balena/jellyfish-metrics","version":"1.0.363-renovate-major-external-major-c532daacd23f01375d342e864b1ada9f14cbe619","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.363-renovate-major-external-major-c532daacd23f01375d342e864b1ada9f14cbe619","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c4bcfe4bfffcabcdaa0882d7330ec57037c977d2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.363-renovate-major-external-major-c532daacd23f01375d342e864b1ada9f14cbe619.tgz","fileCount":15,"integrity":"sha512-Zfx6d9lBqRrE9RBH6QQRKsg5BT7uGp2JMxKE0zJ1pX/F6VeX15qejkyEzJubJmD90Dmaq9OBDMrgVrPZKOl0ww==","signatures":[{"sig":"MEUCIAkXq6Ywdp6sR6utoUDB82Fgx0B3h2Me7ojesa+l+GIgAiEA90pvZPExvz4w8Bqu0G21jica3T5LvoCGOSBXjCYuRwU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":126555},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c532daacd23f01375d342e864b1ada9f14cbe619","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-30T04:03:52.107Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.99","@balena/jellyfish-environment":"^5.0.11","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.7","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.6","@types/uuid":"^8.3.1","lint-staged":"^11.2.6","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.363-renovate-major-external-major-c532daacd23f01375d342e864b1ada9f14cbe619_1635566888035_0.9636017030149167","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.363":{"name":"@balena/jellyfish-metrics","version":"1.0.363","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.363","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6aa5af6eff29ce9e0f8aa5c4dfeb8207ca89aa07","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.363.tgz","fileCount":15,"integrity":"sha512-saPpIVZzUQRAJyauM/NvV8GfWNQPW2ZRp3yQ+ZU7Vw1Yj6wge0dBRiqrE1QoGJ/eKq0NXMoMsBxjIyuU4hyI7A==","signatures":[{"sig":"MEUCIGR9tKmTRr2bNQtnccaCHMS9PwmzShyq8uTz5P2B7aPfAiEA04LLuUp3nWoXEX7g9C0rHEr6uNXsCYB5enGQf0yQe2k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":126484},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"072c6a69e6b1681855abaae396360ae9bdca28af","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-10-30T10:04:45.185Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.99","@balena/jellyfish-environment":"^5.0.11","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.7","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.6","@types/uuid":"^8.3.1","lint-staged":"^11.2.6","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.363_1635588406164_0.5964114543637404","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.364-renovate-internal-patch-13d2e7a2dbac663ade62ffb4e77dfe26399e8b3a":{"name":"@balena/jellyfish-metrics","version":"1.0.364-renovate-internal-patch-13d2e7a2dbac663ade62ffb4e77dfe26399e8b3a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.364-renovate-internal-patch-13d2e7a2dbac663ade62ffb4e77dfe26399e8b3a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b382e643c0329db673dc19370666a43a05f35186","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.364-renovate-internal-patch-13d2e7a2dbac663ade62ffb4e77dfe26399e8b3a.tgz","fileCount":15,"integrity":"sha512-Js5Y4sv7Es1TxGrzjX4bI4w9qn9Kyd6IEpWvYj/Q8R/WMWQOOoZfb2s0gS3k5Pz4gCtx1beTN2QVtH04sfhicw==","signatures":[{"sig":"MEQCIBUzBwO2sgVmcOg4tc8upY3Zwo/wZIRHb1KYkIaqH6F0AiAX7WiMjY9FGXocoXTxc8dQaK2DTATcb9Ib/3GbKX00MA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":126622},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"13d2e7a2dbac663ade62ffb4e77dfe26399e8b3a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-05T23:09:28.546Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.100","@balena/jellyfish-environment":"^5.0.12","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.7","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.6","@types/uuid":"^8.3.1","lint-staged":"^11.2.6","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.364-renovate-internal-patch-13d2e7a2dbac663ade62ffb4e77dfe26399e8b3a_1636154024126_0.3189784429414253","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.364":{"name":"@balena/jellyfish-metrics","version":"1.0.364","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.364","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6225fc2a2246113f04731349098be328675659ae","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.364.tgz","fileCount":15,"integrity":"sha512-8/GkJ+I44tRM4gjhlj01d7FUKf19n3xJX9AzlNzvYCktsRvYyr76cafhMaj7IEd3AFA4t3JCbmqrWs08MsZInQ==","signatures":[{"sig":"MEUCIQDWwbKIgCw0CePTV62Au1egrEiP2ob0Nxj3FYo+XlixkgIgZUc2Z13s8ysrrp0LfJNH8k4/BIU+4U1MWs1+6bAAjUw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":126557},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"1592796b7fa52f74e1a9b6cdf4374e74f371104a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-05T23:23:53.960Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.100","@balena/jellyfish-environment":"^5.0.12","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.7","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.6","@types/uuid":"^8.3.1","lint-staged":"^11.2.6","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.364_1636154756539_0.932198484165925","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.365-renovate-internal-patch-c76aebe2427b81931cbf0d64c2e38eea50da807d":{"name":"@balena/jellyfish-metrics","version":"1.0.365-renovate-internal-patch-c76aebe2427b81931cbf0d64c2e38eea50da807d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.365-renovate-internal-patch-c76aebe2427b81931cbf0d64c2e38eea50da807d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ce987552baa2c5e63708fa237d196eb46a13397b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.365-renovate-internal-patch-c76aebe2427b81931cbf0d64c2e38eea50da807d.tgz","fileCount":15,"integrity":"sha512-NJrrEf7iIrk+5wLBgbI88Q4thjykNj0X6cJhwVxZGAQ9xarRjZd+38C2kM233o4nlQOTh73H1BNH1qO1fJ+g5w==","signatures":[{"sig":"MEQCIE9JLga5EJ35aUcU1Or86aeuxKuRpEaR5272F7GnrBxHAiABQClj5TWaATvHlnrjvs3vRUi6CDt8dnSmSgDTNnW57g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":126727},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c76aebe2427b81931cbf0d64c2e38eea50da807d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-06T03:41:21.031Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.101","@balena/jellyfish-environment":"^5.0.12","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.7","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.6","@types/uuid":"^8.3.1","lint-staged":"^11.2.6","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.365-renovate-internal-patch-c76aebe2427b81931cbf0d64c2e38eea50da807d_1636170223671_0.022674084855560217","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.365":{"name":"@balena/jellyfish-metrics","version":"1.0.365","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.365","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e82b497601d5d1fb963ee03544fde0164eb3604c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.365.tgz","fileCount":15,"integrity":"sha512-GyQQsfPcIK0e1u8eTPROXqHfYEaf8xC0rutE5tvklIdzgKVyDP9MgqiMhhRZ1bUZFxHbA5wpn6yJ8eI0q/ijDA==","signatures":[{"sig":"MEUCIQDdNduWdMo3Vh7oSZ9iu9JFFaUrfjzovy73bwDxR2J1sgIgFYKT+W2LVV0Owjj91ivqXRbtfsvVa3l8czjrtYqS654=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":126662},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"661feb2a00cdf175501ce5fe91a529e80b043c47","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-06T03:45:00.852Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.101","@balena/jellyfish-environment":"^5.0.12","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.7","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.6","@types/uuid":"^8.3.1","lint-staged":"^11.2.6","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.365_1636170394882_0.23825073551273213","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.366-renovate-internal-patch-5dcb742ae74fd69f95f6ed75db97dd44c24b1a7c":{"name":"@balena/jellyfish-metrics","version":"1.0.366-renovate-internal-patch-5dcb742ae74fd69f95f6ed75db97dd44c24b1a7c","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.366-renovate-internal-patch-5dcb742ae74fd69f95f6ed75db97dd44c24b1a7c","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ec9a38b98f42e87ad3c1386215f62f1cf8e22fe0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.366-renovate-internal-patch-5dcb742ae74fd69f95f6ed75db97dd44c24b1a7c.tgz","fileCount":15,"integrity":"sha512-aCksQaG8B5F4k7fl94G7JnRKe9ueObUa4dOhFWWpujSQ3ZyL2l+fcpJE3dXd+sbS2LPFgcuvofr6XbhZlCgKqQ==","signatures":[{"sig":"MEQCIGiRforelKw2sCGxM6Z0uYE7GeDwhKVn+u98//HKiv9fAiBjfhQUO+V5Zkfs4SfKdenVQRJBP7L55znJhEYQR20cmQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":126799},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5dcb742ae74fd69f95f6ed75db97dd44c24b1a7c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-07T03:05:43.624Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.103","@balena/jellyfish-environment":"^5.0.13","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.7","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.6","@types/uuid":"^8.3.1","lint-staged":"^11.2.6","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.366-renovate-internal-patch-5dcb742ae74fd69f95f6ed75db97dd44c24b1a7c_1636254586490_0.9236035487638496","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.366":{"name":"@balena/jellyfish-metrics","version":"1.0.366","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.366","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"567fd05836897459a9fe64c9b57219b5d5d1fee5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.366.tgz","fileCount":15,"integrity":"sha512-p1uEcUYdItL0P+22CKTsznP/HtcI6/0AraIqryq3VByDb91AhOCUrj2fxJyleh5dtTKP5q7I89CNoww4wKCf0Q==","signatures":[{"sig":"MEQCIA8Z/lA1kP3xkBLKUp8r3HSwF2TcwxXXb/01O+evu9aQAiArI39b/ICqPARs2o+bQ4lrk/o3BfKM/81B7xmt7vjO1A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":126734},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"21e39b18ad4fa41074a700305289f95c8dca69e1","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-07T03:10:51.963Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.103","@balena/jellyfish-environment":"^5.0.13","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.7","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.6","@types/uuid":"^8.3.1","lint-staged":"^11.2.6","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.366_1636254892242_0.428798893693104","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.367-renovate-external-non-major-a2eb50ac38b4747bcca7645ec771ce79ae19d3a6":{"name":"@balena/jellyfish-metrics","version":"1.0.367-renovate-external-non-major-a2eb50ac38b4747bcca7645ec771ce79ae19d3a6","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.367-renovate-external-non-major-a2eb50ac38b4747bcca7645ec771ce79ae19d3a6","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d3bb0907166ef4cced10f04cc647dca5ff26c9c5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.367-renovate-external-non-major-a2eb50ac38b4747bcca7645ec771ce79ae19d3a6.tgz","fileCount":15,"integrity":"sha512-oBAShyraH+UNORQqoY5t7MknsZUlJqKM2DVG8q74r+n/pHDQ0WEdtWU913R7Ul9fYYP5ZMeji9lo+J8XHOWMdA==","signatures":[{"sig":"MEYCIQDfPlXbO7E8UYHU5WVt0vUJE8l8AD4v8bXsBfDkc2E70QIhAMfAswkd20czR4Fed/kQy4KxQBDWoeckHZG7fnLuoDYZ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":126890},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a2eb50ac38b4747bcca7645ec771ce79ae19d3a6","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-07T03:13:34.822Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.103","@balena/jellyfish-environment":"^5.0.13","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.8","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.6","@types/uuid":"^8.3.1","lint-staged":"^11.2.6","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.367-renovate-external-non-major-a2eb50ac38b4747bcca7645ec771ce79ae19d3a6_1636255233335_0.20833333163906897","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.367-renovate-external-non-major-fd1a4e5e13989d53288cf52388087060b2991265":{"name":"@balena/jellyfish-metrics","version":"1.0.367-renovate-external-non-major-fd1a4e5e13989d53288cf52388087060b2991265","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.367-renovate-external-non-major-fd1a4e5e13989d53288cf52388087060b2991265","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"429473593dabac875306e579614422546495e0ee","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.367-renovate-external-non-major-fd1a4e5e13989d53288cf52388087060b2991265.tgz","fileCount":15,"integrity":"sha512-a+/foPQhTX1xJAVI9q9E0Q61gn71gmnikLVaJh/A3xUkIrJbm9sj9OLoDlI2KBj2t3EGMakIV5yVq6ZyStW7IA==","signatures":[{"sig":"MEQCIFuzpty2Ik2kXTK2SET4faz1i4jClWWQTh0kRVnnCz5uAiBQaqiU7xp7VBTUrI3kBfwoaL25vxM3MktO6dd7wW/sMg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":126879},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"fd1a4e5e13989d53288cf52388087060b2991265","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-08T22:07:58.351Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.103","@balena/jellyfish-environment":"^5.0.13","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.8","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^11.2.6","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.367-renovate-external-non-major-fd1a4e5e13989d53288cf52388087060b2991265_1636409862976_0.9947616611762098","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.367":{"name":"@balena/jellyfish-metrics","version":"1.0.367","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.367","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b674dbb4cc3b58043ec537995c5c2fa88d442c31","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.367.tgz","fileCount":15,"integrity":"sha512-H57LcRGI8w2zsEDEX1PG8t1QvQGeLY1L50y6uQq+V2ScVsMG90fG4XcWCNNsrIbWi0xHGMI3P8Nu3ijh6DteZw==","signatures":[{"sig":"MEQCIQCeTyLov1c/uJqU9KZiHEKkXIsvi7mpzOkXnhJcAGfJ6wIfZ0PeIRPO2svXaSrG0NWVlPjBeAJ/wek/8wLylugUhg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":126810},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b831bac329f124df78208494032aa852437e2c9d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-08T22:19:20.480Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.103","@balena/jellyfish-environment":"^5.0.13","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.8","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^11.2.6","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.367_1636410238144_0.07279625222945785","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.368-renovate-internal-patch-af1a81130daa5bb72b1456b92ae13c94f8518250":{"name":"@balena/jellyfish-metrics","version":"1.0.368-renovate-internal-patch-af1a81130daa5bb72b1456b92ae13c94f8518250","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.368-renovate-internal-patch-af1a81130daa5bb72b1456b92ae13c94f8518250","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e20414982b039a54ddc157694973518b4dccd6f4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.368-renovate-internal-patch-af1a81130daa5bb72b1456b92ae13c94f8518250.tgz","fileCount":15,"integrity":"sha512-hB8z7yDeBhyeMRnTgBrDIAGJ878dvNAMxesqmzJvgsvIP5Y2Hh3rIln9XNKRBf/Z9v+XuSbSLKPBbhPPRFo2gA==","signatures":[{"sig":"MEQCIAku55RFr97w9S60Mwe4uzFQM4pzK2p7d5HEAW/8/uwFAiBg4C/6awz1mihEOBPS6zVBnbYeFNlzGTOOLBMbWRfMAg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":126947},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"af1a81130daa5bb72b1456b92ae13c94f8518250","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-09T13:53:05.190Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.104","@balena/jellyfish-environment":"^5.0.14","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.8","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^11.2.6","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.368-renovate-internal-patch-af1a81130daa5bb72b1456b92ae13c94f8518250_1636466158889_0.32609227249226547","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.368":{"name":"@balena/jellyfish-metrics","version":"1.0.368","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.368","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8e0e8c1ba6bec63742d67d71ae6930af87d5dac1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.368.tgz","fileCount":15,"integrity":"sha512-xDA1lfgpGL819TWDSVa9kzdw9uy75JPpvO9XfXPrNidGognvImlhRPm9SI2TwAP/GtiBsIYV1DwsCZ6/RRuYMQ==","signatures":[{"sig":"MEYCIQDRlUHNpq8SDE88xYKsHHmvvrGYzlyzwbygm1l/zHx0QwIhAI3y/Z4mDvI9WyIbHuEB+7rjOTlTk0JKokApcHZuFEjx","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":126882},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"715216dd781fbb128c85caf701933b6c9384b032","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-09T13:57:54.226Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.104","@balena/jellyfish-environment":"^5.0.14","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.8","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^11.2.6","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.368_1636466414202_0.1965503056854061","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.369":{"name":"@balena/jellyfish-metrics","version":"1.0.369","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.369","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1a459d432421d634b7fff28d25d2f7d2b1335169","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.369.tgz","fileCount":15,"integrity":"sha512-HVZvE6rmOGB5SPra4La/5jzYjRyUjI7KWtL5CmP38nH+PrHmlxO9KzoO3VmRXQNNTJJYI0jJFx9R17Q3VCHX+Q==","signatures":[{"sig":"MEYCIQCbaxCG48ITcCEYySLZiUKWr5Cf2Qhj0qhbIor8QIg3/wIhALdHmBjSxXbI9gqYowHylSNJFyxlm0YC3z/FnJChLIAi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":126989},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"41fd836dee99661f8fe1b3427cce02a025e8a8ac","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-11T05:31:03.674Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.104","@balena/jellyfish-environment":"^5.1.0","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.8","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^11.2.6","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.369_1636608783581_0.3304494197055856","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.369-renovate-internal-patch-271754aff34b3be97b8d10d433d9dfeb1db0c76b":{"name":"@balena/jellyfish-metrics","version":"1.0.369-renovate-internal-patch-271754aff34b3be97b8d10d433d9dfeb1db0c76b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.369-renovate-internal-patch-271754aff34b3be97b8d10d433d9dfeb1db0c76b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"317542ee6b5f9156beafd8f3f550ecec4dc31b62","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.369-renovate-internal-patch-271754aff34b3be97b8d10d433d9dfeb1db0c76b.tgz","fileCount":15,"integrity":"sha512-rHJV3A5/6suPnvkcTsZLkNEO+yo7aCPsdQkLnf9O/Liwak9YsJWe3lewUcZ8keAXH8sSvtKh9I0bc2ukPerVaQ==","signatures":[{"sig":"MEUCIQDSG0yFWE0o39IBvdx7LIRTpiEo3Rj0CY+4pcVibinScQIgPQw7SEKZFuC25pq1uHfgf3g0C3SfHEdePgBmzgr8qa4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":127133},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"271754aff34b3be97b8d10d433d9dfeb1db0c76b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-11T05:31:17.898Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.106","@balena/jellyfish-environment":"^5.1.0","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.8","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^11.2.6","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.369-renovate-internal-patch-271754aff34b3be97b8d10d433d9dfeb1db0c76b_1636608848496_0.15111453974199263","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.370-renovate-internal-patch-cd1ffc63ae764e5450fb224a9fb4a3da0e9b2cfe":{"name":"@balena/jellyfish-metrics","version":"1.0.370-renovate-internal-patch-cd1ffc63ae764e5450fb224a9fb4a3da0e9b2cfe","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.370-renovate-internal-patch-cd1ffc63ae764e5450fb224a9fb4a3da0e9b2cfe","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9ed4acbec92380577be3a930c11b27afd921de16","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.370-renovate-internal-patch-cd1ffc63ae764e5450fb224a9fb4a3da0e9b2cfe.tgz","fileCount":15,"integrity":"sha512-CkxSUNACKS6B0ruS6f6cX8O73Ur11ZQSf7XiAqu6Je5vi6xQReXvs+OexbFqi6CG1YxBD6WYyz69LK5a1AYWvg==","signatures":[{"sig":"MEQCIBCleZ8HQceQC43BCqniD1pnkmHZcE3nsxw6v8Ct+0kmAiBtBJGkq2CFTXsLdKTI86sRt4sx9FtpG4dtC6iQPwwoqw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":127159},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"cd1ffc63ae764e5450fb224a9fb4a3da0e9b2cfe","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-11T05:33:47.709Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.106","@balena/jellyfish-environment":"^5.1.0","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.8","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^11.2.6","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.370-renovate-internal-patch-cd1ffc63ae764e5450fb224a9fb4a3da0e9b2cfe_1636608982790_0.23393597727610005","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.370":{"name":"@balena/jellyfish-metrics","version":"1.0.370","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.370","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e19483ecb9d91b86ec4a9883353660b357d36c98","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.370.tgz","fileCount":15,"integrity":"sha512-clOjiBFmMly/M/2Ofl5G9DLHsOp8iWQLnHWQQxsNCDZb25i45vI6IRnGRwt8xAZsky4JzPUwYJVLt5gmUytM1g==","signatures":[{"sig":"MEUCIQDMXUGwOP02lYHNWhymZyStsDI8VwbnOcJh8p86NcK/gQIgcbgrqO1lNCt1Amdy5KLjr/TGc2S+fgWcWxtzDPbWu+k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":127094},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"fe5db2c25e15b5db334f90b5de1714d99aeaf53e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-11T05:38:10.123Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.106","@balena/jellyfish-environment":"^5.1.0","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.8","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^11.2.6","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.370_1636609204661_0.40538726005160464","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.371-renovate-internal-patch-9e165cf5f8476c3e196cf6660e877cb423a3b782":{"name":"@balena/jellyfish-metrics","version":"1.0.371-renovate-internal-patch-9e165cf5f8476c3e196cf6660e877cb423a3b782","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.371-renovate-internal-patch-9e165cf5f8476c3e196cf6660e877cb423a3b782","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2fb45e0cc41147d86f154aab3cd62f977c0c9cbd","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.371-renovate-internal-patch-9e165cf5f8476c3e196cf6660e877cb423a3b782.tgz","fileCount":15,"integrity":"sha512-+QVa7NdqRiOuq8t2pL/zUzdyU71CyT5wEcmqbWtuPhME5aVcB8iE4ur4AUNTln/I4rnziRtoFelvc7n2tx8FMA==","signatures":[{"sig":"MEYCIQDZfTbhXFHwEdSuIVxk/YVlzS9OfY4nLZWv7Zc27xqImgIhAOxjc+jbefR09tDlJYSpABULDbb4U4tcTOUFV/L8WZrV","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":127267},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9e165cf5f8476c3e196cf6660e877cb423a3b782","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-12T03:58:58.717Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.106","@balena/jellyfish-environment":"^5.1.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.8","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^11.2.6","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.371-renovate-internal-patch-9e165cf5f8476c3e196cf6660e877cb423a3b782_1636689691168_0.40824599803368167","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.371":{"name":"@balena/jellyfish-metrics","version":"1.0.371","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.371","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"03187c50de7262fc1147dbf0469114e3f2f74881","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.371.tgz","fileCount":15,"integrity":"sha512-0W/w0JvBuaPTLRAKYg25dyQSBq/jOZoj0vuO6m200fln8Gwvglh0wJgpQkaPI8U3TgOQr78ylW+YmjDMLnbQ+w==","signatures":[{"sig":"MEYCIQDFMusq5JLsUf/QZfwLPVugxL5NgcA3Bd69k+Tg7JSwNgIhAL6ReaRcRP7IDJCPsbVwKie2iq54aWBPuYkYo4uLKDjx","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":127202},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c78a4ee87729167baaa1937d5055489c0c11449b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-12T04:02:30.645Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.106","@balena/jellyfish-environment":"^5.1.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.8","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^11.2.6","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.371_1636689862605_0.7279586550197141","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.372-renovate-internal-patch-a0d0f97775602dc24452e67af5abe1efde63abca":{"name":"@balena/jellyfish-metrics","version":"1.0.372-renovate-internal-patch-a0d0f97775602dc24452e67af5abe1efde63abca","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.372-renovate-internal-patch-a0d0f97775602dc24452e67af5abe1efde63abca","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ed9368e17eeeb5280518ce7b979fefa81b842257","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.372-renovate-internal-patch-a0d0f97775602dc24452e67af5abe1efde63abca.tgz","fileCount":15,"integrity":"sha512-4AVjHcBd6WPbJmVo8/x0l8LT/HPmZSc68UKeegQKzSIYfS6iR7eMwMAW1IUrGuYycJun0QNp24cbMTJ6SD5+gQ==","signatures":[{"sig":"MEQCIFTdiD7aOYdvw8eZZ5It9tssvHA08N1UNAq1f/zee/sxAiAdgcL/Y2wDO7bTeoXPeFbbA9Fd24/shYX8tStI23cgQw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":127372},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a0d0f97775602dc24452e67af5abe1efde63abca","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-12T05:40:45.112Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.107","@balena/jellyfish-environment":"^5.1.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.8","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^11.2.6","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.372-renovate-internal-patch-a0d0f97775602dc24452e67af5abe1efde63abca_1636695792806_0.4716439866957367","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.372":{"name":"@balena/jellyfish-metrics","version":"1.0.372","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.372","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f038aa1169bdf282c9a7522da648da34e6dd614c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.372.tgz","fileCount":15,"integrity":"sha512-F4jzAcb20959nwZwUhBwOuk+SkHe8HbniEAuLQJJkTMjmfYmIoWw9VSxqGfJrd+N+dtZUwLCfi4Bqsp6Xiy6Qg==","signatures":[{"sig":"MEQCIDUrWLReqFymk/CvV+xTcmT508FZlwPWc3Gso0RwZjuIAiA03pQeYKUDB5+rb767jrn/VNvUswgBEuDrfzNUXN1EtQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":127307},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"283a445a1f76a288eec668770796e21e9c2d946c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-12T05:44:20.171Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.107","@balena/jellyfish-environment":"^5.1.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.8","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^11.2.6","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.372_1636695969621_0.804310838818352","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.373-renovate-internal-patch-1589ac669cf5ae2a4e196e95c352d7144c225dc5":{"name":"@balena/jellyfish-metrics","version":"1.0.373-renovate-internal-patch-1589ac669cf5ae2a4e196e95c352d7144c225dc5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.373-renovate-internal-patch-1589ac669cf5ae2a4e196e95c352d7144c225dc5","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5e21e9df6fcac8e531620f5785dee1ac81b15231","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.373-renovate-internal-patch-1589ac669cf5ae2a4e196e95c352d7144c225dc5.tgz","fileCount":15,"integrity":"sha512-3ghtQVkC33SOiyY+sN4Dv66ee7I1fZi9gwUZ4efgTqbOHed+eU8Nni4vQ9+9/Je5UW4HvuF+dST0ub5Lfa+MwQ==","signatures":[{"sig":"MEQCID80ETTIo86YRuWfA8t5HPJew43SMvmyh7dftaKxrvO3AiBh5m+kvNOh45WdIU2EEJ0f3NghTYHBkOvWHIh0uK/2+g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":127477},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"1589ac669cf5ae2a4e196e95c352d7144c225dc5","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-13T03:12:49.465Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.108","@balena/jellyfish-environment":"^5.1.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.8","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^11.2.6","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.373-renovate-internal-patch-1589ac669cf5ae2a4e196e95c352d7144c225dc5_1636773315555_0.6613529313526518","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.373":{"name":"@balena/jellyfish-metrics","version":"1.0.373","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.373","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0118ccf76b86ba04c0a6aef55f30bdd23240a43f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.373.tgz","fileCount":15,"integrity":"sha512-BQtp4JdmedHJWbu9LsjKIn6mK7dY6PHxD6iyYJR9J9Vku7t/YG9fy+rN1k/96O2CMr1hgcRleiYzPvL7Ftz5UQ==","signatures":[{"sig":"MEUCIFp91MtaZ+1zI4kciLZKg0v8pHd88nenrQ017n+4T/BCAiEA+V3bs8pD+q6KXMCPO26VQMfnRyo2yBszZgqsApD8LKQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":127412},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9d44e8af21d734e628ede68562ba55816f57e551","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-13T03:16:05.173Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.108","@balena/jellyfish-environment":"^5.1.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.8","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^11.2.6","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.373_1636773476183_0.712069670806406","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.374-renovate-internal-patch-5aa588a12665bee17d16516a08fd3973d3ea5d68":{"name":"@balena/jellyfish-metrics","version":"1.0.374-renovate-internal-patch-5aa588a12665bee17d16516a08fd3973d3ea5d68","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.374-renovate-internal-patch-5aa588a12665bee17d16516a08fd3973d3ea5d68","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6583f2016846c41acc39309b5f13d7b3fe9be0be","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.374-renovate-internal-patch-5aa588a12665bee17d16516a08fd3973d3ea5d68.tgz","fileCount":15,"integrity":"sha512-R2J/hFf9e4K24pwxak/tRLJhyU8G5DsoGq/S/wp4awg6iTMwUEP+aPScwqHwsz9/XmjpyxkUPby51uCxXOrlDA==","signatures":[{"sig":"MEYCIQDCvqaK+xl1ArAaWmTIdrBW1KbS+t/hd1agkU1AJ57n4AIhAOJmZxDwjd0HEiRkSsx+UgZ1AQMhcZcmW2YWMllHGPBa","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":127582},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5aa588a12665bee17d16516a08fd3973d3ea5d68","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-13T10:25:26.315Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.109","@balena/jellyfish-environment":"^5.1.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.8","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^11.2.6","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.374-renovate-internal-patch-5aa588a12665bee17d16516a08fd3973d3ea5d68_1636799257462_0.8071992582514242","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.374":{"name":"@balena/jellyfish-metrics","version":"1.0.374","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.374","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9b9412e702f5b7b49b266c881672ad46da02e848","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.374.tgz","fileCount":15,"integrity":"sha512-48JTIoWzWQSQQsS7w8r/WBz14ga7FdWQ3G0gRMRjHsTSVti2Tv61ztycmCDG24N2j8/TWbW4JFgBcJm8rWnZyg==","signatures":[{"sig":"MEUCIQC0l3mEhM893Withsy1bu8lG5CCSgSwnl2+cCXsNXL/zgIgEd0AyVBs5T7LvZh6IoKNmMADSG5SIPWTHdI91nCtQqw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":127517},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9d0852b9ca0d1fac83809966d2c0237839a79fad","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-13T10:28:49.461Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.109","@balena/jellyfish-environment":"^5.1.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.8","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^11.2.6","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.374_1636799427949_0.5270659012898038","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.375-renovate-major-external-major-510a92822f738d5b984b31a74abe542e7fc04c6f":{"name":"@balena/jellyfish-metrics","version":"1.0.375-renovate-major-external-major-510a92822f738d5b984b31a74abe542e7fc04c6f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.375-renovate-major-external-major-510a92822f738d5b984b31a74abe542e7fc04c6f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c3da48380544c596181ebd55aa1f4505d79b592c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.375-renovate-major-external-major-510a92822f738d5b984b31a74abe542e7fc04c6f.tgz","fileCount":15,"integrity":"sha512-ATArwJlIu7JBKrk8IHehZrilXPrp4HxT+No+Sm0EqyBr93ljU0RVC+WKByWZcPXmcUhHQOy0UC9Zre7taw/DNA==","signatures":[{"sig":"MEUCIQCYXDb2k8TQNHdN1oVj7VXEcKnEmZ7dkbBpT2JjnAjXRwIgAfXGXOzBKIdRgq7incrC91zEIORMHVsOZBHYNIRc1qA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":127675},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"510a92822f738d5b984b31a74abe542e7fc04c6f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-14T12:10:07.798Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.109","@balena/jellyfish-environment":"^5.1.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.8","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.375-renovate-major-external-major-510a92822f738d5b984b31a74abe542e7fc04c6f_1636891964594_0.022746230986362637","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.375-renovate-internal-patch-84a01042ae19828cc1a0ff51b1c7aaf5ddc3b06c":{"name":"@balena/jellyfish-metrics","version":"1.0.375-renovate-internal-patch-84a01042ae19828cc1a0ff51b1c7aaf5ddc3b06c","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.375-renovate-internal-patch-84a01042ae19828cc1a0ff51b1c7aaf5ddc3b06c","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3a2b060251c362e4283afee432a0bda674cc1237","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.375-renovate-internal-patch-84a01042ae19828cc1a0ff51b1c7aaf5ddc3b06c.tgz","fileCount":15,"integrity":"sha512-8gwcqcKZ+YZtyWyeXKGNhHlxaCUVYVZc8qAuAZX2QZyWRtHYTS8UZJoosq03FTBim18E0FWP/xHrITr8NNkznw==","signatures":[{"sig":"MEUCIHzFdva1TZD+3gL6xbDFuJ9JLcO1gP6XjLXixwQzYqQcAiEA0aPpg0v9lsBG1OyZdGwcWFFVugy/WnT3zp+3qjsKYJE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":127687},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"84a01042ae19828cc1a0ff51b1c7aaf5ddc3b06c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-14T15:42:35.646Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.110","@balena/jellyfish-environment":"^5.1.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.8","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^11.2.6","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.375-renovate-internal-patch-84a01042ae19828cc1a0ff51b1c7aaf5ddc3b06c_1636904723268_0.9795127023012917","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.375":{"name":"@balena/jellyfish-metrics","version":"1.0.375","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.375","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"74b473cb9a56eefa50ad19db03aba70c740c2f94","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.375.tgz","fileCount":15,"integrity":"sha512-xrO7fpqMCbGlkiCQx35jZeoF5UflfBKgFj9yOQuBJpvpUEVLNhnLBPlaJe27BvdFlxA38f8cUBaXyMQgFvIjHQ==","signatures":[{"sig":"MEQCIDCYZfJnCqKtEtpKhmX+u5GqUPDzzHHJLoEP060nb9LUAiBVT1AHYf/q22px+2oWDo1qIMRwc4FAJlZgLEs4sjuHbA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":127622},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"65a297020219a123982ba4b18a8c0178ed6b8f68","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-14T15:46:49.368Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.110","@balena/jellyfish-environment":"^5.1.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.8","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^11.2.6","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.375_1636904904542_0.43859100764825465","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.376-renovate-major-external-major-2e2eb79fc425f34981433df36f7eef012dbf0891":{"name":"@balena/jellyfish-metrics","version":"1.0.376-renovate-major-external-major-2e2eb79fc425f34981433df36f7eef012dbf0891","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.376-renovate-major-external-major-2e2eb79fc425f34981433df36f7eef012dbf0891","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a995e6f090c1e74168ec9107df19a701cecd7ce4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.376-renovate-major-external-major-2e2eb79fc425f34981433df36f7eef012dbf0891.tgz","fileCount":15,"integrity":"sha512-tJAX0SFbfxVlXs6NyfzSk7v9waF8+a0SvIW3inm1JIb81gxgCuxmL6ia5orel6yJeyteVBOHkXguKXAK3MGQ2g==","signatures":[{"sig":"MEUCIDJkodxoACJkkJhvdKAo+89+B7R6XAC0uSMSsOcW8oNuAiEAsdXvqMl5kKSuZSHmWXJ4O5SXN7eOZ0xob5AZyjkg/z8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":127780},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2e2eb79fc425f34981433df36f7eef012dbf0891","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-14T15:50:38.808Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.110","@balena/jellyfish-environment":"^5.1.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.8","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.376-renovate-major-external-major-2e2eb79fc425f34981433df36f7eef012dbf0891_1636905168878_0.9467623147322497","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.376-renovate-external-non-major-0f32382dc404f00ca1191d16f319632b5ef2a10b":{"name":"@balena/jellyfish-metrics","version":"1.0.376-renovate-external-non-major-0f32382dc404f00ca1191d16f319632b5ef2a10b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.376-renovate-external-non-major-0f32382dc404f00ca1191d16f319632b5ef2a10b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"083a946c90430efb4a21befd951056ac603fdfd2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.376-renovate-external-non-major-0f32382dc404f00ca1191d16f319632b5ef2a10b.tgz","fileCount":15,"integrity":"sha512-vz+137RtGC92X3xjqluxQwIDcj3484vier8iFwyzZPB5V3LzyJnY4KDG+m4wKYGUn/oR7aReOJKTrfhofrS1UA==","signatures":[{"sig":"MEQCIE6GBeND65cYCdTHpRyRC0bY9h2xeq4X1DyXyquGd8JiAiBP/d57EcdYInY3UYuUluIQQpWPlbzv46B7ZZeY9E7Nqw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":127778},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0f32382dc404f00ca1191d16f319632b5ef2a10b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-14T22:16:13.794Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.110","@balena/jellyfish-environment":"^5.1.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^11.2.6","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.376-renovate-external-non-major-0f32382dc404f00ca1191d16f319632b5ef2a10b_1636928317747_0.2882639675677976","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.376":{"name":"@balena/jellyfish-metrics","version":"1.0.376","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.376","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0fb9bdfaa655ec4acacd268538da9bc70d04ab37","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.376.tgz","fileCount":15,"integrity":"sha512-blJ9aCRNIkllVXOxjiYsrMpoqC1LtMl06X7NrIr+xBFzJ4u4ix1WcITqoBb1kY+4TygkoF7vqh/N+k2dAAahEQ==","signatures":[{"sig":"MEUCIQD9myF9BoELiTx3yG9NfXt96SGKCGhKXjdmN+m7c7pbDgIgXhCuxjj3oVl/xRH1YP3qNRHovkEhe0J0aZ7RKMr9LOc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":127709},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"84cb24a73007e0efb2eae1dee446931fc0a412cd","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-14T22:20:13.424Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.110","@balena/jellyfish-environment":"^5.1.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^11.2.6","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.376_1636928508216_0.9491275656713627","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.377-renovate-major-external-major-e16c3b7d0c9de5b2bc06501dbfdebeb90dd0892d":{"name":"@balena/jellyfish-metrics","version":"1.0.377-renovate-major-external-major-e16c3b7d0c9de5b2bc06501dbfdebeb90dd0892d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.377-renovate-major-external-major-e16c3b7d0c9de5b2bc06501dbfdebeb90dd0892d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3f0d9bc0397d4cda37af031a615e3c661a870c31","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.377-renovate-major-external-major-e16c3b7d0c9de5b2bc06501dbfdebeb90dd0892d.tgz","fileCount":15,"integrity":"sha512-pmRpKyEmumBTWuiNcPIzaFRw4O4T40mr9Gk8b+TS4fWbvPwHKCdH4Vy8ao9nSsyNnB1iHUpeTFsnawaZMBYIDA==","signatures":[{"sig":"MEYCIQCR9MH0doh53afZJ5+PdwRNzTlPdvWMnlulSGUXVYbQSQIhAM1HmXAWr91ko9VuJWMG3dxTIwfsfFR/q5ApcFsM9Pgy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":127867},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e16c3b7d0c9de5b2bc06501dbfdebeb90dd0892d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-14T22:21:24.279Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.110","@balena/jellyfish-environment":"^5.1.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.377-renovate-major-external-major-e16c3b7d0c9de5b2bc06501dbfdebeb90dd0892d_1636928631586_0.9281306197955934","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.377-renovate-internal-patch-b571eaa81a188b1626d100ecfce942d95c7ca41f":{"name":"@balena/jellyfish-metrics","version":"1.0.377-renovate-internal-patch-b571eaa81a188b1626d100ecfce942d95c7ca41f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.377-renovate-internal-patch-b571eaa81a188b1626d100ecfce942d95c7ca41f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"29a581b1e06b9944143de8f856a7c20f662dc175","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.377-renovate-internal-patch-b571eaa81a188b1626d100ecfce942d95c7ca41f.tgz","fileCount":15,"integrity":"sha512-DeG62D22GYovzBEAY/o0jPcPWbgnCUXrDoSthCobPdzSgQGh7vdOJr65pSwMhXc6gWQ5TFzZVomcxKe99pbI7g==","signatures":[{"sig":"MEYCIQCK2s/vR5e98MLGLSgIYuVAtnM3j6oExLI/hwIElnL3XgIhAIYSowldC14eRVlKSy6oL7HBxWg41D58+F/95Pn7y4Uf","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":127846},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b571eaa81a188b1626d100ecfce942d95c7ca41f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-15T01:17:38.442Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.112","@balena/jellyfish-environment":"^5.1.3","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^11.2.6","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.377-renovate-internal-patch-b571eaa81a188b1626d100ecfce942d95c7ca41f_1636939198774_0.7441881789668581","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.377":{"name":"@balena/jellyfish-metrics","version":"1.0.377","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.377","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a5c9a61f10efc01c7ae9447a86ad948e5aa57795","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.377.tgz","fileCount":15,"integrity":"sha512-DT67x9VmWglpo1ulxEip2A6xnf3YFMYmrxBQgBT159NKvWoUOeDk1JfLThA8IPO221QGL2NpgH4LzCpCytt5Rw==","signatures":[{"sig":"MEUCIFg7R5a3+MnhWoxd+ep3GTXHc7WcQ6iOcf0CYpMdCVIuAiEA3Xhdc5Q8jm6PSdb+6W9tVji1rapXXt00enguDLGWpPs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":127781},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"07cd27a05674a744cf5b46cdeb11fd1266590753","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-15T01:21:22.653Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.112","@balena/jellyfish-environment":"^5.1.3","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^11.2.6","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.377_1636939384569_0.8779758098485233","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.378-renovate-major-external-major-d7ee87e3b58bc8a89f7dd3378c0dd69fe9560412":{"name":"@balena/jellyfish-metrics","version":"1.0.378-renovate-major-external-major-d7ee87e3b58bc8a89f7dd3378c0dd69fe9560412","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.378-renovate-major-external-major-d7ee87e3b58bc8a89f7dd3378c0dd69fe9560412","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3a93a2530871a7f0d3c65ee42506b5e92bdc00c5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.378-renovate-major-external-major-d7ee87e3b58bc8a89f7dd3378c0dd69fe9560412.tgz","fileCount":15,"integrity":"sha512-wlKczXJ69Ha+3JYTTmePaAaAiyUodrWi599HAjeGXZlwnM8wtk4Ge7RyJXs08b8Nf9ICB8lPn/NQCiFlra/cDA==","signatures":[{"sig":"MEUCID1P4rxG6AJ4iIB6IwGqWVqXvFkQz9gfGP7343oBOzyJAiEA2CSbpL4kvSqVmptvAjQ6meLigZQ6mWx/gcTTDuxP5rI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":127939},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d7ee87e3b58bc8a89f7dd3378c0dd69fe9560412","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-15T01:22:39.914Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.112","@balena/jellyfish-environment":"^5.1.3","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.378-renovate-major-external-major-d7ee87e3b58bc8a89f7dd3378c0dd69fe9560412_1636939502234_0.35017614307626244","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.378":{"name":"@balena/jellyfish-metrics","version":"1.0.378","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.378","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"320cd3a58b5f019b92da4d0718000fc2c4cc09e8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.378.tgz","fileCount":15,"integrity":"sha512-nPkem5Jd8eM5+x6PXoDVlDOveIRwwQ8tZde/9R5wLn1XzUVGJbPM9xDCOsW8knz/P3jTGncQ2/5MFJAzAfH9tA==","signatures":[{"sig":"MEQCIAyZKsn94948Aru+Hyagp1zbdf4Tpak1rIEh40dvD8lfAiB0JbJqu4leCvOUSWlHRH4avcBjlmvyDIysRr3SyJRd/A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":127868},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2187b0ba0770f591a87fefe68b56735d3b892ae0","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-15T03:15:44.670Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.112","@balena/jellyfish-environment":"^5.1.3","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.378_1636946298694_0.4235191957762039","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.378-renovate-internal-patch-2b7a04654f9f1b3cfc04c8a584be140889912c34":{"name":"@balena/jellyfish-metrics","version":"1.0.378-renovate-internal-patch-2b7a04654f9f1b3cfc04c8a584be140889912c34","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.378-renovate-internal-patch-2b7a04654f9f1b3cfc04c8a584be140889912c34","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0daaa81663a01bfa0714e84cccec7c0afd52d362","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.378-renovate-internal-patch-2b7a04654f9f1b3cfc04c8a584be140889912c34.tgz","fileCount":15,"integrity":"sha512-6A3yemOmuq2goW3gPTz9FGvk6SXH3IzbRfTadJK+kGHAmNh/HNCDL8fh4j/r9Uyjoae1Td7htuMJWMu9OSHpbg==","signatures":[{"sig":"MEYCIQD2qEciRIenBr0/Y1kOIe9PsBh5fBsRbHdEZ0lCcO4C6gIhAJGikx7trsa6XBTPU1Di6jw0K24hDzGjzwTmLEayJfbX","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":128012},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2b7a04654f9f1b3cfc04c8a584be140889912c34","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-15T03:17:38.473Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.113","@balena/jellyfish-environment":"^5.1.3","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.378-renovate-internal-patch-2b7a04654f9f1b3cfc04c8a584be140889912c34_1636946435196_0.06564657592413425","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.379-renovate-internal-patch-ba6b69153c1ae992d8cea7b6f508e61d18ce8080":{"name":"@balena/jellyfish-metrics","version":"1.0.379-renovate-internal-patch-ba6b69153c1ae992d8cea7b6f508e61d18ce8080","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.379-renovate-internal-patch-ba6b69153c1ae992d8cea7b6f508e61d18ce8080","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"43a5e7411dff0a2e363a8f9b751baee7c7826746","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.379-renovate-internal-patch-ba6b69153c1ae992d8cea7b6f508e61d18ce8080.tgz","fileCount":15,"integrity":"sha512-2rLtSlhXDzDfEodOwlnmo1qhsA2fZqa1ELDnJGrFBWx3oCx+ZNrYKYiFTzZPdd+ORbH0MK911/3JmiovD0XA8w==","signatures":[{"sig":"MEQCIDh3HRhwF/cHK1jqS8gARUX74aFfXZ4ZZERJbo3zX0ZyAiA9+cq/uANnRGVaJYjIOOUGIbtemixI+5gqbP+PEa8qFQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":128005},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ba6b69153c1ae992d8cea7b6f508e61d18ce8080","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-15T03:20:50.459Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.114","@balena/jellyfish-environment":"^5.1.4","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.379-renovate-internal-patch-ba6b69153c1ae992d8cea7b6f508e61d18ce8080_1636946644041_0.05317092389358247","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.379":{"name":"@balena/jellyfish-metrics","version":"1.0.379","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"UNLICENSED","_id":"@balena/jellyfish-metrics@1.0.379","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"710393c494774ebc7127c11c99a8a476e617d179","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.379.tgz","fileCount":15,"integrity":"sha512-3mhBLZj97LyOsaPA0FZ61SmTT4yRLpgJQh39E2UGCKKEq/O1QGBUY7RggKCa7zSUQOIABsXEMLlWr8e75zY9pA==","signatures":[{"sig":"MEUCIQCUBUZQmm0HySClGYoE/QFTd/yPyxV4V35BuNq2hN8wAgIgdmUD8auBWWmKBIBfuRjcylpm6gXWudVfWn+a6pdt7Fk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":127940},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"aebb0047308eb0b2393df7ab573af3a2a02b3f73","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-15T03:25:55.563Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.114","@balena/jellyfish-environment":"^5.1.4","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.379_1636946885172_0.47694011219046417","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.380-joshbwlng-set-license-d1859dcc34a1180dee831e5c332f04fbea8c933b":{"name":"@balena/jellyfish-metrics","version":"1.0.380-joshbwlng-set-license-d1859dcc34a1180dee831e5c332f04fbea8c933b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.380-joshbwlng-set-license-d1859dcc34a1180dee831e5c332f04fbea8c933b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"217ba320aad9545ba11c3242f99ef0fc0d4ee756","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.380-joshbwlng-set-license-d1859dcc34a1180dee831e5c332f04fbea8c933b.tgz","fileCount":16,"integrity":"sha512-MpB0wKnze48OocbDpGG98ma6P7me2Od0lf69yk0YL2b6FLG0jHJvVP9x2/ipywb00HSMxrMT6we1Dt/ep0/ttQ==","signatures":[{"sig":"MEUCIQDPah1u2h77d7Fdpf7Wyu3hQMZWji8lEyZRIITbN9uGzQIgCvBdt66iPvvsYVlWMOzqKUFLDrbw2GVseo3kgdCFu0Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":139394},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d1859dcc34a1180dee831e5c332f04fbea8c933b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-15T03:33:30.608Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.114","@balena/jellyfish-environment":"^5.1.4","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.380-joshbwlng-set-license-d1859dcc34a1180dee831e5c332f04fbea8c933b_1636947373834_0.44266426470324216","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.380":{"name":"@balena/jellyfish-metrics","version":"1.0.380","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.380","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9a6634e8afb64cb4eddff0bffb301063ad22a22c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.380.tgz","fileCount":16,"integrity":"sha512-Lupi1LIklv9VpYkL4GXngDBcAteWgNwDcHaRxiJWu4oQEFy3G3m9R+i+yo2J8jXP21dauMTGT/8TrxJfcRQgLw==","signatures":[{"sig":"MEQCIEmFkou8/frdJDiN0M93gyQoYRipT2d8GNCyp8do/1NfAiBLR69LW+8QnBaR+imRThuWKorbyr9kWSkUlDcpwxUv9Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":139331},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b3cb7f1a1f6ddfa967acf03aecf1f3e9d47adf24","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-15T03:38:12.351Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.114","@balena/jellyfish-environment":"^5.1.4","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.380_1636947594456_0.3805683286841426","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.381-renovate-internal-patch-ef04d618864275777cf4a8e921973431b64db181":{"name":"@balena/jellyfish-metrics","version":"1.0.381-renovate-internal-patch-ef04d618864275777cf4a8e921973431b64db181","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.381-renovate-internal-patch-ef04d618864275777cf4a8e921973431b64db181","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"01bf0ed3380b86ebf335c419c0111c046b97ffb0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.381-renovate-internal-patch-ef04d618864275777cf4a8e921973431b64db181.tgz","fileCount":16,"integrity":"sha512-eKP6/Im70yBA88/phuczknhbuXBFbszzvIDHA7LiLi+j8AGs/535CVXGmRkC69aMEoxvN21tOZwwOuMHTD71FQ==","signatures":[{"sig":"MEYCIQDVt+u8uududbgk04GftF6wCyXTMJgBuynkoVdEc4yhEQIhALM4GBM3H7X6nVgLoj/fWzFmNUQOhJszLnKRBLfu+c87","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":139468},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ef04d618864275777cf4a8e921973431b64db181","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-15T03:41:49.658Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.116","@balena/jellyfish-environment":"^5.1.5","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.381-renovate-internal-patch-ef04d618864275777cf4a8e921973431b64db181_1636947896856_0.8533667718962219","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.381":{"name":"@balena/jellyfish-metrics","version":"1.0.381","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.381","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"77aa28b27175d7d97a8716ad575090e8317ca13f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.381.tgz","fileCount":16,"integrity":"sha512-1TA5rFaXfoJ52nZHDR35dOwClhIS4Q5lkxcIY7O0mSYPmXfwgANA4ZPSld6hnw98FDuC+98gtAN2i4mckWxwqA==","signatures":[{"sig":"MEUCIDzHE0+KF7NCsWDQh97oAk6GaEDCCP91EQR6YKA9Oc1BAiEAxZwsEfrSWDP7ah5Tnd1L58+GXGfYR/43JUSXhF0x1YA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":139403},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"05530acb466cef844c9022eca170c25c99096312","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-15T03:46:42.344Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.116","@balena/jellyfish-environment":"^5.1.5","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.381_1636948114964_0.8887427124786005","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.381-renovate-internal-patch-d23a5fde6dce0a8153933df9b892ae83c8510372":{"name":"@balena/jellyfish-metrics","version":"1.0.381-renovate-internal-patch-d23a5fde6dce0a8153933df9b892ae83c8510372","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.381-renovate-internal-patch-d23a5fde6dce0a8153933df9b892ae83c8510372","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f78ec47f3e0b3738d776d329d41005a2232e23b6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.381-renovate-internal-patch-d23a5fde6dce0a8153933df9b892ae83c8510372.tgz","fileCount":16,"integrity":"sha512-GL0kGFNxtYwnf9IOQYuZm0TyLFbl45Vc+5Nu39OVj8XAT4+/fD1IcPXsRwoNlR6rNm5g3SJvhJkcyLoPI5SpkQ==","signatures":[{"sig":"MEYCIQDwxvdy6lX0sJKfVJzsfklGc6TD01lpOYnmzi6xJJaPIwIhALrMjqSWtUm56KEZoEjfOBv2MKJvUD+1LTDvxcY0Yt6v","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":139547},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d23a5fde6dce0a8153933df9b892ae83c8510372","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-15T03:47:21.439Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.117","@balena/jellyfish-environment":"^5.1.5","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.381-renovate-internal-patch-d23a5fde6dce0a8153933df9b892ae83c8510372_1636948239316_0.9522526879224467","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.382-renovate-internal-patch-20ba19c40f1d9a18ef5aed741e5170c5712646bd":{"name":"@balena/jellyfish-metrics","version":"1.0.382-renovate-internal-patch-20ba19c40f1d9a18ef5aed741e5170c5712646bd","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.382-renovate-internal-patch-20ba19c40f1d9a18ef5aed741e5170c5712646bd","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ea48dfddb4cbf85c4ec7fc428718bf006337cc98","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.382-renovate-internal-patch-20ba19c40f1d9a18ef5aed741e5170c5712646bd.tgz","fileCount":16,"integrity":"sha512-agvyrCH9H/fstJf+gNFFZa6uiUQPMda+tgiTzOZJUZ11X2nCp6CBr/ZAH3xPDFN5PEn2deFzSvpsbnGsEx4ffw==","signatures":[{"sig":"MEYCIQDgJpiLOtqzvPX9taLKDCpAJWzXvgIUkQMCxg0XeRinSwIhANgpUbfguRQgYs2P3Sxdfqlt/38wkaWytD2q4ooiLZop","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":139573},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"20ba19c40f1d9a18ef5aed741e5170c5712646bd","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-15T03:51:24.229Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.117","@balena/jellyfish-environment":"^5.1.5","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.382-renovate-internal-patch-20ba19c40f1d9a18ef5aed741e5170c5712646bd_1636948443832_0.6974704120073139","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.382":{"name":"@balena/jellyfish-metrics","version":"1.0.382","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.382","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c56bddc53f06a7d1d905919e71b4cb69fcac18d4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.382.tgz","fileCount":16,"integrity":"sha512-k/X4yVcAcV6wNU/xamdvb/eRrUcIwE2Vl7AGDvnSh8lXKxS32VOrGR4MMKaD19lo1C9TXyLwEr1Tiqe9NCh7rg==","signatures":[{"sig":"MEUCIQCfyvWNMj5O2NFedGjZnFlftF7oeiPbVTTNVStSu3fJYwIgJWje1EGQ/l/K6gJDzAUmqYQoK4HJ5DlBeStdiwzXmUw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":139508},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b8053bbe9a4fe13647400e58fec979b1726b9a6e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-15T03:55:30.198Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.117","@balena/jellyfish-environment":"^5.1.5","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.5","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.382_1636948646150_0.1456485544764563","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.383-renovate-internal-patch-fd521f159e10a533e330912e80d9fc476de61e07":{"name":"@balena/jellyfish-metrics","version":"1.0.383-renovate-internal-patch-fd521f159e10a533e330912e80d9fc476de61e07","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.383-renovate-internal-patch-fd521f159e10a533e330912e80d9fc476de61e07","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"93f5e398077f55a8c589076ca8f72d582e7f45e2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.383-renovate-internal-patch-fd521f159e10a533e330912e80d9fc476de61e07.tgz","fileCount":16,"integrity":"sha512-vq2nZPRqv3b97xYZPucs5DiSQQ+wM+PtPZZ4zvyK4eUbOnkQ34cnFOf7u95tbFCw6qMKA9hZbZKaokZFs+G8iQ==","signatures":[{"sig":"MEUCIQDq6CdC6uiJ9y8g6fURL0MA3jjCGbLWzBmZQKMVxmJJVgIgCTVX+Ulxs+LwGayiLXHSX+jP2kxO7hBkRHv8ikyvkp0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":139670},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"fd521f159e10a533e330912e80d9fc476de61e07","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-15T06:04:26.665Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.117","@balena/jellyfish-environment":"^5.1.5","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.7","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.383-renovate-internal-patch-fd521f159e10a533e330912e80d9fc476de61e07_1636956424210_0.6743493116390864","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.383-renovate-internal-patch-237c3bc0c0569e180a0ab28e97addeaeb087f5e0":{"name":"@balena/jellyfish-metrics","version":"1.0.383-renovate-internal-patch-237c3bc0c0569e180a0ab28e97addeaeb087f5e0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.383-renovate-internal-patch-237c3bc0c0569e180a0ab28e97addeaeb087f5e0","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b063389ec56b9d6ee3e4c0bded26179286d4e45e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.383-renovate-internal-patch-237c3bc0c0569e180a0ab28e97addeaeb087f5e0.tgz","fileCount":16,"integrity":"sha512-2DFwGTlxzBBfnNFYCIKBT4V0MICBAkw6+l6ABjO5q8dERvRnn3vuDEah9/Wihwx/skhfOp/I3Hh2XEEs51Bk5A==","signatures":[{"sig":"MEYCIQC84hukFUlwUXV4MgCv8VKy/DHkgXXu1K5TZ9D6Ba+pNwIhALydHbNYRzAfFIeg2h9XkU+VtcmXyUxgGYiptAq1J8Um","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":139645},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"237c3bc0c0569e180a0ab28e97addeaeb087f5e0","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-15T06:08:50.645Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.117","@balena/jellyfish-environment":"^5.1.6","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.7","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.383-renovate-internal-patch-237c3bc0c0569e180a0ab28e97addeaeb087f5e0_1636956666021_0.8894534105802907","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.383-renovate-internal-patch-65098288e1863e1b223c64e35506c18504677a48":{"name":"@balena/jellyfish-metrics","version":"1.0.383-renovate-internal-patch-65098288e1863e1b223c64e35506c18504677a48","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.383-renovate-internal-patch-65098288e1863e1b223c64e35506c18504677a48","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6bd74c2a1be034c1f55cc9cacf88c6cdbf2dc23b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.383-renovate-internal-patch-65098288e1863e1b223c64e35506c18504677a48.tgz","fileCount":16,"integrity":"sha512-jClbDipzxuMGe2+sxx1IEYD+lDE8ouWnNQwGogH3nnv6+djk52KP3OU50t1C42k+e0CY+zBNSkE+FeDyb2GdDQ==","signatures":[{"sig":"MEQCIDzxUjl2naycCLJHMfq5lPV5TY22/0332vu5QtfulnMmAiBpmfa1My9gCssiWxB0ENmcmXZfB8aqAR30Y8A7NXea0g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":139645},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"65098288e1863e1b223c64e35506c18504677a48","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-15T06:12:38.033Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.118","@balena/jellyfish-environment":"^5.1.6","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.7","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.383-renovate-internal-patch-65098288e1863e1b223c64e35506c18504677a48_1636956891401_0.46455169872425994","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.383":{"name":"@balena/jellyfish-metrics","version":"1.0.383","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.383","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e0c5a5b7a97e3b9786cfd738a33e5c1e5813f064","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.383.tgz","fileCount":16,"integrity":"sha512-SiaP6mfY32bwl7oN44Mh74KYccFGpMWaPKzWDJkOfU63vVKO1e+nwYZKzT2R2445LgYUamtcahzT78YybT5Fgw==","signatures":[{"sig":"MEYCIQDVqNbvCdeMmIcO3sWTHLAVTrZ90F6LM0hlGHn25UkWfQIhAOiBZzfqhoFwFWHg9qb6VLKZXQ5hdoMcBqv5yHL2bRV0","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":139580},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a568c22706c44b50ff59871437ceb513838a30a0","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-15T06:16:34.522Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.118","@balena/jellyfish-environment":"^5.1.6","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.7","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.383_1636957102326_0.21198217343057846","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.384-renovate-internal-patch-31c1b66492c32f2e22d42daf745cc127117f9afb":{"name":"@balena/jellyfish-metrics","version":"1.0.384-renovate-internal-patch-31c1b66492c32f2e22d42daf745cc127117f9afb","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.384-renovate-internal-patch-31c1b66492c32f2e22d42daf745cc127117f9afb","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1605a940bce9983a5280a76fd661d9371cfb4605","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.384-renovate-internal-patch-31c1b66492c32f2e22d42daf745cc127117f9afb.tgz","fileCount":16,"integrity":"sha512-69LYIf34FibTvgUuqAdVf0RvwLYg+YK3MEgJPFMOi+/d3mjztquwjMlbk6qtFhBVcfe5QtMzMvtUr/ZSP54cYw==","signatures":[{"sig":"MEUCIQDbkvo2cGd5MXoOcKJ9dk3tzxGqKzcV6Td1fdB9GdBJpgIgfngj3ZaYPOJs4r+bKY1NmtLmO6Js2PIJdDTfQFXQsog=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":139750},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"31c1b66492c32f2e22d42daf745cc127117f9afb","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-15T06:17:52.448Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.119","@balena/jellyfish-environment":"^5.1.6","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.7","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.384-renovate-internal-patch-31c1b66492c32f2e22d42daf745cc127117f9afb_1636957246523_0.11838902659852235","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.384":{"name":"@balena/jellyfish-metrics","version":"1.0.384","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.384","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3250256d0b8d6bf4067d8b6ad5a4064a1baefcf2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.384.tgz","fileCount":16,"integrity":"sha512-kTlj5I5kWaqiEjt/mqBzWn6rqn3u6jOuaB/NhsfbfJZyF0UdGFFyeTg+ByWjsINMgYvl8eBT0+2hnh+2bHnn/A==","signatures":[{"sig":"MEYCIQDbY5J90XHB4ekhE2bMdReiXqG6+xqShXHkmzJ1PkkDLQIhAPySN94rdiCM49zDk1PAynLaqvF9J2ijm85/ndxUbF8p","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":139685},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7dee84451f2696c817f9689f2928788098714f8b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-15T06:24:00.157Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.119","@balena/jellyfish-environment":"^5.1.6","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.7","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.384_1636957540923_0.17519966155862776","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.385-renovate-internal-patch-b0e2d79505517fe71ab7545faba242be87011118":{"name":"@balena/jellyfish-metrics","version":"1.0.385-renovate-internal-patch-b0e2d79505517fe71ab7545faba242be87011118","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.385-renovate-internal-patch-b0e2d79505517fe71ab7545faba242be87011118","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5ba85060aff8527db53529bbea7d73cc9fa2143f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.385-renovate-internal-patch-b0e2d79505517fe71ab7545faba242be87011118.tgz","fileCount":16,"integrity":"sha512-h8YbIoFE+gUKsPXurthgxJk35PXNv2TCLpkgEG06mOZyX8mlM8VZWWYMKreAi+i3s/1O3JK4gJYMpNf6tm1QhA==","signatures":[{"sig":"MEUCIQCPSNf7jIgTcmlYKaYO9i9NzuKULw45YXuHz/uyVH4+AAIgKCMQp5JVrgUsUcMnjxQCo5Cp9neux7xhGbpNIJVEnj8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":139855},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b0e2d79505517fe71ab7545faba242be87011118","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-15T13:06:26.943Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.120","@balena/jellyfish-environment":"^5.1.6","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.7","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.385-renovate-internal-patch-b0e2d79505517fe71ab7545faba242be87011118_1636981760361_0.4946086394903719","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.385":{"name":"@balena/jellyfish-metrics","version":"1.0.385","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.385","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"077f8e60df844e6c3c91f94355396256086e57ff","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.385.tgz","fileCount":16,"integrity":"sha512-STjN8JxrwdUrzHWEEI9g+rGZ8y+P+CooIVfZDTswQIgz6LkOHCgXlDTyQwdtHH0LAIxKA56BJYPWybEpxLnxDQ==","signatures":[{"sig":"MEYCIQDKcgJsItlzigI1yph7fCaYIoIoVpblSsBi6Mkk5OprhQIhAKFpulaucgyYrvrLFQjv4mVw9gPM82L9nVjb+1FOo7jc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":139790},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"68f26914e3e9922decfe9c8703740a243562166c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-15T13:11:05.431Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.120","@balena/jellyfish-environment":"^5.1.6","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.7","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.385_1636982008876_0.3228627747009838","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.386-renovate-internal-patch-b76bbdf1753008ae16e8cdec44d96163afc6408b":{"name":"@balena/jellyfish-metrics","version":"1.0.386-renovate-internal-patch-b76bbdf1753008ae16e8cdec44d96163afc6408b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.386-renovate-internal-patch-b76bbdf1753008ae16e8cdec44d96163afc6408b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f573c1029f695c3d3b724df78d6db6c0bf06d1ea","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.386-renovate-internal-patch-b76bbdf1753008ae16e8cdec44d96163afc6408b.tgz","fileCount":16,"integrity":"sha512-Cj2QuQkvatm/pbwVc2aeHRNtFjE+Fwundgm3i0cFfboQxDeQnVBrQaXs/syVUmtsJLs+aPpxZibPp+iwKragcQ==","signatures":[{"sig":"MEUCIQCeWuh8oHyZ7FYPCzxHMKxrNbjsrsWPpw+vRlHF3u7EbwIgPlqopGj0Ycd2ssU9E7DkJMOizLylOiCJEkS+kVaeY4U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":139952},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b76bbdf1753008ae16e8cdec44d96163afc6408b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-16T00:09:49.953Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.120","@balena/jellyfish-environment":"^5.1.6","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.8","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.386-renovate-internal-patch-b76bbdf1753008ae16e8cdec44d96163afc6408b_1637021550907_0.06847455569902228","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.386":{"name":"@balena/jellyfish-metrics","version":"1.0.386","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.386","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"179d20ed4c09b2a812be29cddfa64580f33d7254","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.386.tgz","fileCount":16,"integrity":"sha512-CMvyRn3u4WNejmqINh48CujyqbYeDWO0YISn9qu+dqfokJ49Q/WIu3eh9+OfxzohYQx9WwJsP5oK2e1hRbNvUw==","signatures":[{"sig":"MEUCIEhjKzvPY/ny+pKLO5PUm4NXV+pY59+vW6iPnnRwQeOFAiEAgk+1jUO41prvOPiHh5do6v/D3qmFEjB5+oXr38NpLUo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":139887,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhkvg3CRA9TVsSAnZWagAAh+oP/ibF5j2wdBkgscrvdjMZ\nnSBBqM2yoShbsLURnbS7hbjXGjFLoOtf7czgCJMtw9qQDq0nyl3Y/hpAUWQl\n2nqa4C01Lhx78tAsjPuvP6zw7YzzSkXw1ab467zyvb6OMNI6i34y2hbFJ50v\n9a8CwTX3Ur3NR+bZXUxHy05JvyyQN1q1Jwq+8TTsdeNQNS+7LeRntHVHS2ia\nZ1tSjOtoIXoUSDy0UpozFZIGcLsZJtdrN1X+5l2cNAE6o5m/u50hu3eO5jgU\nnEF6SmQ7A0MSp8eq9zcn35zwLCvPzDjnGr5ZWgTyf3CuCMnYKg4t39/PB7XK\nVKBu0G2GE1jx2fW6DFefR30H2lJNuCkwVq02LSipBasetGZj7CZal+GgLZWK\nFdlOKj8dy3QemEjSYs9I7gSg1VoJ+v0iZiju/tZiEtwdtxgjZoQ4dJR05K6X\nt+Z7QHdhtoH9/UmNVE/59qKRcgdNT5JSnz+zdhIgEIgT5KZ3BOwjDPevW1Ac\nMOzFLtmfUVxSqZSITUm5V+E9JLdiOlD4dgR+uHoBfo3LD8aNJJ7BJqxtPZ7h\nYcC2zgp0hjNgm3/+3tsMtFOtMHZEE4tydj5vRrweUOWLile/vSHqV6vAU8Dw\nDMqIwLuST/7YkmAj854hao/Ggf7VbpHHgEe2LZ5VYveFMhOAWzxWNEzfrDwe\n645Q\r\n=L/ZS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3095db44cbe8b5a7be7f50ba5e5165acebed691a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-16T00:13:59.018Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.120","@balena/jellyfish-environment":"^5.1.6","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.8","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.386_1637021751114_0.925553740996123","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.387-renovate-internal-patch-427798f5d1c2e936ff22f3145c7e7a077e0ae79c":{"name":"@balena/jellyfish-metrics","version":"1.0.387-renovate-internal-patch-427798f5d1c2e936ff22f3145c7e7a077e0ae79c","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.387-renovate-internal-patch-427798f5d1c2e936ff22f3145c7e7a077e0ae79c","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"dfa7478e57fb798e13fde9dc66ef5ecf47a22a01","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.387-renovate-internal-patch-427798f5d1c2e936ff22f3145c7e7a077e0ae79c.tgz","fileCount":16,"integrity":"sha512-5/hv4i2frkC7DqAXcp2SBrirwSHd+HX9VafNtlCuWkMGbrTW+t4P/fMeLGU0xb4nxJylyjcy5dttluPEi/50jA==","signatures":[{"sig":"MEUCIDSR/iHLTISQTtav2vLtD1cLzfevIclbDpC8vAXeeOhjAiEAzZqN86ce++m9mbEnubCZOj6ftVyp81NIq4YNFJu+9xk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140024,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhkyCnCRA9TVsSAnZWagAAl1cP/Aw9CI+t075Tm7hYvA9c\nbwE/72HSGYdpE4ojffOC1XO17lLk//SjZYaaCNyr1JijHsLyfVPj/GX4NqYD\nEl6JKZCAGIgi2Lw8GeRdOX+q2zMG7i+5q0mbYIaHHi3DetB9vNf6MXrw4V1B\n/qb9CcAWRxmyuMSoxPr2rlUIkX0pRCvFFHc/Vok0TSavtbk59fSCICtGswMF\nROXN2pxjOQJBfkZ0sOpUWyLK13q+Xkz91A1kuHRpZQ/EleQFMBGc0L2cxkqJ\n15siq19ZP2SIzWlVSCk9k/IqqanGV2weoII9cEKOB3YcchG1hMlvZRlajWg/\nyV8PLvxQHQLlzORua59lv68A9ZJbgmAUAuuWTM7UUuVqQYRhLdFxbSVLOWyL\ny5bii/Tb3Gbqj7IfKcNTrqYfejaEa2VN3780l85Q5AJ6w7D/hiT1D/FchWnV\nkxrJDFIFfVNtNz4oLmUb7UKvJQenMXmELC9utINRnvrw4yS34Bs5p6TgUNwJ\nQHAKWDg+8wgE243irWABA4xkA93QH9gYv/z0nwRHGowYDkqAE2fTY/7Pb2sb\nFATltmbaat35TPUqK0rVsNs6/yr6K2VzpegtIu+ApeVv65FNeujV6VTYubmg\nl7CFF+7PqBhqiVM9Abnmd/KRecUN/cArFhd44aa8ImypesKMLVCkrccagduf\nL9K9\r\n=Lrtg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"427798f5d1c2e936ff22f3145c7e7a077e0ae79c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-16T03:05:43.729Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.121","@balena/jellyfish-environment":"^5.1.7","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.8","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.387-renovate-internal-patch-427798f5d1c2e936ff22f3145c7e7a077e0ae79c_1637032103289_0.5865152727140117","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.387":{"name":"@balena/jellyfish-metrics","version":"1.0.387","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.387","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a77a2556b4503403c603c6cee9b774d989592da4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.387.tgz","fileCount":16,"integrity":"sha512-YaNMIs5qpT6MEKH5wtGRzVwo7Dq4RpGwsMcn3Enli+6LHkCsYpvOdsaI/exakbzAKsUGD39ILaj0dWxtSFHiVQ==","signatures":[{"sig":"MEUCIGPjyPHhK6FshWmZowUxUfKRZue6E/q6QpnW+FTRPLBsAiEAxi+eGvAEIQy+Qq3IgwNXeGnrcefe8PhrjO8YRHwr/H4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":139959,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhkyGMCRA9TVsSAnZWagAAXS4P/3aKrp0fjTItcnbrpowe\nFfQHuNgpxVouFhFnFk0OK8BeVURI1A8xUhq5ZhGDTbrT7doL8eLUTbzWBdpT\nVgnWciN/z7mrqNIPLfksVVGHPrQ3BvCitB2Ah1gANeU+lA+plRFsuSKxWc7O\nlNTOkABW8FQH1xreqQgQbf1IYFo4Rqmxoso/WW0hDLoQsd+8YYP06+0900xC\nXsMLjfkTyUsgKMSxi+S/Ajnaed5RceAOUIDGFeMxu75a+FN+BrxoEqckUQE5\n7bzMhNg8pbsr2vJq3pu8HzRc7GPRY71qA4tWNK56tXbIN/FpdVNsMXCDq2im\nrhmi/6QCnO8issLrg5Lm8Eno3ndO5EJPXC1C1dLuaft+3AF9TBGpzdpCTfbp\nCpXrXVU61UYnEW6NPZ2Eem+bmGmxeAJAy6l9fGvKy9JPjBAB4JKoa7KbuMIB\nX+G+LEl4pUthbXc+ShtV1TBJqfFSeBj6QJUBdsJaXXzQ1hXYnml0t1gZAcUC\noNtQHNTIwPWcCevmkKfz1d38z9ClkBCuLh6Wu45QcfLMLEpKms0jGTxUZ3ul\nuNOQHGAQyaSzr7y86BIxiNFJ32/gQHmTEyV6djHz01pXH25XECLG8LfTn/G9\naVRAjjfoLMHDe5xw3uKw5cZ/azTKlFEJWLIjEoexA9o/cwnUQfMGRkHIGV0A\nwUB6\r\n=3OQM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4c7679c4fdc105b191377cc92ef21538fb7af197","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-16T03:09:51.025Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.121","@balena/jellyfish-environment":"^5.1.7","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.8","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.387_1637032332217_0.49415864873741455","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.388-repo-sync-jellyfish-config-default-0dcd2b80500bc1fd8c1d7bfd2b2d0661d4313114":{"name":"@balena/jellyfish-metrics","version":"1.0.388-repo-sync-jellyfish-config-default-0dcd2b80500bc1fd8c1d7bfd2b2d0661d4313114","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.388-repo-sync-jellyfish-config-default-0dcd2b80500bc1fd8c1d7bfd2b2d0661d4313114","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"704ba4345e3e3d30a1f68a2209f5b9540435c707","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.388-repo-sync-jellyfish-config-default-0dcd2b80500bc1fd8c1d7bfd2b2d0661d4313114.tgz","fileCount":16,"integrity":"sha512-bdBR32ngqKgnuWTzvgoB5iOgEzf0isYORF80/P+SBQhjpwFxJoeN49Kv8gahQ20E8958EJVX4g+cG9RvAJHc1A==","signatures":[{"sig":"MEUCIFPX5/A0CP2KIIlCE1KRoPwzePvu8leRZWdqwlvtLdPcAiEAkEjZKpTE+//pOmwKDECX4cvijuQPEzjw0FH2yZ9NPAI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140128,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhkyx/CRA9TVsSAnZWagAAgFYP/iGHMWPuVc0zGZh0xiLM\nVJSaKohsiPTWWV87cPS9cEmRPNb7jCI4fuZYTh3OPdLcvH7N36Ml32KTNDMd\nV8pzEL1iuNypdBbbKVG+/BrdQx0GHuipVHGrXWch4FQqOQ+ylWimpr0og77r\nt5AmmOo0j810JyLiJCxRwOoZSB9ILtNhjH1X11ajaVdim/sliocNUueBuD8f\n4sD+8/Dx6Uhbh3xcDLs0xNNazv2xIfX4HJB36oI9NQXcGO2ObbYytog9WIsx\ncE4SW1W4Tp7E04XKThko0nxuLvRumn89gV7evuveql3Nidfp1nXO5NPctsvU\noBINio7YhGV5AtPrqU1wFSOIWtvGIxGZooUjXdQ4wfI7tbeRYa+ubO90VvbZ\nh8OmHL76FMMaY6WFdDC22ewnnO9cKn2VOgbgMtZ/W1/nlTIPBxrMVgZ/nyFW\n/GE9k8jRHGVX8xSDBce05gc1KSgN3M5yyaXHQOoMJT7LgpxpnQvOEdZF/BGj\nD7BOI5QHbKA9A4FIFXoNMH4Eapeaa3w2LHSKO7gjGE4QBjjypJRBgjstyhNK\nXFEMu4eizrtyIEPoVC/Bh2XwNO+DMUeszOcQES2jj8TFOuTQOMBeDymg0b4B\n8BvNqPxBYAk1yZOP72mvgpSUAH0aMU+4yiWVcGD+1Ny3DOgmGFCqv5I0Yomo\nzfTM\r\n=z0Tm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0dcd2b80500bc1fd8c1d7bfd2b2d0661d4313114","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-16T03:56:03.901Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.121","@balena/jellyfish-environment":"^5.1.7","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.8","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.388-repo-sync-jellyfish-config-default-0dcd2b80500bc1fd8c1d7bfd2b2d0661d4313114_1637035135466_0.34158040134194967","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.388":{"name":"@balena/jellyfish-metrics","version":"1.0.388","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.388","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0393e63362305b7e75db1d6c43a58a859fde97ee","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.388.tgz","fileCount":16,"integrity":"sha512-TmOV2tZNvSS42FHUJIvtzK28Yijlim1Kz5RolIXGwJzbc8mDs17cZI1nSCgwcFZUqimruJlLTc1EASINQx6J5A==","signatures":[{"sig":"MEYCIQCwh8o17ds/5AV62nm0kpWtPPOVq4fi9InCQ5uWwI9s/QIhAOIPVB2aH0Wdm2gTQ4iMT0YdJllPeDWWMH/KBjukmZfi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140052,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhky1pCRA9TVsSAnZWagAAcfkP/0WwaZA0RYNr9xgQUqKs\n/sThbLXNsSX0e79haZ0x4evkOrPaab7Fe5FrGlfGcljik+5qeqLQfl6qB6Ut\nrXOUIJRvooQ+hSC1mS0ucDzwKSugjiQNR0aOaSNErp/Aw+4HbQbir8soeuz+\nnuF76RRCoR7tR5mkQ/1mmBVLn0obVnrGIM/BrPH7VNGyfQiBG4SkR1nKpsn8\n6aX4qCE8efxyXJqwgnMiYbXPdf7p+YWGDbe5GMAbVa0yfG401WNFkb4R8bVq\no3berKj4zcIUb8t2/DCbRpuM+BJIYjDugxB/FOsYskxzs4mzb8ZcZD0uovty\nVufAE81+qGkn+KEbwXkk1f1SjxOZkJQ9jQUKG2xmBlZu6m/0UfWJXNN4kBa7\neLLZjdeI5bQm2gwgptaXddj8Lf+8V/BObFwi9XRZJRUifjxoQ+RIV+xQBRf9\n97TiFAcCSC1PL4BkbTkyOEOgs2h9qS0rq9ktL7VPn+sIomQ1WsQF6FbEG+NO\nKW0C8DC/omoCchsS/GZ4DtxntOPgRZ0pny4hHCY4JPhEcapZsHZs0dP9AvND\n8Els21649zWUZvEwvf0WobWxpqV4520+bWqi/KQGi42VZun99KNEsofGRTuf\nmtaoOmR4CLI6lzLF/19biDpwbUFUZ6l3g1vUTFmyE5QmIcOmtxRhpJ5kDmhZ\nhJN+\r\n=sAR/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8028df5b52919819c3903b7f8a59319cda26ebf8","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-16T04:00:50.034Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.121","@balena/jellyfish-environment":"^5.1.7","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.8","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.388_1637035369856_0.1509593582256601","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.389-renovate-internal-patch-64943d275142c823e38f9786e800437e836e5276":{"name":"@balena/jellyfish-metrics","version":"1.0.389-renovate-internal-patch-64943d275142c823e38f9786e800437e836e5276","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.389-renovate-internal-patch-64943d275142c823e38f9786e800437e836e5276","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5e6c967ff199593c1e3343710d1b41051d7e6820","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.389-renovate-internal-patch-64943d275142c823e38f9786e800437e836e5276.tgz","fileCount":16,"integrity":"sha512-UZSI8N8govdkaRVYK17oZgdqqrpAgaa6YMqiG2hLaD08J6fH8wGVW5h43cvfTa39/hMg3eGwCykEjXvNIRyrFw==","signatures":[{"sig":"MEUCIHsI7+7H5k2E/rde3p0xZBIty0GhCmlibyRngS5uGcQlAiEA2v2YJZF1McYQCIXR8HAif+u7qhmsD2mAYlGou5GxaaY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140225},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"64943d275142c823e38f9786e800437e836e5276","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-16T04:05:12.933Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.121","@balena/jellyfish-environment":"^5.1.8","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.8","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.389-renovate-internal-patch-64943d275142c823e38f9786e800437e836e5276_1637035682735_0.24840333294181782","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.389-renovate-internal-patch-f37b1536fb217e6c474e070099410ac0075cb555":{"name":"@balena/jellyfish-metrics","version":"1.0.389-renovate-internal-patch-f37b1536fb217e6c474e070099410ac0075cb555","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.389-renovate-internal-patch-f37b1536fb217e6c474e070099410ac0075cb555","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1fe8b3d7a2afe2d6f8d1d50da8b08cd078b2332c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.389-renovate-internal-patch-f37b1536fb217e6c474e070099410ac0075cb555.tgz","fileCount":16,"integrity":"sha512-3Dw/1lyGKM79ivxiWCGeXwEoBs74FQ9zk/5o/Q83VU6n3irpsInCTETVJ8oy2u4MGfgbAkQA4Mv78aoY7VLpYg==","signatures":[{"sig":"MEUCIQDnyRX19Mdz+8KunWMCxdF8KuOc0bmH/Pdh4CYpgGckNQIgPfN8Jgkp0I0Ab5Xr4a1hPUbrIunFAGtxGPR0Sw5nnvo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140189,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhky/NCRA9TVsSAnZWagAA0IAP/1Rykdqwdx+QGnS0ZLe3\nmwEgrVTFIFbPE3Fd82RYQhG8pE6uvort9cH/uNkyoGjqcbAkiNE1caIvUye8\nI+rP+eec05zx40Grso5vRbsN4A6f7iHIyvF5ZJFmzvSgY9bP1oo7as886p+Q\n4MBKalpKq3wnERfIHJr4NBLU56XznCnNFpOsVp72uM3Y5SGgeF0bYq4zDYEH\n2gS2ekCnrl0DzjfgbBgofF9iV/n9mRglfBixQHe5K/fHijpys/yDPRFdXMUb\nLJmSX31FSRC6JorEwO7OqahVcaQK7699YKTvhmJYqnWi3QSwnYvL3QdcGlDC\n7f598kw/6i3jzNgz07EKLzjJ/n5dGBx49+x22idlxOoP5xTTqKPgJrkgxDMp\nlHFzl3hG77aahswSI3dQ8gYFtyY2+kLE4aVJl5Tfd7kn9G6csZcSd3uWFXis\nu2+O7yN3E10WOevWVxeRtxQRpXbknyBPU1wwxiR88xcAGvajHeCQgurQkS1v\n8aeDmD6alE87nJkkYD5LVKk3TpoP9D+aplhXKy8SXj38uwi6/LBw6lj7mlHo\n3IAjGX79yRkqLr0Tr9dPIa0NleATKi/JpqeN5yLtg1y9FMT2+gzvFGaxgpuX\nWC62594YpBhUN79ENpSsBcRm8rGsincX+B0cQXyJoIynE9fh0PG4fv4ZjBv1\ntnC0\r\n=yiZy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f37b1536fb217e6c474e070099410ac0075cb555","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-16T04:09:52.599Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.122","@balena/jellyfish-environment":"^5.1.8","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.8","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.389-renovate-internal-patch-f37b1536fb217e6c474e070099410ac0075cb555_1637035981233_0.23997371689595615","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.389-renovate-internal-patch-ed0ea71c5a636496373229c05679cff940dd54fd":{"name":"@balena/jellyfish-metrics","version":"1.0.389-renovate-internal-patch-ed0ea71c5a636496373229c05679cff940dd54fd","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.389-renovate-internal-patch-ed0ea71c5a636496373229c05679cff940dd54fd","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3cc0e515f61c7bbbe665f2b386c51d483e2b1b7a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.389-renovate-internal-patch-ed0ea71c5a636496373229c05679cff940dd54fd.tgz","fileCount":16,"integrity":"sha512-LGwZYV9T5xyUexC4zm4UCCcgChhCQgWwUQqMmd+gHPPk9M/9Qf+Iv6g178UEAhABZfk3U98CjddQQIHkVJLiTw==","signatures":[{"sig":"MEQCIAj6cuFfF4YSLS+gQhsk2Xhtd3vlyhNuNwbpay7ZOVWJAiAILnzA23bHP1lnIAMbFiYPBFg5lrNc9JZ1KhEVSnj0sA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140189,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhkzDaCRA9TVsSAnZWagAAbokQAJ7WIIrBkBl6cAoDSGrc\nB0FQcZQu0zBAGvUNT2NKFEGH/ro4BKItYLrCzIumPHCTe+d1qsgDQAc8rwnt\nOe/gYDgtIznw3w2tftXo+9JyvTdaw+Cz3lGKS4JoD6gf+ZQCGW7/LLLUpgic\nM3EKLncnB4RkeJ1IYNvQxCKUtZUaH51mGIHuBT9jO555Ki4nGEO5s+BDXzMI\nf8iu5qAiFJnKORlcOp9bqTsmzFKPIs9nTs+ysfg+y0dQYiBl3uyOBg/vfQ8R\n2zwfHUKKtgVSA5J2103GN4AvyRC+72nUoQigHVT0gmXGIq5fxzKtTvfiNMW3\nCBWrQFp26NOvdZiseF0/GZa2/8XRqzKqW+UHmR4r1zirV/UcCKCl4Qs0PpBV\nqUISBL494rmh67Y2Ep0hkv2NWPwfQetO3nNWDlufJaS8N0Q8SQcgc9DY/bWc\n44awcgE9OSJ+c0WipMYra9KrFv1BwSubbLDPlhs2AOGfxXe5k056t1qmkYiT\nbLradw4i5xx4R6uGXA/kIQeaK3hvnX90RodOm5QPfcupj3bY/pYd1tWOdEyI\n5CgRrTBfGR3le7NKHfH33rDP6jISomC6g86CAzGbRyjgL0++kpQvyuZnjRmx\nqHtN5jfIjS8iL6MDuw8veHvOdtWoj3atiHia+h29EgYDJ5xSAcHbtTxI8ZnF\nVJml\r\n=bzKY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ed0ea71c5a636496373229c05679cff940dd54fd","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-16T04:14:14.168Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.122","@balena/jellyfish-environment":"^5.1.9","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.8","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.389-renovate-internal-patch-ed0ea71c5a636496373229c05679cff940dd54fd_1637036250644_0.5535541599927987","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.389-renovate-internal-patch-286cb5c4ac71ea3cfc94b0fefc1bce66bc178c13":{"name":"@balena/jellyfish-metrics","version":"1.0.389-renovate-internal-patch-286cb5c4ac71ea3cfc94b0fefc1bce66bc178c13","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.389-renovate-internal-patch-286cb5c4ac71ea3cfc94b0fefc1bce66bc178c13","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"00ce09439494f59f089b1e69e935213861d585f1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.389-renovate-internal-patch-286cb5c4ac71ea3cfc94b0fefc1bce66bc178c13.tgz","fileCount":16,"integrity":"sha512-1LQSpWhparG3Q4URSdsIe0cVhTttxPDLkafZxH47/S1Ih1Lck/GvmMfR1wM6Vf3PTrzgqbhrnUb4fUZ29/BKwQ==","signatures":[{"sig":"MEQCIF07WGwwDuUbP8vdOBtzwtKQz+ghPDId9eHnHraJE0vkAiB1gD8yb1Xx+rd1lbXeKqYfU0XcZ2omAEyIH6yWLnLYqQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140189,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhkzGDCRA9TVsSAnZWagAA6mEP/0K3G8WwW6bpq0QDdfDu\nhPnXmLMT0iUvgdoTAscoe1zapISDeSeGMLI0d4nUD1lB+rxa64hcGLQXJx2K\nSgKpK0Ov002jev93H+FOzjOBEv6LDJFadqUOBxG3QDvz+OAabr60CgTA0N89\nb39uvbpuk4YyiX1qSlH7C9F+SpXb391OBCnhslFwsyLr7bqYmPr0IKcNXUox\nWy006cWkzSlnWopxOSOwBSHSv2CT3mIUEFai6NmWE6v6EN4jn18vNdPPwLot\naPUAIoTdjCSdanjfHuyvw9vPjggrWvlWwMW2GyxxbcSh7KbLvfeeJL4FWk1G\nafd14lKuGwNO2bmuXP2NBe3rf5lsCjgQWKMQMXKMTk2mJnP0tzWryS5247sq\nijDhHB9FhTNQIp/u1T2BbkDveS2RqEnv10DwmvFL0waZAzYAPtF9tCcnq7D1\nXijZ/xg9K6YtjG93p47tfHGxsQDlInfZ58s+IlYwoLH5ZmAvqvdZNHXW7dR3\nyPfN4qopEzdWzrlXOCH1iYKb8hZ+WXT0ZmG/pX8GOPWY9heikiTNVGLcThaq\nILTxXwhgKvw4dWBDb9sVNHElghWs0qaOTZjAMlL4qDjIJSKzbarriydnrkyY\n58+rWOL32bgBtYO8mBsdWTCwVYoPdt3f28oBbzaWanavUfQMcJIvdt+eCpnB\nqONb\r\n=58it\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"286cb5c4ac71ea3cfc94b0fefc1bce66bc178c13","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-16T04:17:12.385Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.123","@balena/jellyfish-environment":"^5.1.9","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.8","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.389-renovate-internal-patch-286cb5c4ac71ea3cfc94b0fefc1bce66bc178c13_1637036419361_0.7980424767326695","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.389":{"name":"@balena/jellyfish-metrics","version":"1.0.389","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.389","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5d177563fbb75106348dc76e515d71577615a3e5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.389.tgz","fileCount":16,"integrity":"sha512-hdqpI0Lgts6OZvvLJcsKL34pPGO5Dixjn+MNBCOdErn5bxDzT/x5lz0MHApYOLi/CF361CxSgzn6eTQUzvniIA==","signatures":[{"sig":"MEQCIBM1ohvgphsB+0Qq0GMXyzonMhT2C9htHQMVteAw8AaRAiASTKamW+Iy4gIHLc6pWEcU0ONoHhuLkLHJOv70OYh4cA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140124,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhkzJwCRA9TVsSAnZWagAA57AP/j17egnqw90+EQDCMVJC\ngQ0CU3kE6Ghz8FDoRS37FDZjCPhBsVvqCN97FdtzUcKnHnkknuqqgl/Ykp3z\nlpWFGZBKTLrf5PjGQsm5otoqXGCCOobasbJC/DnJhqK4ySb+03mIFMo9UOIN\nvNvtFLoltYL/IaJsYHmx74/1HpyXZb72yq3smv2d9TZHTzOiLxo1Nhagf/7U\nNBuQ8TXVgzxukqbc1ji8POvaY8QaShcmam6kw7G3ooYoyLU4tOvRuabGxyo5\nfYPTL41HpH3oFhyX8Z7Ro+4YTu4j6yJsVtyM1f8lpvxQx8aDW9GrFfB3IgwN\nUIDLyasUcvLfWieYPWbkPh1INRRILeSL64ruZAtr7JdoOu9VapGpKmMV7kpL\nGy4sczE7xj0Uz4fVc8dxJqjbQhx92f+6JNbtF8Sy3lbcCwOmhrQYXxKNY24m\nvo78IFtGi7q7GzbVYLU1e+qPinZ1edCYWbBPf42dpLYE8LI+Dkp3O+1nOgu/\n0yXGSRcpjJRsdC9h9QKXUi4ZI+nXd5QyQnbk6zrYUZXSnqsSs7pde1U/2jy6\nsoktTMJkxwTp5xdfM2rst2XDXDv5SKo2wq51MqS5AgaGl0mww0yUwvzQONRL\nSfVIbKpwjkfdXrd8cl0iIm1IYTZZwBHZrQbqgt7k/0WXl53hH2ZCPFpi4Uqe\ndZDV\r\n=NpXa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"115b5082c586c6e3a04ba0a4746ede95b4841166","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-16T04:22:35.362Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.123","@balena/jellyfish-environment":"^5.1.9","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.8","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.389_1637036655883_0.8078069053692429","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.390-renovate-internal-patch-c421c0dc80faf241a65d0250ef38749735847ef0":{"name":"@balena/jellyfish-metrics","version":"1.0.390-renovate-internal-patch-c421c0dc80faf241a65d0250ef38749735847ef0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.390-renovate-internal-patch-c421c0dc80faf241a65d0250ef38749735847ef0","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ecb711546cd590cf5404ca2f70e32601c12d95dc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.390-renovate-internal-patch-c421c0dc80faf241a65d0250ef38749735847ef0.tgz","fileCount":16,"integrity":"sha512-Uff7AseBMNc6N6HuHF1BjCbTfkZQSn1NDccEQwTeFFz64M24Ps+28iK+RQrWtbvcnZhL7AbNC7u6Yx4G0hrvxw==","signatures":[{"sig":"MEUCICuMyd9QUNhiaTEr4RLcW00zgN9VUlGkZWct8Fbm8Kh6AiEAwznr77mgnm1qa7s/AnVhwCHI0ebhQAEIdcicwp8hpz0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140294,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhkzOZCRA9TVsSAnZWagAAoqwP/3GxgwTRb4oQDGEp8rPE\n5VheFekrVws+TQTzmHXKb64AyMhvGXGp10QpSRcNhhlv+9Sj9sb+qE/EZ3mx\nDfwm/JPOo3pBqWjypoUeP5p6q+k2+zAsXsISwCIrI+nshOI4WR09gnZZT61h\nYjwYx+aooHoVJ/N96j01ND6L7PxC1qYxL0WvxNk7iK+P6wopRD3gL4aLRQ0k\nFiFGjEfloMJFQMSnbGH76Gf+UYL5D8UUErLluy1BvbeY8u4KZnNOkkqWlc8r\nrGw+yLC0tERNoKzewFIYZm+QZXiXIiiSKARyiUInc0QnLrp7Nc4Yzj+pxOz1\n/CSeTSub4wQF/1qeLegjelNrAwGMG+UyJLdHttGU5Dh/s3QlbBGW92EzVYX+\n6kFCEYV9LmoJTxpjVj22x2VcBVRvGSbIgV280a+uwyTVpW0AxAGfTazF2F2Z\ncbRFnmFGrhFJ5ZoIYnaVZ5/epaViS8sn4/R5aLyFdUhetDnZtAQlQFStiJ6K\n8zGblsxz8z1ACbTijeEcuKufp1F1r3PkUMorHDiUIv/cHFB2so8RtYalME74\nUzrl8nshEx9hxtjRSEIeStEprSK+QS3dk5Me7k6hd47w27TCTbJyBZ9K5qBe\niOmjOlNR9EOL9R9s0vQa3FtyqNbZRHH3QPZ9v8guiGfBpVQ89KK10/9vlcCj\nsQVN\r\n=yDSt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c421c0dc80faf241a65d0250ef38749735847ef0","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-16T04:26:35.233Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.124","@balena/jellyfish-environment":"^5.1.9","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.8","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.390-renovate-internal-patch-c421c0dc80faf241a65d0250ef38749735847ef0_1637036952800_0.15185337599625193","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.390":{"name":"@balena/jellyfish-metrics","version":"1.0.390","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.390","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"77d70280c179796cede9dc8a1b4a568b4c393df3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.390.tgz","fileCount":16,"integrity":"sha512-kNIKm6ZN2uVbifVTPFOudFyA1RLm0mr4whnQK/3qjHnKbgSb7XHdEOLOxG3Mvk0OIgMJ9TOcxrb2ILU3ELFnTg==","signatures":[{"sig":"MEQCIAUXR0BTNjcqslELHGbLAq7fzOOlraPY9sKQelgms3kxAiBylNRPGlAonobT1eG35MxkQ9pkTtJSCqNzo3Dyaibq9g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140229,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhkzR7CRA9TVsSAnZWagAAQGkP+waxXLD4pKdqv4Tutrcj\nVE83+790PCUJtJttXhJEohWTDX/Gklj3N+/xTT9iC8eVRLKp3qDSTViGWhuN\n4DVcn2LYgyTeg8zUiTie6icn1Zsv1xw/l6Jzvtqky0xfhoF0nO5F0m7M3YC/\nrUXeiHxVEtw3Lhdaj2mv2ltlHi9ZCxVcK58sxKE2JpxVJnlqOFr07X6ljkyd\nlr79TM9G1p5k1gf9xGuG6RQHuIG4MLJBzsxsJzB+syS2bRqIvJV7eK5qFSW4\n5mEsx9PmBJ6Q31Cqil3awoJ5zEyagNGlq4b9BjsEwXsejIA53+nVXUiKT42u\nQBVVazhrhxV++Yqe554pQfKzOAhUL09w1hgSJFClxPXhEzIu4v33/TS0wdEF\nJN+8rJ2Hlk4T5IOlMXejSOZbwwf5Crpnu5SlN1ZsgwjSQuQ17AnuErj1G2hx\nMXyktZBAgJTtcpHZYicWyMgqTDK13CyrZbgDcYJzdoR0Y3kyt1iXXzUC9cmz\nkHDPzX+J2D8olQzmwmC2VcTX4qySdo44wtF4nNz95B1JmKg7DZlK+s6NdfK9\nhvZG5HqDx9HpFCdm4tzFtJPbT3+vH9h1i/RssmSbKKj9cPh97OAIZ4k0MDqC\nquQIO7Mc8BY4kfgJoCrGc3iyv/0DbRKM7bVJ0fcaA3KPa+FF7S9k3WOHnKuF\nOFZp\r\n=JrUr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4ef07173f12ccc4b3f655adddd06af59f785e228","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-16T04:31:11.293Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.124","@balena/jellyfish-environment":"^5.1.9","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.8","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.390_1637037179583_0.26820189291600416","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.391-renovate-internal-patch-eb7d81bce0229efce8c3e26245bbcb83c04606dd":{"name":"@balena/jellyfish-metrics","version":"1.0.391-renovate-internal-patch-eb7d81bce0229efce8c3e26245bbcb83c04606dd","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.391-renovate-internal-patch-eb7d81bce0229efce8c3e26245bbcb83c04606dd","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"03f2e64bb90c5aab51e66f21711a80271fb5aee1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.391-renovate-internal-patch-eb7d81bce0229efce8c3e26245bbcb83c04606dd.tgz","fileCount":16,"integrity":"sha512-AgwUEAtCkBWmb+kOaBK8Vv2MqOGN35IhzYNBO8HEfch5uOeYisUHwUBxVZ1AHyV/WJLd7sqK8oB+3hY+s/xnWA==","signatures":[{"sig":"MEUCIHnF40qTSQ9MmPxedLYZRcfYxXNa6hGGcqZMEeb4C75XAiEAoZ3oncIsM5EZ+pfL8ph9g2aZxoLW+FTbxJd+b0BfH84=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140367,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhl4NfCRA9TVsSAnZWagAAb58P/Rf/EpJ9gIMrH7JugYp3\nEFY83rvjPqx0TJ0P1pRLAlUrUULBTtGVKi5O7bdf3qpzzoPGzy7eb6KHu8Nj\nilLj7S7eQG04BcbcKbWAuoXvBJefwgZ/rm77o1s3QZvSzSCaqoSYX/RpfQTN\nCmpsSOMKn3GcLCBkOByMgQdBGfmH4fFxrUVHgabWE/7FAY8i9FJQsBymvq5R\nF0SypnfGBpCITCti+nOyYunQe8uV8fCKUxrsT3PVAYSBcjNoygO8JO+SZkyw\naOA9RcwiXrOM54OH0tMICTw8yk2L86ufDAJ1VetKaM/TH0noIMFIIn3uCNKO\nq5C9jWL+5RzXYVsmU8dCD+js+/0sZ8z8bH/r9APrnYBbyMhgtHv8BQMhlxkc\nz+C7jhsKyIU2UxTSCpzKosaZLSXyyQuE9MlVqLr9mn6QZlk0xaQrVlmlPaMI\nMDrKiI3hesPRmqo78On4+cdqe6sw0OmlhokyTrbSO9K2oUbAJvBM1EHgnfYj\n1diQcYX9Dr6+suDbzwmfJHkLdvZDh6GceZX/v91YXNK7CGuE4lk2ryfElVec\n1xLSIIFjfllsHh/UfZJ34plMahYNAfAXK9Sdr5pZ5Hld3NSDHvP0wW0OJk1y\nPN7QjOUP7QTB79utbE1XYcdNa9vM0M/TvXpP+Y0LWc/IuQx4Do+8PlT3yJC/\nu5fs\r\n=2PMY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"eb7d81bce0229efce8c3e26245bbcb83c04606dd","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-19T10:55:43.633Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.125","@balena/jellyfish-environment":"^5.1.10","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.8","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.391-renovate-internal-patch-eb7d81bce0229efce8c3e26245bbcb83c04606dd_1637319519603_0.5261610215005945","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.391":{"name":"@balena/jellyfish-metrics","version":"1.0.391","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.391","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a0a067b81f768f1d94d5f35823aaeb4351ab4808","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.391.tgz","fileCount":16,"integrity":"sha512-zYyAeUHyWRu9LJPWiQoGUBJGHdTVIEBwM4eMHSEAvbcmtLmHd0pD3dsp+OdcIETsbXd+MHmM+MSgbdsGpJQ6MA==","signatures":[{"sig":"MEYCIQDat+il4NzaAh35H7FjsrN2uftAWDdnY3DRQRdR/q+m+QIhAP7aSeinGka24ZlFEpZqFc8K8kzZ1aPxTnGAB6P43fiX","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140302,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhl4QKCRA9TVsSAnZWagAAYDkQAIyuQEdFBSR59r0lzjwb\nbAxpj80wwDXgxejxLoorOce2YYJuc9pF1wSfbLRfmRoCMRw7DqQRh/G+Bv8v\nszWZ1FE3SiMF/zverBrKt5dXSGhrLFdPnAajnsayH52ektuv+a3rBPrg5vq9\nNSzYXy3/rTU7D9g1M4FpO8UehllgYmAXtfWq6Cm2TAclJtQn1Aep3gYLdVJ8\nHi/tbIwV7oFO6GYJ+eVQacsIbbnETjwWlK6x9y8SM+2XdmKWm5wV5YFfSNQi\n+pO5iJxtPIoqPgL3dWuraw/T6vl+KYuomSSOqTeRFqojxW7+My2Lsq2bPYl9\n0Nif+oT1Vka+LT9tbwApRPn7UjV7SWzVHbL3tOY6Ki8lqI4OT6PYCHfOpK9D\nsKF3W8a1++Eas+5igFgfu1ew+Fk8h9HFKdWbWf1rc3ZoKOraPziaAaH7ayUp\nO7XXBKhM8+MXsz2XyNaVPvX1y8zWtFNoT2Enc83yUFMR2npdni+AuAax5XKV\n9VPZaVMnuzZ9BeZHRrEt7EQ8QexsQir+bBG6AjC2Mc0Hs5VN6MbaxiuiWU6G\n3cU1zxGRaR8p0gdtHkTy0QjVzpKTQp9rjZCRODvDJe3mOgex5O18YAgHNdC0\nBl+LyJe2n3vVxhH5E2jyENISIviyf4JayiQR0+Ui1A6DGTDnntYk0/lc4+jw\nlME5\r\n=i/Xz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ee674923e0d1c2ea45282a28ccb57f4b277250ac","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-19T10:59:37.759Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.125","@balena/jellyfish-environment":"^5.1.10","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.8","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.391_1637319689946_0.9026574594862886","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.392-renovate-external-non-major-e5d1711b7d7cc862afe47200099cf669bde2bbe7":{"name":"@balena/jellyfish-metrics","version":"1.0.392-renovate-external-non-major-e5d1711b7d7cc862afe47200099cf669bde2bbe7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.392-renovate-external-non-major-e5d1711b7d7cc862afe47200099cf669bde2bbe7","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"155f7d4c032c0ea11140f3136ba166ec1abffb80","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.392-renovate-external-non-major-e5d1711b7d7cc862afe47200099cf669bde2bbe7.tgz","fileCount":16,"integrity":"sha512-CBcNNEwVpf9Xa56bkY8vKnKFvR/HDOS2q+N6b2AHBEvatRgcBpGw6FEJ2oDXyTVi5T2r4PIHw7X0mnAwkwmtwg==","signatures":[{"sig":"MEYCIQC4Le/1RWybPR/89OY/dq3376xoVVAoc3YeqpUamYwBPgIhANyBB7RedpYATUiJi2C4i4UrVoJRX6PgckLhziDC7T5Z","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140447,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhmEYfCRA9TVsSAnZWagAAKcIP/1wLx1op78X619NeqCLZ\nIZQzVfZ6uwBFsigNmOfjvNhuwhjG4G0VnJpAGx2rS0ChzIYNChuehJP2AxpX\nl50kjl2jHmlQsHzveDWg7PEy1VzKHCikZ8o6R5925AA+Q1BGE8tZ6MY7Z1a4\nAODTcgMnftDCKjifH8DGuta7cbz/UVNhkwrbNvy5TgOUl5w0EUQvoxoP7WHa\npDjnkZ0USkzd2m783ePMcQWyCsxTOxiPcGX5v+e2i9LhzR5TZpoGz97o+Tph\nc2Ii2bn+M+9jv0TwGF6o6yzB/ykmFJm2J976ZxxxoBQmxpjRH8nP+Cv3A7B5\nbbMVOSEvfL62hHl27tM3Eaj2nH7dLS6jWruM/AycLATrd07U7WEGR9HxkfAB\nTWleqzJ3+MZU7xTjjkf2w1igsCd4Kc2Sm/ZseT7Lu/L/XVNLA8Yw88sjD3No\ncJRZN5pu3Ph2YmxH5JhAObpT5ZP9X3P/DkHypla5JyJ6W9TImDYSBKIP0pIv\n19gXubprrmJERhwX6oJVwhPgPzMAOx7KCrJOVzIaBw3QLXMkm/VctkEVyJA5\ngoPnl8FQscSlsAgMqMKBfY6ZOzFQ9aD6TB5CO0XfpigTZqzaIqctf74/AO+m\nfnw0hBOxdHeDOI3p1qAOohL7OTnK3kmR/m8TWPe7Qqb9GKX3Laoc+8Ln5PYc\nUhpl\r\n=CwNE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e5d1711b7d7cc862afe47200099cf669bde2bbe7","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-20T00:46:26.181Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.125","@balena/jellyfish-environment":"^5.1.10","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.0.3","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.8","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.392-renovate-external-non-major-e5d1711b7d7cc862afe47200099cf669bde2bbe7_1637369375440_0.5712144824126149","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.392-renovate-balena-jellycheck-1-x-f0ec0e8ea54bce32395cb4b0fb0749b6301babe2":{"name":"@balena/jellyfish-metrics","version":"1.0.392-renovate-balena-jellycheck-1-x-f0ec0e8ea54bce32395cb4b0fb0749b6301babe2","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.392-renovate-balena-jellycheck-1-x-f0ec0e8ea54bce32395cb4b0fb0749b6301babe2","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a6b00ec5227ce834276d5443c8abd4b5456eff81","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.392-renovate-balena-jellycheck-1-x-f0ec0e8ea54bce32395cb4b0fb0749b6301babe2.tgz","fileCount":16,"integrity":"sha512-/6GUY2jgQvsxjRQ++37e180/UcXgq8X3aM8Qsobz8G8vzlKIReutuClQXiqD3ElsppYXWiLV0eA0HUcTKTqDZw==","signatures":[{"sig":"MEUCID1inuC3C1pTjPDh3KZ6qAEBA3EogxRqPze32Vj0Eb7KAiEAr370wWrYR7sEyZ9lPn7BCWFepHXQffwtvLFcDPgR0Z4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140467,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhmF6bCRA9TVsSAnZWagAAg3MP/1IiphhLmqVKR7GsIwjO\nA2+YBPKKI+A4ZbaN6UuCmXcy2NeKMWvhUvFysnFgDeDKAlFOXXBAU8jo+XF7\ni4y9YdCe62+mGrtgDWkdQIciq89wzGpO/z6F4gz/bcY+ZvFFQfjLTwlyrP/3\n+G718PZ+71QVtFSs3rPZGHcCcUrYcg5iFGOGSZY5HW3i3aUjSktmEMTI/IMv\nkgNus35zptjsNMJRWfh2dWI4FgR92+Ry7O2dHlJ90Z1m+RNF665bIa4uYApU\njqWMzdwy/OBPa+mc7UJV/UMDEXDXOxPKmyXb+E0Ywvosp28FBODldQeXi0mB\nJ/ANXmEqBczoWCy3yCYUWl+oXfyT1Le81v+nweZtx49vbTYqLQyeP/kSA2jL\nEty0xHXY52OhdXl3JHahJj7SPKgzV0kHUIBnmhKMXOJnUSu8PJMYvsk32y6e\n+8KvS5/TMInIC5loMrAu8lDl/bsT58Uz6fl93JNT9K53z47K+wENlwugsFAQ\na5Fx+8fbtu9xfRt2AxLoRjh5ju4tw/8/u51M7m/YdBTiXvSsFh5eJHQeXgZp\nfqjoR33732GI7pZyiCLAcBWZQ9zRD3ft5YhY0oPxNrO0BR8hxA2BTn3dcZ7D\nBK84ZgL1inz/WjuDp4QFen5yHwnSCRkEBJAUFsrkZ/icmJ1fisZ+dyjw7Ye4\nyDPf\r\n=vFaW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f0ec0e8ea54bce32395cb4b0fb0749b6301babe2","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-20T02:31:06.126Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.125","@balena/jellyfish-environment":"^5.1.10","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.392-renovate-balena-jellycheck-1-x-f0ec0e8ea54bce32395cb4b0fb0749b6301babe2_1637375643587_0.93476148354501","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.392-renovate-internal-patch-f7a74eb5c4427fc7443cbda05006e5a4f0dd98e9":{"name":"@balena/jellyfish-metrics","version":"1.0.392-renovate-internal-patch-f7a74eb5c4427fc7443cbda05006e5a4f0dd98e9","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.392-renovate-internal-patch-f7a74eb5c4427fc7443cbda05006e5a4f0dd98e9","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"dc7eb45fd306b565b94550765a35f819c7f70b41","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.392-renovate-internal-patch-f7a74eb5c4427fc7443cbda05006e5a4f0dd98e9.tgz","fileCount":16,"integrity":"sha512-1TKhNADrPhjo3vlbtoV+nXCUU/REdg4oX6mniFaCOnsNQonRSFs0RM7iDUfR53cc720tj/NEzIMeqEJmRce1tQ==","signatures":[{"sig":"MEUCIE28hIqDeUaMuRX/ukwrG0qOoubKGHl0jI1hmDt1xZ7AAiEA1HXpdgvTxyev6RrRxmiCoZ7nhkU9b/SDjHP2REGyXUY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhmLAoCRA9TVsSAnZWagAA5LAQAKM3Ur9X2qfX49x+RS/q\n52efYUIg+Uxme3LEqS5a3mdbBHve8L5ejqs0czI3h6oaWUwsIHYBLTbd9l7Q\ninSXdIF7HkOgTH51JSLSCFcjB5hgxTlJ+4N7B/u7KzT9gcv86lHU6vWLtSbp\nGhXaEzPedpwG1Afc1r7b/ozajDxYho9OLYUW6aDMXR52MSAeH8OugH/1v+Pn\nV4FTCstkVKehaT3b3pmPDlhNowQfv7PyhFVnETgcn8XsDpfwtnxV8cQ8QMCi\nswqUwnlBMpRiLU6CbTnw7v+z3zVREPC2EQCT9hn3IfnGvhksYJa1dAZ67zD2\nx0nZ5Jzdgd9fnG3421T9DGYz8W7sJlVv1BySpmCOmcyxV0eW6JdMwrtpJhQD\n6aj/HVoehFIKLoe20PY4f6RBRmcoRXHUHM82pBs07AcuV8wwNMC7sY+UozM2\nYE0UJvh0Gn8gFJgjc58fMwRhMfPCX7E1NSmRZyWpGGaL8rP48fbchpMF8Od+\nv3fUHvsm5HhVnJrb7t4HPCDvkjAnm16jWsmuCdVUaD0pGizGr/BMAqiBymr2\nSxsnGz/9WC5Fm4DUO9KXTe8ScKDLvE9VNq0fs81KMIuE+IbCqjCbYYlkL9kc\nDEQGCD0HFR5gxfmyAXrfUF19RDhEoWJlakKjVdjkm7b+0hXFBBH0QWHcS215\nhVce\r\n=RGfb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f7a74eb5c4427fc7443cbda05006e5a4f0dd98e9","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-20T08:18:53.648Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.125","@balena/jellyfish-environment":"^5.1.12","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.8","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.392-renovate-internal-patch-f7a74eb5c4427fc7443cbda05006e5a4f0dd98e9_1637396520395_0.10538984953871866","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.392":{"name":"@balena/jellyfish-metrics","version":"1.0.392","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.392","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bfc87b59053b3649d0024f9bce77d7698f2941bc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.392.tgz","fileCount":16,"integrity":"sha512-e7Z0png0hta3ivUb+f6RXR/cUuLUEVbjh2DQfNoUJv/gLDcVpseL5d0gJK21nRUZF32SmoWA1B4sXdEZMdThoA==","signatures":[{"sig":"MEYCIQC7wl7C1KV7VVpsSOOdCq1l+Kr7mLdEG6f90xzP38HfZQIhAIl281AV5xQQW8JGAUYAUL8zn2SEaXKurt3mYvmTiLFG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140411,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhmLDaCRA9TVsSAnZWagAAiQ4QAIhqj1BwoczxH0rXA/yj\ni30O3yAxmeo4bnIq8hVdBEitIiO4CP3Jzoigfytt+umS3/qbI8CsTxt/gzoR\nVuMiWrb1fo3Tq2rIiZ4dRB+huxvmsTGX+g1oeIm8Q2Sq6Ew+swpX1NTelmi+\nwAVOXK8A7RnRYwyGz58709kx7KAzz614RvHzCPM7dPW6/uCiXgE0gBEospm2\ngpJbJdgS+ZhzA4IWAq2QxNmhG+5QRsy1kfD1LyoZNiR6JDLsl02Mi1HMeAXe\nWlfPfKnZOMSAfjgmmauDLLVxAGo3O1EuiRdvXeyYUcw7pGvnqTWrPHgFWQp5\nw/qOBzv5Zd6t+oBl7/zG9plRR42NS3Id/7NnLMYttE8ME/z4qUxryl5dj1jV\nwyLNiFbdXpfRJurirN2XeXBeOeL2rzZFXG1Ibq1lJJnMakVCT3CuZzLssOl2\nmnpafkkJbIzBJnM7DWzGpZSOKza6wfb6Wg5xd/tmPQ5NjOYVtUTi0MNjG7Ri\nKw2JIbVK1wShjHa25xyQ6L5TdXB9QlmBlcixpeP8Q66x7z/qvFsyG3vgRdKC\n1RVU2f06/kTdhUGaDWXEQG9xq9gQijgogCHu/wGnfl1O5nfMSnUEgRqcdSqP\nZxd6iGNhBMwdepkRU94TW5HR7IhQtfloOmsFka9PJhHKCShPnwpgZiYFEOll\nA32c\r\n=ml/U\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0536124ad2f3bc941d9cf3fc08c7799c527e404c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-20T08:22:49.108Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.125","@balena/jellyfish-environment":"^5.1.12","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.8","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.392_1637396698591_0.4610673660263116","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.393-renovate-balena-jellycheck-1-x-9ebe7d7151c67f45b7e58ba819552b76224c8ea4":{"name":"@balena/jellyfish-metrics","version":"1.0.393-renovate-balena-jellycheck-1-x-9ebe7d7151c67f45b7e58ba819552b76224c8ea4","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.393-renovate-balena-jellycheck-1-x-9ebe7d7151c67f45b7e58ba819552b76224c8ea4","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e4ba4586b0a9b706e80cef31a03799069095f049","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.393-renovate-balena-jellycheck-1-x-9ebe7d7151c67f45b7e58ba819552b76224c8ea4.tgz","fileCount":16,"integrity":"sha512-lO+zPFpIisAqrF/SEGiUeYOO0vs93dzt69idWJcCGR296/P3pZJ4B/mAXCy2EpJTylOiKfDNAEZQFXSQZzOfoQ==","signatures":[{"sig":"MEUCIQCcf/wZXLeutU4svPpyE0Kc2/whNputaICVRPS0Vu7ZqQIgLQU/DFPnOYnDOq3r40LUH596VdjZXCGMB7BbvjhQw70=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140576},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9ebe7d7151c67f45b7e58ba819552b76224c8ea4","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-20T08:25:34.021Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.125","@balena/jellyfish-environment":"^5.1.12","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.393-renovate-balena-jellycheck-1-x-9ebe7d7151c67f45b7e58ba819552b76224c8ea4_1637396946445_0.9199115622877576","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.393-renovate-internal-patch-7a4eec6f7c82a795d6fa903c93fc74a702227613":{"name":"@balena/jellyfish-metrics","version":"1.0.393-renovate-internal-patch-7a4eec6f7c82a795d6fa903c93fc74a702227613","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.393-renovate-internal-patch-7a4eec6f7c82a795d6fa903c93fc74a702227613","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"66abe7c57007ebddf43f0de2f165b349daaee24a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.393-renovate-internal-patch-7a4eec6f7c82a795d6fa903c93fc74a702227613.tgz","fileCount":16,"integrity":"sha512-yu9NploBfXuteewaIVWdXonzP4p8yk2Gy82mPcZBb0faveyVyioZrECuEDTVxudliSMVy2nA2JIaW1epoha6AA==","signatures":[{"sig":"MEYCIQDLvN4thd19oCr7Q68bLVhGsH8wxYjwjPaVmNcALixpGgIhAJjOuTEITOst/aLOCtUBGux7QmNTpUeLw+8Dn+n2mowT","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140581,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhmNDgCRA9TVsSAnZWagAAPg4P/Rf792IQp9dtLsEPbJ8J\nCm6tATNYdK7mSjrtHRskNBWvIn8UbrPDvW8uia77C/aUAp1MqzkqHjp+docS\nz9hh6VfPjE7LhFxPvrAG9i+sfN16FgM0288bCBkhrj2ZZ6AgLTwgKBCp+pXy\nWAL8KPnkuC+lWB+J8vx1FP1CBXA681xx9fBUUYpjgLFLMc3ZXzirqmG6uVCM\n3iJqGJbhBHmPE/pMonOW23gsxfg4yj+broeyeYLTyY9e3aGJTjphcSDLniBS\nw+nefSX/fbbEDuH+HtXfIhzTybZWLGYo8pRwu3MR1SVof/WNxtW5a4HRNajZ\nchrmUg0RaRoktOy951sJvynZkdSq3eflKTdRbknxeYQaDwjyGw220d1TTpC9\n006Si61nSCWM6QTfEf9VrM05BmvANat/YId5e5C/yCS5CHThbVYDEF9c4fHK\nkrsgvwr/uKDCF7evRHa6d9aV6iqpQn+SRzTnkO6jAbYjB/Z+cM7AJjRSj2JH\n0MEw2KRUmCiaXkHlRRSB4rbnmnia/yb5pECM/xhs8UrqB/h2OvqlMbhkW6pS\nbUyMAv+swrVuI6gEcrPcsB8X81qUKCi7htglw1qnuItwgISSzoPqyJZ3P60U\nOT4xjjiNrTj4wHFJgOZrQQgCQwdg1Fqv/u4K0mo1EsOIT6jwopprNwkT7XPs\n9UHS\r\n=D7Z0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7a4eec6f7c82a795d6fa903c93fc74a702227613","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-20T10:38:09.424Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.126","@balena/jellyfish-environment":"^5.1.12","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.8","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.393-renovate-internal-patch-7a4eec6f7c82a795d6fa903c93fc74a702227613_1637404896519_0.6222591948652214","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.393-renovate-internal-patch-a412b9fbd99e65d8a97190640c25b21fa3120ba8":{"name":"@balena/jellyfish-metrics","version":"1.0.393-renovate-internal-patch-a412b9fbd99e65d8a97190640c25b21fa3120ba8","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.393-renovate-internal-patch-a412b9fbd99e65d8a97190640c25b21fa3120ba8","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"69c64f4f01f5f2eaa84692d357786723e0ef6a6f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.393-renovate-internal-patch-a412b9fbd99e65d8a97190640c25b21fa3120ba8.tgz","fileCount":16,"integrity":"sha512-SxPhYUSJlLcPE0qJhWqndqfgAB0taBZZFXPLsPAfWDzdmOFa/xVjsBdLmuk96uvFI2uHIi+GMOD1Qs50o94odQ==","signatures":[{"sig":"MEYCIQDftrlH868iH2FyYHrZUR4W0usclJNeA1detRBdhJM+yQIhAIJkTs0VLDxVJ0rmoW5ayYxz4KHe0DK0J2TYsX5PRH56","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140660,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhmPCVCRA9TVsSAnZWagAAHGQP/3LGfptBXPV1szXvKpIO\n+pHM4ctuPfptn50LocCcCJqE0mbSS7SdnPXq48j54zFAzirhdSiuXpnqCn7I\nW9kKUf3dDdzdIk8S5hY1SmoR+OHRam+AIcELjwHzR5JbGoW2pm1UBhHYphL7\nUaupPw7celEogofaJF4dXck7QH/dQBN144SWNFKBjBWO2Dar7ScrOUC/gFzq\n5TEzKaOXxiY4lWUmk6cABTB0T/+N/dDK7CM8nkzwbk3M7DDbbtwhGoSke6w9\nBK6BlCVbxqGumXDhf7Tow3h9eGH32RjrpjtDJuEXotTBE7SGEptRpv1VQymd\nWikCZ+2QQ+0KkbV2Oj7Vy9lKO11YKeMQiZWN2fXcfRbWPKtfW49IU+7alrqh\nxXJ32VWJ0nYfCuNzUmEfwDlGL31MyC79SOd63aaYvgXkr8fi7rVLF3ZGx9EM\nuFWLXCBR5EnPBrYQmWPOujiSMdvOBnqAYWWU8zJ5GE+jOwHOn+mFl+SMbYMv\njHLH4D1GmkEhgnvmmeW8zGIKi36kPq5c6Kak6xJTcEKB0wccn0CHbuj6GljG\n2eqq6dUyziCc2ZvUkFxONuw3TERdjxuQKycjrk+VBZAtrYFJS3ZbnXSQxyG1\nsT/mhLtbXU6527iAzwyQUSsXiyEPoo7FJzpmWJgV7E5gjScvZ9nTTO7XB9/w\n0jsP\r\n=pmty\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a412b9fbd99e65d8a97190640c25b21fa3120ba8","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-20T12:53:46.926Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.127","@balena/jellyfish-environment":"^5.1.12","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.8","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.393-renovate-internal-patch-a412b9fbd99e65d8a97190640c25b21fa3120ba8_1637413013779_0.6869397191739188","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.393":{"name":"@balena/jellyfish-metrics","version":"1.0.393","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.393","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"18ca936cc461f1065b1506c168f6124c1133b59b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.393.tgz","fileCount":16,"integrity":"sha512-uyy15JYfq3qkMFXAq5WCjL338UPciqKIB+/pbln7h6d7KmACxz8j00PE0wJr20XgcHCHhE9PZFQ7mYgFbXLxAQ==","signatures":[{"sig":"MEQCIArb1yQIkRzDfyVX+xhEau2xEWdYMNw0opF3obGelTHdAiBdOUPn80EIhbCIQu2CoLAXuDYE+UQk79f2GP8Y5poklA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140595,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhmPFYCRA9TVsSAnZWagAA7AEP/1wpYo+jJ9Rq4T8BuNd/\nl0doJBJi9kzRzzrj8nIISUkWaONPbSvHUCjh4ZMZHr8cLqrDAraha/2drHC8\n+0s8iNciGjPKOqNASTYkn4TSg7HFn3w22KcMlvcTfO6uhgQKtvBOuVavvXcQ\n0ZMFbzI5DFXyON05SvQyIS6C8RmgqVj07sxaN378sd/pxpwCqRIgIQPNboQZ\n0oxJUqLtgMlB8xAY0Qz3d0fA7J05TF/8hNAN/6xFpk7ef7qSB4AKsO3KTBtj\nvfMd6aJ8z/RnvP9BRYjcluS0HAc2G4/K1z3Vx49C3993EWp3JgEXMGrYIQPK\nc6hkaV2FNuLib50OMU6F9fdeRks2HKpyloWPzqQIzfMiSRBxqaSOpMkwGVny\nnsALrP+j/UUjITOZOTxVJGTox00391AgiCP53uc8ccGFqASETvMXy1XiyG47\nPvHuJz1IO7H5pNcOqnQaX5x65+ZFNVqAucLNnPa6cQCWUpqEo7vEjqZfkqjL\nOUMqhkthXjOMP0NcWmxWBb9hEqNX4UJtELFHBW5iCV3GJG+MlNMIL/u9sJS4\n7b247qS4xFqINiSDmv17zHjdu4QCTonqOAEdXpdYPTLeCL0k+FNTVR8DhI0B\nSAk5eTExyciYecgytd444QW5RfwgA8aDO2C5vzEtHdHxFaO9VhIzdmpjRaXl\nus6x\r\n=iJXH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ab3f15b718a3a4118a8ecaaa5ce75926edc7554c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-20T12:58:15.166Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.127","@balena/jellyfish-environment":"^5.1.12","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.8","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.393_1637413208583_0.08440844925836788","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.394-renovate-balena-jellycheck-1-x-badcb368995039946e7e91d5d7bf73c72cfc04d6":{"name":"@balena/jellyfish-metrics","version":"1.0.394-renovate-balena-jellycheck-1-x-badcb368995039946e7e91d5d7bf73c72cfc04d6","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.394-renovate-balena-jellycheck-1-x-badcb368995039946e7e91d5d7bf73c72cfc04d6","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"30c1e45fc5c32c6302a73ecaf68f394de5c18c35","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.394-renovate-balena-jellycheck-1-x-badcb368995039946e7e91d5d7bf73c72cfc04d6.tgz","fileCount":16,"integrity":"sha512-ScH57obIhEKxJPhORcANTxaUIh95yOio+vSfLJSlAsRVSHOGUL+qth8VgRtuYgGQ/IvRY9vlDK8ST/C0Zw+nsA==","signatures":[{"sig":"MEQCIG2tQpG9mqXhKGXLSh3SWPshDKFAhsZc7DH7nEcJcIhyAiA6S+e7o0KeV2vdb698MeSMLilLoQwNO3R0PLmbmMrJ5g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140760,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhmPI7CRA9TVsSAnZWagAAXKEP/1gKTXXmBCM5WbIe8Hpq\nFDowgF5Asx6f8Nkhe48NCv1/n63SJ14FMHcYzATFxTo8V9UCVzwOlTtLAesc\nfzIlTqCQrGYHl096J9RFzNySvJq1Jz2bwQHvcVzTfRzrvbYLOs/8XG9zh3Ak\nZzmvzCaMYDg58d/Q6HiJu2M1TAUnAoiN+hYLbaWWYcFK39z8GFsi1UIYvMc0\nZR0aKOpHbXulDiVDFAMGygKWgv6KNBV5FP8X5BBB5mye4cS+h/tQvHQO17gW\nWD1wB5bxzixIcA5pZ9sqouUfBEWVB8dXie09E0TzLxUFh4yt+R0QHqccICJT\nbKw4+O3A4a2piGzmR9cb7HY4DMZSWzgAFt1dBBBUAS9g8gYFQ2SaZXyY84Q1\nuXYwX32QgfaHBYGwaCAtmpG4nhyL+VzizBvUUeQ8RsMZ0X284Vw8viI+2J3Z\nJlA/2tZhWf0nmo3CKjYNVdxNKmWN8bOEguenlMJnwRr4fnzWjH+Zqt+0T+Cj\nuKu+gybZDclOEvCODiBQb1az9jYqO3O+9p54UeaMsXZklg7J8pUK6WuCaP+v\nbvmMUZ337cKgl+RmH+1f4ihmgHq6ajZlKgrzPa+GhjP6BbT/uT0U7d+qN/YA\n4gVq+x8ICFF6yPH2KMjkPlRCaRpKvNayRGWKxceHwTAvxk25i4fxxF+DVpj5\ns3/p\r\n=EBXy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"badcb368995039946e7e91d5d7bf73c72cfc04d6","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-20T13:01:26.424Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.127","@balena/jellyfish-environment":"^5.1.12","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.394-renovate-balena-jellycheck-1-x-badcb368995039946e7e91d5d7bf73c72cfc04d6_1637413435488_0.5984695097884924","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.394-renovate-internal-patch-4326580980d5cd664c7b8ecb2014588499cdf654":{"name":"@balena/jellyfish-metrics","version":"1.0.394-renovate-internal-patch-4326580980d5cd664c7b8ecb2014588499cdf654","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.394-renovate-internal-patch-4326580980d5cd664c7b8ecb2014588499cdf654","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ba380155fa5b23bbcaa42eb53161aea2500fd06d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.394-renovate-internal-patch-4326580980d5cd664c7b8ecb2014588499cdf654.tgz","fileCount":16,"integrity":"sha512-O+sXksnkJrR7r96d80g6AUrmaNtb/psnXse3q9Omd32hhijiZTQ3e+ovlH8A9/w4XbHOWRrOQomy124j+9v28g==","signatures":[{"sig":"MEYCIQD6sBmX2EDJ6J64XP3UE3vQNDnLJFdL50Uw1yBK/nosLwIhAMLgdnJ/FnM9zSw0eeGApUSf8kzRnPjgxBi0Dkfu+M2m","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140765,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhmPM+CRA9TVsSAnZWagAAXG4P/0oT5jmqJip6K07V+VZ7\nkfYo/DJo1AulyeowEj0R1DP+JXr0waEpzWCrI/Di8KYTUTH2hOE5sUDS/rqY\n1x0jXUaKGNluUDViInu5nVskb1CJSNLqO/Bma7exyaQw6oJpABi6y4X5LnFe\n5bR0ZIEZgIGGrq9n1ggtE8eTXsp4QVBdknTjZ9QiV1T9/pGHtyUK+uZGnem8\niSenFxX4BbVmipqVCjL/xB2sQd+QobdrqMkNV/mXZvMBftj/OxMtBnM3OCXv\nKtdN/NIPoBkbNObVlEAu9GQ95rTvtpO2i1AYLrclpfbUm+QUZIxB+enUzwzV\n7R5pS9ZZvwTmhdzL1waU8bTIMoym1XhOILBZYzP5du1VGby82xhMC9LS1ahJ\nBM1a/fxRNGqsNAxF1KDXHiAGJ0HFqj94Xnjw/aIU+jOkHSIyshcpMrFJcPy/\nKW8HjVidJoXPAwp4UOghRPTGpzw7fBrI3GZ5yMnLUdnCZPF4ATbv8kaH7qL9\nb/1OsizkWIfA+jhamuhAS0+2tdqGx4vpOp28K6wbSrVRk7zfJTyLMfTLrv/4\nmBBJwaMEw2xbj8/QWI80xes06Cy9r0xcaiIjk4ldv9WZrKieZfd85tJZv+Ry\ncumRP6fRsbIEH5Gh868/mOtqj2ghbAA4RmCwUWvY/evvlvF1w+r50StCxm7G\nGPsS\r\n=21er\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4326580980d5cd664c7b8ecb2014588499cdf654","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-20T13:05:15.482Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.128","@balena/jellyfish-environment":"^5.1.12","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.8","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.394-renovate-internal-patch-4326580980d5cd664c7b8ecb2014588499cdf654_1637413694611_0.4022498658793521","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.394-renovate-balena-jellycheck-1-x-e5842af21f5cb4d7ea22321d950ea49badc8f7b8":{"name":"@balena/jellyfish-metrics","version":"1.0.394-renovate-balena-jellycheck-1-x-e5842af21f5cb4d7ea22321d950ea49badc8f7b8","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.394-renovate-balena-jellycheck-1-x-e5842af21f5cb4d7ea22321d950ea49badc8f7b8","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4610b0b969146ee3586f61b74ada095d20036d69","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.394-renovate-balena-jellycheck-1-x-e5842af21f5cb4d7ea22321d950ea49badc8f7b8.tgz","fileCount":16,"integrity":"sha512-a6M10reQI/TTpTH8Q4a8bgXfuXuDewowXPUySl+cLf2KejyrXjezQ7kO3Tc/WkbTapZl29XdfxcTc2F5tBaUxQ==","signatures":[{"sig":"MEYCIQDA0aDrIH5Y6AbHPgakNDmH2ScaSi7IBoJkpGJaITdqjAIhAIzz/EGsbBp3TfB0xKcOGdAaIJ/sQdQxNNXFTtcMSY9Q","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140839,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhmPSJCRA9TVsSAnZWagAAOYkP+wTDZBgyTSQVSarzZvOA\nVLIeRCuHLa9vM3gn1LDjXNmnzY+Et9ANndhv+AJxXfUqc6pXZGNL3P5p86hd\nSkp+mfldpw2BUw+JQ0NOq7GBdPbmzRVN/CXL97D9OiwH1jBcehVkEvKmhpSw\nhYukSuajA2IGx3kWuWgO6Xs1OLrlNqNgfc/qMtTNqyykWuzl6MTV8GWN7/fb\nUKvKHnpaqfHsuLHMzwBh/+XbNdzmfC2z3MKqjkT5TDJTbo1nTu9CM2E1kibQ\nf/2YUEuYQmnKtuYiG7lzaRsw3vQCxMI/rLQBNrRU9RTRwp03N3x2EMo/MpuW\nedLX0cIHAXahlOmMiJZKeRMRGD60R/w8R+C5Ae7spUCwIO9/gshAxeQezOIR\nPzbKOLQlOu4aopAJWQhgrqxK3m15MQ439jrgRSpiB+BLo7x0JjaSsVuMMfLs\nwwIMUf3VTm65qt9468COOQQvh3S03YK+Pb9z5BaWbDAMLyGBtxCiivIpIu2W\nJvYkwegrJ+sbUGx12nUHU5yWF9w16cQ8sa5aSOwCozgLadxabjlkdddVMjs5\nyYeo46QbzEQSpaGDo13If2AvZdeXQL3PD4d/DIrHuafxK+RaDugdrezQcZqb\nFLrRhBaU+4n5LllzsTKswZHh8hD7lDQZLxY7FWj1S+wLAaStgx/pNIxctHen\naG1J\r\n=QYX2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e5842af21f5cb4d7ea22321d950ea49badc8f7b8","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-20T13:10:52.523Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.128","@balena/jellyfish-environment":"^5.1.12","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.394-renovate-balena-jellycheck-1-x-e5842af21f5cb4d7ea22321d950ea49badc8f7b8_1637414025145_0.39500110816282263","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.394-renovate-internal-patch-db44d4e5410ec10c1c25bb8cda0d054464789075":{"name":"@balena/jellyfish-metrics","version":"1.0.394-renovate-internal-patch-db44d4e5410ec10c1c25bb8cda0d054464789075","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.394-renovate-internal-patch-db44d4e5410ec10c1c25bb8cda0d054464789075","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"07d839adc698146890f2490011d99e44229481b2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.394-renovate-internal-patch-db44d4e5410ec10c1c25bb8cda0d054464789075.tgz","fileCount":16,"integrity":"sha512-/U/z2td76+MdnzNfIrpz5X37/P1FttDkmhCQ1hF3kOfX/0ro5+CB1i7HiuhtdA+FtaP/ngAzP5hmVtAI4zsSXA==","signatures":[{"sig":"MEUCIQDjV+HficA8PPO5wEs8NfXoLqQ2Jm43Nojpr1LTykhLQAIgEBZOdnfPGUfwgzevufph2Y7lI331WnAf7E2o0Qw2MlI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140844,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhmR8/CRA9TVsSAnZWagAASRwP/237WszJdALUlwVcCmzH\nWa9DbXVfw4wULH/6trFtsK0i2Ji4vj0JEaz2RoWMjnxb++aZ9FVgBInRIZUQ\nzmo1nwcsaeunLTWCc6AKmAt0qTeBkFp+12BHA+YUGqhIfuFf1uqbSBmxxnmM\nPqRRt7+/FsRC+tT8iEI9cDBF+UIEAN68k6t9+RZcGAsXybag4ctPRNpdhDWp\ntb7Ccn09pcKF8Kwi0YP5oaYZb4Ge/vX3LVDICxWGhgqLuXz875qUGtF2eIHq\nejxwF3t4QjpHBVq/m0NooSfcfS81m9JoaXpXjgh6h2uxzujrzOE9dmi6WOBg\nqSDyClfOrwH9OpP/raxJpgj12aunpwOryFbC4/mCAC7SilLxdOdmKEpxeheM\n9ZBPDEGLGGnxfUmGLXPqCH9cYHrtTiC7cFEGXPI0ZxcDlU+9WKMTmypBWSNg\nJWOOaquMXebQUpytjEWpx07tPP3BSR0voAR9Aiinyq08I+ZbzNzWBB2Mw2iV\nnwcJ1GkQT0dvWlnXmSMiVyFS1tfdhzwkQcjO5wYjiqzoYiEdHcMnKyuMeYaV\nBaCUnKhhiRF9bsbNpKvUcbIGEZWqSwtaHhwWXm6GhxdoTXzT8Ms6pAPWr5Od\nSN9vH3nJHwqilHiSd3hMHWIoMWaBgZCuhsFRAH7XI8gU+XwWHdAmn1p8qTxv\nBfB0\r\n=/rJY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"db44d4e5410ec10c1c25bb8cda0d054464789075","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-20T16:13:35.088Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.130","@balena/jellyfish-environment":"^5.1.12","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.8","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.394-renovate-internal-patch-db44d4e5410ec10c1c25bb8cda0d054464789075_1637424959764_0.05499955328268391","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.394":{"name":"@balena/jellyfish-metrics","version":"1.0.394","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.394","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b0e9cbaa665dbb47b590fa69236946ee50ab7e4e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.394.tgz","fileCount":16,"integrity":"sha512-gT0RfIV5PAMHyKzEP/gU5oFSWvXfW2Lk4ZCMkkOSEA59OWH6RHiE81hMWToBWsrS8f/CNldz9pbLuAUuHXlEbg==","signatures":[{"sig":"MEQCIEgPfmrYVKsRNsu6HcsoeMZoDEQflqFFF53CDw5sQOXYAiB9iSnZ0v5aodywBkI//kbGBgyO9IxSbjfM+Fp2wCWPqQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140779,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhmR/sCRA9TVsSAnZWagAAg9kP/RumkOmqk47wieC2DAJ5\nC273N6UoE5oVDOeHCi1GP2GCyOgJVMyVk4TGrw5/BUWAGGWeOGuXPdJqBxMk\nmiV48BTmcKqlWL80GrYVoiYTNaXkEGtz0yOiAqqfm7LYwx8OHHfPqD51LSFd\n6DduzEcRjRGX00vaA3k5t4A3dNxSUPD5UDokFK3paYbzqQuQTunB1SnwuRea\ncS9o5xoTIcoCmXZKYX2fqossqoHiwJ17l38Wi0Fvi+xiOGhKUnFjjjewOUox\n5UOdG3qW7suUGhqeMu8IH0OKxzHOKmx7Gq4YHKqIrsKXFaROh6sRsVwhL5pr\n8I0lTr4tEfte3srqaURLRuULGSCsTLf9DaB79nO4TYkeGQ4YY0HSGyD09OY5\nEzLDtjVw6VJrshxdfB8rhv3p5uDDU/bxYuz5D2+4Vd8o863wczoF2KCoHj9L\nk67XsTQwwkgyn1L9Ir58PrR1rfsIVdPhB/aO/DdMLxwYeWFfYa8F6AjYGYgM\nslk0WHRrFZ0gAWfPB6JcWoBnbTGfpwipAUJXjBrajSfxaffTiGrLRFytBhz4\nxorFj0VV9LbT4+aXXyE3tHzn/5HZw50W0nV0ROzMW5tJVK91xnrwGUnjo9G/\nJL4iCN/R1Lcj3prXYXjmoT2ewriIcar9PUaOXhVUv4A0kR+RG1Un6As/0bsZ\nSb2u\r\n=3SC+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"37e75db9b59c7e21924115a207a1988dc50cdbfc","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-20T16:17:05.067Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.130","@balena/jellyfish-environment":"^5.1.12","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^0.1.8","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.394_1637425132333_0.8922402184138012","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.395-renovate-balena-jellycheck-1-x-f193e54b920ba45b2c17e848109d0099dc6b3be8":{"name":"@balena/jellyfish-metrics","version":"1.0.395-renovate-balena-jellycheck-1-x-f193e54b920ba45b2c17e848109d0099dc6b3be8","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.395-renovate-balena-jellycheck-1-x-f193e54b920ba45b2c17e848109d0099dc6b3be8","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8891c2b1b75e906623bf0c9f4117b31e7f5f3a41","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.395-renovate-balena-jellycheck-1-x-f193e54b920ba45b2c17e848109d0099dc6b3be8.tgz","fileCount":16,"integrity":"sha512-krqM2Vrd2N7oFupFavmi0/ujMZi4M+WUgrBfjb/QPGzgHpKQaGdDW8VLrUBeXzdnDG6RV/88jOWi9MOWVhWq1w==","signatures":[{"sig":"MEUCIFqvx6B4nMGXCerucoy28eifO2NHOXg8QO9+7Uk8rTYiAiEAqhJK+SozmhaW1puIZhZZ+HOrar75xcw8HbY7UHmRY+w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140944,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhmSCuCRA9TVsSAnZWagAAD/QP+wX1801kvP3bqt5UFdf+\nX7T92Nuab8JSvR4N1ZoG+wj4ONO65eePs03sZ6yz7GdLf3TE0nC2tXeR4nal\nM0xfSdo1902VQwwW4yhMkcw5n7tn+YusvCkebUaK1GgJhJiCezIpzX8I/3Vj\nYZbsNkFAH5Pidka6gwC5HJk1Coc2aUnJ8di1OSu38mAM+JGhC7skBls3HSg+\n9XvMAbMDpXkT9qZ32c3SSFJ3d0uM5W6oUZe3yvwI8P0ZYwG03tXuMsaK3TiU\nMYaZMIg7Ojv1WtGtdqqQRZGp336XLanzE6JZ//lOrF5AnfOLLdr5vTwUv4dU\nwS1RrF+bwZJ8L6JvL9djYM88rT7jMfwU5bp31cCpfi/EqWV/OWQ3K1qxBmJh\nRFWq0iajKQYegZgdkeFOGwoEZgryxfxI0j8rBqub+DkeWKcQQ6t99WnMXMSw\nN0hL44vq/J0fr9Uce6o2Lwhfw8Tapt2FtXJiR42QRfllXik/xja7kowBbfwD\nxukJ/bkeWhdmymF0zpMPZkPZDkzeF+8KirT1Vpm5rlHeG/qaLgRotwSAmt2R\nINtVG9jq74BR23ejkEPyGNKYuwjODNeyRrfiuFBre7Ch+Ofuz+gNslq4zf/h\ndUU51+AGVmlKnbpY/tO8cK+BnCBhmrW9IF+UH1CQj3n9yQiu9Y5Keffv8p8v\nuAyM\r\n=sAPu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f193e54b920ba45b2c17e848109d0099dc6b3be8","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-20T16:19:46.124Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.130","@balena/jellyfish-environment":"^5.1.12","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.395-renovate-balena-jellycheck-1-x-f193e54b920ba45b2c17e848109d0099dc6b3be8_1637425326554_0.36600029982946003","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.395":{"name":"@balena/jellyfish-metrics","version":"1.0.395","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.395","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a7f41b42329625f7d3fa7cacdf43e7c346abe473","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.395.tgz","fileCount":16,"integrity":"sha512-tdldkWE7Pr9XZaJFMx5qrkjNAAcauvHsU+ag2nkXjYwuIyKAuXtypQ561/u/M7YelfDlRkWoO3umbvEQct7LdA==","signatures":[{"sig":"MEQCIBFsmT7Euw6QLT0+6iTK1ibB8jhRP9M90mSJPAYj13ZRAiA5/xboSAjslclXKpnwV9RL5Kzye42257Qcntzx+poOug==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140872,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhmY46CRA9TVsSAnZWagAA8jQP/3iLMoRxZk72Ybzx1bjC\n9PmkYf3YB8sRx/YljS+13geLU3Kbu/uTfaqFHMUtRIlUt9vVDL8LeoXqx3gc\nOGlqWTvrSPDMHRrO8ARs5fZFkTcIgyNPJ9NIF2RnuX0mIJbcmRwDytMfJzEj\nNDrrWCKlvbaluMC2LcCXffNmJPD1FyQIb2RjOcgKp2YjdG3nJtpJ/ikKVJhU\nbtnD0+ie0CiYJslRoubNlb21mgm07lPHCYaGus0jPjV/GHp0SJoWVS/gP82N\nCV9nClXU4u0Gjee9i70UEBsIVnP6sIHErSS99TOIdqbn0LbugL2VwHJJ21T/\nhKLlFmHoAb37DHpNP8NVP1HqvwwrvctU6u61b9yPdQ+ldhE8i4W+VxKesa+s\n6i0WB4nhN8zhETx4y3Ecj8lH0nrGmEVLcTf+uJMZ/KSOnTk0aYsO5eYXRy3b\nXVEiUyO9obl1Ei9OcjfCXBBmBktbosx865ufAosSyWLHMSdGnJpCG9DGVK9S\n+anro17XaLmPWrWtYtK9pXA9oI1RPr8qRNnU6vXi2aZEXfK0tWpUwHsZrdOj\nw/TmDCwT5JynDp3jDVlhw0oWI68Ui0GSsutDJTmgY/rR/C79BVZ0fdFioory\neq+3Nz/SLOtxEOsJijJpPCGrSiRYv/IiQ3so/b3oifv69ksKqQYbdHPPNp2B\nKhi7\r\n=4krO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a2141bec69cf36d40abe13073e847a2e0bb92bdd","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-21T00:07:40.049Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.130","@balena/jellyfish-environment":"^5.1.12","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.395_1637453370811_0.9616208710722267","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.396-joshbwlng-remove-license-headers-f6e39e82fb5544cad3ba3c913a96f9ba274eb925":{"name":"@balena/jellyfish-metrics","version":"1.0.396-joshbwlng-remove-license-headers-f6e39e82fb5544cad3ba3c913a96f9ba274eb925","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.396-joshbwlng-remove-license-headers-f6e39e82fb5544cad3ba3c913a96f9ba274eb925","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"984ae386f9c4698132ee6017bd52a87ec7026ede","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.396-joshbwlng-remove-license-headers-f6e39e82fb5544cad3ba3c913a96f9ba274eb925.tgz","fileCount":16,"integrity":"sha512-C34kqhmZ5PJ4gMXqh18+letlIrtiK44FowGSp0HzGfW3lymUr2Yxh+DfwIJTx+g0uKXZy4TxbJHsKmTTOzv9+Q==","signatures":[{"sig":"MEQCIFcvI2sNe90xik0Qr41WOtxBYg+rV78D79VYzX3iwL3SAiADzGYsnCfo/H8yOhieKm8JNiR7TY6JInqOkI6JHAxJ2A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140296,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhmZJlCRA9TVsSAnZWagAAWWoQAKOdDanwj/qZ74suU1A3\ncEHzyQ7rp5wjHR6Z/iTEwYmRKBkHhZQvyaSCIiZutaB49x0qNhELjdyH7Qk0\nYz2BKA/+sL+50KLFSx2vPlwffXStKrCKDyC42dDzq6f0ihseh3KxLMHkI2R2\nbXayrLaf0pNK0K3G+EW694pJFhXTQJxutkBgq02VocltEP60DyhslvCfmmsT\nPJpAiD4ohrBxaPjc1ob1HCLIbjQTov7+sGS4G0nbbee2bateZeaNjGap+LqA\nqhURaNil9BdiK4Nkm96nexne5XXqnhu6iGf3JhhD405h0OCf00us7ikXuTn4\nc/vf3CZv4JojBavL22Sg79n6zSteLClUir8CpOPudaAAnj1GrBk+mt1ZOgOH\n6S7f/aQCbjB+wC79bd8aUiQ+DwiErhau+HZRTV6I//pfFShIV70ne1w5Nh7P\ny/k3LYPJV7a309YWa/4bZ5dTqT0qWz8G991stLivfh1ePOZk+zwtu+H1wp0L\nUWEwKOKaDMz5lSdoaDSivgcTgd98ZYPPoEwfoYZyhW2Lzz7fb5qDokH/5zDU\nSJsL2RKpRpHqP2mYIXiHFu5/t6wK6TMQuG0fSKU6Q5OyWAApnjUE5bfI7Nsy\nQ9Hd81X4P/MJF2lAQc5q49wZ84OAJMoCjo/+2dqlF0UKzEnNkKACq88C0poP\n01RH\r\n=rmG6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f6e39e82fb5544cad3ba3c913a96f9ba274eb925","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-21T00:24:23.345Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.130","@balena/jellyfish-environment":"^5.1.12","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.396-joshbwlng-remove-license-headers-f6e39e82fb5544cad3ba3c913a96f9ba274eb925_1637454437134_0.26259071231322584","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.396":{"name":"@balena/jellyfish-metrics","version":"1.0.396","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.396","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7ec01e20bd7bbaae1dab9513ce38225424db44fb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.396.tgz","fileCount":16,"integrity":"sha512-LTWQhR+MvgZwewY/J9yAqmoYp7evkJg1Exj3p23Afbt91jzy7XjPPDb0bH9rRP5c3Xg38EF8Wtg8A5aUDm+QOA==","signatures":[{"sig":"MEYCIQDLXU9iUeqoFy/eCq+JW4DxPMsVwAynS0ziEJR8Ds2ziQIhALd6ZGfVQ4V7mACSk4A7T3ed0g66C8FIekYIbMv1UQrE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140222,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhmZMhCRA9TVsSAnZWagAAZrkQAJGhf1wUHZMhW0TvBO9j\nApA6FcH0zkyrIPp7QC8oSMaDrktyNmYEtXz+v2ne1XbVwDxGW/GKyKZIcTZN\nvGHtFq0YmwUEWLMKuwzwVWihHPvJdLbffFHc9AQ6t/EEes/c98AYZgY4sbEb\ntJnorNlAZMOqc1Sua7EWcs12huXzxOeJBikyVzkYEHXxdeYOPKzhqJe2fYku\nK4Te4/mN8l+YX+hRphVGOww1R3hGVNbVkqWk1PsiJD/K+mqtU75EMIMlwrLu\ny7uOA7hj/YJouP6h5anCew5XrIPfvhRfbjSakg41n4POdqYMfg9tFOKGKxBa\nHnkREBTd8INbyS1RpiltQwgUF9JlILnBpc4cav+C2pFqGCNEudekYu2OYCw5\nMQZwZFa/IrXiq5QgvitiSQZHArdLPLWFAwSnwbQjozykEMFTHxCkZ+iSARMo\nDLE/4ENXt8M8xkWmdzAPU7RE6SH2qVD0KvMW8O/v2w0AyVIowULb/C2x2vkX\n1YXV806VUx6CdAJ0YqKD0vUWcS58UUt6YUPk+nclMSZ3D+EZghu92OyPPTtm\nvnPYFwTRc0FSXhBL/snA5RND34N99Y2qb8F7AIbU/qzAQeg9D1c8XgLkJ2is\nhAFHqjbeZpRhmDbPTpsxvkTvB3FbsJMFg3hs0Q5M8pNmpvoKwRz6SOPIbz45\nQaKl\r\n=S5Yo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6f82ba6d6fea6aec52772d25915ca428219f7650","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-21T00:28:23.457Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.130","@balena/jellyfish-environment":"^5.1.12","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.396_1637454625523_0.6326908929954629","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.397-renovate-external-non-major-06f09fd5b26ef59acf85ba6735b212dc03c34666":{"name":"@balena/jellyfish-metrics","version":"1.0.397-renovate-external-non-major-06f09fd5b26ef59acf85ba6735b212dc03c34666","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.397-renovate-external-non-major-06f09fd5b26ef59acf85ba6735b212dc03c34666","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"dbeb8fce526ae445d83b154400d9feaa8acc9a03","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.397-renovate-external-non-major-06f09fd5b26ef59acf85ba6735b212dc03c34666.tgz","fileCount":16,"integrity":"sha512-RgtVrYdgeFG6DLSGxt8b4YKbsYQsZTyQN9sSpgaBEM59cn4LRA9iWX6kmFdFmgArfX0rLF+lpUzHsJ3sVjRsZw==","signatures":[{"sig":"MEUCIEWQp/5XoYOgCmdFxN3lpPVdcoGBzFIbLFB+Hn4oZrZ/AiEA2IfobLo4VU82fHNZHsUw1X89abqzRA8y7W/G+YrfKfA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140367,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhmnDECRA9TVsSAnZWagAA260QAJNbZ2x7DvqudqzO5cef\nZ97sgqLFssFtjCYnNXIQsFgigWQWXAy6z/h44Gn33n7BMFzbC61AkbNfU1uw\nqtl/9Q95tbs0RwjXGzgUwpEmX6eHJwXDupRS9C5sQN4sntAAOTg8h8A63b9o\n3ue922F1CxJZQw+XWAYRNa+FfOwzliqQ4av2/+SKu1aVoVZfbaZDZJ5KIam8\n4m0oCuYCI7lUc5JLVqOxrwI14bUHZGMay9qgPw1XyCTljsXJPKxjO5LvwvOG\nhT4W0IFgHyCmgTDk9PTYlYp9CwI98ZAOMdHmDW1GZF/aRfDZ+nlig+pmrqU3\ngPO8MBPbuIrhpFR7opKEXe6/oSHNK1c65EgaSr+Rdd3AM4pc5Gy+yNMmJgkz\nE1nt/8HMeluXe50r9CCXgVCuUcRvI5H+uftyVUrSMJCUXeMJ5j9+UYc4wSAf\nF5wN+5ZoyFHQmJf47DtO7kA4ShsY/nB3OFPyQZij0nbjkxSHxMqaIfpCoyXh\ncqXhwM/zRRVs3SNZzg+faS1vrFN8hRrRrMrwkBKFZVYroyFDYVsCVHmmeLEa\nPMmGmj/GlkiHAm1tErjCGcfJjo32r6gmxXNNGjwLASVK/Ikrjd8OUCB3eCvI\n628OVTLVSK/8RiUqoXrC5OKmdPCFbyzYAYyJSS478eVsfvn/OudCr/CkkulR\nUpwB\r\n=WrkH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"06f09fd5b26ef59acf85ba6735b212dc03c34666","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-21T16:13:07.418Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.130","@balena/jellyfish-environment":"^5.1.12","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.1","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.397-renovate-external-non-major-06f09fd5b26ef59acf85ba6735b212dc03c34666_1637511364654_0.46090333330918143","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.397-renovate-internal-patch-07631846ee205b9b06e19f3bbacfd7039992cff8":{"name":"@balena/jellyfish-metrics","version":"1.0.397-renovate-internal-patch-07631846ee205b9b06e19f3bbacfd7039992cff8","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.397-renovate-internal-patch-07631846ee205b9b06e19f3bbacfd7039992cff8","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7ae8b5cd5f0dbd17d4fbb9ba36dbec9be8946fc3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.397-renovate-internal-patch-07631846ee205b9b06e19f3bbacfd7039992cff8.tgz","fileCount":16,"integrity":"sha512-ZLVaB+a0eWskYehO+MWgw3FOHxFcmMRrunSj/WdWLssUalFNN5G8+ycBo4YLGF9i/5G7TUvTsefie8+axGk5TA==","signatures":[{"sig":"MEQCIBCIQK9Q45u8YJqCisbLH0OoY1Xosr6138VW/akv5bCPAiAhQ0lsWnf95KecCkGFYIW9vHGlto9fN0ejMY4Ig1FuRA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140359,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhmvVSCRA9TVsSAnZWagAArG8QAKOlv+BCjtmsmOUfAz6p\nxK0riSxped0Ill53zTryfVYsr9v7gZWab9Dsmvm4HbcnaEnZAGb/O07V1bbY\nVRutUfAtI6m9kwAHdrPcfOtDDeE+gcpsZrABhJL3JVW1eDHJsD3nDQBEqg3D\nXHczBCpWxx6F9GE7xZraqGlzKZMw5MMgvilYZREXOts4OtlAGB6Xjy1LYdBn\nPdYKCDL3DHQvv0WhvQHhFDIQAoUEYGPQ3uEQvemKItmBdmFyjkUC40qNuo5t\nUrpO1bTAotcd9aLFJlzJ4ZbvAbLtNLMfV4uoesVbwCS8aS6dqzWPhRxoeiKt\ndthjATg97EKOgOpR8G8vcn5zTEvvuqAPwcSJASIo0jAoL1TbMxmBD/+PT4sq\nKnTDjvqCKUMEDG7calHOvT3ZVlFWhlv7baLcFTwpOsudcWxZlflJ0mCVS5oI\n2uEDj2CNnBPEgJlH8mGbenS1PMbUYAUMSgiNuhXZe3dWpjUiiXfxi/5+Swnl\nCwWaVjAs9qKXbzQOBpojTE+Ah8z9MU/kGURpmgFU7N6TiyLpSA2EiCPCMuGl\nqDm5X9BWuibIGvUADTbLpbMOnZayvTSpvMtxpHW7dSPvt7u06cjjM7iLNzMH\nvVjmY7wIuzVM2RK1oHJElxgW75XoyECywWB3utcF6LNGrc8HV5yJISfY6Sa0\ncyG6\r\n=v28X\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"07631846ee205b9b06e19f3bbacfd7039992cff8","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-22T01:37:58.850Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.133","@balena/jellyfish-environment":"^5.1.13","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.397-renovate-internal-patch-07631846ee205b9b06e19f3bbacfd7039992cff8_1637545297881_0.43306417392531893","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.397":{"name":"@balena/jellyfish-metrics","version":"1.0.397","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.397","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f587fc4ba176651f8ac64c17ceaafcacb921ae13","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.397.tgz","fileCount":16,"integrity":"sha512-RWM6S2lGwxnBp2uwcljwRC2DOBt16A4QnaU2zsXG2aEx5rhEHW4icE0S/n2S9+LofVBtXY7Jco9gdqBGuXpwLQ==","signatures":[{"sig":"MEYCIQDI+ZBRsl3ottHNht7kzn32hGiKzy8HuOmESr25SgMiQAIhAP0EWYrJlxfScRpkiX9aZiIdQroXAgIGEcLxL4znANm9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140294,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhmvYjCRA9TVsSAnZWagAAph0P/i9cZhsac9aGDAzTzzdt\nC5yisGhtEiLLwa3iPf5VX+AxKGNcdNINs2t9ddwbwDYPkcbnoOLDMV5+Qp6c\nR60z1GL/iEgHxsCLxhLx+RPX7XwxtLSiIi0S6bn0l4fj5ObVI0W/OR6h/32T\nhm8kgJAozMy029bFWqPGus2RyJzCumX3iX2LJbeUexJZAhb3oS+j6U86XeXw\ncNyKRLC6PPoze7yYI0IV3x3/Sv/czwhcqSZYCnnUzWgjtDlMPUM3E3STE3+a\nm8ObDufQ6wacLGxNcioZ59+Z+7vHfVlnr/ag1u/4uIWPKZlhCP3WuCW254o0\nJQAfPxYIgCIMHkJ4f/J8/gOn0mZNIYBV0LcYydrGj43js/+yp+P/YV8NsOme\nVFxyhMDL2ZwXuoaU6aJIfRdxA/j265MyiAHQCl1uoIxpHVHL4WCUovL4vwhw\nF2pqe3ygkpC5isYZzpe8Nceazhxb3CX7FzKftaqekPdJogjA2xFT9/Tf1ypO\nqd25Xf8qycNcRkj9uEUZGbITm4MYk2py0wXHejfD79qU5SVm2r4ZIQUNoTMJ\n4DpUN9k4Gom9zESwQZo+lI7YZ6JdhaZSRlaZfIuEqJP9A7SKLw+O1kaBjK6I\nrSIaOqUOKymqJ7HAJD3IyOjVjsnb7q2Hw2b+NDG3e6ZyrfInJ2O+YPTarkWc\nVXoR\r\n=+T4y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"277c4b3f9bfa133a8cc9ffb3964bb77316d6f540","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-22T01:42:57.705Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.133","@balena/jellyfish-environment":"^5.1.13","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.7","@types/uuid":"^8.3.1","lint-staged":"^12.0.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.397_1637545507749_0.1540568399966964","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.398-renovate-external-non-major-caf70202a46ad58e7b2fbd8f156d3c9702868fbe":{"name":"@balena/jellyfish-metrics","version":"1.0.398-renovate-external-non-major-caf70202a46ad58e7b2fbd8f156d3c9702868fbe","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.398-renovate-external-non-major-caf70202a46ad58e7b2fbd8f156d3c9702868fbe","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6192bb69874f1fc9c8b4a2611c12d9a92a4c507a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.398-renovate-external-non-major-caf70202a46ad58e7b2fbd8f156d3c9702868fbe.tgz","fileCount":16,"integrity":"sha512-jbBGQbqkv9/FzGp6yTwLu5GLJ+sOq9YIkpyTCX9OHS7sLuFophVZwzqb5Y15TEHHfOKcPnU4emrm1XS3tlIjew==","signatures":[{"sig":"MEYCIQD79QnURATm58A3daqkQ0DPYWYzGm36TT2pXFdUbU7GhgIhAKRaJOGCm0Moyelv9pgtiSRv6KOZU5f2LmrKLrl5EG4M","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140439,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhmvazCRA9TVsSAnZWagAATNEP/09Z8INCdJPi8RqOUSQe\nPL6uGoQrA6TWUs907zftYwIdlQZAX+pXpwAaPhLnl8WJNQYCwAnZcwtb5Aaf\naX1O1HEyEt/hCJKnX89sYQAS5yHOA4YiNrWbo1og6NaEaCg4z95QCP5u3QbP\nazxENXJfTtoVs41n0g2Ak8bM33CmAPC7CYCh0OTrR2LZYq2A9tJ5I07ASXxM\nFoc4++DLxJEkZUXFWGxHkgMr3lN+kQJWcQ9Y5ePKf0zZEh0u5CzXVlBbjhU7\nYECD8ZCcWpOfshDuYTbDv/PTTl2GPuV/lbsKQ8mHZ+x9DI78SHbSuVGreP6b\nYlBFvfc8mc+d1g2Ke9jwLFrcJNtfd+2sjlHZ/nWcVTDuHa1Z0c7KH/oLuzZL\nzMc2umkzIDL6ZeBHnDatLbsltE7EniqFwb1GB/7cH1dDYqDDBeUE3m3j7rXb\n38aQhWEZmDftlphZZrXTPhzUMdnRXqimg6vdLm5SL9czJ/Wfuq5gl/poYYb6\niSLY4aq/ntpocBJtqCr9kXqhjI5nE2TpqaB+w9XGQZwrlWxNCIrLxWqo2tWj\n51jPwpIkHsgcJ1MNO3bf5okgazar0gyPUqNfw6iW7bN2XwwoJrIlbYoSbqBh\nDnIhM4bxhb1uGYf8jv3pZVJ10DvzhGaDtRrA/PrnONb54XCC3FyQ6mL07DMQ\nhyfW\r\n=0QDB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"caf70202a46ad58e7b2fbd8f156d3c9702868fbe","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-22T01:44:53.428Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.133","@balena/jellyfish-environment":"^5.1.13","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.1","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.398-renovate-external-non-major-caf70202a46ad58e7b2fbd8f156d3c9702868fbe_1637545651591_0.22730561288914264","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.398-joshbwlng-bump-deps-2ac4109ab076e2b258d2506d3643102b6dd845f8":{"name":"@balena/jellyfish-metrics","version":"1.0.398-joshbwlng-bump-deps-2ac4109ab076e2b258d2506d3643102b6dd845f8","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.398-joshbwlng-bump-deps-2ac4109ab076e2b258d2506d3643102b6dd845f8","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2f028cebd2df6db606fe2bf8b4a1a4be64e665a9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.398-joshbwlng-bump-deps-2ac4109ab076e2b258d2506d3643102b6dd845f8.tgz","fileCount":16,"integrity":"sha512-lKEkq04nVnAXOnySWCv1clsHPLe6L0zxziBa2V05VMoaEwaxZei2ozMdsQy/mP8n8VvlCj2571RiF9OhWGWptg==","signatures":[{"sig":"MEUCIQCe5yemv/zfbtm1v7bX7arUpb6cz47Vrfz5f+rwCR6WwAIgGe2eM7NMUP9ZSRE+uicKIwxCuhzEuqfbOgfV0NpITIQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140417,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhmwq2CRA9TVsSAnZWagAAr0YP/0MBwM53hQ4DUcM9FeHJ\n4ZTMpvmBhDSlU9Cn3X/uV+fhSH3/wWXIJTPbgO+2NmKcg0jI+wRc1u+mLQem\nmtOntX1/ZmTQJkPGhswE4sEDw5T+sUxzaG45+bbNsIVvrPc5GVoVyrLnLpzZ\nDIwhFsWnTpbvUklFfwx9JeQ6Vin+nOq/nk0qM3JhqcBtWGSNu0I5mpKbg1p8\nPBR9aXaKoeV6caAfuvY1Q9v2EzBe7b4OuTIPTtHZgPx5nJY7vnqwcg24eZoH\njCIADbhxG1JAvk/oYVALZ2Ve3E2qhwriEgofaeIxgSXPnUdWXKjIF51s1cb/\n9s70rRYKg8cSYh7jsdlo34jUgs6GuzibEsbNpr9pjf4ceQQA5fbwROYfHsoN\nwpL8RDKlPN1Vr6vK4AFEyr71Zj6hsgqYZRnwJhwOo8FeQZjxf5cJIifcGV1S\n0aFdvHWqO/t5NrtkdIn3ETPANypky7t/5bZfd7stp2g3OD9Xo8BQ6ca7hd3L\nVYRBzzrPHKyGyNObuzQUCPFSAIyDXB/T5hHWL5RuPt6Tuer5D6euu3bx1Vsw\n9/mF6TozVj48ke6KbDM7fg46D7uUZM8l/pQeCpPtUli/23NLJUMeocewQVJG\nN9/mstwi9LeUTuQlowdaphJ2/O6/cAOAH4ky8nPpLnOKkCFCzLNIjxEK0mz8\ntHJp\r\n=vx6T\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2ac4109ab076e2b258d2506d3643102b6dd845f8","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-22T03:10:01.575Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.133","@balena/jellyfish-environment":"^5.1.13","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.1","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.398-joshbwlng-bump-deps-2ac4109ab076e2b258d2506d3643102b6dd845f8_1637550774383_0.36208274795201834","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.398":{"name":"@balena/jellyfish-metrics","version":"1.0.398","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.398","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6921858ed0f01fd1cd4ab04d5b11e9ea904497e0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.398.tgz","fileCount":16,"integrity":"sha512-m4nmbGsBYdVMhScrWHjYG/MrEL9AQusVtSkQNkPDEMyaGmIv1Tmu2jFUn+ckGvF76UIi6R31Wyl5e+hD0Y5kUQ==","signatures":[{"sig":"MEYCIQDnl/bQx/w9KEz6Qa0/zL3y5klOwjIlraCYGkpEbUwi8AIhAJw0rpaAcwimK+zmbk6snxvQFWx6gAs7fdrSEnlhHi2c","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140356,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhmwueCRA9TVsSAnZWagAAaAkP+wcsFnjWyrlqDsWb2B61\nYyoOxS314/xEEq4R1q7Un/tEqqDMk4g9etzsxPl8LoHN0/7GnHpnmiisPv0P\nnFle8MlSQH95IdZO4+hHBMX7sreCmEdhox28urAAIbhkATmgKj1Egqf4zt1p\n3ZTb1EbMrckv7zFbgHhQ1cApaypyZirS8EFXZVguE660kLQLG+kiBV3tVLn2\nBs1gAccu1N4MCly4/c7B1VmuBwMffCdsIgFdDa/PgSB5bT0jv/EMRsRIzPY1\nXZDSQQrcyd7XxLLH9GNNMC0meTaVukJaYtTlimgc2jBS7YKIArIUx+BSV30T\nQ2Q61zSzfA06ynSmSuEyTSZXYPWfYpR1LHsogsp6XzqRj1HgF/W4wtaSWeTX\njMC30Pqwxtke4hCuAePkIK+KGBuMUY8y4V1At7vDLvDtCH8JXTk1ryuM6xPx\nzqCe9VMsD3ifHd2mPPKfekln+mnMEuKHIxV+f8Bhoenlk5stIUDYBUg2txkc\nutTKg8+xrn5GMoNuWAWVafFdNy1+MPLdr7kNaCsMBiYCYyHmmPvTp4v3/KP/\nwui9Y4FIfUCKpvcLp6GM+z+ynFyrZyAJC2k8TEi0Kak38cjt4zGmGLekQnWr\n96BpTcYqE8SLzUZ7R6RaAwsbG7dme4F6dZxe6UPO7OWIRwTr9pgMAxM0y2r2\nk1lV\r\n=IbWy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4fbc51210efd0e8cb753c28ec25996065a937f2d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-22T03:15:01.960Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.133","@balena/jellyfish-environment":"^5.1.13","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.1","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.398_1637551006647_0.08830609583698679","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.398-renovate-internal-patch-a0f5de866756e3dd7888c620b5bf07aa3772c0c3":{"name":"@balena/jellyfish-metrics","version":"1.0.398-renovate-internal-patch-a0f5de866756e3dd7888c620b5bf07aa3772c0c3","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.398-renovate-internal-patch-a0f5de866756e3dd7888c620b5bf07aa3772c0c3","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3a0015b6b7cd7b808466211a6730fe4930fe84cd","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.398-renovate-internal-patch-a0f5de866756e3dd7888c620b5bf07aa3772c0c3.tgz","fileCount":16,"integrity":"sha512-fZXXRPKc2DCCGNXqkuxV+KLpT5hXwg/gkRqHKKBfZ9ncAORpjnnFxkhqAsiuz2Cmwg0vwZ74ngZr6SypGbqaSw==","signatures":[{"sig":"MEUCIQCng2I04FpssHnANF0oy8NilQ/YWCWdRC92Kiu2h6dXTgIgV0HR9ESFYTXTi8RU5mx4XTMmOsnUyoia7nNjMHMSGLI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140467,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhmwwRCRA9TVsSAnZWagAAnWEP/0Ly0G064HJIx8uM73+x\nVCLAAnREAJD0kpfI+LOGOP+jcrTQb1QrkPpv+sAIBPYZ7NmjcTtGnw8ivZW7\n9rkgCGGMwb1YDyOh7KQRxrzPNpLnAvsUOFWTqy+OsD23CyCanPql05yUzkyI\ntTM4KbgAzKqA72+zxaWP+BupJtRXvtyigEECPh706iSd6fsThxsQPVqPp1qE\nJcPy4zXQ6q0cVcaoDw/Vq803Ya5Jz/+vJCWbjXc3tIf/MQPsz4roEVNen/BF\nmWAfvV4jO7EWZdrgjsGb20UMrZmklMMNc91UL1GsUHkFBy+5CH0PSKN7IdMU\nkkrAiFvxzDEkKYlGteBXtYz2mVgrcDEJE3+dygfQenYVKbrcMsjcTzxTOvm1\n7J+ARX+d8vmBTfVpkxzuB4KYXJ9w3bsgLRStrCWMHl6zbQCkECRblK8oMp6K\njK4mBYKQTsuUpneNqg2sI/hJqRGNiCxhMmb3T25fy7UPdT8LaA1DVfPiHRN6\nzIZ1YqsqnY0Skc+09dlziQ2sFVL5vcEuNnqll0sgQXWRkKS2neJhNvHPaqEh\nvEywKrnjSB+uMvQ6MhmCUQzwL0BuvspVRERj4dXHCxVcLAJWuB69WgOfbk9y\ntIQHC1b8KkCTaCqcrHEAmsHR40210RstfdhRpMqLJYg3m0+duJZzCjszTrFa\nnzA9\r\n=dBA6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a0f5de866756e3dd7888c620b5bf07aa3772c0c3","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-22T03:15:59.919Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.134","@balena/jellyfish-environment":"^5.1.14","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.1","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.398-renovate-internal-patch-a0f5de866756e3dd7888c620b5bf07aa3772c0c3_1637551121786_0.9494823847705842","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.399-renovate-internal-patch-a6061bdde25041149aba44cd2785acb3888f0723":{"name":"@balena/jellyfish-metrics","version":"1.0.399-renovate-internal-patch-a6061bdde25041149aba44cd2785acb3888f0723","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.399-renovate-internal-patch-a6061bdde25041149aba44cd2785acb3888f0723","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"745d781bb75ef1b35e49640849107e0e1b118ce5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.399-renovate-internal-patch-a6061bdde25041149aba44cd2785acb3888f0723.tgz","fileCount":16,"integrity":"sha512-T/lakwIJtUitqNVr1jtCADEQnQTHqmGxxI/XtyHD2Is9UoIHfVgDdIHOGQ2H206AJLKO3nQ7xO0SclrxljDgQA==","signatures":[{"sig":"MEYCIQC0/E5s+CCUxT3oYjOEbReWidBHKtshXDkHnHF7bttudwIhAM7cEgkhsnDo/r48R+5iuVdeHqlr8FDQAMp/E7r9vW2S","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140493,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhmwyvCRA9TVsSAnZWagAA7OoP/iXIfDaoAay2pFtLjOLv\nd2zRlnuhlp3VmdoMqXhpmRMNKYzW9oolBn6GlSeiRsJ3mbGOu/7sCEG1BMab\n8vRe0r8Sys4Js8YRH02sUaLiJb53ZSyakIHlaHdRYc/sG5EzgMoJDTve6xoz\nYrxiHfpCUOYs9dvLIAzMLbULQwbUmak2KRKNnvC2dsdBjGjOnvXYS3QmYqtD\nC6Pdj+jAqpqjB3er+gAqi1gpmBu9s1va0ACmaFOnH2A8AJhriG0tEY9oWb1g\nboan6Ffg2F84uIf4ZfJdm+EcHluB5Q1HoLcKSDVPA4isd5K2JaKx/ZYB55pA\nR4EdmeMmmE/3S8ndkKWBG4EHZXMkC5OVIKX0xO7A70IIBmB7k3F4EzdPRTpE\nc6pwCpPWn4OA7E9LmnsEUSFkvYx8fHx3pgfd4S70LnN+bjK+FpKl8Vi68yuQ\nm838bmSxFJc2CsiyLkcImNiECD2JSjr3tfyMnSJQDWx8I4clcw2TI2H/EhEn\nz7z6TrOJAMVj+CmaV19bxWxAEjZqmit2Lr2sayrOO3GlRUVUnYm+ArglfmbC\nGUZy1pcTgcBxx6gqNJVYORl1ml82Mvx+uMIO8JFkzlYhJrlYt/IQ4nFLvbOJ\n6aBVVnP1MWG/M2HOazprtKLr4avVkqwLW5tGkiBYK9lb637WUKGJZpbyMIrK\neM51\r\n=iAK7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a6061bdde25041149aba44cd2785acb3888f0723","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-22T03:18:18.322Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.134","@balena/jellyfish-environment":"^5.1.14","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.1","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.399-renovate-internal-patch-a6061bdde25041149aba44cd2785acb3888f0723_1637551278903_0.16774260686655174","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.399":{"name":"@balena/jellyfish-metrics","version":"1.0.399","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.399","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"26d6b4eeef6b640124078fd9fc6ac7dc73bee7cb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.399.tgz","fileCount":16,"integrity":"sha512-dN5SG9tzpl7PwQohbGVMj5zmVkPl4H3Qpxi+ZCV3RLfwjB7SYJkDEs4KcDf4cUBUc24fh8whSP7Vm0vKcheiLA==","signatures":[{"sig":"MEQCIArO6uJJEH7QFamu9hLCLnYGr0+Jy5zER7kAyes4p7gJAiBkVtVErl0Wv+ddEnbukg260QUmdaKa2GSA/BaEjc71/Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140428,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhmw1WCRA9TVsSAnZWagAA5zMQAIR9J39NaBi0wQCXCtFv\n2zgkFH8C47AjRqAzr3Qtrna6gAERMJ8zNtTfXNBkc3lhXlqS9WqnyXK6WkR1\nFGl725AbweU+dzMEtVua+UmSkA0VAON1c1GVEfUvZqnzCRPM6PBfdTMCfD3o\nPl+SpORNVY6OSz3ZUZ1jgvcfL7S6X0v74Igtj0NZ0eY2i0RPxKRXc2U63Myr\njpOdGa6kJhu3dCyTl6NqJ4FE6cYe98g4bIAHWH8qF43twoxxDVlFcX3z6tjH\nsRG8ov+bIyMorEl447JNgEDpLq+h2a8lZL/tInOAXQrgkITs66Wr23TXyx5K\nNCxbOYV+ItNlSwP7eOOl3B2DqA/ObmkXYOrf9tX5W/FKt6dqjtnb/Cj5qxVw\nKygVOGbZ0PZeD7IQj6MoPFGkCgQDog85u/B3lmbBRRsHSamQxrtS/e/1Ao5f\nVkwhNxi9+Yf8RZ4P51e9mFGupDuEEp51HGN/nOkY0lXJMhxBNmquZpsvfBps\nbWon6hqBUEbJowXjMmSft/DMAJAaY1UhJlgwljp2I7XIVDUHJtJLkHlq37QP\nQOLBz7buOammsjLLIyanUbotpn5DuYGxTFxvVSWX4S/Ft3xJ4/dL14+bms4P\nEpRVVfefnWH5juk/7czlFwQoA+i32Oxe6gp6wDfLUMCkeBZfXeZ6QiwAY/6k\nUCP9\r\n=/JW2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"16668abe0f31c8b12bb14e70366cc58f0349567f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-22T03:22:09.016Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.134","@balena/jellyfish-environment":"^5.1.14","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.1","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.399_1637551446641_0.984536970891916","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.400-renovate-external-non-major-d91b35f1bf51160655382a0a1d5dd78505119df8":{"name":"@balena/jellyfish-metrics","version":"1.0.400-renovate-external-non-major-d91b35f1bf51160655382a0a1d5dd78505119df8","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.400-renovate-external-non-major-d91b35f1bf51160655382a0a1d5dd78505119df8","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"894de6941c873ed9ad91f45439c03bfc42035dcc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.400-renovate-external-non-major-d91b35f1bf51160655382a0a1d5dd78505119df8.tgz","fileCount":16,"integrity":"sha512-LLotfClqZwpsbBxmTvFMY5MW28sBzUVDOGTa/p+HBhLZMBZ8bAGKiAEojmnz62uFTWCjOPezsZNxn4IRqYHqwQ==","signatures":[{"sig":"MEUCIQCOuMiPjIonCmJeCSveE3/UdHOPi8Srk2zrzsDmPNwcAgIgNJy/YK9prm0N4YRA3G1h6eD5GWoZXhMEoAheor6/350=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140586,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhmw38CRA9TVsSAnZWagAA4ioP/0XiA8qGCO5mhyvtBVtT\n+3Z7XzDcwtIZLQz3zFlnlFBlJq3TsgZyJB7Zj8jEzJjm0tV856JqtbmlKu+u\nIWIZZdgPkehhP7x0cqc1Xh5Br4yH8JftpKI5S6iWDv/xuOxFnDX2AHpHSMwQ\nRnVTgY6EBZgdg0KcVoLrFZHdEBaN+f+PNHC+hCkyheqzrgJ4mk5c19odTAaI\no1oYCYUTRPhrnFjh87c6RCZiynT4WUjSU+RF/lVDt4Jf3PXUcvvJ7Nzn8MMT\nvPkZJUbEmR7dDV4eDsqZapL/w0zlJO7CPJpib8+aEl85zH9UP2HFaNLVsL4Q\npWITU2mK1XaWCRa7A9Htd8u04SwNRINrpLqN0AfLqJCbVt3ogSVSom37UzP9\nRnU2YJsRLqH6Uj5/CejZjUerpB00/78Dzp/z3Rgi+wRvl/k6Ih3G9qk7zAaP\nlnJVSzzskx9oZKnkAi2eHDThF8KvDUyEdtwOp/pZSbQkRoVwn0gpMCk29orY\nUl8+WPvkkEn75rSGsLEsJEZzNUsyZC2ZXghIJgYDl3k71f+hKvF9dC03HCmS\nwbsKZ7c8lBK90EjlL06xTiOA97I0nP8DOWmmQak//270GZeSeBYePgf0eTGW\nq3ZI8SYyOb1IXevtXx30c24LeDZMjg2IoPYLz6vZLiqiEa3xoYSduOFcW27M\nyld0\r\n=2EG2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d91b35f1bf51160655382a0a1d5dd78505119df8","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-22T03:24:33.339Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.134","@balena/jellyfish-environment":"^5.1.14","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.1","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.400-renovate-external-non-major-d91b35f1bf51160655382a0a1d5dd78505119df8_1637551612566_0.07330559656181079","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.400-renovate-external-non-major-29973d299962578a33cd8c4a617c56149f364470":{"name":"@balena/jellyfish-metrics","version":"1.0.400-renovate-external-non-major-29973d299962578a33cd8c4a617c56149f364470","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.400-renovate-external-non-major-29973d299962578a33cd8c4a617c56149f364470","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fc96babc94baabe1d0b0171d57df3e5a16d594b3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.400-renovate-external-non-major-29973d299962578a33cd8c4a617c56149f364470.tgz","fileCount":16,"integrity":"sha512-DkO58OaMkSp6cTLBPlH20iHxfq5zfv4iyj4wtI/fjRvBX+YOdUJa/2hHVIhcpBjU1V9BSmWfmkW0tVM1K/SPuw==","signatures":[{"sig":"MEQCICjwEf3e6MDJ4Jfu1SXTiAGRVcuPKCZJzYW5DZ45eZzsAiA5WZHQvZOyVmEjUWDBSUiVq3o8NnXRCDDgVWPAKDMnJw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140573,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhm3xyCRA9TVsSAnZWagAAgWIP/0SS16+BgbQS9SAHCgi2\ntbHFiny3MJ2ARBPrdGmlXa/JOKw0GDPaorJJ1e1XW76EcNX0zRDldv8lEi6I\nuI5tjW/EFnZ3VNVp2NodgG9Pwb4gMMZdE/ME3DiK1Rp5i/btyQqr1O9wxqWw\nPQ6GYwc4+hYj1RVywHbW0vEMCgLbMr/EZvt0DzvBT8dlBZ5pdrOez5X3qSYY\nB4oTIRNCNDoG9lgOQ4pqCDMxVP4hQ9cJCKA7dxmKlHHDmUR8pHjhDFq20A2/\ngvn21YAyE7pa+FS8AfV38Sp4u9kRrnc2IgnFACAo4H4G8wEmlUl5PJeEg46j\nB1FceATDfwcgGhko5WplxPJnFnjpO/KBlW3tSXyg3JMyPSCB69CPHpaA/7ix\nECLPUUMHiQk7VNnZZipdj40wyjtFLsjdUtQxvB2XBHQ7ub1Uqn/h1rgi9hoz\n3ixI05UgYjMdbTwvEuoNaVWmphoYFuZjRQ9UDtzob1gFh2lKzjnGpyKRBls5\nQJvommTYJwbtIM3DOQkXLr3Iv/YoPwXqlm0L9BwDbRe/OZXSlljCvEdDi9LU\nJarVjtOGgklvvjtT8rDTo6VXPxLmgate0o5agQfervvUsaZUWdevkQs9/HU8\nXhZfuLhFWqnSgH4IwK0gIdT2bjq1hTNO9hr3cGnzEEDsDXcQHcqwFJAbLPFO\ncR7K\r\n=+QRQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"29973d299962578a33cd8c4a617c56149f364470","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-22T11:16:07.233Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.134","@balena/jellyfish-environment":"^5.1.14","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.400-renovate-external-non-major-29973d299962578a33cd8c4a617c56149f364470_1637579890313_0.8073766084713774","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.400-renovate-typescript-4-x-a301655ace3d6bd233a779105a3530165388f67f":{"name":"@balena/jellyfish-metrics","version":"1.0.400-renovate-typescript-4-x-a301655ace3d6bd233a779105a3530165388f67f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.400-renovate-typescript-4-x-a301655ace3d6bd233a779105a3530165388f67f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a13bd6b51ddae579ea4af8321bf8e344a0a3900a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.400-renovate-typescript-4-x-a301655ace3d6bd233a779105a3530165388f67f.tgz","fileCount":16,"integrity":"sha512-RZ8niv3GXZhLLypVi3ZslmH6wrJnpPTo6LTHQU9sC81gaVDDTdq9I+VfUbjne/9hHll2HUeyKEZozaQL3GkOBA==","signatures":[{"sig":"MEUCIFyty0oh3onjV61uqcjXCl95mjmzkkj3imLsaOv9t7xNAiEAySwZIBD9xP11zZh0bhsx9A3riIhM2FYGoh0a9A9E8/M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140582,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnFUkCRA9TVsSAnZWagAA/I8P/2wzVAvGh76rACGRBrSX\nyQUkMA2aVutHnmw9iI1A8iHNL2+cUXK/3xuAcy0Q3aEgKseqUNrz9Yc9BG+c\nMMblxdDdOGtV8Cd/k1LRtU9V4wv3JVk5y1qzaXCJclpnipTmhgzY21jmmI6k\nkbXFVUuSyRU46xRhAqKnsMPBOMfQJelVzyjhosBXbj7BPNWRZJ6V/dAF9aAM\n6qwHVzP1VMJ/BtRdgFC1txxoOTSa8F3cZpt5Ki1CmCVBXr+v74+jKi3zgLUU\n35ebSOkl+l5tF/ftulY7qjxPjK5dlpP7btA+ZfkJZLc25n/F7/huLZM2GF/H\nz1UqHyAS6JSbqL3TXaxG9RiAFuMjgCsdQvD0z6hm5CgpGhZargnxb0KgVkwG\nref48GwNGCir5skR2Yqtd0ZzjbFxy11zGVjvYAtabXLYzqFN90nYPg4sUb+G\nRZFgrWBzZhqm/JyP/Y3MWdvYWIDgr1/V8A1ySpaV34+xufmq9iWS1Uc1HlE5\nD8feNSvZEW93aPV4rgt3ZEgxSN+XuitUUTErtFSffq145Q8x4Ri53r5RO/D9\nL7y1ba83Mcne1o4Nf0SxGtimPMFWSzSw6QEk1JKYpaOH++rQFz31QP8XzdCu\nThrd3pBHpoelSE66uioMKrKBjirbf+lkezbMzpLmExzFoZqi8eg4g6MP+klq\nK2wZ\r\n=P/vW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a301655ace3d6bd233a779105a3530165388f67f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-23T02:40:05.118Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.134","@balena/jellyfish-environment":"^5.1.14","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.1","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.400-renovate-typescript-4-x-a301655ace3d6bd233a779105a3530165388f67f_1637635364185_0.9363973974597437","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.400-renovate-internal-patch-e7796edc7b6df0f5ca8b5fa60ea2dc9c9b12410a":{"name":"@balena/jellyfish-metrics","version":"1.0.400-renovate-internal-patch-e7796edc7b6df0f5ca8b5fa60ea2dc9c9b12410a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.400-renovate-internal-patch-e7796edc7b6df0f5ca8b5fa60ea2dc9c9b12410a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ecaa4a2f458df4170c4e23785237695e79d74bc0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.400-renovate-internal-patch-e7796edc7b6df0f5ca8b5fa60ea2dc9c9b12410a.tgz","fileCount":16,"integrity":"sha512-GRNijVA5uKzboHdj241rcmhsTvj/fvtc5ZUZYgzIMICNqTlRkh2G0PVhKWSCnXqikH1ClgLod6kbmowUfrReig==","signatures":[{"sig":"MEUCIQD181Xd5MPrhWxlIUUYhyn/gvbbjCxrZTmYmWNXuCX7jgIgPomlWCR5UsglVB/LLrfS8ZQLAmnL5ygUi0vxU6URpTU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140565,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnG4kCRA9TVsSAnZWagAA/J4P/0++96K27fB+645vIjTq\nkkfb4HEolQaiOa4ZTECs8uWPk0QWsUW5ruk7YaXz5D3TFz8NYPy4ntSPZ+u6\nfOawhUJ2U9FM3croefRF7pgRSoUkuMtFlfenHIjJPRBiLAB99GbHAdRB/i4H\nPvnjJSrFq2u91nQ+8qrObwozlrrIMOrzKIQep1gfCyAVlREt1+SBgzMohLmv\ngVXz5YDXF6O9jOtUjuCVSymGEm6l/TetIT/cti9/54NBhLq8562YJ1ypvlfH\n9/UatI5t9oCWovxiXM2zG5ZDTVWTMDqKIrq6bRjVOBNWa4T4ssf+aMZi3ko/\nRifUAXPxTHhoCLXSbyW5mWCyAIqTI9Gg1exl5oYzxrGYiRtDc+purL/ZEyrB\nEHbUP/QmzzFTzvsOhV0BD+URrdqXzWq+GeTBnnxkwhaN9SKOhk88jfXGuU0n\ng1BQE/mToPpLeBcsn7bW5PUakzgCn9GlmwpIVACjngp0ahUAIKTxQAd78VJ2\ngZlplw8K+KkFCiAXSVdeOdWVsxCSvJ9xZ21+/SW+P58DtqWasosP/bWpKmKN\nM9TQdt4XL3t3mvlJN1gyrNd7YUpYgUwqbLeDFJDIhvahfKd9Y9sAJ8NcDXQK\nfY/g4SrVx/dCRaf3eJmg2srkgp9zeFgDGvGKG3demrns26xFg4Xh37Jau440\nERzU\r\n=mcN0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e7796edc7b6df0f5ca8b5fa60ea2dc9c9b12410a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-23T04:26:40.706Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.137","@balena/jellyfish-environment":"^5.1.15","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.1","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.400-renovate-internal-patch-e7796edc7b6df0f5ca8b5fa60ea2dc9c9b12410a_1637641764185_0.9622445182397148","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.400":{"name":"@balena/jellyfish-metrics","version":"1.0.400","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.400","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0700065dabc07539c8c26fed3fd079ceda58d668","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.400.tgz","fileCount":16,"integrity":"sha512-E6Nby/F1Az9vKL7JTBruDYJNwm7XY5JkRO5OfedSfF9mnspfF9p/7ueQEIgM5oZR7KagC2SR+nZH8zJT2G2uGw==","signatures":[{"sig":"MEUCIQDPQB2CZMxua3YRIEISqi/YmtI53laijgRZTDwtWgPkMwIgUXxdtoJHcVefmvZG41JAS3qY7vLndn7R96rM6mih970=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140500,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnG7oCRA9TVsSAnZWagAAR08P/2DISOMeVjyob87UHcfS\nXb/ijFs8s1WfXpEEQfmd625q3ad6Op+KJo6wpSmpO1l1fLcrvd3o5xLKtQUX\nmiMsiNRBCjLDxju2VzwWIsIAz5AEhIgYO4PLRrUcKtZ+D5PXeZ67wDz+5sWv\nehMBbWOR0B4fxWrOqHX17z/Zt3ej2wOh6SNKtcayl5vL4mIvqJ7JptpM2EOs\nq2E1Dg+Q7MCYkmbyCWJcAcGQ0DhaZNYU9BQnQNgkENP/mJ1pqZq90AZAZKZG\n2DtQCnnXTDdPQX2Pomiw0ncepOqOItOuqjSr+PeQSOCchLISDAMZmhi2xWVX\nPDzTj/AaTbg3aqRyUe/yq1K0oTXGs0ZaU3sgJONT0HNaFg930ESPpQG7131e\nVdZdtr2fqg48LdLbiXx1daTvKK/+ImeU/jvvTk/ndCwqttYNbrsdfjD+6rhG\nulD8Vhh2ACC7gfzUUDDn66RWeQwddmae2yuRBG3+dW3g6RByDgnR847Wk9p8\n5hHWxOdetnhAnq78CaS7uSQaUwyaXDqJi16VRDKgYsInXWr9HaLFTBmXmOL3\nm7GIDGu7c1OIrqJHNK8Hw5J020uXqOPu/x0OypOAmCTbOAMcvkUfEzgvVgZH\nIKvtAX35SShjmDKtLGiwbqe8O8U0Jw8Kt7c8Hv1CVLXpOWJQFPcLgxjoU0q/\n2Wpi\r\n=thXb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"37babd11e9d2d31eabba6aeea8f1dbd3ad397174","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-23T04:30:34.732Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.137","@balena/jellyfish-environment":"^5.1.15","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.1","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.400_1637641960080_0.789827164748925","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.401-renovate-typescript-4-x-b409e2ea62449b7e88732d95f1b721413bcbc44a":{"name":"@balena/jellyfish-metrics","version":"1.0.401-renovate-typescript-4-x-b409e2ea62449b7e88732d95f1b721413bcbc44a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.401-renovate-typescript-4-x-b409e2ea62449b7e88732d95f1b721413bcbc44a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4282dd89c6e8467cd1231ef6db2bcfa0ef0f9a1f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.401-renovate-typescript-4-x-b409e2ea62449b7e88732d95f1b721413bcbc44a.tgz","fileCount":16,"integrity":"sha512-NxP37uSVpoBYIpdWnbQ3TBuCkBmS7KLi+W7E2XhGA/12DO2HDMLNGOdVXeag0qbiCoZKyR4prq6Xp/YXHL07fA==","signatures":[{"sig":"MEUCIQDW8DrcU0NDdkln49N5CcaHfhOslmToV02wTkm95W5HSgIgBo4VgLcQvxSglBYzMi5+Qg0PYpRq6A9mfdvPJzog1EI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140654,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnG+dCRA9TVsSAnZWagAA4igP/0N0oCMlGxOA9EnhwKQA\nCZro1vFRmlemBTFtiodlYSkp0xvNa2wKVORlCvHvrmyXcU2sjb1XdEs7wzSZ\nMI8mW2pQqvcVI6xmHYIoALWU86GGJ/gg7g/NLXdRFGr2NGPjKF8ccpTrgb9W\nCgjMhTAcaqtjYiwEdMND48zGg0OZmgigxoxXpukkePtzXyFWI/q3Mnj8ECtY\nJ/z1nHRCJMwVJQnzSayqVicUS7fdPghzkOJ9wUC1LqJhXXIJX+ItRgtYkBc0\ny4TaDpypnQo/FZE4cLuswi9b5QMrM/bBPB0vXY6LaX3qHorbSJEgcOD5M9UT\nCrMlGaq+wehTvIkqc3mglYnfmT4rT5jDdUFDjsptDlSidhFVMCe0hob+7npg\nq15+dDK0Xrv3GsJccTbkNl+3DgwCmKC8O+leSQoQGhuiyYX3gZj/mWfky+eh\nFNaydZEHSWUf4INC+44I8bnhi7MrG//jBJKS7sE8d1Sq/FfgwOg6o25Dm7h5\nhUqaPI2T2lT2FLThqNLKNm+zBJ608eTuOswvOh52dih0TP/HuUT2d3aG7sXf\n4ozIWI2D8N9tSw6K5QFNSWddgQO89rnOge0mKz5EclFiOFTgA8kFCuasvpNC\nU6LyertzGlKcIVa5RMr2UyneV92eP2HO7u1Z2DV24M7Ce7/qMwz7ZgRbXf2j\nmTAe\r\n=WNFd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b409e2ea62449b7e88732d95f1b721413bcbc44a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-23T04:33:31.231Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.137","@balena/jellyfish-environment":"^5.1.15","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.1","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.401-renovate-typescript-4-x-b409e2ea62449b7e88732d95f1b721413bcbc44a_1637642141355_0.5258959515946406","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.401-renovate-external-non-major-9cbab0a99b7a20a20e2e1a75f9674bf34742da5b":{"name":"@balena/jellyfish-metrics","version":"1.0.401-renovate-external-non-major-9cbab0a99b7a20a20e2e1a75f9674bf34742da5b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.401-renovate-external-non-major-9cbab0a99b7a20a20e2e1a75f9674bf34742da5b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a32df148c8793c8947b9b62574caea824175ea9c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.401-renovate-external-non-major-9cbab0a99b7a20a20e2e1a75f9674bf34742da5b.tgz","fileCount":16,"integrity":"sha512-zpGfU6wMYn11vUJ6VX2D59tMPtaMnLxFEyvcmVzn5+INAQkK9MtRxcvFJZ78yJ5Y1qxUn9AFoXJ2DuUjqq6gGQ==","signatures":[{"sig":"MEYCIQDhbrtRuYdFaTKHKIVT/HNynKGx3r9Ou3bLsaC8AxLrzAIhALOP8+txhy9195eFDwLADHhruWCMCTFQO7oCpWy/Cchm","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140660,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnHABCRA9TVsSAnZWagAAeNUP/0wHGLMbk3Gr7QJPYeW4\nIw3mriUj/eIVc0p+L9VY5bblIe3p/lOAAph2tNabd9BTWrctN4DKM29LCyUp\njyh3S0wyStsYWF1S6f2JtsFhQkZjopT7I9HQ+RAwepMEG5tVNr7WbfmvnbgB\nkQlGMxA4k8jl73bZvAme6t93QOgxygJyFVBjgAX8cw/PEE0hsD4DmU7iNbIr\n0fnxzlOl5+FGqFNTwj8aIAFboxRmoxj+i3WHOVCLItqnxwXVTnVEeYCOh+VQ\niyPILoUPonvx1hhgqFnlKoqULj65c+G+Xs6jCVNiSuOqb92ZONhI+30IAEnS\nDMvG4Ri3KYYbtMmUc7Zd/Jv/tvfHsYEG1pL5mesp76wIslhooX8tE88isk/M\nBRxwSJLP5XRWKCGuhRfxiLJSofqNJEIJ8KNJunBiane/bYZ69ZOYzJaDJxrF\ng9jLNPwiguGf7Jdgh8BVo7G69oSMKG/Ewlrz5xVKDORuykp9k8jU0qP9mIi4\nR624woKkwJGBZ4Occnv6cPymQOazQmuzVMSChww3OJJ1iNSjTyYPptu9Z7FJ\nrUC7G0o8l0WIa/8/YNRD+SMipwLQDKCn4r5vWzyBswbDcSC10rLhv8BTC9JT\ncrMsvRHOAz/inu3Ba4b3SOPTrExa/cstKn3yujO+9+Cq1PhoDrsgoIC3jnZ5\nD8Vn\r\n=5/NZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9cbab0a99b7a20a20e2e1a75f9674bf34742da5b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-23T04:35:12.263Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.137","@balena/jellyfish-environment":"^5.1.15","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.401-renovate-external-non-major-9cbab0a99b7a20a20e2e1a75f9674bf34742da5b_1637642241056_0.6135940966640163","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.401":{"name":"@balena/jellyfish-metrics","version":"1.0.401","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.401","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8c89dfcbbf7bc79afa323b8b94146b9d7942ccb4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.401.tgz","fileCount":16,"integrity":"sha512-fzjRi7otbmZCnfTvXVCzFcyoEzjdI+dfXuGGVa7NU70dsFqB/OPxqRUsHgragCOo7yRmBXYfg4xUpjlqTSQYNw==","signatures":[{"sig":"MEYCIQD230tbZYpFoxhXcAkTugLSXufRJ7EylVCQumTLiRxdygIhAKvhFxHwY19NZKj5fjdrAtgR5YiHRtgZMEP7rQ0EMZfG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140591,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnHDWCRA9TVsSAnZWagAAt1AP/A5yrMOXCXJQ6M/M58BP\njMdrNdVpq6mi4slQbs91QYvobYDBvriEc/byRsQyVsF3WXBv3HrlFuGAZBA/\nOdyMp9q5pUg/fBdGd3V5TXjorUsDW5aK1ddc7ggHtD8U6yJAtlfkB4mdUE/v\nc6MSmgBja0JiWhwoHCyrc7njA3/W/Izo7OwEWjzy6mBBjIfXNe/MUuz8qDmc\njFe2n6xEtyQEt3eUwyixUkQ2b/0Ms5Xh9RL14P9mevmbuTOrZZdzrdVGYppm\ndda/jGw3y7z9whbzWCZjtAeU5hwJBY3vTZZhxkjZuZkN0Q52RpNYOKOLK6kk\nlubeDJLhjdR/7rfSzkFCDMvmnLCmNmBPs5ODS9WeS6N0S/zwdd/0HFlibm4a\n5T69kD9OKldAcDVKlUQThqtY9PCxOnYheks0kdIyfUyUg6ojX4iUbzZTQIDL\nH4jNTHay0NU4NPrP2ZEXP1CFJ9DngMXCwDOPl2viO62+ock36xeV6NMYqxv4\nAdDdzeu/0/Ka0QQSavYBfRBkse4wE4+biNkHTeba+QhUzMCMSqtP/zB1wqix\noX0xTyWOj1EnDupmTcx8vLDw26/mIRlfeZqAAgZdnr+JVYI+7T8zcZu7uK12\nm5vbtANSOUtl/rwnusBpG6Hwy3MQU6MtX5d32OqWd1km1vzgAWqWERzLsxlD\n4OJ1\r\n=ELJc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7189dbe3b7b1391a487521261ac43f370bdac9b1","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-23T04:38:48.806Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.137","@balena/jellyfish-environment":"^5.1.15","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.401_1637642454244_0.468025713117479","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.402-renovate-typescript-4-x-c5cee3124809835f4ce4e11f331eaecad7dc4117":{"name":"@balena/jellyfish-metrics","version":"1.0.402-renovate-typescript-4-x-c5cee3124809835f4ce4e11f331eaecad7dc4117","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.402-renovate-typescript-4-x-c5cee3124809835f4ce4e11f331eaecad7dc4117","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"34ea7c3502b110e5e0073e8c7dffa248292fc7ff","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.402-renovate-typescript-4-x-c5cee3124809835f4ce4e11f331eaecad7dc4117.tgz","fileCount":16,"integrity":"sha512-FwRlD9mSojXi18Rt0A3l/Sm3R71ChB0Zxo5cnfznTt/Y4I4FgtV4oQ2TGXgd/vodP3vDbN14Cx7SxRfz+txKEg==","signatures":[{"sig":"MEUCIDlS9DzXnCGo0o+e+nKI6uc8UU+SNBo/Yrb9LIapRKWZAiEAtHqKyAAK9P04MNBIpvJV0FIZSfSYT4ZG9KEgLiGXuRE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140745,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnHGKCRA9TVsSAnZWagAAtLMP/3I4zAECarK4I+ijoHGe\nXHzQOo0LaDVStpYTcxGfv7YnR5if/NxbzfEJF+yV3h6OEPGz3WPPL719Sy8z\nRwjkbujMDkwxKfck++YgIgnnuMUDqJqdJQixDFXlGIWcOft5HmM5Y64cFZDQ\nY6ddcZ9dg4+fPyvY0FEDfhh7KBurDZAyzJ4ns8ddtR0ox8jbRvpCf9I8TijF\n1XjqigD6b5XzbuNkPPtpD5XmYawahLnJ8kVRCOsWi6edf4EZApVL76YJCCdo\nUxLune+rkfCEjNl3Ab5Bs/sxkL+Vv74SOxSzZuwUeR7rqMYDsBi9Jtd7Egsu\nVZhWnvX7b53J28E6mWTPIabXXSV11efQTw50sdmhgZVS50PAyjpA9gvroA17\nyNuPdIfU9uyKQEn9UQ3ljmqEIJB5KyRW2lIgEQvlgSEIA3VrgNoDk0uH55Pf\na3J8OvNd6NERCy/M/zwmsdJRtoyRm2OJqkVNL+3squWwXR784rM0j81b7faE\nbHTFQMaUePO7WUenZCfL6xX97XehD2wl2+Us9t8lp0ZIEuwI9xSgWrAz4ex3\nNa4ehbRpokVNteoySyKCQ+vzWbPtKK8wjXZkjNfWB3NVTszpNwbdXc3wG2T1\nZCLoCCI9sEMHuWxkt6cUr8H7fIN3i0QjBxGr8dtosh3Ys1qLIUUhPMw1RC4Q\nT5Ie\r\n=EjRt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c5cee3124809835f4ce4e11f331eaecad7dc4117","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-23T04:40:42.411Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.137","@balena/jellyfish-environment":"^5.1.15","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.402-renovate-typescript-4-x-c5cee3124809835f4ce4e11f331eaecad7dc4117_1637642634527_0.12133447749678306","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.402-renovate-internal-patch-4e980d9edfdb0bea12bd5b43fa6d26793a10f8a3":{"name":"@balena/jellyfish-metrics","version":"1.0.402-renovate-internal-patch-4e980d9edfdb0bea12bd5b43fa6d26793a10f8a3","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.402-renovate-internal-patch-4e980d9edfdb0bea12bd5b43fa6d26793a10f8a3","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0895cc036fd80a00dc6ff2d23b9c6847936c66a9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.402-renovate-internal-patch-4e980d9edfdb0bea12bd5b43fa6d26793a10f8a3.tgz","fileCount":16,"integrity":"sha512-UGCaXoS5hUC6j0Wj+PmzUQvFuS+67Q4vz+ig0PDUEwQn1N/TmTLw+VUEoapIPhk+0RavhmdHtgY0yodqPSY5Hg==","signatures":[{"sig":"MEUCICY711pSmifzLlTqv7RsTiQfQkDjEZ0W+R0WxARHcPn2AiEA6HMhTGAIbfnzaGl9E9c55vlGQOR8osjl7yeuJk5YHBo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140728,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnZs4CRA9TVsSAnZWagAAj3QQAIrzOF6p1f1K6HMW9lNR\n2E1qVXymqSZjsH7dOzg+RBy8YkBG8zYFcNLgBUJVo87svSqfg5z47Ss1YUUU\nbTyAych07VtQM/AuPIKDQ21h82C9fZE0T+RNYJmjABcra4b6trODu/W5cyam\nLBSL3CFIzG/CrRxdeQcPSF/6Q75sDXFiqABG9hvFqqGrM/1/54HUADHOBEMy\n66yOaKOvs9OqHYuc+KDQ5x55UF5ZVDD83Ch10Xrf4RT2xL2tMc/ygfv4n2to\nC1sjlS8/OprXecO9tlb2AxjUwdrQQCCVLfZM0Le4v4jChxaa9aFqlV03/rIn\nu9SQ0UNSANXEiHbrZp1EWishWpIb36BsbcXqbwBNk7UC9Kfn/GjBEgUbBmjZ\n0Wcz4t+xyO8UluO4TWgw3nNsEFoBFFOtqrCqu3wsgOU9n/J9Ll+R7sUJeFWX\n8VRC5+BqmYb35pX5wUSjyCWYCCWcMOrUtB7WqyyZLNWnWmELDN8XfFZQbHcm\nLtSEL+lstPcv1MEnlzsbuFrSKfsSDlszqd6GbnMv2PeNSVj4LLl8IsrDsekj\npFyhparmPezXPf34a6W9riIWME6XjfeZZX0RbSJxqpeuzbgK1Agv6yIXd/lM\n+3zVODvrEiJ+8DBzAZPw9M00/pXUPOZdnIiaqbZWuHf3OLoLpIpjeOSgM+Y0\n/HzI\r\n=Ac5Q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4e980d9edfdb0bea12bd5b43fa6d26793a10f8a3","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-24T01:51:08.399Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.138","@balena/jellyfish-environment":"^5.1.16","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.402-renovate-internal-patch-4e980d9edfdb0bea12bd5b43fa6d26793a10f8a3_1637718840534_0.9043843972264676","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.402":{"name":"@balena/jellyfish-metrics","version":"1.0.402","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.402","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e265d1b401c184ac45551629dd6db5fd93cc66ed","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.402.tgz","fileCount":16,"integrity":"sha512-15Ef+SDRP8gWRSv6+t8/EIPq0ge0VwTyYEJ+r6KKhQbka9QAeT/XpFRqp0RbR/13ha9wDaacRZkLk6NENzgN0A==","signatures":[{"sig":"MEUCIFBSINWRrjdNEoVp/Zxom97ste4tzkw2zSO5TnRvhjbzAiEAnG9e/dGx6EvqEChiHcFbSW1m0MLAQmbEdJHqJHof3u4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140663,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnZwlCRA9TVsSAnZWagAAy3kP/A5X4FNdOyvWe1Gx07YP\ncr3vEilcNJIqjX31YROlUqFFmvQ4y958JlUA+Qhrrktnt0nukYdz20lPOnIW\nfAXvF/ZtT5Zji2C3IyshPu4nPFjvwUM7UWVHYTh9tVlnbQoxzn2k0HSNBh0K\n9YOtF2035lg+RV6H2F+dzgEMKcBV+rzvQkqasn6I2A1sbZrsOrrSSTUDaMGT\n6qgUWmlzWnhqeeDymk177ylo3EZVgedq0Vc6NT0bZ7R7TfVPct32+AAlfK5X\nD8aTPI9GXIyoJP4/P6g3HB9UQe8MrVrfRJUUejudgGhtBEmVp3OvWOntWh+A\nNazWgPXgZL8dK03Zycz+EqIeYo5rKhX7ud7CKg6xkysjmA5Q2Ov+b07pmWyJ\nFR9n0QSmeptW2hTTnehVCn9Mk4xzR7uRtEubb616CkdwlEWURLC6m5vzF35P\ns2tvJAEczsYsngSfUP71KefWHTo4XaHpXm0yj68MoumREUKbIcFfkPt21c06\nlQwTMg12b3uKGtiiNaNk17Ng3z4sZKGx5GNn/BiuLXk+rV18XjJ3mg7s8GKa\nRVm/Gxfed8ZDdbvwhMtEzfhMZ1CTxUSF+Te4fSywHX1wvRfWOXIHWv/yZ3Ut\n3UKkqgXwNnyzzqJbQnIxSZ95gDEREdTVQrFTxsvgsFd4sTVJmXq3ceG+EfFa\nrzrP\r\n=WjGM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b5c9b34d825492e5cf0ed67b8e65018c466134e9","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-24T01:55:58.462Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.138","@balena/jellyfish-environment":"^5.1.16","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.402_1637719077573_0.11324351393136856","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.402-renovate-typescript-4-x-59ef30e0c85dca82cdef8001e72ee977e359d480":{"name":"@balena/jellyfish-metrics","version":"1.0.402-renovate-typescript-4-x-59ef30e0c85dca82cdef8001e72ee977e359d480","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.402-renovate-typescript-4-x-59ef30e0c85dca82cdef8001e72ee977e359d480","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e981464c73afc191dd2e972e8d4c919eb65a64e5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.402-renovate-typescript-4-x-59ef30e0c85dca82cdef8001e72ee977e359d480.tgz","fileCount":16,"integrity":"sha512-gjMf3fIKwzxnRNO+Ue2b0KtIkr7Aw4oTQ8kNeByfsNPCvWJ2XIDjKRbMsQE9C7ZNsEIVV4C1aX3aZh4JYkxhHQ==","signatures":[{"sig":"MEUCIQDkFY5/J2lNC2DEruIwkDybDEjI7AYnKhItEWrbgmxY+AIgDfH3lw2DtdH8fZcZFuprTcdbbPMv5lYrD0rglaNeKuM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140791,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnZyaCRA9TVsSAnZWagAAbiEP/jVBMsEiKp5UhfguFL3M\nLMM9vM8OHiR1o6pdqA3u3xejx9xHr0YgqQpAt0b53Y+jwNj3uiNpr2XbKV+r\nGtLOTZSFtbMNxnmfa4egJjqZkTJ1TkpuVUCw8GCLSBtJBwrhwIMRFVQTjT2P\nwwQY4+UCB+dFvD7NN9FZvLsRXv/qicbwuyNhVJgqIPYQq3FnUkXR4aDnSHYy\nTOSIRjOPT5I2uRy+2nORQoWHa23YVWtUqu8k/EX6X1qmKlHoMv62IsrQqV6s\nzsHoTd03hf7vYp6GeylhG9eCP+z5AMZjMBPf62VK8fT4YN4ePPAD76G4qebo\nLZae1W+nDjh+IOyyDBUK+0TbGFvTuMY59X0osgqXlOFyUJPYvhN9bYAsP9jF\nKuJbct7tWYeBgzdvkr9mcuTFi/Q8Lx/1/SqBi+MZVQYsUFEHp146kod0Rso6\nTBv8M9JhG/GwVdpGv9bDDPEqr+WRroET0bydZTuKYhD/3aHl4X9kOwfdUEc7\ndKoC4mtngZ6Mb2a+lUPGSyG/RJLX7Z5n6P6S7JgINrEEQSXzcFPapy1BWJSZ\n9KSybDhdEtAMfItCcctv3xMMv9lgL2vL1wEl4sLYD90TfsbOqwOqiAqaRsQg\nHEuHFP56DTpfwrsHD3an+tH4GPE0+VGQshuogU2ShnpK2KGpOD64G4Ehv50B\n+G5e\r\n=t7jf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"59ef30e0c85dca82cdef8001e72ee977e359d480","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-24T01:57:08.762Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.138","@balena/jellyfish-environment":"^5.1.16","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.402-renovate-typescript-4-x-59ef30e0c85dca82cdef8001e72ee977e359d480_1637719194351_0.5212296722226919","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.403-renovate-typescript-4-x-692879ffd683ceed56021e42293cf7ecc96e9018":{"name":"@balena/jellyfish-metrics","version":"1.0.403-renovate-typescript-4-x-692879ffd683ceed56021e42293cf7ecc96e9018","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.403-renovate-typescript-4-x-692879ffd683ceed56021e42293cf7ecc96e9018","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3327fce9f2806461f22380412a6ef7b744a6d907","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.403-renovate-typescript-4-x-692879ffd683ceed56021e42293cf7ecc96e9018.tgz","fileCount":16,"integrity":"sha512-JoqXdkUDJY89ha1LLmSLDj5VzypFuh89xCQXTdyv79OMp8F5KiajxnNsOBvb20p5UdvRAVHdiNr0BpMx4dWivg==","signatures":[{"sig":"MEUCIEhW4ecrpRp0f8MNKne/OcIBjtQFNviZOFHYLBt7GcCUAiEAqTMvGZkqVz87t7RQvDUcK1zHUwEsrKBO/VoewomZztA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140817,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnZ1aCRA9TVsSAnZWagAAIFYP+wa6oH9ID33XToYPtttI\n4LQAdh9utLiZLgNesR+IEV32fYZLc92If5eCABVhbGRu23VpTlANGCnkJy6O\nWiMaZZCuinLkPIVuS/xZpF6z2D3ayAOW/vC0C9zIsFGTIo64M7qZxzoyriBA\nfTYRv5uYrCto6RqHWuCbaFe9nlwNIhntjRkkUOX+Z+2m1xfR0QEHUE/lm1Y+\nb9Kmx8j9nzAlK/Xxu91g0X8ZLQ3XMnfW6m6ajnZc4UF4vraTtisHYsY8esEp\nhPsFNVMZqYO6SkxyeCWqw5fnpb/3uUCoHGd9yXlHXCEA/Yu14k1pWCn3DyLx\noKaXEvgrcziNWkONYfwJGuxERZTywLYky/BH01PE4CPiPh4AFTtMdZJgRzyz\nTuAxsxCeQTM+9nb6+8GXBIA6Xd9iFxQZSKzsvwBsXo8kR4D/xOBNjatBT58u\nCTNLs1ym6nBVG4HaA4LOaa551oytBx2/0TTWe7PlrbK8NhWsMl+rse7SGi9Y\nqKtheY6EXDGmd6PfBtljD+sXxePEHbqB8JA3rhFiJBQx2w3E6iMnGESxCQDq\nZEkvomdSKuYme/qSmz92OhBvO5E4BQ+xf9gx4zc19aL+g8eVdnROwdhr7aKn\nvA2DkIeTMFi3UfDkDRP6KTalhF2GZKKWOpgGwhhhHxPUsr9IkbHsQ2ICBLL1\nWZH2\r\n=bkRI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"692879ffd683ceed56021e42293cf7ecc96e9018","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-24T01:59:58.934Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.138","@balena/jellyfish-environment":"^5.1.16","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.403-renovate-typescript-4-x-692879ffd683ceed56021e42293cf7ecc96e9018_1637719386752_0.11111738633157109","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.403-repo-sync-jellyfish-config-default-c04fa8f3a016d5a92d8d246653b2dac9f5f5368e":{"name":"@balena/jellyfish-metrics","version":"1.0.403-repo-sync-jellyfish-config-default-c04fa8f3a016d5a92d8d246653b2dac9f5f5368e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.403-repo-sync-jellyfish-config-default-c04fa8f3a016d5a92d8d246653b2dac9f5f5368e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6afc56446519ed5f63eac62b4b99749b756f6e24","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.403-repo-sync-jellyfish-config-default-c04fa8f3a016d5a92d8d246653b2dac9f5f5368e.tgz","fileCount":16,"integrity":"sha512-HTCc2Ut9PaPYbUTQix2Ls5x5a6kfdKLXONkdGzqnt/7uWcFIFKJht0OsIUvFfQUnaBbVKaStpJLSSfKqXJKTLw==","signatures":[{"sig":"MEUCIDGP06agGoEmF+k/l1Oz2rUphT6cSxvX4tdsU9JdSRXeAiEA9YkB3kVL4ENqqdN9imfKmvjifjx4K6P37qCCF7yUWvE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140832,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhna0pCRA9TVsSAnZWagAAgykP+wXpQUWQnOdrKgxPI0cn\ngx1fByzrMXQUYAl+a/F0w8Zp5lZWYfht6GG4rFWOWumt5YRteAvMYuEeO0Zg\n5RIoxPWSmUd6PoIzmYuAEvF/+p/FrtVaElR6T1sKzAKpQJeKgUfJzBwfKMB5\nFmpksTS0naYyDzy2Mtey3psufkQohi6ZlQTvDk1HX6wOE2Ayf8liO4TDOPlZ\nbouZA1cwk5FaO7SrVVJgu1E7pxdk+TvNbyiJBtcYa3UDsre+kSc4zCwcnva6\nqf9S/a7DWdO5f8a8pPDqdFEBRHq2bZxs8tI3uVcvt+FXh2s93Jz80aRicWb7\nUSQThhAFEXSE6JlcF9yKTF9l/UI7BmVkfdbwATNqLqkJZuo2A4eTyuc5MXwb\nz8PB+7T+RKbppDDCSUGDdeREp2Ae2LapdqKRUBQRytSKy9wcyrmeUKXPnHa/\nvluZkCJrnRFecEz+oPGkV/GUCe4Z4iP/l8C2swixYz5gYQ6kYwGZIp4rc7Jf\nwaUCbGwmrrSBkTqN4472c7kBx+GiIlY9usKPQnZa8daNmEQve6bXPqNW72OI\nZdLFd2WepxNYueARuNdvVgJ7TMBw9fj9sb3AouCXg4TbHHLfF/2CZWvvfyu6\nU92lWQ7zRjAor1ObJWGuESNqIVAOdAQs0Qq3EQrvdl8e6PB45sQQL5R7LIkW\nIYqH\r\n=XGpD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c04fa8f3a016d5a92d8d246653b2dac9f5f5368e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-24T03:07:15.273Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.138","@balena/jellyfish-environment":"^5.1.16","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.403-repo-sync-jellyfish-config-default-c04fa8f3a016d5a92d8d246653b2dac9f5f5368e_1637723433733_0.05002853432014631","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.403-renovate-internal-patch-42526c536a2228d25cb3e7d7e5d7e3992511e36b":{"name":"@balena/jellyfish-metrics","version":"1.0.403-renovate-internal-patch-42526c536a2228d25cb3e7d7e5d7e3992511e36b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.403-renovate-internal-patch-42526c536a2228d25cb3e7d7e5d7e3992511e36b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e5f1bc0386efd6c72ea77f7a4dbc19313e09c708","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.403-renovate-internal-patch-42526c536a2228d25cb3e7d7e5d7e3992511e36b.tgz","fileCount":16,"integrity":"sha512-XRBoDGXAnGM3CnqH+3DWabx8+F1AZSUzJ60fyY7isf30lk6NKjYhsu/b4QXWvIrUrcd9RQlExQl9ylID150Pjw==","signatures":[{"sig":"MEQCICmDDMhH1K4HET6n8JfuFkDsdGEQOS+/7S3CbTLxzqCGAiAqeIGKHEvHe85pFGgaBRpExH684Zfr+ATE76lcOOgZFQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140837,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhna7fCRA9TVsSAnZWagAAcXIQAIfSaXqEBY86WEw+utpo\nyT3M7fXM7ZQrucksyzLvm9CFVzerbDZ44k13pZoWgnLp4LzKoGamWzK7iUpi\nvQ0yuALAt8QPUTzk3VBm1/q/nQDeefJmmWT5AN7INrDiOCt/4o284LRBBr9u\nsJYgcMWaLGKVr6FWqU2JkApR50K5vL5PK34Evue/FyARw5fpEV1YtTqz5VY3\nkMvm4hP8slq8u6jeWdlsM7J9E044oKRnXrHVQTodmLAqVEHK87OdgEb5MMF3\nBEBVt/KDVTWOZhWljsdyyK455rYZBCzWm7LncV9yz20tUU0ZsXyzph9AqJ5g\nT0Dx2ursAC4mo5sK8uxvpKA92POfBzKnXY+3y3QW+5yli5XTdAUpBRL6fiv0\n41jrLX2sOvL19tmo9nSzx5dFk/uvDH46H3lKHJyK6sRQL/f8eivwCRz3ngbp\nNEWg2981vLXxnfYrlZ0jmxA+iXpeFiPtct1l7Px4l9hJxCutgWKBND+yrsim\nB6IPFt76llCrW2uXVUm+L4pslUYaJWdkTKU9XSo2RZCGYa+8QtsRsi1D4hcw\n7XVPnKeqqNu7y8v/v44n7I/PBrUFTEnG8iw+lItT498eAX09/53tve7Q7C+F\ng65AwDr8rrabwRtJwCu+oqiHBRxWMeg2X9orL3hIT5+ZeHChFf4vD2qVxGhm\nD75T\r\n=jALp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"42526c536a2228d25cb3e7d7e5d7e3992511e36b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-24T03:14:30.858Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.138","@balena/jellyfish-environment":"^5.1.17","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.403-renovate-internal-patch-42526c536a2228d25cb3e7d7e5d7e3992511e36b_1637723871668_0.8877806168120583","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.403":{"name":"@balena/jellyfish-metrics","version":"1.0.403","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.403","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d86424257cbe6ce55ea86246d4de66191a658a47","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.403.tgz","fileCount":16,"integrity":"sha512-nUQNrwsvXSdIXVZa70XcjmF6r9xEtmHQNaRZ9SyPx0m0rbbeFVxnr3fqBInKzDMrW9FjUd15nrSYrU4bH+29XQ==","signatures":[{"sig":"MEUCIQDAhR//aHvKKTRDlyXrlxBbXRa/F5zUW5/gnkdNR9SSXAIgApz/LvI2fxHHx1d503LHM9/iFUJZKrRk5e/fM04CQhE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140772,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhna+7CRA9TVsSAnZWagAAzKIP/0l2hi9IrT/kouL4613f\nR52KlyMb3RKy+QfDi/li5X3hiKSFIP0sxasjj+da7k0wzzVbDbmfSoCKST7z\ndH4XF554UTfpNhKCZnv5Rg9eBmLR3plsTxCez0R+VgNgD8Trpa0f0+pOECQm\nEHFe+uXGpp6SoAZ4PDgvWEkbHTS/vjc8ZSffVtzfI/MJgboqjL6BOLnsqr31\nXlhJyOC/df1JpTD7WSf6eTmXADl2FRnk5U4xYqw1JJoR/HiVkABsK/Z3SmbV\nOpHSMO3X3p7u4zq7ZKnMG066oZnpAtgJK1CJ3g1ZENYcyC+twv921tSZo+p+\nmayUynyAPOmSn12LCOZbCoXVDhQyKDeI4vDa9iN1qThBtNRCLjcDLB8r5w5Q\nOdSMa3IqSZRm4ZMJ6LEJpuK5LY8wgps8Dsvq1k5w9ujdCX3219jBdZWVpBy3\ns+nBMmKFbX5XsO0ULcv6E5nWn+QUvjJS4hSoHnsqefmX2nwSNvWDYBt4GDio\nfSfYpITayapHuEh0rUnyNPxv+s32tEg3+6NAA3vDg8i5EMTN30Ttsr/RVr0w\nGgQ/+ZzSiE5wbmYRD0pkSJe6B0RwmTcHNvTgwqD1FCXQc0w/VxEDx5DpIXgY\ncDrFL4aPFNzM6jjQ4LC9kJULtziSQ2gX3BzG54bpO7NtIx1fQ706YTNRpG/t\n3c8D\r\n=eIN5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0ff3cc81b575b1f90a9157d9071de6d1538c497b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-24T03:19:44.186Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.138","@balena/jellyfish-environment":"^5.1.17","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.403_1637724091306_0.7143051365332169","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.403-renovate-typescript-4-x-e768990388d7cd0c6631918e22937d924d54cad8":{"name":"@balena/jellyfish-metrics","version":"1.0.403-renovate-typescript-4-x-e768990388d7cd0c6631918e22937d924d54cad8","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.403-renovate-typescript-4-x-e768990388d7cd0c6631918e22937d924d54cad8","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3ebd7231cc7820bc4097f26bd8a0c7472999c71f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.403-renovate-typescript-4-x-e768990388d7cd0c6631918e22937d924d54cad8.tgz","fileCount":16,"integrity":"sha512-mB/Z0lxFmhZVREGy9t1DkaXCrHca2WeRWtw+dfoNjSFflytC3e7aeuVMcoohNQhD0lEy+bNnDjqEk2itW74t6Q==","signatures":[{"sig":"MEYCIQDtKBND/7KC+wqD42E/xawR7ftjUsV6iJPcQ8drQrCpBQIhALf9gVlG5aKEQuizG5HaCvVXXDZcjZ7i4+TeePPvX4eY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140900,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnbAlCRA9TVsSAnZWagAAhMgP/jU+id/uHsz9W35qtSwW\nYz3UCC7OODRfb2ixi7ckVtXDTFoha4UVZrrobVDGDMjz352m5cGaeZ4AhrH7\nen0rNtl5bGpy6z1Py9IlGmq0vXuNwf4ENat1Cx7IyvpdMtIq+egPZtVtig8V\n8eshZTS5ROveeXxubsbjrFKEd0UNcx1x0lGOv7eb3Jkw/+LO6NOFx5Xdy+A0\nD55H7RwVJhyphMFrmfMPZBDR98PogHViuhxMnER7nuzbPYQRDqh0rbxO93iv\nec9b4LmBE87PYAtT5Vs38OLwiQIJp0ZW+NwMEJUYetR43U5yTTiKrpkbsXiF\nb5JRZiAhZdDDWoc+d2TGAr7taYUDnXGPQxGUqozUpMikEl4gFjeeSOm+n7Yv\nueZOpKIzhXDIKgATaSokunRvw6k3UNPqE+KlU7+Io6om2Pbb+2SWInbp9Pne\ndrlDevc2EkEo9M4W8xIGoMwLtGdaM38ACwUNuH5cLUGooHSCc6IQnJ9StrcQ\nNVbGNCiaRXELtTpOMQwvrgroekLIGM9n4lD8V5hV/fiplFx9Uq1K/sTLn0wF\n0VtEjNHdQSJeloHC2JbqX0GikCs51gJ/odyuD8tAka+faH7jjhZ/0bwVywMn\n1rrTfz4Ytvi2Pci5pTPDeA/GX/AiMZLn9xD+sUCU0ys2Tg7HksfoSGvAbU0R\nzfna\r\n=fVds\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e768990388d7cd0c6631918e22937d924d54cad8","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-24T03:20:30.658Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.138","@balena/jellyfish-environment":"^5.1.17","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.403-renovate-typescript-4-x-e768990388d7cd0c6631918e22937d924d54cad8_1637724197296_0.5093013800513728","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.404-renovate-typescript-4-x-7737cb6f59f27f7c1bf75e7037e2dbe35126b18b":{"name":"@balena/jellyfish-metrics","version":"1.0.404-renovate-typescript-4-x-7737cb6f59f27f7c1bf75e7037e2dbe35126b18b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.404-renovate-typescript-4-x-7737cb6f59f27f7c1bf75e7037e2dbe35126b18b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1fd0472f5ceda615aa3bd1191e0168378b945829","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.404-renovate-typescript-4-x-7737cb6f59f27f7c1bf75e7037e2dbe35126b18b.tgz","fileCount":16,"integrity":"sha512-lacQCZVy8S1oggweMCO4hhcclXaZ7rf6yEWywqgKX8mfCUJtMMH8XtKQfzbLRKI/PB0b1jjC7kBq3bh5j3X30A==","signatures":[{"sig":"MEQCIEaFkQd7xFJQ9XWk6PD/UGi2otgWzyQHAyYcW8SM866xAiAk1TaugLhUhEwSPCkuf1ik34DJXrlSY+zDftBZawfgEg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140926,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnbDdCRA9TVsSAnZWagAANLIQAJH+ft57pxer5IofCJ/o\n2QxkhdRgotGaBHI83bBBMJYGVpy4pbDz5W6oLcg6R8+0Puka1dIZYNVnrVfG\nKjnWB9PqTCEuChACADRdZJC1bjRewZoNIHJWFRDn35XKTn5lmBCczP7Lccgk\nX/09/l4HGYKq0GHxDK91aeMpiuF82/5bWAPVdaxmIBTqB3HnxNvt+FjQG6m9\n6wqtqRHlb0KpuZ73Mhcqs9n29IwhFscOnpU5jGnYFaMlnQwA/0KNE+ZLI87u\nPU/TkpkQ21RhV8IzZNe4Q4n/3Lxi8uf+DShJCwm8Cyg7fr1Wi0PyOIlPv7V3\n053rmq5cfRw3z1yoCw/M/6yDUmyGhfxal+60oAB4P69Ljcpu/FlNhjGs03Tk\nR0DBN1uYuub6no6HxM+qAWPkNxdgu0DoqQ6ZbTTI5wMjq/d3k7pyIQMmQMMO\nF+SZkeO3FNDQyuetMEBs3sshBxBAPsV+Ux899x2JGAdWhpAemArTjb62DsxT\nX1yos6ZXU+O+Eafvy+W2JzdvItMMAMsSldBmZt/wdgcHjdUkQ31pM2QHnfWL\nUYmzU36BrfMdnn888bDhaUzY3BzsMVriV+Ix36+aCAJ6/TsF5x95IyNog8Is\nMmAS5HPWwumIM2Q6FSrWFuarDtpXuBgBfhD7roq/YHT/AS+gFZrMBFSRKNIg\nUHhN\r\n=fJfq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7737cb6f59f27f7c1bf75e7037e2dbe35126b18b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-24T03:23:12.142Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.138","@balena/jellyfish-environment":"^5.1.17","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.404-renovate-typescript-4-x-7737cb6f59f27f7c1bf75e7037e2dbe35126b18b_1637724381762_0.4993668347532869","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.404-renovate-internal-patch-97c0c1a76e5e19bcc1dd8d87d7fd8d75e0fc8d35":{"name":"@balena/jellyfish-metrics","version":"1.0.404-renovate-internal-patch-97c0c1a76e5e19bcc1dd8d87d7fd8d75e0fc8d35","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.404-renovate-internal-patch-97c0c1a76e5e19bcc1dd8d87d7fd8d75e0fc8d35","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e215a7bccbf48c8257348bdf2bf05c1d0930e383","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.404-renovate-internal-patch-97c0c1a76e5e19bcc1dd8d87d7fd8d75e0fc8d35.tgz","fileCount":16,"integrity":"sha512-RqBrwf83yoPLe5/m/1EqiJd6GTqJ9hSf4Wsu+1s7Q3R8oMyhJbfTbRqazkvRsraCUOksp930wbAvCI9oyi+zFA==","signatures":[{"sig":"MEUCIHtpOQ0r1wD9BS4Ad3r3nniOV06An0om2nMs5gTg3mKhAiEAxFMPsBIzQKRMUgr7siYQch52W1GngIUsIJK8Nuujvhw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140942,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhndI4CRA9TVsSAnZWagAAh3YP/iUlytU5AfNKm9ukj69v\nghPB4vAv9wavJ1FiXQ/SYXIATTBXheQaZ7sTT8Sboox0uPnuVsOVo34fdbnW\nbrBE6/9ALrt48W5DrvdkJ4W7e+KXUQ75nGPTAjJLcjDS2GJXJTkMe33lJVgT\nYPT3A6GtaKqF+gaayrW/cWMKcm/GHgX+vxMhksKG3DaGToXi78H6RY4Dn2bf\nI9jdu9ZEsC6H0DonU8rFqHzr19fTOYsWcmcfQ5VNufVZD2cFfO48IiCJpxsI\nQRf4Q2rRb/QBkWbZWKUo1dpz/R4HoLTr2lMRsuMl1iIdxzpW/IirjweqylOV\nnG6NDQieQC45/hUu0n7XmO7iEvzV+bIc0yAgZtBL6vyjI9qYUIExgb1VaIb5\nOgfQdjecWQVtPKe3rdj+svcOOZBYfmKRpyEFqGAgoNl7sP2uL/98865gisGF\nAJe5cAxJH8lOFB42RSDzx6xm22kRQgfE7cBCFtZ0iNd1Ms67TJZG2+9yV1Pj\nByBvoZ4q1B3Te10TjE/HWlkdGmS6dswaZ38634h89V34o6elECHVjgfxCDTq\nto8t0mUvslg/CNrH7eXz6WRqvwQmT4OI0roFrPo0ck4cOcGGz/VF2ILTXsWv\nOrgFwYV6z31+hL8k4+hwo2una4DkXfEqtckELYloy7c/6U/qDnS1kJOJYgp+\nHCZv\r\n=nFp6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"97c0c1a76e5e19bcc1dd8d87d7fd8d75e0fc8d35","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-24T05:45:45.497Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.139","@balena/jellyfish-environment":"^5.1.17","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.404-renovate-internal-patch-97c0c1a76e5e19bcc1dd8d87d7fd8d75e0fc8d35_1637732920786_0.5639582216422891","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.404":{"name":"@balena/jellyfish-metrics","version":"1.0.404","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.404","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"66f1f196851166304786fd9ac004a6672750e228","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.404.tgz","fileCount":16,"integrity":"sha512-ClZa/9r8ot89X8weTKZrtRAYnWYPKD4VZjFHRjzO5rrge/SDorMxY5rZCVRoJXakW8HlhKhxqHql8pjJAQ61rw==","signatures":[{"sig":"MEUCIQCo/WHoMvBFtkgW51SCIIlusH1HAdrBLxvX34jqD7SRNQIgHjmWaifFEd79osd56oPC0wsD2Xphp2+g2ugmLSIiopc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140877,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhndLdCRA9TVsSAnZWagAALnYP/3CGJ6Ydxe2cIxvOKRGz\neO+pGVtvNGOA8bjb3N/B9+VWuORDFeKqgMbQr7pYjHuekcWiGU7nlC+ERrV0\n0Ilr2F0N+hHZx6fTrp96fM4yZP9N1ZP4A9iyqtb4xBdnCcmoIIUDhT7yCISe\nYXpAZubRXzmir2lNVwdnh1jQcUk6SbkPUVMA7eB3MD7wLKBXnAyTNS1nW6nT\n9XytkoG30MJCbs8weKwdnsgiUxdEqmq7odZuokVBN2BfszZWzPBFJukLRisb\nTvoOAXMgO8O1NcXDd5A7kLOHsJ7eetNQZx7Zfs2b+XRPIvhZSsne0Z1O+KrW\ny3nz2O12v3+KuNAtXXo6UHYyad/Gz2olMoqVIzC2nG2ljDlw2OYHtXIq+uTA\noVohrq35Kv2IyDr2phn/+c2BLikguyCMen91MGgR+3kysNJW4/auq3g9FIG1\nGIbWWcrKDqlnki+KHtd1JqwwRfGvatu3RfB3mFCH08Cv39DVE6ENdlFiAHP2\nqndPkJ1LmgNZ85Jk3eFoycpemwfsXHA9fCG9UcJAZ8hYTWz0gR9xUjOILErz\nPgFiboTTmHT2rMCFyYbRInLFPdbCxPMd3eRPI4VRSPgqefqRHoIJ73JvqliH\n+Zy856GZ4jNd/pgd3MwsiYDZn4EB0w0SIIFLySa5XuG3oxFLI17URb1uo6HI\nVZ9g\r\n=RN6d\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"99c1f981c54468345e904ee029a9df390228a560","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-24T05:49:35.752Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.139","@balena/jellyfish-environment":"^5.1.17","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.404_1637733085472_0.9117261369906913","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.405-renovate-typescript-4-x-0e8a1c3c0ceb04b3922cc2cfbf408479f1b9254c":{"name":"@balena/jellyfish-metrics","version":"1.0.405-renovate-typescript-4-x-0e8a1c3c0ceb04b3922cc2cfbf408479f1b9254c","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.405-renovate-typescript-4-x-0e8a1c3c0ceb04b3922cc2cfbf408479f1b9254c","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b754a0e1bf5823c89c8b694472a245d8b239c50b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.405-renovate-typescript-4-x-0e8a1c3c0ceb04b3922cc2cfbf408479f1b9254c.tgz","fileCount":16,"integrity":"sha512-syWyNG8ul5ZR21u6YQ4oyZKw4lN1xYqDRM4LUQp+qdQjhd4LJjKn9KotKoKi1az3J9EcAzMhpcSQEHFMOtHILw==","signatures":[{"sig":"MEUCIQDuSE2zJ+nFCVfRZA/ES0bu5NDfLvXuEL61XXg22DBOoAIgU9bWxHHqpgHvfOIQVyLWy8Amu2l/vH0OE3DGQ7GKHCk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":141031,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhndPXCRA9TVsSAnZWagAAI4IQAJnk8pqwjzwy44HCOg0H\n2WbjezI/h89xU36LmFiOKJoBmBeqL41ayGXdSF8aK4maZabk+yDkdgy5YfKt\nT52L3pA7ChQzHdPQdJlQFVnbVofDwLFEhEfCoT294RSq7TKAY6FlkrgItMH2\niDDsW2lwI7zBXOkWjH3hvRcnXpU5lhIouG9uptY6MyRPQMspdS8hReXC8TBu\nWp5hqFxh9ba1PgfUqEDCB9n/ytC7HpiQNMPBOPU41aSjYDGXbgReS4vLT2nd\nugQPGp/QviMpu3APy48d9zc4Dm+DjC5dDN3D/M0VCTUHcc1ahia5KmXdyStA\nRRiDAEiYdDoya6NkOKoq3xndHZ/cTZqI/XTksyPDblnqRiR66PqAKN7KStP7\nF1K8n1s52nfSJHAN18xibOUOufyF9pXvEce6mL8hYOXc6Srgc5Fb6yW9pgBB\nLMUgKrfSWP6qc/eH47zB6p+QO5117BiICnvA7+Ovq5mJ0K/Mw9aA3ZQLuF1j\n2g2/HprzEiKONWzKvoTJ8ElCLm3dASFhs2NBLR+rmMHBBs1Rs+Ox/otZ916j\nG8XDFM02xa4qxowJIrkw8H9H9vjXqQMif3cUizW3lp717WG7F2QC7IuEtzH8\nDOnBn7+yVaVx5/yd5NOp1O0Er1sgq9qLbrc8KFUYlaNMs6cqFFRz921KD3gn\nC5Tx\r\n=QnCA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0e8a1c3c0ceb04b3922cc2cfbf408479f1b9254c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-24T05:53:16.524Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.139","@balena/jellyfish-environment":"^5.1.17","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.405-renovate-typescript-4-x-0e8a1c3c0ceb04b3922cc2cfbf408479f1b9254c_1637733335042_0.4443703639807546","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.405-repo-sync-jellyfish-config-default-2bc54dbc156e03d3c34df40d5c4777d44b39ffe9":{"name":"@balena/jellyfish-metrics","version":"1.0.405-repo-sync-jellyfish-config-default-2bc54dbc156e03d3c34df40d5c4777d44b39ffe9","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.405-repo-sync-jellyfish-config-default-2bc54dbc156e03d3c34df40d5c4777d44b39ffe9","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"065fa873be0f1fd32cac6ec341f38ffe35d1f82d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.405-repo-sync-jellyfish-config-default-2bc54dbc156e03d3c34df40d5c4777d44b39ffe9.tgz","fileCount":16,"integrity":"sha512-I05kGxD0EnfeVYTFKYl8Z69FE3O2EvLrFl9arBcz1/HNv7mSnU5IGYQTpRNY6q7c+VfR0wcjqcck96V5e+p3wA==","signatures":[{"sig":"MEYCIQD5hG01zpwntaxp2A1i7u2bLWv2mCsXpqNkAe4HqYJO/QIhAOtYCSDeOn0ALSkklLKYZ/x0WZfy/S9pHwpnVNJVfcsy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":141046,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnd//CRA9TVsSAnZWagAAp10QAI7lVzm5eT1k+DKV61/v\nrsaRS5X3/Kd0r10qMb/kpgRLnIaR/E4iy1/6YQt6rr7bO1I6zlow+kRZwb5L\nxELPu6Lq3H3WSLb+g/DOvaN+7UtV2Qtk90k38Zvs0Ebueq1pVfsDJ5+7jSTV\nW52hB4rBGUaJuIy3qEmDBRPOZfCaOvFYeVA0Evow9fJNRUCOSRlKX1AdJzlC\ntvG0BhJtisPJsjzoqHC2wc4M8Pi4bG63k2S0EHPgBrSVkPeR/FNUy0mw/+cY\nCihy9idW/U/0mn6BCsBrbX+8nkcRKX9CSajR9g0IxfHJKWm4JOUJhQ8OEsVZ\nW1Df1zAfH1D4T6+1TuNqAjRg5LE3PZm79tbBRlp9IlNss6tTrJmLT7XIVhrR\n+fNNpL+AvWn82fZt+yD+Mb5V70OxUpf4Z+B/sM0DVYOKse0oOsDGXTn8GCWK\njpzbTFpHfq2of8+hbWHEN1XvIhmLHwsl0VuncpMxXoY5hJLYMOdG9Kbws609\nyAxP4mkTwhj6mHRVdW8P56uY8utWZzmI5IIDjuFVhRGWg721BK4jWIOGK2AX\nZ4v77O3nErz4cP+7zcfk8sSWdatTqbsxCIgB6IRN01Cwu9cpqgzOvVPEgB8H\nhcOE14FfdPB8GDrA2trLYRY3Y5E5ZirP4OQpuIYhhF/IlBTNfypKK+B2xQUk\nSRV2\r\n=BO9Y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2bc54dbc156e03d3c34df40d5c4777d44b39ffe9","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-24T06:43:47.818Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.139","@balena/jellyfish-environment":"^5.1.17","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.405-repo-sync-jellyfish-config-default-2bc54dbc156e03d3c34df40d5c4777d44b39ffe9_1637736446973_0.7745372811786666","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.405":{"name":"@balena/jellyfish-metrics","version":"1.0.405","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.405","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e5cc5120e9d116c740f556e5f0e4f85b514aabe6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.405.tgz","fileCount":16,"integrity":"sha512-UzvVIKwgsW+74VRhvTsvCMgD+2UE4RS2z5iQAbgSaG5Z5FaJa92u5A25ZReupnmYSR5WwMGKgWQaV1HTX8EEvw==","signatures":[{"sig":"MEUCIHs0YpmZAkSf2AfqUN34Y1Ro2Ob5rvqcf8p9DdYvtEwyAiEAgqCg8ajOE34NLog1RW2zuptbaHsyAXs/oPX3BcZzQfI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140970,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhneDwCRA9TVsSAnZWagAA3i8P/iH7StzAkRZzdDmmVKHI\ngwRXkcZASyJlO4AzjZf72Blm+9ha6q1fYhIteb8CpKKfP7spsc02syePGOr7\nZoQp/3/TbSXHx7icsTqdo2GZvKKE19/JXyo9W6EpOLA7YPxgqWlrfSLrT6Zi\nePAqOy9W4rvclysIYSF9K3PXzFoOyA6jInWmVUVrWe0E6Kw97dYHdzDfs+lu\naOGN18o1bTUar/z1hzOsr8yjCKw988rHJyoM/YmuvxcjBO34WViOp50FiA64\nvxAvznE4UawB/gmnXbKRQ26p8FSlZzNnnVRzbiC5TlR24+MaweHX5ykS9/Rf\nL50D+MAeA6UnRMmmUyt2XTMzNNQcKK+NQjcirIGPEPzdwCaqitw4HseBGzf6\nLa8WcyngxQulo0A8wxJQNwREgZqC36QcBHQNmbiun6PDAoK514eF9SW2zMOR\n9mVenQtducYH0bnrutxbBeJCyjq+k2XSu72a5WijKuQbxtV9fAKrkR47/5ne\nWvqzuRmE3moVTXt/GY2vxwp1bZgNbUg4cl9iYkbnrkxkMUjdht4RIrWjK6uP\njUEUUprqMqcfeFuui+mQHrk/92J/mMLqbHFBzNX0EORY0ktH680AsdofdOhz\nJ+6i6wMv5ogyuIO03nakOUzR+yAg+K5/1+yDMmbbzNqZXtIVbQQebQaAZ1iX\nrMiU\r\n=qqy6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9b187616a3ea909db3cfb34fc3c2ffc7d7ee9e9a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-24T06:49:05.375Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.139","@balena/jellyfish-environment":"^5.1.17","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.405_1637736688529_0.5188524308738736","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.406-renovate-internal-patch-ba8dcce44db77926b853a50f3a67aa86edadaca1":{"name":"@balena/jellyfish-metrics","version":"1.0.406-renovate-internal-patch-ba8dcce44db77926b853a50f3a67aa86edadaca1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.406-renovate-internal-patch-ba8dcce44db77926b853a50f3a67aa86edadaca1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8f5be941025fab543274964bd51a835857251e53","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.406-renovate-internal-patch-ba8dcce44db77926b853a50f3a67aa86edadaca1.tgz","fileCount":16,"integrity":"sha512-O2YksNNCHk2u9Js8IJmwNE6YtotDU9uWVjixVDzG2Fj3bSsFpeKU+llyMEMfdOk/IVPDn8tkVDGHLBvbJgaEZg==","signatures":[{"sig":"MEUCIQCVCAHQDk8c1uqxDbHgSfff5NaYMz0IxR87gLYFfW0k1AIgSkx3VjM+92xKSnIYGnVWzyeyymG8/j3GJfeE0Q/N1L8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":141107,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhneIsCRA9TVsSAnZWagAAWAIQAIi//dw0GCsjnqH31SnA\nA5Sm1FxL5oU62i6W9FPVZHNfHSdJVqlHU7fSVvu6PB7XMbFqzER45iR7liv8\nL9nSf8NnrKopHvibikUzUXQhe2CysfTQXc9zSdz37muk5tbUO2i4Upa1YSZi\nt51+0SUpzVF3s0bojo6gptg4FYv83bN2oaSRcQlBx4LzbbK7BDFWZCJOR6yF\n7v8yV3GgqS+eh2b0IOgrU/FVNK0zz6fnfIbJ8PjWrApfRDrxxmzKbjoFupY8\nByOYFlh1kXdXdTmMiP2Mxg+ZXp1OqonV1gAX9+mjOGWo0wxzHGj48MrAnKga\nFnG9Nuhadz2AP64Ezrh5fMOgSy7M7om9HcdAtJZ7ZV8xOv0gvm/RyjJZ5Fve\nKeHXUYBySy65D4mCBntLzrXJBn0t7AVTjY1JQeOEoGgdXayh7LG2ow3sKmtI\nLedome+NrgKTxC570+g91qIHp8lytrSNbJST2tPsJ1tBPl3pQGRwyrue9pgd\nLQaDVaXmcFR1FgrUkp0MyaLxKOyCCgeeq+kEpd+C8m9LQXfhcUK0N8KoYb+f\nvluTZcBvhSOs3Zy0QcbYwMrF4lsWJo5gPkMg332nyw+vY+11FgBdT+5nG/MX\nVchJ/QWPIdtL7EjDxFKywXg1ivnO9mzY9qqXhgFSLjCKvMNNr77gtPXqcs6Q\n1AJJ\r\n=9gkX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ba8dcce44db77926b853a50f3a67aa86edadaca1","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-24T06:53:27.688Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.141","@balena/jellyfish-environment":"^5.1.18","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.406-renovate-internal-patch-ba8dcce44db77926b853a50f3a67aa86edadaca1_1637737004753_0.20618390944966758","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.406-renovate-typescript-4-x-00dee225963c4e94da9165feb88293e11cd9ad19":{"name":"@balena/jellyfish-metrics","version":"1.0.406-renovate-typescript-4-x-00dee225963c4e94da9165feb88293e11cd9ad19","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.406-renovate-typescript-4-x-00dee225963c4e94da9165feb88293e11cd9ad19","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"73c91ffccf7affa4715fb91e5059fc78eea22253","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.406-renovate-typescript-4-x-00dee225963c4e94da9165feb88293e11cd9ad19.tgz","fileCount":16,"integrity":"sha512-1RIEBRNB1g30W8oEbuitGR4D0BNNdGPql4fCpwstJWD1S2Ln6wZabY5p9pyMtPRGWpIGeB2MH0euUpZUnBd0vA==","signatures":[{"sig":"MEYCIQCkQZCHFgU4c9gTrIowHmhP8YzPSO+8U7HV0Fq8Eg+AjQIhAPNDVJ42ON64AUtXmUQlKRzcuEYc61FhWPIJCJ25PbEz","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":141124,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhneJFCRA9TVsSAnZWagAAQ58P/ROmK9IaL3aqwEQBDWN/\nxTp0NDOwpw4IJhzrHUBz67GJMGMRNH3XDvm2JtKpyBgVyH/tLAZqBUansJor\nxxoGkFcVb0OhjcrTiyhQIRjdwNfdt8WQ0mFSGOzRM6DGIUdcVO2r/QbAeCxB\nNsesKWlU7Ud1KwCFAt/SKN4pKdq7Nk3z37OFaPnbsRjQijRDDqA62Y4nS0XF\n+rwjLFKg7/L3wo7bdVYWU8Dr4ZLof0NdHXPSQClnSKzGufAVlQngawg/M2wu\nJ7NWWsEWW4Y+/xxf7+uwq6m8hb0cIceZ0KZ4Xlz180yE5tTlaLEFs7eQh472\ntDWfjvXZ0evx8XZ+dbLAwbV/n1JkIasFDx4kGe6wv+SzEb0TuldJsVH3RXZn\nI4Bfpvij1i42IlPvJz/8VEM/KiRz8VA3jcI1wsvyLs/zaeHw1uZ1vlD4wqKB\nLl9fm4bBv6uyolXZnL15MUrpnVEVlFGwB+6XWNi9Ek+GMttzBU8+HRvH7xQb\nPaot4W2rUeRbcPqn6jWDbUa9m2MDMe8sisYuf87FLaw7ovV5qGDtfA/KTbVn\nrKT0hXlfpPMzIb18yr8zV+C5J/BaSCx05PxrlKgWrbrPSaSx8CzjH1IiMiid\nXTbR6KAaNMdZHQA27gK02taFmNFm9Ai67E9VW+HT7S6oXBHxPV6SXypAbaSC\n6HNG\r\n=F9B5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"00dee225963c4e94da9165feb88293e11cd9ad19","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-24T06:54:12.097Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.139","@balena/jellyfish-environment":"^5.1.17","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.406-renovate-typescript-4-x-00dee225963c4e94da9165feb88293e11cd9ad19_1637737028950_0.66277103027891","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.406":{"name":"@balena/jellyfish-metrics","version":"1.0.406","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.406","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f75d06da2396f0ff3098f90749de116d6ebdf16f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.406.tgz","fileCount":16,"integrity":"sha512-BKD+Sz/PVfhU1/WEt1nv183iVF/bU/CNg5wtJjVdN8WL8LINWv8PZZcUoDCjby7mM8iyujXVKM7MeY7RhIbH4Q==","signatures":[{"sig":"MEUCIDwK/YUYuR4c+mTSxggEMRMmWZhDpmRUbSBDbaZixk2pAiEAjbZdiMs1dvawq5/+dYVZquppee0khu1uDBPIISxFDHc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":141042,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhneMXCRA9TVsSAnZWagAAFL0QAJ6uGHRStuDFfBOSuzRs\nTTloWTpxSF3s2GbUVaIX31YAFcI59WCOHBjqaJifpTMIzmHGj7IxI0Eus6ld\n5EtXjYLHyVUA+wQai/aBcJJL9jWW+dd5USVIfeyUgqvne7S+UAdykIwGkAXR\nzgAOqf8wHBz8/OR+hWqEmD/0ZioKm2JaD9hfAsMUoQQsxHGWPLstkxiLea+J\no/Sd/aNzwSl5H+DTHPUjavnSqK/03Qz72rI6XGO4IYNkFrjED2bAsvg6Xc32\nXF2cGlAPaZkheBGibMRpHEQptzKJpoGg9e6DLqHhMClgx5M1gjWqwBPWEY8w\nAq1++sc6kaUInrLFJ+0oZEFfjo4VFS3S/sytoL6Y5KnURO9FRlv3YyGCZ2c+\naxBLnH9RXfH0Ei0VnPTCoFxKOQ3E01Mwib/XOJGe+mqlbjDBnkELF4v6uzkt\nayTCYZCibTLJwU6MUE7folXyJixQB+aZxBI3PjdzP+U+Nlild7n1i2OWQQpE\n8IRyOIOI3VEJaqfUhzkytPbcr46nTeM2NjU+xCy73rJIwQsLEeHTPTAOjhEG\n+6Qh5t8B32R+HoCKikq7jC8Odqh61R6CDSbdOBKveLMi4NMRWpgZlB5ERLT/\n6AB+ixyBevE6gkjCHhOI8kqk+URxNtKm2e842N37d+VlNUk7+dKtyawlPEsq\n8nT6\r\n=wEd6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"16a4a6db86ad7e27f5ad3a6fc8cbc692694d98de","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-24T06:58:39.676Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.141","@balena/jellyfish-environment":"^5.1.18","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.406_1637737239608_0.7550645635258857","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.406-renovate-typescript-4-x-9f7d750fa92e8a231e2483deb29ddb71b69cc350":{"name":"@balena/jellyfish-metrics","version":"1.0.406-renovate-typescript-4-x-9f7d750fa92e8a231e2483deb29ddb71b69cc350","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.406-renovate-typescript-4-x-9f7d750fa92e8a231e2483deb29ddb71b69cc350","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"dfcbb34361fd2effb3a7daf07057c47b3238385d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.406-renovate-typescript-4-x-9f7d750fa92e8a231e2483deb29ddb71b69cc350.tgz","fileCount":16,"integrity":"sha512-U54QZRadtbrZrLlqkGtCqPNd6VZwTuFUOZtYXQN7/uj0RlPpQsHpYvVGXj5yn6r9vA7uLukoGLO07+FHBQlyKw==","signatures":[{"sig":"MEUCIQC3OgeyAnjRMNyho5fCIjv9ErSLowj7M58bPKtVQZ4qTQIgeuBGa815q5teztKHKfWacuHQtkWrJdedqmb8moABtkY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":141170,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhneOXCRA9TVsSAnZWagAAr5sP/3sS1t8rWsg0hGaszWeR\nsonCzANvSlfXdkmJ0OGIjFFGpS3pY+tErzl17ITDxaEwJIpr3rjO1yM1LEFW\nlTd1ZcHJGR4sSmaEdJ/ejI9a5WJR+01OsrEYN0byjjQ7c2nKzBFqK9AumL3r\ntt2+02SusmERAPVEurqFGRXRcEj7ledN0f42bmsBDLo7nl/rdoP2JsdPEQ8R\n+CmmUZoXhcf0B741KUWl+QqXZKsK1wcotrcn8NCuHAKtfd2wPThH3+SdzGz6\ndv0hhr+5dU3v8Auoh2hvW6cEbUGuG5eDImnM0aacoMSqHBMgPwnUgUlQj+vD\n1QFenyrZMTCdpsSm1zYYi7F3Qn4PRz6s3iSXulr4cOG/5sqpjhk18mVYtW+7\nzYMP8/j8N6ZnXDhY8jnEM1bCYYHZ1MMXg1pDIhLcULkdhDRFPCh5DnG+o25p\nUuuQSdJRFSMiS+dZcdgubsOy/nFG0LIU74stJmjbJ74bWLljvDM1luLfUWGk\nkIQeRU3MFdOMswSdveelgwr7PN0sgUkciYWCAALQTPevWHPpviD1I7kY3EYF\nQZYXhewkau4SqIij88SYLXc0ipBogLiHDi8JGzWTJQGtaCp+BqWiKyXx/i7t\nspSIff5EERDHBFobVo6YldnlBgudNn+YWz3UnI3yJ3WYNMSKTsW9oaBgeKEl\n7YlG\r\n=P5q9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9f7d750fa92e8a231e2483deb29ddb71b69cc350","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-24T06:59:52.421Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.141","@balena/jellyfish-environment":"^5.1.18","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.406-renovate-typescript-4-x-9f7d750fa92e8a231e2483deb29ddb71b69cc350_1637737367597_0.7700103183234996","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.407-renovate-typescript-4-x-096fb533ab3b64e96bae04bb98726a9d20378716":{"name":"@balena/jellyfish-metrics","version":"1.0.407-renovate-typescript-4-x-096fb533ab3b64e96bae04bb98726a9d20378716","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.407-renovate-typescript-4-x-096fb533ab3b64e96bae04bb98726a9d20378716","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"99fe45d2da85038fe4a11b423b891d6cfb87ce65","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.407-renovate-typescript-4-x-096fb533ab3b64e96bae04bb98726a9d20378716.tgz","fileCount":16,"integrity":"sha512-wEonSDFLmfPWS3d09/UqGakbORX1dmcvI0YwQ8DWN8vDhuYYC9mvA4gVZNJvSjKPuz8/7zY/l+DNWvhrw/ubTQ==","signatures":[{"sig":"MEQCIB5SIWpO2uoQVJi6jmdNCcVtOcXiB3KLEoE9Kj3ywwKMAiB1e37QcU6J0ZNGomuTItTrY2mP5KqJ54Di8wterTj3eg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":141196,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhneQGCRA9TVsSAnZWagAAToMQAKGOVcbgM7oUjjzpja7y\nAXImjxLJpw7BCUnKk7iJSP8i/3rpYsKREhKVwOxrbc3L0vhDomezo65HypiC\naigxCLzc8GNLActRCEiOuQ74Eey52IM8pYDsmqnM76ctQ8XewnJb4my4jyWP\nS/QzCIzJTl1vYC7B+blL+Byxsl3I7sO0ZM5M3be+K4TAkqw10TUVcMl3h2P9\n1vjqwujaqEP5tl7Cf3KEBNtXXxJ8eRXHcNupppQbtcRmmMUCTBjwXfUpapED\noWlNi+zMfp4FZD9Q1XvmAeftFKdH3MqZZiyPuvZLbngJaKHtqXpeUsDfUEWV\nRK6OWJjzzVCDQHyGVU6wMJAXTxguKKBjHR6UKTfsZ7lypcHGhTpJwwQeMik/\nc+ybyQDeRBpKnotKI1KqGaga+fZvqivqQ3Pv6p1vpNZtMx5FB8kKe6z97rRy\nmvfwBLXIKAPSLt2KOFS9BeRUkghSLtGDbfJjzPVyRMILuooVXn9F1T9ztHVQ\nnz/28O4V55g21o4vA0f6rVPLz5XwZ60na9ebGSlQf+8KRiErjqha3HHKj01f\niJRPZE6YY1Bp2IFYg1HVdvCHfdBGSqcPa4OCMb1R21WZqbwNjP79cwbsq3KE\ngpXP+kQSeXwB7Hc2/Ce2Xc84HFlNUuVmrVp8iPv7GN8+QAWTZtqFkLBfCg0i\nOssp\r\n=m2El\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"096fb533ab3b64e96bae04bb98726a9d20378716","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-24T07:02:31.832Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.141","@balena/jellyfish-environment":"^5.1.18","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.407-renovate-typescript-4-x-096fb533ab3b64e96bae04bb98726a9d20378716_1637737478838_0.152661404379568","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.407-renovate-internal-patch-18f26e249aba91f4f165f4cee4548395ad1bff12":{"name":"@balena/jellyfish-metrics","version":"1.0.407-renovate-internal-patch-18f26e249aba91f4f165f4cee4548395ad1bff12","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.407-renovate-internal-patch-18f26e249aba91f4f165f4cee4548395ad1bff12","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ce2d1c1148bb696775128946a97b05af144e2d3f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.407-renovate-internal-patch-18f26e249aba91f4f165f4cee4548395ad1bff12.tgz","fileCount":16,"integrity":"sha512-2DOtttNPo446/bLvzzYHBtO3mWgG08TrwoY/9A35eGhpsWGsDjWIGVTYiMkE4Bd/H9QLbj5KVqZ+YG4qbDPNUg==","signatures":[{"sig":"MEYCIQC3G5Hv9ZgScEbPY+76hOYMRe/Eb02dWeCrfd6j5tTibQIhAJgZS6Cc3Tj0mApcYt3QtOX+tu4bkaX2H3k/NuUkwuwa","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":141216,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhngVhCRA9TVsSAnZWagAA41EP/it1aNP0yPIwD4vKxPnF\nsWGtd7394l1YFwwn/Qrki8BLSuiEYu2u6UMg/B0rCLLQtc/1BYoZ5vvRO+Bt\nXbwxyyxgfuT3doFaQ/3UvKYrnuqWEmuwkO0XSCdUHNrMl9jWdLDHVX8UhFd8\nq5Y6YPOI/rkiF04m2wwVcxIe+s4PVHyv33w3CmGPlGMgX7wbS+P/epQFXSh3\n0q1JX4F2IJeXfYwlZXvHSTdgFnUQxE998ZBIFp8cmv9IAOK1QVvhwuo/vPSo\nAmG8zb7aptBlM/44b2WLI3y+vpxSBPMoAYjEb+rv4RyQJtdezvyHHyo3pBft\nYTCeaEYTPdGnTrf2jfGvFlMONhiIDAqJLRIfEJg3uBKgplpWfl8QuY4i7lWW\nhK6UT/9HPpbysqYY64SBGNpsEnrau7iB1vpC8BVPoA/M2xFNQrlSgDnq8gfw\nIQC5CopNcIn/X+Lh+iPU1nRoFLa7p/gTJZdbLTu3Uk5QUYvUeiOlejO1vMo3\nhZFlKTdhFpjhsATi6PeyfTuV3PqRz4ssswiKNEslXesG4eD+vOIABL9J7S3T\n2bo/VKcM2pnfT9JZyVSKjHvpxIenLU48xtQ2Zj/2QRXujjAbShrs1Hwx7S0j\nMREqUKGKESM172b5kqbW8rNSShMFaYS14mSQk2VWs0Lts7GopGo0uyHujqDa\nc2D4\r\n=0Rlb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"18f26e249aba91f4f165f4cee4548395ad1bff12","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-24T09:22:56.060Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.141","@balena/jellyfish-environment":"^5.1.19","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.407-renovate-internal-patch-18f26e249aba91f4f165f4cee4548395ad1bff12_1637746017281_0.5232870361222999","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.407":{"name":"@balena/jellyfish-metrics","version":"1.0.407","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.407","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b53245c2ce604579563b654ed256778ceed70e47","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.407.tgz","fileCount":16,"integrity":"sha512-A5EVBl7hnyKSBPES63uCLH95bruTUVmSRPftlQQHjYCSlxuCPkwVjrAr0Q4H/7Bka18gFA5bOxqlz9At4eGY/w==","signatures":[{"sig":"MEQCHw3aaCdJxbtc5h8DM4RKAHTO09du98ipUWESnmZT1Q8CIQD9fuai032evcRWyVKeT5gUVyttBcEKGj4DK2+kEl3+wQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":141151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhngZsCRA9TVsSAnZWagAAU68QAKGeupYNC7fqAZuoNkpA\nKMqgmCb3zeHUn0PA6boWwpSAbA+2WsV6LuTg6cw+G/ByhewgaxvMy0lNv4lo\nADMSpyffi/RdrMF7GvHV1XhEepqYLWCuMVsyPXpHYRmacEfki4t5oI61wrm0\nYh8HZg1UtrPTZVqVdkMmEz1oKe7rOH6+qy/QB12Bwr0vgwcaWqg7/avw339X\n/DH2ENr8ByAhRLQfueub+eSwNz5XA6X6dkF8uumDdlB8VJRQbZ1dBmYvH4My\n6IMfn7D1Rqk7FOy5EwML55W7mP61KEc7C0/YR2WGAmq8dCd09QXUMY8bPHTG\n0YEKmJf9JGW1H/odmr8kGw02AcaX7HBcK7XYe9yHtzpPK1t6SB9F+3iWHdVx\n0Nt2577+726T9kqRSEWO74Q0UZY/tRVALosvW+b0tOrLlFJitJ+kO18qYIjk\n8Qzrw2lLSHDulG2ddtUBT+oSk+pVvLEJ7ocyciw55NPs6eHR/jgbj5W/+WsF\nzrAjbFaXddcrmxTaBbauYrb5N/rrUeLyXj1/M2apDtGKoOd8Enb8dVAm3wGH\nKIjcIIH8XIyKGbnqAWVwrOZ4qrL6EM/p79EvwScO0Zky/FzI+mdbQ8EmWbcf\nSEUGmjqZe4i0EC6UnL8lqFm4YEsq3aLILa9eIoNWxAfm8F5yGY3aX3qSFfVV\nrfMC\r\n=ctv/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e3f68d0537a90fc0cea9d4bdad30a196562cfb2b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-24T09:28:54.103Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.141","@balena/jellyfish-environment":"^5.1.19","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.407_1637746284617_0.5758770877356574","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.408-renovate-typescript-4-x-0865ae754e69dd202118d895461ca5d4a737398e":{"name":"@balena/jellyfish-metrics","version":"1.0.408-renovate-typescript-4-x-0865ae754e69dd202118d895461ca5d4a737398e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.408-renovate-typescript-4-x-0865ae754e69dd202118d895461ca5d4a737398e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"37d66beae4a9d4b010c7a3c93d6f526cddbd6103","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.408-renovate-typescript-4-x-0865ae754e69dd202118d895461ca5d4a737398e.tgz","fileCount":16,"integrity":"sha512-bSUlj7lxkBdXXBk3jOjgH6kPrfFtxGY8ogb3Iv0ygcmMWJsNihSP32IQYXooLON15sODhpV/TnWKif3kOoy0xQ==","signatures":[{"sig":"MEYCIQCYUzq6+5+Nvs56Fev72B7OEhnH7A5DQBeLRhR8ayJVSQIhAO7Lh9Pj0/RGPQgMTmgRJk2VQqhC4Wc1L1J6lsGicISe","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":141305,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhngdPCRA9TVsSAnZWagAA3IcP+gNli1KVXyOU3x+o42nO\nzPqTslex8rNRGNUqDaSnljeZweCLpb8ObIvdkgoWHroACQzf7x03qgOHSZEO\n99iky59JRtk9dGQpmut0e8E8Rh31+T2NHydTSCtc4sh1vB2iRC+0LRw7iqad\nrWByx4NhbC22geja9Go0P0RDCoLZSM1sju7FTuz0vNLA1cJMbxMMq5SmxAlm\nGrqLR7AeGK38sdVaWm1pYclVaZFEWEaR3V5nBbUjcNn7FGUloJOwZwRSmMG6\nUvNgydilnt4Oj5CaJxxxc/WHnOcj8/uUdAAl3KC/2PMfys71IsfVpLr9WVFp\nNjwoEl/rJEEDsbqTMgeFhf5Ex+nLAIKGxxyDtRudA17MDBHTxpQYL3x49KAE\nF6kAyNqHMog4BgshNVodfplO5eNOjqyrlM0Hq5Wwo6K0glP8rbuzRBY0VCuF\nc2LPaNfiBNy7f+fTUsCB/iPsCKHuxylc04iMW1qkpLmuMGEio8+KkZXGVrW8\nHJkbtHvmaK/0bTTjGEp9/klvxh/Uvuj5I+SAq81dgIzTxdP7oIRFD57h5z9C\neIaMIyTH6vzQ1689FRZp1huKfZcXPXS/Dz4w8vcvkw7Zr2Vk5E46ksIiQknB\nx+2GXqueJUr/L/MZRuNwD7OrIAB4v9DCT7CUoklom+6EZ13IFAmCda2+2FJb\nxjAZ\r\n=IP64\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0865ae754e69dd202118d895461ca5d4a737398e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-24T09:31:05.017Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.141","@balena/jellyfish-environment":"^5.1.19","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.408-renovate-typescript-4-x-0865ae754e69dd202118d895461ca5d4a737398e_1637746511751_0.8482696569671166","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.408-renovate-internal-patch-4db8a0c7d5b85344838c2b563f05ddae8c3f2731":{"name":"@balena/jellyfish-metrics","version":"1.0.408-renovate-internal-patch-4db8a0c7d5b85344838c2b563f05ddae8c3f2731","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.408-renovate-internal-patch-4db8a0c7d5b85344838c2b563f05ddae8c3f2731","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c621f1dd2c30251f7317fa5e50fd40bf9f052447","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.408-renovate-internal-patch-4db8a0c7d5b85344838c2b563f05ddae8c3f2731.tgz","fileCount":16,"integrity":"sha512-OpZ5FQizuDEtxG8jawb+4RdRRaVYsIxWya3HiyerhZC283umK+Tsqw826BSy17WnxbS3CAoCNlHjr1xh/UYteA==","signatures":[{"sig":"MEQCIEjOY8MudoNOlD73Qm3N4gq2XxkxW7m50JrGiOB7HsnFAiABphZSEAogw0NShMMvXlGHQsmgxV+STc2/tA5TxEUhng==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":141321,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnk4oCRA9TVsSAnZWagAAJsYP/1+LXme/zPf9mXTshIfW\nIoAJMAu2arAWhkhX+siCFiFZ14HAOp+0s3rkt225SYPj9EpgvbNfu1Av/iRI\n18qz4v94+CeG8chBli2C3n9mklwFJa70Len32nlIKXdNABdKgWa+DUjqL+eJ\nSdRLjV6SP73MvgyNJEdsZOivBHf+oOxla1QJVoKPHVgdrhTYrZr3/husuBwO\n0uV7uwLmdY/KA+AxdC5Cue73cy++YkGf+to92wR8uaIB1TLlQvgB5gCHUi9O\nKlczkDSUpf2wVW4r6f/xEOKmm41U71ncq2O2QQRAB3LNKuTJ2ouFRQ6jo4XA\n0dRqQtnCZyqj/NqeMaRcayg5i5gPiIPZSHrJs9nIM+JB1TUYaEtm3uwpvVcz\nTONOXz+Xd9VQ0xFpfU5gBm++pD9XA3zcXACA/T1vOsb6E7fM3bAcPMfArPCE\nRCEp9OHT+kNhkkJYDZILcuOz4j0VkeLUJarOPSsnw3A3IuFi1v6Hk98CC1m4\niUP8kTzZ4IJ6MHux1HeVcW08V+VjeDspTgtcFHV1h+Rh/k4HUDYQ+ZznbIBp\nGCoqCvLN4KESAzZjA3Joo2+OSyriNa3xMEoJBMvdOHZ/rOj1TtuapkNFpjyt\nPSkPUSi6hs4R2qZlqU3G+kq8PkVlFB+EaiVVs95mu9xozG0Z5dCb2d8q7wLa\n+Tz3\r\n=Np7/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4db8a0c7d5b85344838c2b563f05ddae8c3f2731","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-24T14:34:23.745Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.143","@balena/jellyfish-environment":"^5.1.19","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.408-renovate-internal-patch-4db8a0c7d5b85344838c2b563f05ddae8c3f2731_1637764648245_0.7021517316316228","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.408":{"name":"@balena/jellyfish-metrics","version":"1.0.408","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.408","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fbee74eaf453488eb8912e5a183d300515d12b5a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.408.tgz","fileCount":16,"integrity":"sha512-YEZvyRx8/Yg6HID9EjUgN0aYtLkBV7iC9wweCuHVxn+ggqPOPREHIPBtMaxzwM6/jpdEJnhBzdiRnYRnEJHu0A==","signatures":[{"sig":"MEUCICWkreZjKysMtsLekXacFnTs1r5VwWR79600YPXg6ne1AiEAhP6BCaneaLblLv0GH9/W9AYw4YClKo0N3r1RmOfOC1o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":141256,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnk8lCRA9TVsSAnZWagAA4WIP/Rc39yGfBoQBN5eedlbb\n7uj0TZOAGM3adsLbSK4Iypm+5O+yzi1TvlmcCDGr7XEmSIfvZOwrvH2GmYmV\nFIfAKjXEGWyN25vBvQtR2hmgu2F8UfF7HWe5ylYAVNSwR/YBzXV8XXZHGd4p\nJ3pxMvydzhDU3CCVPoK1e1x6TX8tg14zN6pnB2AbGpFWK7q7b3W3WVTX3u18\nIf0g4FyliFQDBhEBYIYhlxVmPEjHdRB11K+BbkbJOfOIaiY4AqCC0CyPDxSx\nSya2nayrY7PhRFw/4NehElB20g5Vy2aL9bBDlQOw3qAcCuIOMdYMnl7EU0Tq\nXLJJ4IMtS17B50ZTLF7tt9iQf6OOwx21Kjc65qRlOTJo+KnNvnjp49MepAUx\nzPFPh/vUUF/Er3Kg5W5oQ8/N1DA2tTfYGcucs0WTCUlltT42/EfD9oYWfx9t\nyA74Kt2Op0NQyJNBgiemUm545Q8mDtysJ1i18gXLHuUyaqkugOFy2DnnLYBl\nDCbhygC0Hc28Yx/jx2jd2bw4M+44U/f2jIjRVbBZXNqw688B361wee56ZhVZ\n5ftFQCjtDzQr5qUg5xEaOotHo3VkeF89dXs3DHpc0rEPEWPI0A8324q16mZr\nIQMGieRnSB5/JvQAFrtQyrSwIA59HNhbsdFhGEFeJL206INu/gFotqWxtELL\nRrLO\r\n=VTQh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a5ca2083f668eee9c8d833a7ebb713a302a8d919","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-24T14:39:39.551Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.143","@balena/jellyfish-environment":"^5.1.19","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.408_1637764901288_0.5666894092836796","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.409-renovate-typescript-4-x-3f250697cac116d6e9464e59a358adb39149769a":{"name":"@balena/jellyfish-metrics","version":"1.0.409-renovate-typescript-4-x-3f250697cac116d6e9464e59a358adb39149769a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.409-renovate-typescript-4-x-3f250697cac116d6e9464e59a358adb39149769a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bb61e6cffe17c8fabd394ff319efc5f6c73fa1a4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.409-renovate-typescript-4-x-3f250697cac116d6e9464e59a358adb39149769a.tgz","fileCount":16,"integrity":"sha512-t3ylPfmuLMQ9UjYwjzbMri2TSTSnQsKNxZCGbte6Gg+/EOisZ2ADofU+9JwkOa0vAMqxzZwflQcLaWSTB5yylw==","signatures":[{"sig":"MEQCIFiKozsk7VJQT6RYjGPGWMHN/vHSg5iW1NUBfZaR7UWzAiBN6qYMk7GZSLTHXsHCyZBuzEiaZ9Z+vR1qTnMGBT5x1A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":141410,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnk+tCRA9TVsSAnZWagAAIk4P/RAlTYdb0lWmkJ9Szi0L\nollDxyxJOidFGRkdMcs0AKjE9wUSyuhcnv8T7lkXtd5CM8ihgg81RaQJ9wdy\n0F9v/Muf0u/0ALZf5drCHhoowutWGpldCHA2Ot7iHxlWfQryux6Nn65lAwNj\n8FNdrpZ20Mmwan/Iq+ulToAl+3QGYA0zVtIO+pG/KICL0elF9QRRq+YlrXxO\nu+kZeUpfre5Oh4aeXMK9M0bCKfeatSNHUozxyvHMHymL1R9o+l+ifXAwNomz\nSqZ2ysLECLxSU8yh0UhmBt9Xfp4LbMSwjSJPL9C/YjXoibt8FnOsiPGw7IDd\n9k/vSjthLpJM4RdWy9kcV9inGrU3cBCzuAS0Lad+yX7GwhzhXiLcqaI2D1tv\nS8W7hDSNOjUwPn6su2v0sLXmk4J/6nYTqh30SBO7YQjaIuK5cklPG85xRJ+O\nW0k/rSeQfu2LxRZv0+3z7YOxB/l4tmo2XGOndeib463hL4r4EucJXJo0TiDj\nMNoPA7JiQ+iUHBLi8iBaWIFQGzlm6e2HDxJ5ysPG1dSVPiseqUdeBvOEiftK\nnRijCMLoG9aV5bDvYEdzYF6hT8HDA3VZWCPdyJcSzS1JJIxR4KDVHQJIw1C5\nUIZndCovqqdbQBnMyLox0Ojk/dmsmE4ecCpOkOhsiEecjvvqzvVkjTVkgF9O\nzsLU\r\n=+O9k\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3f250697cac116d6e9464e59a358adb39149769a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && npm run check && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","check":"jellycheck","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-24T14:41:30.863Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.143","@balena/jellyfish-environment":"^5.1.19","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellycheck":"^1.0.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.409-renovate-typescript-4-x-3f250697cac116d6e9464e59a358adb39149769a_1637765037566_0.7042194063888298","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.409-joshbwlng-remove-jellycheck-62a0395af7044aca53e81a6abd1d7cafafc3157b":{"name":"@balena/jellyfish-metrics","version":"1.0.409-joshbwlng-remove-jellycheck-62a0395af7044aca53e81a6abd1d7cafafc3157b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.409-joshbwlng-remove-jellycheck-62a0395af7044aca53e81a6abd1d7cafafc3157b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7c20d3732a2643f02671123756f6ef9cfcc00d64","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.409-joshbwlng-remove-jellycheck-62a0395af7044aca53e81a6abd1d7cafafc3157b.tgz","fileCount":16,"integrity":"sha512-CgGp2mXFTpLq3rPM9aUZL3nrfQuOmC6Yc7zrCxxZMaAoyCy5lGReNmVCgZUGsJccS5qs0Aki4ndPzHjGfBdE1A==","signatures":[{"sig":"MEUCIQDdPGtiE8wRLJ39LDfFn7RuOhIAizIs04Nauq/hp2rRAQIgLCrIzeheYQ0EqGtwdmw2Sievmni7HXA/WzslCdbW6CU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":141306,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnumpCRA9TVsSAnZWagAAfREP/RyqA7hOQ3/SxtPATvv1\nZYVvrhxMFOHR2UV8zMbWvFVzlhoZwHDAdT2kvmoEw7nFQhlxCAf1Idlcx9jL\nymgDyWQNPEm0XuG2huFoivz8JCxEk1Y95pUL2K71vQWGdV9SyBj7+THEysja\nFDUUO/2jQS0uhEyyvFdRmlQYvzbuEdH1CaCumFVLVBoyLGkXGSKLh8vwVltn\n4FsmxKP1I1p3f0W1ijJFNhvb0ciOrbdo4BoNXf3C1PfFGpl5UdXHX3oY2VAw\nY339aCyB0z7nm+JRCMoPaLT2aypUz2cCwmFBSntKrLdMjbxsBT8XnzJ7cxtA\ny/5nI+t7toGZfCzc8rfO8HU+U8wUxKRIKtEaLJF1TU1z6MakUn5XZUL7QD8M\nU59xqwbJ3lzsHUuJI7CyRjXlS+9AhTEvbW9YSVjUeY3olOrzapTr0oi85jLE\neHB3tJSf4sz6XGa+EXOuSaFlCUdKxaXF5lve6s38SexHFY6XZLcdBM+H18Ut\nvsNt8PlP138dIS8NcbWLqtG1JPiHZTaW0Fy+qNcBobYEoadFqWZNUJ2TJYL6\njwd86bxa4vy5aU9tXIvYoEkbEgKLWWY59ga1/wxczeyHy42oQQdGTZbq5b+p\nZQH+ECiZ9R2PiSSfSyLOdL3Jc1NtHTvrCFiKYjvOsawyxKR3OpVILxCPLIIX\n3KFq\r\n=Aidq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"62a0395af7044aca53e81a6abd1d7cafafc3157b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-25T01:38:22.002Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.143","@balena/jellyfish-environment":"^5.1.19","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.409-joshbwlng-remove-jellycheck-62a0395af7044aca53e81a6abd1d7cafafc3157b_1637804457812_0.49940653341122876","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.409":{"name":"@balena/jellyfish-metrics","version":"1.0.409","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.409","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5078cfc9df25e2a3d63160337eb67cecd5f551c8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.409.tgz","fileCount":16,"integrity":"sha512-TsM59hr1+iWcDpBzTE4Z+D33QACLfhzHmdq0R4I/zGrvHrbMSM+PIVDCGTnf18RnPD/fkbYE2DKFYlStznNIjg==","signatures":[{"sig":"MEUCIEWZGZdsudmJRJf/Nn++cZIy636UWIc001xKrsUp8R8CAiEAtFsFDFEAemb6f29/um/okyqewkQAvMTdWtLo8srQzYY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":141237,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnuqRCRA9TVsSAnZWagAALAwQAJfv8Fcn+M9RoId1LDmf\ndQXJcvVmUfpqZRyv+OftPQQ0aK+nodHx7XBjThWdUzcgKM3Cuzbyg9ga4pXh\nc34u2ehFeEzUHbeZlgrGSle7Bujo0ZQc7DkkqHUKAp+bxyM9mqVIv8FYAlrI\nJNZcTaiiZQLT3cJv3HbWeJUqqI40LaVxcBWiXMxrqngud/RVN+C7O5ir3sA3\nmDQEuPoqk60ZfAek9tZ6aZ7DP7QzHCh2DJCb6tEwRHuwHEa5y1STTwb/ZFV/\nqLGdnsHes9wx2+JzLCCvxR80FLWTxUQLVoh+zF7iL/7yi4Y/p/UlDkWvgt12\nIN5nC5vwtfjYGu5kV1mAN96/1ldqogouxuC3KZQ6xxwaKRQOcGWVOmsngEHq\n2wAHxtzvQxnvZeLm4MnUnzOCWDnIovnZlW+qhinoiyA/L6Tbkr7iLrIx8Riw\nyoLHcPJtT98q66V2eHtEcgEqB8HfziOZuGPmmuzsLZUsfQNBQ9CdXBSuqA7Q\nUUaFMHTLFNn3ofoXyTjQeOLU9G6NQ5VgUqmmc4ZB7ON5EAjIz/5fmIex7oid\n1c3ZYmz6YgyFNLlCzoD8cs2pHDpaYZs9aWznORXepn12abiT2k3QmpZo9J0M\nQvop3lmdbKViIuEfgJjKpkT34wqHwQ1lC2TCAPuMvkc4wwMtI4rWa4eOp4yw\nJiEM\r\n=hzhn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"083f24102c785fde0c7a7f13e60402250cd90915","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-25T01:42:47.575Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.143","@balena/jellyfish-environment":"^5.1.19","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.409_1637804689443_0.8754549333715278","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.410-joshbwlng-update-repo-yml-7ba65193c194c87365256264ebbb98bdfd9b5d7e":{"name":"@balena/jellyfish-metrics","version":"1.0.410-joshbwlng-update-repo-yml-7ba65193c194c87365256264ebbb98bdfd9b5d7e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.410-joshbwlng-update-repo-yml-7ba65193c194c87365256264ebbb98bdfd9b5d7e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9e9cc0e987d4418c388bae60421007286f31ab33","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.410-joshbwlng-update-repo-yml-7ba65193c194c87365256264ebbb98bdfd9b5d7e.tgz","fileCount":16,"integrity":"sha512-BCFwfNoRWf9/3M/oCrfXm1nJYh/X0J8Cx9W3hP/a5RhUAjj+G7MadnDRBUJ7HzGKXhAlSN1G02QKHxX8fP1Tiw==","signatures":[{"sig":"MEUCIQDPvVGp/WP6dH1rjhwupszCzuoB+IHgaRHsF2WHADq3zgIgNp+ykKggX431mOepCqTFxiuNjSkiYj9s8TqW6zInuFM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":141387,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnw2dCRA9TVsSAnZWagAAa5UP/ixCkQ0i6LD8YrW5BPQh\neyg1STjIJhlnTvi34QAEY6TEFgkDO8QX8Pppef5ZDjn72weMUnAAoZvtWOWQ\nG7Eil5FwyEe/FBPyzCy9RR6NJWg4HfSsDL7YTef7cjzdRH8Q5NUYde7qDztJ\n0nZjfgIgH6fXuo3tAHDN1jqPoGk3KOT98vWbBfP7rU/e9Dl2gy+vqvVAk5o5\nTsJuix5aoR/Ia7VZj69jNWkq8kBmyWTbFCrhxXEVzlO5Z+MA24ZKnND4xxEk\niNDNl93aiZQGYotqqKv7IlYkbCO67BAVC3LVxr5xqomA0aVGLzhQZBOtyOLE\nv+vkoZney4EWZ6qSztCQ6/fJBcccAU4a49uSzUUR0xvqtD8YdSbw0u7+WqxM\ntvotc+L6MeDQ0kpvcgc/+AtaHCwiO1Zr0Z/lsxExLSqeDcFEDBpngUv3qy/m\na2dduLg6XDultRXp37HsLv/88B16FdslbVSfF/rJ39SwF5j5tQBeW9pS47LZ\nRHmiUc6A9bBXqAtfCoE+H4GjilKbX/xrBgyYIx0yMoQmy7Y+JynD4QCNR9Ng\nfuEIj9IX0KrP4EFqw3uwG+xdqW65fGjiRDymQOK/jmdoj47VFhKPrZWNd5ke\nq/UmIfQmcaxJA+HNyqKPRAGwmxF/40sahAHhymVokkfgtY1bV4j/ce2T8XD0\nse3S\r\n=wvQl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7ba65193c194c87365256264ebbb98bdfd9b5d7e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-25T04:11:24.491Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.143","@balena/jellyfish-environment":"^5.1.19","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.410-joshbwlng-update-repo-yml-7ba65193c194c87365256264ebbb98bdfd9b5d7e_1637813661777_0.2591806616740988","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.410":{"name":"@balena/jellyfish-metrics","version":"1.0.410","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.410","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1425e8fb8d623aa5fb4de26ad32c288ed4bd0197","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.410.tgz","fileCount":16,"integrity":"sha512-xMk2RINFsCtIo4Cozj9qhgCIT5El5xlCqmVyEJq8gwHRxEGPGq/TBEFkRgyERIuYpdIBMOp0axjzXP8JhjVrbw==","signatures":[{"sig":"MEUCIQDMQKat0Yd2S9qK6/OPt+cQbTkR7MG4XgdfYn33k4mOWQIgFQOcAPSfl8yrSHUqmWUCokXh9TEGd5JLiuNRsW8Bj0w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":141320,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnw5YCRA9TVsSAnZWagAA2isP/1h+WKhHLiS0njJfwWzg\ne9h0mMnlkycidC/O0LWlKNiXF4tpy/S0dcTRJHiTZOlfMOJbJ7ErBUm+a8r1\nC4HmoQbAhmULDxyRZRmRb4YJ0jd6VAlnTcaTgNQbn7WakqXBQWeB9c9ihKux\nOhXmRWKXr7bXzsl3L17q732/RB8tTQTbMeGw2fWTsqNKKPGz5uS6Bn0ta8Qq\nESryL3Na3ccGUSvyKuIGUmPadGkYwmiW5pcY+zsGNlu9rtpuO+cTYIfaUa19\nTzGmlogiP0gkZ3a2W51PShMtV7SXr+AVJ6Nav66MSl4TDU9KOLDVkeN7zmsz\n0vycEFcqNt4WSVey1LXHdXVNqXpmowIwc+qL7WvorKs4l9bDnMj4ux0Q4TBV\nUbQAxhzWT8j44xwqUBZ3S3Js+MP0G9W150WoWW1x0lSBjPBzR12dCkfsm5pm\nsUz1Gg1jSP1CIIOzrgYkIGnRpj6d9D2a8w396khUJfpLX2i+Lz50K9RJTzxL\nynpDY8L6n2D3OvuWxm1shTJqfstbwoLcyb6NuHEpqpW+L6YQXHF0JPlDCiCK\nwgkjhibKv1FsgpFK2tRzrR81j/KKauZsQBvCA5H+6y9yrTL4fvOPRUbP2Oek\nmf3MVVK9nUgt6dyDVLUtoasKmu2OUeS/0xY3/JX5SKmZ1jxJkPOf0ypDfwce\n8DDL\r\n=jjOn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7d6ec4ab0366251070f273b268b28e8eadb9c3e5","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-25T04:15:35.149Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.143","@balena/jellyfish-environment":"^5.1.19","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.410_1637813848347_0.47053531010188543","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.411-renovate-internal-patch-7a4e5a59dee8a8c4c3a937cd31943864a877e34d":{"name":"@balena/jellyfish-metrics","version":"1.0.411-renovate-internal-patch-7a4e5a59dee8a8c4c3a937cd31943864a877e34d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.411-renovate-internal-patch-7a4e5a59dee8a8c4c3a937cd31943864a877e34d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ce7717c64b367421799e74b1bc933f2d43755162","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.411-renovate-internal-patch-7a4e5a59dee8a8c4c3a937cd31943864a877e34d.tgz","fileCount":16,"integrity":"sha512-C4MyGZB1gKwEzDLbZrl8XPlPTVyzW6LusotbbyJgUW5KHE2MR4Kjz/HWTmcSmU+M5odHDlSCtzIR8Oz48e2pTQ==","signatures":[{"sig":"MEUCIQDSj9zQZqvq2WuTW8pY1AjwYkM4mO0BrOjarfifUeye+gIgHVMTheewrwax/eA8yxDbEBR2SvqgpvR9SfxW1vT98TA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":141457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnzNpCRA9TVsSAnZWagAA9wkP/14rK5DRgtxcGCoDGJ6t\n6LSkrtj8ebiyF0igzodK1l0e4ugc/vfF83v/S2N5y/O48WMMsJTlQcaLCsH8\njT4nI7qbQz9vg/jjA3zlmnUz1J4PTtUXOwqnLcBuRwyAzcyy7FotS8rmPJWi\n6eaoUJeeQFLGaqVaRpxg0aYW419OX9Me7GYuRM7odLQ1nlciO1cY9ecKvb3x\n/8kAqTVSfQQ71tuSWXGmNGBTqGRsA7DJy2W6FhcU2PvFtUhkCEvCPiabGptE\nNTr29ha3Mk/nlW5mrDJPV/yPdmEtY4l223PsKelbWIXRub2fZqmvmxFMZT+D\nMlSCywkWAVx1zi4DtYy11xRcjH8jIBlt10HwtEbfZVNzbi3TfbTvBkuUTshU\nIQ5tYGZ+cFGKttuyeUYGLsMfNMzoS/novWRhVBq+Kluhd5pA07n9iiZNwbJ2\nDMoInhzRRzmrfaeH/vGQNb2yqqa4HASXeepsH4p4muqy8LvJyw5NfZVzIiXk\na2OWMQQHOCZgHbu1tb6pEzgIy0a9oAqgZ21GmVm8lX3J1Tgbny0vXeKiMBo7\nD68Ey4ow+H323BTHCgpJF4cNXf3aJPlqgdvaT7LeDpXz0Ah4ctX4dAhNDet6\n8OMU7TFbZd5cREAJNuINbAqFjVJRliYEpArJb4inYyA1Xb2ThJVmZAxQ9Sga\nexrD\r\n=v5Gp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7a4e5a59dee8a8c4c3a937cd31943864a877e34d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-25T06:53:22.414Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.146","@balena/jellyfish-environment":"^5.1.23","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.411-renovate-internal-patch-7a4e5a59dee8a8c4c3a937cd31943864a877e34d_1637823337446_0.14978500390231342","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.411":{"name":"@balena/jellyfish-metrics","version":"1.0.411","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.411","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"194260a5f3177aeae240d28a815379f45a849ece","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.411.tgz","fileCount":16,"integrity":"sha512-J+7GX1HUzdfvYOE9qSoAefrIBUKfKxAcLSfcHK5yun3cIf5ESYUGRFeONs3fSXQNi6j9w+46UwjNdjO8NycUZw==","signatures":[{"sig":"MEUCIQD9k2A62IrhZmg8LoykKdch4f4J2s6nGaLluFuEOUw+aAIgcw44Cz2e21rWAEEUJEJwj0IlLpMEbwRanQVzA6mk/ZY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":141392,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnzQmCRA9TVsSAnZWagAA4RoP/j+rXbd4v7a3C7vYG/M5\nzRDJxRcVWzgYEkXx5vNHT7jmuuSSFEqEW3oNUhDYHHRHOzz7NibOZd40d+eh\nUhmE78/AEuCyZas83Kt148901GvfSt3EcZtu9bLfhNT1TxVNt6ZiPzjM7Dbq\nMKfJWmC/ny+vxCs3tAwkepcE5A7FG7OQWdIz4992zxXlU5YxCQMh4/Stx6Aq\nff9aRjG0omfJW8sNvijAfEFgVH6skKiCm+vT+gBBv872LJSM3nqBIkFJcmx4\ne0PQq61dHtoMgTEOk/FxRHSiGBF8RLiXd7GoMGrsQnB+A5TjWHViJwREtsIV\nbfHroU2BvgXrP8Djye/IiwLSzPew9NFl98vuRKPMDIQ9gLB3dBrZP4qUkqEX\nXpmhL4LLyaynODbpqKrqgf+iTnN3y5nVLJ3WbEWG9lN4Kv3cobnuvrGB6Lgj\nADgV0kWXbjUULLt07wMiplRxVkgGjRgs7xcGHel2y6hXr3iRR1X7ZxCTkew2\nduHtOoaEES3RYQTWUW7jc78q3MestOU0DejSFH6i6xfXzHC1N/3ljjfkLW23\nI1HAHNab2rkfxIkhEZTJmqRUo0mUzUxgVELWbLrOilrgbiIWR2uXM1DUwf+J\nBPVdz/N4/9pA4foxekW8NUfdg4yNcxrmzfdhFijR/mDAQka/ruPIvf6L3zBX\ngASq\r\n=GUVd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3b9534538b4471f8a220884b5a09a26026b43fc2","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-25T06:56:45.689Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.146","@balena/jellyfish-environment":"^5.1.23","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.411_1637823526557_0.3541164980158349","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.412-renovate-internal-patch-2941c49c1e13b38039b83ede3d897421fbec8e22":{"name":"@balena/jellyfish-metrics","version":"1.0.412-renovate-internal-patch-2941c49c1e13b38039b83ede3d897421fbec8e22","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.412-renovate-internal-patch-2941c49c1e13b38039b83ede3d897421fbec8e22","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a66cbde440d6af717e6e853880035f377aa94e61","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.412-renovate-internal-patch-2941c49c1e13b38039b83ede3d897421fbec8e22.tgz","fileCount":16,"integrity":"sha512-Uenqps9RLWbxTsc/QRrWKpUlJYqhqtRB6omcxZupB4BCUMxMbVjsRuA/6U5gILs8YqAN8OR7AahEmjoIHpul4g==","signatures":[{"sig":"MEYCIQC2xBbEcv57AYObYAbKRcBwnhXvjMCR0fg9McvSZqckxAIhAJE5nVYbnyAOR8QFHaVZoddtmUMnniUCVius80gtqd4S","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":141562,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnzVFCRA9TVsSAnZWagAAy7MP/0QCI77P+O0eEzyefphN\nk7qyCMLU+uAvBQlU194JETofLVptlohPy7GMZ+m4Oka3LomfR1c9k/ddWKIe\nDcHHiEjXUHu6IzpxN7Xdfu3skRRF9maG6qsLJK7nG7MXamgjieWI4xrKNn0J\n45rIt+/BZYDXt6mJ/MlBkwcojuK/70r5aQ1UY6cqHfn0tijGba/hTJjPZFRe\nUudgzKrRIEPcd6RTLB1qJUeY3UDDgXnxP1MDDufjc79KC5pfF8qZUaNJuQsN\nhLi5yo5VF+uZmcPibBOjCjblMjhqYbxzkwoVuE0ME2eTs5KcEWPn8NiZE33P\nGx2WGq4Y222r7xe0+JbzDO0LxwF/zoiY9axYG3QrTHBHf2Q6vv8iiwFqiXW8\nClupvRF3gW2NkSysxfKMqOR2UvzfUGMdLK8GaJdxM0SXu/JeT3XmO9omWb+K\n/RQh/15cwclYGPtCgfjouoeRSi85eDj1V0936IGpwcNVgWnoQdco28tt1zQr\n6kNf/KA/c//AocAYsNHNIoHz4dZFVyMyiVhb/VyFUT36bEJAOITHoDohDQyx\nK4Ytih9v4NoZ67DHXo/qIVV5VrX61SnQygL+1wPsUjERXQ8Jnj/d8LgGK0Jl\nUol88NZuIQzXAbyxKYXEKGd/BfQ93HCRqSfE7Uxl4qBBLSVtil2HTOIldq4i\njkDA\r\n=lRUr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2941c49c1e13b38039b83ede3d897421fbec8e22","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-25T07:00:07.475Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.147","@balena/jellyfish-environment":"^5.1.23","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.412-renovate-internal-patch-2941c49c1e13b38039b83ede3d897421fbec8e22_1637823813362_0.17941422205491064","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.412":{"name":"@balena/jellyfish-metrics","version":"1.0.412","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.412","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"36761a32148934c827b3053a5bdfa8af2387166f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.412.tgz","fileCount":16,"integrity":"sha512-aOcCfKweaLJFscdg4VWnpUXqHu+x6QkLhBc2+XCN1zGHhM6vHbw8821wT5/CjVKvnC/1B61tWJriq5auKOxYJw==","signatures":[{"sig":"MEQCIGRD3tnf1nuqiZ3lP/dXEQtW+gBSjuxOae6CUuLkmrydAiAoFBCBOA9wKgmmMVlosccaIIBTecYJGd9sUKRYq7ptzQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":141497,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnzZGCRA9TVsSAnZWagAABSQP/10ukCG0mChdmPqeO8yK\nJgNQEKqL/geNZcGnEjIXRRovck3LEteOshecCa1XfvuLNSh2N62wRA3mdSNH\nJyJUolee17zZv4nrGD5q96F3LVTyKzwQ3Ne584Vy3wocVOVT7EbrKdQyh6Nx\nECFcYNeeor6TVgEhXtEfcnOcT6hF9MzvWctXu817WqdvMmElav04fUWtFF5U\nTb+Tm1isKj94QQd9govTs7bvYE65Ps2BBDrwI+9GJJnMlInEyNIbqbvDhRGG\nV2xsXVp1gNEqfLHYvSLliwu/ZVAxXyCDEeyjoKYAUHHSNLQbGtgB4d7MPPht\nt5HiRdIYOfcoBtilj5oz1ec89yj/lfiCLI+71CSJKGKYZma5NI042eqoKAKN\ns0S4gwfDEvc3uO3rRFbuBI/F4mu0EUuo6Q3cPSt01owKVj3IXEFhsBK5ceIP\nHTdZphGuygfdqvXE1gKadPMHTwQU1S9UIb7aQFs00hjkyGTLHah0dtHFKxMe\nMGQWi2Z+EL+XepadEzKHNUJpwwr3ECkIeOSofepwZQoyo8ncm3p92mbM54Z7\n55/7w6qBPoZuY6r76scNTj25L6tHVo04yQTDatNjmv7qWYKBmj7zkyO32iv8\nGTe7qqWCQZOEhUuPFCKgOrC6IVsxg71RsFzdf95/mzRDii6o/ouZlxvdau7m\nTi29\r\n=/F1w\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"773a3b735978649a9082c57adf5daf768596f72b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-25T07:05:13.944Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.147","@balena/jellyfish-environment":"^5.1.23","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.9","depcheck":"^1.4.2","typescript":"^4.4.4","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.412_1637824070477_0.468050163952328","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.413-renovate-typescript-4-x-21cfeab8d59dc0763f079e0da7f753ddcacbd981":{"name":"@balena/jellyfish-metrics","version":"1.0.413-renovate-typescript-4-x-21cfeab8d59dc0763f079e0da7f753ddcacbd981","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.413-renovate-typescript-4-x-21cfeab8d59dc0763f079e0da7f753ddcacbd981","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8e6753cc9fb2c9c59d2424910092a76317144c4f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.413-renovate-typescript-4-x-21cfeab8d59dc0763f079e0da7f753ddcacbd981.tgz","fileCount":16,"integrity":"sha512-GjxOK0/L8clUjuwWa+D5U2l7R8FIeh+IcKMILcerS/6/6zcZmgXBdoEQbm/nQO5n02HjHiaupD5QEQuvBsl95A==","signatures":[{"sig":"MEYCIQCSjZc6rb+gYvDZpSbP7dDTIVAHnniF1FreDXo1uxs3dAIhAJJQsiRmT3ouLNjFpsUIGAavfni4/lBnk9ZIeMV2xJQc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":141694,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnztxCRA9TVsSAnZWagAAV7IQAIgodjEUGRDGey4i1Ux/\nQBTYBAOiggNQnqf3AoW7kuICPt8vDhft7KZthzbuChIZGpjq9a2Gb41jbwA/\n+RZKoqM2TIXtb6r2RM6lhfRwY/K1M56KPlkkDqrTE14ZvQNwcof5QtKVDD2V\n5Xdglg9Wng6HG0Osx/vPusKDezHSaktD085Rpr2ImfPJ8RpBSODNPL+uZxdz\nRQO5w2k0jfG1Dli06hlQ1uKZQ9n9wu6cX3vqMrTLLBvzOVCHXomBn12yH3K/\n6LAssdJTk5Dm2R+sx+ym+hDDoxoAP9/ZQqmWIMCt03Y2OEbx8v/iGtg0xFeC\nhT0qqTT8yuu7Tan5eZUhzkqrlug+CkShEAZCH25CPowpuS72wNMpaQOEUObf\nWK+/+PCdEqQ9iiDUEmboIUjMwp5F+Hpv7ZsvYAIKQRCeAWwcV9zAPbCzOIYl\n4C4cZDsSjsQ8ub7O7EgCESTeXU31UdWiAS3MUPb6Tg355cajmG5RIckuUp61\nVelKE8NzjRCwDnZI9pixQS7h97ZOf5Vp+q6T+MzgsDuwwxEB+Ez74oFQcGsd\n7LEvpJkEsrmf+19JpFqWR5b4NAQMbQMhlrFnu22RMdAvq+ZRtT3Ow0JuSf1L\nUzamGg46CfozBzJlf/mwLLOCbUttc/e5J/NDr9MHy3WJ68J89K0vZJaWD8Iy\nA//E\r\n=qZ4R\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"21cfeab8d59dc0763f079e0da7f753ddcacbd981","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-25T07:27:15.075Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.147","@balena/jellyfish-environment":"^5.1.23","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.413-renovate-typescript-4-x-21cfeab8d59dc0763f079e0da7f753ddcacbd981_1637825392801_0.23772128939204573","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.413":{"name":"@balena/jellyfish-metrics","version":"1.0.413","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.413","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2319eeb0e62a5d26d631a1d74673d60386861505","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.413.tgz","fileCount":16,"integrity":"sha512-1wjDtHyeZA+pn5g2hDKGJhSt1fuwonhEaSNVTREVJdVf7GsoVmEHEeKVonXz2Rm0nmXawP8E0RZ/d0SHbc0VsA==","signatures":[{"sig":"MEUCIQDAqkk5fEfqClc6jV8KSxUg+VAlPv+Rmt0wfe606ZWizgIgWJRtT0lHXDB0fgpSwaqNVvDg0tIzNUFbAWHYRYlPa34=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":141629,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnzwbCRA9TVsSAnZWagAAFzQP/34WSVRwTbWFw12J4ly2\nEoOEA1m5jyLQaFQa+SvnLbGMQU2FPQ+AAghIX3yzctkjZNugjdllfs3PdW4r\nY/kqwBum2o/ICUHsNK8DZty3iuwgomPaOsOEwYrRVTnCgjqFxLyU23MnKkT3\nQCBIHduTTw42qHBXMs+YJomw+vPvXjlk2SobDLVISPrnV8cA4/zcV6Gcf3rJ\n3ZdCTOGcavTgJ0fMd4Es6I2KMCpPveRZdF6txD7ywuMMAbtNSlrwBwE48y3f\nHGYFW32zvaVtNsoBcWrcsQ3wH29yuUAZ/UEVbN+QhiLQN/7EBmAWHaApAiVx\naOhv3boqQVeb0zdeO+8nfQ4iDaPd/qSQDTnQPbSLqqU3HLqvbmSJgEd96A8G\ntO3nfGeGC3vCWWNV50n6jPytRtFb6vDrm7TC5CGAZ3H5oRJGiS4i+rYG04QH\nktZIHKByrFeDkWlHufuhYxA5uDpiAMWzhk25t+LEYDzvJbkkZL1Js7PM1k6s\nK8qsNXjQupBj1ewAIUJQZvzjH74RNetiiY09GgFJcvr53hbQTSXpCUL9vAwD\npv9/nUykjPhVuWhJ6LeMqYeWrwDxgLiyrOzA7ZNvWIn1cIG0A1q5EHJd95Fm\n0WLo6bvmmiggKnDTbs3IcPleEYiWhyHaF1roFDRX/uRtW6bDMArvkosKaTHN\n4FxW\r\n=btqB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f917c8863ff5a3be303f9bdeaf89e98551bce380","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-25T07:30:39.204Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.147","@balena/jellyfish-environment":"^5.1.23","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.413_1637825563521_0.7556828916395735","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.414-joshbwlng-use-renovate-config-d1837ad99a4e1465745bef1b6507885dabecd010":{"name":"@balena/jellyfish-metrics","version":"1.0.414-joshbwlng-use-renovate-config-d1837ad99a4e1465745bef1b6507885dabecd010","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.414-joshbwlng-use-renovate-config-d1837ad99a4e1465745bef1b6507885dabecd010","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5bc1de5aba877bef3bf952de244d3bb10f2460f5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.414-joshbwlng-use-renovate-config-d1837ad99a4e1465745bef1b6507885dabecd010.tgz","fileCount":16,"integrity":"sha512-ljBag8PSI+f9J7P0JA+BXi10JrFecRszlTonAaU8ZH7EBzsYdMKII6Dd4YnZ1TjZtmFMz2tZ8BQ0cWmb22OBfw==","signatures":[{"sig":"MEUCIQCxDyRiOlEp83X9KKZ/5jfC82Th/pyeKoCPilVZUjAHnQIgaadHTYkkNxJwh29e5kzzKfqtNgV3yWFBHlGDKHqTxp0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":141774,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhn0oZCRA9TVsSAnZWagAAieQP/16+7H7TXrZLX+v0Ku+t\nHkFckfmB1zkoFJ1mvyOikKLm/lxCit03zKpVvp1XS/hed9uKJ+ZkwId0ER/c\n55PPMkqyimM0zWZXSV1Y3KhtGUBKv4qUUOo4kV/U6dGCZEZzyUA2rgnCkMVY\nhAKWBVW+iYI9GjEQSvYgldivudjlNyAwevt1jPLgpnf7c7m+KpXyfd3Lbo9V\nVyyE0C0Cy86iD1eSVBVwOymMzlCwiD/Rd1dPZnISuMzQr4tyZ4A40eLZd1r3\nrSmCRcSFqOctUrDRWfStQnQ+4N0ig63LCzCEK8To4JwoRm1xrTvsbZ39PCGi\nTUMgx3shBht0drebpwi2gHQvSslroCCPaS2IKFus1YAyYfUur9GASIZpgXQX\nEh8aK3qrefz14hzMubNvGP2YEM49agRU2vks9c8Dfaidbl5LUf8DI52Wra4I\noQ+UFlUj/PPq2CFdyiWxMfY0wfSQc5MCFNdk/yXES8TFyVBXnokpNp1UNlMu\nPKbNj3u2eYQM9m3RV7G8HmoFEwovK8AM2V2eMshaOcBqo7ZOAcancMmYv+M4\ngYhcn/dd9ZAx0hi7fJaC0rXKX9r1rGZLaEgEcjbmZkw44i8gz3B0TJu1viLQ\n2DfXfEKxDxpHpnoLHCp/jo/VyIloLTz4qV/1fc4otSOT7TxoySJ9Y47hnvgV\nZV4/\r\n=jIBb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d1837ad99a4e1465745bef1b6507885dabecd010","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-25T08:29:05.346Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.147","@balena/jellyfish-environment":"^5.1.23","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.414-joshbwlng-use-renovate-config-d1837ad99a4e1465745bef1b6507885dabecd010_1637829145762_0.6577731566727236","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.414":{"name":"@balena/jellyfish-metrics","version":"1.0.414","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.414","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3c876329f768b8173ce43546063e8c50fefafa5c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.414.tgz","fileCount":16,"integrity":"sha512-w8MzKDJKsUi2zWFZZv1lbjYk0/KtUpj1k63jUKjAplVPL0vyi49HSU2qwcVYZRHxQNkjdJcwmZQ9LtxO9kWJhw==","signatures":[{"sig":"MEYCIQDYHbECtl08X0z+V1Xf1fpL+/+cCPCQsrFwbFxzRXueoQIhAKfycZGycBZrvcZaLTggLydSftaASNOk3I/l4Q4tPfRp","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":141703,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhn0sJCRA9TVsSAnZWagAAlTEP/3uXaBwQKnDhKd2/ejQU\nAWO//cXMroRwbM0Sh135AXNmZipe2LfaAkB4ya7xIma6EegDq7aEbzgSJWnx\nx68spH98fZ8ZDSf9HRDLwACe9DX2u72DUigFBQzEyjrvWWKXoWzGQLN5h/cZ\nthSc3Iid6agvHCLa9YZrGNjDc/cNONfHBXilutR0PUtx+Cba90GYvKFsqa3u\ngE1m3Vj4s+YzlyfJDphaQyf9yjdflP8SEZVvG50d3VfGVW7PTMGDh7Mm6d4M\nmvQS2y8BY4YtrPBLPo+zeVwmtt5jPFsECvWALCgCnhv/sMAD/+IyM2kyAmbG\nsTmYNjbPmZKcwscuZsGGS6ZIPUlAuGambLk0jUo7x+m2aBUQzG0CBg18JQU1\n3ieU+vNLEI+21Yn/QrWjHy0cOgnF8CW6XNEpuHp5i5Nd4286JRN3KNBn+2kw\nN95Bxzl8tkM/0PiGFqMWcyDMNM+kPLw2gyYaZ8TTkbP7D421tUJky6NTh6Og\nf5H6/2oR1sA5yKcPPgjMiXR8EA1F6CZecOPy3ziAlMyTQD+Pu0BjyfFF9G0b\nccg18JtrxLYcwjJnAEfzvAXO8tH3WT45hJYSL1eiMxSGd9n1dSFR0vl08aVG\n4jeicP2MT27pjMLErpT0vxgiPTLrkrELg8DuGXae2BAgLMzXTyMkAK6uc3Sb\nkhN2\r\n=xvr/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c3c2739e881038d1c6c77f7676feec3a9ea48739","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-25T08:34:32.194Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.147","@balena/jellyfish-environment":"^5.1.23","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.414_1637829385343_0.5254190960198843","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.415-renovate-balena-jellyfish-config-2-x-b05c4a850b231ccb6ec8a08e8f3f7581128f482b":{"name":"@balena/jellyfish-metrics","version":"1.0.415-renovate-balena-jellyfish-config-2-x-b05c4a850b231ccb6ec8a08e8f3f7581128f482b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.415-renovate-balena-jellyfish-config-2-x-b05c4a850b231ccb6ec8a08e8f3f7581128f482b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"399ded65f3802b4f5daeb2c41d8a21acaf5eaaf9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.415-renovate-balena-jellyfish-config-2-x-b05c4a850b231ccb6ec8a08e8f3f7581128f482b.tgz","fileCount":16,"integrity":"sha512-bYOuezurvI5epNMyN/mFKMVyvo+UbtsLvt03GriNhJCrWeksn60mB5z5aAfUNteVwbrUJTs38FhVCe78lKyBwg==","signatures":[{"sig":"MEYCIQDztuKfC1gMgVWy9KkB/fGm47Z7jgo6pgqSDs9pzgyH9gIhAItfjkUbfkbMal1w8NtUqSHpR7t63BSkmlFO0IJJxx/4","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":141880,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhoMKfCRA9TVsSAnZWagAA7IMP/2JBbU1VPDnCJspyehgJ\nSaPeurDI/nW3RJsZJccmq6Fz15DZ4IgFWEIQEcwabEzAtmas5VAOIF38cPik\nBONkFHRnSVgmmjXbmQ5t83SGK9LBdMqXVbsW6kImnyX1NG2je/bUj3aR7lvt\nEFbutzyXX4CjvPsx3TFpx36sl0Pa9YJB2Rpy1TTj3nz4zsXut4QthGZafDDL\nUAAKEv4CbwZd5Dbfidky+9nu2jFSk/2oXIeeXGsvbM04MmooooGIJlTFvePC\njKUSPtocjYijL9c+UPjVgUrKtpcfAq1T0AxSs84GwgL5mR0kNsLYmcyrS8pF\nyTrsxt8tiK3JcEsbJeKLPz/FE0ovHnhTVG4egxWlEvMeJL3j4BuKYL8pLJQv\ntrsxBCNmmqoMaRtMzY5jlmxTfrz3tOq+W2nBFaWjUs7WTkYv7OblCy/lzs/T\nqcU5jmEtgp9HJ93XF8T4kkIG+dTUNDVdTnh8DE4iIXERtpvoGWNNmaM+GGnQ\nPMnpnSXRGz4vncyti7q/ZWnTHEY7rz85yLAhMZCuYo+5v86BQ/bWZDJDK2zw\n+aspQZ3YagJphaiwsd2BlGqPIM0od7fDQ/22yzodHP70bvtOQRH3NeWP6XV0\njtFEz6Tz7KF35byjxw3OKGfEfhokGhnORDRpZ7w7VtfciCcvY9uE/b301fVZ\nBycf\r\n=IZz+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b05c4a850b231ccb6ec8a08e8f3f7581128f482b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-26T11:16:28.442Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.147","@balena/jellyfish-environment":"^5.1.23","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.1.1","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.415-renovate-balena-jellyfish-config-2-x-b05c4a850b231ccb6ec8a08e8f3f7581128f482b_1637925535124_0.11737531094538589","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.415-renovate-balena-lint-6-x-ba5374b670a97d163ee0f4967b4f0affe07cf1a0":{"name":"@balena/jellyfish-metrics","version":"1.0.415-renovate-balena-lint-6-x-ba5374b670a97d163ee0f4967b4f0affe07cf1a0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.415-renovate-balena-lint-6-x-ba5374b670a97d163ee0f4967b4f0affe07cf1a0","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5dc9df4e256d8cb848694debce9ee1049c9458d0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.415-renovate-balena-lint-6-x-ba5374b670a97d163ee0f4967b4f0affe07cf1a0.tgz","fileCount":16,"integrity":"sha512-lM21RM0Fk8/Kz0z5z6GGumVeUhi+vcgU5CihEvmIXCNw9slbY1OMkVJ3QED9PCZIak1m4vbN+i9XDZ82sp5Pkw==","signatures":[{"sig":"MEUCIHYuDfxqy4Wieop6zoP9uPiOcjJ21eydEd8IB/n9JkrAAiEAs9yLfB+ws5K1Obh4d8+EME+h5DjvvDUR6knSn11SwNc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":141860,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhoQwJCRA9TVsSAnZWagAADuUP/0+CjLfM6FFtDJZrgJvr\nwcgHvLGDqKVbNCUFxUsSzblFYNtvN6/XkYdLcgOwQn77M1HBzLNihIw0MGQK\nCvW+JXOjxDHvowUAR+72PWSlUGTp9aFSTCQ4LNMiApKO4cIiZCYKLEUUWCtT\n8wIoJ6tguxsgVcE4PJmrAkDNIEuOrJTTXez1+wqAUQHZjr7njL9HKyGCzBvO\nNfGq5gtuWf8ISACFBMD16oND4YJhsd78QuY+z/G4SRZ7owedStCKzYA01Z6e\nfitvBNJQZqHlWA3jO+5fX8gpYQjFtDIQokbBSVrlTup0LS8799GnQvftem9m\nsj3851f+8WY15q3g/0XbjU0wij5bp9qO4TuVVFGL5XXBTsxDJ7g0/TVRW/ns\nR02VRCHMKfrxMs1gHVmIk0uXf+zaZH/6q2FYVzKszptFSBLajX0G4LxbbFp7\noI7S+sl3VbWHr4uWP99+aVsz0XWGUjxq1Tf9KhlOk1x9OJmoRLAkrLxQp9cy\nBR6dS12P5xPE9iXjytogFSqPhZ5edS/mUmfJ+Hq+EGe4RgYIxjErFLw+Upi8\n79vxnzpMIyY0T/2+XoIdPEnefUhQefpM8j7kod4u3sVFqOOSwt9K10GsOILV\nEHMZ25RyTQ9BbHYGolwFO7oNlMv2Irt2jJgWoHZVlcyS9XRwy4NrtizsgUTD\nQV4l\r\n=Uu2Y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ba5374b670a97d163ee0f4967b4f0affe07cf1a0","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-26T16:28:50.375Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.147","@balena/jellyfish-environment":"^5.1.23","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.415-renovate-balena-lint-6-x-ba5374b670a97d163ee0f4967b4f0affe07cf1a0_1637944329233_0.8329999631706329","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.415":{"name":"@balena/jellyfish-metrics","version":"1.0.415","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.415","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"358380e874b4ac5922d67cfca333cd0e136a3ab3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.415.tgz","fileCount":16,"integrity":"sha512-JC/sHZ21X1j0jyolfR8THU+dXgQ0RDBEC8w+b4eoRT2rysD/o8c5dNvevVJz+ugJJ9l0szJxnM40jB+WwK/eXg==","signatures":[{"sig":"MEUCIQCdigEK4t3mRvDzdQY99m+xxt1M1Xv9uCZLfLAUNiUhzAIgHHLb3jVnKG2wQE46XOOAzDXY0UFSQ/cqpcHSFlGL/Mo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":141794,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhoQz7CRA9TVsSAnZWagAAxMMP/iUwtLiUMKZloUf7wPDz\npFr4sf/zdAWHBg8F8E1+0Li4PXmR6Lb40ucgb7h2eDSD4+9Eymu6a18WgsT/\n1pG+n7dFHoKRjPVqHOImpfCkJWG9T0kkBHgUV15/Hp6dYj9jRmKYYjClbYkM\nSGNQvxw3t8gPkVigbx5oKHn19lYKUdLlpFe/7t60V0XxmppK7seBJcSl0y1X\nVBN+XbVPML2VaayxOp0wp7dro2ZNtu8W2bw3JrSaJAieA1PjceT2lFG3igHu\nVQRmR5LGH9PhGnF7v3VCyTkWlDQkvAPxfuARLLrm0K6eE4DWGohbdgnFe/Bg\nHz00ndXikyfINsmuGE8ztBybO0wvETLc86cEF4dHxp11VugeV2ITbzxJZR02\nBkx9WzAmsNk/25bon1M3JUKK9XAGtYPKF8XM1/24nQ0UFBzDiV0hdOuxKa9K\nw5piU5qVx1H0XeoPGhaCh/iCnmBskaAQWNHKP6ZyiciM+MaLHygMzHl5DTwT\nawPnViB0lqOMVZjQTi4pE46AV6BjqrD/QEHjW5LSaG3Y8gdFvycF+KvFBI1V\n43XDO5wUBBbcRBC8TWkyVo9OKF3o7R+YHrYfBGLL3Tgc7WJ3R8oZu//7AqRf\ndcxjhZvpg5BN8hLYqlGmICC+t/YJx83gujs/1zC8BZZdctZw7vgpvuvgykIM\nivsF\r\n=zYoF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"10c0fa625726b502538aad152c3a4be5bf76f0f6","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-26T16:33:51.841Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.147","@balena/jellyfish-environment":"^5.1.23","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.415_1637944571470_0.3089956254879258","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.415-renovate-internal-patch-c46f858ea5faf8e1d38cd3ed9163b3adb11a6ea1":{"name":"@balena/jellyfish-metrics","version":"1.0.415-renovate-internal-patch-c46f858ea5faf8e1d38cd3ed9163b3adb11a6ea1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.415-renovate-internal-patch-c46f858ea5faf8e1d38cd3ed9163b3adb11a6ea1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b8ae1e382a6d18443820352ebcfcb82db4e87524","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.415-renovate-internal-patch-c46f858ea5faf8e1d38cd3ed9163b3adb11a6ea1.tgz","fileCount":16,"integrity":"sha512-ig0fLr27hJegElpKvW473u2LVWdLE4fV7H3vFRAdlyNJdG0eJJWkvyw/UkzcRUXD4bXXUj0F+1YPI+Zt9wsLvQ==","signatures":[{"sig":"MEYCIQCYLmb8J5HbwCWTqt0drhtLsPNQfL+qyn/D4TRXxW5d6QIhAJczDQTZ16LbzIN15qS3gMNmVrv8yPmJtcs+o1CabVQ2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":141905,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhoQ12CRA9TVsSAnZWagAA3mIQAKUmXNRc9rYPhqilhg5P\n8x932aN6lscMfwJDczgG6xfkoLLyNf/zUynrru64siNgCj7IumLRWIT7juTV\nkQLWCtD/8xVPezB2GTok6pKN4FwGslvsfo53Fytgkz1s+nfgiYSraUPBTlDx\nabt3+XN7NbW2uTlk4l1lQX8Omwwjp/e631ATCgpa1fif1sIQPkAd7gz5bPPk\nT5W5lpiTC1tUmkUdaKGz85DAtzhcfZep6CZnDb1s9kynUV7cdY9XG1HMbHqb\nVVgvvEX8w2IhyJ4527tj/47STVwqRxxQdZixi+a49Rav31c2Qi2SP6yCKYMu\n5FVvu/JvAFzreJB9Z1ZFkpNJ9tCBlIQMgdgRAV9zoWCw8x4rw2N4DxvWroS1\nye8dH/+WdBwO/enCANcH9pJqrH/ZtENmpj1Vc/c58sB0F7mtFkroMtt5GNc3\nS+mkYikfuXxFpUV0wEVcQctYCJ3NtI0wI8ZcIAnTmxHr/rjNmRaoXvpNKdIq\n4PLvWmYK/HGhWy0AGz+q4i/oJq0+ScLFtQuMb9iM7IqnUvZ14SXHmLkQ9tRl\nuqEpREINmbU6DZjoJhnT0B/+xx/msB5PPUcJEWXQS5ZCjiWvp10o7qKoHMJ3\nkjsSdMKkcG4EfUK+B3sYgkvmLzAa6E1ll6RuW9iRmleNh6LdecjiVxhS/oN+\n+Vbk\r\n=Jpxc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c46f858ea5faf8e1d38cd3ed9163b3adb11a6ea1","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-26T16:35:15.108Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.149","@balena/jellyfish-environment":"^5.1.24","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.415-renovate-internal-patch-c46f858ea5faf8e1d38cd3ed9163b3adb11a6ea1_1637944694526_0.005457787484270726","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.415-renovate-balena-jellyfish-config-2-x-7adccb3f000017cecbdceac1256acac256c3933a":{"name":"@balena/jellyfish-metrics","version":"1.0.415-renovate-balena-jellyfish-config-2-x-7adccb3f000017cecbdceac1256acac256c3933a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.415-renovate-balena-jellyfish-config-2-x-7adccb3f000017cecbdceac1256acac256c3933a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"dac8c683522da8101f8ed1ae57d01cebf2f23866","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.415-renovate-balena-jellyfish-config-2-x-7adccb3f000017cecbdceac1256acac256c3933a.tgz","fileCount":16,"integrity":"sha512-/TCheb707/vHn9awc7+JvZusCwKPyTVBWMUCGj8Xz1p1Fd3YmOtFeHs+LW+VAfUY3mj2H6gWMOpWcosTG/4tDQ==","signatures":[{"sig":"MEYCIQDOyHhVfCHNAOvQhthDdnOMTTOq0n6Jplg4OTrr/sUcSAIhANkv8cnGWp7/cO5/GtLJeB3OhaULYr5EW7yz4dZQwOMz","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":141945,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhoQ2bCRA9TVsSAnZWagAAo9AP/0tQT2qIjwqrrrxmInmw\nVFAaceeIEOoiBLrtwuTpPrVRuhkKg/x8hVJTe+B1gQ2z9UczOz7amG08exUG\n/wkkTQJzIeCrcuwZMdl0GMzgCPiH6u+C+1hYuWpGd4CwCpDglQtYdysIJDjS\n+ZvAVd1KI1KOzyuje4uslIcMVdlYuS50dpEOT0fDd/0LXqrRloWPOht4N+bv\nBKcgDa7SvmNahiDi46nJML63Nh2NYKaRh/4OmP8lrtxSGbijgAIs+n1xbruZ\nQ61Cet5TY5JBo96yzkiW7qYChZa+8gEm1cJw5pS4iTfwfRXfJFhzHUOflhzq\nj0EsuURrBbSqnn9CmrBUyfwBhhvFe7tpvi5dTIUjHBpWxiA+YccIbdTjaP4A\nnRkooS/y23r/yNnNeHc3KyQ7oX6edSRcopSy+xwiYx0aetrDgnJIt/tDvUdR\n9ux9XpJR6X5+NuPoVXT39SLPVPLbWpV0JaZ2s7SaV773bn7OqZ31S4SQctco\nUjwT7e7keckJJy8pIUD0nIvh257E0BC8n6Q2f/q0GjouR3N4pXBCDQong7YU\n1pei7jYQr9TSk5jkyNjXOjx9vrs0aQ0bgyu85ZE/hJyaoaSPIsg/HRPCw2a3\nS98c+R88qfTQLfrkRdiZW7syMErED0KF1eWpeYNfLY0BgGl2jr7Cb7BN+Cy/\nvkTw\r\n=CV8H\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7adccb3f000017cecbdceac1256acac256c3933a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-26T16:35:28.539Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.147","@balena/jellyfish-environment":"^5.1.23","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.415-renovate-balena-jellyfish-config-2-x-7adccb3f000017cecbdceac1256acac256c3933a_1637944731014_0.9461753747319377","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.416-renovate-internal-patch-40759677364d18df5443dce751f07082223857b5":{"name":"@balena/jellyfish-metrics","version":"1.0.416-renovate-internal-patch-40759677364d18df5443dce751f07082223857b5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.416-renovate-internal-patch-40759677364d18df5443dce751f07082223857b5","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a3005358758420f17f5dbf0ce3ed2f8cd334981c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.416-renovate-internal-patch-40759677364d18df5443dce751f07082223857b5.tgz","fileCount":16,"integrity":"sha512-qnXJI3L9XLxml54/YJ8spJ/aCHHcEDm4s4hmocFzL1+ziS4oF7ZeqtCfkq0ZfrI6qPztxg14ijrO2gp9yoeC4Q==","signatures":[{"sig":"MEYCIQCb4fG0fJ8y7ZAPZxkwYiEZRSS4HjTERI0+bV1mDw1euQIhAKP6vGuDjGNSrtwb76BxUDOfy6LMs3q5UbGqs/LU6lSm","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":141931,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhoQ4XCRA9TVsSAnZWagAApVEP/0Ha0qdVBTCOD8n2DjF+\nQf6wEdB9CDZVrxQLjYmfdF8DW/OGPOtG6j0kqz08bTMnxUoJiXHvRatUqIoN\nA6Gq1bsBfWGeWdZYAp5cqPm+9Sllev0LBIB+1K4daHXOB61VA+1DJbpAbJxV\n744SjoeTZTpqAtuBucFV24gdqvj7dvh7N227wVX3mMTSo0t+MNmtDCZOVi+I\nfJmg4zDn1wKyME1FNLh6VahBT5hIZmwjJmtQNbnfASLhW40JEeG1WS7cos9M\nJLXSLZBigTjsATkvfvOo3V2cberSUrRh8QKWuq+rmH1DC5R+rIgTb6VyiCKV\neuTbFsm7FN44+8HQGNUL77kVKs797QfjTdyjG4BiUJLwdgfqW5eeBGzUaERq\nj1m62szxT1Iuu76UWjWeboZ0t0RcKNW4+vKhQCQcZCKKsQz81aGiKxhzWYyu\nai7jXxtlJKy4U9l67/sRYY58rSAzYP8OkO9+4rHU1qWPslnnw0GWBvW6TFA/\nDq1Fo8ENlV1cxA2t4D1VjMxD4FNC3KlnhER9FqBmrjXkaUJNzwiafcfeFD+Z\nbYrXe8DnkqLWLV5kyBlNfQ0J1oX6NNC3Bdju7nhsDTdtuOEdLWVhE/7e00ob\ntCj8ijJ/o5YIXIDxHvxC1euxY8NZH47XWbrs+ll/9OEE5A0apIL1oqH1Krau\n0rA+\r\n=2T/4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"40759677364d18df5443dce751f07082223857b5","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-26T16:37:55.109Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.149","@balena/jellyfish-environment":"^5.1.24","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.416-renovate-internal-patch-40759677364d18df5443dce751f07082223857b5_1637944854949_0.2982560779321981","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.416-renovate-balena-jellyfish-config-2-x-d04990fedb7a076476c29ee448b5a937322b9737":{"name":"@balena/jellyfish-metrics","version":"1.0.416-renovate-balena-jellyfish-config-2-x-d04990fedb7a076476c29ee448b5a937322b9737","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.416-renovate-balena-jellyfish-config-2-x-d04990fedb7a076476c29ee448b5a937322b9737","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4f60c01a602fc6197b65f12d31e9209cb23bdbdc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.416-renovate-balena-jellyfish-config-2-x-d04990fedb7a076476c29ee448b5a937322b9737.tgz","fileCount":16,"integrity":"sha512-jp/W5fpeXDYK5Yx+hR4oXmr9x6F63tSn6KB0fiszT3UnYwRLk58OtY04DeJU1sfiH5tjGdRvtleN3/p5Bo/IJA==","signatures":[{"sig":"MEUCIQCf5/Rg6J9+W7oCknA5mzEyHfM5QyL0NfjwKgHQHIym0AIgRCm2f6NfCj9hgztUUDgoaWnAO0iWUpFeiyeGyoCHDyc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":141971,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhoQ5JCRA9TVsSAnZWagAAEFAP/2s/cxY6Oy08//nTnDTU\nQKsuQ1L8AqToprBJpZIBJwcWvoQrSb+55/A+LgIvcVib3ZeD7HyJ0Xp/TgGv\nWxzzeCHZFY00pA6dowWLFyk+I4RU7jo7gH0F9oL+FtTMzY49fDUcps9trTzV\n6J9kHFkkxu32ublwUitgNBned2dyiImAcdWeoqqBZPWRODGAIQTtLzNUGZg9\nG6HSH2meOegrD2lxigyEHUt601HbdIsxjR7VLjwR6hxLvY32u9YPafsYXQeU\n0433wJhER43k9WsWeh21NNyvZFftmNmi4iwlylsay9Qx2gpeHfLGttcNdiau\nvPz5xPOKmM3RrFxBqzNscX6fjyhXZ3qgFf2/fdKwHZGhz3d6U7q2y4zR/GCO\ncpC/PH+Gea7blCZzpN0NWXXnkf6uQZp4OFtTbXZZp4OkOizD/ngx+9G/e8Qm\nRKzeCYauJsMrbjgadWj037C7e6L2FtVFSkvqgD0Oq27cyUAnf06DctL40jXY\nzzhuGMDLqLffjaXSnSG2jkdRoa/QCFRyVYFupvlHaOnSVUjWTufchOWDs4gi\n7Z3rnh905m3E5dw1FnbPYADqg3pQNzGZr6EKjQnH+vAWdCXKsjml1zC93h+u\nU0p2HnTIzTqUhWGt9zI24tnh/0EqJ80z3+BVNQmz1CkfaMjJQZ9IDpRomSmZ\nyw5B\r\n=f6U/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d04990fedb7a076476c29ee448b5a937322b9737","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-26T16:39:03.449Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.147","@balena/jellyfish-environment":"^5.1.23","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.416-renovate-balena-jellyfish-config-2-x-d04990fedb7a076476c29ee448b5a937322b9737_1637944905023_0.7348509629270104","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.416":{"name":"@balena/jellyfish-metrics","version":"1.0.416","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.416","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7051a22261b051b6a45a5fca8e51c1cb47d4bd70","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.416.tgz","fileCount":16,"integrity":"sha512-AxaDcutfoXmXOw8F74JKJDjlEBM1Lavcq1el8O8P6Ftav/jvvK6E93MfwqMlWBLBRIDWNT/brq1HI7HmpHfvZQ==","signatures":[{"sig":"MEUCICL00SH54PfQNXY3OLD8W+oNU2dXMyp7ORJqG/yqjhZGAiEAqNnerAoOHEELOzFk7MRfgaQezAt7wgCgklETjrepaik=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":141866,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhoQ7zCRA9TVsSAnZWagAAWEYP/0UjpK7UGJ7u7atcwewG\niAskgwEhMZNnY0/O+7S+F1GU1ZLjZhNS0SAV/zlBMYuPUnvNo2XjjoTEKWoE\ngaWPPpp+293/MxSoKIQAvjSQ1uxdcdZwgbzKruSqMUJxkGFOctYekyYmHTL5\nleWAwP3t+sTBQw50LcRCnwlA64ntaDbI+f7dKxVp+LU9n4OxysldZVmZnDqj\nMPmWJgf7woHG99fzFKu8PKecvA5Z3kT9gUvQJxDq5NSi4E5ar1Jv68G9/srs\n9dnoWyHhslyv1LSzEK1NHDk9hxxco1RkdszfSQQRCOFoVcD1kKIA9g9Ufh5i\nIaMaQALJlfl/6Th8OgcsPcLBCAVVTke8Ph3rX3T3If9t2Nl7YpZw5NuyE8JA\nckt+6F5vQB9vRGllaScFkr0ysXarwAulCuEt4fk+aNjsw7Ha15tRZoTYM3sE\nuEn+GNRYxAYqoKNPdI4nV59BFG7PmhkVcM7d9ZmE1U93EAnq2+ZBNmEzb9u/\nTBo+XkP2sfNxwjdgeYPb9ubU7UbfKRDmink2wHFEo+vn4dHRI6lWy5OTZF6M\njCfS/EuMHqDc9dpH2HQykgI9sGtbT0sIb649l+ZPXcELsReDFSg5e3addjnp\n/4XFH0mi6JUjIs13VgoA1lXIwKPzYjIlrQCdnzlkkrhBYC7tNKyRtzc2SRnJ\n2e6o\r\n=1QrN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b5f398e47c795d3f22bb4d7b5c0ecb29334f99b9","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-26T16:42:27.812Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.149","@balena/jellyfish-environment":"^5.1.24","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.416_1637945074881_0.4449582492474349","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.417-renovate-balena-jellyfish-config-2-x-2c48a10d793b15c241dc64029a2ee812bd4769e9":{"name":"@balena/jellyfish-metrics","version":"1.0.417-renovate-balena-jellyfish-config-2-x-2c48a10d793b15c241dc64029a2ee812bd4769e9","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.417-renovate-balena-jellyfish-config-2-x-2c48a10d793b15c241dc64029a2ee812bd4769e9","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d07388e706137f60cb4531d26102ed866ea98eba","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.417-renovate-balena-jellyfish-config-2-x-2c48a10d793b15c241dc64029a2ee812bd4769e9.tgz","fileCount":16,"integrity":"sha512-AXEEhEY6pUtrVQHA098AK/LDCSUElGSdHAU5m2fZNp06X73htCJxV6uRkVq3am9fR5rJaCg/LjeIhrY4PJ2pMw==","signatures":[{"sig":"MEUCIQCVntS/zFDNJ6Oe1hb7byZWlwIb/BfL1mhJaz1ZwYEUBAIgSTvNRMntpXJANyF2XBB1i1EEc/Z5Kz1+XyKLH5PnNH0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":142043,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhoQ9lCRA9TVsSAnZWagAAEKoP/2R10qCTxSQjGyp/38Dw\n3x2kAuUMstDjMVpJalZJ0C9o3Fpa5rFIRW7Qe12K44r2rkY8zeI8Cmq4c8HJ\n2kfMo6XCIjQSwXCsRXMs4CXkLfuokDNiO7j/ckyuSmiSfLAYyQlR3TVs440M\nn4uBsgqyQbxvIXWThdfUjJN75kIXJNxFFOVHZ8YhItVNtIe68dbvfPqZWCc8\npYzB39IpYuQcUuC/1+LwicGKjIuMC9sBSFjSiqRAxScl+sAWBdw5bkFkr2Fj\nrzUcLCVF1gqc0NsvpBu9yMV5tclLLcmKlvD5QokW85bdvRVvHZhJBr1I9SeK\nLChZtjH/DnsILKBqIvIGTBZARy3DrhafQLrh9keMuJNo1pVM+koN8soVoQID\n9zS0eJdI4L87ZJazQK0Z1VRrKs+4dBiljm/1AWZBfCC0to6lNeFZZzIz797k\nJzXudkTaB5083WETwWtSvP4q6BrtoPFnM3G6i8DwqaFP4dl4fhM0cwXt57dM\n9wAo/7IcLGDaRhlabdIqHeMOznxduEwWAoV8h/fURDGVW2gpR9yDoIp9gjLZ\nAbn1+UwSXOIUEjYo2ieNHN7zye0l2hFkMwWSMR1duaURzuPMG9rYeXNLHx6Z\nkGUJ8Swtjvo4rwT9mKx0w3DXCKUfgwTS459G8vLW7Gj3T6YHBb38d48aS/lA\nc6Mg\r\n=yfHB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2c48a10d793b15c241dc64029a2ee812bd4769e9","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-26T16:44:13.237Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.149","@balena/jellyfish-environment":"^5.1.24","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.417-renovate-balena-jellyfish-config-2-x-2c48a10d793b15c241dc64029a2ee812bd4769e9_1637945189536_0.026409519645255175","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.417-renovate-internal-patch-d3bcbaf6c29758667b451c7af47061eb64a9c1c0":{"name":"@balena/jellyfish-metrics","version":"1.0.417-renovate-internal-patch-d3bcbaf6c29758667b451c7af47061eb64a9c1c0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.417-renovate-internal-patch-d3bcbaf6c29758667b451c7af47061eb64a9c1c0","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ca7d7287a5f24d7880829f1a49cc9e1ad07cbc0f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.417-renovate-internal-patch-d3bcbaf6c29758667b451c7af47061eb64a9c1c0.tgz","fileCount":16,"integrity":"sha512-7y+itLq+0noXkXALQWF/U6NC0RiYF4mxb+K09Tm7OiigFnlqdJhxqS1exKPeCzeANgM1KovOyCuhK+lMcPNJYA==","signatures":[{"sig":"MEYCIQDP+fhjbh8+fOW8ctoAPVYZgl2OmmfEabxQuydTQpxT0AIhANta716UunRXd07gmJRt0C3yuLPRD/GkgXHNFXb4zKpW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":142003,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhoS9bCRA9TVsSAnZWagAAW3IP/1uhyUwAVnzAmBwDY2w1\nXmcv1kLS6Cj5mq2zeSHaZ2zDxfq+tbSmH+xgx4klp+uLoOyE3EXNrKxLYGc9\nvxsoInGRECyFH4hyx14DHpkHkiA/tgcstfVNe1McOmRKcKH0YnUHFc09xkEq\ncx5Ty0kClnEwC/T4I+ynd0jPHGS4jJsXfP8PPJXLQq+WYd3eehCmAXeKoyLz\nvxBRXOCiLb6MmnUcShpkjl9ADLSYlpMDhxLIVoEbwEZ87zGqdeymTuLGIhTP\nxaz5fZWmAU261kiQcECJLGP8hG2vTY1kx/BqtgkKN0wgwPscKlm3SBBgxX5U\npeVMONChxt9XMSv2mTYxfDL+DvlFJIiDVyg5KNBN57VJ1AR6yn0xMkVZxu7g\nCO9GIJRZabWSO2xXO2rg1Kw5fa7+3IjaQN6ODRTjta0PAyixL1EnK97qFHrf\n10kLxldSux52ENOYdcgLFQZEe1usM1QfCghYLRhxeNBmfNUtWUTnZFaZR77i\n/yvCJYvBPquNQBSm/FqkeP3C7fTHS7g3vA7j/+4e6YoJIQCybVD45NHWSU15\nt81WaGjMDtjJ3JkJH1wpAzZ7FO6YkyVPTfb0LhXPN3Lpdty4vS1xZukMQ6ts\nNb1wd+T/m927+/I8x2UVnUL0SbVWv4wUl/merZTUawO1MZUmMuwIwcmDGUjs\nNZs5\r\n=rlVz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d3bcbaf6c29758667b451c7af47061eb64a9c1c0","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-26T19:00:29.678Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.151","@balena/jellyfish-environment":"^5.1.25","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.417-renovate-internal-patch-d3bcbaf6c29758667b451c7af47061eb64a9c1c0_1637953371024_0.22734368821076645","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.417":{"name":"@balena/jellyfish-metrics","version":"1.0.417","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.417","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0a0a8e30bcd3fa6a52f12640c87b514dcf4487b0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.417.tgz","fileCount":16,"integrity":"sha512-NReM3Zz2asn6pZ5C95SXkLsUUhPC3pGeaXqSM1ytkD0dlNK2eSiRUsMQY33NL6NqQ39Iok9ar0VVwfvb0POmXQ==","signatures":[{"sig":"MEUCIEJ72SmhCcDdnZfrc8JLm73JbvJm7Vag4Agp0BC0Avf5AiEAr29IubbRlp479vQ1a++MEOjiHtBvmNQN0WVKayF17bU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":141938,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhoTBKCRA9TVsSAnZWagAAQzUP/2hiaxoVPt4j+0ewWXmI\n+FT96WRrkeIg7V6YO0Ztn2oAuLxIHgq/JqPg5MUzx8jDi3nQ0gNG2RtoVTUj\nxZT2Q6QeLF42hsZcdeyhkmsPABmNblT8TWCYDDu+NCi4MIbckot9xuobo3iB\nkFHZ86+GJDSIm3TalgN3C8fbmmdXUrMgmybSt4tLxhfDfYg9LHJoh41StTt9\n5BjiAegUMGulIdXfWFIpD5SVxcO9hUs/hJ6Vhi0CgjxSER4RoQc30TXoIh+s\nhSe5KXLikTpsm+thVZuVQ3HIZy4s4YfepQS6WUiNd1IzXILxx+LXZmTqTr0t\n6Od16IoWNFTPBKiBWn0CjQYOHpUcxMbObnac3LduFD0P9N5xLvMj0+jMiV09\n4qSsNOkj+fM14pBm7QqQmdyWN9RkuRbCuzHtZABOELUrpBWR0Xp513V7nr3W\nM7uRkpuy73ichmyhPvBSvshl7jxPcY72QHlPS20OJfNNwnJPzL6W9Km+L0NS\nHpQK7YhSjHHRnfRm+0vBQQhXpVuUSXXKNtMbpiH4i4f6R+lOujz/7USjc6Kx\nZSRaFv7oLRw2HmgmhsMcUOzikpmlzaOQbH9dEX7TZWiGZ7VtwQnuRqsIEJm/\nFkflNx4191gWerVqudA03AMyv3ZL401y4Uo3idnoSqCrr8wNbj6O2uwxIjx7\nkZrG\r\n=eWgY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"758ea26354da75d231adcfbc8034b1993eca0ec4","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-26T19:04:34.913Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.151","@balena/jellyfish-environment":"^5.1.25","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.417_1637953609818_0.010282390413302256","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.418-renovate-balena-jellyfish-config-2-x-74efcea01e0587da7d02ff61ac2f5a5b2d18865b":{"name":"@balena/jellyfish-metrics","version":"1.0.418-renovate-balena-jellyfish-config-2-x-74efcea01e0587da7d02ff61ac2f5a5b2d18865b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.418-renovate-balena-jellyfish-config-2-x-74efcea01e0587da7d02ff61ac2f5a5b2d18865b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ebf0c6c97066e8a160a9054e0c363fe3118e076e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.418-renovate-balena-jellyfish-config-2-x-74efcea01e0587da7d02ff61ac2f5a5b2d18865b.tgz","fileCount":16,"integrity":"sha512-xVydekaGCw3o38v1eRkJP/9fNEOT/IOmQNzFjxdnenLi+K+w1zKb3WM140Rjh+N6Vxs7u0MfFU+s6UyVpmaigQ==","signatures":[{"sig":"MEUCIQCq88A/qM7TpKZXHXHI8w/ok7Qad2cMekR9Mh1bek/jSwIgCr0nfOfuXxSexfDU6VXFZc+PtwP1sz634ZANtQpC34Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":142115,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhoTFcCRA9TVsSAnZWagAAi8YP/jUk/w+SwlOzIXZ+fdCy\nLqwrHaSZ5BOtRDWK13k0a7avnbmaGnAfKG7jCgK4Yq3Sn6GecQxlCeQNVSWT\nBLHGgkW5EUFxf1pXLMQcEhHwJyGMZC5Wp5LfIUuyn5fNZULJk8rkXAaJc8Jx\nm6NAVEKuuKK2ZFlqDLuRevoff17nPszziJFS3b+RHNCaWD1vQZebVPsmO3UU\nYGsXDcpyiUEQL+NIKn/shAplcHuNMzkXmtp7SLPbdGsGfNODJ16zR00gI4ck\naFwwU8f/onxl1DMldbg+a0krjE1/aDzEZkKcSt0RSKyYRfX3iEZol7iBWWX1\nQb26JyhRAsazsWKhXkyj+ttoRv8w2TaBVWgkrGWY7tKSiMLHfzWXfUeuXmt4\ntcXGJY0M3px7KSdpqHRG4LKHYNaqD/6sNisKwntRcTHSWsk+HWCLDxkWq5Qo\nMDaVE9ThHfRwkv3UMgb0BW50J8QwszyZApvx3cDKfdkRUV/WDyUpfFsIv5el\nC4X0v2kFHC35TpYpWjZR3wYJwe6NJ2VzOkKPFEcLz72QaaAzf7+Kc5Micj0x\ni81XdG6TReD+Qbk91Q+JWO9AdRxqI6kL2v9mIkJgqaaNQgjQn5T0GfJoy3Ed\nS6s6UFTWIe2DyzV1Ms2BeCN1cOqYhJpIBIwauJVbxe96YqtcF+0ct81QPAnx\n1LD5\r\n=vbYo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"74efcea01e0587da7d02ff61ac2f5a5b2d18865b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-26T19:08:30.417Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.151","@balena/jellyfish-environment":"^5.1.25","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.418-renovate-balena-jellyfish-config-2-x-74efcea01e0587da7d02ff61ac2f5a5b2d18865b_1637953884475_0.273817292302138","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.418-renovate-internal-patch-6cbd57cc30740bba0757e587c38d17189953fdff":{"name":"@balena/jellyfish-metrics","version":"1.0.418-renovate-internal-patch-6cbd57cc30740bba0757e587c38d17189953fdff","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.418-renovate-internal-patch-6cbd57cc30740bba0757e587c38d17189953fdff","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cbb87497224400fe8ca96f01fc67aaa85c04d898","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.418-renovate-internal-patch-6cbd57cc30740bba0757e587c38d17189953fdff.tgz","fileCount":16,"integrity":"sha512-KSgT9KcgOvxRcnI7hwpOCJbyYbqEtc9dMojEf0BCPUhYW1qKUOWiebgZQPHqGdIE8TONqEpAwwJreIcwIoWWeQ==","signatures":[{"sig":"MEYCIQDrfGKWYqDyhL8Da4g9hwnT1TKNrmAyVbwzZaSx5PBZTQIhAI+LmFDI+4nkQyqwoonZbrhepDhT63CAHkuYxi8WrjvY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":142108,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhoZcxCRA9TVsSAnZWagAAzKkP/03IOqINON18KcblyFqu\nukQAgQtc59nyBsa9Y+kj8GhsSggAa4HJsCYFvaOjBo50EvvUp+aiiAk1URyo\nDatBOpXoMi0Z3NYUfHcvBehrzqr6CHnFoxyQGhMl4Es42qE7oRS+SNqpdbaU\nU5tBI4YgZbUbed5Pb01JRxpGOGfDGhKwQhkmmuWlbQOa6SDKwEujr28JhTaW\nCVFgMqZYp7pul8sgMNrm/AUl5VOFkYGjdi7ilDMWrQDEi8ygNkZPx7BIJvyi\nWt5+yzDCKfbIoDqxFpozeFVFqAbj9fZjk6Qh0ftr+SneFxYh/pzr1flO2IqG\n/M1EmlftXcQanw5d2uW1bZiyABkBbwn4NI3Q7Xn9GzmEcwGw8m8dWMpfnRTW\nzfy4Go95wF70jCUePVa3lQsl594K6fk3FbZnTjOyHUuQgJwzWqnKe0CYKUiJ\nhz2Kg0BrMKU1SxeN5EkbWvHgJZgcAi49EwM4vQwha639MJOLjbbIdTftJeNo\nDqArM980PfekV7xRVWbfvOZbTUOD1GbyprZr7McJOMqlgxvu/LxHA33AtDn4\nNKDfUj1lAMn2ymcCmV7slZLJCkxqrEJWPw3S8AIrVykrO04Wd763guL+DC9f\nKQRuyenMpWBZBz2pSYqe4PBTeLu6M+o1JM/pb5SFNhlZTX6BAeEkkTlk0TW1\ndP/y\r\n=yuiN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6cbd57cc30740bba0757e587c38d17189953fdff","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-27T02:22:12.906Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.152","@balena/jellyfish-environment":"^5.1.25","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.418-renovate-internal-patch-6cbd57cc30740bba0757e587c38d17189953fdff_1637979953061_0.9115323243235285","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.418-renovate-balena-jellyfish-config-2-x-ad664e6fb44d4b56c216fcd6fdfe413d0fbf3070":{"name":"@balena/jellyfish-metrics","version":"1.0.418-renovate-balena-jellyfish-config-2-x-ad664e6fb44d4b56c216fcd6fdfe413d0fbf3070","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.418-renovate-balena-jellyfish-config-2-x-ad664e6fb44d4b56c216fcd6fdfe413d0fbf3070","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6e12f83d98521a5ef50e05d7a7c483e26d592692","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.418-renovate-balena-jellyfish-config-2-x-ad664e6fb44d4b56c216fcd6fdfe413d0fbf3070.tgz","fileCount":16,"integrity":"sha512-+myvflE6cTyNLcjXvZNrGW0UT8CaChdFuHQCrO6Myn+tnlQcojdGnqCxTYzSV5OQRW/Y+r4OuF3vOCuSx953mA==","signatures":[{"sig":"MEQCIAE9ev5kCy0cmlYIHqybiIMPKEgTzOi5Hz/wOS9RBdbWAiApw0+1zWTmlgjz9UPt4Jhafa2eff78eGnAGHakQe+cnA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":142115,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhoZeSCRA9TVsSAnZWagAAFbYP/2ZdvRSAmwlCmn612wjU\n3aHvsOG9Oh6Gife83RgE280vBhTiMNVSjj3hfP8Dgy9thIaGfvjYMCLKi1LY\nz+x+t4pFY58hfzBBzrVDZV7PaApQ0FL/lL1V1mOitL9qsBWCxYKGVV0XQpWu\n2TUg4xGZr9EH0GxGI5I4HnwnU4vR5rX1hhtCxjRRDVwZH4kkbUOm18+CjYHB\nkgUEYXw33zP8JtLfsBCGHkcKf1w+6vi6lmuJXAXMJXJIDCQ0EzJKYZYaMdBv\nmUixZt+eui9E8IAQT0Mu2iUUtWQtxv9m7WFGa7cMk7floo4kSkQb0WHIz7kF\nkeAf97427oAHgOpAODlbkDs8c4KGFHLusxX3lMTXb8qu6jroa2SM3DHtlnRE\noBgQGeUB2EwwcynCJYYmIhSZjAnYgsY8dLH29na94YbMj3CDVc6qH5BE4IPE\nXA18+f7hZwlj48msdEb8uUbq2tytZKlnc/jgiksBh5IpRW/+V8mKchvegX5Y\nDLkSLIwPMI8W5ervYMfkyWuhuHm/yLn6MVycQxgH1fhp5puZZ+pvhUF5d+uO\n2omuOM3k2RdHwic2DuZTKBgVjKYW38haRrr0U9y5HbF3gX5S3lzv4POM+n+k\nbjLLz5Rkwly7clhc4KQvx2E4gLqbVHIrJPylypkkA3M3XOcuAJPMxuQrfkFR\nQuTB\r\n=e+dG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ad664e6fb44d4b56c216fcd6fdfe413d0fbf3070","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-27T02:23:09.800Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.151","@balena/jellyfish-environment":"^5.1.25","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.418-renovate-balena-jellyfish-config-2-x-ad664e6fb44d4b56c216fcd6fdfe413d0fbf3070_1637980049644_0.5309425371222756","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.418":{"name":"@balena/jellyfish-metrics","version":"1.0.418","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.418","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6ddd233ef954e815062e6ed985857721932b3d8f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.418.tgz","fileCount":16,"integrity":"sha512-d4ehZ7Dy7CaU+PxfD1i5aceNGV6Z5O9IkDaH3G0J+uTHOCpz3i17hg+3e6Sy/uUhI+QaEwG459FEs8qFRwA8tA==","signatures":[{"sig":"MEYCIQDck4q+7gm5ahouSTzqIinXJKkN3t+bwH7Lp2+vEBOX9AIhAP38FqeH+/xELb1eAmIAz9jNhddt3Se6/0ULIH3cG/zS","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":142043,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhoZf0CRA9TVsSAnZWagAAHPAP/07ZMMYiQv9XSofv97Px\niQ/BWvjsRdXCGgzhcjp9L/FoxnDgA1y17JAMp6VnXWL1mwDnu2xhtcnTL/lA\nTWqS9jeFY3hUd1C5hLC/6ExESuwF68MVOvZ+cTfM72RcoTobt1kQd+qLFKtp\nsrO6nB/6umMB444II7uXcXD6RlozxNu/rLCEXELtrseqN0kVYbT/DenfjjvR\n7j+aF2Q+0jGjU9Af6t8vGzQzBepfL0JkwfouFY1mzCjcyI1AWPpZlU498j2v\nb289KiXkWplTmmdV24lHzymh8Zq59tbJd/67C3ifxUylgEOzCovuYTAXmoPy\nROkWPFETMpj48XJw45jM8q756utGn3sJ064RaeT3XDZynwU8WY8StCB/92SI\nX9xRrDkDsFYG+UEUqb3/MsuvDI6bVuQsGqGbN5H/jIIMmBrt+WwqwzZ0gOeC\nJe87gkUVcSmgrGRUTOAAnMENNweXyrcdsWjY+jPzs3w7VrYgiONAqWAS3Sf2\nzPvuDLjRjpfsKlviDTwLENhvUxhWLGwdYIe2XZfDNd2NPtWDYZTQbX36EiZ0\n+pYpVqANjomQaTEy1QHT8jgRKJ8ZSFdst4y2RZX/eoRZkFkCZlOpBQAZxMP8\n5NYDePi41ekG/hXDwOKkHUe5BmodRfkKefEsXudXZVf8KDLQ3NGPGIGhbZx7\nVf/R\r\n=8aBs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0da9c72a223c0f823a98955728cbb4c26a3a2c3b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-27T02:26:44.597Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.152","@balena/jellyfish-environment":"^5.1.25","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^1.5.4"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.418_1637980148038_0.5360477066047042","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.419-renovate-balena-jellyfish-config-2-x-78364b062c41b63444fc73d1540b0bcf6d59fc3b":{"name":"@balena/jellyfish-metrics","version":"1.0.419-renovate-balena-jellyfish-config-2-x-78364b062c41b63444fc73d1540b0bcf6d59fc3b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.419-renovate-balena-jellyfish-config-2-x-78364b062c41b63444fc73d1540b0bcf6d59fc3b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"243299d3a80734e7e0846061acfc8d19344222cd","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.419-renovate-balena-jellyfish-config-2-x-78364b062c41b63444fc73d1540b0bcf6d59fc3b.tgz","fileCount":16,"integrity":"sha512-QFXrPJRQ/9ec5NykMje7dtTpgwFLOWUcURWtBLu+T6m+c73oD7qzZYkXUNq7+m3bNGlGJxiAZPxGmZFLTECkhA==","signatures":[{"sig":"MEQCIHtSaeyvLwaosPVd2gTwCmMa6EP8OfWmX5Lwyea1lkVmAiB9qRrMtg+LorG37o2L9SxT2STeTtMABkTduIeshQ383Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":142220,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhoZkBCRA9TVsSAnZWagAAxKAP/iQTyN3xdKjUBkbsBhuq\nkaX/N3MI66QyEIwHeZ+74KYoMBuRm/4L44JPtyUPeTERhgloORbQnuK412b5\ns9zA2/sY1yRcEa9TEQ36GsTvq506WtbTemVrE+sbDPYRvbL5icUeT0V3rzfx\n+cCMBTuFX6u5HrX3/Sdlo4n3895Qvbr4nXim+Qz58Oc14O3MPbbUpzWf216u\nlZcybMqTLkoRWcw7rU69UuBMl3er9F2zINhVXDvM84yvTa9suLxLXuHmzaEJ\nWkdWWmZtKy0LhjgKQlpMKguavn6qQCNbkwWkuts/vLmwu8iepe7Soe38M0BH\npelPcJNugSQ1boJhzey8Cih3qCHLcNSntZbofx5GGx3x84p8ZM66t79dq8Yx\nHUmvNdf9V8QFNEjjtyj94Y/nJsm1/S0HGAq2ti47GEB6qkz6f/UwrdpAC9o7\nOxFnptQ4lqPdvbvFfNhPRLLHR9Nvu2ANfxUoo8w15fmQm4Kirz9Z33XrCBN7\nlpoUTix8u1yl6v8SVgZ536plRzI2YUQXWUM8HdnYlFPsBpSIyO38xhTA0hvP\n2qGr2jd4OewOiBf3bSG7Yka3tBGG6UceAYbC4C/TdG8BHEWqwdrnpCd3vVd7\npXv46LmYTKEumw4ufwvfIv5Uy4x30oW3HLutQe9ggch3vq9UIskEUwtiBj2U\nJr7a\r\n=AJkf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"78364b062c41b63444fc73d1540b0bcf6d59fc3b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-27T02:30:57.676Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.152","@balena/jellyfish-environment":"^5.1.25","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.9","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.419-renovate-balena-jellyfish-config-2-x-78364b062c41b63444fc73d1540b0bcf6d59fc3b_1637980416867_0.9633407294025058","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.419-renovate-external-non-major-e2148f175287ca0c13402eb9de5d8b15dbc9f143":{"name":"@balena/jellyfish-metrics","version":"1.0.419-renovate-external-non-major-e2148f175287ca0c13402eb9de5d8b15dbc9f143","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.419-renovate-external-non-major-e2148f175287ca0c13402eb9de5d8b15dbc9f143","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6ac5766462bc9cf5faa389c1afc7a8104bb90634","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.419-renovate-external-non-major-e2148f175287ca0c13402eb9de5d8b15dbc9f143.tgz","fileCount":16,"integrity":"sha512-rE7mznO5FzwCtkJWGVsMOLinfprFEt1QzPrpnnzudP2KE5OLnAqdXxIaFySm2EadBZrAjoLjL/I3iWD0qPjViQ==","signatures":[{"sig":"MEUCIAWav9VJ80o1AMX8cH56Kbelv9Mn/VDdSs5kq7zY/b2IAiEA/FnfTEQOS9kMKHH8VqZcRPMJLz2zCnML+U9j2AuYdcc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":142279,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhokR/CRA9TVsSAnZWagAAcUMP/A3EsxTzvkO51KYYsJFN\n61HTB/ITQWTUlDf3DZuky56jR1Rf6CpJ66fOsWZrLSFO1xliDq+xjYGCDLhI\nVioYOi0jjYy7cvWotfAfmMxet3uGkm8AXQdAY/YgPnrxhlwYe40eFwMFM5PT\nTexJT9fNkm94bs6AXnlJbwiYVPsj2ZsZcK/OeNxFht//Sdnao9n6BvhMMtBh\n1YpoXnLrXLfgc+3YexaDNmhJ3lIv8ypSm3UU+l18ZKwWA6Z3SNUdBXwItsLA\nib9UyAPHN5D7QdT6oKbEUX3mMTLQ51NZ3YQrZGrvYdQBzj3qySjSkn3Kntx1\ndGHKz98xS0J6zx4mhPEa3M7HdNUASBTAODPPGTjHSr+ZyG3OvWqrvswLz75Y\nbJ+bPdQrzdFoh2U3R0gT802teq0HuDhvb+e/9byIlNs9PLQqtpdol0x1clyj\n4XQm9zr9LTLSgxf3U4yXpnUx6s0qILZiarIVWNPn8kDx7eOuiE3yzR7mOfcQ\nB6m7J4d2a2EeGC/L0t3Tey2nn4bWajhL1mloo2On2cl/NKEQknlvOFsaV7JW\nl1swz0N6gWdWH/nL5E8S+P4z8bNs2jALHYeyZ5uZG/Q3CQhA1BPHc8InzU4D\nvGfIi8yOQDQiMMfzm1i8S7t7nRqTUivRyYG8V4BaZxRXD4+BQFT9J3VFdHRL\nUF/r\r\n=SLt9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e2148f175287ca0c13402eb9de5d8b15dbc9f143","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-27T14:41:48.588Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.152","@balena/jellyfish-environment":"^5.1.25","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.10","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.419-renovate-external-non-major-e2148f175287ca0c13402eb9de5d8b15dbc9f143_1638024319073_0.36490193918794445","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.419":{"name":"@balena/jellyfish-metrics","version":"1.0.419","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.419","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5c559449fef34bd5c7e67ab60d3323780244b82e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.419.tgz","fileCount":16,"integrity":"sha512-LfqYGiFUYxy9VjvZI9XX1bTMp46Iot04jxbPU3cgtGKf+w5SeSJb/kfCdOoE3xbuRopJQgyO7nD6sMHyzECH3g==","signatures":[{"sig":"MEUCIQCiVhixeewvhrANvssR5f0cYajMV0e9kZktZIvsgXqF7QIgL3fim59ueDpomHBAmB7KMsxS78OWjXmqEqAq/5g2clI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":142210,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhokWGCRA9TVsSAnZWagAA1vcP/jjeEA5TwFPeAGfRwdPN\nO1ZI9XWsXXAFmHC3aloItzh/Y1q4Yi8aJGdnJEfJQx/khiFTPKiEEWax9cq9\nMyX7ZdRvwpUHZ3myl9Y6Nj1WWTJvAi1CZWEFJ6gKAd2iMJHjZE4feOaSYrtp\nlI9dQVcVSzFzG2qdGHZa1/BgPqYt2SY9ccoHGPKgKVf/nJ+OjEsz69ilpsq1\nKWycbKNqIGA6hxYgVSqE3TbeXX2ONTbY5U9KokjVryfKZyh0W7goHXR5tvKb\nmsOnNwWjTjm4vVtThE/yv9E1WjlNxyrKBdxVRBGyEzfByj4YbhqbH9q5qDmV\nZ6kQ4S6pAczv/qHo0PyMeh5LoqPXZAPfw1vTpPA785o/zOZ10btXYLbbdJKJ\nyDkgS5vzS2hXwSJ0oAcnnaRtN5rnhGe+DbeZxZUlRR/zKM+yNzXLyzc18o5L\ndHaaL2yoah3hz0PP1SAW+yB5K3zcObXDOcYXX9E+pW5hhnsmL2NRVwsLraBG\nXfaax9PFCys+hyk7IlSUjBIDVc8M5iAlpbDR12c+djW1mDEiIdOiZKlVZ88U\nPOl+qzFppPyvMyKwI1rxsE37/jyvftu6QVo9ixO1j9w64nJjwE0oQ8zjKBhN\nr3Okkbd2uqjvSSIiJspHii4a0y6ZoiCKUF884rmCz+pOrPQ+ggBRo1HUX94p\nyTHT\r\n=wX7D\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"20e6986e9e0e9547683e5256888fda7d755cad45","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-27T14:47:07.390Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.152","@balena/jellyfish-environment":"^5.1.25","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.10","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.419_1638024582213_0.5198300495301569","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.420-renovate-internal-patch-c12c0ae5dafebea6ca23744208163f3d8b08f2ae":{"name":"@balena/jellyfish-metrics","version":"1.0.420-renovate-internal-patch-c12c0ae5dafebea6ca23744208163f3d8b08f2ae","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.420-renovate-internal-patch-c12c0ae5dafebea6ca23744208163f3d8b08f2ae","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5297a5b25702cfb22410e8013154d31783ea575a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.420-renovate-internal-patch-c12c0ae5dafebea6ca23744208163f3d8b08f2ae.tgz","fileCount":16,"integrity":"sha512-9e8D3tmhx5SkWPgPGC7bH4WlISMWY2Z0AeJ98NhVUNfcNDLydG8hp99LQxukDSTly16J+KkQ2f3ReMfD268zmQ==","signatures":[{"sig":"MEUCIQDjvzrIk3f8VvY5bIc2u4JxueIhEbFHQJ8NlOkJ8CnkfQIgNK5lxUcip2w117Ma2MfkgCDDnZDjJo/YqDcCR8kB/+0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":142347,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhokaMCRA9TVsSAnZWagAAp64P/jRfp0tlKNZnSRcowQ13\nvdsQZaQwsDv9rP4fM3yYyhFLdH0hG7UILXeJR0vyvRHJw7j2sL1JT9BprmSq\nsgXJm8nLY761TvyexfpjxwYlaxIxJsvyXy4QssHULLqNAb4HBbIvyylNHPVK\nFHcacaX2gPl+BU50iYF2utnCHFh7dZMG9Dpya4H/nXquyRNcPBFohW3OmR6D\nvRXvCAzs2DSm10dyRNeDWarnWXdOMeF3aPovv5o0ANJnQ4sCw08h2A1YJMod\nV23Q1SGyFtzLWfSIRUHEc7y1kRHUFYzRe3aX/858yd8K1Sqn+tgs8t3c2lxu\nAYks+oTlCZeO4aTwM4soJj3TGWwCcQEuqE1NWpzFZE0FYLGY8UbKSJNgM1kn\neOHJ2WxIT7xjtm+cLCdlqRD+eck0TI47/XsW7xIx+hgpg47KPqu48SRAzp4N\nTxlPtgKrx6IjCsb8bJXouflVAv7c6PYp1Slm+PIKO5VhfuHdnV4Bwxt2m0kf\nkw7t7OOSwzimTxfa7kD02p0vklVoP3s7n8DDlAo0OHPLWgQBpYgLxLHw8vyd\nDCdY2ESBSJgsPiF1QDbqt+AFpVGPIRRFvpbJ3F5gPU/e5jaQVOgO8n5vprt6\nyYzWMgzVeiiNGGIoRcox/HUINJa5C0idbPnB9X6xqhgw4mHnXLGTNptCwk5g\n+UY1\r\n=UD3Q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c12c0ae5dafebea6ca23744208163f3d8b08f2ae","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-27T14:48:59.040Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.153","@balena/jellyfish-environment":"^5.1.26","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.10","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.420-renovate-internal-patch-c12c0ae5dafebea6ca23744208163f3d8b08f2ae_1638024844752_0.7092065976629509","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.420":{"name":"@balena/jellyfish-metrics","version":"1.0.420","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.420","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5652588e09c32a809598484cb68eaadfee5fce1a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.420.tgz","fileCount":16,"integrity":"sha512-pXgwymesXFqrLTm3+rMXsNPynY5qCliwgqbi9OqRyyx1ONYF9d+lTUflg5a0mdWmueqfJEOw+cSrQcVlLVgPOg==","signatures":[{"sig":"MEUCIAGcu32hUA6d0RzEGK4wPfusmXTpWUmdfaatCoPmeVvbAiEAnGAjzFi2cvMjTBplafFcD/Jp7nGGMIBcDWmue/jERd8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":142282,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhokgECRA9TVsSAnZWagAASFIP/292zCZREzq7zFu3sAOl\nTXMRbm2miqo/H6lKBGLgRmeBeKzhDIGxSnDTCgnI3DzcDPh1Kh9tQ1/xcLsK\nK+uqi/bv1tY3uEFdedsQw7xvqko4LMJcembJY6NbOyDN7DdE5s5qyF68dG1q\nGmIWYxDIKf6EQ1VJpiFlAcJB5KT30zw619EOgO58zCHIHbYTWpkL9BozDEEv\npbNDzdvCvbSlkkAH2A/reLmaFN5xrUNTcVKEAkJM1gJoZdt3BTuATCRFJPvc\nIgXPgFYM3erVHEKAJGnlv0+WMBTZzF+wZFJkdr8fisxBqHTBp4qlzWKoY6vm\nwIU/aLAR055Ri1W0vF8tEGFvP8D3Q7EyjEfc1yr3uxSxw72+XeWywGeq15cH\n4oXWcoBME8AYWKGb0aLuAYz4Q83RgN2ez+fJERF/i+uKSfTzw44Wa0j9Gr8/\nanzUSywCdLuXxSzrqeDVeDORQtEj0mWFeD8qNzp1re/vcjXtUkIRLHDJeAwf\nF0f1yc6daORwAh73c4eZ9FYJuMUjmfCdJlgtJQcJBewhz4apVxeZaYFiD82n\n+oBIOWDLfX4Peq1C0//E0j19w5Lh5e08fky3U0/dTHy5fUNirmezq0g0cgPB\njssRlfZPA2Lcm7aoX/O4Dqv8zmpLbVjs4vmIcebIsf/7EgYWLLOcKRrCJL6c\n0CLY\r\n=PSDk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b76ed2879d0cfdb1a090f53e644d7815f78b9e1e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-27T14:57:59.321Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.153","@balena/jellyfish-environment":"^5.1.26","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.10","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.420_1638025220644_0.26112236549835677","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.421-renovate-internal-patch-e874c221d6534b0fd4e66239547abfd77415bb37":{"name":"@balena/jellyfish-metrics","version":"1.0.421-renovate-internal-patch-e874c221d6534b0fd4e66239547abfd77415bb37","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.421-renovate-internal-patch-e874c221d6534b0fd4e66239547abfd77415bb37","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"be6cb3430e7ac4756e0b94f1cc3d8581011dee49","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.421-renovate-internal-patch-e874c221d6534b0fd4e66239547abfd77415bb37.tgz","fileCount":16,"integrity":"sha512-AjGrnPKjwfWuPV4pSEpvUfECOOVloaaSm9v4q1jULzi6dPqPzr+r7fBrGDXE+fdxUgIzAFm0kaXZJxp+KAdsVA==","signatures":[{"sig":"MEYCIQDoztbavxv2n3KaJ0eZIv5dVTglGOg7V4tLvhXmrlQbbAIhAJnAXJzKoKdAVgvmJkUZYFaJdBpJknmsOy8b2DUt+2Ff","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":142452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhonC1CRA9TVsSAnZWagAABm4P/jli25WEkOO7t/pQ8nqX\nBd+t91D19PjueedKwO72UTEnDrN55i0mGrEM7BFsyW76nv4jqd3BsNFWPuwM\noGNUdgomE5g4+/qDj+KYf/wB02xmjRvOx87yt/xEkgix2hwfXGyO1I+3kM/c\nbfKi8GlyBb4SXkh7T9RU/bQWl9bJFvuKtJCCMMD4htKi/tVjvki7OajuiUPg\nS6VgmyWD5Rr2o+7btVEdWJCBFrmsWhpjrlcsHhzWqtGS5/sP9mqCtoQ3q9CR\nglE7VJlnOXRQ8JTEm510nza8CIVt10c48dnmbquY3Ek4A2/65D5uK6THyooL\nHuAvSJtrSMNa7bRA6uuEJ4Vk58ONPnbiA4I7gvr3plailXtPqxI+5Nc9O2EW\nom9K6dkhVt2qEYG0KCSpqXS+Mpf1/vbGI9nKbGRE9YH1dn1gbuXuafZRwSvQ\ntdOKdQwJWu3UuVsswgij6kGPb/npM4wM1fi9Jt7LIU7qPWCcQyl0YW8pgxCd\nLNYbezguVcV5tsuUiL3LIpZ3brJ5ua7GbnFtzmnFwC1x6Jnd9WDnDvCU2Q32\n4na3nZFhV0SAu88ZArNhX1BY2jy4GbkOlyGDkuIuKiW0Zjjtu1uzC4IWIvug\nWaZsHIQZbHYIoj8zgHSlKdL9pJz2v2nZzMsfQxLTfXBgggnxPl68tN1MN6Ky\nosv5\r\n=gTyF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e874c221d6534b0fd4e66239547abfd77415bb37","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-27T17:51:03.043Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.154","@balena/jellyfish-environment":"^5.1.26","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.10","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.421-renovate-internal-patch-e874c221d6534b0fd4e66239547abfd77415bb37_1638035636826_0.22559767332119396","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.421":{"name":"@balena/jellyfish-metrics","version":"1.0.421","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.421","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"731bf5a7e8a5b82271be3a5998d0419e813a1dff","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.421.tgz","fileCount":16,"integrity":"sha512-Oq31F7ImnQDOgjD2Nn9+m/xsIlutJmLDMBvWgUQyX0Pb4WXT2qDjrqu7MfMpuCq71oHnaFyjHvGzy5UU7ffZ5Q==","signatures":[{"sig":"MEUCIQDKj+iytB9bX7LTsqNDL9q/sk0kIxuqnbDqdQg2rOJ5FgIgOf5ZsNtasGhydvYCCgBvunN6KDu1T/afdlPQZvq+kPk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":142387,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhonHECRA9TVsSAnZWagAAgK4P/3jo7zibgs+NlJXLXmdg\nTEtBDcEvfkHXDMNjXttnToNO8sYGgB0SXwtEeTtFWGe9bAQcq0JiUWD332c3\nA9ODoSLqRhLl1oHAHrfiGe/oKW/u26aLzllqnG1agCPey4JUELPBO5yElJlv\nj/4E1mv+7MdPWqGQYnNCnjrMHGvHlw/32ee4JIo+saaLYw75p8tOvzg6m7zI\nN5Zyj5xOM13kmzDZdglT9BcI5uOEGCdxfWd7dtBNAGJY7J0OFrzeHjxvQma9\n2sQHFWiMhNkS8UBsP2HWovdDuTvU8j++olmqPNhJTiYNr88jsjhpDCstc4G/\nXHyb4L8dZyyJ1tEtBBInUMEHtkFxhZ82G0RAdaBYTiHC3ZWnVXfwZzJDs8Iu\n5AjFKvsIs/Gc8MFLGEnwnRh8K3Q6EChLiXR6iEWAMgAUMnCAX4uDPDX1cpwF\n4gThv2qpmf8VcLum159FUfMOAekUJiraWXPxVx1ad5CrkKHByW685nAlkT27\nRxdIO5CHIl+vRCyeyiuvUY6K/kVTv0/ipU7R1PJdewTl2DUn0wDRWZs4HtZw\n8CrdiT8dufRRv0mibBKmDNLc0CmBtouXltS25OaIXQSvVUtAsb4aeRaG+HpZ\nwahdM0RI5UOhu0s6epkdpuVLk6fSrpuRpCqJavWb2pu2jzWgxO4hc2kQIqG7\nKZqC\r\n=ZtKD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c49e7c297284b1408fcff573390fa288d4a6b0cd","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-27T17:55:37.964Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.154","@balena/jellyfish-environment":"^5.1.26","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.10","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.421_1638035908818_0.7058398991764756","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.422-renovate-internal-patch-566882a2ce0e4932ea04bbfd9c959b463e18f8c6":{"name":"@balena/jellyfish-metrics","version":"1.0.422-renovate-internal-patch-566882a2ce0e4932ea04bbfd9c959b463e18f8c6","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.422-renovate-internal-patch-566882a2ce0e4932ea04bbfd9c959b463e18f8c6","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"980c46564e25bf91d3520eb23d802a8bd9d4f30a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.422-renovate-internal-patch-566882a2ce0e4932ea04bbfd9c959b463e18f8c6.tgz","fileCount":16,"integrity":"sha512-UhrGdKaN2uurrVD9sExvZnqfO6JCDvnN6+zasbSTaFkRtwGSX/ig0eu5NMs6u2spPtKrJgNjOXz8uTIXxs2AfA==","signatures":[{"sig":"MEQCIC7JdPf6JbGGcrYJNQD+s4MNVvcc+b+JTL+EVJYhrv+gAiBPQ9S01l5kAOTjK5kdZFQyGqjC9XmFtJLBS9J+Y/0NAQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":142557,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhpNnGCRA9TVsSAnZWagAAc9kP/jUrgeluURz/ZhQDsNZe\nahZ95DTPFsuadBvDv++6N9+fo3RRjS8JPnD5Th8ppmXZ6x60cGKmROveSlku\n/9JVYJmocY5gmeubSt3mpRus/izuSvwC3G4yJcyUVC7d4gsf3jJSjVFmjRM2\nMYEzMBBhRpY/CNNw8cVZ9kk7URkNlVf2uBay7Iycoemz7ss90pflCNum4X6J\neAXuxr6hDR/E8LIaBP6IAzL5JEj6g29Sh5o9OPrUf1gfziPy93XiKDgB4UB8\nGn+NMomXmCxOmctVoc2HqNB4TqK0AosGmDzxPSBWO6Ra3tHu+PdCRJyHjMpJ\n2cAtqOvoyfseD4AK4SsYAj3A2+xX+nIbjOniDeO5aFYaMN5YYR2f7KF8pbfz\nhGfuPnKw3nZIIriS3cPH1s5I+wmC4m62K07adtLbdWkRTWfTCdgmCYW1xv8/\nFBDAs/uPX/XdsFIzvZJbK8mOMNAOQ3iGDyXIRtWcBhZIW6BI4eCvzfs9zZWZ\nm+ATL4H2Q4cp7TJv8E1hfQetXPeyE/fg6uWxibrmoDupiv/C4TpOKry8m8ww\nyaMJiTKGgxpgsWi0X8JkfDtmG6Zm9HWJhoU1AkEJ+GPSfCxw+P+zeDZEUitj\nnFxugDQ3adZtPUcG+Udb1UxJOUN/vJ99sgAhiw3XYVvXjYeTyK+Ql2QN/FJB\n4trR\r\n=JCV4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"566882a2ce0e4932ea04bbfd9c959b463e18f8c6","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-29T13:44:07.926Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.155","@balena/jellyfish-environment":"^5.1.26","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.10","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.422-renovate-internal-patch-566882a2ce0e4932ea04bbfd9c959b463e18f8c6_1638193606108_0.7969592104162984","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.422":{"name":"@balena/jellyfish-metrics","version":"1.0.422","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.422","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2efb9b857fdc919bd14abe0316e78a65fd4e297a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.422.tgz","fileCount":16,"integrity":"sha512-qdWXjSn3xsJPWm+HpfuziQyV1isKwe1NFs4MAhEAYPU5UNUdxB+dSzuBw1FZU14BkW+FXmNlJ23Ch4TtGf5esw==","signatures":[{"sig":"MEYCIQDwcCNoxzSwkvQOn32Y678xXpJhC3Y8QvquQ2kJQ7+dhAIhANvLWkmd3IIvh0uDPZ5Z0gpr0HnY3l0KgcsHmh8fXltH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":142492,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhpNqECRA9TVsSAnZWagAA1wIP/0nKzDOWG02NKiTTYAkP\nsMLQ4yoA6oHltgJCW2JYqmBurmQiIbPRo6G5vmoDndmJ/FgYCtGyLBDstP8R\nL1jhenqYQqhWctT2OZAoFe4qy0owVdWmhtlX9jarSDl2UtYhIuqNEZzMw9C6\nG55JLAGOH1BJFF+NTu4c4koMoYgEEk+d/miHLGaSom0ro5kxi624ny5l3R2G\npHnRffYPhqDMdjxWOHmpnORe3n/KRLTwF+EXdBTTMB8ESLtTTS0pdYhq81mh\nd0FlDCQNee961R1C1EkrG9ZqvrSqLoUUg6rt0q64wF/w5PlvoAyHDVVZ9t5M\nXjNha8bAPf/YVOhvk6haODChlVOb6amByy3Rwt2VUiV2hlhmdWlsh+GSr2v2\nqcjFyIVea+uZdrGzR7dDRQc8TkcqRBWXDWXju5eK1ihm885BQIJVibDmy97u\nrXs1a5nRx/P2R230mnEY9qcWWwQ9WoFw2EFcdwtq8kb9x6AaZHfGaS5t2Dos\nhdY1yImaQViPhIOVDs62WQZYBoZlXc8gJDLc1+IkZaO8tBgdHNexZj00sDgP\nfWqm6MyWxkTbavOqNFGcOvyektRO7tIpB2WpRWUUUxtqETBk0Cb5yXFONkfC\ntiOUKfagMxT8GAwzvZbOOts9JUUhudl/n7hrMvsSDAzp0sI5UUyR9kpQb2Or\nGb0U\r\n=Zrch\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"462c915267f1daaa4ee527e0be510afd3f273fac","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-11-29T13:48:08.418Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.155","@balena/jellyfish-environment":"^5.1.26","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.10","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.422_1638193795963_0.9569419612907304","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.423-renovate-balena-jellyfish-environment-5-x-2173ef0e2ce92d632f65c5974724744a06081d30":{"name":"@balena/jellyfish-metrics","version":"1.0.423-renovate-balena-jellyfish-environment-5-x-2173ef0e2ce92d632f65c5974724744a06081d30","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.423-renovate-balena-jellyfish-environment-5-x-2173ef0e2ce92d632f65c5974724744a06081d30","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4c71b9a95334dcdfa2714cc8730dd24c9be46710","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.423-renovate-balena-jellyfish-environment-5-x-2173ef0e2ce92d632f65c5974724744a06081d30.tgz","fileCount":16,"integrity":"sha512-fUMUyX/oabUaN82h1K+bpMwIh6DnyOAW7KmqeKIkhz7OjGVUdAi2Ht2WKMspdSa/ebtYP4cXSfORiNNjaJWjwQ==","signatures":[{"sig":"MEYCIQCJYa56UQQSX/KKaKAUmawWnXvLW0QJcfNq8gkR0FhEzAIhANpyogcUoCcSSPzDcqxhDTC9+dhBDpcAlWsutSWPhsoI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":142682,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhp00XCRA9TVsSAnZWagAAxUQP/1FzHjSeraF5qyGL53ud\nLInykN7mqOmhhWi70SAmvq9S2KBjNJTpB23tz1+1ch8EXwuluqmOKYPwqWdx\noKzL4F/fYp7st8H103ZGkhC4w/qaUYszFoBekl2hcR75dz6VvFtidxmiG7hO\nqluaGKWah+l8Kur++VSAl/oiut6k2AOxiTjoBN0Kw1HuU41PDIkU13t7bIjK\nPfcWutNO8O+CE6oZYuUP0v/XJgXg2Qjktndvj6pUHaSmHU/IUKmZDZKjFo1C\nfV0YQadjUZ9557utBrsYDJiZ5PPMxxij9O1cAANKlPSXdlVXGyzr2h/e3S3o\nL37xfPN5fgTtzE2Yv6kC8MI65HLRGNSJAjcxex3jemd9iOKafEhPcHNWi54b\n6qpLXPQ8w9E0WnVKN4KzDFUZ/YF25e3AKSbex1qPZrGu/UJ9EIEIbvGxCPhD\n+jSf4xUPVq+zstpvoISjhb8YKgZo1vxS4eAqNMBHHYGr9I+UaEXfe5zeuMvr\nFVKfMALwDhHHasYHbbqR5aKDITHGZrjJcPtoa7cWKoDMeLfmBdGuh/xEZLUA\nL4KjGXjgKfwNipcVusSDHhui2aAvNtHsRbJ55ITi5jOJO6SlTzo13V33h92C\nO8TTkok0vYr3dVt+6mTK9DII5fsWlHqP/xoBv5U5XIy681vGMs8obycP9pvb\nuXew\r\n=buVw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2173ef0e2ce92d632f65c5974724744a06081d30","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-01T10:20:03.489Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.155","@balena/jellyfish-environment":"^5.2.0","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.10","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.423-renovate-balena-jellyfish-environment-5-x-2173ef0e2ce92d632f65c5974724744a06081d30_1638354199620_0.5373689141005433","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.423":{"name":"@balena/jellyfish-metrics","version":"1.0.423","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.423","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7c2ce0168007f338a6f098d3e52cce0f3e6a5c47","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.423.tgz","fileCount":16,"integrity":"sha512-lECe0WIznfJCjTp81Q0RBDXPqtv8EyaqI69rQ2Tce8CPXhf/25iEQev5A+i1eaZ8/8bdtLwo6PDxSmYBqee8Pg==","signatures":[{"sig":"MEUCIQCB72VjNJ93IOF/ZxP09t4ecYYkJPF7Z5HJ+Yu8PUxWzQIgXHp9vfTWHhP1EJcNUnltHOBV6EKRi1CVpQqEHOYHCfc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":142599,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhp04fCRA9TVsSAnZWagAAxG4P/3ZWPmmRrSA/tcPl4mYv\nFNpJuSO3hLaK7T9obnG0MXcTp6Y9RwKsu1dtUOEA19cCQgqnJdiUSPmwIk1L\nqetMLVXHAGUDw7cVrCz/6nWKOIUBazxio6gzRAYVd8fhvdU03FZWwfNMRh2O\n8P+GEcGirWvIhXhTDZA7TDIKmfotz0qDARd2/3/UC5vV79D4bfFMABY/fprJ\nNEbO/eGu+uMtEJhvFhrUo6xb3Fi+jRMvMzV0pdPBfsjA0TQ1RMqsTY1fAteH\nPJcgqMElwMcbV6SFrewEuqEkZLVclEmFaSiQQqO24zHy6dcjU0F0Tj5RNEqn\nW2rU1lY0D/JloVVyty01FtQTEcFY65Ygz5Ls3oLY/NxhM/iTdiAz4UDFHv7B\nMV85FRnVcZuDwyyMN1XPeaxRuHIbnfIRq8ChXWynsgubdt3JrJwbSYQkdk9X\nwPUAWX83Apoj4wOoCTAh60PJEquwRbNMzeHUYr49CqvmcA5Gwn9k/bj/ENLY\nVQqkOWfti2bqj+QpFDb4OYw06TZL6Et0Q6/pnDf30T3P53hnGTd+o9cENwxx\nluNW0l7yy9hVLBOXtg0wgOoVTl7Z9J+JeIbCSIPYYnNzDJ6KgrezLLehr/F9\ns0npXcQZwnosjF6K3I6CpZfagvo2OI984fZ65MLob8Y+KE8kwb8r6ktLE3gK\nATNx\r\n=jUkE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"fa208fb2b001cc0328fe84af3331b905b4508815","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-01T10:25:20.535Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.155","@balena/jellyfish-environment":"^5.2.0","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.10","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.423_1638354463083_0.4506505831453256","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.424-renovate-internal-patch-1d717dc42024fb9833062cf20793fd4a98ee73f4":{"name":"@balena/jellyfish-metrics","version":"1.0.424-renovate-internal-patch-1d717dc42024fb9833062cf20793fd4a98ee73f4","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.424-renovate-internal-patch-1d717dc42024fb9833062cf20793fd4a98ee73f4","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"15ecfe4a9b6b10c3ee3108930f47b3f8dfe3e5eb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.424-renovate-internal-patch-1d717dc42024fb9833062cf20793fd4a98ee73f4.tgz","fileCount":16,"integrity":"sha512-TLeZNMz9wGMGFrBpn1dVTV/raAr/jr72SKmG7/BaH+s/ZiVSBQvWA0LAxnToBPuYIOxceF7OAJ+4wTFqMQpJww==","signatures":[{"sig":"MEUCIQCoiYhRn9IzipUfmMgDjaUOooyNj2RWZ7yg+dW4uGNaeQIgEPRPWuYhZEZWXY75I4/KN/UusORJMKyWVEzx7K2dWHU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":142769,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhp07OCRA9TVsSAnZWagAAvJ4P/19rEdNXukinStJuO01m\npJwfjBm/FdWVaul4sp/FRT2RN0U3GDWqtGNMa1sSKJSvN1u4bxSV+3d1pzT0\nKvrUUTbUUHYiVFBM+IqcLOngdlkqR7QIlEa6S+NhpQyY4lbqnXqh0CO9YrUK\n1dHxrcES+qMjMZL+XsXUUdTtCvx7SPGKn6MHxifVCT21wI5MqeHcXqsTnLTM\nG++2bev2o+lNeY1K98EnIXM6CvlOUzHkJjHCRqjhFkaAfm1RScFRmww3tZGI\nWRSSKoFQJLvOTMj0fBjCPEKf9DPCye8mJFwFd90q7ITWF63VMPmb5udr4tl3\n/WHzDrGBxd40V2M4wGOk2pMvQVLuNzeSRs/QLa5IuwLVWYsG5a3YzDJcHUVR\nUvVUDVEPTGaRiEEhDSiXxlYyVjRmoWTdkbQiepQRP3uVOaFABzypOwJDr/8Z\nh71AsbK1ZbCawEcOyWXacLqdSdbo8bQfqwRIrx37vvAomm3QFtkRF+DZEkJY\nGwu3YdIo3mo5CpGBWoAQ8zhEPJeCiROqNrQ4zdnCVoLs6KRpw42YlN4mVyqe\nmb7wgn1cZ++4HiRFf7UJoUxdWIx99iXSYXz3TfJkxrhsYfj4w+f08Jzllv2E\npc8IJy7Yy9hrJG+BDvoUQFCSRFrCuCVkpcaRNgaulp1RM2/oRLhYFpSLVFKq\niEqS\r\n=BQJa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"1d717dc42024fb9833062cf20793fd4a98ee73f4","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-01T10:27:07.696Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.156","@balena/jellyfish-environment":"^5.2.0","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.10","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.424-renovate-internal-patch-1d717dc42024fb9833062cf20793fd4a98ee73f4_1638354638405_0.9396198861038443","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.424":{"name":"@balena/jellyfish-metrics","version":"1.0.424","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.424","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"af95307bbb315e6ca362f44e794671426e0e9817","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.424.tgz","fileCount":16,"integrity":"sha512-tNXvjuPEbiF90fclLQdfxFCheRO3HHqWJMBAjjJBAqbmr3bM8TMUUeJfOLjDihq7iEcJUun59nUceFc3fIDZ1w==","signatures":[{"sig":"MEYCIQDsReJgLOesNqp7Gzw57wEBxXIsAOQuYZjuGGBBZ0THfQIhAKrv9yxktF8fWkYGoTt/7APsuQt7fw9YaaumEMaA8B88","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":142704,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhp1A7CRA9TVsSAnZWagAACE4QAJbEziFMyzdiXpOnBLmD\n1LKkkagi0li25TCiX5HfL5afTwpyI2Kq4gvDPPXA8FvijxPjDJKp5rtdDjHa\nLMDzil4m1hnJCKfoTqUj4aJZy9jXfzNC0SsqzvtYdpO/7ZN5pOyrgE0iI5Mp\nDTr/YzLHf+ZjVjbNDP9mWk4AJlO1VFAnV3ClkhepknDPKSzS3eWf21OggxHr\nBAucpgnCbfVJlsW4XmWqHjSw6XfPYRFFSc5GT180Eszp5P5Ts6yYUKmAY0FX\novalBqCHwP/tVZHUdZWvPVL26dJ6HisiuUJTePhf1ozqrn0Z7EdewFepH6xe\nrPIg+gG07mIEh5E4snblU1/Bt2wEr5F3zZ/F0F1eDE/zi1e2tr90Qe6R8bXI\nVf/HMirDisj/mIh05WnSujgRCK3YWiyvn/9jmG8HRVura5SkE2ozYJnjKCa2\n3euqOiMdorC9JOIxLuYIxUXQ+lT5L+AziMq+VVY4FUMqf9QzLkxHq/jCQfaQ\n3NezwKKw4hQaDT4wZkUXpGPuyF9wwqR6YZqh69ikoeC2PH5MTwH1WVmZhj5Y\nbeGDn9+YzNAibLjBfl0vAleSXnMwes38aBkngrbzNS2nS/ckoC+KL8OTnC6S\n/DBhNViOvjx4VbkLLrDYmu8VVnrXmHi1v1LpvwgsW6G/fyB1LhIM1w/dNmk3\nw8DK\r\n=ZmQ5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"000f24a7dd2f0d0f82ec39782766d5fb8a35463a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-01T10:34:14.309Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.156","@balena/jellyfish-environment":"^5.2.0","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.10","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.424_1638355002824_0.21575664212285806","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.425-renovate-external-non-major-df8066e29a7af5702d0c57a7791afb6d84e98cf5":{"name":"@balena/jellyfish-metrics","version":"1.0.425-renovate-external-non-major-df8066e29a7af5702d0c57a7791afb6d84e98cf5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.425-renovate-external-non-major-df8066e29a7af5702d0c57a7791afb6d84e98cf5","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6839f50dde82f1b46094f26fcf1a3a2f20029e49","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.425-renovate-external-non-major-df8066e29a7af5702d0c57a7791afb6d84e98cf5.tgz","fileCount":16,"integrity":"sha512-OgSMld3aOjzUa480nKmzmm0RKsYNYMTtS6iTe0tmZeJywxJ+OQM0icfCAJIBLd5oFnwxoTHj8K7+mXFzFs5P0g==","signatures":[{"sig":"MEYCIQDnt7q4Zbua0IAOuQxhd4vJWkIdOBQ9lHrf5nxg9N582wIhAPdBm4nrPS2IisVmYPK+Y7O90RUM1+6lyj0CvFEvmfJY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":142849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhqrUtCRA9TVsSAnZWagAAtpYP/26XhXCi9R3yx6B3ujCE\n6rMQ5spiMeudCA71lGVb1gyP4tDr/t5WHRzpzT/X+CltA7FGJr4cRC0P/ozr\nadhXHTVMyKUwHvTEW7nmwxfxnlpLkDD1oHjkbym1WQAS6MLSIurPAbRH3mxP\nvu3+jdd5LwUlNOTqeo2HTihzKK2sPLaTwRqG7u6ZCGgMQlFIbwRmaqs0Gx10\no7LQc7FYPBzTjJ9fn76xoKMpu419wanf38xD6gpZBrtSLoLUcCHuZphggSnZ\nfFKhWoPZUFDFq/CwJ8lFc2XOSkv6+BQXhMM7H9xRhgTNBsHdf2LziBs17ADQ\nX8gUR2Ay2Jq8TbVB3ATD5pSOR75y/BICLeDVE9bwRZ6d+YDp6KCrW34UmaV4\nVZqdfgRc5rlY5W+QpHMb04IMTdJOmlNDxXxG5uL/I3R/HIN6PmLipT4k9TeQ\nQpjim3ueoxM4oPaiFiWlgb3ju74a4ZkTjiivKE3b3Aj4Fnfr0POnXv9cdVKD\nFwGN6buLwBcrHYctKGRC3vTNMvyURH0TmlIp3qL2CUdddkDI+xBbXaXeF5wp\nAGLKLNeHPFVIKInPRyvISVjTIZlgUBQe5JDUQV/TTxOShVa3XiI30gBbpKK+\nqNK1W/RO9qLh1xYYTtLqrLtYFStlrG6KYrXPOidRsKHnk9wFDB38XXqD4SZY\nhE7t\r\n=zcY3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"df8066e29a7af5702d0c57a7791afb6d84e98cf5","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-04T00:20:59.257Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.156","@balena/jellyfish-environment":"^5.2.0","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.11","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.425-renovate-external-non-major-df8066e29a7af5702d0c57a7791afb6d84e98cf5_1638577452992_0.8853385702367962","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.425":{"name":"@balena/jellyfish-metrics","version":"1.0.425","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.425","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3e7c37ec2be97f03c18d61ad959a90311cc74b17","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.425.tgz","fileCount":16,"integrity":"sha512-0XvB+64P5dDpPKGI8jDSUXy7LxrBED6UQ/OtstXCvvlYNO8UDGRywOllPqjsehu61bj+/ZiXaNzGug3956l+sw==","signatures":[{"sig":"MEQCIHekk+s/jpHuA28uf4AB/T8cpg4vri9l/e/8cFKP7YF/AiAcfif8kiy7T8fAHO+fIm5VJbW/rYHNEC3ZwqQpzTZUgw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":142780,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhqrYpCRA9TVsSAnZWagAARl0P/RKQnEaRx4fe6M472UWL\neM9yvGRTRRf0By/jq2ORaNvQWAkr5QL7Ps60sh2ldi30IUqWgJrL/MBVjNnX\nKTfK29DzmI8XrSv6UL65SAP5+R+Y6GzBmt3tQdLCB82UxBsZ/NzGu/bqmP5g\nfmpV1WYDOCnZnoDQ68vA7/CJ25Fxvx7fyOFTuWrd/JiVEkS8m2IHpoTOk/sm\nfrDeF76Nkil11KcJHpSb9EK5qsERVbQSCeI5phACKM50ixf0FMSPnZ8b5t/K\nbShs3bxyhqd/1v9sC8v/k2HkDsONQSXdP2tEeGMCUet5GyfRsiBKXJ2qCoib\niAS3+n/FomftDJYkdLHz7tXruMvzlzwe5V9jB7SV6BJFt16T4twU3Pd3mFcB\nIHuUDoE2CwRNYHTB4yUGOBG+LfAFdu3pDppXkAHA8LF4dr+aCUymM64SX/0a\nA3CETSgaxo6nxwJUkYKOEl23ieattZhufZNzNfJNMgPqwZXKNOOhG5nYfGzs\nNdcDGeStogeMCLH9/EI1jgBWdU32xviRiCxUOs48CvX7gdjUMGWQd050ac8J\ncOeE3X5JIFgyedOYRQihjiQ8Vsqgxk+0goMUxMggGYDkMaAa34vtNRWM2+l2\nqblIQ049+5MO9G5j+haEBAzbU1zSxMyCvSzuUhGih0RpsA3WiRdfIeKlbXoE\nO8ZU\r\n=t7UR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"45d61365811bc0e07b0d470bab7b2ecf2e5eefa3","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-04T00:26:14.823Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.156","@balena/jellyfish-environment":"^5.2.0","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.11","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.425_1638577705043_0.4052816037308882","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.426-renovate-internal-patch-23d4c0f8a85c967a007118f3df1bd5df6a4698ff":{"name":"@balena/jellyfish-metrics","version":"1.0.426-renovate-internal-patch-23d4c0f8a85c967a007118f3df1bd5df6a4698ff","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.426-renovate-internal-patch-23d4c0f8a85c967a007118f3df1bd5df6a4698ff","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"247ced5988f0df263f8ac69003b6282ec015695a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.426-renovate-internal-patch-23d4c0f8a85c967a007118f3df1bd5df6a4698ff.tgz","fileCount":16,"integrity":"sha512-/wm7Jwu7RCczvHXixX+M9nyObT1jzxB8Fc7eD+TQ3ZUF/gZjFUQIT6+q6utpIHWAXNIPIxzT4jS1ggDKBxoGLA==","signatures":[{"sig":"MEUCIQCLwyK7g+oYdL6IQgmc4LWgBhnAto755ttQFZDjBnMSugIgeJxv/Q2LJaslUjnY4wTmsIFRcR2rILy5gBqpdUbZpk8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":142917,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhq6+QCRA9TVsSAnZWagAAGsYP/051z7395rg9jWYfeXcN\nutmK+WlvilCAukE2kBDC/7mTxUqTJPG+Q54iGG6W8pCSj+YVAbOQNHbU7nlw\nrqVCiO+4jlRhTCekGxAC+MeV3+5H3w4G0SKebBN7de87T6HGg+JKLh64DSps\n8OKHlTzdwPnATED9Ym4IjKR69fLGuwmGee9tPWOJ7cH+hqOyNTzCPoPWgPN+\nMNpD5fkf9kVBVUpscdznivx8ziPqI0FV1jA/39cXPLDo1qKpVwu1HWZxpLzB\nuZW7Dq3BvZgnF6yp/i/j6/CN2kMBZ26BLQkeZpIz/du5S06leyEX8ys9mrwT\nlB4UgHgDJSqIDMwfF/at4mAZ9f8/PsRWbzoCl96CPnsaiGSwwCVsKzS15LFI\neWLG2hZgIvqvugPGnW92OtFKdjledmHlfmgf7TGSXEWNDCASWiJwAidi0vuR\nHdFIHROqyijiJwAtQjcbFWj5SnoHFigMSeGLKuAS3n4XiOr9FJGS79RdBz+0\nbUBeEYljBSOZ6klVi3GWqJM7uKP0hceE3IQNFi8Cz/EIAdqzSoTSozA0c0eg\ne8U2N3jcohz/poKJasjyO1zVrWpoEY+iROQLc7EMr1jOV/UfypTcRvK2RHad\n+jrGkXNG9OviJKJ35+A/vHlJ5k4rWHWl7kwoZ514KOlB6xHT/BVnuIbzKzvx\npkmn\r\n=bBhN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"23d4c0f8a85c967a007118f3df1bd5df6a4698ff","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-04T18:08:30.772Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.159","@balena/jellyfish-environment":"^5.2.1","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.11","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.426-renovate-internal-patch-23d4c0f8a85c967a007118f3df1bd5df6a4698ff_1638641552666_0.32495283360965566","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.426":{"name":"@balena/jellyfish-metrics","version":"1.0.426","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.426","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7dcbeedb53cc56d4b7a5e9e656bde3027f645c54","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.426.tgz","fileCount":16,"integrity":"sha512-wf0uwkZYX737FbR4ibIXru6Q+PqW118U1/NkWO/UCyGafTmnWrub956GTpvrYHz8Jx69bIFGnWj/3Wk60sBIEg==","signatures":[{"sig":"MEUCIQDPhIQJl1Hrt4eHjSGqJypx7S0NxIAVOiLzUQB6qZqf9wIgNIPl97ol9xbry6xNQZA9siuMuLjASRg4x8Z+knbSc6U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":142852,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhq7CNCRA9TVsSAnZWagAABfgP/i6KNaTYlhyVkb3sFGZM\n0TrrG668+CK94ezl88TogWoyGPVa791+o113GtbbpTmlBgsEb7Zqg8n0QK7b\nrZSJa859HS/G86prSx37QiG1GJVe8Qsbs9gq/RZ8DCE87Oc1iskIaXaBYGqv\n/HxRHo8vOXVN+bwRGmR00JSEVhQovlLoe+6UhqoAUaQEBVpAjcP6JMOtzQj6\nogKHawFMJnuif7TkSZiFVeHrMjkDBPd1TEq8VA8QlxQi6OzzR1emWQSlb2Yf\nblj3hHsyvEKGQ07g5OeTZrFtQ/5TI4Sx4hWDZSB0/wv12QW4rOPzTTBl3uSP\nSCF5QOrijF8nSshb0VKt7+DtbLyGFlIg5NI/a3ITvAqYQtUAUmPc9jZHPk0D\nGebbtE4JVGjDdJOkVUn7g2LnVjskA8Pe4SXFHjY5EpA5qwyzLTEqXNQu39cn\nQqx8EN8+nK7m5YOOjq5rLK39FlZFW6iepyr7thEGBYra4x4hmDaeqYTkBYIG\n0XZ+ec84jezZycd7L6AnbhGXo3KGfLrnC15shEkb56kDZ5mcnICPY6HpnXlJ\ncFIo6htEZ0uz6pFRzLZX2SWh6ACUzQEOKdwY+Ai2m/wCg78IgHAh5+Kss6b9\nGmPedC2QJOVNxsQjeFdetn9DaXUjfhHfWeIc5Mtd7UxWHMW6P3iaLPIgotI7\ntV1Y\r\n=nBey\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"be0647ef559a06a327a546e2a9d78c4dd7559efe","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-04T18:14:30.198Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.159","@balena/jellyfish-environment":"^5.2.1","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.11","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.426_1638641804860_0.8557351586610682","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.427-renovate-external-non-major-1be835e4da8f215ed3c37283a79bbcb4ce1acaee":{"name":"@balena/jellyfish-metrics","version":"1.0.427-renovate-external-non-major-1be835e4da8f215ed3c37283a79bbcb4ce1acaee","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.427-renovate-external-non-major-1be835e4da8f215ed3c37283a79bbcb4ce1acaee","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ef85aca889d88115613a3e6cc3167ab82058e760","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.427-renovate-external-non-major-1be835e4da8f215ed3c37283a79bbcb4ce1acaee.tgz","fileCount":16,"integrity":"sha512-4kJ9lXsAmKKnOYGijZCyDqlwFGuHno9qe+LlCquDAT4rY76JLqT8Mv6kF2MmAIwoXn05hMny79rJS/iRtsj5HQ==","signatures":[{"sig":"MEYCIQDY83W4l6JQrtywC3unIYeHM44ElirfjkRcsryL/5FYWAIhAIaVeLu0vJ9K4/qDEOHPc8TeKqKOh9OZRa+7fkp3VJ4o","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":143008,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhrI38CRA9TVsSAnZWagAA6cIP/3AiYreFpUSk0oupsEOe\nO2YA9lXS8m7kshQJ+xRdaxcIdNvUCHMd5QE9GUBPswXjfADm7KsxErLHFLMx\nHbcSTSZw38SMQiK4s4wa7mKr9ZztHYEwCKnPLTwZ3bfm0/r/fk5ksqBoUBpy\nCawFBNfDUzxO/Rvzn2SBGW4bvHNWyhUgTnAlPZfHcVe5unYtY22v160EuxFv\nItq9yVJb2G/rDkS2ZtKDj2uqa6U98cI+uHEWaIN4sYvFl/FDWaguKEIugoSW\nfzH3NVfh3Vka5+ivnAf9kpVKemlClcm3xHd1gGqXblcuVsvtWmU8jjcnUbvM\nMM2whImH3XGVG5vO3888PYltmf0rFta8aSOFgdiYcYr10cPcLp0x1o5WBEUB\nJ2f6I7kO6Sb/Ecf/TlphD7bSPQo3n/bvgFqE29y0Pqki+mScVx/kBfQU4Mhq\nHJ1e6EMT1MMXpmgVR7JG27uAcaYTAcJwqRjApp1U9f8jSNzWvHxdn/X9Ycl8\nbZVW8YPNYjH35F3we1P+G1Zp0LLM+at2rzfbvrxw9cfPm6sAnC0DjSXIDVP2\n5OBp345RbamM5G741KqHbgaZsGSWWj6JHGm+Gx2H83zhPH3zKPKZ3YYGeoRr\nHt9KDSKUi0uw6M/hTE0cU10Sd3C2am1oqb5bvcAsvB2MdwORUD/7FbUTN/3U\nsK9a\r\n=hqTs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"1be835e4da8f215ed3c37283a79bbcb4ce1acaee","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-05T09:57:45.173Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.159","@balena/jellyfish-environment":"^5.2.1","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.0","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.11","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.427-renovate-external-non-major-1be835e4da8f215ed3c37283a79bbcb4ce1acaee_1638698492079_0.7886907105076011","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.427":{"name":"@balena/jellyfish-metrics","version":"1.0.427","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.427","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fedb2a7b119538a37777a8acfa88c350f0873aab","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.427.tgz","fileCount":16,"integrity":"sha512-nUZE2zQMaYeTR763oSmDSpN8Rt26s7393Fd0LZBAr6YtiJPk+i2Y3NFIux5drIrmIGTMcbkR8gnvkfOAWobeOQ==","signatures":[{"sig":"MEUCIQCneBZR/O5H7mjdN7Go6Uq4HiRFsiN2P0NJ5mwgBJg5nAIgU06mAiT1jhpIeyvqeSzkgQeh3IAPWW2OMQZgcteARQw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":142939,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhrI7qCRA9TVsSAnZWagAAS68P/Am65Qquqy9ytA7ljIjX\nukcHK3C30gNs2HaK3V0stkIAxOeMTGDq4p7+8JOo4EZTD6JP0Rq+OdLlERAm\n2rDWPuXsnjIYX/49w2wxkAz8Vm8wPXRTTnlCw6jbGnDxBLv/nk4GfY5hh+i8\nNS9J/tTGscTTlL1yGlUzeRi71r7U9R71FwkHK55jv65fLOSNEExyE0m2pjCO\nv8MFBqgBcWNHX/AwVcpPsIOUw0BPbjQ4dN6KIEDdWfMmw6/D4DQ8jKox+jyX\nrjpqUxc0ZLbHW679Voyr1WD3xplzFNxKWXgkKEoWQ7SnRTDVNo8cUZ68fknR\nzEj9aO9mYqAcbt1gZ9Xaa/YC4mKKXoTMh8tTPgw7snpul8pveLcMBSpbFNXe\nF4bQlW3lJpRio97nvzngQqHlSSVCvKmzJKd8YE+rbM6bKXC7pNLxaIK6dCaB\nJ4B0n3/1w+pDRdIlSZ2DLFTpbiQKXFnFzd5Ig9tsIsavMOHpARmyz//5wwZy\nxyLEhMNDk2J/BawhAPAJpuNwWMVNXHuL9o0RW0AiGRPnK6y0KAaEJvPC42tu\nIGODrUFlbZY6Q0V7/5oAGqTuDwUR+5FjfnwvcP7XQw6bbnOEli/0BbG91VAi\nSxL5iG5mtjwXsQ1IVuzG1ikLjXC0LjPJlsB7Npd1jey+ck2N04kDo55f7gNF\n+ZrR\r\n=9m4K\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5df25596010da91c5e0b78d1ee173d7354b61612","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-05T10:03:34.955Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.159","@balena/jellyfish-environment":"^5.2.1","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.0","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.11","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.427_1638698730267_0.5809707220061318","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.427-renovate-internal-patch-b3f65897b38b1c29e0ef1c617a4540e8500a34c1":{"name":"@balena/jellyfish-metrics","version":"1.0.427-renovate-internal-patch-b3f65897b38b1c29e0ef1c617a4540e8500a34c1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.427-renovate-internal-patch-b3f65897b38b1c29e0ef1c617a4540e8500a34c1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c36704f26d88e31abaf12f1bc80fd1a47cc2c99c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.427-renovate-internal-patch-b3f65897b38b1c29e0ef1c617a4540e8500a34c1.tgz","fileCount":16,"integrity":"sha512-wAM+YWQ9ivh81+LttnM0TBLV4hBmkLeUXXdzCXPTFZATPADNyXAwpTdYZtZ2v58A9wRVZG0U9LW9QI8bptM3ZQ==","signatures":[{"sig":"MEYCIQCtBn/qcaXT1uWmQ8shSbgInu2zzdLAMC6LzGszYU2cmwIhAP+9qEHtWkzXuUDhCaueBVA3rUQ4szkOaWOxXck/k9N5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":143022,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhrI8BCRA9TVsSAnZWagAAcVcP/2Vpd7CEhahEnAKyBAM8\nfSy787w2oLXvUTvklDQUMLLeEupktZAntpyKlEbq82EK+z24M1JfkaQM5PYt\nAH37wqhdalrGZ/BkBs1f9o5NDGu+MSatXEshIZpWWhfML4y/FbzNM/dVUEFi\nP+dT+ZVGfUZgis+qRI2qBdJlh5KWeEi8fSGfqfTwXSolqoFSzpuPw3SoZGnJ\n1SzYrYaICmZrTlPrn1Kg6yPqCVS1BU38V/Qc7zXv7ttdJvCuHASpXmaGFKv+\nNEXKn36lVDiF+bmF7yI7qOlS1c6vAGaWjh/m4z//T5TUboaYNfApNUtWvI2Y\nnExoauQJkQrikIpC3WNazNiK+iECfMOA7Di7z5olser9OCg6F/WMkhyiYY41\ndNDPZFlqBQrbZJJ3aWhlohS/V7nsHaHU4xkFAjIk9+4dX4wCHa+pLQNolV6V\n8sjWEVIplaFkf91va2UTQMIdEKFhL0J0XiZ+sxJXi9/KeLBLbU6iMv8vCXxN\nsaniP+plBu3Ol2N1xW3yVgyXogZutVX9ZAz5ULYmUYcmZT9+IZeknlQeNRu4\nzR1X3BOnt2e1e1UgWipb/xpnp+mOR1EgxMHrU3kJ+akOfW7opHNk+0kvKJ+Y\nN+n30hbp2HMDxiWo5Msx6cm89vjv0432DvxZdYA1o/92qRudm3a8zKoMI4HZ\nwLHG\r\n=CvEv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b3f65897b38b1c29e0ef1c617a4540e8500a34c1","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-05T10:01:57.342Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.160","@balena/jellyfish-environment":"^5.2.1","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.0.7","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.11","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.427-renovate-internal-patch-b3f65897b38b1c29e0ef1c617a4540e8500a34c1_1638698753714_0.7741015318354105","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.428-renovate-internal-patch-f8074cd73ca19b8edf937b9e1d03e764eb540f2f":{"name":"@balena/jellyfish-metrics","version":"1.0.428-renovate-internal-patch-f8074cd73ca19b8edf937b9e1d03e764eb540f2f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.428-renovate-internal-patch-f8074cd73ca19b8edf937b9e1d03e764eb540f2f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"91787d795883f13779ac818eee6a035666242810","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.428-renovate-internal-patch-f8074cd73ca19b8edf937b9e1d03e764eb540f2f.tgz","fileCount":16,"integrity":"sha512-9lAjCtmw5QW1PD3xi6n2CLCG4ZVecj6TdI+2TNrFG4mGD6vruq8FNPR3dkwWiMRX49S5wCf6hj2+69dbptQHBA==","signatures":[{"sig":"MEUCIQCiL5IXZ466vyz9m1cGcVHGiF5dw35RvYfgQ/wOtQca+wIgJOeEeX2FwfA3XYOSWhG57CVFuSV7yC4/UN4nuU7muwU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":143109,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhrI/SCRA9TVsSAnZWagAA18UP/0tWcB6+pZiQzBZRVkJw\nPirjjITrbolXIzdvsnlfLihl2fIoiemVsodk9EC2h9B08N6b8xr0BcG+QiDb\nW3GwFG5vzDXD6EqkudeEprUSdk3Ue44FEBnB1v2Znmc4HDJlhhLaHT5y2O7b\nIIqFHEZttxfS+RmgG2YxsQ4kWRrehvvmUnlz+kFpxDizJOW70iB5MvfVyPZw\n1DTHBVZqaITaMeKGcat70eb7DuWxpNY7PykpLUmLgjHk9z+sn8Fi9iTT2NUB\nYS91AuAB1W8zIX9QFL1nyl7d7+yuthFLtczuCkReWpWA7/bFEtyQa/tNa7EJ\nChrvzKqAjSqWhF5G1nPK6Dnk0QRQoqbUxs2+8qpReceaXv4LsS4PpwyDG4jN\nDN88hINisjBnLXsJyQJXb5yhq67bR8pqkLVwBp09mVNLpZyiImqdj6Q8p1WD\nj+o//ZZxneH7dVFcGJ0C8HFso4iC+BAwAxEUIUT0vISHp6/SuXIcL7DoluvQ\nWf0RV9mrzxXBzM1HvMNxTciHRPinz1+J+VS0NB0nTkCX1A4jeSKOHz9L8I3N\n4Hob5pQidlxLAQK+mFfhgO0vJfoCMGKiHbU7nECqgSI9alT9yEqtA7NflRuo\nLktKxT+3ETPLsRAv+RB/ctGnI8fYC0fynPj0dkB9LXGizLtk0S4HV4LSMQga\nOlXj\r\n=pTUO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f8074cd73ca19b8edf937b9e1d03e764eb540f2f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-05T10:06:35.663Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.160","@balena/jellyfish-environment":"^5.2.1","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.0","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.11","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.428-renovate-internal-patch-f8074cd73ca19b8edf937b9e1d03e764eb540f2f_1638698962502_0.9788159720811653","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.428":{"name":"@balena/jellyfish-metrics","version":"1.0.428","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.428","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b311128d20f8d2a2e3d34284020397758ba9268f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.428.tgz","fileCount":16,"integrity":"sha512-Szg6wGdOeE8o+iojInjjk9rfr133iC4nVihGxPj4O8PNI/zDOTyqUKcbpD5GDdG+YMOK/u3CbhtdU43Jpozrxw==","signatures":[{"sig":"MEUCIQDJYjWJVHm5Ef26f7x/EyiKWt548SI5GgDj+68l6VTl/AIgJCvCmKOraeyvq37dvGoGKp0ZL3j3Dozxu9iVLUWGBAA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":143044,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhrJGQCRA9TVsSAnZWagAAx4IP/2csXQ/XMClmVnzq0MbA\n35z7USTBvrklhFq3QfnLn+OvYVk6UQtoiNmIe3nCmgp2B+cJLp4pgEHj4azs\n5yiXlPmhzOxPmLSSdiFfxPUsZQ8ko4VRBD1D36viHIfvMgr0asfdyjXpa5ke\nO1jUspoKjH36oZoE9lNNWBVmy/M04HwgJlD5ioKgb4ge4ONLCkO7+PjMb46A\nvEbE9zpkcy+FA266Si2px5TEJU3RjGPS4Oi3l6gvCnFAsXgcPFdHfNw8kB6w\nOdabZz0S+dMa2kKRV9J9YNpzssMQS0rdMuGej9mmTAPgX6Dg5lI/GpRCf8Md\nLyi7ZBYhEWD0TmqwHkpBHiARSDFPR7Y2ao67fOUtuHCedfY9m3klESF0wRrE\nEcGpSOaYDbGhn2tyD7ilTPtOyV9rBPI3xYP2ZIK+WIlh4fj/0r8iQtnuNTcR\n7/HjXEn9vsP/ALjAlMM8++OH1Kj+yXSvU86Lcd8zO3fgq7HDGFTBo53rDxBU\nn0npKjE6mMH6HnwoHymcI5Mrak32D/IhcgaaGtjKuBzSBSPKem2BaF7twCi+\niVpCgc23m1Mc3gDcTztrPMmCLi83XKPmGk4yIFkwG3Z3yXozhUfyrQ9Is6w6\n+F7q5AZDPXjgP4oEFENMYkcBa9rV0uNa712Eut1lGE26ye3OAd4hIhT7QBIr\nLhth\r\n=zy4X\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"65c03bede0383956bd7a9064e226caf691cfef5b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-05T10:14:06.301Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.160","@balena/jellyfish-environment":"^5.2.1","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.0","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.11","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.428_1638699408341_0.8645442009622037","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.429-renovate-internal-patch-5a79e22eb097bb506a208f43a2e568d6b41401df":{"name":"@balena/jellyfish-metrics","version":"1.0.429-renovate-internal-patch-5a79e22eb097bb506a208f43a2e568d6b41401df","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.429-renovate-internal-patch-5a79e22eb097bb506a208f43a2e568d6b41401df","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"08f1683e7e16e045974934632f6752f439759a87","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.429-renovate-internal-patch-5a79e22eb097bb506a208f43a2e568d6b41401df.tgz","fileCount":16,"integrity":"sha512-N9BoVsK8vwpzTb2BD6ts22jjc3tl/JqCNZOQHKfpeDMGEj1sCsIj2IvKi5gCa6kQoo6q7q81+OmiogDHsRrarg==","signatures":[{"sig":"MEUCIQC7opiD8+L5XzXsx7QoD6TWJDmDrt7gZrtf8McyCYoIowIgGXhz4CQoERFtILur9OnZF+9x2Uqsq2onVovHOY49eO8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":143181,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhrLLYCRA9TVsSAnZWagAAgZ0QAJ/mlZ2ii5KipYFEBY0f\nZsnDL5aERiCZ1zQvAXXxWtpCm+wqiw85kcOKvgFiakY7BHPjdYJ+6zSQlICE\nC9i9WHkcx89rlBo/jFOMIO3DsZaoQDPB7yxzp4aYp5aoKaccp7eu7gHIpCuT\nycNHwSmS4ykGFaLhvV2kQokNUhOPWYQhdRRUGUWDhrX7iPekfPpyLoHdq3nV\nzvsvHcpraDWNG5mx+TIt4uq9tUaRGE2GUTa7JO9p9Eu4XQPv8qaLBKDTes/S\np+9aTzJq0ENpBsKKJv30bSXhTDv3De6jFDPwOQWKtB9yhfWbuk53soQXeHPR\nA+Hp1jHHXyY8HynAyvbIaetVZGvsf69jmaT2/ap2ae4JateEU83aYLDT5Ddd\nQ1vm6nVHxle88QHL9lbPud6PLTFKvYQR/FEOBfZzyiFECc/kKRG/Q6XSwrx3\nwgrd/y1SpjDAVwgriN52aqkq+JuUY34qrOHvMKQv1s1riFYapc7ESLcHzSJV\n3Ft/SgHuV6Y0kWhI0E36DYAZlM2z5jPb5Q4o++jaL7fh++dxuDe804nPipxu\nZRrUMqCYOSUOtJ9wbQLmLsuq55W90WduVUuTi8LXCh4z5ow7Q2vcMVwGk5AG\nCOb9dYCJr1Qp2e/sHo1GHXgN0Xi8MNQ8fcHdBtTHzF16lMiQS5igRFd5gEf3\nAY70\r\n=6IpK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5a79e22eb097bb506a208f43a2e568d6b41401df","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-05T12:35:41.433Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.161","@balena/jellyfish-environment":"^5.2.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.0","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.11","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.429-renovate-internal-patch-5a79e22eb097bb506a208f43a2e568d6b41401df_1638707927886_0.20872999645570744","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.429":{"name":"@balena/jellyfish-metrics","version":"1.0.429","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.429","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3e387d711969a6169693beebc12176537c5bac71","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.429.tgz","fileCount":16,"integrity":"sha512-d7e3C2Df2Rld2BkL9bQsHcEvwAcoVLTDHOIytVUizB3C3dtZIvUmsnMimBuPSvEVZxVxXpSrnbbHnalIv7J+fg==","signatures":[{"sig":"MEYCIQCSv8vEmkKdq8nHJvdXrcNlDMzb/zYJ4qM8DfFYofTgwQIhAP35Kn+BoIdJXC+ahCDjFmHHmT6rz+64wLEElVKsps8g","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":143116,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhrLPDCRA9TVsSAnZWagAArkcP/jX/XAASqAYUNbKMOJwX\nAs4hpv7pWsoHplZ0A8un9eo/AnZTfOphFPp/SGNgWIomuM/+h32BF9iBKRjG\nuVLhDZ0zTOy1NV9hMXcPRD5VGOvfXSm2pjrDE9Lsb8qkr9LwPbmV8btNltT3\nnhGlpU5ZIfTgCL0ESQah55AOfOXSiLoI3wFIT5iiJbiBcs3RLPy51NyntvAT\nINiAZvX/KT6zjeaEEwRvKmddyeqsMzoQC+l1it/r6vXU2ln3d4fhCAW65fe4\ngQIWlmLUjSWLIr71O8t4qh5sGzM0ggxnp6MMxg2cSlNk8Gmcy7uqeJRaOD29\nAUhpu1JPpWUS8dzQYFlKmjWBhdyJ3OSUGrc84g2E4Q/Hfh+L5LIcDDyfihvH\nOe0IRb0R3f3UdP/OhVuYlo+oBV4gLYWARJqaWjOjrxK1eodEQCsE8hQtBfJK\np1mTvtTIOrphxw2hMdFOwthULIhcYr3DDQMawhw+3inxpQ0xh9+K3dk2vRov\nHADcQCrn4KvIm+G/GQwrMLt9n9m3PjR1jJ0Q+Z/sDDLN/C5v6HRd2vWnUqmN\n7QTrEflh/OTZjPz/L3kkbsUZ3xK+FUQ1U6GxZJmDpzHu65BrlDI4hBH6LI87\ncq+ehO/mCavZoXSLMx6rkJXDT8WSHpVGrBxNCy/pyKAy+qupnlSzsJbE6fPx\n5pyj\r\n=AQp1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d1548cf359a0edf2fdf76725443435711ffbb5b8","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-05T12:40:35.632Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.161","@balena/jellyfish-environment":"^5.2.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.0","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.11","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.429_1638708163070_0.43383621685584917","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.430-renovate-internal-patch-80a00864caf9294f9efff85eee89ae51757790dc":{"name":"@balena/jellyfish-metrics","version":"1.0.430-renovate-internal-patch-80a00864caf9294f9efff85eee89ae51757790dc","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.430-renovate-internal-patch-80a00864caf9294f9efff85eee89ae51757790dc","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"76ef1af9575ea64cfed4380b09eafba3507ce4dc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.430-renovate-internal-patch-80a00864caf9294f9efff85eee89ae51757790dc.tgz","fileCount":16,"integrity":"sha512-H5toYqzGf5loaIpxfrt4mZmVuAbiqFF8aDp+Olp4/iJxWtMHIum9pCtZ7nv8yWA3V1NyCiLlE6f0iljYw22VkQ==","signatures":[{"sig":"MEYCIQChMFMfwMTkJvmTRoSU97JxDBJChR72U6Z9oq0Z2TP+lgIhAKLMPGHSfvvne2PxH0d1Uoi8Ki6CauiT1ZQN/7TyRJoP","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":143286,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhrUVVCRA9TVsSAnZWagAAPQoQAJnR7/Eb8R8e9BYwcflb\n/iiuaANSbWlDvQbxp/xRm8gmqd+gHUxFDXVc6Ni67foeV4w2slaSexsBMdbC\n0bUfyIUdYXzZwAxV0SlwdexME3+PUJhcHxckyIC7YFNlTnzGKbC9L6XSdyMX\nL9mAm606QRxQyckKHURV1S3SRCSPgWdfWHcQCqlMKmEduRBbrXwHK1RRxXCA\nY1sRKKhfFjUrUYLkZIV7bfJk4ZUrbcS0R8Z4rTFsNUeWRsSSuDHNP8N0EdK3\n94O+68B5w0BRU368+N2BBO2NOTgP5agCpLN7yM6xY9K2WKLUookQyVcycI4g\nsKeDgZB61kq0jX3xs5GMJ22wbqNc0LcxvBw9XzwJkUAnN7JkzslVzTTNz6WJ\nGL7EyoLYvJVVVyBMxhxYaq3K0b6Jn8SaesmIK15D+3XRpbc4BV6TBb9QutRo\n5fF8AmA3ldTSq4dFu2vR9qHf08Ldf1Tq7SPLMoPEFBLQLs0qiWfajl2HiRnK\nvfhm+wf0wiQXEHW0fNZb64XpJpGwE6Fq/o+dD25lG1yJqWaRJCPC5MG0Swo/\n8Ireo4HD8QqaDLhKS6sZFAa59k7utEeD84Ld3KocDaTnAJJ8sxG6G/fQEc3O\nBFY9aGck0gNjXK+CzqC75gj6kiNY2J61L2PkJr5AQae0mikcJmxHR6xsz1Is\ntTa6\r\n=PuVI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"80a00864caf9294f9efff85eee89ae51757790dc","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-05T23:01:03.186Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.162","@balena/jellyfish-environment":"^5.2.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.0","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.11","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.430-renovate-internal-patch-80a00864caf9294f9efff85eee89ae51757790dc_1638745428953_0.7920466428367026","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.430":{"name":"@balena/jellyfish-metrics","version":"1.0.430","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.430","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f84dfca79bebcd1d0cc8e3ddc9b77417cd46ef96","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.430.tgz","fileCount":16,"integrity":"sha512-Nc037tZWaOGXH9eBhSeR3CeTHr023P9noRkwvHDAyGdb409jYr4hDwYpyZbhrRxzkO//fbnZ66uAOPyG5EY3eA==","signatures":[{"sig":"MEUCIQDlkuhXtwYD3ddNJqiTuE1z448Q1lvtzxDWwMB0TVhK8QIgPZRTasB+IChCgo+i+9kN+i8tg6xvPIWOyPP9QMemlJg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":143221,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhrUYACRA9TVsSAnZWagAAZj8P/RJ1BBtUYsFDLxurgZyq\nrnn+EnY5T+yKNA7LueaUNZDdr4HkPGDXOzi7X8vzUjwMtfafn7Ou2cMJ8l0i\nBzGfsEy7tt9cLHqbduq5zM3o1ug995agXEa2S5dcVAFycElfVDvZhskwzbp0\nsUSYRqQ7JvKCEOtyNQUofir+E/YZyd1tNH3WkBzOUCfT8DqalWrf87y8TN4Q\nmEi9LDoeh4cKaumAf431iRtOxQzJMeZVXZ3pwwzLxPlTUnk1cm4mCYBqRRFN\nSy917ubMfoYy6KpQPTY7DDAExjOaA9hXn7HNtgvL5mU4kfMJLVp/O2ZoE+R7\nYoPVO5aqW+B1Ehhrn/1ilPS1AZradGxYFaoB1di0yn4V+bLzGQU1Oo3QGX/9\nNaVt2tLgU2e/qNhOBEcmXnNorLOQLg/IBl6umtA9C6ecy8aRRDJE07X0GgoH\n7yciQFfAW3z/mQnJSGr98X6ISzEu0uNvXncvvcUox6wiEgovnHdoKHw9j/uq\nwznxegM3Fa+gNBFJQMGLkm8M8in2D70v3recNHrV6lhgDpLe4nfQ7Gt0V2sY\nuariCRP/75ercZ2bKg+Q+REN8SOWzhjsO9mta0EArFlP/4DWp5Mj0pRmxgOz\n6vqhOYbySTaMOhUQi/tu+I2IC1gjtg1P3dGM9atTfT1YRNMN2GTGePBzgAbA\nfOXv\r\n=2qcp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"00dea84457aaf5740844bfc20fdd7f69f378435e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-05T23:04:41.991Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.162","@balena/jellyfish-environment":"^5.2.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.0","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.11","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.430_1638745600348_0.9379114215610203","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.431-renovate-balena-jellyfish-environment-6-x-7dd6b9e258816b18326d535eff7650a931a72102":{"name":"@balena/jellyfish-metrics","version":"1.0.431-renovate-balena-jellyfish-environment-6-x-7dd6b9e258816b18326d535eff7650a931a72102","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.431-renovate-balena-jellyfish-environment-6-x-7dd6b9e258816b18326d535eff7650a931a72102","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6d45ad758cca61754c851a6d5cb95513400725bd","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.431-renovate-balena-jellyfish-environment-6-x-7dd6b9e258816b18326d535eff7650a931a72102.tgz","fileCount":16,"integrity":"sha512-R4ZP7mSujA1SO+I/vgkRLUVzBh1ktLcZFDeIOoz67SNQjGcVS6dhIHJnxxg3A6tQQy+HWg9zzg9tKSt6e5gf8A==","signatures":[{"sig":"MEYCIQCN9gzlt6lJBEZV3jAHSp/fxDjvQsWgYwjvwlJafgODBwIhAOoaaUZczhcB9LlXue1El/4PecDWM/x5LOoRZ94Q+6HS","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":143408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhsVNnCRA9TVsSAnZWagAAN7YP/2v1lGSsqDDu8b1qcs1K\njn1CkgaxE/teg2IKZOsrfI5zkfEPx9cV6Az3Hw64wmGGYN0RaYsMPVsfKeI5\nilNKb0hpCz0HGy3OqyTCkARZWODHit1wOz3enjmpFrNNpy6YyYzWZnPXv0Fk\nCbBQ5YwEzZddWw5iwThaem0aNtkg5PRdK4RSSoa74r3r1PEmezM+w6LTYkwr\nkrU8/NZdeaKZO9xNf138Yz7/H0ZVuzGgRjWoor3lsby6Jw9IiimXAl2iD11Q\nI/SFENbX0xawPhkWXgzhogZWKFbXv6PX1QCpaXCzQzEMXP1KuGO74fyFey1X\n5yB8YVRUEetW3dXJmrhKnkH07a508BwigaUqcZAgT4dL38NpqaXJSo6UZlAg\nJGyA+xIzdJlWzhpBzDEkGilbNqjbDTXZmGq44dD20RlVA+iQOoyEfaDqv01S\nsKVKbA/Od5M8MRTpRHOHXU+2ibikZpvsLZab/YMFV7S7wARQYh6cMF1hVIu4\nFwyu1nV1POilg3yl511dtG85LzWYgrG5e/GJLN89zDaUlZsiL6R0A53A8w4O\n068D1eJnv6gKoQ2QQ7H4tINCxOfkvT1Sf3vU0r4q27tla6HnCgWEsrpzjSZs\ngv/4B/hkx369X5bUcdWyZIuM6SMwhjDFK1TqVh3eH0+ykkRm50NCabFsFDYp\nA6Cq\r\n=YqLy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7dd6b9e258816b18326d535eff7650a931a72102","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-09T00:48:52.200Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.162","@balena/jellyfish-environment":"^6.0.0","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.0","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.11","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.431-renovate-balena-jellyfish-environment-6-x-7dd6b9e258816b18326d535eff7650a931a72102_1639011175609_0.4348876220688367","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.431-renovate-typescript-4-x-a2bf2f333361682db8f91ccc79a9ca074e14d2af":{"name":"@balena/jellyfish-metrics","version":"1.0.431-renovate-typescript-4-x-a2bf2f333361682db8f91ccc79a9ca074e14d2af","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.431-renovate-typescript-4-x-a2bf2f333361682db8f91ccc79a9ca074e14d2af","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"79f5f0327f06974e11f147424a31aa0681350c40","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.431-renovate-typescript-4-x-a2bf2f333361682db8f91ccc79a9ca074e14d2af.tgz","fileCount":16,"integrity":"sha512-qFj2NWK7mLEP5z/VLABPgCiK4JENWX9eiFXxB54+Ia5+RZD/iHoKOIFSb5o6wnEj8IPOCpWpwv8Nh8vjlpbBnQ==","signatures":[{"sig":"MEQCIHfdgCXY3OqsnrdzzCM/fN6tjfjfl8Y16zth/HgH0vUdAiBWDtc95c5XuqDTbyI13LyR77KcNky5HG8U7FvQL2sUyw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":143375,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhso5yCRA9TVsSAnZWagAAmjkP/2fGW5heiJBspavxrl1U\nHzczjBvH5sT6AYYRyP+tVtiWuMk+jp4wABnKUXCGVRJjYUzMlizTBBqA3Mh9\ndol8bXRg5tZa7jVVyZfjPprmzOwjMA0xNps9V9XY1r3/17hO7naQZ0IA0RPs\nxornv+JVDvY4xtd4f2393ISQQqes3jLGq1u5HZvv895BokUI1mRl9bxOi+6p\nP8qsTOkZsWYLgFvngyeS9FhkaB2hWvEoNmUWGPZMqh53jijUxLfae6eH5RuW\nhbS93tQ0Tg59vUSVuyMVv+TSN0U8R8C1EajQjYv7dV7uw1DW93ppmxT5MKVP\nvG1QDoFOxtHioUQ7+WeVYRcvee1EQmlYDu8VM16CNSwNoJMlJsaQIt0KFR3P\nO/8AHwDX3e16Zm6/fmbHpJS3ilnsX/xKrayP075IBX2iThe1JbBeqhqME4vA\nsGeBetU+HiKPCiQEZG43Uorb9nSCZa6Q2slp4hKNYeiQl+mchOIh0KGQMIXF\nHSvTeuQr/V4iYl3U5xrXVbIDSdGt5B7xcJowN4H8/S4UDG8oXisvEGP7ZSQm\nGrrZJZuJkLvf2yxoYuKsKzG1/GPSPOR62Ox/gBQ4fMZFWZ8ykA3LtBTdcjv2\no7hmnbx2T3F50dS5E66ZffQxsmGUID/00C79sMkjO8T76b0jBNg39rwiSXff\nvvl0\r\n=4plG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a2bf2f333361682db8f91ccc79a9ca074e14d2af","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-09T23:14:10.805Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.162","@balena/jellyfish-environment":"^5.2.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.0","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.3","@types/jest":"^27.0.3","@types/node":"^16.11.11","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.431-renovate-typescript-4-x-a2bf2f333361682db8f91ccc79a9ca074e14d2af_1639091825875_0.6183265788454702","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.431-renovate-balena-jellyfish-environment-6-x-74c2640fa4e9028e13208781df7cd5f4a49d8c8c":{"name":"@balena/jellyfish-metrics","version":"1.0.431-renovate-balena-jellyfish-environment-6-x-74c2640fa4e9028e13208781df7cd5f4a49d8c8c","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.431-renovate-balena-jellyfish-environment-6-x-74c2640fa4e9028e13208781df7cd5f4a49d8c8c","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"eaae57e0df3bb8765e76c0d6cca110835508602b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.431-renovate-balena-jellyfish-environment-6-x-74c2640fa4e9028e13208781df7cd5f4a49d8c8c.tgz","fileCount":16,"integrity":"sha512-TNuCHKaw2iP6RRMY9IFFVStpZGpvHAG9ZuhS8mZRfdg2DfJ7MChzKA2+K/jrz/FzOuWUhtRrwtYSQ820iMV5Jg==","signatures":[{"sig":"MEUCIFZ0a/kyGCKTHsoi3Pl+WTtdcsYW6WksWy3+9VnuuAQCAiEAoPZrt9CQ+AS/lk5KRb8nO761reDayLxySveTj/ZIvSE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":143471,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhssS1CRA9TVsSAnZWagAAyVgP/3QwQ/vThF4N+BmQULAq\nDuTlefEjjownvPQjxfc+LKxQ/bT5TUQaKnFDQyzsxXXbwSCuXWHVoEa2aSyU\nt5zCYLfLDpALCLGras9LuCRFUxS0kssbF9Ah2EVwglVrshZkQMPt+ZUg8qw0\nzhAEuWdCeYUOYpEbaQ+HSo3zAoRQ+CwcRtoGpQTYtzDNY5vRKs1fRFbDz6Ah\no5ggeiE1K+MtM++H3KxcuZKFVdaW2J4P6MseNQvzpYQYCYFdW2IFTSWzRbJ3\ngMiuEPEwQZRoysgXLN6297jrztn1+zmZWp6rmQ41BmXC7uURdw63+uKBjo8u\n/PI+T4UNVQrbMEgJVgMf1rntiB3ZRkbC+vWevhQywbvChnk/tQji4cpnfwiU\nAMvjlI4IXvbXlfc0DTMNPbMBGtWspxtspQArq+pjHeoHFPO3E3QCiDGD+NIx\nuNSXACtxuzTA6itxE79x0fGno2cRHnaMeckxqzRdqQMEVkKXPKIZTCyV4x39\n/GxEUtouGXmk6BCvagk5bkd2sAv46ANJDncl0s1QsvdxNobWM61+yWNEpwfE\nG6wm38wSWCV94d0eSmS8FQvHS6llEL7x3jaMKLyTsnWpk9yvQpaljpKpvm81\nkeg3bTXLpmvN/PBzmjXctSnoPjLrgnYOGbZqWL0MWy+qF7VDCZRJowTD85x/\nJz81\r\n=T8cE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"74c2640fa4e9028e13208781df7cd5f4a49d8c8c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-10T03:04:54.459Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.162","@balena/jellyfish-environment":"^6.0.0","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.0","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.3","@types/jest":"^27.0.3","@types/node":"^16.11.11","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.431-renovate-balena-jellyfish-environment-6-x-74c2640fa4e9028e13208781df7cd5f4a49d8c8c_1639105717427_0.8686133711664978","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.431":{"name":"@balena/jellyfish-metrics","version":"1.0.431","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.431","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4cd14a0dd7764056c6b2ed073ba1a01360e1ebfc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.431.tgz","fileCount":16,"integrity":"sha512-KyQAhobiUKXeYytUkOV550qb1JI7p9abkgsspSfnMvEu6iGjeo3rOBDrFV2au8Zijg+BsmE8GUufpO4QSImEOA==","signatures":[{"sig":"MEYCIQDQL3Lc36w6tjge0CZKQ7iks6rDMMClclolYHxvqrKLxwIhAJ5MwkCJSp/vsOpBEj2cpKSzO5WiMcRGRTli8b3TAL5u","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":143388,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhssX7CRA9TVsSAnZWagAAONcP/22gBU6IooO6sElak4HI\nEhcwdeWCfjE34l3hRi7qisBrcCxOYOnxjDB3g8HgI8jXIHRqaAEynIFKEte8\n1BErGUM0+7kEha1hrLJUVzlJWRn0KbxnpLWw4U1Rg6ml2Ai4KggbOYNCxSNv\nQVGN8sxzIJjAKnZgYXrQHIK4UC4PwwKaSx49ra+nexsF5UGbkaHE7e9vL8C0\nVj7JEWbW0ZUGsMs2jRDKbqLdapAURcn4+w4DFEbX9+YirZD9Cvzhldsa7fsc\nnAX2YwsjFsCmhTaVVgyUnLctGoMTHa10358ZcP6LYLouG+w8FC9kyTZRt8JY\nfTSmJbL/PuXcNRu62IynetyS8ZtY0t3idDl+m2Mj55RUjMvsLuFaGuMGcBYn\nguN216POD7tjQxhg7LPe6OgmCe+GmqoPdYHPA6fZnacOZqZbfNojdxlpM0dp\nTlH8yBR+yopSfwszNis5wFNSfXa3EPqDw/S0bod5mMyDX81sMlVkjJTAeVzh\nujHtDqNDwX6P05fIO61LEgurZqlPsk21h+jCDEYh67/h8Lq9YVfbbgWMdyos\nHz9Ob1GZt2O0f7+yIk2Uz0Lr4j4b0MwSU6UiWkYkP+Dw3hW8In87g/pJpOS5\nGFKWqPPHwRAapWoNrLXXsHYo7yOv5xGecyPVOm7zgQOrj0O2+68TQnV2sCnb\nPGYM\r\n=URd9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"086b3365c02a737109118c8ec3b97500cfb82fbe","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-10T03:10:43.419Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.162","@balena/jellyfish-environment":"^6.0.0","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.0","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.3","@types/jest":"^27.0.3","@types/node":"^16.11.11","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.431_1639106043572_0.7101549379049603","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.432-renovate-internal-patch-123865b93202b627320a7bf16fe7ffe21de38b8a":{"name":"@balena/jellyfish-metrics","version":"1.0.432-renovate-internal-patch-123865b93202b627320a7bf16fe7ffe21de38b8a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.432-renovate-internal-patch-123865b93202b627320a7bf16fe7ffe21de38b8a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6271f5ae62b00e868707674fde6fc3eab545d656","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.432-renovate-internal-patch-123865b93202b627320a7bf16fe7ffe21de38b8a.tgz","fileCount":16,"integrity":"sha512-f2dFACfInZsDSa5v/0v+cW0B0mRYuzKt6mG65kRz3S0sjFl1bDHRwpuLIehfv0Wnio0ducQl83usmZ/R0yNbAg==","signatures":[{"sig":"MEYCIQDDQ98D3seLuPGeNouBsDlMe4lXy+yv0UMjvJXCVQqQTgIhAO1Ui2BrQ1rlsH7xPp/FsOui3ulBdOPfzidZ57JtqLZI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":143558,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhssc+CRA9TVsSAnZWagAAqfYQAImY0yTLOrDjht8t6roY\n5K8LYp3ayjiuumpiaU9TY6sAq+2dxoYMhshRzM04CvhUGaCjcsw/Ub9MQ/H0\n7uP3Wdl0PQ1FMQVruOkWSq8aXX0hxlEwbSAgpUQr+nCeKAhSkAcaq5h5NPCh\nOmd3W4SC+6JooDJ86H/6Z3rG/4/FN/2KXvaEzCjAwD54KGyDuNB7lV3LS2dL\nVxpaix8YhjsZsQWG9Im2xGGO5X+3pJrN9zsxdKJs+JeWJ7fFFss8E9xmscXU\n8f9BWX8xAnMTqBxZ1fDwlhSQPLcjywSxKUFzzvI7Uo3X+lNrZHBAOzCD+/XS\ncBAohec3WuKMs8hnCpcFT+u9YDvZfaZVLNKBxeCL8uDPnUG0+EWsdNwZUsZS\nrTcICc2n1rSTkN2ykVm062H34D2KSRZ179vh53+dttWppC2XLtJlD36PnTH7\nXJIPqWGxIQpYa5GxQOh3fNiy60noFf922oGaX4fscJsn3k6F1J3cIXhPDw/H\ngfP4iIWtOS1lOV1QDMxOCSJ4zHta7cuQv4VcdHEbth4tjZL69GQe7keTdl8U\nLIovPF1YFgp11LgMwEmI/vG8ks4rAEn+7xxV5ggBseTYXDy/w7OGU+x9pcNk\nrZMd5Uy7WDT/A14ryE/O8txXih7uyfUY7ZI/5d57qTg0sdacILW4eK1uveAH\nqh3+\r\n=qIvl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"123865b93202b627320a7bf16fe7ffe21de38b8a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-10T03:13:31.877Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.163","@balena/jellyfish-environment":"^6.0.0","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.0","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.3","@types/jest":"^27.0.3","@types/node":"^16.11.11","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.432-renovate-internal-patch-123865b93202b627320a7bf16fe7ffe21de38b8a_1639106366632_0.9834124482164728","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.432":{"name":"@balena/jellyfish-metrics","version":"1.0.432","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.432","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"41ab515f5fb1a92f69c4508911bae5e9c525ace7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.432.tgz","fileCount":16,"integrity":"sha512-a4NvP5OnZDoa3QpJgb43tYF+DTxXYYAbWcAVKiwln62lBfNvq/ir+69s1KoeYAe72gGGixwYeGqs2hMv+IhKBQ==","signatures":[{"sig":"MEQCIHf2Oecbgsgo7CepWChX9JnLHo9i3VU0ZyocV3L2eT3nAiACrFb3v3cUn9Dbk9UZxDtJX+ieF44hb1lXH05z+coXTg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":143493,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhsshWCRA9TVsSAnZWagAAkMEP/AxYtJyvt+9FK4QT7YAL\nR6/XbKQ70JOUVMmr8czju+aN3j388JUxQTcDBB1SkJnxJK/EP/JvMrmnsHO0\nzSXA5nsi63GW8MjKNoBVWbmtDhvQiJAHApSa0RU/ZGdqE6ud3RFa5YqfZ8Js\nirT5FnRvPvFVvjeWPFeAXnJSHXfm0cPB3uUAPeLBHLMAl1cV/bS3MI8h2A8+\n0xV/i+QF10uu1viB71oYdRhoEZq9CxM6qh/Q7+PkM7M+xoVpE9UlB2T3iIRR\nFDJXJopTpDXtNKRRe+7I/6cvNN0DBR5xe70lk7VXEPpLR9cIA7C5KwWT10sz\n2Hig1FYGVb+rootC4xUldwb7yWkqNlOzAA3WAY+5YknhN+BFyhMRihe0OvUW\n2T7EebRjRXFg+SvrV5HVhJRHD8ZOMaSJvTF168BwCr2QWWloWcgAN9b96VRt\ngNyP2XlHEYm147eo0+ZeRGi+nQ2HZSxP/h1cxG1zON8zCwYfP+YHwx7N9Eg0\n3pw7NyynI6QQStuWXYiUut+bym1U28hR6a0LHTSIu47pmbOmpaZ9MJZnGmfO\nBF4O/my2pysrNn6d6ddynInHzaaXsn0Dgijvak7kDTOjWq7NWYQJXsXynFx4\nvL4VfUgHUISG4FXfsraxybAGrUW7yMmwRtCgxlaQFdmnvWh4+y+ZCVo+JiqN\nGrbk\r\n=8FzQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b8100751f72f8cbbd59d0e9ef9023d122cbde2b2","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-10T03:22:01.954Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.163","@balena/jellyfish-environment":"^6.0.0","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.0","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.3","@types/jest":"^27.0.3","@types/node":"^16.11.11","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.432_1639106646697_0.11727157447918013","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.433-renovate-internal-patch-d3056dd386731cf43d32b6c0f07d861e51e65319":{"name":"@balena/jellyfish-metrics","version":"1.0.433-renovate-internal-patch-d3056dd386731cf43d32b6c0f07d861e51e65319","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.433-renovate-internal-patch-d3056dd386731cf43d32b6c0f07d861e51e65319","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"45357f08c7f208164a00033999f220a5c2e942e9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.433-renovate-internal-patch-d3056dd386731cf43d32b6c0f07d861e51e65319.tgz","fileCount":16,"integrity":"sha512-CaQndLnr5G5/LAIQJvyx09e2By7uYS5vj7keLY+iGIRLdhwTd5GROkVUyh2i7791N9WN/GPoNLkXtXsIL07Ixg==","signatures":[{"sig":"MEQCIH1oRds2dHR7HdVlvihAs3FBANVdubglfJVpa2wptpGhAiBmTDrQRu17ZynaI0PpomteZr2lIlyQ4VceV+gUp/dXog==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":143666,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhtAGrCRA9TVsSAnZWagAAmEEQAIiHLqXNhJhFBYHhqKEQ\nwsQcGLcjga4cHXVx3yZoRMvKITAD1h3FEUOC++K6eZe4L9FZJjgPXJFxChrK\nqx1KPTULgBBsiGVPwRqvDrTYFr1mMv9K0Y9rw7ujDlYNs8JMcL5vENQuw2aR\nIS8pStVoDu7wRpo4VozWrHsqOyoFCe1CQvu2YoHSXhmgWWILMr2mEPY95D8G\npNybITbetRv0fPCH+NZDcZy2CaZClczWcHaMyg0HbXYjFQeWuA1yAqTImqP8\nQbUMjTBreUIRTTiBIKfHXWieaTSpjz89k+Yj6SZyoewuHJ6qxiGSrqNGuiP0\nEKNuP01Jevl9iurQIveBkfYWO1gcr92hoaoYqJcFld98ZqmYFZ9XsEgxiMNz\ntV+rQdfp7PpRxuShIs7thaF7A2rfZC+vwi/ulrLkv2qFGxR4WQNZ/NTH/UrE\nO6FKJxi0/2k2PIYfMHd1zcFtJQuZOZEbc7+5C6kILzLzSNBtTXr7g3JOMCny\nzWjcAwmFv54dQ4xP/ph77etFHmBJZWLS4SkVnJh95SHmML2EWUzgX7NdOnFd\n1pPsaLv61dqk+UC+xcyGC1io9EkQcZZseWJxGGl6roc9uciYHg13GX0FlEXj\nrCHEQ21zS7iPlrCQFNLQoP+mIBbEtOlfP6KupT5VO4/sUhh6SNf3IdCxJ/wi\nWoEE\r\n=2bzk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d3056dd386731cf43d32b6c0f07d861e51e65319","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-11T01:38:16.495Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.163","@balena/jellyfish-environment":"^6.0.1","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.0","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.3","@types/jest":"^27.0.3","@types/node":"^16.11.11","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.433-renovate-internal-patch-d3056dd386731cf43d32b6c0f07d861e51e65319_1639186858857_0.44318157517496615","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.433-renovate-external-non-major-5edc5fed82d66ec1597af4ab7ea678d177b3d1cd":{"name":"@balena/jellyfish-metrics","version":"1.0.433-renovate-external-non-major-5edc5fed82d66ec1597af4ab7ea678d177b3d1cd","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.433-renovate-external-non-major-5edc5fed82d66ec1597af4ab7ea678d177b3d1cd","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"80176f97c150f89affa27da69a2a9ec5f16a4709","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.433-renovate-external-non-major-5edc5fed82d66ec1597af4ab7ea678d177b3d1cd.tgz","fileCount":16,"integrity":"sha512-xA9vLIJUTYhG3o1rcsXXU5ZA8l4NBpT6igCCkRTM9P/vZCL952ha2miGRCTqxuw7MGdmnudU/gAZVNfxv4h/TQ==","signatures":[{"sig":"MEUCIQDxLfOjNwCPKihm5dFf3Lu+oqg4kIJiIjA0HiBl+pFtvQIgYSRNBaAd2kTBAMHckJmD+Q+domQrEcPdr8JBAWp7LxM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":143638,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhtAG8CRA9TVsSAnZWagAAAV8P/A7vxvRQs0KcNNr2gpwE\np43u0XEe54H+QXBHwl7dgdMbrRxbOQDheLhuPlztxuFRwrBJ8rHQCM3Xp00D\nEaFdLIbouYGx0ME+CG0plUN9u6Ol6YAUt8S4e4Bss8d/9soXfyJz2bzeoqGY\n8pmfBDqKqosNgJlnYbm5hMlKdz8xTZXru5VBzSnUUo++TmA34u26nlCs8NYW\nq+RtNEgW20hN26wQJjX70SMCAeyqUYiuAx/up1Svzkb1OU08aiZ/7nhpf2/w\nABB3wHaKuhQar+a6Ubj7F6QgjGYXXIMyzR8LF/P9GT8q8O/iEOesSp/6QmT7\nTjEjZtTGSDzdyuIiM012GTetQGWQa7DYLN3PiA1wx0nj4DjKEZ/sOgSsXNHw\nvOxEyPA7ZzeN7r8tPZfWgp0wmci0NrnblUe6v0sr6itpugKAcrDKRXTAzey+\nrv2Hjla5JN530V6EeoQS/LB35uGA+5tsPdxNDCKE3UtkmthPwpNm8fPO1PED\noBD48DySozgEMAjvbG5TH5PXMplvDo1J/Wm2OW2uQ9CdYT/pdHQS0K6jnGeL\nuEt0Ya4tpBxkyNihyR0dgsfPnqdDZn+4ot1/sLWaZrCwvu/4bHNzUNTuyGDT\n8lONb4lWzg9yGMVu+MbTDPMxq0FgjQ2ewZ1X9Ugova0VEvUtzUwYwC2A5TGA\nH03s\r\n=BePh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5edc5fed82d66ec1597af4ab7ea678d177b3d1cd","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-11T01:38:23.402Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.163","@balena/jellyfish-environment":"^6.0.0","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.1","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.3","@types/jest":"^27.0.3","@types/node":"^16.11.12","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.433-renovate-external-non-major-5edc5fed82d66ec1597af4ab7ea678d177b3d1cd_1639186876403_0.8005432915823649","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.433":{"name":"@balena/jellyfish-metrics","version":"1.0.433","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.433","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4ace3c2248930587c1c353dfeaacaf01cfb32b3d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.433.tgz","fileCount":16,"integrity":"sha512-5QjbkXg/hy197m5Mb7ptWRjICIF7TJAQd6XgZR0U4io7DTydL9deNslfl8MdfdupbMnVKe39mqPlBz5cYhKiog==","signatures":[{"sig":"MEUCIQCEiVdDbZH2WzY9L/CJfVc97WSip7W50jIGYsXq6eqOHwIgUtmuj7/Sy9Kvhi4euGJVy/H0CNmbD+MiVCq1BTIFvAo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":143601,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhtAKACRA9TVsSAnZWagAAqDkP/j1WusOATpPfFjmggkS1\nyK9kgF5es/HYgXbU9IqHHhYxJOVtk0bzmljqdBgtsJChhEQGIT3gL86TnMP9\nKrOAJbHc5Nwangv8SspQYIrh8+eB61dfLQ4quuhrINP/Vh1RW9MSCvraBQPI\nrdXS17mebE9T8ANt1eupsB2kWePiRI3ZHl1oRll1wzitosQB7xj+KWX5OfUL\nSMIefBGq9AzbsCqDAOKCcVYTELZTQMAtwO7cV9x4nsG7/Ps68ZN10q2MiN73\nq71IGr98DhGkgFW17Tc+cDhJohyZj2dJZNedxIP2dUBurpzNyT0TY2DLH9c4\npdmjxtKZUhnBhN5P3bTbFzGvgWzsJu7R7N6jGCDTiympmwu+iJleeahHPcJM\nG0IQ5rz4euwgWK2Hyhjgv6aaZHI5Fa3YwxeajBcRIWchvJwf4X8HH44aoskB\n1YYd2hDk4fjJo9MIsE/INnkHScLxEEcFOPHgN9g+jeOcldRrUZwQveqVzYTr\n8p+Vj1Vt79l2Xb+OwGB13Uc24kfsf/hcd1SUsFTXN7hU4Xuk4jSvkEMkGYH7\niv+0gmdELIwzAms7v6jVw0BEPFL0mVRbFRXWLrYpT4+0KhvubVshmGdJPamQ\n6v79f+E0wcCerQu1gi7HG3o33mPNJyMdoPDXbiU+U7m679IzKpj3q+4U8mnb\n8enb\r\n=7Hx5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"71997ca591be79842fb87a319cfe75f0b3effa12","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-11T01:42:39.612Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.163","@balena/jellyfish-environment":"^6.0.1","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.0","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.3","@types/jest":"^27.0.3","@types/node":"^16.11.11","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.433_1639187072004_0.07601057917990506","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.434-renovate-external-non-major-1cf0825a7f3d0c4fccb33ebdb313c07073658740":{"name":"@balena/jellyfish-metrics","version":"1.0.434-renovate-external-non-major-1cf0825a7f3d0c4fccb33ebdb313c07073658740","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.434-renovate-external-non-major-1cf0825a7f3d0c4fccb33ebdb313c07073658740","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"da3cd4ce9443332aca144174c4ee7e1294b66432","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.434-renovate-external-non-major-1cf0825a7f3d0c4fccb33ebdb313c07073658740.tgz","fileCount":16,"integrity":"sha512-11a5cLl2n1nkudU2WFooaQ7e9xAhXVHQh38QZMCvD2Kdv0+JZ1DRfHZJG88nwdf2h/+EMq9obAOmDqxVxSntiw==","signatures":[{"sig":"MEQCICjzIFHYyBZySbbyQ0B5lKCY8WdixST9Bjofkb89h4mcAiATcEV2WhhAwrpXC7ARydC43lJTYCyZMfe+yaR8Ey0BDQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":143746,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhtANNCRA9TVsSAnZWagAA3vgP/A8lkXwvwNRgoznNelid\n9elPWWe/n4hLC2Q4OjaTlumau7u5jqqSqmhsoybStzt0oaxvtq7zjPLIWAey\nUqFWyRhDmE1hD/h3UdHvS0Ga/4wHwNAdZm7YUoQhwCxFnlNWxesNA8ISEWCV\ntEZOE7Jtt2SFaKCGLArXZDZ91Gju7VOFJQTMieHHz747lvQcGQ+2PruX5H1a\ny5BbQ/AZsu9+bfaOEX5uLfZ6tyI6XwECYYZvNLgFWkRwNVPCaiOgcsmGCP0P\nf3iDkW5k4tbmNkfFwgjo+w0530Co8XJGusSVo3sdZEdxLO7mfIPBWcplJbIn\nPo1FvLelg8u4dUQuMaAJfyXwdlMyrl6KepcQp3yhIRf5/jRxREYxo+5NT7lU\nvuMyB1xilKYioy1ZbT0Sdiq9LJr3BJSNj6d5uRAw+c6cwNiu7i6CoxiFGQ3A\nmipFu+RyUPtYsbF9Bg+/wlOvHTm6dXm0rhNiXFMn7KugRFEfb2qZbmhjXNCI\n+yoXnMkX4L6Neg4WKR+uLa/eIvlfAz7nwdD1R/k9iIya4vJtl+jaajY3anE/\nyNR9wB1I5Oo9f3/XwpcGXTryTdxoN7Ue1cHw0KiVzyfVwQPAP5WTQYcFgKUJ\nqoCCwwBOeDBe2zXQJuW2Fcv3KXW3QJTU9d038+8E7zgxc/1fgJqXD7KoebHV\nMMlO\r\n=cxqB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"1cf0825a7f3d0c4fccb33ebdb313c07073658740","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-11T01:44:11.531Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.163","@balena/jellyfish-environment":"^6.0.1","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.1","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.3","@types/jest":"^27.0.3","@types/node":"^16.11.12","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.434-renovate-external-non-major-1cf0825a7f3d0c4fccb33ebdb313c07073658740_1639187276989_0.8963507107461413","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.434":{"name":"@balena/jellyfish-metrics","version":"1.0.434","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.434","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"547d9d01332525a83f278b272e46adffaaf21006","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.434.tgz","fileCount":16,"integrity":"sha512-2ZAGezP4x6qbWdq6/CV6IoMadOBt16Fw8h/knTy3cK58gb1//xr9zcFZd+pWImREMEdzrWHouZYvdtN8lqFZRA==","signatures":[{"sig":"MEQCIEYTFvdGejdLnae0MPn5K55Y1viyXHDHH3bHC9SGNEQ4AiAzPkNcPjpxPfAzn8cHou7/X8buc2O4QVetDI+x5/Rszw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":143677,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhtAS/CRA9TVsSAnZWagAA2mEP/Rrzi74v3500gP6hTvI1\nt+YPD6pdZ7KHhzKvPlTeynEYUPsjlwkg5ZozaVR+ugB7qegahXcT7VLmlnZ0\nG+Q5QiqHdaJI6npXsgBdoYC1sx1vwIJ9hbImPkzO94kuXxed65T+/kZF+/52\nwtJI9MNUaS7nCysObZZTxRDfjluBByahgS6/LssKkzLy5b1FNmpJoN3vjdj4\n0zPGoBtP6Gx+n5NfHGX8p8JQw4u+KhbfeTTCtIrluJ91SaY0g2uVrA2m4maD\nyHq+3pqMUDE/+UfrRswJqtyesHxI35o0R/Pj8Q8TCCCR/X2yfdCRHPHLl28Y\nTq5RXIFnFJpZovm+1SPNrAJtbTdxoFRmz/vR2OznCu53NJlKEB9Qzg0ntMY3\nyBcV6nyd8wjuulsoDm/Qk1HJ8quE8OkRtQLr5Chj0lZrhMmM8gQMS2pdXBh6\nSpmcrxX9Nsj/pw/0shBsNzhgR9ZJ6YqU+n47rsjJ524K6elhqcGDMoSVTONN\nYhi0Gf8SNDQZiJf0iEHLA9AaT3ioICY6fIe7cEUgpDUp/UDo6Q9gGe/EC1/N\nncSpFk4mux26eBxgOXD2Jg5/guFWL3POb267+aftR8IV5RO9QIWRk601kSXE\nEEbfdhkoLC2/lYDHDFm7Zzc11KuFEYB14/58pTYiuKI5AOcdARGTMKzP/OH3\ng86A\r\n=Jq5O\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"96cf6e34376b53901f60116d69f9157ce9308feb","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-11T01:52:01.572Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.163","@balena/jellyfish-environment":"^6.0.1","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.1","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.3","@types/jest":"^27.0.3","@types/node":"^16.11.12","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.434_1639187647444_0.30686738898239785","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.435-renovate-internal-patch-213dc62f11311b10fd0438d4798d07e7ddf54aae":{"name":"@balena/jellyfish-metrics","version":"1.0.435-renovate-internal-patch-213dc62f11311b10fd0438d4798d07e7ddf54aae","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.435-renovate-internal-patch-213dc62f11311b10fd0438d4798d07e7ddf54aae","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c4fdc160e4fd5cb810d8fe0659df45d8d42c7b70","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.435-renovate-internal-patch-213dc62f11311b10fd0438d4798d07e7ddf54aae.tgz","fileCount":16,"integrity":"sha512-QoXOxtf3YIoc8aES8yt8U0LEZgm+T9Mv52Z5JQOP5xzw0idIz/h7IfOROiFUS912oVv2lIRLpc0NatymooYceA==","signatures":[{"sig":"MEYCIQDEKbMaUHLv9Ra23/soMhKUQwq24J/AlXQonY+JBhiKgwIhAKNaYy3KFBxZKn1I0ceMMfWwO9LFUgWZtwYdv/aWnupX","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":143847,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhtG7GCRA9TVsSAnZWagAAPnwP/jhxxtoMQVM5x6ngfzE7\ntw7qZtLM2hiijfxcb+cm9X/FFwMv7lMvZsTol3IIj+OMf7cvQbsSvLxfUXrC\ndRpBIGrgz/LRPbiHVm8Q1hpznubUqvUubhrHEidMPqIAEk34ie5OmwIN1RSY\nXg9BBeLJj23sFypwsU6RhxgptnSiQrzsDjs+Ep+eYHbefTeXsBj+xsYfF+in\nHJB61yEDn1ptTGdXC6CNK8dBNT5lKnwyxjRy0T2/j213BHpJIkWyAymKCJ9F\nsDeJnp7faTCjUZl9TkDjlKMMZwkhtfz/WqykWvUzbnODeRRtOwnyo56CyE8P\nTXGNaImaxRKFW0xJBUIG7BxyCm7h6X5dl0Is2dnbFa9b1p65RKaoeXXJXNOV\nnA7uOnZrZqM6LByX9hQZ8+BBd7kg/Dzz5l/5IuIXQ6Dt3DZzuqOsVdfsEMw1\n9lOnZl1sTwN4gHGLl3xRqUKgEcGcgq2p6k1Ko95yBegHw3kcwGyC4oi1IFvE\nymhiZUGjdOsdQTbeHx1U2nJ9ljvPX3Mhw2dG7wnJsZKS2v3YmPJG1+myXw8M\neIPxQvBjgZcihB8chwuJYevpmD2tmlewWz3G6QBPKYRCtO23WCKKgpjsWuum\no8IigZNJC0U+VYCjyYDqeu2dTKYtIpsi+dNDiSnc8d1PX9HTY8cGChTGnnhE\n4uoB\r\n=SePU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"213dc62f11311b10fd0438d4798d07e7ddf54aae","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-11T09:23:15.064Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.165","@balena/jellyfish-environment":"^6.0.1","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.1","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.3","@types/jest":"^27.0.3","@types/node":"^16.11.12","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.435-renovate-internal-patch-213dc62f11311b10fd0438d4798d07e7ddf54aae_1639214789964_0.5237378002622768","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.435":{"name":"@balena/jellyfish-metrics","version":"1.0.435","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.435","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"999f18a32fe1a4c37487322d582b0e7736df5ab0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.435.tgz","fileCount":16,"integrity":"sha512-lWkM3iFL0hxlLvpYGHgsMZ5Hsz8Z4JWFdoG+NEow7M/zE+HK1cXYXgjpSoI6c7bz/kC+IHCfr8ne88is+otngw==","signatures":[{"sig":"MEUCIQDmDmZb3swlibSUpUjMMeJjEqpWwRfVuLrWjLi8OrysGQIgBPyDVVJ+8khUI145qVeqiPtbJ5IxWg1HjQLmvvC+OhU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":143782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhtG+iCRA9TVsSAnZWagAAuLUP/0fRP0Q3llnEPyyfJlOM\nqAg3qOu+Ve8OnuppscF8Wf6LGcBaxCJS65Tf6h3QAwUg0x2fjCwkHU/pjEo7\nKSxjyA6LHhLrZd7lnkNULujeHLj6HOwEEKarImvuKckBS9tUNSrzJiD31utn\ndxryk70Qpbt/llywjeu4BsOqszfg5Feql23RazKCRfSKzbeDXSLVhGWw9qD6\nJv0Jpr3JZuj9soMQRpvtxARwda6eUIbhf6dzSQr31+nBDcsW0rZDLVNS+0y9\nS9wEFjwD5+QEp9gJ6cioDtQyjjKG2V7oWUM50aHYmth/Yrt8P5cxkGKzw6Mj\n1ojNuQ/JF8iSG/+y5JZj7wuzEl/Y35/OENvgMCw9xq0qFF21+lJNmUxANLfn\n5RzTWkvw85BQMyPydQbMPnVdP9dhYdzZfhvWsz0ALgEcs80k0bEo4KdTDVzk\nq8FGYKTZ7JNA/L3j1JWCrLNT43vqIfq2M2mX2LU6vXJPEdB5bG8RTq9f+xxB\n3zOKstt0haZAWmL3oTntq2x4T5U4sL8RAeHjJd54RALeZa/bOwJb81mgdnMT\nH0PhwYNiIJrsq4vc9n+CW027fXJY5uCOtY6SsscfQ2nPVRroupcO+WmMji+O\nn8Jj2zK5mIRf5GdrD2CsYtpXveDQJ49A6hcVi8dE2plSpa9nz37irwvOEyeh\ntpSD\r\n=XD3K\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ad039e51142fa3ec3fb07ae6a1be33568a9b5274","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint && depcheck --ignore-bin-package --ignores=@types/jest,typedoc","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-11T09:28:15.266Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.165","@balena/jellyfish-environment":"^6.0.1","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.1","typedoc":"^0.22.10","depcheck":"^1.4.2","typescript":"^4.5.3","@types/jest":"^27.0.3","@types/node":"^16.11.12","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.435_1639215010749_0.8494612961470147","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.436-joshbwlng-drop-depcheck-c1a26052a3bd6cf2cecbbb72e9e718f4f8d5d461":{"name":"@balena/jellyfish-metrics","version":"1.0.436-joshbwlng-drop-depcheck-c1a26052a3bd6cf2cecbbb72e9e718f4f8d5d461","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.436-joshbwlng-drop-depcheck-c1a26052a3bd6cf2cecbbb72e9e718f4f8d5d461","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5cd3264f5d93b873b32f61be11c0a7281b06e005","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.436-joshbwlng-drop-depcheck-c1a26052a3bd6cf2cecbbb72e9e718f4f8d5d461.tgz","fileCount":16,"integrity":"sha512-ZWZoBqo44QFUTeaYiTOR5yBlJpBBnfKaQW5aAnR6ai236IrVmvKu7B/WP51Db2VjW3thoO/+Sxlk9gCiycCXyw==","signatures":[{"sig":"MEQCIDzUJkXpJMTDoDzo9695GdCUK5O+dFKXfMQoFOL0XksSAiABKfiqrLehZ0CWpUV7tNCxHB2/ebSTyyUaAkJJnORFhw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":143832,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJht/gICRA9TVsSAnZWagAAWEcP/3YDdVbYuxXwQg3XhVuV\n3bRxcWhkt6/rza92wlxKeQ06vCzmimYZhuZ9BayBEsj7xYFhfVOMFIXD1BS6\nk0DKw158zgAOUSPwpcF01087/Pe4syYjCoEozKNQ/HSNsChV5KhDs7SMS5lE\ns9g3uVfwxDWFgLoAUMtUH88lDsyDmRRdlz5G4eX0VFhfftzXJe6B8o8+3N4W\nPOvt4+FIybPE4FjD7IaWSdDyn+cOg1DvbVJB+KjWmencIfxQZXs7f2KaS3zO\n8D4Qc9vVGODq7yJUQUdHBRlQ9MM6d3ZC5eei54685McFsvvCwCwwf4xDFv1R\nyOAeOYz7RKj9oomc7yJ7UmtWyQPD0LtIeK8tGV+ibFvutfseKKRosIcTVjph\n+V9Pq2gTUNqW8sk0N3VprTtXb96ecD0p0O04c7+gl35GluCkoaF5/b1q2zxP\n9WZlTfgbWVp0s72a0jYDjRc5RO3cC/Bk+umgj0fJnucVpIgJK56bfElIo6hz\ndiD667Mi3mtzRPXfd4p7wVhbp5cWY22jlYvPu3OmZ+gJrQefCXeYUfHx16UJ\nnxcSdmWjovprwKPLSa7228nK44QHg2M/HUltZgH+0xkcUu/tig6xLiZcZDdT\nrAm31oY4CW0z+MVXJBlrcYK+q0YYgHOdVrAkEBjEjZIFN1Sk/hhVA0jePhrS\ny5N7\r\n=NKmQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c1a26052a3bd6cf2cecbbb72e9e718f4f8d5d461","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-14T01:46:11.940Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.165","@balena/jellyfish-environment":"^6.0.1","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.1","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.0.3","@types/node":"^16.11.12","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.436-joshbwlng-drop-depcheck-c1a26052a3bd6cf2cecbbb72e9e718f4f8d5d461_1639446536650_0.4768628732345579","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.436":{"name":"@balena/jellyfish-metrics","version":"1.0.436","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.436","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8837345e61d48a231b7178837e21dee36ddd1936","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.436.tgz","fileCount":16,"integrity":"sha512-TP0upAE7bJKMaBjzYBEq+aY+PdClPFz0DIpM/xg0qg5jyy2VwTcFUtMbJ+QpxKCD8d+bYiC+3bTTQRXDFKGwHQ==","signatures":[{"sig":"MEUCIANJfkUi7wE/L5vXHmtiTYbVMfkTw/D89YFykUT0xxHNAiEA4OjS2eQ+QQQOAoYYSkcpLnFeKLb4R2Z2SEH7Ukq0v1w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":143767,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJht/jWCRA9TVsSAnZWagAARMMP/R+227ulf0SsaTgGjwme\nud0BA0pm5BN23DKvnqmdjFQMiAdnY9IGAiwtc8/55DKGP5pZJzDqRXJf5YN7\nJN/JeEWaToQgxx+GKblwCc7k0i3v6LecWoiaojebNvkz4ckFaPwYCfcx2Xdc\nifvjVkpUT8LsWSChXErQN0nsQsKJWuyFtZFRT6DD/DH+Hh/8k/NBOo88A+Vf\n83KoXifqoUUpYtFSO54MCEtwavShxX3G/xIajAgqPDAR4YsiyZpXDO+CXB2l\nVX0Lj0liNbehhFoxVfJWPt/hrcl62fIQhGi7jMYVwlV0ycpZhjYYtgnkDWqR\n4d4woQoNGAiAHPkZDvdYWpILTIviLfjLiGgs80i0puIMoI3Q9rdJjEpEPUX8\nBmIlVyru8N+UlfijXB6OqzBQ0QFfCsgB14sPiO2wwEkXxHlggbjvVkPIASsi\nTPA7R7190ub/GCe0M+R09h46nUbf41oUSJGtXaCfTbHTWACv7PUO451TkRVK\n5QHzvmmovh2Uc0RJ8S2dTvDXR6oocmVH1i17G0XrzBQd3W4gHsRN0+lTnmgf\nEY6IN94VTV1Rjm3jfqCSgWqe/55KnJQNs+qcZT0ffRncaUdFXgNb/Ek4NzrZ\nkFs46FpYY5Ol0koSgHfl4td5tB/WhzCpRBb0ER6RfgIpEJeGMgvo1K/5ACfe\nc91o\r\n=FIXG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c6b7a4424f1b42decbeeaeb94ed65d9d3c81b63e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-14T01:50:35.775Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.165","@balena/jellyfish-environment":"^6.0.1","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.1","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.0.3","@types/node":"^16.11.12","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.436_1639446742671_0.3116741282091742","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.437-renovate-internal-patch-772cb6d5334149ef53110287eefc0991bb540733":{"name":"@balena/jellyfish-metrics","version":"1.0.437-renovate-internal-patch-772cb6d5334149ef53110287eefc0991bb540733","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.437-renovate-internal-patch-772cb6d5334149ef53110287eefc0991bb540733","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9411464c5da6015747f32344ac452ca5e9e4ae31","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.437-renovate-internal-patch-772cb6d5334149ef53110287eefc0991bb540733.tgz","fileCount":16,"integrity":"sha512-43uudscqJcVD34F2qq7cztD+4zcjvZpNhnTm77uXidm/GfFVFNCl+GWyATpTVY9bnbUuV48IewNwODt5HLoT2g==","signatures":[{"sig":"MEQCIGeUGKmlyuFXfkZDz+BNcrfiqBMUZTAJofXOLdyTnfYfAiBZkWcl62d7njWSafRlm42W/ouc8HGiDctLhtMSkMO7Kg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":143904,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhuGKhCRA9TVsSAnZWagAAFCUP/jpc77hSr7TzMX0ARA4j\n8IXuM2QWp8VkcelgOZUkK+D2lQvPm8YWYDxY95m0fbTshnNGA+sS4W/XK12r\nVS8A8dEQ8tBgv5zXQVMpkPyRjTdh1WKxuJXC7w/5zYv8S3R584WJSFbWBTC0\nEuY0mOkfXQYgJwSNw56ggo4Y2kvvO4j0EH/EU7Z/8lkkUfFAsuHMBpSuY1k6\nprPO7hJdHr67CK7TIw53rDAoGfIl2lGnh6gwvG8Jcw+XG4cuRj7hGgWbKS4D\nN8ZMojedFd36NQPvBx8rH7kgFzqpjf3JOZTG3eJnMBqAUUIttAPh7xvz5UFR\nlzHpkq4yCeiuVlAcZ/J/wEYfZ+O0/+Wu317vtW+YH+FzMTU/aqAdkxpa2zR6\ngh/N9VfdfOcMElMRpbSpcgCjTrRSz6ME0AmDIKsiZIIWlnS/fL26J3v75q/8\nb/jXYYK63vYbo++HrzmwOtQ+nNyucZYEXz0cEqq4QIR8mmDyl1fd2clSuOX+\ndhHTangRfhLLxG1MtrhRPC/+3GBglXTo1bdxD7JS0nAzruGFquImfRtnazIJ\n1U29iP8aa8RJXWI5tTOirRTOitotKOfNKXgSTXxY2uzqnwwNzwTcrDl/adWq\nsHb/EUgKd7E8tnnz5FkMriTEpuN6ggQJQZ8xt/THSboiSt/BXIDNjlJoFYW1\nVXB4\r\n=fct9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"772cb6d5334149ef53110287eefc0991bb540733","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-14T09:20:16.455Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.166","@balena/jellyfish-environment":"^6.0.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.1","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.0.3","@types/node":"^16.11.12","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.437-renovate-internal-patch-772cb6d5334149ef53110287eefc0991bb540733_1639473825832_0.1778663953675319","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.437":{"name":"@balena/jellyfish-metrics","version":"1.0.437","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.437","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fc7d09a67a3f4e7223f2ed86319020a78a9a051d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.437.tgz","fileCount":16,"integrity":"sha512-WdxQWMPb73+2gMt8PB7Wqy8OA6ev8R5IR9+h3W7nASO1I7v9g2T9RuTkIldxiE18C8CljSoEExFeVejPpq2I0g==","signatures":[{"sig":"MEYCIQC8S4FaZBHnm6VWDGITxc/jm+1L7yId5HYe8rg1ro/woAIhAIEknGLGMAnnJrnyFmVfJubk312rvMBTqcsXNN0xML+k","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":143839,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhuGPACRA9TVsSAnZWagAAvV0P/RJQKvgYM9W9rOXVPlrc\nVWG5xCRlyNvZxe3opzKc/R6ZJVEb2HVo8lT/DdYgqGdQ7lsUMtlX7cEpmeOb\n0ORgrN15+Ixkianqr2vJy8R1MhhSNtplr0M/xndkxc4XLXTMjJTlDBOXDJ/Y\nOwX4ZL9nrCncsIE/XO0v9N3vk/YzX1uEdh6nTg7DTNJsOd0Z9pXCmYaucOIf\na2dYEE5gtnWxdPHgK8bXgmUVseVevOCy5ybzLY/FUBYwaUbUkrPnLwA97adR\n1a+/O27oDor4qiPdHKQtXY4Ao0I7uqJWHj439+M9zu40vhiADSkidZ93mZ+A\nIJxuvSuue1IMYzMqbcy+ItMHgXRHPjwuIDxzbL2WxargBhl0+KUbTrLpA4qq\njzVuEoRulf18SuRkAWIB0Mak3jui5A5e5We9Pwaq/2Kg7ju6d+msimW6VGg/\n/LFJsKgnQTSqvZA3dsDioa7FeXVDfXcnLRCr5rUd0WleCDF+01mblkg1JB3i\n2yW9rJ5UsWgpl1klXAdbedliipifxi9FdIcWt5uDviqTy0vKjRkT4XXfcTfn\nTa2A5qMRt8MBux95FPJn+dZd81PgFLcXw5qI1bDi5Vi0Yp5KCmoOW3yRLVon\n/NSkJT5JspB+z4j2iQNS5LOgZT2cvA/b9X2TowEr3IIrvpmq5HQQ0RuxZt9q\nbOVG\r\n=KEnc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a9042644356a73abde07da589dc560586e9166ce","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-14T09:25:51.283Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.166","@balena/jellyfish-environment":"^6.0.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.1","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.0.3","@types/node":"^16.11.12","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.437_1639474112257_0.8623911142066296","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.438-renovate-internal-patch-6cc5b439eca6920b2770e9f998b7f9a3b9e121fd":{"name":"@balena/jellyfish-metrics","version":"1.0.438-renovate-internal-patch-6cc5b439eca6920b2770e9f998b7f9a3b9e121fd","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.438-renovate-internal-patch-6cc5b439eca6920b2770e9f998b7f9a3b9e121fd","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0ab6748ed64bf3b19bd1af76794f06d7328ab353","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.438-renovate-internal-patch-6cc5b439eca6920b2770e9f998b7f9a3b9e121fd.tgz","fileCount":16,"integrity":"sha512-FsBzKtCfXOv9GR8FxWIwYsIoMqbcVjp/1FEtuH+4DYyQsXgRzvgmP8SdpRTKQrhbtbJqB7vv+MJBLdRmtaWkZA==","signatures":[{"sig":"MEYCIQCUWJLfg98Z08clWT6wDXevLUHjANhQ2SBWy0fhuzYmNQIhAJMUzj4nyRq273i5vuperAThjgVosDSlLN3iEnX6rnPp","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144009,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhuGRUCRA9TVsSAnZWagAAOZEP/R9G1s0k/bLWq4ubbxqX\nNbEl47qcmGQ0Wc6g/rnRMQegGbSVxX46xtbdqCSRQ1F/F+L4HJQXq572c4Kr\n3vmM+VRgBx33Omr2GVK4IvEE+fzPoCrt6UfoxouuAAyxYxp5+C9vHcrQXe2B\nzlPcdlnPtXmy52TGCc8xL4Ft3g7nWWSl6pwM/NleBZaT4Z8VlJfZvGOZwZpn\nVzHXto8Ty1PditrbUAbBRdYkJ8pmXn7oIyN2M8rHjdHk0fDn4NXdC/siIsmx\nS+zSWZEWfGNm39ble2N0HAyFyUK07G2ga90ehrjNi4PgfpNkFjlrUa0btwP3\nqj18uPWy+cmvhbi8e73TGitK2xwY6TBps4FykPTNnqK6OgLcIkmK598IQYp9\nygBkhvyj/Qs3K1l6K78FshTCFCIuDWahHGaMSmItZoJCaSc9g4FpMa7uI/Uz\n4w2R/6u74glcwiFbLHhl1VvAJFs/2Wm/orf3blVDbst4G1v/52cZEbkUWRIT\nclVxG1gU8lLWYtSDq2IZKhkFNtyKpDL30IWX/XEJpzeD3iYfQN1BnslkjzV1\nP5/W7babAaABvSYe4Nm8WKO7fh2B3TzmroM+jS7q7dqBFo+gJVHfid6VUMdo\nyOYbl2LxK0HsQQtY1aWqSDlItz9uUR0w1NBdKPnw5Iw26Ob5SaYDsTlFUj7x\ncWsI\r\n=V0pX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6cc5b439eca6920b2770e9f998b7f9a3b9e121fd","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-14T09:28:08.001Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.167","@balena/jellyfish-environment":"^6.0.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.1","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.0.3","@types/node":"^16.11.12","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.438-renovate-internal-patch-6cc5b439eca6920b2770e9f998b7f9a3b9e121fd_1639474260081_0.9988998502312705","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.438":{"name":"@balena/jellyfish-metrics","version":"1.0.438","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.438","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9e659e92bfaf7014b7dfb1b895bfec942b10aa9b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.438.tgz","fileCount":16,"integrity":"sha512-peRXMpqd5efAgzBnTkSuf7wDNRLUI1yBYJo5xXWpBdu1WsA6cJCJJBUL/nHfovZDHxkNkfR9W5xg3/9z4YmtwA==","signatures":[{"sig":"MEUCIQDGx30KuSXwNIriiCPkB1LUgX65su8zKFYtAr54edjClQIgfxv8o4qz0SEvzRBli2oF1vouamQZ9aFrwehtRLKcJpA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":143944,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhuGXACRA9TVsSAnZWagAAhmsP/RzMytEXI5R15/3l+jCO\np2JlSQzNzgbjeYjfZTGHqeHsSdmLWrUz2lY3mgy7zcBUC6RuF/1V35hew6aL\nk7BAdNeIj/AUUa8oeWV2TFIVISTP2s75RHpzNqKn2s0GUDfl4e97g/FAL3xC\na4Y+9AFdi9eMODB0bpo81dBKbZeMLNZcAgb4zXPAiuipQMUc2iAAlsWOWtT0\nmmWkVtgCVWfVYlEhFfIbbIOfIFeat2vIK3TjXV2kL+j6cPHYqz6GgIjLzzgz\nVU+kOJi8sYQd8ZGVgDJEEuTM3ebXaJCSjWdcjDRA2w72DxSCYpKnYtUkRqD8\n1f+2NRXzO34FagLMq3S4qRgut7h5mWklDCJQrv9NUtlwxnp0LnHtvukODCio\nEaqedLkHjcPdhDQDcqM8y702UXHRh07++wsxlMG8cBpyRceNTqTL0bRjONsz\nffPhzywYKOf6SE6Av/H70+egT0zyts7aDahYzOB+QUos26dOv1J59QqF6ieC\nTUFFwMUmv4fm4L2mjp9hK80DZjeAl0IcgnEX3SozN+Wb+Me4FcO5AY+9HtS8\nmTJ6pK/V0EPYeXAFg6a6tXfiqx94jF7uKXTL2vSSLgVAYKSroA4V7SphU449\nIWAlf7JOgpyzsQ6TS+U8hmKbuCmiFFvpo0tWYZQ0W7GVAsBZAE9t92vPaAE1\nP08f\r\n=5Ami\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8a725dcef321d36b1f5aff5994ad3bf5dfe5ef6a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-14T09:35:17.775Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.0.167","@balena/jellyfish-environment":"^6.0.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.1","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.0.3","@types/node":"^16.11.12","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.438_1639474624322_0.4292443730321769","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.439-renovate-balena-jellyfish-logger-3-x-88f2fa82525f148ded63b8ac0c95561b20d10fcc":{"name":"@balena/jellyfish-metrics","version":"1.0.439-renovate-balena-jellyfish-logger-3-x-88f2fa82525f148ded63b8ac0c95561b20d10fcc","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.439-renovate-balena-jellyfish-logger-3-x-88f2fa82525f148ded63b8ac0c95561b20d10fcc","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9347998dceaa6bcf454d05984c30d970d0e3bfc1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.439-renovate-balena-jellyfish-logger-3-x-88f2fa82525f148ded63b8ac0c95561b20d10fcc.tgz","fileCount":16,"integrity":"sha512-XVaUMWOU22zP/+VWrFubWK8YeAZ5FoutfDChAGUcZbvyi9T4I0vqvYHJaZZTNWnQGXO4EM+wAly0nEIXsxTebw==","signatures":[{"sig":"MEYCIQDco9AMKgk2OuyZS2EVo+DlO0xwt9RIab6EfkATQrG48gIhANKErd2IUyH51yf/jFwy3q0YuU0eGgn+urLHlopSMpu+","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144123,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhu5baCRA9TVsSAnZWagAATBUP/1/9qsMhxCz7wjmEIU3a\n/AApMs+xj7IE/cRpWyRGFxb/kpdYP+M6BbObMCSNj/jkJ60Zz/rSu6QU5KjN\npH1W5In8C017K+d9Do0nfx0Mvm3e05Qilfxulz341BNIc/sL1Q7USheSFMOV\neiNNfhMGpsvmaHM0P4QnOcTadTKAwxN7+gtQBoks4bLCF3h1/jP3tsLCYEoC\nH0s38wFzjj5fTYjh/5MU/+ecWiWUFlVwrwB8IgfpFYHpW6DlSlhPpMaJom+R\ndY8REC4jK+5oFr5NIzG5QowVTYJezVJhGFXfn46j/ugtiMNB17NJkSbjJvP+\n4nE6ZpImpRm3qkL+UKvqJMgMJl5nsy1kmxJPNNXlq3tfvxEXthGNCeDa0wNj\n4oJ23iNMvXHOXJv/1txAzCVAyIBl9ujbZF7ikTMRVF0Btob3p9vvnplU7pTY\nopNz680CqyRv8MaKoE10qDc7QPhwclcnls4U5HjFOqMEjQSKMYHqo8qFfUXA\nGrXCJndYq/I4qSbdCLYIDRbeph5mhbI+C0g5TC6CbA4z1FZQcZn/UkZ+QTBv\naZ6pZTBbCE6geZ3XxM1C5ZYI85cvmmVKjxnpwQ13ckjh66LzV793WUmlqK/3\neSE6RVEqcaiKP4NcaF2mfGdH2DzYJ2DEOFVl0x14fih/yRJH0/LLfrF53Jfd\n7Hbj\r\n=KVYp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"88f2fa82525f148ded63b8ac0c95561b20d10fcc","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-16T19:39:49.759Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.1.0","@balena/jellyfish-environment":"^6.0.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.1","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.0.3","@types/node":"^16.11.12","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.439-renovate-balena-jellyfish-logger-3-x-88f2fa82525f148ded63b8ac0c95561b20d10fcc_1639683802288_0.017812312917012907","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.439":{"name":"@balena/jellyfish-metrics","version":"1.0.439","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.439","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d3248da1f41d1f508a67e4de210fb72592f5440c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.439.tgz","fileCount":16,"integrity":"sha512-lewuaBJoDt0IYHB/91sEJ7+Irvh3HxcJ/gcO9SYFTrE8MFIToz1pfpvm7dB6DK7Md46nqgzoSFiB6IV5OurjAA==","signatures":[{"sig":"MEUCIAD4Ht4UwOyeXQwFIdfchELNvq/LkQh8K7bsMucA4OQ0AiEA08e5w4QYOJX9/splo9GdDDo+hi/EhB9LZ1dsFP4YGDw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144045,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhu5eyCRA9TVsSAnZWagAAWDUP/R6tUBi9j+XZmb6n4H7D\nR2XzQqFOTh9QKnw0LUP4N0ORQ6/0uPmwv6t5PRqmQsnwIayQDcGG54hn84a+\nf5tE5KBp5JMc76x0GZ1Xq0/lQtmzn/oJXWfhxLPIPH4n6/whEmzKVAzr6wOi\n6/K/FTLJG4bKGeBh6BpFAXyrdhblr9H5Q545qJTGUzcxhi164DzvCwXaqpyX\n6GbLMsCdRowurZJIK8DVDLiIF2xl7mLe6BU+UC0BOfis8zR+mKs3JoQaVOt3\n0kwbzYMOce1FdjV1eJ7gdCTQq77PWEoprZnlpFsvVdwNuYx+XX0g/PryPUmE\ntQJdpOaR2l0a+BRZVEEHcdy0+i5rJgpHG/gAHM/drwXdC7NVGsdtVnJqmkk0\nzQ1X9qmbs9cq0l09SKcuDzMAXbADcO45VLP7AN8jfWuu6re8q0XIgUskpity\nxAZvB7mpFsIZZzadU8y7j/mKsnmW6zzC3B4JZXI9Qp9394ElVu8qrmDXDbKt\nG1WuWodKxjCZt6Am/qlnwA3MqJMihZpfsIoRe1RdvBk9V6wve0kdh8YXD0TK\nLGtoMnWuJq+DEYXaZN+rheDoUk364/ZpdlfQyhLAOLhISZRqm7sbmF+jXoM1\nt7VBsSwcCTL2iie8XwHaeS1j7yejcJEGVZNMg25QdxJTm9fG3RbJ974rIiRU\npDWe\r\n=zL+s\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5f5866edf75329d42888215760e82ea7757a08db","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-16T19:45:07.561Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^3.1.0","@balena/jellyfish-environment":"^6.0.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.1","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.0.3","@types/node":"^16.11.12","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.439_1639684018383_0.21034283019602795","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.440-renovate-balena-jellyfish-logger-4-x-7ae85de1baefad63daed6c9a71730ab437612ed8":{"name":"@balena/jellyfish-metrics","version":"1.0.440-renovate-balena-jellyfish-logger-4-x-7ae85de1baefad63daed6c9a71730ab437612ed8","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.440-renovate-balena-jellyfish-logger-4-x-7ae85de1baefad63daed6c9a71730ab437612ed8","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ddbeb732d617324aea68f854648f335ae5ebc0c7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.440-renovate-balena-jellyfish-logger-4-x-7ae85de1baefad63daed6c9a71730ab437612ed8.tgz","fileCount":16,"integrity":"sha512-qZQ7Yjvle8UdCpuazh3qKDQVCIp3gsQFjYozakBfHSZPYFIOFf3c1q+ADAndGlw7Sbvt7atrG+lfAkIQ9cGWAg==","signatures":[{"sig":"MEUCIGAG17FzGnTqtUUAPhtAYZLG20TZ62jVyHrjsE/nimvmAiEA5hzYADOIV0LJ11En6gs9ydmdXlGCZtIx9Hawtf5aotc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144222,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhvMIYCRA9TVsSAnZWagAA2pAQAIn52kgE5iOHGiLTLT/c\nK3zcmeRNta7pc5wcaj6hv990E77APaATuzBbi9kr+rCZInvurTcLPMCGpxSn\nfwMFmYCcuewIDexS00/aqIw2xExM9kzy2WYrakRaBUfLe7v2D4hMfkqMwV/u\njqB/i6gS2F8hhrSacpLJ4O5BkL8oXj9Bl8JuzNlohKJcMQEbIb6Nntk+di8L\nMuxNcCbv55iQNaEW/CpMjrEKIsANuuKqlR6B3wuNAxhDIPRo9mfSmuHkKu9J\nTY26SIP/gAcLrzBCAizyFUt/POA4Pk9ONxwSDD+8UUNWhrj4n+6ndCyXZ1Dz\nZMJGfos1gQgKFkhJgZlKEdN9Ge2vZb3FZMBcpRBzG+i1Ljep06xJUuLrvEiD\nfeT01V8upQymmSmkAQuT/viB8AYjDYnywzwmNdaxRAB0AsI3xvBAObYm/zPJ\n9ROf34oJm7emkHNAwArXA5PyI/vpRUM4vPAa99OWBJzqOG8vWXbVzF1v8yxF\nK2apug8hflXAq/PMWhAPIn69hBlVE0dY+CAWkwyALLB0dqlYbHS7d5Dp96Bb\nqUJvGjBa6j4rnzI2f9v6tjs0mPG9zKPWUZFp+EPnCJyD3r5zpVO2gE7wA7Wv\nhPXw6W73MZJ2JIFMbYFWdmpuxEPQB+Idi5oqki/exWqDDPoDNJJpyyXaRUk9\nHJKB\r\n=R1bt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7ae85de1baefad63daed6c9a71730ab437612ed8","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-17T16:57:23.630Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^4.0.1","@balena/jellyfish-environment":"^6.0.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.1","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.0.3","@types/node":"^16.11.12","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.440-renovate-balena-jellyfish-logger-4-x-7ae85de1baefad63daed6c9a71730ab437612ed8_1639760408408_0.7520614096602132","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.440":{"name":"@balena/jellyfish-metrics","version":"1.0.440","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.440","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"be0b4eb6996ad1a7f892e08402c8f36e59bfda75","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.440.tgz","fileCount":16,"integrity":"sha512-aE5U5CUpAdQ8OEpJtjUY+a+Xuwm/dZwdXeHUYnKGQZmN1N2G4ykYaDODD2UQItJd5aBsO11bMq2rGbiWV0ESiw==","signatures":[{"sig":"MEUCIQCzHDVhRXXxoSCh7S2YCHY74DZoKg6wF68enB96sh1P/QIgHrpUXGFzwg+YZyZBizbzPLOyUEiyZelp3oFf5+Ne32s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhvRefCRA9TVsSAnZWagAATLMP/iHX9Fm2d3XQejH5eR4Y\nZmwM6kZBiQtG5iIJPHj3D9Va8BIzoF73OOL7tZvjp7Z7AkEsVS+NASP2BGok\nStetR4ltZva/NnXoTIzqQZkDTYJYGU9mvRdQfDEvkaT/Oq6r+V2JYqjj6xN/\nipMx1YOm7PReFonmYDoGsDV1gyDhTHXRbLYJpIH7EuNz/9liVrAmhODS/+FN\n4gAkmez2H9rNt5FLJQHGeHBcWVcVN3UxX+0TTfnWKuxukOMdl2R0cpbs+/G9\nWdLqitiSU8QybTx/IRP8AvhJqRTFbUV8dIrAq5Omr6XZDMedKB+RVah6w3Ri\n1fB5pDP8MDSbnq0c7ih0XFdQ5koUjyuIiEj3eXBW7AYh1fvFcPyppFMf8iqD\nbwMCx6g20nU+7JLpH6GZCLoEJSN0uz/Ci34nhc/O09L6GPq2KCrL2aCLAzVi\nD6ZTtP8I3KuqBz7k2av46XnKb2sueNcxNoFi57XKewfOHPgu2OiGAgRLtAc6\ntUumHdgVIV3BGrpKPRo8ECpzq2zILGKgJSBo5qAShe9V+Uaw8VpJWFVwmSmN\nAi0s84bqTG+kZ1xoF2GHHgkYu47YXIRSqM5NpVCFhunl+6IUXLleV67dlN5V\nC4PwYrA7XbnqdtP3H2NMIEQ8zdElNgYeOddwA/lgMoJ3pIA2FmgRPRushcgn\ntQ8h\r\n=HVLd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f35ad3579c4745dc8065b13e427fbe7d8c88f6bc","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-17T23:03:07.520Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.1","@balena/jellyfish-logger":"^4.0.1","@balena/jellyfish-environment":"^6.0.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.4","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.1","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.0.3","@types/node":"^16.11.12","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.440_1639782303371_0.9392414389472652","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.441-renovate-external-non-major-6a9b41893f0e8e4f481f390940502558b9e6fc47":{"name":"@balena/jellyfish-metrics","version":"1.0.441-renovate-external-non-major-6a9b41893f0e8e4f481f390940502558b9e6fc47","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.441-renovate-external-non-major-6a9b41893f0e8e4f481f390940502558b9e6fc47","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e7c3a83c9995d0792c5bd183eecc66d862ee7942","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.441-renovate-external-non-major-6a9b41893f0e8e4f481f390940502558b9e6fc47.tgz","fileCount":16,"integrity":"sha512-ITiSQS3XgeIVJcl/iuP7NujsKK6ZwgYQyQA6wrGV3jYJsSbqxp4gY2w8KIdgqInKQHfrz/wEEorZvTHadidyRA==","signatures":[{"sig":"MEUCIQCvJY0u0YTY2uoHnfYy5kJ8CwGAvbcHKLwmZjnFkhdBWQIgCONmZHCo7AOCCDL9MxPv+/VsEgAjFsFof1QHq8xcziI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144289,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhvSvkCRA9TVsSAnZWagAAMasP/3+XY4ci+YUYM4DrsDAT\nn6mPc5c0QeBDLvx/kbH3mXbzvdXnVaOHpfLw//XwTaZHJf5DOgatmOmWEFeM\n1mT3CZFA7LXLo8QAiAbpvalErvxh2JEIhGhlIbPc987UbZtUCYbkkFJ9ug1z\ndS6CruAkFfxdImztNIgVH4G8tbJzzUMqBqlh0EtrWk5SRxHeEsPojHK+lvh2\nBi9FCNLiAapnjJcIoUFKMudiuNUwpGUcrCx0xEUo6I8e5+a5ecdljwzE4RrS\nchFueaNCd1CHrxz77HmRSHmU/HJNitVt285SuzUDvwpw1SobSS/+yzsLmXZC\nh6XIREgOK/kx1cThaIs/8BKtBlZ4/Nb2N7JjFXkwuIrYtvTGIBxl+4RyHgHS\nBmZgaJwrB14itffbT1Y1p1mTHNge7vUBGLbszEH0hpBG9nbaY1Cg1TBQ1VNv\n/lWVNgnflpk+psyuwB7bdQj4GpRjUYjt9movenQU+2uEHdE9UQtOLaEEe2UP\nF6emK1CtOMWU/lv2aORnJVUUEohuTA6XTKpSuCrarXrfdwSfXEgyvve0wrn7\nMd9DfN4Ipi0hbGjxRbkI73rHFjltYuv2NkNZUzNNXLhfejhgIj6nhBKE1EsU\nGh6dhQUdwHejG5c8DRXfMgdl/G/CUjDLIziHUsn2DE/69fwFic/+m5ia3uUM\n932S\r\n=ae9x\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6a9b41893f0e8e4f481f390940502558b9e6fc47","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-18T00:28:53.573Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.1","@balena/jellyfish-environment":"^6.0.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.0.3","@types/node":"^16.11.14","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.441-renovate-external-non-major-6a9b41893f0e8e4f481f390940502558b9e6fc47_1639787492807_0.44273189412869196","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.441":{"name":"@balena/jellyfish-metrics","version":"1.0.441","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.441","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"520db838788aebbd2fd6783ab2e297083947e48d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.441.tgz","fileCount":16,"integrity":"sha512-Huk8m1j5wyBpAFqbrr4k0jDhf0x0JyWdpk+2Is9SEZfT9CqLXlDru7UsWqkhfC8lV7+B00IWbtttKZ1p+vGEcw==","signatures":[{"sig":"MEUCIQCqzr6dmlhj3/eX4lfMJLwcy5dE+gDIyy5/ywpxpycvhQIgNQEfE5GBR5x3r95rhJIRDhQTjxEAII+OsAdoWzSbgag=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144220,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhvSy1CRA9TVsSAnZWagAAsJQP/2WYLC25WuQNbPiDbH2L\nSXznQL0vY+b8DQXs4bn8K8i8w8EUFtGxhTuajao+8fi+oLg1mdrnkLqkbN0W\nCrGcymxxi34VHjLujoargUsJqV7REypinTS8yizwN8w7YF81jzqsdd44dGew\nsX7E0d5W+PdnY9Qv9jIndYKBKoF251NDEB6JaxZgt53gJ5kZ7ht0gvYqalIt\nz6x8d46VBk0Wa0EO6ytdjtK4aa5Xa9LJ1zSRApqGqP9DVEEKrZDZVE+w7Tyd\nK1eupPoTZQC/xSCMb0UxgaAXAYay1P00v5HA5+JSzi4hCf7UO+7elLQJOSOp\nOEvU7131tgsPCRkJpWxBhW+VzxzBzgZ1PYVmGLm0Lga/O/oatsePmzJHhZwe\nylaLe0qpTu2/F0rfr75qy/QzRQsFRWMRYNdoHZ6HSeUC9npBG09zFEXgXMMw\n3Uiuxpw7tk1RbR2v4cAjHk4W/qvFlSSKcl32DgcLSkK9EbcAjSH0AeeY9lLc\nIwEtEtnW0WdaCJQI1R6qCudL6RuPAvYIpqdE9/zyUHfOvdS8sYKQFArXhfCW\nEMoxo6x7lDaUHxtnMHgmRocuIjihHc2zYph+OkUMCHgf91F4vLg0djjJuJmr\n/AeCQGpq3GFGfv41pAf7dDzxPyRSbivwo5TTd5Fw2ONGSnh5c35H7FrUJ3rw\n4wje\r\n=0GTQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7d27786f8caf3ea6100e26491396ca4314a1101b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-18T00:32:55.288Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.1","@balena/jellyfish-environment":"^6.0.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.0.3","@types/node":"^16.11.14","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.441_1639787701675_0.3332212518500728","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.442-renovate-internal-patch-2b0f7e08bd8b0bcab8266eb40456b177577c06aa":{"name":"@balena/jellyfish-metrics","version":"1.0.442-renovate-internal-patch-2b0f7e08bd8b0bcab8266eb40456b177577c06aa","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.442-renovate-internal-patch-2b0f7e08bd8b0bcab8266eb40456b177577c06aa","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c08c7059465963f6bef1077f731e20ccf0aa20e1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.442-renovate-internal-patch-2b0f7e08bd8b0bcab8266eb40456b177577c06aa.tgz","fileCount":16,"integrity":"sha512-Polcp1RMSJlCjklFeoiGv1KMRC8j+sjSlOx4wpiDfEm1SpCjwDqu8LO1gjoyIR948BO4HMJwbjcpSbfjxp01/A==","signatures":[{"sig":"MEUCIFuSevchu+MvbHyUnFHdvUPyF89zjzNkleE04NKhAPnsAiEA3ly0Lov5ZOttKFGoAAu1XTc8g1xmdWa057wiA8RwenE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144388,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhvZDKCRA9TVsSAnZWagAAzZAQAIuPPXpvdjPDVu4BQ8n9\n2Ro+RKFi1M2N7sI57RNnbsngEx1901Pv2Shla8Hyccbyj8pxbvhKfxxYl8kO\n1umwcbf69toU6b+ZMHB7HM/HseQo6wmBNE6LtmCTGBwJJiHJDbZOPG3kMloP\nwuiPlc9QsqZ+GAfX9GMKO1hmeP/4SfuhCr/Mt4Bcsral3SHECnCkiMYCIbAT\nmMfkEHsTjIoDGJfA7csEaCzT6+ecn31RnnyPybWBYuUMKqauycrtZajLvSSS\nGcT1SgQ6KpX3vkKwiKGV8t9sxNmq6pa02EBWEld8qkQfwBWXym/YCE2eRPrO\nHyPyAzqJz81SHBY8/SzMaSz7uX5Dxa5IqWzL1yd6r9/kXZhg29a1ZP5l8/3c\nle8iyvh697EIIbARESCBVh2QuPvKsLhPjhvvt+CUe4gjhEjNzbQjMKzOoZV/\nrtEWcUA1J2AVyPFBHmcUjFHLrFajPFz1F7/oDfKC3QvlSaIyndVwvL2FlvWO\n+XluwyfqPJCmgs2o5sVxvloXQG0j4eJPRWLeAKnUAUNvoRpSGA+Yzs0lKbF2\nbsB3aLIzRpxIbIrotGcoDCE+MApfn+v37K15ROeY3eWQqIy3ZjCJ/d9gmKPY\n+dnyz2YFue4CenygQZK2qqL/XJOkrKuJBYlfRupXtHJhDCDVW1TsUaAMDp8z\n5R9v\r\n=Lkm3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2b0f7e08bd8b0bcab8266eb40456b177577c06aa","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-18T07:39:11.183Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.3","@balena/jellyfish-environment":"^6.0.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.0.3","@types/node":"^16.11.14","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.442-renovate-internal-patch-2b0f7e08bd8b0bcab8266eb40456b177577c06aa_1639813322173_0.6422150207027173","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.442":{"name":"@balena/jellyfish-metrics","version":"1.0.442","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.442","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4a0f802706441c9557cdd24ee88656112814e408","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.442.tgz","fileCount":16,"integrity":"sha512-rLBU9GiQnyi21mlp33q0VzqyA3ENaR3YZF9r95SISqaSjGwhsOJgb27hnkXuG0IlSBf22SQVOK0OUJW9bFwzzw==","signatures":[{"sig":"MEUCIBgCl1LTiFJiE5ZavN3ljEpNqnJmcqc+MkC79EN8f98yAiEAztzAQJiLuc90bnXVtZkcYankWBrokQzdOZnji+LPSHw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144323,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhvZF4CRA9TVsSAnZWagAA9gYP/0HAcOYQkMLo6mkReItF\nyL9sPOJuZfKRRrBxb1ZMHJCsP16Zsf/cwkf5s29Wkhp12Cd/J+mspZ2Ai5cq\nZCy7Chod4Tw2W/TEE7uQVz9ciRoEKzx9JkICKPByGRRq1+0LhksQDrlXio8V\nIyPYr93gGqjYDaSi8E0GGu1j0L8ajmOez3/CdmSRxAeW8ehtuRoUYjb9zhPp\nMJOeDuzRIsJzbyEtAAcTBah5ZwA1Tfb8RU8/qwyfR9zX5yF1KrII1IH3xrU3\nRDnZM9DXceGJ3fovDT2vN9xrTN5Fp45mRqi/pJWLbDjvNqrUxhjby7cA2vas\nvHwuM2WcHHgf/INkCjBt7QV/nEwU8T+p7csQMOCA49DTrYzcRJO/qngS3hy/\nmyxkBmxN2fvva+vemsmNyqaWeq6vCPeK6geoZLz4BEXTSxF0680BZqdFByZb\n75dNbQAFHSRqTch3YogRuOusuNDmd4DUJCEcL1NAVeX/aeflSkzhdWD8LWtg\nAlZAI/lP5uxD4SyKNf8X1bCC1Ioyw8zALQpMQ2rn1OtsO0iddcnKOX2CjvTd\nDjr9Wp/cXYfypyZSv8LJ9O7kO8wAZDclMLdqlNJoDjARDwkQEyEzzxgHE0Z5\nm+gaJejkXzDUQmcJOAt5ZvI5sYk/Mdm6NZ9P3mcqzZ7gnYnh6fvG5DJJj/51\nzjbk\r\n=A8xf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f05c192ffafccc7d6a4c6d23b87d266aadc87a00","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-18T07:42:55.134Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.3","@balena/jellyfish-environment":"^6.0.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.0.3","@types/node":"^16.11.14","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.442_1639813496670_0.15876421156567666","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.443-renovate-internal-patch-7e156dd33bcad23d8b414a017a359d9d2bd6d744":{"name":"@balena/jellyfish-metrics","version":"1.0.443-renovate-internal-patch-7e156dd33bcad23d8b414a017a359d9d2bd6d744","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.443-renovate-internal-patch-7e156dd33bcad23d8b414a017a359d9d2bd6d744","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3abf17e3bf773d25ce968d85e502fee31f10f563","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.443-renovate-internal-patch-7e156dd33bcad23d8b414a017a359d9d2bd6d744.tgz","fileCount":16,"integrity":"sha512-/2UkfuLTbZF5ECamsRsbxrT9WL72Q0rULElO1zgXzlMsebEQ6AKQC8+58p0VBCtqsHN6K3ZwIyYYuWmdZdIs4w==","signatures":[{"sig":"MEYCIQCZHUIOzFQj1CNSfVjOMTQNyrm6yMfEoiBwsv6ilnekswIhAM/Db8Qu4mit7C6yyiEFgguUKOQyQDoSgVVYx8zBLAMj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144496,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhvZ+jCRA9TVsSAnZWagAA3N0QAKQ9MBpHUPTFzKiauxCM\niNVR9ltPmBB00ATDub/n0aipmjAcOprSsZbIrqEF0ZsrdYFRbelYeUAAhmpn\n+/tZ/qSFd8SIUoxl1D/3b0aodwH8PX+wLBl9cm4Dstnvz5Ybwe6a/f5Xjms/\nJBOkEfK1LDa4dW9+yy+HNVA0qnFLz4ezzIWxgDg1Pf12NddcDR9UjZ4Fghek\n3iVvKaWGK27f+Ch3yb/GOm1j8OapSOzWQ155S17sy2y2H+kqKSMK0Y1uBhnS\nrigHonSBIQGVcD9OGeiUQqFMYy7T/ViNVTrXSe8Ja3HibjZ5/jFffI2WlvBR\nZBE6HJluO/nRLWq8CGmWf8MgY82qt0NEiPAbBT9lnwsUBN57Cdr8El2AFPjU\neVzsGHixCPOZZoB5NajfLgBIfa5jKy0Hy+2CWtCagAsG/CM0mPgUQu5V6EmG\nFq/Pagn46ZLkF98Xr/xy0ghOPJZmrgXEIQgDcXUeP2Gd855zilz5hGPaQ4Bh\nQIL7brDjoq/lcCigfW3wzTlDUXcWD+A738+jipLt4eX12LgVWtsIiYi46hRx\nsK1QJANKcp8YMAV+Xv+Cd6+L9LzPUA4N13UKsYXuryR/peev4ZOSsHds+3NK\nrRqPg8nQJD3htOpgwTQjNkAG+sZ6gSoeXv2KdpivxG3vBShVtbIaAOOKb5ol\nScXk\r\n=Kbrr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7e156dd33bcad23d8b414a017a359d9d2bd6d744","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-18T08:43:11.830Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.3","@balena/jellyfish-environment":"^6.0.3","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.0.3","@types/node":"^16.11.14","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.443-renovate-internal-patch-7e156dd33bcad23d8b414a017a359d9d2bd6d744_1639817123795_0.1614847391177383","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.443":{"name":"@balena/jellyfish-metrics","version":"1.0.443","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.443","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4cc000df40a916cdff920f9a592fcd8a57e62c37","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.443.tgz","fileCount":16,"integrity":"sha512-DrIoA92UCec30TcX3+BSBw6yrOYbx8TpFTEmDewbQUh8NmFR+fZbybe02ZLAVWfKIkdOH+D3VNCkBqOW6cO60A==","signatures":[{"sig":"MEUCIQD+/eQ6YbTqz9dh1KsgdoxezN/hEcnCSPXeebviRXjBrwIgAvSM+2g9T2PGSsSc3+uCV4v0HtEW5Qh4oxhf77sFNtg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144431,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhvaBeCRA9TVsSAnZWagAAIkoP/1NFzgIvOfvGJTRj4ZRy\n0JS8gJzS833RGfn85fCUCEPY/oLRAdslCrLzPmVOrdE61fQJfgJhNl5pIrot\nG7RMkHp4gG6mXFOQNQR3EWTM76cninf78ssP+UXzO4qBl4zmciL1iY1h3Z3J\n6tz07hzGFxUxq42G6i5IEve2CpnvzmKRmu1WtMHHuW+dJ5mGhG0L6i8fubdy\nM3oThy1KkHWHlIw0MqpgvKJmQeQO7CVJh/6wflBmTD4+wGx0zg5Kj4/Uhwo/\nlOdUPUgbkDooIuu9Swzvre+ZLRP/nbJtzraR8r4cjqoDUcfOeWhk2yyZrJ0Q\nEU4UIqrU4L68IvLyM6mr63Ov17cgZFOr+MuacHAzNwQXqS0HoPOJic4p/nuq\n93Ms3bS7zhKVQ8RaUydinnXsY/oNVFjnbSocSEjepsrcWuZsYe8nlI5jKxGs\nkQkKwmLzAetNZr6XdmusMPWxAJKpWFvVv0v+7M2bVc5A/2+I6pWv+kBMChEd\necOefbDpBbvgv/Xl/PDZempWrqARifBhM9+oLpLK5VSJKN6wSIRbXhfxe+qF\nvr73/Ror8jot3E2Uzx/9ElANUYQGAwyrs5YyoANhCrr+Cmp2BYFCapSl7eOt\nbMwA4DDK8PjnpsJpgYZrQf5AoNej04eKAUiH2cL+n7i0xlWzgpo1tirbJNEI\nJRka\r\n=vv0R\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e22fd7e22e74cb32416659200e55306ba7bdc83a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-18T08:46:20.618Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.3","@balena/jellyfish-environment":"^6.0.3","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.0.3","@types/node":"^16.11.14","@types/uuid":"^8.3.3","lint-staged":"^12.1.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.443_1639817310744_0.9890709329276288","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.444-renovate-external-non-major-ae5e44e76d0dac9d5c060de826456f4eff5e68c8":{"name":"@balena/jellyfish-metrics","version":"1.0.444-renovate-external-non-major-ae5e44e76d0dac9d5c060de826456f4eff5e68c8","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.444-renovate-external-non-major-ae5e44e76d0dac9d5c060de826456f4eff5e68c8","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"defb85b15f787f2572aa6c0f11a9e2e2cdec9d7c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.444-renovate-external-non-major-ae5e44e76d0dac9d5c060de826456f4eff5e68c8.tgz","fileCount":16,"integrity":"sha512-JaAeJan7HwiEx/7f15Z/dE9cd7uPKSnMwXml5uL0t99U6WFonxCZEjLghf7Q6ELFQ2DyWc6uid/6bhV447yuBA==","signatures":[{"sig":"MEUCIQCv4y1PXUwVMC4AZla+YRLJtAPIIMenXIOW9VioLZHorgIgYedvifTWgYT8jgsQnIrPgzRW9LgDW0kvrq0SBWoWJh4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144591,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhvcIZCRA9TVsSAnZWagAAL7gP/3upcRqOmiCPFzBWAfO2\n5z8ZDCv63jzUMEOOL0s9u6zjVwGZXoI/Qy59LiTlsZ1hUbS3b4WsBia3ok6T\nw4ALM3l6vFRQFBuuwkEX1JI00Bl62EIAJMEX65jtWE905TGCv7DP5tZ0+5tx\nrIxFegW1lEt2Co6Kc+2QwXFWlPr8sDlroqwP0mOqNSGJZ9BqsbBnDrmgAPcm\nBS6/8uL4zoRGQkqnUAiRakzz4uoKtkTc2pza8E0T1Cd0yoTrPbzWAcFffP9G\n6r6Gv74rbB3ykVSTqB9z8iYrP9hfaOeuO3JEx169IOt1ntGxsoWCopjhp1l5\n5canqchpEdJut/9Qw5PXaWGbNCUKbgtYYm+e/4jVefdCyv2TNk43fHpuXCsB\nMyDQ75kSm54QwSIwPG5GxAwiZWMl5uPoJG4gFS9Rwxfo1wyJElXGnmd1uYIP\nsvco34BBllXgEHJs9waI/jNvNvbJp/u149nvI0+WYFLMl69SrGxKOcN6BlEo\nR6mZ3FfZiaL1W1VwJHgXWidzvyNSfdUOa52nYqp6UXYry6dcDxPBmHTgDlJi\nqCJf519Emfr1CGYkcer856dbLk8RFLKXRE3CpJHI5Lw0vrj91Rzzn3WWOgyI\n3N4LsPHvWHsqLNfvW5VUd+q9w1/gr/LqOMkI/p2ZsvhSDaZiuU40IVMCXIkC\n1gj/\r\n=DfNG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ae5e44e76d0dac9d5c060de826456f4eff5e68c8","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-18T11:09:15.446Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.3","@balena/jellyfish-environment":"^6.0.3","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.0.3","@types/node":"^16.11.14","@types/uuid":"^8.3.3","lint-staged":"^12.1.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.444-renovate-external-non-major-ae5e44e76d0dac9d5c060de826456f4eff5e68c8_1639825945718_0.6352389459145282","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.444":{"name":"@balena/jellyfish-metrics","version":"1.0.444","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.444","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f1be89326d536fcd8b0f47a68c400a2846458714","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.444.tgz","fileCount":16,"integrity":"sha512-732wPvQ5hi2aMpPnKK3j0MvbTXleHJdF6u4Dh2qgZ843vRkLRQHha6ll3pLMYMNDbuS3+4Cgxj2Uv+wxXzIf1Q==","signatures":[{"sig":"MEUCIEM41SQE2nVGASeYrj07cnX/oQ8aXrfyWsZdL3yaoCfGAiEAvtyEDMuk4J0ydOesMvOBLu9bYngrrHVhOQj6vaXmDWg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144522,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhvcLlCRA9TVsSAnZWagAAOpkP/2PkR1RYWUobO9AFSs/o\n1swQd/TAhipxNiZV9ToIJLBA7PcH47dPQsWFFVB4H8g7XvPI+AkaItccUoLq\n386cfrFN29Yemvtw6TudQ0aKufJvht9kA1ykGtU2xw+IoOjSEtlxqU3FnhAV\n4gQZ2XIA1vDNfiogM2ejshHS9rBd6MhTPMnGi0yqxMYBidowguvoROUs4djK\nkvtM37/CDzOFxMCEUDgJ98f5Tg1XM0Zdj8niqSvbEcCBtaNB4OTdk5cIH6W8\nXqcvBvc9x+2js1baht8xH7bSY05swWfZ2zdCxiAWQczdrD21oFmfvKG+0LGa\njympbwBkqXHly9Dve9nisGXET7bYWGOxR8Zfu/sinTkwltu9+L1Eql2FbHqf\n07NcqkcpSMF8GajmDnlmWC5P2hOCE67tOQAt0Dqb6piKpN60F2QGcECDWX1V\nvUveEn3S+iUv0IvugVA1oJW65sxuGARpk60liplu9As1XLVTrZm2sO9WHyyq\nGagYW6PQARlRxGG3k9XZlPnbEXy/xZVtWhVRBmyanKliwXd/dJ8ZluOLdJvB\nuSREGD5zQFJgjLEnroY+km6M+Wm1TlF+mmKU3WMH3/dTtinsBV+yDoeYFyCu\nlVPHGw9n2S+BUZE4H/R4yFVPLLtOLb9knNdiqC1dng2ds90/2L/PhpADb4Qx\neMrn\r\n=53xW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"16cea67fbb0629aa918dfdd0a3e8caea22d225be","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-18T11:13:41.026Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.3","@balena/jellyfish-environment":"^6.0.3","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.0.3","@types/node":"^16.11.14","@types/uuid":"^8.3.3","lint-staged":"^12.1.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.444_1639826149214_0.2152525681566133","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.445-renovate-internal-patch-16ed2c858bd83251e27b3b20e3014d974304e269":{"name":"@balena/jellyfish-metrics","version":"1.0.445-renovate-internal-patch-16ed2c858bd83251e27b3b20e3014d974304e269","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.445-renovate-internal-patch-16ed2c858bd83251e27b3b20e3014d974304e269","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"51a4a556c0a4ee4a0c66c1b0d377ca0ca121cdd2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.445-renovate-internal-patch-16ed2c858bd83251e27b3b20e3014d974304e269.tgz","fileCount":16,"integrity":"sha512-zPJQ546AJUdCZR9OKaEmcaFG04YbPuG3vcghPyV7jarZ4PxyW7EzsQn4hsQoQTGgcj7FR8B4jsSHyoDu2jS8Og==","signatures":[{"sig":"MEQCIHfRHTC51IcGUGGFvkC4HIqmqIO1d+vPx3brpaWm0M0wAiBRKUWqlrO0kdzqbLmahpozBa1dvR9QC2MwVCyHZlDCQg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144659,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhvcOtCRA9TVsSAnZWagAAqxAP/RX6c8eAgCHOLx8haOJS\nGgaA+QEAJZEVjcE1bjYajKCfFqJI0DEPpha6BLXM37/N4pxt5ud6yOQS5GLD\nVxnYXPIxLpdszQRtOm9gZhMpT202mpWsl8dOWO+Mglp/yToA7bDzVc0cROyv\nGOLj1I5fvo/tpOeNgd2eZ1tguI3hZXFSAw01RglO7Yu8Gpoq2xPRB4ezNFKg\n1cu+vdDgKoBfIT6D0rYev0EGiQXhr8wad2reui8ibCGTi+rRU2kep9nDR8bN\n2LpPErk3pzpAOEHunZaQ5e5oxP3OfDHmcCS8+hY29pm6G9/4A7gzqufMW+1C\n9JSFKG7WXCWlg/UiFhB3siq69ZEm0RbrVH5aRskXxrBdJKe2CHHY4UIq/7d9\nzzxAvhGAIRICOkElDzUYMKf+3ivUdan1xsCr7vLz/9lG6Z2X52ye3hQdOZwg\nFLerkJyyA1MgoKctFC4rfElau5xtp3wgevTV/SeQ1k5ONMzoOhS6bBPwIsiB\nhJgDd4RLZfcaT8oLAG/eVCX2SPNPiyBqSDucKS0NYt4QDM0VLXbeaCfgAi0u\nhz32l+jSQyAgnZe6cWHsCjm4UE+If0mhtU2aC+ELYAc3FjDc61njklGiUN4t\nTsygmbyLcQKq/537AWXZId+hD2KE4T8e500wfo8teuZ8A2IzpQZIDN2+Ri9K\na+KS\r\n=W4Zg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"16ed2c858bd83251e27b3b20e3014d974304e269","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-18T11:16:31.225Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.4","@balena/jellyfish-environment":"^6.0.4","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.0.3","@types/node":"^16.11.14","@types/uuid":"^8.3.3","lint-staged":"^12.1.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.445-renovate-internal-patch-16ed2c858bd83251e27b3b20e3014d974304e269_1639826348844_0.05541180902799803","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.445":{"name":"@balena/jellyfish-metrics","version":"1.0.445","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.445","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"133b2b0efa4ff1071a9862b58f6aa84ff88af601","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.445.tgz","fileCount":16,"integrity":"sha512-giWEKxRcAFBCOzmtzPjer0WXrADnSSduRxvmgiOZzJGsBmSYOaVCHLckHggBD8v0p+KZIuPuri7cQR1yd/t0CQ==","signatures":[{"sig":"MEUCICDXDC2MkwHQoxPz/C6SCfrMxipOe8r3WYixN6chHKz9AiEA01WeoKWaU3sZD46u1Q5SjKy2XFRAR5NpAvr9HvGBCYg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144594,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhvcVvCRA9TVsSAnZWagAANF8P/3NT/AvkPFiGE07FgvNX\nrMNqhj6/c/MaaBTgARIAFmO6M/MXnVe4c4clnXpzLOaZrWUmQoHmVMKrSvn5\nsGy2WdwCxu/1iwLk7J2Ezo5MeXXUBPsXogag+qxoZBmq8QIisfLWpN4vR/A0\nOwkkLF2oJCwlYVtPIIbtPQwseQuH3pzwR4769p+habaNMhYDzFOtWTnmrAXv\nfgRLbjt7ah9GTMH4OsHHgvONopFWw2L1lmht3o11OVIHWR8zuqzPwVze/Kob\noToHDvYPPN01b+iAhTGks4mo47/hbO9ea7RLZWWGC1xHUHjqg7UHCUxH5+Zn\nNJGDkLVCyrmiyi5Rp0h4yvpcD0my9/LOg7CWcYs2ZnhF3Pae0MrpLwKj0EoH\nwqNw5MqfXRB74I3ILjFFqi5o3fhQ47UQ1Tm8NptvgPqgyxj39d7r/JAlMZRk\nfsIWPJIjWquGaKWwuHxRSdRSXEJcxRvFTDwjG76o5R2W7w/Ov199sahg+yVl\nkBRU3X28bYdzTuOJAx+FQjLlnX6O2iRic8amxlHWL9EI6wubgp1BVPPQiV7z\nLr5yT1iHv1oKOnGra/HLTXAnhcpdkw0Fn+Q8nIScBDaa8wW9HP099S4Sw7Tx\ndSCzGK8Kg90Otgai/JXOF6nH62hcg5k5Q4qVpaBSTkCglw8xECm6D8/jiZyN\nHJT2\r\n=zoSW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"14f5245c3c8378eee9426f8e86fa9fc2169f6372","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-18T11:24:16.204Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.4","@balena/jellyfish-environment":"^6.0.4","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.0.3","@types/node":"^16.11.14","@types/uuid":"^8.3.3","lint-staged":"^12.1.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.445_1639826799374_0.3202300249188086","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.446-renovate-internal-patch-ca967ebfe64452c843fcacbc3e30fc88d2a4de6a":{"name":"@balena/jellyfish-metrics","version":"1.0.446-renovate-internal-patch-ca967ebfe64452c843fcacbc3e30fc88d2a4de6a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.446-renovate-internal-patch-ca967ebfe64452c843fcacbc3e30fc88d2a4de6a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e0a4b95090898fbb3fb847c0505cd52ea1b43bcb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.446-renovate-internal-patch-ca967ebfe64452c843fcacbc3e30fc88d2a4de6a.tgz","fileCount":16,"integrity":"sha512-SvJiUFJ7P4MX4zkHpgHwVM+j5VffdD0HBrTkl0/SWwpUO3Ak4ibI6NM7BDwc8rRZChKAaiJQ+7m6Dn0x7BTlbA==","signatures":[{"sig":"MEYCIQDz5LyWtdSL2LxtTFlAAsBXRnto8ZQYYrAjDT3QXExt6QIhAN6L8hBuVcU48sdvCEcbRU4eBLkH6RihSbF9VzP+jdWE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144762,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhvec7CRA9TVsSAnZWagAAg3QP/1fygrZd4O5ZBYNBxfxx\n1Nff53nRcq0sYTQtf0HDw0tvSc6FNLKA5L2quuajSbFfeQ9WJAXTewwXxDpp\nt6HvruAXKAlOJYPPEqt/VlEzrujjh8sMlM38UoJMkbxOKeyLtKuidJ2V4qmD\nVweL7gnMGU0zWS/AovJxExMBCcgMl/9HO0HOQqzBf0uDasnVHhX5dM1d97Ka\n8Cd/lq4yv28JRUxz+v2uxJZkLnkv28YgCOa1MdwqHPwJ/Q5DXuCc3gV2B+0w\nzoY81wP2mtO6NnQsdP1nwtA4BN9liXlsM23h332eYVWeh5TuoE1iXlxktBcz\nzZrB745d9EdFCdruyUeTJEM6+jxAzsc3ef1XawN4485Ug7OleJfsswiPd+42\n7PliVtHKnLsuMaFltJJgPEakeJJTYwi0Alill+1bSgyNYh5aQdbmdx3ALecx\nZ5Eq9xGodWrgKnHirEAgPu+RgHKEmjlcd6nADazftTHhFc8nItO8TE+s9Glr\niKw0CKhCdj6XKYgRJlLUQ6xjVLt61/1uunCBAMFLdJxwAEa2mUghWUu6oe+n\nXztl9IZ2VbcOI3Mxhbyw2Qsm3EIIeU6XMmEgcdfTo0zaAnt1QnEjqf1FCK6R\nnyCzFFQbcgzvpFQfKwMZpH8BLmub2izWTr4T+vVBbYH0sLCFU66qrZv7nSeU\nRmxo\r\n=DPu3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ca967ebfe64452c843fcacbc3e30fc88d2a4de6a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-18T13:46:52.865Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.5","@balena/jellyfish-environment":"^6.0.4","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.0.3","@types/node":"^16.11.14","@types/uuid":"^8.3.3","lint-staged":"^12.1.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.446-renovate-internal-patch-ca967ebfe64452c843fcacbc3e30fc88d2a4de6a_1639835450826_0.8971533307801656","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"1.0.446":{"name":"@balena/jellyfish-metrics","version":"1.0.446","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@1.0.446","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"11d9d3baca79b01b5507c42621339ecf2ed14ab9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-1.0.446.tgz","fileCount":16,"integrity":"sha512-L8xaMjoZO/ypGPPvcomNqhn0wXcBdjxNhle++wdx2nLi6NED+R7WAplDBeyKD/aCuBzIk7hfgU8akg1yywC4Bw==","signatures":[{"sig":"MEUCIF4Agj8HCYnnDxIMnWiD/pZChniO9XKiWbeP4dWEIN9BAiEAnklILODksoSSPthbnNNEXUOLFvYjA4R5K09mGaWbt+o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144697,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhvehHCRA9TVsSAnZWagAAxHQP/1+shE1kaYSb5gWIxNO2\nFsxvQ6HeABAra2CRi80hERnjIaIVOX9a/JwnMdTxAaRzBF8FFu/JzI/YZ7FK\nShvZFfjjui7KAWs4fCl+dSA1+uO4kAtQZ3C9iqhVz9V3cEr1jSNrRixJbW2b\n5Ah8R99aMgNn8R3voPmXxAjwQBFBjLfZpzBh8FBm7PZgFA129FPq13lBw69z\nuDmfnB8zAjQjjNBw1TKDT4D5pykfFndeh6f9xINmfWx490HUsXyCZAgoavcp\nGnoFQj0MiYsRhC52eEUgwc3f5K+TDCT1waWOsI+JFG8g7Dy8UJ8ZoF/LoQh5\nwIWmjWhB1cX1RCm5ai2h20l+4jwHXwR1dIdYogP7qYbzuy9DjmpVbHR19iv3\nakC23y9DFG2DshJRfTX1oyP3spK2c9wBJn9gb2aM1gAi+BvNpN3f3UIMym3h\nQnE6tNuyq1gnsYbL+C7aTC2v6RO16+pN+a46FVqA/lTT/w3NbdS80AMnrVsY\n1rCtQ7FpcbpmXqEa+Ub+MKS1DlIM6fNje5xCE1eVW7jQtrWOuhUX2M6OaXUI\nrdrFGfMtNd4xgLmkHOiT6fz9ayTZDkzGYN6gjya4c0VnQk0neCUsGTQ+CHwd\nVkUxuTVLjXbWKcG8rIoiOj1FbgA3kp1S1ADJ7a6jHtumaiky2fsBkI/1Ojp2\nPfQR\r\n=jhib\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"75b3eebba65e61fb9c4093118fe395d236eb3f06","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-18T13:53:03.353Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.5","@balena/jellyfish-environment":"^6.0.4","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.0.3","@types/node":"^16.11.14","@types/uuid":"^8.3.3","lint-staged":"^12.1.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^1.2.3","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_1.0.446_1639835719606_0.01274444449095169","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.0-joshbwlng-clean-types-edc235c1e853562774dc150f6e5d80eb903c077c":{"name":"@balena/jellyfish-metrics","version":"2.0.0-joshbwlng-clean-types-edc235c1e853562774dc150f6e5d80eb903c077c","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.0-joshbwlng-clean-types-edc235c1e853562774dc150f6e5d80eb903c077c","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4209c8fc2a253a46ad83af5f43d5d59a4fa26dec","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.0-joshbwlng-clean-types-edc235c1e853562774dc150f6e5d80eb903c077c.tgz","fileCount":16,"integrity":"sha512-s2u53TNQJ3Jjmnld14yeFzAJ5BLidMzl5LX9RIX2Ol3SBkV9NPUZY00Y39b/drBbsVYDKj8jIiBrPF0ndXOczQ==","signatures":[{"sig":"MEUCIQDM5Kvqd9Y0W/9JrWoooK8XUE5beIWqF0De21WR97nv6QIgYluHojy6cYd7MwjpSiYVFRkx3jfqpPHdTezEvxjxuuA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":143856,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhxShvCRA9TVsSAnZWagAAvhMP/R8p8zzOijBqTdOxBKcL\nJNhP2XqMVGLiYIRrOGa6GobGNY+nfN/WIrEj1iuGhjfW7gvNIhvY07d+Ivt0\n4zOM3/071Gl2kyUtak+T3VIICTjIcuLQXoDs17EBhPuvSku33cVExJudPN4C\nMX0uLnPI9Y1KorekyBXelvKqDVNDo1x/PnCpliYSW+7FOj8kDB5Uok1g44Kk\ngam6i7NfG+c8jpdjG5XAazeb+zqKxri9M8hk1Mn45zzrxcpLLrRrxmjUE/sZ\nDGyd35UagQpP9I47bzFYtufkAQBP8rQ6uA19mN5MqoJEaY4TX6Ruw/+QFc4s\noJ0zWF+GQWamKIeElDn366qv40ofxIC+E8SqA2175WEbOtzGtvns3QfN5Qrb\n9Ls6qCc1CKETpGSdnlMeLIBlNA3Cj6sHjlEbDPOEbL9S63rSeee8v0uA8gaw\nk2Hgpjs/GeHhKtg0MoW+6FaSC7XkdEcfAkZWLcxQ2BT91Dmm5aVtU646fM2l\nvXXjI/ZRmTBzv8kq+5Tbr3SghnuXJPTu8d7tb00IwB2c8zJslh21HDVXhOvc\nIo6tDL0YCX7032vrw8sUD7Ol2HuJA2Kjo3XTSU40gQI0xx8AHNE5sz9eE8Wr\nf5AIloFNkOfc+gVWlxGWDTrM94mkGbaJ6bspT2LWkF3sfJ5zfd8jetUq44bR\nmrYf\r\n=mzsX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"edc235c1e853562774dc150f6e5d80eb903c077c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-24T01:52:41.599Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.5","@balena/jellyfish-environment":"^6.0.4","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.0.3","@types/node":"^16.11.14","@types/uuid":"^8.3.3","lint-staged":"^12.1.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.0-joshbwlng-clean-types-edc235c1e853562774dc150f6e5d80eb903c077c_1640310895728_0.9674405233395367","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.0":{"name":"@balena/jellyfish-metrics","version":"2.0.0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.0","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9f45eae6c32e0e34a6dcb840ffd090f85d9d986d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.0.tgz","fileCount":16,"integrity":"sha512-6nPA621aD3Jg6w2wtZ5S3LN0u7Cf0GM+jswDO5Gb4Qmp9ANr/ty1qqogsms5lPN7y7xNeE1+3mjHEb43tS6YMw==","signatures":[{"sig":"MEUCIFTOrlSEhGvHyB9jlxd9Z4J5Dq8VR5BV1DY9yDxUwWn1AiEA34LJeqjgLN9jcL+W5DJ1FahRzn5AU2EJZEDu2d/DX08=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":143793,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhxSnKCRA9TVsSAnZWagAA2zkQAIROwwLh2YldnF/Pr2BV\n7k83Rv6X4yvl2c/KvZBYaGpAxsJTYpO8I4wWno3zfEaD1tPPtDq/n7fC41qX\nGXCu5juvo6zZX12nOYu3XOjEXlVAwHH92BdwtK5Z6jREL4WumE40JlaFRFP8\nZ+sBVx0pE69v+wwYENjSNFlPlFEP8JRrFJzIMhWB4Hf9cwb69rAg2aFHCSoq\npqYz6PoWOa1CcebrDZIdXcAVcAEC/mhFXyqjVim+OX3xRbc+NtsJUWylEV1+\n5fGwWVYQeUeTMaEZMAocpzsmJAq70VsHSQcQCN7xgSvXzV9VIkkQJCYsQBcZ\nhD2zKT9KkEWgH+2huwhwz67QMrVRrbJ5idA3l4fdg93/STIfYrbKG+DVN3gH\npxsmofviRn/ucFYvSPBYgqNSR6i4ztejBceWFUoy5mosGYZ2K4VTN7CxCJAg\nNzYWZadg08N1rv0VQoSV6Sni8BHKR1R6vbOD9s9Zx/hzqlmkfIOKH/PYJA3Q\nw9QOc0zU94VvgoHAd7VG711iC2I+Hg+5tu7ct5TZVP7EBedANVhbjkh5FqWI\nRhWem0vOc8NbjnaXxxxgtJfX4tU4IGqiB5tenGuZf8lOIAuQ2C475D3XD39L\ndhhOrZevlqiqaRxckWuvs+JA/UeCA34cE9Kd4WorjqaYBFs8xU0kYn7ulkxM\n4gmR\r\n=fmtj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"271581154b89d3a2ffe6d4db5fa6929844701fcb","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-24T01:58:36.448Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.5","@balena/jellyfish-environment":"^6.0.4","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.0.3","@types/node":"^16.11.14","@types/uuid":"^8.3.3","lint-staged":"^12.1.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.0_1640311242133_0.024384205073120446","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.1-renovate-external-non-major-4a4a167a204685df4df5666821a49cbd9cd6dcb7":{"name":"@balena/jellyfish-metrics","version":"2.0.1-renovate-external-non-major-4a4a167a204685df4df5666821a49cbd9cd6dcb7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.1-renovate-external-non-major-4a4a167a204685df4df5666821a49cbd9cd6dcb7","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5f85b57b8036c51014e3efbd75fe7455112e562c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.1-renovate-external-non-major-4a4a167a204685df4df5666821a49cbd9cd6dcb7.tgz","fileCount":16,"integrity":"sha512-sFlGTalcoI/auZIFxHBJ0xGbzRXsTGtOdXvnNyMS4BhbMRU76erBUEKuiugEM+29vzJptyS9iTOyBnRarlsmnQ==","signatures":[{"sig":"MEYCIQDgwflDhhOw7bphncuNX+P3ju7R/qZsS9sLUi6JpSYQfQIhAJrcX0nOV1ySiFbrQp4CoQxekTSK9l0mHhkU7oRZawsu","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":143936,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhxmo7CRA9TVsSAnZWagAAvSAP/iVyrZSfWuBJ6PQdME0G\nyfvnr37Qb4gu+/zGv+m4K1LQavBJk/pQt1FqjLDAyrvK3ppX7gaGJcFIh8B/\nDLdPtaoos00/80iqDsla15If9tc2vj5gofQm1iq4s6YQP8gle+7h3ptoiLFl\nII0RVelW9icPLuFnru/x5ZtvZjAnjjJ0tyx22IVJsTjGwUp/p6ozN3PX+WQM\ng436z2N4E78qbsoobUi+c4jEmkPcWj2ijE56mvFGoeRwhFquKHnTNqfnIVu9\n3QIo+JA5VwAM31r5vn4cjVdgUJ/dR86+vofxRy07bWdzGg/ilXrSNNAAGqsW\nW6MJEOFNz6ZxDpdMN9uCOsylVHDFLx8VamVefLgKGNv3IZ8XonjfX/yFouEc\noJ+I29C74z+hTh4zillvjTG+/neOasSwomxOvSXUI1c73gp0a/LGEUZqts0y\nW4Vp8xY6naTKWRn7x0tPD+pPITdl3NR59zdNMSEYko/10BIpBEZ9OKVXRru0\nPINuwRAH9MzG0skoGJk8dKR1o34qPssnSsEZdYvpK728unSONMl9unqN9oYL\nIA1ZCyd8nEAmyM0C0FjFezp2ZDDgC01g+2IzNb3wIrdqLKvQEEGbVFn4U9We\nfpLlwpnVl8H1MGcvSU6STr+eixObn3MF9W4nr3wSZeHsxUuBm12hQp3i/Mbc\nXC9v\r\n=p9mh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4a4a167a204685df4df5666821a49cbd9cd6dcb7","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-25T00:45:01.361Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.5","@balena/jellyfish-environment":"^6.0.4","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.0.3","@types/node":"^16.11.17","@types/uuid":"^8.3.3","lint-staged":"^12.1.4","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.1-renovate-external-non-major-4a4a167a204685df4df5666821a49cbd9cd6dcb7_1640393275071_0.08284999072267141","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.1":{"name":"@balena/jellyfish-metrics","version":"2.0.1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fe06f9f2deecc330c1e09fedab5930db937d5157","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.1.tgz","fileCount":16,"integrity":"sha512-TyPEA++8n8GBwFjIU3w5651DkFMI3MkOw+d4xQlrjKhrNefeEY9MDroLpJENLgxoATMvUXuWIsvlPkndQaMIEw==","signatures":[{"sig":"MEUCID6G4hPVvMOwVOSujUtK5GEKQQmA5n33qqRiCOrad1UEAiEA3bCwb4NyExqOfKMn4xmtuDTaJXG0gYUeO1/AJq0DIYA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":143867,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhxmsXCRA9TVsSAnZWagAAPf0P/RJHs6dmRjAltI0AEAfV\nclWfo6splAPOyAxunClDlWaPcnbev/0VEqw8a0eo3MbHkrOLkHqqgJjR+3/0\n83emgi7dBNOc56c03klTp++KucaefCkpvQCoswEL3EqGl1vdLhyhVQNa8TX2\nVwOJ/RGzWwjwqRRnQp+zKzl/76TT3Fw5ABkcclSndlN4E940bmG5s511BwCd\nSG/NwfHJhdpq+dbIa/CevpM9OjEaROZpxHeuwsq3tE8yyKvMA52EEstSyiHj\nNorUb9liN58JbLkHuKhLVGiwHwtuMY6ffd/bLovOWsfLxWa0LAapFC6vakhv\nUVKKCd5wOtXRMTThynu10uD2X7+iY80QKFmICxaJAHu0uPFgWZWIGucPonin\nMy0dnPpK26Qc5Ot+G4aTop0nW/uUFjNcPM59Y1FeLFNa8tTNDKJGb1UIRnA1\ndPhQhdw4nUEbBuHieQCkjByvv/Cmcjpm2uU+z1eBUJMzo20vpRC6K/eT70NK\nPeEOAV74hjpkXqtNey2j5kOeB24UIBPuLjJoZj7BlDbHBtefK64kHTmwpg9j\nVoStgyZhwnSVWjLrlWAjvEjAH1zKo79n17oszgVTbyDcC1LxvkNJDWnAq9+U\n5Q3BVY20YMtEXkBmkWX8SjD7nIFLUIDJLYSrGu3megfkBDXW6KXR75lu8jNO\n5Ieq\r\n=sIuz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"be3eda7cefd54fe8244ab52b166a10a69e46dee4","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-25T00:49:16.597Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.5","@balena/jellyfish-environment":"^6.0.4","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.0.3","@types/node":"^16.11.17","@types/uuid":"^8.3.3","lint-staged":"^12.1.4","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.1_1640393495109_0.2896545671906643","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.2-renovate-internal-patch-9f210c87718430d7420ade7bd02d8baa30b576e6":{"name":"@balena/jellyfish-metrics","version":"2.0.2-renovate-internal-patch-9f210c87718430d7420ade7bd02d8baa30b576e6","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.2-renovate-internal-patch-9f210c87718430d7420ade7bd02d8baa30b576e6","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1dc7f9c981653a11efe0e3d8a80c9ff592391c17","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.2-renovate-internal-patch-9f210c87718430d7420ade7bd02d8baa30b576e6.tgz","fileCount":16,"integrity":"sha512-0N2nImB3PChLrUH9+l7eqdAJIOMuskz0AyDVSRLkBbYfXej8TdIAbyaIcDXSjSFYNtiQQzQCfam7KayRAwlWqA==","signatures":[{"sig":"MEQCIEPS1viU/EcrECT4N9yCsmrU/lmtzuNw9kZ7fJjHjyAXAiAZUco3hu3BwuVsQwa60vVNpeyCZDcX/C0IhWW9SQulpg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144033,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhxmvLCRA9TVsSAnZWagAAVCwP/2rlU9p4HuLpKqxYQNf2\nF1nftukvsFeyebz+smQ4CIQ9KZmeKx5igzyE0HD9mR3GZWCtUilV3wJ2mf1e\n8GzgMJVl5MLkGEYEfIwWOn/Rz9zdSZLoNS9faVigRkvIEJIA+EBkOLnWKakm\nJPXh0m/ZjR2WJPETZ8OZYt3zHgzryZTL5tlhBeb+kA0WhBGpt0LQKaw8qoxn\nkw2iqiVlScphCIXdYvu5T39vfExtIN21Z9GLD2b3yCYa2J1J+JlxvWhOdcRV\ngCmGxJbJhRDRrCedl5ugKIKpfArp8txaJECsiI/TPaDxzzZAzKUUfsa2Yoz0\nrk/pbO/hXZmJ85yxIX2U6wrNlz+yorpMzer0q4kL+AEQ9KJJhtVlJAHMjlnI\nT9SkLfOdOPBo8cqt6UmK4mvW2Wdm/C0gfFj/+oP7leUv4nngUW2A6fNUl6YL\nEX+ELe86kFpsB/ONdZhUBmYnj9VgnlAmF5UmBwf4xi/YTeDdQqyQz1x4Vlr2\n+cXes4L6B9Lvr5wd/3+Bp+aGovcMCOhwkTyx1UhCD9MbDkakYgwEy4n/x+lK\nLms5i2kJ4gtD00yqP2dnJRJhFI8NuG6HPgUhEmqvgwN0UGTnZsJeMecCjb2P\niWjREpt2UmEnQOI3sj9DZQuKGeDUZIEvjzTFEZqCvZb3C4KofLDDYeF9WW1r\nq93t\r\n=w05g\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9f210c87718430d7420ade7bd02d8baa30b576e6","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-25T00:51:42.537Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.6","@balena/jellyfish-environment":"^6.0.4","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.0.3","@types/node":"^16.11.17","@types/uuid":"^8.3.3","lint-staged":"^12.1.4","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.2-renovate-internal-patch-9f210c87718430d7420ade7bd02d8baa30b576e6_1640393675080_0.4467767415646855","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.2":{"name":"@balena/jellyfish-metrics","version":"2.0.2","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.2","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"77c58c1e00d63dc471d38f29466c4bac16353a47","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.2.tgz","fileCount":16,"integrity":"sha512-lcq7wMfNR19kJ7uTC0lBtxmdH0AAfoSN7s2TNpmw0l0d2FjeDkqeDZGbg/ZUMrizm0i86a4DdEW/yu7lRbHMCg==","signatures":[{"sig":"MEUCIBAAEdkVG4bWUodcgFTSqA4+r5p5Bg1/axQhR0h/hfG5AiEAqzhM7OagHZS9MIiduX2r1t8N/qGQy5FLZVIeDmE0fik=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":143968,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhxmz9CRA9TVsSAnZWagAAB94P/3wsCPjqwq0EkZ33+De0\nFLEabs4b2b98XBevvx7minrfX8lDOCYQ92S22gzXAuRCfQWSugrrmgyec2M/\nBvtZDNFiXvD25TfYus8lTOtO1m4/HPfw/3RRyggdLecXigzAMUx8LQEl9fIn\n7UjYKF3yggEwSqqFtkChQwSnonjcwUsYPn4AuQybS9d0UPDDcKWF+XzX+ArE\nqImRc7vnPytqLomkaJUVyyY2d9YXWowpB888/Yisu2P88T7ZxPtfPdPo2cle\nAE4C1FHLxFQLg2SSimkxTVSzC6TURvy99CxQ3ux9DOQk8SurJfu4wdoheGMn\nVPftsQ9l5rKMG3PuqmtKSo5mOX/LdYarn9ctvU4PsbIXkNMnlp0/PxI1cq1k\nn2PZYZiveWpmay4Y8Yvt+ETkLqPrZO/IVHKHxhfdp6dgOMPwn5zv0D7Qz4yi\nN6MNnVUaTxRzlM3bJB8izCbir74auw7NCQCDi6lcQaGBzHV7x0ZJLOGHxaNu\nlpf81s8BK61DucehOdf8ZMD8co0ufVP3hQVOBk+UtzE5wNrbl0kkyCfzQUgr\nsLQ8nXkEKODpQ0/uTpMZQhWlYJ4h+6NgYHv9txiTdoO6Xx/D2AIYi4+EJW1d\ndIGUkq3jhoC6n1tEOrHWDzLlLr57IzfBd3EGt6WJ9BBLaPZQucd3kvlRfTxS\nbYTm\r\n=QISk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"25c9b40b67412f6e9f2eee8503041167ae13d814","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-25T00:57:42.609Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.6","@balena/jellyfish-environment":"^6.0.4","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.0.3","@types/node":"^16.11.17","@types/uuid":"^8.3.3","lint-staged":"^12.1.4","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.2_1640393980969_0.7479884845985012","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.3-renovate-internal-patch-dfc5eade1ecdbf9c8f94f29e1b0610dfe6418856":{"name":"@balena/jellyfish-metrics","version":"2.0.3-renovate-internal-patch-dfc5eade1ecdbf9c8f94f29e1b0610dfe6418856","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.3-renovate-internal-patch-dfc5eade1ecdbf9c8f94f29e1b0610dfe6418856","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0c47a044be52c648dd390158f36637996a439320","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.3-renovate-internal-patch-dfc5eade1ecdbf9c8f94f29e1b0610dfe6418856.tgz","fileCount":16,"integrity":"sha512-R/bLa0sDxOFJyLq4ufz7m7HecEdW497TpC9GBMAMhtKN7R4NwhExog0HCTDhVugzJ62XmKMSLLGYlEBY6MmxWw==","signatures":[{"sig":"MEUCIBQSZFFtNOTdDRTNmW4BgH7dfSfTK4Jhu0/wyCXPheMrAiEAu9Qmq08meneYuxgEG4OIFsu27bDGCbjhVDYgHmCwhfI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144103,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhxojeCRA9TVsSAnZWagAAAokP/iNugiyIyohSX5lrTHa4\nt5kX4/Ad7DFLtSeWg0+hCRANSelepXYNxsNd45dLb3zacgarxDQpF+eE2QWI\n+a6JCbmUBMr3eY0GgpAzEoWaDLVhWQFk6rYRxpXue2MIUTXsbtd9Cb72efk3\n5V5VvZ+E9KuGxZDhrno1kRSVPf6mGH3UqKWO6izBsxU4Lwo2g1JzCv9zdDvd\n/t1keQNSlpawpU09zKYS01RkV7TeNpg3/1vfhFqC80yoBFTGhSq616UCaH3A\nylEghYB/4aFEc3JG9mr3arwdR1exBbofdrcB5x6ev2fEqunsL3UhecR2NKhP\nhQGw+oTVkvDTDzvqE1WSqLGcPPMDSmYXWnUtu70A1ijmzgaKMzGv9L51ZZ8d\n/+mX3wxkwMWVt1xJKuGk70NtfgKLszknL6QyhRVdLiUOj6pc5iIp5DwKEyE6\nxgu0BKud0ROMMySnTvwtA+LjIgHOXlbQgOOlq+zDLTQybFLu2Z3rJFdEX5Eq\nN4x0FTv203IXYhfwnmEUZkr5n99gKY5Bvg9xU4nRIj1rB3zXIsYzgwKvKUDV\nDarV8RuZ+aujlml4JV5IHv8ZODm22OsDt63BgEszEfhwPEvS1sqEU/TSSBOH\n0/4nphZy59E/x9GQf7Udv2YghyWX6LcA0TDMI5pejr5OuJYo9iWEBiiCvjZK\nCCnV\r\n=yFj/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"dfc5eade1ecdbf9c8f94f29e1b0610dfe6418856","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-25T02:52:44.361Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.7","@balena/jellyfish-environment":"^6.0.5","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.0.3","@types/node":"^16.11.17","@types/uuid":"^8.3.3","lint-staged":"^12.1.4","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.3-renovate-internal-patch-dfc5eade1ecdbf9c8f94f29e1b0610dfe6418856_1640401118180_0.36430356021662647","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.3":{"name":"@balena/jellyfish-metrics","version":"2.0.3","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.3","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ab6162c83674a37ef97bef57490c3f539ba85769","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.3.tgz","fileCount":16,"integrity":"sha512-JKT8v10TB4BBQEXfbN1pH7rV69nfUxhVtXzszXmOWDSBHeT2TCSehiswpuvrYKPcFVXq7gILvqftsb9/OKHPBA==","signatures":[{"sig":"MEUCIQCZ8Ur773YETqSi4162e+POAf89ItwmGoycBLZRe58DhQIgKFg8eUK9bNmTrbZNYrm3rAory+C+wnByKzOpxqiB4Yk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144038,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhxopICRA9TVsSAnZWagAA1YkP/10zewrAEdtqvZym2lxs\nDRtHbuBwldQcgz1970dNfSy1QvPVhLIIICACWmrUBO1aoAHlYxKnbOWNmPp4\n2cSsr/TQZJSz/MVG4CBSi6Pg2T4lMH3n66aHslkNDk3dX/FAqvdl7ElZqU7o\nhq+Y4vMk05jJhS2AGAfX03C9mwKMGC9iOyekcVN2J8KovWL7R50qS62VRa+o\nkMgjwhGk6WO95cpszQEhH1NQ0P2EdouXMQhMNP93DsukwdEZ2ElyAXYvHmlX\n1gPlRuCP6aRiXvWLbFTaAZE2j3lqqqgqdQ0X1wtuIb0dEOnaniEbOhTyz92F\nOHAQGcQIgZisLYqIwU18X4kz6rx+5pLpGaLcUG/TqZ3vjh1D48H73HLnrf6x\nXq1HO3qaxAvqBJX8yFc+PC4RShfpmbaMwSyzDvHFRi5VGWitFYgapHzUBnXU\nh0o6qMmii0d7JvcANeqEV/slSf/kq+m5zrlh4FDJx0S4Du1TKyRFYNFDDOp/\npU7BPoLkz0K5ljVOC//tP9zSy0beiGkw2/Z3Hu/Q4hMr/Y2x9SomwK65Tf/E\nef6mJr8oO//XvO8+PNSX/3uOTX5O6HykN2MCqZYZndlr4viwOzr6oIvf7qX1\nAEwYslWI+p6DM36+qSHL2cfAk1CVL3vLNBK4GmwWKCOcrw5+WYRA+DG+IkrL\nVz/v\r\n=yRRf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0c9c85dfbf484598b5bb2a542a8ce0c0c56bcee7","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2021-12-25T03:01:34.629Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.7","@balena/jellyfish-environment":"^6.0.5","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.0.3","@types/node":"^16.11.17","@types/uuid":"^8.3.3","lint-staged":"^12.1.4","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.3_1640401480155_0.6588722622616243","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.4-renovate-internal-patch-8f0b67ac396d95e6b489cfc75ca1b12fe6ff5bb5":{"name":"@balena/jellyfish-metrics","version":"2.0.4-renovate-internal-patch-8f0b67ac396d95e6b489cfc75ca1b12fe6ff5bb5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.4-renovate-internal-patch-8f0b67ac396d95e6b489cfc75ca1b12fe6ff5bb5","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"46f490b236dbe6a693455fc7ebd4825876d9f811","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.4-renovate-internal-patch-8f0b67ac396d95e6b489cfc75ca1b12fe6ff5bb5.tgz","fileCount":16,"integrity":"sha512-oHgeH4vwszPBhKI2XAYvOH4FIvfWtbMscFlJK7f6gIRv9rgRls2orPEsZniu8zdWEmKwV3B6I89+3L5PhCCVeA==","signatures":[{"sig":"MEUCICmMjkndrXFjb7Ha8aKXCWF84o19Tw35XQaDXAmhvjVOAiEArjYmCcHuSA3wwrGexumIqYRkPxKkUQI6cohqYKar0o4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144204,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhz7g4CRA9TVsSAnZWagAAG70QAKMw1rE9amO//DXMOEK7\nXb1Q/m+pp/8X0R9i9quSOBONITUCNAoStc66OpYqAqnVrK5UOGkb8IHW7G3C\nEPHcEdYW9WEEwa/NSq0dmZNrxukCj8htRfQh35gY06yCCzoHd8KuxAin8lEZ\nJJwB3jh2IOMm/0QWsAy2UiF9PIb4YR/VkFeS1r0bNuwmtQjnMV3sC3r05Y1u\n5r5OONBfX0/A0i1+MSLMeY5UddIulbBWb3GjSXsmo6Bry17NiUIxDW1E3Y67\nPNFsSb5x142IDCnNwukLnaOYkfrVbE5Ge/1Pko/VNvbXUM6+DUisuFha0A29\nT9VkQGlTkkt3823ZYkn/904Dy6djLfPVj2fhiaLv8+EZ1farCtgeziru4ff1\nQW1m03tN53RLC+SpGJ/h584qpXAF/gn7IvShl3gh8mRMZVkmBPI+Kxmp9ryh\nooGlWKKF6rY/Z8ZX0WPmSA3kLeN0smTBMyDmkxkDGaQfAGDEfxVRXh175ZD4\n9tbErfSoI2IgQpgoXvBaN8QNrlCLhvoUilHqkqIeF0mW5CfzRwy2JcikVHAH\narsYpNXa4bGLhovZFeyP0+P3rsjHCpCWkFIC6uq/7ZeciDfhoWlHtzXvcNfg\nAU3Dp/mLt6R/zgFALDvdCWvBjKwrvydW4zDHoAU5A+xDwSfyAp7XI9rSGkve\nrL6G\r\n=+WcS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8f0b67ac396d95e6b489cfc75ca1b12fe6ff5bb5","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-01T02:07:45.703Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.8","@balena/jellyfish-environment":"^6.0.5","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.0.3","@types/node":"^16.11.17","@types/uuid":"^8.3.3","lint-staged":"^12.1.4","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.4-renovate-internal-patch-8f0b67ac396d95e6b489cfc75ca1b12fe6ff5bb5_1641003064585_0.1599635904335348","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.4-renovate-external-non-major-183a95a0108117374bc096117aeee58097043882":{"name":"@balena/jellyfish-metrics","version":"2.0.4-renovate-external-non-major-183a95a0108117374bc096117aeee58097043882","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.4-renovate-external-non-major-183a95a0108117374bc096117aeee58097043882","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"787353960a660d6988554981f05ea2b506d5e8e8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.4-renovate-external-non-major-183a95a0108117374bc096117aeee58097043882.tgz","fileCount":16,"integrity":"sha512-mHFmftUb1pil0WfIwp4Yh6E/Kfsan7G+xNKGm9O2TSJXF5/Rzu8IRHlAZL/F554mARVn++6TklgOVfH623cdoA==","signatures":[{"sig":"MEQCIHTuPffMInI2fhJjs2/2db1XtoASTfGESgZCHaXOvBWoAiBKebEfsQwMwRSLmPYPc2IBltgdRCPfKuW6ABdLqF+WNw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144196,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhz7iACRA9TVsSAnZWagAAoWsP/jJtc8rTPYnx3hl5t1KF\nKwbKUjSBlzT7TmvRL/iGz1wsQR+pa49eWtQYqfKF3UeXrgajHgw3qoAeAcaz\nJZSBRR2SUXRe3XsnNnAHlUYvGw2cfrb9Q5bqxPCR66H9B1Jy7zEVe89HU7im\nQqskPjyDe+8atIudc5tAawA/LqbtXRty22RYabaT7sL0ODKsEBDhjxzX7shN\nST8yLNlb3b4IRNYIxb1UIWRd3oUnpQ8WoaZWdEoGTAHy6FW9ci84alGVXJlP\nrBt381u+yDQ9iow9am2dr6kiGpMY30d3N9degrVHkNHHYIDEIGOp4jdD49aE\njzyMrVTe4SW9fBwvqiVb0/8nmlEEeqbJDqJq0t+Zd9EuK8/i0FiH+ZHNHWpK\ng10CzRze0t5YldnPY4kxWZui7shlZX6uV4f0bHA3trstngcQ3d+v17dx5WZx\n1wPk0GpY8tSbJma7GGEOMIMIQv9qTLmkYDB7OLMPMszw9DGQSvO7yeJn5ZJG\n+pVQQQ2NaGVNvb/CJrpsQRzLehMOxPMHJhnGOlISF2l7eVNhOm6dWOS/S+Xh\nCy3XeZB2N9QijW/JICjmRcPIGwduEWvCwSnFZnXJQaT1GlCljAmILCX+dgum\nqRoIBogByR8HP2107Y9A5GdVETLGkLOWmkxfIwomk7AeTNNjIwxrUptJl+Dq\nTtf+\r\n=S8g1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"183a95a0108117374bc096117aeee58097043882","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-01T02:08:34.518Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.7","@balena/jellyfish-environment":"^6.0.5","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.17","@types/uuid":"^8.3.3","lint-staged":"^12.1.4","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.4-renovate-external-non-major-183a95a0108117374bc096117aeee58097043882_1641003136012_0.6809601917404497","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.4":{"name":"@balena/jellyfish-metrics","version":"2.0.4","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.4","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a34193e03323d81b8849631e0aeab7efc14d3c48","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.4.tgz","fileCount":16,"integrity":"sha512-lrHEqiYBPyjIih0VmROsxnG/hYKgrBpIsZLW7clUD2k95qOfUcU1NyxaKEeQ4D447p3GSwijWh5SIGwNBKRfNw==","signatures":[{"sig":"MEUCID4EWFvqfG7JmQR10S1vpPRKJBiDsuWGylRiyx1u00S0AiEA8iLWg9dOykduzVzd5sWNQKs/4KIVzM9tw9yk+NIPb5M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144139,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhz7mmCRA9TVsSAnZWagAAQvUP/3FFUO2HPr/EtN7DjyFn\n2o34T8uBQFJYykaP/1zSTsw5gJyvot+W5L5sYrVKAnDQW/9x/wUXmA8YxfUl\nhhPSk2stFnP7a4dbMYA72ODdFLa6bZMD1B4yCQ3AttW1K29ud6nRzpfYbK6W\n4Zkk+Iy7V4VP78SteIsXr8SjQCK/TZ5qlEkPORsEYB3LnpA4oz4kBkEG+dQM\n79aroU6WnoMmVZqK8S2uuqRqEHZ4blBdArDclO0AVi72COki6gjRfGRvbUXE\niq4SKedxGVB9ghfufipISzWmKOc4sKPIF3FL8ZDn3KkNtQzXmDfz+Lme6B4m\nHFeX/QDa7px+d48+032qmQms2fp/mp8LXj8ECURuH2Q44REubIQ5d+DU4MBj\nWDBdwWOZ6pF7k0TiqB0kkK78hLQN5GRb0HOlB43AWp+PQsP1i9boIDlb54q0\nyrZZHIbi8vw6PLmUfOIf4LUwRH1KROuD+bdCiWctSvoPYmQrCywjuZNs47Vm\ndz4U5MppHhHyej6/kqMXFrt8u6IqAudWHuSnC9KtUP/AxNjXK+Y65XKJ4Rln\nvgPaQ2VgwK5WRRDQDwfPMhoNj0VwvoLi3p4bV1keoYbyn6kZJnDE3kAtqiha\nCea9ehJgfNxfYA7bUdE3XeGZtFVGZv/At7gNE7arp+xSpii86rL1jY1NF7CD\nCW0y\r\n=myp6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2c157fe8202024a246c31a469c76939a61fa78e8","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-01T02:12:34.741Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.8","@balena/jellyfish-environment":"^6.0.5","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.0.3","@types/node":"^16.11.17","@types/uuid":"^8.3.3","lint-staged":"^12.1.4","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.4_1641003430628_0.35661999417719104","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.4-renovate-external-non-major-083343cf574ee4b4195fa363f04d6dc2855cb96b":{"name":"@balena/jellyfish-metrics","version":"2.0.4-renovate-external-non-major-083343cf574ee4b4195fa363f04d6dc2855cb96b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.4-renovate-external-non-major-083343cf574ee4b4195fa363f04d6dc2855cb96b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"21f5bd2d21bbb8ecc2c15c793f61ceec83459816","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.4-renovate-external-non-major-083343cf574ee4b4195fa363f04d6dc2855cb96b.tgz","fileCount":16,"integrity":"sha512-l6iK0HKWaVxT66Uio7NFC3YP0LckePpH/Tu16vyFNQDdMiSEaezz9qYHnl+8bDzVo+uRNRYEFEOA3VXCs3t0qA==","signatures":[{"sig":"MEYCIQD1gESjTS874HqErM1yblhr9f7xbxfgDilQXs+3LTeWEwIhANohmizpA3A+TjEpWJfA3fTEhy2gxjBUC8+A6AZ/fVAo","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144273,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhz7pXCRA9TVsSAnZWagAAtNUP/RBM/4vf+MKUfLPiVqT9\nhxnL2EWS8i0l6VFfvmfGybXoAlPkoxnPIFQpu8ohqfR7iFU6ERqKalJil+8f\nAB+xqJfhiCupHdYH5Rj4dOmxLlQubjrjQMOfRJxYElwp8q3n4zlg2bH5gtEY\n9WUzlganOvzZUcdB0CT/Si/v18FAT0mtKtXbR9w7CfotjUKTGXRGHEinttTn\nmiSSwMQ04l0KHRAjZUSIYQTbsqbLw8f1U/uxNP5eoFG+alwrasxLbVJMk0qR\nmzVziAheuQiJKe36cqEVwYpoeXrNHemdCDlEnbO8Bh/3m5d/3UiBOQV7flx+\n721wwzPeDt8+EpfvFZra+PToUsVO2PSO5aBhJqgtRp6HPzmWSwcRwVwBMmgV\nxAQ0MT9EUkbIBUDXNQKrZYk5CFW67cHPPl8MM1/393Pfn4necEhxd9CSZBgN\nzHL8lF4IQ9oag2l3JkW6LCcjHWyQCGkOfsNM/efwQN13b+O0aJxYe0YDkf+0\nBGI8c1LBpm9K7ayhEZYFIau8dqjzPRhUpTIvzmQCwQbAFTsafSMxGLLUwgD8\nBxQ6zD3nOdeNyzgYZmtgPI3AJJ0o76HYLKQfQDNL5ExFLhr5MSV80VJcJju+\nDt79wbifnMtQxzuzV2EDn1p3xTw7lE92jQjFWKZqyq/oZn49c3AsetT9rRT0\nNNaU\r\n=1R9S\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"083343cf574ee4b4195fa363f04d6dc2855cb96b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-01T02:14:12.929Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.8","@balena/jellyfish-environment":"^6.0.5","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.17","@types/uuid":"^8.3.3","lint-staged":"^12.1.4","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.4-renovate-external-non-major-083343cf574ee4b4195fa363f04d6dc2855cb96b_1641003607049_0.9126262155425975","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.5-renovate-external-non-major-2c3622c7ec399244b8a0c701fed244d742aac388":{"name":"@balena/jellyfish-metrics","version":"2.0.5-renovate-external-non-major-2c3622c7ec399244b8a0c701fed244d742aac388","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.5-renovate-external-non-major-2c3622c7ec399244b8a0c701fed244d742aac388","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6fcd767da8c8f1fcfe7107f3912998bf53a96814","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.5-renovate-external-non-major-2c3622c7ec399244b8a0c701fed244d742aac388.tgz","fileCount":16,"integrity":"sha512-4+ijNj3JWO7jUrVRV057OENUwDE6kpRUMCua28OgM12BfQFGjvaucsU67ntK8r3NAs6Nknjch+9b/nLr2noVNQ==","signatures":[{"sig":"MEUCIQD6GjBf8z6OduWdWUOGCa9JnKLCjaB9LzXoUQY4qKvOBgIgVHkizbonBnv9Im2PZKhdCCQx5HKyReukbFfOdeswqCg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144297,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhz7r+CRA9TVsSAnZWagAAokQP/0JiI6uBloDiq+VE8Lku\n+GetRXhpIvjaI0mqj7SVw6+Q7OIT/8ZeKfFeDb91viIIi87nc5u+GVDvCx40\nP2AnPfq9kBdTM60p2qhbM24vtnjg7MOc/8qvSra4vh4ijYVUitWDYKH4t0xO\n3vgdofaNOStvl0XGPvG+dEovri3VjSLBO9j+Rc7Nq0qE3z6tB2pBB6i6jvu9\nKxBf0lpja3weNm/enqvIqc6mdlKmGGGa/1K7k06dOyueUGLK9gtBDlrmGn7q\n45Bx9bMT8hEoScElzHnFfgn0PMDk28I36ZV+OdENsh51w0tB+SljXODmqsrT\n/dt7I0zgNzkQQm1BXV3z4NEN4AQjgFYZzYlwVJeNju/fmGONkV72bWbciyTT\nASInjk4dEMTe+L//VCUqI95nRedxiGcioXJbXU49umbUSHtacD7Ni1iwKOPk\ntEMMu8CGbX7HBZBXMKs9hvCcAheuDKOjxoL3CnMl4p9fUPC3ixTVTf/P3DkI\n4Al+EaeY1psUW0emOvUZ4QwHMZgpbYbvFnzlqm7s8/tUgBDFFcxVjSoCdWKu\nwbb3QUjUNzY+LT3O4LPdomDO0RaC+n25+5qS+fVPHwuI44+NgFHaqXkM66Un\nBNlzbMH8U2wcSvB5Qtfm5WmpwAbZrDdtW0ln2y60BuDq6gzWe1PgLqCohYn5\nrzmK\r\n=2/f3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2c3622c7ec399244b8a0c701fed244d742aac388","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-01T02:18:36.742Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.8","@balena/jellyfish-environment":"^6.0.5","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.17","@types/uuid":"^8.3.3","lint-staged":"^12.1.4","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.5-renovate-external-non-major-2c3622c7ec399244b8a0c701fed244d742aac388_1641003773839_0.1178969286251812","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.5":{"name":"@balena/jellyfish-metrics","version":"2.0.5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.5","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9d8e7a5b3dd40a65f92b588c624b0505ec900fe7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.5.tgz","fileCount":16,"integrity":"sha512-HEpniRtnhUDzWUqK056x5x2sz+1csglBZNcNba7I5Pa84NeGhkoZOYKx8XopZSJ0NSO72VXadxRbZTvokaVUSg==","signatures":[{"sig":"MEUCIQCM1J+VF1d0t5mZODIL/y/sjy7Qgtux1a5qerjOaNKDlgIgfOwNBxSKmeui9Y5zs34D1lG2B8JZrhI41ukH+n3aWA8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144228,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhz7w4CRA9TVsSAnZWagAA4wwP/jZjuMqWie2i0yIZLJlp\nFi8pvF8WTaPMvnWqBpUffQWX/Bwu8lZJXi6bcbBsxXS2vCu95rvMN27KDNjZ\nxtKd4W5fn6G30bHevfFF4dSuKJkeUVU1gnweT52+K6VXw/guhZ1ctHHn+C2z\n7js/hOAqoTwEkywgAY2hYcRCsTfOrs6b95UumuLRhl81an8EATxlmtkOhvsI\nA48IlMjWEkCP6EG/Ib0Y/07Ra5OslXlYmVBxtxoCOlm+U+Qyd/ZjUHP4kXFp\ncdCXw4bZ/hqfT7ZK2h3xdWaqUOebhzgdIr8vN+mK41GTlSZh1ZWh7fW+yeJk\nE3ESyZ+4eV00goqt8+9jYJP/nLzoE/5YmDkjyxcc6BphUU1cq5Joh8TdO8DP\nzjqEmZY55Lrg6sbGD+4Y71Y6Z9hK7LuRrggokyIN7sG/bg46RVYh8zqqkS6o\ngPkWwtJwcf0y1/armBKoGWCwW98HhGJZq6ubnLqNCyBqS25ewqRTMjrcnE0I\nfJFQxuvrwo0csZlfkswEDEifrdmVxcw6liux+pOwStDAFTP4OfXT3OmBgbMi\nHq1KP36Xto/srCT59Z/t/ogPnTZchMNUkih7IUq5dpji+q0fPfMDPWvy6btU\n0BmPCcgchEzYdznHa6vf0JCh9/r5xjg30WQFeQ0r/JvkWReREXt5X5nKU/fB\n8vMn\r\n=uiD7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"16f5afa85643748bbcf304ee1ffc6565520f0440","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-01T02:25:57.806Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.8","@balena/jellyfish-environment":"^6.0.5","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.17","@types/uuid":"^8.3.3","lint-staged":"^12.1.4","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.5_1641004088342_0.5049319387610736","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.5-renovate-internal-patch-d5971caf30a506a39ae0c242f545fbd26e98b4de":{"name":"@balena/jellyfish-metrics","version":"2.0.5-renovate-internal-patch-d5971caf30a506a39ae0c242f545fbd26e98b4de","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.5-renovate-internal-patch-d5971caf30a506a39ae0c242f545fbd26e98b4de","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fab81f49b0ae59a41ea813913b8649281e01f965","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.5-renovate-internal-patch-d5971caf30a506a39ae0c242f545fbd26e98b4de.tgz","fileCount":16,"integrity":"sha512-cvYJD4ojthh2Yzoe5Jv5aSEG2HKOqfWYOWTrn7uAD954EVK/5wc4t+RdsLV7UaSRb9csqKDzknBYGbxiYoQ3jQ==","signatures":[{"sig":"MEYCIQC2lFX+Twz/Kz6/jvuyiEZQPVGj8WY9aDu2Hiq8Z5jtigIhAPvdFHNlXq+1S0tAY4z+ToqdeyLJdWucuHGVjrUqIv6E","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144310,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhz7xjCRA9TVsSAnZWagAA9DgP/3BMAJhWzJEFfeKO3BM8\n7ejWArIgeT3+YNvQv67JVztjiuMPXN1Tz4TZFE+0cGmbY3o4RKZhcpeKtbsC\ni6021YI57Vt0Ot3g93rAlIE00G1rbmnQhrV5gHt+h1lr15vBsOub5mNwtcaw\nEVhHUMQER56UnjuULhhd9vi4SOS9w3JFvrccal6ozCjkRtAdGr1phoEo0qD/\npHKyaki1wcSODoCnIP2HADIKzY5JhPor25SRe7Em1sW5lMlePjqhHSe93D3T\nC244m2WFKEGqOr2ui3M5DqjtIOFbmVQ0DDLwAMGiSuBXKBwMchCernDKeE2o\nPOaltxnVTbQa2i82+Xgdusuz8sHzHEriNjds5a6pg+pyFAZrRonzz6VrdtKw\nVI+3zAz4Z0KZ1Ru29lB7B6O9qryKgXukibsKQEsvsk8yopTjKPQQAtiIwMRp\nHQ8TzpEYA/22/QrANKbQBvY6TPoy8Lg/BsJXV4Z0TFIVHeEkuL8i0k0/9myC\nm2W/pj2MzxQqh30FS9X8TJI2bNhITG6E5u3X2sauGttxrp/i0qJzEjYgIxHu\ntFZqfRRfsc1aC8bZRL1S3uQgCwOMKh2vc7DkbH4krT+v8CpIgOJR0QbuX3bw\n9Ig31LTIwDyanOyymxUR+WBbeP8wxd8TNXbiXN8k+cTW1BCRoTSenlSmNRR+\ngs+s\r\n=4T11\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d5971caf30a506a39ae0c242f545fbd26e98b4de","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-01T02:23:16.105Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.8","@balena/jellyfish-environment":"^6.0.6","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.0.3","@types/node":"^16.11.17","@types/uuid":"^8.3.3","lint-staged":"^12.1.4","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.5-renovate-internal-patch-d5971caf30a506a39ae0c242f545fbd26e98b4de_1641004131589_0.753776817739443","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.6-renovate-internal-patch-0e64f385c445a4a1ff352f78d11b9dc16d2abdad":{"name":"@balena/jellyfish-metrics","version":"2.0.6-renovate-internal-patch-0e64f385c445a4a1ff352f78d11b9dc16d2abdad","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.6-renovate-internal-patch-0e64f385c445a4a1ff352f78d11b9dc16d2abdad","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"172def587d1efff871740f75bf9e7a7ae6867624","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.6-renovate-internal-patch-0e64f385c445a4a1ff352f78d11b9dc16d2abdad.tgz","fileCount":16,"integrity":"sha512-Lx/Y3rvGoCWGVsipU9Qi1itBPFgOYvyGf1X4sjKHpfRtZr1oFdhG59We4kzIJw4g0RZHoxffIAEwNlAnufyMRQ==","signatures":[{"sig":"MEQCIGL9OH4qcyhe74Xn+FodEAm3WEOp4X/fbr8dK/hl7H7HAiBjIm5bCbu/iTL81Y9Q8X1nl0n1zFiAxIgZfjEZDiqg/g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144399,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhz71oCRA9TVsSAnZWagAAvqYP/1OWDtUPN6XNosPIXoM1\noqlfbXJhgIXh+pbQlBttlQwB6XhcYchy1mTK/rKUc+xBj+XqglIQ1KBwJefN\nsj3j7or11CYyEmF5PiDYVF3eAi40SrZ9BgrjdvFAQP3TmE+Y6ALiYUtJOmsJ\nTevBRHgBWpssMBfDv0QqXP1v1Q8iN5DFIIA8X5V4rdN69zNPrLSZy2UetHSm\nX0L45YTp843/2LGdSeDkDPvFWnWaURlinhjcJQgvCm6Lb6CNNp9FESSAThaJ\n/fEpGoGssiSi9hiUHEv7i+bNpw6ivb17/AxYunFyJWz9DYLRw90W2/uMpKYj\nzeVPjjautVd2DvUzjWgp1z2bL4OSXwXjRlJ+9y4xk3BfvHqjbEru5CDb2NI4\nKnNr0xFme1jFJMu70XFtuoF9dkkcvjMGlfachAWHgv6UKm8a7rfOJGD6OAqN\nXCFwM7lHeR3ZsDchVbNYisRU2Zb7nGIadtDsvFPJ3VbugyKb0/SzzyoY8n4Y\n0dVbwysfQ7I6FG20TqJEbkfHYfcs6gyEHWJoUHLcX8bIZnNrThdgq/Cz4VJ1\niv945O2ZPTFEAc/u4Y4rjSKyr9rbWtxhsi7O5ZjoYyvtfNPIvJYwc3OtIxla\nlL1SosQhVMggiHg5VFi89L8y5OcCbCRLNPByfGHQZaL8z9bjBzoWysNXtwM8\nVNvY\r\n=ffR5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0e64f385c445a4a1ff352f78d11b9dc16d2abdad","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-01T02:29:47.859Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.8","@balena/jellyfish-environment":"^6.0.6","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.17","@types/uuid":"^8.3.3","lint-staged":"^12.1.4","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.6-renovate-internal-patch-0e64f385c445a4a1ff352f78d11b9dc16d2abdad_1641004392709_0.8335339088238256","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.6":{"name":"@balena/jellyfish-metrics","version":"2.0.6","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.6","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c1131ba03f80341c79ff414c7851e26c6cbc3e2d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.6.tgz","fileCount":16,"integrity":"sha512-9dUmu8iwl7y5xvyfwBoDneD7IU21nPQo4pO5O9IiUdapTxHEjwrOOx3euyGxWts/ro0SxUEDsNsDrCgrIfaC7A==","signatures":[{"sig":"MEYCIQCj0PstohzATh//T465AuwtZk+6m7FI4uEySBjqkP5OXQIhAOgUiQhFjHAGBCmyITLsYTiN5EmlJIRZK1LuSjRs5+gz","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144334,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhz75iCRA9TVsSAnZWagAAX8gQAIkHJ1uxxCG3Zv/MEhCH\nIR48mmRLOFkvwsm6vqOECPY4HiPWL0A0N94RYyzv8WEyAVSj1wZTvQypCyym\n8RZpZq+4l0veoSJ2doHLudf+n3U7GzXSnumf5fznHD/EbY6fd4rD++Nz2uYx\n7pY2P+XarklEawRfFTKLn0/7u8agTbAc1QM3wNqgbYOiAhDwHjPWS6peHSPR\nsBSQ9t2n/WfGN10wSLT1GO6fyp1t0YVEEylnzNNvvYRPTzI5wjUVNaiVllRW\nSj6C6eIocGkbx8OVc2KfcsLcZ13utG5MD2uQ7/ARHm8QlbEJcVT5Oai1OogE\nFfdtt+fQX/qAhmLPpMmc505DApv9OdrDUhLUbCisvwUC8R+9MnnPmM2iGpvL\niqVK6Ve5gzZyj9nxglPu+weMchwNoPMOkUyGFC8OcyqzYUOsuQvaJP3wrEK/\nqreSL9yRPdGByAC1hxJmthvB0RFT/nVD5tOaoXO6lRNx2RsTwcOgqVhd+J1M\n0JGkkR3E5Hslixr9jPmex0+VgF7RhAHp6BdX4iCW/Toy0JAyfq3trh/ik81Q\nYAhG7y8yhJwu2SYbYfbSThPborGy27QgAsO27JCcw2alrucWn5KEUgribsvM\nyf5t3USunj8/YLj6FeIsFKGrj3uPavyNVR+OGSB3bYM1eVbVQCqP3tQyXuEs\ngmU2\r\n=qqni\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4cbb1bea763a2b567e017c499e3f657aefe39915","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-01T02:34:38.364Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.8","@balena/jellyfish-environment":"^6.0.6","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.17","@types/uuid":"^8.3.3","lint-staged":"^12.1.4","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.6_1641004642717_0.2799701502597727","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.7-renovate-internal-patch-b240fca1bb99e999a845d9b9f52ef9aa319b2592":{"name":"@balena/jellyfish-metrics","version":"2.0.7-renovate-internal-patch-b240fca1bb99e999a845d9b9f52ef9aa319b2592","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.7-renovate-internal-patch-b240fca1bb99e999a845d9b9f52ef9aa319b2592","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8c97ced7171c989ac16c610d264800eaa7971e12","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.7-renovate-internal-patch-b240fca1bb99e999a845d9b9f52ef9aa319b2592.tgz","fileCount":16,"integrity":"sha512-ya36CdIn7U2qwLQ0dChd4TZp4cx4Qtp3loiNqZcXr4EocWgUstuRLuTbcjMICVxrYnNCLbbdwcoa/ItIkfsSCg==","signatures":[{"sig":"MEUCIQC2PN6F6t4SA22/PYcfdxFEmzMrEwgWWgeaQSUQub/ZYgIgLCTjN5vEn5P6Jm5yTq2Kd++8O3ee7y0HpcmDCMoVd8U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144500,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhz+CrCRA9TVsSAnZWagAAbUYQAI83bWxTd/UzASEWQ/QR\n3uzZnveaCp25sfRPmoY29aouS+PRC40WChPBN0MH6Z6jScyOQ6HK82r8xWvD\nzhcpcxySIsKphGeWj77iT7LrkFWWQbUXbxfnhQb1qP1WMU5UipFRCxblPI6M\nKDF5wNCvrbBRa+mBXmcTQ4cBHdYkbw2Z7ys3B528/Bnr3d/rcQfyqHxqMiHc\niOcfiNNuK6dGyI9YdDdhxfzHbSuDbazWncib3wZR9gtzDQtMoCw4kTQAW3Wy\nuhxlJKpMK/wy/Oqt/aOUernn8zO1sbzV333BJ+5zkbgxF7qML9kUU9LU6ozz\neWJLeGYyhmBc/jrN65hQ8EatJ5QdiCSxgNQ9m3DnJd63unkkq7FXSB+eIISA\nBTj4NN7dwhf8q+mmkNoxogk7ugDDpYdL0HPPVCjz5wnpsK5DdDWDdi+hhDKl\n7SenjRtUM/QYmmoNVK/r3DO5J49ChL30bp8Inz2InHKwT3czDL8S0bS1+QDL\nKmRRuU8nLBvZMF/J+rV6VHP/abCeyUkEJAK+kFTn9DFzwDg1IllxZBUdp/qV\ntfgiuHas+Vt0s+maMejg/0focRY2hkI5tevWOBW7ezzjkP9nlFEW3sjzwe04\n5zt2XmbV7L5UxMVLU3M6MyVFW3iIyKKzGpxP+yC1+FxfRUGcKQjgwxdS6wCL\nx5Yq\r\n=sZTN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b240fca1bb99e999a845d9b9f52ef9aa319b2592","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-01T04:59:32.937Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.9","@balena/jellyfish-environment":"^6.0.6","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.17","@types/uuid":"^8.3.3","lint-staged":"^12.1.4","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.7-renovate-internal-patch-b240fca1bb99e999a845d9b9f52ef9aa319b2592_1641013419793_0.2701703502422539","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.7":{"name":"@balena/jellyfish-metrics","version":"2.0.7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.7","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"086e2f1ea4556d658f00f3584b72818684a00e86","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.7.tgz","fileCount":16,"integrity":"sha512-tzYqk4lg6AybHMgW58iue5SBVwpEWgd2RcHlhTMKJw8c6lvWIU813ONNZrEnkL4nEugA/a8yyxa0xitXREXyXg==","signatures":[{"sig":"MEUCIQDQJ3XeMN5hQevucGuIx0LRknEV6bvLXa1D1z1u0YoIggIgWUCWgClEm1Tkw+2ZPl/9oRhFYzPYAjuhCYtYfv5E1ds=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144435,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhz+K0CRA9TVsSAnZWagAAq3IQAIoqlu2l76QR+GWZWpxK\ncvhtxH8vrHm+ygY/CeWYowVy62TyFoRawPkCoX4gIq4Q0GU3hrzxKEjwQtJG\nn4aOv32CFJXls8wj8IjnihQi4IrqwRfr6LAklCnRODfqldfphYpdYL5rpBEy\nrQd67Jlk9A/nAXsclbiYCvTosZBo0NMlfjcYSdQKxGITXfZWTz9ZpuGx4nh/\nTHEKN8wJ0HwEam2xnht9iCAkpLHgPMZWP7kMex04AqsMx4RovSsg6kCGkCsH\nTb0JzVMbyTlhFI+T823Zm8reAbvOeSskvJ2c0kQeFOJIpsIRRF57AinT+h0u\ngwK1Hb2IQB52fW4wiPv0ZMEYX+GV5UBTPzbqPasqIYq2fG75qaxLbauUyFup\nnUy06crpoANhUFOjkylmCq38sm/qtfdbAlV4MqWnUZnfh0Yt9wNV9pW6P8Qk\nKe/5YQe1faFUVNdYP+6YLoVyM0N/AIHjNhyDK7WjqyN0JQ0fze6cuN0p3z7r\n9ZQVNmqobBG4fMJowCmTolFoCeDDmxUxvAedhzBbxh/ZoQfsQyDQrjk91rkT\nd+DOoAztxs5WGnA86ZIaZKbw08v8l6Jf6tBq70TtG0xXwMeo20Il67+N+Rpn\nJOuiNqaLw3NkLCn4fYbcs1buH500kEawK6fAAaxjcJFrhSzRa537mRufSRsa\nuNs5\r\n=Yg0u\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"519b46e74d5e66817a5ada072f9eb42e1a1884df","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-01T05:07:35.007Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.9","@balena/jellyfish-environment":"^6.0.6","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.17","@types/uuid":"^8.3.3","lint-staged":"^12.1.4","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.7_1641013940657_0.5397251656839177","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.8-renovate-internal-patch-d47f574b55cfeebe145d200a2e6455f23c63c13f":{"name":"@balena/jellyfish-metrics","version":"2.0.8-renovate-internal-patch-d47f574b55cfeebe145d200a2e6455f23c63c13f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.8-renovate-internal-patch-d47f574b55cfeebe145d200a2e6455f23c63c13f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"58d212ae429c037a096f6aee291f97e1433265cb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.8-renovate-internal-patch-d47f574b55cfeebe145d200a2e6455f23c63c13f.tgz","fileCount":16,"integrity":"sha512-SY0Ym6xrcBUMTZEiAaH3+FlvWNX3tw5R57HY0cqLebIjIr6KlttEu0qjXbaiAmji4svS+g9r6Y/JUj5wsrN4ag==","signatures":[{"sig":"MEUCIQDiR+2BHRRXj65HTU45SCaYM+X6d9Ixlc2VYKQN+GqQTAIgf3qkAfJSmHH6CZaSS7NCqnN4/DwKziKCQBIkgKEpLC8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144603,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh0iTBCRA9TVsSAnZWagAAPQUP/1FTs0DE5L17Fgc5rxBQ\nX3k/kWc90ayRRuVQ8Qi0S8ktN5WUC9LYv0IvpKl4eojhr55dz17AGEv6sT7j\nVnrK/qKWRMh01HkiLEDN5kwiYhoxfSJUni+sM/f+0hEMrpBq370AHRwzYkqL\nB8uZrJyfzBAZeqIE8duBzvN0/stzbgIzE8/FjTWWbSVQ8GcHgtrHFlunAj3L\n1rQkkWF+tqajEZSjkkJdSPrt6l6VKBdB36jaYzUJPdKU4tBETT50K/ThqRZy\n5sG7ciXSR6EPq/0rKdTHid+YkFsMo/spafyjvhPZv/3Ec4oPWxg8YfrCx2bR\nazNW0upgNOEy/raDzzJdOOF91tOsp5JeNk9I7Xe5qjcwrN2ZzBi6/wbpgb30\ngJ8VEUN4pVjneKqMgeRYzTdHV4fVMe6pbUAZ0ZiLXsqApKRQC/Mr5+XS+WmJ\ntWV6zCS54yYgMpI98GDQjCnzPoJoRelTAsYr8QujJbrTOGS8fbyiN8jsIpoy\n+prbaEWjCnUySrrJ9w1ItITxJbUJm1if3Sl1l+tzxROfB/XV2EVUsDvot5DN\nz3wO3l7l40PnqC7hQbu1W7X02va5a7VNgvW9+IalCjnPLv8q7sazNyioCxpy\nNp8oxtd54LdIdweB8A2kAN1cS5XdOQSf4k8h9QdUU7WItbU3LrEi9Blq6yyo\nuNJ/\r\n=qhRh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d47f574b55cfeebe145d200a2e6455f23c63c13f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-02T22:14:52.802Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.10","@balena/jellyfish-environment":"^6.0.6","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.17","@types/uuid":"^8.3.3","lint-staged":"^12.1.4","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.8-renovate-internal-patch-d47f574b55cfeebe145d200a2e6455f23c63c13f_1641161921040_0.5064724589597682","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.8":{"name":"@balena/jellyfish-metrics","version":"2.0.8","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.8","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fb261c7cf1ef594615ce599c03eee34478678dac","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.8.tgz","fileCount":16,"integrity":"sha512-WX6K5zMkDBkmCfF9TEdjSRJIPvizDkl1/a/mSnhf3uT+Rnv57m9d+k8ymvFT/HfyPXy5I03PMTNrMuvL7J8zCQ==","signatures":[{"sig":"MEUCIFn8psQ0TJJcqQRTDnAGIa+oEi9QT2f1L+atA54hIU64AiEA1oI90g+MR0N/R14rUyeSagSHGOIFo8q0bQfXEubF9cM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144538,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh0iWgCRA9TVsSAnZWagAASG8P/377h7rHbvS2XqgSWflj\n8VY1Vr/PqF7NdhzdYEN5lzM390EiLk7g29EYW/4sIbr54taV/mUtQJX56I2b\nZrq7CsxbtXGtkkBK5MgwPUPzWJt2yITaHzfeav7t1UbEsmhxL7/rhm1yOmJZ\nI2Epb9Az3FcHYfBcoGN47YOx5bxW0G27gZEer1uMrUIZVzSi0uSyJEuJ0k6A\nmS4XiLPKWTV5teT12XmGuXOms4Cg5WGRksaVJgMRrLWcCSW1zfesBMtH8o9j\nZYzHxrcHc4jya/mrPPPGpt/xBX5eEA0VUP6dITweZAYKdaalc8asGWNuceGQ\nXHo1NefbuIHmoqUWB/b74I95q4UGGFlTNK1LXXqhHn/V8TUvC13EQ7WQg3yG\ngDMNzxsRwKCyLn/V0/7l0sW0lyp5Bn9mSZ+4SWdx+H0RQpeK0GemSzlK1+d5\nOhFj77TIF2Xh2PKdtuUb0rOFd+MEOkWZg+TJPN64MJlWxx19WIz9xfH4wJsI\naHtyBaT8ShEnSR2cGrOc1j2S8ahEkLx8ei1H1ZWAKAsAMReh8fx4QU2kR0MF\nPAYl7vB5CxJMhm0PQfiNDtGLxBW6oNJCjdT6PCX6Gd71AKOvBW9g86iu41TU\n0wJE495u9Nc3aqPNrg+jPq++4soYU3Y/cqZC50Gb3J7y35RJCfbJNn1FIrZP\nFHwA\r\n=Dd0i\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8b5564fddf408bb0e02a041916de466e8d632408","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-02T22:19:40.253Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.10","@balena/jellyfish-environment":"^6.0.6","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.17","@types/uuid":"^8.3.3","lint-staged":"^12.1.4","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.8_1641162144644_0.0755596874151836","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.9-renovate-external-non-major-1514841da0cb4de11392accd7e7e50f218a2239f":{"name":"@balena/jellyfish-metrics","version":"2.0.9-renovate-external-non-major-1514841da0cb4de11392accd7e7e50f218a2239f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.9-renovate-external-non-major-1514841da0cb4de11392accd7e7e50f218a2239f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8882c59ea72d3ba5c481f32e76baade281f1423d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.9-renovate-external-non-major-1514841da0cb4de11392accd7e7e50f218a2239f.tgz","fileCount":16,"integrity":"sha512-doyVIH1UFRG5U3yHipKZeSWV+p2xlb+GK5lH8BNi/47dON4W8G27LvqDHokkLJpHWc0gdRk5+xCQu/dGFU9pAw==","signatures":[{"sig":"MEQCIA6G+E+KfXPTwlQknS4Yix1IkHizJLSXDnEqlsnNJuWxAiAO8LnIsmnOUZoK2mqpkMJgWcP7KxVYTe7835g7dL/Sug==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144696,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh0ib2CRA9TVsSAnZWagAAfzwP/iqe5b9GpPoeBH9YTn9G\nW2u6ZWT/NmCEQvgwqlcVT6RzoWp21Bc+xV2JTW2/Knqff15/Car/3PUWt/Cd\nPCD78CVXLzdNh2EUjphcqOZ/MNrhUgDwvG9cxGYHoL66YGtSDavOnPxZPAKg\nkB59WhlvkRpHeTY6Oe7wLzMD8zvnlUsawrDFhxQOWZyhbRxP3I8Dgy6AGJ2k\nD8pdUoBdXzoSb/gIn1Lgs+zn3bqaHs9eMeMVUaDeC6c9ofPv3Tcd1SvIstf4\n5qMlCZXrN8VVB21wTZ6fiN+8SGy12NP7hfZNwLdI3yPsg4QiwiwQ6NgXKfcv\nKvbkdia6xDmK1Rs0Yx/HxdtyMI79xjHi4m8IA69XaBRXISGMWWR8MsDGmw/c\n0S03SMLqWSDiyMoxF6j3ZMWLrOasqYcxU+Y5IA4b+3mufrd5jTS+7dVYhrNo\nMO5xDa9bwILDJZSEWb1nXPFxvb42e5mtftSY5EMe1+2YusBZ5xwVW3jcTERe\n6zOVYBYYJcuFiEGs1KMk6dNWtmI3xcgV48OArlacqBgW4+Pg6ssdkJCyFbSM\na9Z/5xHBBTWnwX6h+3lcFuLgBSd/9cgBhRytX9sB9czXUVPeEjJePaoYkUMm\nyZUIzQw2BCF2JbgB09dW203xCnA2rN759ATVu56Nly5x3pL+uVtHUwX4hV4F\nBtqz\r\n=ceuE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"1514841da0cb4de11392accd7e7e50f218a2239f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-02T22:24:58.601Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.10","@balena/jellyfish-environment":"^6.0.6","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.17","@types/uuid":"^8.3.3","lint-staged":"^12.1.5","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.9-renovate-external-non-major-1514841da0cb4de11392accd7e7e50f218a2239f_1641162485994_0.4649737689615967","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.9":{"name":"@balena/jellyfish-metrics","version":"2.0.9","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.9","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"172fc2ce93f916333f7e01af21af452220ea4b95","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.9.tgz","fileCount":16,"integrity":"sha512-MYEiTn5Ycl02ZCZQJe6mMmKKcaCW7mN5pLywnvCp17xevUoUG0dwPdFVsk99qidhGzqhM1EkIwTVoeB3ccBclA==","signatures":[{"sig":"MEQCIGq1ynZj4hrEbVP0MZDSzMmsU9XWEVXX/8yHTNoBDeZ3AiBm8kgm1wqYrNX3dPLTczNi82pXUJL7kZTQPrUkWHBRGQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144627,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh0ifsCRA9TVsSAnZWagAAAlQP+QET8/9yoxpz5E3obayJ\n7PKePZpUb99OdebrykgeMLUaa05I+mege25ZVlyI8olxBoR5KJrbuQeYWCUG\nlkC+5m9IFR3EfPBNHPvK+eSfyaHezx/vvu6oYpNMVUAwgNRBAIjBriaRj2kQ\nAc8R50PEvaziiSAoUl3TDdVWkSVVMmMSE2ISU/W6cTTK47ei9AA2t3izzdg3\nmI9xwx4FO4h0qglEeI9a+x56BTeUtchx6L+FhdktXY2sSKavhy3YLmz7uF7a\ngQTHj3Y2alrnZrvTsejHHAorVFNS6nncyswUEY3TSMTfDkAVtT+NODLKbHW3\ni/PXX3gDE6r497HHkZF2figUCoIOFPXr1B6pSILFfo81Uk4UY/2iq3m8yNps\nEz1DOJfRFnB2RWvX3t+60HgaoM5GCF4XZe5ngIJJXfNzL0VlNCv78YFPlr/k\nDIkZX4h4HD+NCINhS3jy7V+uaWMTIRLVwlEhBr0gG7CMGKa/1QY+nJhs6HsA\nDX/mxnX5RuDs+K7Igqk34R4yjorSPR6sVhLpSrugJVl3AseP3mSFGgzTTbG3\nBIXRo9T373WVxa9n0QW0TudS6hR5cqDg5nobls9ec4qdXU2qojeCZoeDiFTs\nDgH62L4ki12eN9yjrFudNlPomjQqgfIrsCTGeXosTXCdEL6AGt8GCvWBuTnn\nz/6i\r\n=gCfO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"29f9b0cb57eabdccc136cc6f61db162e9fec1746","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-02T22:29:51.178Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.10","@balena/jellyfish-environment":"^6.0.6","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.17","@types/uuid":"^8.3.3","lint-staged":"^12.1.5","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.9_1641162732048_0.819616612209882","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.10-renovate-internal-patch-2f80e57e2beec442549bd50522dca3c60544bff0":{"name":"@balena/jellyfish-metrics","version":"2.0.10-renovate-internal-patch-2f80e57e2beec442549bd50522dca3c60544bff0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.10-renovate-internal-patch-2f80e57e2beec442549bd50522dca3c60544bff0","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b7401bdb111f3b53404fddc5ce8508060eb04ff4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.10-renovate-internal-patch-2f80e57e2beec442549bd50522dca3c60544bff0.tgz","fileCount":16,"integrity":"sha512-XYav89MkkXjQ/9Y9UcRh2EyyeMO1adB/9DcfuRY3M9tePk3QFruy5reLpsNWdqPIMIAlY0/tkleb0CrCgGYhMg==","signatures":[{"sig":"MEYCIQDKXkfSqEcxQrOaa9HchLqduF5mr9KiLw5tyll6ZkFqzAIhANT0rJHyFXInqa7B0rZ8MnMKyclCnhY5bACuuMNlLxW6","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144796,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh0kYvCRA9TVsSAnZWagAA3d8P/Ruyt6he/Lj0z2q52lur\nhblcYa0AeS0e52TVhgHIvmRdn5H0/j2495TN4y8h47XDMlL0CJ3RErO6Dda5\nPrjrg44CR8VDOaJTtUzzujPueFwSlv/oPgIrpFlj8D665W5xqc+ze9Dg2Iwr\nqAChix4/mj41uhe4R0kpCTXXhYWGH7Z2Z74CZnxTGY3/Ea31BEvxskwmapCV\nQLYqps3CiIgxM7i+2mW8+Mi/CZLUiKnXy35hKVpLj9b94WmHCVCHiKRtlsTQ\n0QY5n50UJvW50cceDAuwWX6tfzD4n5reIAzr1lqwZrRfOfd6+4kPlcI4kl6u\n622exTVEyxbPppWEEBtLcte+LWQ0V7+ojsDrSUEBBGrVpkM6PZPawBOfza57\nRsCxQYHT4NLYu8Ju4vlb5NYAB+TS7pj+v3TdvzedpKfEtwdZ2YAATtYtcG9z\na9jjIisgtvhIAz9r2pUvFzyNGt3XgN3I5BIo3R9T+TolqxUDfPrF9ZEKEeqe\nprxNU9XLwKog1/R0LXDsbxk2PBoXTq+oYqOsQtJy7t3zuQyYKdi1ult4R/0I\nE0d/imzvbue/3LacF4deOnq4WCC6TA2VgO3IMFNj3tC//AhHhXpYWVKZK1rk\nSkoxyM59fqiJYeZKWZn8cZBlw8rDBADAH0eSPhW/WNDmUPe2DacPaZlahHm2\nXUUL\r\n=KgyX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2f80e57e2beec442549bd50522dca3c60544bff0","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-03T00:37:22.821Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.11","@balena/jellyfish-environment":"^6.0.6","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.17","@types/uuid":"^8.3.3","lint-staged":"^12.1.5","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.10-renovate-internal-patch-2f80e57e2beec442549bd50522dca3c60544bff0_1641170479160_0.28727107132094387","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.10":{"name":"@balena/jellyfish-metrics","version":"2.0.10","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.10","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8a86d110f07146a718542ab69656445c86e326c2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.10.tgz","fileCount":16,"integrity":"sha512-p2gd7YUKial/m+HgZ29hd9ZXYYFSCZPdNC5xmrACgrGo8oUMk9/vW+gbmk6w2bcTG2Nb1lwCqa3WuDmk2c342g==","signatures":[{"sig":"MEYCIQDhAK0+57jpJsUfgFK+TEkrgNb0FwnBJ+qp4U0Noj8ZkAIhAOVyVEVOhqQjP9/q6i0wNNe/PTO5F9zwGYFIspx3moyT","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144731,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh0kbyCRA9TVsSAnZWagAAS4wP/2YttO4x4ElXoukDbqvl\nBww0OD1HXkCrHOahk0SBtf6ylgSy25adr71RmizRNO4lhF2IAWGmljSsdNew\ntq+QTCoPRXDOpEN/xZtJM0KayWnR3hOfkJpOrXOUs1cw3w/EPkno027DSBrN\nL5BoiT9kazCQVXzxSPvUt9MXbG88e3FME7oI6gxiPswlEanzsWw1qiFJlhQ6\nejyIdpDnwX+PFo1fLLOzHmz7Rm59erJMVy35IqpL/zJhgs2k3iopaaGtDVgd\n/4Pl/LBHQrgb64BqMLSy5YfjDBEZodWls/2gVgVEqKLFQbR4e5dfp0dqgIHA\nI0gXId4ToHncl1zVClW/bzJY6V6xnobYEy4Jtw48zw9nyNaMqMJNwbCIY5dU\nlXCAsNvAFbZhqE8tVanc4C6th4GZm+osxdixhti4sd9mSxvxSskJRx+m8HnM\nrADqysGx4XTdUg++78O3y0IzVDpNaZIWTBQXf3Y8+tC/7fqkqa/IVcfzsmYK\nGr9rQbezk2qeoBZXtd1bAgTfWndn0065XEMdNiry2LYqLzfjqwkjgzn2AQa+\nGwCPVQA7sGHgp7Hx4ZUb0bYG12wSYY+OwlpaSB28MkHm2LwDCP0jgsKLHbkv\nt8NKDPXmlMelwa1cu+sDyEBoZ8mHLFLf17qiaGRPHTE2C4PqK0AYBlsqFZxO\nxf3Y\r\n=ye+4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a45b09edf43c4d1a27174b179a4da11b31d59f31","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-03T00:42:39.287Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.11","@balena/jellyfish-environment":"^6.0.6","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.17","@types/uuid":"^8.3.3","lint-staged":"^12.1.5","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.10_1641170674150_0.3945981326422967","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.11-joshbwlng-update-contract-type-14bc0363e150513c342c5465b435b5c5cbedcccc":{"name":"@balena/jellyfish-metrics","version":"2.0.11-joshbwlng-update-contract-type-14bc0363e150513c342c5465b435b5c5cbedcccc","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.11-joshbwlng-update-contract-type-14bc0363e150513c342c5465b435b5c5cbedcccc","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4a6a89c7cb05f926bf64e45a593a35a2c8effc2a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.11-joshbwlng-update-contract-type-14bc0363e150513c342c5465b435b5c5cbedcccc.tgz","fileCount":16,"integrity":"sha512-7Ha5qNppCBEJeIHjLGmrthmlAIikzYHFkiuyc4n+5EnR5hgJK1j+i9okHOkr+D/1RvM3GljAOJun92e4s/hL+g==","signatures":[{"sig":"MEQCIEeuygql+CfA/hOSJS2Y0RP9tJ2mSz87Ut+U/+r7/YjUAiAvxEL8huLu9TowwiKkQX/C6hlVPvXRqRl4yVtliTegKw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":145010,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh0p87CRA9TVsSAnZWagAAti4QAIAgch+LUPp8UHtfthhw\nDcOr0czWfKxNwXcmebV7RQjdMFtOHuYK7VCOWclU5NDHCPzM17GJwjNl79cj\nrAkae1UlmbW27jgszdw7GZH+RLFEpsIklcoRWlwek0WyVn1QaDu9fgEnJmRq\nzNWOtXd1EIRecms+uSow4CYgM2Z8ABp314TXLwlCcEVZOz8/UgsES/o0zA5C\nbx0o4Ss1dBlVQpGFFApCe3Efn/Yu0B7brIPg4iuNIBNCaxn0Xcw3ERrpAIOt\n3o0OM60rYjn8Txnvj3Yx8aW/pfsAXv+hrS9KC8pM3veUdEia3GNv/00x8x2I\nf4zPgxzDDDVe9/uXI8DkoQ/cKOTlnkgeJHI3H7J0EJgjecYLzwE/79+q3iRK\nMy+eRAJp4LSJJw454LgvaYdqsl+d3dy0jE3Cu6QKxQJjrkx9qPI6v4e2UUX2\nb4oAqsXh7Nn1ClhZIk7eEgtzD86GpVv3v1bXw4/pM8YVRBxCzL4cRo0ckPkm\nbMf4yBkwgWlmc+7eEi5D9EP3usXTsrTjJo8dRalqQKXMFHYIXomc5/43LdOV\nN7/SEeDget4Fu9VvilsDQgEX0BFpqr3HsBC620NKf44SpdXUXi1FShaUZr5H\nriAh4opXqGT6InaGoit2WFll1tUkk/u0vEvfQdz5x9nH4izThI0SjHZH0Cx7\nSwps\r\n=Hp6Q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"14bc0363e150513c342c5465b435b5c5cbedcccc","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-03T06:58:32.160Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.11","@balena/jellyfish-environment":"^6.0.6","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.17","@types/uuid":"^8.3.3","lint-staged":"^12.1.5","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.11-joshbwlng-update-contract-type-14bc0363e150513c342c5465b435b5c5cbedcccc_1641193275322_0.4813098509301812","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.11":{"name":"@balena/jellyfish-metrics","version":"2.0.11","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.11","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6de0a3d36f0fb8be1018d15d3c7e51c16cce125b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.11.tgz","fileCount":16,"integrity":"sha512-FYnzxAZ50g2iUqB18nhowkQiR0ef47zRkTBlRpr1EUF8vz7uDTJx/es/Jh/9EMToQTVU2bqeptitxdYN2TF5yA==","signatures":[{"sig":"MEUCIQD6Jqa0hIDh88khqf0OifJxmMbb3Jev8FpGUAe6O9eQ1AIgbYbh2VnH5DQoD9YOVq68yXxJDKQ8DnFYG+Mp2U0kNho=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144938,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh0qAVCRA9TVsSAnZWagAAaAQQAIr7H9L9KTxtHpcYRM7m\nctLD27/1QyCPTKCwywAtdwMo0V166bgtoT1Jiv2Age2aePi+qO5wZEWz82xm\ncBDTwJ+1NmftTHTwerrBQVSJJ7sLVJXPiFGaqpFlLx8mwPw6xaH0LC19qor4\niVFNfqOhzCllmpesqwcQW8sqCO0vDpnJe0O+SdkoK/4DRwNXqGmZHauMdYiM\nQxCRmlKy0LydAjopU6iZ1GJ6tdBeL4y6GlCBKeTrSRimJgzvryDeorzVxg3O\ngyRRl3+RnUWlzAqdZsmT4LxOOYaeZy77n1JOrLDRRRRBXv7P/49qHwZG1fYx\nEM6xyZXG7HTgmxXVzPJVQqVIMZLJ+e52oDQXeJkakPSCjaplyk64uYsmJsPs\nBuwZOp1YmjTv1UCcN7mtIaheHkoF9WS3w7TOR6Q3/56Hn792BckJeRgTHs3O\nNW4UkTItdgXxUTmhA3ei/CPMz/uNaK9KKFhXpBqRdt1/n8wxBoARbtaKrm2W\nNnp3Kt37i0a5kJTrQC18SvsOht6fEsL8Rv7aU26QrePNmS30XCJHapFIaM1P\nxrn+l6p+qXBoCKeatj2mAEmOJWakVnPFIpTSPXgqinIuaBSgb0gYNmHWmxv5\n+aR75zDcJltan9wjOYSFhLzOL3JbsJu4p41qR2Jnw/3xBj/zkEks2k7p2S7f\nRhGe\r\n=/HS7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"37837f495f6ecea02a55406f424827f4964e10a3","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-03T07:02:51.897Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.11","@balena/jellyfish-environment":"^6.0.6","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.17","@types/uuid":"^8.3.3","lint-staged":"^12.1.5","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.11_1641193493227_0.995610118751217","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.12-joshbwlng-allow-null-2e8dfe0b0e3082995952e4bcf26acfe12c323e00":{"name":"@balena/jellyfish-metrics","version":"2.0.12-joshbwlng-allow-null-2e8dfe0b0e3082995952e4bcf26acfe12c323e00","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.12-joshbwlng-allow-null-2e8dfe0b0e3082995952e4bcf26acfe12c323e00","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3fb4d27af5d85405f898912413803a45e6363a04","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.12-joshbwlng-allow-null-2e8dfe0b0e3082995952e4bcf26acfe12c323e00.tgz","fileCount":16,"integrity":"sha512-TR73zEfINQ3TD0/nPZEswXXe4mNoTVM6d6EMc9a5rTb6fxIKAV4uYoEojSJMngdz2UFpzNKwHZ55Lti8dPDl/Q==","signatures":[{"sig":"MEUCIHEU2IL5nVkbfvtXRx6sEAnT4E9ySiUzrIcq6en8f3dxAiEAt43QLtfjy9TMdzURyHeVcNQP5bio4ESMGh2FZPlMdA8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":145086,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh0qdCCRA9TVsSAnZWagAAwOUQAJeJZMJCD/9lFcHJpbLg\nqnREQu/okhP8aA8QzjMkzJR40wioLyFYOrChA6O2xOQyaH1TMs6GScUu6+W0\nFaPWcoLFtu829IgvTZKs/KbIkxY9mmA7lQqHnK8W87dDehP3KdsaTDTL72em\nEVAFDxylRhnqeKnMoyB8FJiiv6HCH1cOtpZrTkHmXwsBo0AH/uVxKJnAaWZl\nrx/nBSK8k5MFj8Tun4XOs28eC+/9cvV59a7Ie0OguMfc6tyiSY5SKkqpscys\n69ou/g2WlnX1fN8l5naf03Vo3O4NdtFAKkFaAPaM50g3owGKCndcD4BmqEe7\ntGV+4wKJLzu/EA29WACrDjUC3fJJcQtCzhg2BaO2o7Au5KwPF3DSZX6hBuvm\noqh2N2IC5DKMsZHLZyamPB7dKmOetyMBf+HSFlYO9zUwPgYKQtWxatu412Dh\nbfVgcCwTzIGVD9qJZHdAi4wy9bRvU5Kis/HRKOkrQidko77u6qMVQVZl+5ed\nyz9UqHJAVustiCxtq5zGdRqnRT2cY8simXZY1KKP7kPjs4znmSLlfdifxgoE\nnP3Zb6HvjZWfsLXp797jEKnzKvzYMfEQtNFXeZCwBI78/QT/ZpVdX4R9Wv0w\nlxNEO7kI+4hGFSuF0ZjLM2Oatc6B0VdppBZBqUa0o0xAep3T7t0Ou2+NSpM/\nGPAl\r\n=2bHD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2e8dfe0b0e3082995952e4bcf26acfe12c323e00","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-03T07:32:59.720Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.11","@balena/jellyfish-environment":"^6.0.6","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.17","@types/uuid":"^8.3.3","lint-staged":"^12.1.5","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.12-joshbwlng-allow-null-2e8dfe0b0e3082995952e4bcf26acfe12c323e00_1641195330553_0.15872897360651006","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.12":{"name":"@balena/jellyfish-metrics","version":"2.0.12","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.12","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5ff7e4512aa880f3037814cd48c009d887b79ad7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.12.tgz","fileCount":16,"integrity":"sha512-7kbry6lH4HABpaabcp1QIDyKXOja9+ma7wjqXoMaJp0HeyNcSA92EuGjfTKNjgtx9IdvLHNPY6nkmg1+Ugow2Q==","signatures":[{"sig":"MEUCIA9xQrf2f8dxyfULPZIdLf7F9LADhmUQyu1njIYZ/yhfAiEAz7HnQcre2iB9QMnc7LjaL6dFR3Tg9aXjhYHmkcpNCWM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":145024,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh0qluCRA9TVsSAnZWagAAkNIP/iynxVtyVrS7tWstN1ow\njOXw6nwPdwPUa7TYTbsVDsX3O2zNRiVl6f4S/QnwT0bDy4cbE8vxbH+osAgY\nBPmBxVqS8Qq9GgtLhvT19mm0lFcFMaQ+Ph33P6JiOocjjNkreY3ajBiAURI6\nPF01hRYNxFMMaS3mgvB7tdTQGIunWb5HfwSpFuzaBNC20kYs675/WlAvsv6y\nsibZUfU+Tz8mHsnQP3Q9vSVUgiIAQzwQmNT6nlkuOyIYYSmZlaUpdM2re6VJ\ngEuAkxL9SYYeTMEqL1/+u0zNiKZOyDvzII8pbYam32qnL18BWFoi9VmiNjpJ\nwC4DQI9XDP0l9/UCr9bWET7rp+hVOGE9/AHd82BQMjwWDL15pQfNL6hq4iQP\nPlsPtNjry0N2TlEX3VcggDa6tbjArAlwZL46hJjDsf85WxWem+cfvWeSb/yG\nB/867WsnhoEz0EH+A+NWt+WF6xEesrPjRs+kpsdAdrwvy1lCQjLjh1m84kXn\nL4QARCI5fCXSEx8SlX9caIVklp9loLMRdrCcYNs0fF/ZGMk9ns8H7j3hAJr/\nH9aVyxA1i+WXZVvShTbE5fmMgAjbKPft7HM9eftHy3jHXL9n6ru6IzQNktaq\nnrP1Zmao+RGfzNxf78uPT2672rkD6dTS0wGAy+vMSMT1Ski9Bn3w1iT9HSqI\nyE/l\r\n=x2lE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"1c26e5a0526e1ba1fb36217b070e96310ee874ee","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-03T07:42:45.791Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.11","@balena/jellyfish-environment":"^6.0.6","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.17","@types/uuid":"^8.3.3","lint-staged":"^12.1.5","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.12_1641195886318_0.887377374593991","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.13-renovate-internal-patch-c8fa2be7d4cae7f705730adb28e9fa29c27a25e5":{"name":"@balena/jellyfish-metrics","version":"2.0.13-renovate-internal-patch-c8fa2be7d4cae7f705730adb28e9fa29c27a25e5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.13-renovate-internal-patch-c8fa2be7d4cae7f705730adb28e9fa29c27a25e5","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b2737fb6ba466faf05fc1144901e988507df5337","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.13-renovate-internal-patch-c8fa2be7d4cae7f705730adb28e9fa29c27a25e5.tgz","fileCount":16,"integrity":"sha512-HbPvLpRoG0UZNh+PySM2K3DnaKEopiy58lwFdNtMgl8Y30vtGRJIj2c+OO4dvvvyB8Ig+3XB0QtG69Zjf75E7Q==","signatures":[{"sig":"MEUCIQCdUeb9idsjEZARhMTMMK2/f8T/AmyTpRYt8jVW7HzDNwIgZmWbUmdBVMWkO8o5C6dTDAYTSYKKK8tvfMalZJfmN8s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":145196,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh0uWfCRA9TVsSAnZWagAAwMEP/RyuyP1oZY50u0u7k7Fn\nFiCi5zTIPzLtowKv3QokCzB7G9rqdq/lFubWlHSFxXCo8d78PcLutKmVPKpP\n/cUv1ifs90tzSIVhwmN34If5pHir6LfQfxGL6M2/06nnD5rQKf5q3Sli4Kez\nYfzjCHV6Kpi++LG/3B3D1qLvEONCE7F/UTsq3r1X2hUdue7RzNNUtKOj6S2i\nnpcl3U9ubLP92me/cCABEYDTAvSDTqGcRfjPaZtzWQiGTQbBrlc8amEaPx97\nuc3NkaMn+wyvde3bP9Y33hpD4TqUAuJR3SnNZbiOdY9IxClZYLPXKDOSDqSt\n8jvvZcXzppM9F8/aOU1V8PmJRyiVaTgrA2jutjuF0YUd7ZREPT43f/QFclWL\nWGyy+dRNC8kjiU++EIWvRPoWNqTtP52t8d3OdmuuwwPh2y4+6C7tgsNYsUEJ\n+WZAXtKvhxyTlQkT8QXLfnYOeVNE98RxLXAl61YQxmYrWaJdRubuvELgvMSK\nA2a/It3UUNqrAS7G1UomLkZOjyWa2oWLoPQ+zGLnZk+/pg8g4UDTa31iH+l1\nPnQnpvYaj+dr0maKT+QfcdHVluOEvWjWdfp4HVdELEVjvaZXHzWRnbizAP1+\nJgGfcyp8nYGtuzElPZj7WC+tp+gp1sDnT+U/GVmlNPX/WfYUwy2nUH8i7LIc\nxYLM\r\n=Ve1r\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c8fa2be7d4cae7f705730adb28e9fa29c27a25e5","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-03T11:58:17.922Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.11","@balena/jellyfish-environment":"^6.0.7","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.17","@types/uuid":"^8.3.3","lint-staged":"^12.1.5","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.13-renovate-internal-patch-c8fa2be7d4cae7f705730adb28e9fa29c27a25e5_1641211295239_0.5684651356844428","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.13":{"name":"@balena/jellyfish-metrics","version":"2.0.13","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.13","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b34500be08a9abe96114ceb3178c79be5d18cff6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.13.tgz","fileCount":16,"integrity":"sha512-MFws7J41LCc6DVQMgPUtHS5+z772ELWTA04PTXn4isEty1U2KItykD/XH1YNG8l+BjTbwzcWt1m2o+eKgIsyoA==","signatures":[{"sig":"MEUCIQDzQjBSzSB1bvfcwdDcRSl13tulWdVv0VHZZhML4s0ccAIgT8OLWC4b/WRdp+nrj1AZIKXxBSvRRIFwwDFXJM+cjic=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":145131,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh0uZkCRA9TVsSAnZWagAA2y8P/Rf+lrEtbg2g7birn0As\nnieKr6KBF1kMzbiPDCuujSebskHAv0Y3GaNKD0RbFwLismMcbcoBbBmOOGNJ\n/7rZJuKmy5r5UD3pTVPmbWmtLno/DIvI2vMPpZELLMpvzx+FAQStqbADugNk\nqV+BuFkwmE+2tAbCD2Npjb3BVEci/ZUAMfsNGK/UdLL99vCsnNNKPnay2b4+\n6Nzye5RU93HotX9jS2oeFKAldkoY/hZT3NKX8deSbG+W2d2U0PDg9Evj0ukt\n0tA86YZ7ksjvh9psK4JM9Ny0otW38ykzTyTMwtvunuJcjilWTFjWMEYPEenq\nCugjU7KYRo8SnW4hOW6sk5k0htZzAthBMIJ0zfNE3ZQC/KFhduNGeGUEYEbC\ntcYyPElFEhPSo8jhlq5WWjqQjpMGVlLucLTQKCQj8lQ1PG54QxIiOQWn3U7O\nXpZGH+ojQye8JdPB4+6DbbCQD4mM6fNxE9aZLCc6+t0LpwPv7+VAovlDFYY3\nZzEzijnnoMcQIyCEZtoa5YD7wQT/NZHztPj12s4X9bCZT/FMj6KufZYKMRaB\nij7Eqwk3Sjt3h32ndtHquylAwZmDFXgqPoqKtvaARVMQ9UMx0fDBBlVJ320v\nBs+y1Ql0HKWebFzHeYGM+mWr9Yd3CfgWT5qz79f3ahvI6YkfcXKCj2wWYHd4\nigsn\r\n=bhzT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"df0e95da1b8785cc42fc1b9220032e40c1aca371","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-03T12:02:42.681Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.11","@balena/jellyfish-environment":"^6.0.7","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.17","@types/uuid":"^8.3.3","lint-staged":"^12.1.5","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.13_1641211492512_0.15047664668797633","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.14-renovate-internal-patch-3f2929ac0140712465a603f438d6e79a7b062dc9":{"name":"@balena/jellyfish-metrics","version":"2.0.14-renovate-internal-patch-3f2929ac0140712465a603f438d6e79a7b062dc9","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.14-renovate-internal-patch-3f2929ac0140712465a603f438d6e79a7b062dc9","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"433cd88723da5ec2c5129f2e356d46247a42f7ce","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.14-renovate-internal-patch-3f2929ac0140712465a603f438d6e79a7b062dc9.tgz","fileCount":16,"integrity":"sha512-BmVsgsQNYgOqgGgmvNtS7UtCrtI/TrbWkk6Z1EgZM028BefSoLDJSF/gAM6xOw59GJH2VP8HHK6ZXIiLhzMgtA==","signatures":[{"sig":"MEYCIQCBX6s5tNGoqslRUUbhhBFcdLLjKaKiJo7OF6mhx4SH7QIhAME7fdT7hHmYTZGRN/xYjl2KX22bNw07LK8gYaSnxEyj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":145299,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh0wT9CRA9TVsSAnZWagAA3X8P/ikiN+WVyn1afgyyEbKO\nYq4p3m49Qj6illu9UIfdeV76YSE+4HoAbe9fHoZjBU2x6O9S2rp6sBUktQ5w\ntqa7W+lSuwJca2MQF1qhrUUP4eN7E7RDFVLZ1rTUhhzG6+4nzvX5PE8iDEfc\n0NU8K5LsGrP3fsYKgm22qS21XUUXZF1HdJGACVw8EPLD5EJvRlw1G9sONTvc\nljaTuP7quX+XNCvsHnw52QUkAdb+u5LLdpaOAIs3mb26I9c+bzEcbxuKLjaq\niR4Fjf+ffsxuFSY+04n7IduhwKLv1PYX5RGjeeVUNX1WpX0Nxu2N0WO44guD\ndlr6k54zrp9jgUhiGq/NuGKf5ms3TY7ZVS9Ogmp7xeWbd5ReTlRleSDt+rn/\nK93mIWTsprqpCMg8mQwot7IMDl7OgyeK9r4PEVfX8dsaPHpH+nGrCnhjdHxr\nxggA949E+5v5INN2E89UfcPYuseG2fM2KlnGAMCv2dGfnP/CtdGxn/Bf9FT5\n/H53cMuk+40aKu1pjXwzZwMYSS38z38F9PPKAn7drt8L/+LGy0CNwoluJlrr\nnqo3eEzjnRATFiN9RC3I9w9AaAARhC/PnaqTWuOqRjl2ciUB9aOj75a7VLeO\ntzkn+B6LjeDLGys2JLZuY9ax/wanXlprXUbC1E34NJpuHfJ3UI5Wycrl3QSp\nX7JZ\r\n=AUyj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3f2929ac0140712465a603f438d6e79a7b062dc9","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-03T14:10:02.177Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.12","@balena/jellyfish-environment":"^6.0.7","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.17","@types/uuid":"^8.3.3","lint-staged":"^12.1.5","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.14-renovate-internal-patch-3f2929ac0140712465a603f438d6e79a7b062dc9_1641219325093_0.10420822691481724","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.14":{"name":"@balena/jellyfish-metrics","version":"2.0.14","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.14","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ad16ad9bf29a226f4c8ce906b7ada12819fb1a3f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.14.tgz","fileCount":16,"integrity":"sha512-XtbIH/0daKvhp1Yc/zAfN76nT89gltLfjZrfJE97UuXiwjX+1W1dRXiZ5M2W1e/6U65ahppK+EdNJJenvrKoRA==","signatures":[{"sig":"MEQCIA9FkkrEZa92Vrv21ssgCzcjnjYepUJc6EVvIwIrE3FYAiBgyxZ/xADIiXbFYiNk9g4tlcbno7XcRDe4R29A+djarQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":145234,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh0wZpCRA9TVsSAnZWagAAMKMP/0RYbzwio0rh82DgJ3sj\nhKjWn5I2yN2Wlz3gIBl7TZmQxX4wjoaibCNCw+vMLkoCn0Nl4Z3f2kzfA0F+\nSUSNR7jlMkYJhZA5k5pulLMuqwT5QrUREZAfiU0XZXCBGxPxjo7abcqGVv5z\npndWrKqL7+AfYx9jYoSj0NJMpfXNB1mQe7RFwOGci8+j/h9Klm5Xx0su030A\n/NbRCfTbEi4hXN8ydsh2nit3lyUoD3ZHIwDRIGzhqwOM7663Sx9hDGnWhPrP\nmYqKyEMg6DyLW1gpurii4MONepRvBZFpzF6WgXcYQVF1lDKOJ8knhpKMoGgm\nk0X3AmjDKTmExCmJ1xJcnAmxFOms/5ZYi6kitxaSGgYfKkozaHb9h6irP+gX\nSg+q6VLlmYkHPqrZt/lO5cYHGbUQmX7MhH5lHKLujyMYHO48bLuHLdATRzjd\nxSRMcIlNXX5V69JTVrs/dnS2WDZ5ZoDD1wrBcGxXDXqCJsxeC3afJomDERTQ\nQfk4ZB3Q6b5GvmdvE9Avq4Z6re/n2IIRReO/EQ1UCAyArozrR8BY4EPn09EM\nt7qvCvbgYIFC3f3VS1n0OsbtbMRhlJsdCFoflOAQocxye4Osx6o4mh+gMHv6\nl+SzRT6ky7nv9h8hor1JWi8Q6sTyOVlHd8pox6c/cjvLJe5VKi1OVkC2uDz5\nxZur\r\n=an9t\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"194a7e2d17804b11cd6fd5457f546a1797bd2f10","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-03T14:16:41.672Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.12","@balena/jellyfish-environment":"^6.0.7","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.5","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.17","@types/uuid":"^8.3.3","lint-staged":"^12.1.5","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.14_1641219688927_0.9610603700357176","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.15-renovate-external-non-major-7e770b63f0dc722092ff352cd3d0238713259a89":{"name":"@balena/jellyfish-metrics","version":"2.0.15-renovate-external-non-major-7e770b63f0dc722092ff352cd3d0238713259a89","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.15-renovate-external-non-major-7e770b63f0dc722092ff352cd3d0238713259a89","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"45b6a76c22b028bdc7cbadd8df802e44e04dbd43","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.15-renovate-external-non-major-7e770b63f0dc722092ff352cd3d0238713259a89.tgz","fileCount":16,"integrity":"sha512-xdF5Ak8R1MN7wJsGj680hld3AKl0s9GM7dlz/PgJO9RK4q2DjLAZSUp4LDloYb1+PM6T2IawKqtpe8h/5YId4g==","signatures":[{"sig":"MEYCIQCtR2BGnyG2WD9Tf7+FXuR5tmUle3yNXkHkBC6YzNqVOQIhAOVNH5oWNBO/I4fq0r5+WC6oZ0RI5IuLF/72SEnhMGSE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":145378,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2OwKCRA9TVsSAnZWagAA3rgP/2G3plAPeTe2Tr3jIioF\nHtHjmLUPN4uZe4B3FYeToayN3CQjwnbNFxYKLVaephS3SA/OP5LaegsenMPz\naQI6P5OlYomqRICuBD94WN+Uqk93DyoM1JAyoVde3FcAGZx+OiuPREGxy3+T\nD1hVSQiLLsZkLy27Pwq+Isl4NE/SXrn1SltGSai2aXNaqhxGb9riZ8QUk8HM\nKR17VlY3+ucvkoOQj671UkviWIFCjSwS1zUpQLHB1PPsOfQRATCdD4umYTT4\nFCbrFCCuqpTNecAGt0lvf+gUdzMWlt33Ejte3zlAFPcaz09o32UCSaLeAXib\nAp8gycyvw0edGQI/5O68sqjr6IwVwkQxzkZIgpmURWJpMWGact2ryFALklhK\nkA+kKLjGReYb0FOEQZWPOLBK2TekASuPrY8M6Jx7iZArcI+IGjQ42CPbRvZi\nOT6qKp0migVVXGrKfDMtSYfuap8a1+fRg2hUW5XrRbj+CLUcpMXHaUUvVzGa\nsMziAovbzXxAGfbDrWByK35tLC8PTOK6jtrxLIfauelRHCyCME9kpt2eyO5o\nQeaBLTp4WIPyVbwVfapRu5bw/57Jljywg0B4CzTWfxukIxQKtGZGyZsU3YBt\nb03vsNIpBZzCGcSE8G3CflQa1/r7/d6gIOQ0+Lb9KNrxLNtSxFEuZ7B+cef9\nH7Bp\r\n=MoYV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7e770b63f0dc722092ff352cd3d0238713259a89","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-08T01:39:37.820Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.12","@balena/jellyfish-environment":"^6.0.7","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.19","@types/uuid":"^8.3.4","lint-staged":"^12.1.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.15-renovate-external-non-major-7e770b63f0dc722092ff352cd3d0238713259a89_1641606154470_0.8367089033975614","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.15":{"name":"@balena/jellyfish-metrics","version":"2.0.15","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.15","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c7b526bb3165ca3893d55eaf3638d7ee8466f13c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.15.tgz","fileCount":16,"integrity":"sha512-q2wKU6h0EQIh2wHQE2Vbxqyib43B5hWmTDkF/szPt7QITeZt+kzkuXSALe/fTodZSAsmAXcOIttKl734DYe+eA==","signatures":[{"sig":"MEYCIQDprJAk1MgmiRQmmxfAa59na+07XLgvaJ27tVOIM6+SeAIhAKlG0JiX3JjQOu3c8bsMHNR3CXYI4L6ATFic8t7InbCn","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":145309,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2O03CRA9TVsSAnZWagAATYEP/AzPVLxekpa633GmMaQ+\nsayv5bELGrdqnNIJ90qQBhhVtnjrQeDLwRTv8zAvsJ3YjqGNLo3L8cg3sHzh\n7lwhkCQKLFlN2/QYdrNw1e+ExaNEA16svyf9yA+T+Lz5CAQU65W0qwpc+BGb\naJlOUG5gKNlku8Zy+/lw8friVuX3qVr+60KQ69Ra1XvXmJJT5L2MS7K984eH\nkVdEllsXaL7k99TeeCDpHpZEzFBG8FjKuAEPkAJIzdQLZEJ173zp58ovrKZb\nOM1tvUQ/fs4vOhBERfcQ28nUhlmWW7pWY+H3vAQqUofOFzwZbXvEwgZvrl5y\nfAmkDBrbs6/jKKcGZReS0lzfILDWgI3q9gTK3n11ixYzkr4DtAO2iL+uAi/V\nRJtQsiwRlsvWbUmJOckhCWkWqm68zR2PCKL5FFa+CqVBmluofCnUuEHHVbJD\n7QSfwoNTGMJuoQuDA4h0+/O1HzTfiZ2qqguZPEAlHb+RPWEAqoBa0SP5QswS\nkPvo6tk1EdRkWyGDi3I7pFG5EGxP21Vt3nO623Gko5aqCfggrIst5P998F+R\nRxLMmGss950HF31EUrgMyWc7mKzgSRAdfCy+eNwuMa++IkIDovC9bLsolR76\nm0hsPcDUMigSWaDs+sLfegQ0qOTtXFtRi+s2OrUpd1BMqtnTHyWTsaqU57iU\nv4jq\r\n=zCS2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"53be902f1aae08a7f45426b74efc9798a22b3989","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-08T01:44:08.986Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.12","@balena/jellyfish-environment":"^6.0.7","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.19","@types/uuid":"^8.3.4","lint-staged":"^12.1.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.15_1641606455082_0.3420219328822438","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.16-renovate-internal-patch-075e427b7c85869b4b3ae4dcf7a6fd5135e41f60":{"name":"@balena/jellyfish-metrics","version":"2.0.16-renovate-internal-patch-075e427b7c85869b4b3ae4dcf7a6fd5135e41f60","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.16-renovate-internal-patch-075e427b7c85869b4b3ae4dcf7a6fd5135e41f60","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"037d078f6be75ab60b500939bf0a7fe863a1120f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.16-renovate-internal-patch-075e427b7c85869b4b3ae4dcf7a6fd5135e41f60.tgz","fileCount":16,"integrity":"sha512-4P3a/d3LqiKXxzhc5Iryol/UHL4evjIkjulqSnnDbA1kKxIghJQQtOd87U85bJQM4XO58noeb7czpZhzC1KdIQ==","signatures":[{"sig":"MEYCIQCi/rm//U/NrP3m+AvOdKdFwd5IYOwX8Dc7IYaYrMvNXAIhAIY7sFl7LbFqG/koeOLiaynmZvcKTKyllupBz/4m56SE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":145477,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2O4ACRA9TVsSAnZWagAA06IP+QDlV93hfDUcwB76sKXQ\nObrQzD8cENnF69FYkhSIy/tNwTlNJIkpePFfmxGugAacY+yHBBulLOW5IDCg\n5IM9Id/YIRAayqpLkrLZ4QUsojISnHDANps2yMHzIm7Wi8FouXmfCVcFiI8k\nQixPsxA2VZuFz0bs5Vanz4AnwxdDjYN2v05r4Aukf9iPVdbTnPzfUnoLfn41\njHdceQH0yEN/Cj/tbgnqyCSU2rv27ks7k6KoN9vR1f39usvB2FdciVlinLB9\nYZE9IAGJzMsfQdYT88VNDiUfoG0orShne4NA4xtkDhZ9RYNJLHuZnXCCVone\n1ewy70iER3m5wXD4wbIUHme1VupPoKWfsa/Ne0DYENhEEujBoXrNADa6ktq9\nxExf6/vPoEfyGK94jwlqcky6oNgT6HZO5dkCUlYEUSYnaQofeV7OOGA8MRXA\nf/hZraeRgF2JI97+XRr50p5qixDzV4Ek9oEm8Ys23pWkMJcHDIfGNsmw1Er1\nMjcC1khbtV7ma1JdKcL7TMhg8P0tEsWOLWfwUevnAtoIKN7jNmYmITLge6CD\ndNb/q1r4bpOOn47iE135A4Y7GwJ24v2J95HYJ4QIhMPTF1Ssj2zbUBt0OJSy\nuLVf1hRKAQqh0rhagjezAzjm/T0E9jOrdfpcT4IrMiVDxKLqm1GT1nbAGljD\ndXjO\r\n=id1p\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"075e427b7c85869b4b3ae4dcf7a6fd5135e41f60","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-08T01:47:03.386Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.13","@balena/jellyfish-environment":"^6.0.7","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.19","@types/uuid":"^8.3.4","lint-staged":"^12.1.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.16-renovate-internal-patch-075e427b7c85869b4b3ae4dcf7a6fd5135e41f60_1641606656547_0.15882117632214743","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.16":{"name":"@balena/jellyfish-metrics","version":"2.0.16","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.16","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e6dc013bdac4520c74093555d9de515dc1655ec8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.16.tgz","fileCount":16,"integrity":"sha512-LupAwgQaOuJHBsjLVLMCrn5/7ZNKRtahjZO3iqv5KkhAgHVsQFY+vPGWuaCy1aVkWJ+zyuW68/IrkpAQ0STixg==","signatures":[{"sig":"MEYCIQDSZ6JlY7Q1nipbLodWgHYADsoPpGUBAd594ZprmlKKDQIhALYyEJyIldmBfogZWuXPTKeerC7Dz8g0qvFJQrU8XZrf","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":145412,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2O8WCRA9TVsSAnZWagAAvJ4P/iQU+0If5HZ8hEFBclbq\nEffRV1G3cjWcgkVzZYRAvevaLlRuQoVh5kpuL7c/0K90+QeJZg1RJf7FaNRN\nfi31E+zM7//dg3pvmr+OGopjJL+CjrYIaEVdE3XjjNMA+6lPyUqMD1H5qVNS\n2HY1xnKTHeJ3FJuYrAbeOlBehyGxD7H4zAEnmaXT66Qj3iMgTsvaHmu7lZDk\nZP/Y2SSifi+WrvQAtI6WIzBCpiWpib5vvRcQwoW5f0LDu8lpzYVS+hkrmg5c\nuZ/JzhlGenN4aMLpdKGWhw9LZeXl4nBONkyGc5is67Wh3ZT/hJPvFHXBxrnx\nOWVWqWVXn67/XVKTjyEy9VEh1j8tmb6WWsjYB02cxpME2vRpJpzRRRerIsB6\nHYA1Z68rJqGWNJEgu6JnYCulkvYu+O0iP1Uopn7YZItmf0ozBlhWh+Rm25ZS\n2/JJzJOaVO835peyeWHI+gJhUMEpmF0tqgJgpiaXk2p+sdGiA/q5uTs00yP9\nOwRTwe5K9iTiCXaJ30CSYVhpjDgellB/a8v8oIEWTl0RyUiwBQmcmheCNUUC\n4NJq+beeX9hACZmmSQK2WsI6x30gC3fHj6HzvcxbKkMCSOefj0J4ZYgK5tMD\n1nMKBY5ysnwjHidwriq+Bi0RvXmEK+F6f/2HqA7ypzhNvAQQMFsOpWXic1Ve\n3m6W\r\n=yXC3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d5c047f215aea47c6fc858e675fa14e954ab9c82","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-08T01:53:32.335Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.13","@balena/jellyfish-environment":"^6.0.7","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.19","@types/uuid":"^8.3.4","lint-staged":"^12.1.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.16_1641606933950_0.7947962404580775","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.17-renovate-internal-patch-f8b689a0f88dbfd570e186781647789c02997d52":{"name":"@balena/jellyfish-metrics","version":"2.0.17-renovate-internal-patch-f8b689a0f88dbfd570e186781647789c02997d52","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.17-renovate-internal-patch-f8b689a0f88dbfd570e186781647789c02997d52","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"772f20789b2c69b92de8502dc2866273d9323bb8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.17-renovate-internal-patch-f8b689a0f88dbfd570e186781647789c02997d52.tgz","fileCount":16,"integrity":"sha512-6tFbKyl5yOQGkSqcjtqNbFlZBBZNBqDScqqoOMLGREtzMvEjO1Z0uAggLNs1W4jR3DWUE0EJjtbsV5smDQk6IA==","signatures":[{"sig":"MEUCIQDXrboRT7Rhv8Q4vdP1YFw23C2wdZg007vmrsj+u7RiQgIgXEo/CNESJloeVfoAw1eeL64eKTlnZLF1cpl1I5r2vyc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":145580,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2RVLCRA9TVsSAnZWagAA18oQAJZM0JNnmcbdMlSInCFo\ng1UkTpGu+HwI6lB7zv7dbPkZ3DieqHUa66EBYWZVsSvO52JbI4cBKVjK7A6d\n4AFWZ7QqtztPKGaWiP00X4Dji8FXvsiIGLPE8xklzFD/qZvedJXCOdpXRr3F\nQWPVXbvjF5UktQjXdi4sUZcq/qjtBG5acahDTfc2GiSW5IPdDQWaTvDkbzDv\nqxDhbscepd3Duwp2Ed+ActjgtdVPbYGcoctnE33qNxMuwHtvtdvAc6N+GsC7\nMFyZqgnxI3fm48FGP1CagtQnbt8uwsMoKRgUAfov38axhmqkSDk09ZWNQGI0\ne+XSA477wpkmMoTkBSsvtM904wxkpYpFayW1TSa5anJk5PyBZsGG/BCtNyy+\nLhuoFB69DmkanJovhsOOBSkR91vC1mHRkyyCvAIsn+/Vk2VLjZL51Jijkxdt\nDEXogIA8d8GrjJBRXWrgqwofa75PNwmOYT/8K0EdO787+Z92GbSGx27J5XsI\n+bhxYHAVqPZ9H/L7kauLRlyog1OMlMnAXx4Kl0Iy9ZqxVXfUZTGlOZiD8G3f\ncQhF+L01Gw1pdedUUWFflwUwTJ7VOwdGBOG8qAO372luhUIYqHK75e+cuRlH\n0OhxwE620bvqWAJC6NZ3sNmZrqbAmWgc9WCK1C9Sb4mHQsw7FnFn0biPZjwk\n7Wbc\r\n=pPhw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f8b689a0f88dbfd570e186781647789c02997d52","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-08T04:36:13.163Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.14","@balena/jellyfish-environment":"^6.0.7","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.19","@types/uuid":"^8.3.4","lint-staged":"^12.1.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.17-renovate-internal-patch-f8b689a0f88dbfd570e186781647789c02997d52_1641616715057_0.053389846043174316","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.17":{"name":"@balena/jellyfish-metrics","version":"2.0.17","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.17","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"71b5b606a29a58cca5f500077be927cc46692eb5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.17.tgz","fileCount":16,"integrity":"sha512-p9SUMN5wevyZGl+798RskYWAl2qzCpJSutcvoO1YospcFa0JZrj3yOHWqxCV6PKMAKggLNj/rZrnPgDgFRkxiA==","signatures":[{"sig":"MEUCIQD1gW5MpgcYxddQA4EPwEjjcs9HO4VUesb0sIRYl81p5QIgFYhpI7/Ds0b/eyQgaCNMfu+dywhlzq1qrQsN0OmrGv4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":145515,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2RYYCRA9TVsSAnZWagAAZO8P/0fHOWK4XGQ4HzaK+X3E\nkb2pHGMszo9o1qKv696J+UWgAkA2UrYJt0NjpxSsrjs07Pzzd+c24EAd8oec\njddV8ycX2JQNsHR7WZMF669ZlHa/DygeESwZlR4/8V1kLyLiNIjEwNIMbiWv\nutHd9NhsWmtjQuWW33ViSz1HtJ3hz3EFXdLMIdofEzMaBCYJUzYKNGtHoXIz\nEQRfKvwhrpuUTpN7AjDx4nt7jcuNiDz1OVrtS2GQOHjtjj6vYEDedpRORXtl\nCRq5ZOtoAeObp0u0nThfa32mE7EwKQWItZ8ktoom3oKwHa4ri7DKA0AxBnC1\nIByuqpTM3cLKLZ/ts21vy/IEa06QinGO7rnqUnOP8TIz7rfI4HBV4byPzPLB\nkr17T3J9IwjQgqWrXDVMZvzPtfsvMHqU7sCHUzOtjVd8KmkByyQj8vX1Sp76\n3ue4Crws/wXDCOFMcAdpEns1aA2fawYgbPcCy7CJJgxQgB+j0MrhmAN5TuEf\nLKM00uNNdsQBXhWX6aQkh9WGjcGdCg4l9l2iIZa4XYkNaEmsC3iY3H7NqCuh\nmKNY4Gzzb0bxlaIzogpn0Rc4sQ7FaOvgtjxLbZ7v4bMdZiYBSHtGtuAKlgFs\nhi2MnYBsGSrN7EQn13oGVJyf52uYDGYS2HvGLE0W3aTgjQd3B5TRZNQhQwRz\nPUmg\r\n=2UkX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f3bc5cddaf75834b503e5592786e97bf1f0aaffa","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-08T04:40:04.763Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.14","@balena/jellyfish-environment":"^6.0.7","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.19","@types/uuid":"^8.3.4","lint-staged":"^12.1.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.17_1641616920611_0.5383070753993453","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.18-renovate-internal-patch-c2519bb5d85c0a597c1af693a27be23e348a080e":{"name":"@balena/jellyfish-metrics","version":"2.0.18-renovate-internal-patch-c2519bb5d85c0a597c1af693a27be23e348a080e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.18-renovate-internal-patch-c2519bb5d85c0a597c1af693a27be23e348a080e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d7610a5708eb6deaa2f59f6c1445bd40735917e2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.18-renovate-internal-patch-c2519bb5d85c0a597c1af693a27be23e348a080e.tgz","fileCount":16,"integrity":"sha512-lvD3P0glCrY+LWJs1o3b3LisAfniPU7v6ZWWdJtrrETPT84LSump9DPeSBt80q+2ECG0iCLQLNE3z/N3WYASow==","signatures":[{"sig":"MEQCIAiVlja0pHPlD3jNQSh+UegT9YKJwH2+HzDTqofoigTsAiBNU+wdafNkxvhErBqJ/qQtiudu53gKMoCHfyeyoLLepg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":145687,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2XYzCRA9TVsSAnZWagAA3sUP/RQUE3Rx6yIlE5O9n5x3\nefJ6FKaKFK/h4manGye/hy64aOnpWL6pJxm/RunZFwIcaupWYoIKe0rFSDBc\nBELvGbfVjjsSNMolOf6Wre9onPyWjYc3MDkxsnBu3XWSTUwsasQrUnA/jrXY\nnsqNQ4SBQqmdYZmvMMLd2gKWUhinzE+HuQVCqJlgbufad7DjWJKMVY0OyIfz\nyYPoXYBHoSATM1Y842N32EzngyalYUVgv2vFFHvS9dgEiBdkyVIHr3D1jDPv\nUvukWq7sy6ImfCIbsRoFY/vqehHen1xQcAQrIC5qco6h8lLEZavf8l+ZL4cf\nZdXi6jYjsoeKMWCM8o/99yV7uIoZx7fYLuXgDFd314gPVTdFRR1aeEcWn3t2\nKY/Mp2gY0nPbxuXzJciEumQWvumW74SGm/adY2/mprhS/2vLQ2htpUIfauu2\nEeQL9tLcCW58LAOI5qhkX1IQ4ZGRehaMZzGKA7xXbiOYmEzMowAbJyiTKpsa\ntWaa09eZR9UALBB1z4fszLS/ZVR8zAmYkaIMVG0JQzoqo1d9AMj+3POKo7RO\nlIEUOJj12v9T10+cH/PHioRSI0WNy7trtMURRXKphzashwkeaomgOG6+Ipva\nak5Vhlsa3wv1E7Oz2wb5xkKJEwtfAnrZMqGhJRBW+lSbRuxjSlAnx2CX6yl4\nrU4/\r\n=iiFM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c2519bb5d85c0a597c1af693a27be23e348a080e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-08T11:29:13.105Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.14","@balena/jellyfish-environment":"^6.0.8","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.19","@types/uuid":"^8.3.4","lint-staged":"^12.1.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.18-renovate-internal-patch-c2519bb5d85c0a597c1af693a27be23e348a080e_1641641523175_0.7481961264437202","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.18":{"name":"@balena/jellyfish-metrics","version":"2.0.18","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.18","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"aac50e30174358e1a33d24461d71b18ce05926de","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.18.tgz","fileCount":16,"integrity":"sha512-80ZXstx+0gMxLD2rP3xiwU2jofKWI2NqxxU1aI3emqxrY05Ccv2lu8s7bS5Lgkf+guX/e0+yD4F4lFIgIIbxrA==","signatures":[{"sig":"MEUCIGdSUVOmkk+XM2Glc04aUTvUmmzH2sk/3kPkBwKnAKUmAiEAr13CWFyDo0XGBIf/4cKkbqwb9nPxFphxWwDZxfDRNMQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":145622,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2XboCRA9TVsSAnZWagAAHRQP/Avue4yvFk6SN/jWcw3N\n4V3rUFPMJ9FTQKDdoZmHOqv+WoFYEwrldSW2gSHbZC2dluCkEMXkn0ZuHNyD\nUDiKklD6/sawkDe3knMeded4Vczr1FAXeVpja0cVVEGrSqTdDB3bSZqJjF46\nosdU+tE8VoUEnQZkHWOga+m+G/WoRRL386kE6N0rRcfQRQpU7IUNTeEazITu\nQdkEWWg0P8ZhqjU3MGyu1n+uGKDLmRXcJIzRDwMUyP8J2Gevt5dYPQm1d/SP\n7KnUq8ew2eFVap8cpZhZi3hbOvdNQdR6l0GAYLz0iliY90vU2khC63nbyI/d\nkQfZztRyKLzG9EsRrEaxjI6VUSRp9Gh46zfQXXFK4Ujl0850nDlr63d0jZow\nKbp6lt+smBnbgZpftAaOAHC3zMTAyo9QNFkslKFSTks8GqepaEAiVqaMm5eb\nD8QOqVVJZpKp8QxgbaYoYwNf3pQiU6QK2gsnXgeYENro6xqomMjQoiRVXVT5\n/wr0GuW2Vejmn0BZASApMBh4CU37umxlagi5SAX1u7hq/9mkvK09orfzOqyX\nYv/ERXwMufhO3bFIobleepTmtLb+44J+0Wlm5j5XWo6qO3xza3qE48BTKWWd\n/uz9pXvJGWhKpMjSIN/533ECAivjE6pjB42cwzr98ZC4ixEpBHBI2tGzVh6y\npc0G\r\n=bwO2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"527fcf5feda7f27157432440971fb66f48b856be","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-08T11:33:03.634Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.14","@balena/jellyfish-environment":"^6.0.8","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.19","@types/uuid":"^8.3.4","lint-staged":"^12.1.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.18_1641641704846_0.34637716139991825","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.19-renovate-internal-patch-a105380933f3a5bb0fb8a0a823a27c7dcc169e27":{"name":"@balena/jellyfish-metrics","version":"2.0.19-renovate-internal-patch-a105380933f3a5bb0fb8a0a823a27c7dcc169e27","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.19-renovate-internal-patch-a105380933f3a5bb0fb8a0a823a27c7dcc169e27","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b1bdbf2c123a1c3ab35092dbea5ae3a7383d28ea","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.19-renovate-internal-patch-a105380933f3a5bb0fb8a0a823a27c7dcc169e27.tgz","fileCount":16,"integrity":"sha512-OKM0MucKjr48srVlUQx6YdDxtKoWr2xOyitK+pQNHxLCm6M5ldBBAA1SfNynikPT5oGQeyr+tg0uAHsaOjPMfA==","signatures":[{"sig":"MEUCIQC7la19X4JFSWY/kjAkYKU67/+s6J2AgEov7KeSYTPTJQIgBRPBHhfNjT+7rwKkPtxBVu3e1nnR16E++NiqzlWGjpo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":145790,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2ZiACRA9TVsSAnZWagAABHEP/3DOJdzVUaZPbOisNhjf\n2xMVmKQzKs8AEs41l1XBAm+3Rv24eg+laZ3twZUQlCTmRzeGP2rBH0aaY71b\ngiQ6R8T5VCcE7LumB8sPQEg+GeuIWQf78zecb5jx0Ld/wQQwAcMZv8NgvmKP\nIZxXEBvy1DkfNehkUD/r/Vey+WlSpc07dErzuxMpr5SpBjuzWxMyHgeLv7Bz\nYOQs0pyrLxnelRS3qrZ4oY2mcQYckS3Iy1X8qcJkSNAHgCA+se7BZoxcFr3j\nGB2HZACA3uWkvauKbVOCq681G/E55gnahr0rLGtHLW66xjCBMfPyupvHZfld\nTiS1EBlt11BcFFhy+rNAdMf5OY+jCd5QemlpxDqyUm69PrVsaec6UFqNBRaS\nG9B0wAq6XfyxRrDSIBsKjPpYqjKYjXjhhwGDwZHKxwJ12GPYW/uqH2rs10jz\nWNGoPShJAOpZcsvSR/OGTmyEFwpLE2BEAwtZ/5gUeTrhEO1vKJSqa77D7i1P\nnBjd/lnrVMmx6N5EXZz0UNn0IAz/t6LWooEm84GThnB4fwWFhBzMj6ZUuC8y\n3jwYPZ+xOor+XNy8U09yUEdn6YRxTIIVnD5XENfzW6cYRWEArSb0P2ycTPVA\n9XDWA2X831hf97fhSSrPTGPfEDGwUk8R00YwiBYDDwY8u+1WUjC+MdGRVvCv\n/2Zu\r\n=f6hW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a105380933f3a5bb0fb8a0a823a27c7dcc169e27","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-08T13:54:22.216Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.15","@balena/jellyfish-environment":"^6.0.8","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.19","@types/uuid":"^8.3.4","lint-staged":"^12.1.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.19-renovate-internal-patch-a105380933f3a5bb0fb8a0a823a27c7dcc169e27_1641650303908_0.9397718691748236","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.19":{"name":"@balena/jellyfish-metrics","version":"2.0.19","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.19","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"26b082445e6e9222804ba7281ffaadc953b66c05","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.19.tgz","fileCount":16,"integrity":"sha512-4TqrbbQwsQ27EM6/ws1lpw5/02papyKRh8tNkwPsI9wAquFp82we+2xNKmHpGVNhCm2iIWfI3C4alr/phl9sgA==","signatures":[{"sig":"MEUCIHsVmveWT49jUO2+F8MTr2/8RwCFOo16OJ2IeZbArD7JAiEAi6U+9n4Ys5YAUXGRTLblX/7ylikqjkktHOa27EgYGzM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":145725,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2ZnZCRA9TVsSAnZWagAAJJsP/2TsN8FAE8+Q21GbboTY\n98jm3UOXSAUmhtFFkcPsRCRtwCOuyEwtgsu8gMXIBt0ki15HKNsWBeroKoZ2\nU9vLDtqZMKaQm0zN8WIMzIVghaYtiKiSW/pPwBVXePavYdecX7FrbIL5W0lL\nveJr7hgxu1uIVDW33z96FeSf+jkJKLA+E0BXbwI+kmj/4PA4utuNYouJmk2L\nUQTf6dYqAVr+E7/VxdG+SvEwf2tst+/mqyL8ro2VovFKiBZbMotnGI3km/wq\nFt8Y7Axb33kFp4TkVi8Ti0ClZxByRhpMo4I6IUhHlwhvF4Mbd70WIGNhe9/8\n73C+pzPVFh0jqqKU1+SMuDajpjz43VQlYPg2oHih2xjPpEjZeyek/z6+Zid9\nmTl54DGHuej+BnBFqalCyf32lpZWzu0FoK23F6O/3TZJp7yn+PXIhZaIqwqi\nfFYtE564MJFSyY4E314wkC3yo7N/utSJyouI+UUmzRGeqImTRe1+LMKZe4sJ\nIDIYcHfWCDdajaWixLdK8vX659RwjQQZneQ5AQxp+aiwOHmvVgmfuw6lLVy1\n2hssQHoEQufX3z+XFOFsXoUd3HhlM4C4t7qHG2k/HwOQ1qri1wDAAbFzxGHX\n9VVy/0PVJSdrxulIh932TPBUdRY0eQNp4MSJX1ohXt9gdFR4WnsOv20EeQH7\nUhpf\r\n=TDJn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3c817e70e3339b049fd477f9deb98a41b890f11e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-08T13:59:49.251Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.15","@balena/jellyfish-environment":"^6.0.8","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.2","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.19","@types/uuid":"^8.3.4","lint-staged":"^12.1.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.19_1641650649822_0.13374297939266588","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.20-renovate-external-non-major-a446e4fb19a9c74699ffbdb9eece09fc79e18066":{"name":"@balena/jellyfish-metrics","version":"2.0.20-renovate-external-non-major-a446e4fb19a9c74699ffbdb9eece09fc79e18066","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.20-renovate-external-non-major-a446e4fb19a9c74699ffbdb9eece09fc79e18066","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"78af3f93ebddd91b1fea8e089aecaac260bcef72","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.20-renovate-external-non-major-a446e4fb19a9c74699ffbdb9eece09fc79e18066.tgz","fileCount":16,"integrity":"sha512-wK0w8cAK/Log+kriapEoUTtkjvzrR40cIlPKgLmi5gVxuZuUdKarizhvwQwPtteUOd1B4dLmYBft+bOr4EjekA==","signatures":[{"sig":"MEUCIEgud2kJXQRS9rL4+MiFVFKsmeelNOKbfpGKS3cYHEplAiEA3q/qWvscFJouFv+QUSdFf5Uxc00N2fVqRqKp2aUyMKg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":145880,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4hTOCRA9TVsSAnZWagAA3TwP/AiO1IpB+T08BefHAxYF\nXZLCUtDpTrziA/KnCa0Lo3RX6fUO/JHscB9/cPbnb6KrZGeLEAy3Mw8tYfA1\nzLACGVMpwap9yJ+8ax489PjUbJuovVPxkO5gNmAsOextqVB03MrKg6Qu4UzC\ncFX3Mumh/nB3CRh7EDPiwYX1rTyokqZ0QR9aam4FQgGRs3hnsQ9tKFrGblo+\nU8ZO8s0AKZujJyoRC8XNwNZZhHX4991kDEnsEyYvtJzi4ZaS8p0YULn+SXdG\nyuttxh8HaUQvw7YELc0dWSUSrsGBy95CoMZR0HP2PO9N6uBLEFegbTSggxFA\nkyZhQpduZfDzxw3G8KsNvpeTLNWCmPmdjR2nmlKky/6tLh+hqIM36rFGrr3l\n+GRtm8/d6dvjkCnPYxovTKRmf3miqSkwGGIjtg0tKpOWW+ARZd11XFW8l/gU\nD8XVzD3D4U9Ae0ElnHEAei9RiiyXpBQm1EsC16+bdtudtFtJPqMo/m0xG3K7\nfuNLZ2ItCH01eg7DkEhgIZRSChpkX/wwNHnmkJmrT7rKjyiHIwnMlU3+5b53\n92vROWwkqzmo86UNPsi9nQH0yt5W4XgJ1FcPy0Yr9ibjb3AvrjXevA0C9sXD\nn7+R3BY2QHL9M2Mv4ardYgjOLpuRPafyYiuAmIF6E30GOTCRW+yhFDbDfyRW\n88cR\r\n=m3fj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a446e4fb19a9c74699ffbdb9eece09fc79e18066","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-15T00:24:21.684Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.15","@balena/jellyfish-environment":"^6.0.8","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.19","@types/uuid":"^8.3.4","lint-staged":"^12.1.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.20-renovate-external-non-major-a446e4fb19a9c74699ffbdb9eece09fc79e18066_1642206413641_0.9964384491236566","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.20":{"name":"@balena/jellyfish-metrics","version":"2.0.20","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.20","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"59ec8259828a4cb72d80130ff424a8411c144b5a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.20.tgz","fileCount":16,"integrity":"sha512-is1GQiLwX0uqwkpg3btrX+9V/Vl9sG8+ye7PF9xPevxv50U+7GBwTFEyuGOYSsjmDktZ0rgPOcPMQDK3ZZk+tA==","signatures":[{"sig":"MEQCIA08UPEOq4DHnBzKTVD/i+7S8H1E9oxPuoakaocP/RamAiAnP+wbJ26zX8nNSV/9Qo7ffJPfDMqvcdV/sy2DU4FkSw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":145811,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4hWuCRA9TVsSAnZWagAAoJ8P/iAqmKbBneLX8ib+iok8\nTSMcVflwsIuZ8xqw4H/NrCncqnhM1x4JlcjtnCO6eeSbzG4Kn/tHfRPlFwK4\nClE1XSuYhT1XCwvebbB4+EHVwDqdbrl9I9m86brhMryksIlzKxGPIHjIuu/+\nKz+Q/ZEpPZJXmZw8p6yUf3CQc+PRgGmUkwkBAY5dNx01bYzq0f8QhLHL3k2n\ngtIolyLyMKXBg6DvXhkH/nRW45kK+sHt3Lu2kDaTKGOXQZZqvxFgqNYS00zs\nRoX1YundMS7EXxYtivXuZPUWGo3+JJtR711Xyboav9vVlUYewFMf3USGKxz1\ndtPtk20+zjYCcWgHU2FtKmlknMfpw40pgESJAsGXeYw3Tuyu/wnAMTv3S9xQ\nBW1wOdw+9sP0wUPWMP8BSr06TadDNe1n3pTZvnS/05b2cRUkbqhkTgdibH5M\npIYiEYSgJOWVW2negSuf4bNglO0QmRnM6l10rNWHPIl8L3ZMqFQg5w1W6FNL\nSyQSOuzgMZEGmbXwnRRo11W3RdzZTkRjeMJG8TLgdMmieDKDC2F4mAK/KD/b\nkgbU3sBoSdSZZUEXUq54fAw/2luPyf57RIGp1teEpzoqmEG6pk+Rco2LHUwS\nqJidtLUWM2Pzpqq3+mbUTbzOmLfDu381qpUzhwem9/MJaFXwk9CsxZWWm3TT\nYh9c\r\n=b56c\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9f559e60d76cee0f0124c02025317ad7edcc74aa","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-15T00:28:51.952Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.15","@balena/jellyfish-environment":"^6.0.8","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.19","@types/uuid":"^8.3.4","lint-staged":"^12.1.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.20_1642206638460_0.36170159738128804","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.21-renovate-internal-patch-8404eb9d7b0952cc3ba073d294b2c4dac617d4c1":{"name":"@balena/jellyfish-metrics","version":"2.0.21-renovate-internal-patch-8404eb9d7b0952cc3ba073d294b2c4dac617d4c1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.21-renovate-internal-patch-8404eb9d7b0952cc3ba073d294b2c4dac617d4c1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1f75d5451fe26b0e62eed8b7015ffb4906e7d1aa","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.21-renovate-internal-patch-8404eb9d7b0952cc3ba073d294b2c4dac617d4c1.tgz","fileCount":16,"integrity":"sha512-FUZULfgiynaBrv776kLd0NH9TSyoT7o/qCYfWWucfQypvrXL4KXT0hmoAbOnMSjsRBa10ScpCt/pZqnhFoEyMw==","signatures":[{"sig":"MEUCIH74nboCnASASXC7NxitZxJ2z9uKRg+KEyP+y/snFaoxAiEAgaz2AXhUa4E17/Wu27JYmDP2yg2sxu6YLr2PIygAOgI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":145947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4jrNCRA9TVsSAnZWagAAHWAP/RcGK2dRx+uJnM751L51\n80Cxe3kAmT2VHhavjHHLxZwkbSYthkLgEL8ovybxNfcJx4e0kHSTmgcNzGOb\nhGUO3L7WKl2iu9q8J9thDAG6HV9ysrx8A4b3ibtd0lBO2zbfr9FJJ0vw/2wH\nxLrB7f1FpMteyClcrd1/ANNfrtQLRlral/siFy0aip3p7vo9j7CwjWMT/YFm\n3zRx2ea38xYStZc1a+VBrmlgz2WytARL6XrZYtXxilRg4SBe0mtS9LyiOCjj\nR8/QxNVEJSE/hmX3pjfj5OeQrDQ0iaJzqgWD1bg4l3MwWWJLLiJWJPuV5ZYh\neHsm9i7ZgiXk17mDtIHkWO87/q7pg1uV9WJdWcY+Hd2Tr30J93IbQkEpEX38\nR8n1w2FHX1oiqd9NwD+CoB5numVS0bo691Ab3+4HanvLLRr2YJKNri6gxoLp\n+PhQLb5KhLOOnHJ2DKttQ7j/CFCt1nysEi4739FkApOehUMJ7pZg1gkUNBPZ\nwOIAOFaoiHGzy9imc7QrXuq/Z44RoIOz23/APRDeXncKCBZ0wljxI8lpTdP/\n8d3SSxtwzYvzKuFzxjGeJ7Hn9fQcPen99yp4NV/U6ozJuWmdK8UB40b4cJ6C\nzR0fif3dWxfau6ZCCjPYSrziT/C3bIm6hdxsNN2kvcfmltBLOo2q6jm4lGKF\n8S8/\r\n=v+c8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8404eb9d7b0952cc3ba073d294b2c4dac617d4c1","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-15T03:06:32.060Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.16","@balena/jellyfish-environment":"^6.0.9","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.19","@types/uuid":"^8.3.4","lint-staged":"^12.1.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.21-renovate-internal-patch-8404eb9d7b0952cc3ba073d294b2c4dac617d4c1_1642216141038_0.03386061963171416","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.21":{"name":"@balena/jellyfish-metrics","version":"2.0.21","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.21","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"15c868398f35027f9d6adde30ba3621882fe0669","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.21.tgz","fileCount":16,"integrity":"sha512-qjLsKg1QJcJA2F29Se/q0xkvoa1NiewWnOygQ9Je4vSY8u5DGxOa/Egezz3uMEZUI7Lx7lrMa9usLRPS6/0gRw==","signatures":[{"sig":"MEQCIF+NmsCaJON6IoHrsu5JZk0Txib7LkwCV3mCGHoQzznUAiAx88DaDGDCdJuv38BRPM1gjYx/IPREU3vMMnemvKn0fg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":145882,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4juVCRA9TVsSAnZWagAA/zkQAKC2yIBqx79FFX+b9ZOy\njPSdFQzrSSYUxNDVlp6Qp9tqf0yfGVB7noQGbfk30hwe+R+otRdNPqctM52p\nPrkbKwqMoJ5yDV5oxG1i7c/LU5GDbsrgIqTPYcwUodSFnZnrhL1IHlREaqF3\nKYVLowv/wYiqbMY+D1V1v9beeCOpEZV94iXmISTW/+oaBezSjinn9xGmqKN/\n9Rg/1oyegSuyqBMuhU0H4WnNkRoYbj4SVJQTa+I0/NeB2bP41meckDZL4Sj5\nVJTTeJpiQNrL/6j0zVuhSPiI+EzZK1D+siBKubPEu8lqyy3mZYLuldZhOYx+\nTCCLqKF0De1Ih8Ej+tnUhNgmbYpNYHwPOX+vUXUse6WDowq0caSJ3K18J3pe\nzMEkQoxFUxiwLQP/GtIPetPmOipZ+3kfRqoz/HzxLqHPtB//roHtipCY94S3\nislOqmrtXKd8dPVchT1Ls6Y/MJWQsrq8V1I/9kbRSt9rxS8Xli870LhCOJB3\na9OJ9WKV5XyWCrO6cp3qA6FdeOgBwtFTzPSP5yxaQupk3/zJzYOQa6kl2S4O\nqvSmqjk28IQKgeTNs8jlwmqBpxvS23jcnJA86VUkbf669N03lWkYDnPrEk0X\nKk5op+bTc7p2/FgujrILnN1jF+0hILOYb1j3eFiGjEdo1UO4T9rN/sihy/kT\nwQos\r\n=tf4t\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c975c9b5dd8fee8a7dee160c8d7f209e4131b80a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-15T03:10:33.478Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.16","@balena/jellyfish-environment":"^6.0.9","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.19","@types/uuid":"^8.3.4","lint-staged":"^12.1.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.21_1642216341108_0.19305584848775958","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.22-renovate-internal-patch-8a345a73f228be3d8f4cc51ea0e6367aae3d2bb9":{"name":"@balena/jellyfish-metrics","version":"2.0.22-renovate-internal-patch-8a345a73f228be3d8f4cc51ea0e6367aae3d2bb9","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.22-renovate-internal-patch-8a345a73f228be3d8f4cc51ea0e6367aae3d2bb9","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c79a9cd29f6b5e7f75da07a491770ffcafb2cf70","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.22-renovate-internal-patch-8a345a73f228be3d8f4cc51ea0e6367aae3d2bb9.tgz","fileCount":16,"integrity":"sha512-l+aF2bIRKZdBlJOt5+mXDRaPwgfABOkbM/wHQ30sj7uFbcZ2dEozevDZ44kJVEPoWG+w7ES3CZCTuK72sMcAoQ==","signatures":[{"sig":"MEQCIGOdEUGzEpUv0kCimrEGZdYi6wRfHRMqOVgPHWnePUp0AiA200DswIxJrp0bsTCWCDY+BTuEGB3TGPtvIE6oLhPfYg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":146050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh5CthCRA9TVsSAnZWagAAL/QP/iKKsDBoC5Suc969D/Tl\n4C1KCkPm9aGSxxvy/ENkn/Say7G+adOIWmf2TkjGByd5wVx8aKHVXSUxI9pV\nHWKyFU5THKiVQxEeLOz1ClN6TCMl7nqnO4gwCDPGmjke4WU1v+2A3SNbKGjT\n96/6mOM/DzcgFmUBrrOl/K0uoIw4AaQvNgVEiau8pJEVtp2pjMHAki49S527\n4WKIdFNEb2FV0lS2lMI1/gG8dInOHZ+oYW8DV24XwkifsgKq3tW5dJDajlUk\n6YEBgY7O44W3oAgNIHReXmybOr9ly1Ok3/ywq1TuYjMkoPW41wH0OOyqCvum\nZawaVelMXTjF3aIv0d/2y+tv6V+7Z0P9GoR79KNXrQ7FQwI3vz9suj5hMA+C\nDEl15b7T00u1EPtW0dlyPTezJSk3Pw7vcFQ0VaTkteoeTjiJ8/iCSEAlkV8X\n5IRbaKlHAkAboVA6BoGK4mvSqcaU3rjJwkwHz7vW9Dgc6/AWBZrk4ukab4Qj\neJI1Z0kV57JNdCUyYSzCEWQ/01rrWxLVLMO4Is+uv+IW/KH1zCEbTfZqVyVW\nP65haSciTnoJ1A7HPygiAqIpVvNyTOxAPyz37EuA3y22JDOMIeWmBVnggraR\nZZTg1hP6jiWQf0Um7/k0cMh+v4JS21vxxHqVk30C2ReGWCcSRZ1tqF9iMDeJ\ngPu4\r\n=TpDi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8a345a73f228be3d8f4cc51ea0e6367aae3d2bb9","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-16T14:24:32.369Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.17","@balena/jellyfish-environment":"^6.0.9","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.19","@types/uuid":"^8.3.4","lint-staged":"^12.1.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.22-renovate-internal-patch-8a345a73f228be3d8f4cc51ea0e6367aae3d2bb9_1642343264891_0.4276926474575311","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.22":{"name":"@balena/jellyfish-metrics","version":"2.0.22","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.22","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"82aa20ac4c7d1cbdee71d20a757efea41de7eae5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.22.tgz","fileCount":16,"integrity":"sha512-/oiezYWdf2q+VgWtOfhFF0KHuKYCkkdx1MnT01Xa7tqjUe8HRBgldtuKlaKbG9KOoQidwIoziS3xAxd5/mc8Jw==","signatures":[{"sig":"MEQCIGGgzXkdADW5+BeQDjCIfqqqJqfWmoGQfq8IMvjJhT91AiAb/+GrM4femyOVSXSGA4vS+vnyTUQ+mN/LxRUXO9E1UQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":145985,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh5CxnCRA9TVsSAnZWagAAkEEP/2pUdZO81s13UAzYLkwZ\n4WeAEL++hkrtzeBm8nQst74JcSUSFNmZ0TiFaNLM05mYdceO7zzjLKVxDUwz\nh945nZazRE7HH5i+69a8xlI7rwMRFShK+FbazZZzq10vUAepYe6OiiF5Fhtf\naAoRjRzw6OkHH4pFjR6D3o5ulpiogjRm2sFAwB0aobc4iAgmPlFWj02TNdfY\nEcONgbkExIwTinA1rBXQsu5hXYAvAtU5AdJnDg9SFlhjx2ZwSsDwVWHYGN1V\nGImisLzGuxyn5IlEJXQ2FTOgYo4E9neXcI058yCSL/lulFUlcBVvWXcPYdnk\nHCxG7kzaD9Q2h/piKmrL58bRIam/TXuxcEHVGJjRxjDNa3hsgrjQZWUxzmHF\nNc7lLhFg8LL+IrZbpY7PfpjMbfE/nAGyIC2eTTBRadbV0/+3f6aZ3TUBbXHc\n9l+n26G7EZ2uMI5EU58mHswLomyDlfaHIJtS/YKgqoiqObG3AvSNFpRcM7mU\n32AbObuy1fCgUbmYJelxQw6nJG3O1pt9OKiVjpejZ1tW0PnzkXwkaBSqueyG\ndFzvpe0Y1Dyq4Cl2BJ5hiOItFNnJoVXWNTZZPcF9fpapLi3pR1P43HwuELYw\nne1Z/My9FdgjUl0bn5+H83m9pl0FNMpU662xltAz7OuthIPVsq4YmUJM96Jk\nnCla\r\n=LlN/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ae973b3cf66fdbb2c49abc475f4b94e88f0f3038","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-16T14:30:10.206Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.17","@balena/jellyfish-environment":"^6.0.9","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.10","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.19","@types/uuid":"^8.3.4","lint-staged":"^12.1.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.22_1642343527290_0.42444124603691","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.23-renovate-typedoc-0-x-fc10f045e4e5d358d9f98ef3d5e610dab8a5a321":{"name":"@balena/jellyfish-metrics","version":"2.0.23-renovate-typedoc-0-x-fc10f045e4e5d358d9f98ef3d5e610dab8a5a321","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.23-renovate-typedoc-0-x-fc10f045e4e5d358d9f98ef3d5e610dab8a5a321","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"17db8152fff937edddb3be114a824e4b036ddf74","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.23-renovate-typedoc-0-x-fc10f045e4e5d358d9f98ef3d5e610dab8a5a321.tgz","fileCount":16,"integrity":"sha512-eMJfqK5g6Z18LaG/SmOxT9ryWqCXv9g2VHZ4dxSrguH/cS6hBdosIVfpZP7+LbanHLloE8Al3TZQh1NvsU3NBA==","signatures":[{"sig":"MEYCIQCE/Y73SRNfJvjCsLCDQY35TUTziejf7RuwqKzqNO01PQIhAOZb6r+iy4gQpQSnIYKkEbU/3nVDOjTHm4uB492PQ5qp","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":146134,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh5oCLCRA9TVsSAnZWagAArUcP/RX0nLEZzuAXdvSp0mBG\nTGj+TzwMHbAfhlsu9r8mbeMDqZ7MgTq/zhNKFvZx0dwxMbXIeqrT2GFZONUU\nS8jPqESRtxbqdr2Ka2fXK4AFkFBfV6j2gXzT3hwqAuINDmYjACv6qI/ugAAm\ndN2VfGgoxE+xlzb8ogsULg9inOkPk4DsEvBZ6JNWxfYYV9T7i9R4Z40tc6bM\nOf9VCCiIsqKeuKtYcqKO9VZ4Xe2CwjleYNDztXFE10JBcTzhNrRS7xKjhCEe\nQJAHz7vtRnQoSgPVsNgI6u+iGBgbRzgEkT9X9INmGDTUBjpp6RELvrGS7Pdk\nS5IWy+x7KR34O3xfpt98IJJJ4Nmv44fFkGSS2hbs9lm5ZArznDwZaXBBow/i\nfX+1/uIoBd/gg+PJN0hUShUUS7Kbh4IUafQKD9o8BSHbcs3mYBz3r0LSrxkt\nKB4xkCas0GQcaLx8XIsD292yPWmkfWl79uW7czxKeDNSOTQ7fWxNWPURXh4m\n410Whf+bdwS66rldu+cEyk1CzIP2doMOov1OZRBH1kzc3x9G3L49e+x7cDIu\nwmhtYzrNOMrf5LzX3MTJn+CQtZAWSIIJPPOfSs2J7H7DjFzBxncc8+s8EkdZ\nxoZYBbc1vQ2B3E5qPhBLnmtPietJ4RoSWDO0F7JhO59hksvjAp9QmirnXEY2\nDj1F\r\n=+rM6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"fc10f045e4e5d358d9f98ef3d5e610dab8a5a321","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-18T08:52:56.552Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.17","@balena/jellyfish-environment":"^6.0.9","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.11","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.19","@types/uuid":"^8.3.4","lint-staged":"^12.1.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.23-renovate-typedoc-0-x-fc10f045e4e5d358d9f98ef3d5e610dab8a5a321_1642496139646_0.6212928777256943","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.23":{"name":"@balena/jellyfish-metrics","version":"2.0.23","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.23","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ae644d58520960ad76a17f041ff15335a64b840f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.23.tgz","fileCount":16,"integrity":"sha512-qReYCU8TxiUJ+AOTcmrTuZkJA9RIievIChOKjX4tHWIq+3RtiskvS54i02pUZ5THNHDrt0ILg1vUCk4HGpjuBg==","signatures":[{"sig":"MEUCIDHuSmwsfnTxNVYxO00NPl7JAlrJLWl0JMp0dOyAd2uJAiEAlL6Btuu/xm7gAGSNu3yFDy+XRTiBzV/KMHGcgDH8WIQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":146072,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh55plCRA9TVsSAnZWagAAdCQP/idbCAAKQE95laqtf1+/\n8VbI6i2FmrGv1DEAjRxIX7oUOWkEHCxnrm20BGdvARUkiltSqqXCyLlNzDlL\n1yjuNW4dcwl1PyV7OfLRZgYQl6RHnuwVawM3pxwEmljpdWdYIjIF7KazjDWM\nOfWUhw+vjufPvzCWHVvih1poyfV79cgbi+1jS2ZzS2kz7r/0LsaDZz148Ynl\nPZo8Thoz95QEXtV7k7ffS3UMFVlxOvzY4t4fkLJeyxgAgYQHMn1hBTzwMs4t\n+c0LsugGtOOH2rpljZtw20HS9grzZgpmIZ6bJ8QlAKev0wWy1jl5zaBmE+bW\n+/j/Ls8/5XsTEsoO/VsD6C6f1Tthu+CsOM4s/NMSTkwYSbzFhd8NoyJk7IM2\nOEOPS78RYXEur2KCbppAdiuapp6jeQ1i+ekLCRb/AO+/xPGBGh6bQ3QrzEME\nSs2qXf/AZOaIU9V5j1+s09tFLaitQkpmlgrrwIxR6wPZ8q1oeJq8aQLxgcRi\nE1Y3gHvTAhFJv0t8AOQZdvD7zfTsGXI5kNTQP5BBMfWpefF3h2/sI6EJKANg\nAaDwrpMHScju6YX3FZ7uTF7h+udWckNZi3u8qklTRpvH0Eh7PzUrMx2Iy4sW\nOz3OzCj+4w+t8M0kAxHzXgB1buNo0CAGDVqO7qRtasjiYitEAlOC1XasDAqt\n4IEA\r\n=Apss\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"51287c0edae4841c2760f01403f68e7b4946380b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-19T04:56:05.085Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.17","@balena/jellyfish-environment":"^6.0.9","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.11","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.19","@types/uuid":"^8.3.4","lint-staged":"^12.1.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.23_1642568293303_0.42192122337861937","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.24-renovate-internal-non-major-eb65f843ce94428f3516f3f7cbc05dbf53c02b6e":{"name":"@balena/jellyfish-metrics","version":"2.0.24-renovate-internal-non-major-eb65f843ce94428f3516f3f7cbc05dbf53c02b6e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.24-renovate-internal-non-major-eb65f843ce94428f3516f3f7cbc05dbf53c02b6e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2eeebea64a90eb1bd0373b516dc244ec619b606f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.24-renovate-internal-non-major-eb65f843ce94428f3516f3f7cbc05dbf53c02b6e.tgz","fileCount":16,"integrity":"sha512-2xobUAeCj//Zc6p0Hc/GYKlbpRCjdZhQEWDEwbsVqrQIhxk4O+IOSyounVunLgLH6uwP3f63729T8wmGfkUZHw==","signatures":[{"sig":"MEUCIHWFOU5Q+F7qh+SRqltlylc7L+kBuBC9uEbyZkMshUhGAiEA6IAnRS/ki4yICsg9Z0uz+PTCpVMu9GVUEyPFuhHiqJo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":146217,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh5/mECRA9TVsSAnZWagAABl0P+weFvke1EchqJqQ3zs6r\nlDFAac16EWr8KD/f4t76+421NlwMOjARMRhHUlPCihlOicY7kjbYuaAHOAgj\nyxy/8Tq8v5r9lROawcXnLVkhPeDVf4HaMWccKvEEIjS3X7Vc/3IEJF6/869h\nsPcAYE9kQo+NLjAR10GIfvde8+RzRVIcCGUCaKPbAF6Mdn1745BusM3pKsFb\nNAvgx6HTtQwWAtYcUEgXIUfWKWz+QGcSmGorBjywjRzXlFT5RBrJrDa8b+By\n4etHJKeB0VAWz39vm8lkcDPwyl43qPpBgXmx260XlLzkSwHgVA+dBBgT+i2N\nU90F1o1S1AjTRs8S30zYlms5BTy7tHned/9eor2SXkWXDUPVdJiCWzMb34+j\n/DWLsFiyo6kMAyasPZJBtpBG+kM3J+rqlc6JFRn6T1Qu3PmgM9ta/u/GqKN5\n6IzjBpLv+cemwVDs4ghMA/SOX278b/lrkRhSZMcNacNRo20ULKoJeLFaRWLJ\nRYWkuTiuhNXq0+SsYRb+ndA8tNb8351wB2BPZn/Z/221PZqbkkexfsuEdo9L\nG5FYcV6nlUTgMmjI0x97ZlXRhCYrDjnE5xWESJKXNngxHYFq9/J7T8fpOfp4\nRHniTxSvj5m4TLhpDziJYTeqEJJXm+OFIJzCUllOsop6MyDcJC6qEwtUKklQ\nJfkV\r\n=Uib7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"eb65f843ce94428f3516f3f7cbc05dbf53c02b6e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-19T11:40:30.537Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.18","@balena/jellyfish-environment":"^6.0.10","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.11","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.19","@types/uuid":"^8.3.4","lint-staged":"^12.1.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.24-renovate-internal-non-major-eb65f843ce94428f3516f3f7cbc05dbf53c02b6e_1642592643898_0.857435306110828","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.24":{"name":"@balena/jellyfish-metrics","version":"2.0.24","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.24","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a639663039c48b703d92b2b7cb4c087da67eccd5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.24.tgz","fileCount":16,"integrity":"sha512-XZCVNmuvAsh+dywvyE2ow+ZL/P5DOauBdDuXZQxmNlEhzyhqiMJhsHnvKfwh/xzSKrqW0bq2UVikndxfFx7vvw==","signatures":[{"sig":"MEQCIHUBsv88oQeK9E00RF0Mk2nKVwZrNqAX5Vb4QlKj1vtcAiAdD2OMWJr19kOG712BiXW+ucV5WhH66HEzb/ec07Fyuw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":146148,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh5/qQCRA9TVsSAnZWagAADEUP/1p1Wh5ThH1yz1Y5Ah4W\nI1+xfShwkcBvVM2GVj/M5glomww391TN3ssxt6aOSTGAUy2/6fiAYI56IIC/\nrPiUbYebckPAzNTlVwlb1QjOS3OetYyNvVqxGdkIhKrhSKobr+ukDWdP4VYQ\nlYC2iWRRUnw7KjITeQF8NlFQo1tAj1KBdtxaXHJXyHOtIsRSDNkoPFAlcmFI\nuTyjMMbsoLuwFs3pWyoSNGWdjOlWuWNGUdLrir3SipJurahsxHMB8W6kjCGE\nTYJj5hUdHlBaTr0L4MTrcXNOYTXQktL+p2rZEf73VWGQtuzq/hDVJSi2E2gp\nI/drk5VtwMQXd6ybji+f1rMkCUN4VD3n7wSnUJ/ISRMNMLXxLlM4bZZav+Dl\nOaw+S6x8Rk8PO1abfeidoyiGXMKNoegV+47Vy5kq0o3NVdQd8bGc8GFXIjNe\nRmpj8Uj/1YEvEDQmus0zx726EA03K8Umaf6iaVCWvTBXLofCfziqvCR3iwzB\njS5CVDfCopAFXYlyIyiHIj3XcGNS/GnxY8Q9Ooz0OakRIwd6yuu0KaMwjGzb\n+t9YbcCcNVmdVoXuIfHW6RQJD1hZn0yDVM6fXq/jpBLZ4nC5V6SQ9DBk3u04\nEHItR199VrL8ebCZTpS2viKAAOUaZQKfn3mw2Ac95Y1Fcs2LInpdXf2Wl0bL\nFQtY\r\n=NgrG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"919dda6fc67a388fc529b5194f392eea52fe973f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-19T11:46:31.891Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.18","@balena/jellyfish-environment":"^6.0.10","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.11","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.19","@types/uuid":"^8.3.4","lint-staged":"^12.1.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.24_1642592912846_0.595106424199034","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.25-renovate-internal-non-major-0f580e5a24a97033b15508eb23aab4fc593bc8aa":{"name":"@balena/jellyfish-metrics","version":"2.0.25-renovate-internal-non-major-0f580e5a24a97033b15508eb23aab4fc593bc8aa","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.25-renovate-internal-non-major-0f580e5a24a97033b15508eb23aab4fc593bc8aa","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"65992f20e06d7592f014544644142a0c0554a2b7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.25-renovate-internal-non-major-0f580e5a24a97033b15508eb23aab4fc593bc8aa.tgz","fileCount":16,"integrity":"sha512-MEXi0TcMAIoPQcD787csCP+lJmyE6mY8saABirATl0MVmFwWtDTvh0QyViAGuCOTY4UjCJ46YKjOmAtZoO+70A==","signatures":[{"sig":"MEUCIQC3i72JVDK6QakxU5AwUVAqQoNG7hMgbJfu0ACj5LktDgIgCUc/N96t3mTpBEkkoRnvKWj9iBuovunR+3BtqEQ0PyY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":146320,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6AwUCRA9TVsSAnZWagAAsjcP/jm9o73gFFIssQ6XNZN5\n5A8zmy5MTYZOMJXl/676jdTEhiae+r8NpAAyt3Nr/Z0QG1cmI0iLp959m686\nMjZKDlZJ+LuBnTgGH2VnPo2bv1sbkoVysEmH9HBOVLg+i8YpwguZMTwRhFCp\nE7RTWNZmiTLVlciw64YxHjxcsnOXUJTHU1PRrAqt5kzElRSaT79QXQwL7KCJ\nwx8RxbPn1egFTL76b5kKBvF09QoixduPC9O84WBPGSV+LYzch/qqACFOgntf\ncg2X6nvDHozPKVfrJ98yyZi5OzKaYpkTl33SM+2QWqSnvjH4csj1D122GX8O\nuARyRuv23ALc0HqLd3vuTtQ8EZS5FJlmCSyOS5rsKHfMZfiHtKB2+Bvml+/V\n0l6ov/hfiNdipYFKvgFQGtY23qqSVeKPXoidhpfKEKvMIZt9c4S5rdz1ILAv\nMzCXUy9lUPxRYAD3s1/JtY2mX3YMzebfxZMT8oSntSDcLj0Tr3RfLGpFB9YP\nElC59YVPawsZZwsVGoBEgXqfKhtoyI8YyVm5DGWdN9+ZUmo4FwcijDzFjiNm\nR+FMnTLpw7u30Fd6FkXjRPQ7dbHfZESDJejEGjhjeFRWexdhVeWwLs8buyWa\nB5+M2ADcfAMFKa/fgn/k5oOqKOWbACsmz2BoDuOjHlD0lwjJPernAeLuC7fK\nsp3o\r\n=RPse\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0f580e5a24a97033b15508eb23aab4fc593bc8aa","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-19T13:00:26.938Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.19","@balena/jellyfish-environment":"^6.0.10","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.11","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.19","@types/uuid":"^8.3.4","lint-staged":"^12.1.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.25-renovate-internal-non-major-0f580e5a24a97033b15508eb23aab4fc593bc8aa_1642597396304_0.009883715298452111","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.25":{"name":"@balena/jellyfish-metrics","version":"2.0.25","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.25","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"da4db7acf41cac65d7c2c49005740bd459fd41df","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.25.tgz","fileCount":16,"integrity":"sha512-U9dMfN5O1YJrga0CxNUe1T/enthxZxDyGtQMmCcKXFcs2CugD3OoNYxI7zea47iX0hdvgZ1H/iF1JvsnuN7Owg==","signatures":[{"sig":"MEQCIGoaaX13aqQEeaZ5e862sPuE0AzQ42AfDirt6T+J4PWUAiBivPxuaGtMJ1Qoeu+ccCqhI8Hwc8m/45kmssPGywzl9g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":146251,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6AzSCRA9TVsSAnZWagAA50IP/2HNzB4bL7MFhhMX5Rb3\nasWnxQzQl3s2s10I+yjijjYeUuK7zGEhe6gQVK/vZaFNAnOW0tPysbjlS526\n2SmRSA3OzjMj8tzXZ/eFwxlCsJm28QPlcXCEmubkn2DJ/bEPx6ts3i5NAVsV\nbdYr6PpdiRvW/y3K4uMNtTIohcNkCOTmWq/xaPY4ndiRpqGmZuWZhCehxGwv\ns/ZFw4P2HjLdYwJi+9CDpJaA8jDY+nqF4pAVfpun5RFT/59OTby7jmiK8qeS\nRQ54YVYljQU8edJOlpkYEAh5h909VCCj82Gt6CrHGqQElSBshG+yf73tQwKw\nBG3cKer9nk35T6BSGdS+rxkHmYwOUDCoDSP935taybj0Z1vzGaPlWta3BUGk\nvOFkBICI9qHUBAPOZZsDjuewqNkwp6HIFYEDQjKpxHs/+y/IEfOPCVTNQlWf\nFJLqNbhk+bnGC7oODmO2cO9xGgVF0VOX6Smt4NsJy2a+7ZAzu4IZei4URP0Z\nktn2TskvsbkjkDwCGEdH6uyP75IBvN4E4Ruv4CfvY3r9210psiqUGXiF4S4b\nM7lDTWrz36XBwYDMN7VrIYRlnEFQ8x8IdLwA8fkOiEo0KswioXljwoyfKoqf\nsbRe4R7QyoOZiHAvVrbMp35c5MUSRzHMQ2zyptETexcU6K4UJj6narcJ7paz\np3nO\r\n=yeGj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2e14862ec7ab14a08ac4f31006103c4905e0519d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-19T13:04:25.574Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.19","@balena/jellyfish-environment":"^6.0.10","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.11","typescript":"^4.5.4","@types/jest":"^27.4.0","@types/node":"^16.11.19","@types/uuid":"^8.3.4","lint-staged":"^12.1.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.25_1642597586155_0.3103948523019784","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.26-renovate-external-non-major-6bb3fd3678a56df57d07e9b4de45cb1691914008":{"name":"@balena/jellyfish-metrics","version":"2.0.26-renovate-external-non-major-6bb3fd3678a56df57d07e9b4de45cb1691914008","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.26-renovate-external-non-major-6bb3fd3678a56df57d07e9b4de45cb1691914008","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"02eb1fb4b5f9af1dabb195ffabfba19ce39d44dc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.26-renovate-external-non-major-6bb3fd3678a56df57d07e9b4de45cb1691914008.tgz","fileCount":16,"integrity":"sha512-VL3nOoK6LKXYJqFKaZA8KWNn3BOiAfGNzF3rKXbk0c/6drFzt3A2NtzBBDOYGYAlQfvetcjkf5vbBcuLX91S4A==","signatures":[{"sig":"MEUCICD9UZAnFS4KEPshfqzSyFte0YZg3sxVLRSMfTSlMwgKAiEA4DBxoueZE5odezwF5Z2BRjhcoLlGOgnR39BpiQovEbw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":146395,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh60q3CRA9TVsSAnZWagAA9yYP/0r1M/CijvU/mL7QJ7Cq\nkLeaEumkEZ2j9GdnGsn3f/lmBSr2DXYkmuK5qM9rn3PecR6/iNTzkyQom3tw\nrYexIsnvu9RLV+63pT+8wawqP9MQqA0DIlxiUcf0C2YB+kK2XjLvoac4gh7v\nnveR/okGcIG91cAIBjMCBfx6ONgn8V+PtP4btIZIv39xcgZamXr5vrwbOdSE\n2VsSlGyp1JhC+hcoaR4lXUVFGJRS62A2eo2A8uA72gd6v0KflRSpQOyMOrC5\nae43UTtrU4YXzqmiB9BLD2RT2Bu3Dm8nqWXV2rKexuBdxiRLgnygGkm12bsf\nywRN+s9T7068xqu1j5TiaRW1KzCshLbpoq0jlzE5slHoKuvKG3PxoRGNlD7A\n+ublC9MkpHiPKPny3N4wh0h1vL+MHX5Pjg37G39YNuNaw9hoVwRBW2MMHRox\n9Hxg69mqD1OJHK2XsDq4zlPCbVCfzDP6qks1P+dQw8OGj6lFtK8HUsWtI67A\nGfGd3BLz2zqSNmi3meEgjepGCbna9Vbne3xKlqoH+Scrf/FUvQIFm6u4H6sh\nKW+Mero2ZSaJfho9Jy/WfxSZ4BjTtwB/+nZPxdPpsF2o0YuL7C/UrIYpdbk3\nPv5XK6EQm4Nt3ewD9zrgtz+TUWTnNFFW9eoqGO6VDn9e4cxwByb1CZaX0KKt\nOWn+\r\n=R8ta\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6bb3fd3678a56df57d07e9b4de45cb1691914008","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-22T00:04:41.946Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.19","@balena/jellyfish-environment":"^6.0.10","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.11","typescript":"^4.5.5","@types/jest":"^27.4.0","@types/node":"^16.11.21","@types/uuid":"^8.3.4","lint-staged":"^12.2.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.26-renovate-external-non-major-6bb3fd3678a56df57d07e9b4de45cb1691914008_1642810038923_0.3695876039838957","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.26":{"name":"@balena/jellyfish-metrics","version":"2.0.26","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.26","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"265041cdd8c74f89a54fc6180858d715f782edfa","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.26.tgz","fileCount":16,"integrity":"sha512-S+VtAHIeZe7OERqL7HzAQ0KJEun4bSuUYQVzQfEu5FO5DUBAMNzDPl5p/csAnfvyuKq2fsu8MBFlzXX6G2rWpw==","signatures":[{"sig":"MEUCIQDZMrUX65IugXnPal5zQU/uhmoZ0NpYxflen2Cv7+g80gIgKADVkUu5NR39d0N0QO+HeK9rZNvRs6K+mrm6P28r93o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":146326,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh60t2CRA9TVsSAnZWagAAMtsQAJ/ug6w3dtPKzIjx/90x\n/uJzxCkfIbQ2gxm8Gsak9x6QAjztfawktywhgUii5EWRaVIjzZxLW2z5Hh2l\nQaYiyfoljiik/oHQB9TTEDQv7lis7mcgWmRNV5rJlljxn77LFj4ZiCgqlPoa\n+One1W2s/37k3BrBpqLXWrvshFISUiG0PXZ5QiHQMLhnTtSKv9fKrGNU2TA1\nvVntKr24SXm3rY7hYVT2OFebJJdW55RmWDsklQ+04gMK+GZQOwSidzzcMgaG\ngpdk986PDtbFKLNjKlCVa886OSooe+H/54mWnCcfj2F9hKN8t3mioBIG2w7y\nzly/Y+p+7Qaimfg+B7bLCdegZqRZp9eeWwhi3MLerXweT9qNyUjJ+sepTgWU\nt/xETGyLabHxK59xygPJpFkmv48rF4lvTroGvFu18GeSfKtgNrk2ScKKfFaO\nIFb/zPMhizlIOjbHwpQt/r3SOpAyeWd7fiutuyBiWQt8Otvd2wZ1oQuZXEgu\nkJdQe6U7OdJ7x7KzOiYnHjmXrzNhfptAZbu1HFPkFmStEfiKi+dvsb6UumaU\n7B3/uQ+yTnopRxjNZSGoJgeJc+yRMJkwR1TXMz+sOg1oXW3d2DHoRK/MTGXK\nx2fh3TSImFi30Uq79i+bruPByo4yYCKxWbkyGnwfN++Zj8skECkdZmiJJc6o\nmHFc\r\n=8BHX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"fa8075c2975a526ac1e45053da2662c80dff77ab","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-22T00:08:42.259Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.19","@balena/jellyfish-environment":"^6.0.10","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.11","typescript":"^4.5.5","@types/jest":"^27.4.0","@types/node":"^16.11.21","@types/uuid":"^8.3.4","lint-staged":"^12.2.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.26_1642810230487_0.8246184671171464","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.27-renovate-internal-non-major-db687e9e638af21be01a0f4f2ba53ae449a0461e":{"name":"@balena/jellyfish-metrics","version":"2.0.27-renovate-internal-non-major-db687e9e638af21be01a0f4f2ba53ae449a0461e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.27-renovate-internal-non-major-db687e9e638af21be01a0f4f2ba53ae449a0461e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"864b77c76ed3c2a4c8678518dad2bb8543a5bca8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.27-renovate-internal-non-major-db687e9e638af21be01a0f4f2ba53ae449a0461e.tgz","fileCount":16,"integrity":"sha512-GLc556kXB2obJEZTn4KiuxwoHsBl24PM5JaOdHTmvrdqEVyWkbIZ1i0N8Ea/mTy1Ef2AyWz2HWvIqvjVFjMElA==","signatures":[{"sig":"MEUCIQDlvqZ7fspl6kqcniRsoOTRSxr+NrXEyS66qQEH5kDN1gIgX5VvR4tcpYsUpHCh2XeNIFMNURKMg3aFR7+APmHqq3U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":146470,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh62MJCRA9TVsSAnZWagAAC2IP/ivahXOiJZRCIxmpvk11\nJiHwHrxJNHaSbEEXWysnY1toilGv/neYsAtwSWhytax759xz/ZYNUNN3Eogw\n2hbsBZ0hRFcolm4c0tAebI/bS1BvTD0WAgEDNhK6Su8ufai333QaAPUl9hDm\nWH7OmdMIzIMJD8qK0dBMS4Hnzai/D9ktXQGw09gz2wwmMiuKbmBeudhkc+BP\nKwJE6l/KCb9upQcRUQ5YhR66ILuK23AaDSQPI3DkD14zEd4/yq53GMohCKEE\nx7GPGU4Oy7A6gZOjX7TQIH9DUiyM+kFeYwgbXbmw2NKRya5UDxs4p7ORLQG5\nikPIxM9fBCoud2Ecf/3vFLCje6yKZ6ReII3+Ld0WiQI8HQgfgeLKo5R048DU\nAL9aa7AEt67ZX/yhjfl510iajcI/a2/ORrMA7RMaqpnbWRqutEgG0Zr4rSBk\nqzGwZ1IUMKqCZ/N+d8lPRTdJGjUzc4xzdd7t3ZySjSyRkrce1WF69eS4VeR3\nMWCBBVQ3muRJfCWFOBIm2TUiOIEoomeMUrnEbMP29neHTSxBx6pgHiRBvneQ\nSuN033cRKxxH5ma91ZL9xTIokZwO3/OSqt3YVsyDkwEqfxGRNFACeAvI1jYF\nx5SQgAtq8cvJtfCnmEALknapRst/4PjOkmjADFNiwaBUkxihtHTCQGVb8Q7W\nCFeX\r\n=X0Ag\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"db687e9e638af21be01a0f4f2ba53ae449a0461e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-22T01:48:02.173Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.21","@balena/jellyfish-environment":"^6.0.11","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.11","typescript":"^4.5.5","@types/jest":"^27.4.0","@types/node":"^16.11.21","@types/uuid":"^8.3.4","lint-staged":"^12.2.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.27-renovate-internal-non-major-db687e9e638af21be01a0f4f2ba53ae449a0461e_1642816265108_0.28024647686028015","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.27":{"name":"@balena/jellyfish-metrics","version":"2.0.27","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.27","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"acc8ca65e9c6dbeb777ea1beefc4ffd77044e898","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.27.tgz","fileCount":16,"integrity":"sha512-W6IqEQz2quxyIW6PGdsOLFpo0SeFizeBuLAi+eElt5kM2bRjDbfxY+GxkvqgDS4XVGoIsbDW57qYEOZsQOOsqg==","signatures":[{"sig":"MEYCIQCo4039YuN0g8CmsnPg0QZ8wFkek4KFcfsc3xfd2sXkTQIhAOptgfwq/4KogyVSM8VNNEJ2iTUwN2iKVCTp64t3EpS4","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":146401,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh62PjCRA9TVsSAnZWagAA7qwP/0NBnKcvLCJjqx1hYiFK\nsju/VN3WF9X8uNboPkBLqMzBECSmcfM07RmDiQU2KU8x4xmG8oTsdIuSwGAF\nix9eOXfTUxU3UFCXAHTr7xpb4fFmDld3VCpetDKOf5K/BAob7RE0YZI7iPwJ\nfFwhVdnbEVu4glByR3D4jNYC/cA61k3QZIwMYa/IJaH298cH7WGlIRlcLJ6l\nadVn1Eog1H3MjI2aG4umPjH5+XOYSRZNyq5puhzA6SZ6RIQ/ZBS2TPF2ecED\n2WqGj8I/jt/tznkg6vEidA8JeUlnfWklBPWcIXzqqM5OKBYNvitMCjvV4Ujl\n4DRV9XFE95xBDVRXzcaRSx3doX2iGfILpSlY6JaDifxfcdAg1iFKGq1s29Tn\nB6cFpyYthyWwGfPfUfyWs+8+oYWV9BW4KrvbrQhYH7Op3P1DqZxHAUwW97pS\neV+bBkZlLkWZmlWbNcllI7J4f8PzyjDX0/DsfTY/KH7aoUN5lGpVcpauLEgz\noxn8tBoyhezCGorQE6BKr70N4JnA8+WrWNJdYHz+9XhICamjnteDbRFe/Q9f\n1hiXlpWwkmP758a6YrQ80UVylAWgZ+L3uLmOqJaTo4LsQ4YaKdUWDmyL6TJm\nYby4lU4yOLEhMiSt1ra36ykfOyqoxHBr/xinWMZpvPRem+LbizA296Ca1hYr\nwH+o\r\n=sTa4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"693534633e250695fc37c0dabe5987bcc5a63518","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-22T01:52:32.129Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.21","@balena/jellyfish-environment":"^6.0.11","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.11","typescript":"^4.5.5","@types/jest":"^27.4.0","@types/node":"^16.11.21","@types/uuid":"^8.3.4","lint-staged":"^12.2.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.27_1642816482932_0.18223332178492546","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.28-renovate-internal-non-major-a6cd3722b65e0070fff5d78d5e07cfc81d70e203":{"name":"@balena/jellyfish-metrics","version":"2.0.28-renovate-internal-non-major-a6cd3722b65e0070fff5d78d5e07cfc81d70e203","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.28-renovate-internal-non-major-a6cd3722b65e0070fff5d78d5e07cfc81d70e203","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c557f1318922f1573c415b83dcfcf4bdccecfa12","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.28-renovate-internal-non-major-a6cd3722b65e0070fff5d78d5e07cfc81d70e203.tgz","fileCount":16,"integrity":"sha512-6i3mWWQlAH1mGqTeQpQHfkNjA352+c+OYXdNFM7HU6Rqrt3NIHQ4pdV5zwUVaj/LHwlNR0k5gIGJnsuHXNQT+A==","signatures":[{"sig":"MEYCIQCCsy+tL5H5LDnBDpgFLZUVyPD9gZMh4DtgvAXwKorfmAIhAI9uU1S0mykfTixHaBUULoEdJfeZ9XJhI/FYim2yQVe7","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":146573,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh65VZCRA9TVsSAnZWagAArg0P/00gAN+KwKMimGpx5WzO\nyBPOq0F1XWiznImQscEA05jvMqEujyC9R9hC71eljBxV/fcod57htMqbhAsw\nD7Wtgb5mflqPtmfEH2RwbQSHOaetsZOfVPoJIBGgVmmt+0p9l/xGax+Y+h0W\nJc8OpliX/tIJZPjWU1WxbyVy/heaWfBbqtXys+7DbS2o/BDqft2VPSj05/kt\nGpYOnijw6fk9uDxr/JqVuSvNilqY47O4uccEi2BcAC19B59GK/IkgBO98PSt\nzvKyGOefTEtRo1wzQcTP06S1W4Y7doUEJg0Kr9GzXrMXHmRn+NasmDccS2oA\n7vPrs4H4WWK+hcX4RR0zSAcLXblNf/DsZOq9mJwumLy3yLmVV1966ZZCjTTJ\nTcCum44yn64vohYcrcEPFXa7eSluvZMy/mGJa90680ZLRK8mjvD+WIq8Y6gE\nfK5G1GsSIf5xugFc4meawqEJouIjbZw1nqOJ97v2NzoUFw8A1KdieYvYtPGo\nO2j7Qu7EfAmmm1ER8oKq5o7NTAwFXgujhyJ08N6G/FOffVpV7BW9yH9zPyw4\n6ElTJDdiZpiH1SO7+1z7o/Om5FtCowQBlGHYHiszv3C0to1JKWPQd7yDgTUH\n/w/jjr//nYPn7IlEJ8tRUD1WZ6ymDXx75Xj4sIRCghJhF+LacIzB8B6sXLBx\nc8tg\r\n=mKZI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a6cd3722b65e0070fff5d78d5e07cfc81d70e203","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-22T05:23:29.468Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.22","@balena/jellyfish-environment":"^6.0.11","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.11","typescript":"^4.5.5","@types/jest":"^27.4.0","@types/node":"^16.11.21","@types/uuid":"^8.3.4","lint-staged":"^12.2.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.28-renovate-internal-non-major-a6cd3722b65e0070fff5d78d5e07cfc81d70e203_1642829145324_0.7763248158337586","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.28":{"name":"@balena/jellyfish-metrics","version":"2.0.28","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.28","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8cb964eaa8132f49376e6fd66b8635e53aeb541d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.28.tgz","fileCount":16,"integrity":"sha512-1NmsmvKaCxeiwqjSpi2UP3Mgftfo7WP+I/tN4/mi1iBBS1EfQxe5XTdM73UNcAa/K/TIwK46LPcoIaBnvqsHNw==","signatures":[{"sig":"MEQCIGP67u5RQ/3+DmzduSE3dHM1CQXV+qhBUEfLDyrZBTlnAiBd7xLv508qwOXrJ67FXoWD8vw2Ok+JZDWwb/75wmjTow==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":146504,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh65Y7CRA9TVsSAnZWagAAvf4QAJTD5PNhIqan2BQ7XCXL\n9Pcb4BtQmcjdIRlwFWJQGntqZvq7VEDyIU7bGubDMF79PyslGaXCIvbHuVkR\nVN6lR7R/Hayo/N2khaaAUHT77LxkarWmlY+DJvqaGCRU3OxW4B5D34pDWEZr\nr9gpBgB6knT2T2Hy+XuGMFUFU9VEs/AjTqg9/pCbtrsouvzVK20eHqFbvbuR\nyHg8PQKLNhMHITQ89VGP7hC3XF2fEMEYJOLQbcdliqACN6HxOYEOtLdG41U4\nlyiuth+EeOAKwVcQ8zs/0t8UMYFmgMUPE/R++712a22g94iTs8o3YAy7Ybku\nJBWJpVUOJwTkSm3kemwwAELpAVv+0pWMveKPrtNrOe7fIwW9+R6coD498fcL\ngBsDrl8PpNynGS8OKIvslVPPTY3gmdWirzT+HvpdtWGgrJyXLug1NyhPCO9N\nmUnQP6VUwsKg/BkxI417KrZ2vXryyRvjpom64XrUndO2jU9FknSWcMVcH5RE\ngX2lFPf9v0B3mhL2MVdf9b80wBGrPDxHJfMLOPiKCszrxf7L5fjNGWFNu+B2\nE4Z2/z35fU1FOaGxepVZxAySVaJPMWmCq0yV4c3xS4KgZ9L7wlwTYtLYLQ5V\nJ+eAyyRU2yh2GA0Fk1Jxcs1N/6Xxlf7ny5GwPv14WEF5qCOOWRdR9BZbwvTQ\nxhkw\r\n=5y1k\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"edf2ff48033ba1ff1f441deeede9d6de8631a156","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-22T05:27:27.048Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.22","@balena/jellyfish-environment":"^6.0.11","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.11","typescript":"^4.5.5","@types/jest":"^27.4.0","@types/node":"^16.11.21","@types/uuid":"^8.3.4","lint-staged":"^12.2.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.28_1642829371088_0.7456531182790167","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.29-renovate-external-non-major-08e3c755196811aa690090e470e9f4840fb22995":{"name":"@balena/jellyfish-metrics","version":"2.0.29-renovate-external-non-major-08e3c755196811aa690090e470e9f4840fb22995","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.29-renovate-external-non-major-08e3c755196811aa690090e470e9f4840fb22995","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"55757f77bac6d2aaec3f621f065eb935b454cc3a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.29-renovate-external-non-major-08e3c755196811aa690090e470e9f4840fb22995.tgz","fileCount":16,"integrity":"sha512-Uo3yA2GULXH9EJLA4ScyaYNbCghZ8ZVCojyV6qnLpag+IG90Gql7PKtWTB8a5zFWrb4fKKJZvPYgaa9G82hjRw==","signatures":[{"sig":"MEQCIBKdtPhUfJYuBWVRhTJMYbwejKPNs/EGufDFMGL/4QCWAiAtFBYA9m/leuIyiFMWd2VsKcCSb2l4uq+XZ/mNWhTITg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":146663,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh7UNgCRA9TVsSAnZWagAAfYUP/RRKAmH/djhVKq7NWc2q\nhPrJNdDCDYYUk+1XrdFDuLkNzLeOZByarQgD+8hR7iN7RTe4Dllu9Sbhjlnt\nYGOPekAeBkzHcbK9mSFK9q00zROaItRQ9zTlfN9ZFlYR/8Gfyou/UnGgK2nk\ntcurstWBByDlVrL6nbPzoP1TGwlUoL57ct5EglQttuGa7TdUMKjxsVrW0M0o\nSYceTCO5Ss+beXGaMonHTpL1WsbGoZ9v/HVP4Pb/WpJQmGz4z8WGAQxHJrrP\nPTKSyd9nYUSiVT9JMCF8JIsPYDeT7hX2GuLWvH8q/zNJ839aPEq44EuY6jeW\nOQ66KTnBaLkOSR7Qbs9IgWkPwxSiatSnfoyimfm/5mVcTIn2cbxKQK2nbouu\n7QjWsQcOJa6T4HOr+bReykB92OeSbjfUFwLW4zqAPQJz9O8LbcWY2BcCNNhH\nSEA62e7dJo+rfHMhhG0gaY4kbQ2eKSOkfBhDCEeIuEZ5aL+i0DwWNJOQ6gPS\nqtX0HEG8rQuUbd7bt060AtGvoFUegeWYP2Kfioj3tyzudg5WENYmNcy/2ydP\nJTJ88rzRuAWRSc6vBJ+VcC5Xjd67KjVRKaZUBSX6YsV/h+7p7ykThcxmNASm\nx3pve0lML5JJ7ps/Y3ShHp/EqwbYmcoEe/CMXtDmaVdZtz/5DECd7ZZPZCbU\nCxib\r\n=AMbN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"08e3c755196811aa690090e470e9f4840fb22995","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-23T11:57:16.177Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.22","@balena/jellyfish-environment":"^6.0.11","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.11","typescript":"^4.5.5","@types/jest":"^27.4.0","@types/node":"^16.11.21","@types/uuid":"^8.3.4","lint-staged":"^12.3.0","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.29-renovate-external-non-major-08e3c755196811aa690090e470e9f4840fb22995_1642939231993_0.11868154703171196","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.29":{"name":"@balena/jellyfish-metrics","version":"2.0.29","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.29","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e2c7b2a88b628282e9d3a7c26cfdd94a0b78d315","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.29.tgz","fileCount":16,"integrity":"sha512-a5+o1a96iDYUME2i9V60MGMhKvD8YewBMTHhdDjuqxc+tDVlpv72H7GD7/E4xR3h/tiYi4tGT791qt0WAeP03Q==","signatures":[{"sig":"MEUCIQCHmOYQzRnHJzFkNWjKeaw6X6bNYQ5Ca0OFw5+pEhWFGgIgbJ1ySEFtOvPYLLHuUsvFBXxAqd9T2Hjosm4ZYlCk8JI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":146594,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh7UQdCRA9TVsSAnZWagAAyfUQAILX8JKbCU18sFinM8Pj\n3O6mXwaVjlH5Mrx1cJ/bkXrRsCGnaXGaB23vU+gFOiHbU/1jdVSwAL76+kX8\nmsNhMg3uymkc/iYRS9HYJ4D9gYbiTvhcpRPMqBtOhUMjy4JXtgNIgukO8mRs\nad6FUX1jSJtuk/LgSAmVv04NkuTYef8aX7duz5qUNkbgTdSjlN/888sV5WwC\nkvzQgzPqB7cPUhXXF8/2auJHkLZ9fPMLgY1rNcyoFc//brXChkFqxLV/W9Nv\nTd3Iq4WQKx2yUnaicL2R2BMulIXaV4lZLYLNeUzPctBEAuA7eWypsB+4Q+6h\nLLRQJlPye1eH7Ga71GqfxokKkEPRQtWrTDl7eI2j0Xm/jqO9rPCwPjxf6Dsn\nmmOba2wWoSpUEO0EbYwcjkqrSLPXCPFPq/W3wVwlMY/kG5WEwFxzLH1FvG8/\ndmmAj3seiJiGioeOWJzdKAmdTqU8TZzU/vW/Hy8+0Zaxttf8kW9QuJR+e6KB\n2WT23tPTIJeKH/3R2dg37QiPeuCngw2QGGcD3x+r/pkk2kMAK3ScIRrQhZ2V\ndvgbLd0vXLKjVaaACz5YjVR6JcGfy3mD/Xc9Tvd5FsuyefxsQrti3lZx+r8q\nuEyNewBHoPuMDXeXW2+8E0EdrCoS87WdUqSJd1A37Ykfy99JpzU6DC9LljJb\nM5lf\r\n=iW4e\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"263d085514418da37dec9c777a18db8503779ee7","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-23T12:01:38.189Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.22","@balena/jellyfish-environment":"^6.0.11","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.11","typescript":"^4.5.5","@types/jest":"^27.4.0","@types/node":"^16.11.21","@types/uuid":"^8.3.4","lint-staged":"^12.3.0","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.29_1642939420869_0.23746181499870533","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.30-renovate-internal-non-major-b3f533a55c8422da9cfc2b04ba17ec51440df9f3":{"name":"@balena/jellyfish-metrics","version":"2.0.30-renovate-internal-non-major-b3f533a55c8422da9cfc2b04ba17ec51440df9f3","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.30-renovate-internal-non-major-b3f533a55c8422da9cfc2b04ba17ec51440df9f3","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"222dcecacd724af99a63c1ff1457b9466f37587e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.30-renovate-internal-non-major-b3f533a55c8422da9cfc2b04ba17ec51440df9f3.tgz","fileCount":16,"integrity":"sha512-4pfV8NkP5QAT/VDOB4jBhbYPgUXKZO04FjUc/FLWP30boqm1uN3mTuEGQOGoTUwAMmnnBnuYlH/59Eaffs2NRw==","signatures":[{"sig":"MEUCIHd5LBGbEs40GvG+h0Sfo/JuKlntlABpVZ9/xGW1O5CJAiEAxCaXQY1dr+Pz9kYbGplolPZclTcuUxOGD3/Vt72y1HI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":146771,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh7UURCRA9TVsSAnZWagAAfLQP/2o5Cj6J4LNUUas+9mfQ\nMgVQaM5YnXHbCrf/CgTj3o6owhtWfvJcjOxorOao0t4gG5ujjSXqdrn8XlD9\n7/QYNQoCAYqdxbOe+bQ4tbK8fOI5PO7le1xRbX77IOqNyA99wyYYHOwXmiCA\nU/XgwGwhLo/470je7MkYe0pK03AdZdgE6lOdm4m4bPFslsgfFmwlHTTRcoMw\nkt4RW2eSf66ssu93F9UBFE4/7/mw0i499thN3clEEKuQg/ujaUWnfN5C34sB\nKhXWNMyVOKV4jqXOeirGcEFqVUIras9yz365vR67fH4wqKv5gaEqa0V6JRoB\ngBRNZL5FPBYOSVeUe6W8kCFJWjqyFO40CZOo9qhvIHTUpNxWbXmeqPZDtjq/\nbXKljQxjwKpHo0x8tSBf8ahMec0Edpet56eUcau27QvlO6CDVaw9nzj67ELL\nx+18RoWTR6cYvpJl8to+i+wWmQzDTRFAdMaCPhhMxqf5YUOfR4ePdguThEOe\n1psMZz7Cnao5hnYm0s1rghzbVytySEdQPrV6QI5O5smewSuPld9ydKyYsZJC\nBkGr0pmQWwHFxlDeGzb+7W5RgOJ06g5SJFSWiiXPZcSbsvfVjfVLFqzYJJ+/\n+AVAmFpRqxwiyTX2ArwDRsU2FnqMwTZ06FbU7fse0e21lerWTePBe+4sovfy\nIvAD\r\n=/snP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b3f533a55c8422da9cfc2b04ba17ec51440df9f3","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-23T12:04:35.586Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.22","@balena/jellyfish-environment":"^6.0.12","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.11","typescript":"^4.5.5","@types/jest":"^27.4.0","@types/node":"^16.11.21","@types/uuid":"^8.3.4","lint-staged":"^12.3.0","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.30-renovate-internal-non-major-b3f533a55c8422da9cfc2b04ba17ec51440df9f3_1642939665103_0.7575906640759889","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.30":{"name":"@balena/jellyfish-metrics","version":"2.0.30","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.30","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d6806c51a7cc60658ea15f0580b9fcf14958b31a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.30.tgz","fileCount":16,"integrity":"sha512-DOXlfunqu6r6UvQBLcIiKPKjypBrc1ltGAuUVzMRxk/53GlKLHnvmEaTgquuf7ZAcgwFelllfmfyKoi1lsVCxw==","signatures":[{"sig":"MEYCIQCki/dEILXZg78nAcIAm2YRA5U1SnAlkS1aKBZ48rgcCwIhAJ644Q5M3hR1+8m//3XYE50F09qVKL/xc1hdmBdu6XiA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":146702,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh7UXUCRA9TVsSAnZWagAA2jYP/R9P2tFetF08+1FPEzZP\nWEJ0kQj5BK7CYsMFPW6yqOVNkJRPRLKCvucAG52b1fxd57I6T7xyS5XqeUm4\n4+iOEesmbW4akNr8dxsDcfSEbNUC5V3WEbdswA0h9bNf26hJUYYGP5WCWbB7\nkZ+XSRCgHvnOrgX4nCaHDQJMKXWIaSnmC7v0wGoKfdGYX0Jb6DsDEqiyYFOA\nFJnA0IKnDg0PkH1ijRn9yE6a3f/P6AY7GW2t7LeCLqKqxgh/0HErRFaIrplk\nZSecAVkUIp7/vXPAVElNTWmHT1qENXpd3kryfxFVK3GxZCgaYaUqVQ2NNgbF\npj97lq8AuBb4BNMA1NrZOwq1/clO93yzdHroMiXZKIPVaIEj/mNaF7vOEUhz\n6oQM3HW2Sn+5Msp605I1oQVmuPcGO6cakUkeILc6d7NNnVbutUEFcYm5jKOi\nMmXA/cdlXLMs7HMpiSsk5/8Vg5KIRnmCg9RA1juUBWWaFIwf4VrZ5zhqE9Ii\np4oHguJMrKh8R1JEgqM6fXL06gKAmBpCJaMr/y4KzFlExQlXoqLCWpUa95/Z\nFoTtUrC/ERMAuoEjc2SR9ifezVYLneyIRHozRtxVN4jWsQsp08OA/uVk5q72\nevXTIaggcK9wOfvBRc7MhiX/KHm95IbAGLOifSS8ctXEzWb10ba9kP5Sb7ZG\n00g2\r\n=7rBQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d7de1d0c86b20cd0ec78bb602ea39025c4aed72e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-23T12:08:52.788Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.22","@balena/jellyfish-environment":"^6.0.12","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.11","typescript":"^4.5.5","@types/jest":"^27.4.0","@types/node":"^16.11.21","@types/uuid":"^8.3.4","lint-staged":"^12.3.0","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.30_1642939860013_0.7859068368715549","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.31-renovate-external-non-major-46610a05039e192fb7a1ff3f93f6919e0f2ee427":{"name":"@balena/jellyfish-metrics","version":"2.0.31-renovate-external-non-major-46610a05039e192fb7a1ff3f93f6919e0f2ee427","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.31-renovate-external-non-major-46610a05039e192fb7a1ff3f93f6919e0f2ee427","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"48ebe24b50f47407600f5a3cbe653eb88768f643","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.31-renovate-external-non-major-46610a05039e192fb7a1ff3f93f6919e0f2ee427.tgz","fileCount":16,"integrity":"sha512-4UI508lSiqlQtXwG50P3v3AvNfXJGEbPtw5HoocdWlFS+cN0kU+4o5tR85ZMSGkPNIMZUgNczd6Q2Zpw7x4kVA==","signatures":[{"sig":"MEQCIHOjgOntOiBE2Bk5Qbx5uSUJvbfK2QY4OkjaLGw8gmZGAiBNPHrHNfl2rVfbFpWcH5YfYp8r2o3vfIunpfjNKw7dkQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":146861,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh7XV9CRA9TVsSAnZWagAAF9UP/1T4pG0L+2q7RYqUq/6P\nbdtP7fiw8vHH6BH3HxsjQQunxG1XzYhSfN8EvwTi4WLHDa59lI7FA7OeZuEl\nznMGpfQEzrSKzx+j4R66b1MtX81k0smXfI96h/IK4lnu5fq0oIDYdb/3mKX4\nU8UPVxeYyUqfi3+3vLXhUSUUTRfkBV+2VaIAoTIRs2mSaTS0W6/Ol5/krXAt\nSnk/q+1YazXYPgVSHgD5CgzSp/y/WPophcvllAygYkxnrySZRh0qErp2yMTM\nt7v8umr0618VkN0+m3fJwJmLeEXrzMlRtWo5tFIkw4FYkR1LcIliIoXveb+B\naF1cDCBzW1DhYSz1OJOjbAhkWZ3CkNhzOFEnWFGptIBfFbCxNw+1PECSEIL7\n9wvHWS+NO3Pc/brLaiHnfHYGEWYNGDFTNueXtyogXG5bxW/vJeUtyIdM9VQt\n8BsQF+Vxf59UlnxTiv7K9js8ZvVZ3X6e3fE0tDLikrysUxMLgnNSmCgT8gSF\njUEKpthwoL9rXeuOdQ3oGpyK0PXRLn1flXoGABIClq3yW7BeSegoloznkHZM\nKTmxPximQ4PtwC9wYrkUFBa3JwpraGzwC4ELzaJjeYMIg9DvC9JTKQoAq2Rd\n5CKhYnbkgxwl23m7+TGHJHfTrBeLlBeJGkWcAD4gxzDTbsxPkh9y7IwNzm9u\nxIG8\r\n=bdS3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"46610a05039e192fb7a1ff3f93f6919e0f2ee427","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-23T15:31:04.839Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.22","@balena/jellyfish-environment":"^6.0.12","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.11","typescript":"^4.5.5","@types/jest":"^27.4.0","@types/node":"^16.11.21","@types/uuid":"^8.3.4","lint-staged":"^12.3.1","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.31-renovate-external-non-major-46610a05039e192fb7a1ff3f93f6919e0f2ee427_1642952061604_0.9533709128209964","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.31":{"name":"@balena/jellyfish-metrics","version":"2.0.31","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.31","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d005c5c596b4b2508986a902f5d1a77b36177029","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.31.tgz","fileCount":16,"integrity":"sha512-pWNUWY6udSVJo8VFWLvRNR9Okkwhg3qyEMXo1KdErqljQ0vMiFPbnbqCepW2lp0M1Q/PkwGk03wY74rVC/45EQ==","signatures":[{"sig":"MEUCIE4AnGZU0GNzraS5d6xHDP+4hE5f0VV4wxssIhxopkMhAiEAkTKc2jcYaYr1rpICTd3CglvuqWJ6BSDvp7vVKsFTpN0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":146792,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh7XZeCRA9TVsSAnZWagAAWo0P/2LfKXgphsF8ywwx99qH\nqrhzLK0dOQ4VCa8J/X+YmoCjYREjnuB3GXs4vk5dWpiKg4qYnapn57hoRnO3\nkF9P20CDVBaylOK6c/MRj7nh9E8/WsQ94oS+lHz2DJu8eJ/nPmD+j4JhIQUa\nAtRxJDztFHGYBCgkmJ11fIoJjvwaf/iDwXHKfz9yUhd3prIOsG+fV/H8WON/\nE4NHByRuwZBa8ln2bhDnZEqjIS9L1hQ3EneNcxKV9siWHDZ+uQ0brdfnBBmf\nFijEBBMfmLFKXMav2X04jvNQ/8EkOqPoQqJ0hZrlg9Hea0beHEel8GA3tyMo\ncLy2Nbrr2Vb112tnnzJ+V1LzLcRiyUKi92zE5rcAjjfriMQsfmVK/tAiNi90\nqRh97+T8t6lYCwNL6dPmpsawsYuv+Pfo9gEZ2hQ93El/XXfHsVWCYmh53PcD\nFgNHUC5NZyAq69UMNb6cpoEG+6+fbeKuzNknH6G/erYCr6fwtHzCl8Bnloz1\nxOJhV8gLyiZjWeQ9+/dqR+JXhgmnFDyTLS53SI8iSjhQYWuVklPIzg0IvT1S\nnO3EFq7Z5YS/6xO5uL+u4HliPDXZtneOQrcwhPrZzRuqlZ1h3ZUmVHgi2Q7C\nnwA7qhKkypfC+3ZrF53xpxeTMOlwB81KJDpPwgceQlxmQHdlyBB3PT6FB2NL\nF61Y\r\n=/2Bm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"baca31e824cef1a172e6f255df3b4c26a54791ac","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-23T15:36:08.658Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.22","@balena/jellyfish-environment":"^6.0.12","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.11","typescript":"^4.5.5","@types/jest":"^27.4.0","@types/node":"^16.11.21","@types/uuid":"^8.3.4","lint-staged":"^12.3.1","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.31_1642952286458_0.7254197066435806","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.31-renovate-internal-non-major-43dafa81baab1fe5ba5b50046c9cbcef1f1ef1bc":{"name":"@balena/jellyfish-metrics","version":"2.0.31-renovate-internal-non-major-43dafa81baab1fe5ba5b50046c9cbcef1f1ef1bc","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.31-renovate-internal-non-major-43dafa81baab1fe5ba5b50046c9cbcef1f1ef1bc","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4e3858943f94611427bd10dc01a27fac11f3eb4b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.31-renovate-internal-non-major-43dafa81baab1fe5ba5b50046c9cbcef1f1ef1bc.tgz","fileCount":16,"integrity":"sha512-iwc2wMR1FERt5VgMcuODD7t+hPAvk43rr2bDyDIJ4JAEwTc2kIO5IXpHrTgugbBVDpSAIBcgTTMFD4lD1K9+xg==","signatures":[{"sig":"MEYCIQC/lE1R9Gks/iaL3NVLCwlYxz/kRfzQyYgjmxmVqVf1pQIhAJ4WL3f64WxazDYvLi2hgHntKbpRrz5SUSjJyEwS9QOV","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":146939,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh7XbbCRA9TVsSAnZWagAAwo4P/jhD4YMUmO/NtULUZgkQ\ntbBl83oCF80iwT1T8UpESb/cmqxTk+JVoqoPCFqRS6Ny5f/5tPtsPNjcKBRP\nVdg2vA4chPNF4eyUjVvTk76p3c/m2DnciJWl1tu1gpUHe2XMZiI0JEv0EjJU\nZTx3/7rsEoakyeAXjAvyMYWXYg+8w0cxEIdDhnImUtkBsHHkaFQ7Vqi5Oirs\nhG9XXibxP1j0JRSdcFdRifdX3EXlP2urkITUWS0+1ABn7xlqrQsEexYckHPJ\nq8zHDIzAQgGnTLUYJjWH9Py/tt3CsqpkIuxEcRSEXJ7oD6OJ1lRC4+X75N/T\nVu/drr5f3q2Ftnm0gIRDXiJdjVJDaxpcW8E+pg5rEZ9XuasaaOysqTFaphbl\nEor6WdtwdKCuXbLGbZnQJH6jQoto0Qgqg76/U2pnjZnOXQ12OlnSaK4iCGvv\nKreCPGZ/6xrVl/uZa0b8+MMS8gGtYvhSGtJLZ8TwjpzBM3LQHCB570G0cLNd\nDE4WZ7AuWU1f35eKGNc81pfkINyuSnSj1JzAKS2UztB74GsCjgkI7MYoIG0S\npXTwUlQxPFzl65RvmNoe2DZUAMgUtV9aXuXvypTHjIP7hXpu+xl7yvrykFKK\nuZvbljO5NQXeY8xUWe94Dzy7jiCYmylqFvg713G89gQCFJCTE+IHMOXxsaeK\nq6an\r\n=eKbD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"43dafa81baab1fe5ba5b50046c9cbcef1f1ef1bc","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-23T15:37:17.741Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.25","@balena/jellyfish-environment":"^6.0.12","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.11","typescript":"^4.5.5","@types/jest":"^27.4.0","@types/node":"^16.11.21","@types/uuid":"^8.3.4","lint-staged":"^12.3.1","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.31-renovate-internal-non-major-43dafa81baab1fe5ba5b50046c9cbcef1f1ef1bc_1642952411410_0.66811181897743","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.32-renovate-internal-non-major-7db8462019203e7c04e53f90dc27e525fa7f3ba0":{"name":"@balena/jellyfish-metrics","version":"2.0.32-renovate-internal-non-major-7db8462019203e7c04e53f90dc27e525fa7f3ba0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.32-renovate-internal-non-major-7db8462019203e7c04e53f90dc27e525fa7f3ba0","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cccb09670ef45597b2f78d872fa31209db2627d2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.32-renovate-internal-non-major-7db8462019203e7c04e53f90dc27e525fa7f3ba0.tgz","fileCount":16,"integrity":"sha512-sxpXNeGIVr+nXdxUDWlBxjnr0vvacgPjPX4XxYxIwBUNd/I0i/FcoyiEWz9LRxtWN6n+zgrEE2jutwyFedkICg==","signatures":[{"sig":"MEQCIEW5wtn0PgNBoKW+gLKX/UTxEJArFZSen61LRjK+ayqdAiAIIah5SxrzIZM7mNGx7VsQXa3EwEi9akeKC99qE5iqaQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":146964,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh7XdlCRA9TVsSAnZWagAAF8AQAICPvRmtY72BUt/Yd9zS\n/js6W8+hM3QN7XZVdSOWPvUpdz5Pd7uvzZPiN9m2nUdee3VpBZLY74+1vKTI\n4XTTfyGvu2ivVGj1V54HKcZ6mufG6txDfxzU1cpEHPj3QieOKH4zR16/FhwS\ne9NiMf77QdUF6wgi9b11drDL4Wv+BQ4NwpTeV/lfXXbNh4NQRiQY7ZhB8tME\nWWwFvbfDiEr81xsmGFP1VHZPVkPfNLMPovt6lcnBpndTMLiODTp9vJbTEBnf\nGNuCFMozwjbAv7wfFWYQT1WcAhUgFT8JJ9hUK+IP0qGbeFWTDqRrQ6enxLsF\nWDWD47LSYOqSfUjI+p2x6KmTz1TB9TfRhdPMYBzHcOW3CCi+RxgxJn9MTJzU\n8XhQILlwQlZd3l2CmV8U1HEGn50vIO5fTYXxRZZlay7kf7yiBcvNUxJbA7/F\nGKeX7TuF/rO+l/6C4AwXO+S+9UdTlryg3zMyol3+ez34sl1RGKMOqu+sDqok\nfaF3J2v1N8135KV+qFSs8h3+9SeiMZffYcL0nyhuMQTN9JqkBQktJRFiWkxk\n4NO0OOODxebNWB6JnY6G7agbuFgSx2bXCXZ1sG1vQf6G+nEgVMQuMWnG0NWJ\nYVYk/nN3LKXHfD/W0FeKZdBpSDi4rthLzEKKnnjurSWAxIsD1cGzB5g1VT36\nW3nw\r\n=OxtA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7db8462019203e7c04e53f90dc27e525fa7f3ba0","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-23T15:39:57.599Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.25","@balena/jellyfish-environment":"^6.0.12","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.11","typescript":"^4.5.5","@types/jest":"^27.4.0","@types/node":"^16.11.21","@types/uuid":"^8.3.4","lint-staged":"^12.3.1","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.32-renovate-internal-non-major-7db8462019203e7c04e53f90dc27e525fa7f3ba0_1642952549755_0.8138192529214754","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.32":{"name":"@balena/jellyfish-metrics","version":"2.0.32","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.32","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"165886b21a7667ef53d524749048995376dabe8e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.32.tgz","fileCount":16,"integrity":"sha512-xV83uEU1lBPc9rJlRiGU/0gP2iLLS8gwape/zJ0xTiCCiGKjLcx8yD3aAgWKV34WDj/FPZEaiPkznqVAcXflOg==","signatures":[{"sig":"MEQCIBnfLP9iDoHLOMclhQp7861Gad5KG+9Xl0BnGroGk1lJAiB2wBSszedVN/bl1i0roMofZUckTaTq0n2kpjcAH2KCTg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":146895,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh7XiBCRA9TVsSAnZWagAAX0kP/jF8bGai4hXB01JbldAu\n2AbfFYGCruSPEuwXQRYgFYAe5upVGVAOIky8RHqDpDGb3jjLhVr3IeO2YUEg\nYVnTSVvsQ1OAlSnXX1t0qTYpkBbx/LPmqYiodMpdxfMGoOju+sJVkZ7rWptp\n/YEScJpLBGuHds7EQedWKpgkCwS55rISMuEflkoL4iF/UYPZW1ah6q+LFAoe\n/lMKS2+mwfkLnND6ytEsGw6IuB1fmz//hFryssAUi6wHJ77tr4rtOWLoKVs2\nAixejs4jcLU8BJpNw8Nl3a1gY2/+8Ha+rKDMa66y8R6nnrcQq8wgGs3wZ5Th\nJ4SMHwuQf3aWNIohS76KWbZYl9vYaBwiY3qreDMepgJisVuGRRc2zvK2hO3S\n+htXC4Kl+06AnD4cfzotQfLvASzukaqLVTfSScrYKNeYhdKD3FcugZ6+MNM+\n7wjiz1OmMp/FJMTz7nLy6SvrzfVjMAobYs2TFG+VxT+ZObiT9xvkY20a/RE8\nQxnY6qJAUB7ZsmyZ2gv8dpnQO0WBSatbpPXCT98FS4Rl8a8sILpR23trVybO\njOJJNTgBk9zZ+E+6Uv6xDVyWJKj3vpylHmVF+mNIGIXPaGLgGPhyOTjJDNZD\nSflp9YTSvjbPlKDPDCy4seGL7w9xxyDTLIVpeZ8LAI9tOjgjpOfcS4D80hlG\nowp3\r\n=cXqR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e0da01602de208b1f4ba35ec1e51825cbeb49a76","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-23T15:44:37.900Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.25","@balena/jellyfish-environment":"^6.0.12","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.11","typescript":"^4.5.5","@types/jest":"^27.4.0","@types/node":"^16.11.21","@types/uuid":"^8.3.4","lint-staged":"^12.3.1","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.32_1642952833138_0.9465518341192596","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.33-renovate-internal-non-major-494de0f2831adea9aae762a406b542ad99c68559":{"name":"@balena/jellyfish-metrics","version":"2.0.33-renovate-internal-non-major-494de0f2831adea9aae762a406b542ad99c68559","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.33-renovate-internal-non-major-494de0f2831adea9aae762a406b542ad99c68559","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"577d15937700e9d53547b13a7de5bdf8cd7d50a9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.33-renovate-internal-non-major-494de0f2831adea9aae762a406b542ad99c68559.tgz","fileCount":16,"integrity":"sha512-hTIAIOmr4RSOmxCwz7Tu7MO975AH+eeXcTGKAVDMLpggPU9F4R0NfQrMKB1c9nghnqBcPtvUmSUMpWX9THdVLQ==","signatures":[{"sig":"MEQCIFD2vM+x2MUrVEc9d4uiI1U9W52CmwyctlBAS5JSX+3sAiBflELio7Dlpc+P674LKCQpQbhsdRL82fa21n7EREm5DA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":147067,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh7bMVCRA9TVsSAnZWagAAG9gQAICadd2KFrQE1GpUXP+Y\ndhq5ai8ZgHVo2XASPyS2ZcSl3kc5ApiK5Kf/VI+wSn6e94OqmhSIutleKsYV\nTPKTm88cdw9DMdLI7in7ogH86hSXA2T4fhWp2f/2ZNbwahApAaLGJ6swefTj\nyDmFEyva0nrm2ePL893gZgc+C7e3ud3z8LSRTaAw71E7rdjRY7A4fyDqXri6\nbKppvZqXpphGzxUfC5A8P/VZfbYH1ucL+UMpa0IMsqo42wYeIcfTR+amqxLa\n5xF9vxtww1kQIPk+SbFfQdbCVDWpwgA/nKYlU3yotmYhdY3zdFCzapJs425Z\nbgRc1cOv6rs/7utVjCW32Vu2rgoEYdL3axnOHkvdAyetR2IhT1mziFWlfVCB\nrgUgnjtWTYvMymRUpgfzFZxTwk6Ha8osyWNFias44leeD6XLYk2Hkvyj5q6N\n1X9Q8fqZXzULF6dbzBc3x4/MtEkePqnSLpa8zm1g/PO4bLFvC993OdYe8LxO\n0eY42tBXOvktc2TrrRHBTDudddcijspjCgP3jp1jGcoaBrZAXbfknZXpNm48\nLX5kD7q7ev/xqJhuHZU0G+cAsN1NjY3STz49cDkGv6PAHaRX7wO/hvbBUm8c\n5gvAOxiWJXa4eASYCQHs6P1GGIz5oxInrjK0eGBbEzqvaH1Xp7vmfSCexlUB\no6He\r\n=B0c0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"494de0f2831adea9aae762a406b542ad99c68559","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-23T19:54:52.310Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.26","@balena/jellyfish-environment":"^6.0.12","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.11","typescript":"^4.5.5","@types/jest":"^27.4.0","@types/node":"^16.11.21","@types/uuid":"^8.3.4","lint-staged":"^12.3.1","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.33-renovate-internal-non-major-494de0f2831adea9aae762a406b542ad99c68559_1642967829684_0.3205506260953159","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.33":{"name":"@balena/jellyfish-metrics","version":"2.0.33","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.33","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cf037e6fe2a97eadac19e36a2f4434ab43bd4512","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.33.tgz","fileCount":16,"integrity":"sha512-FJsSrXDqTxY1Ss5tPogg3FCjny0j9H3RhEGoOShvTSrm0ZRhlcyhLH/1NAhJ6FWptcNASVVrzn0CcsQhPrVZ4w==","signatures":[{"sig":"MEUCIQDfkp1FXzCev2/q4k9KYaQuksqTHKY96es3Tua5DcfycAIgFSFfEmpyOtNhbJRKI6xFaaS/kTsrHAoTR73As/TzrRc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":146998,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh7bPICRA9TVsSAnZWagAAKG8P/3OITBXlCtt1BUbtPvzb\njKoOoVAxJ0OuL3s3p782vsarQTqHYSmAlLg/lO3URkUNxo0QzAIuH8arDJhT\nFbztNLE8mu4c3kfurDc1CVA1iJfR3oNi1v+rltFSFZRRgzMIffbEYm6Dwuqy\nj6PVult/uKcv4QUsS5FBHYJzb9KZ71dKBFFY9MTLz3fRDeZITMl34YHIiAWI\n61CIo14S5ltE+Z0Iw6Gh9u3yGOMERIL4K0/9svqVIry269PCTLJlsZfW3q53\nqyJqN5qsksEDi3FD76D71Kt9kojW1/dHAqXIXmohgqYDFGRWasA0PBVBNTd+\nYwMkNEvqo3EcQURjaydFaUjTFODucm4zfo7m+n41pGeIvRCKTXN1/ARLE5Ms\nhVL4WH40xAy7xGOm8gGMHLGZXqhayp2NopRMLyusFLiaFEBP3kmlYNBjnEq0\njOM5CtW0/lKiFb3UNJFHBIiSDlHT7zzUFqPUiDL7Ui0blTUMtX5JgofKnT6j\n8BVHfr1UxiVid6SbUAZ3hfy7r2ujEl6nYlApbbQ6yhZCY3GQSgmehk2fXVEl\nUItmALV6qmfkAlHGoDCN01hTu2x4JM+I/8xtwrPYzcm2xFNVg4hPvmG/3Jfv\n8inVI3pX9VrM9NkZevwJfqUY1bxilyGOjfP7141cJ1Zf2tXBotshSuKdEi9b\nLwFY\r\n=slCz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"cd71254b86f67157b52ddae4aca4879119bd008c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-23T19:58:07.160Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.26","@balena/jellyfish-environment":"^6.0.12","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.11","typescript":"^4.5.5","@types/jest":"^27.4.0","@types/node":"^16.11.21","@types/uuid":"^8.3.4","lint-staged":"^12.3.1","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.33_1642968008547_0.5276982628750968","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.34-renovate-internal-non-major-a7f547c75d0dc626be8f8ecb8855b73e36ad08d4":{"name":"@balena/jellyfish-metrics","version":"2.0.34-renovate-internal-non-major-a7f547c75d0dc626be8f8ecb8855b73e36ad08d4","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.34-renovate-internal-non-major-a7f547c75d0dc626be8f8ecb8855b73e36ad08d4","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b8df69039253fab0aa5668079187228bd09f5739","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.34-renovate-internal-non-major-a7f547c75d0dc626be8f8ecb8855b73e36ad08d4.tgz","fileCount":16,"integrity":"sha512-im+YCwLNFwi/Hkg2F4zChUeoIlf2B57wB/lpKkCzb0B7NcMhkfvXQBH1B6gJ+fSIgDUSYjnLMZ8Uaot1uTdDYg==","signatures":[{"sig":"MEQCICBkTqKqA5483a6DITCNvm/6PI1msHQPDVywCMtzouPfAiB0DDR20Jy3KpwqkOzvfYt2OCcHMyQETZ95uw6pZzHnDg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":147175,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh7ramCRA9TVsSAnZWagAAEPIP/3RJXX1OTPyfRoXx+fDW\n9MJgCEOZlTv6R8UPmTOfaHDyUUDRT4ppo2M8cwDEqlgXqpXbJkgYlXSFEYB8\n6Ccic1rzRu7KXZd1is9w80jPuOuUpCTxiCrRw0i+3e2rStLp7hMaZQdDrWnT\nz2YtSrIOqrOl+Y5CsC9U7kMFdBOgZ6cnfddeKAwPJXYCINRCFQ7ICAj6AEpx\nWXJGBprORsOUg/q64ky7RtPZh9l1ermwsFXGYWrS0SIACVoQ1Rx5m4IEP7pS\nApiAl9phx9bdW905q9vW7oimaMGbTnRjDHpEkxHxACS8WmtAySwEnxQxbCBE\nSkp1PJV23DcuEiuw2Isbg74xqYqc7uuUcaQpes3meNSp/gO9uAWQXEDbCk62\njg/jmyW5Cjhul7/ma2SpNKxkbZmLksYrvhnXetW1HSEAy+7t1/4U2OSOhG3L\ngqR9yRoiIWcjHMmYqari6fR70u9mxzHS9J7EFmEMuwi2QvtPWMo9wXgWKZEn\nwsYzl5WvMcz/iKWrvLBMwwULeaSqzWtPZfTbEAOBn2sfE93Fh7ANuOX0dsMc\n8xf+R3LnZRNSc0ySrtR90ITkQuiu/AbFvBon5foh6WT33A+hAWVuUDalXdrC\nYPziDHzkgmyK4JDn3uhaxcr0aIm3Qd1GpqPysn+XECblxwJ01e4DpdpdYGIU\n950/\r\n=vGpT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a7f547c75d0dc626be8f8ecb8855b73e36ad08d4","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-24T14:21:15.530Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.26","@balena/jellyfish-environment":"^6.0.13","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.11","typescript":"^4.5.5","@types/jest":"^27.4.0","@types/node":"^16.11.21","@types/uuid":"^8.3.4","lint-staged":"^12.3.1","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.34-renovate-internal-non-major-a7f547c75d0dc626be8f8ecb8855b73e36ad08d4_1643034277979_0.4205453200850351","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.34":{"name":"@balena/jellyfish-metrics","version":"2.0.34","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.34","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"361aeb77e58f413548db70fb07b2feb1d22d8cc1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.34.tgz","fileCount":16,"integrity":"sha512-Cz3RbImoH6r3eqsvVakACaM/c3Z8OEgAuJf+19g6zcfaLJ2vTv6MRH1J0jFFWXVXYK3EYM4AF+v7t3sclqRF+Q==","signatures":[{"sig":"MEUCIQDyGDX2swjdG+8zR0OecNkArWx3tJrs6LoUkFtLqe575gIgRWkKyWDeFWkYcOpehu5mO80dEwJnZhhKpKN81XUf5Do=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":147106,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh7reSCRA9TVsSAnZWagAA6ycP/3qWHM0XizXZIPjD7JD4\nGaIXmh2HGLq8pMfiXtUSzy/0j8f9SGcdfhHqOneuSK0izRrICDDsiXrzqjZ5\nZS8uKdWouPCYdcXf7a9Zbc/xyHUFO5ay+rj+YqGWYYypF3+0rv2T30ril5lY\nLWxzLhD8xpuurNToOAJQ/sveyWSTMnRb2Tnst6VW16/JDU2Y4Fx9a941MFXS\nfFwERrfrDmu7eOcpBOAi9ai6b35ysVXzgGgOkYAL5PSAtINm75NJfVpPCUty\naIoDOnQET05TfiLAAl4UbgXAkQTq+mU2BL9UBoRA8p06swpUcz/y3//8vpfN\nIpl4s+VPEO7hGk6ZaTctsudtxuokfklcf82W60X79xzq87fYWuVaHVCry3te\ndzaEQe96TZPzHZ2xfhNutdoKIEWZlFbDaWloksliMPDPl+BrG/IKktC6q7mC\nc/u6l2BPNG+W7C04soIpfAG6QW7pvAGYEfYuCiwVNr7P9140TyBIeqof7+H1\nZlgLd9URdDOiSILRQPv4/xcsWcAyUolimaS1AUyd1CZGE8n3fjCJPLx3DDn5\n2s/5OW5kIgc8db+RFEifktmOjXXn6NnLJXnuEMTFo33rv/fgme9ByEBjy3Bo\nPm5YVsGLZ1xKeHusSjxj2EB4GwiOFTflusbZsSgtrWsfjIRDe/0/JMTPGH34\nk8nk\r\n=L5Ic\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"29b6c9b2f11ad14e85a4529f899ae4fcc22f26a3","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-24T14:26:26.205Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.26","@balena/jellyfish-environment":"^6.0.13","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.11","typescript":"^4.5.5","@types/jest":"^27.4.0","@types/node":"^16.11.21","@types/uuid":"^8.3.4","lint-staged":"^12.3.1","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.34_1643034514628_0.01979445173739114","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.35-renovate-internal-non-major-45c0c90cf3c0c72a9c3a97e3e96412b20f5d8127":{"name":"@balena/jellyfish-metrics","version":"2.0.35-renovate-internal-non-major-45c0c90cf3c0c72a9c3a97e3e96412b20f5d8127","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.35-renovate-internal-non-major-45c0c90cf3c0c72a9c3a97e3e96412b20f5d8127","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d4c29c3dc4a9ef23491221edde30b3fdf95e0138","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.35-renovate-internal-non-major-45c0c90cf3c0c72a9c3a97e3e96412b20f5d8127.tgz","fileCount":16,"integrity":"sha512-c6gx/sgBIfMoywXW83AL/1E6CbpZYNPjyCvS5C3yl5ZVroUYPcRefluHiTFjMCEILriQVCPtissvJfClS1lg3w==","signatures":[{"sig":"MEQCIEa8Vx6xvMaXLESquasMtk3XVcNxez9rM6dIUCGZnCGlAiBpOxFLOHMOwKqksygbNNkQLjPGSQAYww1Mwl0S0BPu5g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":147278,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh7teUCRA9TVsSAnZWagAAfEcP/RiN7lH9BQs6uQfdupr0\nPwe5WHblCW1nXQIZYTTFe54v/xDMlL3z1eSXaVMl/6nT07eYZWvL+/wEk0nL\nFMYhY9px9K2lnJ5Q/SCBK4ZG66E9f3IBDJQCZPHy24+lghi70MbT+yy0GKa2\ncD09U+VAYuaVAjUWwm5jzC3CM6vWbXo8VpHHWu80b5lmaWUHtWb3nahCS717\nJfx/WvOqmDgvBbwbUQGTWoWAq07mQffO+96LBlJ4FdGJhjQmd/8djJSZsUXz\nPP+gQyPsU3aGUY+ioSbuY3VLS9OZlvot5ADksZdRaM5To5M+0pxXngFK7LCY\nJIHlEW0oIppe+oPLrB+HxQtlFTCE3IcKivkLB2Wj9y9IwbURtSDjwWCJjnYO\nPO1rCVhNtoNgM3YWZM9Qlkpz8z6XQKDaQYmm4Zoa8ujP4rosd1AygdeHcwP6\nORArFU336wP1l7aaUxcbxG/McO3hoBtSkXHq1/oBLrJrCXnc3EoXfDZg/BwI\n+Ch9/jMtZxPqeKodXgqwz9xCxt75TYFrA4l5ytnmNrtMPJbc96TeaQIQXV+D\nGy3ruIo3KzXu8MWcnoUMHu/CZ+5p4GdfPNQMH0FZN8YN8SHr9SWrH41fAqia\n0K3CLlva2qceSq1bFv5nAuTbCRSJNdLHc/0LpcFVlMjmdAPKgEQcsegSblrx\nzcCn\r\n=N4Bf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"45c0c90cf3c0c72a9c3a97e3e96412b20f5d8127","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-24T16:42:03.175Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.27","@balena/jellyfish-environment":"^6.0.13","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.11","typescript":"^4.5.5","@types/jest":"^27.4.0","@types/node":"^16.11.21","@types/uuid":"^8.3.4","lint-staged":"^12.3.1","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.35-renovate-internal-non-major-45c0c90cf3c0c72a9c3a97e3e96412b20f5d8127_1643042707734_0.47449951304601967","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.35":{"name":"@balena/jellyfish-metrics","version":"2.0.35","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.35","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"06c2d64118e7691d958dfb5a327e86371c2b0e58","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.35.tgz","fileCount":16,"integrity":"sha512-9dXJAJa8cBmF7DVXSgNlxbrbtUPw1vEpZDeUywGjGZUsTYD5htlXlwh3ociVnvIA6lTKMpi3e2Aspk401LFrtw==","signatures":[{"sig":"MEUCIHfyathTZzsAH3zTHw5K5hhjrwM4lDvbCg24YuhgzEvkAiEAi+/JmCWF63ot8YWWBhPfHap1Z106bcyMrDKUhuTKxVQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":147209,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh7thTCRA9TVsSAnZWagAAtHkP/iEI9cZ1rbr36HF1nqIf\nyeA6Icavr8NLiVkT8WItiBoJAYES0vMsc1VGO5GaArlnDt5O5SFse/+uQrZ5\ndouJe0woWnp2NRkbuK1ngOLROx+XJI4PK4HiZAUzPFcMrFBOizroaJy6Bfhd\ncqIolG4nlC5iEWGJ+WZ81rKmrAJRyOqqNiHBRvGpUVdIzkDRVrHc4ujFKhh0\nsDyz9pLscofSD0o9FO9Jj2Pr6j79Czj6VrNPmHFe4HoLDiCZERiDnao98ASH\n7wwxc3Uz5H6BmMDngs0WFzxJ4i8iVt+2NmVPWDExo24m2N3pRrKoe8CWuQ0t\nLEBu3UPUD2u0SXbZZhOC6fMPS8whsjF+yq19hZgrygxa0Z5lpE7OkIqlH1fF\nObf0cfD8IClN4KW6i6yKLDpDORLn7o5HFsFGQF3oTbkUkekYy3FmCUCL+U/1\ny1N8tkUzPVFh3ApLeT+EYvfXgiOIOBDtXS+zv75xJXqZ+ELtHu6MrZz65KCs\nXL519D5DUFHiS8DA7EkBevj5LYRXlxBWICnZl7lHnb3Jlc8DPWnAyVk2056k\nVWMomgrVgZ26NL/8ZyKQXbNSIdGJMMO7o5QPeUAFwgUVm6FoSDvsboNIwnPo\nVZ++nzEmvj1XAFAl6i+5QI+sjbw7WNBFMRhowXq2MU9TYAjQ4X2Ugwhh8JYA\nmfAv\r\n=Aysw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"be39c1ad6f94730f7f14559b21cce771f07b3b31","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-24T16:46:20.366Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.27","@balena/jellyfish-environment":"^6.0.13","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.11","typescript":"^4.5.5","@types/jest":"^27.4.0","@types/node":"^16.11.21","@types/uuid":"^8.3.4","lint-staged":"^12.3.1","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.35_1643042898968_0.7126132542399455","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.36-renovate-external-non-major-5c97d9b0bb2698645fbfa2b6d0f81f0af5d1d9b8":{"name":"@balena/jellyfish-metrics","version":"2.0.36-renovate-external-non-major-5c97d9b0bb2698645fbfa2b6d0f81f0af5d1d9b8","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.36-renovate-external-non-major-5c97d9b0bb2698645fbfa2b6d0f81f0af5d1d9b8","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2a71593301a317a941ac09939212adc1047a1a77","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.36-renovate-external-non-major-5c97d9b0bb2698645fbfa2b6d0f81f0af5d1d9b8.tgz","fileCount":16,"integrity":"sha512-Vmk0K8pDvV3/mv+g8pMt6kIzK4b79Xh1HRIrCQr6g2SAg/ksKLrXTZ+yygGy3HhTdCFIcpjgmutBMv5ppVOc+g==","signatures":[{"sig":"MEUCIGPLkoTrUBLmbB40E2f/JrNKDK/hizTSd1ETMrSlDaPwAiEA8yoBvKag8CC+tCAG5KB3EsUJ/brtN/j7sZmAZqBmvrU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":147367,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh9KMaCRA9TVsSAnZWagAALeIP/jBvVMtUoZ7mvkVSgKBd\njLXL9UtEepIlUrUfYyGyhvhkIk2nmaRo5/RIUQo1b6O6KPpNw0s1WFyorESA\nRN+ewGswYBImEwA6lRUisnK0GCDVKPp7NT/km5Dc3hvaeazH7PDnQz/JLo2D\nWA5gYV+AjVHgNkKcl0cA4a8I/wUJl7Z5UY85idmYOUMtA7AbIV8QEvEjAo0R\nWL/rOjoleJZs6xMXxidK/6eZ56KFLdmJQLftqSqwfawb5qK14Lyva/mhvd7w\nLhkS2Xqr4DjJ9b2ca6VTQZFyI5kpwx8D2HG6I7L2jBeE1EwaxuexSIvIRgPQ\n5i54U8Zmot1uVHWzYmMYFVirPU4Yd7QUt7RJV0qf2c2f57VGdyG7cicNwo6R\n/IjKu4LpKKydQL9Jnh1Q/rot6kNWOVBa41/iCzJhX12gXRnq1jDgxgIvEaw5\n6iDzo8TKZN1SoD1UmYn2Mda84eMplKbGi2njUnkreTLwtRXCFIvlaHGHDVig\nihvEiCpH58f9mo6kQPbF2jgAlfitFnUvSen/6Ml32PanCkcX81Woeg7cwwW6\nmoDPdcnWoEFobUsim1vEh3gkPH9F6OEayz24T+hgop58Rqf/2w09/GRPmohI\n9TOynf5mrwCndxXTMlnZuS8hLP9GrfIigIY8jnkKqeCWYdTOkWAsMeMuyqRx\n25us\r\n=tCiH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5c97d9b0bb2698645fbfa2b6d0f81f0af5d1d9b8","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-29T02:11:56.270Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.27","@balena/jellyfish-environment":"^6.0.13","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.11","typescript":"^4.5.5","@types/jest":"^27.4.0","@types/node":"^16.11.21","@types/uuid":"^8.3.4","lint-staged":"^12.3.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.36-renovate-external-non-major-5c97d9b0bb2698645fbfa2b6d0f81f0af5d1d9b8_1643422490251_0.9161396393870378","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.36":{"name":"@balena/jellyfish-metrics","version":"2.0.36","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.36","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a167c543d1855032332a59df9f49f870d175f466","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.36.tgz","fileCount":16,"integrity":"sha512-8jSEznxFzPFiBUbdhm++EmOLNKnX/vhKo+axXdPV/ValqFtMT3wHEZ79u6umSwQHPerhiV3FF6EBNxYJUSbRhA==","signatures":[{"sig":"MEQCICmw/lbWcou0+Rzzn7b+pmuZ5TD+L/2M7jmPzmEJZnqfAiA8qEavz2Lv+NzGZSSlbgzHG6cnyvD1hkiX/EyU+5+hLA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":147298,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh9KQOCRA9TVsSAnZWagAAyt8P/jzKwOGYEYzeSsBXubxu\nEekvCfYirVusUKUiH8xCewLZoq9YDMJwIqugpKFGeFIIynx1wMgApCVIfwOe\no2EjOPlpEo4SadNsXMiiXE7L0LMmv55FY8eUg4ysBYcpDUpP8hOe+C4fJBd2\nbaAr57WGRh8/eZq0+gdrzb7QCjuwAJ7fL9yzdfZmqBKax7Vn057npOlI4eoN\nInPooiTOJENI9oY9qESoLKNvMTAVJSs6cv07/uJZL3JOKxyxTiYYB3qf/WeZ\njCZx66ivNjaBP/XK21ElTXp8NxQgzFDWgdi+hjdKBv8YpC7CZgyEUE7KkXLX\nVjJSMT/xQGQoWkUvzGYUcU3gyhjuycnTWhN6SWtejuucxha51Av51hFrgelr\nKXRINCyS0zu5DCO8Po7Ae9OI5j1yjyEqRHKU+JEPojHHcn9HHdRwMHmCFwWQ\nNS9r1igysM1qoumLspsjJfoPhhGHybVz9Km3FPgrA8vqjOeg6WoGO2LkjFkM\neIFqsRR7rl1ztLUBVDROxKusCN94vbBSmJqZtiWhZE7R+2PZL3Sz8gFR/FeW\nL5TnsTfrc6gJupSJBzTc49qOQiFTT3c/WxOiQiHfoeWrOVoz5haO6YpfJ3fI\nwnBM1H33bIt9t0bV6JRFVk5BPiCqn93eMvpNcEuBA0lFEosT/2MbadkK1kiE\n3jnb\r\n=dy/z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"30ff9fd0048f16177b99cebbf11ae338ad6a191d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-29T02:16:50.117Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.27","@balena/jellyfish-environment":"^6.0.13","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.11","typescript":"^4.5.5","@types/jest":"^27.4.0","@types/node":"^16.11.21","@types/uuid":"^8.3.4","lint-staged":"^12.3.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.36_1643422734478_0.5738750840947333","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.37-renovate-internal-patch-d2a6671cf532f6e0ceb5e2f54042585815e8ddd0":{"name":"@balena/jellyfish-metrics","version":"2.0.37-renovate-internal-patch-d2a6671cf532f6e0ceb5e2f54042585815e8ddd0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.37-renovate-internal-patch-d2a6671cf532f6e0ceb5e2f54042585815e8ddd0","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f20c2f8756a3b4b20d9ff0021e52bf5ce5fab351","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.37-renovate-internal-patch-d2a6671cf532f6e0ceb5e2f54042585815e8ddd0.tgz","fileCount":16,"integrity":"sha512-005Xco3VtbryultXjX8qqp/zt2DhDm+xroq1EIQu8jhQVsV+00rO1pJKj33ZeuZPGehXYPH/+2uZRt2QTYG4zA==","signatures":[{"sig":"MEQCIEf2sxGqcZHMTZhGCxIHYDCmtjbcKp8rBJq7U2dLJG7PAiAuu6Xpm+x6YqYL0Zn1Q8nEZKYYTZU0FO6/795gsxFjrA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":147448,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh9MosCRA9TVsSAnZWagAAw9AP+wYjZXwtDIg9Hl0CnxpN\nlrK05eGWfKVO9gypsCgwmDKS9/DCUy+qgUSS+6/Fz5907ZovCL59kzhuvDoQ\nKiywizGW9oO+9E5jAm78XOA0QLqyczhG1sJkB2eFscpFCcjeEfZV6oY/U0ep\nZbe6fysvkRfYK8G/4Sot2OVLDiAzgopom8djyB9o8gm8lsNuRoLtArSRFlkP\n+6949w9FO+82jXiaeFojKwaHbvu15sWnLEpb/sXLdaCBJaS2PBqIewH6/XEZ\nbynPk1QVdSA3dv2fe8lBgIg9pxGpidH6Dw60W8EhCp6Dh2oUr4gU3MZyO1gv\njPmZ4K8auRz3XSapxkZDOjWoyj9lXEKi5j3M1A5u60sawX5sOfHGZMBEGjKs\nVPmeetZbxwIfjdkm1Ub7o7jwsq6DTmsNGy59jlScNyiRwTnEhnke7OZdHONe\n5TMVNk/pwXJONHfnBh6NWcSr0PcgM0vucapKzv4ltgCJA+T9PpJxVI1HS62b\n6bV2IFLkFpXp8i8LRJbmODXxp5Pghi5KZX3cWQEqDYnlaWCGnnXSbFOdCEO5\nDUPh5v22XfLKnf4Sk0fZhZ8s+55VN3m+hGRZzFGku/ZNRZ3lI2QzQANR9msJ\nNp/ftmkfVBnlj/KmOmLl9aywdAogFT/Bmm5yoD+FbDQvT72HSGSwcNcrgZ/M\nfwzL\r\n=MA72\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d2a6671cf532f6e0ceb5e2f54042585815e8ddd0","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-29T04:58:56.899Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.27","@balena/jellyfish-environment":"^6.0.14","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.11","typescript":"^4.5.5","@types/jest":"^27.4.0","@types/node":"^16.11.21","@types/uuid":"^8.3.4","lint-staged":"^12.3.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.37-renovate-internal-patch-d2a6671cf532f6e0ceb5e2f54042585815e8ddd0_1643432492489_0.17531175858509362","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.37":{"name":"@balena/jellyfish-metrics","version":"2.0.37","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.37","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e7a299dc43018fb207f660af322ce81c2cae553b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.37.tgz","fileCount":16,"integrity":"sha512-WoHNuHhmB1e5zLkA6lqdnzNmDqP/RWa54WzIY284bu857d0pksczcINQaUkgvchJGNM49G1JaFk+Te0TUbTopA==","signatures":[{"sig":"MEYCIQDOYye37T6pJCo/erykgjI7TMwtLm5w1Tox9ghdkcuKpAIhAKWf+H8Oi9mGMu7fi2s6KJBxvu45UHse6qT8zIPnYogt","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":147383,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh9MstCRA9TVsSAnZWagAA/wQP/3EhvFPxsyC5Y0CjmlHM\nP2QNPSBigjnbPYGC+qrvZiyZ+9ZlR0z5MpaYjBt8ADdRgv5kUi6zLu3rs1QW\nAhDDdUcZlcwVnP4NhTcJViZMReXf2KwOfOCqSpWmPRPvudUOOu/e08js3YTJ\ndgk9I0Vz6iWeevIfLSM9sQuP/Il40vRUrfNGh7GWMHmw0hpnshWvBl2eVKXl\novrGhVXDYR5nl94nVZdXQRrV09J95WpMd/IblEjz4tLpFS9Q5bfnzJoSek+c\nhLwY9F1FOJKtH72KWty6DDGJVkaQnfmUDo8wY18e4ctk6v5CmfxDUbnnsA4z\niWsyRVr2bW4nA0f87z7dHtQzKoNK97sTBs3PUwb4vs8EEnvkVmcYrKzcagpW\nfs1m2a1SgG2O2c1xEWzU/f8OJbyz0RmKExeaffTlCfOF9PkaT9FKQzbyFFDB\nsYLIxA6ezSZIC33pafFG7wz3eL9W9uKOvBJI+9texZlkGHOuRN2QCK4zKG50\nxRXmHZyBjKx1obZSWm5h77JTmHCfWO2CBkyJQFkMiA95AZet902OGs9sJCmo\nIbFKPVbrxxBhT/N/PWBZ6r8OE1DN36LKRHayp1I6U+Z0aOfuOPCC0SDpi8IN\n8nEBnBsJDzCJwkX1erNiYyuMzmzEdKHMbQjjAmmDLkE5LRuKIdsoKMLLYbrY\nIvzg\r\n=9GWz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c03cbade38a28874019eda18aebb373ac53c65ad","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-01-29T05:03:42.076Z"},"_npmVersion":"6.14.15","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^4.0.27","@balena/jellyfish-environment":"^6.0.14","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.11","typescript":"^4.5.5","@types/jest":"^27.4.0","@types/node":"^16.11.21","@types/uuid":"^8.3.4","lint-staged":"^12.3.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.37_1643432749384_0.44036820732712556","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.38-LucianBuzzo-patch-1-8d8d75e8bd5e0a156baaff0f11fc67d496b8f385":{"name":"@balena/jellyfish-metrics","version":"2.0.38-LucianBuzzo-patch-1-8d8d75e8bd5e0a156baaff0f11fc67d496b8f385","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.38-LucianBuzzo-patch-1-8d8d75e8bd5e0a156baaff0f11fc67d496b8f385","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"dcc9a38921fa6084ad950093c5cccd7116fbc63a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.38-LucianBuzzo-patch-1-8d8d75e8bd5e0a156baaff0f11fc67d496b8f385.tgz","fileCount":16,"integrity":"sha512-1pSbg/GpYLAdn2oitf3KLkGfIEtXSU0OcDBv3hWc69BYtjahhqi5NP8xV0ki2TfEPHiUgE6BOt91hDuPNSt6tA==","signatures":[{"sig":"MEQCIDVMDGcGrCth5Mu8Wk/BUOmyf4wLEpqBUwK8reTeZ/UnAiBgaXbjsKJbdzBlfeAzStjhhY9gbM3yTNSvb5rxaB5urg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":147524,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiGO9CACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrQJw/+MDKv1RPSMO0tJgw8WtVcua7GnrfxxD15EFEWNWxdqbyDrumU\r\nfjvyyjNz2V08CQmx8c0Mv8oMDQXA8P4Y/ETdKagKXaJ6npazr0C5vTK2y3xX\r\nuAKyBNU0ucqvYPKwC3w1UTCNX0VPJ84rKMipLmoWRTVi+Whho4CPJ1PzFkIc\r\nUfCMviRAbZYBjeV1a/dup7v9Sc4nRbJQuy0MVoGi2fuXpP0kskOvEwoQdJd4\r\nNvgqLJX6mBaAvCmKJsT5Xe0f1bNmGprb1hWr+27hwuhV+svUVw3aCRNfDQ1K\r\nRIQp9X5wPYs2gxdQfLcjrffp90CfXMyY2F+FfGmyIqoWxhGytPqMBKGeU6m1\r\no2RNc2GLbfHTTljDNuv+g+xRbWZExDrTwqEARo7KShcYdYm6jWB8m8d9h9wQ\r\nXDw5M1jQyYP4axDbnHyLN1bVoHi+Li1zSvB54qZITQZSYBr8AaLOuZX6CInn\r\nVVqcgIRPFd7MvF8CFXnpmTJalnkyeah+fVIooUGGwN1pzUjevigLh5uBzauh\r\nNLQqznTieMHZmLiySXL1mkOz7CR7L0nqWzn1WmpzNVFn/LrJx2VpV0RJauKM\r\nCgcQFLunKkiDcGdwtquj92h5gCr8xdFaixw2rHFnWsVzVm+Cs0eK6aq7bj7i\r\nwQFhqXqV6Kvi+odb0wUuAsiTXssbrf4eWug=\r\n=c1kT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8d8d75e8bd5e0a156baaff0f11fc67d496b8f385","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-02-25T14:58:54.592Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^5.0.0","@balena/jellyfish-environment":"^6.0.14","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.11","typescript":"^4.5.5","@types/jest":"^27.4.0","@types/node":"^16.11.21","@types/uuid":"^8.3.4","lint-staged":"^12.3.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.38-LucianBuzzo-patch-1-8d8d75e8bd5e0a156baaff0f11fc67d496b8f385_1645801282641_0.8849936187232812","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.38":{"name":"@balena/jellyfish-metrics","version":"2.0.38","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.38","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8fdcafd7e1cb0fd083ad1d3f047c0378c5229095","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.38.tgz","fileCount":16,"integrity":"sha512-z/fuC+ZhoTxEApIKX5K4VmzY6q7rPGhsHmlvWBJlW9bBDlPwVreOOOTnSvTnYNrTieNL98EzgiczyiTk6EaWDg==","signatures":[{"sig":"MEQCIAGxGFZJx/ApLfgFh9YiNBmrSCkfOftRzXnO7GJP2/5hAiAjv5jqE8AxacJHVYDEzEfuk667na0jAqsdx/uWQD7EGw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":147463,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiGPGFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo6uA/8CWW9M5uzyIvcRescUG5SLNdmzSWorV45qpm0pkDF9XHJxUtt\r\nItVpJ/etoXjnXkcCLV+2whgSmEq/VFv/13ZctgpkRqnilZgSFUulfDR1vyl/\r\nCUYO5ynw/51C5nfSbS3ZE6bI0qSdyg6Px0EkNk7fBI8aVkPJpI0rLkUxUJLK\r\nX6XnpF+sqLLhUj1ZTMlhz6Sn7se9rrbFJK3LKC7DL3VLs3kZFETM+WkNdhOf\r\n8TFJZI+9Dm1F8lH3PTtV/fdoHPR1XXvPik5nRWJx7w7fMPltzJmlx3KLsmd8\r\nNtPA6Q4GskkcInj3cnUK5wH16gPxx4VfUW5rgdIhd87IE5ESDXLP+/X4gpiZ\r\n1wHpLkT0F/aiNrrgplme6NRe7M1/ceMjVjaaSvqEDCRIsKw7cfhi+IlyozHo\r\n+RIti8CvgY1Cm5J8RqsrwnmIOrSEe/n8LqD1xhKbO8/U8B3ZFYIRUH9lyCMV\r\nBGZm3ZfdoHwDEqWg9JES9DjhfydKvb5xsy4+RWMLUNvf+P3PPdkMDxxzLMpO\r\n5RL/16V2mqdPgHZiTrfoOQObY7WaCzdB8ktwwRDCF1dHzRE7G2Opo+C6lxlY\r\n3duTCrgOcFhqpWDZLSprvYqRjfOUqdvaIsLwYAX7QS2JvgV3u9ddzOC3BUA2\r\nWJTU4Ff0romOW4y6EX/4Hyzb+YM7R5Yah1c=\r\n=zPXX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"cba587c845a7f118fa66327de832196fcc6a90a7","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-02-25T15:08:59.495Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^5.0.0","@balena/jellyfish-environment":"^6.0.14","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.11","typescript":"^4.5.5","@types/jest":"^27.4.0","@types/node":"^16.11.21","@types/uuid":"^8.3.4","lint-staged":"^12.3.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.38_1645801861666_0.3309212230464891","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.39-renovate-balena-jellyfish-environment-9-x-50c8f284c186e4da4951825815a0e5c8ff9b2d13":{"name":"@balena/jellyfish-metrics","version":"2.0.39-renovate-balena-jellyfish-environment-9-x-50c8f284c186e4da4951825815a0e5c8ff9b2d13","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.39-renovate-balena-jellyfish-environment-9-x-50c8f284c186e4da4951825815a0e5c8ff9b2d13","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"dbb4910ca2dc128596f66a0e548ff10358a09046","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.39-renovate-balena-jellyfish-environment-9-x-50c8f284c186e4da4951825815a0e5c8ff9b2d13.tgz","fileCount":16,"integrity":"sha512-yaqG2hQLsWgDLhuUdrMdLUE3PWFELn2gI5fbUbs50I/NSgq6WzSEj2C2+Fzg3918R7FJuukRMdR7bYSr9FkjWQ==","signatures":[{"sig":"MEYCIQDszWVarsE7x/aImYSK4U9cIfbNjUv6jlN+NMzeB7HUTAIhANe1a+m4yTBYawHc+P/A0044w68DttXfu+ky3FaLwKKM","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":147645,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiGPJtACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrhaA/+OADH/sqbvcpIHe6XCLoFDiocLDwApokmhHPSzEKga3KkzPZo\r\nvaSiIJJewuXai1KgPzy5bAhtlNAWaC+60A5zemJ6N7JZoc9ysCFUBlYX0TsN\r\nD/mCUy1IuOQGJy5QEsVxayYz4HG2VZHo5eDgLL6Q4bpfE/HiGmP0eToOenG9\r\nvsVsyRHH/a+tryqDE828iHu/dFpP87y7r24Yo81MjKkAFOQGY7PdXysrABh5\r\nLku6q0i8yScZgWW99vsnk7jsukYcwVBBfZSaNjVxfdEGdDYmsMoWj8pb1zKo\r\nY+KjZGTJK3OwmKuCciY/fIPw5MJwXMtSn7jzWG7+MtwORZj6LC+oKsEnzZ6y\r\nxdOjtCaMnbczIZnIx1yNR3jo9/w+I8u9YOlndRMbuPX52tRZSTrZewWvwNTR\r\n7emEOOD+mxEFq7VoGywBHDou97BJCK6o7pK1xTYBIL4Bfot6cyzYpALq1fQj\r\nhSGg1nJXYcWo3Upu2+Kl/KhhIEV0Sz2U4vlDkJMDgDjNce0gc9ChLvMR26xj\r\nu/nWqJqzPtGymrF2jDzGgr/iLm3eqcYtzQn048F3q1iIt7eZzAP4n7Lshn4A\r\n989CQMDJqi2RTOnImjjjizu5EFR8ZZHpHy0x5H6xwuh7rJ9jKVQZY5bnFVrH\r\nxeBLRgVYb8UnzlwZ5YKrXKKGRcw3/W9SfeI=\r\n=2Sh3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"50c8f284c186e4da4951825815a0e5c8ff9b2d13","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-02-25T15:11:49.627Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^5.0.0","@balena/jellyfish-environment":"^9.1.0","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.11","typescript":"^4.5.5","@types/jest":"^27.4.0","@types/node":"^16.11.21","@types/uuid":"^8.3.4","lint-staged":"^12.3.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.39-renovate-balena-jellyfish-environment-9-x-50c8f284c186e4da4951825815a0e5c8ff9b2d13_1645802092837_0.5719454443226646","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.39-renovate-typedoc-0-x-eb16a602b168e236ff372f3a2323ed48cd9551bf":{"name":"@balena/jellyfish-metrics","version":"2.0.39-renovate-typedoc-0-x-eb16a602b168e236ff372f3a2323ed48cd9551bf","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.39-renovate-typedoc-0-x-eb16a602b168e236ff372f3a2323ed48cd9551bf","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6c2a40a88e26e05eab1f041ab66cf4fb884d347b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.39-renovate-typedoc-0-x-eb16a602b168e236ff372f3a2323ed48cd9551bf.tgz","fileCount":16,"integrity":"sha512-Cx7MqSkLqJ6MUzhelMhRve5MkJYAvMnbWpepM3eXENxL1MtqVx+5BggTR8S51aats53K7qP892Ynf+OI0EtF4w==","signatures":[{"sig":"MEQCICsKUZtRMcYk7V1uyrN0j5YsmtZv2eM+b3J8OO2AYda4AiBwiTacP56HcDvsiP3d7OPlkHufZTZ59WHOEzCuhELMIg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":147606,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiGPJ7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpiEg//eJ2EXJqGc09hV0nbkhETF3uSUDACNmna7vD29+uvx0+Vs7dT\r\noIs6pjgBmdUDNKXH21xXu5sjw0vMAM1qPrPiU1J3Kz3v6HHYYyjAZL+9vSag\r\nBHCXo6eLUz7KkOFQSHuk1eTT+0zVTrMZsQT734fsPdmVpsxQHflNpWOvqSan\r\n43gijK14j6KjSXcwajnQG8rcyLhFqWromhiLK4q1fSARcZgqUPSQ++i3d2tE\r\nzIO3IqEzC4UIR9XUhpHKIyqDg9a+WRPNX97QcEvT/kCS1uOEPRjd1QJpPG9E\r\nCfyBySHSZWImxkKEPoigXJ/6idz123dNWrvuUPLd1k2ExWX1p5YnW3UJAwMq\r\nLI2fuQ2ZRpJdMbP9wxZOuFjYrKZ1TffiR6YyOPw9dAtvbjiPZYA7Sdqv7RMV\r\nkRvkf/r/dAvGEt2m1/LfQ7Zf5YKtVtgDVtUciY5ZVOJkrxDfBRKA50Takbgw\r\nXXfyn75UhxwZJaMvlO8xmv204u8phAyZ3HkekpF2Qsi5g2W8aF8w/C4GeVfP\r\nNvg67NKYK4IIIb8E48LxIg2YagicyWPvX2yMIG5F+groP5x4NmNzbQeCfsOn\r\n3dRe1M5gC8L5+iPWt69GiCeLCLJ629MtBbOD0TQDPTgrW81CGDEsJli5eRrd\r\n3cYhbl9t3iFqiEqxZyxs++to0ym4w1Xgpgc=\r\n=iFW2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"eb16a602b168e236ff372f3a2323ed48cd9551bf","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-02-25T15:11:18.834Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^5.0.0","@balena/jellyfish-environment":"^6.0.14","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.12","typescript":"^4.5.5","@types/jest":"^27.4.0","@types/node":"^16.11.21","@types/uuid":"^8.3.4","lint-staged":"^12.3.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.39-renovate-typedoc-0-x-eb16a602b168e236ff372f3a2323ed48cd9551bf_1645802107764_0.3622631209684739","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.39-renovate-balena-jellyfish-environment-6-x-1fc68690ef422d57939fbea2dc27d3be909eebb7":{"name":"@balena/jellyfish-metrics","version":"2.0.39-renovate-balena-jellyfish-environment-6-x-1fc68690ef422d57939fbea2dc27d3be909eebb7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.39-renovate-balena-jellyfish-environment-6-x-1fc68690ef422d57939fbea2dc27d3be909eebb7","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"05aca3a5d6cfdc95b7953d32e4c0bf0147db8ef4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.39-renovate-balena-jellyfish-environment-6-x-1fc68690ef422d57939fbea2dc27d3be909eebb7.tgz","fileCount":16,"integrity":"sha512-lRZ6IN5zZrplwGep12Jl9Da8IkIm0ftNDXPSP7KBtpwsM3nuQZ/EQ64smJZ45C0t2OCU3Al+zFN8sgHzgEdgYg==","signatures":[{"sig":"MEUCIQDs33m3y6sXXrTC+V1v5xKl4XE4KS+8isC1dE1Om41d1gIgNVN+HYDGzDaacyLTEXursSOwJLhbwkI86HgY9OXD2e0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":147645,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiGPOYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmobDA//R2oCFQPh9r/3eBtjbjVKc9lr2k00Im372PEfgbY+TqQa6kZF\r\nvqKZn374AKfLnYrUJeCh+IOIMeN2K+XybzgdK+F0XnKcaT1IcOadejSlUd7Y\r\npnf/BHbmasirTyNzN65ZEi+6RRUp2JmwO6358jCzk6Qbrw3QetbKsKA+JsWI\r\nbES2rSGrW2ZDeUMYiDTJmIOdnRSEoJVJMu9uK4XS7T+rd69D8zoYTlMIItsk\r\nSd+j2FVaGskbB1z1hVx6lwHAkD8dJXm+zhjIbuGm9/yCIo4Mf7mfqTh+7+27\r\nqTnbaztPGPxMyzkr4FYYfV0O+/0k+jW7q7oeu5s02dTKpemouHTDWCB1AVoa\r\nqyyd2o+GMtvi579nxGcA8BOkRHZXrW7nMuTuPILdqpGw12xTa78NZoskH0J5\r\nGJHKXimtb1JCaCvmFfMxie0roHwYWcb8joPIDNnjS6ilNhYHdM8gXH2+ZMqK\r\ngJBQzmh2oVWo0lle6oV4/z0ipowUI+39MLtBIoLG7JflDstpo2Q8V+3I09I5\r\nEbfMiDgTFDpmwD/uGi9TrTl6DkgawwgERQhDjyUDhYtxC0oSWwboLvHpnvEw\r\nP1CacLtKn7w/n/yjUFyxGkNpWWcZKBWDSVhaXWIH4QnJG5738G88i6PH7JH1\r\nP4G1cAx73iikaGW8i2PhgvgisG85UmVcm68=\r\n=zlzJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"1fc68690ef422d57939fbea2dc27d3be909eebb7","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-02-25T15:14:54.271Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^5.0.0","@balena/jellyfish-environment":"^6.1.1","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.11","typescript":"^4.5.5","@types/jest":"^27.4.0","@types/node":"^16.11.21","@types/uuid":"^8.3.4","lint-staged":"^12.3.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.39-renovate-balena-jellyfish-environment-6-x-1fc68690ef422d57939fbea2dc27d3be909eebb7_1645802392759_0.49742781878836406","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.39":{"name":"@balena/jellyfish-metrics","version":"2.0.39","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.39","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fc210dc577ca8c50e248984abaf44c85e8521347","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.39.tgz","fileCount":16,"integrity":"sha512-68G6vpH4AGb97fT57m5oF8qZU+RaKQHDkRJ2lqNNj0ifQJXiXeQ85o7/OP9DwniBX3JUAgTEVK6Jrg9A6cS4gg==","signatures":[{"sig":"MEYCIQCnstxtsmGNUJd1hrgJVacEWujnmWM0s9J6/QVA/dekEgIhAIiaLXfnPc491OV0baAQ1bdI3b5OvrOSqgTkiX/1DUSJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":147562,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiGX6OACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqDCA//fjxZ0Ek3Avb2Fv/oO512d+pn19v05j9BmYMHyDkHLBnvWxs7\r\nT4vHjoX7Qk6wNySYVVd7nA1LXarMsl+8GH1kaSy6UPzdpxWA6wLy9YeJCEy1\r\nRJjnmGC6d7EgrJ+iKQxHuTb5Q5rWzdyu12cD5Z6fcwwxFsUruSoep82n869W\r\n7P2qT+3xN3da4BJLm4ZviI1cv0aqLT+nIiV27kPvM+RGHVWPBdcC7waH1Nx5\r\n3Nprsddyo+opHX0FNTaIHW/d2HuHLvZciw1wuw9VamR9ZngMe3ADwohhgFLv\r\n85mwXKFaQG4amWbLAAXp4/u3T1/393r/6rud7hFnWIgj9EIssbxKEPzKaR4h\r\n0598wC305nH+HsJVLYynknvuIBWY5quhHTQnWs77SqB+WR0VRcuyibG+COSx\r\nPhPF0LBufgaDNsUBvylSpegomKvFqPCNlLKTRT7JoifgnamCgwUYRHLrSmCu\r\noZs+8paXemfK1M6YLKY8+lCyq6kg06YbKClNskM4koFLfqsm/ZUJtgFSyqrB\r\n5fbFFjdmLI4ShEUdTCq6x5fFKG3dsAmR/Vbf/2MRaz8T+RhHqMmpI7ztDn+d\r\nqgeqJ+Am99gdBF/rN9opBUH6aszVh1T6i2ZThz9i+cKwsEUx18AYDJ+s9ls7\r\nuPiD5LSNJki0O1PtxZlXbqaaxgPtUhFXse4=\r\n=Cyx2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"84034ca272633ffbb313705914014becf904a3e9","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-02-26T01:10:48.839Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^5.0.0","@balena/jellyfish-environment":"^9.1.0","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.11","typescript":"^4.5.5","@types/jest":"^27.4.0","@types/node":"^16.11.21","@types/uuid":"^8.3.4","lint-staged":"^12.3.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.39_1645837965895_0.6428419375075769","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.39-renovate-external-non-major-d650773a440c6451f1f605d5cc7f9f531577516d":{"name":"@balena/jellyfish-metrics","version":"2.0.39-renovate-external-non-major-d650773a440c6451f1f605d5cc7f9f531577516d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.39-renovate-external-non-major-d650773a440c6451f1f605d5cc7f9f531577516d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"850ec72b7c96282d6508cf82a9b54ba9c11ab150","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.39-renovate-external-non-major-d650773a440c6451f1f605d5cc7f9f531577516d.tgz","fileCount":16,"integrity":"sha512-sLTggMyWfdupYJLOquBljyzla4OUjQISlsK5koH8DslCK7DPmtd80CGVcUbjt+V0BFgx6dHytjfDBfkBXQA2ig==","signatures":[{"sig":"MEUCIQDNkva0WkkOdhNNHZlUXh3YQJbh07v8csx9vhRNoqE5awIgPL3z5JKbaKGT1RvbHUKwNt5iwVZwWQOSvti6vBNaXXc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":147600,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiGX6aACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoaXA/9FPtKjUO8IjQ4/b9XnFfEynzAqwZVXZ6r+prtnLw9nEvDI7Z3\r\nCj+sv9P6d5ELlz5Ez2atohdIhQaY2LzMKyc4+yRw8N18/CrRXV5BJZRYAL+X\r\ne9toAljkHKAQrhczdTzUOVoHqrv+0Haz7eo6Qww6bXwfdC+mXfuNOeGYdPlP\r\nvc8d23Wg/jkdQu0QNt6CL4PTSOTQcnnJPfRL+DPrlIMqzYvkQgT09l0FPnb8\r\nguRrNtYyH25+ROqiEn90Uo7BhF1DrGiEp7GczYJ5UvUrdFrBIPs3tw7nWNu5\r\n0aipDCSdjcoE9FMobexwENfMcIb9woFb58f/25lhKjPLUQLW0/wbtZP+9C4u\r\n9tSFIphEXD1C9SZz4pvAkaaRI3v55Mu2Uk+V78N5LNK5FDd4xt8hFtWCSB6y\r\nnGQzCFIZg6oP90PUEYJvndrp7TjbFD6QcXVkB5n74Iz5wP/0SSx9vgJ07w3O\r\nDbsP++EUuNFFiSShsrB728nfd0GHqMMzpg9luHiYtzhFTCxkbHnzJllg2XcM\r\nuzDZ/uYMVhrW+GvaKbX/jK8mhIZolVpP5syqx7cCjGebhgWeB6kaL7xlOtRZ\r\nHhlyWG2zIVGS8iwJnMESWdy1IT9YHmNRvkPNnZYp4FbfhyxIf2fLYwzIox9e\r\nX9vj7qx4XOi0LTplbyruylznohVrVmtWQDk=\r\n=iSn+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d650773a440c6451f1f605d5cc7f9f531577516d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-02-26T01:09:57.135Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.0","@balena/jellyfish-environment":"^6.0.14","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.11","typescript":"^4.5.5","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.4","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.39-renovate-external-non-major-d650773a440c6451f1f605d5cc7f9f531577516d_1645837978113_0.11201616518941848","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.40-renovate-external-non-major-17a7f13b8705aa09f3f10f655fe7b39378763e80":{"name":"@balena/jellyfish-metrics","version":"2.0.40-renovate-external-non-major-17a7f13b8705aa09f3f10f655fe7b39378763e80","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.40-renovate-external-non-major-17a7f13b8705aa09f3f10f655fe7b39378763e80","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"88e997d99e702b76c49bc209bdb7315d3bb89fb1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.40-renovate-external-non-major-17a7f13b8705aa09f3f10f655fe7b39378763e80.tgz","fileCount":16,"integrity":"sha512-tSxh7ITARXsYAXX/pBrl1/OLG8UYqIUeIsND86xfsI+IPwjpHQG7YjbqyhC0P0pKVG33W0zOmHZ9IaIHe1JSug==","signatures":[{"sig":"MEUCIQDofERMLf3Sku3rm8rtMe8+Ad4n7KRt12gARpubZLePZwIgBPvNXrH5Dx3pU6xTFtut9XpffSBolUzzXx+5HuxQEjU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":147699,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiGX9SACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq7khAAhwR62mh7+3/LoSiyvM8HdkauLhoFbF0BCNg7dpnBBrqpkQaq\r\nlv9j09ucVpNnWzh5HV/xQFlo8Ma5NLxweYYSctehNmMxZPkezEWZjXMVUdQr\r\n6ClBOXQw09+xP5hQ02NyA6m7Nb8fKkqng4peTQ/ZasHmv2QaNSo2U0NHumyY\r\nwlS6/Ybms+Tf4kXRqKheG5ieX7SClOIhrc4NsN4eF67ZRY1i4jv2O/pcX+rJ\r\nTS0Dx/QXSr5RLmYwUDhG2DOD2ayOo425yMKrKWbmlGsVDDkLpPoiwkiHsOgW\r\nVcTl/LAXdktu/CGs3F/Cyo9YNoEBvPLeqRvz3zFpaxNtgo3OHgzKarzXTFPo\r\nbeWcAwiYSl7yvECTUOIDjPzeHJ0ndSK59xNGB2ejBfG1lgkjKUG9jIEShxiQ\r\nLO+RjpUFsIvH8ymLejbzUhuaYPahVbm7UVDF7bBGXg2/GbSKWeIV8GkBwKVA\r\nQNT7lxUKQo7PPn9TD1o5ckgi4+F/LT1rFgGx6TyAB9q9jqYZnIOAqcRUGecY\r\nJBWWcUI7JE15VdGOMk7jol50GQCI7FmNM5yRmytm51OxbiZrXSHBkLP7iqJP\r\nsRe0yr6Ko0KUxwxBxUODAettUCH4afCk3zdDvwU8oR3vC3LzBatSLEJK1Wct\r\nb8sKkqFPfeRhQ+l40at6MDspLTtCUgwBVGA=\r\n=UD+s\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"17a7f13b8705aa09f3f10f655fe7b39378763e80","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-02-26T01:12:18.885Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.0","@balena/jellyfish-environment":"^9.1.0","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.11","typescript":"^4.5.5","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.4","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.40-renovate-external-non-major-17a7f13b8705aa09f3f10f655fe7b39378763e80_1645838162679_0.4723672896441684","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.40":{"name":"@balena/jellyfish-metrics","version":"2.0.40","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.40","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"50cdc6ddefbf1a3f12b93a6757400d7d857cd799","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.40.tgz","fileCount":16,"integrity":"sha512-U9+NJwir7Hzi7boZQ/bqYg9MnBQ9ltCfUsZNKjM9Vd0oO6xOTMFxufZcVugqdDbqmC/yZbsQWb8uf4DeL6ME4Q==","signatures":[{"sig":"MEQCIED8X9LA+kHtzLwtj/oXhBNuSb9q4dejgcDdsvJbiYH/AiAoL/Zv7AzEyVNSktb9hMxS8KiiJzBTr5T2p58o6sMICA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":147643,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiGYDTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq/9Q//ZAW61e4//wPZ7HzFzyY0x5zterVfnu13AbCe10mmy1c9KBrS\r\nT/4DabnUBnCtRiy2x6cBaWEnHWCrIvk5aDGxa7afYQz+XmBDhQcN/rItAlvC\r\nh3bSp/0+IqZYm7uctmiJqgzwE/0dCpdH0b/OaDQwKQqWtWwUYUHoZT52E0S1\r\nZALT8zFZPKY9qqQ9DZP6WYGGFseiW4WEU8Ddv2WPbaH+X2v2fH5u9Vo6Tuha\r\n1ScPoD+mZ1f9BCOxYqTs4m95qoGTEg6kYPhKwboi/jQDnzQfNuKiJeCYKquF\r\nMs82A9M0AQ0mSZJcL3US+UWlcSuT+5surxUdeSP9ez5BCwuRHKxqItuxLjmt\r\nULjkn+4edex+bKTTfhzagjyu4iKZIsqXMmhwwvkoX6VsqYYH4Tg+x1V4BrBK\r\nEXuRzo5TpmC6YQtgp4EymReepEETnUY8831pxr/359Hdl5NntK8K2h1iHA49\r\nseklzWQXogXn7JWbdOw4j7mhQGDT4sD9N/yCrVLiPLgRlhuCZcXshjRNkMdi\r\ndc6atBJOVJbdyUggudp4nrM+tgzC6xkiB0c1wdmMJMasC/vIv06p/UpXEcTI\r\nML4TyCs7qs8uU0T4llyubiXgblL9Xa8roakGTrD2eexS45g9HO6eko5vxD/Y\r\n4m0CsGO7VVBm71coRHmXnAYd+VIypLLnzHc=\r\n=4xlG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7e6927ec7223f384c52d8154d4fc59832657653f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-02-26T01:20:15.589Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.2","@balena/jellyfish-logger":"^5.0.0","@balena/jellyfish-environment":"^9.1.0","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.4.7","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.12","typescript":"^4.5.5","@types/jest":"^27.4.0","@types/node":"^16.11.21","@types/uuid":"^8.3.4","lint-staged":"^12.3.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.40_1645838546830_0.3819129643720687","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.41-renovate-external-non-major-4747fccd9614c5f769f90f8b114f48d57cf44ce6":{"name":"@balena/jellyfish-metrics","version":"2.0.41-renovate-external-non-major-4747fccd9614c5f769f90f8b114f48d57cf44ce6","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.41-renovate-external-non-major-4747fccd9614c5f769f90f8b114f48d57cf44ce6","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"92220e72bb6d63a0e815b96876445ac9627014f6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.41-renovate-external-non-major-4747fccd9614c5f769f90f8b114f48d57cf44ce6.tgz","fileCount":16,"integrity":"sha512-9AgOofwKjQ3DgSrUPJTr8pYrQBhD9R15AM+2h6B2z/keK6K1ixNn+J/XdWS3YtwvHnyAvZMAkjBxActUCYBIaw==","signatures":[{"sig":"MEQCICoW3yJLfjQx7FNCEyShIIepC8OH9F/HAF6Ksjpt00lgAiAlc6Gvk0rbkB5ANWeDeYSZavHWl075uvgx6lJ4+Wt8qA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":147780,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiGYGLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpniQ/+N67k8Fky+iEqAQ1wOpkorpMXFPCD02iH6EwbgNfd1DuTmogG\r\nFSAxZlshNyJT5fX5dlt2iEHpvn9bUIzO7ABJH97WiPGBkX9F1O4mwz/G9gRV\r\nmkUULTlxP8yg82yPgw69qNDLqHZJAoYGi5jqxLOdq3vD3p2DRoVE3GVh4ZBa\r\nC6/e+YUVoP8YfYq6zMzsCoTHyVl+4L8QIZpOVKp/wdhvGJTaWgXdvK3m7Jrv\r\nzaWyVDjISqq+6fS1rXyeliPKcQLQXhOn7CNnSzv8RZKxO0VIwiQplClStyq4\r\n0KpEBgJI0nNNajJhcbyMKyp8sy81UqHj6gAeF5bm9L4g/QbOuQbPHgYYrw7u\r\nwHXFuqwRGGYO15pZAB1iFEIZ7/LcO3HpHzzTooE5zKwC/pqbXdxLzVK2kibL\r\nNW+B7P+2UGiN5nEVxfrSyA8r3FaB/mx7MXo04H+FnJS/fhCJUpMGwnXYgcbh\r\n5VDQGhF0EhyrLXRrlaI9KfNjO1xepEKEN3eRCEIJrszm4jEiqXtnN/hvS7gN\r\nRUdLXNwVbQSfaqBwGsBbWDUgEKoHTq1hOs2Ab0aRMUskwtngjnnWLps1mAga\r\nDaludZe4V6tzeBW9zRMN8ET578O3UWiwtUKAKLKBkcZPxWMYeZbrYIM2SxkS\r\nXtKZpUkjYLuYRQ1MVc9bt24yG6eAu7N5fQc=\r\n=Kefb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4747fccd9614c5f769f90f8b114f48d57cf44ce6","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-02-26T01:22:18.449Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.0","@balena/jellyfish-environment":"^9.1.0","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.12","typescript":"^4.5.5","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.4","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.41-renovate-external-non-major-4747fccd9614c5f769f90f8b114f48d57cf44ce6_1645838730896_0.13998488200871217","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.41":{"name":"@balena/jellyfish-metrics","version":"2.0.41","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.41","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8e69e521eb9da9900c57e5cb3e7582d3e443a833","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.41.tgz","fileCount":16,"integrity":"sha512-9P2KLT4tFTCzOQfWeI590ZIQ9hslcjfB7wvH7ADlM3QmAONF79S2VzX0Ifvn+/6CH3qrt2JcJNdUakzoWN8qeA==","signatures":[{"sig":"MEUCICocicoglE0AbGwGXEOqMd1jlbzKlyzmargD0LvK8nFxAiEAgFvfQjBf5d3MrF99e/mauzaGNMqgWv3rA2tBRIGG2Xs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":147711,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiGYLFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqA1Q/9HrOgzP3hjWB3ToERKO+0Fih3+f7vPbT8BJH6oNC0LYM/kQew\r\ndWO2IN/kYoDV3/MI7siCMu+MBK6X43WnMS+cKnkiNW0wGxyKq6LO70RMv8rW\r\nmBl0O4fhDGSmXpaAtSUuz+fjSKb0RUo0GyE+E4HpABY9+NMN2iVddpL0DYe/\r\nGOnPdUpqMq1Wa6pKAQ6Ym1eWbgwq6niKWHT2GDji8TLnTEUgIBU7hU4H83M5\r\nCj0VVB0wS8ngvTM/rYxtqYPMtdbG6Z9LlPvkSk+q+7Zg5TfeJued9Xa/j2/l\r\nW4cvDKb/ENec746e7GVUFI8tOj4EIcirFGt0uS23qTl3+Es6GOD4ddIO0P8t\r\n8zYErTCYuuYy4CFb0Z9Jlx4xRuQt6KGI/pUZMGBItlGeKBM75vej0UMXmNMS\r\nzjWSGA2v9yXqMlFlQinPlgK+oQ2t+3ZzwwdmWvPPHoagtrAT/N6Ij5yWId2/\r\nSHKSqpOYPEokuTDw6PuMJz3ArTcbdHcld2TbuDVjfAHvp8XtgDQ2y7+a/2QI\r\nMARmHJAwVv/TiqRh6SDK2/WDUfM4wT6MkyC+ISrtH/2Y0OpLjn4GpyPmeg/z\r\nk2ICw6FQN+2jMeADdwiPclHzp15HtpjmjxM9cqi54WWXX3hzJw7/FYLADJCb\r\nhSlX69a9teSMc2jQP/+rYYRYPijkPTSY7Qw=\r\n=64Pl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e5610b36030249fd3ab7eb86729a6ee3d9f45522","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-02-26T01:28:46.713Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.0","@balena/jellyfish-environment":"^9.1.0","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.12","typescript":"^4.5.5","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.4","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.41_1645839045139_0.9601946027187789","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.42-renovate-internal-patch-119eb510699ae6010b05cfe2962b370bab81b893":{"name":"@balena/jellyfish-metrics","version":"2.0.42-renovate-internal-patch-119eb510699ae6010b05cfe2962b370bab81b893","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.42-renovate-internal-patch-119eb510699ae6010b05cfe2962b370bab81b893","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"aedcb739b47d84882cffbb40f647547424ec72c2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.42-renovate-internal-patch-119eb510699ae6010b05cfe2962b370bab81b893.tgz","fileCount":16,"integrity":"sha512-Q2mp6tBB1lwyYwjJNE56ECI7jyWHbv000XAq5uwgCIwf6Ut/jas4kA5nBm9aXH1HZpujlGqDRZhrqz7qwDs/oA==","signatures":[{"sig":"MEUCIQCZnxbttoLPEJnP0WQrnr9f8TOnRAEjx0zCJ/ciBe1EEAIgFoe5S5I2pehSebqMRf0v1R/TcVomsZf6nlTQFhOSIac=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":147840,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiGaWgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrjZQ//QZGbRdBTgOCyF+sZD5cH5grmUvXy/ZW0jDYeC6HkwXG8vKgM\r\nO0jYm3CqhOI0gKEnJMBN94rRq9HB18Da087+x+6BZ5Qyu0X52KsNpqERlQ28\r\nSHA6VII9n8MfgFKL9xLx+bBxTrkjOmU+VsqNe5wRIVnMvx9NK1Qw5WIRMWMS\r\nrbtl9T9k6lRq7LL1jpwT6q2F5/0wN+IF6uq98d0UhyfdcLiOeqOywMZekJzJ\r\nNL+sO1U5qQFdsXaC1i5+rr27qplTgiQ4V2iiCGR6PJ3K8Mz+gSPAdJgQSxGI\r\nrAPBVmtLm3+hK7XaXJjQlWHpjvTSjOrPZlKXYitwMDxHzacxxeB6STSkZjBX\r\ndGTfZLipfrigU3DJFyjq2NYnDGviURfuZEAb8nU1e7kmJ/kep+a6dLw20d/R\r\nw49nDqW34pDPNTocRjXd+E8TVD31ScUHIbNgvVLLL+bldDR32oOb1H8F2WIz\r\n+Jn7XBIQSHtigeKCwYnbYs926BP5qUvbiiCR85vp9DXDtVOWADlP8QxwQ2zw\r\naU/rJGYHkBsZ9W99xuyGvJSrEJ78DBW1fGqDhDUJ7lJi8yoF/wjTHj9ty1GR\r\nyUY7Cn2hgLy/stXZxaBLHfhLHdOSlABQAIHgwVjmWRjBi8+q5UgysCSsBe23\r\nFi+JYBQCFkcZtBigW11S2l7O1BRuwxaNxzg=\r\n=lBCO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"119eb510699ae6010b05cfe2962b370bab81b893","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-02-26T03:56:29.812Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.1","@balena/jellyfish-environment":"^9.1.1","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.12","typescript":"^4.5.5","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.4","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.42-renovate-internal-patch-119eb510699ae6010b05cfe2962b370bab81b893_1645847968221_0.02273857004259816","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.42":{"name":"@balena/jellyfish-metrics","version":"2.0.42","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.42","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b619897b99ce49be1ce7b4ebf60a90f1568dbcc0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.42.tgz","fileCount":16,"integrity":"sha512-zIt0BXW+4fBEsjYxzNRfdR0F3s9VdsKQSRoTQgHqi0qOcvKZL63KFN1cXPFcRVQBd3KV9A4sDjL3l00TVk5qbg==","signatures":[{"sig":"MEUCIC2d/XcmIObBYGGghCFqKNvSA+gMHHgSY9RXnTfnCivYAiEA3YPJIr5sw14h3+f1OnM16n/a/AkJ+DNyXGXJ4cqS3is=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":147775,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiGaaTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo8qw//Q9MLuM2Ft49PQj+r9/n2cczzFOMf1xhYh1yCuDA76xOf+3zZ\r\nRMQGe7N8hN9L3hehp0IZtkas9L/5kFXh2QX7rbuz1MOs6mjneISAJZy2bS9L\r\nUoJ/wO/DH4ec2JvqnG+8EGCe8UCFFYwPlyIGf2/QOuWR8jU1E4zL3z+yMuj5\r\n5nVkOtc8dh4JlTKDDKUMlV4jCMNycx2KaMLahCjTeaLtWpDfs0VKXQS5H+1t\r\nYRRSWotu4T1JRsLZmB7HGoXrlpEjch4wKa290q3SXUCHsHhN3LnJpJS2AOKJ\r\nsxwAk763LM8V5s93aEkZX7Gl0fkg8DMgzuhwegwao3iGGKIUEVCF6SeR6HxO\r\nzMjosgHOiZFriMtRnJoZEuygiBnRbO6ljUOwybD10FJGWPWBMzvDSkGykQF2\r\nTvpEAewqvpHp8sNKQVYeQuX+vAKttafKYJD9mX6RRQc0QmTDXW0d9kDDb8fr\r\nv41vYv2usaJvoapCEmUuiPzZgde0ZH6XKc/RSQpX89F5YNeFLbZJwkw+VuvS\r\nJD8yscPTNW6c3GVwiGwcByLgf2o02LOWM8NnB5URh0Df2A0skMIpW/9Nbpgk\r\nOAWg9Aq1W66uhakJ9IlQTVBkShLwDUD+C0A8PifSgjXiYjiymNRMp3H/kbgJ\r\nsDqUZNx4/n2UZK6Jj6iqfZ4/owNZ4xLz3fo=\r\n=YLAj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a40ad3fb2b2862efd991bbf60cd512dffffe7cbe","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-02-26T04:01:38.113Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.1","@balena/jellyfish-environment":"^9.1.1","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.12","typescript":"^4.5.5","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.4","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.42_1645848211367_0.18117329560778916","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.43-renovate-external-non-major-c36a282eac9ebb96f4e245f41b4c14065c399448":{"name":"@balena/jellyfish-metrics","version":"2.0.43-renovate-external-non-major-c36a282eac9ebb96f4e245f41b4c14065c399448","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.43-renovate-external-non-major-c36a282eac9ebb96f4e245f41b4c14065c399448","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a8695cc380d3bc44eaa6a8a94a2c1585fdac8609","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.43-renovate-external-non-major-c36a282eac9ebb96f4e245f41b4c14065c399448.tgz","fileCount":16,"integrity":"sha512-3f3lDRZrwVGFRVyuI/6BYqvgr4oKoHHm7afQUtPlhsIHUJyBjnzx7/w/fumjT4R7z6TA5dskijoRNGWfa5K9kw==","signatures":[{"sig":"MEYCIQDaG/HnoEmxNoNJDwizn04ueaZOr8OgVi8IAWf18iPU+gIhAMCer+vnnipVtfXYnF2kgR6Bbth6DBkbjw8hbrn3LLre","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":148256,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiI1tCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpstxAAhYXDxpI9kNtWEzAsUGu+h9XGmEpoVndqUkBt3f81oI449+vo\r\nP9NTXiV0RJaL66qqqFDVzWo5q8JMqxnWOhkWcDajKkmL0PLmumWy8efYd8wt\r\n1f8Ol1CVlA/z2f5qL0lHjtK7FglwJckzOg4cvGLAek+lgKLY6AVz1tEnXpYI\r\n+GM2bSyXMo3FUyAKyfPvkstIbU/dznNdwc5Amc3V8Ch8cbyv3iqKqtWnSa11\r\nl1V665LLVINI2KfnQWiY8u83FzOP4Wew/FLfgS7HfOemQNASJyD7aO0IDhqo\r\nJmr/iFsr/N3uukj+i3aZI1lqi96UeHBV4LXTN+p9R5bW35Qea0gxAINMd12I\r\ntuY05ppYBUHsZn0YhIhCYY+2fCAfNg84riF8Ok8kq0hov4R9mJs0DZj6aisD\r\n0Z0R3duptRt+iTcO496YyurCEAUkVgx3DSmB9mKYnd0dtZh3Jat48qmlDKDu\r\n44J5RqvmqEOsHsOZxfLpkCwgcU5W0S+mN47+7qs5zGcxHlZFayqheRvnEOXw\r\nVBGs2CB9KKVh5YklS//EV0ii5wU1hINRNuzIias5GcJvefm0ewx2u4gfTlNx\r\nMH64DuWvXzgkY6dEnk5yFWKk92nlMDK1bXdTHqPZskL49C5O8JZVmEfYBSNT\r\nsavnIYrbHP91Z0hrE4MPYKB35+EW4VRNUV8=\r\n=kXGn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c36a282eac9ebb96f4e245f41b4c14065c399448","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-03-05T12:41:30.985Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.1","@balena/jellyfish-environment":"^9.1.1","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.12","typescript":"^4.6.2","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.5","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.43-renovate-external-non-major-c36a282eac9ebb96f4e245f41b4c14065c399448_1646484290273_0.018914714688923917","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.43-renovate-internal-patch-9cfbec424f8f6eb982168eda9850c3a0014d1ff8":{"name":"@balena/jellyfish-metrics","version":"2.0.43-renovate-internal-patch-9cfbec424f8f6eb982168eda9850c3a0014d1ff8","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.43-renovate-internal-patch-9cfbec424f8f6eb982168eda9850c3a0014d1ff8","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ca8c7f0723d487982939270ec2522cb49fbaf5e4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.43-renovate-internal-patch-9cfbec424f8f6eb982168eda9850c3a0014d1ff8.tgz","fileCount":16,"integrity":"sha512-S62I5GDRrTlRYBxHy5ujesdlp/rI2dUfpMuv3C7Ykg6uFLxxwoN4ZXbiET7L7W1KMdyS4jFrfAWRC9sB4D8EkQ==","signatures":[{"sig":"MEUCIFgLn5ZsHR/69XlNaN9uY9QgAa0oipm1Fn7BEpY/+prZAiEA4ls4izmOZDHKYAPB1JOZfbL7P//eDD8no5CcXjqwmEI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":148248,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiI5S1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr7VBAAjA4z6wuBXFNSE3ndqIvNmbJ3KfcWoCBKcV+QOyCQ5laiKw/S\r\nMWeLfZzyPZ77fzagu2G24wrpk1fKUsY6LDinCQD5xI8cKSj/ZiuBmrayg0Rz\r\nnctsZXxYBnepDtCGd1TvoDuj7li3ImL5Z51Ytj20QoOobQ0IfGhZHhOwpWJ8\r\nU5VIio2xFWomUno2dIwcHiFBM69xFfPOeiS3iBU6t2ulHdESbcCv8I8fOXvf\r\nRpZVVFMnIsF3V7YqB8zn2zzLl6C4sro7xXrqaQkC1QgIhQKw+nVlXT+7uwyC\r\nhXssqnxzG23gBJ7+hZZ0L50IP58YtCi+ntTNSji5LnWiQyXGq/tC5F6yae7S\r\nrWQ0YJFiWnAmC1qLAabWyfwcyQg5YnpcDEKsqSqrPezlJCRXw7lVoSMhgXua\r\na9dGNq7OH2GLByqwRIwmc7/S9UekbIZ2MUw59y4NZDy/wbIhWHZ33tZiQ9Nj\r\niDZ1/SFvCz0WznXv3jJw5imoTnFUniwMLdhhmHPt0M/kKEG32iIjLhXk5rKr\r\n+0HrNOpSehWP+ng0C2NvcV8uoMFpszmSyysZCkVDpUqXGVf25Cvqr4yzfVAt\r\nflTGMF4BtPcNLA8s/e41ezeS3QPYHwU5y+qcCu5PB3RJBtNmCU23/k15wtol\r\np9djgi7QxwR2tnwiwizoHvROiFPp3aae2dc=\r\n=HlRr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9cfbec424f8f6eb982168eda9850c3a0014d1ff8","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-03-05T16:46:42.776Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.3","@balena/jellyfish-environment":"^9.1.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.12","typescript":"^4.5.5","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.4","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.43-renovate-internal-patch-9cfbec424f8f6eb982168eda9850c3a0014d1ff8_1646498997123_0.6783066748379387","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.43":{"name":"@balena/jellyfish-metrics","version":"2.0.43","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.43","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"422d50ef4708e93435980144643864910834ff6d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.43.tgz","fileCount":16,"integrity":"sha512-EzfFAPlK87KZYS8j0XSuvKuJZiuuI43748aPNT5kcKvEfS3Up5bTjsanZ6PU7T9GtbXbwplW2S2iMx0QZ8v2IQ==","signatures":[{"sig":"MEUCIQDYjWCmqJtwFN77hg5plnt4tlu4J0l6lzcKz9dHVrvHoAIgRsuJHFBc+jDY/vlv2MrhaKdZk0OSPXbA9E0ilkEL9Ys=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":148183,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiI5WEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo6VBAAoWFrLmr2WCgak5fTP5BapXtADYdZWF0sV9DjUGhDr0otUGDd\r\nyTP7B4ynAhx7RKmRUwfArODj+/o7w915mG2G45mhF4GL5VuUM/fc//xOQ6Pi\r\n9a+pkBqYjjCa1pxxLv1ayq8yWlY6QI7MlG9UAdBU+c3AcqJQqqxgSK8ohXnS\r\ncQQhUrVbqsylonO2RHn8naweTMV8cM/KTM/xivLKRt1mWiY7BlUtTbM6pKPo\r\nV6n2VghGb3YNSiWF2IixQqE8inlu3qxasX7YSQA+FVLzf0YfvlwnM1fHKNv/\r\nhqStxz8uj9sVcsXW2hcrJEDrMcpgpKvrbUrZrG1dB2kpnP40HbbMef5hEISq\r\nOhZpzmQmxzamqrIiwk9aJWcuQLdJfAl05QpqLEl5um8Gc/2Yx292/EA3xaFp\r\nhINhUqz1PgyjQRCw0Jo+qZq+Jb+6ZbPqfVwk5V9SPUqaz3CD3KlL0ZpVqfNj\r\n/WrLdgWAvbrTNK9+n2XNonbScQddzjzLaW5p8+OnL9BBRZNDhKWyl1TELTyB\r\n9tGiPnipbffhBx99vT1MacGNGOgHrdLHoxxQSlENTerO/hHIUvwRS/ouwjY2\r\nE10VWycKBK8fcJWvWWU4PmJ5ADahQLkmD2MST7LYkUm/Wu4yH5duZp6Z36vl\r\ntub4u584rAf/gR+XYEQ7dvn9A4+2RRalTSk=\r\n=b3X5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7317c84b32922d3322f9b9ffbee47447e83e156d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-03-05T16:51:16.109Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.3","@balena/jellyfish-environment":"^9.1.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.12","typescript":"^4.5.5","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.4","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.43_1646499204679_0.5100092890416827","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.44-renovate-external-non-major-4b6424c880f3ef671d98b1bdc8477725806f86db":{"name":"@balena/jellyfish-metrics","version":"2.0.44-renovate-external-non-major-4b6424c880f3ef671d98b1bdc8477725806f86db","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.44-renovate-external-non-major-4b6424c880f3ef671d98b1bdc8477725806f86db","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7137f0ab0f796658020ae154dc9185d91fc028ae","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.44-renovate-external-non-major-4b6424c880f3ef671d98b1bdc8477725806f86db.tgz","fileCount":16,"integrity":"sha512-yPOHEx0ZNnatPh+Sb5dWAoepFUfe2EC8NJIX3N6CSPnWqx+NqBUfRIjayXwpG+9npVWKXrJgil5YvjFhFHKTPA==","signatures":[{"sig":"MEUCIQCdrahJ7yrWC7VOBmxCmitJ3Xv0jZH6wzECJF4ThY3+UAIgcGxxpvcl6UAUcYuGiEuUg4D8v5ZKs5v9qkxEBN1x6Hk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":148320,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiI5ZKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqG2g/+JJoOEq3K+KCYGI69RDNcV0j9npq0IeTejvtGN+HYHxcRAfZA\r\npxH3ZADcLudYVpaHWQDLkH4ZBeZtUK41XR5DYutBrGWKEnVNdgnKLktFp60O\r\n6M6KCcv6+3Sa9NieFIIYCTnlzzEAyqOEOOMwcRQBVMQPHPhUxrIoiJO59L2/\r\nDY0monKp60v+BeFpeYfYMPKEfnjNAlxXKRUnVPC7JlX2sRxaZ7BlILKQBgBG\r\nh+xWLpKtGuIms2Z7hM+d+xEJR7ZifAmWjTeiGUosLHylZ8SF8KPxVDmkxu45\r\nu0DB2KvtVooQxG8HwF8bWi61XIPOpM9D34wrO3MUqUKEGDF/pm+Ta2mJhglw\r\n23WIauveHEBGMvblysPJbk0SNXZupHATWw2Fcw9ruWOWWeNgdxa43k7NExQM\r\nj1ZDQMI81rXHNLctqQgoHo218tnDIhwahskI38bYE2vrNGvxBK7YctuhSP0v\r\ngNDmfZfKBAJnpt5VGxC9WSkSiufNp3E5hllk9ZHwE/hnnmaBTzxJh/RQXY1a\r\nOL1fbFj0dSgScpbs0lloJ6xDaa3L4Y6je2XwqmyPULJPP+wctiekeuEo32in\r\ni/NMonlgu0SeySNz7gngS/OiDhopaldUE5qEDr+nOvkW9nld4o6qEtiAQFuw\r\n2ifZZ89neAvV46NHd5Att12co7tMoRpkwkA=\r\n=IZUd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4b6424c880f3ef671d98b1bdc8477725806f86db","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-03-05T16:53:29.567Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.3","@balena/jellyfish-environment":"^9.1.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.12","typescript":"^4.6.2","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.5","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.44-renovate-external-non-major-4b6424c880f3ef671d98b1bdc8477725806f86db_1646499402640_0.3390088427556843","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.44-joshbwlng-bump-lint-staged-bb70f7f923acbdc4c28351bb9e5db521ca33f17a":{"name":"@balena/jellyfish-metrics","version":"2.0.44-joshbwlng-bump-lint-staged-bb70f7f923acbdc4c28351bb9e5db521ca33f17a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.44-joshbwlng-bump-lint-staged-bb70f7f923acbdc4c28351bb9e5db521ca33f17a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9620e02e16ff4edec3957fa4c5d203e4f8a52faf","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.44-joshbwlng-bump-lint-staged-bb70f7f923acbdc4c28351bb9e5db521ca33f17a.tgz","fileCount":16,"integrity":"sha512-OGiDUFpNAFmYvNP3ZcQihwxfTtR70r3/WSodiz01F9tBPMtTdUsCDeUDKL/xjV7fMjRGFwH02BYXDhh1Yjk28w==","signatures":[{"sig":"MEQCIE6F/ssWJA7eugCcbqNOD16R0d4hfe/v9bijn1kixa+wAiBvyPfGm3tREQcWm+jOZjKDfxq05uxMZuu3rz0suzQ25Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":148334,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiJBrTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpFgQ/+O6bd3ttwKQqLjR/7ctb0zZZ6tawm+IvbXcMty/UJ4KnEn3mK\r\nOk85XYKB+LcMjRKGl667EYrtgElJXHMPAR+x7LdKNqxa49CP12nAGhkrNaWH\r\nZ4fORowbf/ZNrHRF155p2eLzgRXYbqdDf3L73pMzuemW4FDuIsLiJ8bgZygl\r\ng9L6tgUA6EnbJX0F8aZAOhR190AZloCSvI/lbvKbeWZMUZyYoG0gLp5ltH4I\r\n14wwUikJmdxWOQmmiVqVg8SBHG2//Xlk+HmelhbeIobUvJVZkQH7NXaGGuoW\r\n2Xe/7WGsOd+jUzsiDxJ4OoTnRnAj2x4rmc/cuRiBRWt1b/jrS09Cjjm8Dfzb\r\nCiyBFNkykr7PitHk6W8o31FGJykdSlhzWQT8aArSWSaT953eUSBLKV5USDyD\r\nGwxLF9AlfJIynKgfmAM6N+UhfRm8ur3NJerG/FV/3WQhuIuoAT+2WOneeqL5\r\nagSApASeHzv+gIlygAGfGaBcthesbth4j0ZVqpW6sL6eSzYNJjqXxWmBf7r9\r\nyEfnVHStT6w4UWOwMV31QO0A6h4PvxarX6++fDzSfXVFPc/aKUZO3IYYeakz\r\n6XgTXHbiINFpklT3fTVjg3Wpp9z7qxsQ8r4JdwcsnhIPa2Si51SN1kLfXX/E\r\nnEwSQOX9XyYsThi4ibN0y6jcfkkJGewY5BE=\r\n=4cyJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"bb70f7f923acbdc4c28351bb9e5db521ca33f17a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-03-06T02:19:33.660Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.3","@balena/jellyfish-environment":"^9.1.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.12","typescript":"^4.5.5","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.5","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.44-joshbwlng-bump-lint-staged-bb70f7f923acbdc4c28351bb9e5db521ca33f17a_1646533330906_0.7240081007690538","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.44":{"name":"@balena/jellyfish-metrics","version":"2.0.44","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.44","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"efc9b9b5bd21351e8498afd3c7e8cde859a76453","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.44.tgz","fileCount":16,"integrity":"sha512-o3BstY3A3HGpMxtOGltI1apAW/93matADQJsCi7ncbbbWMGAKDX92hTpYtGip7Yxv4Q2WAQZPzvWb0N7EwNfoA==","signatures":[{"sig":"MEQCIFuT0hF2RRSOJU/QI+8alRs2hEpZz2Wn0Ch1TODLc2KEAiBD1pTXg9W+Ec8hoatbb7WnZ1GpoVVTF/PID/kj/BOOYA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":148266,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiJBu6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoVOQ//cwV6nowQhtTYbp8zBYMNoiL6v/CagYSKOcAVvanZY/00Lyr6\r\nCl9YzVcxSE5dzfEzLeorGi7CP8tkv1jUwTLrt5bzt4i5MulQIyh7A8JpCi7n\r\nEYmjBmRKxUOixjv/mZUVM6vdHuqRGqvi3eksXjpIrxBnDyzeWuz4ASCz5r18\r\n88+GGnSfFA/BJgDMFbhV4TTm3cG1DMZAfLjoh2qyfUefyndex78+2g5TPxBD\r\n0sAkcGMbKRZhfpTk3MlkGx46aBMb64lFS53mow90dtlWlRKx9pKLSINEZ9bB\r\nE/tsSIVpGjNNGFWUs5vKD6yE0PWo4OUwtcU6tWY5F2FBhKAc2lJKlnR1H/2Z\r\nrqoA3EiQpFaUY4YQrltKD388+mZPvZIhqhayDnb1wahUThL5eytfx0q+HlQZ\r\nXXKLNcbxVYjAWGLrYv0whFF/Ec5fb+bt6NagqZMDLLbWqbmzuTPzAWSmeA3w\r\nRNCNV3iqWljn+Ml3fJV6oBlIF6myOjAaxq0DK35zwf5rSz6yvVEJu2yugf74\r\nC2e8T1qt7V9RYGVaak7YwsPXvOtk0UuNw38QkAiO81+8mJfic4MKXs/ilqOh\r\n8dpMW1ku7lNB/AOsA1yx0PU0iI07YXlhQduG5usT3VLjqYPvmgRyDF4a1vOC\r\nXV2POA3tyL/EeZbZK8qyTcjDDP71JBwZPUc=\r\n=O8M/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5816a08d686cce4a3be2011b21e93ba0d87e7153","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-03-06T02:23:51.869Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.3","@balena/jellyfish-environment":"^9.1.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.12","typescript":"^4.5.5","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.5","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.44_1646533562484_0.970302500517692","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.45-renovate-typescript-4-x-3d1098035c0b6e799d21649b9ba82633251f9362":{"name":"@balena/jellyfish-metrics","version":"2.0.45-renovate-typescript-4-x-3d1098035c0b6e799d21649b9ba82633251f9362","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.45-renovate-typescript-4-x-3d1098035c0b6e799d21649b9ba82633251f9362","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"98f4180ba003ed566f6b03e7ec74a63e7b5ac58d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.45-renovate-typescript-4-x-3d1098035c0b6e799d21649b9ba82633251f9362.tgz","fileCount":16,"integrity":"sha512-uXkwsLBA+NXeet0ryEwuHZ/fD6SSAwWcPtLVIZJGpWdYgMG1V0WmuSZ+xwhjwl657VPAGV/2LiGkpV4hdFP39Q==","signatures":[{"sig":"MEUCIAGO3HdSKvbajm3DkjDNQ9U4mJmGXcvO6rRLWTu9zYXZAiEAgzNhuFFW8V9YqdtDQHtuYmX4UzAB/5DZzvhPyZMDRP8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":148411,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiJBx5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp2GRAAoh60lebZ81r/kGqIciCJZNjIIqMLZyxHIKwT070oHgD87sjG\r\nhUi28Z0C2sCc0m9/T228gf9580HBOA93YfIVMsqKHsYEXzlmmwzkrLjQBGPk\r\nQHYUgT+647bbglxbtqIFXEYDxQKh1PGCUFZ/LXAYm3556XDwvAtG1D6e43gV\r\nxciW46jNxDfF5PT4MKCx4NfSDZnqJHy7L0rcUx51fLsSz2aBTly2FjGNYFbe\r\n8WTJAbACMnnYbvi4m/Apl0K7Epbd5qQjP6r9pc0y09W6MbQXVyvg6zsuXwNg\r\nIuyv8FPy/rpsdSbEE3m//XxGFIJrKTTAlIh2N0kn1vVTclJs+3YXKzUFsUqj\r\n29+RaJHUZNOIcYN5wn/WEof723R0293N5ky0hLcaLzpzjT/600eP3xdwrg/I\r\nzI0kt1SSRfu7ztDcfmUwiyMa8vxmIf3fq0+9c0KCv0/Xo1CuKtrebAzQEaN8\r\noGAhWnULUeGzOr1FCAOAlpP3qXiZFKhTEfIZW8t3D9nTFzfc/d/SnOYwqbvY\r\n1Y9C+wB81ZzT8yxCONbjVJbgKIVQnINh2UlOOS5o19vJtMkKguWoBRIv/YC/\r\nPuYtqWDHAQJzgX9tUoWfMm+PAUk65+CuVyqfXZDYBH3nWf7rG1qdHUYnuLVC\r\nfBmgVs9YAQexHAtmVKdagY1Ky1lCsQReT0Y=\r\n=q3Zh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3d1098035c0b6e799d21649b9ba82633251f9362","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-03-06T02:26:16.229Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.3","@balena/jellyfish-environment":"^9.1.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.12","typescript":"^4.6.2","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.5","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.45-renovate-typescript-4-x-3d1098035c0b6e799d21649b9ba82633251f9362_1646533752784_0.12298449403404588","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.45-renovate-typedoc-0-x-3b3ef126690e7a890f04ed8618f3659e512e9349":{"name":"@balena/jellyfish-metrics","version":"2.0.45-renovate-typedoc-0-x-3b3ef126690e7a890f04ed8618f3659e512e9349","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.45-renovate-typedoc-0-x-3b3ef126690e7a890f04ed8618f3659e512e9349","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"038f6de353ce27dd1e45e050d2871f64c6caf06a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.45-renovate-typedoc-0-x-3b3ef126690e7a890f04ed8618f3659e512e9349.tgz","fileCount":16,"integrity":"sha512-a3zVzzwlYYHnWebZuKkj6+K1mX0R8o7CPoIn6CkqedjIO+8xA0NR1EdusxLNqnvBOyX3RMVzLrhANAhy2ZDAPQ==","signatures":[{"sig":"MEUCIBzjiputYae8V9l7aay+jQz5Ox94rQ8UZ9DbxZcS6odVAiEAqbMwlA9K8c68kwsWagSE6+74NhIYow8zOs+cj5eTwYU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":148409,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiJWdEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpB7A//Z86NqaOG5rQ29uvvCm19dwKFSzoUcDzY+Ci8UiIghiboG5HM\r\nnB0Iu3db8cMqzlG1CRBR91j9twYcpeY/ncEu/Bij8k+i7oHvfXypGHCnva9+\r\nq+Zt1o+UND7hylXSnfE+nNxWQDvmxGvBwdNKh05aEUpYfuVOJoN8H3CrlEZH\r\nnybDgJHDwJaNvL8xSgr9/XrbQfHJnpQd5HAlyxBeoUfOaIiwhMFOldyCW6Fe\r\nnHtL85Y2Oel6S1iIFqcy1KCDnt5JJdXUeXTVNmSTRFEme5aexCav65QlGl2D\r\nb1V/15PAYcCiD2Xgafq5iTTCZcJbjFA55FXb+LYE9P1pekCAvW65/SSCVRJ+\r\nmCbyz8DWbOwTl1cwY5G8mR1koKJNl296rPd4fPWtACHz9PmWFLZ0LeN+oA8h\r\noIu8DJegnL+1Zs6ZTS65nVLWgVGeigUrkRyFU7zbjSAUDutVicfV4eTYFpB4\r\nHJ8Kagxki8Or0fGJwSvIcAJCBtwamCli/FGA7B1vgGuKQalSVmjdgkzIQIEn\r\nAyBocCs5PHL/kfRtyIyUVHmJdf87l8QDa+Gd3D33A/LzO+OVte1f0z7sv9zs\r\nWEJ5f9lQBTg1thRrry8hwD76AhYcY9d+ZtvxOLy8jSDm9CC4WN1Bz4hG+2zo\r\n7WfzoaPZzXjSnjDE/eUxB8MbjrsMg7/gE1s=\r\n=NLXl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3b3ef126690e7a890f04ed8618f3659e512e9349","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-03-07T01:56:47.423Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.3","@balena/jellyfish-environment":"^9.1.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.13","typescript":"^4.5.5","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.5","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.45-renovate-typedoc-0-x-3b3ef126690e7a890f04ed8618f3659e512e9349_1646618436364_0.39438573702256274","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.45":{"name":"@balena/jellyfish-metrics","version":"2.0.45","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.45","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"45bac65a49ac1bd88df69862e349e0fc32299ed0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.45.tgz","fileCount":16,"integrity":"sha512-YPxrgSQVg/zd0fIo+WY1+FHPsK0UQ7wo9w36lGqeTJAxd7PuTJ335U0F6LJ3qjK6kMKkHD1GFf9Ulyg+P5YLgw==","signatures":[{"sig":"MEQCIAOnU6u+hIFN+nPKsFOgancvKpjsA30zysPktEmwAUXGAiBPw+h5ZKGhd+ZFkp/ejtdN/sJew1aZKSvlgMl0+qLOhA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":148347,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiJW/FACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqcKQ/+KCZrsidnvRV6gp3yA4BYi9an9Kd+kgf0u6DMTMH9EW3+CRo4\r\nZXhdWe7N0FKt2kKWkTw1Qd7x7LpW1uG/YEoxnVTIO4osfau7kbi4hYs4lF8/\r\njFhYGY50xG2HYq1MBTpZpNvATUOlUD5RVgfELtt6FbLN1SJ3E9oH18dzMWdM\r\nVfm/o58BfYbnVEzQiltb9uCVQY7cYJBwRJDnhd6MhiBK2VJQST+/o7aE8M2D\r\nMI6Zawt++s3YIDCWLknOnihkLxZw7RTgHVGkymEA3t61rrSQ8C6O4IJQAzrJ\r\nHJCxGW7tNgsA2e7jsKWR76wZJJ2up48Unqio7FhZgyXukY+2tZK312gWJB3U\r\nMomKAejkNDF1RgAkhaHtWITUrxkVYJbNiv0GVHH5qq7HEPleHOUeAdd698mU\r\nlAk+vwgfu2A+efedCXGDkyfEEH/UQHs861d6TACqIjf7Z2T5irrpXvLkcidQ\r\nLk0I/JICXWbQDDttCNIOHSfK8l7yXw/Y/pIfnwou9a7XLPdNabI4OUQv6lck\r\nMc06t0ekOL40NwPyRk1cHWqxWDAesOgVXuAmZM964QWRIuIWJSpK9SJRlwHl\r\nRHJ2aKBditSfe08KiAl05UJWGcQLhhIAcy5NVKnqjxIBpEwiD1ztJjhGCoN/\r\nXU75wnpv2Y7vRUNq7FmBCAgLhNu0dWbfUGs=\r\n=a3qQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"37f503d842d581c1529c029049d8a02f9709d9ce","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-03-07T02:34:33.749Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.3","@balena/jellyfish-environment":"^9.1.2","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.13","typescript":"^4.5.5","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.5","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.45_1646620613811_0.3006235509982964","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.46-renovate-internal-patch-5670dd80249c24ea72291176dd008d7e9ce13c26":{"name":"@balena/jellyfish-metrics","version":"2.0.46-renovate-internal-patch-5670dd80249c24ea72291176dd008d7e9ce13c26","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.46-renovate-internal-patch-5670dd80249c24ea72291176dd008d7e9ce13c26","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7dfb0fa9f011103ae7e49e2ef0d6b89b09b8cc6e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.46-renovate-internal-patch-5670dd80249c24ea72291176dd008d7e9ce13c26.tgz","fileCount":16,"integrity":"sha512-niHp33CJLcN216f/Lscnb4bfLcTa3HGUM139S30waUe7s7StO9z/oOIHC67fMYGyYiLmx8QsqJcPIwCQ8RgIpg==","signatures":[{"sig":"MEYCIQCv6Z97v02LaRAI8I1hitcWfVd9vosihzDj9Rk6up5QqQIhAMSv4/Eo2iHGoSe0zxKpCYLFFIiYShzlc0g4UlLHy1SY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":148476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiJZSYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpMaQ//RiWRIl9Db7tGLm2H8PqvHvqRcwW/6MR8bQ/wUYq6LcfJgsxZ\r\nbhPMa9TrOxSpKNLGSeQzbdL0x7fRwXcmTSMMNII6bLJ+PDV1Au0DDotgdFYO\r\n8OXNAf61DFdYxgfZDEuKWSkk4JNraVJnbQjDHtz4oj3fD9xPiWYbn+fYTG6V\r\nkoNo7ph0G8drpKJ68JxkiEIrSbtMmwwtWx8Bbjof6eKeH5TgmM0p11GonS7P\r\nWgH6iFlJpIlsFTGI1E8XfeTkkrxTFREz9MAMQ4d/WCIlrAH71oMNGzcJuGvM\r\nKJmudiUTCW0g8/qDMwArDB6ZvgDoJWFV2LLuLX+I3LwQP7xPueNbGnoUlZkP\r\n6qRs2/7Befu+w8aPUN2TLCoLq5Qi+ib3txWUzwW2iWAE2eZciSleReBulJw0\r\nF8UsZNjehXnb/8BEZN0Xb3ETPLt9bqYSbg+Aw7DEu7ro46iAOPju1z4MKhCq\r\nOnV0XgNV62I2xXAJ9g+2KDnhuiGWKgJhdVzW3HRznsci5LfbP9xd9h5pT+ec\r\n1p2KU0XtBN7kGnx2KSgYpw3V+axALUeJDZFO67ohEurnggdQGJI5mXy+9orf\r\n1yuwgZw8pm2KD5rhODM/gA7YGyNIN+F+LvC95/VHIxZG9tyRNVX1ZOGM0sqy\r\nLnXJNiEdyRttVdVIAA0dbxDKYb2InmwLAUM=\r\n=UKU9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5670dd80249c24ea72291176dd008d7e9ce13c26","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-03-07T05:11:00.730Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.5","@balena/jellyfish-environment":"^9.1.3","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.13","typescript":"^4.5.5","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.5","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.46-renovate-internal-patch-5670dd80249c24ea72291176dd008d7e9ce13c26_1646630040058_0.12907831506940104","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.46":{"name":"@balena/jellyfish-metrics","version":"2.0.46","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.46","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"736a4ed31717d1ce8076abef80a584dca14170e5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.46.tgz","fileCount":16,"integrity":"sha512-9hpOC91HGf+TdMZCBuVMpwFjN0IPTkmr8YCHWrps7uF0+YCBtlT9bWmlQPlqRDrMYA6WrVD3zHAQwr7djVaBHQ==","signatures":[{"sig":"MEUCIQDqosM5uY7HxdeZjxWbeVhRS8cMLf75MTu1avwzTt67yAIgAI7xo8wqXvcqed+b+Wg6WRsICzweslgX38njZ7CvxL8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":148411,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiJZWLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrdFhAAhVm8JILH4eFawvK+rR2EtsbsrL1qAUfhuJoveyJQTXUqerq3\r\n0eQ5nNaCfS/lM8qhywAi4LRsmd24ev8f+eOyLW/It4ndEBPxTUg/J2boWGpb\r\nBBCAajrSqVIwvnQz4xDpcbXwvSwoEpXMfidzPAxQWDU7hwic+EEVgmLJ687T\r\ncx7b9/Bp9YDw5Y7PWPMBr8v0j7yxaAvzS7CdwSEM0Hc+N7WoUCPQuugCqXHm\r\n7i+TuYD84hmkk+TYhAgaPzjDX9Jr/Gu5TSKz9KLZ/5PB5LZ6al5eyzka5/tU\r\nS46/JBB3c/7Snytviqo5TfS3xJLDboiBcCz6Z4bBRWUfTQmNO6biY3D7QJ6x\r\nvVpCP/vmonTTuWZDRtfgtwyggExIG6DItypnGZvIZCMItatWURly3qoc+tcJ\r\n/j0EECDu84JPJgxEXoe+WoNVS8EpHrGL+Beay3jhQK4f9lWV/965te3Lb+Aq\r\nCVwBnCBaD5S+2rA5V4IDAtUJrzy9M/DHkoNVpeRCpJUxXA/Veim+JfItJ3+X\r\n39MDl3AFJcu/Rm08sYH9FGdoY4wWAZIOb8FP3bpPSJ3euzkxBkTko6+GAgFk\r\nAMEOxGCIojUrCsYPAcByO6kEa2uitEXo4+YNImYYaOVfNcAULEFy4paZ3ncQ\r\nTxGvHQAYoWPvJWwP/FqinbEaL1SVsQg+yyw=\r\n=cBeh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e508dc92cb7319d08b9cf6c72031dce2342d21c1","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-03-07T05:16:02.808Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.5","@balena/jellyfish-environment":"^9.1.3","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.13","typescript":"^4.5.5","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.5","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.46_1646630283143_0.027648034247161668","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.47-renovate-typescript-4-x-9a89ba43b879bca13a72c18bcad044859ca4b8fa":{"name":"@balena/jellyfish-metrics","version":"2.0.47-renovate-typescript-4-x-9a89ba43b879bca13a72c18bcad044859ca4b8fa","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.47-renovate-typescript-4-x-9a89ba43b879bca13a72c18bcad044859ca4b8fa","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"84fe52f65392abf942ddc956765fc28822a176eb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.47-renovate-typescript-4-x-9a89ba43b879bca13a72c18bcad044859ca4b8fa.tgz","fileCount":16,"integrity":"sha512-2IXe9E3yx2MJSALaRlD57Z4JriJs0x5HZvTc4JyHR9AG9PuvX4b02jR4SauhoACRZkFiSNcYJVyccDMYzbX+hw==","signatures":[{"sig":"MEUCIQDa0UBbsPWlatCa27hqk7lHKi+BgkVoo8Hrw1hzGr9QtgIgbtjZCBofuu7QpKcehfd5ILwBnaa713vRY7DI2JPcubc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":148556,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiJZY6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr5Zg/+NRQ6ZX2VSNYjsdmt1kAlNkZLBEgmOW3yi5FMvCt5oy82wLn3\r\nnI0CCLMvHDspzX5PDpWvwkySMm3VKQOvBLAIZq81rrf36riggDUuxU5mH0Iu\r\nCxazqU0QXytZNvj5D8B+WHCRKWmd3MJufsfN3rcf6P4gmNQDfSYOnOFABf85\r\nWkKRVTIwWCV+N+gSWrokLcinfcdkI32QIKTdMoW/VAHUqei7SkKiteS/quy2\r\nY4zGdIm5DwlaDTfEYz39itVSqJZdFPjAr2kEmEEKWcWYxOAVURXujowCMXy1\r\nv+/fk9VHldbj02GMGyNHeMAdilO+u6YG3Q3repLqGjyeaxq5LdmQBqxfP1P5\r\nad57UaX2AHMM2hEBlkfEM0KRkJSodaAHUt5rbCReXo2lai4Izlz0cOVCtt2j\r\njncW0oLLnmX92Ex1OiId72lFkFmiDCwTigYR+OKiKDwRE9pDqAwdwbWiHsH2\r\nFFvcMkn7KW7xcTYwy1UETOaTQoDOgHflu1BOt3V9jP8PtYrORxjtkxUXp4y1\r\nzKpMsExbtQbF2kjEGGBRZTMJLVdtmIwxjVZRLZe1N2hGKfXpZjEk4g4jM1fP\r\n9w1i0ZgVgx2VzitYdlSDnRaeABQRvnK4hb8LchSz8pJMJsDnOMa38CLzKVOk\r\nT+6Z5XjbbCQDp7b6LUSS7/5DtG3lb1mKL5c=\r\n=eAzX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9a89ba43b879bca13a72c18bcad044859ca4b8fa","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-03-07T05:17:31.887Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.5","@balena/jellyfish-environment":"^9.1.3","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.13","typescript":"^4.6.2","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.5","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.47-renovate-typescript-4-x-9a89ba43b879bca13a72c18bcad044859ca4b8fa_1646630458266_0.44844913287602695","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.47":{"name":"@balena/jellyfish-metrics","version":"2.0.47","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.47","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e92db0941734b35fd59e27c3e4a7abddd619256e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.47.tgz","fileCount":16,"integrity":"sha512-RgjuqskPpIFcv+nV7ki1UI11wLhamZJj+CIb0LnPHU1Co/Et14sBZgbyR1xYdLULefIgVkOanjxXp4mEt6psFw==","signatures":[{"sig":"MEUCIQCU+/ts8NNmOHIx+2WsmDXBlfLeiv3KwExO0Wte0l4VrgIgXggQ91LPiQ+lXla78xnjLcGbn6cJFj5O9PqJOwQucFE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":148491,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiJZehACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrsHxAAiFbYaQ//dM1T7Zezkg+BHb3u89zQg3qcpZZxgfD64c9lYBjd\r\n3ttVshGJjm+k4Qv+sfcJAznk8Sm8KpZyqQPD4ZOwd+0QYgjjrq294fXezscR\r\n4pzW6iZGQuqWkmgHYKy03QApLxuxNjEIvX+iSTbQEKd/kaRqqdKGA9hMXIws\r\nDC8h7Ed4BtOHP1GHKvSzqXUx/je1f1+xe/bJNcZKhFap5paOsVI5bqkZ1ck/\r\nmHXwJ/9NRzI6831dOzSLSTpwx4Rpuu62+iAQ6pZ2IOjPpj3n4TNHaO8GSGRJ\r\ng2GTNrpk2tR+AzrfdzJwYZ1eYGEd/4jj7Ou9y+Y3DGYNN5u920T7Z4rKYOht\r\nDIMfRkT0LL942cZYechFeOMaAMSCe0HaVoslNvxoBR1INbmM+Lwh4qXIN4oq\r\n4hIoaeYeWh2sm7qRO2EnxMV2al7eH3rejZ5F1hgZHUulgO6lEY7e5vLo2Avl\r\n75CSSvlmccrm75zcxGsOIT8I8OHCU5Vm9LSCmuPc0mT7hGmgtfhmMaQLmuWt\r\nGhVH5nY1tJsA9+fLdAPlkW0ux9QC4VWiwn1y9bZSmeQvEApfP+/HTIy8Uvu5\r\n2+FRCb6eDA68VGsQnIc/LJXhSFKfqddgsplokHZwsxTkS6zEbCWjUTKzVhvN\r\nqJAgfacS6RNPTbZdJ/7F0wTkrXTk7QnP/Nw=\r\n=QRIq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"79db8b4fb3a9e5c29740bca99938e9cada6c73f0","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-03-07T05:25:04.184Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.5","@balena/jellyfish-environment":"^9.1.3","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.13","typescript":"^4.6.2","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.5","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.47_1646630816822_0.3797701478945128","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.48-renovate-internal-patch-f3b208ba5c1885e48d0bd59c2a19588b804e48ec":{"name":"@balena/jellyfish-metrics","version":"2.0.48-renovate-internal-patch-f3b208ba5c1885e48d0bd59c2a19588b804e48ec","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.48-renovate-internal-patch-f3b208ba5c1885e48d0bd59c2a19588b804e48ec","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"85635e369c5fc4d772c7741078a16bc4d6f49471","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.48-renovate-internal-patch-f3b208ba5c1885e48d0bd59c2a19588b804e48ec.tgz","fileCount":16,"integrity":"sha512-f2vFeR9vXFYYfO7OPU6STjsz4Yd8bdxRefxht2WYuwNFMJJFZjuZLxxoC4XWJYNxgwT59EVFqAgrn8WOT0t/xg==","signatures":[{"sig":"MEUCIQDnSDN23+8f6rJi5VVDusr/QKrfOYfpbANQOT0hKVSn2gIgYnJ2CwC03Qq/q4KuJsTIqWNTJcTLJ3lj/2Ynipe/LgM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":148620,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiMrcMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqdGw//SNFUBqSf/Qw40d2lW3KqKegdNCenhCzvsT1hOy9S24uc+ax1\r\nSD5N843/MFbgxG7JEos8u1paQ9yKZ+WCuHfDy1AYm/PP5R2VNitzuYmAbC+/\r\ncIEPmSZNjfWOTaOJEKuurg9xm9H8IstRJAn3bcXVmZBgbu3guRPNBqI1KwLg\r\nF0O7zCeEZkjZS2wIXIQ+WQEsnNmcrkT8KfgNzP7w/xIM4b1kbRYC3UhV0q4b\r\nMeEE+CTajXhoToAh6Kg9dQsO5fJ6n9qTF1svDPAM8etT7Ek39XIrwWJG1pib\r\nrApz5BEiIl1Bn+A4r9TFleWYNrrDXoC5bxlfhvjBhtyq08Eja1u+oHdf4gwJ\r\nOrM3ACYXrJoLP1pO+EqoT5nlXRVMqAS8ouJRnG6DV9HLcRb49uv4aIo7475p\r\nPVq1CJb58COAb9RltmTjcFhsTBeXS7efzG2XSYcl5i7yez2Oppl/XmrqEXUm\r\nN4iALOcYP72XhNoE/pRtndPRnIQ7HR+BlhL+xztZvZMtj7aw85t1iUWT4CGD\r\nfjW9Ij/DYy5wiL9J7h5luuOHzqGrBzb9Sehrp1EViQnzukhqZ5neq3JDx/aV\r\nD/3gMdi7q2bDG5ZxswQ90Dyhxm5hdRgt/eFMgkhvVHEB8iVXgT1dmHobhMWs\r\nVGIUN5YC2PQ/iJqzyKnt3+9/9PsNysugMC0=\r\n=H8zb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f3b208ba5c1885e48d0bd59c2a19588b804e48ec","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-03-17T04:18:15.447Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.7","@balena/jellyfish-environment":"^9.1.4","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.13","typescript":"^4.6.2","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.5","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.48-renovate-internal-patch-f3b208ba5c1885e48d0bd59c2a19588b804e48ec_1647490828174_0.6433406296767903","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.48":{"name":"@balena/jellyfish-metrics","version":"2.0.48","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.48","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"961fb69249db9a97331236d7f5903b6c7e8a1da9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.48.tgz","fileCount":16,"integrity":"sha512-t2uV7c0k2eCDo5VROvPITfsP+/Dh0no3aB4vSljUpwIR7XpitFOayJOhqKbEwju4wpa87qiPv+LXfc+itvfHeg==","signatures":[{"sig":"MEQCIGq+c6ow6CFzxFDTDDqjKXn+iqTyHyQKaT5FYh4YBvvDAiAvbzhIjcFYOKoQzgUdjZt332Y1le7VK22OXcHdVdzQjw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":148555,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiMrfHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrBMA//eSpu4Ra6mEYTlpJiKIEEiYbTRF4G+ehlrX8FEwswrd5I7pk7\r\nis1LHjmbfkrQl5VenQ2Ut2w84fFbIcZ+49yWLDKEBh0N2boewV3Xt8aD/aUM\r\na1R0Mud6BJuXCRLAgr8XlrlqkeMJJkOyh2uwLTmd4fXukkOLo4bTLGijHwId\r\n24vNUbAUBnfZ0CEgd5eRUUx8cOiFddnAUKMdbIAt5zFlrrJWxM4AHdDoxLTc\r\nDf19XJmGzQQcM9WWrhuOou5j06T/Fl3LVUoIQxyJSreAjpSH6PpPIKx1fUen\r\nD8aF6tU4TfenMG7Na46Wew/2GufiLDjOMR43NFmpk3SsB+xdch/DMGoK+hME\r\n8te3GxK+RmLdG9GQMEK/x9NaWEbI2o211lURYW7NHNO2PpFXzibX2crhIWaQ\r\n7fZ90Mo5Q2PBhqvybXDM8uBw8d621pqpeNN1QYzUG6HufQHWM0VDCs2hzpBG\r\n5LoZ/maQqroozdXYcWkXY1H5MFWDBh6DQt9/j/fDcg0LuiLrSCmZop01o2Xa\r\ncP7TmNdgwOZWLQn6G0bn+kRFBO7G7GVvU8Ya3mUuvOiH3YSLCVSF6ywf+zXa\r\nSPJzZ9qJfNvHwMd3BswKJe8Y9mbyWF3tNoyuKK0i6v5JSoLvbNiEpGfhUbkE\r\njgynD88OvlEyj5KmBZNXpKzp5bdqPoI4Aos=\r\n=e9Ok\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6dab0328ca1eeae845ddea8caf95dce68463a966","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-03-17T04:21:39.907Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.7","@balena/jellyfish-environment":"^9.1.4","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.13","typescript":"^4.6.2","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.5","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.48_1647491015283_0.01253047124227602","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.49-renovate-internal-patch-d48337ffb2bd4ffa0cadf23a7e844831394da273":{"name":"@balena/jellyfish-metrics","version":"2.0.49-renovate-internal-patch-d48337ffb2bd4ffa0cadf23a7e844831394da273","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.49-renovate-internal-patch-d48337ffb2bd4ffa0cadf23a7e844831394da273","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f19876663d5f24c69ff68bf3ea9006ff29a26214","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.49-renovate-internal-patch-d48337ffb2bd4ffa0cadf23a7e844831394da273.tgz","fileCount":16,"integrity":"sha512-3Ks7q/mO+6eSvSyS5/g08R5B2GnCloFSlArgLEUidS7r6wsa6T8ruBBfD+vquF2CEJD/gtwdfsJwzRDiDrLDfQ==","signatures":[{"sig":"MEUCIH3Mlo6ucC/h3L2Xns9RNP2lY8ig0uDHqi+RFN+TQB7qAiEA45Hoj9dOcyDq4qk10SOfABzt6N1DrwY9cmC8d7mrJ50=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":148684,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiNVn0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr68A//ZmS3LqBHvq8wvOPBYPF7bIr4us6ubchdTzHsIFiXa00VUMCJ\r\nfAGuJdORL3m5cdgjm1Uu2TfadtY4zuzROzSRnr37oOw1XTcjoJYBNHi8Ffhp\r\nDz8m96/7JCcxM5inadgLAkCCUHm9fL07er10BloQXWd5HFFrB6i617SpPbCX\r\nTnbCBbLnVOOICi+xkncQX+vL7qsmuVB/ByBrZA8ZYm8lcev88lb5S8N0j2ZK\r\nlZs3UzmgEnR7yyuZU6PCojltSJgLxswx6xEg/L5hHRt9v1ZM/XpIGvBoQdKW\r\nLWakYrY7qaz5EMNMdUR19Ayz+NhqJ5kneWQY3q4Izv6lM1Ql/lU+crGo57wr\r\nGTbqcDJkcJto2S/dc88zywH4+wjmME4RyGSk7zYDqNu9Xf6IKetH5lZnJqBa\r\n6gZpsVlS0aJwLO65yXoUHUCao9H6P2DnpLtYc4i849SFL5HKrIuWditOh37M\r\nkRsuDq/3VZ3I4aYpR682B9uf+fsrC2tZQuFRSMpGWBKbcVAloa2b4999C0H6\r\n0IMZU9/W6nH4/1kA5kfmbJ4nOL9r5pGVhIkDJkTz6fthZ9Q/Kr0ynATklbbG\r\n0tyYbZsRMQY56+SwnkRAZ6Eg1oaPg8ef+E7eLyTEgMeyLuT1e0Cv9BdzFZHd\r\nUIT0Jw2Zz0ay4E8xjhfXKjiHI8vARgdQS7E=\r\n=j0/9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d48337ffb2bd4ffa0cadf23a7e844831394da273","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-03-19T04:15:51.512Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.8","@balena/jellyfish-environment":"^9.1.5","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.13","typescript":"^4.6.2","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.5","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.49-renovate-internal-patch-d48337ffb2bd4ffa0cadf23a7e844831394da273_1647663604020_0.9524305046032564","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.49":{"name":"@balena/jellyfish-metrics","version":"2.0.49","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.49","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"78896f0ecfb8aecb347d95ba48969a386d4bb75f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.49.tgz","fileCount":16,"integrity":"sha512-t3D5ilwIQPRR6hGn346GDnzbDFMPg3kvM/+kBGJ77lVxF7cCRantXGBMuE/F2HHwI7kEG6bSD87hczwWXn3vWA==","signatures":[{"sig":"MEYCIQCUXo3CYPJcwCniqQ9kTkBk97MJeb/GdD4OXiVwAmxaNAIhAJdjsifTxwlUraRqUiwVQ+jurxLxZ7PAIoH7lLtZefgU","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":148619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiNVreACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqHhg/5AVwYan81uCN475ZRJ8Yy5VuiTX9m2zXzLEOUd3I1DK4gYiUi\r\n9OcnT4/OjicdPYi/Eqp69pZjdTk88OTcpp+g0epJK0OmwSfgJ6H5BCZGWYI2\r\natGIfuTXeQYhFHtfjJtCjfyY9p/acdSKzYY2QQxVpWXSYHmgU54yzWUiy3EE\r\nUB7acNj12FbecPKfFWkZM/63U8IgUGMfw89oLw7qMNfbOQlDsSELOwWpcHAo\r\nqQq+gAeiy5OB1LxThLEHOsmzU435amSJHpW3KKcJHbc958OqhU2NbYhCCuoM\r\nm8G3A3vmUBMRqmgWlQUsqk8vZAiPDlEQxwx5a5n6mei2kJxImp3rObibQJWy\r\n3k4f4GPpY1T320xW2fzaYkNsonDwEEgCu7yJ6/cNqOuRNHK9eo9pXzqVL+P6\r\nZnvBxEwEE3JSVAo6oCNAgGqPHOcHDdq6b5EVO6EY55OcGamcJQOz/WzgLfIh\r\nNQ6cUryrGw4iq2AyBjkC5Xo7QCpqubwm/wGnQhOMDhzrlWV5uGDVyabWnBFJ\r\n9eHGx8Do4By3vHby7FAWae7dtWEJAYrShIGkimpNIw2iGUAStnUhRqF1BsY1\r\nNGCY/f372IykFm1N0np2imckT/l6UawsrZ0c8zWrv8CZ53Sy8kbAtWfRehVh\r\nwYGtCfitHpjwttF/wnVh9+XfN3w5OfjMIPo=\r\n=atbx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9c656f37bdf1e6d9b2899477d4746cdd684f1586","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-03-19T04:22:02.102Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.8","@balena/jellyfish-environment":"^9.1.5","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.13","typescript":"^4.6.2","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.5","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.49_1647663838710_0.01713989204625177","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.50-joshbwlng-update-repo-yml-31c6e222ce5d6cc9891c687f204f620be1ec33b0":{"name":"@balena/jellyfish-metrics","version":"2.0.50-joshbwlng-update-repo-yml-31c6e222ce5d6cc9891c687f204f620be1ec33b0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.50-joshbwlng-update-repo-yml-31c6e222ce5d6cc9891c687f204f620be1ec33b0","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a0643772168d241a8c755ee79fb09ad923bba2f4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.50-joshbwlng-update-repo-yml-31c6e222ce5d6cc9891c687f204f620be1ec33b0.tgz","fileCount":16,"integrity":"sha512-RmTkG2a/ldiMyU5jN7Fk0QrE00SMwAQeGpSj9WJTJK5Oh7qilUqAfeyI9LWdEnqgUDPS54Geod6ZCQExcNNjgw==","signatures":[{"sig":"MEUCIGmEDf8iPUXtvnwK6WekRr0pNBKWspIPJRqgFapBaP7+AiEA9AoVeTRr6Jw4y8Uvzkn6+V8MpTUh4ZjjAmASyKmC58M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":148757,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiOU9dACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo5/Q/9FYAWRgWTUCzFRD/CHBMBzVI5uGSPstG9g0gVucjyTElAq2Fu\r\nBmHAn26vlRD9c2bb0/xfLiVJibnGnarPCv/3kzTTM+9w02kPM0X+W3tpR+Qg\r\nC8ONhK1srbRMc5kX9pT4fn8XvH058boCD7P0uc7pJkpBl6BsANALfMccLacv\r\nxB5Kjx0v15KN/sgdTG7IjNrMat5UmiPuSrSmlhV88Fw7BXnkWTJGdTLh2xkY\r\nIc9iwreA0tvAKIkL3NngLLsuaYke/i0pfaKsBVkp7nNyYY46chi9LyE5vMD5\r\n4AHMnEyaov/S4dFeVBiTVSMg6SaefY6CRXM8uK4MvmqW6j8T3X1bxDpGXHUp\r\nHAXT8PffDGhGLV5TJ2bNDOCND8250ec0rrfOf4EJTh2+TKLzPXsG2KMSwU3h\r\nNzwe8Pdv4DHttfr2YwUdmQ8XtPBE3OJs2uqOAkGS//brPF08zRlhlMTu9s1l\r\nk0SjNMrD6/tSFMKfcrtjsgtVZskPSyBRZD7BqJ4WrEMbYogdOuEkGxLo/Djm\r\nWg8046eMjwN67e21v2hNyDB0nBqozxLEaOMBBaX5YurpVwyQzv/Xgo/Y5y9C\r\nIqQswUrugnPozV4mCClKFdwaNgF8j/XwL1CkZWgIGF/xX/q3N5fA9pxCN1HJ\r\nkMda9/4ggT0mLCqRzljxJzUzL03XuznSCV0=\r\n=VgCG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"31c6e222ce5d6cc9891c687f204f620be1ec33b0","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-03-22T04:20:50.895Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.8","@balena/jellyfish-environment":"^9.1.5","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.13","typescript":"^4.6.2","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.5","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.50-joshbwlng-update-repo-yml-31c6e222ce5d6cc9891c687f204f620be1ec33b0_1647923036954_0.9464574891660649","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.50":{"name":"@balena/jellyfish-metrics","version":"2.0.50","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.50","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"32c12afa21b27922f7fc82e5510c106519563c8f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.50.tgz","fileCount":16,"integrity":"sha512-y7BaJ2zjCxUcyTRpCazrOxeoqiIstMkd+NDPmfTisOXFe/7NdDDz751rkvakAS7lpCkrT4LRa8m96hLQuuunDA==","signatures":[{"sig":"MEUCIQCdv6+s0usO6HJQjLeynMHCjoe3aRbqHZAXkscSGsPFhAIgWpVv/apDqZNOv+9IqB6Cw34njz1F/yOsRiLqgFeiQ5Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":148690,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiOVBiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrrwxAAjaYpJT1vWV0HYdeSFvBEMl2zOWgn6Jatp9ZizYV7PUozHgjj\r\n0crAwX2FPN4Noqrzc2Yi30jhfoHpdErHD3izqD/nlVwvPrKOQzuiE1PxD/zP\r\n3xxhjZuO3/jDcZWC7BldSjlZt0ATmKCFNjCKu6aCRvrzSqqAp/n7hJoS/iCW\r\n57k3JJo5xqHpOJe++NsUdquuUHIyQbB3m+NjOQGC8z4Cn12M2MDt0ssammkO\r\nNR30ZpfxwJM5RqKGUXB+A+kFrF9h2CHUerCBKasci1dMV1ZCM+0Q6BEGHqdk\r\nPicHXcfavhgIQTraH2Tyiq3eyZ34/YL/kwo9hIXVUu9xCXBPADCNwY7W2lxb\r\nmxvNOXaHj6VTDdHI0ium9jec8oWLr1RoGjs+HTl3ovlNhmSz/w0dTv8JmJdk\r\nuUNCWY+aQ2bS2+YFJpQPgmLfMy1ll7BMFUypnHOSZSkYiYYBxTuczGuZt7qV\r\nT7079yhb3OTeqywKptOGUt7DZQ+kTI14B3C0tCRA6a5HniXq5UYEeORI/aF+\r\nVIXuEzk+6IIrM9MRcRakWob2NzKRwngzaxTA2YRGoQUcTrK/Vfo6YesUJ71M\r\nyeLZMlkx0xZnYjJ/GLD5GMBP9n0I9fi38YZpuGj86K/5cwJ/CoJ+t+DYhiv/\r\naVggwtFm/XObttaD9LOJBuMpigHqelgKeWY=\r\n=1olf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"992b1761aa88d5be10afcf5c6dfa15c4301e6610","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-03-22T04:26:05.438Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.8","@balena/jellyfish-environment":"^9.1.5","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.13","typescript":"^4.6.2","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.5","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.50_1647923298455_0.3000918973180877","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.51-renovate-internal-patch-73eb87db157578b33312066c717c67877bec0363":{"name":"@balena/jellyfish-metrics","version":"2.0.51-renovate-internal-patch-73eb87db157578b33312066c717c67877bec0363","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.51-renovate-internal-patch-73eb87db157578b33312066c717c67877bec0363","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"34d1286b46f715f4af30a60d483629c17f03f7e1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.51-renovate-internal-patch-73eb87db157578b33312066c717c67877bec0363.tgz","fileCount":16,"integrity":"sha512-SR2YZTNSs6fthPlh2IJIjAjZiBYoxtHzTXFLZZtFt9OyY7JEtb2NnSHa8afWMQperISQvv78havx5i5nBPfw3Q==","signatures":[{"sig":"MEQCIFBVbITGS8+8FIb5JUExvGh6PtYYLPgmYpyge+UC2STkAiBo3jn1wvtcyX0QAswHmyCIu6F1gQI2QzmdbrdMEgR7QA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":148820,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiOoDjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpEBxAAieQ0+TPxVm7DNBQrODq4Jm6EiAyICX4YZWDrzMBZ0dGwLVPv\r\nZIsMrA2CrfX/jK8HDPJG8UkSquoWPMcRvXMR+rgG++2j1LkBaCk8I4PD5OXt\r\na7/Md4LyuYk+gtGGjtdX1nVEpIwOvQ073QRtI3SxR1n9FOu79s+XOP0jei4z\r\n6Ug5OBoCuJDgwDkcPoZsrKTGsdu93+TgXhAep8/YHL+E9ocqy+kAzV13GxiO\r\n2JysGTtlrXY71ChRhdZ+TLyaXtTxH79E5qRVJOAgHgd66QModrKn/iiGBO1n\r\nwUcBa/GsWdXzAQmpnUlNiMWui2pOQR87f4+UdP9wktL6SX5GAGVODT4IwQsi\r\nI2QSxb53IZJPLdyb1KOgiH+qijZQ1CAEfMr2X3SM1qjPTn7TVyI67UUz//fa\r\nSr3drtK3ZeiVuV0TT54xvRWf8/AtvAktu+4UZMK46tOZbYrbfDkaa/kl/VO5\r\naFh9hTisdqaLGIRlkPJjAz4MRHCdclzXf8mNDf8k2ndP1pJHjAttwgsbIZbO\r\nV2MDzd0uDxnv+ABt4uNnrAwGWrcHO/SNCLBQo3QKJQFkPEmUfDXMd0zkdTYD\r\nSQkVRKEqdKBj61q/g1xvEt/VCoYTKKLMgJEPg23w6g/cG9G96dXGi/DBIv7G\r\n7xhW2wQkWGYcBFMqaWBwAhb0JYd90qQ6KQY=\r\n=AuMq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"73eb87db157578b33312066c717c67877bec0363","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-03-23T02:02:14.318Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.10","@balena/jellyfish-environment":"^9.1.6","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.13","typescript":"^4.6.2","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.5","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.51-renovate-internal-patch-73eb87db157578b33312066c717c67877bec0363_1648001251496_0.5391827091809487","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.51":{"name":"@balena/jellyfish-metrics","version":"2.0.51","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.51","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5284ca931166ad2470510d4b8394cb7c727e1541","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.51.tgz","fileCount":16,"integrity":"sha512-Xv8njGfACndYU58/YxXNUp0Ot8x58RQn5SB0Oj3Xw4nWsA93SwUEIRkzJ4ucUf3hISiKycIkH1fCh4lqOyvkoA==","signatures":[{"sig":"MEQCIBT2v/oHGzqFxlr8oMFIYDj4gpil6KlVBkysyk3Nv6PDAiAdY99+yjfA48vXwnvo16L5Tk1reMGhZ8bS1NpZEktORA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":148755,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiOoHjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp2QQ/6A508urRBr6KUGzKcuTEjiWzMLxlrBHzmuGovdWftP3xRXVYk\r\nT3I47L+7Zv69Cq5ki7WJpqT6c8qZ9H+LO00larrh/5FXCe99nnYtSwMp3Z33\r\ncFt11/spd7XN1FDS9WOzGHfFWATF8jtnQ07M+FNYZSBt3dW0IH6gLIjqvS9a\r\nh55QQdK9dndr8OBnB8VVbxQkmmGPTsYlsQpXmX1Tq8xgz5Zq+6NTqgafLk8q\r\nCb4czg9zWcseny89eKuBneRoCi0diCd9icwBJpj20QJW4NrUnX1LFOLpMrId\r\nYgEgv8tPSYmvS+Wt6hm4pxJCBqRLw+pnBAWj25QwTvdqshZBPiJwpsJpftCf\r\nSa2pq+KWrOrUASKZ1oLBFJerN9+aJ3MWwFPEESE3NiFq1xSFblwQoRmlarve\r\nEtLHDCBHFqyPHD51mmynXu93w0v9RFweKQjDAUKcLB0UeCxaejueoD2iJLtZ\r\noYRpKN1bFBLyB9/ULlQHNnSIyIJgurURnHQq4+ZqbXaDNgtqFZC16HoPRhTW\r\ny4eBwPpn/7hMq3EzkwjwqawbpasGoWeFtl5W0bUl9gMQk2/uqfe0/5pTNgDz\r\njN3/SjnnRrWYJRPwpNpFvlLNMQUJVmncFbEoxW+FZ1c+gP5nqFdLp0hx1NX+\r\n604hgTbppgExRPPE5EE5YiRJtwE17czwWPI=\r\n=LEKl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e6004625b60f40f65d8015008092426feb0c31cb","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-03-23T02:09:22.062Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.10","@balena/jellyfish-environment":"^9.1.6","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.13","typescript":"^4.6.2","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.5","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.51_1648001507250_0.47643096251119554","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.52-renovate-typescript-4-x-ea875b1877d6fcdd4e7f2c672c5b23c80c94c01c":{"name":"@balena/jellyfish-metrics","version":"2.0.52-renovate-typescript-4-x-ea875b1877d6fcdd4e7f2c672c5b23c80c94c01c","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.52-renovate-typescript-4-x-ea875b1877d6fcdd4e7f2c672c5b23c80c94c01c","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f75516ccfa21ec60536a3a1e8cb720b636cd4165","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.52-renovate-typescript-4-x-ea875b1877d6fcdd4e7f2c672c5b23c80c94c01c.tgz","fileCount":16,"integrity":"sha512-45SkXIHAkwMConyPw7nntpj52iCQ6f5+D/Mo5xHmDVQfX7Q4WO9AoMhIjouvUwMNuOLygDJoZ0cxvhMK4ghMWQ==","signatures":[{"sig":"MEYCIQC0qls94w3gqoFfw9Dxw1YH9XjK7U2BubcnXoQqlmEMXwIhAPhitb+cLmxl/VmuV+FDwYwcqrOp0/vkRFAf2/BfYXEB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":148900,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiPQS8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmppWw//SdtS/nPmAWKXBufA/l8p6OoqSMPHO7Cx6KfuMKeO0qlvqLd9\r\nP5SWJ/lLPdRjUuts+n5ztGUfNoxGTiTDzzvWCbA117eO/2bKnKGJBfrlg4pq\r\nSElI35Q580xHzcFfWh8tyrm30FEZ+TustQUZ0ZWPyMTfrWmgejTazo6af9L8\r\nPvcihp5NfoNlIWcuklx3vQyAmHa83pQbJSC965ciQZyIOvgMm5geP1pn4+wZ\r\nL5ZpSBz/Qt+egfsssPpMFB7w87yd6nHdT5ma2Hu3vadV935sqCF4A3ywYrqI\r\nCR6DwRmKFUQuqXSjis9aYnlQnFG65fY0vVkrBmF8glctWJUBLRwM95431O9A\r\nvOiJfeX/NVFo7qWuNkeSAf3IRfr+uJMpqNfMBFr7lfHI+rTs9zzR7vtdk6ZD\r\n2dYxZ1KUmdmuKNuDGCa/16tvJIeeHkO2aDc/pmXnopKaw95m3mSHcjUOAJ6q\r\nGdYrUfDfQeX8L6L2iboUuKTCvUTladzIt1Bkd9mqYGTDftm/D+5Fux7uCWsQ\r\nJU61h/qff69P35Tj72DHgSuitMEbUf3Uf8/s/f2d7/Mluhe2JSxn+AZZD5O3\r\nFh4pqV/BkHM27bkIoZrBd4IxNlRFzOdr9cr2vvZuk8U2srfA0XubD6WJJibi\r\nVcKPUftzIasVpAiyHCV1sJpW8UCPzCfXDE0=\r\n=0G6Y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ea875b1877d6fcdd4e7f2c672c5b23c80c94c01c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-03-24T23:50:33.015Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.10","@balena/jellyfish-environment":"^9.1.6","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.13","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.5","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.52-renovate-typescript-4-x-ea875b1877d6fcdd4e7f2c672c5b23c80c94c01c_1648166076263_0.07247893135369199","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.52":{"name":"@balena/jellyfish-metrics","version":"2.0.52","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.52","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f10abcb4445661b8b13a2c385fded0e65c28fd0b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.52.tgz","fileCount":16,"integrity":"sha512-7R5xB7Rf4oLLGFNf72yRwD5o+ga0bAnZzPBBKmxMcDy3ZhKSgZx2QM95ORQu4J8kR3RyG4eWMrhssLB2xFxgBg==","signatures":[{"sig":"MEYCIQDdTHsnEvZQXr1rPAFxx7TkDSIW5BzhckR5ChSr0+ky9gIhAJhaCc1CT1BqfMWyDhoEnqUaCVHbh3CJ5kI5dKZJlc/E","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":148835,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiPksNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrhnw//cmhT6pz7TEmjzF+9N9Or+pbJ8j40cHPbMSOXav4ODlZmzUfG\r\n/inu0aSiiHA04QNW5F06F0wBWg0B6PcQgujCC2rJEOzc1ud3gRWW5gXJAfA2\r\ndUOig9GowNX+OJ7gqJDN7ThnN2MVkVLLCTcKvRu8ER8TnRfAysptgLx1hhVZ\r\n1v4O9vPEujgE2LC7wA5Ss9sLL0slS/pIVCty6H5gxvpx8jIqB4UHlzn32r59\r\n/ADAEhQ4Yy6R3tS02IqI8yfcjxI/fUnwfx6s8D0kjNtekgRObCyM5tFKNE5r\r\n/MNK0/l5YM4iw4+sDH/vTMfOBdEzzpvUsvBHpUQC8ZJxkUtStr1Sze042Fky\r\nMKdT4W+ZmYT2ZM5LknZ/snl8bG7sNvhFVQa9vWZ76/YvUEaM9ip/eTDb9uav\r\nZv9e9vw3zVGoerQng669CLT9txTEr6yySpAFQvu8/0S7rLwwxGFDYxbdeo4F\r\nQnga8hJ59jbHEai/FmfHwup+fkHmQDSxSQ2Bced+1Z/bUNylbr5CrBRzTuGD\r\n0NmfMjBI62GK6QNrGE91UVo82RMcrJjnpKfXj8TECxqV3h+VUTxjEpmtd1BY\r\nSU5IkPqaVJPIwdIihtqLQZ2wjPhHCohyhJzsMHELOQUcFFFrRKvMyELMdI7z\r\nxOL8zr+8MbLbHBRlE7+WA6jTNxhhIgbS21Y=\r\n=S+J4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9c0072e8626f213ce7ce54e43c43d5d9981cb5a9","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-03-25T23:04:53.110Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.10","@balena/jellyfish-environment":"^9.1.6","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.3","typedoc":"^0.22.13","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.5","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.52_1648249613496_0.9598099939889322","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.53-renovate-external-non-major-a406bece323dbede2bd0ba50963f2b4fbc610fec":{"name":"@balena/jellyfish-metrics","version":"2.0.53-renovate-external-non-major-a406bece323dbede2bd0ba50963f2b4fbc610fec","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.53-renovate-external-non-major-a406bece323dbede2bd0ba50963f2b4fbc610fec","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3f0f712ff77a1c3e689a149efc6f66f4456c9de5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.53-renovate-external-non-major-a406bece323dbede2bd0ba50963f2b4fbc610fec.tgz","fileCount":16,"integrity":"sha512-EIXb670EID7eCphTH5sS8lpDOdOteG60yvXHFXtWAz5wEWf+XljXh/Vtkc3xO+HfMqucmiA7M7qZBkkiYWpuEw==","signatures":[{"sig":"MEUCIA4buM/90n6Y0ads/JKtrbtyk1qRRd/Xqln8Yk2DBzUsAiEAuTz47jZosycJMfeA7PicZ8TJMWHjSkeYbXNUtnW6NJg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":148972,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiPme2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrtNA/+N7qiWAq/riE9p4sGyn40HPqm6SfwsPQcdFRgFoV9ZjeyvG6n\r\nYaCCWNowVYXT1ZbXKYpSVPBa9iZ+gH0mQ+86dYAH9yC91wdFVOeQCK1PXQhs\r\nptiuYy+9PEtSx/AidUNJdy36bBJaw9QFmclRnNRhTOL2xv6NoO6tglP69t0E\r\neDn+5ji/62Sk1D0qfaUcwUc8yrODZHyA/g6vm3OS0KqsN8d+iSXTRELWSCYS\r\n/UH8R2Zr5tivHLbJAsMH0x1k/0ps/SwH2saqjRmERyYCAuJf9K0o0dA7nrCt\r\nts6wlatD+gJVtjlIEzYnKc+3xoRb8nttIeClPBBUuFfYGf9mpp24WiapMaof\r\nsE3WrsTv8yKZHPHKzkwrETChQ4BJ0Dy5HjIWB1p2m82hXfke8Z+Q4noLAgZY\r\nFs6KxAStGJvqJSKiXQuOOHHbitzV0Yljmot0lTmr4ZwECRtvpfnVj/ldQh4B\r\nfnTJyS3SRvf80TkCS/JFUzePNivRD5LGAnT2S0rxXEZSNnFVrF6n1Dn1rBrg\r\n/faaLmwU8CHqIEmKpwioXWUljIIG8j1g1jLl3utNk/C6h0NqP7WzARjxHUS/\r\n9G4hCJuq5rNnONkr/f1AUm9F9Tj9fS15XoScsgHG1dRza39xLbVbHCYFq3QM\r\nYxXWy9+rVs/5klL3n6/M5i5SPKPdmV1Hi4M=\r\n=f1wZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a406bece323dbede2bd0ba50963f2b4fbc610fec","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-03-26T01:04:38.301Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.10","@balena/jellyfish-environment":"^9.1.6","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.13","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.53-renovate-external-non-major-a406bece323dbede2bd0ba50963f2b4fbc610fec_1648256949976_0.7189521520476947","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.53":{"name":"@balena/jellyfish-metrics","version":"2.0.53","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.53","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5adf180097e36088f755d35f53cb360b8a17ea5a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.53.tgz","fileCount":16,"integrity":"sha512-wbOTaonPYJQguS/aEg9XIH0bGo5inhP5LVYHr8oxUO4gf2SGTE3ECasINRdpj5T/Ps/clTy7SqrA9miLxWRg7g==","signatures":[{"sig":"MEUCIQCZtc9PQZqbchSJ6VWgz6BNxYA556p8uj6jUebW9tCVTgIgM9CIeyusbLWAkuf8bvWj0YQZ8uGSovS4g7Sb1pDydm8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":148903,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiPmjJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrrPg//aoVvRO6uW9PLGJHrRwcjhEsWhDT22UlazuIX9EvsqYGk7FY9\r\nevNB26AGzMMLIKCm1SoLIvGPgd6AV2bSixVZ3N0MauTaZ/s6YPkaa6mW3+BY\r\nTaj46fgLOlA/0tHFA0HW8xtumyN+AcHWfBdi52UhSCruKxKlbSvBhuger3HK\r\nGNtW4ti3MdDnoNYZSFwMfqULDk/8QIoBZSvz9IvDIf6ZWAMym20ueSaOh5ut\r\nXCAuNztYkO9RLI1bOMwj0QVleLV2P/EETT089C9aa9foI0er8m6TdhMiYWTj\r\n7eDjzIW5dz+f+2vH2d+7j1/5iNIfFRm44ui1cEbPWSjPu1rI91G/CQXj8NqZ\r\nE65PggkeGlnl78H0n6d7gIfPpTQxavF0d0tLC4mKWV4DHmgbq83PZw3DQUfR\r\n/F2LSIzXbeuUk+ASYgvYnDR/AXzTm2ITyBkfJhEaGsFHqx2OiwD0/OYKe3vV\r\nGFSLGyLDUA27fVc38rdR+mrYBPxamq2c7Pr3+1WRiQfGqsJIYUXzGUWERCoO\r\n/NIxa8FKlaxnI1NRDL8UH9o9O4J5jvZ+SVOOlVvrXADb4bOoIPyZmO9/2ZY2\r\nYdMGqFpxpi95otJ2d2wfN1+AK4qb9gdVyka58YtlEVWMRiQPBMW/9a1F7wvv\r\n5zAy/MK1qvoTkBDrszoDhxZM7bPNJJua4p0=\r\n=YCoC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e07628438853719e2aa8f89f352b6e8c65a4d0fd","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-03-26T01:11:01.920Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.10","@balena/jellyfish-environment":"^9.1.6","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.13","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.53_1648257225051_0.019346165036865592","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.54-renovate-internal-patch-8bce10394299c4c1a46bc88f3ff31c30a937dcad":{"name":"@balena/jellyfish-metrics","version":"2.0.54-renovate-internal-patch-8bce10394299c4c1a46bc88f3ff31c30a937dcad","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.54-renovate-internal-patch-8bce10394299c4c1a46bc88f3ff31c30a937dcad","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a02f497c3f441980423bac4ab17a3ea843cdccc4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.54-renovate-internal-patch-8bce10394299c4c1a46bc88f3ff31c30a937dcad.tgz","fileCount":16,"integrity":"sha512-bWgwV1wMmUfiPP1Z4PEN1x+/TA02c/q5Rpqlufc++pWyiKdO/ok6phMlOnGr/U4W8/jue12zLlyzOkoT+RfQ5Q==","signatures":[{"sig":"MEUCIG5w0hHT0oxBY6+AuATJr2UkdzopGt145HbvexnjCgM4AiEA0AkMYmuPMrwxtM1pEuaVmfQ031n/HHWjkH1vWJHgeCg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":149032,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiPzqcACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq4qA/9FahfYEmYpwq7QBOeFiyzg1TllX6SURpwkwPcPSHdiCp727KC\r\n4oFHEfYuLUDc/CZRe6tQ8cv/uc7tRaX9LLg/vcSRC7+L8PoH48NZS4qdZVBM\r\n8xnizePPNaqnhjSa1KQPRqQrkgKUmvhRh1P3G5riYgD7HsHXrT/PmK4WZzdE\r\n6y9Cnq7tR+2whaXLNhJcR712BStie/xlYj26BQhLgorI4YG4cf0svxbo0RiM\r\nj2o9sGh+wKEK8HB8jh+uoWv8vcXIt48tSctNPiPjwh+QTt7jZts8L5gljo4W\r\nv3d0f4nRFdQxhwlEa3iIIl/4OoyNl81hbXuD6/1fKeb8NEjxGmjN5TgH8wVR\r\n0SXOq+yAu2CM8IPWkBkILd7EzpYzZPxBdyw8LwqHQ9/bLoJnPHSOl/XUOHCn\r\nhpj8VE3xc4jqw7oi54uDAndiz1VJJjA8SwL3oiI2eOVcnxVecJu0JIhCZIw5\r\nsbaKvSPkrGy6VJL8VQeZhVi9wvXFLE3X+AG1yPNK+YeaIlJX2kqlyVQckmV/\r\nOLzmGhNE03t9uVUCxhIW08iG0XM72SKx/SkXvErU5h7E5OgJx69poEteSy4D\r\nx1KDQFpVgCN+dg+F6XUYprpE5g/B5Jz1wSThSvmsHuCUTfevYIJDuOtbjUrW\r\nUumHMEtPl00DCOLQnMlRSIM9I9mT/GGDsuo=\r\n=oqXx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8bce10394299c4c1a46bc88f3ff31c30a937dcad","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-03-26T16:06:23.763Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.11","@balena/jellyfish-environment":"^9.1.7","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.13","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.54-renovate-internal-patch-8bce10394299c4c1a46bc88f3ff31c30a937dcad_1648310940117_0.04710255777482808","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.54":{"name":"@balena/jellyfish-metrics","version":"2.0.54","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.54","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"efedbbd3c782f0204efd0e87dfe1c860f8fa7d3a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.54.tgz","fileCount":16,"integrity":"sha512-IcvfLVlswM8m1ye5/L5I9vkQhNHU/hn8Gm2BpdiYvXDIUpbDuHimhaN+9ceAR5B2kBnQiU8NHKm4bunWI0oGNA==","signatures":[{"sig":"MEUCIQDOLppjZvTiV4rcwOW5udtMjq/epJFaZxznVhzsiyBXXgIgab2cDoq0ygX7y9Gh4xo0qBJn9Fd1+1QFI+msGvFJCjM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":148967,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiPztuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr3VBAAoiG1WOLBjawxRl9Caz+AOHvPbK97BvLCqzN9remj2lYrylF8\r\nchPf+lDHiL2rq+WMR872MoWS17/VEsJYcqwYx9tmcj+aDYwqVTH6WAWVk+Qx\r\nMy3lQ5ojTB+1bgroS2UxoM6EFQvFJLWz2T0UyDObcECLkdvXRlc/jxAUx8VX\r\nZB18ULdTanVF9HtF0YAnxork/ESxdpkYtcfwomVz/n+D1+RHD1DaJHEtkltI\r\nyGfl3v3IWcm8q8b7rksWd/BYHBTXik1kt4MgM9bGIgo/T+V64dveWQ8LfjMx\r\nP/H9z9hDnLAcrabc4kUSK0vlZEdZDN6vH1O8RZd7nB9mN48zQEOfxdabckUr\r\nGKFPUS+bXMTTvCairXUV3+fwUyv41ZA3IxeeUf25OiuhI1I1/GOsGA8zwePt\r\nX92ki/9KR0o10zBSKa0U9qyqFfg7TUA8m7iX3HxGLe3LQ9NGZTx654LxAMSc\r\nKIddA6z/FcjBgCxWh3WnQyRyOQ6sAkd07ssKguaLOIdnQFfk68/nrVNkZACn\r\nouKE+rerPp0MpTBarAxeh9v7CNg79z38uwBqDs/ygjvH5KFuidZyfRrdWdhC\r\nNVRRk1R7z9YvKaUjEno6ZT8b+c5GAjJ8kv+GMHeCdX0y5bB8EiMwEusztsSU\r\nAjw1oIjrxInnhPW9HmPWCFhWyNP5V12l8+o=\r\n=g/5g\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"bf16d5cba8969fbe57acc72d54cc9ebc144b4a8d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-03-26T16:10:34.744Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.11","@balena/jellyfish-environment":"^9.1.7","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.13","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.54_1648311149987_0.7243644671354941","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.55-renovate-internal-patch-d51ce836de7614f70c9597745ca7d144e05cdc88":{"name":"@balena/jellyfish-metrics","version":"2.0.55-renovate-internal-patch-d51ce836de7614f70c9597745ca7d144e05cdc88","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.55-renovate-internal-patch-d51ce836de7614f70c9597745ca7d144e05cdc88","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"68b5d9bf80843e0a74c097fe1ee4e1aa782f6e76","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.55-renovate-internal-patch-d51ce836de7614f70c9597745ca7d144e05cdc88.tgz","fileCount":16,"integrity":"sha512-rDpWBXCdoPFxvyVPL4+b0J1MFwdOdFkIq19UPknmSjkE6qQeOkTSACnEvoyZL6uqY8qPXC20binVnjPwVIZARQ==","signatures":[{"sig":"MEYCIQDDmXlRcVNusOV+Ur9vJjki3VFjvqEx7CWalXYLXhMhAwIhANkdQvXDJGK1j+LiimWh/AkLQEO0091wUtkiwZKzFcqG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":149096,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiR7TrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqmtQ//a0SSRCjIJowaCXmvxxf0gSJLAUO0dWbY0W2DFmDYzECHbktH\r\nCgZ1cLEkZpQmoyQ5lXobr9XtPm2b+CdiXT1OCHRcz3lTl3aSwib1+8X7T2Rw\r\nJ/H0rICYbQPdkstC8My8Hg26Izo9WN7gcazrgthfFRNKyrlqPth7cnL/TL6L\r\nslQofumfQ4WGIlTh483TPLoyo5u2cRGIrFT/TDN2zxtEHidMRBC51rdeAkzi\r\nLQkCN+1Fs+pWai6UK3Y2LucbYp9PC3JG220T1qCDnHYRRbu9d6sGh7mpGUiB\r\nxU/5TlQ4eHUPOnAAPCBasK/VcOqe+aww6KqZIh6sXt9xUGJ8zprDPio+fzjF\r\nJ+LbtrIDMmZpAAwcp9Yzvvk/gINFKNSYrHWQNdKSkY3guwMXQCj8wD3ga8SK\r\nyRAimFj3NJ76epVm7y+7VOIV5p26+K27+ldkqfYyfROvbgotgRIrLfkbpZtF\r\nlNu3s44vGpT20/o+64NChsjyNemMoonNc0ppbX5cg7jRrI2BFeXFcQyg1aD9\r\n93iUwIqij5kz1mLmC6AIGiRr+hxbFo+6ukivFjNVVMPRlmHj5tjpmgy6yx7z\r\ny6ihKgNyU35COCognr8pzSexTIXVtkbJ7gGlL2lSQ+DwkHhH3GWrI4gVTpzV\r\nm7tRktLJzVsRPE2oD7eWhvg6NlFU7qBdKtU=\r\n=Zj0v\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d51ce836de7614f70c9597745ca7d144e05cdc88","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-02T02:26:43.660Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.14","@balena/jellyfish-environment":"^9.1.8","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.13","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.55-renovate-internal-patch-d51ce836de7614f70c9597745ca7d144e05cdc88_1648866539439_0.2699503926992579","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.55":{"name":"@balena/jellyfish-metrics","version":"2.0.55","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.55","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"132fba46956ba5265a34cde078214fc54d5cd030","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.55.tgz","fileCount":16,"integrity":"sha512-srVkMO6bYPdBdx+GHMyeQdy8y4Ql6Xv67bDZTgNr3QMveBxjB6YMO9w5cjwS9QxRhPBWJmH1voe+tn9yXcMltQ==","signatures":[{"sig":"MEUCIQDZO0bljY1br4r1fFDaU7Zs/JypOyWHL0LD3krMSgpNOgIgSmI9wc+oSbszNNi1c2pyRUiMQrXQ8+/Mli+lHCgxyBE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":149031,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiR7XGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo3zw/9HPFNfxyNYflhzvRi8wEiz7KgGKiZtHp1jK4pC4+/cE/gZpIT\r\nwbRKDIgbv5+NoiulQPDZ6eamboXT8ROfaRrD5Moq1V7BLKEE91yN50KuuhUd\r\nymnTEeps3hSg4srNR/F0C2E9rZ7gj0nnlOVLDQndXL6/j/vtuz4HE6JxtEjv\r\nf66/0e/3xPj2G0GHqYNDgYBZ1Hl541FRC48fBAMjLfnlp4sxyeDgyucfKEgE\r\nhJYoBikSTYDXkaAF3uDPRpR8zUmHwIed9rdYB3cR3PMZDjJ03iapqnk8dp9l\r\nygeTlN92gCbMyF/m1PGmUhup6Hly6oHJeHrchCU6GvyaQzf/1eOnCnHB5Anx\r\nuhizbYK3Y5/ecH95Wxsg0Qt6GK/vgISoZjMb5xKsGBlzf9yQJtrQyyHlbdZF\r\nhN1ojbXU14Ws/zU+VT1NtPnLiRM38b4Nl6nWS1CTF/suNbWHQG/toGXb7X25\r\nPe5v3cLM7Y01tcA86gOsLaDLgy1ZEOYVprGcNJX0Jt6+pTpsYvFG23uEFlpx\r\nrsB7I8Ua+i4cmW1ip3XYqfCNordV1cD88D0IN5Ymo0rFxo/E7HypbGVXviPu\r\nOcOfZR5/qyYHtavjNqsjYSbWvCKtOhI+EjN+G6rZ47hY+xkyRQK8Q/emo/3t\r\nxK2HBhSTuNAcRN7jE9x9RehLKN556qeLaaE=\r\n=ZJuc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a7c158db1a97ac1cc30b2a6d608674d9888dbfab","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-02T02:30:08.174Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.14","@balena/jellyfish-environment":"^9.1.8","@balena/node-metrics-gatherer":"^5.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.13","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.55_1648866757782_0.7899844720275038","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.56-renovate-balena-node-metrics-gatherer-6-x-2342834459358648f5eb34355a1f57530dfe39ee":{"name":"@balena/jellyfish-metrics","version":"2.0.56-renovate-balena-node-metrics-gatherer-6-x-2342834459358648f5eb34355a1f57530dfe39ee","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.56-renovate-balena-node-metrics-gatherer-6-x-2342834459358648f5eb34355a1f57530dfe39ee","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"76c7e21c2048e5412e932c0c3654060bd4d26a67","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.56-renovate-balena-node-metrics-gatherer-6-x-2342834459358648f5eb34355a1f57530dfe39ee.tgz","fileCount":16,"integrity":"sha512-2dqPRqr/az1NatXLbLW9NDj4sOqOT6CcTsVJzqJyFYv+LbJJPyGCGT/lVEM1t6kd6Fz6w1Zn+dwCMJKJV2GlKw==","signatures":[{"sig":"MEUCIDU8DYavcDCt2z3Letl7ELW4q1gk4ACS07VpdQqLhUveAiEA2jXmkmbJkI0o3wKvn1jvTw3GG/DgtJ/BKMoyJhP7cTk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":149213,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiTOAWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrOzA/+JhnlAxLGeq0158Wo2C3Q4jdxbP3hqCTMwvko1nBtLeksTMPT\r\npZqsa9ejenDgdchH+EZv8MsXX2rlCEMJgX7JxAjMCL8H3txuhB7mpPVzTh44\r\nTVTCHJkk8X36sAdq3pB0DkTg1pvSMREndhF1Ajb+yZX98N4YGWaTN6oOsOIl\r\nhNjidpGB4lVai1dYdJPyM0+ntQdeOlfwJyMXpuZJSzD1gtCAOocsXObDpbnV\r\n1x5FGZSweabGUj4BSkVXdilMQqEIN9gQGzHZWozDcTSRv38sTF6oRmNMP0J6\r\nMt+jEMgiR/7fZ760mL/rIgSUYUaW0zTqmZqcJ1gV+FRAS1CNPtzaalFHntcm\r\nVDhGy/U7P1++8gkl2r7LKvBfEEQ398AulWrTM0Tk1M/sS4PB5kPHMr2hD6p9\r\nj+7zP+LN5+PvkbzrQ3Q9/+PUkDLvFgY0sVyr5wT8yRReL/mv9uAWAxLdPmpv\r\nHxDCGwl2Rr5wJhG7fbdoYAlEQeOHhAvswbRXRxewKON6Bppjv9220iUyJB/N\r\njMOoVrxNFBVrYZARPFVZSVFGWmhbtWkzuhMzX0H3CaBjjZKfG+p4+eAZcm1/\r\n5i19qaDHRfJj9Bdfr07HrAUryK5eusA7o8dZmHfDJYs1E/faRA/x3NGGJrgM\r\nik77OiMXHhJ3VVzQx5E/1rOJBIiMqg3sSyQ=\r\n=JXLd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2342834459358648f5eb34355a1f57530dfe39ee","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-06T00:31:23.896Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.14","@balena/jellyfish-environment":"^9.1.8","@balena/node-metrics-gatherer":"^6.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.13","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.56-renovate-balena-node-metrics-gatherer-6-x-2342834459358648f5eb34355a1f57530dfe39ee_1649205270476_0.6383628357038877","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.56-renovate-balena-node-metrics-gatherer-6-x-a015e149337559b0055294df2c111c1c04f200f2":{"name":"@balena/jellyfish-metrics","version":"2.0.56-renovate-balena-node-metrics-gatherer-6-x-a015e149337559b0055294df2c111c1c04f200f2","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.56-renovate-balena-node-metrics-gatherer-6-x-a015e149337559b0055294df2c111c1c04f200f2","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bbf7644af87ef73ac010588de450c3bad93775c2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.56-renovate-balena-node-metrics-gatherer-6-x-a015e149337559b0055294df2c111c1c04f200f2.tgz","fileCount":16,"integrity":"sha512-FdvmdDReVqUwkMfvCg5ky55+lgmZe8Ne50OuAauIC70zYyJey1TVbou5HC7bp7xXs2FlILveWKen6IK4CD3Qjw==","signatures":[{"sig":"MEQCIHehI4S0bjoor/CxGQmw7qsgSiXQe8gP1CCZCIttN/wkAiAPakIvROoXBdQbjzvyMwukuAEMQgszpUUYvgdO1PQvUA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":149213,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiTZY+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoxEBAAnKE8cr5+aaDYJhGmWm0Z9ZopmMLul8xUPSk6gp7/FPFi9rfR\r\nDlEluq6JOUkRs3vxOUokxRexy0bT8BhKHRbT1+82kf7MtbOKaWlslQOEYUEw\r\na843bD5USfUWkpa54abapgB9JkysdtcRcvlEqBqWvGsyVuEC/5XwYKhYRA0k\r\nqynTxvyUgaqaPBaKpiA6H/qRqwrtVebLe91SGK2xlvzm+XrL2bCWoXNIzczD\r\nBgaeDIZps/7PK7SHOUF51jfczivx+SS9SGzpulsxizG8Fs5iiKWfBjACPssb\r\n4cM+Uqi6E6PlKwjMD/IbayOaIaqzoVxmsJwfOM0SjiUBOVSyNwC8xi2zb1iT\r\nwMqOAC3NNHExvcZdoWXWdlui5XkYuyrYX+SIyK++5B+Z5jMDPiTZi450LtbD\r\nSz6aQSqiEwIY9ehxpOTZJcjWI1m0R39tgPGNEdp8TcnZWl24PelKR6csgo+o\r\nRBRZMcSMPDeK1Qf/C559ZwB8ZD1s+BrxoxAjbz8rsq9hZBcqcxhV0lizERBb\r\n088sYgy2UpVjUCS1A88in47+FVtnfjwHRKj1iow5bBMBNyvk2ckU5hT2x/zk\r\n1Vsu2EPeEetSPWGg3gb40RjLfPS/F4Wi8LlfsPoUhV4mCwe04tQz0rGsJMwn\r\nlHO7qtQhCgJDCY76S0SLTyTK2RknrgcFOz4=\r\n=0oIf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a015e149337559b0055294df2c111c1c04f200f2","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-06T13:28:35.688Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.14","@balena/jellyfish-environment":"^9.1.8","@balena/node-metrics-gatherer":"^6.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.13","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.56-renovate-balena-node-metrics-gatherer-6-x-a015e149337559b0055294df2c111c1c04f200f2_1649251902414_0.4052052790775804","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.56":{"name":"@balena/jellyfish-metrics","version":"2.0.56","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.56","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2f51b84567a070d251eaf4fa9f531afd1d82aa8d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.56.tgz","fileCount":16,"integrity":"sha512-eYG67/MFD99Qq+VkffpnSUQJxJ7DPMmoSXq/nyQJJEM2QVOepR8tCBplXmggn2KrWbBquYaP2qZkbggmF56BOA==","signatures":[{"sig":"MEYCIQCBGzft+95FzKFnS/SsgqfGOyfGOPepT6dlF9qwCBQrbwIhAN8fBZP0lWChGI4eZyLnu+gI5TyDGuaLINqRtbjC/7P1","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":149130,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiTiUmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpF/g/+N+9mkyPjibBjGon7gk+BtY/04+P87wNpz35WCp/1EX9w+qkY\r\nlLOTO+AswVrWkisrkOeKFZ8l5NfkFCFs8nFGuihp67jtX3t0sHUUL9zM9W0t\r\nHsX6NSB6a3LHpwRADl/bof499/azcH/oYTsoynCYCrq3uar0RHr1YuElfF7x\r\nWEhPrMKoW1I3BfYD+FE24q1aHh4yFI1TqEpyNcmLaIdM1jmdnigxa2KwfDlL\r\nBI1UnsOGVmfapvoFdRryaUB1algNrGf7Vif9/0ka4TCqJ8qkrwXuQSNEBKDZ\r\nPi8uiYllwEOuwjYKXC27QbhFBIKHxZfaZ/YGGRKs4KKCoaBXTs3nwgTWll12\r\n7BlHswnBMt5iX47ux96Kzxoab6sZEAWhiFVs/5ORU5ZAWNildbLNJCdQOISB\r\nJWpr5kuJ12sX9cy2MUrgtZAJ5vUmMatbJWef8w5D1mXjMgF2A61bgT5ISlim\r\nXlx5qOxdsf6yaLQ2atAcf9Q/yklfPCj0slCgDe1M0flEHKoIIcAvtniinFU7\r\nEy+t91zg/6OmqN2LMy8EjfrejQDo5ZZG4ogG6wypNXf9Hm/nKl2cPyuH7QDa\r\neAeOaGeSxiGcfzZsND6tUJh5n4RMas6x6Uu/JTr9Dqtk215s6sCPLcZU7Ip8\r\n1MrjZb1YoiR7yfuMNU/ZwFkx7DoNVwF0h2E=\r\n=M5N9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"aa4e6dc2cc8a5c2bf15017bdb92377726db6c713","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-06T23:39:27.898Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.14","@balena/jellyfish-environment":"^9.1.8","@balena/node-metrics-gatherer":"^6.0.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.13","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.56_1649288486437_0.6964200890451915","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.57-renovate-typedoc-0-x-4fbcdfec0dd3242cf86cf0855289d96b59abd508":{"name":"@balena/jellyfish-metrics","version":"2.0.57-renovate-typedoc-0-x-4fbcdfec0dd3242cf86cf0855289d96b59abd508","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.57-renovate-typedoc-0-x-4fbcdfec0dd3242cf86cf0855289d96b59abd508","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c4cb20c25b376bcc4b56f609d40f0ff07b936367","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.57-renovate-typedoc-0-x-4fbcdfec0dd3242cf86cf0855289d96b59abd508.tgz","fileCount":16,"integrity":"sha512-GeKx8Pk6Rc8w6xVgBjukm/WgdGHi/lHxMTduEnZnI/FmkgJV5u/rSJcIvsxukAzxjjqBy2opKQ5mRQUpnjEn2A==","signatures":[{"sig":"MEQCIA3AllLakbdaDcrLasZxe7qeoir5O34QE/vTnzb/uUuNAiAMZkqbA2CURjBl02Cug4B+JllvKO2PTiNQHQc6WeI1VQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":149273,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiTm49ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrbNA/+LjCVPcu0pEOpVUdOtOekXWTz+bN1vVGg+7lM01r6JBLOJ7NJ\r\nmAKaosg/kh4Lkf1oQJHS7CtcDlog3isXSEZHSp48d54jelefmg5NZpf4GzlH\r\nPuV3ii+UsDBnVQ9AORAEMGk3TG20EMagJfzm41cnEpnGvxJWjVe0QDjEHM8u\r\nQDR/1+A9MgDomq9+/yGWr5OAXhIdiCTCcbjc0Ipar8H9ZYVhfsJVxY+xLBri\r\nSNX8q1+lmH7yflX9oCbsFMz/O0IFt1HVstn3xFZlYD8KMI5BBUer8dF0xjN7\r\nWDYZGDr6/A75m63a9QKJw5brG49QDqiwXt1mmpORsHTcHnBPpF/HnFER66Dl\r\nyrACsXz6O/inXItspRQIvuE5LMJS0/4eVQB36APNHHbD4T3KgPPK17GJVnFy\r\nERPrkH05A9CLM6/IEc2bpikFOfxih48yjvCTGiBivkjGF2hnTEH/PvfLc3N5\r\nSqJdWMR8Eqf1XUoPUsapA4ldO6sg9zMflIFNoxq6zQz1h+S9We26mIwG1l8p\r\nQtrEmeq/KgRuvBOGh3W3sgitGQMKlD7SrKeSeujZw4gyct6zVNZsasq43EmZ\r\nZ5SELYRRGWirMhPHOxDfJLVaaqz37j5CS88wnWMC7LYqr7pUJhC9FWrjMtjs\r\n3cLQZSKhpCnEO6ls9aOlyX8bGNJLqRl6q1Q=\r\n=EULW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4fbcdfec0dd3242cf86cf0855289d96b59abd508","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-07T04:51:01.093Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.14","@balena/jellyfish-environment":"^9.1.8","@balena/node-metrics-gatherer":"^6.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.14","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.57-renovate-typedoc-0-x-4fbcdfec0dd3242cf86cf0855289d96b59abd508_1649307196979_0.7629530733491192","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.57":{"name":"@balena/jellyfish-metrics","version":"2.0.57","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.57","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"62c46017cf602e0f749ae1642fa18b84c1cac84d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.57.tgz","fileCount":16,"integrity":"sha512-1vw82jvgkuhsxyKvL4CdkEUYtoYOtbP3cC0yDDBQmmwg4gzrxgrY9ghPSPJ0VNR8y3bzDa6jE0W/SRl3WlMgXg==","signatures":[{"sig":"MEQCIAThZkONyO0CY7yN4VhkbHaWc8XiIETANGCVCh9O2S6VAiALFWfNq7tf8xHH6AocCImE5fBpET2iOqdIGDGfHrAwWw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":149211,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiTqd1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrVCw/9Gp9f+9UPh7AB/p6Q58RkZkqeCHrO2P+9mW8/vbGw7cn2soc6\r\nM419Duvl/eeqmCu+BsT9bbjoDBWYG3CT+Lwxbsx6YWbXvAlMCw3TsGWYuhtz\r\nBpHzdvVVwc6npHBoRGwNaHVtmrJSwwPGZ+2n0QrAaJiDEzJkDudvhgovOSIf\r\nIXKWAxtPcnLvQDOoprr/ckhYkpTX8UiXY9uBT6BAwAeHdkMmwC3nTvUD/Wu3\r\nuvs3wdX3PKjPGhqoNuPZl/UrlMRZ/KoRqPVJ9fWYAycX2h6Jw4MkTtyvHFeH\r\nF558v2LLtcjlm+MwVmC2RxnSGU3M/P2XhwvuvqNQjJTDTxUJQCL72hDxhrBK\r\na7aaj37XgVi9w/Ee1TRrRraFlyt5MTjXUvkuhoSwYI8GGP9bOv54c5BwckxI\r\nPt4gb+gWcadNKwzxX9JFdbHl6o0CzKsO51ZLIGZGrXJlb33zL0bwhj1T1X+8\r\nxNE+zCRHbGts9waSb5RNAMiEV8B+2oK1QTk5sFs9Ww78tMPX4J6WjTdlqThC\r\nLEOTT2B3QEF8N3brq0Ao7qomB3ASJEpmJvaKM9btm3F9YnAE6MDUsZ3Omse6\r\nCyR6Uxt9RsBbLq1GGGfDMygnhmEymZnBwqh+YTEjbNqSmKIMdtZt5kUar5ul\r\nXfHS8RYizUuNeuWEKikJ9sMQTWOIcdOm0I8=\r\n=P2Xl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"63abf1e207c94e434ec74ea541a5642816a513b1","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-07T08:55:16.938Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.14","@balena/jellyfish-environment":"^9.1.8","@balena/node-metrics-gatherer":"^6.0.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.14","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.57_1649321845302_0.7049040495059433","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.58-renovate-internal-patch-286d6526659fab52f98dbb82b48882efc69d4481":{"name":"@balena/jellyfish-metrics","version":"2.0.58-renovate-internal-patch-286d6526659fab52f98dbb82b48882efc69d4481","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.58-renovate-internal-patch-286d6526659fab52f98dbb82b48882efc69d4481","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"90a59ee353f9e09bd9336fa6a439189bf3200696","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.58-renovate-internal-patch-286d6526659fab52f98dbb82b48882efc69d4481.tgz","fileCount":16,"integrity":"sha512-obyNZxu+LPVkMQaE1/yBSOWJYqYysYfjjd9YfsVa1Zk0FU5r1jV1UI6UX7ZBUUZiPPHqIB5d8+qwHCElKZGW5Q==","signatures":[{"sig":"MEYCIQCsqfKDcPeNSwBdr8/LTNpQx7W47efLUuJ2o/oVALc9cgIhAJRjoCw8Ba7djr7zXlUdJ84sB/hGL4M38wxuoLa4ATHD","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":149340,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiTqgkACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr6pQ/+MILaSGQPkrRB19iA6+GjaV4y0ERs9giSXXZsY+LRcXfy4wzT\r\nQFImXxwieKNqhsAMctTtu1iXLPh0hRFCT026flPxyPVNsooqejDd3Ok9EhiU\r\neiehhYeDclFqnZ3eP9/36cZCtUzp2+TMZRYDmKaupRS4wU0w9enNx1vKsazV\r\nJQGZ5atXMlvv4oDPu7E2kxbitLeaiUKblKmUjekD1HyWk/LHuLnJUz9sScDh\r\nW7UDR2GRWBLmhXxvDGgsf4VMMUayErg4ur0qQDH1Yi3jyDnTGv/LV64iGLIy\r\nwGQwbVa//zZiVtWQCOaRGixIC4v9Wd2eet0vYhB/sHBVngHbk9grjOjQTth4\r\nIMrKQSNuBtFmRTi8Jsi9R1X9Ha1MgkbpGH5sb/nxg60WiHRdoN/yEgh1rkI1\r\n3n3CIslyZltAxgaJxow8VCVGOjarypKhML6SwaYJrX9EW7luwtlos5EA/SuH\r\nwHHXjrrs8UDRQar/1HFSTFShsupIdpBPBy5pNrs2GyUV/8OMiVPvbWdmkQpd\r\neULL/6zzp8FW2VaN+MePzcFvfALFEyNQXmOcOHV32IUTDA6gUTpK3BmHnH24\r\nqtXTQd2n/nQlLPGfE4Jg/l1iMlyzQNij+b8ZPQWB3WO+GT5sC1KeHUoZ+ZA2\r\nXkeA8v7UAXuENlsGErhOILXaRp9crKvdObg=\r\n=BAR1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"286d6526659fab52f98dbb82b48882efc69d4481","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-07T08:57:33.616Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.15","@balena/jellyfish-environment":"^9.1.9","@balena/node-metrics-gatherer":"^6.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.14","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.58-renovate-internal-patch-286d6526659fab52f98dbb82b48882efc69d4481_1649322020210_0.9398911772445755","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.58":{"name":"@balena/jellyfish-metrics","version":"2.0.58","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.58","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3d51899200738e050b0e0e8eeb206fe30cfecf13","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.58.tgz","fileCount":16,"integrity":"sha512-OOUZSI0Ta1Q2DZadP/7dOwgKAvgkTGJO+fjkFPPhqrnevgZV5LcqXoxG4y6QF+sFpiJrH5GJ8ue+rTj0gNIMUQ==","signatures":[{"sig":"MEUCIQCTFs10iS5hwnvxYm3XSNSjzjbBIYcvLTTrgr/AdVgsvAIgAoBIiwCcxdt1HA2+YBu5xUIwAJcL/upFBzFl/IhkfEQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":149275,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiTqm8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp/UQ//fJG/WHpAs+I2YG0UMwNITV7uTZcqLIywDInmMausEkS2COFA\r\nX7vm1H0mHwkmVSdGWHU/5jK6nIkzBKOzlx6DwVE+RBqUgT1bBYnJp1fkn6ta\r\nF8ldKK7VS0iL5tccDzbW7LzLFuS0CqNsNtC/pmIBt6b3MXbgc87XjFwSZqKL\r\nIhyhhb/1fkE160mPgf3k9oXpg+iznJZRFn0jUw2dlAVd8XPM0LO5kgdl1qrv\r\n2ksSuSFWJV7c1rumeSGQu4LQprdFaGPCdxg4TcgfF844cTnNg42A3RF+DEUM\r\nX+3CBFddJk0+Y9EX5KHtl85cZsxtib1a9BJrgLHuPMzUBlG/15Ub/cr4bGBw\r\ni1b5TE+cXBSR1dQgKyku4U/JdJcuhK2HGS0rdxp8Q2QfaTTmRop1ouUEWVgN\r\nzK/z7wy9r5Bq/q5H8zAXNXv1hT3jhTx1/+ee5Tdw+ngysYV4B6/m25DZPb0V\r\nyW5cmWvwXIcY4VU5TV9eYHt+3ADGud97vTVN1a7T4dJB3pxh43Eat+e9BmKi\r\nq/e+CecgPFdAaqN9/G2WUQxBiVyvZSpsiZMvtKeIpXi6Yr9qUWl2OfAi1nnt\r\nIh+XCMuKijII0/5xYf4yZENkLsSZUbkGgdrqOL3KTNtCau/s7FI6SdvDkL0Y\r\nGDTlRVizRrcaoC+kxX7uT0u4whrSlfHPjrc=\r\n=4nvF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ac9b2a643ced88410a3a4fa27526e09734075674","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-07T09:05:17.164Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.15","@balena/jellyfish-environment":"^9.1.9","@balena/node-metrics-gatherer":"^6.0.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.14","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.58_1649322428407_0.7627020231409234","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.59-renovate-internal-patch-3a879ff17259854c775e200bad6e90bbc1321c72":{"name":"@balena/jellyfish-metrics","version":"2.0.59-renovate-internal-patch-3a879ff17259854c775e200bad6e90bbc1321c72","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.59-renovate-internal-patch-3a879ff17259854c775e200bad6e90bbc1321c72","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d137c66bf7f07c8c922ffbb5eabbd6edb39746a1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.59-renovate-internal-patch-3a879ff17259854c775e200bad6e90bbc1321c72.tgz","fileCount":16,"integrity":"sha512-TNv/AvdTYXqxBI/+zJRK6XyaJjo1AwBpApkWT5y2dvmzJigCcyU1QOcXajeQUlC33rmStwD75A4sCPBbSaWvPw==","signatures":[{"sig":"MEUCIFFNO4wIHaiuKfnbQcku9oUClRf3RJ2yt4gS+vQXX96aAiEAmxRvz0kr7Hw7nOU/2GUoCxnCIzSTJeC4HDoBdMTgFL4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":149404,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiTvH7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpN3g//QGjVAt+YQJjYwam9Hn2mCXNTFLr39n2CkzKCFmQPbuM8NEAb\r\nAEgV3FA8MuWfpIH4Kc/Q+KE/7MWji0RAZCRaxWO4I83Lc4w6drz6+O0rcdWk\r\nydzPiTD1AP78Xe5m4IW3pNFeucaEfrzAOA1PNUwih1NCC83HXqMKEHhStgHz\r\nUVQm++5h8nRsc+sguDClt4VXaLEHOjwgyOdN5kdZ6EpR2fUXM9e4KUzweotC\r\nt9Vgo1ha1jJuxJzRh2kzFCBln1ImJDIAaCEcea9ErQqSouK43sV15Uyp7zPL\r\nfT2wZnEIzfclJUL3o6VUR1+in70eePVu66pqG939S9hIIXsau/gsHg3gEAaZ\r\nycFfUlraqt5CSxcKmEtBwkNgPri0kjFrd692V55mb9WhukR2bKkBfRTU9f0u\r\nINoeWM8lj0lomMWtY6pn+zMEADQwWFtplOLLMhqpUX5EmuVCVt6FCG0YBWrg\r\nH1RmIHQEle4WisVjlRgNXVgS2QXl++5RVhWMtTxXDz78GUBCts7FXoZK+lZL\r\nDEdPo+BJvYASG9PzR7fpFOk6n2Wx+Oo44FU+z26uqZIbrubcIsIaUGRgZyrr\r\nZzuTcrIapHQn+GhX7jZTJWJStVSCN6jxhxoDg4YgCyKv3PLDlf4mbk6ReTB3\r\nPh53ysNz1mC8ujRAfmD+lCHhjlO9nTziJ2g=\r\n=bPNE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3a879ff17259854c775e200bad6e90bbc1321c72","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-07T14:13:09.127Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.16","@balena/jellyfish-environment":"^9.1.9","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.14","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.59-renovate-internal-patch-3a879ff17259854c775e200bad6e90bbc1321c72_1649340923267_0.7815225933714149","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.59":{"name":"@balena/jellyfish-metrics","version":"2.0.59","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.59","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6c14d3217e4846bf74771bf9fab2b4c0cce355db","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.59.tgz","fileCount":16,"integrity":"sha512-J7JLB4qOYEKbHL7PtrjuJsJC6D0F59c1Dum1ibWQOaZWBup7pYreI8opD3wk7HT/8ztsUXo+rsjSLpWzqlrS1w==","signatures":[{"sig":"MEUCIB7HQbSqnMYV28hsEs0VHbyggVvX73s/FDigLjwdcEmnAiEAm0VU9lefT3c6RdLb7cRwErOQKm2A6iYZRVmXrCU94mQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":149339,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiTvMEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpYPg/+IV+2V/iOdm+Y9jhAonzKUMuqhmZ/hDy/hfFrqrXc+HKVznQt\r\nP/k2RsjRxD3ocWMppm5HhtuEi2B63aVRNl6iQEAbgxOTjbChu7xQZqJp/CWj\r\nfifE+suiOczFjumtobr4bwutR9jqUdBtuDWAACL6kH49Wv0XYEVU9l+KTxRz\r\nBYuwxacFsYnab1kkgkPnxHJr+MtnFCJ6DsRHG8I97kVUTZiPkGBGpEyoMQQY\r\nsV/fNCt7mFp/aKChY3NVi3q2nDLqLznxgQTbkaJ1Nri71kaSH3ILqA9v2jPu\r\nVc0nl5BvgTUHLOUhnK+L1sqH5id6nOg/kH0z+cfIphWkvnRCp/2WUGxwomkG\r\njCqPnVsTI/2IY32hTOjoXuAUDDRQTCQibKmgab4u/JaS4ITYbgnW/AS5joAb\r\nFCW8OQIVa4WwX628NVkbQMhTrHHjFfTXcTy7b4FZUnJw+1U4BD1mIgKQZ5Cy\r\nhraDU8bnxqa8tby1aJ/oUd8AQEqD2x+J5x3VvpQxxCV8VMsGju62ryyUzTsY\r\nnUob+AVNyE7BWlWnZWNkfjm2X2pamLLPolsb4CDhL3cew9Wb6BGrJd99V/kz\r\nvS3rbYqcXKEfF0uObIK/1ba/X6m1WWHDPfw+NgXnNb9KeMUEta9iMOfX6w2w\r\naOnUOdXUL6i9KuH0Zomj7Na5ose+sxQM6pw=\r\n=Wet7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5418bea1ed80dc115e8af10f7b3fcfe137739834","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-07T14:17:59.298Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.16","@balena/jellyfish-environment":"^9.1.9","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.14","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.59_1649341187959_0.6392913040189108","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.60-renovate-typedoc-0-x-950e3f3e7bed472433feb40d2369a38068f23b29":{"name":"@balena/jellyfish-metrics","version":"2.0.60-renovate-typedoc-0-x-950e3f3e7bed472433feb40d2369a38068f23b29","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.60-renovate-typedoc-0-x-950e3f3e7bed472433feb40d2369a38068f23b29","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c41f3f47e7ba4bfae2c0cc4879da600df11b0912","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.60-renovate-typedoc-0-x-950e3f3e7bed472433feb40d2369a38068f23b29.tgz","fileCount":16,"integrity":"sha512-c40DdXfA3iXwldmfOGDuiZEs6mFWg3xWPcfVoKgEwL73d4h5lb/dAsUYDm9a4bm5PTSumXoNTfz9kSsd75qvuQ==","signatures":[{"sig":"MEQCICllGT0q5jUcROglrqknOgoLEb1LYi+d0R4FMm9cBER2AiA2G9xymd+LBStbis+KiNWC1B8q1y4qjgMvlvuAqXlcbg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":149482,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiVECaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmreTw//ezyL92MLc89WviuqWfKkA0t/BlNoTCp3oFEnqEEJqM36IjD/\r\nzmNEPv6RhCohr48bcAEU4YbUKnkTXZvQrOzhy926/4oi83zr9wTvUFUnAa2i\r\nhvaX2/juK1ZnoRb5+ucpLJKsWDqO9okBH6eEm00u7fAUmRbpPv3pbY22pTsv\r\nhS1fV679Dgj2ZqsLXn757d2xu/NSS5TcH5PaSKsyu9AxMUDqb10PC5Rfe9RY\r\nlv5U0vjLKSAjMnyJ5YNiq3xKKiFuFA7p6NKZnonsERvjOGXfLf0D4WTIYvjA\r\nf7qrhDk3Kordis7BjwEpXNpfLEP2RNFzByCc5FpdfNOkypIwKzE7dUI4Pg5x\r\n4RKgvVBShH8qhQs/+UeK7SWyGHn1NWh1yYr7Hbz7W38L7+MlJY6eCcQVVQJs\r\nDGmIX4SI3VsI4IlO4EBBnCDzB2ZSX4sDT+1KP8d8nZfaRxwFOxAlz2uNpjoM\r\ni5mWlumv0nm6teY8iFYyxGujYvWTwofv2yXdvMPiZQhofbY8HMVoC2C5inyZ\r\ngWCWQ3D9B96bw8JkznNOpkFNEeizSN5vRdog+8r2Tz4Zz8oeM8PnYrK11ut/\r\n0ewAlBfHVD9UGJW731UuQXAXK/QcVKu7LesnIaI22O660bg22ADUNexLfaJM\r\n3vQvEH5DN1NCatlQKlvBct641bRNNRXIzXs=\r\n=8UY4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"950e3f3e7bed472433feb40d2369a38068f23b29","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-11T14:47:25.367Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.16","@balena/jellyfish-environment":"^9.1.9","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.15","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.60-renovate-typedoc-0-x-950e3f3e7bed472433feb40d2369a38068f23b29_1649688729993_0.25771279854085827","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.60-random-port-fix-744da15b0cb69ff21b739c6c58d58b274029854b":{"name":"@balena/jellyfish-metrics","version":"2.0.60-random-port-fix-744da15b0cb69ff21b739c6c58d58b274029854b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.60-random-port-fix-744da15b0cb69ff21b739c6c58d58b274029854b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4554fd3442c0152cb2aaf1663d45b9e07a58a4a0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.60-random-port-fix-744da15b0cb69ff21b739c6c58d58b274029854b.tgz","fileCount":16,"integrity":"sha512-CdAeO2Q/WXu8gCS50lgfScpHivpzwgR7XikPKzY72F0eFDIvdlzeAlTelaOjDnmaMSUqzlh2WHShlDUKpVXpXA==","signatures":[{"sig":"MEUCIQDiwZi7k4GKA+T/LAqIJCH9qpDYjv4v3J78rbUmGOF5egIgOPBO1rPrmnJhgem/54pqjkpdTNM/mbvEl2EHIB5Gzxk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":149594,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiVEd3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmouRw//S0R2pyF9jN3yij+a/qcqeWf0BKxVbGcmXHQElfVTZdQGYXL5\r\nhec4J/y8LliGTyAYAJUam+Uajq/Y0I0xfMMPvD0fkfMVIsSXrKb3ey7XmCPi\r\nIUtVGpdpjkR3ff9Fp38KAPIVEdraJT6PD8tv+Pw4ZtFV/OnsGUzebKrko8rF\r\nV9Wrjowx9N16FAN73VoOpr6WaiZBetRQ69GCIeVdasTBWOZjZqd6HBDUXkLf\r\n0FFKCq3f1uBSmP0sEU1Uh9PUbgeTuxXXfFWLoBnqLOyxh1u08ioPQbCYq4i5\r\nojTK9JHhYuS0HVlAITyL2pbJEJhXrfRZDESzLFLk96C8Foy0zn+d8QnW0YkA\r\nSLWrHKtpZFp3joqdKis4IXL0f6r41nKENn2hnXCiaHAeX5U+TzgXmSzdwYMV\r\nB92saVg7t0HnWPKgEKhxC1M9KUpdB+n4SyPP411XqMU1cuXvnwzJLHRAANor\r\n2uZAsrMZRSK2bFEWPNbridSB+OOkMWQqVrqrhLvav+deo7khnGil+65eXlKv\r\nM5Y6lLm0yaj7woOcExL8eW/Fye4S8sJg71e/BWIJ5NBImyYhYllYqUD1HOpb\r\nfTDn+eSEDcglLvBOurCK4wNGZBIqu46tuNro2gKILfr9vQqbea6LCbiorKN5\r\nV7vvwa/4M4/5WOEa5Ujg7pDUH7fYO7MIusw=\r\n=xzwL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"744da15b0cb69ff21b739c6c58d58b274029854b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-11T15:18:24.814Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.16","@balena/jellyfish-environment":"^9.1.9","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.14","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.60-random-port-fix-744da15b0cb69ff21b739c6c58d58b274029854b_1649690487670_0.12318325311433997","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.60":{"name":"@balena/jellyfish-metrics","version":"2.0.60","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.60","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"dc96534f3c348643b3d3f06d8ba10322d733b230","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.60.tgz","fileCount":16,"integrity":"sha512-Wl4yVFxRwqgOmSQV81hJx80F2PP4K8/LNzo9/fiPMwPYh3J61ogdkCxQBR3vzuflRacSYiMv1PfJKCe6mYH3vA==","signatures":[{"sig":"MEUCIHG7tZOXsT6slfLZIy7DfwXBhv5hprEkZRRkTw0RKNXaAiEAsALlV3uocO4bGYkslMh/ZZA27hXwGIr8O+C9mrCPWx4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":149537,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiVMJaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp1AxAAjjWChWw3f16YLIMXQT3exYq9y/YmbEa+wNl1v+UB1FvKl+hJ\r\n55vu+HqzQCVTDMnHjAFR8PidTqXx/jjvSy6Am0+ypT98EVXEqWhCDQjBnnUH\r\nARjMmhy62l0vV7flZ0PARNJg8C0ZN+5C2eb0WhoTVv/PAKqz8/42Vh+r/HYR\r\nv0vLJrnZYNb7j0gGtUqDwQ2Q/5RBYr+H/MsBjBMVa7Z9e0//KVa5NrX15nyp\r\nahjE6ECwsmYEgoubiyGh3BNXJ+6ASQxoFUpbZLHj1cifcLuPC/PoCZ4hn2d2\r\nhrSqfisZ0p9G+JJt5weH4F92HfdAWkjiQEKEOVAcadjzPAhTteaEGCBJuXl4\r\n6bLozAIjmcrqbi/K24KoWDucAto6Ln772Ki8Lfxy9eKiUCMSse1JadlaXrQM\r\ncVLqPYmIMqyAX1eO2hNRDvL1j5QoLV8TCxdH1GUI3DvbF30G0ZAP41QgGpfZ\r\nEyPGPEpdHorb7MSftwzdfVEWCO+nb9HePfbdsm405UMBZOPxH02wDkv2xtEd\r\nPsuHukBcIwBSGxtkN6ai1D7Lj5eUo+eBm3HE2YDNtlSf/GxMoxXCqu2FHEC8\r\nuqKze4p7q8R4AXQllTfy4FYQk55Kn/yS3rDdinHAnbyz+KbOnfJ47uI1t1Al\r\nnwl+muRDDapsXjH3YigryUU4SP61WL2JqJM=\r\n=RN5m\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4dc27180d25744fe7bab858cf5e41dc48beceea3","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-12T00:03:51.992Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.16","@balena/jellyfish-environment":"^9.1.9","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.14","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.60_1649721946633_0.09053629707050881","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.61-renovate-typedoc-0-x-231b965916f8f94c0f686b306cf9d4684c62cec4":{"name":"@balena/jellyfish-metrics","version":"2.0.61-renovate-typedoc-0-x-231b965916f8f94c0f686b306cf9d4684c62cec4","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.61-renovate-typedoc-0-x-231b965916f8f94c0f686b306cf9d4684c62cec4","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"18170c7b7c97c872e291a65b74c5c65f7d9b81b1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.61-renovate-typedoc-0-x-231b965916f8f94c0f686b306cf9d4684c62cec4.tgz","fileCount":16,"integrity":"sha512-+whlOpkArmu1gWtG92FibzxGyWnKGHU06rhtU7hqK+OQ7ZrCL3GU7w8GQohUW68nZciqpFuztuTOQNEIzZZm5A==","signatures":[{"sig":"MEUCIQCp1Zrpp5ptXMD18w2K9+2juXLjuPV5gzr8jmO8pr9SEwIgbkODGFUPcp8BhCyGVRfRvbp7h5x2/MNJ+15t4diSIuo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":149680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiVMNbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmov9RAAo0fMclE/fT6Ow6CpUpfdi13EA7XdV5dH7ZJ1JWaFABC6I2Gt\r\n2CEYysls9Y+QRnK80sYLaYsYKbRwysIRUNQyXvuv36eYHSfYO0TS5UD1cLzv\r\ngdBDOEu4qW1wQxaM1UJWprbGLMCqHceOLLOUfKcYDNYy+piGi6zbu7NdVKB0\r\nWYW9c7Gdebxb186+f/Yy/vK/nDV9tK267ATNvJtSIuhS71Riw8wuz+p8wIVV\r\nJyoT4jCUq1vXYKcwCAuSDluq0lgB8FcOijwese+AELpX1xHG7caBNaxd9ZG/\r\namfROQYpQ/PLoBCJaPcoqYuymfu/aqCk5dDrnBjBDbIrJdbmTrTvmJCfggYW\r\nIlBjZo5B22IHQOLSewI9ZeVmaFlf2g1VBw6JXDoZrnBoD3CcTDm2xDk+jOAt\r\nTw1ppTIfbkhlU/i6F/OitZz5aCxN9vU1Lu8Ata+ovM65+d695E2He6ag6jq6\r\nMFCF/h9oK7y9R5hdMF1sD3RkcQT279BQRPGwzpQ/+eqYRbAfQ2eQwJKWlVwH\r\n/5LJ8JvLiGvXlLXcDfNJKzmIORKQtF1BHlZKeDcqiY9W2l+HHncuHElLJ7ku\r\nZUVopiIc4WJPyMMsF1odXdmpg8kfIo6nE0OQ67KGsMTSx6Ea0fUDvcKeSPbW\r\n2wWZTto3XlG+z4vLZ3qhB8BkIvaK66MjzJg=\r\n=Vq5v\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"231b965916f8f94c0f686b306cf9d4684c62cec4","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-12T00:07:33.754Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.16","@balena/jellyfish-environment":"^9.1.9","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.15","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.61-renovate-typedoc-0-x-231b965916f8f94c0f686b306cf9d4684c62cec4_1649722202731_0.07174631579981305","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.61":{"name":"@balena/jellyfish-metrics","version":"2.0.61","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.61","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"17f0ad7200b6570696900f556c4a2e2c59c802d3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.61.tgz","fileCount":16,"integrity":"sha512-5fu7gsaJzilYDd4kvXxTyPVttUJ5vnbqT2QbjeUrRJLgyAJ+ZwZuDBuaER0WNLBCKrB3WWBLTWM/Tm+OC/q0zA==","signatures":[{"sig":"MEUCIAfOixiUUjFWqNi6VxQgZKsoQWM7+Ru+cXlShZLj5/sSAiEA8kUnUUgpMLaI36MCOWRGXiXYGmPSkBRH6smkKGMrAmA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":149618,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiVMSoACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq8fA/9E8wZ8GawpgIzVqt1FdV0jDOhPdObPIVLAQXeJfpivqSkMnxk\r\nzQsRlDSIlLU5fIJeUv3yMkYNABjV1Mg/lwNoXgtjJfcEgcGs5Bva+TQlgGI4\r\n1vzsk3w6sORG+x8i3MDmWHgZmlYrJyhhQb3j+Rh+X+gNqA4IwJMzRW14ICqs\r\ngrTw65e6hf6HanLbWS2JgSfNTUCLxoTNV2meJLGMuOZfanELEhat+n5ATshO\r\n0JoEJRohQGxlcz8gV1YMD4tgleiLo+QUAiB/uNC00werblytrb3QV8QNVpoP\r\nJ3Xpyvxq+Wo7rsjrB7q0rEXIUOG9mOv4uULXD0SugvlBU9gcOznbr5HIgEJg\r\nPXXJpCITbsXwZNaZQHPceDeuT3x+mgdCtoYYOYia5k3EGb9IZ9hffDZh69TT\r\nzAkQ1EuoyPavx4YyiD3P7tqca4OKBnmtce/34rUelgtuTiMudMSIDsmSsrPr\r\n2KaCPnUrt8+xEMtMhnHc69Fo+qNMRelPstFYDnh0nUZ6FSZPnA3RBGC2j2y+\r\nHMLMR1sfyOfSw5UZR5CbMyN+gKZaexF+KUkhgzt25ebLfKb5W5cmHFUbPTRq\r\njJ64bq3KmSgbUub2lAEYbkI+7b8/8FQ+sRhjJvUozHIoHNGqIEoAtniXawtL\r\nFPPPrWeUD5kFuffh2qaSPaU9WbsQPlWC6T0=\r\n=d0rg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"1887435ab8023b30b0c332133af496c7d2d4d5bb","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-12T00:12:45.249Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.16","@balena/jellyfish-environment":"^9.1.9","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.15","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.61_1649722536111_0.5149710927121895","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.62-renovate-internal-patch-940d9b4ba35045e870b977f8c389cf95786c4f9b":{"name":"@balena/jellyfish-metrics","version":"2.0.62-renovate-internal-patch-940d9b4ba35045e870b977f8c389cf95786c4f9b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.62-renovate-internal-patch-940d9b4ba35045e870b977f8c389cf95786c4f9b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c2ca2a7d8913eeed84c3e7b373e84a8f42f23b2e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.62-renovate-internal-patch-940d9b4ba35045e870b977f8c389cf95786c4f9b.tgz","fileCount":16,"integrity":"sha512-I6mu3fhgUXSZY4nvxemLRSOumbFyHTwCrQp0RPlo0PsgUQ/iPPpcNL71nTKkyf1671m2dy/6FA+Tz/gzuQqXZw==","signatures":[{"sig":"MEQCIGrb6ukPmRt18DiLKKICKL4QvY4EBlJl8Oneq+YpAbVbAiAHPrUlkfFWP2dL8J37EHXAB8vWWZnH5rgVm9eYH9XrAQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":149748,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiVQ5CACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr1OQ//Wqquh7Crp1hGGiWJZkqv4cU0FMPApQJqP67Zv3IJK9/WIwey\r\nomYkfg6SdDUNJmHKJcYfCozAEDE3vCMUtjuLo4nOHZs5dqSHsJ7SwOpScm3q\r\nNB0sTU6HTZsctCz3Jn0Lb9hTVt5SwV6SDwsDm4KdQEdkGUW5H+2jSpFjB6ku\r\nkSuvaX5s7GA/ltSkfmGLp2R8X6dxE8YeYiK8mDUZRyAS9KVN36dUfiOiPKL+\r\nDyCoH0P3bn7EWVBXSW2kyOfj68i8AUHdLHZky0U6Bi3QikkJGS9pLD0IHLJE\r\ngzVbPH+pI4EPacjChGhVx2ASPPvZEUvPiVcIgWiSFM2qJVu2bWOyzB5ci+qF\r\neR/ScqTbMfojQs029+0qsLehWhu2rhBYAzahr8RibsXflgVHI7x/AczEBEHt\r\n4rVdfD8NNwBlU9pSpyld0wZMJjzImLfE48C8viLSTKErpRydvb/tvzP2Rszx\r\n6DRu+gX/qrMBftmCIByhoAUmg62QiY5Is/rtXQ3nLozIvUMiJpbdee4p2qr+\r\nGv31EMRmSfCXDtQGKkSkF9SN699sGHFRKulHQtOL6nD0mPcGhB/IbX9phfGR\r\nGmEFU7g6UPc2HsgojhMUVm40fb9ysYatPQ/GjjGNmO/vXORBFC7shsZ2M9M1\r\nPGf/ajp3pn2D2r3lbK86fZFK8sVOZw6KXb0=\r\n=4yBR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"940d9b4ba35045e870b977f8c389cf95786c4f9b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-12T05:26:05.484Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.18","@balena/jellyfish-environment":"^9.1.11","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.15","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.62-renovate-internal-patch-940d9b4ba35045e870b977f8c389cf95786c4f9b_1649741378339_0.6949594133314552","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.62":{"name":"@balena/jellyfish-metrics","version":"2.0.62","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.62","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cb32ed2771909a96493f6f1aa1fb49d96497a20b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.62.tgz","fileCount":16,"integrity":"sha512-mSLJgj9uGIReJEFYVV4gqY+y/wahrckWREOps340ihH5A1CjO461DlquTdrwqwnCPup2Q7lzyPf5wisd9tZyyQ==","signatures":[{"sig":"MEUCIQDWkvMm+IrJCe0+dnrtZWStcGpX/DhvRURMoRbV1OVZpAIgRzK6HNpoKMBKdS5Xz9CqsI7vU7mOc1QVZ526+ydpUgQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":149683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiVQ8mACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpS0g//btlYm52a7dh6A6vBilhDCM1Uo0q0vYrGrYxYNFWmb4geownf\r\ngyHcZABxAo8dWAcrMlni+mfJWu1AcdTbYNZOYU/t8mWNM3KeNCmQGzE550ow\r\n2KNTkbVuRN6kOGzRpeMmyx2RhfgPWLyevFKaknZhWb3Gvpif3IGhDruFfnIr\r\nt0/zlL4YDd+0eL0+1CyAoazvFgctB9fRIgf9CwytptVbUz7AZoCszsckfUpr\r\nMattCF+8MEL/HDjouG8/GLqZXYv/GinDrCPAefsEvdK7D070UvZP9yXtE1oq\r\nuOfGkonLE2fYVh/sSJIaWx2Gj+AOI31TOl4Duuo/on5RnAnmj90wNQW0pQjy\r\nmlTTiBLT0lKT0HisnRFCMOusNMf2oe8Bwdu8cBalzTYb7KEfOmote3n8RfJp\r\nbmLO1PBgUyo0ty+VTvbnHoJoQA26kO8QfEgMpkEzYjWvognyvCBRHnv9UZxg\r\n/wIjj/DiBFML8xMIHGSTbJTOOyZcahNpBRF13Dk+KA9zPbm2sxp4qbEp1fBT\r\nu9WmDJxZeUpwyeQ26nz+B0hI+kSN/pJxwJzvNy0rmomQ+xS7uaSxEL36NlCu\r\no+2uSRrJF/pgsJJhtTXbA4iE/surPpgQqc1+0vpFkvY47hQemT6EzNPaZ8fc\r\nPjy3k0Mt9Mk0p6B3X/RZsvbnoh7LzyZQEuw=\r\n=I1uD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9147effa55de71229cb8e8977c5b40c04861418a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-12T05:31:20.485Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.18","@balena/jellyfish-environment":"^9.1.11","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.15","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.62_1649741605948_0.6799575259551629","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.63-renovate-internal-patch-64c2ef66ee83d881a47fb5daa4b44ada2b9d53ba":{"name":"@balena/jellyfish-metrics","version":"2.0.63-renovate-internal-patch-64c2ef66ee83d881a47fb5daa4b44ada2b9d53ba","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.63-renovate-internal-patch-64c2ef66ee83d881a47fb5daa4b44ada2b9d53ba","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"eb763e32765c3253f4b3dc9b53c399e3982ff8be","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.63-renovate-internal-patch-64c2ef66ee83d881a47fb5daa4b44ada2b9d53ba.tgz","fileCount":16,"integrity":"sha512-EQ/gDTUer2PdZU9UOhcDpbv5aOthn75+MW1blBkO9NToqPxYPNXWZZkMCU1AYdekn/ZG/JwNnpnyIj/2DCP9qg==","signatures":[{"sig":"MEUCIB8s4pVxulqDvQIbthrolD/D6nSCNLUIx9EoNxdl34ltAiEAqNMi4Vd28GcBdOMEzcws4VGukaKsC0svNwHdwoDXURw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":149812,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiVWUJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrZPQ/+Ix9Q5obweHjNK6TRzTA8XSeR/z4XCeW+vicZlm01n7rP3S+X\r\nNwVHx8wHHY3woyIj1bbFyYHVsPNFjwexfUfGeo5AtMo+JIHBEIKHQcCqfL61\r\nxrs2mWODqeTk5RFjM/Y8NKFlkNq+PbsD0IirDvoLefCUU2+cGEDz6vpbQMTJ\r\n/54o3L9xF5X965TZ7+OoSZF7bkbFIcVejSnhYbiTMt5rs6uPyKQWo+HrgKe4\r\nXQEPeYF50lLTuXNYVJ8Co9M4OJqST+hedjMHcPTwKQpcUa4YyN8DzUyb3XxE\r\nOfjRUqdIHH6MhVSm66lb0Y0r9irVlmpZ7M3EGvShPQ/Or04YWPUrrz5S1odD\r\nM40d4UGDj6rdBu6383xCivnCApyZq9QH8l7rYQAiiMu4H087A3KxkjKOdf0f\r\nFw7pVLHsrDXFHAeNZfqbIzk/Xk15M481y+BFv3NZAiJ5H9xQGDeDYX1A+SXT\r\n5tW5FKzlRHlSDDBSSjU2GJj/8TG2H6tGEs8dyFEIweZeKjbQkWpzKKfDGnmF\r\nQX/j9sF3jIhPIboNBH1QJyYdDvWgfBy9Bzws2LofunC4VgSn/o6zepk5hkvi\r\n3J15X/mbfSrw+pr1mIhRDU1wdouvzootGd9OkYgkHRJhZ+rZ6wpspcuxXume\r\nuin7Fjz9U/llIxBms0syx/zXqHQIQQa73qQ=\r\n=S1Ns\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"64c2ef66ee83d881a47fb5daa4b44ada2b9d53ba","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-12T11:32:35.002Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.19","@balena/jellyfish-environment":"^9.1.12","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.15","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.63-renovate-internal-patch-64c2ef66ee83d881a47fb5daa4b44ada2b9d53ba_1649763593320_0.8516837244438697","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.63":{"name":"@balena/jellyfish-metrics","version":"2.0.63","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.63","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bff1912831bd8a9e4ecda014e72f848b02b37f66","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.63.tgz","fileCount":16,"integrity":"sha512-76Yx/5/p4oH9qmiA9F2Mxd1YivvUSkfdP2MtuGhGQBmAt0IZIQRCIDnEDtMJkh6+pz8v963BgaFNo+a5ixQIWA==","signatures":[{"sig":"MEUCIQC1pv5s7N5d2QkmtvsdurKqRPgLGmXBl7VdktbnE9EeYwIgJokrkKAfrq6WzMv2l8rbXJasKu6QPGCp8bRzBpH5C1E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":149747,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiVWYVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqBvA//VDpIe3jm5ksNZZ/JtOzn+J1F2XfdoG96adE7jkqzZkDvv4dw\r\nqcK9TPW5bdG9ywAEtjztzFUN+TD5mFoyJ2nzTNSu8z0W2kaYMpwjoG5ycqL8\r\n0gg0jWfyUzB88yzyXLvNyUFiKPn4QGZYWGo+sXdvZH5RjlYkKJZ1XZQ2r/9C\r\nnDsBUryGydUEOYMReMFjEas/QRrwUsnghL5+B5rLX4InhppDlR2h71PTYbcH\r\nIB6osEuIpsCJN+47a0gvmJzI1zMERDUc98mEM8aTGEB5lTZRZvLlJeZ0FQoB\r\nr68kD2JDXNwvdkC7fN6C1EA3UAhVH9UIAwCEGmhkSTHEUZsXK5bgEhc8qRi+\r\nJupP+rCe0bElnEhnw0zty8AmE8WA3JrL/s3lnADqMU2+wD1XKkm+NknzZsKV\r\nbU+8h01kbegxYO6gmn4uoJWQUCBnk6hb5x3vp3i8X4MbjhG5i45xvZ+eJoLy\r\nJEYmcuJoeDTLoYG5+vlftBY6U/8b3NPKAJOEaF8oq4R3CWg0RWgzzr1PQmVh\r\nVrviHmYGfxo6N8DXq+4EmJ23ukPqG6HgzsVAPRdsWjvYiwiMbr1zhyVQtZti\r\n2pbkZmkT7ku+x82RrdOAD/IVVKRDVhtgFM84yGlxi6WiacQHczjP9bPfPHVs\r\nBwSku0gqLRgBPJxc8ez15j8Ds/GxAQ/vPq4=\r\n=piER\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9f9cdb8dd136783f591d35bf83e6b075b94d7c6d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-12T11:41:46.309Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.19","@balena/jellyfish-environment":"^9.1.12","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.15","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.63_1649763861025_0.03274220483975854","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.64-repo-sync-jellyfish-config-default-60e69c91b70d3a4561d188aaae7dbd03f6a0713b":{"name":"@balena/jellyfish-metrics","version":"2.0.64-repo-sync-jellyfish-config-default-60e69c91b70d3a4561d188aaae7dbd03f6a0713b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.64-repo-sync-jellyfish-config-default-60e69c91b70d3a4561d188aaae7dbd03f6a0713b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fe22cb145709e0e2436a8fa081227d0fb8a20181","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.64-repo-sync-jellyfish-config-default-60e69c91b70d3a4561d188aaae7dbd03f6a0713b.tgz","fileCount":16,"integrity":"sha512-BXIR+NEZaDrz4djJF2sNX+rfVg6EiBI39gFlG9UxhbHCYqvNdim9Z+I6Ky5V13Q/nzFGA6sNy+vFYdsdrrHhZg==","signatures":[{"sig":"MEUCIQDw0gVVtzcEMo2MbBonBOhCRO9Pu2JSfWfeKQBW26KX5QIgaV5+PI6LeBtMq5q3xRoqDkIj9i06ozavtXfjwGe/43Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":149915,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiWNaSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmosow//XC9O8w5eAR4EjtgSxtbuTB9xAsjsZrSK5RrubmvrvDETlv+2\r\n6ax8Eb2Shlg+RG2gBT9zBbOX6f2Ot11aShVO3MSmAjS9E6iW5u1v5+sVzIn2\r\n8gQus/o9711ZmCG+Pn4CnADCEYR3vuWtFl9pf5gBK5DFshOSDP/Vf07QY5k8\r\ngjVcu5fFiSzNiSOZRADIV/au2TyIablV0FAqH1E0R5rYOlcCw/9ZACqZglc9\r\nMUjcpDZfXZtSkguVuwvXy4b9CEkQepLLN+CjsZCvrfaJpHtF7YppGYmPFd4W\r\nOnRsud4ZD7nCAae/bAQCASNXqF8xwypzrTvHrMNJ65CwVmjbQU6YA69PMlns\r\nGtlW3CALu8nMwpKY6uMqRdNeQdqAQ4XVysbWVNvEHL8zpJMyS1rtE0SZrrpc\r\n33LPTO5EydgSV6MNlyLv0X85IgyKxxDmH3jYaIzToNQhFGaC+ZTozhJA+f+z\r\nZek5iCn/7CTZxuZJ9tzBrpSOQLPjcW7pYBkPd3plqCpP/YDxXUVUOlua2eBS\r\npnTC0ePvpM4PCDyaF3MUQeJct3/Bj/n56JyXbKxpacIu2UoN3Vo0b6oixANo\r\nppSbTRZP/kj3ocP7iC8MPebdoS3mCWVU5OMnjuvx4Pscv4oxx5MnGE8UKy8V\r\nJ8Y8gTN2TzcKTPyMk6VQ6SEpBZhYFG+Hb9U=\r\n=9xCy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"60e69c91b70d3a4561d188aaae7dbd03f6a0713b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-15T02:17:50.234Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.19","@balena/jellyfish-environment":"^9.1.12","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.15","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.64-repo-sync-jellyfish-config-default-60e69c91b70d3a4561d188aaae7dbd03f6a0713b_1649989266522_0.41982792405713054","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.64":{"name":"@balena/jellyfish-metrics","version":"2.0.64","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.64","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7f3f587d616a24fb4c97c6567b007d5a83f44235","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.64.tgz","fileCount":16,"integrity":"sha512-jPDiQjZYw9frCU6FD6l0y0jwBSUXP2GuMwEbh3/59gy+DzDIozSGtaqN/SF6QDKODvaMqgIUNWe2AP2Fp0y5fw==","signatures":[{"sig":"MEQCIBum9aKa8H5JVMB7zdPe4+r8BDhs/+R38FZOF6KnsxHAAiBbShC2QUgKZtCk7JhjAfA+iNhsIfHcPmUSJ5Fm2vM4Qg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":149839,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiWNhZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqz7A//ZcZoIoBX6hSwssEol9BHKm+SUQpEbgkVGjydfAlFHhBh3Afa\r\nc2qha4Abu6lOZZ7e8jA/O3z7l5X9TrPdM6B5aMr2ETupGk3vlLiHKXxmhQKA\r\ngF+V+Bfw00ZqgbsM6Xe32bns25sKxGg6dznHoVNvyB9KbmfTChBMwMElE00p\r\njoytaEx+5ogHOPtaDqmB9qqXEq94N20A4Kx4tp5jQlI2YQTvRbXc34Xx2xaP\r\nsjT+eDjXRvjqB2QqKnnqEuNI1ApFWbKGWUsXPiMp0fipaxD29KZUC0C+GGiT\r\nKTbai+mII8h06mrYhU/JgSZSbDTpv8qLIhIfClPXX5GyPk/8SOK09xL+qHM2\r\nPKRvTvE3yCqxQqH4tPW239CtLJHnjfKUgX0P1ey7n9TGN8ypWatg5yWPQs+w\r\n0rBOMOgKBYvf7F8i5NqVMzz3qp7W4NNlAiRDvi5k5HNhySQDlg1o+X6gGagV\r\n6VCKZwwbvbxXZ3mjoFL0XKqsH0TjaSQaFBU5T2oMu9mUOaJY8fmFTWm/oiEG\r\nItFTFExIarCdq4hPRWgEIrtzQ7b9yTiQ66RQIGes5o9Ub2Xl05JZEnql3Shh\r\nd1pupLA/Ts2V8xCht+3hMFBY2+2yyA+JDCW/NyLBvPAUHeGv0bn1eD/N/Hl4\r\nu6zA5lbDNrdho7WMSSaEMb2SSOqOofcMS7E=\r\n=fOkD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f5c05eb7fa53863c512488d71a2c9bb43b98b3ea","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-15T02:25:21.609Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.19","@balena/jellyfish-environment":"^9.1.12","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.15","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.64_1649989721507_0.46615032990308136","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.65-renovate-internal-patch-fc6a04412c9863ea0b33b05960aa7eaac701077d":{"name":"@balena/jellyfish-metrics","version":"2.0.65-renovate-internal-patch-fc6a04412c9863ea0b33b05960aa7eaac701077d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.65-renovate-internal-patch-fc6a04412c9863ea0b33b05960aa7eaac701077d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1a3c38eb47b3a3cf540684cf6ffc01a1cefa716e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.65-renovate-internal-patch-fc6a04412c9863ea0b33b05960aa7eaac701077d.tgz","fileCount":16,"integrity":"sha512-TCHmQlt0P555JZgdDIuI99ITGlhl9eUf2GJm+BLWxsn2t0pxlDEE6lYlCS8heO9P2UMYQEaVWo4S0s1cP/KkCQ==","signatures":[{"sig":"MEYCIQCQFX7pSiS5816ac7pIhXY27DY6LZ/2G8rgd6lSeralNQIhAIBXhXQ4Qvmy4VsJ5X1qjzQ7Ff3nnbvH03PXYvJmatAD","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":149968,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiWYQGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpIDRAAhJdqUzlD+AsTFEkkcSfFvNdApdbQHORfn5uwvZVXYGPL0KRP\r\nOD9Tg4k5RUWgwfrOrE427zRfZggaznY4opJAcStZNsV/uj5gHWlb/1sOcBdC\r\nz5BgvJ5BkHL53c8kBQSa13TGMsKk4aPr+sfAINxOoO5pbG9bhy+jshGbOZ3Y\r\nDiJL0B4Ey7+5MQIEDKg9PiepHGZEnzSUVDXTSNVc9uyTATqKGV0VmFJjATMt\r\nXGCroaHUWMnOPb9QFZua42b+Krz4u8TVGyG4pRzevpDH13IxLcrJlk8WxLpz\r\nYIrUkeXngWLeaHcQf/limzgh5tQkaEjOzI1Vd429SNm4CwFMEMkGMSkzkC3e\r\n/2J3/2Q2zoF+R+1OeSOspXbRu5uwN9LBg7OqBFWbSfIJrTQlOiHN35ZPYOAr\r\nhb0V3JjINAVO7ek4f/H5PtVzcJAUKhkFYijMbdbi7K14vpXako8EvhByLTtH\r\nMy9P/yRtkCeOn4sUl4mmsPR4z69YAlRM1z2kVIXbVrCZJKhbgt276alhkYCx\r\n6/tJliwcTM9pXKIaV8DkW49rISkpRqpCxLLc+gmw8U/ZZeYACVfHsCzDSXHB\r\nYQYhE2N4GCpL1sRjTvo+nGT62zf655+sYnX/mA9GlknlWxS4cm+qsvhUY3PP\r\nCm6uAG1JvAuTgSwq8N+KkyKZjdWtiO1RIMo=\r\n=n+nF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"fc6a04412c9863ea0b33b05960aa7eaac701077d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-15T14:37:36.893Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.20","@balena/jellyfish-environment":"^9.1.19","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.15","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.65-renovate-internal-patch-fc6a04412c9863ea0b33b05960aa7eaac701077d_1650033670135_0.27474098019737014","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.65":{"name":"@balena/jellyfish-metrics","version":"2.0.65","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.65","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"05bf34cf3bd0fda5115a4779f6eee76e10172822","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.65.tgz","fileCount":16,"integrity":"sha512-85bhnFA4t2yOSQYFYar3hXOTgXFqJ/qmFJSSWf4EJzMXaEv4Jlw3MxR8HBY6192mrzPpatQ5sk/8ankrOWc8uw==","signatures":[{"sig":"MEQCIDzu+5RO/96fLrrjtJODWRFPBE0yU/1nk2kAFZqe/LnIAiA7lITMzjYduc/5TKTWgAIWX3I7DISJg/cFRO8l/ezo2g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":149903,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiWYT/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpI7Q//abmPQlg1XzHL4cJT3vto/cTWX7+fMZcAiPvSGgrGp3K1Ll+t\r\nsCfjPtwtMByeCrS1xXErmJ2mDvGJzVgrfDjCVWLCXpH7T4GX+tN0oD8nnKFO\r\ndAQLmJWllgHdhuOX2K0WKJaAQCoiNQfexPM/tW4s83WEONU9BRSMvDpT0pTl\r\nm6NGKsPtBEnUcgvYkMovkWdixHaoQf3n5VlTMpa/P07harmKtt7xD2HV1EJv\r\nE8oxhJHQiBPHDiTBSeVzRtCKcp4NdNUw/2uLbGwf8DcmHegG4LYJFPytzsnc\r\nNvupQZA71GAxLHIqS/rhrOvC5wWETZzKGl0J76H3y8tj6K7wtWXGNNGQc6oT\r\nOYfkdbHsR7Lgpd6pN3E8oArZL4CHsoO1LO6ZIoCZOeE8j2dacUInunYJ4VtF\r\nINZCAdPGrwMVbewDNP1H5bCGnZEjqyRUvxjfhbZoe2KFHPGqRCYgeeph+Mex\r\nLURv4dsNJE+A5fxtvWK1yxRE1NO9+ScO5QDIOLdifVtvlwiHLUnL2wAvZpor\r\n3C85w04Q1YJ+cp3KDBlPaqTU3ModKaHQe8AAbIt3PJkrsIfijvIuLtlHkd3X\r\nmW/lMpgLMDTdDrmyZgw1FhaPulofm23Tfz7XUutDe9LUE3cHnek4YEkeTqg8\r\nQeAwSoT9mBarurf3uCFBqliLHUp6K0Astpo=\r\n=Yp3x\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c4ff6810468caab7db15917acdd04e1d30ce0c3e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-15T14:42:50.906Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.20","@balena/jellyfish-environment":"^9.1.19","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.15","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.65_1650033919329_0.14988330090915292","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.66-renovate-balena-jellyfish-environment-10-x-c24b6cf0b360d5244934153df21c132cc547e98e":{"name":"@balena/jellyfish-metrics","version":"2.0.66-renovate-balena-jellyfish-environment-10-x-c24b6cf0b360d5244934153df21c132cc547e98e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.66-renovate-balena-jellyfish-environment-10-x-c24b6cf0b360d5244934153df21c132cc547e98e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"99371196c51d86be0cf44cf2667bca30f506dfe5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.66-renovate-balena-jellyfish-environment-10-x-c24b6cf0b360d5244934153df21c132cc547e98e.tgz","fileCount":16,"integrity":"sha512-ZF9Wxeb2pwWDUUJ+BgJaeHaGO3c/tVHBKy1imgwBpBJDmU9zT0OL2hffYHxHjJ2oikgHcHCD7ydFMPJN9Ds5Iw==","signatures":[{"sig":"MEUCIQDSMoTNMdAZPJio10zuKq3e0DZK9LOngkoENyky9C40jwIgbruyWlv/AnIQG0/mmshoKd6nEXvGYEIjCCqO1mtgV8w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":150088,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiWly7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpLlA//QYrWc00Wou/t0jel9ztew1TUm7tBPYXa5vE/nxyfBIyJ1JXD\r\n9VLNVRio9PCLhNReG1UMD2+lErDThwNmHtsLHerf9I5MZ8E/ViwHvb4qgYUB\r\njeZF17LOHdvBrPTGeCFtc6gSM5rOOEjYvD/O9Mz0LTo+5prFMolSTa5rsXiL\r\noqEWy7lnTLE568E2bn5ZyZTCoKJDV9EU/Gvw2eCEU9vM7kpZ6STdfBPVHEM1\r\nyDmq06hUWcg83eJcopwKYYd/nRqonaq/20wPVD10W8V5YK+5IqLAlWBgPOgn\r\nBS69qEYDNs+iPvEHfF9spwlFZ+EgAROIM9kAvtJNL4rkrLNvWTm5tEoVXXJl\r\nRvfvSbY2hVrvNKv3T2GlZgf38r1GHCpKbrgQeqt7tdupdSGC+ptseORYBP+E\r\n6q0y/VKKm2t2ZqQPZlJ4kpXrDPIKWG41IygeoHO89qD/Tk6bHIVgF230TMFe\r\np6HuBK1hNmOV2Xj7gTuZhogCK1G4ff+w0cOC4JBCK2UJD9PVuI7ScyIbCb9q\r\nRnCFNMrtRz+cVP2QE/bWUg6BUCkCSIVCNZ9vEVr3N4wwBC6hId+4M6GpLF/q\r\n73K4+R0umKjjRGDd9Sp39HgeY9d2B0KNKeG2+hZQTtp8X5W6pKm2p77bSJef\r\nXhnjj/G82jY4hz76jjoajOXd0e+Y5lVpxV4=\r\n=9e05\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c24b6cf0b360d5244934153df21c132cc547e98e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-16T06:02:11.079Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.20","@balena/jellyfish-environment":"^10.0.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.15","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/uuid":"^8.3.4","lint-staged":"^12.3.7","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.66-renovate-balena-jellyfish-environment-10-x-c24b6cf0b360d5244934153df21c132cc547e98e_1650089147424_0.6099050006438278","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.66-renovate-external-non-major-6ece914a59061519032923fa4f5d897b28134099":{"name":"@balena/jellyfish-metrics","version":"2.0.66-renovate-external-non-major-6ece914a59061519032923fa4f5d897b28134099","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.66-renovate-external-non-major-6ece914a59061519032923fa4f5d897b28134099","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fed239fce472d7d437628ae919044c2487f58e84","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.66-renovate-external-non-major-6ece914a59061519032923fa4f5d897b28134099.tgz","fileCount":16,"integrity":"sha512-fodLWaqX5qBIwe4c82vTSigM1cchzSa2U8t0J/xR79OrYhxvnFC4pt/rIQ/+OAPsyS0Ox6VpZ0fhGdCSzKCyEg==","signatures":[{"sig":"MEQCIGGVmOQ7U6NcHAV3CqlQLh3a6xOl+di3laMvK4K+4EiqAiAcXLf5E2B49xT/LqKrUwKI8j1u/QgZv7N73cXBUNFSSw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":150040,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiWlzLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqHow//Td1f6R3RT1H7Kvl3CYzdj88Id29NPmxBosf0+tbJJxbKR7Hq\r\nVHB732QHuq3yy3H7PStn6WAo45UdadA586mAhXL/5cqjkcJLNcfm9Aeiuu33\r\nldVjq7lhWSn0+HOzNQ+SHelkhHhT/rJVTlgFlAMSVJ2xFcBqdgrUUIBLZtrB\r\nDOdnGStw3r4BUXJTV5VaVEHdUM/ixMZlzeXTKTHsIyEqgDXt8/oju75F1ciY\r\n0G2x0EqbLnyIzq+rKJz0Tks0WjXyfIDjyKAyo5f0wG5dUC3uk2nkK8dM4YJq\r\nkBsZSL34WeDY4oaKrJvTo/Osq0QXGkS3Mhu+F72Wp53lMz/D7MlZHdbe91gK\r\nTfeAf2AwPYOgqhkzBE+WvWo7GCGPavVmkRPDBzbGCllA4iWfDPylYDJegyVO\r\ntIIONcYpSKuHKWo7XNUHFdS1eQMhNQYO401rlshj3PEH9yJVNgPumWLesNuP\r\nm2yFax9/5/3u62UknDe27FpNeGXvpFUNzyrWhC/fSh0MXguQUiDs+8ziZmEu\r\n1dJhKqu1seE3b8xB1WfX7y4SgMEZo94/b6SHhzOG2l3AUp0DJ86caZ9xPzzq\r\nVSEWS2/O/AWfmmWDhFzZFXt2piI6kNkXYK2LofO5AAcNdwKQr9FB/1oOz2RY\r\nad7LQlxGtm5r2UJzPAyLziGEUC1h/rapmtw=\r\n=wn2k\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6ece914a59061519032923fa4f5d897b28134099","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-16T06:01:45.977Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.20","@balena/jellyfish-environment":"^9.1.19","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.15","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.27","@types/uuid":"^8.3.4","lint-staged":"^12.3.8","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.66-renovate-external-non-major-6ece914a59061519032923fa4f5d897b28134099_1650089163551_0.7451220323328771","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.66":{"name":"@balena/jellyfish-metrics","version":"2.0.66","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.66","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"19751039ab2de211289f4046b4b4d78135b23e5e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.66.tgz","fileCount":16,"integrity":"sha512-ix+ZBS/giLChGpuL8BVyRq91IJgDIRLzvTNGCcPg+95pF3yQAHZj5bm/0brHNpllJivY6+gNEuLtLSMTdejzOQ==","signatures":[{"sig":"MEYCIQCEdv5a+oe2e2KGCsGOFElz93WHtl85jMy0WN/YJ4jYfwIhAIQKHOGGx0aj+7iIjk4D7t7kRkosvsgIA0dGBq7jiGjG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":149971,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiWl34ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmolMhAAj2/nCrmOzNEVm6kVp7KZRB5hGK0X7ePTv0yXa7GCtlchhf+7\r\nD3/pbV6xZYcSvOx9Us3MDT4SbTnwhFa28Bmn/XOXhfsYYAIv0XVpz8mXTT3f\r\nx+XUnLa5rVXXQA/ZNqapdegtf5j1rJRXdi2VhE/algpAZtwCI4DhLUhepPTT\r\nthPzOfytxCVMs3eG8cuZai2vV+I17CRuCVdk4Bg1j6MFcWW6CIfPv4j67INv\r\nIYLxwoFPH6YMxwSqWUM666mBTwVZ5gosy+E2N+/afaQch4I+dM6zHtXWTyJo\r\nZ2J3y4w26gNvvYQxLuMgW5pvT8XXRnAwP7N2BlzX5uqXYgt2YXdKpo80x5Z1\r\nMTl/R8dSDTpK+XNETkIOqEL+w3tuxBmFTU+jmSnWSkVPj6UaJGBe8Vgo2l5R\r\nqqqVXDJSEVVMo90chJQX/e76Sx47OJk9w4LXbkGr0xuG8Bhvv2ZDqxVutXF7\r\nY7BnXi94eNaqqswkiAsHR8uqvEgiR4TmGDYoqRYhc1YFu18g7GuC8PcaXW8A\r\nFuLN+ocVna+GueSldWsVEeI8Hjrc99A5srdJxheMjMuA9ut3i1dUqz27CZx7\r\n8kZKlKowhmoFR4jhrnRz4QGHQavC6JKSBAuDFepBQL1tVR9UD8v9SzZBDDZw\r\neeI8i5v1oBms7Tmh+q5J52v/ZHezo0R6cts=\r\n=jbaY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0f048492395bf6927e9a989165a4930852d699b3","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-16T06:07:44.558Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.20","@balena/jellyfish-environment":"^9.1.19","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.15","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.27","@types/uuid":"^8.3.4","lint-staged":"^12.3.8","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.66_1650089463774_0.431238492054806","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.67-renovate-balena-jellyfish-environment-10-x-b4f0843cfac6cbf2636298fc44ab6588373fbc8d":{"name":"@balena/jellyfish-metrics","version":"2.0.67-renovate-balena-jellyfish-environment-10-x-b4f0843cfac6cbf2636298fc44ab6588373fbc8d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.67-renovate-balena-jellyfish-environment-10-x-b4f0843cfac6cbf2636298fc44ab6588373fbc8d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"baaa379193c6b54cdba8217015f1f0e04acfd0e9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.67-renovate-balena-jellyfish-environment-10-x-b4f0843cfac6cbf2636298fc44ab6588373fbc8d.tgz","fileCount":16,"integrity":"sha512-stjwcNYinppqKr1qY5PmcSESI4AFMQnrTIBaNQb/3nqNali60LWLI/pFkH2UVM5Esh1MsLoLlkThxtbyQj9xhw==","signatures":[{"sig":"MEUCIQC3i2l9/AqDtJnml9c6KBB0Y/NQaRBl0RUQ7vZjc+rsgQIgASYK7NV+URivX+vmEnkAw8723QVQ7bh19ucgVWoYnqY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":150156,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiWl8qACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoC2A/9FBB3fjkTSXV5WvDDokGX6Pmgz44s7Ie7Kizevi/EXs1yY3FR\r\nr+NR3/eKsDZnbCNd/0chevbLnzUJYMH8Dxcs/qJJFXDEKeEOfQ0G2ggJnU2U\r\nuhIYhNYC4pwynlK8Wz369WOC+lJR4/OsTkdJ3bWJ8EHPvuRXgi3og8lJp8xT\r\ntdUjyH+GLK3VwbltpP9qvqAQpZpsM3H3jcqwGtiblaJdyxbzyRNJQD/9Cqju\r\nX11tnEbtbPXDG1kRE+Mz93tF4cxhylQCQ4qMHRhIxMZBOB5LNPOqBWX75yTH\r\nuyhfEGpzd3B511RGZaaGsw2J5Nyb+wbFQ5X8NjeihPT97mh4Iymh6G7bRyag\r\nMpIxnxogxPmJwM5dXRVGid8sjw9AOV1iMJF4+LLVGGJIilbnM1kNXUGNQlqc\r\nuiv9U5hGrswrJSpVew5IPCHOgcFLcvm82I/72YJ5zif7ZqJKne7r8/79Kwny\r\nMCT1fpDFmJINabhMaSvcqUF1yd9RsrZN7D3zOFg9rsIKOnSCW+x1KG+DG289\r\ne0uLSf5oWije+0MGzZNl2C94zO3hTD8uGM/epqK3BJCc5My/4UHLs9bhwC3r\r\nXIz++5ENWsarTbG8B884lcZ5l09SACDjMIs4lAL7OUTuAdC9gXp3wb5nz92O\r\n2N/2wcxLrWJj1TFSroF3mX6Vv5SaeLRzn5E=\r\n=69Kr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b4f0843cfac6cbf2636298fc44ab6588373fbc8d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-16T06:10:46.216Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.20","@balena/jellyfish-environment":"^10.0.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.15","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.27","@types/uuid":"^8.3.4","lint-staged":"^12.3.8","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.67-renovate-balena-jellyfish-environment-10-x-b4f0843cfac6cbf2636298fc44ab6588373fbc8d_1650089769986_0.7145158544985308","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.67":{"name":"@balena/jellyfish-metrics","version":"2.0.67","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.67","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6873702972d7871b816340ae4cdfa1f4653b1d81","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.67.tgz","fileCount":16,"integrity":"sha512-Y0kYMliFCNLTE3YC0Kk5nJilOBHPpy3Uurd2JmmJCHa9hVqC9ZLfFOVOjaUFydQLiAYY4JAOjEY7gGkovesQQQ==","signatures":[{"sig":"MEQCIAiyh6flo/uKcJZO3eCLjQ7QE7GLG2O727lXYG4h2EnBAiAYqOelanKhhWP6jmY8z6BreS3PN+6Dw4tRMqyrS/qx/A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":150072,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiWo7xACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqFYBAAmWvwqrnA1I9sfUzv/rR1yeKct0gfxjxziuPD6UPFYDMSiurO\r\nKbbxbINZzNhfcSIcAE146dzdmBzgqf34sTYh6zvtBO0jF2O/1T0YOJ196MPr\r\n5wpD9vDRAHFC3u1aT/M/EQRXPB9itjCcuyjPHBeC4NtobtAcphuw1KsaIKPr\r\nGHTF7juJSQjrA6mXnNsIFCarVlL/mB2fV+pjFTv85b6XCJiHfybA6s0mmgUu\r\nWWCHedzxPXKV9g2EMT1UPLuMhyhj6+tCJqS/Fs8s28r+HvKnfHInGGiJ/LKi\r\nJ0vyN0UXEi399P1ORWhBd6NdQM3NrF+vOdkfqXG5Gar95pMND5eDHZwqHlT1\r\noMYT+NYj49iqVTF+J1oImb1pa1J/ikchemK5c7huCoQOpWtO6tRKq6Bfsktk\r\n5pCqFBy3fpNd+1ChHXXNC6wQj5kiDhjLZ5I8dUeyowXvsWsjtV0zlqWLDh1r\r\nj1W2vCq/POvK5KrOIhfS5RdPkI4xBWkAJJrD7viiD1jsCVfR2U1IxU4hlfVH\r\neAJwDEiT93Q/U49TkAFQw8rrxLDwBEnWDMdgaMgVGsxkfIh7VSVhsrKCAnD0\r\nTbm0U0HgjJvFucsagbZUujFO2nTVeMjNtL5/ycwDvn6ZAyliqIchfz3lXAmh\r\n3K61PS1Q9FHJfxatFOjQVTpd+eGbEVVsupA=\r\n=D+bc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f1a1158681c1d646fde8eeefe52425457c8ac559","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-16T09:38:00.064Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.20","@balena/jellyfish-environment":"^10.0.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.15","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.27","@types/uuid":"^8.3.4","lint-staged":"^12.3.8","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.67_1650102001379_0.10039537483824601","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.68-renovate-internal-patch-46b4cb50a8fd9075c901e9c3c6ee82474bd32879":{"name":"@balena/jellyfish-metrics","version":"2.0.68-renovate-internal-patch-46b4cb50a8fd9075c901e9c3c6ee82474bd32879","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.68-renovate-internal-patch-46b4cb50a8fd9075c901e9c3c6ee82474bd32879","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c4c5f4ca539395d0d0bf3bcaaaab64f8a273b362","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.68-renovate-internal-patch-46b4cb50a8fd9075c901e9c3c6ee82474bd32879.tgz","fileCount":16,"integrity":"sha512-xSDvbEG1j7Gux4+JG96ky9cK9AI8eYjtc4MnMZJ6rVxZIc7GyBzQjW46PsJJE/uRAnyerD5U2ANdBhaG9L2QFQ==","signatures":[{"sig":"MEQCIDJw5ElS5g51K43c8CFFdhq+sShPOFzIdL/fFEqLqyp1AiA9nHmQDZmVjRFSVSHLg9TVjh+y2JAknsl1/npfY/r1sA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":150201,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiYOn4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpkkw/9HumnIDab3dH1sHusDCkc0ylqstvwKyYnOGYU4SK4POWFdxCX\r\nBQWQQyfJ3KQMbmSU4dsqtGuyoNUO6vrRVwJBBn0V/GbNiS5tww+9XhNoYqUk\r\naBPrEfRBg+VFzucQZSjgB+/WAUd9fq2IyoN9zb3HIJeE96N1g8WiK/qUDjK1\r\nEmYfA25ZV958VXXq/snWPbiR0N+yWRQaJpQekwtH2XdLllXlCtZZRPG0uUs3\r\neCUUdnnHG0Hwn7F3xgkITXaKUjl8wgc5MUR4eJoeodhFxNv4H8yoC++dsbd9\r\nORNnyI3hwT3RA4BWmJZRWlKn2CS1K5rKwWVXjx9rgK9Akj2q+c2Pp6EcWFU6\r\n+XkOsrrTB0+cDLGWuFlaRXVeipKL4tWqt8rGPgHOdjczI/YmXrtWP8C9N1kO\r\nyPIaLznO31qf270OWZp4i0UTegU3PM8vVkz/fZPU1JnNHb/aDMs2Ux5Fn/oe\r\nullIfMA+eKnZkWr/9dzYeforpqPGkhYrhrawc4XC015RRgPQINxChZ0Gnlv3\r\nkPGomIYH8H15Lv08l+cJI+4BsZqX6TQTkiwzxn/k1ctmrzB+g/uJJYBG5b/E\r\nNGdJjZpvak049YEbU80OeFkZDBmjiKkIi6mNX33hZeaaBVAEFB9qYlPT2z6Y\r\nWw6STxQO8V4tQBAi8rcFZO24tMMopK8KLcA=\r\n=X5T1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"46b4cb50a8fd9075c901e9c3c6ee82474bd32879","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-21T05:18:44.116Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.22","@balena/jellyfish-environment":"^10.0.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.15","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.27","@types/uuid":"^8.3.4","lint-staged":"^12.3.8","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.68-renovate-internal-patch-46b4cb50a8fd9075c901e9c3c6ee82474bd32879_1650518520119_0.14433664552585257","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.68":{"name":"@balena/jellyfish-metrics","version":"2.0.68","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.68","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"be3725e57e8c5cbea792a7b758ecca5018cbde87","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.68.tgz","fileCount":16,"integrity":"sha512-XklUdoo++SNFKKT12vRBh1nnmxIijQTJDUR5VVKHcCW/Rn4VItJsAoP1lpkTf/gRZm3C1gE8Sh0WzXfDAMy4Tg==","signatures":[{"sig":"MEUCIFa5TvJyusAn7gWmWZE54inj2BrmGYefVbzkWybXjyVWAiEAgI+ZPbRtgrpTLxOGuGbuJ/ZJ4y1plIlnIxM3OvfpVzU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":150136,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiYOrZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmofOBAAibZdkdvPExzbnrYHeRjcF3VDEXW/C2DKLzkM0JL3LLo+EgNz\r\ng6DUASaG9e1sd1+frX9NwNTjRsUqyIyt2szzRRWFWh3OfGKYjVnynJl7c4VL\r\ngLGkxn5Pffl7oaGStvcjL8eaXlHYUpnCDHn9vUwriUUdnHB2ea9/RiOChwkA\r\nOqmypFZ5MmAPD4LNChXipEMa106q8w3I4IGD/N1cAgyL5EBtLDnUl9LdT8Xw\r\n0ayjSUjkd8Po4LlCU9DL3wClmNePyIQKnkvZiCiGzK+/iVIbJ6Weq4zdqUie\r\nsNKH1qCptoCkli3KdMX9VdRbK8HfMIlivaf2Ix4EoigtS2hZIDKbHeBmy3TJ\r\nMFqwZzocjkUsopc+mkn40tOAbsMrDYY/V+9pAGqhn2Z7lxx+UyzFGmqx0Ty5\r\nPZn+L4rK9xYGg9QnwHTP/bNAXRBgq4bnIAdf8B6QySWZe/84KTdSGn07gBea\r\nZqBban+8A5UGBWCHdEEbtNgvkCIdf/Rr9bjHW6lTacu5LYxM9grMHaml9JeS\r\nLJPM34HQ7nUoYl0YMJyAgSpX7+pKwvF5ThNHRC5c/veynCEkTKKe3mjBzL0I\r\nsHIA2K8Vj2iO09aFZblLqZkrE6nj2AmAU+Ey4ByghDjXsSZHXOqC5BbUUcdb\r\nxgktie6Nlt9OZzMNvsEv64FZeJ/5rIvCt1Q=\r\n=EeuW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3c32ae95ec5edc88ee217eeb7731cc046ac94248","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-21T05:23:13.351Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.22","@balena/jellyfish-environment":"^10.0.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.15","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.27","@types/uuid":"^8.3.4","lint-staged":"^12.3.8","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.68_1650518745197_0.132401865425273","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.69-renovate-internal-patch-4d18bcaad437dbc438bcce75786db3c7038fcffd":{"name":"@balena/jellyfish-metrics","version":"2.0.69-renovate-internal-patch-4d18bcaad437dbc438bcce75786db3c7038fcffd","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.69-renovate-internal-patch-4d18bcaad437dbc438bcce75786db3c7038fcffd","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1afdf5ec94714b61ea948f7806466235ec04415d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.69-renovate-internal-patch-4d18bcaad437dbc438bcce75786db3c7038fcffd.tgz","fileCount":16,"integrity":"sha512-J1OdXrKOKEpz+zl23rhzrtcTF7GwI6DUBdmkCNHoWOnWqt09HfzXzs17Z/VGzhw1uU5dQa7m8rgK3bgAxaf2nw==","signatures":[{"sig":"MEQCIHweBuOHNHYhS2MWmyloBTmV33fviME/vpAhW4sW6bZPAiBz9x9gubuxzkooPNzJ9Y54iXXcSSm4CghvIfCQEIQbaA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":150265,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiY3amACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrGfw/+NRcLHFCO6oAzMnV2RjADa7YEeZy6fEbNL0UwvA1AYMFHJS0K\r\nIjIIVIoiGHAbARDKWhrAUSTa+cu3DIkEfWZcr51e3cm+VspfJJU20k5eHbi4\r\nNM/xQmE9Y05F+WHeI5VDznSoeiaOMfKsZ2jcPqRcX25kT29r/Kd6oygaXPaC\r\no0WD/P0KevpBRHJMvgiXxBNnwRD8c584aZm0itF9LJ8ev2VvPWQ1QYCC8ZD2\r\nVVCx1x+9E3cKgwvbtoJrLUTNAp7g3vcj+M+bZmc9sOogADT++SB1wVHnZbBT\r\n1KU0uMhOzQHCpIRk9yazsT7CzouWzbhJoEonECN0TLWEqi1phMrTVB+BEHe+\r\ne6bjcfYaDvjY8f9oswQZUKnPVqggF6NNk3Rb/jkSKjV6dTMcoc6ti4BPnogy\r\nCVm5Ug9ZY8G6jij+o3Jn0LRktEXN3xH5fSGrsr38nod7hu9V5sN5aCGpPQWG\r\nsRziz8CHeccIn57tGLfm/wZIq6nDxnqpG8Vi2/o2BNlz8HClMTtEi02OBvhF\r\nyh7NyCWBp+ElCAsnVmJNS1us6MKefgpfxl9Hq4txVtTj1OFiKhv2KdJNzm5E\r\nv8uo0uCwI5/vG/h3uz5bkquohlzX+Op/W8J2bUUe5tpZEqvA7tXe0xPxy3se\r\n4KM7X3eVTEuVh/PAw+zm5Pn9kS57sQB1rQM=\r\n=rR3u\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4d18bcaad437dbc438bcce75786db3c7038fcffd","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-23T03:44:33.646Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.24","@balena/jellyfish-environment":"^10.0.2","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.15","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.27","@types/uuid":"^8.3.4","lint-staged":"^12.3.8","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.69-renovate-internal-patch-4d18bcaad437dbc438bcce75786db3c7038fcffd_1650685606128_0.19680092474478417","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.69":{"name":"@balena/jellyfish-metrics","version":"2.0.69","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.69","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0c2ffa550eacc0d621e75521f815910526eeac6a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.69.tgz","fileCount":16,"integrity":"sha512-voVGMKTV8j654jinEsoXsVIcdtX1j3Y0qpNf3RAPDykmMtgvib14TtTlGCmNggJYY6tTSTvruCq1cnWUHpZFmw==","signatures":[{"sig":"MEQCIAnhfNNvjrDTjjHy3vp0Dj0KF5ZItTHhP2x4ZfmpEvU4AiA6EoheO6NqRFBiXVx5MhE/Gvy7HAiUzdfhj9/OVNvnZw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":150200,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiY3d0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpiAw//cmmQJl04VHRdiMIy9ojwmYFvv3otjKW+mJxvmI4zr/VKmghG\r\nZNoOPJtKLB9DJ1vme+tFF3qDFobe0D4SJVCckj33nCQx0PcM4jGfChn9NaMv\r\n1RfPIFLlvcVFqzRJktl5rEmPuUvuVHGtBVAnofHfjrpWrKR/0Fp7m7ZpIaUY\r\nG4gHpqLlFpvmNDNxMJW/fCPov+bwcfbnlUKu6SbjM3wgdoyhcDW6N26HSvi0\r\n1B0EcMP1qxlB/oMPGltVBP6qOOAWcNnR+jUOHF533wMDKCFtuAOh+lPipt62\r\nOFhr1dFWi55mx1R2BAuVjLxfPvqusUOwGb8AaskLfwGlg4SWSEfBYdi6eaWd\r\n+8P+RArVKmhz41F+7NrAY95eSypAiOvgJecUlVn/g4MQgTQ91RJrc9t7lxjg\r\nIehuCns2IDKDoXwPb9LlaNPVz8ycVDmwLD3spCbz1nX7SXTWphrVugLa02Zy\r\n25TYIX/D3EkdZ2ZtddbJ3cp+qgGLyv/6nS7Jfokvij5eSD6dhLbR+VBwXKwI\r\nD/m0Od7n1164n8CgmynO5qT5IR7pyK7oOv3oUn9ZnoDO474FG7v/LlY6sjgK\r\n3XkqQt1trPJMWX/tfk+gHdB207AAGIavcFnMwjUue+wrD6qCai8gfun24an0\r\noQFL/Ph5kbCOw/RCkzYWU+6fsFUAuDPgkAs=\r\n=YoSH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"675854bfb9f0eeeba370e0f36bd283129627898e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-23T03:47:58.736Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.24","@balena/jellyfish-environment":"^10.0.2","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.15","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.27","@types/uuid":"^8.3.4","lint-staged":"^12.3.8","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.69_1650685812263_0.6113322011014855","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.70-renovate-balena-jellyfish-environment-11-x-89eee6e538a42706eb199c5c34041eee4de6429e":{"name":"@balena/jellyfish-metrics","version":"2.0.70-renovate-balena-jellyfish-environment-11-x-89eee6e538a42706eb199c5c34041eee4de6429e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.70-renovate-balena-jellyfish-environment-11-x-89eee6e538a42706eb199c5c34041eee4de6429e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"41eea43426e82e1a4dbf61c5c1b6d2d7d3d6cba2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.70-renovate-balena-jellyfish-environment-11-x-89eee6e538a42706eb199c5c34041eee4de6429e.tgz","fileCount":16,"integrity":"sha512-v3lHORrUEWrK2Zf0m7GN3bMqBRbZyWluPHhZeJQd0IpbUW+fXelp7snMYjBZVnyrC0q+XkT9/UPIkqoXthw8FA==","signatures":[{"sig":"MEUCIQDnjbTStcFNm5Vkki74tiR+xj9MGtVoo5lL38VlGh4cAwIgGRVeb83nJoiF+T4rRcmRzmxabGeILaliF6JAI/JvxvY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":150385,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiaSapACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrj1Q//agWqkIU1oODLaqubq1M8c90Sj5fOfzZXxzULJllxebEu4QRN\r\nu8dE+HKj8/0gHsw5csf6BgIbw1XaWgKXK3s1SltQErfO2PptBKzsF7Az10LZ\r\nbQWzADCO5P3+DRrRm22/C2WwyxNCFZ5WNiJBsv0eo3sRB4R5SJstUBv/ViEm\r\nV13V5aY5jxD3Ny3vOp6PIgHDsvD/o2/aOOGKlbRvxes9TOcRcJoxGRtL3JvV\r\nth9Q7z0Ux4KePuuIznD027rs5MSDfBt+34bHXIohPkqCDjCysffi2FoB1Id4\r\nebgsMPxEFGXt6SQzGGuNWMJPEturQfadlXLplP7mSCsHQ0CzEiGciNzZWCLa\r\npsRL8rNvxx/9JbzEmx/wn9sOanbP2ATZ74G6dJpE/JibgHN+P/K1G0c8dWhb\r\n4GVvYqT8K/tcsNkK8EYk3FxQ7nqxXz/33ruZZlWpC+OiltmiNuCP19XTdUdH\r\nAHL2Soi5WD24GD2bAxynD1sXg/bALmwu757FE+0THh5P5EjiK3ZVRtHmuuaV\r\nSPVIiHfGJd2Ki2UsEgYkitO3dFFKNOrgm6kCi+4iNf+6oH5oyJqRM4USmP20\r\nc1c3nUGjHffKJwSl9tU6bVOBftBiVH4vtrfSNfWmY6x4YCagMvWZrzEaBgJs\r\nXxgZ8AJ34PTsaeN8lxZTOdhI+ktvkKyr9/M=\r\n=nWN0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"89eee6e538a42706eb199c5c34041eee4de6429e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-27T11:16:33.669Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.24","@balena/jellyfish-environment":"^11.0.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.15","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.27","@types/uuid":"^8.3.4","lint-staged":"^12.3.8","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.70-renovate-balena-jellyfish-environment-11-x-89eee6e538a42706eb199c5c34041eee4de6429e_1651058345734_0.11095961694489542","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.70":{"name":"@balena/jellyfish-metrics","version":"2.0.70","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.70","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f6cda73b186d3b76443a80ebd6385c541093c7e3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.70.tgz","fileCount":16,"integrity":"sha512-6ZjrQvHQVoBugkoG7XnlRWEvzse7h+WMxe/UoERuhm1fzJVMVo064DRSiWkBxDhJSbrScB6uF3lW7KglX4uakQ==","signatures":[{"sig":"MEUCIQCW4wyodxQ2PouNdbCEML4RoE3MXdaAxA+pYSxyhd+S7wIgJYevDhz4WTa4493Fo2Q0FQItcBofDSbCoqYanA0arZo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":150301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiaVKwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq3Vw/+OtSuC5TiZVq87VN7627DPqd1scdvE/ZWqvulWuhrjlGRNLul\r\nsvnT+pAIbJV+1AQHC6wCciy4pBMtCmN1fthKOQGqTIL4q8cOSG6Z4jOgN6UC\r\nD3UZ9dtqP9WZHsoFo/kWSJeCFiAxFfnqn144y+EwKvuXffu87zoL9vD6ehvJ\r\n4AaoKTj/IBff9wjlyGxjNv5gP7T/xnY/P3MVDXsSVOXC65wDyhY+rcnpIsQj\r\nmA15DDfHS4cLFsnBn7/QYU1u0itEyAvHEjP1oGQVbxMQrt8BOqvjlvisAGbt\r\n3Nco1mEZbSGt0eoE7OJPp2dNewsuado2Tu5fubtec/nddKysjKQOHMnTNTFP\r\nIQ95ENLBBRY3zW790RnCf8bHF0QQGedepGlVNM98oZHoyGjFOA2o7FSxBy9e\r\nBO6ivrLwsFrvgXaPAMESOmyV1TU/9yZyTfiYe2+GvmcGFwccVsAawxdbS/jA\r\nBbmvNT2YmfIY4kjSUIBmwJy0mwCRz8i8IlzIssv735Fo51HfJgSfd0f0HpGO\r\n+HUWsg8fIHCwLQKGGovO8JMS5q15AdEMsTL8RF1OGicb5y1LMeDYN3MQ9frw\r\n8vCJFDvYpxC+29tN3Umx78RDE/Y/TJHnu1lds1bEesTP3dgU9jr/ev6JULC9\r\nzX6emx+T1Xzh+u5mu0xFieQxWm7sD8nnpp0=\r\n=aC5R\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2c7452d10fcc1070446166695d14161c287709bb","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-27T14:24:47.928Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.24","@balena/jellyfish-environment":"^11.0.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.15","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.27","@types/uuid":"^8.3.4","lint-staged":"^12.3.8","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.70_1651069616130_0.19111766975668032","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.71-renovate-typescript-4-x-abfcaa27447cb76002ebdb4df1070a2a3bb90906":{"name":"@balena/jellyfish-metrics","version":"2.0.71-renovate-typescript-4-x-abfcaa27447cb76002ebdb4df1070a2a3bb90906","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.71-renovate-typescript-4-x-abfcaa27447cb76002ebdb4df1070a2a3bb90906","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c05ff5f3937383525765427a2d1e45defe5022aa","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.71-renovate-typescript-4-x-abfcaa27447cb76002ebdb4df1070a2a3bb90906.tgz","fileCount":16,"integrity":"sha512-QwGnlKLBMC/aZbdX71kQbXxPxLbESGB2hSIrwjwhTb71ahY7K/fFObvrTlCrDbz/YFvunPtD3NA+4627nqAW8A==","signatures":[{"sig":"MEYCIQDSLghVIyK8ulE96USr9iuRGTgYLLVQ8jSQlFBy2SZGnwIhALmySeFacCAjw2xakZXS8zjtQL1yWEYEsfkbW+za2gq+","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":150446,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiaxOhACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoOAxAAoKBJpWOCpqtXXbHgyGHOL2/XF1QHljZ7vf1pJLooBLQe0B+3\r\nhk9IFbphKby4LrSKNhKWZNYP675MeABDuSmgT8s3PNvYSJ3S2dhDsrpOSLib\r\nSrgljAXKNP7sdYJjA9xyy0RqZOU9neZhCw4ePDTTtaKMOLzqJoOegDgFOr0p\r\nvrxRNgp+mYfhZxsF57QODpYJ1r0Ato8cqcwmXZp8eKmaentsPHmF+tR1WEd6\r\nCXbPk+rhSTa0lzWZkQtjRJp5IufxX8wrLaKqMatw8620d/1SsJlOQ63ksdUf\r\nRYpiLQFc8nG2/PZT1O3PwPf+1oM8AUMnr3geikycsEYOKwklJN+z2rgWl43N\r\nw4nWeJcwslvuXT1nilYi6NPyu0wSsmJo5SfbkRKGMlk4XnkYiWMzUGptTMcE\r\nGySyTWgoZUwQd+NFoWTXHMkQ0IFyXlT9Xran7QimBJYcmGtXEL0Q0Dqa4M1M\r\n9ziET9gBQlF1F+f5G/Pmh6yY7DszYO1ZU/6xrUE8sC+b64btXSBDfC5WsBjv\r\njleJ3Xnvm7nZsTZJzzTdw2U+gvmdasXN72DDnOY9QMy3bNQUfvrH5UDsb9F3\r\njSjR/g/iu3UcPgs3Etc8BZ8OkSax34ECsBJ1rwXBL3whyBlMl/hIMVCNkOa2\r\nXWBdAa8wmHvIstpzblDrpddt/423BlXoMms=\r\n=GXAu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"abfcaa27447cb76002ebdb4df1070a2a3bb90906","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-28T22:19:12.952Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.24","@balena/jellyfish-environment":"^11.0.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.15","typescript":"^4.6.4","@types/jest":"^27.4.1","@types/node":"^16.11.27","@types/uuid":"^8.3.4","lint-staged":"^12.3.8","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.71-renovate-typescript-4-x-abfcaa27447cb76002ebdb4df1070a2a3bb90906_1651184544995_0.5607937047143812","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.71-renovate-external-non-major-ee29168fc95788ce5188bed68de0fbc1921db139":{"name":"@balena/jellyfish-metrics","version":"2.0.71-renovate-external-non-major-ee29168fc95788ce5188bed68de0fbc1921db139","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.71-renovate-external-non-major-ee29168fc95788ce5188bed68de0fbc1921db139","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"388e225d38f249ff5248a817323d9231f9c2ecfd","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.71-renovate-external-non-major-ee29168fc95788ce5188bed68de0fbc1921db139.tgz","fileCount":16,"integrity":"sha512-4UOqUQu1hg0rwv2oXwyXV5i2tG3YnIfRvxiOGrMf2DGCz1+/Acsnssnw6bw5hkcLHRtzKv1/6Mkv1lF6IeBnFg==","signatures":[{"sig":"MEUCIEnJTtAFdVLnbjCOJ5tVQ6r7AXDt5A//C4faF9EgSYrrAiEA0DEHSo/2FVAeERnJti3MO+fDzYt5OCP7tNekHJWH4J4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":150493,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJibILTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrFng/+KAWyj9slxEJaa5db5IeUXtYEjkHQnBuhwCPSW+Kp1qQ9lbzp\r\nf/DLRfivFK4Mnrr8Kqw9pndqcb+O/vC1pYOHSuZg8MQgRH3JlsI+65HIUmsO\r\nyGRmHV+0SBUSqT6AeUxSF9omfZFqLB3D75i3YpaaTEmwhABKN299vLW9mZb6\r\n7AAuCEYuL5TfV5v1HmnwLTWz/T4mAFXZim5AaXN6e2+IA0acnzgFbAZKC0mp\r\n9nc73L5Oy6QhDJcbw9VxrZQJFRfy48XbI9k3Bpdk/CGYwgzDchh/GS9+qP8u\r\nOvL5eztZ8SQOdis2/vcBGJlq2c/O2J/wI9EFTElRYnzZVVRca7riFJlSaxFJ\r\nVLFMJmRDv8dcZb5raUkQ8071dOfdUhHcqvKDgKQkx8us5eQdQqELa9hqEceD\r\nVV0EWZPnE10ygOsWvx9ZB0QLeufyEe78b2SkAX8wItFVdT/Ngt6OQSWl/iWm\r\nT3TkZ+QHtoYqpEg+gzo1+5UcYiEe7qIEFTN4H+uKd1AMbKo4yYyTowoRstml\r\n+0+uo+wHQFhpPM4TWP2cQPfVCCL5tr4axi2Aqdfj7Dew4YL3nEufG/mLdcq+\r\nAcXweMdf6hM0It4hoUFzishFyN8XwZN+6albI06QINkShYkCKD/nhS7QlMQv\r\n7rUFKHTjgbZsjZwqVLrZk7o9NWEq5talCxM=\r\n=ToMz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ee29168fc95788ce5188bed68de0fbc1921db139","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-30T00:25:21.249Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.0.24","@balena/jellyfish-environment":"^11.0.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.15","typescript":"^4.6.4","@types/jest":"^27.4.1","@types/node":"^16.11.32","@types/uuid":"^8.3.4","lint-staged":"^12.4.1","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.71-renovate-external-non-major-ee29168fc95788ce5188bed68de0fbc1921db139_1651278547259_0.2416237991196113","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.71-renovate-major-external-major-e9e1d9c395a1b0a8d43c50da90c14ecc3b1c35a3":{"name":"@balena/jellyfish-metrics","version":"2.0.71-renovate-major-external-major-e9e1d9c395a1b0a8d43c50da90c14ecc3b1c35a3","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.71-renovate-major-external-major-e9e1d9c395a1b0a8d43c50da90c14ecc3b1c35a3","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cdc6b9784f79a5d31ed2d11b86f599423cf095a7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.71-renovate-major-external-major-e9e1d9c395a1b0a8d43c50da90c14ecc3b1c35a3.tgz","fileCount":16,"integrity":"sha512-4SbXFGY76+mIWormi4Vph6H29yv18nmV7M1USFVeaH2TuJm5b9IfpANFCaTht87/yJQVJM30riXTy0O6BujhZg==","signatures":[{"sig":"MEUCIQDEM0jj61lpHtg2bnM+K8D0jlmYmlFamcSN7XtWIakMFQIgA88hLrYSqGvtOFqcb7qzi4Y5RQgvtDN1l/5EcrzYVP8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":150512,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJibILsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpybhAAlK1QQC910it7S+lYWx3VlgD5sV8irN5ekAU03VPzWgZw6Ja4\r\ndVXxDCaWSrLXxI1GxTh9I3WeFESjgNorZlDMC2lz8Y+MYRc2up60eSV4fy7g\r\nIOU0LiZYJQxzCzVF512hhjdfHZ71zQv6yZRqFZboCrCMdwEKC+5jqDG8QbER\r\nDagOsW5uFUFS4Wd+h8HE44hy4rLxUhojZniRZ3eunHaR2W515+1/LtLi1gWR\r\nc2VgsQgmhxuvv40un/tU7yFMK2N/qekHQzom5cWe0hsDRQzEb52rFtH0af7A\r\nilxUb8S6Q+2jGGjul1tiWiDjnRzr0zwJEAM3Ax8Prf3cAySZnyaopBOMBq6N\r\nIF8nS6o+cEXBe+0dJ9RCI4R4y7MCqnXAa57sLwKbPcPRvPB2wYxBkDgwk8W+\r\nimloAdwZRiB8Q3WyvEJt3US0kFOZwmGh4n7KdGG4aEG06MBc1vrJDKNAofL7\r\n21PE0t4Ords9hFP4LFfjDbd/XWMokb+AMMDfmV/QXDFU2plAnIImQ38XEy1S\r\nt5gYSJONiesM//Qsj9HFc0sifd28ihI6uIwi//HCKdBjPJhNSqfRYacUmofF\r\nZemXfGFBGS/1np5M8KIm8qTSK+9yR/LxgstJ77W6zj2fGP01HJ03q1xCdH/0\r\nJRk3/Ba9zoAxSfysDbAE75Nk/w7Bhbcfs+Y=\r\n=SmfX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e9e1d9c395a1b0a8d43c50da90c14ecc3b1c35a3","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-30T00:26:29.391Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.17.3","@balena/jellyfish-logger":"^5.0.24","@balena/jellyfish-environment":"^11.0.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.0.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.15","typescript":"^4.6.4","@types/jest":"^27.4.1","@types/node":"^16.11.27","@types/uuid":"^8.3.4","lint-staged":"^12.3.8","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.71-renovate-major-external-major-e9e1d9c395a1b0a8d43c50da90c14ecc3b1c35a3_1651278572516_0.9058651761200942","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.71":{"name":"@balena/jellyfish-metrics","version":"2.0.71","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.71","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cf1b1ddd776add788815e39ca287872b18e7f5b6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.71.tgz","fileCount":16,"integrity":"sha512-pi/s/AUtRcoxugkdYi5mpZ9fW9ypC4ikRqSDKubCe5ZISkOBZCEFMUNrXezhI31LA+FGzw2Qjz7IugoFi9bSQQ==","signatures":[{"sig":"MEYCIQDadOI25wxmlKrAt1mC2j6iOmtUyeyJzEKlr+2M4yKNTwIhAIBz2FWZjTvn9y7EvGumA/FiDXBejaEVq7dhDcWrUJXj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":150424,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJibIPAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrHqQ/+IcHnIm/gwEpPNaI5l9rKnFGYJ2wtLEyylsxfOkiNjYGhPKHr\r\nAcwyYCFnnXFbt2jQba2cykyXlD43+pY4o9uiLoJy0hNCk2dCu4Ve8Ia3QEXI\r\nT62lWIyNrA59Twoc3ggTqxuPgXJCoqg+KTvyELSb7q/4hnxwBtNDXkS+Qe+a\r\nqZCye7xAnGY3+CR/O02CGYFQBwzsRKOWMQyADrDjB1E/1vcWHboyWxssq8/o\r\nyvJEtvwtufBnr+bRxhGThC4GGWuNGqqWmQLZASaQh3gtyD8ENjLxp7bo4csU\r\nQa88jXZabwIndP1DaOQ7H4k9QfdkhqehJ1drgVAkQTrxNlhYcFH2CPL4eNBP\r\nxeZtD2FCrlI2ahxPappzVX4FReGYBlSC6MA3mUICCKpdFa0+xJjP3W84esTB\r\ncVA9gdMrWMqrDE5oe7eGaOopdVvojB47DWUmIlBFS5tgksrxqVtrK6m6yURs\r\nQA20Z67ryK+pkiBvniqcKFdvXbAxkUjmQR89FVDWYCxw63yqJqPcV3viTjGc\r\nstBO802InWV9WGHDnK7P/cejOso50I78/5v9IgEJOArjiI+vwD3iGhNeFzaE\r\nTcBKb0y/y7bffqgupb5rrxAjEWFVdRFtd7fISEIXcUsrbSvDtLNbJ+G6o3yT\r\nyAWSz3QPlSPv9TaWsPdr/kY+m10Px2VKwKo=\r\n=6XTG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2183d1ffacb4da2729add63c71bdc5c3530317b5","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-30T00:30:54.083Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.0.24","@balena/jellyfish-environment":"^11.0.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.15","typescript":"^4.6.4","@types/jest":"^27.4.1","@types/node":"^16.11.32","@types/uuid":"^8.3.4","lint-staged":"^12.4.1","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.71_1651278784268_0.8571347035578123","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.72-renovate-major-external-major-7863f34657ded335ad571020649414f07d3e24b6":{"name":"@balena/jellyfish-metrics","version":"2.0.72-renovate-major-external-major-7863f34657ded335ad571020649414f07d3e24b6","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.72-renovate-major-external-major-7863f34657ded335ad571020649414f07d3e24b6","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4e16d84eddb542f0d7180ffd6874109fa15a9191","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.72-renovate-major-external-major-7863f34657ded335ad571020649414f07d3e24b6.tgz","fileCount":16,"integrity":"sha512-pLO48RNJUXVjo555cAk14VQ4Yls9M57CYlV/6zX41Rshdgc/zmQUnC5yw0mCprEEKOpWppesCVhFejzir4dong==","signatures":[{"sig":"MEQCIFFGLeByi533LpuQhzLSXmSOIr38f8DqUFDNozmlOHbbAiAdjbtjPOkye4ymtN23EJwqTPO1PigNwOPPT9xY7G1Jhw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":150580,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJibIRLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrAzA//UsyqpVtFmIMqMkfUiy0d8YoEYducbjyWr7RMcgsEjU9TjbGn\r\nzqJxDUtjmVkecfsJTqUITObyEezFGVBdPyDc5n2lQjG56+zZHydXmrDUy+k7\r\n1Wg8TXpaX9vz+vrgmYF9KO8lMRKoly9aQll6ybwf29nrq+DLdfsWPyR3EoK1\r\nOPNH4ysvBQeim/oUibei1yZ+5k6FnxA9uFduj6BVvj5Ln3ow1GZ1NpS6JF14\r\n6AahncUhPGxN5111bJVnKyO3Dn5bal+rqFtuA4CL2cWPT3mZWcoKek0zv/Ur\r\n+Lui4v2gPiSYOw19hozqSxh4s5IptANynroxqU/5kw3ca/hCbQk4N/B5yVPJ\r\n4dcxdfscmZ/VLWz54hVFv3SJgTRDPbkSgbjDXyuqDKdUya/cvxWWOxBTaQmv\r\nzgUN87RnJzfSwoF3D6KKQOkflLJgHTCgPioeE4Otr7JNoBviX7i01kZaHq8E\r\nQYWWzJ/rtWK9q+IbHrdloCqy/gB41CB9k2CEjcy/F/P99loPwMJ/EZi78YMM\r\nvOKQyn7QUQEB6cF32NQTp9V+BuQig9/PxnTEexVn0Asmf0d816NdfUh7etfS\r\nKprpDsnwUcLx4pLJvyU6Zw8am81xzHJUfBZ9U3D7j03l4T9FpqrZ/5uQmfMf\r\nSuq3/nOkn64D2exwxJ7QIFHn4H7L3G8KwGg=\r\n=BXu2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7863f34657ded335ad571020649414f07d3e24b6","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-30T00:32:36.353Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.0.24","@balena/jellyfish-environment":"^11.0.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.0.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.15","typescript":"^4.6.4","@types/jest":"^27.4.1","@types/node":"^16.11.32","@types/uuid":"^8.3.4","lint-staged":"^12.4.1","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.72-renovate-major-external-major-7863f34657ded335ad571020649414f07d3e24b6_1651278923516_0.5589891222529375","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.72-renovate-internal-patch-3693d3ea0e2f50f5b8a4c74804a75776951f63ff":{"name":"@balena/jellyfish-metrics","version":"2.0.72-renovate-internal-patch-3693d3ea0e2f50f5b8a4c74804a75776951f63ff","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.72-renovate-internal-patch-3693d3ea0e2f50f5b8a4c74804a75776951f63ff","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b39da655757e2c26cca381a61cdf1e4f68f69cef","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.72-renovate-internal-patch-3693d3ea0e2f50f5b8a4c74804a75776951f63ff.tgz","fileCount":16,"integrity":"sha512-wbsxmE2VxztFc+b8/iPCpJ+dHxb2BgWCBIEz9ftZu54k0p9tBbU7ylBp7RuqZwWMz0Ely6HN3zoGKtj2KEnbag==","signatures":[{"sig":"MEUCIFl4qXFs5TIx0P8oVlCR/xJfzCZ4hCAISa3o5X0qnlWxAiEAhd1JuaRaYGOQTSeWG6HV6RFGI4duCaGz1YJ+QIYO2aM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":150553,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJibSVVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp6ghAAj66xxpF6oD8HoKy7AL93UphUk1Fk0Mad/KhFrSqkZcUAtcjy\r\namXmz3TU04NkrzR98w3r1cosCNk7JrMcxs45KakmY+jt8+XSPtGY+zGfgX0f\r\ncquQvuIsovWtTOw1X2yVlASFrwYKOz5JIGXNx2O/K7f7cv/sVfsPvzz/AZEf\r\nE/13DbwXlhBy5SatTQ3FCtZNhYI7YStKhcS7/PT1Ow4h9LtmXo2pghyzccRL\r\nz/ohA29bdFURYqyVM1jLPsutO+r1Fpye7B0be7oxkVa8ne/EdvQBYjinj2bk\r\nT3VPazmKk9N7aDGwGq9fsp7AeMFgC5FEqB7DIrbpJghm+j8IcvS7PxWT8OTw\r\niMgzoiOJOIXI3k4D7Er0Bsg5OlJxsyGJaRRFrr60Ofvcyn56abAopFi2kPPY\r\nJyGdPqMeepuC4DB879msDIHXE2w4lK8+bu4JN13Gv86W6b1mr7QROtNDuwP9\r\nd38MTFic8ep/4YZnehR3xZFnmJddX7kSeNvCSfquQXR4PI5NExIrMk7BvGFi\r\npUgFB4Ujs4PM5asbK7xvZ3tJaMboNJcJQ2vf9iPfpiv6n5AdJV1t/iFwR/Hs\r\nOoHWFClsqgu6DpmzhyBVVEfAqffYugdJdo8N6uCGX1n9+U3tcb/DUcMoRN6m\r\nIsuk6pO6zY88QjH7pdI5te4VrZyuFKXUUko=\r\n=kudq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3693d3ea0e2f50f5b8a4c74804a75776951f63ff","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-30T11:58:56.131Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.0.27","@balena/jellyfish-environment":"^11.0.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.15","typescript":"^4.6.4","@types/jest":"^27.4.1","@types/node":"^16.11.32","@types/uuid":"^8.3.4","lint-staged":"^12.4.1","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.72-renovate-internal-patch-3693d3ea0e2f50f5b8a4c74804a75776951f63ff_1651320148973_0.7021135940196312","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.72":{"name":"@balena/jellyfish-metrics","version":"2.0.72","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.72","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d848e2cb52fbbeebd799aa5cb55b37680c7f904d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.72.tgz","fileCount":16,"integrity":"sha512-307tvemCXyPhWf0dbtxmeDoC6f28og4nMb840SvLuNrLkkM5NOwh2GDcq9Q0JsHJ8DtSVVJ40tP196Lk/TkcIg==","signatures":[{"sig":"MEUCIQD4S7Y8PUYzb35W4Ii7RNBPAHLK4mDrRsF/BYdt6pZhjQIgM1H+WrMyljtbyPm4IZjwthufXUJ0yZ587yPYoLpPhK0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":150488,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJibSYcACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpjlw/9EraTzdvH+5lneU0G0KCOzDlFtvsDpLSDpM1iSCYa7ru7TJjP\r\n7KePnlYwfz5Kx0oNpzB2z+Eg+vB7kodAheK90N2okx4cbST6IH2yEY3iIxDP\r\n7TopxuJXIfXhrfDv1wObqxejcGLwl2IJl3FVwe59KfthfTwmQCABlUE3U5/S\r\nc1hvWQN7qWBGR7vFQHqCp1TT/onnEMwfff8c7JUqGorqf4OndPP8w7RJQeNo\r\nLStyD24RIpUEBNoTnnKOWrzuyNATeNn6tR0YDI9oPohTpn8UUZRWEwP4ILib\r\nK+aXEse0z/MU5pLv2BpKPR1Cvh1v73XHzMf4/NYnTYtZgAYRgJBxFzRJsRto\r\nwCBOYQVPjnSbBicthXPjxXEx7G3e6s9Duzi6R8o87tqvnjeuEjiKFSX22YJm\r\ni8ywn/2yTbSt/mNUz5lkLZ4QyhIMVr/TA979nRAeGZRQCnK2pRXhLhliQkNy\r\naPJ7JWoJ/UhV1DtKJuQlOREQfqJcz1iFyf1MsTHoZO6qEPNPIPDsvpFXHZ3s\r\nC0/Ut+K9LZVtz63qnDL56nMToHsdHx9QsdA7GFUnJLWb9wkJXFHSWmHjDKTH\r\nVkceFsmW7yoWy5hjazttXY/OTEO9he8FLVpBHZ1zK1IJ90j3APmDY+bfUdf8\r\nLsnN1N3EOJU3eLGREDCyi5hypYJWMB10n04=\r\n=jnVE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"fab19cbb0a2f729407510f0cec5541b309d7e742","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-30T12:03:14.654Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.0.27","@balena/jellyfish-environment":"^11.0.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.15","typescript":"^4.6.4","@types/jest":"^27.4.1","@types/node":"^16.11.32","@types/uuid":"^8.3.4","lint-staged":"^12.4.1","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.72_1651320348132_0.7023175870159961","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.73-renovate-major-external-major-cb00e375a5d3d46e85dfc78076497a36f43861f9":{"name":"@balena/jellyfish-metrics","version":"2.0.73-renovate-major-external-major-cb00e375a5d3d46e85dfc78076497a36f43861f9","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.73-renovate-major-external-major-cb00e375a5d3d46e85dfc78076497a36f43861f9","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"65e534d1b039dd2fc79612986d02f5da27bbad5a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.73-renovate-major-external-major-cb00e375a5d3d46e85dfc78076497a36f43861f9.tgz","fileCount":16,"integrity":"sha512-zl3cvruDH3LOq+5PXolH3ur4r54HgGZ/e1ELrUKtHg6DjHSqv5KDsKEA6wRyUbhTzy01uAcq69+JC0CnPDTgiQ==","signatures":[{"sig":"MEUCIQDKSFoE4dqYbThG1kt1fpb7vA/FvwcvJqhfVvE/CIQ6XQIgB2/iscxlE1dCbtmcLW7dg1gWuqOQcso94raEYcF8OMM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":150644,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJibSbrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp/mQ//bBy6/DpY9+l6iQGFRJcfkQTLwblb9yHZPdDQEedhmELscoHd\r\nZC4Hk5zXygbwzOmCrtBCPN5afou519+rJpXnpF1XquPAs1t6Fi5YVKCZ9yxO\r\nm9x9Wh/4f8gnzcchjl9iawMPr2dbXnzaS5Eo1yKRMZ0qdRTkkfzUKZmBHQlb\r\nQu44MOJv9zM3CoahIAG9K+er6LZWbrCHnB0wfx2v4bpTC4XS+bmvd+gOwe/b\r\nt98Ah8m5Yf8TloJdOgPVBqCTe6YC7uG5LJo37MXtxc24tPRAm9PaO9d5yvON\r\nYwsGIOQbfV1dc334rjClZdSuu3F9A0tvxeUzaOBM2cxLntBzNCypiZ85N3pf\r\n//teEr9SPDubc0ggV8gbamQzzFn7YXDECAVpBvYUOquxVE/S5hfd0WNVOGwC\r\nUci8JtHXIOPcXOjquE2QcZEZ2UVGn5XGv0zmoE5PnXdXQwbKKMnjdiLcTPfn\r\nNU3nUr0FVC70YucXVrr6LzKVq6VlXZr2cnTKF7gqs1TP2pgBvUzpwJg6buQ2\r\nKAhqSwKoXX5CJ8EjvnMY1sqUPfbogM2XSutJaZwRS0tIejLAI5fv1v7jJFjL\r\nUvO9YLZs+PVVYLR0mYP+/R71uGtsntUoCNVcAekP8W+Dju0S+OqfHhGs0piB\r\nWPgKyplTcDit9TPKvu8lHvXjAwcu7muBEiw=\r\n=qlqy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"cb00e375a5d3d46e85dfc78076497a36f43861f9","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-04-30T12:07:19.684Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.0.27","@balena/jellyfish-environment":"^11.0.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.0.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^27.1.4","typedoc":"^0.22.15","typescript":"^4.6.4","@types/jest":"^27.4.1","@types/node":"^16.11.32","@types/uuid":"^8.3.4","lint-staged":"^12.4.1","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.73-renovate-major-external-major-cb00e375a5d3d46e85dfc78076497a36f43861f9_1651320554807_0.1785411014621867","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.73-renovate-major-external-major-3a9cc83d9bbe6189fb9a8d2b8e79bd8a75077aa0":{"name":"@balena/jellyfish-metrics","version":"2.0.73-renovate-major-external-major-3a9cc83d9bbe6189fb9a8d2b8e79bd8a75077aa0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.73-renovate-major-external-major-3a9cc83d9bbe6189fb9a8d2b8e79bd8a75077aa0","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"36ddaf924e2a41ae8cf7d789a9ff4839f775e1df","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.73-renovate-major-external-major-3a9cc83d9bbe6189fb9a8d2b8e79bd8a75077aa0.tgz","fileCount":16,"integrity":"sha512-fkXkZ0KTaDtbMNzw/fAyYMdiEo+YcmexCd/LPqQEOcNxS51ckmoWjZCGqJ1IZT8O4Ex+1Qqwu6JwHfosnAawUw==","signatures":[{"sig":"MEQCIFHfxHEU+U2lBMdSerC75aWJVjUwd6OUAluI42+F3hNXAiA8c9Pk0Q2wWXjz2hFsyhRd3KzRlruFNsCspyD7y0zX1Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":150623,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJicStVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmowLg//c3OX4up8Cl9Jp/EbFYkNpzzLo69Xj3KLqjDLJXhxMmY//npY\r\nDLkfpK0Ug77d/9BUmwgq9Ug65x0VFpU6ppOuGyBR5kVAQuWvZlE+OJEXh5DO\r\nUdroy+gNbVG4aXp/oN0c4Vccw1JJRP3cTF4Uvp2CFZJqVfSWHnHDHuU6MfG2\r\ncjEpFloHjeMUcDvB9KKA6OtCgY1w89aqDF6cGu0Yrd0L5tumO+AvNX1LlzE/\r\nmN7+jXFJkhdSmN4Opl27hF7zHCToB1D8glw56h/gJwSkid2m/DzGfptjLms3\r\nqOExXZ/xq8jQ5eNFjfeIHwJzdvYQ28jK38C6gRA4zC1XLXKNniOLPxSXiZmV\r\nWo4Tpn6DLMSSXwT53Q+WtBshx965ljxmF7SNkCUzLc+4AlrdG0ZAl8AcX8LA\r\nKyJTa7iwUwnaqSquEg7c+PF7NcHQtFP5ZlsXaUZg3ecCmVEAOOToMsTlg3YZ\r\nvfISRXft9lpq1y6H4dWmYPZ8bZbte5ZPP6lW/boAlslAT5LtLVtBiL7IXlsE\r\nLbOR8odPOZQTe0AJ1gYMXQWVWodsTt0uACCT5YArbqwM9r0WkUG6Ksr9wAuK\r\n45sZMt7DyeUyrM1dgHJwDBtTcuI67ESFrkL6HPbp9NCTfDe9mMbBU4W4bGtB\r\nQRt2e/oye1XivwYEr1nZgVUnV5BYG6UqiYw=\r\n=0Csn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3a9cc83d9bbe6189fb9a8d2b8e79bd8a75077aa0","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-05-03T13:14:05.535Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.0.27","@balena/jellyfish-environment":"^11.0.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.0.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.0","typedoc":"^0.22.15","typescript":"^4.6.4","@types/jest":"^27.4.1","@types/node":"^16.11.32","@types/uuid":"^8.3.4","lint-staged":"^12.4.1","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.73-renovate-major-external-major-3a9cc83d9bbe6189fb9a8d2b8e79bd8a75077aa0_1651583829356_0.5759989933790326","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.73-renovate-major-external-major-3e046b9dfb7d3745bda96505a344363611bc5d17":{"name":"@balena/jellyfish-metrics","version":"2.0.73-renovate-major-external-major-3e046b9dfb7d3745bda96505a344363611bc5d17","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.73-renovate-major-external-major-3e046b9dfb7d3745bda96505a344363611bc5d17","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2ab54f7aafb501debb6ea6a36b759336e63540fe","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.73-renovate-major-external-major-3e046b9dfb7d3745bda96505a344363611bc5d17.tgz","fileCount":16,"integrity":"sha512-KsQG/Re17DDYcov+AHKpBZihhvdia1NGfIK1xMelQgD7Q6M7RFiB3iCbUBzCZqBUw2TdG0I/6RydrLx1V/ohnw==","signatures":[{"sig":"MEQCIBEyLCXXgLnn8ndlEAvoMtJmQnF/dFwtgw7DOQQw3BM+AiANxW5R86vldhOObuYsfOVmnAAOsCUA+2Q/24ZhHtMzNQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":150623,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJica6FACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoDdhAAiWem9SxVwU6ISemKfJJmSlwb8mXLvIfgSvm9Rrb91Y4/pbBM\r\nFnAMKqAI4lyz2Z1y0e6GkbxqGsrHJlns4WNE9N6nkIBP5aLg+wbjADhXLxp6\r\nUrX/QIp5IdMdtsd9JMRMobtnsDc4RApWD84SQS4NVBKdsBdSG1uJlAkA27a/\r\ndhuvKh/bysHYktSHODyyCqXOi5z6+Zzg4nFVBKXQNlFWqpVLsbcogHlGghZz\r\nWg0fAKo2ipxWc3yFNMOhrdi7p5VMsIJwqjMwBNrj4ngJZUNCC5JHlx1Q2vtg\r\n1TAm/0Eh3iwD08afVm5/T4dJu+XCYqUy13Jgu/FRoPcb60ej8r3uPHrObXHY\r\nDpwVRriZTmOMbiKDeGfVjoSnnRad72T/GcuMRr8UVhNoNfRe/ztU56LrM0wU\r\nuIJD7NjOM167BWFw5wbJNXLfwsfxJj/QNv6cRYUhgl7ohlM0ypM7i54ij7v3\r\nWTq0SuFR7JnRUlM4XJcbdaCpc1ux2gfV2jTgUfwTKElGwru9JSJYTYYO8czR\r\nNhIZFtBkGN6KXHNy02K9We58S8XIWuu8KkLuO7+DipipZHYiJ7Rda6ujm8ff\r\n7zAn2H4AnS4P1Tljd9sZl+Ff+q5nwhKFji0yhVXoZFFnLsguHb2khX3Sz0fj\r\nXdUSmkzJ20ySsCOkOmzTbFcUKjzSGsk4zgY=\r\n=/j68\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3e046b9dfb7d3745bda96505a344363611bc5d17","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-05-03T22:34:05.458Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.0.27","@balena/jellyfish-environment":"^11.0.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.0.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.1","typedoc":"^0.22.15","typescript":"^4.6.4","@types/jest":"^27.4.1","@types/node":"^16.11.32","@types/uuid":"^8.3.4","lint-staged":"^12.4.1","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.73-renovate-major-external-major-3e046b9dfb7d3745bda96505a344363611bc5d17_1651617413509_0.5128374749394207","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.73":{"name":"@balena/jellyfish-metrics","version":"2.0.73","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.73","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bc949cc0d6b3ad41e1544cb9e672336a54711cfb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.73.tgz","fileCount":16,"integrity":"sha512-iFFpEb/RPm3YiBq2ucYsGtG2IWU/W6sKZh5pXtvT2w4d4OFzpxZyPRpBHUnXV6/gvDWPK9aVAhoP3OBGFlAZqA==","signatures":[{"sig":"MEUCIFxtSTTb1szN2kTzovcO9wPZyIAKhx2gXDgZ2iExt2fnAiEA6pPhSWzOjVRj1WFZ10UzcKQH6o03Z/aAFBKzWHRHk8c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":150552,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiccxQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpnTg//V2m0urjDzriSzRF4hYojqkDcBH39UL18GfS1UuNJZT7lckNE\r\n7QjCiV+9LSHRxACpuR/sQFiePanT/w810W1g6doMggfegG9GIoBxQeJ9n3+m\r\nDNIFGUuldnQsBqKtOZbGpMGVYJ1YVaw67Fi5JcbpkY5hkd+x7HTe9/lZR05N\r\nM8w3QNLASunsbS6mM54NBFpnCXgxDWMbklXTqpCZbGuA2ViJ3Sh7Mrm6XJGL\r\n+iubUn4kbXTWcw2WF08v/rCVRzPquSvSBfRXOb3YKWps+23RQVlNlS3WcP2s\r\nxiZ+HOA80bILJYtykTWkS8l3Awp0BVdRViYAVnOfQ801BpPHMOtXVPhAmXRZ\r\nsIPqmFeexxxq1gFkwH6JTMfkxgeXfgc4uHkb2HFbPLBWiauZtyr/W1wowgLj\r\nlpQNjqMrSIW5MVSxu//f7Ul8NedhGw3uiPLD6reBS5qmYaqDldbGLRKgY9MP\r\nd0r0NutKv4iVcFoevIsTbPZViv66rFypdIRx4nsffTWbyuLAd/XumfIQZ8LE\r\n4RVhRe4h9rDXqwNuAx0rfPnMwJq4ZOkYssQbsAQDwvBxKveshFr6OwDl+4DV\r\n/CvDzv1PRFb4wJvwcQjgZELpZwMLagBFJw1jhHKAQ3rNN9vjmeCX6v+jC9ao\r\nUPs47yg2egfMXTkuHHS+r7HeNlsCnjU/QXg=\r\n=Ueln\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"833e406ed63ee4dd2f44ad7ab49e4f593d3ad700","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-05-04T00:41:56.027Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.0.27","@balena/jellyfish-environment":"^11.0.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.0.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.1","typedoc":"^0.22.15","typescript":"^4.6.4","@types/jest":"^27.4.1","@types/node":"^16.11.32","@types/uuid":"^8.3.4","lint-staged":"^12.4.1","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.73_1651625039765_0.21570147524989158","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.74-renovate-internal-patch-cc5ff44645afd40e56b696ce06f1eb1ce9fde605":{"name":"@balena/jellyfish-metrics","version":"2.0.74-renovate-internal-patch-cc5ff44645afd40e56b696ce06f1eb1ce9fde605","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.74-renovate-internal-patch-cc5ff44645afd40e56b696ce06f1eb1ce9fde605","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2887500699cb030594205e3d899f559402cb2f28","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.74-renovate-internal-patch-cc5ff44645afd40e56b696ce06f1eb1ce9fde605.tgz","fileCount":16,"integrity":"sha512-48HS5KUsVFSvnCo0umJmUxDQVq1ZznBnfsTwchgkP3dRDPlngcqNFwaRIm0ndb0xolkKtgvayb2u+1VFDMYuIA==","signatures":[{"sig":"MEUCIQDeMqPOSroMFaBCCCeus89AdrtR45cp2hdY7z9mTzzNOQIgIH61LGZrESdLcafMtYC02o0upmUBr1Xb/BcU7Rx7q5A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":150681,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiceshACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo0Fg//YnZm9YLPvgNS3vjhcjo+OtjCK1/ZF421OSU5IqkzwhisjUUE\r\nc/EAKj3W0ht+dahp20JNkjarYDLp8aGiYBA2Zssf2BJ1wA9GVzTyajA7Ficx\r\n8YRGyvyynxoffp/84ZrvCT8www7Fi1R4eZh5Fb6RzEIlk50SScD4PgPQ108m\r\n5Fo7Lht4MFHhwzkUA0NbxftX59FvS+kFRYQzgw+Ce70hVieMOherMoo8T25v\r\nDYqm773p+HcsNQtVsm+1xce88XMz8LJxfMhb61I4u2Hu4FJ9eQ7iKurigUvV\r\nE5GdfNRwqbudFsVhtw2ZkKa5JAxXg+x9b/Vfkx3a8gby+9iusfM2OBdvRQKm\r\ndZEv9NCVore7PRXz7CQEOomg97l5T0mcH5buf71599ipAuZCldSGzIYj/cyE\r\nwPDm+8CmPhsfmX2SiSGqzaq4NVrK4pckDjpaib/cJNelTIb4uXY+2xCgtCkp\r\nZTqhx+/SFt3n4S7+kGPuHek+gJkWWVt3V3baMDvvJ3irrm/fBQ5/eW1Fr/Pf\r\nW1fh5CAwKuxFdauhi024wcEfr1+QbttN/omxbn0wyFSFf9CPLKE6oMZn8DEr\r\n1t7X2s8ha05ijlgJT4BfzdLy6NaTJgEjd4ewloU32eJ91sbWDm0csvMK1mNM\r\npITZfrFh6JMLcoDhiVEiE1Z+M2btwt0Xb1w=\r\n=Wffq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"cc5ff44645afd40e56b696ce06f1eb1ce9fde605","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-05-04T02:51:56.189Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.0.28","@balena/jellyfish-environment":"^11.0.2","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.0.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.1","typedoc":"^0.22.15","typescript":"^4.6.4","@types/jest":"^27.4.1","@types/node":"^16.11.32","@types/uuid":"^8.3.4","lint-staged":"^12.4.1","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.74-renovate-internal-patch-cc5ff44645afd40e56b696ce06f1eb1ce9fde605_1651632929352_0.8740904240341543","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.74":{"name":"@balena/jellyfish-metrics","version":"2.0.74","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.74","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b953e3b5f634a75572127b631a044c75ded4bba2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.74.tgz","fileCount":16,"integrity":"sha512-sytPGFvYdchYyzgVoAMcU3R5TUP950vktj3sOpFFp8WNKtQiMXENxgqdaAfwwE0pnmVSL9XmhDptHMymQfqOQQ==","signatures":[{"sig":"MEQCICCwkTHunYNdzhM6Z+7+9oZL939v05e4nFK3rdCuq121AiA5RSFbyDUvJHBSJIh0o0z+31rAohMy/R9l497lwBMB9Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":150616,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJicewtACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqueBAAnBMbrMpmt9FP17rp9yLHTZ/4TXd3mOgCpx5uKjs5UcccNnFZ\r\n/+VJ5/M/yERtX/uOKpf1e1gn4+5wNKMX8thJ04EqJ22Evlt8TJF6XD0ryLQu\r\nYsZ6upfgaYj32f8K3SNtVPmIqJuOBAJj9dac/m4l3mWFkZ+yFQ0EX283DJrS\r\nrGhu/lEedZbZvGpnomVrcoedTyM5aUzDpUfio6vitN/x77Xz77uXQzFWH5pl\r\nVKXx3YDosWeGJUI4gW06wf0+OfzebV+g2/bQt+JjmQs8uKlzY9ZZcP51b6ki\r\nmqHFB4OINkk3lccxqgVQeCdy+WTFgoh+LMHCvmMYiFv0B0ReTgmnoOmv7ElF\r\nJdibkPAK9qeLnQ1eXm3IQmYCvc9LMAhWvqISukiX7UKLJX1aB5kiPTGs3zP+\r\neQamTvod+Z0xTqy/SpuCO9xjtk0JVVZ4t0FifV+hcoT8Cmrn901azZViGFtq\r\neN34vxlQoIPSOL4CJ6aYU+bhET7UtTm1aa0CTg4Z99J6ML3y90dSjqKQEzYh\r\nT7luw21nFb2mWbqdSlGAVHUmlw3uvJNJu2EQgckffrIAofyEwRAtWVKJ43pG\r\nK0Rela14XLzXDR0xKOL2T6m+6WzJ8XDASYDkXfKhNm0Ca9HyMpFPtzlK4p/S\r\nwjphEaPPgexvWGK+Mj3uov6Tj7RqvjY5vfA=\r\n=JGPE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3a665b3cd4e6df3267e952885a49b063e1bf074b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-05-04T02:57:26.366Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.0.28","@balena/jellyfish-environment":"^11.0.2","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.0.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.1","typedoc":"^0.22.15","typescript":"^4.6.4","@types/jest":"^27.4.1","@types/node":"^16.11.32","@types/uuid":"^8.3.4","lint-staged":"^12.4.1","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.74_1651633197081_0.5406506601213752","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.75-renovate-external-non-major-0f4c2cc1bac08cc09fa1f5798a5549cbb29df25f":{"name":"@balena/jellyfish-metrics","version":"2.0.75-renovate-external-non-major-0f4c2cc1bac08cc09fa1f5798a5549cbb29df25f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.75-renovate-external-non-major-0f4c2cc1bac08cc09fa1f5798a5549cbb29df25f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e85187dad825869c79b13369ee4f9ce3463ca5c4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.75-renovate-external-non-major-0f4c2cc1bac08cc09fa1f5798a5549cbb29df25f.tgz","fileCount":16,"integrity":"sha512-mgLsX/lgVVQeDqfAUOGeg/kFyF4O9qhM/KRqyVkeEzg1BO+Rm6SobsOw+LB92uw5bw3Mf1QYcNta+Ucj2vSN/w==","signatures":[{"sig":"MEUCIDTtB4/rWD+TIgl4TBSYxtcmFPvjoPH25gLE0AJat0VXAiEApPb7RRx7tdTun1bp5jusqtA2Lie2hQp9emhrh/2jNxE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":150753,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJidc5hACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqgsg//cn35j1VpKNTipqxq0chLrwcH6o9JdloAZuGVn7E9YFSTYim9\r\nvPkj1q0vFuCwjQhY0n0TpezKnJBVe1SnytEle7TjeVLPzVkOs+T16aWDtcZ7\r\ncI/0DmWLQzChRsHfWJJL7qjaYrlKNQCsTlKF2hRq2MP85NAl7ZfgjAlKPLXz\r\n3x+toh8YkYHRv9hbpE27C8MsYJBs4FNx+Wz2SKuBu87g1Wqj63u10FSpvR8v\r\n9FwNmpeU3NVz39XpKLW4ECUwCptpWkbfTAhUI8tZMLRhht9fPLd5S3OLDOVU\r\nyeR9I9X727CHrMH8I0EV10/hQvz/ZqE8uAyF69tkpujUY0dKFv+btxdy+ucl\r\nuc54TnM1R4uhzS1QEwolfaNRR19noNHHPYZuZqtTrbZzqJx/rwLQGvDRdRWy\r\nL4uiu8lizn7+IsfPkUvepHNiQwbRSZ6KEV+DXCinXonro6PwRmYqtZhRmp4U\r\nP4Hy2T9x2PV13aT2oDesaY5ZctYedUhf9qNjn0EcpSJmDZk2Hf2sXntdzp8Z\r\n0Rji4SLKcOMVrJ3b3IiexVVAzZgnIWw9DIJ3H8QmfbX/UbqMH5rTJR473n6a\r\n7qzuQ7jTfwmXfQngo3aLzUS6R0RN2enSU4gApWWV/UomCHyw1zdQzSYzHbPA\r\nh+oi1OBZav7Ua94IlACdgfjv7NMBs8hGr5c=\r\n=KqQS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0f4c2cc1bac08cc09fa1f5798a5549cbb29df25f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-05-07T01:37:54.587Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.0.28","@balena/jellyfish-environment":"^11.0.2","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.1","typedoc":"^0.22.15","typescript":"^4.6.4","@types/jest":"^27.5.0","@types/node":"^16.11.33","@types/uuid":"^8.3.4","lint-staged":"^12.4.1","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.75-renovate-external-non-major-0f4c2cc1bac08cc09fa1f5798a5549cbb29df25f_1651887712978_0.9237160370614912","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.75":{"name":"@balena/jellyfish-metrics","version":"2.0.75","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.75","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cb4a7c9261cc070d9b3f5ad2330760ab6a3164c3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.75.tgz","fileCount":16,"integrity":"sha512-pDw1Q8NqvmcZ/irnS/b+Dxc2ZPshvQCGPaJGuvcUysQgdIyMxwZ/Wj/T8EQyNuzPgWkMfaC/WzczebE5L+BrXQ==","signatures":[{"sig":"MEUCIQCucNDEblqdDv+uVWTWS9SpilmHzOzWfvfaj337eEBgpAIgDJN0mVZaxM/E/NXAZIKZcq50gwoHNJEjy3kmYvEFRr0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":150684,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJidc9YACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqhew/9El4UeNlo8Z3aKvYq+e4T2MkaxVOk4riM0/sDbG4fu+iMSkBi\r\n+WG+JmTYrCcujeSDag6eWmWmwuvW9iQEEDWCpQk9b2PDpRK4fGBB9oajyJca\r\n0/TfdkG9EuVfV3f/opgC+2qGLFGC1cwnjoHF8r6bWTBWrmhJ1GXBMK1Q1hZr\r\n6LVyphZ8UmpEvsy3dnrIXY8ssPvnWhBjkky3qq9758KOiGOLlb8zEjYuo6wy\r\n/CfL+Mc/4pTPvN8v6D5XhdQYzQYhWNE5uUXGYwBUOPl1OBlQeR36v3vBU24g\r\nWLUwW80uJjt8d3LN4OT0s0EyTTsCLCLrd9xbKfH/KnKZUmAFPKiNWxVCYYsX\r\nCVsQwmXQ3CGve2areyMNIAuX62l28TkPfqCp9G7dP2uSjBgub853jdz+DVOY\r\nnw7IYx1nP6GRzpjTDwWrfFNpr423ZvuKlnGD4Y9l03alki6CSI9Rt+scYABP\r\ny6oU3Jl40hvtM1D/9162fxD8eZcqh77hdYGaAxtHDDImSck+KagkUMrISNPa\r\nu71Q1qsBkK6J7cNW+FbNeGQFsCBhVpy3qtVS5ZQKST2IoU6iTPwwRPcCHmPW\r\nNXtFuatu9jGzUROq7pnqM9QUsRu2/SiSBjYXO3gOTGa1n52LfGhSp2nWLtix\r\nB1LyAzCDJIgFPrOK3dknj2IjKEi2XkECIhc=\r\n=Zn3n\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"48b55880bde189b2c7af36993708d05e64cd75e0","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-05-07T01:44:06.369Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.0.28","@balena/jellyfish-environment":"^11.0.2","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.1","typedoc":"^0.22.15","typescript":"^4.6.4","@types/jest":"^27.5.0","@types/node":"^16.11.33","@types/uuid":"^8.3.4","lint-staged":"^12.4.1","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.75_1651887960121_0.26453912882207997","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.75-renovate-internal-patch-ebca8e8fc7e9911cfee87ddef783e4f3a411b266":{"name":"@balena/jellyfish-metrics","version":"2.0.75-renovate-internal-patch-ebca8e8fc7e9911cfee87ddef783e4f3a411b266","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.75-renovate-internal-patch-ebca8e8fc7e9911cfee87ddef783e4f3a411b266","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"12200e526c2b44aa9efb6d8ffbea87f7bd192ea5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.75-renovate-internal-patch-ebca8e8fc7e9911cfee87ddef783e4f3a411b266.tgz","fileCount":16,"integrity":"sha512-ZZCAivITFJMdYp+tgc4SJcoM86Tq/J1jEzqljinVrzqAXWJtbz8b5hoZm03F0AulGao5qdr6C7Jm4bySC+VsQQ==","signatures":[{"sig":"MEYCIQCkEAcqzvEdKmBhYvhti4JaQJbPMumPrUS7Cewy0IORuwIhAOhHcd0k2wg/1RKZ63dSWwR+oFyLhLAXR266JFvi3Ytz","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":150788,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJidc/UACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqQkA/+N//kcxt5W3weRVSroO4W4/T5H6Zz9a3SaO0pO2eG7DBMzQ2T\r\nFSrKihEAYwPG3Q8KJ0p5hLZKK+Y4oTJ95lZpPb+Qa8WbDOkfB8GvZ6G0OUQ7\r\nFSFoFzBx0H/Qo0/bTPa5Ji+/TbAX03pUhyjhTn+Pop1tyjL9abe4PJS5Px1V\r\niPKzS9ayZ50P/bWyw7sK/QpZpJ5rnWa54bEtKl4EbQCClx9CoGcEkNG/Bnb+\r\nITf3zl/t0wboD/pwhTATm5MC9Zk0chJow0dqtgPXIDhxwr527SYLlpMgKBX6\r\nIRu/g+V99js30e8xq/8ZIMlt3WSK81R5LWjIgo/uFJ9HaZEJiNvNfCM+dk5u\r\ngMAoi5bS0LK5an37WffqyMFyeQ0XaJ8Cs2YWOuNXnj4gFKqoIu0LOVBSxzrK\r\nkKLhWkRyRT+NwK26UGaQM4677R7CjUxdjEPezZe7IwAxWh2Yze6yx/z3MvAM\r\ntkDa08EnufmtsQifOTllyVK9L8qq2g7b8eBxpIWeq+6lkjqv7qsJbC2ukTkd\r\nrdK7vY47y+uO1851Sh2j13ROVcAHsYsh8oxWfpsk9nrWKe55+WE4I8hwansI\r\nrymn4KyH67tRiyGXjJkCD6KBjX+KLhCbkBMxKdQMnIr2sDsP35a2iMIcHWPT\r\nnUE5PQetPrhCqKv9fa+N6JQCSUJZFcUnchY=\r\n=H2pY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ebca8e8fc7e9911cfee87ddef783e4f3a411b266","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-05-07T01:45:06.548Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.0.30","@balena/jellyfish-environment":"^11.0.3","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.1","typedoc":"^0.22.15","typescript":"^4.6.4","@types/jest":"^27.5.0","@types/node":"^16.11.33","@types/uuid":"^8.3.4","lint-staged":"^12.4.1","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.75-renovate-internal-patch-ebca8e8fc7e9911cfee87ddef783e4f3a411b266_1651888084040_0.6730045675764089","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.76-renovate-internal-patch-00bdff3c88afb3ba8c2bd262a483c2c9f7633591":{"name":"@balena/jellyfish-metrics","version":"2.0.76-renovate-internal-patch-00bdff3c88afb3ba8c2bd262a483c2c9f7633591","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.76-renovate-internal-patch-00bdff3c88afb3ba8c2bd262a483c2c9f7633591","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a0c7d06f5308d6df923a74583d6828efacd39ac3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.76-renovate-internal-patch-00bdff3c88afb3ba8c2bd262a483c2c9f7633591.tgz","fileCount":16,"integrity":"sha512-58HeFIOEstmuXs6yvGYI+jiqNUXBiCK59pzrPtqJOVJ9u3rqIbd2xzYPgOK7jknh2giQOwXwRq2HR/+eLgqupw==","signatures":[{"sig":"MEUCIQC5v0nDA2u6iboWC0K3L7MNnY6wBXyV/jrVd0jnwYZejQIgVK+J1Q1/daWnvqK44Qds9DZwj7mgjAhWafrjrZyq2/Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":150813,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiddCFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoMGxAAnUTBVorfqWs/r9tFVb6FcKPpr7br8HCH1P0t8eBkLvV1IcGs\r\n29IjeALmBr6cnFUxRIyGtNZWRuYSyZpVK6GzIec9VcVTGGSbPc/eYU+CNmj8\r\nW6KcAATWriNe4buy1sQ6g83+3OZfhmG1KdXL0VrV0vLtYGerLkNQ4T49xhDq\r\nLO0K22smV8Mg+N5LDbm2qyaxfG9ovozdgopXEPW5mAJ0iLuTnx1eW1LZ/rSD\r\naE8oiuR2ApuysJVKCFi7pE5vucphtpcfmuxJvqr34XKQmDVAEWdZThf6y0LV\r\nI6Y0SgcEvqWknaVhjx97lcwpVNYtPgxxnNuRXdz/QimE5IiOfLr1ecpHLVrE\r\n5HC7mPC1cdMdvLcwjoLK9PGoC1v8z8OVuzjXLH5sMyg7AZj3O36KF5Iej3Ki\r\n4VecqWcUrOi2S9czpOL9+zkcybYXXVNdaVAVp9uRj1oTBgCpWKjODFXWjvue\r\n5A9SjiOOagzE0oWqofiFr4OoBYix5FsRliFtFWACnjVaQaWiddnhnvbBZf4F\r\nndPgthDD/i0c7bqp3bx4YR/uUo9FEKzQLYCikDwr5+TgQV4JaNK4QGP0fz22\r\nNrqttccb5O+pTklgTPP7YuoeaaOlXEEkc8mdGkxlrGTqjQi2h05jAPY0NC4I\r\no7guUbBNTqqGKixnJRBMxuBiOfz+5jHYxlM=\r\n=7YjW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"00bdff3c88afb3ba8c2bd262a483c2c9f7633591","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-05-07T01:48:18.429Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.0.30","@balena/jellyfish-environment":"^11.0.3","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.1","typedoc":"^0.22.15","typescript":"^4.6.4","@types/jest":"^27.5.0","@types/node":"^16.11.33","@types/uuid":"^8.3.4","lint-staged":"^12.4.1","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.76-renovate-internal-patch-00bdff3c88afb3ba8c2bd262a483c2c9f7633591_1651888261098_0.017632394598614543","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.76":{"name":"@balena/jellyfish-metrics","version":"2.0.76","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.76","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b6776d414357d37c3deb2afe43307925f5d393b8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.76.tgz","fileCount":16,"integrity":"sha512-lPWd6MY4ZBaK5ig2timt3HRBmZOzmkBRWVgYEVU+MHtJZ5noSoxUwVFmBqdDLeik2vXM1VRhMQXgAg5eu7W5jA==","signatures":[{"sig":"MEQCIBEiiv4PkEqhPiPcjRYlRU0mi2e590sYoQLi+5V0yyCaAiB4dcvMUd0YK7OFds3DvowZqszEVYsfHau2l940zpw/cA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":150748,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiddFRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqbkA/+MOE5jNC1sj7F5AP7ZgfT0yfPUjHXaLkce5VgQQf4U+mP4fKZ\r\nwJ3mhIVTaSTJspEaaMyF4IdKyo8DrEA2Q1KAqfqW/DidLbx6bgw7ufKI1CMa\r\nRKw83ZMf6oCvYnuNEt0Wzw8LZfPvzVTsDe2PUGNvU79DMctAkfka+loSD0Ye\r\n+5mEKxsXsJeNUPCzT9q7COQUjaUVU/BMr79RtV2wFW6assuYO4qw1BQEbwFp\r\nDeEf/lNSY2rETu70qMWMKXVAGTJGV/nsRIsuTzi+sy8A6HSmfyzbCQ1NZ/ON\r\nojucZGLz671LLSwjoCZdEIlf1UN8UAhIzQzhpY/J4dFfFEG+dMuuR8hukJA9\r\niQaa9N77ANpVsEfWObh+U+uPAjVJL4cP5BPgbdFrKxr5nIdG84TSv0dfize1\r\neWpW7ymRdgaCxujlG85GXh4ah/jFwAY4ldC839HeQ1iFnAdwff5G58kT5RbI\r\nMvjjKlLb2Ja8g34LDiDEVw5V4yr++VZljs48IY/HAdUbs1UHffokntfYYUPu\r\nOjRzbXYJsPEF7Lwr5SxP7gxOzXQft7QqjdnEqIoYcN3idXAlX4H6NDsvXghZ\r\n3ryybCSCM9YXoZSQKtpYZ5UaZ6w6WT0a0rUx39tbZ/lqVGukWakk27RQbnkB\r\nAMsJsDIO3HAHWqUe1YPiUaheHX8XxTTtp3k=\r\n=OmHb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2a8887b9e3889f8bae62901dd4ecb778dfa54f71","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-05-07T01:52:36.774Z"},"_npmVersion":"6.14.16","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.0.30","@balena/jellyfish-environment":"^11.0.3","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.1","typedoc":"^0.22.15","typescript":"^4.6.4","@types/jest":"^27.5.0","@types/node":"^16.11.33","@types/uuid":"^8.3.4","lint-staged":"^12.4.1","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.76_1651888465507_0.9366137121516418","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.77-renovate-balena-jellyfish-environment-12-x-67f8ee2de72e79efd4a78a32ade721645e427910":{"name":"@balena/jellyfish-metrics","version":"2.0.77-renovate-balena-jellyfish-environment-12-x-67f8ee2de72e79efd4a78a32ade721645e427910","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.77-renovate-balena-jellyfish-environment-12-x-67f8ee2de72e79efd4a78a32ade721645e427910","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7781198531d06c18f52f246049e3ac4167d16394","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.77-renovate-balena-jellyfish-environment-12-x-67f8ee2de72e79efd4a78a32ade721645e427910.tgz","fileCount":16,"integrity":"sha512-LA60CVJtYVKaJDBoxrEFoaoEE9PWAq45ZPGRWU3GzrlipuBCvkaeRbxLfFQ9PX0jY2KqSI3E1QTSMKdo8cqpSw==","signatures":[{"sig":"MEUCICoa7RqcQtpePdkuxWjpXI9nANJqI9tAlkETvWKTbkYmAiEA4Q48sSx93KsrWLUWQsrlwYVZJP101I57CXmmnUkwwZA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":150933,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJifTd/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoBshAAjjIU6Sfng3wkRlymRxMSZI8qtmdApl4oXdCYcfiu/ACLxuEz\r\npZsRyQu3rtsiIKp655tRaD7M5t5ML2XzsVjBT0KZ8280i0OBX33fx7zJYoAS\r\njhOgHYTt/QrzWzNACZ80BgGz8L0xFFEFXTYAOrnds1QUHY0xgj9qlpl0xJvL\r\nNCJcdgA7ezRVG+SA9nh8t73f2FfzZ17089l+FaQLXmgmWd7nUKnyo7WLiLib\r\nSy+gzkTR1C9Yd4/OA3zob6ZzQX59WnPXM98HT4Ou4wxLZDULcncpNAHAGpkQ\r\nceBFIEV7L2b/U8VVIuUbWyGfdvvcz3dc1lImewWgMX8yYdtYOJSp4Eqt2ADO\r\niPrqXNU+qpgqb9SyvxNwUFt4+q+JnATKBHBHHkQ7aVdGXa/eS9hGp7iiXpBX\r\nyCLfsdDn6DoHE7NIWUNJWbIASmQEWjCglOuqZZcvY2aHflEGiQOrM08Yt0Pe\r\niU1IH6ZvHl6LvDGRh35nfnMJ7PH0Br3lQFqyowIqDM8AwPlotvWU6EWrAlVC\r\ncfPa1yEqrQiDBc+NV95KEuxd/Kl2wgPmQZyO59DCHrfM5b2EFDW5rEhRzYY3\r\nOOTFZGbO9Jta6RKsPowszpKysiRClonlYaWKUYs4S/2NdzZqEsFt3Fk8uLek\r\nx4SUM9knMvDvgK6N7b6ULpx7VCcXctf7u+A=\r\n=nuMs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"67f8ee2de72e79efd4a78a32ade721645e427910","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-05-12T16:32:51.111Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.0.30","@balena/jellyfish-environment":"^12.0.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.1","typedoc":"^0.22.15","typescript":"^4.6.4","@types/jest":"^27.5.0","@types/node":"^16.11.33","@types/uuid":"^8.3.4","lint-staged":"^12.4.1","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.77-renovate-balena-jellyfish-environment-12-x-67f8ee2de72e79efd4a78a32ade721645e427910_1652373375376_0.683668338204696","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.77":{"name":"@balena/jellyfish-metrics","version":"2.0.77","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.77","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d47c7418554cb56032891faf868aad3688efcf6a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.77.tgz","fileCount":16,"integrity":"sha512-/FvV5ImnK1xKqVX5Q6HiNci8aBZhOuG1IdXPXZe9LYELw29ZdtSJjC5z8613Lh9TDkwMDJUCINBrHXCiTIqu8g==","signatures":[{"sig":"MEYCIQCh6SxlQyNx7HWd8MdeJYKsBJG+hAahjx8MJvWhaLkhkQIhALSbgF9Hhr/9aDOVL9AZHO96diLwz4Uw5SKtwd5/N8hy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":150849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJifaf3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpJaRAApRGs+w9rBbHbYgcWV+H0jokzLk94Mhk9LpLr3hwrUBHyhDVC\r\ntAAfZ6JCpK6WaR/Q01jRzm93RZzVDHIKY7fF/2s/2TXBdEGsRAksbnNUbDYq\r\nAxvQQ99F14z7gDDzE0wqb/F0oFWNzc/R514NGoWfJhKjzkVm9bLoxitr9qHd\r\no7hRqVlj53GObeaSE/YKl5vy/5aT2Fkjpsv7cl0cnKiO8igDH4uEHRwKgnvm\r\nL6hcLKhI2AA+Vqg721g/6fXJQuZFrrlBlByqYQmdVz6exQZ4TbQ26bZMmgAM\r\nXtN7CIC8f+G/n5hzyoyyGVQvk5ZAdI8+XlTbw9ug2ScPurd0UGRJWN9PNg6c\r\neb0kVq5VQUsdWXbY30jl7eAlcYMrw2kFNc6M6txYsdUhd6MWkbU+SXskCKNa\r\nAARDiBIhQUVg2hAu2lh+KkzMctny3w1E5jpl1Juf0IvsCQObvMOX3pYi20Qc\r\ntYx7dVE2QyCccQLkel9rQv/MUR2i0uSAKXypaXoESuhJC3wEz00Y8TVtx/mC\r\nzO7lQMTCROG887txXZ6rXLR/KDwzv6ja0WH/HJnio0Mp2l7MaLhx5T7Kwj48\r\nF7dJdC2YrMNv5cCpFELsZwJT6RQcTBK8EwkVr3fbXB1Yu0MviNtrtsGoUK0H\r\nuAdFttyHiEVEg4v90yB/bdRFoeDSI2WISUE=\r\n=EjCl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"08c48f74108989a71e485c78bc14231429a1c98f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-05-13T00:33:00.076Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.0.30","@balena/jellyfish-environment":"^12.0.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.1","typedoc":"^0.22.15","typescript":"^4.6.4","@types/jest":"^27.5.0","@types/node":"^16.11.33","@types/uuid":"^8.3.4","lint-staged":"^12.4.1","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.77_1652402166991_0.019682030833757302","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.78-renovate-external-non-major-d1e1465398afae4b39403b6f93397ec7831d1324":{"name":"@balena/jellyfish-metrics","version":"2.0.78-renovate-external-non-major-d1e1465398afae4b39403b6f93397ec7831d1324","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.78-renovate-external-non-major-d1e1465398afae4b39403b6f93397ec7831d1324","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"efe732641f1dcb47cc3fa266cfe6d08d1ab18f9d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.78-renovate-external-non-major-d1e1465398afae4b39403b6f93397ec7831d1324.tgz","fileCount":16,"integrity":"sha512-euz0JbxWkUoD/uL1FQvZfNzcl+9BW7n5qP3cuDdBcG6wqMnQ8mR4Jp1txR2HAN/lZUHEwv3z1auUoBOBH9JLwA==","signatures":[{"sig":"MEYCIQD6zlLwMXFsZ4qtwswEf0RO3zuCxM99zwN+NehUxq9SmAIhAKN70gPVKCsqLnK7TZ3yOXr7f0bJUTVRBoNEKB9e6oOO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":150986,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJifxirACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmofOA//WKB1C4Fu6KJfEkBMXIbcIiCtiLwiOS0eSFpmS0Y8cYVSPtxv\r\nPyuzlyGygbjL7nEXxxm5c4m1G4OmzOo5pm/e+Gw68/WJUIIqcl3hRr32L/+s\r\nFOS6zfoyKZhGYu3UI4h7IshMBebv2322ucfav5Zou0erkR0cZNOp8HmgCrtL\r\n9/ofDtmHnz3cKO+JVTIZk1f3di75VFkZvQ6nIiKKLoYn4bMO3XULzMfyVoDf\r\nltR7MO7zP4VfjSvOXrki+EKf6kIjWTUCnOeZsRYsk7CcXy8IJs+hrjAacKFX\r\nwqvVkV2TsHUg4Bgr49FIB0Td02E59NiluNzJA/1CKsdFMaQ9omtXRORAV7ix\r\n6gUjyvj1mdy9EHKHn0Y+EAGP9+xXvlWzqQh9r8qNTnXYNGT8v1jeez/mUq0Y\r\nkEA18rEBJ60/UoJ/DY9hMBgufzloyV4iSVuRy8yfGNcbP5khYf/xMz6btyoe\r\n6kOkTZjjbAQcMJU0MIxrD3GFagNbiOsRbM7l9zqRZQkxIcb/BSLopE4bIEM6\r\nF/98GcslXj9jUgTGk0qPyk0olfb7DF99cajxDgCla8aOpwSpXDAb6DO7hw1g\r\nfYUtQZDC0gXR6VeMPuG2W+crPR+TAHAuXPWr3nCFygcrwNIA1Cn7nc5w4So+\r\nuBztL0Elokca/ZSaT4bFY1XUVvHeIM74y2I=\r\n=gW8U\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d1e1465398afae4b39403b6f93397ec7831d1324","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-05-14T02:44:24.071Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.0.30","@balena/jellyfish-environment":"^12.0.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.2","typedoc":"^0.22.15","typescript":"^4.6.4","@types/jest":"^27.5.1","@types/node":"^16.11.35","@types/uuid":"^8.3.4","lint-staged":"^12.4.1","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.78-renovate-external-non-major-d1e1465398afae4b39403b6f93397ec7831d1324_1652496555102_0.7308944799804431","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.78":{"name":"@balena/jellyfish-metrics","version":"2.0.78","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.78","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"34f3ebe096112176b21d5aadb014db6e96c21b4c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.78.tgz","fileCount":16,"integrity":"sha512-170OMUVVrsyhYny0HHfDyAZFLqBnJPRokZRGhCw/8aBybBAc4dbAaR7ycOGFR4d8/cAlM3FE78RhATbJ3u//ag==","signatures":[{"sig":"MEUCIQDm2EME9O+z6C3nCu9CsKB2SwcgvBdDDUKCmugcwS7PlQIgQ3XweWSZfSCiUNcgRM2njUI7RoHWQEaJX0cZjWK1ufA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":150917,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJifxnPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoyxg/+Ky9tFNG31BYO/i+34hJgCR+vpvdmp0JVeGNi50RRoF80MC8n\r\nkFbbpEhlKE/CVks7i7sZciY48xxAV5DMqfZqkD6G8BiTgwoERckIVo3/kpAx\r\nagutr3HqfArdhnTbukKQPPMZtKXrLFfDKJeqRehYKXCiKmjRpScQiOS0ABcT\r\n0VApik+0WtrJWlNC7xqmfAOFM9peHnU9p6XaYQkV4INZJbpDWRTdhoJT5HiY\r\njEY3+Z5kaW18wV+EeG0Kx7fGLO8nv4SJcKTv7Yyh8xmvuTNyL10pPjH4l+aZ\r\nkPsd1MEjQRTyXIQi5wT00zLIAaefW/S9vXT8kCYK5uATOJyqUy/9+tu8+BB0\r\nziyYj1WdtGKlM++oPx+3UIZ3bGsM0G0xYJN6hB60e0Fao5PToWYetyvv4gCc\r\nIH02Mu43wXbTa/QjspYgqJi9pXhae0BMmZJ8yTZPnDxdEHGYQTaAAJQhnhFi\r\nwoXagf4EBVcZv06dOc+wuJQ5bFHKiRgSBx8D5UD5CV5qwzfNLi+1A5ZT8ZTo\r\ndme/ULixEytt8rAQ11MstBEZLlcauMT08f+8sWLNG1CxEZrOLfeWUZSu9yEL\r\nQ+zFB3hHXezi2DJWRqus80mIwS1f/Eu/CXODnfAGPauj0TZ31Md26yFiYOqS\r\n8eLOEbWCfrlYkaueGDLRLrAAe8/K92w7odg=\r\n=vbxu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"81511ca5130e427ed4770684c69f169dafaf1bf4","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-05-14T02:51:19.750Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.0.30","@balena/jellyfish-environment":"^12.0.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.2","typedoc":"^0.22.15","typescript":"^4.6.4","@types/jest":"^27.5.1","@types/node":"^16.11.35","@types/uuid":"^8.3.4","lint-staged":"^12.4.1","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.78_1652496847639_0.765949552396546","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.78-renovate-internal-patch-d5df490777cd341cf7171b9e74eff2ed1bfb3f78":{"name":"@balena/jellyfish-metrics","version":"2.0.78-renovate-internal-patch-d5df490777cd341cf7171b9e74eff2ed1bfb3f78","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.78-renovate-internal-patch-d5df490777cd341cf7171b9e74eff2ed1bfb3f78","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"dfe430e929057663404d8a4e4afdbc61f5062e77","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.78-renovate-internal-patch-d5df490777cd341cf7171b9e74eff2ed1bfb3f78.tgz","fileCount":16,"integrity":"sha512-bPwMEkErZwIzvc6cvj/ecu5I0LRBEHwEHztWj2zyvNGpWTeZTvMITCMVorVIeoXyXTMj1DZYx/Q01AwhcobR9A==","signatures":[{"sig":"MEUCIHu74/MqlsBbmOqBci/aOoUaQ3S96p40U9Y7aSjQbNaeAiEAxKSFInZP1BIX0ACU6LO6KiyA0kTlS03eL6ZeNh8fa7g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":150978,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJifxoQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp4TRAAoVaJ463Zgw+QKe4MlZ1HZRxKLYwdHkIurOVCh/an+bGEoZhC\r\nPam1mqMat531nAjj5MnPBGzJllKRY2smYowkAVoWZ2Fytb1HMGZLz3fbZ7bY\r\n+h5YbCi0EUFkN8lPfxFQ+QJvAhjDRZOqqYMHL7nJVRZLvbNLRswqVeZVr40+\r\n83pHmJbBuOQFCGwWR8/9manNog/AJ4yigrHH/o4Jv9L3C8s8/sFoTDorcIEH\r\n2rjKtB5jlhe8e4K8pn1cOvtI2kQhz+XxdjEbPnRKFNBeCV67IhgER0ygDjrY\r\njLkWhR0KsRwUM9wyz2/tk/KLD5oNM7WozGNyLx4eh3tJ9Rjd+6jnIyeyzMZy\r\nTJkIpDWsYJ1vVprXCufp6cdRN353qQVxKTL+QkVhIyQIT8ebjDte2/wZNl+3\r\nvGmGGOB06MTbVPTAtkBCvMY9vmo3tOe94ZYSiG3L2lIsDn95xrIgrLLM+FmW\r\nkMa6UDqtagM+DE1PF/WSPMAbuRMoXuulsvczvm3nxJNXDKXyoFxw18smKSfV\r\n6BMdf5CcLLnJwdDn0HIUtx8oD4GMLLKIRy4zvtQklZX+++4KWci+OGMtpcGP\r\n70JG/BIE620mVIlpxeyOE3IcowTt5xpPrPhrnIDp4dz3/qFOH5QcQ60bLS5J\r\na+TPcGaslAxMHkcbcDIXnlzAx/vkfeAC+jw=\r\n=nkpI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d5df490777cd341cf7171b9e74eff2ed1bfb3f78","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-05-14T02:50:00.598Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.0.33","@balena/jellyfish-environment":"^12.0.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.1","typedoc":"^0.22.15","typescript":"^4.6.4","@types/jest":"^27.5.0","@types/node":"^16.11.33","@types/uuid":"^8.3.4","lint-staged":"^12.4.1","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.78-renovate-internal-patch-d5df490777cd341cf7171b9e74eff2ed1bfb3f78_1652496912361_0.980925733905935","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.79-renovate-internal-patch-885888ad8a82811e164c680a0efc0e4c28ec9cf0":{"name":"@balena/jellyfish-metrics","version":"2.0.79-renovate-internal-patch-885888ad8a82811e164c680a0efc0e4c28ec9cf0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.79-renovate-internal-patch-885888ad8a82811e164c680a0efc0e4c28ec9cf0","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7134cdac3d1ee397ff7bbae42a5db63f970e9891","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.79-renovate-internal-patch-885888ad8a82811e164c680a0efc0e4c28ec9cf0.tgz","fileCount":16,"integrity":"sha512-h4631Rwalq9CaXZ+MIEa6C0hZreUv17yqHYWqz7Ql6BPMoH44249ghOEsYltAZ8ayCH2h9W6qD4Yky/NIObZFg==","signatures":[{"sig":"MEUCIQD/Vq98NA3KK+XdodLXHXW/IbhC2/1fwm6aY/MBaxqTKwIgftseXpy7BV32pNMWKr7scpecCj4Q8/Bz86Y3aMP9VN0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":151046,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJifxs+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrTOxAAjvtP0dRfO27xhNU9y9eseN0LUvCyBTfo/iWCj4psSWog6Ce0\r\nhJ62r5cH4CNb3xHuXov+xHEVL4IPff08nEuq35PrgC1qlyrGF63MCrQbB32B\r\nKGhYMmjOMtWEpYeBQpJbTrAC5NsOTUcd9M6Qqm9khvZzCN/wzRaQ4jQI/AGy\r\nAO7Xd51hYoe/qqsjoYPKpl6bAdaZgLx0IuWNXuvU2QWGjEKkw1ypVLBxKxFP\r\nF32S1ei3ctXP1AX1nXTi//IJuCZzO+TBnAg5ICqOqHHbE4VuCTLXDl7Y+EV4\r\nLsw4CG/B/i5nUDyo8xykoENGymtDVtpN3NfWdPfD12+LsE+i67j7m8P2dUsB\r\noutBGXuCqPoVXKSPx1voR6YjbvLw2O31yJ+VQy0mTduGr9HtKNV3eLlVta0U\r\nDwir/6Zm6jhRCmhucWUnYRcgdigp4ksrtr4yOpx/p5FuTQVickYuVoQjOial\r\noTm7XerWspDPVV4HimFeF6nehGuNIXr6UV7VGcFdaMeXmLOMbGTYHvYoKnWk\r\ns0dsKdhqKaWuKBiPHYVI1EM4jJtQDdPnZHfJBsI1/Vc7ypfm4DpteAOoi084\r\nHmbGVqdCLtolcl486qX6nUuLgne4RkaelBZncUPPY44p7qwQwsuMX2BRyaoF\r\npS0LI8wA9PrhsNSO6lkJOJBdH1cCb6Vgjjs=\r\n=XG9Q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"885888ad8a82811e164c680a0efc0e4c28ec9cf0","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-05-14T02:55:01.184Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.0.33","@balena/jellyfish-environment":"^12.0.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.2","typedoc":"^0.22.15","typescript":"^4.6.4","@types/jest":"^27.5.1","@types/node":"^16.11.35","@types/uuid":"^8.3.4","lint-staged":"^12.4.1","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.79-renovate-internal-patch-885888ad8a82811e164c680a0efc0e4c28ec9cf0_1652497214500_0.7691335677155757","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.79":{"name":"@balena/jellyfish-metrics","version":"2.0.79","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.79","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5a348f2756212d85dcc8b1cc16e87a528c1162ca","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.79.tgz","fileCount":16,"integrity":"sha512-eMz2ThAySEmiGh2GY4IdR79py9EhB0SDb/twPP8RYXXDd722Ft1jCOOJdxaPVDoCtz3j6P07wnUK7Kx0xWRMFQ==","signatures":[{"sig":"MEQCIFj8+Nr3C/HqsTPI/eiNFa9nGK+PkIUJ1vGEv/dAbIceAiBx2Jf62dQkxv8ybjstHrMvgOJOGZrLJPGIUo84SPSWxQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":150981,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJifxxbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqUYA//dLGunfnDYVd4P/4napDZcYh90YizVMWlbfkGDoDqbT17qvbx\r\nsONHdWkXYs6mZlj9MvxQKXRtJACFwXXgPI2PC6sK6xYvguMRztBhhuhmqiwe\r\nEoy65y/wsLDeG80UwSAGc792UzJGIQG/hDO8kWTWat/eDH6JnH/aDTZyP7o+\r\nVNTbWWOqrTMC9HhlYNknwwVsRnJzP4dlRKODnH7xBy7JKHSSufvc4cHYhah3\r\nojxK56iZYyNa4j8zKGhpG83n9agCdDeraQxj+7EVMaSUxVBVNTZKxDyct5HS\r\nN2fsiYHH8BCHcJ85hX/9UQzlg4pGXziYoe83TpoGseCrMCuDmNhxzRL+IE7i\r\nQ1TZQAobyWMIROzvwhpjssdp0TJAIcy3NtOs7DSXce3hveUqcVZNti2CCOtL\r\n/WGC75vfLjOkkkRb9VMkJnJJaMtrxvoPdlG/U8vKAg6t9pXBZw7o0JWhKhF+\r\nvM9yLWunZW5SvOtGHDpjV1FpwXWPsZVKoxShgiRwPROMZHWC8Y3S8hbzYSUo\r\n+3Y9tgHUMH4j+rCjCXFqx9fqY8dha61P/jT7EIv1MTSep8WKxIWnLZJSx6xi\r\nHnQBuWM15UrVBwdPDygw5wx2vNsPRwuiTIzvsM2C6xslfismeSvd3SfItdiz\r\nyKyX6CLAnDkONxXnAl5GLdolW7GzCjUqbT8=\r\n=xia7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"bf861b94ec99f370f9a94bec42c38ea29e9945a7","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-05-14T03:02:37.880Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.0.33","@balena/jellyfish-environment":"^12.0.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.2","typedoc":"^0.22.15","typescript":"^4.6.4","@types/jest":"^27.5.1","@types/node":"^16.11.35","@types/uuid":"^8.3.4","lint-staged":"^12.4.1","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.79_1652497499364_0.9970506447697074","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.80-renovate-typescript-4-x-78d0047f44e6cd507d806ee621f51f4a71a94823":{"name":"@balena/jellyfish-metrics","version":"2.0.80-renovate-typescript-4-x-78d0047f44e6cd507d806ee621f51f4a71a94823","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.80-renovate-typescript-4-x-78d0047f44e6cd507d806ee621f51f4a71a94823","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5a1489a9f150faafcba9b1775031fc1521c866e7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.80-renovate-typescript-4-x-78d0047f44e6cd507d806ee621f51f4a71a94823.tgz","fileCount":16,"integrity":"sha512-v4oL4ryS91KwSMl4vIoH3QfmUqi2L88dgXQoP3c96eMLwQg+8XFVN2tnzbmfwkHlcR4jOP1a62GEJPVL9m0T0A==","signatures":[{"sig":"MEUCIGpoAjFlJSAUEQQL6/enxyEyI3dSY+AHUngkeWEebrwuAiEAl9KWoIOq/uCpH3yDXj8JvhRujsVhpro85ZT+O/l9hb8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":151126,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJijSsvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpKXA/+Pj0LaG4BH6eS2Av2NuhsvaSNpwzT9Ct7gftFnJtxNU1043mh\r\nLcOhBd66AdXPo+mrmumEv9VGlTu0a9+Mq5GuO+Cd/CNjLu9KFsZiuwavSZie\r\nFxtZByaY0bCfnWai5J1521J+HfG6FKY+KWuUAiiFsgQab4JQ3WTOmPH95vEH\r\n9ZLJ6+CjDxHOvSeIUeYA7n6zMyweSPNR4ZFuN6HpCqqmcwbc0tBj3jGBEgv0\r\nQOxbY0iauFGv7upyhOupIA+6/b3skQWsO/hAdDBxjhH6UQoCQWODsjBxdWgs\r\nkvbMJZISOtrzZpeR4letQfsR7z6TkyTQGJ0iUCH+RBwjQDIPCMHEkR+ZaBp3\r\nOz7BZe8MJPchzF7jmxuxHXFUc1N2Bst0bnYi0zPhsqcROoi8RZ4pTvUCIBM3\r\npIH3fdtDHkcTA7HGI4QoYJRXtiuwK+DC6XZ2nydRcQNc58MEEte6W32eDT85\r\nKSwAFxbnL+Br2uhooUPqAMPw13943iza3cd5pq+IMsP1ouUNIGASJkcIG+lI\r\n0+4F+RiDiqY2NLxbJfrCvxiX5Ov9iel2nzT5wAyTKsJjhplC4AZVgiPxV/yj\r\njS/FmIF92i5mfTkKZPEFH+RAbZM5yOtH1pqpixjG3anT9WC5BUvTfBIgIv0Q\r\nmeKZAKGGcuZKMeNvh67FPu/1X4vxG4N1btc=\r\n=jDbz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"78d0047f44e6cd507d806ee621f51f4a71a94823","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-05-24T18:57:58.446Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.0.33","@balena/jellyfish-environment":"^12.0.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.2","typedoc":"^0.22.15","typescript":"^4.7.2","@types/jest":"^27.5.1","@types/node":"^16.11.35","@types/uuid":"^8.3.4","lint-staged":"^12.4.1","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.80-renovate-typescript-4-x-78d0047f44e6cd507d806ee621f51f4a71a94823_1653418799222_0.325377671514969","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.80-renovate-external-non-major-6346d5bec0d838176c0dbca344e96ceb47156e94":{"name":"@balena/jellyfish-metrics","version":"2.0.80-renovate-external-non-major-6346d5bec0d838176c0dbca344e96ceb47156e94","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.80-renovate-external-non-major-6346d5bec0d838176c0dbca344e96ceb47156e94","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7f537106b54d32a42725a80c61915210f36d4ac8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.80-renovate-external-non-major-6346d5bec0d838176c0dbca344e96ceb47156e94.tgz","fileCount":16,"integrity":"sha512-B6eKXbyCf31vzpsAOkixJ6ZSRSM3hjAMXmoilRy9ZsSXsxUuWp0YPijro3GuR3mbi2dxoemfJUWleDNFMlPlJQ==","signatures":[{"sig":"MEYCIQDp4Rtj5Lz5bNVRRiZe3t/2Ql3e7R1/dJyeNJPoT/WXoAIhALt/iP7b0Ni2um+QrLqkYiF0hsdJIbv81M4Nk0iyG3Ah","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":151145,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJikWrmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrxOw/9FZ2P0sYGj/b+REuVytFV2hcwZ+ber0UQRl/yGBvj00UlwWfR\r\nA0bwUHx3KV8z+Nz3l83P8UvFvwlwm70hFLhK12jSD6uua1uO7DjNqpq0XBIN\r\nxzp/JiY44px58dOtcGm0+JIckvrKyWcPo0cCpde+atvo9Jl4kVaJQkHn0qYa\r\nDXTlZviKCD1KapSxrDHb85FHd9FjNot9nz54axv+L1wW1uy5uJ/eb82TFlFg\r\nAPLQQctoGYY7sza9jsoFRtIGVZjVUrRFFs4dIJ5ntM9l1WzGOU+sGnsjI36O\r\n4bV1UG7TMAuEIxm/L0NQt/ak5O93kwvyHwj6TEPd/MUN19vLWsNStvrV1WPF\r\nkzy2b4XH+dOS6Ka2n5wCch6qcIdOitqQDPkZdLHrAlS7P3t3hzJOf6dkv67J\r\nKI07d9hU+qI5QUDscW8Ss1NzXffBEEjzEkH5iZY6EEvH7SsyV2aQIJFs67Yg\r\njQnEtpCaKJMlXO26BVYMphbexil+hKXUEEDTpmD2lYYcdAzItLeeFswFgtSI\r\nS+qKvO5L90HFtK/gk7lCXexqy+ZKpS6TjiJCsBI5Kl6THFDnKNEGOngZrLk2\r\naXJhLTyOlWUealZBMkPIiKlr1xvPRqygN/UqpkgTXYdepbf4L6zn1ooN6ztW\r\n6jawxAzTjmjui5HeI06kijO4CGgwx2hrKPY=\r\n=8NPH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6346d5bec0d838176c0dbca344e96ceb47156e94","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-05-28T00:18:37.565Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.0.33","@balena/jellyfish-environment":"^12.0.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.3","typedoc":"^0.22.15","typescript":"^4.6.4","@types/jest":"^27.5.1","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^12.4.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.80-renovate-external-non-major-6346d5bec0d838176c0dbca344e96ceb47156e94_1653697254121_0.6536436650861994","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.80":{"name":"@balena/jellyfish-metrics","version":"2.0.80","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.80","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"242b6c7e9bbefc338d630c28f2768c062b5eebe0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.80.tgz","fileCount":16,"integrity":"sha512-NPVAXGRme2vyR42eYuaK57jI6Husky861b+5/ZEMnvklA4nX+oqXLiIEtv5bapJw73vcp1LsZ6ZwUcr8U2f3fg==","signatures":[{"sig":"MEYCIQDiPGovPN6sMECkNvXItgoGIwKq9fg7tHAAE/AT9fNYewIhAMUzBMyN0gTIz+XH1Uh/Yj6TDsf2yol7+rMHUAfpJrQe","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":151076,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJikWupACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr7+RAAimGpZc6zxvDSy6+3sTP4NBqjURp8DKN8XK4AvEOjs9AijQGR\r\nZV64HdUcdDBs06WVsNJgoNN7Rgf5S333E8Ka7iuLEJu+Ch+ujSABTGdFkNZE\r\nfh9xfChtakRq5jn4EAMisr3HD3upPndFi9Ce/qas/EMXHdQPLvce6f/UbHkl\r\nvcbHomjT4Sm7fbGVhFOek0BA8xomQFJWIuX+2olJ7Ws5FUFq1y95/rs1u4Ra\r\nEqMATGARAXHeDXcHTlfmuxRRccDWctsMJCJ/80L1j5U5ki2U/+2YonYwln/x\r\nxY16Kfoh/mvfUz8Rb8/AYlh3vh10gVzsCCT+Ai4Irn5vq/M8trUMHFIaKpgn\r\nLCles5qPOpd9G7kySnPIBFs808b9QcxbfDSZZO75qx4akb5H0/DeEN1LbVNj\r\nxG4kR8/SMD9sH5E7W5133cV5BYHc+LSwVMO51Ttza/ga9X3qYVx5bDOsLxB7\r\nPzqCQVqiS4+ev/J/FMzTtaLZhCFIguOrDjDoLqyo8fP7aRWNcabFxOvdFigq\r\nbbpaIxXZU2ybyIaQ66hiny7FQ2LjfSs5OnWmn8PdL2hDa3I+fcnXZ42lErWU\r\nrecWmxpgqVPsfDF6R3kLhBhDyDIA1SyOfscpgw0qtUL/KzqDVH3Ct+aUHmLH\r\n53QjZUcfQO78c2G+tLJMUu2vQmW30pm4P+M=\r\n=0+9I\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e1769701acc08eccd724664504606b4c716dd302","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-05-28T00:21:51.988Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.0.33","@balena/jellyfish-environment":"^12.0.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.3","typedoc":"^0.22.15","typescript":"^4.6.4","@types/jest":"^27.5.1","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^12.4.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.80_1653697449102_0.5188970401198454","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.81-renovate-typescript-4-x-69d8532891e3aad5804857c127b9063651ce6a4b":{"name":"@balena/jellyfish-metrics","version":"2.0.81-renovate-typescript-4-x-69d8532891e3aad5804857c127b9063651ce6a4b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.81-renovate-typescript-4-x-69d8532891e3aad5804857c127b9063651ce6a4b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0264411d2c25c0086e42c80c3e13fc21c2b24c17","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.81-renovate-typescript-4-x-69d8532891e3aad5804857c127b9063651ce6a4b.tgz","fileCount":16,"integrity":"sha512-Y1yMNlZCoLdVRoeE63iuW3Uha2p3L3F1qe3zeATEyRCKhG+ahm6noWYULtp9p1dKEr/K3UCpZGm3kXkN+3452g==","signatures":[{"sig":"MEUCIAadnP4eFks5+W6IZaKfQha1MQc6VcWTnFANUxXBZSIfAiEAifYzhel3LKo00HB24SgHr+ikuF1gfv/z5tfnBXjm82w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":151221,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJikWxjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo4JQ//UBddw1miTX+ev4Pi0vc+m51IN36vjYNt9VWITAPFTNz9xgb8\r\n0EIQ+fOt1PzxAKBZ9x+XJSI4S0kzFuEekCJfRaoFjmUAgC2nqNpsrqEX9d+u\r\nwCU5KT75OFeFhUM8OMn8mHzmGeLKvbWuvdVKNwgM4ZUUr3Fl9xtkya3uZW9H\r\nlhqluomgL/yw0hfdecYCnO5y8dnheGq9wymOp7GJVf9zEl/t17WASezu6FG1\r\nzL21p7MeopN7vn6c4JKI8XwuXDWSLfViSMqMt2vn1r+JUWrDc/hkT+SycgIZ\r\nBEZBhhuv1EmyFtqk7zIbymzL1O7tmCYW5TgCsRl7fgk5S59Aizj1F/j2qE6e\r\nOLb4YHj2CulzGoOJsof8aZizBFfZryeJXnVBfuB/JGbosBQ5P8pxDo0+SSFC\r\nOvweWQeFKzxbBR0lJxDdFSVn9EoskPkqojQygn9F8S16We4LDTvyctSoIbVY\r\nFjEbbbgJeAStUIIVsrHMFpIRBs5UgaIQxLCytuH/kVk3Cxs19sAgNp8bm9Hm\r\ng+vLuA93l6AuGs2bf4gWCKTtk7mevzJN+s0qfPPusP4c5uL3FTwf0utyz/xW\r\n/A+eitwLQatNicC/ZgD1SnmXPFqEFDSf7J8DMPC0r1zXlKc7KfoNNCB4x4uX\r\nlSKXq/xKWeo8+OvD/4LZGejahNTBr5TFqwY=\r\n=CgoY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"69d8532891e3aad5804857c127b9063651ce6a4b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-05-28T00:24:38.141Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.0.33","@balena/jellyfish-environment":"^12.0.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.3","typedoc":"^0.22.15","typescript":"^4.7.2","@types/jest":"^27.5.1","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^12.4.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.81-renovate-typescript-4-x-69d8532891e3aad5804857c127b9063651ce6a4b_1653697635735_0.4862357866879088","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.81-renovate-internal-patch-9dd645a965cdfbef543926a26430a354ed3f3476":{"name":"@balena/jellyfish-metrics","version":"2.0.81-renovate-internal-patch-9dd645a965cdfbef543926a26430a354ed3f3476","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.81-renovate-internal-patch-9dd645a965cdfbef543926a26430a354ed3f3476","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9f13338037e08e78bc84a91e67b717baa71b0314","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.81-renovate-internal-patch-9dd645a965cdfbef543926a26430a354ed3f3476.tgz","fileCount":16,"integrity":"sha512-Solat3qGSnEhnN83reqkgHLyJBiJ0am0sStJYHjG+SwDROf+a8noz5UENNh8F4tO2syW2WFWbfaD8eSkjYCMlQ==","signatures":[{"sig":"MEUCIFGNBgw0oOt2/t9GC2zqRyGLusutHnXiEh0UOuDi5wMzAiEAwgr1kUvlXs94sBX9XTUDnJPnDWRtJptrKbi0P46m2B0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":151228,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJikZIQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp7uw//VXIZ3JgJTHBfA3e2IPnS396N+nvfuTW5Y5qLROaNw2rj4hsK\r\nm2txiu4FJ6uLG5MFiVoeT6bOjetbIyD12M6gPWrsNtQPXMJRCnKkCdrPXbDS\r\n+/oZo4f85YaRSb3tGcJ/XSY4a8Cjv62oqHYjDVEvwdKypTvpFCrxVi9x8qJr\r\nMA5v4h2UbjIpODEEzyiImQZrb3chP+jdhzfsFfcN2CfCl5fJexi92MjCeizu\r\npW5AAfE4IyNNNj7C0vGudrPOjH4Gkr0nwR1DGJ3oVo0wC45ZSRcFe+OWPAGj\r\nqQ2q0uICm+qOoU40zlYg+Ha6Fn8kAVPckws/dg1IQ+xDAIvc+O1McS7C1zh3\r\nvhgPFptn25hSeV24qsdpsXeak2QY+E7/hFYc0SFA/c9s64acPXsoPJYAzAx5\r\nk2JgxDDVumK2xoauiUnv4xm8JEOAJNR/oHih7hGV/0YUQjk150lvSvzQFGpl\r\n3HQT3oprna1s0VDi907PWdYYUpOuR4/cOW73rDCCdl/uOa2mJ4PXnw6UOoPg\r\n3J/qoLYQ3U7GUcV5KzLZcxBds0qleavrihli0t9G8T5DYcvSRZHiDDxz3oOH\r\nLvQOQZPn2dhMs8pCW2Z6twTtAMhu2nY+wKKRc49n9IQw0nkup+afCVfnMa2b\r\ni5t68f0coW7bFqOL9+ElOQkR9xhJULvy5VA=\r\n=mVH3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9dd645a965cdfbef543926a26430a354ed3f3476","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-05-28T03:05:10.012Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.0.34","@balena/jellyfish-environment":"^12.0.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.3","typedoc":"^0.22.15","typescript":"^4.6.4","@types/jest":"^27.5.1","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^12.4.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.81-renovate-internal-patch-9dd645a965cdfbef543926a26430a354ed3f3476_1653707280153_0.5664117569515859","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.81":{"name":"@balena/jellyfish-metrics","version":"2.0.81","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.81","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8867611c25f2956c12c637d3c50cadbcff5103e5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.81.tgz","fileCount":16,"integrity":"sha512-XWOAh+ZhRPZhylH4n5jKdrE2VkWPfsfPG8/32bkIN0Ycl9IUuWQsyz1gTwPMMOV9fITMGUHXe/t2vw5nZJ+TrQ==","signatures":[{"sig":"MEUCIDE1OCyJ+hUMnatTHOiSkincGSEXfWAhlvAz74KKyC6oAiEA3eylaUqwvZArEjNWrivKR0Y9Kxzp2Ed6DmuOxgNURMw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":151163,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJikZLKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqTiQ//cyV3H0w8BibbSCJEM9siC/gIHjlXsemf6Xue3Inzq81Xq+m+\r\nbH/CKjo7cTrFcBOYSDVofa8JL5gmPLWGzXQy2WXcQKxAglb9VTVH2RO3tPgR\r\nxrleSHUrd7P0HvpuBLvlMZ+30Ls+yvcK17VrIeOplCfcubbJhFjwlIwkFpQ1\r\nrBIRvKSEwpZd/ybO46d7Me9tdmS/SuvtbOFOYeV5TwWNKTlToxkBL6mJlJ4c\r\nUG4TxTDC/qdGjbj1oxu1h1C43LjDu6j7tfh6RXAEql2gezxwDafQTI1Qczxo\r\ngznXp2nqY0zbo+Qj/E6DdfI7WKcmhpK9KuIqjV8hurm5RDp6qfMjI5Nn8Xby\r\nBUDtELqP3hH0VzoVDoA0UVYyb4ex1o6rYQ++OYZwDJ2HFe0D/8HqN8TxMdqC\r\ntK4nXeqy77LjdgJcTuOm30DsR3IDjSTd/d2/sB7pBC3PjAsMme8wa6hf8oeu\r\nJMOd4pFY02CNr6g1fm5r6PmJjqZk0CMDpsJOZC6HYANWP7dQ8V76Wm27I0lF\r\noHZ60z/Z8GhzkCCpRwJ6WrDg4Dyor88WqxIgsGr3rSaIG0PiUCgkGaGWuIJo\r\n3ojyrM165Fs0MAGnhihCvqKuedsx6oEDc5YRGjkCSk/JiP0MWoCeoAZ+whgQ\r\ncbVrNT2BLl92ku6VPasDtoAKJSCW1bt0yG4=\r\n=R7V4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"81b30e601628ce0eb024b055b163f6ecb397051c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-05-28T03:08:46.029Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.0.34","@balena/jellyfish-environment":"^12.0.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.3","typedoc":"^0.22.15","typescript":"^4.6.4","@types/jest":"^27.5.1","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^12.4.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.81_1653707466605_0.5921656211980957","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.82-renovate-typescript-4-x-5c9f2aa428dde92b23cb0ab1e9b084a450753d63":{"name":"@balena/jellyfish-metrics","version":"2.0.82-renovate-typescript-4-x-5c9f2aa428dde92b23cb0ab1e9b084a450753d63","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.82-renovate-typescript-4-x-5c9f2aa428dde92b23cb0ab1e9b084a450753d63","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"344a22da6e94968d83b8dd7179b013853ef03e41","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.82-renovate-typescript-4-x-5c9f2aa428dde92b23cb0ab1e9b084a450753d63.tgz","fileCount":16,"integrity":"sha512-J9AA0U6D6fzRHruhP0LUvV90bVRzUserVNZZ8DJL/TcUV/VSDu2VPY239Mskg9UCTOIY7ofuH4w9OTo11neRgw==","signatures":[{"sig":"MEYCIQCScQoS/hSLBItyLsH1VPNUx3qU7z5oLN98Bhgz6NfSewIhAIyTCZIQQeiY5JaNGhreSMZqR+TtfH4zRJkJ+4kPlrVM","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":151308,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJikZN+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrXbA/+LNkj6r+UdWPdA+U7urqdBFdVmdu0vd4yfT4j971hriQvptMV\r\n20jQ5efFdLfuH00t4AL9oSFS52Okc3+6TCCn7536J9bvjbFaWJubvnmCnE+R\r\nfbOVjE/stdag8kUuNJFvuWE7l8FG83T+6wYT7Fnw7jpAfkTf46s/HltrxYwZ\r\nbVdEMtEPOEt9kNJvo9k1O0SYr8YJuSkkQXzv2UgjXcaLsCKI+fR2Y/maYrQi\r\nXk5rZegwvupg7WmBpXQL6TpnEzZiR3t8njb1Ua3aKwwg53iFLSfhdn0f1uVc\r\nFLVuQ42kVtvK0y9H1i9RZcXwN2t+JB85KILIHzBzO/m1DGyk1ACjNXe/rctW\r\nQYlcV8GnlV1qXkQql2moawESlz2RQJQig/6sQhwVG4PlR6l14XsvCokVGGmq\r\nF0ZE63o4XaLnrfg3SSCQsvLpqg//WSSZ2vJfalSrBRjR4jxHhlTbLX+yFMBf\r\nutTRksWuIO7mvbxMIX7o736FT1N2gX1+SM8Z0Izv7+hQlPrAJDPte9KTqVQx\r\nhHBfL7GofEyODyjNz+G+T3bWRZJlQ5+w9VXtjEgZKWwK1Lg0o3eIq5ooOh9H\r\nkFOiQzjl/Dy1suOePmBrdjXLTJW91pXCsbbwDXvBU2ivEy4scQotavQy4YUs\r\nvEBV0vo39bflNI3igX/B6ail6WxjnfXA/ag=\r\n=x5uY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5c9f2aa428dde92b23cb0ab1e9b084a450753d63","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-05-28T03:10:44.366Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.0.34","@balena/jellyfish-environment":"^12.0.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.3","typedoc":"^0.22.15","typescript":"^4.7.2","@types/jest":"^27.5.1","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^12.4.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.82-renovate-typescript-4-x-5c9f2aa428dde92b23cb0ab1e9b084a450753d63_1653707646295_0.6592123791069611","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.82-renovate-typedoc-0-x-71b782e62cf8b72fc9bf7181ad6f688d09423175":{"name":"@balena/jellyfish-metrics","version":"2.0.82-renovate-typedoc-0-x-71b782e62cf8b72fc9bf7181ad6f688d09423175","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.82-renovate-typedoc-0-x-71b782e62cf8b72fc9bf7181ad6f688d09423175","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"04593994c47fcef01d05f00002886f0a522ec437","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.82-renovate-typedoc-0-x-71b782e62cf8b72fc9bf7181ad6f688d09423175.tgz","fileCount":16,"integrity":"sha512-j+QlnaVXOGm0oX+KYzgr7q0abY0wYGCNmEGbeI7suxZR/Y0Ejo95dFl+ScM3rZwLeTbTJJKlxY5Sj5MVPgFffA==","signatures":[{"sig":"MEUCIFAvX5TMf33/jeppIjHK8KB2+Np+R2SoyFa/pyiJIiVIAiEA1i4fBSfjp4mvS4WkZFl7OR/Q40e318MOiJjR9qzZI2s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":151306,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJilQgnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqfqRAAm3JAcBB6pshkC4qL3F13eJ34eSHghn/FJubkm0rZxzO5g4b1\r\naAdcp9CL/3qdFibobwnPu3aM3zdJMZheDjx5mOqY6GwMKYUQWwBPI52P9e9l\r\n/tepEslt7WJ6zCuJEh6t/xkc4P+iYwXzO6grBFzn5wbs5/VvFencQSl0+J0V\r\nPu/chAmTXTzg+cRQsPf3n2EoMJzr9w0mMfUujbpQLbNv2uqT9dT4UQAjhvFk\r\nd74lxoZB6+4y5dG42AYf62jLKdK59/aYtqJC6YiHsxAJird8mX6yFjF0567Q\r\nxHiBEItNZk8WbzpjqBN8KI4cbCdAZjXlVGueyuzoZsPTDr7viOoRdN46agHK\r\nd/2LpgYUpVczmoLo930qWIYdqQiEHelI5uc08IChXBDtWlmmXcxcZn/d9n8e\r\nXI75TGAkFPCfSVSHiW2P+DDjTTwyM2GSh8yV3AjTMvxVhsqT2zVrw5hPx77B\r\naHLx4M9jezt8ghtdPhGDHRtDAy6XAwgv1o6LpvLVwRWA6qmLAvauN4TancxW\r\nfgIvYDxcsoZwOEDIXLHpED9+vo+bLfZERLSnLMldUBpMtjAwYsFF16Mj5Cuk\r\nF+yDHDzevGZ8VvdwSnZR33++Rl6yrDQ2gwk2j39peDU8g2nKH8bjnQPYhZsx\r\n796MSpBKtfs9BABuw6MAKmkm/Gg7MrxTKzk=\r\n=ctFA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"71b782e62cf8b72fc9bf7181ad6f688d09423175","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-05-30T18:04:25.609Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.0.34","@balena/jellyfish-environment":"^12.0.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.3","typedoc":"^0.22.16","typescript":"^4.6.4","@types/jest":"^27.5.1","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^12.4.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.82-renovate-typedoc-0-x-71b782e62cf8b72fc9bf7181ad6f688d09423175_1653934119046_0.8073775241652386","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.82":{"name":"@balena/jellyfish-metrics","version":"2.0.82","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.82","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d61ef4785ef43377d2673abfa54941d092bf479a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.82.tgz","fileCount":16,"integrity":"sha512-8vvlSmFl+SqmAv/65NgnpeBvMktSnj6g+/wquI1wTfDpya866KV593fCyTbsUjy3A0atMJEMgJ9D+OPpX82f2A==","signatures":[{"sig":"MEYCIQDsr4bLKP5cuJ6D2laMN8nTW2jTd+Zsg5q6muHEPTwT8gIhAMMtKm1DwdiBgpdglrwoK90U2krcGpD8CJkqkmEq3xbL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":151244,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJilXEXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmonLBAAkhxVV+mSr7bxA8kYQfoLvBAQaAcag6OiJejOoDabAGJVKZ4Z\r\nJ/Z/FcK7DbiQ6ZtrziwUVbrgEiGVEFxpoV/CC7JNawkbG4kgdFLMqxYh+v7H\r\neisLlKStaAfUqQ5DCnpGmxbqcJWnwzYXh3iMg6E4+6Pu5aCYeKDl9Fm3b+v5\r\nECSvLmELsRfBYh0+wh9AzqJ8B1fsAhnE56En/Nf9nLnmJxTP7Bphh/lKZm6K\r\n5phGDxYuiAcQEyJFxj3URUh1gAZwC3+CzAvnliOjoQxlMMKBwChrQe3nmWUx\r\n78StnaZfTSC/j8v/U9pD4Miky5bhd+ZzmcbUKS/HGLQelhde2UvBbQ5mL5vx\r\nYf9miMdPpjbzS79gcaxxTpPsaqaiWv/bSC56cnF+pxgdJyXts5yJnNFiyPvu\r\nidls16zxduqR6Sqk+ZNcmwkpl3gZoM25eG+qv1lBm5g7L6kfAM6w8oT3ABf3\r\nXHKciqWnf6aZ64R9OHsfs7WmI2Q0QK4ZqlW7FEgwh4hM3DS2RvZdRD+8Tp6w\r\nBIy8100Lb9vYptORfVdPh4CAMcQ/GmWc7PUj7AF8RXwdxbmtMLYBVueZQETy\r\n6PNsx5E3B5fgOycBN0RHpIDMmwDexTrSN2NfW3g0nHp+Z2ahdt4MhmlaUzPF\r\n8MwdgbGodD3f8SrrQc39cZgUtTHfmAA5Q0A=\r\n=QI72\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"1ffb1f15a6867248f3378b31d691c9d438de2ab2","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-05-31T01:32:53.936Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.0.34","@balena/jellyfish-environment":"^12.0.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.3","typedoc":"^0.22.16","typescript":"^4.6.4","@types/jest":"^27.5.1","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^12.4.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.82_1653960983175_0.8583036585906152","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.83-renovate-typescript-4-x-10beadd9bf310f7b48d3274a6d988e10e543cdd7":{"name":"@balena/jellyfish-metrics","version":"2.0.83-renovate-typescript-4-x-10beadd9bf310f7b48d3274a6d988e10e543cdd7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.83-renovate-typescript-4-x-10beadd9bf310f7b48d3274a6d988e10e543cdd7","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"037e9c48e754122e5a0b3af2a155a26c454f6888","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.83-renovate-typescript-4-x-10beadd9bf310f7b48d3274a6d988e10e543cdd7.tgz","fileCount":16,"integrity":"sha512-ZXL+vVo9z8EPI4u/BpHxD2pMjiT3LVGnIpbCJ8EycuHnZYxWwjD8VhBHR4iqAUuBlQ2hMlSuOmIPmDq1YrOMPA==","signatures":[{"sig":"MEYCIQCSj+8RTdsnFpRN9ihec58oLs7cAhbvpPhZ59qfULztrQIhAM3xlStN3NyYg53uxk1KcjLCw1wH2Q55FZDMpF6pCafe","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":151389,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJilXK0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoZ0w//YG5yv7cuislaYppaM5JRhxDbUzJODyuXHyIYhEY3QfZA6Eow\r\nEn6kjQAX3rTP38nqcrHP32vQW2dZ3F0pFFZzDo44WPo4opRzz6DKsrLWu2WW\r\n0993omVhu+PGTnDD++vBT7zc7RkgA7S4TTh6g2BsEDUJ/tyNtXWvyQCdFOUw\r\nJp7DRh574TFHoi2giVhEIISKB0pR/LT+N2l8X42lzt2q9Z9W3Oc6hneOd/7h\r\nbjDc0J+mGva9wqOTDHisG/QY+QSFE365K2b3L+3orqw927HFu/Bz3ZiaDoS6\r\n/LtQ/UeXKTfR28ajOIcue0s2QNdEr1MH/BSFjZRuXCfLhl2atB497lqSAh1R\r\njRgbfEnzA1tkXm1K97TuQjPTdFVChZ1sfqz5z1PYD1aTVU3V+3+/TqsOpnpd\r\nRfYgnLePhRwBmfyzBagEOSKx0XyVbR/C4JFO9+UYhw495+5O5pu0puGUJxGd\r\njymNzdFzZ5Auj3xYlz3Ruau4lxBkJVfFiO+mgGmemBeROhprQYbc6I3aH8IV\r\njlcNRtjxp9CE96lUi8ETNPZkRzQjl3yckhsxXRns7/HysKHCGhHZl3sHywWd\r\nUW1p6rX4GBppfVEKESfzhHhMBPq+II19/mJCPCID3YwrFb884iQBaFipXYvD\r\npVsEdB97KbvM7+ZUJk2m1Uh3d4w2gXkR7U8=\r\n=jToV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"10beadd9bf310f7b48d3274a6d988e10e543cdd7","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-05-31T01:35:00.929Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.0.34","@balena/jellyfish-environment":"^12.0.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.3","typedoc":"^0.22.16","typescript":"^4.7.2","@types/jest":"^27.5.1","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^12.4.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.83-renovate-typescript-4-x-10beadd9bf310f7b48d3274a6d988e10e543cdd7_1653961395860_0.6627424506973685","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.83":{"name":"@balena/jellyfish-metrics","version":"2.0.83","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.83","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"36d0975ea82a8d3e5e96a9355f6f6b119ed225f2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.83.tgz","fileCount":16,"integrity":"sha512-Zhphp9S2O2cFxWil1anZ9h1Y+ndltWTQuwklJwOUQdkLj/fhF3+tafbaSUai2ZenXp6n5pIr1ihEyGCl9tRDpQ==","signatures":[{"sig":"MEUCIQCVIsAGXE13JpXMS0OPxp2nDnLCwTz4d/qL5Tccg+58owIgEkJybsw3yUb+jNPyOiD3tHlKOcbUKaf1pkjFoBF9Go8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":151324,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJile3FACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrC2g//UC7SjAg2vPjJ6E+7/6jRJNwoMYS7Q1EGHGNgrhkjcmns494/\r\nT1RCadfb7lssDNDz9nw1PiRJhlNxd1tFh/O5qyLOKs6cbIUqvCWaGt3bf5Wz\r\nNcxrFY5Vavja4PO85Ht5sosbhk9jmdf9BkNMy7Yy50D/9WrJY7LPT745CuCk\r\nRp4soXXyIo5qNn/POpH+p20i0F+IO3cdBkqoNAKoxPbPyODAvzVi6PK0CGqZ\r\nEcw3tBa505z2RmZs5lhWSyKnUZpk5loYdQwsDQXjtCxOciFj50V9FbLpQMpH\r\nCkovle9O6Zoass4p9B4HTIspvUYCKtkJvsab+ylKojD/n2iqTRaiaMEdnABy\r\n85NGMObGiCiu3MPzEMJKTHlFY08auQYwyM5hzOm4Ldl2vlCPONjJpIPO2HQe\r\nTlojNYzAnJ2wDQGDU3FYWkgeqMWj3Luwha3mCjHfVOh6gUyEVC/XDew3iGFr\r\nCW5nl3d/d4Eb1HPQC9rnT6jXcRrFhJxaNNS7T4jCb1b+4lI6CWAZ6Fy2Z4gx\r\nwyH6Ys7weQgFaSP6+3542p5JPkEYLfic3+zWei9SXBKJ9sBSBZHth0fPkHuy\r\nVvC0SiYI43h29JZyHeSPaWE4wsDzloC32FlTi+tS4o15/56BeDnwOppPevbV\r\n/FtP5yTwVIIcdLWq6DbjqZKs++x07jPmZGs=\r\n=eyeR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5af8eab076b3f8f26c6e3a93a79a6b806d53099c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-05-31T10:26:12.685Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.0.34","@balena/jellyfish-environment":"^12.0.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.3","typedoc":"^0.22.16","typescript":"^4.7.2","@types/jest":"^27.5.1","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^12.4.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.83_1653992901115_0.48807876548773965","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.84-renovate-balena-jellyfish-logger-5-x-4906fe5cde76a697289486f57b6105dbeab0cd8d":{"name":"@balena/jellyfish-metrics","version":"2.0.84-renovate-balena-jellyfish-logger-5-x-4906fe5cde76a697289486f57b6105dbeab0cd8d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.84-renovate-balena-jellyfish-logger-5-x-4906fe5cde76a697289486f57b6105dbeab0cd8d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bd7f2ed91f995ce7017221b02c906eb30168320e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.84-renovate-balena-jellyfish-logger-5-x-4906fe5cde76a697289486f57b6105dbeab0cd8d.tgz","fileCount":16,"integrity":"sha512-qK1K8UoAVq6q44Fyu1GuiGTm55/DvSmq1epDjteltYoccljBMxu9G4qrx34ZfEPriAgvdsgpx3y6pjq5GcBQ8A==","signatures":[{"sig":"MEYCIQCymVtzF6/RFwlp8TBZKUIy2F1JGuUXK5JNisJPGokTnAIhAI/hjhGyZStGOuwI5N4ZuQwSuOCOdyYAgN3LQDZPuqMT","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":151496,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJilo2JACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpwNg/9GVVhCLrfha7WcOGce22zDPv3lGLBhy2bC/WR/eCn6ZaKd5w8\r\nP5bkI9jLKtUvJgufUzIFjBrWp93rlZZcdWX9h08BE5qhA7N0C5RWcMZpl/FQ\r\ne/8yaidAlTHATOOWOKOd1EGy3ZDFmoaFOdamxl1cXNIj2JASV9Yrphko5eBp\r\nIiMq7Ldlq01v8UOPt/w/heY1mo4/pPHx4GWOhnokr/z5i8zM9qK3XkizSQNC\r\nxusPNeEkfSejuSyQrnHfC/pT33OJOcLae1CB+751sU0VQ4VqX6B2dYq6P9ez\r\n2ZFWY38sGZJDLjSTe2Hczl2MaUXDzFU3VwYYslEtT9rvKOp/Mzt2lxNzkHJc\r\nHgZpmytWfAXJ4/xeOVvJwHpprPUb4B4rMtBjpSa9RfYbwO30ZHuDHu0vlLk0\r\naYoZ1GuDVdzqNjklyin4Tl6pOXb2Dv58YJhYrsjOaug2aWMHSy9ZUFMZvifh\r\nJk+8P8gL532Sms+IUZnZjvBYAjy6/y9Cm8JnYhxUOarCJp+hngnFjjdP5/xz\r\nrboymAueh6yLl0FXQP9d42BTSl3uz6aLWWLXg76ypCGSJa/UvBthb6L4osTN\r\nphuMMasVDtmSY6W7xn6ZMpNAi7H20N187andTz1YkZdaSpXOIrcXdTTfmQkn\r\nkiY4lo53kbSvX8KaoKV+UoJULbJ/gKLs9Ho=\r\n=0wxP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4906fe5cde76a697289486f57b6105dbeab0cd8d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-05-31T21:47:39.725Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.0","@balena/jellyfish-environment":"^12.0.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.3","typedoc":"^0.22.16","typescript":"^4.7.2","@types/jest":"^27.5.1","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^12.4.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.84-renovate-balena-jellyfish-logger-5-x-4906fe5cde76a697289486f57b6105dbeab0cd8d_1654033800877_0.8994525688723374","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.84-renovate-typedoc-0-x-e80dd5cd76a9a211eda15fc0df7e6a81668690f1":{"name":"@balena/jellyfish-metrics","version":"2.0.84-renovate-typedoc-0-x-e80dd5cd76a9a211eda15fc0df7e6a81668690f1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.84-renovate-typedoc-0-x-e80dd5cd76a9a211eda15fc0df7e6a81668690f1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"dd73a6cdae83c85f0167f682667926e122ad40af","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.84-renovate-typedoc-0-x-e80dd5cd76a9a211eda15fc0df7e6a81668690f1.tgz","fileCount":16,"integrity":"sha512-a1RiAAnahx6SihqgXIPdVJ4vACOlPupXl5OGKi0qgSOrjsZRQGUavylAgqJHaf2UZROV70ziVSgWYp02PKLAQA==","signatures":[{"sig":"MEUCIQDKaXNtm5EJvO2plTJLFml5bXyIoPQ2bsLkMPqLJ3OkQAIgJBBZw8XiZ9yLPbQeSW0/E065DycW5FRcuBwiEqLSV7k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":151536,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJilvmJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoHdRAAkGsPPapYqIWOXNZ4nkmZkxMdB35Ld667gPjH52dxcfzSZYgJ\r\n9Qeyg0doy77axZk9FbAF4rfqE9KhWyEJLWfZIfoL+z8TYslpku5/oprbWOQB\r\nVArm0EgJDGnUKFLn8v6YPGqs6K0vKrstgV93goclw3hWosvLx/SvdWltO3JR\r\nCeOGZ4owrJmNORoWPmYC2keczef4hT+1Qkx84pNtrlsGYFtIEdzQFvIvMj3y\r\nhXPY8clyMO5ABCIdmsKcu/RSDrSOj6taZ+PJ+IQgpoHjUkyzo1FRGmmpD0KR\r\nSf2GspQc8UkunlhUC46PxIStqVftbz64s4iFjEhmEf+By0jhH8DEuqLuYNi1\r\nu3T1VdOVOKMIHXplHRHX2WzVsNFAiLOsnI5p73QZ8nBi8iSSPCqNSTiZX9kf\r\nQUam9JSvj7P+oWWmkxfIIC2eIUaTJpLqSJvrmxTsSuuCrDAcT/4jNSnTPo5r\r\nKlA1n4z8ZruySsRJaWbi7DxDC6BtxL/ehd7qfgrchYNl1v7GwflNw9qYrEUG\r\nK+59QTLjBl0Bx8aO7daEbpVfC3WZ4brwan0zAOm+EPn7MfVlT9MY4IgJDgRD\r\nkBDewYegNPVgXNXG+//8QB/HhvlXm+oM2gT9mqvYpoVhGc48tSCWYu8o3sBN\r\nIfC+xdJdcxLTGmdhdTLCSkd3/Lh4kV2aBqM=\r\n=ynyu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e80dd5cd76a9a211eda15fc0df7e6a81668690f1","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-06-01T05:26:42.600Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.0","@balena/jellyfish-environment":"^12.0.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.3","typedoc":"^0.22.17","typescript":"^4.7.2","@types/jest":"^27.5.1","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^12.4.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.84-renovate-typedoc-0-x-e80dd5cd76a9a211eda15fc0df7e6a81668690f1_1654061449217_0.016713560603189404","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.84-renovate-typescript-4-x-3ab8ba0cb4eeffe5363b79f70c503d687be09da3":{"name":"@balena/jellyfish-metrics","version":"2.0.84-renovate-typescript-4-x-3ab8ba0cb4eeffe5363b79f70c503d687be09da3","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.84-renovate-typescript-4-x-3ab8ba0cb4eeffe5363b79f70c503d687be09da3","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"91e27fa28f714ee141a45616309144636b866ed0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.84-renovate-typescript-4-x-3ab8ba0cb4eeffe5363b79f70c503d687be09da3.tgz","fileCount":16,"integrity":"sha512-iiNY1VgqH97CVMMWOpD8bb546eI8Uqgdjo9UIy5hMWEaa+J/eQJRs+KlNnA3th5PYtpz55Xes698BN9xsmYxpA==","signatures":[{"sig":"MEUCIQDarVSS7bVIdWhbOvBWtMP2DNQmfsFUKGlp4Ggeyai5gwIgFdn//YlD8cN4MbM2ydJ+srsk+qRQTu5+L01mrOqMOCw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":151594,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJimmf3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrwUA/+PrM+t54MB0i0EOJGyj8UVibwVpsxsjhW164IQGP7mop0/uI6\r\ndQaqmZSh9WvNfyH9+CdFnTXeMFbAjLnSuBv6K1CecXzB/HFEi41mM0A3m2xe\r\npxjHJml7y3NpI3OP1HxUVlfOJpd+F9JaQ0xqu4WvDdupWuaDighxrpT62xjZ\r\ng8cyd/3EucEyN/9kKTYoTz72Et3jsDBmlWtsL/PBcLb6DKKcwnMF0vrRaRiF\r\n2C88LghfbExDpre26EwZPSLWwCK+WbsZHnXQHTQsNCz2i6QDmDeKlY4M9nF6\r\nqSsVmt/p2CRGwChkNlALRyPgPD6o6PXHquSpKny0dG9QGxbKVKw24HGwLNF/\r\nkC5KmOxEHI02XSytOmjByVLy7BbmsxYcHKcJXVnhlNkpG2MGzDaXdDzb4Z69\r\n6EXY7pMbHl9OlU8Em9eDpkkPkxMigNCe8a1PkEzETm4crAJ5QBlqUdIYMM3K\r\n15rCu2cVsTYeppEMMf9zcE2PgniuYyC06TjK9cdyTf8cDeH43e//nrHb/TWn\r\ninQrjIJHPKK8apoiWdrSfHygEzIAx82zco5pMXXQQdwE4ko0TBj1U2UyTYM4\r\nmjkpbrqdw4dfNUhW71+VO1mM4AuuR34aMez3CNlktAIlfvAg7jHszjF+PzwK\r\nf/N9PW/4b6G9tzMnWa21qr/Hy1sleERK0qo=\r\n=UNO+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3ab8ba0cb4eeffe5363b79f70c503d687be09da3","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-06-03T19:56:00.895Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.0","@balena/jellyfish-environment":"^12.0.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.3","typedoc":"^0.22.17","typescript":"^4.7.3","@types/jest":"^27.5.1","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^12.4.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.84-renovate-typescript-4-x-3ab8ba0cb4eeffe5363b79f70c503d687be09da3_1654286326802_0.20479532503867426","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.84":{"name":"@balena/jellyfish-metrics","version":"2.0.84","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.84","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"87b567aa526fdb46a395cdeefb00ab3cbb9fee23","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.84.tgz","fileCount":16,"integrity":"sha512-5JodJl8n67uN2wHYJeP9HHBUOXgB1Jo4Uq7lX5yB38v1oozF5Av1yXhdfKpUtvZFXG4cAUwdQAxu0eA4mbfTbQ==","signatures":[{"sig":"MEYCIQC9M5XZpzytUtZ9MEmLZEjoeAZqQQ8pNIZ1frS24XTtUQIhAPgrOI7ObuWYBKBq2vcxI4DzK339THiSYsaUJ+h7BboG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":151529,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJinAtRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo/IQ/8DCq0YQeUDFH2y5hKcSDPgs6x4dGhEap3/aiJpRzr47ePYh7U\r\nLrxhIta6tKzuU6MahQNXjpHbFnKUtifEZoMr2Lu/TIXrjPQHuzRpX+Zw1g73\r\n92r69b4e/4H1F+6dF1WqumPKMKEaqa4KSNAuvIaAuXOYN4WfulPFLtONYR4w\r\ns1+r3lLlhahxHb8TdE04AOQOMPvsZhCpGZtqO5/NXrhl41UKWNg4Ikj+bLAz\r\ne2kgelJ/J1Ff3ieCOnqoODdgCHS60nkSUGKTkuTXXVXk3xiAgVQSQaJj7NXE\r\njTUz8jil1SmN7zK0KTbsSkWvk8QK2/mFz2jzDT54iJoSve8Ij2oAMmAN6KXL\r\nj46fLYCqw4EYetZJBhlqM5wcy7U9VyYom5B+X+0U4GeOS4wCbYW5iNgcfdKD\r\neL7H3hhSrR1bH0+faOWXuHyytTRAuisCEOkV/I1MMQJcombS2CgthRHidXu9\r\nxOH6PbXcIH3zpIshnrowDOK4u+pWzu0vfWHKjslT67Bv5ulaJh03sfm9OhWM\r\n8NQ6EaJ8M0eHyE/FSMeCz2A3bJkJ83JPWgf3x89rhaEyPPr8HGVZshBnWnJJ\r\n8FoooElriQ5He7TqaScMa8ZvzpXal3ZuVVhkB++ub0/lv2IgGg4l2JuDiNym\r\noYH/8liEbSqwOZr7b9/nkGebpKvDgnUNFpw=\r\n=g1TM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0e0a5136cf5b720342b530d6c2288bcdebd64a16","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-06-05T01:45:26.754Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.0","@balena/jellyfish-environment":"^12.0.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.3","typedoc":"^0.22.17","typescript":"^4.7.3","@types/jest":"^27.5.1","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^12.4.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.84_1654393681013_0.5397037573907633","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.85-renovate-major-external-major-439646279c6c077ba110a9d955f4ff6af45e0cb8":{"name":"@balena/jellyfish-metrics","version":"2.0.85-renovate-major-external-major-439646279c6c077ba110a9d955f4ff6af45e0cb8","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.85-renovate-major-external-major-439646279c6c077ba110a9d955f4ff6af45e0cb8","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"28eb589d2f898037f5c47f3a1d5978b2d73b1712","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.85-renovate-major-external-major-439646279c6c077ba110a9d955f4ff6af45e0cb8.tgz","fileCount":16,"integrity":"sha512-eKTnhZTUmzt+h14S4McPRBlVtryEPzT5pr5EODzZxb9s/GSpLKhlnu9nB92TVJUYHM1KEorPAE1uAgxQ1T1a1w==","signatures":[{"sig":"MEYCIQCwdetnksik1ruMl4DbsrYsZOHx7CpAZHH9RWTs5awg0wIhALpPxPi/inXvP7WZAg8GMbfHjA2nG2/D2lp5xHZe9Q/6","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":151687,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJinYazACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmox0g/9FJL16STiv4d5CDP1FAZHFny496Q7IR93Zq72hxnVI5G6Iad1\r\nqt5eM+SfhES3olo+4dOVDpY4W3Cw8PZxQYJTqqCktyHsjE0HxPNPpHiueq6A\r\npCkp4QCf1BDI9kO1YyCj8w4sKejzNhQoAUPZRLWfSSlN6BTVHaIyQ5Xvh3XD\r\ns0LW55UC/RmMF/rXWLBIgdQfNTuxoPx25fc7Ml0KlljKqYw06Hn5j3esJGEo\r\ng9w5jsWkDCjVfuajCpdLWqklO5eVJiT2nJHZCWmveC/SIUa/sZrczWncO4hp\r\nbuza8ompdsnBXyssLVK9g0Pm6WeDzZ6qooqnitqDV0SDf3gVIXAP2kCc3CzR\r\nS4RqJlt0os6QB1l3fwQe1eTMTT3NMIsZSSzofwAr1BdDRTyuv6LwQWElpC5V\r\nd/MIkQtx38ekGdKWYjIHxWOi5gRNPN+6YrEvaOHr9UHeIr+ixkSB+bfUQcKQ\r\nVyjPtO87gAR8MJgXTLewMzk2AfmhFOE6odjB+wyp894zSuQl0qhujdKgGUna\r\n4aCXSabPf/CEtjsC7lRChczfTsEl2jKGCpLCRsIooZ2/Dh2IhAqkt2v83Aku\r\nS0tk2ByoPXAxHO4k1bnSUuyNinhRuLVTRN93K4ACqYqvS16CmoG4tQFNh4aO\r\nH5vgVVMsfdoCJY0ohDl1gI4GxZ9Bgh+VHtk=\r\n=m2Fv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"439646279c6c077ba110a9d955f4ff6af45e0cb8","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-06-06T04:44:03.509Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.0","@balena/jellyfish-environment":"^12.0.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.3","typedoc":"^0.22.17","typescript":"^4.7.3","@types/jest":"^28.1.1","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.0","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.85-renovate-major-external-major-439646279c6c077ba110a9d955f4ff6af45e0cb8_1654490803335_0.6778735706034116","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.85":{"name":"@balena/jellyfish-metrics","version":"2.0.85","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.85","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"92b45d3187c6d96e8f2f5410064a89c09874f70f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.85.tgz","fileCount":16,"integrity":"sha512-bKRsuLhE3gi9qwEXam0dW6Fy4Dk6LPytOH33St6I1YtgI8J2KeWenlIfMjJHazunHqJUEcEjSncjo+N/r4u8ZA==","signatures":[{"sig":"MEUCIA+bXujNhUCun18eG9QgDOwpZkuhwEvcRJdbXYsKixJVAiEA3cSI2JyH62ekRLS6e/fBgRlY+iwOTXl8aw8//vspmeQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":151616,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJinYd8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoVkg//XcxTWZ7mwYg4Y52XwzXShqKmZqDSvbya+6tKhNFJrjtNM8w/\r\nkWyNUEwe/8CGSuH4TRFffIFB/wXoF4mJRzoC3li5uwiAL3okEpmbPSAQwgSI\r\nZ4vdJqd86f2C1+Y9os1CKAlokV2pPCYiFERccC2a90FuKTxNbBmrJvUZIf0B\r\nKLrB3K98Rwm3pL3o5/gvwZuPjhE8RliIJbasz7Fb8vwa1gRUnsjcv16mcYtD\r\nVQBPocTuoipmWt1qodpZC+aGuNCkiG6lYqvb9BYOi8w/YUpVOboiS5HGI+bl\r\nTvwlirosMdIf4GfekBTZ6dmBRKtTaq5g8dPVqx8erGau4snasKR04fXRH0zI\r\nS2aYpug+JhVU4+I4q444wk4gAgNg4I+kbnuONnACjBHvOlRzn7lBgDwLyHIa\r\nBOVj8jYoZfC8OiVzSY9BkP7P7DEL6cXuKmMZosQ8OBBMf2K3wU5xREZwbuyo\r\nSczPVa6ufOw1z8YLualtqSUCYAm0n309eQ1TzgPRx3gz1pCTldVXmt6/YgGU\r\n3gayQ+IMuyltuXUuB8qU5Ujny9T3+Q7oLXzNp2IaLpWG8LCy/9ax9f06I9Ku\r\n5/lLsrCDdgCYAXNocnYB7A7oBZ4nU87lBl6nuUcQRdAAXWdOBKTkvVZhHwkV\r\nZslXR/9cVZNO4mHwdHNBGdU3y0joXBaGl/U=\r\n=x4yd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c70fff88a5b3a1c838dd3817f1960552818b5e02","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-06-06T04:47:51.579Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.0","@balena/jellyfish-environment":"^12.0.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.3","typedoc":"^0.22.17","typescript":"^4.7.3","@types/jest":"^28.1.1","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.0","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.85_1654491003956_0.035549151449927985","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.86-joshbwlng-add-unknown-logs-4c76a3ad78980e25d563f3acfb2bac1e6f0d859f":{"name":"@balena/jellyfish-metrics","version":"2.0.86-joshbwlng-add-unknown-logs-4c76a3ad78980e25d563f3acfb2bac1e6f0d859f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.86-joshbwlng-add-unknown-logs-4c76a3ad78980e25d563f3acfb2bac1e6f0d859f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f0f00492d7c7cde3274ba0d52b2722382ab30d25","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.86-joshbwlng-add-unknown-logs-4c76a3ad78980e25d563f3acfb2bac1e6f0d859f.tgz","fileCount":16,"integrity":"sha512-iQea7ouQdEzqzR9aWVoCFAslFz7nUwdpIT5Q9IVwv9Cz/oMDMHNhnCgcJ6gMWBXGRmPR33xqeHYYz25Yt4vIHw==","signatures":[{"sig":"MEUCIQCoCGZzBrultRSZqU9FDTSrQzTWITHql+z7tIzbj+dWewIgeIR+rbYu//AMtohQBHLK6/FmhmYm/pymrgg7vq48tJU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":152480,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiobrVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrkrBAAnKhOy/Y8WgqQBMo6hXKJbHbnejWAmOdc3amh8b8w0T19sifM\r\nwNt/s0gTvTwY20KkzrWBjbNEjY5gcAxr9+T1Zj8rkD8io+8IYV589ccqR4Au\r\niY/jFoRHG96Y9hlIW4e4jFacYnPS1ofBvL3X9U/3fvmsuhXPwJfoUk1b55gw\r\nqKb2fLdnpfrHe52k6E8248ZYiVDgk1/gzfs8ikb3xGy+nO5GQBsMQ8tO5dpf\r\nvCOO3Y2w/0l/AqrxHF+jX7As7f+DZjyG8sf+/aHYBmBAYmtuUa5URsg3zWcQ\r\nxukInGv7bp/mzf1KDWDEkU74Nvpfrlv0wFfiHdcR0bUThZN3lPKnHyQKRgXV\r\nuPncGpeCirqytxBR7COd3jEUcwGcDkyxU3wFqhfOrV6hFjdKoObqP7AAzSJ3\r\nUFsWO4EaQFxbrMShqI2VVPxq9l4AOEspFALetJ0TdnyU1eKFFnwYSd1qL6tU\r\nxV3mW08aTh1LZeoevFfwbXH8dIwhQx0oeqDsEnFYOATrB7E4j4KaXyCI8bpi\r\nES1yy/qKLB2xNZ3A601SOL8qhv5JvjMmengE5vhP0uK8GWD8+KtGh009SUw9\r\nUEtf2AI6bo4BcboXXQsRDM89OaOB/R2OKYUJVZb9txReAP0WF96pyXHPLZ4Q\r\nYkCTttLYtWk0+LozIwIiLTI1UsFroG/5p8E=\r\n=vw8T\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4c76a3ad78980e25d563f3acfb2bac1e6f0d859f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-06-09T09:15:06.806Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.0","@balena/jellyfish-environment":"^12.0.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.3","typedoc":"^0.22.17","typescript":"^4.7.3","@types/jest":"^28.1.1","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.0","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.86-joshbwlng-add-unknown-logs-4c76a3ad78980e25d563f3acfb2bac1e6f0d859f_1654766293507_0.1864975396793358","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.86":{"name":"@balena/jellyfish-metrics","version":"2.0.86","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.86","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"736ecbdadb8a8397a78161888de61dbcbe57cb27","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.86.tgz","fileCount":16,"integrity":"sha512-d7HYrOrk3zfBTyriPqHMsXYXq//f/UBG6ybc4DtBH/f2OVM3lVucx6FKgYXhU+GR4gnznqFdsdH/sS409bEVvw==","signatures":[{"sig":"MEUCIFwzYxFMntFduROQdERe7TAH5ntRkQVGpBZ2WZP5BmTdAiEAiqbjCRIJy8rkMBrtJibtaaCXkEvQ0a6SN5TVwAGkI4E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":152412,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiob1IACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoSYBAApEnQQjWMbZ1OQwv5w3Rk2fqiXQYnsMmIRNDTg+Dj8O84fhTS\r\nJyOFS89xDBdkHSupKaeOi4j57+ZzIbw+LzvtsvzpxqzlPZ7uzB72f1hVyRa3\r\nFZrNyCWhjhws0xrn3hKLIYp2tAnh+6+gcxQhVEOua7/vr/0ZBDKP9pC/+DqP\r\n7+jx+8W4vRZS8MUNWo/VWwVhIvs46z6NbVqHXZljzo7f1vfwFrdTlcEuIB8c\r\nI4DXhggPZcQIqk9n3AI/pId9LxiNwxObFPHeT/8lC286RT+xLRqODeikx4hQ\r\n7oOsHTlAkVbvTMdMeGDJ1zDJOb23LYZarNeRNgNNvWo6uuGZ3lYEdmhY351Z\r\nE8Dkehe8L85l5uKy51b58j7cdA1gv+nJm/QJQuLgdUG6QEP/Vb1KesQqsaUO\r\nzyQbONS2JWqB2er6CHRaGZ0ooNenbKytybQQJxs08JNKHUNoZ04/7muRJYGA\r\ntpF4W5HofZlMpaPpk2GW8+nKrsuc6unsCmxGdDQPPDdTnBECAJf4W+pTuccT\r\nfJMiyy+q1kkudgVQrTJdhGQQEFVCsyYeaapAuiUK0QyO+Ss4nBJlve40ALEj\r\n1q/VyhpAxTzkyd+7+i9l7iGdQYW23w4Ov9THuiZedwPJPk8my3GKmzrzVg3O\r\ni7LIgPxZG25I+uKw1zRKCTMo2VtM16tsWn8=\r\n=URyG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c7d63e1cde86072da22c08f3a1d82925e8f039f2","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-06-09T09:26:26.690Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.0","@balena/jellyfish-environment":"^12.0.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.3","typedoc":"^0.22.17","typescript":"^4.7.3","@types/jest":"^28.1.1","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.0","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.86_1654766920301_0.7657873940154698","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.87-joshbwlng-drop-debug-logs-06ab6dfc91e24bb167ea6eddff99c1d052b78150":{"name":"@balena/jellyfish-metrics","version":"2.0.87-joshbwlng-drop-debug-logs-06ab6dfc91e24bb167ea6eddff99c1d052b78150","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.87-joshbwlng-drop-debug-logs-06ab6dfc91e24bb167ea6eddff99c1d052b78150","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1e16772b8d1ce1f7de9383c1ce9276e165107747","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.87-joshbwlng-drop-debug-logs-06ab6dfc91e24bb167ea6eddff99c1d052b78150.tgz","fileCount":16,"integrity":"sha512-OAX8ZcNcrU8SF9+yK5L2I8SXDQkQLTv8v26XGJ/uaTuXo7AtfwI5LJqEn7nSsp72qUGRUKonb4B1FFZDcTL2sQ==","signatures":[{"sig":"MEQCIEHf3glVKo+BgiytmMNf0Bx06hB0F+6C7uXpVQ8ICTnxAiB08Z9tHeTMvlJ+nu09mq9k/d8geLXZDT7SqsbTDe/oXg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":151813,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJios4UACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrCVA//SomrG4TapU/wFDfOZmd4XdKcHWZcOPF2gpfJxsWjZ/f4IBsJ\r\n5dEo+4p39D/AEz9looo6LumkLC2Xd639FBHuSzbrt1TMmabqjkJ6liWsBMNR\r\nTWv9TkREv1cm+vi5SaFFywKcNKbhemrJBOF2nVAHJ00XDpMk6jZP/SudHLZ1\r\n2U0dAjkTg+ATcUw3bsHTCj9NESHEv4J71kOZchReMLxoFCTvx+kgVlYv9QZX\r\nrYci5dj3YWaglSxx6HnftpZMqUEukxUd2Wp5U8dQRgEPFx/W3fx0H//veM6p\r\nvkyfALhHF+pJdfIRdVKrKxCNkVPLUs96WhYVRMRnxMFGvxMom7uVmKasFZmd\r\ntmCazEe7fevVUNfuf0cqKqSrDTj+lN98SmOWvX5zkm7HJR9Pp220TTDe97KU\r\nXz8EdDVP5J3wmsvHRf6SpLRTTzyL4qC90OlSu7VVwrqXyVaJG7sLc06t/4wU\r\nTgLNzmdsCoh9fU1MDak6guXICdQQd+/W4i6po20s9QMzQLvNG7D4WEmdIQI0\r\nleIYTGhW2BxM1INM+FxyedtIB9ocotC5/kyLNzY4c7LEpXETiTHsZN1NGf9F\r\nE0FBYYZZIytA5t3IidUrVe0LEVR8coYDcqj+2B+wEeeAU1om5MSmlCe4T0p9\r\nb7EEBNKGXcMObZyJzGzjuEGLJ7ynVNJu/y8=\r\n=6vqK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"06ab6dfc91e24bb167ea6eddff99c1d052b78150","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-06-10T04:49:45.736Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.0","@balena/jellyfish-environment":"^12.0.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.3","typedoc":"^0.22.17","typescript":"^4.7.3","@types/jest":"^28.1.1","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.0","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.87-joshbwlng-drop-debug-logs-06ab6dfc91e24bb167ea6eddff99c1d052b78150_1654836756293_0.9397154885467187","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.87":{"name":"@balena/jellyfish-metrics","version":"2.0.87","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.87","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"60ecf003ba8433eea6b0892ef88f07c08d2a0f25","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.87.tgz","fileCount":16,"integrity":"sha512-Ymyvn2CLzw8W2ftyTebr0xVEIVTtX9l7I731sWVDHgPRunWKBNrcUh2z9h1LkczN95EhKou7poz0xkbuDVaTDw==","signatures":[{"sig":"MEUCIQDki4QnwOOGVZMQf9PkfXMNR5aAJWeLuJGPwl+e0k2vgwIgOVZBXwFXBpApLIsuoiKQQsIPYOoNZi7m0jSlwNWFF8U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":151746,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJios8ZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr1Kg/9EHP3PV1KsHDhoKde+6/VeX2XXEqQb6/QNSwP1tQ8JV0UqjAt\r\nqfflozBU3hMzfRqj9T87m7C7nTJJ36/K2yu7nXqelox+R8iVqGlkWUxeVfdl\r\ndsL4aFni8JPQ45+rYfvD0H3/ScTTqBpXSSllennUyp7C+NMOJ7qjcRPxY653\r\nbPpYBjA42RWM7zC3aVLgYK8ZDiJiz4BWat2uWqQOwyyZLHqJzXofI5Bp5CSF\r\nvznnMWSm1I2Zw77pUxbyS39ebpkovFA9Fq4thiE3uiUgSox202RhDOpn1rYF\r\nUAa8C7C17QHknShntnejlqkivdU6uZ+YMngNZ3L6GtWRIe1eN5CYmdFS6yD9\r\ntFDW9767h2Yt4xSw+WSIP2UFCuoZDE19L/gUBfpyp1Ni8WuB9jtZ1iuz2VgO\r\nfD+ruvE1454JR9yNopbTYWXi940w9dcnxB5g/v9JFuFv0ryQMiLxizf/w7mq\r\nz6Oo5ckuJdMDfK7enRY07XZx30d8y8rYhI9+ruhR0+S/3z1zNf/RyN69B07u\r\nrAV0cvFQdNjjRBKEU0WCvnsF9qAGGwXKFVGD9TXokgeWeBT2/Rfwz1lhdt74\r\nPB64imZbcRqep9QWCxgmXGSx31KJYfimaJPiHnh9L6oswmxwvwksf+v7QILa\r\ndnVJa+tVqqIYQAPLJwEi3r7v69NiE7BL3PA=\r\n=SZ1F\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c7bec3094cdda424d8d3c789876d2147107a0278","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-06-10T04:54:31.767Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.0","@balena/jellyfish-environment":"^12.0.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.3","typedoc":"^0.22.17","typescript":"^4.7.3","@types/jest":"^28.1.1","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.0","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.87_1654837017612_0.39255322233952694","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.88-renovate-typescript-4-x-5aca333de0d7b106526aee50e5b13e36a1c87b9d":{"name":"@balena/jellyfish-metrics","version":"2.0.88-renovate-typescript-4-x-5aca333de0d7b106526aee50e5b13e36a1c87b9d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.88-renovate-typescript-4-x-5aca333de0d7b106526aee50e5b13e36a1c87b9d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0d0df718d696781d4f642a6b778161ba6cab9914","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.88-renovate-typescript-4-x-5aca333de0d7b106526aee50e5b13e36a1c87b9d.tgz","fileCount":16,"integrity":"sha512-cc+ac9mBsFFfJQS/MgRVzujD/tg+XAh0itP2M9L/jQVg4V47T+txifc0UfV30WFxWBDAaOrXG3exlv2oS+AIeA==","signatures":[{"sig":"MEQCICRf1ODc6awrvFvgEyBHSdxKfmsnGwU/mVg6zJi+ohs8AiAv5PldWZCOaqI8ygowSOntsaCmf4076OM7VC1q1YhXmA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":151892,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJirOSrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpb1xAAlmIVah4AUOCEzza1jj0voOLgS0GBTp74etw2FHC4MbHJ0UXb\r\nld3gdCy7jp+Rdcv7iIaeAhXBiAmyzi/U6hdXb0rDSjDd1EIPxoi1KIH9ZqGl\r\nySxGcyuPmHNSXR1Epy9Bs3Xx2b12q9UjJtz+n4umLafcAbVvb/cjJW+Y8C3U\r\ncIR7gVDMeSZmzz21yZEoQRJRbS4owKrVEWUghZOWtnjl2CePiL71VIqoXBTf\r\nxVl4Blq7CyEXiECsv/vCXoR3l8qnXOHlQaGeYth79F2njCmzJDGpip4M+xTS\r\nVtB6UpbjGgWbGggPuJtZMgeo8wuTCeH2X0vL/iBB2Q3jlWTtAn/anFoFpPoM\r\nJr1C7p2VYCPwGq6YwM8bfbbdBrEeLr4H8PdbflwyUuXEJJcrDxEbxxa8lSte\r\nj2wTtG8y2z63cTYGMzPjlOiHhsiulW1+TfiIpttnwIoqdFlNaBbQCxTZ3oJP\r\neCm2vE806prTQDMk9ZFlgQ+DGo07sXMxTP04cp2X/FzOo7eKzFJIUJR2Yk/f\r\nck53FuXReVwqPd54eeu3Bxmo4INb4n0uHfRAN3A5lvhJPtxnL7MrvCewj7KG\r\nTB4LnvLVbWp0o2UC261LRwAGk+PojSRMIeWIfOEnHZ5kJAcjbxU7aJhc7Z9m\r\nEA1Hd2qJL+hNdBRmMdakvVza2cb9ZpA3KP4=\r\n=8nVS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5aca333de0d7b106526aee50e5b13e36a1c87b9d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-06-17T20:29:09.217Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.0","@balena/jellyfish-environment":"^12.0.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.3","typedoc":"^0.22.17","typescript":"^4.7.4","@types/jest":"^28.1.1","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.0","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.88-renovate-typescript-4-x-5aca333de0d7b106526aee50e5b13e36a1c87b9d_1655497899498_0.10086845083321916","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.88":{"name":"@balena/jellyfish-metrics","version":"2.0.88","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.88","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3d1182eed101d7d8fde5de00a7b9fcb524f2bb0b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.88.tgz","fileCount":16,"integrity":"sha512-Hikspo+Rc99XZ6C1lGuYczoVkhwwrq8tWj4CelWGz+MDoPdc/LCkYDC1Q6LCJ4t9VYCtqraaChZkKLF1x/OsMA==","signatures":[{"sig":"MEUCIQCRK1P1/URoAqJHuR0kVVpI6XAb2l80OE3ChdRKrJAm4gIgYkqQ9W6dT7SWovowXvWtj1Ol+yvmJybKovIFhVt40ho=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":151827,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJirRUDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqGzA//QXCnexrJ4ZttEgOkkmo3yWp8u4rOU3sH1D3SbQ9hAuYZAIrg\r\nw9ttDPnljNoMbBXc9niid3gCA1xlEM0HyxD9xbNVoEmijQ+I+WV95g9Nr4gr\r\nIGk9cnU+ItzPhuRKqBs4BO61+lwjl6V+lSQrJ9lzsrGYipiTHGGbtkOGNgCI\r\nnXooY1k8004iWwDNxz917tK0bpk0TdP/LjOqs+Wr2qMr56Tcd9iC3soeHDgz\r\n6IPDdlRZxRgu9Wy15cdCQXf14aSMBz4OtENZkMe1l3l6VIL7FrniNepOGRvr\r\nIfHQU7D65XsZZ62t5gJu38QeBjRHYPFqg9X4lFKi7kn6EfUguPokgvSTRk9c\r\ny32BOaS0FOoCFviTyEbwlOAtA+OWBkVQGDUYwQbgOVyX9iBBFvafoF+Gqfsr\r\n9phpBmXln1IzmiZdfYQAEjLSnO3gL12y3z54NDNpTd8e3dItnLVaMuk54GyF\r\nOCJHjIcZgJnzLw6RlsYfoiIQO9B8jaxcoCwBLgmfLNzFWf1qdB3NU4jEiC6Y\r\nraZR9J8x5TNKUDAKHs/ILZWnrqSNlqlmbw9VBv2UPBEGGb8lCW+Uljdc94Gm\r\nyGCxq4XmvJVhq/Z6MXHPTQ73BZSNWAyVgrrQvUNEiOzeVopqIwJ3dUhbYFBu\r\ncDPtd4oElAR16t0sPtodvSLssc2DZUCf1UU=\r\n=xIxt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"326beaee423a8ccb05d03bc6d48b56b4d9646e0f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-06-17T23:55:51.616Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.0","@balena/jellyfish-environment":"^12.0.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.3","typedoc":"^0.22.17","typescript":"^4.7.4","@types/jest":"^28.1.1","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.0","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0","@balena/jellyfish-config":"^2.0.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.88_1655510275416_0.7553775145481045","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.89-joshbwlng-drop-jellyfish-config-39f278de88aa39847e28834f18a263d8042b671f":{"name":"@balena/jellyfish-metrics","version":"2.0.89-joshbwlng-drop-jellyfish-config-39f278de88aa39847e28834f18a263d8042b671f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.89-joshbwlng-drop-jellyfish-config-39f278de88aa39847e28834f18a263d8042b671f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6ea8917655ae6acac253041a8756e2dd44ece937","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.89-joshbwlng-drop-jellyfish-config-39f278de88aa39847e28834f18a263d8042b671f.tgz","fileCount":16,"integrity":"sha512-4b4rauZwgWAnKCQmprbLFxTIZQVgnofgIfPOm019MpaddmSBo8/CyJBhm/hfbGK7BLkV8FwPLCYifYGuniUeQQ==","signatures":[{"sig":"MEUCIQCgMDEUFIc6PcJ1JsOQEeeqDaIiwkNvYu01wljJuxUC6AIgS84jHaW8rCxrxf6cPTbyW1UJ9jv6NhvAzn/X1lWqOYQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":151930,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiruatACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr9hw//TFACZMG/PtKTBV8MpnzgJ0C8nBmdiCi1xvySGGM/vjefLNl8\r\ndGwfj7J/Tge01yfHn12OO+33YepXmkIo4dxnQalSk0RZhPwqTmOqS6Ns78mk\r\noN+/3LahZtW/6YyaY0N6eH/6jPNJLHi3/qXk7XgAITU2eK921zBv5JBKCOrd\r\nNW9cZuw/RtkPJFlglCMIWie+IEQQVhJOFTMDwvHDN53J92YMD2TS2RFsVmYY\r\nkJR1ls4IcAnIaHw3QW/kD3nRBsPYjUDJMqkMg+9g/yBgtcryyBFabEdpZE58\r\njg9YqdIiMGzapSxWyXe83tX0/yFhBwy3Orif1W3ZQgDNU+KSVZ+AlkKzrwbk\r\nzbVjyEymDTGftw+LBTxg6/PyTvHaNtUWASfex1Vh9Hh8sMXAhwpIbljKG43C\r\ntKc9X5YS0N55D/cqKdXkkTjKSkBgxHTB/IT6UABpUPbIbwn4UoTU6+5IgXjO\r\nsuyhHJaizyJq2tw/LR9kczABW3d/4HuuD0MaYQcI5ZS4GO9bpn2Rv7rRXkom\r\n0/J6uEzendsymkHihRsP/30JuPhuXDe1+HiG0nzICFjhI1OPqbDiAbfF+TlI\r\n5WCR3d9UcS+iOFtrPX1es0ZSMXr+TeYgeG1xv6/9djQxRvvE9tTtQz2vnLdQ\r\nqw2sxqyo0ZbvX6sY+6TWkwn2kq81Fen8rEU=\r\n=rehr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"39f278de88aa39847e28834f18a263d8042b671f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-06-19T09:02:11.868Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.0","@balena/jellyfish-environment":"^12.0.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.3","typedoc":"^0.22.17","typescript":"^4.7.4","@types/jest":"^28.1.1","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.0","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.89-joshbwlng-drop-jellyfish-config-39f278de88aa39847e28834f18a263d8042b671f_1655629485195_0.05743796401212964","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.89":{"name":"@balena/jellyfish-metrics","version":"2.0.89","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.89","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"137cdf0cba2cf6e9c55097d240fa529e629a80f1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.89.tgz","fileCount":16,"integrity":"sha512-F8WIVpRr8XVUquLJDt5Sux8I43Cjnw3Dq2Obcuu4w2agg7zh3SYB5yd3ezOXEswqe0eNRKJ9wGrzyj9vCwJpNA==","signatures":[{"sig":"MEYCIQCZ4W+XlW4AdUly8h/QBJqYJhj8WIRAKZDx6JYyUli6VQIhANXBLslNmKxF4Fhln8Ub5qmeXK3XF3eBgCe9MJX08Xkl","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":151857,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiruesACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqZvRAAopd06nzkPZD1pfvOWnTtDK1yOc3J8uXymNPuWLXn2FAaB4ZJ\r\nhYlZzoGnyGQvlvwDYw2pS1br6jkeDaeyMNJgXLwVomaIXcW4KAU1+sUjGx07\r\niBQ4BQuoDmLaHXFtVoJJpQQ8aDMmgx5fpmpzhSKUM3Qs7YJCaLqO3QwiQ07+\r\nqNGdDxJyC4u9Uc2TPuAKJKvU+Kk8bp184RhcoWEdDvRE4qQjX8Pk0GctORfk\r\nqzEDfsO0Pht44sh7OUL2dTlxAHylpYp/jZaL4qBFzek2/XP/d4BLGGsyKJzF\r\nXoG3hwMYEqqHCcTNm44o5itQTG3/IjG/LmFKFQssyL+2f7Zq8XBvc/hDeWe2\r\nXMPw1Jy910KUjpKdhOXuwQh4HLd6UfMkZ9lAtGlvmZNuWtkNqyiVgytJSh7n\r\nJpODp9UIGmElmtkhA+Yx3Yl24vGkOtM3vw30PUCAoPXVkbJA9HtPjzDYh47b\r\n9OtS+LFxPuyRVKcvsybXfWiCkcRuxa3pNLZSdMlMZEYE7tddp2Idj3pf9YR2\r\nrE/gWDwM8svw80A4+wPEOuQFXNU98zcPQa3uTaFqsMlzNCf/e38SlNIBTyWP\r\nGFIcZkS/YqY0ywwMmcRPi9WCcRF+Kyb6mGbPd8gye986FOMf/787ZrFF/HFN\r\n0u+NTyY1SHzi1UnxqL6GHCV38LexvpcqU1o=\r\n=X6LP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2db85cc8a65eaf5000b08f3ce8ccdcf76c427ace","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-06-19T09:06:42.877Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.0","@balena/jellyfish-environment":"^12.0.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.0","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.3","typedoc":"^0.22.17","typescript":"^4.7.4","@types/jest":"^28.1.1","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.0","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.7.0","@balena/jellyfish-types":"^2.0.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.89_1655629740306_0.1563284678448662","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.90-joshbwlng-bump-deps-c5b876b932b984bf91b3945d5338762d2bc67311":{"name":"@balena/jellyfish-metrics","version":"2.0.90-joshbwlng-bump-deps-c5b876b932b984bf91b3945d5338762d2bc67311","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.90-joshbwlng-bump-deps-c5b876b932b984bf91b3945d5338762d2bc67311","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"76a14baab51d0db798d587cf31c763719bb84bcf","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.90-joshbwlng-bump-deps-c5b876b932b984bf91b3945d5338762d2bc67311.tgz","fileCount":16,"integrity":"sha512-LFTr6qS66Dr/Ac/eer0QDb1MRGNIXMzhSPX7HNbFsbCmMEP3mQQtIEVhBhbgfKQor0tlzPDXEz/RcTgSN54zQw==","signatures":[{"sig":"MEQCIE3D3cgyn2f1yBUCpOJazxBtQuviqWWWM2AjWpl9lZqwAiBUeSza30OdKI+uoPGhrubk7mCvAXf/SXMA3ThsZJ/4AQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":151979,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJir70YACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq+ug//W9waj+AkQlZ3EMp2jjBn8weX6W2w5CwGhBbgAlQFR4OOq0L2\r\neA771r9/trgwMRDxuEZdBDdviUB054o5JSwXH0uTXkavDSz82ojuO8nkNcFx\r\nDxLIUJvj6o45t5R4t2YroMGdz58VSZXrQatSdaAAWw9AEHXfS2q1Nm5Q15LX\r\nFtjdTWS+IxcwvXLLoq6R6FhS1pqqVrRBLCFdLZ/yq0HN8rSp1gSFYOIAuQ3o\r\nbd+I3cCCUKRPOn2wmjlJsHOgsN9fAY4xexAosUcoCBruDJ4VWMLf8RFdeEJE\r\nn8imHLPRB4IPqIRLpMlps38CK/Nl8W8Xrr3fPpCciC4q2gDm8by9taoihKcA\r\n4xAOrRnMpDOxf+bCFbLYsZunDMp6IqTaYfikqAVSToxSgTnBixZ98XY86sYc\r\n8F0MnpN/qSy8Z9uDUbcutu1akLLGU8YJ1NVUXMo1mcPHU8BNL4QaokJE9G5o\r\nn420wl2ZC9dHopn1ezkSznt/1bPi59uio+1bBxkVRLDxeTNGW3JKjfGNDJg+\r\nQ+ThYfTa0behgGLCn+7BSZOQITtZn5sSkGB/CMVL5Ew1jDNaE7s2mW1Rjtg3\r\niPx1s+75VjG+pMdVbr1+pFOx2W1zmHetpzRJFdSTM0fHPmMZLwzdD7W2VgUu\r\ne5CSMySiaDWOZVu7vqehDi6VRWEVJYzem7g=\r\n=Js6J\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c5b876b932b984bf91b3945d5338762d2bc67311","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-06-20T00:16:59.995Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.6","@balena/jellyfish-environment":"^12.0.11","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.22.17","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0","@balena/jellyfish-types":"^2.0.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.90-joshbwlng-bump-deps-c5b876b932b984bf91b3945d5338762d2bc67311_1655684376764_0.4680068254777172","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.90":{"name":"@balena/jellyfish-metrics","version":"2.0.90","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.90","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6a49c0e59c6f0edc11ab983480c91d1fe7ee4c06","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.90.tgz","fileCount":16,"integrity":"sha512-54l0AHkx/OGHoV4K30cZrKM7s8jRhancZumAHAm+lo0cRIXJFIzwA+yKP7kub/lUwliPbH3kvEmJ71cHdkuaYQ==","signatures":[{"sig":"MEQCIDE6DPvqcJkDxCI9pxIegPtjdDlyw7gkcsW7pingMm3MAiA0HqWGo4fjgOtBTnAwnFhyTk/KoQAdsZwSs0QH+qIr3A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":151918,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJir73/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoeOBAAn3AtWYQgnnS74jeOFGT2+8YwRa+0lJ9EdlLoov1XCUINr+Jr\r\nX9UGl82BXVEuJbA2MsS59FOWzBiIEghssRo4D9iB4n/iiBbBi5C5L7YZ6mAx\r\nPdVdM4oAWSErX11WrR8qm/2NMgQuj7K+h4eLx+cZ1ZC96K+Z1FFG9w9C0CM1\r\ntQbVVBX7l3xbGF7+NT7/mG6HiPW2o8gjFJjzSB0adFUiw4ojaEt14snqH8uO\r\nSqJhmCMLXznHWjdUlFJPkTMZ9cW7bR3qLEN4TIetZ7wrjWr9it5PHw1+qGr4\r\nPFX62iH/Z7uqulATdzW1lE9N6Tv+XgUm4JODpUOroj3EsQ4jvM+92+qBJHOP\r\nFUSEhG4TosfsDLMdxWyGmkjIx3FcGTb/7g2IWe5xpoAjq9AG9HYmRGtickv1\r\nTRzj2xy93zh5oram55A2YS6tFqpI936Rnvk062kUY/yjcN6IROO/ScnBrfG1\r\nRavQfP0bnd7D6Z45HbET90lEkGhYHnr+754E8pcVYhiK6fIE4ty1iVeNwOBh\r\nThG+rdREhqG1RWoVH93VIAVKf7pZEur8tEEjpjANNmqhKiKMgNRPqnF3MwAW\r\nWALprhTdd9+DIakM53HZR3m390+BtVfaSmQgFskZMYmJEUZbaPm31gu20YGZ\r\nOY4N0Ia4g3/SH/AHyeibTL44zK0RqX6UPPU=\r\n=PKt1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"008f9d51ece9b6a5d7117bb6fa72b5a1d616df3d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-06-20T00:21:14.873Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.6","@balena/jellyfish-environment":"^12.0.11","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.22.17","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0","@balena/jellyfish-types":"^2.0.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.90_1655684606926_0.14718439886451162","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.91-renovate-typedoc-0-x-7b58fc0394cbf4d9c777faf9b2274096e4d2484d":{"name":"@balena/jellyfish-metrics","version":"2.0.91-renovate-typedoc-0-x-7b58fc0394cbf4d9c777faf9b2274096e4d2484d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.91-renovate-typedoc-0-x-7b58fc0394cbf4d9c777faf9b2274096e4d2484d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"157ba7c39be929ef7000b14b8522b4e4bd23aaea","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.91-renovate-typedoc-0-x-7b58fc0394cbf4d9c777faf9b2274096e4d2484d.tgz","fileCount":16,"integrity":"sha512-xbAOHESLxolkOJQiGNjRRrA1Sm7mw7UCu0uqZeDCZhISL8OeQ9/0hVPtd2yn4fTbTwBhidtx3pJD8561w9mVHQ==","signatures":[{"sig":"MEQCIHJRVdP+GM52yysonmBW5qhAn2EDp+xLdtAaS0FSTtxLAiBW3uJaoCBhTsOxBR0ba5lLemFVE77FG/Zk/p8agd3Hdw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":152062,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJitoSjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqjlg//WSQUohCVfj/JCpVUWxVZW5CJOQaa65ZtTvtydWZ4VwwAyQjh\r\n1DAZgNoWc2puGw71OnZyOICSWXVxOQV2TtSX43R++i3/ZsIfdWnkjFW1mKjx\r\nhPMiV6PkQJ5YH/TWrsUJ1i6tm9N9vclfmrHRfcfhMvsH+ymUmckxgZigzU1O\r\nZs2rgg3XD110Phx56qOULN/Rx5aEmYByLkaThZylNim7LZp+YMX95VMgfipc\r\nQsaNLSzJorDz9VQcR+okmR2TCtnCqXDBbxPJjAo6Yp41+Cw/UShK+XtU5cOK\r\nlIfQgFCDTj2Bd74WhgjEGM5mpbH8XyguumQKdYAYF9kESDQqVTYL3U4zLGBH\r\nApOJsxvwVAgtvwFjdiFjzwMOPnmsm2qC+UaB6eYGcigxcNHWUn4O/CekGcri\r\nzyGVUXI02LopFD3E9u4gwuAphd9/Kz7LeaaHrv9mrOvREJa2P8oh48t99AcV\r\nE2bQ8zPBxNYJO9pv/mwHWExKToT2oDUtaXcyW/U2Wa9/8EALNqGq0a9JAhL2\r\n4nN00DiOciQ4wfG1r1bJj9nml4OgF0VPdjpQf6Q2w6LMZX+JhPncuyg7lMFq\r\noqUVsAHMXJvsQ30P2WF2mzlm9jzY12p5fycBhQSXHNo2Fis2mNvKYayY02qQ\r\nIqD2Y1PnhsP5yQ9xpvCmQm9NAYesVlKn6kg=\r\n=L7KJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7b58fc0394cbf4d9c777faf9b2274096e4d2484d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-06-25T03:42:20.823Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.6","@balena/jellyfish-environment":"^12.0.11","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.22.18","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0","@balena/jellyfish-types":"^2.0.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.91-renovate-typedoc-0-x-7b58fc0394cbf4d9c777faf9b2274096e4d2484d_1656128675406_0.7453640264173935","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.91-renovate-external-zero-minor-bcbb412eeddd2b33eed1adcf94f81f748641af01":{"name":"@balena/jellyfish-metrics","version":"2.0.91-renovate-external-zero-minor-bcbb412eeddd2b33eed1adcf94f81f748641af01","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.91-renovate-external-zero-minor-bcbb412eeddd2b33eed1adcf94f81f748641af01","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4a343d755a6c7b926b5fe49ea19f83e3a7deee78","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.91-renovate-external-zero-minor-bcbb412eeddd2b33eed1adcf94f81f748641af01.tgz","fileCount":16,"integrity":"sha512-HATq+FbfxOf2A2UMYtEbRd7UeOlgeiSWmh5oTqToMGK5o6Gi824MGGSCnIH2K/7VAKr7rERj+QvbWjEZ89FY0g==","signatures":[{"sig":"MEUCIHBxTiDTDVDoG7NU5uvl4DBih1JyiJn5uqR5ISm4DXDnAiEAgjdrZtXptWpCn+XrotGIVzPXZF4rYVfahJ1lBz8L6kk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":152076,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiuM/oACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqzxg//We3PYdynYG8FZK0hCOYKLr34bDpmlYfgR3y//fXEaj7D+hBe\r\nD8grwp9+wO/5xZEVMZs89Us2S7soHmcSjL8qxxAyMc4BlPusAKu/DNzoW27y\r\nL7JPzNAXRyUj6/J/3Jk5D3mE/GLsCaWU3SiXhCpKMQ3vL7aut6UXV2D72I46\r\nK59IC4o3T7/hcRuXAUv/WaaK6U7GPnp0H6S7rhZAiR4F+AZWvF/OV9TRm2ZS\r\ngEWIAYmxA4gtbxWBxf8NDNvgLtpUS6kN09a7Qs5JCLKMaNZNYD2OXXm7VT27\r\nJoGQ38BoI0z8pazSq7t7L9aLWaK4vs9rtvmmyPuHmUhjZEeA0bcdKveEx2zh\r\nSI9wyS5Vu6rgSwXDGWE+SgeOnOdJ04Fbc8SGPGBzxhHm6GawPE+PwC+ZIVsW\r\n5wkAeSSMNy3T/vScT2g5mTChT/1ubTIeMV4LnpMimPAJEjr0knJPz6Xl0DvS\r\nfTZh3xo9XWATtl4ve5nhQgl+lr653yBi4BjbRmpYa1kb61OSNJdI28p1oLst\r\nNf/2R/AX3EMk2b6uRgyDuNyXYYmY8Mx/ypHDacNTJxo8PQqf5bNRlE1vdJ+7\r\nZfLitJibfrXxjeRh4qWU1VDWlrAMi8z2j+DIRGOVAPelZPBxWkA/hN+18X4b\r\n9SzzT31kjoBHV96rEvCvXzuoFA0I2OOZkF4=\r\n=IsWW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"bcbb412eeddd2b33eed1adcf94f81f748641af01","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-06-26T21:27:23.357Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.6","@balena/jellyfish-environment":"^12.0.11","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.1","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0","@balena/jellyfish-types":"^2.0.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.91-renovate-external-zero-minor-bcbb412eeddd2b33eed1adcf94f81f748641af01_1656279015955_0.7514226458550035","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.91-renovate-external-zero-minor-a0546f19f2747d417a160c8e0496e41a82291474":{"name":"@balena/jellyfish-metrics","version":"2.0.91-renovate-external-zero-minor-a0546f19f2747d417a160c8e0496e41a82291474","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.91-renovate-external-zero-minor-a0546f19f2747d417a160c8e0496e41a82291474","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0022a4cc18444b05669501198c8c3ad33af6aff6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.91-renovate-external-zero-minor-a0546f19f2747d417a160c8e0496e41a82291474.tgz","fileCount":16,"integrity":"sha512-8sMfsNRWqCc1FLbxPNTRPW3Al6a8hg0KPKtiQUrfCWQE6XjZaZ1j0eRNb0MDImQ19MjYUwKbDJFtJlJ3+IOrfA==","signatures":[{"sig":"MEUCIQC9nrjYZZ8E0CrtUnrgRGnhBHQO/Ka9jquyn0jjrPvS2QIgC+qN6dyb3L4tWKmwyj3aoWMeNS2Mt9dLIixIJXbgu/Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":152133,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiuOsTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrkhg//dTaXFZ/11TXd3EUyr3uZ7erWxB8SvmfAeZGWvWr+MuTMG2tV\r\nY3HIUtJplmGdEP7rN+RZy1FtZmeEmk6o9iJJIGF7i87YQv14KosrXDWYzCtq\r\nyQFSZi4AX4zge/QqYDA9LNyW5lTLoO+QR3MIoTiEcn7Zdd7zXm124eBmENZa\r\nymnucaQk9erASLadJx+fLnrcaNyijE03FRsbmdQ6N3YzPOC+bmeRoALf1NSP\r\nE2p11OB7BA2jX5IquzNGdVD7XGNM60NCsV8U8uZjcLQ+/c/FNVvLtZGNsSg3\r\nmfo8OgkBoCemlelRFCOY54e2Vse69wK5xRYvnUCE48LU6M+zCcsahqHiYcB3\r\nFNlLZN2c0UIScL6a+yHJ5a97UnU+GRg7Zec10TVMRcRmg4NcD5u0FF+rWxHV\r\nHihING49NinFQzP3tTAX+t3hZFpK8yR+ZDyus1EaQS9ED7JcjNJwYqpO+kTi\r\nEKFGdu8PoXZv560hipk/Om/kzmJ8lwZVFw8RUyWH3MjUwApZK68sWBwqwgFj\r\nmC9fkr7rz4QB3v/1hRVXiUc8JEvTfoj3iliky6hqKGrg6CGVCkrHnz1muxax\r\ntMPbD0UaAI6PD0qaXBCprN95tU0tSUbjGpG7TMeQ92WglWJopwB05u10Iykm\r\nNlQVxhyDUf2qWPStPwIDeL5tfn+EGT2snkY=\r\n=C7vj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a0546f19f2747d417a160c8e0496e41a82291474","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-06-26T23:20:12.239Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.6","@balena/jellyfish-environment":"^12.0.11","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.1","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0","@balena/jellyfish-types":"^2.0.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.91-renovate-external-zero-minor-a0546f19f2747d417a160c8e0496e41a82291474_1656285971475_0.9779650344107607","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.91":{"name":"@balena/jellyfish-metrics","version":"2.0.91","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.91","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a52b3299457be57c247ba52dcfe274a3ebfeff78","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.91.tgz","fileCount":16,"integrity":"sha512-/rL1+x+husYfHEwcXr99AB09CMOHzs/6eOWXCJbm+lMBWpe493suF2V92KgXi/AkMfREy5gVUo7G5jRaPabtuA==","signatures":[{"sig":"MEUCIQDVpHVzcvMORwz5B7YQyqAqq9s9T7TBa8+NkXOchekIggIgMPC5FDXoXa15CREhdOx+E2IZO/jzosl5/ciareaSYwI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":152063,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiuOyBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmps4A/+KVOV1nMN59U46psdTbZReiJG2DMSPYLJBxF12Xv1Qs4LCR5k\r\n/BGB+vyxStap0fXb5Cb067yIp3TX6QprfWw/BPTEkMinbOjhVJ2rhgK1QZBH\r\nCWRn/X7bhpsqS29oBK8buQOJYCd6vZfKIwwcJcnK8vrrSQG/YTu8+3hp6cIA\r\ne3Xs9NnSE/MTjequqMbTRb5psVyUsQ1SCEYa3b69FDZ9cb0ZOh/S9IA55rL2\r\nMCo4664kaA2PlYyO5EXrqbJ7yUtYT7kBZ7ZhKEO/aIs7rW2+F9duOp+uaeiC\r\nek3wJWRIdStibFW1nBoPgPCZE6jqaFYQFEXZLekzGQrj5u3NsPB99Fzepf2c\r\nmX7ZYzVatT5FoIBCqzHkIoBZ7AkRbHDbjdhGnvmaXOvzklgO6zc4cxuxMo8f\r\nuuOPchHf7z+RjDAXEafPoIjaj14JHsRHFR2D6w71zpptFT2uqOj6cgqdqiff\r\nczdjj0Ph7/I5eIGWD/Fe4AaLH/vm8TdOd2YEiZRozN2aYvYnNaPSM32PFvHX\r\ndRzL8zijyUcccaP80q3sBKPRPdyEZJUmnNovszrqbHdp3RCFKDoqD+pfqT2F\r\n3cPetVRg8Ctjz6iAZaOZi0D3NKVjTgwIxxIz8T+P2hIUPA4Fth3qgP+TDK7r\r\n9RRynxPMvAyB4Xbuj+Wwe6B+FNow/DGykA4=\r\n=iH0n\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"21895889887eb2ea94b1a46b6b61dd01f73e7ff7","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-06-26T23:28:26.830Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.6","@balena/jellyfish-environment":"^12.0.11","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.1","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0","@balena/jellyfish-types":"^2.0.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.91_1656286337699_0.7832498982394893","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.92-renovate-internal-patch-91e6514c336764e7c1ad3a09dd55f7a08190af9e":{"name":"@balena/jellyfish-metrics","version":"2.0.92-renovate-internal-patch-91e6514c336764e7c1ad3a09dd55f7a08190af9e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.92-renovate-internal-patch-91e6514c336764e7c1ad3a09dd55f7a08190af9e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5eaf157eb44d7c673cf3eb5db8a79435984ac984","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.92-renovate-internal-patch-91e6514c336764e7c1ad3a09dd55f7a08190af9e.tgz","fileCount":16,"integrity":"sha512-hxY2UD/NSP/zVJG59exZDmIla5WpyQNYhrbSRDzulqiZjW3U1Wf9a8qHvZjZ6+u+oYHqPyPnNhhVFQFwwuQ2hQ==","signatures":[{"sig":"MEYCIQCopjqs++JB+jOdly89LO9vAd1BQmsjWPvWLTA54hq0TAIhANt4Bsc5muQ9GqfOFHdUvKb05u7BjggL2tarE9TwFVHJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":152224,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiuUkEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpRPA//fRqjQ0Lr38wvP4aS8H3SUb6SGqdSuwMkvqvtgk9XKQt7FI2R\r\nqKr6yP5eH45/ytqLFNSdGqQwA/xEPEW45Wzz1gAJPnAnSNBpE5p70X4xry9n\r\ne0UYtIPQIlQa6FDq3tdCwC2rm/RKssLd9zf8eY/Zy3V8WSCDby11RWKJzeTh\r\nmMPKPozKtUqPK4/TyMd3CpItazE740yto+lOulWYGOIpgDtcJ53AeuFx57x+\r\nPQblcZUmD1GEN7EruJkaqH+HJ/eueu1J/AEpfP7hCQubAoDXJkywvHPTkiwu\r\nl67V6WBTz6TuedEOQa9Q6HnRLZMrhQfUOKe2yKRGzXYx2CpHv+/yLA02mCNw\r\nxJJu99BVjWbLls0qkpzMsTDG4s9gz6bEDnUqyMp0LQjb+zoy6wlpiGn5TqN/\r\nkEWfV1X0HpaQt3uVXxM5XeINFPgsaj5+pHRitsPwvo014JbUoPLuTPhn4XC0\r\nZnysYFOooGsZCTclSCxmnkmO9ACFrRDETNAYQ1LDBknO21x5gXtA2+ReeDZ5\r\nkcQ79IHgauoUyjku0LqCQ3fYhstf2ZCxt3K04FqRT1SgpzjOWIUaoK8ch5FO\r\nULFQ59ni5Bb2aVHoe6VjsN3J1Xr5We+5aeKMW7Wz/Spi75egPN9DsY1ovgXx\r\nAt8v3P55uirQOnAd7+qeRiXx/X37V9EMifc=\r\n=ZEHJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"91e6514c336764e7c1ad3a09dd55f7a08190af9e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-06-27T06:04:13.584Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.7","@balena/jellyfish-environment":"^12.0.12","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.1","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0","@balena/jellyfish-types":"^2.0.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.92-renovate-internal-patch-91e6514c336764e7c1ad3a09dd55f7a08190af9e_1656310020267_0.0864344935402801","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.92":{"name":"@balena/jellyfish-metrics","version":"2.0.92","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.92","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"417007482988db77f407309650ef9616469f6716","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.92.tgz","fileCount":16,"integrity":"sha512-kzRSF+vkYVqv9ebIDzzWFW5EFFA6aTXcjoKfWv+3b0XhMkitEyRgKHQ9hV+9PX2Oo/vu+8Y4I8f8zU93P7qxRQ==","signatures":[{"sig":"MEQCIGZMQTgVYuwPY1ICsrNJxTylwQla5958vXuEbNOm/PSKAiABjKzvm/N4TAhKdgdPBxZ/7IP5pvsgp7HygoxL4uLgNg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":152159,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiuUnVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpZeQ/+JPot+XUYVTUTgPDoi2fgMs+TZWoLkzI2P9V8xst+b6LKVGyG\r\nKzfeo8cUKE1oeNOyk6p4MnxEZJENfNe/I7TIzoAQ/VamQw4mefNZCUblpLb2\r\nUv9jsLjgxJxepXUtFaveU5gmquJcpB+vLew3cobmvalvWZiiKiEH5HAgBIXp\r\nISYJp1SZKTUU/cmgl7nYgGitD7eMGfXUYjCJH75RBynaXx02+VeCTgc/kVMT\r\nN2sXpyTd0Dn+TdE81/oFY7IIiTJO3NVVr4K6XJCDyM2j1YceFZwHQJF/FtbW\r\nYHYjPSSQZNqvBDtdXytkwnLxjb7Jmfuhr+o6cmLkMKMvgHC4Pl9cuCPlxykD\r\nnccq6pWaLHpI1/Xh9gLeuh4hIIQ8eYWiCiP9OLUs5g9Levbjk1q8uuaZAyBP\r\nJry40vSfNd2+5s2gGxlUwBJ25tfEJZozjAxidvNOGTli0hJ3v9f7zE3ihNDO\r\nrmP5q83EzV0ZEXgys4OFXlBymIClaUvKvHW+JmJ8jks9tHkC7rUHiUIetbW9\r\nlRDfkRD42MdcMULgeWwhkDEqp6rvTldft1JHxFJxsN2J34B0vVOzREb7X1Dt\r\njIpGzfxdJrIM2BlCuRHJBphghYHPVkisAquz64NmxurF/TCVWiCkcPHF4hIj\r\nrUBhnmLYdmkiHCJllH37B4u70fENSDf/ONY=\r\n=tRNQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"311781945ec37cf0eab751be1e44e0fe4ebdb4aa","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-06-27T06:08:09.049Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.7","@balena/jellyfish-environment":"^12.0.12","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.1","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0","@balena/jellyfish-types":"^2.0.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.92_1656310229691_0.8039745742164979","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.93-renovate-typedoc-0-x-c7df4d0e5ab30e30183aa1331117e3dcb0840733":{"name":"@balena/jellyfish-metrics","version":"2.0.93-renovate-typedoc-0-x-c7df4d0e5ab30e30183aa1331117e3dcb0840733","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.93-renovate-typedoc-0-x-c7df4d0e5ab30e30183aa1331117e3dcb0840733","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9d76e51c50a872b069303ca2a62adc71db1ad69b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.93-renovate-typedoc-0-x-c7df4d0e5ab30e30183aa1331117e3dcb0840733.tgz","fileCount":16,"integrity":"sha512-uIW8lJ5wsgVfnDunIa7Ofy96c1O6fRM0ZZo1oM45s2byLQcTFmIbyznebBuZzJVUNQ3ivT3qy5/wELZcDa1wuw==","signatures":[{"sig":"MEUCIQCJBUKIH+NbYqfVuL3Ef47MPvF3RxG1fzv8RXMMQcOKwgIgU4ZFHGap8M9AC0lDoQy9Yc47kfEbuIsvbH0LJ6sodRM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":152309,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiulKWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqzuw//VcoGydpBkwm02xEs0pHgNMucMPSnL28sAdzLwGJ/Ltk9GrWu\r\na4RNPHF2s2Nd42nmWBv7F1/DKfXAcSIkfJm151RGcbt22LqBAJwePfCUHkp1\r\nGoMw2cZWDOsBH9ANlMc1QIn5xSC+S0DE0Z/mxEZPtnnhDxQ5lBAUQnlbtpBy\r\nKCe6SpL3tN8XIj5NKkeEpZn5ic5wAVdgkDk5oOqiwglHHSI7CVoGfTQ+BL1N\r\nQqSlvJWFD0052PZ6xqn9bUQ6+HY5qy5VR47u8iBegiAwfY9zSR8KCSwzlFTF\r\ndKhoV0DbeYNqry6G8O8l+QvizPibSRfqDYcdBZmhslLfi017diYXndHfHViY\r\nnBrcloReAzwojruzKBZo0TCd+4+1NWHyCtBuiBxUekWzebljLdQxsunn74Vw\r\nF/EUssRtKwkyHmlJs0WtK2NZAPc5worJdnCv5NRUgpoeXRzfhKdHhsQ/3jpl\r\ndQTVdN6age8zaCMVn/4J6Z6ZEatdW1Gl2rSWBiO3hfPatm7wUNUHdSK28sgu\r\nCsLSvPQYVTJoey6lug21EzGUv2puCKnYyQjTxsoUTJK/59b7Hi+LmuZClz5R\r\nPkaDsgkbkdWP9utqCYb/JuGSDUOkkvPLyriWD6/rB0kUeALdu+Ya0xvk/M81\r\nABUkO1gP5Xw/fvGcbsHVDKilRuI+nz0CMnM=\r\n=4ct8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c7df4d0e5ab30e30183aa1331117e3dcb0840733","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-06-28T00:56:50.922Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.7","@balena/jellyfish-environment":"^12.0.12","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.2","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0","@balena/jellyfish-types":"^2.0.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.93-renovate-typedoc-0-x-c7df4d0e5ab30e30183aa1331117e3dcb0840733_1656378006743_0.6853973632849581","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.93":{"name":"@balena/jellyfish-metrics","version":"2.0.93","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.93","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"dd982172fe553347472939ecbb8994121a46d8d6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.93.tgz","fileCount":16,"integrity":"sha512-PIuO2jBBedxpDWmBd4ndPq+aDNJqHPWWBCrYDIfh055F12kAU5T1j1AgbkcM/KnqedBaWhpLQ9yTQwr75jwa+Q==","signatures":[{"sig":"MEUCIQD3tPfxAw4HFLQluC1qzV9rJF3YNKXRNgsyofTAyglsmgIgYu2kr0EUBVshN1iJdfsCYwb0FrrU46AThUiIaiNZGtU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":152247,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiuoIJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpaMhAAn5Uhn3Zb2CwxjfBZtYIqnFCgqZtBiSJ5Rdutr2YhmZIWBNxD\r\n/6g08+1GhV8fVtDlqqK1t59w9osu4drV1XZjSqzoa1F0qnRsxloPvJrlDOMF\r\nwVwC1/Su7E2WD0zinu9rgr4nPr7/b+xz0REGO8TJl6rmZOhhXJcmDGb0ycLX\r\nNwmLKxWjzedrWxwpxaZLIE5oeXGT0bHF5XZJScwThjT+nV81yxVeTEo09mGy\r\nTMCvoeq6OqiOmeqOZCq+UaNDUYVOetISjJMzpcUdBpVKiIxugPQ0/nCjZy5J\r\n1BPaGLmqldJmGO+OaZE+bknaKyUypzEyqEEW+jop34Tw9rIKfBxAfUJRS0Yt\r\nTCBMXGhhZMNBegQ89IRVP/fPKM1Wd/vckUBLIqB2ViwpvJupGcehBDvL/mng\r\ncduUFNNjuWxxkrVSUpqvor9AxHq0E6ch8tkBnnTExHajdw18dBNnu9rJQlsh\r\nB0GMnM+t3QrP/CRKEZiAKzPpUjgcHCxbdk2y7Q+FaSPtrRbzOIViB5mtkUaR\r\nOj3mOaUKecmOtJgjP2asOC/lU8XkLlqdvxFsXPQUw80vwhlA9+9D+igQOzcD\r\nibX2JW149M9A3TpVD9ZkwL28p0S5bCr4kP2e84hmSOEJgRy4u6nZD97ZI2sz\r\nAS7pgL7JUvEiK0uufHsbkQSsiJclQ8nW/Hs=\r\n=Ads7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4b3f77cca464d91d2c4b983536a8da0eef5f2277","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-06-28T04:20:19.849Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.7","@balena/jellyfish-environment":"^12.0.12","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.2","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0","@balena/jellyfish-types":"^2.0.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.93_1656390153200_0.7103391774240158","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.94-renovate-balena-jellyfish-environment-12-x-892ec49d04270fbb7b8e729dd23a848652d7d774":{"name":"@balena/jellyfish-metrics","version":"2.0.94-renovate-balena-jellyfish-environment-12-x-892ec49d04270fbb7b8e729dd23a848652d7d774","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.94-renovate-balena-jellyfish-environment-12-x-892ec49d04270fbb7b8e729dd23a848652d7d774","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ec1a9ef9693adadae5fbd0b007c01c8d429aaf88","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.94-renovate-balena-jellyfish-environment-12-x-892ec49d04270fbb7b8e729dd23a848652d7d774.tgz","fileCount":16,"integrity":"sha512-albL8g/QWSd0njUlBQJ/hnSmczio1z7jZaL/zii9z0xDkPf97XA7Z80yd5VKpnjMrA5kd4YCw2MNpWNVAFTDZQ==","signatures":[{"sig":"MEYCIQCZ19NJbaKGN5ijetz3uRzR3f122noe2+EaUXQ+stJBQAIhAKlrMC2TGSZ7RDmnIIgMATq3UZ2Nc/Ir6SP6wXto/7Lf","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":152433,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiu+EPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpePA/9F+aYvyaSN8WgZlx55whdxWsScAik9euFm7/JbA36ZYsQi0//\r\ngt49l4+Fyegk/K2slpZfFM3ptQbS6sC8MHB0S+YTYJlgyxRKWN25htLxSUMs\r\ns7F/Y9cMj3M5Cq3vWUl9PQW7uoH3IWO9/TD7SxPXkQQyVfVsmq4uhrtFe/CG\r\nhsratB67yq3jozZhRPO/b6uEm7tdUn3+igVN8JTQEiZp4tk+36WO5C0IG1wd\r\nwLOFiYtEKK4oxUrjlkocGpQlZR5YfRNYRSqcyzDqHWMIiipUfs1HNQ3I39vM\r\n/T/u7/7a5N0phY3Wl8SofMHecurjpCaYVVlgTAUGuuUT0J7EPnRF512rhKDw\r\nq7jl3v9CCB8A9NhFILDSx9ufNTxP9MVWtxP69Fj/A2b11cy0RSegU4Bs4WX8\r\n95uSbc87RsNBTADb7XFR0YT8AdYApwr0NFB7Sj/7RMEie2Nj9h4F0Y/OcmJT\r\njX+A2LU0VDnNJxyztjZpqVwyiL2RApTkYc7BO1bAzHb1SI5Rzud2vMgBUulw\r\nZUlmpJBoH3VhmP8nnw0We54qBPTnFD9qtAvuNsULuMMDC/K1UtXkKbn8qOeq\r\nxv1AIbnPHUvi86eLcrJVpwGG4+UQcELSCUl+5jaG9gNhfd4DRQDHmlkSWd5P\r\nmjGYtE5R0GTIcm1UFl1j0s5AeGFuveMtRps=\r\n=tE1J\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"892ec49d04270fbb7b8e729dd23a848652d7d774","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-06-29T05:17:16.605Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.7","@balena/jellyfish-environment":"^12.1.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.2","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0","@balena/jellyfish-types":"^2.0.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.94-renovate-balena-jellyfish-environment-12-x-892ec49d04270fbb7b8e729dd23a848652d7d774_1656480015042_0.7629338994292687","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.94":{"name":"@balena/jellyfish-metrics","version":"2.0.94","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.94","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"16242ed339514fa959156cd015871b07817deb27","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.94.tgz","fileCount":16,"integrity":"sha512-/NSs0mpJhGjN+WD+UldDBS7esnCa0ZXj7zisbHrRZkFUulwTnEAizgdmXZd9pfBP0ENjng1JzAqHkZYEFBNu3A==","signatures":[{"sig":"MEQCIHW/R81PuVBYmJFOD2QysDTSnJ32uP4EtcwfYYzj7yFuAiBMgSJu271osVQgPdJ/w6WqpaYjx5oxQ5xor2yP16igjA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":152349,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJivDlRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpDCA//dL8ut8zJ4DM8+5oDAOAe6KFz+jLkfsStWMGBZSQ2eJtlrnmO\r\njJPSVaV9Ot348k0L3C6qexvkuWvE4QLAfaMhSUr5Qh9L9zeMqXffDEjU6YkL\r\ncfKI0Vj6Wtr176fDTa2IaEkhGzGL/DWZpFbEtBAtE+9/pTQ4wxQanMtmjrdX\r\nizkYQrTcskXLVZRHNa/u3jxL3O67lkWFhlL1HsuP/t1Rly62FSJG1+KuZxad\r\ngDoLJ3GxpwO/iTvomIyqA5eAov06xg7oIPbCe8fzEZhPwy4g7UJi9KtCpRmL\r\nkJmevYP9yIeWPetg1gBYNtvXUZbHSQtNlwed0Ucoq+Cgp4Gm32JT0tAMuaB3\r\nv1XWeb44AzMTnGJQklIlvyPDeeRL5w4B0akBl6sQdT/567x5/XPh4n0ZjrJU\r\nsBc0u94jDwUkWomR7Zew4BVUD3YECFEQXZAFdsJiAuLQH2hDRlYMF7cF+CAN\r\nzlzJtt+spFm7VOtcoTyUHGYsSunsIN3uBf8IId/uImVnAdUwyJ4WA+aj5cR9\r\nl6lwzrcyGSmKNVgGxpv9WQveXCcvnqfNf9mtiwmbWbA2GxbomsgUhEFhaoiM\r\nGSJuABlhNY+oMi6qHo2XqrScv+Rhyf2MqUpJMs92QPU7uSeK82JjJ2UbzIFG\r\nXar2idm+opphxqqoWHGxNxPNCH7W1diV7EU=\r\n=EXrT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9ad076b031c9efea71f9d73f3a4085f857b37112","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-06-29T11:34:09.896Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.7","@balena/jellyfish-environment":"^12.1.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.2","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0","@balena/jellyfish-types":"^2.0.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.94_1656502608973_0.5219609423368801","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.95-renovate-typedoc-0-x-d7f8d036105dd2109e47d3527fd496510f10fc6b":{"name":"@balena/jellyfish-metrics","version":"2.0.95-renovate-typedoc-0-x-d7f8d036105dd2109e47d3527fd496510f10fc6b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.95-renovate-typedoc-0-x-d7f8d036105dd2109e47d3527fd496510f10fc6b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cf161b6ca6de623e5c349996cda931482d9e3f0e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.95-renovate-typedoc-0-x-d7f8d036105dd2109e47d3527fd496510f10fc6b.tgz","fileCount":16,"integrity":"sha512-o2tkDVO1J/2rN34lkG2jrwq/BTnVVzqgBbFn6iwpMaHFjY5J/pLNMWmjO/6HU9+MYauDKzdj3pbJx2n1YnpZxQ==","signatures":[{"sig":"MEUCIQDVcilRtmFJPCOkXWMoG9Lc82G8SdukXp70oAIgc4FHRwIgdMLTN2Ku39WYpZ7StIqAhjUZW7t7EvWF2wqJugFffXA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":152491,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiv2JiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmryhQ//Qeh+mXDGs/Lme5vmADKfqS9IiZZn+XYFUHJf99Ckzw5ejlKL\r\nl6XTuunTuIgRPNfxXYI5yWWX78lDm/qAXtnQyTY6iud1+ja/2uuYifNWhaNf\r\nAQMPmez894WZbwiFHwtXrq5fuxLpa/o3EXH+2KFiOxfH2QPS6Gb3PJewtZsG\r\nuL/x3cflbXSZdpCQGteh8uptOLiRdEZofD4ZhoiSnDhN/GFaKZDIpdhvg2oB\r\nGUGor1dxXOTVjV/hOS3Na0IzZTkUW9y7RWsfVXB3y/4QSrFC6kZXfo86zAkM\r\n+mYOY0oOzb9hOteW1WW1rKTf2LNEY71446Z3dSabQ/NZS+LIl1HgaeQS42pH\r\nSrxrOLiBNK9GAuPM9ppoGGLNqWK6j7h5JIuwih73QH8AKs9k7kOG8YbJoeI9\r\nGvOK2LvCahMR6Pc/9PImP9cCmozUAWM670u/fWFF9kCsBzoRF/Zevc+55rUr\r\nNkhm89MNd7EksbHfHmKOX55mHmoMNorvzL00d7w3/HtR34dJbNraOpUHUMgd\r\nR2+UIJPhX+MszT9jLyUJpWkfESIcZhG9dgtoylzEwpy3YEb24ue1zYKR4WOa\r\nBaR8T4TjYqrKqRjEKN8Qjqz8Dyh17sGHw0ZIaeNyp+Diqz0cnJ2zSTSMKbhW\r\noH9196YgB5v7Bcv5aAkW4ZKkntjTCNmaxBM=\r\n=Oiwk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d7f8d036105dd2109e47d3527fd496510f10fc6b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-01T21:06:11.909Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.7","@balena/jellyfish-environment":"^12.1.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.3","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0","@balena/jellyfish-types":"^2.0.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.95-renovate-typedoc-0-x-d7f8d036105dd2109e47d3527fd496510f10fc6b_1656709729815_0.31954255014517274","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.95-renovate-typedoc-0-x-5cbdb71fa2baa9b3c06e100d4d5cc20cc420902d":{"name":"@balena/jellyfish-metrics","version":"2.0.95-renovate-typedoc-0-x-5cbdb71fa2baa9b3c06e100d4d5cc20cc420902d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.95-renovate-typedoc-0-x-5cbdb71fa2baa9b3c06e100d4d5cc20cc420902d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"579a9a8b937126e57ece0f47d483b6f445a692c7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.95-renovate-typedoc-0-x-5cbdb71fa2baa9b3c06e100d4d5cc20cc420902d.tgz","fileCount":16,"integrity":"sha512-f63SL1xdnZFe5atpfLLNhmM2EzXbHvmrMC2xm7dXGy09pktQah5Fv/H8761s1qWmwwFU/72G/0ASAUO9Ru0i5A==","signatures":[{"sig":"MEYCIQChSk+hYT6roUFfYQ/2kXICfxijAZUb7YDaMZyCRpcKHAIhAOGR3l9KlpQR7OstMre7NBvAKL+WlHha5OINFSWAfQyM","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":152546,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiv8MeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoc2A/+OzhXc+QhMZZGeZQUlp7OR1KayQfR9afP0vCgCd+Fx272FE05\r\njFPFyR+vHof/18CMc7R0ONnJONkDTFCSthFo+gtWVpKO614LriOF3WkELdhz\r\nX4vYowJawuErLWX66c5E5PIQUOjbxVd8zgsFLor/Z1xNsxtrW/VO8rADpo6K\r\nyD2jLvqd8CJluV0GBVyd6MfgkqrSfazE9mhfdQUd/JmFD3BAMTg9XaNue7Wg\r\nuA0Sh/DG/MmD8pOMQhNUI7e/RiOBiqjcyZLfOd72Pqe2BNxbjXABvPq+Xjb6\r\nNGT9f9srj2H1aTsrXWfl+yoLC5zb2rNFD1DMd8g2VUEtGiIASI4hgzDoC7tk\r\nMfoziKSrRC67II8nAi4uwDlWq3RKReySflO0oZ6FeHfliL8/+Ei9nCxPwAW0\r\nqe9l1oflkj2hLySxAHkxdEJsWRfqZlw2286xVcBbbldEVRzJryqhbt4CUIj7\r\nA5TKl5SQCfGh20agrR9YkdV3Wt/ZAIMjUCWWXBGNGsF8oxrR4ijPBVBvbOf/\r\nQSV/+vSnS2hijTBojhSUmtYh+/GeHe0ehJLEoVIQF2mT54lDKE04C/PqXs/k\r\n2KgpGWqJQ3RGskViz2ox5iPalDQqJ6FapikDAXNk6EhjtwSswxLtt0QimYu4\r\n4n37OG8o0sc2CWoCCztkEJrgtrM8RNJWOHk=\r\n=0pPl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5cbdb71fa2baa9b3c06e100d4d5cc20cc420902d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-02T03:58:46.751Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.7","@balena/jellyfish-environment":"^12.1.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.4","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0","@balena/jellyfish-types":"^2.0.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.95-renovate-typedoc-0-x-5cbdb71fa2baa9b3c06e100d4d5cc20cc420902d_1656734493877_0.0757861517299625","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.95-renovate-typedoc-0-x-6017a9e106eb74813216d1cd21521a0d8311da27":{"name":"@balena/jellyfish-metrics","version":"2.0.95-renovate-typedoc-0-x-6017a9e106eb74813216d1cd21521a0d8311da27","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.95-renovate-typedoc-0-x-6017a9e106eb74813216d1cd21521a0d8311da27","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7a2e035b89ffe885daac29f881ad23734bd3bf67","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.95-renovate-typedoc-0-x-6017a9e106eb74813216d1cd21521a0d8311da27.tgz","fileCount":16,"integrity":"sha512-6EW7Es4R2sNMSA1pn+FAXVTsvQTJaBiaqb6IuSJj37agatyLUtY+rJJuGgkNccNLwy7K6lqRBNckfp6MjCnPwQ==","signatures":[{"sig":"MEUCIHb4zBu+9fsd5pF9ssUuZHVBPwNvL9xt5dIoCe9V+oIUAiEA+VpDuf8MD3P96bs/hCtUya7a2wxIaK6Ko+FHEVCYS8U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":152546,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiwKF2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp4GQ//WIyWTQnODXJBWBZxQQgh7/PDdPYSXXLPsNNRikGJ77gF7iE3\r\nDNrDWgwNKZPFl43hJpw8/8ZPpi8IfI9H8FKiu3AZgq6gOhG+IV9quPruP0wS\r\n6SMfLusQLil7nnRjdxzRqRWDSPBpFNmp+sGpiMzzL++rjKnbLQxOINlyA8hz\r\n3C6tzS5YEuSA/jGIMkaYt294VGa9gUIHfM7sJHutNlwIshVeCSht3Ot3ZV/j\r\nCtIZE8Li7vWJaisnkWoAkG4SPJZJn2rihgkhHhWBwj1Z27YkeKvAGdSlx5aM\r\nMeaQEu8n++V/f5Z6gHphClWPJ7UAn3XPEBN8FOwaLMw6o9sy+RKsoKHOYKjD\r\nF2t1ikEE8Qd7uXDaaWrjKoZW3AWtYPXmINrV2QFtNpfOvesa0nLOl2jiZz8n\r\nyJQ0sup7XcYGOTK4Vi4C+CBmUNqRqH/URUD59YYN5LtiK7sEiiU6r4fz01Xv\r\n2NEVXqIhi16RKwSNgOdrUUD3hm3eyMhXkSBgHa+b6W95/BTaz/lRCCXzeV/B\r\ne54ZCDIp2PUAFCfn9JekJDyrkoYxflHBuihjh4W9D9CzN1pZzlHxdy9iaoKL\r\nu7eTOKYhucRW8adbWWXriGtSC+if6mVSzL81zXyy4AAG6Q8+s5FUbZ9UP0Wq\r\nZgSN+KUfqXvGuln6Ewl6+lYxGEDB0HHgt+k=\r\n=JgeA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6017a9e106eb74813216d1cd21521a0d8311da27","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-02T19:47:49.661Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.7","@balena/jellyfish-environment":"^12.1.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.5","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0","@balena/jellyfish-types":"^2.0.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.95-renovate-typedoc-0-x-6017a9e106eb74813216d1cd21521a0d8311da27_1656791414312_0.6238278803820185","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.95":{"name":"@balena/jellyfish-metrics","version":"2.0.95","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.95","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"215c332913c6e6f6cd2a16453589a8e1e9d6af53","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.95.tgz","fileCount":16,"integrity":"sha512-RENUTRFa2c7BKLMiD7GLKinj1X24sryJNSiZuoQO/ILTmdz8CrYF8vkkfHEgA/tBZ5hEd3LXHbhUq2qcUFO6YA==","signatures":[{"sig":"MEUCIAeCzImB2ilfVPPs36gyE2672kIiaslxbpHElnW4qmZrAiEAmzcC82ALnNpAq+S64s+QCPqfcXO1usujr8sF6xGI3xM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":152484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJixlhhACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqm0w/9HNqkONdMemSny8Ofa5gUOqzyIW8vqjt/ekxBVg3M8Cvkvzv+\r\n4LlxA7QJmHEPRPzZhB+vdYSsVjYik5H1AboIA7OHd2FZM4TE6F9PLvaFdWof\r\nb+bQGYd+vB5LYJ8lPvdkj343+v8ZDMCXIs1PaxX/DxXkh6jzds/XmCNoEA8Q\r\nc/ThjvfMahqUBdR76NZD7bQAp/Bf0hTtyCT+zA2dbmSrM0b23Mm1PIRg9QNl\r\n5Q10uLab6jSzl8KUp9BRx2AzyAmaolnMXaGf/+QpX1L+FUNhh4Hm7c3ix3zd\r\nd43CXhxdQal0lyPumadpIhPA57dWpfRq6uR804vpWQ/qgV1i4PLnGjjSPztE\r\njdatcdePeIdcTbPKnM/IgM747duIgqWy/pCCMIOxaOBKDVWuA4bCIX+SCZeO\r\niaYDF1Gu7cZ/yyqysjocK4mOj7Pgh5uQ9G3kMPjfa41Sc+g3IIpfjn93pRwf\r\nTpfny6KCS0rCLGPOp6fhzkWVufX+rVxmyXeX4OW0mKnGHyOiA6WrUSrSvZQ0\r\nSl1Lw2yvh1+9OMf7zX4dk8NotcM+mG2+bQLKFuS+opPwVqpYs/1oUtIzWZhI\r\nNaUQU2nv0BwOjRYUYNj1NaOGrDnLEmNysaqzFEc9mCWN1T75KbE8AOb+2Gfj\r\nGKYQtimJbl2aCDvS6EzfObsbzuUv1PmT620=\r\n=nqqF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d0b7a0737385b3016ed3dfd0b4c471737cc15f3f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-07T03:50:03.051Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.7","@balena/jellyfish-environment":"^12.1.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.5","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0","@balena/jellyfish-types":"^2.0.5"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.95_1657165920614_0.7038056361032061","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.96-joshbwlng-drop-jellyfish-types-8990954b0953d82cb15f5bd9f6bf4eed2be3bca7":{"name":"@balena/jellyfish-metrics","version":"2.0.96-joshbwlng-drop-jellyfish-types-8990954b0953d82cb15f5bd9f6bf4eed2be3bca7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.96-joshbwlng-drop-jellyfish-types-8990954b0953d82cb15f5bd9f6bf4eed2be3bca7","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"25ea986a68a52482c0210271fea4dbca29affedb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.96-joshbwlng-drop-jellyfish-types-8990954b0953d82cb15f5bd9f6bf4eed2be3bca7.tgz","fileCount":16,"integrity":"sha512-AZ2bMzy/Yw9KL2fSLwmgFnN7ZFN+m3mWk77xjqe+GLl7Ba7G8NZWXobOmZd3zM2AaM5MXzuLaosggVWBcZuRHA==","signatures":[{"sig":"MEUCIHfsskv3RtFwuRCv0yCPr4deOwAK1B1aMm++FaE8WCOxAiEA8nehSFMZhJ/sqba+cUz8VVzhu2mt/tOjgEJLqPB532Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":152355,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJixl7YACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoTGA/+Ppj/X7MKJM5r6IdYRI5QCSFFuT6B4NOXX8CNtTHP5Inpedwg\r\nevHkK2tiWGdzXSsTJ1fYo62J0psj8gthqEBBiGSvIxqxEwhUONT/PymX12yj\r\nMWDhQEudETcP5sRtvvxwQciXOBKam0s5srqRr949aqbaRWK8R8SZ4z326oV4\r\nJ76Zmu3Js19vn8JMNfhRE6Ui+2M5QtGurYAgJqT3kld3/zaHIm2S2W7bsPM1\r\nDIqSe/i+PxmpkYVPSYrbz8Nu+94+2z/Ac06HiAbRvcs277XJIkluWQDq/ucC\r\nm3ABDRW8m/n1ZYgNwAH++F9mZgqCah4I4vP1sUgp4gO7Ck0QQkk+EidnqT8e\r\ngbuiCEuTqNizwfS6RHMt4HU5XvfHPinikXMhdTUAFXSYlAF8mZfhvaHwT6EA\r\nTKF2VSafYFBv7qRgf7XWIGb2K1n9yuIbsyEUDRLPuTcfPV9GRhcFkNF/+dOS\r\nH/dhhd05LIo0YJiOF+eNd0o5zQPri+GgjTeP9v2hSmnXsuUjYBzIGRGdLXJ8\r\nLeMAT9bwef7E3jdgxbEsm7XV+HjNWH9T0n/VbEaH29/Yyf/XZStCaA0Ltfzk\r\nEIHxWDKeQZElQvvvXCxbp79wPQvdrd88Xd3nrAtSfrb18lfFc8bOaEHZ5Ywa\r\nVfGmpBb11vo7eg9gYQoWmqTMwq8h3/udZzQ=\r\n=F5UU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8990954b0953d82cb15f5bd9f6bf4eed2be3bca7","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-07T04:17:04.842Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.7","@balena/jellyfish-environment":"^12.1.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.5","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.96-joshbwlng-drop-jellyfish-types-8990954b0953d82cb15f5bd9f6bf4eed2be3bca7_1657167576663_0.5635041636392795","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.96":{"name":"@balena/jellyfish-metrics","version":"2.0.96","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.96","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6207aa1d96e9c58eafef3049173bb87e5d6dfbdf","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.96.tgz","fileCount":16,"integrity":"sha512-OMe37dH5sCB3xE2/blrKndayuo/mlppZxHbOZuqhEXD9tJPEl35mBLRaKOGA0p4vnzMoBepRpiMw6naZ3055yw==","signatures":[{"sig":"MEUCIQCWThllNakLdOrBcFzmk9inb3A/XxzHVg66OZy8ekioJAIgCynzUpQukhRBTK4u3/CsZ3nmIKgBxNXE5w6gzFjx5Uk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":152283,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJixl+/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp/hw//fdYytNLlrM2ElJSHu9sILObH8W4K/9eJ6h6noW7lHC2Yr/0e\r\nFG6WYDc+17glKMuv/6lkK0ntgX7ZQKzWjwX19VSGvNofTExxneFNuoTzNvOL\r\ns9+61aS63jqCJXzoLDpyLHToovSi3CW+eZopjpwdMmETzbbbaGIDdr0Vk8eB\r\n/DfgfRKekdqv555yfo6IrBent8FmUFUcHAuwIh09/GOUGagHOQ77J0wsztOk\r\nsFXhTvn/K6dQswhqpNqn0n+HFQFLEqBbaywReF6/uLXlMiLa1Lj3dEdf2j9p\r\nqrXB3O/lCzqKXvz88cfqT8FVsqaPIB1TwzDgpxMxsiMeVz/2kQ78Rk6MtF1Q\r\nRw15UY+H0Js8Pg+n8CyPpnPFCHI7RsXuFNUUEfBcqmKEHElxBS9tA6MuRpwo\r\nW8Sx+jwpnOVwDMLH6JBQ+6jEbx+jm1UVj7m2qE9UE/uSGfgSOTYl7R4lBLVQ\r\nzBYZhAP1bw2bbh5iUZPxuSbRFnWELVhf6BLfmiE4UYbgK/fTkCx2Frr0yzCS\r\nHCgPbkuHLXll/NIZjALOc10CW60hiSPN8NLfnWc4Qd567qzlGQG+e+GR+vYp\r\nUT1JyoIhwXeMHlRngADeFi17TvWxKnZTeq+sHThPk5ql8YcBYv0/hqM7Kjqt\r\nv2UVZJ1bplyr3Z2zz7A9wdXsrY93/afXxCw=\r\n=Ml8X\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d81d3783c9785afa15ecbd38fe915f1e1c7c0278","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-07T04:21:26.002Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.7","@balena/jellyfish-environment":"^12.1.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.5","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.96_1657167806948_0.74424551625014","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.97-renovate-typedoc-0-x-e83617a72683b5d014b36dc02357a2929a86344a":{"name":"@balena/jellyfish-metrics","version":"2.0.97-renovate-typedoc-0-x-e83617a72683b5d014b36dc02357a2929a86344a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.97-renovate-typedoc-0-x-e83617a72683b5d014b36dc02357a2929a86344a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9278648b8451459117090d8eeaa36a5420de9540","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.97-renovate-typedoc-0-x-e83617a72683b5d014b36dc02357a2929a86344a.tgz","fileCount":16,"integrity":"sha512-sF+2Iie3W975jCbmyyr77DFQwNdlK30VCL8d8ZkvjGRxYKd7tLJoGIpbVseNw+Pvqd6a9ZVogOl2lLRNO97CKw==","signatures":[{"sig":"MEYCIQDMcE5+YuWU2dBEnyxzc6DlRpAWDJ+IHFwlr0lGoM6NNQIhALizIkLm08sceync2U7n3BN6PTmKi10ljrC9a4sFFCnq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":152425,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJix4ZnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrWOA/8Cwx9Bj/+09l3KgE7jclH1oXrWntrRWPD8iBdx1To8dX3he8B\r\neFn3fByrT13VP/H7ZrRks0aiCWtlszJsXZN4MGl3w1f6E0R+2IQOYuKhYcxA\r\nHF7yktM4aQoE/Dcy8fFu57o9YErTXwAve8Kye8Atk1hOyy+5KQEg6f1Q9UsL\r\nsHXkBDDpEa6yYv86PW4q0BnIjmsRpOWgVkqzRJxmDHQsWqA2Y5ssfc8YqPzJ\r\nCw98JdeJ6/ilPOuErWDmjm1gd28xZJ20eJZHUMruDGYYBhoqrlf5XvFJVU4p\r\n3MEgw0SF2sYcIgxat8E/hOb/Q7zpaCGfEVyx9OYJ9egNRpWlvQ5YJNXi46r5\r\nS7vUQzuruo0rgedP5rIRprDLpB6SRvT5j2eXvF8ZkkjibczHzg0vxBJLJS/l\r\n90UJHf27KwywUaYt0k9A/WuKh8t/19d9n4R45ox9eFbXwuGo8Qw5CTdBdkRB\r\netGrvwh1/SV/CkSaN8yVnkB6PsHtjM+5+1CRpztGFHwdqhdUboe0QKnuC5ti\r\n+q80j6peK6yA18xJ3D4sGEfLWHsAgE/wOFE/Fy58wkHDEAuZ0xOwVOrUQhOq\r\nbZ9dHmj6w2wqv9vtPrjvGmrRetlQPKeDoUC/KmK1HHDwc2nfQGj82pLujlBr\r\nkJliwLxYjYQO2vH5nr9ULeahFZgiOfIK5UU=\r\n=yril\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e83617a72683b5d014b36dc02357a2929a86344a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-08T01:17:38.420Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.7","@balena/jellyfish-environment":"^12.1.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.6","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.97-renovate-typedoc-0-x-e83617a72683b5d014b36dc02357a2929a86344a_1657243239081_0.6277420607509849","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.97":{"name":"@balena/jellyfish-metrics","version":"2.0.97","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.97","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a14d310e9ef58ed121854c6c431fc02ebeff9caf","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.97.tgz","fileCount":16,"integrity":"sha512-7E7P+dyfxpr86lFSMFdpNAyJrrUZzFWfyQRK49at1mxsH00hgcpw9IhsWWmJ/HvuqWEWxAWth+3SZWeQ6GelLA==","signatures":[{"sig":"MEYCIQDGfOkF1njbqCObM452DEtCxRGxPKXCDLgr8ZS+UVrB1QIhAJPwbAi6CtYYdTT+tjGBM8fPLheLMLA9OpaCogA+KLD9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":152363,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJix4cmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpWRQ/7BjWS2Q/Dfca2u597fNz/ZPu5xSaSehy4SyxHbjhcE06jnAXo\r\n/KpLf9TrdMtx1rkLGKk9iIQZ2/FRhXWFKZp6TQ1ci+6NmVi/Ps2pNB9xHPIm\r\nH+KEMd5HeRImzcMOPp1I6HP1I8K5rEUriVHWk1q/g7F2QGWoTg70JrvriQhO\r\n3oTegJcyFSID2WEspcnVeEfSJlXNBy/JYMUNkp1Wyr9Zd9B3w4gE+gQYC+qe\r\noy1NM1/VwZCKQcOKu3zZsKBxyzvms3THops3N63X0CwIjxxAqrQ6e4c//q6K\r\nXi5sagU7XhCLDaypsC5/4EG2wKI0pl7IcJl5bZylLgRGyuX3kgsVIb87RSG0\r\n561/3m9uQp19/7CPCbtSAG0zNAkkFZE4PBHj71VjoH60FAOd5oKz72B3iO1r\r\nYHxceDblhlV1evy1sQfAA6esCW1mrMxuKcVb4D83VLbqR0oPHIPCCj4fRnuV\r\n88nDuUL5FzZwSdOQIWHRHHh6Hvyrjdv0IyigCqttS3Y4p3rzKRTo2ibmuIuj\r\no6+KRv1bnZ+hna3tp9ryRC974Jj13pQ1UsfXqQ2mSWV5M77TU3gs5v12oak4\r\nlSwxuraOV/V3MsAl1is8yKNKlfnYO/JFOFbFS2spnskVd/cDY5yPr6bD0DVy\r\nsoxKVwSrPktZduShCmie2roT6UUxS4c5kTg=\r\n=CWZz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d3d2e2a6a046d5449b0dfacd4dc18ba934eddd6e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-08T01:21:48.891Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.7","@balena/jellyfish-environment":"^12.1.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.6","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.97_1657243430746_0.2812206538721047","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.98-renovate-balena-jellyfish-environment-12-x-20f23433b9aa8fe455c69e4a4ef6b7e8bfb97de6":{"name":"@balena/jellyfish-metrics","version":"2.0.98-renovate-balena-jellyfish-environment-12-x-20f23433b9aa8fe455c69e4a4ef6b7e8bfb97de6","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.98-renovate-balena-jellyfish-environment-12-x-20f23433b9aa8fe455c69e4a4ef6b7e8bfb97de6","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"aa56f56e92242cf436160bf77172fc71afbcc3f7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.98-renovate-balena-jellyfish-environment-12-x-20f23433b9aa8fe455c69e4a4ef6b7e8bfb97de6.tgz","fileCount":16,"integrity":"sha512-I4IHfNoaTsLWMcH5wtNyQnsm2Z4w5VrqfLR+PWCdYPnFUZ6+hjRnwjdGiFlfDzgXe/BBbW2RumtCfRpdp33eTQ==","signatures":[{"sig":"MEUCIQD1BO9iGPO7N3fFb2jqqFRpMEpD65WU99OQ8tnIJMMUPgIgOE2oLc0btxMKPTQ7CQWFxQcooZaQkv9e894gaeUzJ3U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":152549,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiyAqUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpD2A/9HuNdhNgn5U/VA3GL7RBULhwhs7oduxkGcQYezIURn2d2vCoK\r\nIOi5aK5Zf1IvsbMwjtFPy1uMluBR4W6e/iEpQ4cU+lWe1YgaMjjuiTBLnt0N\r\neTwjKBNIu63U1OYiexTEWQ34IFHNINdDBlr7poU5mx7YaFLM/9BQFsjCwsYF\r\n5AnFyk7nGBkozQlczTIsBc98HXfGGp9ujbYxakdXAOLdygLRNNAq9/JOhQ77\r\nkoTJ42i/wOsnp6nMOfcMj+TgYPK3gK3v53Deu4NYL3nrthexCydB5/DqLuKh\r\n+L6I/3TcpN4Oz2x1sV3RXgrph6qYH55F5xTaW7LhXfgEMqN6EoGAEtaOFiBl\r\nrIpHXoJBbQuPZQ++jcNWEgNPHZCjM4rnVouWTs0N3HWSWOi5bHDHH0SpvJdp\r\nYSwcyXPhW7B5QzdFGg1/tH/HM8GKEgN6CUiTeTcHiqJhwtmwfA7falOm/Wlh\r\nmBc4d7CrZGXugjQ1Ia0/veSzfYlXtetmF2IuNbyXI77Vq40XbCIIHcKMxy8z\r\npzacxCGgKiQoQ3Tu0fzEJLBvcZmsgsjsdF6eFRGxh52lOIedgg5m/dgSbBrf\r\nuvZEnY/mgW2Kxa9/lqegiPpsf+Pf+FempWf30AT/eSPZfdseYvhZ5tvOZ9t1\r\nOnKzq6xYlgIKsX0H2nyiSZFXm+SNxEmIdUQ=\r\n=OMzl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"20f23433b9aa8fe455c69e4a4ef6b7e8bfb97de6","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-08T10:41:49.067Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.7","@balena/jellyfish-environment":"^12.2.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.6","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.98-renovate-balena-jellyfish-environment-12-x-20f23433b9aa8fe455c69e4a4ef6b7e8bfb97de6_1657277075795_0.8600732770486974","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.98":{"name":"@balena/jellyfish-metrics","version":"2.0.98","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.98","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0052665fc0500e29085984ab6849ee68eea7d608","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.98.tgz","fileCount":16,"integrity":"sha512-U9RJOG4CfOQawlC4twDlq2RyjFB24SSb5nUNLsTgPdIG9+AmpggDKlqbh2PsXKziuC8iaK5oROJ1yJRwRXw6fQ==","signatures":[{"sig":"MEYCIQCcTsTEalcQapaEEYzks0y6Vz95B8xXPkMuUAaMrQRd+gIhAPIbKDBn6BdPjH9vIcOe9TidIRJd6t+DKGmO7Ll5vQeY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":152465,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiyN/qACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqvqA/+KbR1VQZQlWUkhrQz5NpJuOniOTyfxDTtWVuZLTFoX+8zTGJ8\r\n3DvjUNxAq6jVQiosAm1MX9JWNbOBB545NObL1BCOO6a1/fRouquAJWsE340A\r\nVpxQ26NIZM5Sx1BlQkHZbUikts2jsQKMPtXGFcfojRynp1cgfjyJ5RXwQOPf\r\nQUhDcoBYaGsuxL2ZEwEU+iJf0BjXSTIP3/UcvKB5A6qzER8m9N2s23cH0gm2\r\nR3cRsg0yJbNfjkJoDtRd3H/IpWa3+q1NPG1fQclIDmGz5KcUeC876TUFn+LV\r\nLCGVJnrzvtrcfjwxbIz4Qf773fKpNxLcX5Rv18WkwXOz1NFFkoXe/J2Q50rX\r\nG0SOSrOy4uaiJVIMY1rzPWeDEVXLpSBByxpjbwrK166FdQugxCNfGJ5y4R1s\r\nBothOHx1owoen/4Nfj2f9cMIKOEVdddDNxrjHclti6ZUWsjLnlLhZ+3Vj0oc\r\nWuEP/vHVvy/updGuiP6LZgJ4zk7DgjGlAUPtW5Ox3N7y38WKa/tEjhohPF4Z\r\nU+bG5MwQOvoTiSkH7C+Abs4v2TkCef66mCE+9ZFjhbq6MFzrcijNLQnto2La\r\n5rQg8X8fdxW55riKMUYL8Hl+cdUlTUV4M+tl/PrjJ83gNXw8o5NfHzu2VYRL\r\nVDtHD4NgwIjhdVeb/5o81f0RYkCtHBNwnsw=\r\n=efGk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"967d7cf83a0f21016efa998cca7fe2ce87e49b56","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-09T01:52:54.222Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.7","@balena/jellyfish-environment":"^12.2.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.6","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.98_1657331689823_0.966686726864161","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.99-renovate-typedoc-0-x-24709bdcf3ba833bc042766517ffa272a645c0bd":{"name":"@balena/jellyfish-metrics","version":"2.0.99-renovate-typedoc-0-x-24709bdcf3ba833bc042766517ffa272a645c0bd","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.99-renovate-typedoc-0-x-24709bdcf3ba833bc042766517ffa272a645c0bd","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"14994cd6128983e9a68c38d8b87b51ede4ed1cde","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.99-renovate-typedoc-0-x-24709bdcf3ba833bc042766517ffa272a645c0bd.tgz","fileCount":16,"integrity":"sha512-ke3hV0B2tKScLzzohKpxZh+3mJFzhDuLxKBwN9hs9t1fUIzeZ42nZ1FpZYa7e1aDhb931YL2Ugg7Bb+1OKuUdg==","signatures":[{"sig":"MEUCIBaf0hfye3DhJRISR2U8B1FBWOujqT2NSrnS9x11t3KJAiEA0fkNQ9LOPOz+Dmrtjv/4+7/1ASi+aIzAXB2Hvvlw45E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":152607,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiyg+2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrdoA/9H1RHRVDaFhlj/1+klwq/sz0Ch690Z6K1AvqEmAyIGiksChsh\r\nqsp0Xfm5ccmEkIwjNGh418fLMus88YJLae9Rg227vgBOHiChILgms39ChaYY\r\nhk3mBqmYPHF70Fq9RPTocwZJi7p01KHLS1oUq6lI6ZArCKwXfPlX9cth5UKm\r\n5i0VwyrKiOX7oJtqLp6MXIdCrO6jo62K5V0yreQxnVKSjYgX2kNm6RdfMpEM\r\nO36KQi2WTr4gVr/5m7kSR+HFbqXOdeTxoIaUG/VCUAEGbISPRNlxqjwIvl/B\r\n1eT8z9hRmIFFMGXB3iNHicuv2TpBAmk+UWtAQkc9b3f3G0mDfkCLiao4uibF\r\nOLJDxB1r3MjQT1DmM8SlquC6EPTQN/tdh3Rvq55dppa+DnFoyXQFPYSBcaLK\r\nPMnbUcZ0ZkXz3qVklzYq9EoaRPckqSobUHCqE/3sWuAeGPGj9V0x9/uBU2e7\r\nS7imJp+Ki5JqbXKLXxdRAXGfvsJcQojJX/ZQkKZZxb4P0cH9qQa8z58t9xzU\r\n1DT6dryaoRCbqIC3S/jz3vlKaHhwj789J14dam2gosjZfeTSy/LPGjC8u7KM\r\nDid89kfRV33iW26FbPMuNts+9ATDISpqqtPs8OPHvtKfPcMkpm/5dPk1079J\r\nj90G37+ySYYce1Ny3jYMldO8AN60cAhOCec=\r\n=U5PL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"24709bdcf3ba833bc042766517ffa272a645c0bd","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-09T23:28:25.746Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.7","@balena/jellyfish-environment":"^12.2.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.7","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.99-renovate-typedoc-0-x-24709bdcf3ba833bc042766517ffa272a645c0bd_1657409462239_0.14036655943088805","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.99":{"name":"@balena/jellyfish-metrics","version":"2.0.99","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.99","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3070c59b293f5855a05a718977d9b413ae37fca7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.99.tgz","fileCount":16,"integrity":"sha512-mL1Si9kAFInh/Z6cUO3NaZVph1o4LFNxv+NGhGd0tDrknWWgNaOJXCnOeAxSQiOnaLQSlnjTX5GocMLIAQhpEA==","signatures":[{"sig":"MEQCIFknCpWxjYuTzYQ67FP4MrqZzSFkDvOK3GWmarhv9Sj6AiBGCeiMIafol8qGCuobuU5jS41v8WnOgRFb/xmgOKTIxw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":152545,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiyhDmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmraJw/+JkzF00KPtkpkVYeglkQovHaSBtnzRGC1b3B+Htg4bN3lqmoB\r\nrFjt4hq7exh2TQqvrZhFAEY6w/ikNQ0P6b12985xLy3yo660yKHQAAatOqTT\r\n0XX3zTtqyMzsy4O+RLH4GJyBCi5irlkM0F+96887jVpuvLcKlyOSTmn6N5QU\r\nAmwteD2DUdBHvl9AWdyfkjg8lhN4bktL4ZJhHyeKvpl8Slb6exrJgHikcek5\r\n0+Eq1yujXseC8ETJVcz8oWQ//4m0ztZzYg4/OainKhK7GPPZgj1DJzzoCguP\r\nD0viX6rvRRO4b2MDCu0GD5k8EI4wjwFv2pTnBJA2u05CjEHsF/Fa2ZHsfUiw\r\nZ7gszEN7vFPPhA3Q91ohEvrHjY85GJ+aVo678b5fmhIsXkxRdS3BQV7mWhSk\r\n7YZybXT1mNxj+ORhbaeUq8yqvuyfDYI2LXGJvHzI+giAL8Al1M4UEgMA9rFH\r\nFdqTK6o8xwlmY6LhERfF64XiI+BpOmftrjDW9L7+ViBfpZHp15vZoEKlwroA\r\nyZVGcueLhofIIly4xEkuD6dc9zA7qwjBrJeQOx8eB97GGrGbzDGzafjIdloL\r\ngreI+nR2hm/oovXr5cO7cjHYxD+k/7LH3N4Sxcovn7tofEyavvauZzbHu8tj\r\n8lm2zI/tjTOjvruSl7TnJapv+EQvwHTu1NU=\r\n=45TG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6e6a4669c430a339ec9f1342198c9387e6f2cee7","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-09T23:33:48.965Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.7","@balena/jellyfish-environment":"^12.2.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.7","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.99_1657409765996_0.9334254154450015","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.100-renovate-typedoc-0-x-6c023a1bc6dd039e93fdfeef7161ab134fc3aa40":{"name":"@balena/jellyfish-metrics","version":"2.0.100-renovate-typedoc-0-x-6c023a1bc6dd039e93fdfeef7161ab134fc3aa40","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.100-renovate-typedoc-0-x-6c023a1bc6dd039e93fdfeef7161ab134fc3aa40","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"da16e855429232c38063c9f182573436777cac53","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.100-renovate-typedoc-0-x-6c023a1bc6dd039e93fdfeef7161ab134fc3aa40.tgz","fileCount":16,"integrity":"sha512-jCDIFoJFLlEuGkIZ23NY9W8ZPu0X+3cQMjfScCY3ghXK0D0RBPwptwU9CMrDEWUs2kstML03DLDy0BqH8+QMIg==","signatures":[{"sig":"MEYCIQCubZrjO10Q47Czh69kRqYuRfQhdo25004We62qnl9JzQIhAPQ2RwL1cJichm03S3nxa6+fYJSjFOLBk4bKI5Xlxb2O","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":152689,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi1LJkACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrdpw//X9qPxyZ8CgrtfHqR+YLjDcPBxWvbH54xP/MF3sprH4o9roZv\r\nvWyllbx6Kog2np9XZjGw/tv7yXdz0ik/OZIwRUjwwloWbYZy3gFaOs0otMi1\r\n4SpHzKsedb5whnrLCTSLeE0VplRxYIH1vMTn5Qns0ZB5V4H8wRL9nNUhV8Hl\r\nsBJTE31Kndycf8KlAZU8OfbAPVN/iyjdNLb8VVw89SBGcAGmFyL9kFQjbTMH\r\n8AgmHuZm7qgx0BUZeGVLusBl014SS07KaZabLivaUgnPlPzMA4BewVrTmdf4\r\nVt9REN0qvrsbaA9Ti341I3IKzWAxXE5iQWfuFQ+tCtCawlNHVNqvjocS+SqN\r\n1Qi9rYs3yTrNyWq6J1pUGtWrANZpZ2afddkog0+baEmGjnr6oIF0tP0SD7G8\r\nky1FLNgxExSlPS8fe+i1xJO1vWQzP1GolSTstoE3Y+g3/u5n6kdjn08Sr+AE\r\nxEszccAyNa2ocyXA3gg7KLXhUeDZYtIw9mCQKS6Ggwzdx/h7KcqREdCD57+c\r\nlnnW/P6r+ghEJ/hs45nppANt2DVabFoXWIgxNA32MYB667PncoAOY0zJl8pU\r\nJZyVaLbMvAyuyE8NSBIgHUkhLrSZTAjbPQDzpmAYadNeuz8htfV1gJ743lz4\r\n6q8KeOV4AKaOdUS1TUIuWVjAYHCq1hnzx1o=\r\n=t++A\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6c023a1bc6dd039e93fdfeef7161ab134fc3aa40","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-18T01:04:29.931Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.7","@balena/jellyfish-environment":"^12.2.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.8","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.100-renovate-typedoc-0-x-6c023a1bc6dd039e93fdfeef7161ab134fc3aa40_1658106468199_0.3098501691654827","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.100":{"name":"@balena/jellyfish-metrics","version":"2.0.100","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.100","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"06f656e3c58000aff99fbeb7b4054414de431c5d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.100.tgz","fileCount":16,"integrity":"sha512-GiKqzG8+0vcvrwDok4gsxIOFjs2E5n0ffHnhx3Yc12K/SOgQUW9u/YS/+ADUcNmRQ+ouiIo0L5agTxBb+C6QHQ==","signatures":[{"sig":"MEUCIAKFZQETpSiTAem9WS2RYhwjUO1g6oQ0HtNMSciexJtBAiEA14Mq30ikq+V9tEEOkAaO367uPofQh76GH8VzrD622W4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":152627,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi1LNWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmodiw/8CoL7cHIbkpsPHhsabN12WoroFcNaow9mN9ND4uaoyXkf4pEe\r\nUjaa0Y5E/co2XNzEhR8PsfhXet3uUnwcCt9UHx0a8ZB4uXWwrCVBrGVgxAG+\r\nVVwzRa+8CQlpa2OaN6fn6DrcUDJ86w/Irm21fDhXtpkRgDZvFMfVMnMxtKJ0\r\n59cK4pBUcnyG6lPjmEzTzj051GPayWJjoat7sEPtW1H0hVs+LMlF15R4DKqI\r\nAvDEd6oF9ABtk/k2sU4AV7bjOCH8AAbgdhWCN3e3Tx/YxhUq3np3lNvdW1De\r\n2aVAfRVTgtE82/m15v/u4YVqxP36YLPkz7S/Q8ijzuDaU2JfLMqytbsDv6tw\r\no3BqK97ChBi4jdj9SJxJbGbsxj4w+UPbQ/rFKfJBQ59IA+vTgvIxKjcjO30n\r\nkW9D5iYFyjVsS/+XiH/DafA9KI5AgfIKTfHNPRfqKNwcWXq2vFXphVt2vtWu\r\nq6gNMJY7PvQ6BwZ1qgqrh5ygr/LJFeorevH0yH8DrR9+jJAwYB7q/3JUR/z1\r\n8inocTX4L9X0xT1/9ayzepB/GHNUT4jG+Tc0kUfK9CHbQI8rbmQuwtX6RUA0\r\nthxGu1O33pMGwLKJt2Q3Y2OsHni1IHmQ+kV7j2g4KHQhuTeJxBZDeIjk0wgt\r\nHf18INAh91kvCXcGdz8loV0bFPsM89YE/as=\r\n=q3pT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4c30c64a5e6ac8d73e1a03d0da3303133f36d3b4","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-18T01:09:53.796Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.7","@balena/jellyfish-environment":"^12.2.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.8","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.100_1658106710479_0.9895694716264958","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.101-renovate-balena-jellyfish-environment-12-x-061eaf824fdd9f5c0d099bc3474ebaa6734b5160":{"name":"@balena/jellyfish-metrics","version":"2.0.101-renovate-balena-jellyfish-environment-12-x-061eaf824fdd9f5c0d099bc3474ebaa6734b5160","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.101-renovate-balena-jellyfish-environment-12-x-061eaf824fdd9f5c0d099bc3474ebaa6734b5160","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b4c30a2f6f7d4c373ccc59ec661530df7dd91c48","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.101-renovate-balena-jellyfish-environment-12-x-061eaf824fdd9f5c0d099bc3474ebaa6734b5160.tgz","fileCount":16,"integrity":"sha512-niwswiqtRp8skFm5spMTCSiPeUePyK+z/x9UvNg92LXNe/sZm2vlVUzR/U38bcF7hoTrsQMWX1mubcL1Ufr51g==","signatures":[{"sig":"MEUCIQDvtFWWD1rwiS7iHUVd5basZgUjEDrlF+aqlyFAADSVqwIgWlCJloVSuGrY4pDtd3j7cPP9KIY6Y0nKJxwp6uxdTWw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":152814,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi2LuqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp6gw/+JIBkBxGIAqvSSxZirOCsZ2EIJSJKBwB0JbIr5CYbOVLSl2Qn\r\nT3SLLx0d5ACJ3z1r/aSqp6UsOSaAFbQF2gqm+e4hCVnI4zkXcvisg1FQlgBZ\r\nMKXhGrnVqJGquJsWph+i8aM7CCPdgX4fXbhMbaN9kpfi5JGINNAklGr6GsA8\r\nQixY9LJdwnLnrIevr1jBnUWZP0l48CtXsJ6g5hZepfx07Mp5Tk00ThvQkj4n\r\ncuPtSy1XigjTzKIqb247RKAa0gSwTExwRpZpTIStUh2zV9JWpF9hTYNfLL3c\r\nxdWXJGIAsvNjsngKNoGROBq1NVkyjcWdnZ7lHdR0bZrAGDqHjEtatdKGiaiJ\r\npQAKgaUjlCPxCCvIJxucvEWpDLYkuWiCwo3EIhhVrbMfm8HH0C8FNY+/eGnf\r\n+QPGbulwImLkpoNSRNKbHPILYpXDpeUQU3lcL8chd87dRHeqKpcqGS7QTn/x\r\nbyyGV+Cj5mSujusezHllVmWs0MlBxzJE+waFiL0iNuzZ5yDRaKxhXlZTiOGl\r\nAJ++ySc1JSjPfRjpnsGykUwgKgvBb7zEDN/px3a5sRPhB2Od8/IzzbX3Qpnw\r\nQGiiris/1EscZdqNwJsJ3z7qRHpwPtlnoBn8hTQR5ZM1FnjOuz5QSzZ6uSdA\r\nOdFq+ptVTmirP77v8D+buAQTNX+bYRuItkk=\r\n=sEX1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"061eaf824fdd9f5c0d099bc3474ebaa6734b5160","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-21T02:33:49.466Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.7","@balena/jellyfish-environment":"^12.3.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.8","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.101-renovate-balena-jellyfish-environment-12-x-061eaf824fdd9f5c0d099bc3474ebaa6734b5160_1658370986544_0.7383793397162772","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.101":{"name":"@balena/jellyfish-metrics","version":"2.0.101","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.101","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b4fca614858cad8bf9b7f324053d4136079dae7b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.101.tgz","fileCount":16,"integrity":"sha512-D/oAE8r/UAG0ewrhtaDMe4Eidb3p60fkiGBiIUrZb+/PzJ0er9rk2QIIN+Sc3jgjoYSZz8wOIsLymZtQ2Jq8qA==","signatures":[{"sig":"MEYCIQCISVG9pQaeb5XIAKAi9HMpsODsMHZv/n8a5kdvoQmx7wIhAL2GPmhqk2RIZpBIl9J+ZotQHBy/EDPx6nKaQBUBOG1Y","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":152730,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi2fR1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoRsQ/+Oe/khg5KwMA9ItmwZN0JAMv0SFxnVjGfLfoMjkOG7mWLqcHK\r\nJNLIoUsCgPT4rtKfQvzsDA5oPuKruRTfeXW/B58ysYw5RHKwBmX1l5vmNGKk\r\nbKPDz38Pn7Kucwyn91ONtrWuAXZ/8AD2eW6Y+T0olaKQ87Df89PspkQ+Gp0s\r\nlAtsoySLrCK4h620ZhnM3oIAQPImIYfx8vboseICeeZut28CZ4Tc8N7E1l/D\r\nm7Ahkgtx0cPn4xdrPUyjXxvVfoIrzDUrVQ7B8oo9JuQVA7ng4aTmogXOTQar\r\nbfatD6R+ROugj2HJhyYTDqISNMFIweAgGSLVV93bxKuySr9WyzDhFNyamDI2\r\nHFPxGSkkGckqN9f4DAZCMsOjdFFjSLbkrkpvEL30uKSz1IE6JziYYf7f9V2n\r\nvqsCT39GSiGQhYDt7LBW/MDWq5xQOaQuiscT4x0TC4aH/m0rgPqBRTI2C1/a\r\neiR4BWTf5XYH7eapPDacQs+nrr7unGYw5kq6KENcHmxEdiyaVLnG/KT66faT\r\nRZOGt90F/zg/Q38MxNoe4Cz5I48M8tUami6OtePATP5yO0tjiKVkSwAxic0M\r\ngdoZ2Eku57J/yBoitQTnNszwnNMsO34ICueMpU4wL3vnAfV8tPoOdZdLRZjM\r\nJm3sVM8UO6SZ8dFhn7YjoIY4jimUzDFBW+k=\r\n=byBs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"44d7238fdcef214fcc08dfceac31f7b6c4aef4c9","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-22T00:48:43.456Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.7","@balena/jellyfish-environment":"^12.3.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.8","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.101_1658451061623_0.37744158005928785","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.102-renovate-typedoc-0-x-70360123465c46d5ffc0e5174efaac32d195f72a":{"name":"@balena/jellyfish-metrics","version":"2.0.102-renovate-typedoc-0-x-70360123465c46d5ffc0e5174efaac32d195f72a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.102-renovate-typedoc-0-x-70360123465c46d5ffc0e5174efaac32d195f72a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4e7242c94af2d385693a2f350b06e79ba26b2902","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.102-renovate-typedoc-0-x-70360123465c46d5ffc0e5174efaac32d195f72a.tgz","fileCount":16,"integrity":"sha512-ShT7hK0r7fgfL6nJPU+FSSk5c8nIiASmSG2fbhPMsGwLkcBle8D9J/SVuwNnHtT01tFZWV02jKXjkx1+dNFWnw==","signatures":[{"sig":"MEUCIBlKYwO9D612GHqEGrFy5jpegFhFrH8OJ47cPLAeuaUeAiEAksom8gyBYhU3l1PCvBe8OXWHG+qLnRUdzeWsbIPaU0U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":152873,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi3cBfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqWFA//ebM94GzHbR3arK0dM3SLQrVBQn7Ez4kBgjWrm6AM+In302q6\r\n9jYGiOcXQTf6Mukyk58JuoPu1SJ9AoC63zLtL9QEIIOPyvPFiiTCZFxoJ5P9\r\ndZCI6avB6673xOfEdQHYj2Awhl86F8RrKbs1LA6l/yGfvP2i7pLUys9wTVcr\r\nTFAUqUfA9iZZU70E6gdQNyIUQ9QSCJBggLSkF4H7CuD/nmpAZzStJ1zL7u33\r\niNynEoZgw07NyIzlf3o2MFaSwmdWv5GXP5wUnLbaRBpqz3gMZITtnIZrKDXA\r\nlYAASAPoAUGDMNygdysO7ZOyBkQzf+Noe0Lnr9roYmBdE+G4ai48iXPL3nq4\r\nZ+UfxHZw0+T5J1lYb2Rg4fnFs4DjjZFZd0GE0IFiWiq6k1BHxzDjbptTsE0q\r\nzwPvJdqJpWk362DLVkqmxU4zEp+a0F0PZMgQ4WW2L1OC02AochtRXwY1GQPu\r\nAAPQR0U/6qsn5SqMli/AtUH/hrCH22ChRf2GQnaaxhoXIWNM6PQawzcCDmsT\r\n9+Y6Kkb8DVTDEdcZykvXZt/INLINyduvkowp4y3jzNMBnSRzzG7LCu5SkZFT\r\niNu2rj+JeKIZFbKJ1l3GQZK5yrDHaQ6iw2wl9NFuUaS0gcwWuPqmTdSJK/yP\r\nacpXdWn9SFFIPYp7fq0cULOwGlJPQC95PQ0=\r\n=TtQB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"70360123465c46d5ffc0e5174efaac32d195f72a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-24T21:54:40.190Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.7","@balena/jellyfish-environment":"^12.3.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.9","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.102-renovate-typedoc-0-x-70360123465c46d5ffc0e5174efaac32d195f72a_1658699871513_0.0032798043047079783","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.102":{"name":"@balena/jellyfish-metrics","version":"2.0.102","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.102","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5f49b3bb627b00309196f7a0f086475bc4dd06bc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.102.tgz","fileCount":16,"integrity":"sha512-Q5BYwTOOjibWBoIlXpfaQ3DMIq3MNf677JDnUggc35dv1M1tdeZEf7f9LiQFU40zDA3LQ4zLsydsngrorw3YZg==","signatures":[{"sig":"MEUCIQDZD/g6a5HrnCZSCggedtANlB7EzeOL0eOm2AdyJxLqHgIgJs4PogldwG+Swd3DTHdBWxILR18dIAz0bpiw57oEfvc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":152811,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi3cFLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmokig//b2mg922E75dt52yqOjvFth1snSCmJ51iDPEKR5IbojKLxc7d\r\nTKfaZTaGIcMLy4JSx5F6FgKGIeX7WYwGYTmanz3bPevHtFLgW3//FXpVTsCv\r\nIDddcYe8SxKL9lj1EFpicgk1e7hUl2nMbTaj6LlSAsz8930wTcIMYtYxFdAy\r\nBYmkDAiVGrIwRlOm7t3FQ0Vj7E2F0Cv39nd0pFBux+O4yE0gjU8Ku3sYyuPT\r\nCqS4s3gmK2B71MTntHS33UDRSiaIJ025DLe+teJ4H+kMOl9jO/ykCtafhn9U\r\nbpgiqp1uNlGcyOgd7fCzvnohRFF+SV1Lu2Jlz+zXBjWuvXfIe8Tp+IKKm2g/\r\nfuMveO7P4gq0F/z+qy+ijOLLavoqf5rb/MjBPMIiV/N0CBM5jDrdLElcSlRX\r\n9ufQKW2nrrQ0ZxDYvmqcErI/0YUolsNZt+gXqMppfWa5VbS6JYVxNn7tHDVi\r\nGzLwNSUW4ym8nOMnwPCXLx3f2LAOHb9lH1zMStJ+JiBk/t5uBTO5hhtkyapR\r\nPFDP6iD5FaZo7aRZXDPEqELtlq6gYA47m2hv0/XGSx5EnF39vbl5Y6tKbTYD\r\nCtvyO7GqOBXur33GOu9CX8Ib/ZbH8mdeoU0LU3IK8XG3QC+BR+c9d54nnH3E\r\nlfYhkhoF9Hlg68P8yZC4tP6mrlUnAnKkncI=\r\n=xLdi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c147e1e322451d8a6c3ff019bec6cfff8dc75185","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-24T21:59:35.235Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.7","@balena/jellyfish-environment":"^12.3.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.9","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.102_1658700106738_0.2286240492054008","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.103-renovate-balena-jellyfish-environment-12-x-b05b0aca2386432ffe821ff37967f1a42ada87f3":{"name":"@balena/jellyfish-metrics","version":"2.0.103-renovate-balena-jellyfish-environment-12-x-b05b0aca2386432ffe821ff37967f1a42ada87f3","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.103-renovate-balena-jellyfish-environment-12-x-b05b0aca2386432ffe821ff37967f1a42ada87f3","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ad1800d369b72963cef704b74832430235f520bf","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.103-renovate-balena-jellyfish-environment-12-x-b05b0aca2386432ffe821ff37967f1a42ada87f3.tgz","fileCount":16,"integrity":"sha512-/sGJO3IgvqKPQafUuiqSsjBC+HX4BKncw+a+SoTFiJIDpoEm2dBoWVOiJ5AFnSZMysBY7t+OTaepZ+Bfmt3BZA==","signatures":[{"sig":"MEUCIQCkGWI3/0LyPoahJJSSgxZQ7rzAP3cq2OguAEolcSQfUgIgNYksAxnNJ9wbtKqFX+b36fMPly+yAIAzQVJE7FEz4vY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":152998,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi5ljZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpWzw/9FJIzrhuu56uyeQjf1k/tLcqjZl5PGgAYnhB2dPkLqcMH8/gO\r\nUnSNGhVyEB82nbB3n+kzHEK97OLyJBzM4/ACRrnkKHW1A3Ej8vr2A5sKHz1x\r\nTI2CQYG+YhXMvoiw+/n7AX9j3RKKb0TG65NtS9Xdqh75AI61dLkdKgDGj+bU\r\nylar3sT1DkTeU+RSoh4K4P+kmQp97yvU3YLAsxjbVQJLWg69Bd0uRu0LCqeD\r\nnFkf8S7lDlS+Bb1NyY2BsvRwIhlhscAh4Ofa/mPc+zwA4O/GxDfA8W1wYsJJ\r\nwiXZ1eR8LcY32XhjgBMulVubAJmIAIoloDvwFDNnjXk9kOGCpiO+JI6ulHmy\r\nHMEGWbHW3iycYZiDgpE3Ny6Lg8qLak9A+W9gqt7qRRRn+5ZcH0rdGBsK9t2k\r\nM5JmxXOkgisih/VaUt5QffmPjL6lm/p6iTA3Q3s8YytFlTK4u3Hp7bf0V+iV\r\naHa5YNnnDqiMLS2gY+Nl7O7FpYQCIPpOl7NSJGo70Uh/cTLl91ufxXI80+wb\r\n3bPc3aLtyFNwjPvxmKwRzYw6NX7f+qIwur3ILexE7riO58+szUBZE3ccc4gw\r\nVzslRvTnsWiiEhSHzV3MYQP9WAdbaUmmpO+gX4x/B9Zo6MoTYGTgwYIqqP1Y\r\nZKknnwBvg3F6y69txemFrSljBiiWfGAJgB8=\r\n=kF0K\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b05b0aca2386432ffe821ff37967f1a42ada87f3","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-31T10:23:07.123Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.7","@balena/jellyfish-environment":"^12.3.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.9","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.103-renovate-balena-jellyfish-environment-12-x-b05b0aca2386432ffe821ff37967f1a42ada87f3_1659263193709_0.8923674457247197","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.103-renovate-balena-jellyfish-logger-5-x-f58470c4d66ecdca9dda06e3d899ef0d60c4c818":{"name":"@balena/jellyfish-metrics","version":"2.0.103-renovate-balena-jellyfish-logger-5-x-f58470c4d66ecdca9dda06e3d899ef0d60c4c818","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.103-renovate-balena-jellyfish-logger-5-x-f58470c4d66ecdca9dda06e3d899ef0d60c4c818","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cadfb0bed079a4e764a6afa34faa7f42ab0007fb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.103-renovate-balena-jellyfish-logger-5-x-f58470c4d66ecdca9dda06e3d899ef0d60c4c818.tgz","fileCount":16,"integrity":"sha512-xduD8GEluioES3mzf4cdwU6VWL82FA+/B1LsKUTc1f8ddjpKxF7v/fPudIVp9MnG9KuyQQxpFbSRzY5KhD97nQ==","signatures":[{"sig":"MEYCIQD5BQNPYoxcu8+4AkKVW9npZM2LhOdBtQXgVqAA7vA2TAIhAKmdINX7xOg+IJrJ2nfDuklRD9eb8Z+GpETRsu77ntng","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":152987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi5ljuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrpVw//V2K9+FGvgkgKei/2Rdhg/fjZ2surS+RmKtB468BJ6N3bY33L\r\nnOYx/ynycdJaZ/CtD0em1b3fv2uzUcqprwDGGXExrP4BMBLm8TOIYJa0IgcY\r\nRABQwLxGd6DCw2/BP4QvrDa2r3cdmT4bkPlxsZBSF4aW5YT6IuYHUdEQGsuS\r\ntwOGp9TrrYHrKe3sT4ltrX4jpIhj+MeC2WlkLQIEcSxvLliE9nhJ3TMuru8e\r\nkB/QLLt/QGYoXMdeT6UiihwHLXJgK+mzgnnLB7G7QaErGyL0kknhe5G5TcP1\r\nELa0u7T0e/b/3sxVrwvKgAEOJlBhVNiPP6cRt1yeGti48VLnJgglesssffF0\r\noyJ9BDVb0qRkDLFHwRQJTTLixY4Rp0INDNrdEyBFLclakVLYz4xD+lEoyZIF\r\nyX0ibwEQTXk/iV57G033eMb/RhMF+svGeOcRFkUxO6dBWIbo3FtOU76LwnZD\r\nmYw1PovEG8Ti8hz8fFcsIcPC2lJisjsNKY5EkJ4/LcJTuiVebnh6pM8US76J\r\nGGk8MLUi4pKNO5Feg5WaWtLb6HhdGB1vc6zS9T0Cg0azQQs0PZ8R43TRtZUh\r\nOWEr145rJnlD++68vZ4fEK9H3TpX8qTQGCEP1v2OGV/kUtNtjOwJYrXZZQuJ\r\nggGmH/sr8aqAzq0Bc30EdR4viOLK9S+548o=\r\n=rUv4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f58470c4d66ecdca9dda06e3d899ef0d60c4c818","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-31T10:23:37.279Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.16","@balena/jellyfish-environment":"^12.3.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.9","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.103-renovate-balena-jellyfish-logger-5-x-f58470c4d66ecdca9dda06e3d899ef0d60c4c818_1659263214164_0.1718868049327793","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.103":{"name":"@balena/jellyfish-metrics","version":"2.0.103","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.103","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"747ddf1a49f43bf88e08c70fe232349234358099","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.103.tgz","fileCount":16,"integrity":"sha512-8//iysO6aKObtOHQdOt8L9YtMrIqbD2xJs+Erp+dDAW6HEIY2GiTzIOWOJ3O19pQ1LFdvhU3Fe9Nqaq/7ePdUA==","signatures":[{"sig":"MEUCIQDuWjWuOc5d3fb/FjmyBWej7XDcCIvsZPUVRrYWRd422gIgGmoiqx6727UzmBpsYMle876x071YLL/mK+vNIncwX0c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":152914,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi5lnTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoOtRAAoGVVBTx/chqQLePmmkaUdiRPNmiYuFLlzo9tKNgkVK6PJLy8\r\nf/i/qEVrU8tHP5KjvB54Qavg5/2m9IK2pe7IwU6oUM1Ae/kFn4leEO6DU3BB\r\nnYCkY4yGHmxXLNoYDlPcVxLCzrMvRbl4AKhhje4mZVMx/SgcA1Pq3oXFMdFL\r\n9VwWRPPUye/7A9FZ5Rx0+x2HCmxKNRs6X7ZAX1GkYV9z4DqDLUbzBk91DveP\r\nk64DTfMDcoRjnyHqBjvsVZpNnFeXwOf7Io2kXdcaUl/C/OfHp6j+PFRW9Hqx\r\n2JIF+5eNcBIWh0VnqXttmMIL1wm3tYgd3JRi1Qy+yp8b2jRaiRuux5NUPAFO\r\nhh8BimwZf28OtHoGOVIZ3IuboDEeJwvrG00Yy0NpSE453xm1Y7ZJMwGAEX8N\r\nc/5GE8xUVjrlSYxSb43v2HkboAIuyjyoBbyBpQHmqGLlC6iFwth4nsTKsnKz\r\nBJnxuDIzbQie0tErXYpo8TChEorpGQWQyQgZc6sPQfuFSGRIRaALixnPFP7Y\r\nF80GqyXq8y0Cu+f/FacTXtOIwm1PIGMeunakVJKNcpMw6ngL6EOdzUnjS/dw\r\nfryMJmaPTexBO1P44tGIHMyPoZ4L89AfER7MPqhWcMr7XMMMlc/QUzlaiGL5\r\n6wb8OaKFsxHSVApmDNbKuN/Ivd41XInPo00=\r\n=B4RR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"bba16d9306d8347a0a2380f8f2396d3e5cfb7346","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-31T10:28:29.655Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.7","@balena/jellyfish-environment":"^12.3.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.9","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.103_1659263443429_0.6509202726899586","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.103-renovate-balena-jellyfish-logger-5-x-d217eae3567163747ec88bae562d0570799660a4":{"name":"@balena/jellyfish-metrics","version":"2.0.103-renovate-balena-jellyfish-logger-5-x-d217eae3567163747ec88bae562d0570799660a4","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.103-renovate-balena-jellyfish-logger-5-x-d217eae3567163747ec88bae562d0570799660a4","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"35a6386dae987203c3c3f7745f1da9ddf9284ecf","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.103-renovate-balena-jellyfish-logger-5-x-d217eae3567163747ec88bae562d0570799660a4.tgz","fileCount":16,"integrity":"sha512-AVeIdvMW0uYKL8l5E16fc/IUlUR2zkigdwsadh6Y6SfJYcbxpZYiuMj9b9xIAYZCcfEZ0CP2HYK8C4MxAoOzeQ==","signatures":[{"sig":"MEQCIH6DzORBq/PiCGOsfcamcIJ7vlO24AFglrnqQ5i1osW3AiAU1UBsZOsGXIt8/8W+9AWef/uTas73vYmaUrmNPXQQpA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":153064,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi5lpJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqc8Q/9HG0MbCTI3fsQq38/oX2RY+Uq/CyaGtEyOeozTQI8laoL0o9N\r\nhl4ZiXX71AgzCYV27b9T16gJ++Hvviaj7R78Q5QxHfsZvWOfuihXwVG+57y9\r\n1NwYw0O4ZUvahDZg1uXHm2HH7KhGC9stV1x1QAuEIfX0KBZaZI8MJcpLodUA\r\nmXdm0M2gwRjWEzPBckFT/izv0G/6FMyvVtZCGoLx8iOIHWPNIJqFpqDPXznY\r\nVLH0WA0PbdGY7nzz7lzlnv9d6LPLngeZCspwy/51/DZLOa9MADsf8NEg/oIJ\r\nsqiGL43V+yuTiy349fzug5sBolQPDiLuUVl5E9/xGw2x8eYy6yq6FmgRVg82\r\nr1rV1MyuSoPK5MnDvxxp+l/CclNNTjKNDIGKGg2R2yGFHRAaixoVo8uy8Zmk\r\nFyyjAyXRIDPYqcSecIPjSFeJC/UInhmmWNAXk+GWkG+86czWmqetY4SlOeTB\r\nfO4/lyiVOhWlqo4mvNqAKvrP4JA9soFqXAv3+Of/XIJRp+uDuWbroxLyQo/W\r\ndGvdHKlprV5IsvDQBlxlscjb76Le1qwFzIbooeC4tAXEFwTpveomQ9iyXj7x\r\n6GC0Ed5lmtck5Pc7+tlrkklxMnRQyBCygYtJNMsG3MQ9x5FU5ACkCfiMcRw5\r\nhL6PvvrAe91tTAX5KcRHub1NEiFyb7vPo48=\r\n=Meya\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d217eae3567163747ec88bae562d0570799660a4","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-31T10:29:38.281Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.16","@balena/jellyfish-environment":"^12.3.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.9","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.103-renovate-balena-jellyfish-logger-5-x-d217eae3567163747ec88bae562d0570799660a4_1659263560939_0.9489011256418456","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.104-renovate-balena-jellyfish-logger-5-x-296b587c221786231fa58471c04c4069cde6539f":{"name":"@balena/jellyfish-metrics","version":"2.0.104-renovate-balena-jellyfish-logger-5-x-296b587c221786231fa58471c04c4069cde6539f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.104-renovate-balena-jellyfish-logger-5-x-296b587c221786231fa58471c04c4069cde6539f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"517c20d1f1391906e8290ce0abd10df8aca304f2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.104-renovate-balena-jellyfish-logger-5-x-296b587c221786231fa58471c04c4069cde6539f.tgz","fileCount":16,"integrity":"sha512-suF+Z9k2rJcPS0K2VMAXbac9gYdoor5OXrrQKjAoIUEK0DxNBQUnSgwXAZ0HHwSVYqFk6f5kSg6tYBBc38HRfg==","signatures":[{"sig":"MEYCIQClkAmxUj63RAOr6w7g7YTKyBfy4ZoDJCvWTM8ODKsGngIhAIsz4kWB/n1ci8QcvyVPOZbQZX+miYgRZmDsNgtlaqGJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":153090,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi5lr6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpcDBAAk6C490HGPnAmoL1Z+nmEZpeJwdsg0CFdD8l6eVJ7mOiX4Y1m\r\ntb5f66omlw85dntkRoVPE7aQHKX3AkUIkYmrvbVJ6mLe3x7QscmY5l8y+z9W\r\nS/X4wsDkIURo68gIh03367cBhjpFY0yaaYpz3h0LTyJ6eZv4uuk00isiTXsI\r\nKgPHscniu8hppT8pdqlTN/CEf/3+h9jk91ZQP2bJQTTREtxLJAM3Ctj1eDGJ\r\n1toZvy9R9OWGBg5QAMsvuOETKJCRX5Br4uM5dwnonxjDmqHrSVoG1IvCg2s8\r\nD66ltFk5Cat4CLAGfpbPaYfkDIMDLK9xaqqqIHzMZEg9aCz1Veh1/0rwTXfR\r\nVPE+fuqx0a07HBFZv4k24hYQ85DInWwg5z9lcos4w8p0IO8VMpY5gGFRETxq\r\nNNehwe+uZ4jNB6ZHA0qnqp18ACoy19JI6fVEaRTu/P8yxbnxDnOv3jHOUaxu\r\nfqVJDW4VBa0dnihN35zS6JWOt7BJHe4v6Wv4lmEs4Ff9g2ygzGlrVPbLWfvy\r\nbW9S3U545Nxx+P7MMcTdGeCUF7S/k+hJzOicnqx5eBmOLm/Loe3dhc0Q1xkV\r\nAVff8KalT9xdqIxkz8Bh2YJY1tlMHNMWoM5IYG+ti/nuugDG+2Sq96SWpa+Z\r\n+fhOu51af7MqzXXljl4vuCgJa+MnVHzExsk=\r\n=TztZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"296b587c221786231fa58471c04c4069cde6539f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-31T10:32:32.801Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.16","@balena/jellyfish-environment":"^12.3.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.9","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.104-renovate-balena-jellyfish-logger-5-x-296b587c221786231fa58471c04c4069cde6539f_1659263738505_0.030982586502348974","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.104":{"name":"@balena/jellyfish-metrics","version":"2.0.104","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.104","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e1bdd30b92ebd8a5ef9ac219cd2b66f335fa517a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.104.tgz","fileCount":16,"integrity":"sha512-KL2ctWib1z47ar90mVjTtPDXQdVwbFeLbWhnF8RmcoNqg4+lcQzMnQE7K4XKyC6svPsEuyS+X/BqbfZpy7oXOA==","signatures":[{"sig":"MEUCIQCPlMD8AEeQfsAa7hDoxzhuJWZ2+DI7+GgrYayH9jbKsQIgCiuPNvI6qxvssC7ta4gCX00xG9xww6x8NHeBMGHv5Pk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":153012,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi5lw9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqRMhAAi0JWaWsVRHj7f8/j5AGzTpKd1jmuNM1gCxtZitvPyqJt4KuU\r\nfqFiJFRZ2xQMWFYJu/U0PJ2iEyjWAMIF9l3R7+LaIx7Al244BlNL9wxYlRL3\r\nuX/CfbVfh7b0sBEZ1W5gVsKFVkH0V+7bGt7u8c3ZaxQDllR22AUP7/eD2y9p\r\npubW4NNxebinwB/koRDUEKTdS6YXNBRomG6j5/n56kaQu0b6rfcxfOFrhdy1\r\nncc+W+iUlbCxGx6hiXn8AnB73FBuwX35S8GD++Jvbymw9PKEPLqnBrKrd3Wl\r\nrzdzGfoyi04ffyDuqad4e6noMjVgZwQOg4PwIZr+UFnR+bXQpBUPPL/+/I0p\r\nPiCXEXr+4DLN/7nx6Mxf5SM2HjbVUwbBVYLn+MsD0Cj3uWyVqXlS0dEwutnp\r\nE4x3p2Trf+iF2k2zXTsxaC96WulUHwBGVfrvqDebAdiwYDkaUv5mywhhfZb2\r\niUVRnnSZGJaYqwIljowNMEaUeLqKFF/jIeUsnfVswb+NdTWfys5m+fxOKOgN\r\nvv7dHuSTmecwgTXTi5YnY3l0B8Eyr8CPMldGS4TvHBtV6DKekNQ71j4EZ5nL\r\nmADS1RNZPd8Wkl6cIu+fL7vZkS/AOi0YqVM+xl/O82nooUQX5DNXJv8jjSH/\r\n+deddz4lfsu6dNUa9Or+cuqqG2vQ6hzhUTc=\r\n=/7L6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5590cf79fc6f10489d5376d183c9195aa32adc19","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-31T10:37:19.462Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.16","@balena/jellyfish-environment":"^12.3.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.9","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.104_1659264060929_0.7750726068364333","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.105-renovate-balena-jellyfish-environment-12-x-6143e578d621ce976ac6cc081f2bf6c575377b58":{"name":"@balena/jellyfish-metrics","version":"2.0.105-renovate-balena-jellyfish-environment-12-x-6143e578d621ce976ac6cc081f2bf6c575377b58","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.105-renovate-balena-jellyfish-environment-12-x-6143e578d621ce976ac6cc081f2bf6c575377b58","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b0863617b3cf9d1deb631347ad64639577639a0d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.105-renovate-balena-jellyfish-environment-12-x-6143e578d621ce976ac6cc081f2bf6c575377b58.tgz","fileCount":16,"integrity":"sha512-yn4n7qQd3tDrDWiX0BvA3kzaftfyD0SrBkx0yXGP3vCZZe99cSe22A6/noCAGKUoYa9gp/3dZ4NtTNn+gmD5Rw==","signatures":[{"sig":"MEUCIQC4xzodSRiy/Ov+Sx1zrJkHuiB9ggL/04XsoO2kzVWf9QIgRV7KktKkBUxvaG/DbWi8/BMSgeU4RL3TqRS51+qvwwg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":153199,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi5oEAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoeFQ//Se9FteJYIV3hv9XSGn5fuAlCRzqSlse6JnTyeY2rSXwEGRsK\r\nl0FdYEwhys5OwqG8Q0fTETD6lt/U7eqT4yo4kdbnf8O9kzAJ4tcjzAqCpZAS\r\nnrmBXCp73z4X3KkDWddCJ0+sZdpwSuXtLfpP/8pWCb52RTasqUnmBdgOjgs5\r\nlOLXeo/Mrbcn/AAjs2vleW77VFtfxtTJOGCRgKPV9lS5HKiNGE89/Un0czUq\r\neYynuzq5zovWMzflCyW7xKzpj8ePLPJ1AoRdMX7HcrH8FMhRA9fFqqxGMTki\r\nVohHzlBJXPwuvoJj+dRlIAB2aoBsOyJAwE8Su3ERN8zrs5jWKMppjTy5twBv\r\nChAmjKK3XKmhRUOuZJ+2q2Vs/wVHFKvNXY5JbY8hY0aTbDKSvxpjiV5gK81V\r\njL1tujHYH5+uFnD5G8aOLGXThkIpyA0fR304t33lPW75pzBCJbGFCti2uvhj\r\nDrzBe9wZbDAMUJ6Whx5v4DA57hC35qFMmLM9CDoMD0BYK4qrEocM25BvMkEZ\r\nwfVYMmmu5z4jNQ0qWmWX1ZaLNDS5d48103OHsUqunZ82qll5JgUldpZbFyf4\r\ncvATHCxsLUCtdCPQA4h/dVuZxbDU03nnEyYZ7/w5bOKXCvO6o+oYA+b/zSSc\r\nkzYydg8BpQ0H9FJqikR2bJl8G6GjStTZbIE=\r\n=R3Rg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6143e578d621ce976ac6cc081f2bf6c575377b58","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-31T13:12:11.859Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.16","@balena/jellyfish-environment":"^12.3.3","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.9","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.105-renovate-balena-jellyfish-environment-12-x-6143e578d621ce976ac6cc081f2bf6c575377b58_1659273471859_0.0068546452445152894","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.105-renovate-balena-jellyfish-environment-12-x-ff49578ee3c3f14c27331dfb769a0d4f37f78514":{"name":"@balena/jellyfish-metrics","version":"2.0.105-renovate-balena-jellyfish-environment-12-x-ff49578ee3c3f14c27331dfb769a0d4f37f78514","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.105-renovate-balena-jellyfish-environment-12-x-ff49578ee3c3f14c27331dfb769a0d4f37f78514","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fe2f789af6ab2629dcd33938c39894e344a995fe","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.105-renovate-balena-jellyfish-environment-12-x-ff49578ee3c3f14c27331dfb769a0d4f37f78514.tgz","fileCount":16,"integrity":"sha512-xFwpVPV/zvLvDO7j6vjI0CrXStjn2CzNDERX+vJntempsMK8QkyD5Dy65Nh8mMwkoNxytk0787YXpkc0NIw3Fg==","signatures":[{"sig":"MEUCIEMrxKxeTsU7SRIeYc40I9f5Z/Ps0W1dBnSYfyj0ukirAiEA4upRsOS3yCGw2zSEU0h4VxU1EaGLB/thhKfTcvLvZIY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":153276,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi5osqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpPYg//W3sVzcpDBQdmpJA1uFvSAucwOQz19UQkMdbWyUEccv6U9t6w\r\nC4zTOQrGviexv0AxP5m6CQI1zp266MEC36JLVqjCaP46a7gAZPzqNY518dQX\r\nFNv5Y0WRV3BhouOZaf0JJFJua7GpMqIsYZDHpiAUyufEyIuvyp0k38Cy3EGO\r\nC0uAP3luLks3SD9Ha7H3Sej9lxidEij58t67yF5ZEdGqDSZbTEXhvOJJDMzi\r\ncQyj7zvqdEFzdBEVTahgI6DNMnCiTt2bK6DV8lYxuOBsBXLgXD3NHFRAbz1u\r\nVGUmA1NQxh0ayTL8iKVLd/J1iRIxuf3ewqIFkVfvtFUySxbZTuBwz66XgNrn\r\nH8rjUTywz+/yhI4bIHfZsYM6HbARJRniT2nbLjsKDPFOLNBR3hP8Z1uet6lR\r\nDG+LvmxEKiFibDIYkTpyF5/Tzm9nFi/YV5zNNRBYWBTh8H6JoBAiZFbjyigR\r\n3yeg/SfvJ0kc31ByYzO9vtv/kPpqAtMH5TVBlL3AnHSlDBh8TmPD4yd7Idjg\r\nBYaXl/+hVUD5fi+KkljkB6fpClV4ZbXVRu0F+sAeKzmEzw5YdR+fmifdqJ1Z\r\nGt7bhRsd98+M1jtJwkGkQSSd6URrfirKFdAn9ZWw1p0DTF81dYOYiaW8vUCf\r\nrwv9OC9DmbefclxYvrJ1PcRXsXWyLu1oxp8=\r\n=Hv0u\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ff49578ee3c3f14c27331dfb769a0d4f37f78514","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-31T13:57:52.985Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.16","@balena/jellyfish-environment":"^12.3.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.9","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.105-renovate-balena-jellyfish-environment-12-x-ff49578ee3c3f14c27331dfb769a0d4f37f78514_1659276074007_0.11162196701741434","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.105":{"name":"@balena/jellyfish-metrics","version":"2.0.105","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.105","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f7b898f726ad735370523a988944549484dd4ae2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.105.tgz","fileCount":16,"integrity":"sha512-9lmcEn+zoLNRUyv8CSo4NsdvHTBOZc+/mzEZGgxGQf9/GMWxHem+DJbHznr+os2muvuQ8REynKn8i+SXp7bmTg==","signatures":[{"sig":"MEUCIA3izkHuMt+MldaLX+U78AK12KEFF6Ra6DCb601DINe2AiEAmiz5KTfjnO0w7njDoZMFQlUsyvLBO24lpLKDNQ+tqGs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":153192,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi5qojACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo9cQ//U1yHLvybNtgfqJbSYOtDkLjHgSOHGGDm7yT4VYoNdBQyE3wI\r\norYUTK5nZO/xkPrRKmDXkPXqVdnniaCibjQw55b89WIgv3c4EPfwg0jx8Sll\r\nefIv9I7Xfb/uOaWmukz4Mlk/5otfw9/nyNP3fmpv4HUBrw4dz7zxuuJoJ/QW\r\nI32xcNPMjTLZZSzikfhBv5guNM9epfPVPM0kR07Cr6Y84octx4m2Z5EP6iuY\r\nl2DgVvn/P+3V85/lKxmoGYL9s7yxiWkl6zE9MHRkYtZW4AmFib5Jqo0S/4+o\r\n+euLjUAbdaDxA0BcWmPFrhJQuPrQ4UjOOarp9X44i5RBS3LH0+NmkN+ebBTr\r\n0HYu3P44RoblyjwxY/88OG9ocX++ZQ/9hMS5N8k1li4sdL+x8sqFJ5zVtLRz\r\n2hL4Ih3HQiMgp45lUBuccAplfhJlmTaCEacSLTYwFO/5V2SE9F/5e/3GCeIV\r\nuRklJ3q1aFREKzBnTp0n1u9V6Tayq9aT9c2BbEw0kQ0//HWNIECuW0qxqbrM\r\nNIUFq/PzoHl9Rd0dsXefUdSA4KrbRPkYJ1wYGWrTRH/ve4OORCA7GGOQqG9G\r\nsjbWv5NdfyBcx/md3tZq+fk6dBq7ytI+z/goFDd6g8pWaGJ5dlTNM6uuooej\r\nRzqVGq3akx1VyfQiq8l/NGTSIHdgvZIqSys=\r\n=kX3f\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a5fe281869e67763a713b776ac3b21b22727c39f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-31T16:11:17.304Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.16","@balena/jellyfish-environment":"^12.3.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.9","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.105_1659284003405_0.9855460225282677","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.106-renovate-balena-jellyfish-logger-5-x-60567bd70a8358fcc106587178eeaa44c8eef084":{"name":"@balena/jellyfish-metrics","version":"2.0.106-renovate-balena-jellyfish-logger-5-x-60567bd70a8358fcc106587178eeaa44c8eef084","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.106-renovate-balena-jellyfish-logger-5-x-60567bd70a8358fcc106587178eeaa44c8eef084","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"06b11c8fa4753da60fca433ab98d9c40f6bbacff","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.106-renovate-balena-jellyfish-logger-5-x-60567bd70a8358fcc106587178eeaa44c8eef084.tgz","fileCount":16,"integrity":"sha512-bUEQQotj3MIrtO3aTeuxVjdPXr+h/HONEFeTaWqGa5+DHgfOT9qps04S3DrdeM2kvR9t60xra5Rml19odptTAQ==","signatures":[{"sig":"MEUCICS4ZHJXzEdVKyL5F8wSi6TV8Q4xq01/jchNGzuZemJ8AiEAmN6qINEv/iD/VEU5Ca/Jhj6wf0/0FFTyrqFCoiwr/fE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":153368,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi5qrkACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmryiw//d/zR8nPpQ6enP8jvUkv3NrOeT42bpEUhFOBHzmCc3Ljyr5Xg\r\nYhgXWoyIVAMONbIKHsJE4DiKhvXWk2tPTxIxHEtNSJ/VBgIZ+4epqKCz3BhC\r\n94g1FURSlf5zeWDbuPUeTUUOjT3uRYXN7fbQJjvCEqQn65VuzyHaCQ+V++qy\r\ngj7NhG4IEBJXPtdeWrOdtCZ00eVZdCgI3RGDD5WAo6m0eaViWEmKziONE/d8\r\nTk+3XOmsjnSKhPk8riDIgFwK/bBR7/elz2q/qWR4aNFziNSB+bvUXfDv7tKZ\r\nEEWeobl+pwcEm3iHZx3ICKe65PtF/+vZg3+l6ShvoZVRR+qvrgL0SRASDWp+\r\nXCGEcYIsmKuZWHEv1wAREmnSSRQRcN7j/MR91orhUOVa0CCQxIva+Zp4CzMt\r\nWpYzOCR24vWv6219QWEru+WcNHQ76dbmelhkGfmK7NV2+l10ci8GOanmx0pZ\r\ntaX865CpvWY5P0b5ViylibZ8vUEFT+pS5imS2/B4H5j4UTQsOwWkhFOufxGN\r\n4Aq/jTmGOGoehJ+LTrjd6+GNWyXN7vVyrPdQLSTby5Gs4m2JfQuMw9DG0Vi7\r\n89A4fTwaOWdzdN1cstYzg6nX6fE3EAMzJNR/tHd7IyOsbgiGWlgaiR5AzoFx\r\nwlqBK97I9LxhCDnbFbRLI4qtuva1gle/1xM=\r\n=1p3f\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"60567bd70a8358fcc106587178eeaa44c8eef084","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-31T16:13:42.810Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.17","@balena/jellyfish-environment":"^12.3.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.9","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.106-renovate-balena-jellyfish-logger-5-x-60567bd70a8358fcc106587178eeaa44c8eef084_1659284196607_0.9141424171224954","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.106":{"name":"@balena/jellyfish-metrics","version":"2.0.106","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.106","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"319fc31b461a62e16e6748c0136e85b4ea5bd1fb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.106.tgz","fileCount":16,"integrity":"sha512-ygrSIoW0Rt/1avQSPqEqYr3AdaEEBMJbGzYYtcLgt4l9wAmKcbKliZQ+r+hPEoWsd1sAFovKqeZNVSDNVCb9UA==","signatures":[{"sig":"MEUCICcshDGaCmBKjrwu6cFOxVsOb/jEVuT+6HmfU+NKqphfAiEA/FiAraYaquBUNxXzSSbjijgr3VPHGQUk4igzVmuBFb0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":153290,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi5qvMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqSLRAAiaM/j2LPq4dYo8t+wuXjV+HPUZxDMpYS3ZdSsD34TTWlP6KG\r\n6MV4MUn1LOdOrj+9H6t523cG6vF7W3CT3zhlD1daFX8598MGh4qJCqy2jL+l\r\nGDp2UwG8qBl4UYNrlOc7FcrvVUdr3/WyVCHiqrnktd4MbS8+U1LUsdo0Gnbg\r\nGQ09qA/nNPM1k07v5tKAgcwvmi1X7VPu6eniGG4l7qgg4fCajJtUrGJG+KVB\r\n+Mfq4bx3Gr9YkqtNKp/HVTrOzza7SmKFelMpty2+p/Wdn7P9A0L4njq9oHJQ\r\nfsXpJqoK2U3KiB4F0/4DaUEleKKaikZJA/xFPMG7CngwPuq+lVqefoIZLc3z\r\nvqqmjqh0Og3UuOT8NSjz6QuRHwzHox/4tg7J4Jj7hUtrseI8CXUJp6FVA6kf\r\nUCK7BYhusT7n6J1e0qz2SEDQRdLtJG6HCABSbAmm23P6pthcPDQ7Ew8tFDLi\r\n2Hk2v/aOZNRpNkQy0eslv7Z+NOlaqZmnZt6gpkh3/6cMGT892hF8+qb71puO\r\nqboiOSA49QQjTUHZ4Z2Nqo7ys4BAQAttaLFovs68rnm0VZpmrW2T65SzbnQn\r\nLNEXLX+MqRX7vBGhH5FBGpcS0XJIhFgUQKy20OY6914Md2G3y86YHxGHvEFg\r\nfH/RomMU/WkffrlUUmGWdlEadj6tezA/kPs=\r\n=4VXG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8cd04fe0e651b2d1ad0b1ca78ed425f7c5800ce6","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-31T16:18:36.744Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.17","@balena/jellyfish-environment":"^12.3.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.9","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.36","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.106_1659284428249_0.6253726133764754","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.107-renovate-node-16-x-9deefea881cd9c70d201ee13c31a4d519965f106":{"name":"@balena/jellyfish-metrics","version":"2.0.107-renovate-node-16-x-9deefea881cd9c70d201ee13c31a4d519965f106","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.107-renovate-node-16-x-9deefea881cd9c70d201ee13c31a4d519965f106","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bec01875166c934ea9d5435dcb21f0e63a864846","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.107-renovate-node-16-x-9deefea881cd9c70d201ee13c31a4d519965f106.tgz","fileCount":16,"integrity":"sha512-NY8e1yqHCoimA5hWCZmg2JEj3kNj0IROCFHbuRoUadwpCxpGHz/JoJQvXE9UF1Sujd5hopuJHSrSwqX+YTrmJA==","signatures":[{"sig":"MEUCIQC2iQli79p/Yuk1PgJLk3DMwedmkDjUoNSKhBAuPgtdlgIge6rEv/OjsITQ8dWcWCPoxlWWFLyKHhtbRop3nqOCBRk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":153439,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi5qyJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqLEg//ew23XIT1P2+e6lwRpKr2mf8Fkqh7Mtl0ORYE4Wk+yF61IPxp\r\nQvP963v8XjefIArSy71XvFgRChAUuNdKvrFueSN5g2sBEEz39yhQSbKqGM5o\r\nSqHhsluklNDj00yuqoboTXi+EPJPGs46pqH40zIYEv3PnDcVMO6QGB2i+ObW\r\nkf/dAw5B1VWmeqAC7XusBHAeO/Nw9VEhc/zFPXEfQS9wOdb+4YM8qcSQJPIz\r\n4UsDFgM13NPcdfuO8uibCwnHUXCzB2u2V8NZvNC2szBx62fdscDeiGiGs4u1\r\nUNeGlcF9VJgHUN5m3SxOVGcWGGL6ubWFIwhyw30tXLbwFjEO4u9GUoqFuJHi\r\nmDg+Hdtiz255Hai1+UUfQAVUSLG8NHHkztUXi5TFwtOqxP+9865rH6O4rnLm\r\nyHEZALj0Z/meOY0UaxdToss8QAYnQ/0fCOtzXLz/iaxYLNvlZ9MO4sb1C/vz\r\nuZ2xIt4UITYbMnsmY8ZWNB88v8+KhBR4pmY0CkRa5WFvRvQXNukJnaj3id1/\r\nCPlGYRCltr68+KlNo3RYBqvfIZM3+57J3DpAssR1jMGd0C12s9LTlf/dsuo9\r\ns6gzc4zeuPZ8w+7tIM0deoNVkupN/XFoVJv1He3nvf5dzPUM0yMKr9k+3gfG\r\naXl7ARO5jOOpu5aJnVenvnwPCS6VHY9tNZ8=\r\n=TYeV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9deefea881cd9c70d201ee13c31a4d519965f106","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-31T16:20:54.295Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.17","@balena/jellyfish-environment":"^12.3.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.9","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.47","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.107-renovate-node-16-x-9deefea881cd9c70d201ee13c31a4d519965f106_1659284617205_0.7499844629540804","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.107":{"name":"@balena/jellyfish-metrics","version":"2.0.107","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.107","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5d4e0a9ebc209102a4eb9f6d9f79d5dc6eb6dbf9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.107.tgz","fileCount":16,"integrity":"sha512-34pEKRvgRxtgADJ5UFDCSm9McKIKktTAGJJn0j+c5pEIAxiQw/IV7BHs65BvAbaJhOdSC/zE+rdWi3tsLGCRcw==","signatures":[{"sig":"MEYCIQCtoXSJyoW4SvWiIjjm+gHRfzoOlnI4sajbX06skyRqrQIhAJIynRTwgWUeOk8hpWzpWM0HiUgDdn8mqOTRFQplEt/l","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":153379,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi5q3rACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqlUQ/8CZ2HbxNwqi1nDieJ+IX2R7fHa0ZrS3zp1kh3EfH7Ml7NLI7T\r\nE4HxgQwfslxoFa904/zvCwrMJUZgxqXAMhc5Nf2mhtqL9q2SK0+/ed3yUQPd\r\nqim7SNsBLBoXxY1QPa3cYGn1Hcn+YBGyBpQf9KbKeDtkCHxS4MsBgcPPcl5v\r\nQrMn2c1t+0yeIop86irYFDenD2wM4AxfTdyiPo5XCLqqO+UmncfWtYfaVjjv\r\nPWlDssiCnZyck0KhuoN/PzG+zsgmXpQ1blpo4viOwK9gJ5RL25TgSnjhWIYd\r\nckvIot4aTd1HvTNGlj78sZPaCwzi0335soppPIGBe2iUhnCgQVbcungsqgM5\r\nwHh41ONWg3CA3lgEBzIQZP6nb1jdy1FHcv1NQRhNpbzF5ReSjl8HXXtEOelU\r\nOrVA+8jleB3b2YBjjc2267qo8TUo1SXH5lWzpdMHnGoxz/GASwbwyDGIsFpi\r\nT4W0eOy18COr2tYaHHsKbS4AygJvt4Ogp7X9R6werkaBs2hSlsXOh66wH3AU\r\naYjoij9B84VlA+iIXs0sN+jzwaWPbC6MbbUj6fxfUvr0B4W0a/n7M+3v39iU\r\nvL8K6zoUvSms3mJgD7QtZ79CExYEA1rTiqGeh6TGdl+53/FAMjUBKEYqTUqw\r\nO69rMB1Fi9E9lLss7FNJGLN9IdWWoBvV9bM=\r\n=kWQW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"423cd6064282753adf340e4cb751ed6869ec0465","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-31T16:27:25.130Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.17","@balena/jellyfish-environment":"^12.3.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.9","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.47","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.107_1659284971401_0.17101092583239574","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.108-renovate-balena-jellyfish-environment-12-x-a4c4827a9bb0d4718d1a87c2e75f548ab61eb98b":{"name":"@balena/jellyfish-metrics","version":"2.0.108-renovate-balena-jellyfish-environment-12-x-a4c4827a9bb0d4718d1a87c2e75f548ab61eb98b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.108-renovate-balena-jellyfish-environment-12-x-a4c4827a9bb0d4718d1a87c2e75f548ab61eb98b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fb64c86782916b8e3aa2fda35ec9e5326da337fd","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.108-renovate-balena-jellyfish-environment-12-x-a4c4827a9bb0d4718d1a87c2e75f548ab61eb98b.tgz","fileCount":16,"integrity":"sha512-DnIGRhQvlik0vgyoLiVQRkOeInQUCn5+5vhc5KtUyADWH2XmZyAV+88UMSrp+oa6Nc3Ibvu75k70ax+gzls7fg==","signatures":[{"sig":"MEYCIQCFYhEbVDt+HzPw7qbWos7NASSE6+fhFqtsGhS+dwYM+gIhANIbJRw1uWFYVjPSaDDEX4EOFbDx4hsCwoVqseuVkGin","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":153566,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi5s+vACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmogzA//VTNHBPwz997C4nrfUog46ahLRvtEK9r7BG2FJ3UcoH8BJCYr\r\neMeiiVcyhVspOGyEvwHoem6TyqMx7pGkPpBu7KqfZA9qNEQBse3AIRhtGsfV\r\nl3uZaL4+sanRFLNI+ZaFofAGkVkNyRWUNBoq7FBT7aMMGQK2x7cQZrnFA5sK\r\nzimcbWk5eSbDegQ80qQXXNaloJ8U6N0+RtKPXqnEtb0EUhvKIpKpXiNBIT83\r\ng7DQKXePoxJhD/aae8/zYlj9ank14BjJrMOxE9mtz4Ol0kilPYsMOhtO4CAR\r\nF2JhOWSx+FZU2ubezU+8ApoS3lqnyb+lmBXDP6G1g4ba3PhJrWvQsaobPWUh\r\nNIbXecsTBjA8X+Kok7etBwkKxIOwYndruCm2ymHpJc8g+H13buMRL1T/qRIb\r\n57agZ8tdEY6Z1Ym/SMYciETaGQo42/XrgZKsguxUoqq69bObNRQbAN59N5wc\r\nyTKIQemnDTQfahbcZLlpFpB2VpsUuxK5uwzQvnFvq14aHlCJrYhHeC5i0qVM\r\n6BETh9G5UDOJrMvPMO6o5JAcImw+LtsY+4h0MkwBVDioO6bgkWV7H7t/d42i\r\n60uAk+0V5Pr9lE2UidrbIyoxdPvXYaceD+tX9OGL/c8YHebWsYKUMbYgdzu/\r\npR2ucAcK9JutoZT+M7LU9kC0PN/CEJbv4K4=\r\n=GNx8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a4c4827a9bb0d4718d1a87c2e75f548ab61eb98b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-31T18:49:33.630Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.17","@balena/jellyfish-environment":"^12.3.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.9","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.47","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.108-renovate-balena-jellyfish-environment-12-x-a4c4827a9bb0d4718d1a87c2e75f548ab61eb98b_1659293614806_0.38557717855379137","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.108":{"name":"@balena/jellyfish-metrics","version":"2.0.108","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.108","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"04604e3bb015dbe694746f3c20e73308a8da0ab3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.108.tgz","fileCount":16,"integrity":"sha512-4pWMniTTJYi3RmRaRbAD9WKvdJW/GTL0F7/49AafJ0d/aGEF56ttV3DPO5FCphUbvs7tactWDK2OOpPtYbwvzg==","signatures":[{"sig":"MEUCIAOlzHBtK4xNNxFqh73caO2kX0TM5F/XeoDE/DVsWf3GAiEAr0VSnuPMXbihLWDgzujY7qoZIyZuFNyG+6Fo7YtN2HQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":153482,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi5uoJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpsdBAAgE9dvjwMKIG/x8gP8+v//NczM8XE2KCunBYIVuzUnLlZwj1/\r\npVegCnpj90ckZxLbf+AjpGlOGhTw3e0IsaoD1+3stxKPSJYOZ9PrAcdZIiiI\r\nCoMMX1AmLTU8nKn8WlBzcC2Gi6UTfWSbvTmMTKxjxA5VbfTXK+X29VMs7ib6\r\nCain83OZ/zqywnNGpJXfnuYqQz8nn63z6VqgfRZ+KNWU9Drt56mysigKyQJl\r\npXA07XOBBpqr8wiRi1AmFcSPLa3SA8CZPSDrAJk6vjVyBEz97Z/tD5aGX/nX\r\nN0DUwttQy2rtieOgxWsrPRx60FnUR2fAZU338V9TYYyuao6rvqZMp3iIjbOz\r\nXsjYie7PzQcCCls5us33Klb/jrxS2oF7bS1fwR3yraGPm/NRjwiG5k5dyi3N\r\nKLyr0FMCFcYPP9Lpo95q9owrKNsxrsEZdFA/1SygZ1lVty97aZrdhkHmiwGQ\r\nkv4VQwx22qLfmJJcNS3uEQjHX3gxenaYUoiq4HyIg1+E3sks2RI0FHD6b6J9\r\nWBtzhwYSgEXn/flbGm5zbtWOiMiqwSp04T2vrnwkBjde6ipUbs7vXICf0PCs\r\nljj7gbZ66hVsyU+5stofxbPzH3C98qXKjk2sPDCEv2aUuCVzvjtWhxg+RKoz\r\nwXQ2JIPK11iBUex2lWagZ96Ch1k7d8BW0fE=\r\n=+9p6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c604e8443898846d5b18881c6677a75c0cc572c1","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-31T20:43:55.537Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.17","@balena/jellyfish-environment":"^12.3.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.9","typescript":"^4.7.4","@types/jest":"^28.1.2","@types/node":"^16.11.47","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.108_1659300360707_0.39943538502831766","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.109-renovate-jest-monorepo-afc51e998dd6033fa2fdc11dfb87eb8502c4f12d":{"name":"@balena/jellyfish-metrics","version":"2.0.109-renovate-jest-monorepo-afc51e998dd6033fa2fdc11dfb87eb8502c4f12d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.109-renovate-jest-monorepo-afc51e998dd6033fa2fdc11dfb87eb8502c4f12d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"89ab8797e047eb69f6f3bf65ebae4ae72a87d139","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.109-renovate-jest-monorepo-afc51e998dd6033fa2fdc11dfb87eb8502c4f12d.tgz","fileCount":16,"integrity":"sha512-Ht+gAw7hTSU+g86P1cXvZah68hEyqDFswVco/+2maXaktgacFi14dwi2ANRFu+iDNQMbOPVzpf7FEpSTfUvDdQ==","signatures":[{"sig":"MEQCIFMGbIep0gbkGm/9n6D4OwxV8E0iy6MFJr4jf74PGB1JAiB+O5SDxQCiVOwB8krd3I8Y4KKc8LCUkoFEFHyG4iJoRw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":153611,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi5uqjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrOrg/+MGm7BIIPIqfqkn8s56VjAC9o/Plko2CKwDIwkgiJk84a8NPk\r\nBDBO6/v9rat6FcOJSbcPJgK4uNtZ8ssITq1KgZ2vLKklnR7uTqGkdMgPldy9\r\nYAITtKIfjsYCRuFO+uU2lPElRBgMhfxSSGujQelE114RMjA/PaWpL73bOh8e\r\nYcVPuyCPPJVzS0ByrVPRGO9t/TGt7T29cUjzW3eA+7ylFRs/fIt1JJ28hvvT\r\n7bqqEcd+KX4rqcUvFHCPMk8bdvZvJHswopJz0MfvhYEYwItwiKIGl79aKmoe\r\nwcNrcLqE1JllHWsXs/n7CX932lfgg32Cs0pENvO7isK/oR9VLWr8TfAI+wiD\r\nUvcCyQDjMBdAZi4YfPnMFs1dU4EjG4r8KosThP3TTWfkavwhHOpvSRH7MF5r\r\nXfhvGtbVSU6opY48q8Nosh6VDLKP+komI5RbJV7yvcKXYK45Izcqze6XAphu\r\nb/EEQS1AsPh3vTKmAOUJCJx5/djx9IsE1rmljG9jzU3BH9dIBmSuUKrCzVIB\r\nu60oKhWkaSVrFYprqT64JfVnk7EjgS8P3CUMUihJPDjt6ppq9cato/tVgWVR\r\nktt9BwEirj0U5nmyx9dnD7Iu6BgOlfAySNQe2LbCeAj8HSmZjjVDLS9bBwVe\r\nX8drVdUcbrHnb0gYR0Ee0ZV9JN+XpimCOLE=\r\n=SX1G\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"afc51e998dd6033fa2fdc11dfb87eb8502c4f12d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-31T20:45:46.985Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.17","@balena/jellyfish-environment":"^12.3.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.9","typescript":"^4.7.4","@types/jest":"^28.1.6","@types/node":"^16.11.47","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.109-renovate-jest-monorepo-afc51e998dd6033fa2fdc11dfb87eb8502c4f12d_1659300515251_0.9322100427265001","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.109":{"name":"@balena/jellyfish-metrics","version":"2.0.109","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.109","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"88957aae80c13e0ce3039d964d08394a0fa11445","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.109.tgz","fileCount":16,"integrity":"sha512-lASKHQtO0ONoIhH7h2lPQD6b3M2S7tiGqv09V9Pizatqci6WGQ2FIsKZEYQgXqMfersnRakVMnO86AgCB+KjmA==","signatures":[{"sig":"MEYCIQDFbvPhdUmNQIKaf5DWqTRZA1SSkw8UjsIDv6mJdU8bxgIhALhm6pWm8bPJ7YncPNfkTCPw2lWZ3faOwLZZoIfqEqpT","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":153547,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi5uvJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrYPg//Qfu8ybnB2Cd6m/2fTvqmfIgVI1OYAkxPq6a5tAWGnCa+0Lvr\r\nsjr1r+x93BHDPLqg8wZ9l3fL/IwbUMMKTu0CgUoE3aeL+4u6hWjmHl/xDTDP\r\nGyr3WJam0PptodYWRNcjUnDZnwJtPsjdn87bkZ6fNlDVJRg2MyM7IPzMMapj\r\nWLbzM1r6042I9HuM71tYHxX/ipF++fdfjc+drtrtAb4tiHQHQhD7TIszACpE\r\nOhqvOBZ+KyQlpnEb+hiWoaXy03PfUBUbFIWo28dgMvhEMA4iFW5+zhb7IIGR\r\nMMoeKwETFOmR9pW2F7zeMtJ7Ej0olHU/t7UNuda3E10gatyy7JTcgMcUlSoE\r\n4Newzmrs0oUGIlUSI5URgoD2eNqeppKLFg0dmMJIqnKC+dbZJt2fKdWdwFo2\r\n1LuJEu5dM3drgfow7d64LkOPEoPP6JxU65for6klqYHJcZIxeQPC1eMSe/lE\r\ny3JuY2PJNk343WNXa0gCPh4OcoUgqiVIT/F3HGBcUhXq+z59AFYwonN0Rzwg\r\ne/YepXo7fdX0nbAllDmqRNu/pXIcckDTY8SejeknDPfK+H+b2myNJcygBmEN\r\nf91VW/0gLXfl6g5DAx9/fY4gD6QH8sKpOkCoAJKs07TkpQK0NX6ofbmUuA6A\r\nZ0CuKIr+RFp8cnMTH40RON+UXMIKH/mNLyU=\r\n=H2CS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"77cf842096a7c8538db5e0719a3eea87d01e184d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-31T20:51:31.066Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.17","@balena/jellyfish-environment":"^12.3.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.9","typescript":"^4.7.4","@types/jest":"^28.1.6","@types/node":"^16.11.47","@types/uuid":"^8.3.4","lint-staged":"^13.0.2","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.109_1659300808908_0.026325534653300897","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.110-renovate-lint-staged-13-x-56f7b147b3dc3d81f703b38a5b9849c053b18071":{"name":"@balena/jellyfish-metrics","version":"2.0.110-renovate-lint-staged-13-x-56f7b147b3dc3d81f703b38a5b9849c053b18071","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.110-renovate-lint-staged-13-x-56f7b147b3dc3d81f703b38a5b9849c053b18071","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"56ad5848d00c23cae378f9b36d0cf924e0b59d94","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.110-renovate-lint-staged-13-x-56f7b147b3dc3d81f703b38a5b9849c053b18071.tgz","fileCount":16,"integrity":"sha512-VsXN/dZC8xPQyn0l8M/ecI5V0bHaoGoHCl4MJ6pZvvbmGFzCCtXHQsjHcNVWG6lE2rbPCjXGKlOTfztshgEVzQ==","signatures":[{"sig":"MEQCIE6WQ7eaM6gET/rcwUPC5NdLM6sI2wPh/SrAMvXFWQWoAiBINh1OSJkKnWqCICfc4lDXDb6vhfazirl7INnmeOAxZw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":153699,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi5uyHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpyiQ//eUkeze5dqQVKJqOmQ77NBmzftivCpW6VB+LEKyCvWdO3Mgr0\r\nYKpcWZ1muxJSLy4mAsUjs7uHvlfKTCRTF0e0cKJKxU8o8KKvxtwk5BrHgN0w\r\nQSQiw4Xw+xCO/vPJYD9qjHBG5WcFF4EII522DX7o1tENefxmTvs1WyIRHm6Q\r\nHnnORkyim+tBOk8mHgUIZhiv3A+zlgzlurlpCKM5GW/aFQH9kSIHP2LfqZyC\r\nRyUH8gEEWVHYmV73r4RaJw4+FPwUCK3fL7j9PWiJ1K5/K7QQ+A3GhNCjmN0R\r\nCKr2yPnV0yVrxH2XmRmyZrNjO+k6ja43FKISctfwQ/bqHjW3BmUFfRUMwop0\r\nT0nto2gqT5nPYlMALXgzl5tSz95PY74KZoLGIC3PlJTKopAHG5IQiyXa13/7\r\nXcYBj6lvFnnJaldn/BVSesK2DbVTBGeELWCzSKaFN9TAi/udvQDu8QFFYos7\r\nrQiQQ4E0vBjFvj/cSQJpB0d7P8WJS/seom84d5bMi0uNRKbC0dJLo7wrgvCg\r\nKnJgRIOBhVRRt8J1DNHC2mydhtO4QWqIps+d12N+UidRV5rQBl8ch8VFEQB1\r\nLy8urnpT6v0LuM7xxbHj5C8G1qLC2EFUhvqTQML0ORIiIleHKJcYK6KDz6Kz\r\nNH537QLlvHPYBYcL/lEv79762UwVVOy78fI=\r\n=sOZZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"56f7b147b3dc3d81f703b38a5b9849c053b18071","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-31T20:53:41.951Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.17","@balena/jellyfish-environment":"^12.3.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.9","typescript":"^4.7.4","@types/jest":"^28.1.6","@types/node":"^16.11.47","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.110-renovate-lint-staged-13-x-56f7b147b3dc3d81f703b38a5b9849c053b18071_1659300998793_0.06256710730755333","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.110":{"name":"@balena/jellyfish-metrics","version":"2.0.110","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.110","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"eb99a0ba19d82fc8bab1c040a10bd92fbe4bd63b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.110.tgz","fileCount":16,"integrity":"sha512-dzCba7yoPNnZGFblwoHMrIYYjUMEzDSbqlEieT1wet0iCyjBV4WY0gBdBVMfDI0TBVSS/u+N1ewHliTfzBIEzw==","signatures":[{"sig":"MEYCIQDtUw/NaRHmACfgACYuE0tsZ6Xdoz9YTh1NIBcgykvzggIhAJxGVnS1Rmqp4eLGWJdYb+2oAG1sPXs2E/u7xIdTAsjz","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":153632,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi5u2EACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqv/BAAh5Sk64ou1ueTcK5bSl2AS8B5NkvAfFW74WPZrjKhCX4WFrdz\r\nOIuDJIpT5OraKcLJ6B3Lwz+oY1YG1NFdGrQ4NC5ePuynvXQKUFxPXyW94aPw\r\nYoRh39iVGnJ4ZtqC0SBiqTtFMVBEt9qS0FACyeijXuT25cCZ1p8fn6rsijd/\r\n+bkDjNdeQ4UqonenUeIjXXMRneOcX4fA0PXGKLZ+7dRIvtsCKiifvJ5Y1Sho\r\na1RRfdvFqy67a4Kf9Jblxm9F0di9dskM9Z+hIRmI+VBJp6wLKjvOFLEjbfSm\r\n9AwqhULXeNAefwtDTItcUifgLGadrKDHOhydX7BpZ0IRd2VhgFh5JHC8Ospo\r\nprDGE/mniXph9jDILXo6zxeO6kXsigzO0PJWvjO4mKBkKA7WuoBCCp9HjTcP\r\ngwUTl/jKZM3KdEpr9DcfYyoNt5yCw2n0wypo3tA8YNV4oBq9qztvaTQYcADY\r\ngp0l71RA+6dEko6IjnKRxz5I6VtjR26tN98j9VHlspIduV10ezKP3QuF9c3b\r\n/OZE+tB7wpILhkCXtcFcwWklRLQ7buyWQACzeDRRHNLGeqNXeAdnKmJzCXSO\r\nvm2vpRC6GI0xNH9vZIGJe/naH1xZVyvplzSCDVYa3KxQh6N9NTLq97Rqtj1U\r\nPAkk4GFv6gzoEydYUvYPlTBE+QfQJuLoYek=\r\n=gixj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6cf09a32c77df98ea50f072c56542c27d77471b2","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-31T20:58:39.610Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.17","@balena/jellyfish-environment":"^12.3.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.5","typedoc":"^0.23.9","typescript":"^4.7.4","@types/jest":"^28.1.6","@types/node":"^16.11.47","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.110_1659301252543_0.8056161472475538","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.111-renovate-ts-jest-28-x-cf022c72e3f48c2581ef85c96d21b01e3781afce":{"name":"@balena/jellyfish-metrics","version":"2.0.111-renovate-ts-jest-28-x-cf022c72e3f48c2581ef85c96d21b01e3781afce","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.111-renovate-ts-jest-28-x-cf022c72e3f48c2581ef85c96d21b01e3781afce","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c7a6081af43b293dfc28f648394e01b7ce37047f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.111-renovate-ts-jest-28-x-cf022c72e3f48c2581ef85c96d21b01e3781afce.tgz","fileCount":16,"integrity":"sha512-s4qaNImlSorIKMXuLTQSA8nOn12twQfLtyeCxMAMSO3v03Uylt6Ncg6KAU0BSmR4//RMVhgb9nU35CzVU2Ur7Q==","signatures":[{"sig":"MEUCIFifYXcZ9TtSv6hZKAQrpswtqj1siNrROeKcK/sgW9aVAiEAsRP8EYh+22SvD3rw2PnDFzC3KJ2tQMABCzFa+EbRbg0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":153776,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi5wR+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoDxw//X5+IvKEkmDnPAnbVeLFLx+PO4CTObuLW/y53GV7fKgE8J/3U\r\neY2sxJ35ps5zsrC4bESxvoei5EVapk+MoA9C6C7P5QHFQaSTXgOkg1sXBofK\r\ns5gjJjQKgzjO6E4iv64EXO9x3ZsSJY4H3279JeGvgH4IclYktEEOmZJwKf4g\r\nHfqGsI9dM72uGReil9zlKhk1HFS8AwP3FJ+fd0RKAKs45BM7Y6abtyQGPmBI\r\niJpne/+23SAGDZAEhYS7PhN1amIRpAdYo2PyYYUDlu+Hv7W6IZIFNIpfCNf5\r\nvwiCFSB5WTdxqPXybEjVnJz1+ZuB5+51zvUdgM/g4R9Ro0+qszs/y1yWyfXX\r\ni5D2+x6EvrVO06KIm0vcKqX1cFw0aSxd3p3Xv2hSAgUvwzj1kcCKnqg5AC35\r\nC9iZIhVVK7PaztXSa6wZiznZIk795ShBZU3rlU1+RqK3KQDPHnNAU09so7Xt\r\nc6zLgO7XfMaaMdsLzGfyPgouztY9y7LhQNrFEx83FCF8UaAu1MDaP2FF4c5U\r\n+MSV3ltB1sF8PuHZGBjrWfyfniPAJbeJ8ioGij9SG1cZH+TEkwAw55Tnm/9V\r\nNh0KLhMyyluvLDgGLlzMT/jmXCuZfJWd5dMmpZODA/BUrug8safK2MYrh+en\r\npKBzmcjvJi31iTb/HXfQWKQlcpnT9POlFNw=\r\n=1WIS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"cf022c72e3f48c2581ef85c96d21b01e3781afce","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-31T22:33:44.404Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.17","@balena/jellyfish-environment":"^12.3.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.7","typedoc":"^0.23.9","typescript":"^4.7.4","@types/jest":"^28.1.6","@types/node":"^16.11.47","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.111-renovate-ts-jest-28-x-cf022c72e3f48c2581ef85c96d21b01e3781afce_1659307134210_0.29467826080100057","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.111":{"name":"@balena/jellyfish-metrics","version":"2.0.111","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.111","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4b43a77120824f77eb780b495a79435711788d1c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.111.tgz","fileCount":16,"integrity":"sha512-n1TyTQ0CdG7w8FnMqIn8bBz26CRdXnN13uSPaGETa8+/WDR9tLUJxDtflCj6oZBUhrbj1LBJ84QB1TaliFbgJA==","signatures":[{"sig":"MEQCIFO61FQnDmcTSgYIbZ0Cm3H7pee196w7NM041YymvZx1AiBEVi+xeijSc06f6lCD/cSUtWxpbXjQQDVUTRnvpFlQfg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":153713,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi5wWKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpj0g//YD+6vnznr470k5XcMob81V7/TjGY0gpI7O2Yl9Z06R+xEj58\r\nlhbW739U0CbxEO6ZAFnGOAUwvZGfF6TmiRESW45HJjjSefEyv1M0UWNuwMv2\r\ncNkbkM5WsUanBjQ1pLWrCCNPDOqQRa33djHUCHlIyHnTbjLqqJo0rU8z+RLD\r\ncDCoVSqzYG3xnTbijceek0XcxfiMgb+OG8sIX89SYdjqAOdKugF5Eh6Zddrh\r\n+rfTlHdFwm/TReW1QGQkbbIxcvabe0iat9OuAB13ZRSRNg5FWcKlMy2qmgu7\r\nRNV6kBJn/DHeMPy4cvMwWcXB8oPrioO1cYXe2MdBZV6+3jSPPMM6X7DTW4Ic\r\nLVlyrgDL9P1MgBU/OIRCdCWeBputBrY36mrfidtlKytHQkQYaMh7pSCdLov9\r\ntTTHD949C0jpP/LCfb/InllDY7/q9sOYys3LV4VhZYbBG7Jm0C0G1fcstVA6\r\nW14iY4fsraB33idNhUag4pSJs6BozLiMxyzukqb7vCTd6WotwMSoxL0t9Qi2\r\nHRID7q0byF5LK68137al9lBahOsmmap2Hra+VySm0KsPxwxbJi+7qZ1054bv\r\nSJ4AX/IxTyGoQpNrHjzuB1nTl2HQESzYYI07ae2zVDwg5kTlzLl+ClT1U9t2\r\ny4FoiWUFHT1au/WGLDOeIpjPlLM1j5ph2N4=\r\n=hHiE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0a63a1186048006bdb6ed00828c46e9ccd04a590","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-31T22:40:49.965Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.17","@balena/jellyfish-environment":"^12.3.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.7","typedoc":"^0.23.9","typescript":"^4.7.4","@types/jest":"^28.1.6","@types/node":"^16.11.47","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.111_1659307402580_0.70140215269258","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.112-renovate-balena-jellyfish-logger-5-x-d344680c75dcf3a27829a629d957eca75ee64c86":{"name":"@balena/jellyfish-metrics","version":"2.0.112-renovate-balena-jellyfish-logger-5-x-d344680c75dcf3a27829a629d957eca75ee64c86","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.112-renovate-balena-jellyfish-logger-5-x-d344680c75dcf3a27829a629d957eca75ee64c86","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e77c8c0b6bea9465a95b6917d2401230c8f09a22","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.112-renovate-balena-jellyfish-logger-5-x-d344680c75dcf3a27829a629d957eca75ee64c86.tgz","fileCount":16,"integrity":"sha512-eplStAQmR5NoDc/xyRj2XA1PxAokZvo2DVYM41htLrkhBzk0u/L1SLwg7xisL1CnZEkMErUsa4fQ7SNWFDL6aQ==","signatures":[{"sig":"MEYCIQD0v1QAE+F6iERT1lTSM3lbU6/+slxrsz5RBNmTHamPngIhALIrGAAs/wmd4Y4OnFw66k/p+1IZoGcGeouHjzxssDl3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":153889,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi5wbSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoYuxAAji1mS1SHSm4VOWUQDwxvQzBe2HGQQZBTQYF5lwDi+fRu5QrZ\r\nyR9l5/MM/ER6/GUO+9wveTJO26dAfYPLIe1jY/2p9o0pb1nXl6WZ8yI4RF8D\r\nRkFf4tpIWXAWJH0GASd7GLU3WR2iU6Q2cydbelyaIZoBKyBSX1S65HdPiEJp\r\nq0F/p722PsLq1rJZKZXLifCKCjHPaSxTE0nS9N1UMPATbQ2d9nvXr9vbCpoB\r\nbszbj9y7cPj3KNgr4EqYoq8qVVTNPNUuJmaFDA6BoTGMatF1xqkTMzct0CEx\r\nm3HC43eYMPHP6/O4LQt1AahQwbbOHsT0y9A5H5mxMR9A+fALdAjXCd223pKz\r\nfz/ks5IJ4/NJfJ0LeAm/d3/Ky9TbtjBtThG4cQSZTiW9sGrka/2oHmOw4UQT\r\n6FslOzU/5vpBy/LAjQhp06z+Yh3Xj/DfaeKvT5/oxwjhzwa5yy+F0ycPXNVE\r\nJeEMzFFuJP9LJYQH+yQYHEjMQ9/nrXbdMKhYZsZFT7WJbeUDIPIVFd81ybCa\r\nYZ430k+Cv8VvOZ6IWifZpwQuSVsPWrAcUgOn89kAqHmbYwecXjo3o0lDPDlg\r\nAc/QGDuJeWqxiO+gCbcF+myg9RDEsvAW3VFKpIJyBEqafuO6Jwd4A0ClGVuE\r\nmFgYdY/F6TOjFVSSNrB37r0NQaUYgWZCcZY=\r\n=1kmT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d344680c75dcf3a27829a629d957eca75ee64c86","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-31T22:45:00.989Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.19","@balena/jellyfish-environment":"^12.3.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.7","typedoc":"^0.23.9","typescript":"^4.7.4","@types/jest":"^28.1.6","@types/node":"^16.11.47","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.112-renovate-balena-jellyfish-logger-5-x-d344680c75dcf3a27829a629d957eca75ee64c86_1659307730423_0.29022034272123665","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.112":{"name":"@balena/jellyfish-metrics","version":"2.0.112","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.112","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"dc82558088e99b91fa5068da94cd00345fb96d95","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.112.tgz","fileCount":16,"integrity":"sha512-9sI37wbTSofZiDEGfEC9fuQz9LPKm2gQNhSRkXs0E0THJ2ie0qNXJpWHF/d5DUa1TSxJ3p2jA2ealK3mVA7GgQ==","signatures":[{"sig":"MEYCIQD/O0n+IZZLMN8cO4MG7UI12dw0gkGhWKZzahE9lpwrFgIhALbRI01vulH7XETns/8xUuBNDB9gfXyOf882NJIZj7Gy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":153811,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi5werACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpd1g//TrRkbTx3EPjeVrKff+qLlRIUPzvV+f+QJAbPgNVO/ws9qv+J\r\ne7jj6rn63uHOmLcIOyzSL2cKg1/09IIwdD3bXGjig9mT3MXwh0Kas+t6/vPZ\r\n3t8bQbGWrGpcUK3GuyO9B/FD57sOhxE/W9l90rGH0nb7Yc/NpaE4Ic7BCXxL\r\nJrcB4dd6w/1QXJMGmvEjvEeqW8O9GqQPwJBFVYyT7hJwcMXoGRy8dPdEXE1x\r\nOUlufbU6JEL1b/vDjKNANEtEaq1Dk31KvKZ5yUDRS9+diPHn526uT6QlfTSt\r\nB2aavWNR9csV7U37oQazPrOpB49f16eFYM3GQARC+gIqyCKX3SvNI1cyUqyF\r\nGry4rp0qezgyTuFRHKT/7xL1Ab1oV/RFxmQ7vdRwdNhEVbHqWB+kWCOS0hKG\r\n48hSUxSSMrQXzWZqGc45r5ro1w8bP2XuauZXcbKq+L0A+8XIZikkg/OVE/54\r\nZzVc5IMIaxkeuxVO6rStQ1u5vgY/86TMOMZMOQLCPePG4pnJCOR2qDqlHU+m\r\nwXinvybxE7DOOz2eLoqYOxrA7RP8lDCkqDIZ+BIA+f6/UhvIHjaKz7amU6bn\r\n4WMqtwEdE+pYoiCR9Raam29HmpR8sI6RY7sVaANQdPEhOpp4/20CPJSyltE3\r\ne7xpk+pfe2tsS4lq7T15vVyMJLG4uEfafow=\r\n=Tte9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"fe8dce0b847ec141d136afca3bfdad217d89e80f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-07-31T22:50:06.245Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.19","@balena/jellyfish-environment":"^12.3.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.7","typedoc":"^0.23.9","typescript":"^4.7.4","@types/jest":"^28.1.6","@types/node":"^16.11.47","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.112_1659307947552_0.4459327145353025","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.113-renovate-balena-jellyfish-logger-5-x-c605359a45622d5e604e1cf5764d65dac27bc054":{"name":"@balena/jellyfish-metrics","version":"2.0.113-renovate-balena-jellyfish-logger-5-x-c605359a45622d5e604e1cf5764d65dac27bc054","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.113-renovate-balena-jellyfish-logger-5-x-c605359a45622d5e604e1cf5764d65dac27bc054","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f1e33b1a8d256930343fc0919784af0fab79aea0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.113-renovate-balena-jellyfish-logger-5-x-c605359a45622d5e604e1cf5764d65dac27bc054.tgz","fileCount":16,"integrity":"sha512-sJkx7IqpCP3F2iOSTQa2umqKZQed0WJi+sR7IZL52A7OAlvEKGJAdiuMBm8b/YAzKlJjMp8DL6zbghB2LKcTxg==","signatures":[{"sig":"MEYCIQDOwWG79KHKmMafpO8Fc6ShcMd8/zsApMLGBnmJtD93+gIhAJp1BUu7Yp8xcVmJniNl9EVbP9B9VsUOFEZc7XbfmzbW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":153987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi5yWeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr4mA//bAddhJV7kgi8NnioI4QqF54xlSEK3cuAtqopkl49cGuix9nw\r\nwUTo3RtsiV8mew5agMTVQfX+Re2bZEXKEwyhzMXftXmLdg5Ouwe9FdfBwN6w\r\nfeBCUso71e5mLBAHc0xqUDcenesSH7F+oCnAS6wjniHFaviv7jU5XPQmqjgg\r\nw7QBFAmcrsNKGF4o4JKcYdPYP9OmmPdgg2gZJxIY9ebkEjM6H8AY+DdHSiB4\r\nBLUKFj6O/krpLcVR7jVuHaLVfaoNxd31l3QBqmNGNnK1hBiPtO7jmoORS0xQ\r\nqbV7HhzWPuANV2zJNHOFZTS2Q+EzlQV4D6K/c9+bA5MQeCJslMaI7CNkYxJ/\r\n8lUmKDjXkn/prM7hni84FbaJ1E3euqVwIUZjOseR8UXQY3wJGwjJcKMOzLmn\r\nkMG0uUmd4y+PsBdn8CaHZIqUWwWHQuYluwzxutmByCuQuuVCUBZU7s1P+AfG\r\nkFEbB+Z338XfBtSGv2qu65E1espdcM2VQyTI+CYzrtE3HZ6sHtZ8gK6FnJj0\r\n35ZoQnSbpN+kdfr4NPBV21rBJMBDT2ogs4R6AocT/JBcCU+enH4QHd9R/NOg\r\nIw6VPK3K9idYE3fYSnmvkfVNR3zuMPLxRZpgS7e61I9jbwNzrxU2BdOuTZhH\r\nMw5KGDXodcgxmxWiCPxb6Z5F3gUztcogi2A=\r\n=7rOV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c605359a45622d5e604e1cf5764d65dac27bc054","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-01T00:57:33.246Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.20","@balena/jellyfish-environment":"^12.3.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.7","typedoc":"^0.23.9","typescript":"^4.7.4","@types/jest":"^28.1.6","@types/node":"^16.11.47","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.113-renovate-balena-jellyfish-logger-5-x-c605359a45622d5e604e1cf5764d65dac27bc054_1659315614020_0.49192940917266714","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.113":{"name":"@balena/jellyfish-metrics","version":"2.0.113","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.113","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"27a8350219ec0420bb8c1142e8b1e0d3da2f7e65","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.113.tgz","fileCount":16,"integrity":"sha512-jhBaix4SFrRFy0WPpARDto8fH5pBJdAWN4NCFF5q0CFzn/jfa7uIyrdkS1JCyzeREe+1+vuAuwgAnLeYWBb3lg==","signatures":[{"sig":"MEUCIE5FZlGhgqK9sUJHpnfmQewi0df/4WfsZz8zmWuzM+RJAiEA0OZIR83/1Cilat4TH5+cPTmFewGGm5lfPmxfEihsZdM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":153909,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi5yrNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrwCA/+JFHRv25Utr0+4QtynA9BWoMONEAF4kmdqG8nFw1aELdSYAp3\r\n3dWLrkVYGANSukv0tf8VvGWSoysXq4k40IGLG3J1s05zKI1m/Xmeyo1Uj690\r\nRdduDf310bGKrCllcthgasjFqjvwdIO06Mv3D7lrZMla1Im9xNlVOzJuKhSb\r\njNDci6qc2qT65Sa3/SkvX9RrC+7yd8s5+jUmpN6FNTtizARso/0vUAQTlh04\r\nW345mlEGkMFeuIy4oZr8SaG0p40AkOPmh/TSFTWAMKtvDfP+UGrO7MvoGD4c\r\nwK9KLCCkrmasp2OcbPfy87PRznPZxJzpW/PfMFoWqU+XzAgmyRQclBb/e556\r\nX2HXcHAzg7KQzX/D4P4L7o8ePbl4QQ4Ex3DcqWTozKBhjyjLuezCl1C9mTKq\r\n70RfFrWeHKcbucbATBF9FbRAnVeytJtXPWh9rtXJS3pmAMqFu573i8WBwS3r\r\nAo42gcPzpG+b8Yt069Y6dx1xtp+eaAYg6iDCzKHn3L7AXkpSoqF2COteESE2\r\nCCJbQOlbM7Kq90zT9GDw+j7hYtkkxNmxoFF2t2gI8lk2TaHYfyBRrwJjvW4z\r\nULdFqpE5O7BnNevJWenmtAfPLlQ8asxZObDsPyh1S5tPzWQ2gcBFOOkHT87A\r\n/40S7fG1gteDudQKXK2oRMPnE3yED9LWg+0=\r\n=FXwp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f15e36c0892c28e5f7d301bb742128772c34a196","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-01T01:19:31.705Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.20","@balena/jellyfish-environment":"^12.3.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.7","typedoc":"^0.23.9","typescript":"^4.7.4","@types/jest":"^28.1.6","@types/node":"^16.11.47","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.113_1659316941442_0.1655022707902385","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.114-renovate-typedoc-0-x-57c12e15014e1b8ede089437929db7a957816ce7":{"name":"@balena/jellyfish-metrics","version":"2.0.114-renovate-typedoc-0-x-57c12e15014e1b8ede089437929db7a957816ce7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.114-renovate-typedoc-0-x-57c12e15014e1b8ede089437929db7a957816ce7","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3cbfb6f54cdc599f0ea59b4e2d79015c298588b4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.114-renovate-typedoc-0-x-57c12e15014e1b8ede089437929db7a957816ce7.tgz","fileCount":16,"integrity":"sha512-ZZTKyHnYb/U2FG2ieucaGOyDVDvYbRRI3h69MPaxUx0W3JR/CXY1NuVlazY3Fmbam6npt/k9kYqnYHXGc/LrOg==","signatures":[{"sig":"MEUCIFXVQIOAe1epsU7x3CfQ5y6l7srPiAeE+cPKeiUIXss7AiEA36iLl8+aV8dqWxOIlXaGWH5Uc/VSwaGq/Iou3kOHgrA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":154054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi5yvHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrmiQ/7B9vZgC2opvBAdBdc6igzb9EwaOLdB1WPv6u4d1GRc4niswo1\r\nqNSx8QRWTLc6EDlpDF9HlfnjaJtNFZojpfdRBgqMFTxXveNXlJ0VYuGDSvNx\r\nqrV4Dd6TEqO6J8uxAfarNrBJpL9fFnyWOHIEU5v9+fwlK+KDX2z0w1O3AYxT\r\nLAYIaHHxI3np01R8YdrJAFAdDhgoAFdBrS65pnUY9O5CePRUdWeUrldAfb3p\r\n/hbEigCatw9RdK07zavZUHBtynCuuB5xndA9ICm/VoGBVZHRzT1RFUmgb3Ze\r\nGvbR7hstiSjh4y5QFqzywcByty9HnXwUH7wGnClMT3ZeI2KCLAeXWaKuOQoK\r\nUdQXjJ7foglmGlBq3K21NNJLUpLwc01Xxt3PKtARSJDmHd29KEYkyYraXGyL\r\n9zs4yaYW/LLtUUIvPgoKoQfTcqIFqoQchRDpN89V22NOAaOb1lfhYglI3PA9\r\nJsWvaPhVGidhyUsrUC7Bg+/KcxCHhTVJabjLB233vd7HMpqaDsIhH9LkTzvx\r\nlS8KjiUKv/1XEU9ydFC3Rh7Z8C/18YfqTRLpjYxz0YjEjYpmgRFEq87fnfUj\r\npHglzG8Eozkgx7ZRrScfeuNi+Yj5NM3nk/h0vACBa4sI3fU/kDlxs1yfA40W\r\ntySr2LHNsierhe47X3lSHbnHsTkGqKsp0Ts=\r\n=uh6g\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"57c12e15014e1b8ede089437929db7a957816ce7","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-01T01:23:37.297Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.20","@balena/jellyfish-environment":"^12.3.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.7","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.6","@types/node":"^16.11.47","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.114-renovate-typedoc-0-x-57c12e15014e1b8ede089437929db7a957816ce7_1659317191518_0.009036570817440692","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.114":{"name":"@balena/jellyfish-metrics","version":"2.0.114","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.114","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6ba80cff22b67ac690578b8aadabad79cca6b5bc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.114.tgz","fileCount":16,"integrity":"sha512-6GaPKrQb+HhaycI0G62xlQfM1G5hLgRy0GWBdyTiSG4jF89P3pDP4geQ5hr0yc5G2Kyne7e61qzQwGl/rPC4dQ==","signatures":[{"sig":"MEQCIBjOxaf0RoE0n600TzgivhL9Y2ugk7//5yDqIKBrnWQJAiBN3dbkt6Wg5nw6E4Fa0WfMr+tV4YFLrwAf6Sd1sLPzfg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":153992,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi5y+bACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrRlQ/8C7QA/PxeqojvyaIXMc5KTG8utcIeFm0kCCi4gt/sf2Dy2Vll\r\nUSbmwcTe/1pH2pwtLvxgvvBr0QFBWum8oWxBe93yE4c4lgZ6KhGR0RuDLPHo\r\nLvVSxLxoWGGruYkwOs7sAskHZoBJrZfT/A4/Y3zun/VOEhaDoZBhxEFa2w4A\r\neEVIeOORO5ciY1/BagrDdnpf1JE9ODJjs2cbMUesittp83ikdhTL8iAU+oBu\r\nVWoNL0fVAVinZ+1IMxC5K6HJ32Tq09O+MtE8fLgdz8dMdSnHWPoNh/tyNh4+\r\n1nZQS5rnuKMZVXFM9pm4AHr77n4FIdhhMsFdQ7Z/x7UwvQZekSqEI0f1IIYr\r\n1mg+gubRx0f8r5y+mSWc5QepL+X0uIJCZDdsDRjsGL+HptFlCa2jIFxiHUyR\r\nBEIJWzAd8DjIERPU9DBV1QHoklGk8T3g56Ios0Qdr8aF57HcrXXTZY/bvi0J\r\nOEbvhCUtyWMRe2ewuvhO/BzYdefApdocwnZYjCpw3SFeueXz6dP4EH3LLNyC\r\ntWeynTc4dJv9wu5lX9BdC4bnIAKY3lyZCmT4GY2aClBlOgfbR3n4HCxwbaI8\r\n7K2/o5pghwTEu09UwtBZOCYxUzz5krI3gEkOD9JcRLm98VLwr+M5ETDFnwsF\r\n6/LP10YRFIjm4XI8gknO+uY5vnk5sbYXZ6Q=\r\n=g1sp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f47be3b98847475428521ab927e07fe97105ef8e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-01T01:40:33.949Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.20","@balena/jellyfish-environment":"^12.3.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.7","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.6","@types/node":"^16.11.47","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.114_1659318171521_0.05549436211371184","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.115-renovate-balena-jellyfish-logger-5-x-a5d0ee1f0eeced4447fdd74baa759f5317e5e4e2":{"name":"@balena/jellyfish-metrics","version":"2.0.115-renovate-balena-jellyfish-logger-5-x-a5d0ee1f0eeced4447fdd74baa759f5317e5e4e2","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.115-renovate-balena-jellyfish-logger-5-x-a5d0ee1f0eeced4447fdd74baa759f5317e5e4e2","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7ee274f070ea0c6fe05d634897718497dc671bf4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.115-renovate-balena-jellyfish-logger-5-x-a5d0ee1f0eeced4447fdd74baa759f5317e5e4e2.tgz","fileCount":16,"integrity":"sha512-r8jAtlVXlAlVGcxTMuN6p0ZplxBfIbgzkJ1URphbDb10w9hSukMF1+fmGxxKvyNewgfIXY22b2vu++GYngiGcw==","signatures":[{"sig":"MEUCIQCQK1B8I+sG+Q8oHyk62UVAAMTY4cj7JJDB9TeESOIMuAIgZWF7+9m8nr92juFlbDdGaf+HQ54wCzuZ4VETTvlxN00=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":154168,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi5zBiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoIBw/9ECgIoEkFsAtqBQRyDekHUOXuBM5yaGHmZ3o5RNG16KAJeQFL\r\nrFSFcDRXVCu6fSiZUd5GVzI45AO42GD586YxOURWyHAO3b3pvoguuz+TyVMe\r\n/iXECaKx48OUBcSqOva2xNm6Jmhy/TehnHAJqYu+Zgi55xnuY/pw4vx1KWt4\r\n3YcpSihyw1ao2TGX/EToIvBNDFkq5NpiOG+KOrimCGDksJJqYN9JJ/rejSIt\r\nHayGh7/4tShZbcfXmF7qKqfIZGeZgsRyKcDoyXHlCSXvJRIYL+PqvmbMJZoQ\r\nKG8GTisZK/Zw8BDY9WvsmbwbNs4rgVJ+oa82ULs4HXgynonjcAAcAv/B91df\r\nItDN0AUmVyFfsfJxZjonBCmC8TlvAudr40OgK52N9bP4MXOndjUtREZL0St+\r\ndb3XRcfQFsR0inmiVrB7RKsr8S0iLtrNMYAD54Kf0g11BU3C8Xf70dX0oIyn\r\nRUu/N7/Z+mgysipwvWoNrlXheROKv62GCTfHx2JY+PJqe7LRRR5g8ElXD4wD\r\neKl0wD5wKbzDoWvaHLf9L51gicA4j5DahKQxR6D4frIILbmJm8pqKfhtwKPL\r\nR/hcJ0Sex5Yd67iMUfFwMa5BpQvRa/dHSaPHwvHO6FNtd40yv4p4Bp7watkL\r\nYhzjvsDJ91mjs3X1MgHEuewjiQO8HMUeotQ=\r\n=IizN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a5d0ee1f0eeced4447fdd74baa759f5317e5e4e2","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-01T01:41:55.867Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.21","@balena/jellyfish-environment":"^12.3.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.7","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.6","@types/node":"^16.11.47","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.115-renovate-balena-jellyfish-logger-5-x-a5d0ee1f0eeced4447fdd74baa759f5317e5e4e2_1659318370453_0.615744257126823","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.115":{"name":"@balena/jellyfish-metrics","version":"2.0.115","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.115","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cee930a52809c557a227cf06574367f3e4e2a601","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.115.tgz","fileCount":16,"integrity":"sha512-MaUAuleKjiXwNMI2e6bSmrE06yirl8Khv6R/bnC77cmTnemAeRC61uQHyrs+GifYN4XM+7flDaA0p3dFUsreDw==","signatures":[{"sig":"MEUCICMCO2cfy8oaSgC0g2JafQom6zDCOpbQAxgrPp5dDVobAiEA3ugXzKGDgIIrjRrTKyog6aDycip/sqjLJSD919LVhTU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":154090,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi5zK4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrR9g//aE0SDS11aKtW+9BwsB+gYphVUJ6swWZwNc2b/4hNv6g3w/TU\r\nei7O+K6LRhxhx4mioRAGP3XvMkdme/Hb1SDiJlL7+fP+LIQR3azUwPYD3ha+\r\n5t/vxqBZebI/3r2UZYPglz6yB5UX15l5C/IEGpdPYCM/XEBovIZfKnNeTbU0\r\nL2z9XZfO3zDklcLREquogMfbZoX0gG0aLkZCU0pGRZCGmYL42LgpcDF0T9rp\r\nU443EHbuyIzBnSeqTFUZhy/KvzzvLjkgRr5OfumfrnfXzUALEzJdkZb7kUIG\r\nAnj/DFpP8ODwDWYKhfq3YPe1gVVz2yL+gt/SbfEgmvB3cI8A10BfKqad2sb5\r\n5uggiZ1Sc5+bRbFrBLi0p4cicoaw0l7eedeDBpkEAlEK3ir+taJu2KCZrKtG\r\nFaU8a5CmEhEX+lzJ4BJKzZKn2mOcF65VCXlKewTDw+iokP6nbmTacaxnnq5Y\r\ndkID3C7COozOHUK9gu9W4M2SGijSvs4DZwHcbY9DrWhKEH2cWB5ILOzOHiIa\r\n1Qtaw40MFoDAPRsiQ73TPrkAp9Tu/QNhXLgI80VotscoFqb4nXIJtv/nYuJ/\r\nXp/WYw+Yd73gKq/KP35QVTn6ogaeYeIdC1sDczBaiJAwDs5tLrbDtV5hzZ1p\r\nM21VvKBI8SwZAJedpo2EgrBnWb+XpU+Xn60=\r\n=wOhC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0a4ed12a6261bfcfb5b980aee7112d282aa8695f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-01T01:52:10.368Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.21","@balena/jellyfish-environment":"^12.3.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.7","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.6","@types/node":"^16.11.47","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.115_1659318968434_0.8458615206867564","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.116-renovate-balena-jellyfish-logger-5-x-78b3a3943d561ab8304b36dc6dfaac52ee8b32d7":{"name":"@balena/jellyfish-metrics","version":"2.0.116-renovate-balena-jellyfish-logger-5-x-78b3a3943d561ab8304b36dc6dfaac52ee8b32d7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.116-renovate-balena-jellyfish-logger-5-x-78b3a3943d561ab8304b36dc6dfaac52ee8b32d7","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2bdf0fcf1a046482ff42829f6044ff73a5ed8fd9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.116-renovate-balena-jellyfish-logger-5-x-78b3a3943d561ab8304b36dc6dfaac52ee8b32d7.tgz","fileCount":16,"integrity":"sha512-kjdjjFbOGAsipIlxJpXlhw8gRgSCLig+alH9229fQaOFsJDdKAOY5AF4gm17mZ78fur215NW/tCATzgggdPEQA==","signatures":[{"sig":"MEQCIEfg/57Ax+qbSVI/yKuDfxapxJG892nHM55cXWFaQijNAiAhlSr1zHXeXxSU5XrQknVYrHwsDGCJN/0Fmy3y77+qWg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":154266,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi8K8hACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqzzQ/+KOMZ9igON1HbJsxqev1Z5n+GfYDxmssvVnJJRiHVCAT23jn5\r\nUcwq9pYfLa+Nd8IjhYbjEu1PWXyN5C8S2sv4yWf+2NPJnkDOkFMug8EpUyzh\r\n7JTwVECI3bpcEIIdsPWmavwh3zOBcuV5haE3HVHkzJHd/tp8AJJqiURdcaSF\r\nIaRm7XDaMRNxnl1Y4Fq3ChANJMHka2jvQY9N6BtVyaTB7NgyhHoLpEqRGC/o\r\nPr7rFdO1s/n7FiL+3qJKFV4AQ87oDPhBva19buPZeadaLhVWBMjCE+jhAhmj\r\nf/xDnzDxtFiHBekei7kO+43tFfS08/zEDaWfUgAXVrHBcSsm0ouse//ubuKW\r\nZg+psaOmjZiCK3GFekhJt+QFvOzIzGM3S0Xq7j6Q1XuhiPZ33H88D7fUGTQ8\r\nTprYew7ScjmkC1RjS9hUpXYn755DMMJrZyroU9CG3Abxk02oPj/qoTFOdoz9\r\nq4df27NYFKZpRzLzpPf2IKAFwJKKFW8ncldZPyGP+BEHc2o/Eap87HBZqi7a\r\nx/oCNMYyo6xbkXp1mA0PBXHn1lagyPwEquEjcFxLB1ztuyv0QR+hRmsoZIJI\r\n9PZdrGJMpKr3H1dL2lUAbXboVFqcH2903WkYI+j4I1mfV+lXSdM7trLffOmw\r\n512ytGdh4JDPsDvlLF6pxh/czRUJIqif5dE=\r\n=ngDz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"78b3a3943d561ab8304b36dc6dfaac52ee8b32d7","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-08T06:34:37.270Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.22","@balena/jellyfish-environment":"^12.3.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.7","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.6","@types/node":"^16.11.47","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.116-renovate-balena-jellyfish-logger-5-x-78b3a3943d561ab8304b36dc6dfaac52ee8b32d7_1659940640908_0.778649696002564","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.116":{"name":"@balena/jellyfish-metrics","version":"2.0.116","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.116","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3e45d3d34e0007655a0dbc75289aa2f742f0be2c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.116.tgz","fileCount":16,"integrity":"sha512-s0Iitu1C2KCSL16SfRDcjKuUzXG81Cys5wmxgB1B2KomJOQa9AHzWfWCvK2Gr+FcT6mdmr1LQHIUTwoYTkgPZQ==","signatures":[{"sig":"MEUCIQD76bfbxx2et8DwJqfZa2B37ZhIZwXR17iCAL4LfswGbAIgedDgt3CLGcLk6l9XkWlwpmWIRqkloueGR523yXJYLIc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":154188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi8K/kACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpMpg//ToUxjfoyEUpeVbImvD8+ZYzDGqi+UiQsnrv7FCAynyaXR8J0\r\n1zKNKHXoT6ClaEE8s8lwLtNGUm4m8z6XYyqsfjNx2zPi3KAmblSaU2rp1gy5\r\ntHyQFkukwdLZi68/Ce6XdMrCXK66gaQIAmKuC3bUBZnnXnznOiC3Gct3N3wl\r\nqhuVYChMHVc1T5dH1n9RYfA7Q20POkZMoPocUdbr16Hs65x4WXUsXfRCubmg\r\nigTEcjdEpFla352hR5c9Y4AgDk2UJveUwj2r8929kEUUXF0XH0X28uvJgmWA\r\nC6Ie3Sqof95QBVwhzkeo8RBTcVnoHqYw/f54V7iJweJS7IO0a9BdB7vYDvhD\r\n2yWL8aO4CyD/VutrwD6UzDQBvPrkfw3EM5dKAmcab1ky7hIWV821rLtdXAkK\r\nGxuYBsSy2PWltv2GbWhNlJZcrUvFhdFxLggR4yZPMBqdtuhLnjSVwKYp59KF\r\n5WUqt2uDmYy18RtN3icrkW0d2siQR4ELG5sNmME4TbE5lFb3DoMnZWm8eDy4\r\nQ29lqqMKLW1CbOO/HBrkeVRzgcGwPvDxLI3Aff9NA167pM5v4uhXq2L/iUm5\r\n8dpoNT4ThcgeTO4eHaDBiYxF6XuqHTpCyOW1UEGpkqolENwlo+c1+DaGqSqv\r\n5wZBRfgxLgyREwfoi2Vvdy7ft4wRNWgR4j0=\r\n=Asky\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2978183938c8829814fc1217089ff93f15b45bf0","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-08T06:38:37.197Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.22","@balena/jellyfish-environment":"^12.3.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.7","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.6","@types/node":"^16.11.47","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.116_1659940836451_0.7422023592440847","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.117-renovate-node-16-x-034b4c9d7468c1fb79c74dc76fa871951e60ebc4":{"name":"@balena/jellyfish-metrics","version":"2.0.117-renovate-node-16-x-034b4c9d7468c1fb79c74dc76fa871951e60ebc4","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.117-renovate-node-16-x-034b4c9d7468c1fb79c74dc76fa871951e60ebc4","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2108d05ee19f2fcbb2d3841373cdb9537f9a1dc9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.117-renovate-node-16-x-034b4c9d7468c1fb79c74dc76fa871951e60ebc4.tgz","fileCount":16,"integrity":"sha512-YPsnYhBmbf5G4zy6LdXF053l4S7srX9NzyD7sixgdzgjlqc3Xk9KLk7E3aSjCshNon7dnBqEjhK9CpFPsxvJsA==","signatures":[{"sig":"MEYCIQCAem8NnukL6+ADHWNnUytyD7ejcnYSalpZObPK24EQGgIhANa5iOO7gXUl9ChIKqYgP/NXbMSoALnhOBz7wx9hsj8t","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":154337,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi9vBGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpYRA/+NLo/uaBjFrjgso9fiK9e8IIbrXEdP7sqUg0d/ytZeXa/5qr8\r\n8No7N0vMTSsbzOOv7q7Xu2O83gynCe4RRGWTprXoRmB5DqRBzI7kWHSD1xC9\r\nBl+AGdr6+YhXTXWT0LzYRPVYBKcGEkNHQwPaUwgTTRM+l9Q+lZy7O9jjX8tZ\r\ncxIRVuvDG8VVD3Z7Xiyfok7l11mvL5TpDXrMmexx7aT83tHWftwzG97rgzPs\r\n1pglJDVZdgFZ2Za331gc6F9iOqcJxLBTNlgHyJsuYh1krYeuthlTzRf6RXCS\r\nF4ERuisb/Zcw5F5SYIM00JRiClWr+Fz5wzyxYhl1WTb8p9rQJ9UCOM5LpDxs\r\nODtdXXLQzfgCD3V8+FL0+PqJZfzhLK72por/xNPHamh2n/MiP+WaShGIxJNq\r\nx1UhX3O6f2SHnOjEdCMiTbtLMHQ2tXmL1u2ECOUbXYKmOFI79zJNopOvJSpA\r\nsASVLdMKE9PqYTd+8NOta47DLnTZ5B0u7mbRCg/OnY8qLPRcvO/gPg8N7AUY\r\n/yEyHDUGXkYdEHfdo8KMv+2DkKiivZ7baneAHTIs41nToaX8wK4aR8lZj6WE\r\nq9hpa67vEoGTH0jks1JCxZY1yopBqC0SZV8W5nI8Vt8U7xHpmLaXzrkVYsKV\r\nBdY+48uVj0q55d7SZnb6PQecUCXR2QMC134=\r\n=+A2h\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"034b4c9d7468c1fb79c74dc76fa871951e60ebc4","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-13T00:26:04.891Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.22","@balena/jellyfish-environment":"^12.3.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.7","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.6","@types/node":"^16.11.48","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.117-renovate-node-16-x-034b4c9d7468c1fb79c74dc76fa871951e60ebc4_1660350534004_0.7520217814647951","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.117":{"name":"@balena/jellyfish-metrics","version":"2.0.117","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.117","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"45a2774ca6f022c09bb097a0d76ebcdf006fe133","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.117.tgz","fileCount":16,"integrity":"sha512-o7IQqrdiaL5h7QeDc76PWCB2Y6J1eq1Xl0S4O4F2t2191aDyrUAZxSimgkVv3hQ8P8pKYQPkFJhtNy8+TweYrQ==","signatures":[{"sig":"MEYCIQDy/K5nCj0zU+EHi2JIvQbE++ZRNKw9DrLY7qqXqi5H6AIhAMcfjXX/LRA/LApHaDmeipratfnyQDVp6QwlQq6F2lsc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":154277,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi9vEDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoLkQ/5AMK0MSB1Jnzctck/HZ2BZSHKRlW8JCWQ1ffd6/vf6YteRFcH\r\nuROtFq9I5q6r/RP+C3K4TJJeuUe+iIHGZKxDb43ZzfsFujb1CVEuwRxKM7Hs\r\nAPW3cFAUvVc8z24kABO4vfaTSXhbPLpBCwLBtubwVQ2J7JIPp6LE3MlDUfCW\r\nq051jEvARPFR78Ula5nNqEMIvK1/JNFNq2yipbJMMOz3Rhy9g5Lct5fhVTaq\r\nFcZ8xg6HaoduBeuyyp96P3MGr6rKcEreFwD/xRFCRNB2ieAsyMo3KhxxHt4v\r\n1SrLWsOjIvSs1S/Ji2td+sZCsxqzHLZr/6GoLgcnpK782rPlJ4AlhL+ZfvaB\r\nJR+ACHsnNfSITwwJqM9IqzE7K1oWnWMKBHiyLNK6sWh2VnfhY1Mwqey+EORl\r\nE17XTF/vgT5GVInPiZgn7fqU8miGOpKipg1DiBfIfcRBvIntln3AjljlIBmu\r\nkf11p4n/yRNqsSzuhM6jeMGSlHSXzHsC/FuEmAxa2kzI6n5pPWKU9V4AVD5k\r\nwaDjKloIxd6Cdwe/k+QkZ2JsipL6zNT+t+jOBtyUmrhyIVzqNckko6jOq8Jf\r\noa2Zz06qxu+x+TcFYOXr+R7Vt2pNU6CWfKlpdALCwcx9Be5N6CjtfV3vDIVv\r\nzdlpDeaiqSto+Ijz9zThcAS7jSfrHJeZD0I=\r\n=IW76\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"816fd26139214ec391ed8df40e53e65929869b8f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-13T00:29:43.234Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.22","@balena/jellyfish-environment":"^12.3.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.7","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.6","@types/node":"^16.11.48","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.117_1660350722888_0.1261682896664711","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.118-renovate-balena-jellyfish-environment-12-x-abc00aac57e1062edd30e70f7094ebdfa02d7063":{"name":"@balena/jellyfish-metrics","version":"2.0.118-renovate-balena-jellyfish-environment-12-x-abc00aac57e1062edd30e70f7094ebdfa02d7063","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.118-renovate-balena-jellyfish-environment-12-x-abc00aac57e1062edd30e70f7094ebdfa02d7063","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"51108db9d77f9bfd810908fdda77c641a3ebefa0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.118-renovate-balena-jellyfish-environment-12-x-abc00aac57e1062edd30e70f7094ebdfa02d7063.tgz","fileCount":16,"integrity":"sha512-g2KCeoXKxIJLYHwr20QiSKUfGBp/sbvwxFSjg4apzFf/mLsxM/Ri23C5c7d2blXtLuuWnixLlX9qFh0sbHWtLw==","signatures":[{"sig":"MEYCIQDrr60k9Y+x6w1bVRV16b7S//PwDNnJ9vPnLaW7hxKeMAIhAMvUGQH/vGaCU3gbTQVTZ+HV+UUYyioNw4OMd6mVJnWw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":154464,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi9yDJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoB3Q//f05858mNCtvSqlQH2LR7m9uCHM+Icg34mU09799hJ6c3l6jd\r\nxqiQ/VgjiYec/HSAZ9ZbSSnGiHD5Wrx4hvOpRZPFZvDiZ5fEQ/RsiWyJENVj\r\n1/JQfK/9o2C5xdHS0xW5Jjns1NuqDIrj4K1B1/09pTNxfYqZUkWNpLPek6Q9\r\nvldDWWjBR5T1Cz7pEtrAkaUBd94mz38HwViWATDe+7jKO/rkdLRvMgU7S6Oe\r\nlvbZzANBtUu+P0RnGFp0LipkIw96xtDSHnXBIDluVbpP7msVWsqh2WiIbmDn\r\nnNiDPmfavT3puMN+bVBHWiECD4CByeqApwNgXn/VONZI8a9VdWnUJ3mPKFIB\r\noXNlYtfHfFe7yv4qGYgfeV+zqgFQNb6UbgVESJdE9QVMGKBobFZKLlnCSx1k\r\nrOKHTExlfVtiAPAChE+rbZqXfXdORrj2+/PoBHzbt4xs7xuksevMldPFvqbx\r\nRyek6wA8su0cUC2QNNxZ9hgNJZTZ/yEZnObIpD4w6ZHHhle6BCKjRFksFK3H\r\nOzn42OookXVfknBDKSQbROLGJMDwFoPpEZuX2Vv6tQsONHWVbDGtY9OPUO3p\r\n3koLgXwp/cEK2317g+ioetdJXaQEgif3lv8WBMcrS40plzsvoXB7pakDCTsX\r\nroBBQMTle6jqXSboDjsFuJxkUqoxopivZpM=\r\n=W7Uk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"abc00aac57e1062edd30e70f7094ebdfa02d7063","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-13T03:52:15.851Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.22","@balena/jellyfish-environment":"^12.3.6","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.7","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.6","@types/node":"^16.11.48","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.118-renovate-balena-jellyfish-environment-12-x-abc00aac57e1062edd30e70f7094ebdfa02d7063_1660362953069_0.2720683111487483","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.118":{"name":"@balena/jellyfish-metrics","version":"2.0.118","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.118","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f9c977be5c9f3a0d61f81852268df7242681b9d6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.118.tgz","fileCount":16,"integrity":"sha512-EabC+V0pFIfAxKr1lJ+guY2WWiIS4mEUAubNXjfJZ284eEZ9eQ4G+dOaglzKaFTFK/kRP2RkwM5893U4d12kWA==","signatures":[{"sig":"MEYCIQCB+PWbB4SYZQ+j0an5YpvKzewKzSYyhgmn8v42gelwyAIhAPLS3vDq/bDsZIvVrmSxT14E7C1Qn4EUQv0VL5eaqmga","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":154380,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi9yHUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp4OQ/+NGCN2hkYsJsAcInzRuIZBMkvtFhM8Z+VbHr+OXLYX8xjVoAR\r\nwdceVIEojrylstLiwI2eSbo2cat01TOshrwkwfes0K3UOOGtaNFv+j/RMMtk\r\nL+7NTtTHiJw6mHsYDJqR1hIP4nlncNYUjHPZ01q6W3M2Apjv0/M3+WM38dBT\r\nSQLOI5zomMdgj0HJU0m4YGiMOSnM5MEawXP1i6Q1mNCs5iDwe1ulPnsB3fki\r\nV11Wr/4y5PcliYIvnXWqRyeHsUOUm6bKOGET6L3kukw5v1g2pbwBQnCpBSqQ\r\nID9s8b9wqIURRNJXH4152egM7a0qIvOXwqZt2/DnS5j8ETiDbnjpys1NDax5\r\nD6zdM0mdKYsCf0xToBVNyek4pn/be6N7rMQjr80vuTQc8HjrlzEJihpMUivM\r\n/YYDdB66rLnwd6U/7hMl56kwErN6f4g4MT4pXWE5wTn1yai7uuf+Cmqa232w\r\nONvVuZpSbBnU4U0zuaJ06EUM3/Recg8qLwh4jF/UYk5b/vUXQ5aTOdyZlydT\r\nvrjMrhDNUG+oTCs44OcOW1PNXbdb+rGCiNS/faMP9EyIP3kLbUY/0e88rOAy\r\ngA5+xQwPLiOGYOJ11HylU6VAF8CqwE8AifFObfdcpXFiHji8UsgqrSN8YwZD\r\n5HHumnmEJDtzR59KkaBu99saEc/Hn51TbxA=\r\n=D47o\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3869fd76c4d1ca97798c2dc45d5d46da3af1c24a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-13T03:57:50.966Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.22","@balena/jellyfish-environment":"^12.3.6","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.7","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.6","@types/node":"^16.11.48","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.118_1660363219798_0.7042453584094059","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.119-renovate-balena-jellyfish-logger-5-x-6326d9e74ea48d9cecc2b6cd4ab979eecdeec1d7":{"name":"@balena/jellyfish-metrics","version":"2.0.119-renovate-balena-jellyfish-logger-5-x-6326d9e74ea48d9cecc2b6cd4ab979eecdeec1d7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.119-renovate-balena-jellyfish-logger-5-x-6326d9e74ea48d9cecc2b6cd4ab979eecdeec1d7","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2cd2c1c18125daeded7313ec6e66708ab5f17457","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.119-renovate-balena-jellyfish-logger-5-x-6326d9e74ea48d9cecc2b6cd4ab979eecdeec1d7.tgz","fileCount":16,"integrity":"sha512-OttKakJLWdWqB1L7gUv5xADDi+BjbzN/wGvUEREHMjgVemI6Gu55+lS7WjnYgznae1miG45fAzWTp6xacGVjuw==","signatures":[{"sig":"MEYCIQCo09pSHaYtwEDUyjJnFVSfE/yIViLZqc2yU9t+dT0NoAIhAMkqyqfju2Agbo1QAXbYt8TIu0kLqYRPSo+cBby4QWoB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":154556,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi9yOHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoPVA//QHDVDWbubFSwUOCdS/dRsuCMEMNLZcXRwdosSdOCSHPdNMpk\r\np3s5LBHCyo10zyncL83GyVQPv/cEcatrYiO5QwRMrv2Paz7rcyg9EyPC9E/n\r\nEycHwLh2ESi7PAvwWDRPIv+/YRxCwk7RpIv+2Tdl2gsUtcipdIHouVKkqSij\r\nr1SbEr5+2TgPU09MY5hjhZ8re3aM2dtkJaUzyWUUpIdj+jLJ4I6APNvT7uoL\r\ntUHq2L1O77kW61T0llO/h/wMRHItBSqZqSrxdkQt8PxqRodQcp6YvNgAOsX6\r\nUg/yeBy7HNfDA30n1RS2n818dkJnGUih8l7R4bzMTb0XXEdED+u/L8CF1+g2\r\nwOM98kYYMhKZXGha6T2Dngg+auKlEZW+Mm9RfOYHXh/o63gN/mwRelYZ6SRM\r\neQPHe6g9pxlasMBR0jsU2ouTlSP6NEQ33/BQm/uB2f2gHD9573Jn8N0WJDVb\r\nOZ0/1wjS5LR5p2gouM1/HYYkshooRSymoA4qRiX2QapdE+AzeaNXtVdowHkg\r\nRE6lLBb/VG9BTdBZdIqkMLr3CuYg7mpUKmV8PJKbZwwQfHM8xrMeYvsXFbPt\r\ng4pV8ILACSN8ZBHBrA+zTX40PXBBhl2+AFy76Kttr8px39Bpjtc6+rjBnTt0\r\n+9VVwq06CcwlBJvUlOICFOZ8Zcm9zBU7qWs=\r\n=Ut77\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6326d9e74ea48d9cecc2b6cd4ab979eecdeec1d7","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-13T04:02:43.953Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.26","@balena/jellyfish-environment":"^12.3.6","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.7","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.6","@types/node":"^16.11.48","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.119-renovate-balena-jellyfish-logger-5-x-6326d9e74ea48d9cecc2b6cd4ab979eecdeec1d7_1660363655149_0.8090560996654834","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.119":{"name":"@balena/jellyfish-metrics","version":"2.0.119","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.119","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5b102c176ec97426477075aa3ed17ff5f235e9c6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.119.tgz","fileCount":16,"integrity":"sha512-UQuGL/F1cIty36ck2KJb/EjGjMfLn69FRu+eWG55iKubpl+Pp0OWApP5CbhJiGpIzzqh3UuXaHrtkoErCreemQ==","signatures":[{"sig":"MEQCIFWXOecF/9cGUiiCDT6GNbhIJ8Jav+mpA+3CnfoOaiuCAiBa8+Em0U2YK030VAyM/pgqH+5PR5pXgmFULXaVORdjJA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":154478,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi9yTzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr1jA/9FK2OVq4sx7ESrBJYBCrWuzKtHPmSMzzxrGeVjyV/W7OSlSbX\r\nlD814eozNesHC/czkiF907x36elUpGLkV0FLVzxdPPwENquD+Xxo4FDdTS80\r\ny9C1LKUl7KQoOMkJa+iHgeKeTGaZ44GmixdrHy8GL55QWZUcnIPfsXlZUULG\r\nK2e90ODHg/8iBRoulel8PglaPK+JXkOXcKg0xGkyLC40LpfwZuRMyPVIDtRZ\r\nbWFtY1tCbmQuyBqVHJ/OVIz3nUUURZzEZ68YbSaI9rvUg1LGl4EcHdQAne+f\r\nzFFJWxdWrmRfe2lqwZsx3EYe2Swu6AXXJ/34k17j+DfUFcB0vZLw83abanYC\r\nf/oKWx4LbfQyoAOrHm8DsmarDU7oEZjqaJcbesmKxBHu6eTL+VB4Tkqd8AZm\r\nn+gyNknww/FSkI8X89cDlgkWzk4U1VDF9hyvUnlRWI0kMYXH8tAhCPsH50oF\r\nDc8s+lmZfHJ37VCbrC3AJ66aieG1tMpRSa7vR4Rw0dbS9OU+XuqxNL/DwITv\r\n3M4zH4DQ1qUsdJ6pdoE+c1crXH3FZyTLY2+5A/EZP3l+cgi3Vef9zD1JSL87\r\nv7lhGgAwiJflNKcHCvnL+LtyZvH6B4i0sUVyPwa1BZsJQRGQqcpsjkAkaOMk\r\n8oIKo3AxuNgLf5XdfHlkbMdqESQmFY/v/Og=\r\n=LE0/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0456823f794a8f873be3d7d5887684aa7e276c1c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-13T04:09:15.939Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.26","@balena/jellyfish-environment":"^12.3.6","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.7","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.6","@types/node":"^16.11.48","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.119_1660364019591_0.11945554606999864","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.120-renovate-balena-jellyfish-logger-5-x-263c78c50c5ca64526aa853882fbdd530c90f6e6":{"name":"@balena/jellyfish-metrics","version":"2.0.120-renovate-balena-jellyfish-logger-5-x-263c78c50c5ca64526aa853882fbdd530c90f6e6","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.120-renovate-balena-jellyfish-logger-5-x-263c78c50c5ca64526aa853882fbdd530c90f6e6","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4c0a229cc347b33b6486220b23c89af22da93712","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.120-renovate-balena-jellyfish-logger-5-x-263c78c50c5ca64526aa853882fbdd530c90f6e6.tgz","fileCount":16,"integrity":"sha512-iFWtFm/zISJzjsuwdzdvBJPbiBsog1FkA93PuaR4yIrGhyPfY7/Icw+zU/Zv16yYNVgtnGXeUM0fU6+bJIaURA==","signatures":[{"sig":"MEUCIQCiR/STY9qel/9QzrFfcIqPwbgS/V+3mpvbA16aZiuJCAIgbMoJDaxcw0dnbPa201TAIZMpeilQF/lCfGWshIIPqj4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":154654,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi92YuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpj1RAAllnKBVP5TTUftGu5QZqA20CNAuc52Kiz+eW9nmZgv4J1W3w/\r\nHSugo7YBHS+61ttlhQVlt+yHpR4hYGxXH8vuj2JMb7tgQosNVUdLqm0x5hrt\r\nspPuSypw6zx7QiGJAYZ2/eiLWzmI3Z/1SOU+d25svGIImN3i7X62G00OBBn0\r\nsatdAGkWlCySY7IXZ84uguLCBNf64UpqOekUt8Duasjll1mpz3fIQDUpeET/\r\nOgz6q77ro6SHlokvMXyZ/lHhaXga0y2cVz9AujCxv61xHyoshOsG3MsikzVn\r\nYzCnswHCabyzrtILowx1SfmFReJUrwdefo85q9V77WstrbinfJkZVr4paFDr\r\n+zx+YQ16TUTJ/LkKNn2cGE2xIZel07I39pD/jBc9pTHJTohF3Q+oX0oNYq9M\r\nY/xIde+Lktvceb68JapsVFpXgCtwl7edAvkf0N0I+UtfLX8h+I7Onh1dWBHj\r\nMidUaEFPxTno7Ap9O8dLYIm/k65dLqN35C7kfYJUBn32PF5MjPihA0R7CU7P\r\ng1tsc6ae9tk7OQf6pLAOyKJ1kJkslNsCSYfZhrfL7QsicKPlXxC9dNrV1ge0\r\nmPzIi589hrTTbRpXX7+zMZM+ID6E3DUFas3hBu2A8UJYzTyeClPOiQi0Inrh\r\nA6VMwpbcabg7vOdZEux6cd0ugXZ1JDcJCwI=\r\n=ALks\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"263c78c50c5ca64526aa853882fbdd530c90f6e6","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-13T08:49:12.522Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.28","@balena/jellyfish-environment":"^12.3.6","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.7","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.6","@types/node":"^16.11.48","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.120-renovate-balena-jellyfish-logger-5-x-263c78c50c5ca64526aa853882fbdd530c90f6e6_1660380718261_0.6427034744177129","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.120":{"name":"@balena/jellyfish-metrics","version":"2.0.120","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.120","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a571b02ea1616ebb6cac42c5d47f7b518b967970","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.120.tgz","fileCount":16,"integrity":"sha512-umObcOW6jkh8MarGfyWLRoO0Aq5lJ/9LWA6s46kLmb4V+JLjNpOf76lcyTEiYvM2hPda9KylpBbow7x8KBCGyw==","signatures":[{"sig":"MEYCIQCZ8HblyEVA6lOhMQVxztSe/6NUV9F3R94uA9HXd0BlGAIhAMUEbRiTy/1NIGLhrPgm5OkOq7Yr5Pdj6hmCMjJ49K79","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":154576,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi92brACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo3aQ/+OtpUnmZU3agoFzpjlm4NnxJOM8edooavRgHH2XeOHHM+U/49\r\nIhMaemIhtZbjjzfpXcb//irr5AgU15MjUKAjpBUwn+IH4OXezuBjvHuGhpv/\r\ndKDTEm+iN5eHSXGa/ujIXJBvCzIMvPGrC165aErMkCcJUdYUEXMfErmkJezx\r\nCLTvO1/a8hkmuJip8LFETZHTf3fxXaxsI3XdOOZq/pUIjmdCGzCMp2J2oswE\r\nWpdwrdWLiX9rVOhZEe1lUKZsoYYGcIC3zDWzZH01XpM0FsaxJ/EUa6HIS720\r\n11h0gLIequ1uXAR4SDgzkA/Ghd705tzkcabtetrYIFzUnibt7PNBot/DAYwm\r\nmTgxkKYEev/v/gLMfk17Q8uwH2Haem6s6QgWzzbZwTgGOWUcOwOxnGGO6Vsy\r\n6FvK0Vh+OGi2QvUJqy6RCqnYIIde8SJiDB/TKJURT5RE+S9OXjb2tjueZVmp\r\ni8taXP4QmnOXkCetUynmEVzGsIkLZnVUsHsKV6m10Fiv6NSysYjM4fybFXfo\r\nhF/FpeXpgG13+y9MozSzXpmjHbsbIbwlKLGcgggHSMsY2VmJxylaUYEJnKo4\r\nK96FHBlG6ATjvkHAZ+eh9bCcXMJ792d6pozTUqTqoLK6nHWHAY8g1L67WyJN\r\nfgC5l+6oVXT9IU4ePJXWANq1BGomGuOmYNM=\r\n=2VUW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"24b677a22f0dabee03365faf613503298a3d3252","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-13T08:53:07.575Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.28","@balena/jellyfish-environment":"^12.3.6","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.7","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.6","@types/node":"^16.11.48","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.120_1660380907236_0.07822057415868233","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.121-joshbwlng-update-gitignore-48815a5ef7281b0e6aa711998f44edd23b408b7a":{"name":"@balena/jellyfish-metrics","version":"2.0.121-joshbwlng-update-gitignore-48815a5ef7281b0e6aa711998f44edd23b408b7a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.121-joshbwlng-update-gitignore-48815a5ef7281b0e6aa711998f44edd23b408b7a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5b9b1a6e1cf8a443aed30e2d0e5055976ab643b0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.121-joshbwlng-update-gitignore-48815a5ef7281b0e6aa711998f44edd23b408b7a.tgz","fileCount":16,"integrity":"sha512-3H3iFlTctmoq+nQ5zq+Ivn7o0GnDvhbwJpXvyNds98/BL4VCSxAwjHD/Llw/ZhV3HyOt6DdtBAUYRIQb2WZFvg==","signatures":[{"sig":"MEQCIGQJNHGxL0kn1wTX6zzMUZ55qTU0UXxIxI+P3yQHd4DhAiAxF9Q0WU0e5LZeBcfJdD7ayC79djcduSrjcywRs5/80w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":154717,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi+zI1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmounw/+INLAC0Kqqu6hZHuZCiCLPoVUzuYl+G4nd7nFlumJozDDcvCF\r\n++FnbH5og4UpqLvOly3CqlH+syRbU66croTriXJxmvxQOkBKQOQsSZgANhdS\r\n+HRNi/d4zgnxPaJYAprRrZL6lyW+8WtL+bqiNqZ6hKB0Z+Y0fMpCuU++XeX/\r\n5ztYH6fiu7W1Ii/6mG963jSX1bgEHNa5AXoEhuWRxLVzW/8rUlLM1xqZbAw7\r\nLW7ORiChf6exYmo6Agvqsam6Hs0jIiCyRGlQXyUG2pDwHmjGNryiSpMqRtUO\r\nD7uM5ZwfUO1eYhehTLlcWmP5pJs6O0FYSeqCQ9dwJ7E8AV2hEeMFoPg6QkOk\r\nx9E0F+tbq93droWrYcVw+aphGq4QrEV1jEkrdVk4ZIT2h1j7QWGFAUP4wsgm\r\nvcuSo+NjvmJ1R9n0P0cm+TqJd1Ioc+l2id/sv7+Ag1RhPvW81sVF+80J3TJk\r\nLAcDM0MFgTcGEjaPyasbYrzaCaOhH6q/RMq71v2MGUPj0NlKeBL+NHQSzC4F\r\n+nNSbshzlAXbiHPaBU30AFrcdJDCSyaa3uM9qLwQaKL5+4wNkEJfA5U5gSB1\r\no7cyZIVLf/8p1k2rRafjypJAmWJjjBfQ7BM6FLkEyZwNF2Havjw1HcfpxyI9\r\nuX+/gOFw1Z4zX7B8LcSn1Ugo+LnlibI0oHg=\r\n=8Mle\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"48815a5ef7281b0e6aa711998f44edd23b408b7a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-16T05:56:28.015Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.28","@balena/jellyfish-environment":"^12.3.6","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.7","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.6","@types/node":"^16.11.48","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.121-joshbwlng-update-gitignore-48815a5ef7281b0e6aa711998f44edd23b408b7a_1660629557488_0.23231853782015","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.121":{"name":"@balena/jellyfish-metrics","version":"2.0.121","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.121","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c1ed8214fa9f4d69712b996ce67195ffefc00763","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.121.tgz","fileCount":16,"integrity":"sha512-POzLi9kDNz3iX8HRtK4wPIQ9G9ZNYIfar/vpyF9WJgWEdBIsPauBvw6MlUU6OA9lzw4wj5vsfHMPQVzXvOVH0A==","signatures":[{"sig":"MEUCIBiE5uFMh4khnafiAU2V5igaSaHcZ0q08oWxKXntE87IAiEA1S27y//BnamQe28fZlz3fSMl2q8dEzs5bfwAXPGsnDg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":154649,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi+zNLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrvcBAAmv7C/CFM1mj9Q0+QNp1M/x4uBI+1TMXfV7y9TVgglZR0tvkD\r\nyvrNlJLauCF43gu6KmjW1mWpTObQ12Cm1D2U+8/k8A+OfFP5DZxOW+iuQ71o\r\nX+BNJ+SDpl53KJGU2nNUi+7EecCDh0MpwZNyfshKTOke+yRn6CZctPWSwohD\r\n3lcHp93bYaaNYR9OTZ2+PHXfwYGlYqsey1+/gre3qI4YurLhgl7Elbse1u8M\r\nrVinHa8Eda5QywLAUmv2Ps07xeK6XiaxiKBdbwdGgdX11gY/wq8hCY3/cAqj\r\nkJccWKXkcMgKlIn2BmOg2g5DYSYvZ7j5g+vZ4BxAY3u8+AJfryWX45D85Yu6\r\nsn8xIUWkkfT8IvAIv8gDUDepILTEy+XWznBJaT8QEmI/BvAuu4mx+mtjCtRz\r\ntT2q/JwRjtAI/ssTSfbNUj6IIlNrHRSLRqVqvVd0x59CI1NP39HRzbmP6+Pe\r\np1aqzAB1nPUYmBluDH7Ia395T6NDdD3pqd0W+z6jHLNHcF/4pZwN5oQSJaon\r\naGImj+1/geuVV2GphG79YKyjvCU2irD3SqUSikJr6Vm5M2E4QsiVFi4/gCU8\r\nHEAbEoJVkg8t5nYQ1sYSgyAHoiy3ZCaOAG/zBtsLWx2kMcIMxPJ1NIzHVS89\r\nWeKWhympguFHdUeqOSMoKOR7FQs0TS4KAdk=\r\n=IfZr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7baa676da1bc5240c082b94e5c6c44fd3b46765d","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-16T06:01:40.806Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.28","@balena/jellyfish-environment":"^12.3.6","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.7","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.6","@types/node":"^16.11.48","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.121_1660629834800_0.38816150633664925","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.122-renovate-balena-jellyfish-environment-13-x-f9313bdb472ce9f12d0557cfb8b79cfc9b70d4b8":{"name":"@balena/jellyfish-metrics","version":"2.0.122-renovate-balena-jellyfish-environment-13-x-f9313bdb472ce9f12d0557cfb8b79cfc9b70d4b8","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.122-renovate-balena-jellyfish-environment-13-x-f9313bdb472ce9f12d0557cfb8b79cfc9b70d4b8","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"acc2ecf282fb5ee41a5985dde6df1575e769e7f6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.122-renovate-balena-jellyfish-environment-13-x-f9313bdb472ce9f12d0557cfb8b79cfc9b70d4b8.tgz","fileCount":16,"integrity":"sha512-LFeU2RWg6bTBEBc+g/1ZB9q6nyZHT5jnH/wAwxSatnkIsmIEXPmdyeQUDiv14YJ3tTrzpYHOczVCjaiBmvIOlA==","signatures":[{"sig":"MEUCIQChtbqvm5nsB1L7Mua2JosYI0Ukk+rfud+kNFiHDHR1KQIgFq0Zdx8wkCmamuu3OafUt9AJ1R5iySgkKlKiPu1Vwl4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":154836,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/FyoACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqKXw//dj5AomeffJKb8dZPy2xXSmbeSMII6M67KCXeHrTWUkWkWsRS\r\naION3/+yk1tSGz3xkVGZFlYDRl/jNCWaoWUb2atbf0OsF83YMELUgqS7xpoi\r\nN0S/w5HcFmCSw8lrzwAfYSSr0pkqrRb8Vgbkdkti8rhkIbEXQdRoWq/8sYul\r\nge/d24KVt9iNnvW9uDPsA8D2B/rEbpns5ssYXdgcUxegrKpnQ369xu4vlrAW\r\n6rBJjIR2TsKK1lhe36UWz7dwRs5O855CVaS5gV+BWfN3j1QI6ibxnmEV8gCd\r\nDc4A3tJyc0VRb7HI3WSdI9m3I24YeLJ63EyP/JYbvIN1TdG7iUs8FTV20UHd\r\nbGHrtssEFMbRA53QVSS92Pgg+1iwFz6P2nviVWU+tVEWtZA/ug6z3cbvm9Bl\r\nCVu+wXclis6NrBUNw5o2Cq3GFXov/VkHS3c+fHRiFeJ1TNaGj22ov7JJMAwt\r\n9hM9xkJKHkQDMcR0YMwrzlwe9YrkS+2SAlHBm2tstzy6ussdgG8GUphHxNh6\r\ngRR+MSM/jKlYvvJCyt/z0DSuK70LgFPL8AKCLyetf5JWcwdZPcTK8NvM2kKg\r\nQipS9jo2x5skmF0ZZGqZhxvkrzwZXOt5UwZp0vptGWLhGE1SbKQLuOmORPnF\r\n4alzDuc7G/fPZ2uSagaRnVOBiIBMVpBTl0Y=\r\n=p0oW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f9313bdb472ce9f12d0557cfb8b79cfc9b70d4b8","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-17T03:10:12.127Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.28","@balena/jellyfish-environment":"^13.0.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.7","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.6","@types/node":"^16.11.48","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.122-renovate-balena-jellyfish-environment-13-x-f9313bdb472ce9f12d0557cfb8b79cfc9b70d4b8_1660705959952_0.5918649531879927","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.122":{"name":"@balena/jellyfish-metrics","version":"2.0.122","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.122","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7cac9fb506e0114bc6eff36a7c9e665392e26525","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.122.tgz","fileCount":16,"integrity":"sha512-RZVve4LxfDdiac81HXNykAPMbZ1505POMiahmJ9EF3zO0tsRSWGzgz0xlys34yAFM9mdNeO+nycy0z1O/JIRqQ==","signatures":[{"sig":"MEQCIEEZHnRYEztXVYMwkZ6j2XjZNIjOxl+e1d76cQGnH/OuAiBxUv8WLfcp7mY7TTpn1DgBbpyxM9cXOSyfeht+qiBG1g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":154752,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/F2WACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoA3hAAkpqwPJXLm8r7bdqVwQzBlNaElUqfkG2/5i+fd/mBm8Kkh90o\r\ngiMtBMiJR26ir4uMbQNrCqBkLpLP+YK+E6hU5L9fnwbTInTc7ChTDVa3vYtm\r\nN2MZhkWTxxTulQ3tf34xnBpANJuWsg0SwvYxmixnhBucE8R6P9N1BoHBCOcS\r\nwLnpG8Z/RrYJ7/KxFr4PizG3REzh8qi00EUzivnGJ4GbLAvnCZj0VkuZMmq3\r\nefpVCtV5+hhGcjBbjxfO7d+b/JcMvs35+9NS0ES5SWspIOCgwT+DWKmoNzCP\r\nokLTd2YvnooXdYq5miF1x8yEsRGi0afRP9NMv+Zr6plhPapWFcvyz67igzOV\r\nQBH00B5uzNDlaTXRBjCuEntLnZoeshORZJyXQ9TJrKSHvK/K1PvYQgUxO9h9\r\nIV5cez2DR2derfj7gYkY7htPOgTGXPb1rx9UVsE5CPgQVgsDLEVvNmuCTtEG\r\nJ8FXbw4T1csA9/fUqm5cSDIft24iaFD+jUqbyGXYvIbjV2uuD9F7pi6jlYS/\r\nJiGDGbOcCUBNIHBTj64TPKdDsMcxnPAYx/0xcUh2cdkgpHs2IMqaHfY78Aid\r\nBxCCY901+1dYzh4scF7sdeEWMi8xMQu9v/Kx6g7HbQmdyiv2w8eb2q6buz5h\r\nG+zBH2jfZKOOQ2NImxF7MInHyJUHI7ThwyI=\r\n=2EzV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b381a89c4460694cdce90d34ea935aeb28c97ab1","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-17T03:14:15.701Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.28","@balena/jellyfish-environment":"^13.0.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.7","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.6","@types/node":"^16.11.48","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.122_1660706197854_0.2547471544093698","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.123-renovate-balena-jellyfish-logger-5-x-bc953898767cdfab6174133392f9dd3066e4a26c":{"name":"@balena/jellyfish-metrics","version":"2.0.123-renovate-balena-jellyfish-logger-5-x-bc953898767cdfab6174133392f9dd3066e4a26c","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.123-renovate-balena-jellyfish-logger-5-x-bc953898767cdfab6174133392f9dd3066e4a26c","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5177d7e95370d42a9e7d0e7fa5b4fd56ce2fa752","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.123-renovate-balena-jellyfish-logger-5-x-bc953898767cdfab6174133392f9dd3066e4a26c.tgz","fileCount":16,"integrity":"sha512-nTgbYYJb3d/gUw2y548AUIcWN24YgyqrXQ963/duawkDPX0hcNgRX7xYB00MvlbsZ7c2wDztkHeFYkmilAPSgQ==","signatures":[{"sig":"MEQCIAW2FfgtRv/n0I2DLee+3/UV9sjTZ3EAakVVCvvGdgeaAiBc1UNg9q77RY+zNj68NPHiywzp2wyRdbdQ4MC5hcgeqw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":154928,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/ORwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoP8hAAixRDxTzx4uWl2u1XCT2GnarkAM/jhlEOxmD7xb3nrAPZ8xHl\r\niqIZjAAOBuBdtl5dBdxIIai6P2M0J0DHsHhJkjWjXIcNaZNpmenrNGNzw287\r\nkzbU3+5+AGBrNimxXBw0fqQqCbK1AMm6M6/QdPKaCnSfY4gh+u/E+Fm3uluv\r\nfxn42P7nUkupmXzs6A0LH+/C1gIS3zPU4zJyl/Hhdl23ZSLCtuU/MjaOsoBZ\r\nuQq/BwwVUeUefF1ntJlMOejFEOKlGRq0QR76sWrZXdj8tc82U2tV5r2FneuF\r\nod65VoH7zQoDgrCXPt7WsXIUSuMtW7sv2amq/hldCiwcFC3WrDdJfioazE6w\r\njgD8qMArJ9gKNxF5tc8SbcIu9FnJAFdCj63H+8eXOpNhTeNryUMfNjPBdZAi\r\nnrd5EZbkMZ2Dg+rKosfoA/VhwvdEfy4qDGDNRjkX9bi1zufMTG1od/6h3rOB\r\ng3832Hm4bX0e/T0+T5iA9GQnI0uJk3SiSifT6foBBHqy5dS8VfjrXznaEvjH\r\nbLJzF3QCeBZmTxskXXkbwVPPQIekB6zyTMyA3h7UtV6Z45/SzVO0lveOQjS1\r\n2dH0qqjnbayQ4pT//CxpDmShIKSB1VNMtq0XeEu126wxtyndFmoNqlWGNCS3\r\nFxyXcuBmUn188/T7rnEd2molqJdaakcBztc=\r\n=c7Ta\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"bc953898767cdfab6174133392f9dd3066e4a26c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-17T12:48:27.359Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.30","@balena/jellyfish-environment":"^13.0.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.7","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.6","@types/node":"^16.11.48","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.123-renovate-balena-jellyfish-logger-5-x-bc953898767cdfab6174133392f9dd3066e4a26c_1660740719703_0.00787019646691589","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.123":{"name":"@balena/jellyfish-metrics","version":"2.0.123","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.123","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1f41c34205a7b45698969a558e8426eec2253995","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.123.tgz","fileCount":16,"integrity":"sha512-tyDWCafDMlp5sEzhakTRBGKQFo1w/AuQN03qnhXY0iJce+J1xczeFv7CQJD8eWVXXy4sqoDp/E3ZW90B0MSJIw==","signatures":[{"sig":"MEYCIQDmV/vz1aCxSNoHbPf8FVKKQKnkgvbz+OyKy7XVibETVAIhAIBD/4OmbwF9n/MGz4NF+B3ivn6XkQkKT3QF8rmY+99m","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":154850,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/OU6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmowRw/+Keq8V7s9lYAYcO5X86PgrNDASJ4OrcG38fYi4hPtIEfQRstQ\r\nN0JfYX14z1UBlDlXzjb/5XkApBLX3YeL/i44GHDUsIjt4kST/E2WgKVRlbhx\r\nYleNuBg3+cZqFUuS/cCvDJ47rrA1G1x2JVCT/nq66cgE/dVhYPwzQYp2zcXR\r\n98hHoJ1QDWohO0dmOUi3SuUNR+Q0RjbKWdlsW67dkwNugxA7v7i5azb/kD6u\r\nLDaCJhv8ufqXwvchuULfoqB5cS9f0pQhA0NcXqIpXpv4JABvqPJp/gm2iOR0\r\n8DYkRRDUWJp4GhmyceQJARKsGz7LPnfjsVrATV6SlMBABedPhW9l7/tQe5z1\r\n0LKWGPudpYwX6qxPWjMaeKXn4A2FFcEq9axvKyaPgVhZpMI9p8UZHoPepXeo\r\nlNpWkc5BDk5ysB8AyuHDEGfByzby61ZnbjG8QfdA9AEu970xHZB0tiCRDdu1\r\nSxpYip/HTw5H4VXCLUNKlh5h8ksPteUstHWgbhHmk+djpPJ9GZM0O7ssJ+l3\r\n0CwQVj2U4bElwY37wOuWLZVbHjZrf4GmcKhtvca7hEkhY4H0RCDY9eeCnKlE\r\n9YdPTfCZm1f7e1ESHyymzjIMpdhl6nS6ko/DBEGX6gn79Z93WAc/mmCp+8QB\r\nQhxjlEbwjC3inb+qbCZUQYqBcxX1YqQriC8=\r\n=S6dH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0e7a614b003a052f31fc13ce065af3ef70f39a1b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-17T12:52:48.539Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.30","@balena/jellyfish-environment":"^13.0.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.7","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.6","@types/node":"^16.11.48","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.123_1660740922230_0.5954586424151833","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.124-renovate-balena-jellyfish-environment-13-x-1cda68c610100911c6df98e5fb8b7466e2e61929":{"name":"@balena/jellyfish-metrics","version":"2.0.124-renovate-balena-jellyfish-environment-13-x-1cda68c610100911c6df98e5fb8b7466e2e61929","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.124-renovate-balena-jellyfish-environment-13-x-1cda68c610100911c6df98e5fb8b7466e2e61929","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fa7e8453a3322fc7a12aaeec64d690ebc32a99b4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.124-renovate-balena-jellyfish-environment-13-x-1cda68c610100911c6df98e5fb8b7466e2e61929.tgz","fileCount":16,"integrity":"sha512-Q3yRUMvZKIJ7v7DqQOSiWjcGCkwzcf/GRvBG2ZcZjq23EB6lRZtCOucjOWf4eWRdqE9v2dGoUI0KAzBh891dFg==","signatures":[{"sig":"MEQCIGtPCFi/xar7Td/NuNrqQGoYGxxL9zfOtNmI2Ij+rA8sAiBTwRZf1Myqh/uiC2DQVrPSK1gO5ikM22MJ7AXd+NYk8Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":155037,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjAD8IACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpmSBAAiPmXOslIljqsp4WvLDKqvTbbx0mJO/hVyJyWUEDxiZwSaL0t\r\nlcRmLHNwqzkEKpldnSd1TpKrHr5sXdE1r04180A2l16NQuoa/QLuBYDj021C\r\nED5BQAFPq0GcsyRrp6z5ONDWJY1SSGjiLb/xxDbaGA5rLnx945vXGMRuUyVu\r\nWg0S/KC4F2Az6MGD9tAx6SXubgbNDOgHmno0ZHl2g4RC5QFMYcVw+wog/I9O\r\neTcS7hwZawEuK0QGWjSmg6ue+vEdA4ZwpwcZPqFC9AXPmKs22x0+iWa+zwCp\r\nNrjcvj9g0+wNt2cjwTAYgOJ/3Bk9ruTdSsk7d0bHURm1bsufDjcWX4b5hYyA\r\nIIbSnSMrzLW/vkgd73lG4/3qKabiPCCPAbzcj2KoLKafAWdtSofnduMAorKd\r\nsqQDPNrtLCKVFRi+2ffdHM9ywJRgXA7vyCerxw3rOaagVI27tziVmyYw2uA9\r\n7IIL5Q8lDbeL+nGnp9M6dVmdhzGPWAOUn+92tNrnvHt8qFIR43FjxKVij9Jc\r\ndWe9B2SiiPgk6TC/MHBTLpKGe9KTVRvMnlFpiJebwiNaVVbCVS4ncSeSNhIG\r\nIN83zQIta69irwpky5nTqaERmrChVxyCzmwZmkH6C6hrWace0uVSjgsqYYFc\r\nQavtL9oaUInbAmIzZLKIc0SfeXdoX6Gzlqc=\r\n=ywmf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"1cda68c610100911c6df98e5fb8b7466e2e61929","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-20T01:52:17.928Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.30","@balena/jellyfish-environment":"^13.0.2","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.7","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.6","@types/node":"^16.11.48","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.124-renovate-balena-jellyfish-environment-13-x-1cda68c610100911c6df98e5fb8b7466e2e61929_1660960520484_0.25044810595694833","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.124-renovate-balena-jellyfish-environment-13-x-47fcbe128f184fb613da37b03a97342484865d08":{"name":"@balena/jellyfish-metrics","version":"2.0.124-renovate-balena-jellyfish-environment-13-x-47fcbe128f184fb613da37b03a97342484865d08","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.124-renovate-balena-jellyfish-environment-13-x-47fcbe128f184fb613da37b03a97342484865d08","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8b5d24f40955d16359b0f34ffddcdc938454e202","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.124-renovate-balena-jellyfish-environment-13-x-47fcbe128f184fb613da37b03a97342484865d08.tgz","fileCount":16,"integrity":"sha512-1goCDk5kkl91S8j+0CEyJ54MaRaVf42c6faeAL6s07ugX2UicFbNz8Eb1FwNsieSJvS4GSMc/eWZ3GNst0yxgw==","signatures":[{"sig":"MEUCIQDYWt5R/QSsv+yOpJ0e+CY7RRk2XGkw7IxMArsy/BZb6AIgTi3g/STrmiY12Ti3m7TLCU4cl5EBS7fgVYAxlE0niY0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":155037,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjAD/KACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmodyg//e7aUH3GvqGynRg38k/dDe4Bs23gXwcUtXmTTxJekrDF3kTxU\r\ntOdQbXgozQKLcOG9hHUZuBawkP3RxmGy0R+W5l/htOGbnXUkZYhPA+/eCu7q\r\nonqfz4BHSA3U8zJnryjkuM85tH3nk8pmXPKJHq1dzHo1eLNc4nMKTtEi/ttf\r\nZTF1vAxAYMKR0u/nKTLCNq3/fJd6ZsAibxkA2chnjeMhU+bUdsUXO3v1rxee\r\nkkHoJgFNDrRgl0nmhDF6R+ePoUS05rWEICxHk5t6KTETwzDla7yuZNzDDgsO\r\nP6SZzFmZcAK9QTwpabWMv7r1idSC13bEA4q40DuKmGJyW/CFXEmyq8jBbNQ3\r\n9kY1aPnEFWbshR1CaPbO742ejeQce7co9JMDuQXPogbGS7GGbQCf+0KoMl6A\r\njx9AGo0ylu0borA1z+8rCJ1iZL9Ri9JvpliAoBCZ06GbmYFt6S8CBTeVUpnL\r\nL3w2/Ezxt77xiPLHSKj9FEyAi4ixKtg4ErGve7mP882V/rcfvBZeDP9EUNEL\r\nD7Pj4PoYN7QET+BG9/6cLVe0utGbn6KxV1Tdzf066M4DVmcW30/KtFMxFZwv\r\npoo8Kl9vWlHXIoobITIkCHMWR28tO5lTBECb3a/qM0FqohwJjhT25aupoPgL\r\n3mjkp8DRWE+uSPqBLXJe6OxLcbqlydrmwLU=\r\n=rAtW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"47fcbe128f184fb613da37b03a97342484865d08","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-20T01:55:42.790Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.30","@balena/jellyfish-environment":"^13.0.3","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.7","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.6","@types/node":"^16.11.48","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.124-renovate-balena-jellyfish-environment-13-x-47fcbe128f184fb613da37b03a97342484865d08_1660960714174_0.16655197126020527","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.124":{"name":"@balena/jellyfish-metrics","version":"2.0.124","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.124","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0598fe83248d8bdcf912cfd6c1b37dbb3dcbe066","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.124.tgz","fileCount":16,"integrity":"sha512-x1rq809noMg5H0SiRSZbgMvM027eYtOtn+6rehBA5YpaDpRmSKbFLqwpOYTFhix5n9vHsIMxFMjFof059k59rg==","signatures":[{"sig":"MEYCIQC0qKdpqvn+dO8nL2pyRqas7BwWX181Og623x31NYCsPAIhANfxkLoNBLUM69wT0Ish+1SuhYc7ciPRufKT+6GiyQoA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":154953,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjAECIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmprDRAAhwyN9EaRj7c/HBD0LyvjTAaaAZR7p7tBmVln/IZmm8sNgRSl\r\n5qgg0i7ekLvHVg0yAUMJ73DN5vXbz+iYMZZGTD/EUxKciE0Q9Ramc2bVjCji\r\nAITjgNp9FZGpv1GvPJwv9yYi5w0cBFBeQ6oJ+2vUBos65VAhsP1EB1s5bqBu\r\nRgdZ+7YDDjUsjxdkSe9Gtl1VUG49et72DSBb/j7sqV5/ra5XIFraE1WC79up\r\nh7s4A4Nv36M+w9rK3Rdl4d1j0PmkCofDtC72J1npRLtJbcrYRV7zeaHw84ad\r\nbBlDNkRAojnUhgjVl9mjLcl3b/3hx8C2tz+q0Xrv7VK4Bd0ZyEKsQBOkG5G1\r\nK9APb/Zw0gCHFcNWuZqKbP6qMv2zNYrju8oqPV5mewV1pKb/74agG8tiaWOy\r\nsHm8z2GZj+ZBus8irxcpIbaCs9PBiKL6E1SaaOLMMg7ytDiSndd3Od0X6y8s\r\nzom5IXSFc5khvoOFrU4wofV5qKZlpDFVMae5yvpYF9kWofOQAZwur2Gw7kUW\r\nst6YgwphejryxaQzX2voAEm72D0RukrNF7u88biNA6AfJNA8zJoxHX9nOLcG\r\nwnDPszRcyHer8FotfN3ibxTLeSv8zNOqDSw6M81CPyHjhUE3fhSRQ+DbX3Kk\r\nd8VpFk9sx4CYarof8IVqSSom0/EOqAi94QA=\r\n=anEf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"264c6532f130de7d928ab2082f9b183885e97a52","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-20T01:59:31.181Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.30","@balena/jellyfish-environment":"^13.0.3","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.7","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.6","@types/node":"^16.11.48","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.124_1660960904559_0.5678110229248405","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.125-renovate-jest-monorepo-779ac8479c36fbbdacaed5cdcbe9f70846080196":{"name":"@balena/jellyfish-metrics","version":"2.0.125-renovate-jest-monorepo-779ac8479c36fbbdacaed5cdcbe9f70846080196","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.125-renovate-jest-monorepo-779ac8479c36fbbdacaed5cdcbe9f70846080196","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1ce9f95405435c8b7fa221370196d72cf4e59a10","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.125-renovate-jest-monorepo-779ac8479c36fbbdacaed5cdcbe9f70846080196.tgz","fileCount":16,"integrity":"sha512-kcbVCt6bp02/lqkS3cLxb2SAMlZVkRcnuj/3BwZKljh6YnpgOF+gHka8yBH/AV3sxt/PMS94pyaHwfr0rx+UuQ==","signatures":[{"sig":"MEYCIQD5+UkTCKe2RU47d4baQmlceInzlLw307ExnUfrtXCOigIhAODcVd+huHOPf7lVecYl89N0DJ3fKn2pGwUXAFkLLx39","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":155102,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjAEFTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqVAw//ZDSXojlkxP6qNdi2vm8IYJDLnD422gZTRZQI2DIQOzOhNAFR\r\nOYEKwb4dUR80xjWHE/Nrn3o36LOJFaVVLrYUh5ZWd+Ph6jUQ7ayhPzzkAuFJ\r\nI4hOo5M9kJpcg51pO5FY2f9U0oYZmtIewE7+FJqjj1JSd/KHb/sa5SWXo/le\r\nlWo1/vsGr8zQD0yrb9K07U7nzgiSC9oxIaNKLwMBoXU4an7//vxY2nITqkHG\r\nq7sXz9GWGf9Kbd61WnOdCtBltR7jhry4AgYDpUCkcC9OuiTSHLtPWn/o4N90\r\nv6ncj1FZ+CMdso2ycVoHDfy/3p8aib2sUFQiqh7iLHgkPKKZhGwebhllaKS1\r\nw5xqLwd87YVVncUxnh+mx98x1vaqDJLM4QOAfh710gwdRa7NxAMwO9jaH3XP\r\nouDEw6S+6awwJZzoCe6PguX/Pd+cY8JGz5ObMidRDzYtvQpSV0soMxdsIDxg\r\n9A+O/0WyztzrPDWL0OrpO4Lr2CyQlJG9pI6JZdCrmWYLoaRJ2hEQauntqaX0\r\nsIQbv6brOjOTIEhZfmOk5tESSJivMCWE11INPWj+2dPoRQKmZe6EaQ0rN6bM\r\n5OtXGY9y39T3HDOROAshqPN9pLYuJhG1N8asYnOFnk85prtY7yt8YqIyPvcN\r\nDSRVYGx2AMxiDJzSrJnB46jqsPn0tzJy6eQ=\r\n=Pc3y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"779ac8479c36fbbdacaed5cdcbe9f70846080196","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-20T02:01:48.402Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.30","@balena/jellyfish-environment":"^13.0.3","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.7","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.7","@types/node":"^16.11.48","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.125-renovate-jest-monorepo-779ac8479c36fbbdacaed5cdcbe9f70846080196_1660961106580_0.3483103331034818","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.125":{"name":"@balena/jellyfish-metrics","version":"2.0.125","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.125","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ff5a6870717140c76a602b6e2923577a39de0550","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.125.tgz","fileCount":16,"integrity":"sha512-jtlMuh/JYfkMDOUVfILj3cqHh/ZRbHzzzZoxoVigCvCGu6m4gNZ5TYh1479jH1SHhoapf7JMMssv9dMk/Q10CQ==","signatures":[{"sig":"MEUCIH+LKRN4G0zJZ+N8Q4XRf1vFCydP/6K+4rFcaZKc1KDzAiEAn4AdugTCbhoqcN2ELCAgjkVl8IdqEUrahF4piVAzB/k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":155038,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjAEJ7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqZ4w//RCdAXAh6Xcqj3gamuYyxMqxFuwgLszp0zMZ2qiSw8yi1u4n7\r\nXG1jOETZJHjWfjHx9QY+AOV6eGqD2SlmXWWll2uihvF3vtQ5jqHRC+Q82E3f\r\ngVGRDi4f+MpyGtJ7Srvn39Mv7XXp62uGGF/ZSQJcXWGGvvHZUOYUhoU5r1rY\r\nnibIHacEyL6XNYOJ6rHrfbCEeUB+weSCOdkGrUXvLwOA4azMNXpPGmPfLBFh\r\nKkjUkN3oqVgIC5U9DFCLE/vFXTCY6F2pNz2eO6RulYYUPg1291opus3kiAbf\r\n6GTnCKqmjp4O75i8/CfoA/0WLns2/bQimR/bGJqNHllMI7qOWdUUaUUWNXu/\r\nVR7QMGSrNx2psVt6bu77X0JF7oCXbTFqiI+qfTVEdiHoz7uzdAq/w8CeA7jB\r\nQdAIZw2wDnu1Ut5xFBnLe3DaS3+Z2u876Zclu8uXwCrtNcrD+G0lz30E3OZV\r\nmBnL1iTuNf6gU/gZEgWvgfyyFzDBBAAtCRgn8prSg9Ij0XVpuLSzYN/cDW6S\r\nLIMe4M1Klgdyme3znmMTAkpQ9dofrCiHGiRuXaHUE4MghT9wOKGbObHIeuBi\r\n9w7RO1L8VSpBuCMsWqzVOpF9k4HLU6yxcOLVZVpZXo4bI7/ieNzgjemLPXqa\r\nAv9UP0U0IRGw0TO3Q2L0GP1Xwwv8D0GpBHc=\r\n=Bpj8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"88fb1bb44e52a086cea6f585d3b614afc9840940","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-20T02:08:00.176Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.30","@balena/jellyfish-environment":"^13.0.3","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.7","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.7","@types/node":"^16.11.48","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.125_1660961402992_0.7619266877370792","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.125-renovate-node-16-x-0a36feed32da7830e861ef1b1a585a75f72ddfc5":{"name":"@balena/jellyfish-metrics","version":"2.0.125-renovate-node-16-x-0a36feed32da7830e861ef1b1a585a75f72ddfc5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.125-renovate-node-16-x-0a36feed32da7830e861ef1b1a585a75f72ddfc5","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ac486bc5806a123ef951c74a999b7a0b2fe904cb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.125-renovate-node-16-x-0a36feed32da7830e861ef1b1a585a75f72ddfc5.tgz","fileCount":16,"integrity":"sha512-gGm0jJZf9b1z4DAWRQqIej8Q2CTW943ui+OuU0K+EMLMQQgzd95adCquzf8IEDn7ngaXLUVBM0wjCMyf2wFNKg==","signatures":[{"sig":"MEQCIEk6hVrhhAUpnKaWwaHp85PlmAGGVgiW2YmFSaf0qeBCAiBmS1XN7mdS9DxemSBJlpqz2ZMHS1rh5qb8A9zVdANbaQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":155161,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjAEL5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqMaQ//QfehBDoJRBii282U6vpf5pHbwdydAj5iWs9egt/73o1vrNll\r\nLyaJheB3nKUmz9N4ZJ8UrFIlkmFCC0ZelKh8ZVoVv9Y18YSomQLG+1UT4Ezp\r\nw8xg4IXqaelWCSAXY5Hd6N1oCe0INMClWkRb83FVm1AB7x6YWknCMDCHLooT\r\nwooIpyLwOv6LsZPhlyPUMZwwTonOvfGmgk9QzZ9fNsVeNiYAg9pJdB5B87ZG\r\ng6d2WEFdTL31k0hwmuVArR/yJw9dCJZz78Fm6JLQ6HTZvH+OiXsGPVZSyRQG\r\nzPw2v0uF9D5X5VvZI7BKw9Qm/anKzCCrpNCXy9bOutSpzmNzrLaOUS62X1N6\r\nHSHZBJRIy8KjC/waSiEExc+5gjbkZpx31pM2aXdvGgs4oZB6DMVqEKhLPblk\r\njdpcG+ksTLXb8e3Q8f9ynaahUNpROilZiFN1HFv6FnAmoUu/t0BDebamQrls\r\nOuaN4j3AdZLpAjEfTIq90Nunus69lglTIo8mkq+1AFbJrGYzb1rWHmEpJ2HA\r\nHfCV+RbsIGJ3fgDPQPZ/2e9fJ6WQH26l6FnZmCvHbT1Qko2TE4qd2w4U1YSG\r\nXvpssxZigO8tg7d/a/HYkvsmig8veOkrbh9H1CqLMeQSNcS/NqmDR1GUJ2eA\r\napc40rqOfpwU7HD/IwoRRtq+0OQ87UGLmGo=\r\n=tuDT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0a36feed32da7830e861ef1b1a585a75f72ddfc5","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-20T02:09:09.297Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.30","@balena/jellyfish-environment":"^13.0.3","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.7","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.7","@types/node":"^16.11.51","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.125-renovate-node-16-x-0a36feed32da7830e861ef1b1a585a75f72ddfc5_1660961529126_0.1274227152217","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.126-renovate-node-16-x-38df798aedfec74564848202976047378814ee1f":{"name":"@balena/jellyfish-metrics","version":"2.0.126-renovate-node-16-x-38df798aedfec74564848202976047378814ee1f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.126-renovate-node-16-x-38df798aedfec74564848202976047378814ee1f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"46d884a5a782ef7bd46268ac238c269b55ebfb2c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.126-renovate-node-16-x-38df798aedfec74564848202976047378814ee1f.tgz","fileCount":16,"integrity":"sha512-eMGCLiJ5A3dQHrXt2XXe39UdRnhMP18MOSsoQPwW1VsUwPqX/G5+0Z5Ic9EQXSm2gcBIIkZN4ll+pRRChupU/w==","signatures":[{"sig":"MEUCID2NPgnMYPMvcgtzxsXr3rkb8SXQEzAhYZFroum6bhHJAiEAuC5XnS0BwiOhPJEQZr0epalP4KZgkUuPz7c92XHlhKk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":155187,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjAEO4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqWVRAAlnb+7v1hNRLOYKN7/YwHpb21ADCkjXYB2E04OdaCcLfObZCd\r\ns7Evb9GWBHlcwIzahzijDW47vnVO2scadB676q0nI0LvgGGJa45ag+UUkHnl\r\nPnRMF5hu8yzq4wMoZw89TRngWDPEiGWdN0vbegV5zcUG4JNbK2KaZm1q4e3l\r\nqarEVn0j5GfYHi3dniAkrTwsKHyBaiOJ5eUC2OUcQtfoJq7fn/uCM605H6+R\r\nyA8qfoXxBSf0O1ZqvDX4rGrFttCm1+C4OZHPrUtotFEdZ44k6mhAWwEHiQp+\r\n0uN1mk2ScUlOFEJ5MZlXVxc2vpS0LVHTy1PBhAxf1n1XG3tOOYrV9Zmb9wP3\r\n0GftYQ6HYC5cAibtd7eCIZA8ZBw7Aoj9xDuze/7FDZxQQ4PFmGmwpnszTcby\r\nJWeF1wKxBcdTcrZjCLy3FrDH1lPCIyd6F5p8sfLPxaAyGckWDeZgJqkkCErC\r\nzXzSPYcUDpqVi3cYiltnub9uAyOM3m8YNwWO49LQ6vRRmAIq9pImXM6qo0iW\r\nkjcxEifAMsm4Xtsg5Y6NydtpNG74FmUKH3OyMHXNUuYuicqf60z2LCJHTm8V\r\nAEGXT+BdByAFnGuaNle8yfc5e2+VZc12BSKDQsOKMQs3CiW8Ej5pXIq9eVef\r\nFXBnleH/VnZtLhqQT28+mxLtgypIlasU/tI=\r\n=iy3Z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"38df798aedfec74564848202976047378814ee1f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-20T02:11:49.994Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.30","@balena/jellyfish-environment":"^13.0.3","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.7","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.7","@types/node":"^16.11.51","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.126-renovate-node-16-x-38df798aedfec74564848202976047378814ee1f_1660961720154_0.38729845828408616","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.126":{"name":"@balena/jellyfish-metrics","version":"2.0.126","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.126","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ecfcfe4950ed8295ef3bf079ac65e00919bdcd02","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.126.tgz","fileCount":16,"integrity":"sha512-gj/lvyD64fUAvDRfp9C9SftMU80zbimeXEwO7EJkwXKg5HkWmP5RKu1ZQwoTus/vkQwD3jJJoiPvA1B5XMNPGw==","signatures":[{"sig":"MEUCIDZHIMNv2aikjr69QW8MG3sgfVb6/Dlqj5v+eKp5fHANAiEA7n8CS3Fgc5FisbrcnUIWosNFqPRRkbW/TRLXTUq9soA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":155127,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjAESLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqI6w//cGoE4EjlUjzCO11Gvd58KJR1M/W2adWAveJCN+GfgxxAruac\r\nrpEzsZ+DznrPDVKIijV8NX4aAwt4dERHW/7CTEKn/MRhEgZYJXnjGEqXYjbr\r\nnz6lmFsBbcTWCiOCKGvbhCI1gfRv+r1U1Q7OIdBy7d2FBVS8b1grUNcRZP4l\r\nWJuuoMNcB01ilcFcGxiIYOU9KO7ZQB5GFFUwZl8XZYXPZ9VJZXTZ6AsEPeRg\r\nO1Pn7FwIHE0pop1QhJSQ908j49mEFwCcR7rDiA95xSkghwGawFaacX3MzTWb\r\nafv2OarxY/y54kEvbeX87WPbbp8Iwsir82O3bp2U3aqH09dwXjKLQqQ/MZ48\r\nqKu8hbRF+7RMnR0u/mrbFzhSEL5mRdFcVqYkkOK6L8HJbOGUROrkeJzW+ky1\r\nZk7rKZELDQ6kLrggaDwpImzUJNXS364xrUxZdGIBTE73gZdr9bR7QIElrFBK\r\nJxir6RSl7SfNyLY7zLY+YvDtPfIYGB0Ga9JSUHDlcpLLf2ZdspCCdsGtjpXY\r\n5XUO0WtFAjya0wAUwFZKZ55hsv63u99AJrwQV0JH8EuKt7apE4D6I5mtG/RQ\r\nQ2e+mSRAXydpw27moRHwGNXJr89pQq7sExrRaazIhKp8vztCMryD6M2DbOBn\r\n+jwuAgCoexbAPuR9juBBdocaFJiyehPUNBo=\r\n=frZL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"48d7afbcfc3acc2a691ec43217a7e5fd14303758","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-20T02:16:23.209Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.30","@balena/jellyfish-environment":"^13.0.3","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.7","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.7","@types/node":"^16.11.51","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.126_1660961931246_0.04898780394872526","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.127-renovate-balena-jellyfish-logger-5-x-e2bec06ed92769ed64a21318267181cabb6cc5ae":{"name":"@balena/jellyfish-metrics","version":"2.0.127-renovate-balena-jellyfish-logger-5-x-e2bec06ed92769ed64a21318267181cabb6cc5ae","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.127-renovate-balena-jellyfish-logger-5-x-e2bec06ed92769ed64a21318267181cabb6cc5ae","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"77af3ee05d99e62cb73cd4291eb86dcda5a2cb92","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.127-renovate-balena-jellyfish-logger-5-x-e2bec06ed92769ed64a21318267181cabb6cc5ae.tgz","fileCount":16,"integrity":"sha512-2k7SDLBsAu42C3n0TYyxMVFmXkyJPfVVGX3WW7k6J9cdvW4CNlUHtND5YgP7xgHJvVyHsNZzP5W4LCForyGk6A==","signatures":[{"sig":"MEUCICdB0VQ1fRzfeHB4m4mdiRLaSsLD+ZzKDahB1rUbXAj/AiEAqRv1ZCO7F4YJDbKQxHkQUKKEw7MclkG1j/85KWHFByc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":155303,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjAEVzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpFrg//d82jnCCXR6/WLP3EaH/9tVc+gUv0nZ4HJ+bMxF0KQCoisnRX\r\nxU87R+B74541CHHHO1k8ItichI3+wy+owK8HfANMIVsUzrEoF0haxq9iRRmu\r\nZmRo+9f6kectJ+W4JgY93ecvIg6S+NNMajzxRcazg5fLGWR1Q6TkDSZ/b0QD\r\nPeBbro83x+qfZ/UOiQ0nf8BS7NQtflf+XOq0aQfQ4kBgCn6FkUmP59JU6Ge0\r\njlYvYCiNaQfZAH0tTVcEo52Lne6p6EwE9mwQnAs1RgIAe4jAuWCjN3XSasXw\r\nUhawi8o0Gg/ndRJyx+BB0SVdRevd3a8DC9xpWNFV2u+efp/yg8T37Ts+la1W\r\nAlJ3mbEkRnttIlEHDt5gph6h7YycfFxFalvwG+bXAQAin0Q5qW4PvtQf5u9a\r\n/eHLOwPj2J8WjFzhkvnPSM5PwNtZ73Ana7y3aiE7tHQJq2BsN9jkGREtczpF\r\nhGQb2jBDXHQzd7Vfj4JbG8cwvZ3mpWFTDPYOYEyCWO6IwSSDzBUVt217aPhf\r\nX/LtqGyyU/tDOdPr1DxOqZaSu/XecmR0I4FW/f5pTtrYjk0CVy2mmaV1qPWh\r\nTo1I5P9HnyYVR50bg8W6b3TPZ0V44SFBNRdGFYAoF+nmOMOZ6KbpvxjJTp5L\r\nAtOGMb1FKg7Fo3vZmzZRN66Lpqm9alnR+8E=\r\n=8XJ4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e2bec06ed92769ed64a21318267181cabb6cc5ae","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-20T02:19:20.016Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.31","@balena/jellyfish-environment":"^13.0.3","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.7","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.7","@types/node":"^16.11.51","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.127-renovate-balena-jellyfish-logger-5-x-e2bec06ed92769ed64a21318267181cabb6cc5ae_1660962163339_0.3463961289057367","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.127-renovate-balena-jellyfish-environment-13-x-365876d678a2ddf8ffdf86fcafcd9f40131f57e3":{"name":"@balena/jellyfish-metrics","version":"2.0.127-renovate-balena-jellyfish-environment-13-x-365876d678a2ddf8ffdf86fcafcd9f40131f57e3","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.127-renovate-balena-jellyfish-environment-13-x-365876d678a2ddf8ffdf86fcafcd9f40131f57e3","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e89e18745228c19d7c974809ccab837293fac60a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.127-renovate-balena-jellyfish-environment-13-x-365876d678a2ddf8ffdf86fcafcd9f40131f57e3.tgz","fileCount":16,"integrity":"sha512-HGhUCh/KvLITj+A0WYohObQnMzvyNiIS1nGxFB+SCxy7VrM3l5uXAs7k4WeHYhTsy42XZBpueWeobvyvCg/eSg==","signatures":[{"sig":"MEUCIQCWqi4oeo8mmrarELg1e2sI+e+xixpVV5dBrJU7eJAw3QIgWoWkekfQM2VoH9AAprJcP8cbU6OPi//fMU/QRHarGw4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":155386,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjAG4tACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoBkQ//dS3kJNFfEqGvYCKtT6z4hdXir2Cu8b4IYQh0fyqw+KPOu7Bx\r\nMKWnW26iGi+tExUBCv15qHJL6wLsBhFa5yFfjvaNKshrt0XflNmq2lYqyGlh\r\nC4YA0Oz1hisaw2EaVqYpNMNYK5eoTIXTf52OpJQiHHmsTCi2+OWw1NbBHkVp\r\nSgiVqgaai8b6OeT96AAdqg3zBfbZfBJ9wwqnVj9gsqa3oDf66MM2kXMwIV1n\r\n38/TMSrBeHJ3RiV2K4/cOgbkko0le8XgLti7EwyVp+HC+56brRcMisU/aKM5\r\nLnbXMMTbwpXWM3P2aPXxgUcbY2DdkHR5P4Euif+8MxsU7SN+wtTJLWkVojG0\r\nzJxtfK1AsvtEJ3sWMAeOg0FA9slxhV1HQUmpr/aHXsDY6kZ2uDM6gD0o8wuB\r\nulxOaT6lw4zeSH8NIfvfuoMled3uDO3XU6USP/E9Ht17fe+w9EzDkW3g3ZBm\r\nkpROOFgXrqvqRR/zv6SLUOEDlKp2/12bmdfMmorwDVnpEP/UQkie9nXdIYQV\r\nuhXNGhfpRHnn6XhJw0TWI/c3t1iAnlIBZnWb6aOk1Apng0Zhz5PWaIIqFzXc\r\nm12tHqAlZG34IgoqkAC6TCzjKYzxfTACfZd8Dcst6VzkXV72r0/Je9xPU5DC\r\n8PTslj9U+H3XIXUqug5vdkjrVdzD8PqpX+k=\r\n=F89/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"365876d678a2ddf8ffdf86fcafcd9f40131f57e3","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-20T05:13:15.938Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.31","@balena/jellyfish-environment":"^13.0.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.7","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.7","@types/node":"^16.11.51","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.127-renovate-balena-jellyfish-environment-13-x-365876d678a2ddf8ffdf86fcafcd9f40131f57e3_1660972589415_0.41626089624628304","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.127":{"name":"@balena/jellyfish-metrics","version":"2.0.127","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.127","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"96350053cbd708ee9269da265173401e8212d37d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.127.tgz","fileCount":16,"integrity":"sha512-oojvIKcTXTPHiVFHu/Cy7ra5DsMfYs65u7A3EID8vVlqII+/1bFBrNsKYkawn25rhfy5DHkEGnEEvgq5S+mhWg==","signatures":[{"sig":"MEQCIEYy9l80i2ma9+sBIK/c3AQa2cpoek201WTG5Bc/UdAiAiACEpoWNniMURP4w7SYauUYofFQDqWVtGbmuP8oQ603VQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":155302,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjAG7lACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrqew//c4nkaq4I0+w5Ye97cKWLDVEnj41cMS2kbI0hCgaeKlyriCAp\r\ncqJ+qFi1JMtkirriL8UlRF/ezS93+vZA5LmR89beYeKbfuSDkgWLpuR6Q/Pp\r\n4yBTJAzzajzMKhFFbO17reN7oWxn0tsZm62uDXjbIcSKTxaRI0oIHK+jJjSJ\r\noOgoagnSYoIkDFLGR5hXGXjGR5hQ1FbDl0t7737UQb7pd8jzugCUdBIkYnzu\r\n3EnBzuQ2P3FgwA2hEfq84g+zW4BGvLbZ+DL7bsc6lR6RJ4tCJX+dqMKd36Ca\r\nkT7DTC7GgBwFOHy3gJAlHEJJd+lr2K4RuFPO0kse9fP6TaIITtObscKSbrZw\r\nSISTpSw3plrFuGjED4+t6QtBoO5Fp00SyU2RWuvUgJHaTYLANzkF99wITCIb\r\ntSab1eDx56NN8tOjMj+glzL3VYeksuOBBJIM877zDv3xUwrx0rOrrl520n4Z\r\nUwG+OyhgoXrBrlXuRxTYg56H1Jt0wUrxyvDOlDuFQo6J+cU10OsLXs10OpuH\r\nZ0gI07soCqXzcjeQjD26/MJaNsw31ht3IDHg4EWmZd116WgZujWrxiwFMojm\r\nsAcYkfRkod768IlvBMyo02ToFe367PQl37zzpU6VoKv+kuiRgy5+zKAsAr7b\r\n8pzAsbdV8WkxLLKD044eK8eea084+QklFZ0=\r\n=+O+n\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f1397dfaa771b46764cafe4a8fe1f98a9ca20d7e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-20T05:17:14.368Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.31","@balena/jellyfish-environment":"^13.0.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.7","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.7","@types/node":"^16.11.51","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.127_1660972773442_0.7320483964760112","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.128-renovate-balena-jellyfish-logger-5-x-0b7e9e398e9230916dbb3a5f02c186dfdd00c7b9":{"name":"@balena/jellyfish-metrics","version":"2.0.128-renovate-balena-jellyfish-logger-5-x-0b7e9e398e9230916dbb3a5f02c186dfdd00c7b9","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.128-renovate-balena-jellyfish-logger-5-x-0b7e9e398e9230916dbb3a5f02c186dfdd00c7b9","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0fcf31905a4de36599e7a5eda8c1094c56ffc55f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.128-renovate-balena-jellyfish-logger-5-x-0b7e9e398e9230916dbb3a5f02c186dfdd00c7b9.tgz","fileCount":16,"integrity":"sha512-HWi7yLLmpTvhGMhTBWBSZ7ZyNs+sSA41VmxPUk0o7J/gqZxOMIqmlQ81IlxOITElZSo+94UodS5taiE3SF4dzA==","signatures":[{"sig":"MEQCICKozt3+Ksjs5AFU1D529GV90KMYAdRmc+N9bpRRQvtEAiADrexTqIZEcnveqLWqUa9uizgDwwikloGbZBWJEvikCg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":155478,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjAG+RACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrBihAAluPwZPTfYbaMECgP43hAwwaVXyxbZvZ7W4XVf0rUBG+1MvOb\r\nlIQQ0W1HS26kL1r/N4d9UCoE1q4ozDLyKh7atphimudO0eEu9QwKRmCUBZVf\r\n8YcT7l4m5lO586pnHETZWGDhdm+h0WU2IQpwJnxTQwq+ZpBvuPmhAsr10MGX\r\nD41lWa/gpX8O2+ZetwjpRzGnowyKvz7nd3LMRjSR0FsQjLJE5mhihO/wrHVO\r\nluKcMmQ0Sca4dQjWZbMUYElkovP/LUigeuUHrpxSwMZL5D/OHwtv6dAuLG+0\r\n85u5NP3YHaiEtMCK3jtSSOoOkPC3rvy66tITlFpqaZzIUNSoMY8j7emBj+9Y\r\n3FW5TD+/GuQXN7vpZ8hj2/OfP99LW1fCBAfV6T0ZIV7tOh25NvRcdf2qgXrV\r\nprLjBeuMdy2rCk7kBY8YOLj0C3QoM+iJ1KdPJ7D0+T+49aAVrXYtXsBOx10z\r\ngON06itQDSCkhkEUiJJ1QGTwVxxhcAvrFQESVqX4lmovmMVzS9ap6y3CjcTq\r\nEygPMjfAupg28sJJ2OWlmW2oZcuie9JDn1Nk4SgDGEuOuP09QdcZFuGBOE+/\r\ny6aD/pRjzqmvZEQjoj6eeNLGTLOVZJxnN/M4wxftYDn54dYsidE58ueoj5q2\r\nQFalZS+cmx0AS60bOKRj2QOHh8dqe76iqfw=\r\n=D57M\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0b7e9e398e9230916dbb3a5f02c186dfdd00c7b9","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-20T05:19:37.537Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.33","@balena/jellyfish-environment":"^13.0.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.7","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.7","@types/node":"^16.11.51","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.128-renovate-balena-jellyfish-logger-5-x-0b7e9e398e9230916dbb3a5f02c186dfdd00c7b9_1660972945106_0.4746614314907782","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.128":{"name":"@balena/jellyfish-metrics","version":"2.0.128","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.128","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0e8d40aef03825de611ff8237e887cff229ac9a8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.128.tgz","fileCount":16,"integrity":"sha512-BHqpZMWjBGnaKRh6x9pAKE1yaryFabTOC7kPJ/rkO5akHCZ/HCkNYey44FTNW1gWjhpO6K3tELO63G4kMdjmKw==","signatures":[{"sig":"MEUCIHJ4fPUGoIjyIyrfJnkZjet2aSlssn+6xfD2latJUYkSAiEA4bp9c3PCkCRq4G+V6UhDJUpI+A56j/ptBimMFtLmMbk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":155400,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjAHDYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrn+Q/7BOzZqqVdCnnyLNwr334xSz2gQen35OfTZyMGslfz1qdt9J/1\r\ndl/uwcDv+znm+brIUu44A0dXz10IgoMqF4MzHZXMlFtrTtpz2rYltov+qqK9\r\nVac3P0kO9fEuY5BMxO70Kiw8CQPkKLtIbqmxwDcZ4roXK7SwpdycVntiLhMx\r\nnIZ30MJrUNhlKy69mhXULT+WXI6vfifJrcErCcsIvBv5IibuzRLLVLIRjCEg\r\nsWv9SJmNn4rlfCvMMvQNldqRbeM+2o23ADqZyyaYC9PWymUWlW5kZy9/ASTp\r\nQDPHX16WwzUxv+yVRZ7ZwN83gQdx9rIE7vVFy4ak1PS6oZ149s+ySTnjzFdD\r\n/9Cgv61WQraV9oJ5WlVcnsfPI7vvcLUB56TZorzYXNoRUN5qdTPkQE6DBWWl\r\nG3MLwufxQ3BzG+ew80hkbweyRPel+22bBLjERf1K+TiVY8S+WRTDgo0BhE3m\r\nDhwR631xirUblTglpdrc5k4N1CFYUUXJPFHlLm+euVQ+lfe1ZhYFxrxL4f51\r\nk6at90TpTF5LOlM95SF8JOD8FmrHmJT1iVqqP3RegMqeULtraDqI2N0+H/Ra\r\niCND+ZADo9xmMnlqMn6JFQWsgLnlWrzLtsRw+FqXipG1ALZdHOKC+aRXwd85\r\nV8wGAer8hlvsKSH7BN8ZL0OQqMvH+LWshL4=\r\n=/di5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"88e837fe681813335a0cfd3f92dc3ff832bd323e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-20T05:25:42.932Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.33","@balena/jellyfish-environment":"^13.0.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.7","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.7","@types/node":"^16.11.51","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.128_1660973272290_0.34064623288080065","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.129-renovate-ts-jest-28-x-9354582b3f27a704a775ca39879b4895d08f718f":{"name":"@balena/jellyfish-metrics","version":"2.0.129-renovate-ts-jest-28-x-9354582b3f27a704a775ca39879b4895d08f718f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.129-renovate-ts-jest-28-x-9354582b3f27a704a775ca39879b4895d08f718f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"02ce6350c3f9db55cdd63676d2a049dc54e7a380","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.129-renovate-ts-jest-28-x-9354582b3f27a704a775ca39879b4895d08f718f.tgz","fileCount":16,"integrity":"sha512-rSCdtZHo7UkvqpbQG9j7Q7M6j36Qig9ZFm4+dWyvipYrU7SvPpoo1ED4AcOd8DYzYsQil+0NnJ/rWCoHSkQpKQ==","signatures":[{"sig":"MEUCIEa0P7V7e1hAyww9CSbqM3fDM/QyUMJ1vV5h5aQD1qjgAiEA5/mQOM1yk6kZ1SDJQedMGvX0W1wP+5WAcplP/8DVw08=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":155544,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjAKwOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmphSQ//bp5bIebSwGmwYHw7Cu1dsFYG3LKclP/m00+6kL6/k1YhC3/A\r\n5AJT7ff3X9rQNUBDCRUODJhm/3geOCCDsKzBDyBCJFWE9/Le9PTH9pf3capS\r\nBm0Sz7vCm6XW6Z0OZ/5JZs1amwCE6RaZ0I6A8uk3/Q+S8NeVkG2bu3JbASZh\r\n2ouchmiSgC3YtaifrltRsuDctPjd/2o7o95/+81pq21alAmC4BroB9VY1aWA\r\nrN0vPMbkkpGC77DAh3JKTB4jsYDWpYHeITW69wrky7SzuFquyhV4sOWXJxmH\r\ngB1f7XZUYKHWZFdx4x9353JjARHePHUJpvz39hoFE1u5gPOvxlxBmNzCdTIL\r\nB6sRmyYx0cuHdU6AS1Vw1kX69jqwNhLXp6mJAcBwhTFvv65m2BsPk0QwVfHt\r\nwYz3AaCwD1fCOtkH7n0qZvaX896HjKttxRqL6fMC9Qq4KksGcOb/jzBbc/oK\r\nLmuzLPs6yV9737tm/2/sQbh8B2+0VKjIy8NYMMmUY/zUC5SsTzO3S8PEwmAW\r\n0v2JFzo8A3QOfkA/Brb4yRGHDRiifh7V6lIC4a6afN4WFzIfVEeqmmH31P1L\r\nKuX21X9XcmTqMBYI07ubv1JEqkR9aO9xOCnd1rDxHMhRkz/SVMxpVyBalw1Y\r\n8htmmVSSCk/x2Oz8R3oH6/0IjZFrk5C20vk=\r\n=w8tu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9354582b3f27a704a775ca39879b4895d08f718f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-20T09:37:20.407Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.33","@balena/jellyfish-environment":"^13.0.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.8","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.7","@types/node":"^16.11.51","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.129-renovate-ts-jest-28-x-9354582b3f27a704a775ca39879b4895d08f718f_1660988430675_0.2950173409132981","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.129":{"name":"@balena/jellyfish-metrics","version":"2.0.129","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.129","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"75814d0ebfe9b1623766f21b3ee3a370763ad824","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.129.tgz","fileCount":16,"integrity":"sha512-rd2WeJX37Rbl8pPfcxc6YmpurShN80rUaRA4ZEEnWewsYgaJ0PamBITRyRP+xw5LDh/Tvm3VBdlFUO7UyvhwFg==","signatures":[{"sig":"MEUCIQCKkh9cJMS+y46JDUipMRfeZTkx4GCXIRalKgcUAItkBAIgIhz8MlTCDTbzCE5eKratsb4lwFMwCsCeLWlBkmhSTKg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":155481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjAK0eACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpReg/+L88mPhlXhU9F3ZezUThthcW5tCCdHH+i9Hx0ZZdWXSeCjhp/\r\n1Pa6R1LXZVoA1y+sQa1W9GMpEJrKTnDc6mbF03mDbhpZTctsp+DgcRlxtgne\r\nu5yMoikwIxt1ezFNQliNlc96cnFdG4ZqpwByqB/77iZnAN3n4cxHsi84rg4E\r\nLRSH/OlUYrogX+SsMp5kZhUvWKQPg0XP42hqYn2YtfAmJimZ76VWY3Eqit2f\r\nqrFvuR35UGLwbSkaUpU+ZsvPZsFBFLwyXheD60bZ/pDzxH4fuEHVha+ka+OD\r\n48dY5RQAV9dRusSs/e4MXTICAXAWc2+Kz0ZQMfkrlcsk38bZmeaXvTgK82LB\r\n8E+us0rMV7/uXP4SaQnkDI45AKD0lMCOb8XmooVxisscDdy0hAFj0fQiVcWE\r\nVMIAgGYN6SKPQ8bTaSKw2E2ZytM/7fIE8Iz5t8XLvh14aad9uctW60QS5yK9\r\ndFb9noiLDIUCub9XqLE7oI2Q+V4915tjMFLpn4Ji/1/cuSmv9XyIuIMmHaRB\r\nySSeGD9JG58YTTtIHLu3J0jc+FP27GMJEvUqIaGz++wD/KC9ZuFw9KAJMeLB\r\nnPymed/9THkkxgkClxUooG5R+AS8F/gzx8BcGfnFJh79YUBpR0zLKYhQe37Y\r\n2HGbrXkjTRcWpx0TJNKK/r1EDKKoBiP/4vs=\r\n=yGEv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c8fc7cebf4137f5c29c02c031a1165689096fd37","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-20T09:42:29.236Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.33","@balena/jellyfish-environment":"^13.0.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.8","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.7","@types/node":"^16.11.51","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.129_1660988702043_0.15916049685915246","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.130-renovate-balena-jellyfish-logger-5-x-9e823ea3269e87faa68eb9cfb9b53f983f2c2d84":{"name":"@balena/jellyfish-metrics","version":"2.0.130-renovate-balena-jellyfish-logger-5-x-9e823ea3269e87faa68eb9cfb9b53f983f2c2d84","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.130-renovate-balena-jellyfish-logger-5-x-9e823ea3269e87faa68eb9cfb9b53f983f2c2d84","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"de1c96fcaa79cecf514b96682d997f96add6039a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.130-renovate-balena-jellyfish-logger-5-x-9e823ea3269e87faa68eb9cfb9b53f983f2c2d84.tgz","fileCount":16,"integrity":"sha512-cnXaPxr3bA3X+kbnmcJUnEC8VObCGG14pHr7oWaoxWu4jPRyd8nAQztDfM46jvOg90O1pOV2nL7S1f6z+wbK2g==","signatures":[{"sig":"MEQCIAmItcfBK5ms9/NBCc1n/VKNtaCl/8LGeDzgk3tIWwvQAiBqmqgAeF34pE/pvLKslTFaI/sb+whxC8fReMyZTUGXJg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":155657,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjAM+xACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpDDxAAjL4WekRZ3FTRMYKvH7K9lTR1wBY4gomnYxBGNnC7WIqY3SQ+\r\n5lX4VyWopF+Qea9B3vXvnO7N1YLEKdz5MOHzygolAjGkweyrbovjWQqlw817\r\nV/oGx/X1e9ECR5kL9X+zwQMZeuLLc7RK9m5s7D94ZCU1c79qlVOgd3EaCnHo\r\n3StFgciHk3RzPnCZjDeFVMKaJvjwKpgVy+R6fxWb2WglWaJ23XYNQaq8Qs2h\r\nsBv3TuACly1fnEZRWwLXC/wFcqkDdFEVTwHwWwLmImCvoS9Pte9gRxvZe5WY\r\n+LDY1aHCU/bAiPFa1NB58W1SGsWHiffidewPlBtgytqqeWs7Lq4pkl0nEDIm\r\n1Qy07bZwU4432voRIqHjeG80dITD7VKK0BOY73vjnXtlLNq668jV/vlzWkC3\r\nTl2cteejsigJSn7wMCnKezVhRCEwDHIa1lZ6A6L0aRYtXEbyNj46F+ig+0xM\r\n/LAfwWIAQUNnCVCgdOLDXwTy5qR/oik5qcfNlNGKrKoIGuyCNwsD5wOX00au\r\nSo4R9s+gyTqaRD1j2q8qNLlJ9qPld8M6tPDAMiIMslbb9f4I8TS/+0inX0pT\r\nytYruWQGZU3s3bM4ykE6qDPMPI9qr/c+iHRxGZ75yKK/ib9eLcxRTcmaZJGK\r\n9VbfQovRxB9SKP07YZp5PfhERp/3gv8va40=\r\n=pPAt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9e823ea3269e87faa68eb9cfb9b53f983f2c2d84","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-20T12:09:11.661Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.37","@balena/jellyfish-environment":"^13.0.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.8","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.7","@types/node":"^16.11.51","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.130-renovate-balena-jellyfish-logger-5-x-9e823ea3269e87faa68eb9cfb9b53f983f2c2d84_1660997553627_0.6228434625529276","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.130":{"name":"@balena/jellyfish-metrics","version":"2.0.130","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.130","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"202e1c9db860ef9b2201b07bdb8830ad4a28f42a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.130.tgz","fileCount":16,"integrity":"sha512-csDZ/5z7M7GbiOHFiq2kjPp6IzRPumoUWalXvgyzyxNbqSAe7NKZ5upx8lngIBGm2Zk1xxI2++omy0L/JhGJTA==","signatures":[{"sig":"MEQCIBJYyuaJYBiet5QFPUqfzEok9ZBSprF6Cil5a1JR7N/YAiBSJiWH5Ml2EOdzAGl8ALtpRRp3AQ/1oi0NWGQUbFwExA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":155579,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjANC+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqnQg/9F7B8gQJ+HplWXpDtoE0r8eERGbxRJtjPSIFcAG43OHaRcvT1\r\nBKHZXWW6RVyRACLtxkvjvfaPu3eo4ASib/1C4i5JmLVdyBJbr4WI8Jbmi3F5\r\nps3PBR9/IHdS6UXrepqWCzRa+MsmL8Kno4iFHvhlwmRisJyOu+l1IFXZ3Drq\r\nP5Pnzem8RuTktlQWne6CiuzwdD/+7q9v6kNfiQSD6M52EKH9n6n6HS9Hfs26\r\nkV5aPF2cfeZj3jFBQza8o77d5y2Fwwo7OCt3rGTGdWwBTYw8c+hmW8kS2YAh\r\n+3TB3e3QXMgxl161LfMlqiMBpKrjzM8e0n6i644xhgEacK6T2t+smWwJBqiJ\r\nbn9c/lvJLGAc+6I4fwUr/uxf5Z23dfxEurhgzCLIBkv9Bp6cSrREk9Po3hzs\r\nj9cD7fLtiVGtIRuFbdiGrPdnl1E5sHUD5KYVpK3gNm/WSqfv+dEeSVvn04Ii\r\nWh82vhQpr0v5fjSIVxVqtPBGhTiEVCW0NYmQYsU5krj4E0NwhvEF3oOjVY5v\r\nL8uurCBaJYBYQgadq2iLuk0UG2a7Dt3fuKrfPVD2/yNXi7Z0b8taBeM0j8E0\r\nSDKhCKFC3LVDhMDtKcXZtRzJCxSFxBNPR4IaijosdWXvWSBfhZxZZFoBKLdM\r\nmc2xETphJFwkpFdh2iQAB17zHpZlc9w1ftE=\r\n=1yHt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2103b9cb14cdbcefe21034ed4c69c1269a955108","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-20T12:15:04.987Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.37","@balena/jellyfish-environment":"^13.0.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.8","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.7","@types/node":"^16.11.51","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.130_1660997822286_0.9475965225952134","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.131-renovate-node-16-x-ce2433e7b15fde82d5f88942b470e15c983b3099":{"name":"@balena/jellyfish-metrics","version":"2.0.131-renovate-node-16-x-ce2433e7b15fde82d5f88942b470e15c983b3099","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.131-renovate-node-16-x-ce2433e7b15fde82d5f88942b470e15c983b3099","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ed2e3879aa3967576dd32e3443b5f94682c208fe","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.131-renovate-node-16-x-ce2433e7b15fde82d5f88942b470e15c983b3099.tgz","fileCount":16,"integrity":"sha512-YQlJsQrBgvW35zIgrv+JXSklc5gfk6M3gCBPqpZuNQF4+p/rdlcUIGhbypOHvGh4Su0smbSe6PkH87qDtYEyrg==","signatures":[{"sig":"MEYCIQDqxJ2JbaJitnF81/A4lcye/vdn0CFXaYPZBPV1YtC+RAIhAOgQgydYzicjtzYKh6BeempPORHNf1U73BdrZC6oD8Oo","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":155728,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjAqmuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo7Iw/9GBdXf2ffcHV8A04WnvG/5sIjS/dwP7CgVy880S6irxYIndeo\r\n1cg0v9AHVg0xVA3PgluRSM8RFF9tlFbtViSwyzYJambtKTeE9ghVUh6G9SYO\r\ndO2Zq4/dbAVVN0EHsL04DBR8PuhfeuNywTGowmtWuZmQzYhfv1EjhrXUyVof\r\n8nrfN9yeGCzqOqOd/ByybGfpGbHXMIdtFIRimn+WUyfjC40lDin3XHTK9/Hg\r\nnn0W0YJozfSESzEQyAk0LtlhymuGBFTgeQI90h7D+RIylxt1cXxKIL52QK4k\r\nDhABKB2209SnUZM1jkqDNB+RGiHg6zSWk9HaIs25m/z5CgJsvv2+POGcS/qk\r\nQx6dT0uKHXnBUksXe77+f6T4UYhNqua+QYcCV9ZIjCAlyMIXE6/fz99oM6jR\r\ncvzeLngQOPCD6qTfsllylF1/FxLC7fMcVNUQVcVHG4cQjo13uaWxyZ52eRdK\r\nEH6YVr0/Uvkw4LoAD6fVdLRa/+UvaPM2oxhM6UT3wFAWpe/6iidEfw7ejnwa\r\nm6dFCH3gnUFhCOTq6lz5Acf9NAPiI6YbguHv6M9wi7DotyEPd/ZiS6FGJ7H/\r\nZcMMah6DxKkI3QsXAv0slmDFn2Y3nGmAfJpiwFfxlXUdbaEffKzmoFj1pqbY\r\nk+Oj3+P3Nrxphq9T5fge6ROUtQm6wGfs7sc=\r\n=lFAp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ce2433e7b15fde82d5f88942b470e15c983b3099","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-21T21:51:56.816Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.37","@balena/jellyfish-environment":"^13.0.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.8","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.7","@types/node":"^16.11.52","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.131-renovate-node-16-x-ce2433e7b15fde82d5f88942b470e15c983b3099_1661118894622_0.08023432655358254","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.131":{"name":"@balena/jellyfish-metrics","version":"2.0.131","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.131","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"62e75c2112b74947466f33933d53954ef7ffd8fa","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.131.tgz","fileCount":16,"integrity":"sha512-pA/oFCm+Ab6EyjBOEq6qGe41Cf2Vqs3a6CUglRuJ4aj0jGUYQ+pJLjcb4HU3O4Temd98HxInL5tjMRZaRtf7VA==","signatures":[{"sig":"MEQCIDHYTIt838fyY352VTOWhOdWewgoBlM9UPE4TC6oaLEMAiBUE6p8XYhWxYjqjexT/1pHVshbFHZ5nP2Du2uN+sqoXQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":155668,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjAqp3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpLCQ/+PXre0L3QrU/SlGULidtOLGjDa90vTmrziN+6duHAnTCZ3n8H\r\nVhypjnlUyCckJeeGagTM3ve76H3tAcKTU4B1p9TklPxIV6mpfF20zMIo2LwC\r\nbk2oD338/0WYns2j/53KRhL1v4xmveROGb2tXlDCzeX4LzEtPzyWmwC+XniW\r\n9yo7rBssDHcbsmCZ+kpj/CPVpvKAqMuK1u4Vn/i0MILB7HPFTTfMtb2xeRkq\r\nBfsOcgI5XPF1LKfqYWdGRykarOLKIjZT1g/RySawWeKD7Zt8ecy5DJRnvp1a\r\nu34eUiI8oSGkan/shbpABOqpMKqvZ7py+GkDK3f7pAYn1D/Z0gtnLAXQ39jf\r\n7c7yy9MpGN0RWuVkgs4fBYVCWENBgraPoT2BEsgm6Hg4I2UxEncFqyY6tO15\r\ns6VcniPpSLZjhYoARIEL6apQeNgTpY+Od9/ZXdZTGMxqUZzRo/swo7QxvyTA\r\nEUwNDpSxxRX4Jr/DePnsaHyI92pwNSFQhMIrIFg9OFOnWQtyFv8D5UBn66wb\r\ncEfuR7loEzLVsQL7m2rPcd5fFgksvGRDvEIQvKzt2bUmwUVw04IQufOKL4We\r\nZTYs3iE5P23GFfq0sRzo+yjPssbLdPLZyVFrspdUWik8Zymh6iLI+CzypdvR\r\n/7yzyp4UXoSD2w9ee23aCQ7S9Wyw+BNhYLI=\r\n=oOWm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5c11a89e1e013ade103c68513d26c0ad60b2f428","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-21T21:56:02.630Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.37","@balena/jellyfish-environment":"^13.0.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.8","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.7","@types/node":"^16.11.52","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.131_1661119094837_0.00482247015456605","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.132-renovate-balena-jellyfish-environment-13-x-d0a36e441c5f429c43050748dcb5744f0ccd3c9a":{"name":"@balena/jellyfish-metrics","version":"2.0.132-renovate-balena-jellyfish-environment-13-x-d0a36e441c5f429c43050748dcb5744f0ccd3c9a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.132-renovate-balena-jellyfish-environment-13-x-d0a36e441c5f429c43050748dcb5744f0ccd3c9a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b8fec3d385c7bbeb41d0e6703d4e2dc6df6a566f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.132-renovate-balena-jellyfish-environment-13-x-d0a36e441c5f429c43050748dcb5744f0ccd3c9a.tgz","fileCount":16,"integrity":"sha512-DJwx1l7CjOzzj/Fc3RLRxEl9RzfCQkZqYuwOOgj/oKOj0MNNyKAWEGzAwuB+OFyfDbZNVYHdCZfOCfWAggLrFQ==","signatures":[{"sig":"MEYCIQCRiMQBi9mfc6oox1jGqT7HI5FjHy1trvj3BUdXgMlncQIhAIeD7CXCoeByNxuwsn7jNsSktwGe7E+i/cCvySxjz5lx","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":155855,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjCuhDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq2Mg/5Aax2cYGIi0R2pfLbX/AXPek3w8+CZd7Gh2vEoqFSJfGqhHQL\r\n0lisftahlPNl02cuFUlJWfNUcklYj/hRPX9km9Mdskb31/kZG0vtY5rGXXjb\r\nD6cSKXIDhRjJLAEOStaMrSNucUV6wPjwQetTFPHzsP50EF/xHs7vaWuzapvM\r\nOh9nrP9leVdDilvxEwwuK9PJ2S/F8k4d1Bsk5GFlUprBFECV+hvDYzJdWLsw\r\n/pnr0r+u7WCGuPBYhogkDqqmsFunqnNJv6na6O/tstz6FI9KItcgGGv7LLRH\r\nKfp4caOe6LdGMLfs0f09MPgMbLWoYO4DURT9rMlDZKmPROmFp2S3Hxm/Dm7l\r\nYwEF4UsFrd1UOyp+KmVSRCk8BOsphaFyiOTrLznjFOx4lmJFI8Y8L4t+sq9C\r\njNjzkHVKMbb3dU930CoXW/iB6hhxrBj9FXR0XQ7C3Z/8f/dJF2QjDeqqWhVI\r\nQEPfUUcLC9w9G70l5ibg/UzQUS9M4g0dgdtB8VnEdyzxnmQx/JT+eo/ANyI+\r\nmRbC81XE/LWzBtfl71CRgckvIlVTbxqJUuf9YaYUwJOWULIfvQg6RUT1UrTZ\r\npMZXng0gRKN4MTOXmSXRgWTHU0mjdIJpEYGhsZZLLCONkI2T1IiH+TFVmDaq\r\nwpcNsvluDZ6s97vdEbiVrg9fZJg8NM8aZCE=\r\n=k/1y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d0a36e441c5f429c43050748dcb5744f0ccd3c9a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-28T03:56:38.486Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.37","@balena/jellyfish-environment":"^13.0.6","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.8","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.7","@types/node":"^16.11.52","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.132-renovate-balena-jellyfish-environment-13-x-d0a36e441c5f429c43050748dcb5744f0ccd3c9a_1661659203104_0.5216456712312967","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.132":{"name":"@balena/jellyfish-metrics","version":"2.0.132","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.132","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"73aa8f1364a713da807df6ec5903ae4008963cde","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.132.tgz","fileCount":16,"integrity":"sha512-AjayxO/r0Q5H6jCj8/L95D+jWdM8ID1Vta7mrbtzAkybu38JEPRm2pgZWchO9ygvjbef2Bpf2KwquWQ0EyA7yQ==","signatures":[{"sig":"MEQCICt8jWAp0mtbS6ZsGSCxZYFk13UtPaJY7k4b9xcoZNNAAiBXc8juq/FFXnM0377Q3LYjq+A59EPUm3h+lFkmf66cqQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":155771,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjCumiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqozQ/9Ekz7tsxOTFOlHjjIZ+gfpIt4RWyRlwf8Pl22pAih8KLxFMV+\r\nMxWrf3Cp7N/z2lMJa5MvdDKxDejEWCDnldEm3h1gSvtoMcoOlg2HDEr8Tf+T\r\nzFRbPfMAgFHEu8Ro4KAtv3JgFoZfxtiaRPxu09aPNOz2ZbgTxujXGFRrzuGT\r\nSuG5cxIBVn1PWlzzXL7e/yb1/3xrdl3LK9gXcMX0xl15vPiHuFpGXqoyllr3\r\nhhpnw17Es82mzHEg5n2jkiao7yRGszR/SjbLEMbzdCUcK1SWto5L/y9A/ajo\r\nbSEI2zxRPIKM/PGpNY34TwlUa2GU9WFh0zfvyPKev24t1zu24ME45ASPVN7u\r\n2NGk3piQMmIti8Q55C8nXkvoCrvSEWREiacPyPu4Gu1exmWdp0vpuHj2/f9m\r\nc4qZCVW208E+6PSVUAYde+fuJqbSG6fUwNfUDUunlJ0emJVBZjfM1ajyH+FS\r\nysqM4eVdEDp/fVDTxEE4sAyOX/I5FtrokLh43OK7nXJx87gAwyNXp+EdnK0v\r\nKjI7BLbn51KNA1yCzsePBScN5UgJudakN0vDgQ7xPoxs2WCZMpRVgZeDh+bo\r\n44RytJR5tY4ReIZV6F8VFlme6t+Bfmb3JuUEGsIxS6DCo1dSL6cRtUzEq/vF\r\ntfaV+uCugtq2SdkCSZjmizmvFrNk1vqBOdA=\r\n=RGNE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d63e15329f64ab19e71ac81c093355682c83301b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-28T04:02:04.216Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.37","@balena/jellyfish-environment":"^13.0.6","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.8","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.7","@types/node":"^16.11.52","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.132_1661659554327_0.4967686721990199","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.132-renovate-balena-jellyfish-logger-5-x-2118aa3eca86536eb001db0a6bfcada2fcebe640":{"name":"@balena/jellyfish-metrics","version":"2.0.132-renovate-balena-jellyfish-logger-5-x-2118aa3eca86536eb001db0a6bfcada2fcebe640","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.132-renovate-balena-jellyfish-logger-5-x-2118aa3eca86536eb001db0a6bfcada2fcebe640","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2be1b9e59d0496f4e10c7349f6985a885f456541","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.132-renovate-balena-jellyfish-logger-5-x-2118aa3eca86536eb001db0a6bfcada2fcebe640.tgz","fileCount":16,"integrity":"sha512-kAK4Yd1q108ZiAB1BJZFNOGHdJ0pTIgEiTbkYLbw4bvo+XqdhEST/FCYLUs1nQ2bLTx3AKlahKP1jv1azWzMXQ==","signatures":[{"sig":"MEYCIQCJPb35vx7bJUr8NKoz07uoU9gVks5QGc4cXDzKwoaByQIhAMumaRDfrHHlaHrlVSOQG5wKhICc/KVmP2TcsgUC/JQe","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":155921,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjCunmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr5gg/8D5S9EWb5Nutt9gokDizSnEH60NNsqP4+dTHx/GESYUKB/f3c\r\nudwEjyvebfyy10/ITjAKe2CRtbzlSHYAFBmaUQz8tYHmdhUOjjyCzAZP42Wg\r\ntV8Hol3TPTc9woKk8ciPgsVh9TB62Fvt9CJmRfnS+bND4kwKMJzQ5Bkubfax\r\nqmKfa5IlLu/R92n7gn4fcH7pCV67Bzpoqq0amISZvbmpUGRVOOkUHTrkUGGd\r\nRoLqixIyJKoQqMIQBU6aAa0a/yjTZI5FHN5DM9CgQV9U/Rmj9AR8fcgVIecE\r\nVMSqIldamWGo748IS8/XcNvYo4zB/Z9cnWlfghR5dN6KZX6gvGiCFnjPyper\r\nqjx0XYTpy6ipvbinjPAHfo0jZn+4EhPPLI7cBO9pjM4L6jzRkU66qBI3PqQt\r\nMLACAaQx8mbPfd79R51QDsNOR75JJ1e4iN9yOwUYaWizpmcjWp53r319k5jC\r\nF8cotGDUiA5qBHLm8yPOFTJvL7bIsfDF3ueuBMVQxacRzZH490E56X8XZww3\r\nTOiv+0HSyziYWRR8boUMaySQeatbnCBJldoLmlufbOC2ItNmh3JuIKx45VCF\r\nLYKFRNpXprrW1Rq9rgLFeugVpMYSLbFibIA5nCpu/yUYVJ+80ir6TCQGGv8e\r\n/KvtuK5LLSkF1cJcLO9QfXbp7K2NuufMp8Y=\r\n=xhHm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2118aa3eca86536eb001db0a6bfcada2fcebe640","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-28T04:02:57.703Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.40","@balena/jellyfish-environment":"^13.0.6","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.8","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.7","@types/node":"^16.11.52","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.132-renovate-balena-jellyfish-logger-5-x-2118aa3eca86536eb001db0a6bfcada2fcebe640_1661659622304_0.6213352969388561","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.133-renovate-balena-jellyfish-logger-5-x-ce94911269ca5b75e9a8d794824598e7ba5340b4":{"name":"@balena/jellyfish-metrics","version":"2.0.133-renovate-balena-jellyfish-logger-5-x-ce94911269ca5b75e9a8d794824598e7ba5340b4","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.133-renovate-balena-jellyfish-logger-5-x-ce94911269ca5b75e9a8d794824598e7ba5340b4","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a828298d01e3f294f7de91e557eddd6d69440d5c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.133-renovate-balena-jellyfish-logger-5-x-ce94911269ca5b75e9a8d794824598e7ba5340b4.tgz","fileCount":16,"integrity":"sha512-cgoLi1TKB6RoNBym/UANtdiUcqR0S4jc+1H5bAJlepIr11TdHcQ//cjnA/ViS22N/YVj1F9H81F6rv7uRPkESg==","signatures":[{"sig":"MEUCICKtGJNfXViHU47ZFyOSzHgmN9w+3tDCjYzra/p8Nc+MAiEAmphCY3khKJpHvOxe0VCJtE44JRVf7HgO5LWSYYokkjc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":155947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjCuq0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqcFhAAkCwnlzUMeG0MYliA7DC+25AeH+jMFMvEbKlm7AN4a9hyTg8K\r\nLfs2Bdvo5jax49zoqUerFmJ0Vp5Gats3KFQtJD8U/jDAznViLXs88wK4ktlW\r\nla56fHQLrkQ/KdNC7PMOlsc1kHua0Uz1YP2nXKowN0IN2sRfi7LdqyC8LMD6\r\nSfV9LALqvhQOKTQbf71tgUeL+hn8tUrbXIi2cJDkBHwrfbce+dfMSSLH+eb+\r\nLRP8usgTiDsszpgRKvs0+lqa8mn94PzgHkzxja+U/TiHTMBXNAs/KN3era0e\r\nPFmccLxYOHy+JSkG+dAgby00LlQ0kXw3pKydA/7708RJi4JS/fzUp+l6LT6c\r\nzgaLw9xbaMpzOpb/ob4kjUcykyVaggnosKioWgk8GxcRixhmZWv4MK0g6ZE2\r\nZ/ZuNG3A2eyYmnTH8T8nKuGcoRYs4RGmKqtItYgK5TtRNm8s+W6GmW2XHmF2\r\nKQ0P4rXjx1pfQSvkVI9wuaVbLsxwl9BmGzE/RaIKfoDpl0UQlc2HAQmhWtux\r\nXy9RwjffxjM0FWeLVjAMz6ivcl72QWtPOGcT3g4eCukg5joiS5NE8AWwgGO2\r\naifm8n5gaRwzFDClYQ1cCqUmLt2EpXHH0sdMn7Oo3UhzDbQq2VtvTBv6d8Cj\r\nb9VLzEYz4b937wM5mPOPTFHOYEWlJ/16x0E=\r\n=/VjG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ce94911269ca5b75e9a8d794824598e7ba5340b4","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-28T04:06:48.480Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.40","@balena/jellyfish-environment":"^13.0.6","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.8","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.7","@types/node":"^16.11.52","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.133-renovate-balena-jellyfish-logger-5-x-ce94911269ca5b75e9a8d794824598e7ba5340b4_1661659828611_0.20133379422674147","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.133":{"name":"@balena/jellyfish-metrics","version":"2.0.133","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.133","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"86aa462ec749aebf67b3de35986a967a56ee9e73","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.133.tgz","fileCount":16,"integrity":"sha512-mtB0Rthu1bhLrSnUuhTUt1eOJTMLqLAxxh7hJoFWPRBrYe08vvdB0mWetavoVz7ME7ptDt+VVnznM0ZaYKBeig==","signatures":[{"sig":"MEQCICUGeOGQMl3HOwev3N3jyMcC6CbUCZTN1VUIEs0z4f+XAiAWjk5fNznwgK7nuyLz2jItDxpK1ZGMGRxPw1hz3eiSVQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":155869,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjCuvAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrxOQ/+NblYekdSd2zAheXL3rpSLdPnFNgZYHFGKRKa2wHmyaCkQoeQ\r\nTMOJefY4st69s2UTpnCkveOQwJSFxWvWotcNdHt2aFdduu79qekNQCwdpK0Z\r\nntpz0T0QzLcXkXuaxDRoHuGmNQqkPYcKqmgG1qDo81Il8tW4DIvc1MyoyfoJ\r\ncOKP2yZN62EQW49WAiEot3zajdjNLzBKhSXvJIBmiiTe7tdiA33IT+y+l5u3\r\ndnN9NFSNfH8/ToBMfmq2xlXAMBdVPOAehDc6WeS+OyI9nxWanTllyXXO/UYf\r\nmLV8jMtMhAujM/xPBaHgCikYbFpYQkSrdZqO1ukgJCOQvSujxR8KOgROj5Mo\r\njEmFK43WIZoKXL/b/By/YbI8jTrbGoXP/KIdIIClB0VN9IaaVtoaeGIfM9Tf\r\nR00NSNrSu4bNK+064qvBw8MjytffZwTBTKWZQkTzuul7Wdi7L/4K7uDNPyqH\r\nzd3okowm2wuaRPK8iBZ0i5A2MOBulabEyLFJ9YKPxlhIax1rWkuB0qjNx61T\r\n+QHXSf7hOzVGQxr6O0/mVAGYg4ebT3rvczIbQPTgyh01f8/9juMJigisjpNj\r\n/Hg4VBD95taOKVlt82WF3CK+XwDzOqFmG77iMwX92zBj4/LfMJgKJJDzBwGj\r\nxYBkWd5MxRIZKjLUSbci4VRIcFeyvLm80KA=\r\n=Ziib\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"5f1c7b0239d816ab3b0a3741a13f7ee3f0b7aeb0","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-28T04:12:36.542Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.40","@balena/jellyfish-environment":"^13.0.6","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.8","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.7","@types/node":"^16.11.52","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.133_1661660096084_0.007443296080596351","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.133-renovate-jest-monorepo-05889ac51fc21caf70e6330adc07be6bdb62484f":{"name":"@balena/jellyfish-metrics","version":"2.0.133-renovate-jest-monorepo-05889ac51fc21caf70e6330adc07be6bdb62484f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.133-renovate-jest-monorepo-05889ac51fc21caf70e6330adc07be6bdb62484f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"16d2dedd153d19ea7c494cf1cc1df3b8ccd6a35e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.133-renovate-jest-monorepo-05889ac51fc21caf70e6330adc07be6bdb62484f.tgz","fileCount":16,"integrity":"sha512-ptwV35Chut54PCknHRDIyAHNiaVcUJG4hGrBlPnkSKeHoVE0T/pEeAjf9wc0wjsMNHq0SYO1gW6AIk4uUeGLNg==","signatures":[{"sig":"MEUCIQCWkKaLrRkF/L9Am+sECYKnk6iFWPI0Jr9f0VMOlFvXGgIgfGar8lSGYlRpTcXQTfBqGisk4kanVBwjut6dLdOUS44=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":155992,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjCuwUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpqMw//WG0BFas39z5S1PZbuN0ECZplfkygenyqG0/mMYQ+oUN5ojux\r\nZNoR4c8NDcwXJYwTI2ZZbfEteDpkzNx7Dj03jg8YwcznvjzNgsIrHTEt+Umr\r\nHwOXA4BQoDSvS9EED6Eh+KSXyCtX64cpFxLAm/SVytcm4RX9bsClIwJY+vYV\r\nkSnqG9T0Rlz4aOjRNXZW9qAZus84WNXUWa62tDiDfI1lClzwfj95xw/E5Efr\r\nzq1nBEwOG9D22QGnQwW36Q6aQBarcqeBshYUO420udR9o2TqfRTSW9LUrswP\r\nr/HdgCaPhJHSP5tajMY74uXgeJ9Ti+yWV0t+P3FP/Oz2VH09VX+fmz2gImmp\r\nU6XUJEXmLxO20mTPmXaxxqZS2sxR2gDH7bWVVLiCIiIqD+mZKtq0qtgfGX3j\r\nMklw6ojbcf2qipDvGfIV5rbzRYwEcbdWSHvYgwet4+koc9IAYUDjQf7oHa/I\r\nCV6Ct15trAU5DwBL2lZzrtOhgQ9R/f3qlBzONdYP+RtAfFUD0nr8zMO/VpH7\r\njSmyK4GzBZppY7fby8hu803q4HuH0TH5pQ6F0NfTmZreNVqz+ZBotbA1AfGw\r\ndj5l+YlmHJb8hFx4k6AXhofY1LC6r8wqasqo8lUe+7b/XzzVmCOcjePgbFlV\r\nW9Ud7Fm8yr3wlPQdX+aM6+lIFO7KQI8wZHk=\r\n=N3N9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"05889ac51fc21caf70e6330adc07be6bdb62484f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-28T04:13:32.000Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.40","@balena/jellyfish-environment":"^13.0.6","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.8","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.8","@types/node":"^16.11.52","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.133-renovate-jest-monorepo-05889ac51fc21caf70e6330adc07be6bdb62484f_1661660180417_0.5130935531176268","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.134-renovate-jest-monorepo-060fa438bbe3eabed7dbf1a055392051603ddb83":{"name":"@balena/jellyfish-metrics","version":"2.0.134-renovate-jest-monorepo-060fa438bbe3eabed7dbf1a055392051603ddb83","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.134-renovate-jest-monorepo-060fa438bbe3eabed7dbf1a055392051603ddb83","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"af45d9881d07d778fe2c8b1ba3eafb9928e9b421","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.134-renovate-jest-monorepo-060fa438bbe3eabed7dbf1a055392051603ddb83.tgz","fileCount":16,"integrity":"sha512-XnCiRu9qYJuuk3A9a/nMwUJEutO5GhKe8l2SjorYFFC2XEgST2r3151VUfve+hTl95MuyIBXHCRnQHVm0ueuYw==","signatures":[{"sig":"MEYCIQDNZyOcP5VvyLHUED3pQukuXZ0FW9sGiG9pGFKtC0HptAIhAOCTj8XXt4MvWfXyquKLwO5BRjDw6nIgJHjPNOUyXI0e","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":156018,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjCuzaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrNsA//bSmYrguYSz3aQegWDuUq/nDoiUk0D1kgay/QhmZS7U2TZGtv\r\nLcorAsqT3kbYoBoXGk+2/FSrWQ8G71HVB2CEr0/JaoYkFykA8N4pgE18F8SF\r\nVXiBx2nN0SPMNsM4LaX4rWS4OpFWYJBVRQ5p6EOlkbnXSB3UWEdU9E209qOY\r\ntRjzLkacL39tSyix6qS+yP2x74gb1J0O5fIsS6HZkVSDmpPXSIjc3rv3PotA\r\nhYOibpfpV15JQxNXPvxsKRBuuD1gMyC+qa2EOkjJriQu1ho/AR4mFvnEg/WF\r\nYSQt0lNKIMsnutn6mDGHuflJ1SgNjjxZZvuAYwZJQMisuCNiZE8MKjyvClya\r\nWlB9K9Es6nN69bInn7kyQhHXhB8Bpp3ARYAM+6P7re19mPtAI4pPQ2bakAce\r\nD94cz38wm2x4vRP78D2WBQRPaL3uRiqjubrL9u27FHAtTtdvmU5e3MwhNPjd\r\nyxXrKW/vIUAzYEd9HFjGyCJU3jzNw+Yp9nxXx6ss+cSiQGJBWRKTzfw+RL6j\r\nDjtQ9XZ0buHppYBU4/hlkbxEB74frtKmGQtH3j+jNStF11lb3+A7y5T4DPEt\r\n+pgGrDVjx6/uI3ONGaU88CFBY0CmRO/XcgcSZt+yzIMEWW5Ey9/2F7kU+Z+G\r\nGsODB8jtA3R07M+4xj2cbUi8zSSro+hzqV4=\r\n=FNyp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"060fa438bbe3eabed7dbf1a055392051603ddb83","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-28T04:16:48.710Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.40","@balena/jellyfish-environment":"^13.0.6","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.8","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.8","@types/node":"^16.11.52","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.134-renovate-jest-monorepo-060fa438bbe3eabed7dbf1a055392051603ddb83_1661660378788_0.8546182174252701","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.134":{"name":"@balena/jellyfish-metrics","version":"2.0.134","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.134","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"88c2340f8b382bbf6b45e424bdc31e7fa60b4a1c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.134.tgz","fileCount":16,"integrity":"sha512-CPtKZnd3LnY/J5QtCfFrtKh4vUdUxOWhjMqVMZPluZqCIP2Cst7k93PiAsTmhSkTSCDuHeZk60rLEJlBqB6ycg==","signatures":[{"sig":"MEYCIQDtj0rDWl/pwRGVlC00vY1sz3/RARhWfFKbr4kgdVlNfAIhAMPs3M0lRP1SzJJYC59lfQjTuqHJRhxrdSex/C+FEf4T","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":155954,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjCu26ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmraCw//TJ9g4RsAavSPYo8lzuLikTxUnapuvV3AGqz7Uicdma8yMVgc\r\ntmwr1RJvIXNkp25kOAseFAxO/yvLVqj06QbccwZQGTgneeoV2DSDKXkNy3Ot\r\novetnChI3vg+VC9iyhSDOLTGgUAIKyVUfqOePazUOaxWqs6StDb68W1cHNLJ\r\nLd1vH0sDWUw8WP9z8rTHrpgoHE9mUkBwGdMb4BcpMTow4ybPpXpuMeqxePbH\r\n0tRGqXBr0Z88F1m4ojALjF5q0SQUiBWbv11eJrZmk4hr2DlrMFbLSACD+khY\r\nzKlJHDuGL04dNc0FsHH7TcqD4D+5DkyAmfPcKiJcIEvn9NP5NoYY7e+QF5VK\r\nBpabu9+JCp633Lc1L5zYNEqgMXGSyVSPnPLTaqIhBCl+jRzwz0b489Wwwq+n\r\nIJNUlnppHrR8cFUbyl6pf7y+Fhr+pjQnkIl2d/H2gEd13IH2HXS/l9NfpJ9o\r\n25SOx0+vCiIi7UuU9ZAzcXrsCYoEwfS2Mjg6fpW5Z2NqYIHWTZXufc+MOUL0\r\neC9PmQnTvOfBZtx0P2ZNZXERUBBx6unZeP9Lvq7UkctslUHYnDZxs3K6d24P\r\neqQYcFOMDLWaucfRzXnZRHiTQ90oCe6BHEXBOQ/NoZgKEVjxX59v2P6VSaE1\r\nJH0DfdZS5vbekfcbPDfQ2rkY+fWG/8by9d8=\r\n=kl8K\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2402a69868a8f65d41801fb0a7b090633c264ca2","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-28T04:20:38.534Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.40","@balena/jellyfish-environment":"^13.0.6","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.8","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.8","@types/node":"^16.11.52","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.134_1661660602200_0.41922918736940273","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.135-renovate-balena-jellyfish-environment-13-x-467e2b1cd6943a3a7061bd34f125f3bd8a3c2328":{"name":"@balena/jellyfish-metrics","version":"2.0.135-renovate-balena-jellyfish-environment-13-x-467e2b1cd6943a3a7061bd34f125f3bd8a3c2328","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.135-renovate-balena-jellyfish-environment-13-x-467e2b1cd6943a3a7061bd34f125f3bd8a3c2328","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6e68f777a251a13253cb587ff7161ab2a75a6694","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.135-renovate-balena-jellyfish-environment-13-x-467e2b1cd6943a3a7061bd34f125f3bd8a3c2328.tgz","fileCount":16,"integrity":"sha512-thHD2BfVISJhg4VXBh9MkptmCXWTP5VOyOH1JvEIi+0Na+/QFsDxAHsLZfFgCGoHV76ELXGpN3eOQnMgfFHhXw==","signatures":[{"sig":"MEQCIF0eLuKfjA9lkuLV9MyOAU0/8ODmZZFKAIWIws4npxYTAiAgoat+ZQes1uzlDGUBqBWcYMj/mgUAsBTTy3QxZYw5MQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":156141,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjCzveACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpTLQ//QEFqwEZGB+KvSymhLuiToYhyOC/LsRIawIsQXHR/OuoG4VQ1\r\nZ84eKU39eVA1s+NYCf4zbYjlyanpMYMHemFOL6sIaM54QyblW97IzCq7MigS\r\nkgGYRLYQWw4ysvNVxUPMwOsVdJ3+yuyxYLKW8uRJnicqtArz8+hRhDz7hS3i\r\nRM+F2rJPsy+ZkOhD0wJ+XgbsjTelm2e7EpldBWdX/wgT5U5txKqjRAsQzkKY\r\nBxVy9xWbTXggOaFq/phPWbe71M2AevmZvyyUHdr5r5KICLtqWza004sI6GJl\r\nwDXkTlzkM87sjyLJWQWyQOfgudPY5nFUxRu1Z8nIZE7G63lieV6DLnNs2MGq\r\nNOZ7sZzIBUoRHH4gDD/+Ab3uGrjW5c6kM1HqZtGkbiNTXfEMrSSiokriX8dn\r\nPtubzxyiEiHAuj13m7lWz3zblqlJ6SLbjrbMVxOkWLWthq87XBVdL84lg+zk\r\ntSqmPnvQ60oVn71x0/prTnhlqTR/rCIOYtCppuL1OaxYRpY01IDlEw0fAsQT\r\n8IGKkXbuTG0mSDdX2fklMt9tCCHVhJG24aQnbQUXjdEUZIjiyRqcFCyaABM9\r\nMcQTRSJG4/CnEqtev+1xmD22L7IA+G8S3yOhoITfTTySaYCCeOkyutbdICfL\r\n6uSK4UXi0oj/tXLcUZiyxfYhhufo8MxAl0w=\r\n=gjj+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"467e2b1cd6943a3a7061bd34f125f3bd8a3c2328","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-28T09:52:27.861Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.40","@balena/jellyfish-environment":"^13.0.7","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.8","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.8","@types/node":"^16.11.52","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.135-renovate-balena-jellyfish-environment-13-x-467e2b1cd6943a3a7061bd34f125f3bd8a3c2328_1661680606531_0.5785713811318005","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.135":{"name":"@balena/jellyfish-metrics","version":"2.0.135","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.135","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c2336d699ed4c11b9e7f3989553933a95451a82b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.135.tgz","fileCount":16,"integrity":"sha512-CNQfvrCNxP2eCmC2iPByoE1ywoztVMNB2z0VRRCKqH19Otjqe6/v+itZCNE9eIe7BdVgZW3SccvTEL12l1G6BA==","signatures":[{"sig":"MEYCIQDppSg/ghUdof4qxb67ZalKRy+3Lt9QoOjA/FmDhPmUgAIhAPc38d/ZOFO/E2X+eNyt16PTqfMXX8IqSvnn18K7Jxk8","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":156057,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjCzy+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpR7xAAgiSoyHsYIeAAj1lH0Tf/RRlDq4Nvj68V7wUlR8CgUDb6c+0a\r\nvrp4O0u33+tkzaZ5lzgCdBWpT+Z1rIWWo3EjI6gPKMU0QzL0ilSCwYga/g8w\r\n3VGUeo9kU40rw9YTVGw1VrnQ/1UIVF+zoR3Bu1OzoTs7AniIi7eA19y2wRsm\r\nZfssIQIB1vzaOUgR2snR+0RTWJm6gzKwRTU08ddfIunR/lddLO1C3NH3z69D\r\niacD/x9Yyj/DoCGa03ujhjtn4lEYUyiVhFW2CbXY8DhLDjXP7ykEDl3Av92p\r\nZS3iwLq3DUtzd0cXQLeKnTArawQ/DKAXmu9Ceh/Hspzl2k726S5fTZmmwcvh\r\ni7kBYB6J//angd6PAh9AcAthxhGVN/LI/mJEoo454E+4kQUSkREXtrbJfaRL\r\n40uHb0K3c1hAqUdw8wHPA65kmqtZe/PoCepAyx8m9iSFb1a7dn2iWZkPLfrQ\r\nriNpOJZxz/1SXiHPqxkMZXyzMG3emh+Yv0aYqdiUopEEiDxiJJxOnytPq0N7\r\nmRAUKHsC/3eCzmIQIpiRG3NOq9mGDtz0/gJhRQdYNFrusS9pL+uE7mluMwLl\r\n7Yjhmjm5IEBTI87je2L7ooJH3k2GSF3chA5CpJgS5Cp0T8LGWPkNZFYEB8Iw\r\nLcHzU2cogyWU+jD+hljhrKfK+0uonbGgnR4=\r\n=ulm0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e5f3aff3d4dc10685e5747975720ae02fe125346","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-28T09:58:13.748Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.40","@balena/jellyfish-environment":"^13.0.7","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.8","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.8","@types/node":"^16.11.52","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.135_1661680830624_0.35149800043498125","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.136-renovate-balena-jellyfish-logger-5-x-3138f9456299a14835a951b251354030fb7cd5e1":{"name":"@balena/jellyfish-metrics","version":"2.0.136-renovate-balena-jellyfish-logger-5-x-3138f9456299a14835a951b251354030fb7cd5e1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.136-renovate-balena-jellyfish-logger-5-x-3138f9456299a14835a951b251354030fb7cd5e1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"44fc358551e120f1912ceab7c35f7a446b78b729","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.136-renovate-balena-jellyfish-logger-5-x-3138f9456299a14835a951b251354030fb7cd5e1.tgz","fileCount":16,"integrity":"sha512-O4GZ3Mab7afvYjYJXsW9Orf3uky0YkN1ISVS+6xcmzwwejSwyezf/ulrpiOMLpb1VGEaXqOvgUzCj+i5clRImQ==","signatures":[{"sig":"MEYCIQD/KSBA8CewilPcjqwSGpfxTWDN6+dERTpLoM0pmYHhlwIhAMx79zWDhQdKyQ4HlS+djIH4Wop+D4mjKyPasHyGNp5t","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":156233,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjCz11ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmobcA/+Kwg6uS9sVLD/DRrWxtmELEudQstBvwpsAPK3qSmMh/hu6niq\r\nV6uqe0WJ5Q6NtybItGQ2Zs7tUv4HZITW5p6cAlsnygr8AP3NespiHxm5r+8Y\r\nvRrC/xMp7LcHlaWH3Owwanhpda6Hou9hpO1xQhw/Jp8lGmIDJqNr5yABtb/U\r\nDTiq4W8Ly1f0clQcr6HqtpnaEFdSG+8Gi/kNr5H9J+QE8BHqqJfIHUj2556U\r\nAfT+TacNTsoXz1rhtBpl+i10MgykIy7stLc9h9KZMrGg3n/PqqKO4sH26NJd\r\nC7fdNr3ZsfC5gLxVZjrznijUAAcEHxE6j/Bi2IMt0bvcXSmZ8kzpi/dXkzQ1\r\nwFAfIRWQhtZ5hOPGrsX/FbPvwJe+ARSQZxc2qe4pPya3sFbKJJiZVsLGVgYB\r\nAEP07eZKnf+ceUkLlTzBAx5ZMo+GOsmUtIbkb/ejjmObNkgixPGE6SsZoi/c\r\nMgS1kgwRbHz/vh9kKnNKljxQEKSXzsS8DI8/RA93bLYBxJP3zKIZ6wQkpmjh\r\nGQL+geKEVz6ICeoVO9y0tyrbVXWdPQsa+TaXVNPmgnhiCdavYBLqNe3tbDtl\r\nfwL3zDtplnJRhtyjDHeABldU8sZwZgW/YWqYRwVMucH8hv9TDP4I01f0M/RR\r\nF4mJlByQc64nBvFImR6WZoY61t/nqwWU1ak=\r\n=LFri\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3138f9456299a14835a951b251354030fb7cd5e1","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-28T10:00:41.084Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.42","@balena/jellyfish-environment":"^13.0.7","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.8","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.8","@types/node":"^16.11.52","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.136-renovate-balena-jellyfish-logger-5-x-3138f9456299a14835a951b251354030fb7cd5e1_1661681013058_0.08788232135927587","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.136":{"name":"@balena/jellyfish-metrics","version":"2.0.136","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.136","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b0ab475d9d0d3ac1b84e3bfc8384bfc179bce2b8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.136.tgz","fileCount":16,"integrity":"sha512-uZ9q2Jyt2wR/MuiE+QNnSxvgwNQNgOSfVSoDIm3l7QVKVkizekoRb0HVeZN06tDeLIVdIUxM6WdJEcm2aNvPqw==","signatures":[{"sig":"MEUCIQClVG9Yixkpf4HzFWB2py0LBZ0FxQbZVchHPvHWcVH3FQIgAleZf0CbmPIHTVYeQjHl1Npr5okq5PAILGhxyHouIH8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":156155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjCz66ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoDJQ/9Ex9IKVN2ceuP63hqPuRG+43x7/6BB2K3lvX8WsGh1lbsZbw7\r\niVFSxYfQaFknWvDsYN/jwFw+zTbeVh65UMKx+7gi1EgFA39S4MeJDmFAfPRt\r\nqqBoNR61hjLSWeso7fJCKreNjB1I0UaOlQ6ulNhh7wms83RvtyMTxldJaCKc\r\nkg9szS/7KdcQXjnpG5cngHnPy+QUCYt2aNGUtdpw+4ZipSVnIG9HM3BcIKl3\r\nmpeihJ/9w857zp/51GbkOyGZx5sOm2lgupaXjttpPAMCn3AnWfEexP7vMt9X\r\nsCnqSIwo0LGA5qXk0jGuxHKAMyP9zU75PyWn02WKG/qKz+1duZvRZish+zh3\r\nNZabcmj10fKYBwD1+7UU7doUcbGrn73ppuARrop9nF079jUXdLWElsHID41R\r\nhEcWc7GBuC9Jpl1rLcSmeBD+cL0NMdtH91TmmLdtWSKMFJ4r6ICBdpF64d+y\r\nCjCRumZi6d4SceOvUycnUonV5IU+i/4xuPOOUyaLM2/YN99kI30wpHyt2B0E\r\nM1ncFyA0PjC9GgNkHwF/DxMa44IElhV88mEFDKTLOc2nrRjJJqSEODXCLUdv\r\n5rpMAmn+V4IpsuvpB60VZP+sPGuOZosTH73ADi3+FF/K1L4lhyd6pRav5nfy\r\nSpJBf6KWw+WCXrNPc1WjdEutHr2Da/kqNRU=\r\n=MGKr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"f2ded68a65f373cb02376aeaeaa89ed148cc51c5","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-28T10:07:00.021Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.42","@balena/jellyfish-environment":"^13.0.7","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.8","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.8","@types/node":"^16.11.52","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.136_1661681338538_0.225855337551631","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.136-renovate-node-16-x-4ef384063316a68b113e535cc5108972fe0fc605":{"name":"@balena/jellyfish-metrics","version":"2.0.136-renovate-node-16-x-4ef384063316a68b113e535cc5108972fe0fc605","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.136-renovate-node-16-x-4ef384063316a68b113e535cc5108972fe0fc605","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"124d7ad5343e274f32179910907525d2f4ee93f5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.136-renovate-node-16-x-4ef384063316a68b113e535cc5108972fe0fc605.tgz","fileCount":16,"integrity":"sha512-v0+O4v7wOsHi1nupVDsUCK98UegObqMLporfL/KkrwzT0kCzMl13zuxBcPOaJFBs4oHfCsOHRxNfsZqdSTaeAQ==","signatures":[{"sig":"MEUCIBeJcTy/ewJp1KetaDEDlPPsra9vtAqLL/SnAFyrA6xfAiEA42/ESwSwjzUOTSukeK4/PHMXSfNzLUlxjikQtpFPX5A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":156278,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjCz9EACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq23g//Y7DaNOYzLLziWoyd3/zlxDyQ87iEQcZSc1x/gFzStdBa6+h1\r\nuPuUHhsNsgdHcjrkOsckdGD/l6EINRfF1q8YmCAtIIq0nwZn0k9aknm7EVQp\r\nIhoNEMqSPrTEIRj2yLwyVjqX1aMGZznzhpebKL6wr3QBQq6cEFcC7RpImFhd\r\na8St5+oAcFma28ulttsFP+KJgLcM67kJMb4MTt5B2TlhEBU3dujeOYI9GUaF\r\nlyk9uZabQxokMess43mPp71rqFd44zOxXtHefmWtsY9Rb49S1HXXKRmvDCf1\r\nN/+6rxvGkWbTYpOCm7XUFUdyGLzcd24bXhaJXKQXJ3FsQuYF2et9D7d3GsxH\r\n62JE6Evuql0eBywFlAl69qz1RJlrXfVkzZmJ8iWS0tAYCOVb27PoTqKXRgmL\r\nTJjYhsFRs+g32e2kCfc0kSrJ4p294uu87s3blZwkzgEkAjE5FRJmJW2WMT3f\r\n9hS914q3ofY9nIYDdfsqDv9dt2tVFi9nIKsDFL2PvK5yBHpS4oRNUYDpGmm9\r\n9VmkzjfRPlw0l/ruNJav10eLbfvZzczlh24/E02Hg/GhCdxCYWByry6lWWDY\r\n084D8MClyz5PSgi/GE/psX+BojMZaV52GLqiypKW1kopvD0FMM9uHS9OmEZY\r\n183xXmszP+Mc0mD/OQ9IY+eEPpIrcDMd7eI=\r\n=gzQg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4ef384063316a68b113e535cc5108972fe0fc605","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-28T10:08:12.250Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.42","@balena/jellyfish-environment":"^13.0.7","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.8","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.8","@types/node":"^16.11.56","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.136-renovate-node-16-x-4ef384063316a68b113e535cc5108972fe0fc605_1661681476479_0.9213587759665851","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.137-renovate-node-16-x-22733215de9cb99330b593a72e986e48de3d579b":{"name":"@balena/jellyfish-metrics","version":"2.0.137-renovate-node-16-x-22733215de9cb99330b593a72e986e48de3d579b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.137-renovate-node-16-x-22733215de9cb99330b593a72e986e48de3d579b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7d92e6102c630dbb379093b148d51b53a0d6b396","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.137-renovate-node-16-x-22733215de9cb99330b593a72e986e48de3d579b.tgz","fileCount":16,"integrity":"sha512-NPF7Kt1drbVLHMSOOgkGRSeqT9UPtAYgtR9Rh1DXbJzaGbRm6ILE+jEjWi/cgI4DN+59eKo63JahRZDeoHnYPQ==","signatures":[{"sig":"MEUCIDgdc/xgEhYlO36ckmGi83M2S8Iw7kJg96PtAa9YTfEHAiEA7tXioQM3GtqIx7cAVLFH8G9Ii47H76xa9yVEH4FvIxI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":156304,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjCz+hACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo41A/9E89o+3B0GTA8xdkzGsenFAAr55LxF0AYFM3gaAhplpOoipMG\r\n0iba7vzZe+6I3+cqBZS78840asL/zw2irM8/6GfTr7kEfokjGb/UJXQjELVF\r\nbtI4jIXcPLnQ3ERbm/9aUjFI8mBKiZlMofsDClw0aZT8/oy7Q8w3H0x7tL0H\r\nBZA5xvgkGtgYGLPDfBpkDqN4RUNS4dUQ0WAC2XAGrukcYHqZrl50/sEl0r9Y\r\npnYnFh7AWn48YjuQmh3zH/8L2XRVituCPnwSrSycvO7UCO2wFKvOiQOWR6c/\r\n7WCOD1hYm26X+rOO5XMhMDJudla6ZY8WCzv++h69zVdXFBvz65l8ijoFXVq+\r\nZspV5oNbkgD3N1JkkTMvmuuHFtbg5dRALNo95f/9h6XP4hQSm0JisObBgqMX\r\nTGb86kwtCdkKnV1de/KVC+ordPphGKNveD7O9mImwNZW+2RQBrm6z5ul6GNp\r\n4D262i4BfLJgrtwDm3xgSic5ZfvEBPYj829zDchp7+q6sTly5bDsKO8tHUxV\r\nEO2ZKhCKYnfltsVi80trxc4xu2yJgmFOSKGtxtfbJrzGYCJUiVfPHYsYYSLn\r\nVKW8Nfueq/xSTx9U8HnhnkfNH7gI1IVyFfiQa41Vuj8JWp1wrHjiMlwnRss/\r\n8Tsnxxcy5O6KuRGopPhUAJiJRxmeMQ7Amko=\r\n=OcaE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"22733215de9cb99330b593a72e986e48de3d579b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-28T10:09:57.010Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.42","@balena/jellyfish-environment":"^13.0.7","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.8","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.8","@types/node":"^16.11.56","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.137-renovate-node-16-x-22733215de9cb99330b593a72e986e48de3d579b_1661681569456_0.5425077067021771","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.137":{"name":"@balena/jellyfish-metrics","version":"2.0.137","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.137","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4b5929773c070227aadbe0cb86a0dcc3ae9cffc6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.137.tgz","fileCount":16,"integrity":"sha512-OkIeD2r+FhmcKW0LMmsOAoXWvT8CPKPHhsyM++bqc45OthI52YEexfwoAj8nv6fsqp0brBT9uipuUw6WsZb1yg==","signatures":[{"sig":"MEUCIQDc4cnunHrNn5oNm8X4W9HnVmcnfyQSoPsxLAYGRklHTAIgM7Iy4p9cJcqq1fVxoHdu3AaPWHF6YeKd9Cx+wkznJWo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":156244,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjC0BvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoRBQ//Q20sSCuI3XOk6iaV+H9noaDImnwqdZVh/hEiVxYLakXXnRdI\r\nlKGTSNmVBQbLFHqkTVRbZvODsdE/9iZWWEMK4otV2dvDCCtnunktV+Qi07Ee\r\nafYQ67ZGU+r7ofL2LZ2/hJqOrmPEHx/tb83bX5E7MbydSAxy1RNzbg2FuaT8\r\nDv5rPTkdnpswuz3ElN9uNLZtBCCbZQj7tqb/4C6qqZRZCA3kkoM9U2hKFAjW\r\nlpI4zZAqIcmouL28snPZE9zf90TzmwpWgpxH8QiyjMz9FRy1XNyHj0RTkFSi\r\nX6nQYa3qhFCnG2oPKZ3lijsyHXoXk3wKDZul/G8Xq225J3Q4Fv7mWhHDtt/y\r\nlZgQ1BPJwtRcvKsZTFOHEhnu8bKTQ5w+aPYwKj1ht47Eg/RpG6Vy9As61tMX\r\nBJoKFYXY17CpW81KPXE66AAddKTKg1fzQHhYfDZ4+pN7zVLZ4H28vz0Gkt9x\r\nzHi/kuOyWI76T937+CW6khI3NmJupXvYuXoAKdc610EbejTdWKPOlBEZeefc\r\npYNrvGANiPY++SWycJ+ck1mq7kKASODxsCQxPwWYAk/DhchvsFQ09xR0HK50\r\nETciZ4VXJ72DsU5rQyJNwbdnVCMaBdDEjwkXjBC4azZuH6Sohvx7e2ZV9E74\r\nZ9mrUhzvR0hik5Drp3Df1wd+WUdpXvYF7KY=\r\n=WgVa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"bf0ce3dab530dc3c17d224e175c49298612d04fb","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-28T10:14:11.707Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.42","@balena/jellyfish-environment":"^13.0.7","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.8","typedoc":"^0.23.10","typescript":"^4.7.4","@types/jest":"^28.1.8","@types/node":"^16.11.56","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.137_1661681775205_0.357804094843335","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.138-renovate-typedoc-0-x-4311261246de0791c53626268c6c71d8928170e8":{"name":"@balena/jellyfish-metrics","version":"2.0.138-renovate-typedoc-0-x-4311261246de0791c53626268c6c71d8928170e8","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.138-renovate-typedoc-0-x-4311261246de0791c53626268c6c71d8928170e8","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"69f89cdc2d3dcf879314663f1fcea4062b618bea","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.138-renovate-typedoc-0-x-4311261246de0791c53626268c6c71d8928170e8.tgz","fileCount":16,"integrity":"sha512-FMSQz+Alousfa6Zod+Ejog+mGWlsDbNpxdBNEw3SB3optLaOnpPCa4DPS9yLQOy2jFNWQGhhZYUVVSO5OV3PEw==","signatures":[{"sig":"MEUCIFQlaF7tLxc37ABlQFzz4Gto8feOthUVfvKNLp74Gg0jAiEA4p0yVh6cXt325c6ht4CPb/Vmv+hIqhgJHZO1VQoCj50=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":156389,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjC0EKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrxdA/8Dz1kJbmQV3dAHxk32kJzZWF54cdtg5ERziHYLjIAc6iMowlh\r\n69HBl0wuCBtyfOIwuW3P8vc7ePpcqbivn+q7WIK2L+vPK+Fw9Qu0YUVdgsOW\r\nctJ4AygYS/n+R2gqZuM3rIDXz/4reyIhnIKT5LNR4JXCRvTErzBUl3gwDYkL\r\nto89BDSUfT2GF3lGYm8dlqYsE8fMl9rgNhGJCdm5LLnxub6WilNuZdHZg1Fz\r\nTG8B8oFx1fSD9QShN2/mNS2TWEGhw+PjXzN5OcRYpuk2BaF+8YNb5ZcRU/hX\r\ngV/22eiwIzDrtxBxslOCmHqJEmKw8Ri20O6fM3mrFgg8GGWCiUihiTJDfUW+\r\nvlkHCAheUiLFWiHYyt3ODHEY/mHqGVSgEdZjy6Joyy0qgoJBWYT6hkakJiud\r\nMrJ70+PBkvzz6oj/bAuj76XC17/A7D4OsIXBNO5e13tzIsUqrDcrbXqYjskg\r\n2rHuLtTwTNOBSQDKsnOM2WqXBlgvahHOiingMmBv+9Xa3/tDRGcuW5i+BC8E\r\ntEdOf3MkL2XPS3r5UT8kNitPn2K08IAdrIqWNamU8GHSxF+k5Mn5IKu4fXzH\r\nBf72DnYbOXuK+riaa7ViQz5uHA8MD+VTYK07wBgFr4yqdr3UEY1/cK1Q85HH\r\nYDhKzYbiKe2qaO2fuLQ6ReZXRNOrWwGy9aY=\r\n=6Kx/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"4311261246de0791c53626268c6c71d8928170e8","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-28T10:16:11.857Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.42","@balena/jellyfish-environment":"^13.0.7","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.8","typedoc":"^0.23.11","typescript":"^4.7.4","@types/jest":"^28.1.8","@types/node":"^16.11.56","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.138-renovate-typedoc-0-x-4311261246de0791c53626268c6c71d8928170e8_1661681929906_0.695226338662007","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.138":{"name":"@balena/jellyfish-metrics","version":"2.0.138","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.138","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"abe1887bfc3604282badb215ea0c2826c6aafb43","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.138.tgz","fileCount":16,"integrity":"sha512-pQMINwIKm2x/G6xfo8FtswDuO95yJZvpyOgQMDJmRauX44s4gBrHY+z0cSriwIoS2LY6AwudN6PmzB87J9iE+g==","signatures":[{"sig":"MEUCIBD77M/cDFoIlWU3cvtQc9JF4MfKqo68rLNsVHlSQAh3AiEAversOds0fzfiYDVoSCGqoSkvUVszPOr6mBjuwCb8ynY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":156327,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjC0IWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpB0xAAiw2uq3JOvahPrBDyxsYt2szVg0UyBwW7jU9VZ4KadcqbVqcM\r\nIMqzc/WOrj4DLQhfl3qQ8ejLtm+89WY+oJP96EWEJAyPLQIY+06vPHB9P2AV\r\nrH3VnnTyxOQsHFA7VdwbnkXIYxOeoXNt8voRhSRySyBX1HFCtiC5K+E0VF4s\r\nxJP+OMd5L4k6MqiObPrf5BMEIRqVI8Clq1ALgUNyDbEl31kcnAA42wcdzz85\r\nVpAitqMZZuzAQF4XOVHFhFA9rt/Y/48jXodckTZPLDeotsMHPnAt3ohcBgWF\r\nReMmbIMWV4GzEheG3dL9FjeXenwNKgl2iNN2M/SVX7JB+4m7uv6XDHd+mm3z\r\n6+VfkhKw2h0q5GWibjfY43GhJqZrwhsDpz+J1JzOMGKdxiDM9qP3F0/AJeOw\r\nmBY2rObSo0b/6creKSztz0fM5V7Kqie2boE5xoCTSMA1P7w9PBo6SfmE20/M\r\na4zHL6KqWhOGB8sM/wtWo4F6mw0ES9jMKlajbHjqZJKHPYF06o7vxpbH5zul\r\n2KiarAxytMYqJgEfeJ1abz/VP17z18yR6u/iM2nW1me3O9qTz5d50rGHs4OZ\r\nwt3VOXTz/ShkSJt7qyl5GpYAnYyXJ21zR4YZ2P3MCXX00prlNHSVQIleUVM+\r\nvHcKjaz9ep2WNM63ZOsQyks8CzOtlRNCiuY=\r\n=yqma\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3c28cc1adb15f2d0a858ea6b019a9ef005a4ecae","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-28T10:21:22.540Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.42","@balena/jellyfish-environment":"^13.0.7","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.8","typedoc":"^0.23.11","typescript":"^4.7.4","@types/jest":"^28.1.8","@types/node":"^16.11.56","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.138_1661682198662_0.47592540059207145","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.139-renovate-balena-jellyfish-logger-5-x-8d4a099ddcd3b80a62a0e9beb083d04b29c4cad8":{"name":"@balena/jellyfish-metrics","version":"2.0.139-renovate-balena-jellyfish-logger-5-x-8d4a099ddcd3b80a62a0e9beb083d04b29c4cad8","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.139-renovate-balena-jellyfish-logger-5-x-8d4a099ddcd3b80a62a0e9beb083d04b29c4cad8","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d916a7aa8eb0067c4939ea062b2387f0c4b34764","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.139-renovate-balena-jellyfish-logger-5-x-8d4a099ddcd3b80a62a0e9beb083d04b29c4cad8.tgz","fileCount":16,"integrity":"sha512-zAQdyNOeYyrwDasg+y43mDej0tYjXbSqr5qo+f4wTlhhI7pkwyBmbLGxhBsZthlaYYcEywFlWAF/OYyt/noBGQ==","signatures":[{"sig":"MEUCIQCiZXlVg2h6x/8yZVDJpixi9iR2H7vfscY42WCelcJYYgIgHX0u/yiU/yYSQFAl3gRUdWkj9MFVRYMQLdzwn7Bz2pA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":156503,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjC2laACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrinRAAko/gELs1lqtlJQMIo7PWmM8qpyt4G1P2m9Ef+zxAcdRNrFKk\r\n7QJko7OT3B9M3LsQvUBtN25L1WdR85kx8t6bRwugkuxYqt9O/ZZ4ZA/HxYvA\r\n2zSHqI6sVlFapiu7wW76AlL4XQQDM9cGyc/eEX+tl2IEGYnag+eQcsQA/Jou\r\novHZ8qkPiVmceHWeEVXSB4W7Nf/xt+K0GDzxLsMM1YwOcmuFErHWAiBPlLZi\r\ncCjj2XuGLWil/I2kyBdPG73jex+6IIfwAk0E0uMCYrH312Jtx2gGDx8e/8yz\r\nzbHiV6Mwh5SZAU5yDy6sWxamMV8Vh3vmNqoAX4t15d/GDiOAj0GBQRF7Vknn\r\n8aaLNrAEDYYXc4e1UtGQsXXMUU9AfsOsiBPjqlhyWpGCBkeV5dAS8FCRNQLT\r\n53Q1AxSIJAgN863nQHxagrEHp9UvLIinlZ0m7ZK81OjCctIMfXH8Wp94k2Zo\r\ny+Mn8+d/tOIrav0zwb1ZVjfRmlVSHwn/l+3UnKU6hxevi5ISdbvdsQdGrvux\r\ne0+ecrK7ZKP/qSdqPLB+EW7eg6DrfQVkWhJ2n7m6Cj0wpsuGnREozZmq8X0b\r\ngELCmZq+/IuxH5DeEkd5adomrcHTmLH5K+OWHf08S5gv/zFvWVlr/CtTM2ok\r\n+P47gBWG6MaHwRbU2RGWKDV1TNt2g87gkgY=\r\n=4QZt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8d4a099ddcd3b80a62a0e9beb083d04b29c4cad8","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-28T13:07:49.767Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.43","@balena/jellyfish-environment":"^13.0.7","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.8","typedoc":"^0.23.11","typescript":"^4.7.4","@types/jest":"^28.1.8","@types/node":"^16.11.56","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.139-renovate-balena-jellyfish-logger-5-x-8d4a099ddcd3b80a62a0e9beb083d04b29c4cad8_1661692250407_0.04204369070449987","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.139":{"name":"@balena/jellyfish-metrics","version":"2.0.139","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.139","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2724b2bbc7f3a0d303028529fca9b9aa7364a4d3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.139.tgz","fileCount":16,"integrity":"sha512-jN6v2D6T5FTXE9JrZ2Jwt41bB0N2bOxy5P0vZe1sPUgboN7JHiNMRI5mLBtEBReFd77xsUVZ3yHSPjF1HFFWLg==","signatures":[{"sig":"MEQCIFM95mYDgmDFTstwv4NI3kVBjySyzeVjCwriLwbrhDWLAiBCQ+L+0ncL2OWA6cgTtF2/jbeJkonddzY9eeT2c5fB1Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":156425,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjC2olACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqhDQ//apIJQ6OFZmz+mK2jMUYr1Sm1vWayefVu4QqrHdaY7BIAXAZf\r\nSTvMERVDo5O0iMdCi+lXEHX6xTAmnKUXIbuqRKUmjGn6sF3vuakTJzpFp5CG\r\nG77kwl83JjJhz1tuKoxR6dC8IHBOFXQgM9MUElZMGOQ3cmiPigMa99lUc9FA\r\nSp7xTZtXJCkjxjGZWG3/qrK9o0s/gDcQoRi1U/9K4EssW2llS3OgzBvEgaK9\r\nP4le1QIp5mRiU+KB9ZPhq5XmItWSXwiMwJYehFHfvs/AN5gI9Qx+Q9fsmZkl\r\nKx8Sm8sCllRSXYmsab8T+I6SYm+H51BaI9s0fde7qmuvBuHzYaHKMs4Q06YG\r\ndMvbT5Gvp1AcV8V9i5S9qR7Cg1ut1WWQFlz481qLF8XaU0lP9Nrp7Z7Hqyac\r\nhKB38lZFyUsK5fEMWpeE3o1MC6LqXnm/cVYym9Jl3dgpeKJ8Ge9PQai7czZk\r\n/STbJtJgaxkrqWtX8kEW+BTkK92kb+saeP69OC57aH2Gs1dLJSzf003NiK+g\r\nVz6KUc7r3pMP5/lI9hkNyPUGzkDE1JBvjkm0GrRo57yXOB8ln2LTXrennE3i\r\nNKjCcnzqh8eYwxRV5UWHYZwW0ZTAte/iOnzWn30vd1E7Q5omHQMlhM3wvuvy\r\n6Shzl3uavqw8rOjTVE7XH8Kbm7lk/rA3InI=\r\n=WcjY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"b92e174f17aee0a4f45f39f596dc5bfd0a801938","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-28T13:12:16.155Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.43","@balena/jellyfish-environment":"^13.0.7","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.8","typedoc":"^0.23.11","typescript":"^4.7.4","@types/jest":"^28.1.8","@types/node":"^16.11.56","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.139_1661692453576_0.6522481762879724","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.140-renovate-typescript-4-x-d36b31f7e70fdcbd7ccfb2eb3614ebbfa37a30ed":{"name":"@balena/jellyfish-metrics","version":"2.0.140-renovate-typescript-4-x-d36b31f7e70fdcbd7ccfb2eb3614ebbfa37a30ed","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.140-renovate-typescript-4-x-d36b31f7e70fdcbd7ccfb2eb3614ebbfa37a30ed","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d7ff166c73ca6c1a4bcf288fd33d462fcfc16b17","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.140-renovate-typescript-4-x-d36b31f7e70fdcbd7ccfb2eb3614ebbfa37a30ed.tgz","fileCount":16,"integrity":"sha512-16F3nlIRdWcN9DS5sjKvMcxuWCxNWgVQRflTURHQvPoQtJNGApikM4gocLHgTUf1aK6zratSBj6+T/HXMdEElg==","signatures":[{"sig":"MEUCIQCE2XC+AbqwsmBcIUqFQPMfWK3vAJ2M+2xY6Pa0CfmRegIgPcHxDBqhxM/h+74B5UMBft/KUU3ZZTMe1stHH6s7sZ8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":156572,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjC2rwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpkhhAAo0KZAEZJtkgADtkrJ9MnPKA9yEh8DD1mFcwUs0eji3p8gF9w\r\nnxWVlWUStSyf/AYAFkF50wwpqyv9pLfz29prTzioxqjy3YEVyXBegVkBb5jN\r\nlYkMPXnca97D6oJq865uHUm4hnj4NdrtLaet0QUMmPUhmyZHaFZpYNxmWi0I\r\nGvxPVE1qQqbiU51C2Do5lNp5+B8CuUFMHQt+TgT19+GXdcfHqJcT0/oskwqj\r\nxjAGEd3L1Paw4z7lqwPXGyXdyMxLciJUieAINnKrZXjmHwjNxpe8HyLXXIt3\r\nJdEYLOHlsBfkmJ8vbAyplkmfEdUnFyKalYigCu+TnSt6nwM5Wz0JVjIB3+LB\r\nlDzI4BZiSSXBNCIxlGdDEUEfwu/UmBbN8UVlueTUnrL+k3LG8wYNEmyldZ2V\r\naneUtmpIQsgcv34iGQ8BJjufVV12f8aNHGeLoKwvPg6rR+jS3nn7W+fA1vL3\r\nL1le2yeU5hROZVRfpICkfGo0WBH0AnwVJMXwBIQ87xvqwQZNQdkpAteiyA3P\r\nPE0OVZT05O5mDOpC2r+YPsSPsVVksiekOsnTKlcjH7i+sX4WFxEhAxyTwqf6\r\n2uxIwZ9zMxIkq2xY3Pt5gqW+j98P5uMVvQEkex+35OfclWa94VSTsd+Cr9JG\r\npacEov0OPdIEmAeWEXpsVaYY8RSo5DiAjIc=\r\n=o92w\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d36b31f7e70fdcbd7ccfb2eb3614ebbfa37a30ed","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-28T13:14:57.319Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.43","@balena/jellyfish-environment":"^13.0.7","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.8","typedoc":"^0.23.11","typescript":"^4.8.2","@types/jest":"^28.1.8","@types/node":"^16.11.56","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.140-renovate-typescript-4-x-d36b31f7e70fdcbd7ccfb2eb3614ebbfa37a30ed_1661692655896_0.10104122986003805","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.140":{"name":"@balena/jellyfish-metrics","version":"2.0.140","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.140","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d1185d8ee040dcafbbb3bb7407478969907d18cf","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.140.tgz","fileCount":16,"integrity":"sha512-NqfHwU9w+oR9jcWG3eXf5mCnsSkM8WvBT096jfYOjzDugmHOqTxjmDCHtuC857EVWYFIsMYvpCkYqeDZ9AJoYQ==","signatures":[{"sig":"MEUCIBWPy0Ei01d66AveZC0MhrPkTGz3brAg3IOvzaCTaP28AiEAy7y6MSpdyPxs0QlEQE8WcvwkHfEeuDQ/LxCYPd29dq8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":156507,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjC2vYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo1yhAAmE+oIUtSp4Exy5vK3wCCr+9/5bmzCFESkUVwKQEcvwb4Hqnh\r\n2w/ISDHu6ZtUqIBWG8TWzFKRxwrsETCYhuohz/+9MOJmWYHLA9S0dwH2oUGz\r\nD6jdbGBfbNBqR2P8zi7qF3TOO2NH5phT7DoCRJmTHIn3QTLqcnb+y6XuS5Vj\r\n4W2g6Q7yrk1jLNl5NbYKHivm0Ni4dGtWPw36mkiJNc0yUyrBdl6Rs3lPH4Tq\r\nie3uyVOyB0jI//YoubvgkWDvZHlGYPpRL4F0WtEQHGZfmzwgSd9jT+3kew3j\r\nICpKuBWnneaOmzzGUXBQ71pasn+hRUiMYBdB5YDbmioJACVaOzLeQ3N8GrK1\r\ng6ofKZX+uFVW0T/1hfzulQEAwOdtNFKc2lVaCqi1C38DIBSaWZ7sJIOrDbx0\r\n/Uom+aS8X/pfvquHEiY14dlSs8G2rnReGUEirg72W9vylkTu0oYnx1TwVhBs\r\neRhLaBx0slKlV+RyeFBoRJZN7WNwT1eINuoMmjWnIuvJVhHxUYWUrSgI1jPL\r\nXydwcb8yy4odcDvdBIz51EyGQVuvD/ofCaQglfchy0HdamaP3tyIWcuXPN7B\r\naWfg38zQds3ZpdqnGHDtcfnjSvm//gmDbhLvkqXu6MOciF5V+G9tez1xnLTz\r\ngYOIk6c3c+y3eOsLFItEGderWoJGd4gL2hw=\r\n=USb/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"cf18ae484a7529478df97a64c381631f880b6eaf","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-28T13:19:27.353Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.43","@balena/jellyfish-environment":"^13.0.7","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.3","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.8","typedoc":"^0.23.11","typescript":"^4.8.2","@types/jest":"^28.1.8","@types/node":"^16.11.56","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.140_1661692888176_0.24072448342362618","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.141-renovate-major-external-major-3fb0697d75095d025efe79e43d31f3924b87a1f0":{"name":"@balena/jellyfish-metrics","version":"2.0.141-renovate-major-external-major-3fb0697d75095d025efe79e43d31f3924b87a1f0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.141-renovate-major-external-major-3fb0697d75095d025efe79e43d31f3924b87a1f0","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"513b90ac14351689e2790b4eaf7b19ae0cd962ee","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.141-renovate-major-external-major-3fb0697d75095d025efe79e43d31f3924b87a1f0.tgz","fileCount":16,"integrity":"sha512-VopsP42jyY6mGZtMYTHD00GKwCrraB6ebaZ+XqAJJDv12b8SgJf8B3RcBgmZGFecD2eJcicFJWICrO3BxxKXMg==","signatures":[{"sig":"MEUCIQClpeqk3Nq1GlDLcnMlLiqH8PDp4jrvdDLnA0RmDnTHHwIgNbK08oApYR/SGJedqxx8Y8hl3Qi/00B7A3USim7BxzI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":156665,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjC56iACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpxRBAAhH8nsPY5TbpSannKkRgRY3W//j8tRSAKLDDEN/reT8/dPPUS\r\nCTaAtfx5gWLY1CHu9g+7dRb2FTq9Y+u8OAzXyJ2I578ffC/tZmq/w8DcEynn\r\nM5g7MRrzMvRyk/pTFcQ3H9DR8GbyRSPMqf7VA5Hdh1IRXaRN8puuFuRkEF8C\r\nUsLdEgFv7yRAnuop72CISW4KWUjpX9g17L0IvkBTUQLZoAT6Ek0NnHGLPSqc\r\ndd8cS85vIEM4x+J1f/XZWOQODRw5zFWRSAYsa+MDGYlRKZhz0/61Wxr1qYaw\r\nN7KlCs9XWGeY0iK61gwTeVl3AJ0blsoG9uuLJ0e4rVUwh9Q+oCWHatx1fEpK\r\nKaRFUmD53tiJgQEkE1zvsf43W77cEToOR/Tg22PIIqqexC9BkB9VH8bhcNy8\r\nbf8bkRO6+snELLrTuRDeriCSya6bYnpUi1hLgcqYSQHyFlAtgFDQCU7bvytp\r\n08ffnvomiwtoCn7aSvAp/YwUvT2Mi37EDlidPqB0Y/KmdNe6UUxVj5PhcXXv\r\n6L/ZDDGl9XTDpQzoCDdO3F9uMxdpt2mVfUuN7rrFNdmsLMROBmO5Zgi4M/l4\r\nsRB0HUkz3vn/5Bzht4d4WkO/9H6Pg16TjV0G69G5ClKb1+fQHOSIupGtjTy7\r\n1FdE4BP8IpgmZd9tIQEWh61mVUl94EZhjfo=\r\n=tN1c\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3fb0697d75095d025efe79e43d31f3924b87a1f0","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-28T16:54:50.915Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.43","@balena/jellyfish-environment":"^13.0.7","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.8","typedoc":"^0.23.11","typescript":"^4.8.2","@types/jest":"^28.1.8","@types/node":"^16.11.56","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.141-renovate-major-external-major-3fb0697d75095d025efe79e43d31f3924b87a1f0_1661705890087_0.22102613905913815","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.141-renovate-major-external-major-c783e8192199d975509beb6d8252eee8d224902f":{"name":"@balena/jellyfish-metrics","version":"2.0.141-renovate-major-external-major-c783e8192199d975509beb6d8252eee8d224902f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.141-renovate-major-external-major-c783e8192199d975509beb6d8252eee8d224902f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ce17038909631a46c1c682be2ce79af8b932fb2d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.141-renovate-major-external-major-c783e8192199d975509beb6d8252eee8d224902f.tgz","fileCount":16,"integrity":"sha512-adNgqbdLkW7frqZvA3rr3lRxcsYub9unCjcEmjJ++uNQkIDhm5by+9xx05TRX104za1p7g/v2idYSSgVQn3qpw==","signatures":[{"sig":"MEMCHxh2k3OTChXOQ3KbEHQNCb2DX87ScUx9Pe2eTKvT0KQCICEi7gq0UsUQ/vrpwmhtazXsS2+hLWPlA45f5H8Nwspa","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":156667,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjDWRYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqpHBAAh1i4Ozmwx+BPYh190RUdlcwnuk4voAsDdA1yozuheOQ+mn+j\r\nr5WwdsZUSRo37IN/EZIFpWNaZrHYhrk9eb3+5TcNZlWAi4wiatpZ1cMShXER\r\ngk7hp1Hz5IIH38+l+ge3pPBR+QVsQtcL4Go0IyD+bCQFI6GGfzRxZSLJZ44g\r\nMxuUzPaT1nFDwTToMyhh3iLCRr69xwu5R+mnpIRQmRZgtbDDhwBr3PZM42Ui\r\ne7rbFY/XmYVSMq6h6ySFx//n33fxQu/kxZUG1SueupRstepyldfFFTU0/D9r\r\nLylQjf50FcGaEJGMOewy2JWp9b/jr5yXIugeswQiRXyOj8ovH4hEb28MXuyU\r\nS0U+ThCVN7Q6i/gyn1CX2SD6kqfhib+/OyQsaMHrg5+BAvKfvQuD/STMV+e3\r\n6mhTAcJDRZnHl3s5el2plqPAGNLtcWuFv1asbynMgjIkBl+v+jA7RE6wvPdc\r\nsjN/1ktLPf5CWQ4gvdfAMBX1+8/I1t5mc9EgLfp7Q9Lu6utATE7JlJaoC0x3\r\neC6HT9RwyVjP7xxnPmCYiTEiCEzkH2QaevckO7M6omq8tWXbED9q/NLIcem2\r\nTPkCu5PQ9SEUAHGWbBcuxZBuPjPe57BVSCuiOsO5GFyl+bHa8rVU55ralnl7\r\nvZ4FgFOwDstSKJeGUC0cq7fNxRu1qzoVdSY=\r\n=YypB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c783e8192199d975509beb6d8252eee8d224902f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-08-30T01:11:18.678Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.43","@balena/jellyfish-environment":"^13.0.7","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.1","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.8","typedoc":"^0.23.11","typescript":"^4.8.2","@types/jest":"^29.0.0","@types/node":"^16.11.56","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.141-renovate-major-external-major-c783e8192199d975509beb6d8252eee8d224902f_1661822040618_0.8476422808441209","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.141-renovate-major-external-major-6b46013467e5cb0246d4f0377a1be8aa419bfec9":{"name":"@balena/jellyfish-metrics","version":"2.0.141-renovate-major-external-major-6b46013467e5cb0246d4f0377a1be8aa419bfec9","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.141-renovate-major-external-major-6b46013467e5cb0246d4f0377a1be8aa419bfec9","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3582772fc43cb1ad935e3b438bc79fded0c343cb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.141-renovate-major-external-major-6b46013467e5cb0246d4f0377a1be8aa419bfec9.tgz","fileCount":16,"integrity":"sha512-302sNbL4wP14wekrWi9fXVmf6ffJe5c3osKAgVgQoJ/2NhYiwj7O4rnfKPNOTyPnw2EJioKJ847RYFD50Iqt8g==","signatures":[{"sig":"MEYCIQDFkgqbEfU4Z4N6Dw30CSrRDDpHQFNprYH6B+iw8EDzlgIhAMOH4BCPJ65D4q1WzaPpcRbCaT/WokAma3CkfLYwvOvT","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":156667,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjE1HGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpV6g//WOcatpU0Pn39c8reD+O988+8Bc2KCt4DH+OJQQoeUrhuP7eS\r\nzH8CMZaTWOo+zxgPjHze+iS4Fw8U7nDwxA7X0HP1Rk6pS7jDaatmCsvLMLr+\r\ny7Ac8Pa8wZM4yMTugGJpfAi8Atytfh70zmAU6r0Yxwr9aGbQIU7cE3h0dtYc\r\nAKnJ2EW5JnpOSKMriRTxzmOrFzQhNWXDwFPMS2oPcWz8e7+KvlC5zLCnoRUo\r\n05fPS/Pkj/8WoAZq6Tp1qrRcihTLMUmY2wk6bUqsoXVazp8WKmmRlhnV5Aty\r\nnm1WVTkWWN65sJuwFmKZbVexexRGoMPlp0KPb+lijXHJbFxq3Yvq2fMSQAR5\r\nFl1BITUxaWFtn0IqFxVqx/J52spNs0wbfJYDan1keDUSchmeiOsrMW0TZ7ou\r\ntFwk7GrFdXyw9V5eCTQDrr1ZNo+L/vpvhkHT1zylc5JEGmhC1Gk1bXs/Vk1p\r\n5Mth+ZyvMSkANp6gOW4ECEf2BUd0Rsinw4GnkGwKIsy1d10SvwQyQi4nDq2Z\r\nsAjqrjqaVkl39LyP36YujTw2EuiA5WEGzi7FEbycloxszfUVwDeekKZFzsxJ\r\nfd6SKk9F+tOfx+LVy7wUyr3ey/6qRZByBiDTvDxleRexQuEMhMgZasc6XE3J\r\nKAiCGv4zmtmUnFSOCrS2LVDchNhL8Fd4IVw=\r\n=9rzn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"6b46013467e5cb0246d4f0377a1be8aa419bfec9","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-03T13:05:43.219Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.43","@balena/jellyfish-environment":"^13.0.7","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.2","uuid":"^8.3.2","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^28.0.8","typedoc":"^0.23.11","typescript":"^4.8.2","@types/jest":"^29.0.0","@types/node":"^16.11.56","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.141-renovate-major-external-major-6b46013467e5cb0246d4f0377a1be8aa419bfec9_1662210502085_0.4123926661163788","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.141-renovate-major-external-major-0a01649c0a81a161f3c53479d4e27acd04d6b20c":{"name":"@balena/jellyfish-metrics","version":"2.0.141-renovate-major-external-major-0a01649c0a81a161f3c53479d4e27acd04d6b20c","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.141-renovate-major-external-major-0a01649c0a81a161f3c53479d4e27acd04d6b20c","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"28bb23362de5048da5f2d5e90bf5d287bceedc32","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.141-renovate-major-external-major-0a01649c0a81a161f3c53479d4e27acd04d6b20c.tgz","fileCount":16,"integrity":"sha512-CrpVOJsMtGEFHz+33UH3xjKTIJAbI3vE/gf9y5HF5rmqkfIT+iZIPDzZ10JBeGm7eQiWQWUozWhjeDr6NoC7SA==","signatures":[{"sig":"MEQCIG/4+0BS6CRs+sGShyJDDQb+2OsQjs8iLU/rATApHKlSAiBXz5ldHAZLqu0DE1yGYYsp5VAmIXHkL3p5zHtts9Drrg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":156667,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjGyXlACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrmcxAAn5+SExn/2ZTcrh5v9bjfrtZ27rbILqXROAZSpKebRwfJxNiO\r\n4s2lFpYF6eZB81lsqt9xZkJo2qmjLuCR0a3S+Ilh5DIxUIFDKj6DvmSXD2T/\r\nhTpvT5fFSfDq/OmMPUyGrn4SH1j4igsrDGUPa/LMsCEQuJfBuIpsx9IG3Uwr\r\nbfoYmcN+v7TsB0VdexRs1vDN8FatgGBfLLh+BylGyvGesT6rT7Fg6y0LkrP9\r\nHiBkQ8HTBSMnvwnAmLUiEQB8qHS1oD3lmGQ6BIIRGbI369mLpEMeUNjZu/yY\r\neyCm8EyeMT+RcXJ7IunSTtICYOQ8qeszx9Y4I13fqT05YV3KrI6mpk326nRo\r\nN9ska8ZDtj+646JtV64oiK3s6zaqTEnx9ds6GlLSmNegcdcsP2Ys1hejdvx9\r\nVLxfaM73K02zLsvieCUoOQXQp9Iornufzac1S4OIx2LeV3lXpGT1qIegFmM+\r\n1t6q14/92tuD4sr1ymTaQn3Tcs6wQEbnQnGgDwxPdHHDKZXwzUIqb4H6DViF\r\n8G3iwXlOwr2Neg++gGMJsfDOgSmEh3/WqKeJtxnuikaS3adO1ghk90WRAQ9g\r\nNtjCkmeWWJ0AnoLyzElasW0rvkH2nqTA4UtRGP+gpT2SeIqdu/q7/je5yeJV\r\n6PkbOlpVjkLw05jtnBzaNS2LuuVB2zlUd0U=\r\n=X1Tk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"0a01649c0a81a161f3c53479d4e27acd04d6b20c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-09T11:36:27.884Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.43","@balena/jellyfish-environment":"^13.0.7","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.11","typescript":"^4.8.2","@types/jest":"^29.0.0","@types/node":"^16.11.56","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.141-renovate-major-external-major-0a01649c0a81a161f3c53479d4e27acd04d6b20c_1662723556897_0.927829592838918","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.141":{"name":"@balena/jellyfish-metrics","version":"2.0.141","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.141","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f1347ce27f615e456efd4663a7f0e1eb0a9e6023","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.141.tgz","fileCount":16,"integrity":"sha512-CpS9XmSlDXC+8v62LPqQHcKCIbD2fHArd+q9lauyCIVF8EmvphCtfQlozGka0HVFkEZWC8sggJPJ//oRMpZgkQ==","signatures":[{"sig":"MEQCIFIvzYS/5XVeImfe3sus1+QlCtyWtg8Ty7uV5tB08Q9KAiAGZ6iLMb6JNzbyk5uB2ocTgjcHvS9AUmW13nv/6Uovjg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":156596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjGya7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoKHg/+KpC5nLGXmWYRmpDnFLAB++i2aB7QqGSYPrlz05D5BGtearON\r\nt29q7TeRNkKy3nEinG7QUw1plTuOsodOc2rK0hdfux6y6mW5inNeWFoptdRV\r\nDtsWo46zSX5ZCV6UJbe7qmKVdR2k5V2/CsT6radCyeL/tLWOd2OdElbiCCe6\r\nvETWGiPuKv+gXSTa+iHci9Pz+2j60QPQAWDVy5Cvk2DpZTg6kaZk0vhIXlTL\r\nxpg23DhMxID66qSiVKn2Why1MfbbLW+ZPeRM4eEBMyK0NuNqrzgLVkvn7jNX\r\n+OHZ40a++/Ad4pMX9EjprL1wbrBblvWXDlMkzenwJvpPjrPsKYd3t0XCjAaj\r\nAAbXbqS+UMc0J45BzOMwphpVMVasBi1P4of5HObtVnh04l7jXBvTco+1PyAE\r\n8f53zorTCDq67R9ZRDEheDRSQFIY4pS4eKsB4YzmsTXj5rmORT1H2m3sky83\r\nLjrYmv7jUyzaQ1zP2rgDaNv7nCwz7HSILpRpiGWyYkGFoJclCbeQAlgU/06l\r\nqULM4SePg4OFP0j/iKGm16vz/gtHiwzLhS129I1IXZKR3xmsSY8YiC7UCWOm\r\nniCVmNSwN9GNcUze95cq4Nr/YaM95Cc5Az+O9wnQZL9azw8BFHZO2CIzQ/kM\r\n71OxO6xijzWfGjom5zcCz9qgH6yC7QQ6yXs=\r\n=wIQK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"25f7d23782303b06196f8de195f1d6fe5813c8f4","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-09T11:40:42.295Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.43","@balena/jellyfish-environment":"^13.0.7","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.11","typescript":"^4.8.2","@types/jest":"^29.0.0","@types/node":"^16.11.56","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.141_1662723771632_0.3268295111337789","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.142-renovate-balena-jellyfish-environment-13-x-88a1bbb14d49f757eaea9dc8ca8baa174d46c64a":{"name":"@balena/jellyfish-metrics","version":"2.0.142-renovate-balena-jellyfish-environment-13-x-88a1bbb14d49f757eaea9dc8ca8baa174d46c64a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.142-renovate-balena-jellyfish-environment-13-x-88a1bbb14d49f757eaea9dc8ca8baa174d46c64a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e7bd0cf70904e8ea0d36fdeac81644af27b33aaf","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.142-renovate-balena-jellyfish-environment-13-x-88a1bbb14d49f757eaea9dc8ca8baa174d46c64a.tgz","fileCount":16,"integrity":"sha512-iiMiQMA7cKyjU16fNTijZIGSXcYhcXbM11Y8KotOqqy22Z6gHY81ACjM1iY2PNm8emtbtYMqVL591BhXCYlvNQ==","signatures":[{"sig":"MEYCIQDtNbxEUNBUpKnlB3oyaX6cSYSfJrQiZKZ1k3IbGsPWHwIhALikBZRzRY27cf+Y8yrJMaFHMbwmbR+u65FefaKUolnc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":156783,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjGydSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrTRg/8CPUTmnH60bwwo9281dsNcry3sTIR3qpiOZgLbfT/Ea8KNrQ6\r\nFqDPoLlITjIFLmbzNAX0mhS4UdcOit1XK81q6408OWBUoo4MrXdvVFOiAfYH\r\nFqCf35VsChMpWxkskMbctfWmWYdUz4xsRcKeDlt0PQ709RZTtED/PQWIWfnR\r\n3i5Vkd9FpVJp7ce2Au3asO83pIbwLKLr50DGiaTIbZUfRdaz3zj0W48ccMKb\r\nFY3pIXGGkR/5aXlgZtLCcUYCVQJ9yGQRu6C15KodcMmOYiRC5NfW4xQqzZmK\r\nRM4JT4gaHwNB4ZpXC/0ptOZhN31wlv7e85OhHqB7SsZ9LT+1Ihgm/EwJ3M3W\r\nc+G1KNikI4iTnDjz1hdBhEaJMzL+7p/tzsHc8R9vXIg3KMIt8ycugmQvGRWH\r\nCDLycJMGvEOFeeRNgpRwX+ZbsDvEvfYnAsGBf/Zz747bEQxiiMxGIly4hF5N\r\n0DWjHpbM7OG860SUKx9OlT5Fc3b70ij3s5zd0cPWiMQlfGJP6aHKfJBAGdbI\r\nTX4mrBELedS698T/sZ+NGFEutUL6OVtfsL5+TMtGmxGNlKU2EZUxxs6y1Ahr\r\noLKo+CnMM/xYO+W5QJ5NnBbslbLiiZk6JiDKAqOKtSUEcdLbu427RXVL3oLA\r\nOjfjvlN6XPWM1x1PxLFP+okZTf4OINMAS1Q=\r\n=nOiS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"88a1bbb14d49f757eaea9dc8ca8baa174d46c64a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-09T11:42:44.742Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.43","@balena/jellyfish-environment":"^13.0.9","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.11","typescript":"^4.8.2","@types/jest":"^29.0.0","@types/node":"^16.11.56","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.142-renovate-balena-jellyfish-environment-13-x-88a1bbb14d49f757eaea9dc8ca8baa174d46c64a_1662723922018_0.8953512066415676","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.142":{"name":"@balena/jellyfish-metrics","version":"2.0.142","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.142","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"40bfec88d25b20fc53e6fc2f60dc0d3e2551b7c2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.142.tgz","fileCount":16,"integrity":"sha512-KOHbBqoKDGm44SA4MpOuqLnpOAJ1NAkbm6AptwdycJ17aYXrtA5v3Yg/vEqO1ttt7soNykJLlh4O61x2DSldTA==","signatures":[{"sig":"MEUCIAkUkVebKDBNw3bmIYI3Tn8SwBwNA9/4iRBwmIxCeJDNAiEAjRp+3Hji9wnQY63c6D6qIo/OxcW0Oapw4oyI8OwVEeI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":156699,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjGyhmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqsVw//RfA0yMsk75lw6FmdYeyjJGIBv7Ff+fxsE/TK5YR23YfiD+6v\r\nLvIaRGcTqBzr3+bGjhwgVnaOOPWMc9wscNN9ieE25Z03piOBW4BHxdnE/9EX\r\nfiAhlVqD30hoW19mzz548KXaLIincDF2/h0aZNxyeXcKq1gY+zkmq0Iavose\r\nmvvi9ynNaS8SO7PvVe31aGr4xMMuecGvVnAvdjQm93UL+mRcUbrNuw0NpS4c\r\nSmQfehq2oYsYOsTu6T7TFyQ5qpLe5AppfxcU3piZzyhu55d7YOTw2+E6M0F3\r\noTe1e9t2Vyw1AEaxN/gP01GaKNMbUTXnB5ky5BRWXEpIIf8hZBrzaVsgWGr1\r\nz4wKVtpahoFWHSIki2c74/PrJL5YeRwG/24jrEtsp2o0C+hLFjdcpZLK6l7Q\r\n6LlGbNgAPxXxrksweuESMOMc0jFXyywdUay3o4q3tIC8yG5GD2rtiegFeExJ\r\nj1VkCf2rjmfqoyEhc6F1X6FLmJ8ft6C8Srwq8ieZHyKOu8Z5hWv/iGFRdpfS\r\nGPvC1mBIywLAJjG2oQK9A4GZFtRP/omw7rb2PiJjHYIDHvg+rYldO/rEVVOT\r\nqsQ6l/gAUVq7R1BbthToJbA5Y8rlb//B7nlGnBkvU4SqGdF3y7IzzKOzo0ZO\r\nnZFVQ1UapCzwaeGs79LYHg/n49uO9Scozxs=\r\n=wpTJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"68f5bd29f1b1099138bb3a596c13ef3b7e67ff7f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-09T11:47:47.682Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.43","@balena/jellyfish-environment":"^13.0.9","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.11","typescript":"^4.8.2","@types/jest":"^29.0.0","@types/node":"^16.11.56","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.142_1662724198482_0.19788733567379224","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.143-renovate-typedoc-0-x-94aece81e4f3722bda8630f7ab20f6bd9633ea1c":{"name":"@balena/jellyfish-metrics","version":"2.0.143-renovate-typedoc-0-x-94aece81e4f3722bda8630f7ab20f6bd9633ea1c","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.143-renovate-typedoc-0-x-94aece81e4f3722bda8630f7ab20f6bd9633ea1c","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"47056b06eed2d3dbb2f700ad99655d4162ae6282","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.143-renovate-typedoc-0-x-94aece81e4f3722bda8630f7ab20f6bd9633ea1c.tgz","fileCount":16,"integrity":"sha512-u8TtxezSwV4QxrKLBURtujlYTl2O9RiPL77SsO4MZJO8fiemJc0syOF7tPCVCqKka88jlRYg1xtmjzWEJDBGWA==","signatures":[{"sig":"MEUCIAN5czRgkkT4ixJqDZvGNQS2is+n3gZD1uRA6gt4LUT2AiEA3HZh051x3mXc95ImM6dDoKElSYGH0m+zEX/gjdk+j4w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":156844,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjGykcACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoLUxAAoco+ZeymkhGIzV9L+c85AMYRdRd2uUNB7mCpJ2L8oUYm6jps\r\nSMX3TMtkZV8YZY4IHdaC+eEHuDni2zRYao8rjv+VN2lrPTmRybGcTCr/QHhZ\r\njRy2KovvP3DUYkthLYJl0WZjzsuMnkIBJb5yOyanHVY4r/f9CmWs999ddXsQ\r\nFbFCaBDRQGo2Y9BRAUAVyJ4bT9UVCFjOiaBt6l5o7Wnp6CaHQVHo+zZLTndF\r\no2JnDbu4ny1m3L7NJhhrLkk02iHKdpAIKSur2jzah6rvTQCiinlzIrpOpYdL\r\nx09HeAb+CKJQfI3bcrAgHEqCHbZEK8BOxdkRrA0hE5Lh68k61PCCvUEC7sxp\r\n1//gdnMH1Ss5XkGWTaMHN2keI1zB99Awy99hFfYNu5HpUuq9fDxz9Pt7gTom\r\n3A2//iIfo+tY/97x1W132WJcmai23i6ZyUWvVBmKqeguaVwXbmxqbMqwufmw\r\nolCUOC1IQrVcFV2vQO/XMPv4/ENXeg7LEYQdYVdrDUaFhH7Jv7wGHsCgr7KN\r\nriwAufsRTDBYqBugCIhfetw7OKjFRZ1dCSLFlS0WyRia42kyKwScqTxyWh0v\r\nfB2czn+6/SmWziM4xF7oeEL5arA+/a4mGlrpspUSyxIyFUUlZdcEtqcC3KY0\r\nBxIU6/cALXMq5jQzH29Hayhw9ZH9mwBSuw4=\r\n=nJpM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"94aece81e4f3722bda8630f7ab20f6bd9633ea1c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-09T11:49:49.814Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.43","@balena/jellyfish-environment":"^13.0.9","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.2","@types/jest":"^29.0.0","@types/node":"^16.11.56","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.143-renovate-typedoc-0-x-94aece81e4f3722bda8630f7ab20f6bd9633ea1c_1662724380049_0.3098421509796787","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.143":{"name":"@balena/jellyfish-metrics","version":"2.0.143","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.143","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7334f5b4be54cd97ca0f11aad4ca4d5dc4ad39a6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.143.tgz","fileCount":16,"integrity":"sha512-KRW1S99ox6iObUmhQsfm7zVdIip+b9uBqeeYkHZMM6kYWCCBuXLJO6LPvYMGg26ZlOeImWizViqXHcv67QG0sg==","signatures":[{"sig":"MEUCIADbZK+1h1oMmfBAHny32nSv5CzykKZDDYqCoW0I/TGUAiEA9HnebJv1PpcnNBc6vH4OvkFuED0wizAf8zwMdo0IqzQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":156782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjGyoUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpefg//ToqHrPunWWrDYwnc0Jvpkt9gFqhEiKEGsE/oKOGXFQ4mItgz\r\nishfrA//Wk+CRQO08wthMuoD1QlsTFZ8wJpLa3fjgbbBdC2kyh9jm7FRSM2H\r\noFp9AT+DIwKgYVb7U8HvoVpy9pNLj3de25cSxwTJ2f6tapOec4RbO/fkRxVw\r\ncQfpRKTkWe9GqvP6B+U6l+mQ26rkRAQ1o0OaMXy+Qbel6jKVtbr6Ac4CkoxR\r\nzZNgUbmZgCPt/EHzFc51JWb47ibAWNQzdcftostIg5UwmzT2RuzHckA1IDUL\r\ngAxxUXPwcA+Irx4l2SyRMXRIIcP1b3QxD9m8nYjvac0qOg0WPCWrowgpD8/C\r\nYKDoySuWDt0mNeJeW7MACvhFpWsYduvdvnBIKmXhdstNx+UuRdGBkZZ4IvXP\r\nc8rHVL2bOICLqZIT7TjzjshVKszWT76oEljoCxEwMeqpucuy53SjkNjqKoHX\r\nYeJ9j1ZL+VgiPu1MNdtGpemEjJrPK2t9UothfNd4WjM/eca965jPyPCFNaEE\r\nO7EC0Hbf7iJsaLV4NIJpKLPLbu7iuIxGVAEoGM80ntzTn4eOgNupY/rn8n4D\r\nKMAHKQErtzrnf4WvZSIQXDSWP3bdTi3xBEzt43pSNCtVCjl5IA1z+jDA4TOW\r\nVXJ4Lrf6flp27rL+4lXQLu+K3x/GfWBtwIo=\r\n=7imw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"945257109891f651fe6d96c3f5a8683e064504f8","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-09T11:54:57.107Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.43","@balena/jellyfish-environment":"^13.0.9","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.2","@types/jest":"^29.0.0","@types/node":"^16.11.56","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.143_1662724628638_0.45377805666449533","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.144-renovate-node-16-x-7324ca821bf46ed47c0d7f86f883d94a5a49f650":{"name":"@balena/jellyfish-metrics","version":"2.0.144-renovate-node-16-x-7324ca821bf46ed47c0d7f86f883d94a5a49f650","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.144-renovate-node-16-x-7324ca821bf46ed47c0d7f86f883d94a5a49f650","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e36f98dcc835b36d0c500f2f45d9db53a2e6ae2d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.144-renovate-node-16-x-7324ca821bf46ed47c0d7f86f883d94a5a49f650.tgz","fileCount":16,"integrity":"sha512-IDUgi/vjdnD8HKMN6oai2OwAH/6CT1r0mcLhOOlFjnllHdcvAPJR4eXGcWBAxUp+7LlPqN+T17t3J8WPMcnKfA==","signatures":[{"sig":"MEQCIEaq+0qnc618LfBC3P+VGySyHAA51MUhFxTxS/hmdRhcAiBFPqEc/x0j6qaB+Vz9Ia7v99d2K6HW38q1s1Db8y5zag==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":156931,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjG9jkACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrYJhAAh4pF2SEPsqLRQWLWe3PPL0WK3Lo52hTcKpdddBodkyHrI+nF\r\nhnMzYMyeZRfqjG5VwihfRWEfoxeTlfhT5aGEgomi2HbDteLX+V/lEmmChQyB\r\n6BFT4PjQmGk5WRwXpn2dE5PYjqc7sB0wCX5Ds0ZhjPalVRmdArywPTkKMui0\r\n99TVGw6rUWGFeinGXtOYWa8mgL41A33wP3iIv+MVIJpxG84UORkenXGCJC3I\r\nyn8ZNWa1XqakvlxmznVuMQdvcVKF4+SYC0UeZ1TcjYHJ6iR9bSsT5DcofRio\r\nqCX08NZWHH5mBM9llZnama2X/zypGfb5rAwEFTuZkWn941iN04z6PCTW8TPn\r\nK+VG7loFE30lpEdl3MpNJ1W7iyv6CmmkaYDpLGaQD7OJPkoKwL0Y9gAVrwPz\r\nGbwtrEJW/eDEVSl9TPxEdah/DNp/Co67Nagh+cuxAeKS31wsvl6EVXEOIsGq\r\n4ll0wg56ny9T+6e0TU0GFX7GT+BwtN6NhjHhdnecBVDtEYcONipUQJI4BacY\r\nIKzkLZXW/ONDpNDjm/0fSYiJdKvTlveLTMsmmlOjotJVqJbBtsShMZU0Q7Gu\r\nLA0R+kWklIss57zTgE370ysggqqlygSp8JAhulAdMMElgRto1J3fyLNFmk4O\r\nVZp5ST4VGkbe9l7h28tfSJloqIqwVdh4AXs=\r\n=LJAD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7324ca821bf46ed47c0d7f86f883d94a5a49f650","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-10T00:20:09.061Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.43","@balena/jellyfish-environment":"^13.0.9","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.2","@types/jest":"^29.0.0","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.144-renovate-node-16-x-7324ca821bf46ed47c0d7f86f883d94a5a49f650_1662769380691_0.3896329363821951","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.144":{"name":"@balena/jellyfish-metrics","version":"2.0.144","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.144","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3a46c9637fac343e5b2c78345a16850838df4618","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.144.tgz","fileCount":16,"integrity":"sha512-n744iu+rJwqTa/BGIh1Xnwv/rgF9WSStyo9FIlol+qjL+rplBUBW8GrhAHfZp7iwwkXl44pHDLjDgeuE3S9zjg==","signatures":[{"sig":"MEYCIQDfUjZXfvL8E0YDfbedUfXE7JNvC0oDUatvRcB2PfrFmAIhAJA/iC7oQncXdn7vbAaIxKiKWDbgwOfbnsfsUZQ3NIC0","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":156871,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjG9nyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrn3Q//ZjPSUC6LeF17DgjTgRnWGAQ2c1SafqlXqo+MK9UFXtG3W9ic\r\nfRqmWfNXCTnUd7cOlRmehlvACKIPk8NvnrCdLasiqpHJ7j+KLy0IVuHd0MMQ\r\nvGjIH0AGAsPVCdhb3Gc9Ya8G/9z/3CzP7WmAZx1OyghTFajjYd0HuJslOZK0\r\nyIysZidijJWTHzbYwovC8+8xBd/l+A8Bu/4DCE16TSK8A8GStOnus4zwYQp5\r\nSCYB9WBAI+TPoXZhHOfIlmD4UfeY6H/T3WxNjbx25UoxcM0CMP1AIcpgHc5E\r\nR18eAtCfb6XetD94UYfypyd5vzIQld1HUIuE7n9EoWPJicOqj0xtBP5yGv5Q\r\n7bwYM0wGd8Hm72tgZics2hRUYxzCSNJQ+twTq7SSA/xJwA3VfHugsxq9Qv7Z\r\nD43mY1Cmb+LixOgEbszX40YNuw7d6cSpNKONdEYr5bFv5/B4XVooDwXLNGlF\r\n57fm4bZezWdk5ZgoZRmk3eZn1ZWLdkiskpVDdyoRvpuAlSqH/zLM+BrOJ+dM\r\n4i8JUa2PWgzM70L0oHvRaJYSg4a970Ri50lViOSS9RL1zGbddLc996+08uiG\r\nvCZJx8mJEZqSMSY/ChcoSFVaVqw1Yv8UMPs8Ogh9okiuol28j8yzcXxmwO6u\r\nCmeiHUFQh/oPavMOs0cwJHfk/lFkOt/qqbg=\r\n=E2jZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d4400342581db585609044325181f5ff8dd77dcf","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-10T00:25:03.315Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.43","@balena/jellyfish-environment":"^13.0.9","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.2","@types/jest":"^29.0.0","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.144_1662769650210_0.3846526719414267","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.144-renovate-balena-jellyfish-environment-13-x-948b74511cf4088251eb32ea43580ea0be7d2314":{"name":"@balena/jellyfish-metrics","version":"2.0.144-renovate-balena-jellyfish-environment-13-x-948b74511cf4088251eb32ea43580ea0be7d2314","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.144-renovate-balena-jellyfish-environment-13-x-948b74511cf4088251eb32ea43580ea0be7d2314","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"de8eb57b1a0f94dee98c1916a57b395c2e465c2a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.144-renovate-balena-jellyfish-environment-13-x-948b74511cf4088251eb32ea43580ea0be7d2314.tgz","fileCount":16,"integrity":"sha512-bXxLRRZx687vRkZaClhK7FCvdWg59EwXuMqrYyHs7i49oNaUTQ86XkY1M2oaeqpfX3oBpDQEQu5kZ+MivlwCng==","signatures":[{"sig":"MEUCIHa2p8b0YUCRMwQ21dTijnHB7eslsikvUUzXTppnfII5AiEA6TM658sWronnDaArqXIjhx8ZY22GLskWr3r7mdcZ9+A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":157034,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjG9pGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqfGhAAo9nSkppbdAdC3BMEYzGR9jaBmCuYN80JGdpWNDFUUyh3Sgix\r\nZ1LuoXJTyy4S08LkReG6cJQsdnf3zV6B7LcT4eeYDvdmyNfAiKfjqFTxGTlM\r\nlPbiXQcHUVuvC2C1jyL4Yy0C0IiNa8z+5+nVHb+uuyPLKXC5aQzxBN8jUev/\r\n6Tbh1Le/4rbDesIkFyaXJsHZ9Tb5gSzNKI2D+WOkhKLCZVXkGqXM5XM9z3Yw\r\nkOPoy9Y5PFgBXqIpkvnpsPOgp6+jLrR9zinze/X1RTSQaJSWOjvUZagz6nkw\r\nU7R8WGTsCwwKgx37QcUMpaibvb1y/Zjpt4KiF+yqm2WPSNiswK40fWh75/G0\r\niF3+4bf7KtOGB9a8j5YkjmsH5c3R3sL7BqTElPYjZ69wleP6RfxQ9Pziep89\r\n4c3tArzY+aAllNbJ/U73FkBSEPhuPeESE9jZMBksONPg+A9wN610y9Yp/Dtl\r\nbJfugYVgA/nTjsqI2df+75lz2IuMPw1QQ6bf1LYV8s1XFACKe3O4hD+RtsgV\r\nus+X0NSrioyhaNesz8WAAb9fEJ7ALGBGPBKY/Ar1AzwCGBhgIfM/+0zD/bAh\r\nXwKi2okl73y2VypCj7XdLkvZK/mdh2+P/fbbBjuFlvpnMuHWb+fNGwfOZsf/\r\n0qLGm4MKn1XOCL8N2OvzedwVn5ObpEsFSbM=\r\n=V96Q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"948b74511cf4088251eb32ea43580ea0be7d2314","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-10T00:25:58.636Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.43","@balena/jellyfish-environment":"^13.0.10","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.2","@types/jest":"^29.0.0","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.144-renovate-balena-jellyfish-environment-13-x-948b74511cf4088251eb32ea43580ea0be7d2314_1662769733807_0.5005591432290659","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.145-renovate-balena-jellyfish-environment-13-x-c55ceb6d4a567935ed71bff367548c9c491ac48f":{"name":"@balena/jellyfish-metrics","version":"2.0.145-renovate-balena-jellyfish-environment-13-x-c55ceb6d4a567935ed71bff367548c9c491ac48f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.145-renovate-balena-jellyfish-environment-13-x-c55ceb6d4a567935ed71bff367548c9c491ac48f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"84be0141172c36fa5b89b38fce71696b17fb1cd5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.145-renovate-balena-jellyfish-environment-13-x-c55ceb6d4a567935ed71bff367548c9c491ac48f.tgz","fileCount":16,"integrity":"sha512-7w+QqPBCgA/RxaLEWBPP/6mKRAkTRArCdsxKSRHzXaeAWaYE3cqLbbe9J23xBPsH2vfH4dRq3Kk7Rg6TnLhGeA==","signatures":[{"sig":"MEQCIErVlkGYraFGjS7voMoZhgXhYsGrot4oztAxftU+nWJDAiB6Iu31exyL2rDGCiGx8N1H0wbZSYw9XlSOJ3atiIlBjQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":157060,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjG9rPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqKoQ/+MPArErHKoElGK1DZwvs7MEPAZM3vy4Pnhq5hPLjF89RpnTeH\r\ndbtBepEgocKkeWalq9oOBixwiBx7al581sjOi7q8+TUAJhxlvJRUmtwQd+XM\r\nlXCBeslSgyRI+QFnYHjvgYUvdJwS+4xk2dT79L3je/jOx0bsP7ERZWwJKGtb\r\n0Uf66SvjaiaBbuJ4M8086fpedxiavHajgC51PlLdonspoUKyFSfxOxKdKZoI\r\nY5otrNSVvAtnSg/EvMtBhGWbbf1kK2GB8Jo4ClqE55JkX8BMyycTGBKTGXLz\r\nt/nq5RGe7KYwxKXqAXap+yhA2HxlPXq1vP5C2n6+vf3cow4MCVsJ9xAelTQB\r\n18jGWlHzeolsW/i8UcV2YR7CBZF4eF7RXIJuw/x5WNgG4u2Gh122LLbenTtx\r\n0ceU4frVDgIIUR5qwSx/htP19ldndpz8IbY0LBrmkdefM/EBDz7rzjnzJVs/\r\nNks0wdAALSq7axZyNOsrMmNi72cWJUmlghPCHFWqP9JqNorXFiSluG5L7b0c\r\nPZ+v3nK0a9VKQLG477AlzMlBCKjUKIpW4v0oRgJNwtSrOY8OxN4epqWhWN8C\r\nyMN6FbNnXZGcoZ57iyiwspiGYyxjirwq9ml1sZoM1bHVrNXrANgNZoZOl1Ut\r\nfHra+fJGvyvcd33oWOWp0FRqGm+fsJ87NuE=\r\n=8BCI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c55ceb6d4a567935ed71bff367548c9c491ac48f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-10T00:28:11.895Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.43","@balena/jellyfish-environment":"^13.0.10","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.2","@types/jest":"^29.0.0","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.145-renovate-balena-jellyfish-environment-13-x-c55ceb6d4a567935ed71bff367548c9c491ac48f_1662769870659_0.550323475855548","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.145":{"name":"@balena/jellyfish-metrics","version":"2.0.145","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.145","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6104c71a2006d262e1cbb628fa18f92212231279","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.145.tgz","fileCount":16,"integrity":"sha512-6aK+Z7l4q5R6m9tJk7RSQwAywUSkKXjK9pxoqGH8SwKDNm+5I1LrN34xqNzcHUsJxBJ+pvddFpiQ1JH2EKutqA==","signatures":[{"sig":"MEQCICBJ6HPRrQtsArdtc56K/JEIAz8+Dd7E5tZoaUMxhiFKAiBVODGpI3OHQ6aiPHcf4CFbQMF0tg2dgZao4aB7ZK+unA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":156976,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjG9uZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmofgxAAnbeElMKF42f6HF/+eLgC4ROc5QOURzvvUCaFWxu3S6c5YPV1\r\n8vMddDWR0GgCxMdWZBmspL6RX+pl09SOxoA4BGM0v3+MCl969TUyH1FDDzyO\r\nl0ZJJ4TXNtR5yyMlMaUk3EgNWr3qZXX32uo1XzeCapYPI3dJ0WQ6SFS7XvAZ\r\n4Uvr56pOtDOB/+TlS/a+apT07Kj+e0VHpN21iBESU5nVFR/wRWVFpOU1Tx2S\r\nZFwwiZLvUsrQBY7XXN/mayHY6bEQeBuJ5PH4gpm2UgeKcTR2rGIKE+FO8Q4t\r\n0LvY5S0+S6caG3fzF3YU2tiGkiDu9QXRefOQrX6i7+s4+xY3hFDX479m0UKl\r\nwjTTZvVl8XnBdObA3gMZ1DlVPXCgf+KY7/BGV/iNJvdbOd1JvpG7FWIyppcM\r\netwfNskO6og8gWSl8S3P9BC7ub5IXk00enmBRu5ZuHeGvG3H8KPk5D/CbhGe\r\nK01lIXd40mpcL0i8aLcK3xRfP6y5nkcq8C1ligl1jwOG+G6xLwr2hwlhW6DF\r\ndwNVUcc9a3X+9TVXgMLBAEJZ0I8JOVvK8pkyXRrxo5gHyCn96dgTD0f7QDmR\r\nHbMdszC+acZ+Fyhiqfy4uxcz0a+e925zHd1SB8xtisCCCzlyUR9PA5oN4B16\r\nngLF13WFKkkHvsHYS4Eerm4PlDyAHEQsDRY=\r\n=GKsK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9ea7b44b27261bdc0b8e318d91b0e5d600003290","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-10T00:32:13.289Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.43","@balena/jellyfish-environment":"^13.0.10","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.2","@types/jest":"^29.0.0","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.145_1662770073635_0.6602024453970279","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.146-joshbwlng-update-typescript-d38680a9029e7243179f05f337f9cc4543fc0b1a":{"name":"@balena/jellyfish-metrics","version":"2.0.146-joshbwlng-update-typescript-d38680a9029e7243179f05f337f9cc4543fc0b1a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.146-joshbwlng-update-typescript-d38680a9029e7243179f05f337f9cc4543fc0b1a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"424e82f2a804edc186df79c07db776a8b67cdc52","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.146-joshbwlng-update-typescript-d38680a9029e7243179f05f337f9cc4543fc0b1a.tgz","fileCount":16,"integrity":"sha512-FdEoCrcs7JKOcjyEu6BJIq2ry/ikE5XIXrslmpZk71othD7llcsk00SgqH/cujWCPbC7nA2zjY2Ub9T51zDrAQ==","signatures":[{"sig":"MEUCIFSZyQ3R36gmbuDdy7PO6B3pCQtlYS3JMKKxcE0hUomGAiEAuTZSYIKzGDgkdlS+Rua+5b3SsgicfDYPfwVf7JBQTZk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":157115,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjG/YgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq0kg/9EEaTpeqBoW7nyFHHhs+AfeQUSDNXWr6u33XFurhx/yoEv94I\r\n+qwbs5PnVi/CGhbhK7jkwRgmDvaJnsYBdfRvc1Pe7YRiNAKiAbPgBIkGjaEJ\r\nSZgJ8gAspts42GSSYIYXxUhw2rpRuxOFMDC2eZLdR2RoE3tL9fryy/SxYiTx\r\nq8Oy6PNcDRqny1dJ1rZ9oA21kdvA2G2RfMZSMGZGBvGvi+JTrsvdnwXzgJws\r\n+uNcqAzXA52tRiApYnjtkCjlN5N31NKU5UharuNG+SQp7jHgQcKJo3L3C0xk\r\nFbK01PQdMwExO8zrVITTkzFRdhRuKIxxrsdACHrpwijDeP9gvbLRNazu2TqX\r\nmFA0bN2vPPNDjxc9XzWA9VAxIjI+49E07siggnNQCvOaKWCLCvRmKa04OyGP\r\n2w+82p2Dw1I0nqsYRA0LKlZUNHhSGd1zPDFdDKx54isYo+sLeHG9DRdyjrLJ\r\nJdbdFiCDl/8lsgAWR22A5BvvN5n0ipsT9/u/mDbrSd3sz+T6MDJpgU2d/5ga\r\n8g5JE6DeZyXdTa4GqAFUO5xlW82WzmLuI+6MUAzZ14yp5fIISeOfPvU2KrHD\r\nL9F5l01MMu/RPYBlmL2ghrncUTNKC7yZt4j9ZBs3ZU441IvkSKebf4N1YB0a\r\nmdg8GmAOwBueSvY2xFy+SRNlZIXtRtJHFM0=\r\n=UV0a\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d38680a9029e7243179f05f337f9cc4543fc0b1a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-10T02:24:48.260Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.43","@balena/jellyfish-environment":"^13.0.10","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.0","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.146-joshbwlng-update-typescript-d38680a9029e7243179f05f337f9cc4543fc0b1a_1662776864496_0.5136648940948212","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.146":{"name":"@balena/jellyfish-metrics","version":"2.0.146","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.146","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"aa3856955103794f0ed1a212ab9f1a7b147fecf8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.146.tgz","fileCount":16,"integrity":"sha512-b9nB4CpM5Isw7NJSuKmoE3hlOcNPz1skx2XdA9PGu/uWE3wFdZA0ouBo7nivQAwOqv60T2y0fHoZ/TT5ipFE/A==","signatures":[{"sig":"MEUCIQDODsq4GSVo6V/jwC7xSnDhnQjzmRMSc1GEPELOmZBvmwIgSOMW5R/vkkneGWe5q2cE8DWI2DA5fww8BOfHbUYy3HE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":157046,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjG/dsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoB/g/+N6HqXvG+SdcoY+yUmctKiExsNqS0ZFEzOAN9KxlH2LSIPFno\r\noJjDSmAQXCUfyWpo+L1Imn2cnp5XHki7Ir7TWEXnSEtiujibH81p3kZRNAPx\r\nEFgH8A7PR/T7Zn43aaikub3bDEAfBs+mxzguQM7TQp5p66hj2rm9OuQ3qotE\r\nizwhKg419Oi8lgNa/JB2AUiZyPat5fo6QFp1scplsHP3qWpVTXeqeAz/5aSi\r\nQDAyzCLnlF0r82iM98W3nO0Z3bkbD2Fvr1uTvNn/DyARk67tlJ+7HR6Nucbr\r\n25dVDlsLGhOLWhH+fFOBfujdCV3yhSKH1cU0UxTadtOEYvC3PbnO5jEHyqDc\r\nGK3akO83CVRht1ussn0E975kOIsiHUzXKKqFXs+01Ar3mxs4Sr6DXznkFsmQ\r\niqTePqXYPKa290m8mABuZjP1PhJTXWzLVkb4yMpUiDWCcdT4XYIx2E80fYuY\r\njgmDWf3rVW/7DXQotCOQjdyfCq1A9n1iK6TeZndFPs28JvhK7LUJ8Rg3Ec9L\r\njHmBdvXreOVzbU117nspEJ/OEked4zvepSC9FScIpLpfbmuOOFEJoYuJsc0q\r\n250NAhX7zHlQD54ilQJodPBF/Akbnk/GrpRnkHPedqJEWwSvJmuUYty/G0P0\r\nM58CqNNk62DPNKUCWXoycUM2xpV2LY0PbK0=\r\n=EEZ3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c4f36c55ca8dbfbd7367a63098dfab2a95faef96","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-10T02:29:21.445Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.43","@balena/jellyfish-environment":"^13.0.10","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.0","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.146_1662777195337_0.164590571619339","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.146-renovate-balena-jellyfish-logger-5-x-ab50590ff261f6679f267773beddd24d65106e5a":{"name":"@balena/jellyfish-metrics","version":"2.0.146-renovate-balena-jellyfish-logger-5-x-ab50590ff261f6679f267773beddd24d65106e5a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.146-renovate-balena-jellyfish-logger-5-x-ab50590ff261f6679f267773beddd24d65106e5a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a751e4c2d068ed6d3038eb4639e2d553e148d503","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.146-renovate-balena-jellyfish-logger-5-x-ab50590ff261f6679f267773beddd24d65106e5a.tgz","fileCount":16,"integrity":"sha512-VAcQJcTD7W3IN4N7lLyVK1WP3fjlRmlwRoCctckx0SjpQfzehVYfnhCdUvhCIAdK7ishNJyXI9+HBVD/wS85BA==","signatures":[{"sig":"MEYCIQCV2BbtT32UO6RfPpwzFj0BaxK4TnI4wGJudSJlDLBNtgIhANfaTSIQ9CY7PSBtWxl/QXu4xGn79H6WvmhWPs6IfvRo","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":157196,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjG/ghACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqWFw/8C9pFdpg2Gm6KVR069nmvB5bkxF/pJOTBPNhjlqr238s9WE+4\r\nZ8NVDI9mwUkp78KgdYM8ZEP2BlRAM3WlqKdgzAAZH70HRowoQHRnJK7D8nj4\r\n8lXUJQwdqimKP85q++yp+9RC9n8CRqqhMabZAT+hjePrhg9jk4lm2aGOv1WE\r\nhrbgcSeH7cM0WQX5D7hCS2tlKnViSFNCm5Bhg3CHX5r51r0OvjRsXc5u56KU\r\nN0yCb7ZCwqvtEUVl5tq4OD0HJtSicbF2lEVPpV432CY07tUVPz2BOFSuAQXz\r\nwWb1QgpHd5G6oMpNh8gsOwy8eEoCAgllfOGJSfnvSu6eY2RaSjlbM3l++ZC9\r\nUieeM9LdgOM5XdWK+XyGZLIo+PZlxAoIGL81re9b1RiSAFFY8F9oJeR2W8E3\r\nuqEVnuBS/xSzTGzcv84jyJcDHPjxtFdMelqiwytb5+PSuovC77XyFpFmTw3F\r\nBbtRo5rEw0LtLe8Y+cCvn4wmqD/aP6EFHWM2a8AL99XgN9Qlgf9uCfFg8w/X\r\ncSbYXY1Gdn0i0BatHCfyImMHtMQ4S5kl3GAtflCvtJDkNBB+H6raGtW4b0WH\r\nOV4sKHkxfAyGeTomvpf+qUeFvT2EdwsKfkDdVYYQVvRtbUol214YlfAfcQ5g\r\nuyog3YoG7ww65cGwyAoTMlmn4JCQaNwUwfo=\r\n=5brY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"ab50590ff261f6679f267773beddd24d65106e5a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-10T02:31:25.917Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.46","@balena/jellyfish-environment":"^13.0.10","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.0","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.146-renovate-balena-jellyfish-logger-5-x-ab50590ff261f6679f267773beddd24d65106e5a_1662777377187_0.3803801643780589","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.147-renovate-balena-jellyfish-logger-5-x-8b12fbff6120b1b8b7d93d0f83f146a257ae6393":{"name":"@balena/jellyfish-metrics","version":"2.0.147-renovate-balena-jellyfish-logger-5-x-8b12fbff6120b1b8b7d93d0f83f146a257ae6393","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.147-renovate-balena-jellyfish-logger-5-x-8b12fbff6120b1b8b7d93d0f83f146a257ae6393","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8cb9bf6697a8a3b99606f5714eb27e09a4864bf2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.147-renovate-balena-jellyfish-logger-5-x-8b12fbff6120b1b8b7d93d0f83f146a257ae6393.tgz","fileCount":16,"integrity":"sha512-pX4s4ioNg1AZYfqG3oHuj6YLNZ30kyYngFr08xYE9D1zSzmDFbmYbu07hQ74r0xQkfjDiQRLwlYVTK9xNZrOXA==","signatures":[{"sig":"MEUCIQCdLz+p8BRc8ROTu1nhuhAbDTzNNxAa2AA5bkgI84aPUAIgY91/ix+hRHyoCvytXbhW3xIk/x8SMO2N0fgKvtPCXK8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":157222,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjG/jxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo/TxAAoee8mPWJI3hWANbm3PZYQCK+5NhoMH39cMY10NdsDayBY8xn\r\ngMygQ+ijo+6nDpoG9bnNwD1mGEmALsRX0VVNTYzq25mjZzhLbjr7ZkheAtZ7\r\n3EwNGor+/5KOs8/Ks2FrTh3Cma8JXhfUGrrQKiGzf/3yiA55BUk9fw90k7G0\r\nX84+cEHiw+kKwPp21+ozrIDYB1HtOx5m2Hk1333fEz5NdViZqprANcp//WsW\r\n5kFu1WouIrZnlNsi1DbgUGlkPBpg3vv+j2Zhtjw04VwQwIcfwa+18Ad4gRB7\r\nGpv5dxu2Y/ivHuZ4sUPr7RZiFCNnIwMl9TC47VJxgxjfENYJPKCNbAJ9h8Jv\r\nKKFvU26ScHNXlZ3AEAcud0YzWuxv8GlIsFE/BbW3QD++ISZre6ruZj50tCwJ\r\nMCYpiEE4fh0ywukejuqt/oi2UZEaR+ICyfUFAybQAKIgjKjKd66RN3z6Nx0R\r\ngB9FinQM1EmbddXfmm32BFj/YbMrWTL+EWsyoy7cAzUB7CkWJfS1RxQz66fx\r\nu0rxS/eyc2WUA30q5CcEc+u7iQ2oM62XS3O1tzeJHHpQ1H92BcfFS35+i0yL\r\nxBFMAlbXNbYVgV1NohTAmNctDiJmeyoJIJ4RPeM5Mdo591ruS5t6AEt5zlCV\r\nGUS6zUDKF5nlm4TwkHfGhiMNRYyA+8VYvdU=\r\n=5ITV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"8b12fbff6120b1b8b7d93d0f83f146a257ae6393","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-10T02:34:58.926Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.47","@balena/jellyfish-environment":"^13.0.10","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.0","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.147-renovate-balena-jellyfish-logger-5-x-8b12fbff6120b1b8b7d93d0f83f146a257ae6393_1662777584999_0.2492518973172606","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.147":{"name":"@balena/jellyfish-metrics","version":"2.0.147","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.147","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8422b2b2db20afb3b2a8c3af9fcc069568629630","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.147.tgz","fileCount":16,"integrity":"sha512-mMjhCWc9Hq2T7qpYxJyTN+Ds9/6mEwJMnB06nEJ/VrhhKMBOeBeM161RLgTb3+DYy8z+rWtUlPUDqyluCbrSZg==","signatures":[{"sig":"MEUCIQDZUztU9hg5EBsdM2T3R66XHU3DiRT2qW3oX6Ya+ymylgIgN6J36sDIkEUmK8qIl1kztfPU6xFlvKQARkxB65IAYEg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":157144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjG/nrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpQlw//W/lwfShQJTjFUoH7OS2R7hcSTmzgMao1d+cMtMPDhHYkZPxp\r\nVSAmQDlfdENBlHPiphaDvUOt/rI5qlxvNBjYxeUDQo0BV7uBO8NDuaDlhltE\r\nKpM2j2KTVdcTCTQZIA0hPiO4e5ucg0Gk42nlPjidm/Zvs0We64y3EJgIWCcQ\r\njf7tQrWMBbfVrL0VQx7rPVh/sp7cSpFDQn5nfjyxyJdyTi0zPt4dA/zFINOl\r\nnIFhZAs+zqxBvE7rOs+KYy1VsUadDdmQzaEOFdDZx6JYiT10sLX4wEj9Wei5\r\nSqqThlugatt9woFk1Hxp3Qg+ax2vnkQgItJu6VPtb3y1FQeWripC6qHuLgwR\r\n1l3hH2ng+1Of+akGKJh7L6nzOgOhC4pf+uywNIxeRYzFVGkfPw2yMBI0tqqz\r\nWIl+KBRT6/gFBcQF7+DxIS3Enkq6f3fWAoCp825FIuYaRI7Bv/K1nqemp6nC\r\nr+IMoiydpVn1JYoPjHO2ElcxCLW6oXt455noiyqzPbe0wn9gQaWvULLeFdn1\r\nDEV9UUyPYwLZ7Kd29UNZd9TVr9iP5P0H6KCAYHJJv0ahYlRI3fVv5CXnCBow\r\nXp3I3zak5QwWYFysHQSSUaxrwMu8VzNoJVSL3piGk6FtkbRpf8/ARaP3o2fg\r\noB5hxFDbdOsDXMF77/ExK7Q1uQZqPLQv8Y0=\r\n=jfck\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"545c77a39e3f0ddd63f90ebf6b126dc52f98d947","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-10T02:41:44.983Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.47","@balena/jellyfish-environment":"^13.0.10","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.0","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.147_1662777834793_0.5895767092844206","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.148-renovate-balena-jellyfish-logger-5-x-241d922794861d4c95ca34f37a0dc3870d682a40":{"name":"@balena/jellyfish-metrics","version":"2.0.148-renovate-balena-jellyfish-logger-5-x-241d922794861d4c95ca34f37a0dc3870d682a40","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.148-renovate-balena-jellyfish-logger-5-x-241d922794861d4c95ca34f37a0dc3870d682a40","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"46d475e562ddb2f10d6809c1f4bd79d8c3be1067","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.148-renovate-balena-jellyfish-logger-5-x-241d922794861d4c95ca34f37a0dc3870d682a40.tgz","fileCount":16,"integrity":"sha512-slaOb/hB8fnjM3ym0Fju2D4Vo0kh38cAOtl8erYFWhsLfL602C2hwm6znWQ1TrZPJQktMArRTd86CJawvWGOjQ==","signatures":[{"sig":"MEQCICu5USYrIBnYYPdar40WcVugcPMcqAYPEBtsk/MTZX9CAiBdaHGzE4Q5JisshKl3GC7VFjFbG/gvzdEDmvC2fwUHJg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":157320,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjG/r6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpBsRAAiljDc1SBoeg+cQdaJVe/3+JNH4BxaKTrhp6mXNRCmB6pqe/p\r\nwCvd+Mz1cV2WMU1uS3XLE9F/SIlmMYcH0/zR7fX1cu8XYGxr7nbVyaY3gIZP\r\nkXniOGKBTa6IQuH4p5A17AezsuXTuxb0JSldcyHCiaMN1XnPQQFn2Ro8TARP\r\nsP4+jJIJe/j7z00vJ/TQg2Boe0cCWoRmh8ZktGdBJxzDVm5GlerGWQDH9x3U\r\nJJkeOqkFhZ+Skzh5tdFBziTF3mK+DPmHC2qU5k4q7eb2mjbxjKkREdCJj2W2\r\nq7qo3yTcPXM2Nd5NO7V0U0oL2r7YpR+zZEPPXRcIQOPwqqY4iAo2m30f4uca\r\nfsbJ0G5BbaiXqd2k1gNmn2ExBGxWs9riAFDDhljsKOukgjNaNgi5eoQm06zV\r\n4Y07ZTTHqjmF7wJzc4lRDkclVLQF6OfjpntPP9ZOVyR2AmLBnZyGYVhAM6tH\r\n7DVSqbsGAup3TqtvRvRhaAw4lRFLbsORuHt9ZPFqmBG4xttOkOlOVG9f1rvO\r\n3ZVH/D52kvInvZSryXnBBpyDJ2HZS9jSuzUtevO+38+EczvC14Oz6FzuAkui\r\nwF9CKsPpgQC7l69jqgJxK5KgUmS2JERTt7PJBz/3y39+eD7EjmzzWFCUTGB7\r\nLCogg8WwekSoZC+igaOLph+MC6fUNcodHCA=\r\n=HPer\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"241d922794861d4c95ca34f37a0dc3870d682a40","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-10T02:45:46.766Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.48","@balena/jellyfish-environment":"^13.0.10","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.0","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.148-renovate-balena-jellyfish-logger-5-x-241d922794861d4c95ca34f37a0dc3870d682a40_1662778106265_0.333661816637278","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.148":{"name":"@balena/jellyfish-metrics","version":"2.0.148","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.148","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"20a55ea2e7ff82f12aad273c10fe379548eec115","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.148.tgz","fileCount":16,"integrity":"sha512-jHPdqSa1290qRlM8kdYs1YYAdGjkLcSZm3Mlej1yCKTXZOT9ClDh4VH+WdXmh1ikM8IecNPM9YdxzfXTGwoDlA==","signatures":[{"sig":"MEYCIQCfqc0KvjbmWMvSSn5j//0d6qTiYyeyxIZxikUMKmEJ5AIhAPbgAyYv4fs1A6Y3KQ9QU0ZuNExBqqdjRb0ghQWTqZri","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":157242,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjG/v+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrXTA/9FWXcQFdXyCK6w/iMFmQ0BhWSFBG7K/i6L7igAVdZckDLZ8rT\r\nGmx6a+hvsVbY7teNpat9uv3yAmCSysBVGfxosr9d37LQ5pp12jfdOCG2cJfZ\r\n9AVvrcqsrWzou6LjDkOatumW3aPd8Ofsi5+ZbZNN+UIkGNlq8gNjtNO/D2qZ\r\nhzPoaj4zD7hv6jTJwqfH1UsKcYbMT4rnn1jTB+LTen+66u8dIMSGGfHPocz0\r\ndjrLJo/ErU+xOUaEwF3j7u7m+2DbPepvJQMMqrpPiBdjHtIe5vZoj231ZTea\r\nBi9isvFwRVRmVyUrz7AyN8zP82UjR5hGcfYmRWAOI0x8oY30EilGULiZAdaM\r\nxfz9u5OO8qNzqafW+vIuaXbnSM7O85KAVoMf5Zge13JJNlJoASL6Kp8UWfGT\r\nf4FK2PGNO9/9YhzLjiFczU36y30QbPSleFbJZ8nYerpJZrS/6MBYodY+/RQs\r\n+hZ3Z1hhUuzJxM6nB890p/is4VXvUjFF4c3L+kWznbYdRBlEgxpcM9Bso5y7\r\n8ZkUhDxUV/nTHUaJGYc+79FMldTeqolia65YBGgtTVmjgz2queUWTDiXrU/0\r\ngVqqUM/Ei1XKaaM0gEamR94YinhX60cA3MjbemYHGeiVLboGfgvalmd5qA8a\r\nZLJGb+iFeIn3wgoeoGhZ9ihcFnubt1hPTSw=\r\n=nwy5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"9f308b54330c593b197752fb90dfde38820e5bce","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-10T02:50:20.343Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.48","@balena/jellyfish-environment":"^13.0.10","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.0","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.148_1662778365811_0.9076677331714083","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.149-renovate-balena-jellyfish-logger-5-x-29565d96594417a58490b8e7dcacc03020b99488":{"name":"@balena/jellyfish-metrics","version":"2.0.149-renovate-balena-jellyfish-logger-5-x-29565d96594417a58490b8e7dcacc03020b99488","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.149-renovate-balena-jellyfish-logger-5-x-29565d96594417a58490b8e7dcacc03020b99488","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6534a3d3efb86aa93121af31f99294f430331955","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.149-renovate-balena-jellyfish-logger-5-x-29565d96594417a58490b8e7dcacc03020b99488.tgz","fileCount":16,"integrity":"sha512-lW0EFLCY9SYO7QLF8AMpuuy2al4oyIa2+n9OtqOETnDthHmDeMKhVW8eMu0ysjCi95Rkkmx72NBpFKYOdUEn3w==","signatures":[{"sig":"MEUCIGabVshukrkmTEv/B8hnZXU8Y90J9R6fTTBothOWGjxCAiEAzAfRE1e5R+j/PxjLZLr3PUzCg+Ujuyndj58aRotO7Xw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":157418,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjHCheACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpLkhAAjOkgQx0qYT87LgCf41nARopqukqP5ACbSYrb9rq5TAucHjZ8\r\nN1lBq9u+6JZ0nT7QTULmlgZZ2yf1Er3P2BLG9MXiA5TwCmMOimB3mI9+X9+6\r\nxF7h0i7gZLQxq5QUEPoFoWSpw64sgD1WTq62qBLxOquSSc9teGN2QgH0kOJ9\r\n9t1Nu+M8seTr6PK5KuJv+2MSod1X34hsZxlHhx+Me/+hVSbllM3fkkepRK3s\r\nS0VMC3JXzKmTbKtsnd6d7dIRuFaENQneExQUzqS2hQBOumLG9NmgyCqZf6JS\r\n3nIfxPpkPlbAiyxmOKHZqfYpTpkGT8DX1ENPPaY9HDYmFC/wLEYrIrPluZfq\r\nYS6h+3FlyghFpzPrCMgBAVojHTtovZkhrwMj3K2ih0pnHOtg/FYIk64XTlSA\r\ni+Er6DcrKkCoEcrYGGES7XYibJeDKnAWUYaDVRwwjpUMiKMoiBK50x28EG0A\r\nl9rAJg9MceW/KCIlG4ZTsrSdAb7MybfuMyc43EJJlWkR7mtffjQg8+q93iJQ\r\ndQQQOpedyPpRwJGx32Qf5EJtDR82LP4/aHhtE+wz7erKSg+XJZiS16eraQA3\r\nxY1yHonVpjWnV3inEN30GrZ/FvfnoC+ryv7uKYsp/3nsZ3hj8YRyGnLY4du9\r\nXsYnNk7Do5SbgBljsvkdRMqHnLV6VnmsNPk=\r\n=eHgF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"29565d96594417a58490b8e7dcacc03020b99488","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-10T05:59:03.256Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.49","@balena/jellyfish-environment":"^13.0.10","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.0","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.149-renovate-balena-jellyfish-logger-5-x-29565d96594417a58490b8e7dcacc03020b99488_1662789726250_0.34132354499624684","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.149":{"name":"@balena/jellyfish-metrics","version":"2.0.149","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.149","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"67d1db3228a6c4658b2b613c2cf195d53002e88e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.149.tgz","fileCount":16,"integrity":"sha512-NX19fqdpNk8so2orFfk1RbeOrtqf9u01vIFvxGbTERL45LIooJlwmL9meMzzcTOy4M8rL/0CXWydMVk/bykBPw==","signatures":[{"sig":"MEQCICEt0hBDb1rtw3Cp40rPfKmzPcsuJUHofbLnUyVJngXVAiB3cHPx5+kMqh3i5jf5qfUjjR0pRjGYApWgrZZrWJF54g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":157340,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjHCkaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoXxg//bgyT5bJfO1oOx3Ks+MW6YE4PQUE8NiRK8kEr+eZKhTEg+I2H\r\ncT3pXcqSTT28YsiXywKGXrgGJjZlZ+WV4kJFrgPVqAFbJshcxeTlrefnAR5N\r\nMTJFFOZKrkjVu2/rQqhzro/Y1cAs8R9avXYxh1ExSeaYgsNVvqReo0qns/tK\r\nLUZ2SYbPifxqiIRdOiAeVHB/R0tdp/DSvAtlvkCvYEGW3zZuc+/E4cykop3z\r\nvqpaIxeldwqfbI6WfpA9yTj5dieJae/KebGX9JqhpD9lxvJsU7Sh9CHrnPAN\r\n01/9zRGZ3q1TkKg6xNA6XDx0fLhYAhYbhTi1GHQjjLfhdTPi3R/Ub8J+7vBd\r\nmsDVGzjeZnssKfpC78RxOeMvxkRHS94tQBBa/hBdeCIkIskHdjMCufIK99hF\r\n4ND6xjf5t0/Jb3/f8rZKBqAFdzgdl9wq1JdGTeivNLbOoZ11EOZSWUqp3Ppi\r\nk71yZBt7O8ziD9muDZEgzpKO2u7PVzt4eLpn9+Ah0eUGUGjEXd/kozH2IzHY\r\nCl2h5husvuY4kA9AC81tPFsDAMttiHsj6E6Gl2ULDsAGeeSYvdhvuu9K6y2f\r\nWwk8OLaybnZblTLl5O8ak9dOnSFATl7bHbYEIYb7/tnK7rIIsCoOh1bbuXaw\r\nXcuRANQv7tgotO7oZqx05ileCmc/9Js4j2Y=\r\n=v72/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e83b9619925d396f6b0d3c6ca8d6cee7d07c4364","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-10T06:02:57.276Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.49","@balena/jellyfish-environment":"^13.0.10","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.0","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.149_1662789914073_0.37029178864287116","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.150-renovate-balena-jellyfish-logger-5-x-1089fe0a6a3b96ac5d0429f531625ffac2d34049":{"name":"@balena/jellyfish-metrics","version":"2.0.150-renovate-balena-jellyfish-logger-5-x-1089fe0a6a3b96ac5d0429f531625ffac2d34049","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.150-renovate-balena-jellyfish-logger-5-x-1089fe0a6a3b96ac5d0429f531625ffac2d34049","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"98d2e71438b068ecf871f135313574aefe074e34","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.150-renovate-balena-jellyfish-logger-5-x-1089fe0a6a3b96ac5d0429f531625ffac2d34049.tgz","fileCount":16,"integrity":"sha512-euUt2bfzRug0nW+Ur6g26PBWC3GIwYVDTdBLIj3E0fr9QgWlTXCiXC+QKAlosyVoBlOeN0aMeEIbKrg/9HptFg==","signatures":[{"sig":"MEYCIQDNOoYEeu3bUxJiVmoZauyV+k3FIOqtdi9oY00qBN4IlgIhANW+frmsBnpi0em9C9O2nfVk6aLa89oxaWEqotqK2jVk","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":157516,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjHHC0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoesw//d84o+wFo8EzA86o66vmK6VPhdJ9uDIhovqmukQaaRHcgc4vU\r\nEkfinzW/AQ8PxXjeNj8aNzOCTpH5V8DxclaI8TFG9SpzeO5tlJSpce12s9lG\r\nJYNGPIfrF/6T1/Jkutb0OKPJBIeH6LVjE2q0J0AkcwDuW5lL+EYc98C+VcWb\r\nLFbyncMM481MH3vxXGWmhbXZZU2x4ba/QDrs2Hlyni4JEehkJJVURiTBs9Cj\r\n8VTkGvzKLDsUM9L0QMPKkHtV5Qsuw2Hlt3zzdq+7gVxrMOJKrfx10hF7nYzC\r\nf4A2xTaudj8BMw2grcNvCdG1b8i55G6WIr7dGR0Fv8LVdOCpt3gj9hKbQAQ+\r\nW+P5GUv1JCWFwVvfYTy8msu0ZPlIA9Gt38ZrC7gG6rpR2dycailSpI2149jS\r\nCTLxxw7ArREmILuYDWdg+S/OpldzefYajxi/GWZA2awJupvV08hs/oQBDyc/\r\nq9iQCGs16xqdbBSzHJt7XCbA57tyZUUPq6vNbS85M4wxFkufMDg1WogagEXp\r\n6bF0ZsHGhfwcRVtnzb9+nB1q3jnvZdFWVC6/9EyVPAiitXZHAVTFXJcHqNxv\r\nkBoPziMbijnfi/etl9zLlxShAndHpdyEWISCy76ACU5BDcs3BLLizra7ZfJS\r\n7JY2FUpGkhAPofFoWS02qqxuKx+lRSMAP9A=\r\n=XIR3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"1089fe0a6a3b96ac5d0429f531625ffac2d34049","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-10T11:07:50.074Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.51","@balena/jellyfish-environment":"^13.0.10","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.0","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.150-renovate-balena-jellyfish-logger-5-x-1089fe0a6a3b96ac5d0429f531625ffac2d34049_1662808244044_0.10759936588283403","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.150":{"name":"@balena/jellyfish-metrics","version":"2.0.150","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.150","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7547bc11397e7d9f93203d04c52a87f5f8769620","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.150.tgz","fileCount":16,"integrity":"sha512-M4b3oVuhgjbmL1cp+qSLVwColQFhVf3Nclolecy6w0sdmqeMLLKdO6LZezNuBTqz+SE2L3jb9kh9u4jgEaq1zw==","signatures":[{"sig":"MEUCIQDrZCQa7DVq7Sizg/I7IM/kdyaCorlgWL/u00+Eq63d7QIgcQK99hcirvc/qil9UZ1nbyj6wISlsRonRvw2WEho5Sc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":157438,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjHHFpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrxbxAAjDU6o/wF1SNG3Ty0sVPxpzo/9KOna4wLTcqXCf+bGYJosHYe\r\nvr6xwkv5blz5ClV5aIH0BWqeJlOZG33nhSGFFaCmAUsFFKepmhOxMSXpfFRj\r\nfF0LmGMvgvDBzKfGcJtq8XCzvimbbHiOfY/Hb+7hHg0wBfDvEKS8qEXXRqZn\r\n6WBjDriSxLEOV1Xri+sVRHSrs5kQJlP+8erSBAFn0zuMiRP9pMVmLw3ZsJzM\r\nzaZQGgKwxX7OuMk6jn0jSTPyInVDRuL2USep/+D3BxaeietrNw37qp8UDFbF\r\nmA+HG7dcYVbfzFq/WKe1Np2iJ8ho5hEw3rlYwGdLhqtaFTjdi7w3VIK0OV6b\r\nTijdB39T8ez0T+sFLEliMymmnMq3zycAMqClK3l69ZolDTunjrMMCzm3l9on\r\nca9am9rojOIYBKKDONrgZ51r0ttziHJT5OkhSZtx1bdqEzJ1+uyrdx6p+Gud\r\nTKzqgV1dprGjSww5/QMix7PCPSSfe54pUMxspx42U1vXgmq0uHAd14XMbDZ7\r\nQ1ST7cKkkW9kcCv9I5UjZfL4Jrq6lRXLy5y7NhnXzolZIuGwQvbtie5Oe2Um\r\n7Ne66RlNITf5aACNY5dyS870T6rtpwXds7pI/xImx7B0C5D/Q0WPyRzpoZhF\r\nbKJeLrKFmkGBr1t4RbIhnfEDJW7zxpN+fVE=\r\n=9UUW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"708418c6322146280a2bb60cc286f66db6774a73","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-10T11:11:43.497Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.51","@balena/jellyfish-environment":"^13.0.10","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.0","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.150_1662808425545_0.41838912060879396","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.151-renovate-balena-jellyfish-environment-13-x-644def3e7071863bbf0702d4a2639dd3950ba169":{"name":"@balena/jellyfish-metrics","version":"2.0.151-renovate-balena-jellyfish-environment-13-x-644def3e7071863bbf0702d4a2639dd3950ba169","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.151-renovate-balena-jellyfish-environment-13-x-644def3e7071863bbf0702d4a2639dd3950ba169","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cd503b56ad364e4864310a5fa90000cdae206c36","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.151-renovate-balena-jellyfish-environment-13-x-644def3e7071863bbf0702d4a2639dd3950ba169.tgz","fileCount":16,"integrity":"sha512-4JvQeUK6H+YTMpN3yendrIQYRFdjp4OXMAf3cSN86D1c56qjAwJO0d3+zjyeM88k+L9ExYC4dwx4ol3iuB7xIw==","signatures":[{"sig":"MEQCIA/dQ4TiOz3ZqFplTNd4VyvS9UeS6Q7y4CIm3buRRkXkAiBrH+kVaaEsz9e7QQRRSKbyHXr3ItsC+uwmoZ3rYRVtnA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":157627,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjHNFMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpfjA/7BhODHBO0BcBjCWy25w3u2rHj6a8630qE+W56admkE4AOuoX6\r\ntZWZNmStKCJkWKnKV3Q2GS5ZCWXTKxKKV1aMgygLgP19YLgvy/h27ODSI+Gm\r\n8K5+KktGMM7Ge/qBHwlHytHGug8M12o82+IdF3yu8H19NrCGYXZIk32kT0Mt\r\neQ/ishJzfFE75nzPTa3Q6hYARepNt7m06GJflVDcg7ZaIFpgf/YkcHxmORLr\r\nI3CA7aAUcBdmm6BOvid8qHDWnOjvhSgoCY2/YgpQmmFlTL55QDGAow+CPoBM\r\nSdKLOGF6EFJvtNyyyWv2hPjLT8xZeDX1dJ6HmKD6xJ9pC4MPCMisdNdzvrqD\r\nYD1aHZQBQUHNkumN2wds9i6xncVuADh732rMtaGfP4bLhhmbP/tKmZTzVvrJ\r\nAxTkA5aH7kFabbCQZslnlHNovGbS2gt31/6i2DXQQi30CU99PhfGIPU58KWC\r\nE/O5svHiwqtpwrM7x93RZCak4269p6zIPeXg5H/xO50GLMrg/zWVaAU1U/nd\r\nCsjCqqqyZwwowJM/6y39PUDxHIupSZPUsNbgPEL52f6KAZAMEYvHrgI1qRQa\r\nJtFuKne3qjWGWhs8+jJVwUZPI4suFzglWc7FrsghN0yDnRVNaVnaYUTU8SOS\r\n2j+rDOnc/l/XyFsEEGfXJ9wgmR8RjHyOFWs=\r\n=hz/q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"644def3e7071863bbf0702d4a2639dd3950ba169","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-10T17:59:46.824Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.51","@balena/jellyfish-environment":"^13.0.11","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.0","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.151-renovate-balena-jellyfish-environment-13-x-644def3e7071863bbf0702d4a2639dd3950ba169_1662832972582_0.30948990675432864","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.151":{"name":"@balena/jellyfish-metrics","version":"2.0.151","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.151","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"15c440e2108a7dd9094b0cbf592e86c61ae80cd4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.151.tgz","fileCount":16,"integrity":"sha512-OIato8BvsWfP8UpT9UuCNMJZGdUmb+k5r3s7LS5aK43aNWyU0dmKWEFuvgN1KhK+ltF6PpBxBddHK9ViPM1IVA==","signatures":[{"sig":"MEYCIQCq7BYkFZcjZa41jom/gOXWXr2L3w7c0ShPluSflpyA7wIhALVOIJtYCPh1fEzh3SUCNbyDUJaKeBqqLNVnV/SBISwM","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":157543,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjHNH6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqhgBAAm9/ZICIu5o5bSDT35pKpo1KBbp/GCOyIWFGyqfApuBgq5LCr\r\n95pAenmEBsDqKM9/GKNzGNeR1GeK8tDComscyOCrmdKDrb6+qfIapkPwXjap\r\n/rKl6vlSTJ+p0P2v1yRPfVPb1joBwiL4+jCBUnyyCNQP92UVN39sNjSrSXZM\r\nQSlkIKLQ/K3EcX2kujrxtJjp9FMqQhJkL1jft9SPvz7SwOYGi9kFBx9dWCDM\r\ncQ0ArKb5J6Udwr3qx1tgeWfB6sYLl3HP6QsZOPsyUWMU4el0CeUAYO5XfhmT\r\noJ60HuozAOs2I8SyGwENZ0MgAm9rPjYTSRPHF/vOHXRnHtL7x4Gy1SCZPskg\r\nwzFUD81RyxzqzMb0AHdzSvW/YdlQuDszf+g+kmqP4+Vu8g1dKuFf+WjJF2XA\r\n2k0rm0GRGshpafeYn9g6B2o7JizLh4pb784Qtd7ZXv1kVCU+rbuqnRZ1rbPa\r\numL+fXICqeWv8Pep+k8GgbBQxbBDJZfEEn0meHHiPF/Aekr0pE2/lsjlo6Bz\r\nhrfri8eYgYtIO2nwEfhK0TP3LuOxeAdWxUx+4NqU1pEq+vA9iL7Ibn3bnZZc\r\n1zyc8mEkeOQIO9CvCQrtSTiFxMgf6B9xgYdd0lC8jy+EVzAbongW1qDRFmHX\r\nIbfhes9uv9URdb1xZBhU0Q9Q94oJ9p2qqf4=\r\n=Q8Zs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"90ae10e68cd470b58e6f01ed6dd415e2c6b91050","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-10T18:03:52.896Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.51","@balena/jellyfish-environment":"^13.0.11","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.0","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.151_1662833146094_0.01829811015990135","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.152-renovate-jest-monorepo-3db844ee2a9e7ec10473069ad2710f968f72fd34":{"name":"@balena/jellyfish-metrics","version":"2.0.152-renovate-jest-monorepo-3db844ee2a9e7ec10473069ad2710f968f72fd34","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.152-renovate-jest-monorepo-3db844ee2a9e7ec10473069ad2710f968f72fd34","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9ded488cbf47924dfb932ca99de8e620a738fcac","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.152-renovate-jest-monorepo-3db844ee2a9e7ec10473069ad2710f968f72fd34.tgz","fileCount":16,"integrity":"sha512-RSLKoTEwFGAtNqvFajgrwUrUYJTf0M2yiR5Ub1HiUxbBPmiQtBAEMZQAs/VR9EQ7qwn84j+Tw2j4kubGIJXMXg==","signatures":[{"sig":"MEQCIHT6XEUCWeQCgjmn6WH118sTMnXTJNnDIyMwQJtKvYNDAiB00ZRoi/SX4Lcg21dOPr7OUOoCyc9lYB7OGMz5GwPg3A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":157685,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjHNLBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrH3xAAjLlVD/inFlEIZ6ROLGkZ8CskC72ATyvfvMoBhpv2b8BBedvL\r\n9PnEUIGnYhlFIkeO7cqHX8T3Y0BKf0rX79sLF7vlOY8IgUQat+l2Jth+jBKb\r\njQ7X4OacRpTCO8gHJRd04jtKyheTL7sTPJykjtzwFB73zmzAIqHz9EpwZ/eu\r\n4Mq2Syj7jiIMTHGXW8MdFTHSXF7vaWRcJz5PPnYZkYNEf6ADURWH2Drs2orn\r\nxNZMiwhujmIT98nqq4PjDdG2kq71ajgi4ohg3TgWw/Cy80PwBlmcYdTsZHoQ\r\nX4mteodkv19V2u7H1hsyKeTJHuN3bFf2KzXCAP+THMLRFihFEzmu+FYJmn3a\r\nHq/DCK/HInYmoIT2dhoni5qmY0lFZSEf7ft9BTMDmXuBZ02YMr/etSJx+CPV\r\nka38M5h8oTqjLZ3QmhiObN+GcfcwEyhWfCT+l7t2GKY+7SL3f6AupSPj2eSY\r\nzGi75lDFt1bhTzRc4y9G9wDndq8RAX+wVuJwJ9zJo5t39nDEqvD2ORzss7da\r\n83sUI/Eb+UPDcNzj+Bsdi0jbBm54m78J2wj8aPk88JvNaSBO7T/a+L4pOyC/\r\n1ALJ+mYr7iNIaqSO5bahYdLmTVwwW5xSuhg8P90a9kOxEFQR0Gv/kGskU8XN\r\nvlBM/u6fol6zB/GTk8M8m5gu5AKcJCA/F8s=\r\n=TEyr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3db844ee2a9e7ec10473069ad2710f968f72fd34","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-10T18:06:40.822Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.51","@balena/jellyfish-environment":"^13.0.11","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.0","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.152-renovate-jest-monorepo-3db844ee2a9e7ec10473069ad2710f968f72fd34_1662833345426_0.07105831549134889","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.152":{"name":"@balena/jellyfish-metrics","version":"2.0.152","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.152","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c4f58eaf8da1a4c8a451e6eafcb490b63ca1017c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.152.tgz","fileCount":16,"integrity":"sha512-HXZrfmXLBUlnIL5Nj5yaqDtwVx4H+0Vub+Sjo9z7TqMsbqv/zKLaUsecOck2wR2yucRbbvXhrXwSdjiHcUc2jw==","signatures":[{"sig":"MEQCIEoNBdQC2klmF6VEwDPBH+VJ6uq4AGQEaqHJE4SINYdyAiAuppiRtE2CaGkvNZkmP0rdDbZ0VnK+UFaE8rV49pW2og==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":157621,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjHNPTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrMmw/+MTToeVX5bCwLFuySbstL9qu+4KXw2XaAV8q8sUnzcWP6Pe/8\r\nL49tVQIo3vx4KqZAMmSPyf2prSvHswc5XuSG8OkDZV4iceecBh7zP/E7JTpG\r\nJfWBNC7W5LPMrHbM3hW2WdBM4Qak3c6tdcH2qkEs1ePFwnDV4lu+koI/HV8/\r\nwqr7HU56/LK2MEEF9jOZ4ni5sejqajcngnZd7QCfTEtUvsWiYJPbTNAiU+Nq\r\nIeK+hKMJXMkAmSO+uvBsvzGcLejZ0lakNDoeZUth/hOrsAbvUsuTnnaGUOiG\r\niqsmvr3k9+OKQdNLIp1QeDUSCUCHtGz0t05wukyd8HvqYe/A7xg/1gBSTrN4\r\n5voWbovIJcTNDetmAChxGvSAWAeiBDY5cCAO1GtRoYSROIcVygk3maTf04uh\r\nX2IJEfXPPZNuXrjmH1hBOi2OTkxbPLvyCsWG1ky8A2Y/JgdKxzIMuJdlAl89\r\ncypoJI5Ms/If5luPMfQZyGl/2LK25VCBmaiKC41jsxxRE3AiCil+CB93KNyA\r\njSxG7e5yA/DI4USo1WJCemDegcKAuvnBs+29ot/hh7klng9n0XSwIG10d6Fe\r\nGvjnmXWsab7yYkCi3BkovADJFqU94Zq4GDBY7mwRW0Sa64L3HiHIjZ2HfzpG\r\nWegCQAXMiIzNVYDrJ7Ae0OipywK4Q6LVfog=\r\n=uR73\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"2afa4a9594a289f87aa2ce52af1707f0fc3f258f","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-10T18:11:22.514Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.51","@balena/jellyfish-environment":"^13.0.11","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.0","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.152_1662833619764_0.10582047424316832","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.153-renovate-balena-jellyfish-logger-5-x-e894138f334546228cd2ace1291e4d17c5f2a842":{"name":"@balena/jellyfish-metrics","version":"2.0.153-renovate-balena-jellyfish-logger-5-x-e894138f334546228cd2ace1291e4d17c5f2a842","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.153-renovate-balena-jellyfish-logger-5-x-e894138f334546228cd2ace1291e4d17c5f2a842","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"dbd13dd0ba2552fbf07eee3a611e04c61327114d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.153-renovate-balena-jellyfish-logger-5-x-e894138f334546228cd2ace1291e4d17c5f2a842.tgz","fileCount":16,"integrity":"sha512-Ln0rVfIunAb6qR5bMYBgCFCm5+ig3dCkyyeU0o2GrtnQOBJjjm7xrArBAaFGz3XaUwVFzEPIctNqbwBnfdRqqQ==","signatures":[{"sig":"MEQCIBOGZBEyC7MPnhaXq+SSZLJqq3lcD7hC2b7J4cvDYpjYAiA+xgzGJUaMvS1tYqjpR0gka88qhu48Y24Lmvq8TBXNxA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":157797,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjHUJQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoBHQ//YdbQ5CqQH4pGkNhqEpkis39cAYdEM8t3r5N40YaD0cliX3x2\r\nyVPZpfuQjbU09NgJuOWa9h2LDxNYwakpiDgidnhMnChsNLCHk9iaNaxLVK5l\r\ni09Gz7bzZ7DF39L8JpvFr9Xs3TIOLWe12ZfK8GM/XG2kpZNqkZnhp7dyzwDU\r\niD9rqY+uUqrLplQ0IAPkaFsDW+O+3ggkWGoNxInNS5VJSnRdN1QHBWAyqvr7\r\n0KkGGpu9sqtTnh/P9PQZPcu4b7VYT5XzzqOK2qEO/5l7psHLI0aUJHiJ2DI/\r\nUlMpTiOUFzY0w4xHT2hHclJf4KYn0Cj73MeG7si5h+dEyRCVTIANw1Rjno8K\r\n4TEohyR/RIFdliWh2JtYmZPNyjWVWSFuNJ9cYnT5rJg1O2eisyG6WUyMWNaN\r\nzUTIDQX2mdJs4xBiXHPPo9wjfZa+AN9VR+8LXbJrvI81xkZkWfre6JHfVonP\r\nu23KpswCW7sigpOnAktOSgWjjfkGWU1FFN0O1SHWqo8av3Lj9eo8WZ6VkhBX\r\nbi24ielXDJqPHua3vtc7t0MhkizNspCrQ2ze18aEK3BIogLYNdjsujcoLEVd\r\nLDSKfCRDpuQxEb/zunkrcVM9c0SlTCx+C5B1arKMOGnGrPHIvIG18WMQYHBV\r\n10r97D5vb8y/JvQZBTDmVzKdZowHzvOH4LA=\r\n=ViFe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e894138f334546228cd2ace1291e4d17c5f2a842","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-11T02:02:01.515Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.53","@balena/jellyfish-environment":"^13.0.11","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.0","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.153-renovate-balena-jellyfish-logger-5-x-e894138f334546228cd2ace1291e4d17c5f2a842_1662861904428_0.08554101258467761","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.153":{"name":"@balena/jellyfish-metrics","version":"2.0.153","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.153","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ab39c154363ccc4ecf871c5eb95fd990ade58483","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.153.tgz","fileCount":16,"integrity":"sha512-73xKv8s8dcnJOMlPwD+FAXrkjsoQRmu/bMxbnpzdPRqHvq8LmOfnajd2rKwQj1uWUAtRM1GyVfIGDzxSHYYPbg==","signatures":[{"sig":"MEUCIQCKI5P8wOR2UbbcN+l6VVMjPrNzQ099sK+N/LCcJYnrGgIgeloivveTfQojJNoWvBmYP9rtOvOcVM5ZWSfoQ5EKNsM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":157719,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjHUMxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp1MQ//S0qnhctxg2yjZWySswrKvCLd/bXLz1btTeq2lR9Rm9DwyPX/\r\nYVV4GAgaYHE1zM17jPIIK7rI1EYU4I4zOD5/UBrfGrp413+67DsoEUdieSZS\r\n/cM0CyeX0LyJDHeNOXivRumoIKkXAvAq4Jtf3ElVnfqZf2SwuvOX0TnHkSVB\r\n3/E9aUGSj7HC5W6ISCrLOZ/yypz9XmjsQIVZaihNzlWbikYEP3IBazwZ04zk\r\ngHGWkzjcdn1JeGj+4GkyFPRTOtghxswd5QsSeohp4REF06XLPl1thKxck9H2\r\nQtYnq9q0LKKnxrSX1uYIFRocIzPTTjbqap29fX7d7h0BvsbXKPyQ1eDR4Jlb\r\n5J1zIN27nzZ0QlixJGIMPesYaK22YzvMvQjO/R8LOY6JA72WhtHwiUbJqjl9\r\nsqw8oMhyn4pizi2qYn3xbeUPmMyGIPJ+sAy29CictWOrd7U28PTztUb0raN5\r\njvXKgwzb3zDgnRYRNu2IufN1wtxtXhWiT3ewnemBO0VoMpkTPi6Qzy9L9exH\r\n6Z1LtxbCl6ubarH0/oLVxWanY2MNNbnzizuR8dt1SKuS6u7EA0sETvbyQ3aU\r\nS06Qj7q/GcAl+eHySvDRcovZnFfwO0elVX2tVzf9ESLgnOFJ8HvX1tEJCOMQ\r\n5gfgC6S31by9JBz2QRUoN4cUh6jV7SRT3VQ=\r\n=qwV0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"182e653de3952dde959d354fb40328c7e757faef","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-11T02:06:22.499Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.53","@balena/jellyfish-environment":"^13.0.11","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.0","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.153_1662862128761_0.3202357004780425","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.154-renovate-balena-jellyfish-logger-5-x-90be5d9d547afd6a2b43414200607f3a74ad340e":{"name":"@balena/jellyfish-metrics","version":"2.0.154-renovate-balena-jellyfish-logger-5-x-90be5d9d547afd6a2b43414200607f3a74ad340e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.154-renovate-balena-jellyfish-logger-5-x-90be5d9d547afd6a2b43414200607f3a74ad340e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2e621770b82ccd5a24b44e6d7c38b4b2b00f2882","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.154-renovate-balena-jellyfish-logger-5-x-90be5d9d547afd6a2b43414200607f3a74ad340e.tgz","fileCount":16,"integrity":"sha512-7vLos0LChQ8EdJaeuibAj+s9Wpi665yBlauYuZb9uJheeXMNRexD9hkD6i/+XgZ3e3Wk9NOAFZqm4UrPNwLE8Q==","signatures":[{"sig":"MEUCIHbx3FM9rpOmTZxpYRtx14IOfF4QBvN7uOtOb/IKWTg7AiEAiXOHBR/8hK9s7eiRm1s8V9CZoS6ghBTj0Hyr8UiUpo8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":157895,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjHV9JACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpTnQ/+O4wmzgJPbiQfhyOzBZLmF5JTiUFXu0tVk5EgasgnIjRiKuyM\r\n7K7nWVvZGNPTLFaVP1DiNz9ZFvC8zUoh7dgSSG9ieszpl6Wp/0UqloMPZArC\r\niKBGxPEI4B3/URkHFtG+kA5C4mf9X1s11KYaGPafrPizMf3sD3hHKTOyk4+s\r\n0fITH6viLDw7h+TfCXMIw4dzL7Gd8O5uj0ZS2hXF0XsN8w4BA1GDFPEPRVFn\r\nAM/Vs0U1MI8s7i2BHR8SYv7oJ62+tz+HNTyZGOzsOyiuoIF4EgCRqg+QDipo\r\nXK3DQUxmaEo92EcznFIBZ7OyACc6k4AWNRdHmUZpLJriFxNo8qKkqXQvw0wm\r\nhSNBzomsh8KFZyQ2gcah8lb47ldI8RRQT+b9fC5J/r63UhJCRU7MMSjufg3z\r\nAD0m2kFtaXrwYZ1Jk9ej0ZCdwHawR8Mgubkm8ZyXm3fJTfflPjjtVrElh0MY\r\nwtCeeQxSjcq6FZ1fgHdPGyfVbt6WaBs6PUu7fThvNYMBnRC5QaXGpX55+sXu\r\nhK49FVdKrVVz+725R/6CYlcI0oU4MrX65zq8V+N6eeGrJ9g2VUW+b4VKs0MT\r\niz+znFamkPjba6WIvluhThLsFck1IZ28r75Pv1OzahU7UL/Ap000nymYNc+U\r\nv/abQNLmSVVDOP8XqLvdBcWB9pjtm2gtSQM=\r\n=HW9T\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"90be5d9d547afd6a2b43414200607f3a74ad340e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-11T04:05:52.340Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.54","@balena/jellyfish-environment":"^13.0.11","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.0","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.154-renovate-balena-jellyfish-logger-5-x-90be5d9d547afd6a2b43414200607f3a74ad340e_1662869321709_0.3027340355388066","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.154":{"name":"@balena/jellyfish-metrics","version":"2.0.154","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.154","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8dc518324279e73246c52335844ddafb2e897da9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.154.tgz","fileCount":16,"integrity":"sha512-x+peo8YoBAUm2xIzk8UK+lAbcN70vtR8rwQWGE5A3JStMDQrf2LCQjhKRiFFMV+PEN7vic8C4tTBvQ7pxvmG9A==","signatures":[{"sig":"MEYCIQCI2RBDK4XkWZDcBDHJkvXYWzHmyu43BV4HJq0BkUMekQIhAMqSgQQKBfZwnJIzBQvCC7Ek3OHxh1S0oKHZX95id/fY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":157817,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjHWAjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrwrQ//eqn8+svt2D310kwmA7rIKUu8BlxZcPAWBPBiaWt4o1xm/X7z\r\nAGmv6kWF3725hQHguWKzidrl7cM/514ZRXgwGo8Xtrb+wxSzcV2JmiNBKhTI\r\nLUp7jQE4apqOekshqO4WOOAgooXvTLdSE/vE5hzSD79/HA4cyL6t8XnaaQ48\r\ngVFNJMG6klh0z1VvwbWdLF2GGvbVPv4YMPgBDpCigQO52njv3pJmRB2TPT7i\r\ncwaLA2MGSGfzLfvGCkRyRsRNjXQn0WGDyadrXCc4Pv8CDTw4ujoObS6lGfrH\r\neFbuLpRsQdMA9kWGDOLNOU1i2VI4AohwUEVMhVRNUMeRr9rV+Y17Q5O9x1L3\r\n5tNtwx/CTacIvKMjc8uokJqu3Qs7heR2SETURl2QY18lSzgwJrEq+y7aOjbn\r\nDUCOWD9uwrySBgbStbCHuFGzCKp/1SlQA9VjIOA8CsTPm2Eonsfl0F7XOWQZ\r\nSkDM33+sBfzcC7QMHwwrIeSRXw6d+h0A+G3NAfFKYYTSzLI9ko5ip++ggH/P\r\nn1EAT7Av5KBZXEqYyNgI6SGwpx/E6BpwGI4N7BFY+7iDyJ/5IOFb0EcZC6X4\r\n51wZEWJi5xJNcazqQCPQwZpLomMc+/vBFSasPdPBbRA6Kiw5IOmPdO7UAY1k\r\nnGrtD1YgP/5kGsEeucmdOga0ipguSWZDt3g=\r\n=bkum\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"7d5a63c867a587f1cf022acb7b4761a7bf5cac8a","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-11T04:10:00.187Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.54","@balena/jellyfish-environment":"^13.0.11","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.0","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.154_1662869539654_0.7961790134699067","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.155-renovate-jest-monorepo-57b329f82c27bdea9c73407956e5c342f2011ee1":{"name":"@balena/jellyfish-metrics","version":"2.0.155-renovate-jest-monorepo-57b329f82c27bdea9c73407956e5c342f2011ee1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.155-renovate-jest-monorepo-57b329f82c27bdea9c73407956e5c342f2011ee1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0491ecd094e214e63086d99b3f783a4476afb127","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.155-renovate-jest-monorepo-57b329f82c27bdea9c73407956e5c342f2011ee1.tgz","fileCount":16,"integrity":"sha512-C4n3EcEpxEwE3Z/bMFfiC8V2tv7Hsr6Lwi/TzZ2Dy74XLxBcQhD3bkYBVARbW8N9waKEjnMuFGxFknkwctSIsQ==","signatures":[{"sig":"MEUCIAOpxDi6FvZaSc3R2a6tYWIyT0zPA+u1t1cn4c9YztkvAiEAoumwuuZDWgm1m+hjB/sYlAwmKEPkF1KVX0PaqowVRGg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":157966,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjHmrcACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpFAg//WB+RKmzQbFwbDmbVLscs3EfKbRoxbEF5p9l0HIZrRiLi7x+S\r\nID/YUQ9IVRfq6j+wBlwhIZR+YAD5bBuCVTKX5e0miIThAMfhRJHjZT7OfR50\r\n/GaMbZ7E/XmjAO04mwlDtB63WqbAMXyRa+zCB9i4YulzJ1P6kb5vR1zZ9okX\r\n2b16GQuZJFJBmnpxpaYQr5KliNFjeDXKbRaSY20KBG6PiyM+pdKZsfjEoEeO\r\nGIsa8M/T4y4If9mkPF9lNgk2qM3csq7jhHcrDituv5wyspGtRNvOueCXWcqR\r\nuZW6Qmr9GngKr/XZILyz51uP/ezin2Ks8QWR66NOddifxfQHB35Ev2aHAry4\r\nvVWonlA7qXrlC+itj5xELTpFJf2WoTrQKsS9ZgAd32fZihVZY4meryUoKU+u\r\nOMSrlTjIt3Z6MTpKwAf/4S9IwR6wadAr1y5g52Oag3vp87E8V7S1yBrT3Lpr\r\ngZd1X97OQc1i0ha0H7mFs02ttTFfJTmpi9enVfZFQcaxZ1PKGAPg25QC5R7u\r\n31cfO7hIhWWmQJDRmq5JgazIPNqpcUr3v8ty0b9oKxiyQ0BgL2Eq/Pf7yimk\r\n/ju2z1dy5YdT2GUndDA7XLNjnvahCILl54VsyCnYywQnRSeeYO/IjIaFT57E\r\nvD0kC/VWuxBf2LB1X3FZC347YiBlS+iCz7E=\r\n=A5ZV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"57b329f82c27bdea9c73407956e5c342f2011ee1","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-11T23:05:49.724Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.54","@balena/jellyfish-environment":"^13.0.11","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.1","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.155-renovate-jest-monorepo-57b329f82c27bdea9c73407956e5c342f2011ee1_1662937819832_0.10700226485101894","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.155":{"name":"@balena/jellyfish-metrics","version":"2.0.155","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.155","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0d07c76bde6b876f0f89b165fc4bb9e708bf9fdd","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.155.tgz","fileCount":16,"integrity":"sha512-d3juDbpOGbabV/mLP8CdBdxffdDCRuKBiFJek0NmRj2rSt2GNBnWAl95be9af9obPCeOySrCqrxh7JjbCcHiYA==","signatures":[{"sig":"MEUCIEE53cYegbAubKlHoX60XnGMMAhFLei8fmSJ6ovS4kpDAiEA3t8q9TB7c/D9F73yQSyHpe2XQK22OgZMcc3Y9oWAjZ4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":157902,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjHmvQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpLNhAAhZWN4Ea2UC5cWwzFnvjnXQ0k0Tyt+QxDu0QEwpGyf6F3EV5n\r\nS9xLJm9zuOAhz+v2qmwIDT8K0utUDy7rLzifsPaeBsHSAElgRGoVaIqvpwXb\r\nzegC+ScRCWzoCZ2y2nWoSbaVtsDMddnCZiGusja0bY2NEKJY0azF9tYv+ZsG\r\nXH7eh6dq0ZOUE5SaWc/T9JhsGWPVPNdcV5BTlQoodMdBunk6mUC4WewaY4Pj\r\n3R76Hn3mTZS9+IohUCRLxFD132/drZL2lppsUOYc/oGGIeQfXtBhbX4DyH4h\r\nCFXPo41KvM8s+FmskBIb0Elpo7yA10e/3gYN0FZlGih+pM52+YaubPh6mE40\r\nFKHhY2kh4g0/xwbsfGbzYOH13kxhXmbR19owwRgb/R9/4CLEUfsc6wAb0a3N\r\ndMqTugk0/2L/+8Yb/ZSLcCHaiFlMCzHoziddwJnNIzFzN3UYGqaiMVb/M6as\r\nAqVgD4+oumhUkSJwc1hrBAJ/89A0/h2MNmr0qJrQxyVhucQjO+EWAKQpHs88\r\ncBJpwpijtrUBlR4Nqun5hy6PdDCOA9XsrTAJpMLB/MgijGb8k1nmI2yy5c6v\r\nPgWtIGLPJobOlNoGnWBAYadv71dQSH0XW3DvXkpV7GtlGruBQMHMBjraxTnB\r\nF1NHwlsTO9p/JA8V4T7NdtSiYYvPBbY79V4=\r\n=AOSX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"d19140ddbd152e734b6aea8d324ee14794f3ea18","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-11T23:11:57.718Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.54","@balena/jellyfish-environment":"^13.0.11","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.1","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.155_1662938064353_0.02852127166402929","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.156-renovate-balena-jellyfish-environment-13-x-3ff926f097975b33708e274e5e012bf162876cb2":{"name":"@balena/jellyfish-metrics","version":"2.0.156-renovate-balena-jellyfish-environment-13-x-3ff926f097975b33708e274e5e012bf162876cb2","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.156-renovate-balena-jellyfish-environment-13-x-3ff926f097975b33708e274e5e012bf162876cb2","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"51aae6eb66a89a0aa688879f89f835f32d4ca221","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.156-renovate-balena-jellyfish-environment-13-x-3ff926f097975b33708e274e5e012bf162876cb2.tgz","fileCount":16,"integrity":"sha512-LMJheXmoIWJNlwsA1GnWho21pB556aBwns8IL8tPfCa7H5jM3uJcbj1sCa1VRiO5Lq6ZDl1DemkpqdjAF1vYRg==","signatures":[{"sig":"MEUCIADkUokIFRUmGHDgYowXiEil8Iop2kyvDjrl+zMxkwp9AiEAw4eOwgfphSZlnk911JIdQ/9ck89Pt2ng85pnpUKkef0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":158091,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjHmzEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqw0xAAoU0scOT2nxfCN7nsS5vFVi8+sKsOIBNYncBFwkFBrJXTBozc\r\nT4aIdfQPmzl2W9o7Br/8ThwxlcnLB4BoyYYysgHEZQPYpHM2M13f0FTP//kG\r\nSw6Sf/9vNHk2m6vV6Pz7K2gubEsUFI39Hm7LmS9pJSocIX6wXoZmF5O5H4Ln\r\neY7MoHnLfuW1wvOWn98SgGIq7qsyF2Wt3utiGQVrG9hJvtHBgyLRiqXfMOEG\r\nfJgAcwmp7BYkJhGk3QyDpAIHvAJHlc4bayAy8+9CFIgTrdswdGPjttcp0lRl\r\nQYgzefmLftt4OVJivczxZILlAbJqcFWuTDS5xcyyx0K+NkgTP2tErfHmSpdk\r\nGo9GvpnUutf75PuAH+xNrMJBNa26iqeHNU/k0vhfm/+qmYwjZLqZFQBPCZOv\r\nqSLxYyOd4QM0dboxbolQ/vwGrff/6ffBZAWc2YHZ2YwNOxmOcPnhf1Epeikd\r\n4lHlcmSPQHg52XrTYRpkYbyXqU+RWTkvCnkrKKGfP20ES70V0NJujlqtjgPR\r\nAnTP3wUkxhGLLOhJB2LosT/dLPAqEM9S2q9vbb2kbIwBRqfkYzIEjQXnVr6t\r\ni6f8tfnwyC3WJKKOJbBOSrDaAQzschIADJNZXC7YKhlYWAxBRy2WKTUwVRyF\r\n6zppPd19Cfp8o5cMMOu8NPoyxZ4DLvVaf/4=\r\n=mcP2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"3ff926f097975b33708e274e5e012bf162876cb2","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-11T23:15:09.570Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.54","@balena/jellyfish-environment":"^13.0.13","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.1","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.156-renovate-balena-jellyfish-environment-13-x-3ff926f097975b33708e274e5e012bf162876cb2_1662938307950_0.3059326314130546","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.156":{"name":"@balena/jellyfish-metrics","version":"2.0.156","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.156","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"505342377f553242e511d2518d77d445570fb007","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.156.tgz","fileCount":16,"integrity":"sha512-Ax4EKTIrVHOoFIHFBRdQTJmJ1RL7zAsV8y5Vcnd88Cj+XFVO8T+G4pk6iVg2rMp3reMNqwRKHeIv40uSe+HAhA==","signatures":[{"sig":"MEUCICMAkFfkgDu5VTQuJQcrhtfyWcQxRcT03fbOVA/zG6d4AiEAkxWmQobea519Jw26w+Uv5czglFmvlsb7WBKqgbVOhvM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":158007,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjHm3AACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpa4g/+MBIzl3YRdlPk1PDYLsC3TtHN6acyWqdwV6zbJsui5MK2CLaH\r\n6CRhUPOubFSfaaeBgC4nHcKXg9/AZhHa4YX4VKMaOsePLPDJ6JxjQzNQqyza\r\npB5c2gU5SQPvG0NQ5NXgeMwrduihssefJkOgeV3tCeqjMm0CVIUBKQAhzzRJ\r\nlCVd2/l1bOMGM5PrhSx28egjkxNKsNjxrGS3I0bpdanDFfPmeicif2EVftDG\r\nyjggL6krFY1Taay52FEEqbJuXIAhqKXRiNpqGzxwkEkAcUGA/yqyc5WCWSUU\r\nZG1A1qY1ojeCuIPsNOcNsMuFI82dLfV7cU/1RitUo4wC3MvRuKisD1aRw2GA\r\nCwWkNYYDAwuuEVB6UDYAKnW7p6bep1Gk1P0M1H2D9NwEkFrAv3370fir1Amb\r\nwFOy7PzWRqnHSqW0r8DGGKKj6WH98rfDaFT4PH+f+L2FS89LXTJVjlcG4RAN\r\nYyMU/Z/Icdn/6fQAwwf4UVKmrBQ/mI70kl0s+KzHe6qO57W4mOcqw63kz1kJ\r\nZGVopbkBoJH0Y3Pslgo1JNkUz3+8GN1CoP+OAHy80QFHG5xvM13tFy6FEU6Y\r\nbDw8jpsrDDVo22IquEwLlHszRUx35RNw7LiaOQTtwkWoKllO2AwDpBOHzQgk\r\nS1wCoVMhHLdanA6++S7x0yt+gaijuFSFYkc=\r\n=vJIM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"c364997dd61af3698dc8039065503f3fbddc0cfd","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-11T23:20:08.305Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.54","@balena/jellyfish-environment":"^13.0.13","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.1","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.156_1662938560479_0.7060061378667717","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.157-renovate-balena-jellyfish-logger-5-x-a963f98b7af8df65d9949aa71f5c4efa974680c6":{"name":"@balena/jellyfish-metrics","version":"2.0.157-renovate-balena-jellyfish-logger-5-x-a963f98b7af8df65d9949aa71f5c4efa974680c6","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.157-renovate-balena-jellyfish-logger-5-x-a963f98b7af8df65d9949aa71f5c4efa974680c6","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"436262c9c04b7bb4006a7ba3c77f85753ca22849","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.157-renovate-balena-jellyfish-logger-5-x-a963f98b7af8df65d9949aa71f5c4efa974680c6.tgz","fileCount":16,"integrity":"sha512-mNMDYwOSQI5R48DK9cNGDoTAiEhfcKlA8fHChNeiUzcQTaNJH8l7PSf3HWspi2vbZCsOK6w8ai5mpAwNmlCAlw==","signatures":[{"sig":"MEQCIHh4xAOunoleX+iNKHQbuiGYuLr7/xns4tME/SrN2WCtAiA0Jl9wUcjEQnqLbwTcpZKzcoST2uIVcoK7n9agjFDT9A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":158183,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjHm4uACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrxsQ/+NPOQ7t3b4nSEeptC8uVVJUZyUaLxH2VVnMv/8/Cnra4rM+b0\r\n+k6swBs7t6Q+JGhmRbXUD7bo14NoQay01ftoaNU6WUZGDvggY/qKob207SzB\r\neLmvKBzEWcSJ6ydhHpS+6j9y6F/zCihWmcYc/Ds8lLrbneK9aZzvG7j9uLaf\r\nozHtLkEIFcjfJuk2URmq4JqSuDsr+xqY0UDmRIeTxZA5GLXOjkFwPpPnac3m\r\nqXLFOZTDx9utFocmTyDU6pWhBaiz0Bfp99qeu4pVL/X5sLha454zAce173XU\r\n+evGuFCZHdH7o+ktqCw+FF+c4RbknQfjMUvvbz2ZcOHaJDv/NdSmqgw8ljz4\r\n97cxhaRHeS20ryxseXqK6bNd97k2bS2PU6JXw9zPlapfMtmC7YfikqUAXwtj\r\nuOL0ha+KnSQEpkGS1XzzK2K++0KTpKV9/EvbvlMjPJGwjoZpc9emspBSnqOj\r\nqIpIamk3QtEDhjxyDUTTSG9/ArpszFXs141bIPmhnMG4iKuTuBLOwORAIRrs\r\n3q9RxgRMpsi/f45W7Teif7nbCjbzGz4CICH9v5JWvr+GcS49voEkgUt9c7Ys\r\nMGnHWooBPWVfOQq90yHTV+/Pgwv8qK7RRk65nudANIGA9FPG/cjbR4balY65\r\nad/iq1SvjCVkOkuvS09MxALlhaKyEyWkOs0=\r\n=LlAi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a963f98b7af8df65d9949aa71f5c4efa974680c6","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-11T23:21:42.600Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.57","@balena/jellyfish-environment":"^13.0.13","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.1","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.157-renovate-balena-jellyfish-logger-5-x-a963f98b7af8df65d9949aa71f5c4efa974680c6_1662938670488_0.20337672874406776","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.157":{"name":"@balena/jellyfish-metrics","version":"2.0.157","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.157","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"11f184d3893eae569deff341b7c4195e9b60ac8d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.157.tgz","fileCount":16,"integrity":"sha512-OqxvgVdhMhxSW4kCpITechVPydCZK4zsxdqYccBBwTa+xK0Ih+vpcec3bOY4mxfq+PsLW1w2vsSglOs3pIGg6A==","signatures":[{"sig":"MEUCIQCRL863RFy2GMJa/ctYxrSbsgYCqMWJxLW7iGcz1emtTgIgPeM5tzcpwLBIkosf6pdB57Gble6tkoKVnW8WzM3GYR4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":158105,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjHm+wACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmokhA/+P8fwhOP0MH3ZyU3ZkYrd+NmKkhHJqLNoobZ72am6Xda97Rnw\r\nzWJiVYvgTKeWStHkX2DjCs+a8KHxyXsF20K7Wy3XQK5hRAvz+Vi/wGfuYJly\r\nlfz7YvYGntijJfzeqa7HGdeSKX/fvD4oyhsor5Dz1Qx/e+MGLAknUQTXRcj9\r\nLjJyYk/vyIco1Hk38LUt4v8bP5m1JbzGU47OSQdSz351nvw2lgET/bAtgjxe\r\nf6hoggajysbgqpdh2urGMlAf/RKjIW5HxSSfnNnq750SRZm1ft7RP/wqmDjA\r\nG0+/zE69eq4Hg77zIb/F6IIEnmleHCgJ84hdjH6ymPjpr/b7ao9wyxI20V0e\r\nNKMfKKN0A9TPonYm1+MHbxlvuh7oDTSeD2F/MuKMLEaKTkyvFaTmBuWJCs31\r\nFEQHOBEJpqIVN7jPwRWfK/qwVVPIYIBGtHaN8mFVSoIpOAjdS2hkAnFHG2Tm\r\nU2FoSPJMaLWT2LzHRQU7AcfNYMoisgkpTy7Rel0PUzXJhDO6VFQ1cIcmXF5q\r\n+bEG/wxoyifOyWMxcHQDi+LiL2AuXU0J6fCRHejzT0ny809LidvHxLblu/ei\r\n9FqTX/7Y8LiE+s7Em6V72+NnGW2yk0/3g1itSUOIL1QNGZWl8N8MGZq9BjFY\r\nG0qin2QpMlGu5ZqNjrAXH4JsC8nRCxbWqRA=\r\n=A6P6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"28af4ee5d31ce58ffb98147fc127c2fc8e2c1ebd","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-11T23:28:28.897Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.57","@balena/jellyfish-environment":"^13.0.13","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.1","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.157_1662939056492_0.48675011805596946","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.158-renovate-balena-jellyfish-environment-14-x-a59ece5024f35900c27816f82e6b9790dea3e206":{"name":"@balena/jellyfish-metrics","version":"2.0.158-renovate-balena-jellyfish-environment-14-x-a59ece5024f35900c27816f82e6b9790dea3e206","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.158-renovate-balena-jellyfish-environment-14-x-a59ece5024f35900c27816f82e6b9790dea3e206","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b3e93042c96f4e4083331f35e05f1a88b22e22ce","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.158-renovate-balena-jellyfish-environment-14-x-a59ece5024f35900c27816f82e6b9790dea3e206.tgz","fileCount":16,"integrity":"sha512-9hktk820M9cMOqAZYYt32oCruNnPXIZhn+2eVZRN9HAmcYotu9VRYclgGOjQIHzW2hXyB0mlLUQhOdt0pLMghg==","signatures":[{"sig":"MEQCIFqh9MUqNGvKENqlMS17/FFjhw1HDJokPOyVnF+HWutOAiBWCcYCoOSzwpxlRMFXwgxjTB2xxGLR5PYqsrar1R0q8w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":158292,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjHqJ9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmor5A/+Iy9IBFfY1IFuxpQrh53DFcSbG7xgF1WRkLrZKK3IhKsX7Rey\r\nEr6qV54FmhqGZpXsVyeqlPwWQfgGLL6iuf301xb0BrH2u1POq5KBNiCzEidX\r\nvamFyLwmUgeuD7dfNR/E1PkgKzaFRn3vfP0KniK6YjkQAg7IVm7GPqZHk33d\r\nY3IJ+bkV3q2OeGk4cBHitarWGpidSH2+vQWKx62SvIVIpyg3l6YMPZUg6bfh\r\nfvHGsYGKPU5oHSAMr68EuLFFH9VNcGi3iD2C8ZlaDjdbk8zAsZicSAfYUsN2\r\nApggVxyHg4mC1CrTgTOrx64K8J5yyiGDAns98B4jr3UzbdIgqeoVoHUp3I29\r\nInKZjw4eBclqrNQkx+K6hJmB6KFUtx5dBGx+OWdmlEfx9VLvdGzWf0Xhbzuv\r\nzoseh7rXXN+nQ2Tx9Y/AU/VXnP3CVR0pGUEv1xVEss0YK1Tfes0rdJwXgTG1\r\nJTMaJ0y8F9Lt50maCe93atjUs7Jf7B054HMXtiivcTqchyXETH6kV+FG80fE\r\nk8kJBLnstj+XFjdDu06+qoHaSIQ9Suwz8CJHkNG/RtIcpQ7pwegHMv+K+xD8\r\n/YGryydsXbXUqonR2b6+UylrrjkMbaAKkEOC+BZ58rvtD0qdGR8XfOUcn3K7\r\noNWtPRz+wSGRTyGo3VkeuQiVD/UAameQOPg=\r\n=6SvO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"a59ece5024f35900c27816f82e6b9790dea3e206","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-12T03:03:11.139Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.57","@balena/jellyfish-environment":"^14.0.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.1","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.158-renovate-balena-jellyfish-environment-14-x-a59ece5024f35900c27816f82e6b9790dea3e206_1662952061044_0.38521900736897163","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.158":{"name":"@balena/jellyfish-metrics","version":"2.0.158","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.158","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"55b413653d346e4dd0862655cec3c801ada7f7e2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.158.tgz","fileCount":16,"integrity":"sha512-1R6NCApsx8sN0PNt14IeT2FF4PzgOFGLvU2Apdw6W1PoMxS9gtmU5/7NypbK9sqkHrIyhV2cNuS01FT4WyiwTw==","signatures":[{"sig":"MEUCIC1Yh73k8n05kdKZFX28HPxFuYrYhWlTkOjt0FhLjyYBAiEAzWiwEWRWgsHtq/NuP2tI7gbNA7ZCc7AFLBEOEE8pz1M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":158208,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjHs9XACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpnPA/9GmswApodmWT/nb+6rgMKRbpaZ2awjrbq15mVMQZphtimRbPQ\r\n13OK92pdilewofzjDsnaF0igP8zqWdTP9jfO4e1tmRFAg0yKGD5YK4HbWOe+\r\nn2uf1K9SNppuK6BuC3qydNmEM0Vx5nwS5GQYK4dXSHL/DdRaDqMfRsRzMRfF\r\n9ml7sxHUBwap73oh4a82fNipa2vSsbfhbkeiL9EGZ+PsPwcxrTd/lVI0gtfE\r\nOOaCrUlelXGjJIeFb7D+NX3JF5jRO+z6Jvmt+lycOrDt3yUMYdQQCuJYdla8\r\nsWjK7QIgxb5iJDCkjyuWLDf43MOQrejqeA3SOGJvxNrlycpEDIobHrprL4U3\r\ni8OPD1aO4+a2fvkAyY35/ffsHjAB7qUHcxclI8TTVQBcZEr8ceNlw6jydLk9\r\nzAoa3qsRQviu+S0v9IqAlzJJYvx7ky636znoTu/Y2duUX9ds/go0hwsHXH64\r\n3Us+HhrL9RJq1CUZjgK5I7zvpr06tMZjZ05/vttwWs6q8U4f8xpWC7kYXMge\r\n94dmHHnonYICUp/BK3p2T57n7Eo2Bk3cjMChVynujwKbyD62YQbl0ndAMGBH\r\nl2IdCH+PzEmmB1nUh58mt12bCi3gyzNgcnNt8Tu1nwJxE+ehpyyI6Z9osO2I\r\nAhtZLjfSgul3bOwUrpsm9azUDPQM+Me/YgY=\r\n=dPTE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"fa60283eddf6c85ea3b86a0274bd65a5c7bc4f2e","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-12T06:16:26.206Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.57","@balena/jellyfish-environment":"^14.0.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.1","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.158_1662963542752_0.974449159325359","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.159-renovate-balena-jellyfish-logger-5-x-18ad0da531e41938473fac3b4e9d16b5f926fb5b":{"name":"@balena/jellyfish-metrics","version":"2.0.159-renovate-balena-jellyfish-logger-5-x-18ad0da531e41938473fac3b4e9d16b5f926fb5b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.159-renovate-balena-jellyfish-logger-5-x-18ad0da531e41938473fac3b4e9d16b5f926fb5b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"05a30beab8b679a2e0eb856f157ae9aeafd10843","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.159-renovate-balena-jellyfish-logger-5-x-18ad0da531e41938473fac3b4e9d16b5f926fb5b.tgz","fileCount":16,"integrity":"sha512-WEU3o7SYPWBzY8fB0PG0IypbmkhCkpoNKbAKm+KZsqk0JeS7xddqPudOJAs616oGcYBW4GkkXSRO5cSRyKqSKQ==","signatures":[{"sig":"MEUCIQDqClmoD/GmaLHeGHgga/kcHPttJ8MUbPDfQqjp7mNmRAIgL+t9FyI3a965IuUeRsZaZHqhtEruH7fcp6+DTD9b9rA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":158384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjHzNLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpgwhAAmxm6NX61a/u8HWOO0V/m0h6pvAtPJLEsRm1QnfpyadwFlFPh\r\nKdSYGJfYr9oBFuGwISTS4Dmwv2lQgN1Ty+0fUEUsj0QirAGhHjndSENVIHNo\r\nSTGhPCvHmkXICEZs415+4KD5cVx79kem+SXEdi/lz20zA15+287iVT9MUVC3\r\nAfKWFlID0FcIE4Ga1U1pqAada0j0VH6V5erlwPpEMbfguN86my0BDBXXPy4s\r\n36/drktWfjKoeryf6huhRKK9jzY9SZ4y+/vuwQYMKj1ScsCyqeFFVUna+QuF\r\nkp7qQFYdI+2grJBadFJ0N/ZeeNt7v8BoiN91HmdLZuFCUvccOqLlcCImFkcd\r\nmzp1UfelYUa7Wq+kYuOXFc1XlE+4dn7eowYftlxP4FMS7bt1QGig8ochW6iT\r\nZQLYISD5JYck6+Xkly+nMCfcMJNjulLdje3DYHOJY27aXMpuRFSeRfQ/gF5P\r\n9cnFOBvR+nb3SkvEKic9CBGLZYgRZQUPr/fLTPgsVRb4eyDzVo89SI4ALVHT\r\nk8/TEj7ouXGg2Lc9CRhNu2JTGU5WM6YaMdOyxxtsBUBehh6hjBP4n+9iq35i\r\nRyUFG4rlGnlFBqJ2ufoxPgfAW641+sUWaoxA1qOluwpQZ6EpZALSCsTZFcz0\r\nIx8cb5hwKoO57G1YTy0iGlroTOHkuaXUnKg=\r\n=IQCm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"18ad0da531e41938473fac3b4e9d16b5f926fb5b","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-12T13:22:21.093Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.59","@balena/jellyfish-environment":"^14.0.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.1","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.159-renovate-balena-jellyfish-logger-5-x-18ad0da531e41938473fac3b4e9d16b5f926fb5b_1662989131464_0.23384329427875516","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.159":{"name":"@balena/jellyfish-metrics","version":"2.0.159","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.159","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"eafc8e206d2301ee014b2a6eba6749a2262ff9f8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.159.tgz","fileCount":16,"integrity":"sha512-Qu7gEAQ7A2oOhSXHbPEvqpsm5pT+yrsh2RqvAwUpnX4tHNzhaJQDOClloUNQxq3MddRov9/9mX3AjUq3d7cEfQ==","signatures":[{"sig":"MEYCIQDuwIl23O76ZqwFoujc6+00F5RljuS1rNVsTuhjK8nHpgIhAMfo1ehtfs68pFgPamntCyYDiLS72rPq6w2PDtb7ZldW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":158306,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjHzRFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoZbQ/+JtYuBmIurPm777ywyLw4skGAUnMLfzFpg4blbYb+6nvKGvIT\r\nwDDdbrkzP3n+1N8He75ol+Gq7uZhvCtolrh57IH/tajo12mVevYCP3sxiw2Y\r\nTtFU4jUkhAO/+2Tx6vJOG/NNmOo6QBPu9wWf9fi4z6G27bwlvJxeE+ovI1Sv\r\nqHqIgMFkVfkzDUpQLAK8vfJqnQV4wYbj9J7UnYG1Ak64O/VR03Swsa+QldFe\r\ndv81YM5pZrGz4j8OH/zVQ7i4hmZS5/31+/Pc/xE7rfllzbDS0aJpevGEM4t4\r\nzis7m6y90bHVDPjCZ4mfmhQOXeNB/WZ9AmW1YMlr68BcDfuBlJRroCki4DTL\r\n6sOd6FEQx+gzWSzYI8l7lCZoJoJhythaHzslOXbfO146Z3wywNl9rbB1+K/5\r\nBFlIePkknWIugsdYwBOcCH2MJOgXK4TZC81JCYbu0zD1/HPYM+NmfssuJyhu\r\nMlneb9MOajQX0m1gQWPoO0ZwGyYtHQ2qKadQSFG5Q2/ifMFNaU/1n/K9617A\r\nHRwxEXJ86hrmomnenyY/KuWBrvD3O6oA8LKatbVJU2nRJsju3kIrUI7F2I8R\r\nR2jKgMirafn2gEknaluiyiBUkA+u+cBoRtAhGwMZC3lZa86tVHukXu7joRB/\r\nMhr+YAM0gLXmqcDgr38p6Dr2PIyRo4/x9v4=\r\n=XTWH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=12.15.0"},"gitHead":"e930a2e70df080e54684f28f6715240a22a4996c","scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-12T13:27:31.103Z"},"_npmVersion":"6.14.17","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"14.19.3","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.59","@balena/jellyfish-environment":"^14.0.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.1","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.159_1662989381041_0.6974754106330816","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.160-joshbwlng-flowzone-8563f48441c719bcbf6f574fd7f5b469a16e2c84":{"name":"@balena/jellyfish-metrics","version":"2.0.160-joshbwlng-flowzone-8563f48441c719bcbf6f574fd7f5b469a16e2c84","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.160-joshbwlng-flowzone-8563f48441c719bcbf6f574fd7f5b469a16e2c84","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5637be081be8d83ba88477dd5487bf45400d1d5f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.160-joshbwlng-flowzone-8563f48441c719bcbf6f574fd7f5b469a16e2c84.tgz","fileCount":17,"integrity":"sha512-YBzoGxejMf64Iq9URR+j99IhWCzREn/GQT+H7ycZATf98dhq+gCycXIX7sA0Eaehr1UqpMiyc4fuXlGii7qicA==","signatures":[{"sig":"MEUCIQC0F9BYTu7gjjAfW9F7+FpSQNiIlU0PInF6aMIZhQYNxQIgUA5ZrMUToZcxOmDJEgXGzDVxDrJMlHayn7Qmo4g6xgQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68128,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjH/IIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo30BAAhGC3bU6OGXulEm9jaoxd04QdQBVwqTsyU4lRTgTeRd+NSm93\r\nN+ZjJ6ByKJH6Hq9c/XNsgF3LRQTIf3bMBREzcCGUmVbGGmAmdo/miyXL1gA2\r\nqEkffgrNcgMT3fOhs9Zu4chNqSZg41L/GL6zpac0F/Br3iQOLWxgNO2KmUqG\r\nYuV1Ns/w8Cj5/lAeHVOLkmUGiN9MAhcS8IcjkTJq5tCj71Zfl16qNF7t9WPv\r\nEYCUT/NC0qGr66AbUSXqjEVlnFn349AcSvS+5LUw2DqrobfxV1AuLPjIcqh4\r\n2xahDsmwVgDgPSffWIJ1IshrhjWPfyiAtvg6kYLraemSXZxs/lmVlM3WFWnv\r\n9KidX/Da94J1z+kQUPtdrscXXUY72wDvaonpNJy/VjTmVKfb5pv/Pzk59TXB\r\nMc/UW49niBahYEoihkIJVv5yAtwrVU9hbGUMctYLaraXIpa36nBziYb2+sGw\r\n1G9RLcewbuhee/8aFibZdiWZna9XK93/fTuhcwy1+y7irK+ETEZYUXXiRIkf\r\nB4lzPLGnPEv+qC64OghJLPoQIPAo2oJ6PY+Ui6T6h60kFPR3rV7HOhiBymiH\r\nrsWHv2t8uFGLItkNLryKJ/tvYLwZp6wRRplDpXNpPSFcx1n8YRBOqJqr0e3g\r\nd+xCY9M/siJj69v9Q3P4yeaxVjf3gdPvMHE=\r\n=uUfg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-8563f48441c719bcbf6f574fd7f5b469a16e2c84-16.x/balena-jellyfish-metrics-2.0.160.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-8563f48441c719bcbf6f574fd7f5b469a16e2c84-16.x/balena-jellyfish-metrics-2.0.160.tgz","_integrity":"sha512-YBzoGxejMf64Iq9URR+j99IhWCzREn/GQT+H7ycZATf98dhq+gCycXIX7sA0Eaehr1UqpMiyc4fuXlGii7qicA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-13T02:58:05.805Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.59","@balena/jellyfish-environment":"^14.0.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.1","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.160-joshbwlng-flowzone-8563f48441c719bcbf6f574fd7f5b469a16e2c84_1663037960439_0.1718878925605778","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.160":{"name":"@balena/jellyfish-metrics","version":"2.0.160","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.160","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"77a520fb5031996821428bf664e84726164a1416","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.160.tgz","fileCount":15,"integrity":"sha512-Z8UuIOJJMLGzsszVvD4eLRiZSbS+5ynH3yxlY3XEKlpNpItbIlw4FwvRg6codr62v07dqg8k03Uqnj6u479oYQ==","signatures":[{"sig":"MEYCIQDHUx7PNwM7Qx2I9G/teGOCLvwWBqtLR7fekwJeGarsNQIhALhGYFCY9JrWECChyHQdO9YWPaHO5WhhIvLhDgpMFOks","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjH/LqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpCRhAAkxxaNtO/Gzlz+9ZZ86OypDME0UJD6sQidFS1sa7yHP8wcQUU\r\nP4z1P3Y9w3323ZTkW+mRlrA3qIFDHeTABq5gPMvOaYMtYPaNvIiqFXZUS3l9\r\nHS1NnH57AOuHCU7S1IyP20+5uMn+91cXnz/2n1nWmSgjUVe9e1yCb59SLv+L\r\niWRYkERIZGc9vb+RDUlyPE6Z0tu9nBBglrcRunXN0qetxNOp+ve2b2X/XJpS\r\nRf1iz8VkFDuaORVkvdiLOmsLV7V4X1Rrhv+8+iDIesT4kjL6nEcCOrjhrhtT\r\nUk7Orf6Nor71Rl5gW3MdRlE5IUduZw9164x0i45Og6ynQKIGvQ8M4aiwXxai\r\nPgwngc9VU8e1w1bHUAIUoyO4ral2mWYndEuYexH3O3kDcmovoGwMaUg8npHX\r\n1Tze7Pf7xDF+eaUYMnWjGLC6bfdtK2+xO1l4VARVE9WgnerEglz4o6F6SRRv\r\nQo1BkglhQiavV/xw1t0GIr+sO7MBxPMRDg7Rk6rU+oELhF2TkiJ7d0AO3h8S\r\nL3PHBa8E5NxvpKemNF2iP9lakIIQDe4pwzm4GqO8rIw1AMO0C6bz46MoyQ8U\r\n0P++vXo+exyPtGoyNIPv2Nb8dkL3Vi5Plemn9s6gFDsw+lkLo4RguxHvD8Qr\r\n2WXmQh59JheYfY8ruESfCZKEhmydwLe6uFM=\r\n=b8y7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-8563f48441c719bcbf6f574fd7f5b469a16e2c84-16.x/balena-jellyfish-metrics-2.0.160.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-8563f48441c719bcbf6f574fd7f5b469a16e2c84-16.x/balena-jellyfish-metrics-2.0.160.tgz","_integrity":"sha512-Z8UuIOJJMLGzsszVvD4eLRiZSbS+5ynH3yxlY3XEKlpNpItbIlw4FwvRg6codr62v07dqg8k03Uqnj6u479oYQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-13T02:58:05.805Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.59","@balena/jellyfish-environment":"^14.0.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.1","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.160_1663038186372_0.31026927353477163","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.161-renovate-balena-jellyfish-environment-14-x-f2d9eeefca8d41677a3f0091a9f8dacc95e7c780":{"name":"@balena/jellyfish-metrics","version":"2.0.161-renovate-balena-jellyfish-environment-14-x-f2d9eeefca8d41677a3f0091a9f8dacc95e7c780","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.161-renovate-balena-jellyfish-environment-14-x-f2d9eeefca8d41677a3f0091a9f8dacc95e7c780","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7782f260389c984a49f213bc2b5a0ff3d22302f8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.161-renovate-balena-jellyfish-environment-14-x-f2d9eeefca8d41677a3f0091a9f8dacc95e7c780.tgz","fileCount":17,"integrity":"sha512-lSehIHRGsEIdjYq7mP2fOc9XtxehXn1/GDPcVOaBoDUqzJNdFMnDLAb2RiZFU6XesLioPBXS+EYITAZ7qpuThQ==","signatures":[{"sig":"MEYCIQDwdH5/8mZptBTT4Pto0t3BgdrMbATq2liQjfY+68cdZgIhAMB2ICRykqcA/LdJDAJRT1VbKvR24XPgYue8KQJLqWaX","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjIJuoACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqRrA/+JPJ4qBgmDqU1kxyOeHO3jltUxdVSG9sybLOoHRq4g37NSXuQ\r\nGTU+XyPpobbbeduG5yiVj9mBXK8+5Oth/byLRTWd3Xx+xDkMoqJE+bPNGsYu\r\nZJ13ft041cQQ6HNnL5JJkNDEPkwbRj3FBW1ijrFbmhuOpapye4WPUvakU1CT\r\nL6R50FXVONlWRlYGqBP5cUe+fVvLkHfbK3greVzx5FMANE6ybbexPhkhRC4K\r\ncyCNk0Jf8C/bxFx1BAVf63LAXLt+PlmiRQHGJcUsIbEvKB1Y7lxOG9b2nOde\r\nYxYSmK2kBgPzmPkSr7O1iZOdWyPPDGyY3/tEACRWwFrjyydq9diRsllPedF9\r\nY3S6VWYMakDVLmGVbvysYGx9dj4gsn5SM2y2+PG0NFnb6HZuAEsK0IYJh+Q3\r\nyDUJFEqXklkaOO04oMlu3l5FxyPYwzRyLcQsY3GnnJJkApaRClD+pMZjc4z2\r\nahWkst+3OnsyN5jSp3/w6/8/NM6sDQAdgumuTPHvra/U3QeTFM9wBOF7+XQQ\r\nBuE2qqd47CsBVQMm/Q8/VQSDXWywD/tko/fTKsQ+RmvuYww/Ngb0bSmq5BOs\r\nL8YPMmovXm7R9T68Cva3RRC1A9EpbpWDHyUeMzjEuhQuYLkywnWSmjNDHL9n\r\nwAkw+vK+VXfjXpUOM/nghCtju/yBGQ03BPY=\r\n=uLhC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-f2d9eeefca8d41677a3f0091a9f8dacc95e7c780-16.x/balena-jellyfish-metrics-2.0.161.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-f2d9eeefca8d41677a3f0091a9f8dacc95e7c780-16.x/balena-jellyfish-metrics-2.0.161.tgz","_integrity":"sha512-lSehIHRGsEIdjYq7mP2fOc9XtxehXn1/GDPcVOaBoDUqzJNdFMnDLAb2RiZFU6XesLioPBXS+EYITAZ7qpuThQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-13T15:00:40.234Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.59","@balena/jellyfish-environment":"^14.0.3","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.1","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.161-renovate-balena-jellyfish-environment-14-x-f2d9eeefca8d41677a3f0091a9f8dacc95e7c780_1663081384355_0.32858095720753533","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.161":{"name":"@balena/jellyfish-metrics","version":"2.0.161","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.161","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1c72434ea9a380d2b78db200d06d286de1537b83","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.161.tgz","fileCount":15,"integrity":"sha512-WQP+6NmcliH3CYs6TQxlsFiqW7VjdeiOM9TKu0F7v9OS6h7UX2BzoNOK68DayPq4twokRPfpUHHGUrtY2yVoEA==","signatures":[{"sig":"MEUCIAsAlv4c4h6t1B7SSv21Wdc/EleieS2g7ymoylKJffQuAiEAyzMkxgdQMitHCavHtX1Vdo+BfwqUYZAWHPWiVh+xTYk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjIJxOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq30g/9EWAs7ZeXg8x+oJ+qt/5VFaGK0RGpE2X9Kdsim8Saaxkzqzdq\r\nbfgDROhomPvSuNZ/Oi10C5A+YzLvEQTU3Li1IPcHkLk0cBcls/tEcHSlUhUW\r\nUYwjh1EXsB+4XvdGENGmlZcY8FRfqM4nhD7B1dd0iZI5PY5OnXN5f0RjVOOq\r\n1Nc9AjvyXL0jrgNXaWGB+JULk6eECKLF7fMesWWpaRLqpOB3vD/5VYhLD5jT\r\ngq33aPeCjVRfplS3huHb//d5LtHSvffS2v71zc87H9v9IGV+WEgovNRORNZ8\r\nkL2uULeVmaWt8KHknLHfhAkC5GkaEi7Jga1fCp9Qr/pku2Pi4TTgPH6OVRxt\r\n+E+x/hR5DB0TmxFz4kher5cZh5o/TzUYCusKDa8CpgSLf/VYZO2bsbL5IXy2\r\nBKUbEm92uJTvLAiF7M0gGew21jfEgVfUvgW70espfpdUkEeMvDgZuyETgHpx\r\nL5c87yp2AuXVvLbHKTOQd4VGuCWpLjRAJmNH3hboCBbOasyTrZYBxoX2HgQo\r\nSQLJ3/cBQbpWALkRKRT2gWYLvLCO/iq8riiuYvb0cerJ7V9IY3qZZc9C9RzC\r\nDXLbRdgciqyJrdUmCMVOGPApE2jfIIb2a2/EbMSfeKJR9bPaElpYBjKmHfMp\r\nU+QYqJsRYCU0dSpKbwNIFS33efOO/nvJlnY=\r\n=SOQ8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-f2d9eeefca8d41677a3f0091a9f8dacc95e7c780-16.x/balena-jellyfish-metrics-2.0.161.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-f2d9eeefca8d41677a3f0091a9f8dacc95e7c780-16.x/balena-jellyfish-metrics-2.0.161.tgz","_integrity":"sha512-WQP+6NmcliH3CYs6TQxlsFiqW7VjdeiOM9TKu0F7v9OS6h7UX2BzoNOK68DayPq4twokRPfpUHHGUrtY2yVoEA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-13T15:00:40.234Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.59","@balena/jellyfish-environment":"^14.0.3","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.1","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.161_1663081550199_0.9786658727433064","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.162-renovate-balena-jellyfish-logger-5-x-a95dfc14a9cae9e26a6832d9aa1575fbb8d67897":{"name":"@balena/jellyfish-metrics","version":"2.0.162-renovate-balena-jellyfish-logger-5-x-a95dfc14a9cae9e26a6832d9aa1575fbb8d67897","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.162-renovate-balena-jellyfish-logger-5-x-a95dfc14a9cae9e26a6832d9aa1575fbb8d67897","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cf28b8c9a3a71484c88403d97f8872d846475416","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.162-renovate-balena-jellyfish-logger-5-x-a95dfc14a9cae9e26a6832d9aa1575fbb8d67897.tgz","fileCount":17,"integrity":"sha512-ufwMygYD48NuJnGAaaGR5PWDl4NJA4NXHr2gO8AexJS4LRwqyCefx1qS4lxMup3G/+79JEhSJRShn5ENJgEMiQ==","signatures":[{"sig":"MEQCICf6sdZQhGDeRGlt/3nnQbMQWt+vDCrkDQI2l3ZtNWzkAiA7GJ5TMx32kwpTAzJSGDEPPOR6SyRbNmCY150L9F8mIw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68146,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjIJ0MACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr+5A/+Ju1g61pS4lkCMhx/+Fppbh+E5NAwsj7U5Ar2P1jvuQUmqjrr\r\ngosfr/RhzzxvnSi3F+13M7nZl8ZcdOtHnMEeWddtc7B0Rz/cVzynArU8JI/D\r\nsZXKVSZjQrG/mi/302RoVCajbNUuJWkFYdPiX/FO3GEbP9Kz9/EzFySjNDLQ\r\n+/LF0dthYagY4hp0/FhS4356hsdPZWnambF18S4nWeqElzpWOHC4mDnFQuDo\r\n6phbzyz8jgIGs/jaOXDgMgmh5Qun9s6cL7AJZMGCscYkMSiZDlXaRUEIT8E0\r\nqRe9WoZJ2kYGoSgCUrBZMrMmrlfdgln2TUS/Ce85ZZJEEj6byvVPgOXdRBVi\r\nciQo0Cw0yM2krcZMPIFuR3kii+xLJXfGlM59RuYbeNa1sP9y0GKs6cFd8t0f\r\nJHbOt/U50ZP1aLTteIcbDgra/46FLBG6nS6PuRmtoMJJSiXUdNk4+Gi3GEkG\r\nvpYtXkeHjN0pFSYefUCKhphpweBqOMp1MyMZwQ/84enY63MkXBXim9EBdunI\r\n7RHB93J87W+aiaHq90sCGshwXyLBhi8s6T+C32gjTKBrGo/OkxXwiSewcq6+\r\ngiC+6u1EmOoVA5BhnWoMdkyB2YnaoxT3Q7qlY9qcNcZ+08vfmu1WC43VkwVR\r\nSsKHDRS8zAr2pCBJ3SMCm+uvBewGjG1z8Ak=\r\n=f/In\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-a95dfc14a9cae9e26a6832d9aa1575fbb8d67897-16.x/balena-jellyfish-metrics-2.0.162.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-a95dfc14a9cae9e26a6832d9aa1575fbb8d67897-16.x/balena-jellyfish-metrics-2.0.162.tgz","_integrity":"sha512-ufwMygYD48NuJnGAaaGR5PWDl4NJA4NXHr2gO8AexJS4LRwqyCefx1qS4lxMup3G/+79JEhSJRShn5ENJgEMiQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-13T15:07:34.125Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.61","@balena/jellyfish-environment":"^14.0.3","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.1","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.162-renovate-balena-jellyfish-logger-5-x-a95dfc14a9cae9e26a6832d9aa1575fbb8d67897_1663081740361_0.21094358184348994","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.162":{"name":"@balena/jellyfish-metrics","version":"2.0.162","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.162","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b6306e0fae6aed4514060cb4efb731dce72f03b0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.162.tgz","fileCount":15,"integrity":"sha512-Q9u4BziXLbPCF0Z3JgpeaqvL+EeytjV669qo5yZ6+9KL/meUZ0L7uZa9kRy+t4OefO1PTfDLK5elrcY4zX8lzw==","signatures":[{"sig":"MEUCIEWXwIeE76gTWFxmJ4YU8Q0HozN0akcSLfO/4XgiOyHSAiEAjrm12s8gPtBwuxmQBqCOUaGftpKf6a8eycTD4L++rAM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjIJ2xACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrRtBAAnU+acqYLNI+EWFlh9fshT237MSLKiejT5fgIDZjlg7QiuBeq\r\nQ0p1TjXHTr9mUbqid5MJeVuq3Tzs1rRAtsPhlmlqUuND6skqyV36/tTHeEl+\r\nAEDIwEdFA/likD0P0d8DS3OJmKk4HlsBl2dLJOr47zOo43ybtzX74iHdkfx0\r\n4KmjsPGjo95beWJoYJpG+FyRv8KwSgUSBFYxpIb9P7PQ+q9cwIAEg6KA1KLe\r\nZ+FGoXV4eiLin82uKumDHBOANGWMuEVFJLi6QkU5r3vTjBebfdBTSEXItIlG\r\nhGloyhRHtAGPNhD2yYHOlckWXZrhXlQh8v2FkeMuYtSJ6kN68D7kgYVUYC+j\r\nFIT9TTZsSyH1yvG9skSzmNReDx1/sIyJAn81vVGcWwgvenrfwvR3nTsHi3j6\r\nM+2Wsla2BiL5N7vMWlogZu1WiqGG/C0TfYCW5YiKWGAKQ1VWf+GKVhiivRZH\r\nXcWv+Iuuhp+MZcNj6rtAW8EuuS9OqPbHHWwYa5htvz/jbE/k9pLvLTmX1zmY\r\nrebywYk26lhTQGxjFSEKfOIF47AICjegIeAh6/fTMXpHPMg40Ov+2cEvQMUL\r\nI/RUbbEcBHywpl7YUiohbdF4qMMXBZMTelH9UDHlMwF+Lif2z6WWxc3wSY92\r\nV3G+NPjEZlxATY0ZdT4zJDhhbL+F6R/NbPc=\r\n=EW7O\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-a95dfc14a9cae9e26a6832d9aa1575fbb8d67897-16.x/balena-jellyfish-metrics-2.0.162.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-a95dfc14a9cae9e26a6832d9aa1575fbb8d67897-16.x/balena-jellyfish-metrics-2.0.162.tgz","_integrity":"sha512-Q9u4BziXLbPCF0Z3JgpeaqvL+EeytjV669qo5yZ6+9KL/meUZ0L7uZa9kRy+t4OefO1PTfDLK5elrcY4zX8lzw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-13T15:07:34.125Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.61","@balena/jellyfish-environment":"^14.0.3","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.1","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.162_1663081905017_0.11135874261631185","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.163-renovate-balena-jellyfish-logger-5-x-7f1bda7f33f5abb927bdf87abaca4b6c244cae1c":{"name":"@balena/jellyfish-metrics","version":"2.0.163-renovate-balena-jellyfish-logger-5-x-7f1bda7f33f5abb927bdf87abaca4b6c244cae1c","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.163-renovate-balena-jellyfish-logger-5-x-7f1bda7f33f5abb927bdf87abaca4b6c244cae1c","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d38d8cb91dd3653f2c777b99d38bc5d492597805","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.163-renovate-balena-jellyfish-logger-5-x-7f1bda7f33f5abb927bdf87abaca4b6c244cae1c.tgz","fileCount":17,"integrity":"sha512-FOuyxWVd4MdTF+gnQbq+JxOnSnvXpkWrpn+oLhA6tF2mX8YeGC9MZHWHi09TeZ/Ko1hz1EYoKOpJphztgCITbg==","signatures":[{"sig":"MEUCIBQ0pG6FKrPHQI9Z/7A9gli86MJaWN/UUFn7WvoHGzizAiEAyQOR8JG8ifbWaHCOC9nuHTd5ZFSYiyxdU0/cr3tuZPg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68146,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjIN35ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmre3A//ZZijvmBwGBjhC+wWojUNeF1AyhDjF4MQtZ5ar9f1ohJRwXVL\r\nyyKHlm/WJR18mCHDtSXEj/i0zCswdAoOElsZQdoGN00PFhNN2Or6BO8qnaJQ\r\nuCgbBUJK8JS9MSZO5lS/lU52+A6gtwdy76+BJoNqaM26+G7/Zd+yRX3SFDNs\r\nFy8iSB0TOan2WV6XTuho4Y0zHWJFmDDe+rK5hQZanOpmdF+F4AKviT2VHbh9\r\nMigQzFo4ReplGQtS/BPisTHxLqju1z3Hu31vqz8Raa7rkxcbfJz8mLM0MQKL\r\nZu+oOOBHouJo3SwyA/obHEX6+BwU+LGKlhe7SemI4iYL64VapNG4n/oBXc43\r\neHUPEe81En+vD6xBeZmFRsNVxKLt26mXg1eCnvBpFSOvxbh0FVqr2VoJmi6x\r\nOziJRcarD+207vZedMiaPYrDvx/Fb49Vf03kHGlvIzNzYcMNzJ3b6mkzIL1M\r\nLv8EgWLFSsNS9U3ofZfDIw2zBakAUezJX6OfO5Ql4JicgDYH8czTCsnkEPJ5\r\neJMoNBV+XLOVb2NzZZ9HQro2Yu0xMnbqBfWicLJjlm/EWQ28rKB+6jXq920c\r\nd1ghhICi76P5u/U+QfAS8LZKSRc/xB5jB7/MgcoxID8TUDgotNL/d83v7FlV\r\npBdi0pU30iVgTX/Spi/b7GBLSrI8Z3Tf3HA=\r\n=2mCl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-7f1bda7f33f5abb927bdf87abaca4b6c244cae1c-16.x/balena-jellyfish-metrics-2.0.163.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-7f1bda7f33f5abb927bdf87abaca4b6c244cae1c-16.x/balena-jellyfish-metrics-2.0.163.tgz","_integrity":"sha512-FOuyxWVd4MdTF+gnQbq+JxOnSnvXpkWrpn+oLhA6tF2mX8YeGC9MZHWHi09TeZ/Ko1hz1EYoKOpJphztgCITbg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-13T19:43:50.994Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.63","@balena/jellyfish-environment":"^14.0.3","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.1","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.163-renovate-balena-jellyfish-logger-5-x-7f1bda7f33f5abb927bdf87abaca4b6c244cae1c_1663098361167_0.8174416358696859","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.164-renovate-balena-jellyfish-logger-5-x-00a6d9d7338fd4cd46585c02b8cb9dba166ce91a":{"name":"@balena/jellyfish-metrics","version":"2.0.164-renovate-balena-jellyfish-logger-5-x-00a6d9d7338fd4cd46585c02b8cb9dba166ce91a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.164-renovate-balena-jellyfish-logger-5-x-00a6d9d7338fd4cd46585c02b8cb9dba166ce91a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"12038f8d1cae3525dce1204c6659a3874b9492f2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.164-renovate-balena-jellyfish-logger-5-x-00a6d9d7338fd4cd46585c02b8cb9dba166ce91a.tgz","fileCount":17,"integrity":"sha512-eVEhb10HAScIM++xpyKF61YSa4/kA6uZr4G980+5yE5RUVJwAQnT/QmVlFkziiy3pV9b4hbqOhjHruqb3dta/w==","signatures":[{"sig":"MEYCIQDcgpSEfJ1dMZSzIoXEdcxIi8dD3e/IuN3Yako5+5/+zAIhAOouBOUDFa5IGChMxzJmW0Z6wqNFKdhhGlYI9dGLbRg0","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68146,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJRunACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr86Q/8CzNajXQfU4oYfvJjRdfHbj3BGAMmqeHqDLnHfO0lLyWjdgat\r\n0IEj6o9P2psuL5CGr/i41kxyxHFYgtLW17ZgRa7ot+hJWc7jGmarxzFoeUN+\r\n7/EVdmmUFTubqgWL7DniCc0cW6sMB6Sobl4f7HgCR4zhGERn9LnhtkvYkWV3\r\nJGOlPIlGAXpn8hgUZSYjYgKqECs6QQrCL0Jeyg9NMwX+GIgsGyNajDUoyPck\r\nTYaG9p6FDWbtUXbOTdxt+2TJ8ZavbFoxjO6eAqscrpTUMOVUTAGqnmbz7lWp\r\nAx0ZhLAVLQ4rqNsG3o/9yok3nXniJGJWwMinUp4yEOJkGYZ2/fWtnHp0pXc/\r\nFZMv+kr6llUza7RztRtPIpfyH7x1GgtrFkDuDaqCaboTG8qJN2vaWRkyDlqb\r\nc6j5Zfoyb0kVG6fUodOIMwgnCr17l57Sf77z5iqE/lA9rGa/2ojNemzqqZY+\r\nTiL5Fupv8dXK9Wu2AYPlqFSyFerHb+qy49PMdnc89EAoE7UwN+Dtj+R2Iie9\r\nWKDAUFcoVXSsLWHs4Ha1VJqg1ypU2B5Up4+pqh8aqjAFwl9qbxezxs0tXhHq\r\nZjhS2UZY+4XjiL03U0HPYArKb01vuJzOl3HAccwUFUp38WgyanX3z+Z/nAme\r\nYEmnyveH6UNr8o9omsqJWuHu3nUojYWkcLA=\r\n=fQDI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-00a6d9d7338fd4cd46585c02b8cb9dba166ce91a-16.x/balena-jellyfish-metrics-2.0.164.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-00a6d9d7338fd4cd46585c02b8cb9dba166ce91a-16.x/balena-jellyfish-metrics-2.0.164.tgz","_integrity":"sha512-eVEhb10HAScIM++xpyKF61YSa4/kA6uZr4G980+5yE5RUVJwAQnT/QmVlFkziiy3pV9b4hbqOhjHruqb3dta/w==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-17T00:57:02.651Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.65","@balena/jellyfish-environment":"^14.0.3","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.1","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.164-renovate-balena-jellyfish-logger-5-x-00a6d9d7338fd4cd46585c02b8cb9dba166ce91a_1663376294796_0.18490204988770742","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.164":{"name":"@balena/jellyfish-metrics","version":"2.0.164","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.164","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cd0a8b2dc79007ee87ed905efc3091b0ca0624bd","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.164.tgz","fileCount":15,"integrity":"sha512-tyV7Nj7EroP7g4HUO6aTu6PwYYhw9iH0X9hk29KONeMYWPmOo5g8xbv5twDny0wwQPMKbxQH1VgGNFKiYLtJ3Q==","signatures":[{"sig":"MEYCIQD9Nw/eukWF5vMYMM+ki/IuteQVOvxpEkHoenl/Gk91mgIhAOcha3GPtKy6TqPZnLLNpHGbTQcLTu07/3aP/kvSJF4Y","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJRwfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpcgg//WTHDWn11heL4UdL4wjQ+b78l6122bmsAJmnt1gx+63C8lhkV\r\nNdE2HV8zi3w7IiJ7LprKio4vYjXIQWyKpKWJ10y3UFaMkcMr5dc9E1T4OBND\r\nPpEWWVaYMcIL3Aec+hXYDT6IuIdpW81R3rnhKV0bHol6Rqy4X7MHQY4jhF90\r\nKyPjOJpT/Uz0/DQWFvOSz3TaCEk0axMCB9sfvSsXuTx1DIepUT+mB1UGcfHK\r\nC0Ii0HfAVxmO6eFp4lSe+NQr2LlsItkBIyX0RvuhMoLBLZspYPsNCLFVM+L4\r\no6LuT2ghluO7qWwPOfaO0fZFnscjNbkG89XVgRfphVI8ADxQi16xOAeGBMGF\r\nbb1pKAS/7AreoSeSEnOpY2b+c0KQaaQutD2F7Q0XEzXOMU4F2HafuK2WvsKv\r\nDowf1I8WN4ir2pEyKJ4KdnbOSxkqiIIHVJF7no3vWtzyCHs4V8uQdLzp79sh\r\ngatnMPuYT5EZuQV+CTWlNez1o8rW9EkwOIKgKbz4JWDCqzVKg3D0rhDTEX9Y\r\nb6Q4qzn6EUBCi7PC4QiA8yp8xFcFUljUqtvdoZLChh3XryPCzOGdkQA6HcEC\r\n+Xq0DJdBWH4BoJbQQKp4dB1mGJ4IIUgPjt4PMlwlOXYftVeoQj0Thhcu3KiR\r\nZ4og0eaA33Q0pne7cDtqFqkko9fZgPf2J1s=\r\n=uXXj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-00a6d9d7338fd4cd46585c02b8cb9dba166ce91a-16.x/balena-jellyfish-metrics-2.0.164.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-00a6d9d7338fd4cd46585c02b8cb9dba166ce91a-16.x/balena-jellyfish-metrics-2.0.164.tgz","_integrity":"sha512-tyV7Nj7EroP7g4HUO6aTu6PwYYhw9iH0X9hk29KONeMYWPmOo5g8xbv5twDny0wwQPMKbxQH1VgGNFKiYLtJ3Q==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-17T00:57:02.651Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.65","@balena/jellyfish-environment":"^14.0.3","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.1","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.13","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.164_1663376415480_0.010537133488498274","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.165-renovate-express-4-x-2fcb48a0dc8d4c8e6d9ea9fc683d7d27d2e46df8":{"name":"@balena/jellyfish-metrics","version":"2.0.165-renovate-express-4-x-2fcb48a0dc8d4c8e6d9ea9fc683d7d27d2e46df8","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.165-renovate-express-4-x-2fcb48a0dc8d4c8e6d9ea9fc683d7d27d2e46df8","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d077f1329fe5735a35c53f136def81993dd3a1fb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.165-renovate-express-4-x-2fcb48a0dc8d4c8e6d9ea9fc683d7d27d2e46df8.tgz","fileCount":17,"integrity":"sha512-RiStDHdp1qUg7nosAIhlbs1YEvq6qVeeaRt3sh/KiGb62JfhbBz4VAYYXbXO775TmgVYRMyDO1oKKBNZImjC7g==","signatures":[{"sig":"MEUCIQCkT/6w5h+xWskK31FVXYADp4fLJ+Cruhmg78b5s7RHBQIgUEhb57DtAztL5g3LklhcSjkwnFKA5e5sbwAnUKh4mcU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68130,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJRzHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqGbQ/+P6TNzSiJGHQDXENEZ3IUar8n6FztAXyCew4wYYMqLBkzC8mR\r\nW9N2ZD6zEpZnaKw+aXb84BhZ5C2nY2HvexDaC77Fe57z2Hhb8OmC8clR1QQx\r\nNTdrbSxx2cUzcMji++iqG9zH2ZWGrwVyous+Mop/SK6tpB7qmAef5A1if2Kd\r\n3QIEvmmYLJIhh5PI7ESSn+dUK4VjPmBmn6GoNVny2HJKtGRwBRGqrwvyvKX6\r\nAxL9M2JlVX4CMReZCl5Bl8ZAGzGapVlSubEWzHbNhydWZdu3kYslBzmnkfxV\r\nUQtIVXcjap9VjXqwzWuf9hgHdhtMYJ79S/K1GcLfIcIY/Rpy/Z8S0lb/W3RC\r\n65aAp64K68FjVdrxNt1T6o2NaBGJ8+S0dkl9DQzRONf1+KF3GWAzdKZz6hYb\r\nuJ0zY3zFcXdEVgUuHjgk+f9xoTrUHFdck5VviPkc2Esx/d+KC8lGwOyIlZba\r\nRLajdB8yDIyOV/YQcjQoPQEZO0z8vzU6ftUCnz+brfLfN57XN3XEfWdOWn+L\r\nHe+uOLZV1N+46Ds6RIRbWosMeWfhTEKs8dVo2YNGrvY1SajgEe+fQ5FjbCn5\r\nvDcA/4On2hhExUPF0EcZpiF8uChKgIo1ieHCbO6Wjdd6Za3gUquhvjCdI1C3\r\nBojqYvvz4bACStqdjCtbyAQnJH9gxDdRSW0=\r\n=x8VW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-2fcb48a0dc8d4c8e6d9ea9fc683d7d27d2e46df8-16.x/balena-jellyfish-metrics-2.0.165.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-2fcb48a0dc8d4c8e6d9ea9fc683d7d27d2e46df8-16.x/balena-jellyfish-metrics-2.0.165.tgz","_integrity":"sha512-RiStDHdp1qUg7nosAIhlbs1YEvq6qVeeaRt3sh/KiGb62JfhbBz4VAYYXbXO775TmgVYRMyDO1oKKBNZImjC7g==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-17T01:01:53.765Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.65","@balena/jellyfish-environment":"^14.0.3","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.1","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.165-renovate-express-4-x-2fcb48a0dc8d4c8e6d9ea9fc683d7d27d2e46df8_1663376583362_0.3018736499594026","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.165":{"name":"@balena/jellyfish-metrics","version":"2.0.165","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.165","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0f7e7a1e3b3ecfba0ba606370a36253ed91d6b9f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.165.tgz","fileCount":15,"integrity":"sha512-x0XhxlSJwcFs+ACcWieKiUn8IKsSLEGEczQwNwmQTOLMr9GJ2nrN5JR/cofF60b+HEIXz7e4+Jkmif6OThRRng==","signatures":[{"sig":"MEUCIE2MIBaqsPTTSKr0RE8AeJe0y4obX/67SW5c/EHPo6q0AiEA6cGl/qB3UJgy7VEIVVlQY0Px7fnjqu8mo5IH/XFotEs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJR1KACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq2nQ//cgXZjwnxr2zsfFFSyvbr9cJjVR89G1V97pJdtE2jbErr1ecY\r\n5w7Ule3UK+LOrQom6Vk3bZMxXsuI0KvWzJqaJLEbckz8wih4yyEPwldruiJ1\r\n+dlym8l12sgerLrK2+bca3Ug/b1Z1TQZjYq9mz6653yY4c2W+SsA3LbSjg/I\r\nYQZOX/zBtLbnynzPZPerCV+Vz/7M/aiZZ0fXH/Kx+7PG/qaQYNLINogx9UPK\r\nPScFISDSK+JCx4mLndawXot7caNjBmfUQrbSFs41GUbmwIFVsTqExtYPTRD7\r\nji33ebyia/zVt6jDhiIqKIC6eLM3K5M3hwab5MgClng2m5z8ak+PbpLBvgxM\r\nNsc40qVUxwVTLGMRU66VP+u/1aJ5JDjhKbXCID36zTYqY9xtBSOo17XO4hzT\r\nL6QGfcBmzWmHnaSwf5hisko+ufA0H+kkQCnJbudBjRNcUXjtECkdvn9ePmt8\r\npq7HvPDKl+EotzygoHfDjOWX85HLpf2mbDz+4UFQf7q786Nt/+3gPdGKnrdj\r\nj1thveCaoAXwhY7yyfsqBBzIRarK7RMh7uVAJyFW/NH9N/5ng5/1tx9Gr9jq\r\nAFs79arz4fPyG47I8PhOh/aY2nAc0NEn/4ixnQM5nGnWdlsN8Jek0F8MplG5\r\nWEgOkUS99VVIQuGRyGtyDZasUB4qFeqCTOA=\r\n=kbHE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-2fcb48a0dc8d4c8e6d9ea9fc683d7d27d2e46df8-16.x/balena-jellyfish-metrics-2.0.165.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-2fcb48a0dc8d4c8e6d9ea9fc683d7d27d2e46df8-16.x/balena-jellyfish-metrics-2.0.165.tgz","_integrity":"sha512-x0XhxlSJwcFs+ACcWieKiUn8IKsSLEGEczQwNwmQTOLMr9GJ2nrN5JR/cofF60b+HEIXz7e4+Jkmif6OThRRng==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-17T01:01:53.765Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.65","@balena/jellyfish-environment":"^14.0.3","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.1","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.165_1663376714726_0.4913158690611015","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.166-renovate-jest-monorepo-a972104c5357417b17ad81dd54b6bbaeca06511e":{"name":"@balena/jellyfish-metrics","version":"2.0.166-renovate-jest-monorepo-a972104c5357417b17ad81dd54b6bbaeca06511e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.166-renovate-jest-monorepo-a972104c5357417b17ad81dd54b6bbaeca06511e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"58a91dab6f26a9517783bf762ad5da82ba25adc6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.166-renovate-jest-monorepo-a972104c5357417b17ad81dd54b6bbaeca06511e.tgz","fileCount":17,"integrity":"sha512-KPnhi7VbgUBRNZYB1EZVkxRaukhroHHWKoNTKhtWqsx4/x3Yd0lE4/Bz/Ssa+YAGIWtFQzslkx/Il/uKP/7f1A==","signatures":[{"sig":"MEQCIFgyE+n/yir1vb5QMfH7YJZKQQ6qDCVyOu7DJaBcuvWuAiAaHWPL/khPfAR9x22V8Syj6dytnVfANs5rgMZWIiGNTg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68132,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJR3pACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq4Kw/5ABqvEq2devujyP8KsNb9Pa2D880cCw2rb0PKFPtYarBNNHVb\r\njyb0GMFeJOKL4jOSZzY7ql6VJnirfOqk+7TPUqdT6pkqGWfTfU8FY6CANJVr\r\nD45/QcuDfNJCiqLl1GunbeI6Q0Es0ouBCaosqMjTiD6q/eevW8hf7ijoqQgg\r\n7HLD3QFbfAsOinK9vViBaQfKsNxgNfi6ZhxpkEzqy1wjnguVPwv1cysTIs3X\r\nnnIKGP9Vgs5kqfCXGOz2MfyVkGk2TssZWk0qB+QJa5kYvrQvXLFIph0wCiHL\r\n1pAS1KV33SZmkibqfG9d94krCCt6zGH6Q+dINSCHo83rguBDhhQEAF1NUkh6\r\n3mSR4/pJ3ldNaCLRqQCTqrV8As8G0QlKKoowkPiKvtGvi5VRox+sB9tTOTdq\r\ne5R8h3pqF0ImyndYwS30cIZyMnEDK3z+awMop6/zvbeGqwruNExLU1QPT3jK\r\nr9XTEMDYnv/Wu8hxnbtWUy2SMNnGbb33jKboEaF3LULdnQY9OmnVoDKC4uZi\r\n6/TLFiX6rStjhWWMNA2QXvxiGeWJ5HTLhc6RHu/BX6/hjLZ3OAaauZoj+Ic2\r\n08B7gEwOqMeUifS3eKr4YRSk05BNN83t8A34A2GEfL3UWy90l/4hV50YYmuo\r\n+7Ac/1WRv36SrzUiC7smZSV1Nzu7CJXYFp0=\r\n=2JUJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-a972104c5357417b17ad81dd54b6bbaeca06511e-16.x/balena-jellyfish-metrics-2.0.166.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-a972104c5357417b17ad81dd54b6bbaeca06511e-16.x/balena-jellyfish-metrics-2.0.166.tgz","_integrity":"sha512-KPnhi7VbgUBRNZYB1EZVkxRaukhroHHWKoNTKhtWqsx4/x3Yd0lE4/Bz/Ssa+YAGIWtFQzslkx/Il/uKP/7f1A==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-17T01:06:40.700Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.65","@balena/jellyfish-environment":"^14.0.3","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.166-renovate-jest-monorepo-a972104c5357417b17ad81dd54b6bbaeca06511e_1663376873376_0.595732674182111","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.166":{"name":"@balena/jellyfish-metrics","version":"2.0.166","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.166","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4b627ab7ff08e785ce238b2765211fe8fa23162b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.166.tgz","fileCount":15,"integrity":"sha512-hMc28XdcggzhpTsAhYxufzJeV+nACSejtPYwpS2vKAH2Oi++fDPfKUv3IghQZvjeM1FSggRlanaHkOZLVXOxbA==","signatures":[{"sig":"MEYCIQCRzOWiltsIneJcTyEJj9cVfULJ9kYVhJpbbMvVYc7itgIhAOzviGfPaZzcHOjax4lQSZQP93HvFBXDjnNQBnVmJert","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJR5xACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqoFw//R5mSytDxBB4b549tFnjkZ29VIh0Tg6cW+Ks3BjrByV6xhfpU\r\nLJObEpE4//W7n1WU/iRqWkXiGqgVU7AWTI9ckrSPSTNBOG+E/QunMLpu8ueK\r\nx/eRaU38LJCBdhg5agM6dEVdLqpCOHMJXTIcKPf8rdCEliMjK4/BSL2yDnOD\r\n0sfCIBT8QHa6OrngNi+QME9F1grCAZmJ9EA57XBwK/7Z4TKbkof9QtbDPRc4\r\nREKBjH9hpNM3JJXAmginxm+FLLrmI1quKlEYQCAORvlcwPKFhLgXX5G8gTKR\r\nhEtHWnOySFqMuVyAHF27t+vBio9nhjtNInGHHsp7rVXfTORtz+m1qN5g9DiL\r\nvkf6FZcYmPiyebFmH1kSq+N+WQv44UCGx/Qo1mOOptSO7CAWA9WuERlaV06z\r\npCbqE6wrUWQtQj9hyCUVRmGIwz9/0dpGm6/HcCQMeCOyazsqZukOLeYWh+4Y\r\nngrRwGLTvu15yFMxPh+iZbb7Vr1Z2UYZiCLJ9XrZSShZ8Rq3a05VR4vl3jpm\r\n1WqTf4jvIQJup6Iq1rcNxmEjS0gvD1A+h9efd9U9zan9EEL4TSXR3BciEWnO\r\nO72YQQdGRV6Lqj5SBuZvdvdh3YcEqqmaozUoYSQ/QvQMbANvmg2Yj2KmsTk1\r\nQoQJvq1YaRBA/6RuA470LL9L+S24fESGnd0=\r\n=ceEb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-a972104c5357417b17ad81dd54b6bbaeca06511e-16.x/balena-jellyfish-metrics-2.0.166.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-a972104c5357417b17ad81dd54b6bbaeca06511e-16.x/balena-jellyfish-metrics-2.0.166.tgz","_integrity":"sha512-hMc28XdcggzhpTsAhYxufzJeV+nACSejtPYwpS2vKAH2Oi++fDPfKUv3IghQZvjeM1FSggRlanaHkOZLVXOxbA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-17T01:06:40.700Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.65","@balena/jellyfish-environment":"^14.0.3","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.58","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.166_1663377008875_0.3915758080123892","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.167-renovate-node-16-x-b41942a0f57d90c4e22bcb886d676c3ae1f5c6e0":{"name":"@balena/jellyfish-metrics","version":"2.0.167-renovate-node-16-x-b41942a0f57d90c4e22bcb886d676c3ae1f5c6e0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.167-renovate-node-16-x-b41942a0f57d90c4e22bcb886d676c3ae1f5c6e0","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a54188a979758adc3d140bd5d7440f2e70b8ebd2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.167-renovate-node-16-x-b41942a0f57d90c4e22bcb886d676c3ae1f5c6e0.tgz","fileCount":17,"integrity":"sha512-msfN5FLGsKu9KugdKbX3JjX1ksSWIjlGXdvX7Mm5wKRNADxPCFy6gjOoPreZ0NcYs2Nd7oIGfDOSMcD4r8YiHA==","signatures":[{"sig":"MEQCIDr5FR5tm9LXCpNqgWSsKSEYOolVEawPgrquwuhIWR02AiBWJtCDdbzCVjBnrqNSEXpb9aqh+6AT7vcAxfDBwFdyow==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68128,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJR+dACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpPwA/8DUMehtvr17k/ux/NBML5GQwAKTAP3UIsJwvVoZdtkODSTRQ6\r\nuYToTBsVstZtnvpi8hE0MkZr/H2UWDBnpHvMaDUk6W5ZZVRG2a4HVUmeDNtR\r\nC/RLa5fvpgn9iQGJyJUG3dUabnx2NihIWR7VYY65dSWiaGdoftHT1BzgTM4R\r\nixu5Y7F7v9opRhYF+/yOfypYdlvES87KN2zT1A50cSecgghoishLEMWlQhI4\r\nqKxyqyR9kHdH4Bg59NmLyrR297AJk5QbH9jOAEexeX6tismo5uhRFtABpgCe\r\nNF5fuyOwAPuP89r8S8zc0JHF9kIVPHPvnL5uU0xYHIuDKfJuiP5Xv41t6VnW\r\nzFglHcGtHrim7ymY0rLrGu7w5KmNupP9M8fg4swvCZnXVcq4O7D4Kq8rLFVG\r\ntDS6aFjqzO8sRiOcQvB/kEXEmGSssy1W39XLzVDCijsBbJBN69rOpnIh3/e8\r\notlUS820+GKGo9VqHLVkD811rHfVthxT2icsewO2/3Lxik43cdsYTfafEeQL\r\nHmNDYa9MvDupCKPwVgmASQ/ATR9TSvtJx7WWLCSbKmOLxDjipTOJMNMS/QW8\r\nOSyBJ8jVjPuig8/WPTV2NzvSNd8OAXUTveW3OLBMNXiB8kpoH4gX0EtJpfVc\r\nxPVJDiCm4npXC246Yrl81eENL+X+JJmyz+Y=\r\n=MYPi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-b41942a0f57d90c4e22bcb886d676c3ae1f5c6e0-16.x/balena-jellyfish-metrics-2.0.167.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-b41942a0f57d90c4e22bcb886d676c3ae1f5c6e0-16.x/balena-jellyfish-metrics-2.0.167.tgz","_integrity":"sha512-msfN5FLGsKu9KugdKbX3JjX1ksSWIjlGXdvX7Mm5wKRNADxPCFy6gjOoPreZ0NcYs2Nd7oIGfDOSMcD4r8YiHA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-17T01:13:27.001Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.65","@balena/jellyfish-environment":"^14.0.3","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.167-renovate-node-16-x-b41942a0f57d90c4e22bcb886d676c3ae1f5c6e0_1663377309244_0.7488193864667672","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.167":{"name":"@balena/jellyfish-metrics","version":"2.0.167","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.167","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"693a77e74a1195aafa62bebf5f6a427770f50d6c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.167.tgz","fileCount":15,"integrity":"sha512-4qAejCbpgZf9zhkdFSX+DfyeY9CQMpg8EXVODwrvi3Yqvs5KkKYqgz0hZsmqiQJzbghYDG6JBPEW7NZ0SjiIEg==","signatures":[{"sig":"MEUCIBCoMRIQM6EE7WOBy4QR2ryx3e4UjMhOq+yAQPeOSqe3AiEAi24xuexabxyvUmNI7P9g9Jnh86pCCWqy6VSI0VOzbZw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJSA1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpnwA//U/2NlhmQm2HWCAVmOykzAUUT54P/kIFjL6cw1a3oO5z8w381\r\nA8Fl2DLlG3vrU3hNsJN7OsJI/cuawgibnCN4DA3YdMBf0sdPqZAopNfdhb89\r\nGf9DqpOtxLPdU/QnUjLgd3J4iJ/6YPsI+NUoCGocKjj4U/YaKR62B8jdA3kX\r\n05Mv69bRGQoMJpRPrlmFue/fqs1ATVsiIo87OBg5CGNykaHOFW+tE6pv0Bo3\r\ne7G5YLCM9wWwv93ip7GjUzYq9VWY1w1L0uu3xloi1u7Tt5DLwN2sKN6+tSSA\r\nnjb6bLPttk1XRKK3KmibmguW6kZZ4SYAlyaSc1HuNEMdHRvchU1EoyrwuZtL\r\nwGtNHw/UJ9F3Qq/uTg7938T8sw747PdJtOOwCCFVoSCx2rXS8dkeuGw4MAUv\r\nmQKcuti+XhSR+8uUH4RLN4tjvXk516Iu7s89SX7A6cHwX4/mVzdwlDnMhHjz\r\noWVeRVEW3+c7r1ZfUsny3HAbDzoCFAcUSnKmH5QgzCLtb9RJTHVdqnwT8w/I\r\n2zVyKTrzkoQW58szYTqzLeaO3r59kqbNdaoW8rYpAQFqAFrUX9xwssR7o5w5\r\nyubGN54RBvpf/ukgb+t8pyH3EsJfihpNV2NJKdhWOm7ltJ/yBQ1/S6PT90nv\r\nhuXw6Mt9eRCil5sYmpViPZDX6qTbOo0F+Tg=\r\n=+34U\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-b41942a0f57d90c4e22bcb886d676c3ae1f5c6e0-16.x/balena-jellyfish-metrics-2.0.167.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-b41942a0f57d90c4e22bcb886d676c3ae1f5c6e0-16.x/balena-jellyfish-metrics-2.0.167.tgz","_integrity":"sha512-4qAejCbpgZf9zhkdFSX+DfyeY9CQMpg8EXVODwrvi3Yqvs5KkKYqgz0hZsmqiQJzbghYDG6JBPEW7NZ0SjiIEg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-17T01:13:27.001Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.65","@balena/jellyfish-environment":"^14.0.3","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.167_1663377461236_0.6909375284245045","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.168-renovate-balena-jellyfish-environment-14-x-b194e72ad8ddf47b3a5ef788d73a480813072e96":{"name":"@balena/jellyfish-metrics","version":"2.0.168-renovate-balena-jellyfish-environment-14-x-b194e72ad8ddf47b3a5ef788d73a480813072e96","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.168-renovate-balena-jellyfish-environment-14-x-b194e72ad8ddf47b3a5ef788d73a480813072e96","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3ae5f91af4737a21af8eaf54f49fb0820db0faaa","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.168-renovate-balena-jellyfish-environment-14-x-b194e72ad8ddf47b3a5ef788d73a480813072e96.tgz","fileCount":17,"integrity":"sha512-ykk0qfD3UCBCvMHGFppAaxFzJh+2D4zCYT3hL8l5THvHPZ4fXiayz+vvcWkwP/wGIoi+GNfQNAC2r0/nZf61YQ==","signatures":[{"sig":"MEUCIFFZgBU3ZZWlLtvjS1GMMcAppVbqAJHCurb6NC0kE/zCAiEApNQGqdpvyvc7/m3NiyofAF0kyeX+tx6ymhlkjQqAfiY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJUkTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpnIQ//TE+VoFgYB9gv0/Is8eQl4cCwPKavU55jwv/TI3H7hVjRT/gw\r\nxIIDz3MqcwPMQOzjrMCLqKPh02gkfVINCxoTWuKIF7cRyqY8BsIMyiZHDV9I\r\n/IDwq7JcLu7mZC/qanguwsTommsJ7/Qz3wW/GeDXtQldeeub/ccfBhRgcXTf\r\nq35FXCRpm77cxktw+nKRyoZVwedNcR875ChFQ0gsfWH6sAXLQGnoFXVWec8R\r\npHdt0WkJXaQ98AfR5Hl8S/sLa72OBzMuOR3klDThclPBiEzn0BCRJetH5fDw\r\n9pDfAyB6gLAZjIo4lpgdmXxyI0jzrSrR4BH4iM+T+jwafJCZWI+7SVhN6YDM\r\n88uBwmbivFLZwvdIohLBuqFB9yHbxzjzXtJN0uVCdtaIyq6lQj0116JWdWye\r\nUN6J0YUN04bxk75GWOQmKSvYldT7wHFvG89H9bBj2ozgXuk6LBxjDhtlRsB4\r\nWDwx9kMgt/xrLb94VTRZqIcz9gLd/ZGcD3Gg9vaVrRxmQ9fcwzAVSNd3bz1H\r\nYyI7RUnGDxkBLKsHkMRLHsoSHh+nmB5uvy2iSYbiWxZYKDQEr0x9L8zzZd4v\r\nCwHin59rBESdJzdbodPH6urzn36hr9Z9aauCt93bC0ZmDjAJ2N6pceQHNyCx\r\nDEJNYD2UQZWb//fOJkpx+1ZhziARaG6mjRY=\r\n=87NA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-b194e72ad8ddf47b3a5ef788d73a480813072e96-16.x/balena-jellyfish-metrics-2.0.168.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-b194e72ad8ddf47b3a5ef788d73a480813072e96-16.x/balena-jellyfish-metrics-2.0.168.tgz","_integrity":"sha512-ykk0qfD3UCBCvMHGFppAaxFzJh+2D4zCYT3hL8l5THvHPZ4fXiayz+vvcWkwP/wGIoi+GNfQNAC2r0/nZf61YQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-17T04:10:46.955Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.65","@balena/jellyfish-environment":"^14.0.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.168-renovate-balena-jellyfish-environment-14-x-b194e72ad8ddf47b3a5ef788d73a480813072e96_1663387923423_0.2795072762655575","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.168":{"name":"@balena/jellyfish-metrics","version":"2.0.168","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.168","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f5d28fccb4b8a3a8e9916a33ca2a8324079fe97d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.168.tgz","fileCount":15,"integrity":"sha512-1lZP6SUstX7cgViPJYnc2Uzh2ioKuJ9yYJqZ6ApKJalPkwJ+rsyw/qqrrKyvdP8V+M+o03gKQZDW8oCSZDHZ+w==","signatures":[{"sig":"MEUCIQDZCfTSMWD6G/CaWBT/6drR+V/NUyDjxx6UgWONnaXT0gIgG0B6ycBs61R49/Ccw5Eeo0wS/AExpatxS/fuOxXStLQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJUmpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpe+xAAiWoG8K/On34UBHpxd4fuJcIX0Qj2egbD26JkvwgzEj4qlu8s\r\nLEd82NVK+B7gaxRk/2QS79UR0Z2c0W2h6spXFTjtWRRCxiPsuyhjPrue4z+W\r\nipl0LFoIBFaYKFZ8KQyE5Eu4wm3kcA8NLGFkMABnGC3nqk6pwDPulGxNMX38\r\nP2NE6RraGYINZgbpdxcVYzr+MbQ3BMjGtG+8iYtjCD3VqBjYE9qFTG+6sg3G\r\nU8ifKOoAW7Y5o8dSB1fmGqFlYMbQkrbL9z/TQZF5q2XkNZWjfhfNdICOi3wP\r\nJrElxfEtgru+wxiXNlDs+RLrIUXBG9W+/G6eL0QQaoNeQ/oF7sN6kR4Rtgd7\r\naBligBoumrf4ngv79MKjuFpuhuG7Vtr5ob23PeQ9CU6BqZwOaeNBkq1BMbbB\r\nmJVVd1RwXZE7riJ8zrKSbsKbYKnk5mRQERfUudkL5x/rGboGhpy9MxSIesal\r\naOC+O07H64jlEDat+FAS3e2FgdxMj7SZ1rHh2DGNB0YTolmBFmTHxEEHTCzH\r\nhzFg9qZlS5qOJ5nGQuIlDKc2nhT8hOHZHsL0uoCNedPdVhnJhExxySxZB2wn\r\nx1LchR7ZPs/fbTHWTb1G6n30GYMJ0uyJOfcZ14uao+qDReCAzR0Nn35udzy+\r\n7RfMhYM+FXI/kWDrMl/rYsVvYDTj6E+Cup0=\r\n=VBnL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-b194e72ad8ddf47b3a5ef788d73a480813072e96-16.x/balena-jellyfish-metrics-2.0.168.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-b194e72ad8ddf47b3a5ef788d73a480813072e96-16.x/balena-jellyfish-metrics-2.0.168.tgz","_integrity":"sha512-1lZP6SUstX7cgViPJYnc2Uzh2ioKuJ9yYJqZ6ApKJalPkwJ+rsyw/qqrrKyvdP8V+M+o03gKQZDW8oCSZDHZ+w==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-17T04:10:46.955Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.65","@balena/jellyfish-environment":"^14.0.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.168_1663388072783_0.6034873228958721","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.169-renovate-balena-jellyfish-logger-5-x-083c7e6e5f76fe51df742bbc36a23f2f0bf858c2":{"name":"@balena/jellyfish-metrics","version":"2.0.169-renovate-balena-jellyfish-logger-5-x-083c7e6e5f76fe51df742bbc36a23f2f0bf858c2","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.169-renovate-balena-jellyfish-logger-5-x-083c7e6e5f76fe51df742bbc36a23f2f0bf858c2","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"aadb245b2d5a7bec5b182433e27203927acea538","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.169-renovate-balena-jellyfish-logger-5-x-083c7e6e5f76fe51df742bbc36a23f2f0bf858c2.tgz","fileCount":17,"integrity":"sha512-ZhqR5gF6kDRWibgKKWOHtc1KxkrKgHMjFGQEiQep9h4nrp1q7s40e7dXaNUnocdvXuQOCzuTtlBzvgdZA+RksQ==","signatures":[{"sig":"MEYCIQDnmy41W4IJ6UMhBh+rlkYIIsJYf0VMTOrgCBLkepS3ngIhAPFcvuL8zqLkwuKPuWYWOYdqNkBDiBLgnRVs9ogFXoRN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68146,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJUp1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmreZw//TdkZ5KlFQvmcVJj14kl/o0O6dvjQqMXoj5xfERom2uCe8dBF\r\nQXwZhXPrrpzzaWYNt30v4DuQCHf0FIpcj/xEXdFWE1ko8k/ZyUnOdUkEE99J\r\n9LkAZ7JJR6PJxG9yX2jH9umDTWtzrizkvefj/uGTcHH3ouzwcEJpT17pn9x8\r\nU/baInDOWMELe7giKURNv/L+aQsZY1EpjPtNdRVCX8UO1zDacagg56LWAx7X\r\nM/zsDTgV58OyKm6K9a/R5r7lNuuAxLZBVah7qfeOv7PKwkMQ32fbatUAN5vv\r\nYhcPqDnqT3NLSyLuGCIHVR6VTHEJDebnNB5fCQF9oqIMl6V0NGz4MKy5Up0A\r\nMBXL694KZONHkqdRZc/yztoH29RNmetB4LGgJeszfifdta8KQAlRDMnSkQrb\r\n53I0uw+HUiK36OU7rDYelWO2Iee52r8voYQ4Pn5qC7j+2yDrU/x/r6g+M8vz\r\nLZMx5rTWjn4BOiaB7xI/zxjMxo35HFV2jaiJHSQYDqOaxyFVelVRD8FLSE6a\r\n8jYySB/2dQBed08mQP2HCQyHafijMUSyI0QgAIu/DppaIvPQw5L8jE/sQyLV\r\noUTTTp0UAzS01Gwt5ZTAVZxAAPgtHOG5Z2Bs2drX29f0hzdlQmg5cw2eCKFl\r\nWORk0oR/GGcJCxVDnX9Z+D0SuYEh42mk0ZM=\r\n=ENFM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-083c7e6e5f76fe51df742bbc36a23f2f0bf858c2-16.x/balena-jellyfish-metrics-2.0.169.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-083c7e6e5f76fe51df742bbc36a23f2f0bf858c2-16.x/balena-jellyfish-metrics-2.0.169.tgz","_integrity":"sha512-ZhqR5gF6kDRWibgKKWOHtc1KxkrKgHMjFGQEiQep9h4nrp1q7s40e7dXaNUnocdvXuQOCzuTtlBzvgdZA+RksQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-17T04:16:49.048Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.67","@balena/jellyfish-environment":"^14.0.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.169-renovate-balena-jellyfish-logger-5-x-083c7e6e5f76fe51df742bbc36a23f2f0bf858c2_1663388277303_0.1305381110142514","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.169":{"name":"@balena/jellyfish-metrics","version":"2.0.169","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.169","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"954fd20457612fb7a00b45eb6e9ac9e0bfcab0c6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.169.tgz","fileCount":15,"integrity":"sha512-cvSXKpwYgKtts6BATTesH4vw1CKCG0xLp1PmfGhymzWOV1BbZ1LvRmc26KtZa9xHXC4TO6WBBdAiS0eVySN0pA==","signatures":[{"sig":"MEUCIQCebQmRpRvmoXNeWhMCmY1/+Yk6e4msDFjCiInASJzziwIgS5mZf3XBbyMD7HbzoUOONhDoh65mmtARGsbgw+BfpxM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJUsBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoEzBAAgFtgkHWzoHIOKl68+ZsqDV9QvdRomQmBjz6YPlRUYu+hwfK+\r\njOun6XIg77YvilZImg6qbOMENJQEOxc6Qp76leEvJkF/10Eahjj1sK2SIG3g\r\niReu7BPeiYt9kvRLcge52ua3w09e8ccjg3sPMa3NI6SVGRPhG+74u9OpFfiu\r\nHUMygt3DrdD98W42wmbdOjzyhO/qJYeyajS8irUU5qAX5T3vVuos5wcNOyuV\r\npkszHJjmTcc/8uHQ2X1OxxC9PA5TjX237zen2oEXeEqsfmrT+5NySr+y8WZN\r\nD30tR3MeuXXw8AXHB1JFXb1wMvjRxwStfchgU7xrUgK8Sg02lbWiagSLueOc\r\nH1f3+OiOjJxrG2gMwXrQLDRW04e7sD9TY6wYlpqs9axqTxOSI6yY3eZV3gvw\r\nYyS+k1JeBT1PE607Urv3+yrvnfOm9YHO90ZRIW2ydUPC5OnhK8ixstFpr7o8\r\nOESdUKGg0DtpFYtMwWC75GBe0w67Fl/AjrC8CxUxkSd9TxFfFVjmJ0yiwv7F\r\npDyRSZmZvt3edRxkSeNDb8FmiGagwr5Bb/Q6qse2ccxPCI6qxxhIq9XHvQHD\r\nC0s0LUSaWXKslzycQh8Dv3Of9OzpuK7aW1pPq/wp7oh5mMXwJiB9jC4KW6JT\r\n2CIB+fwWAlr3v9+fgcAuuUMtZVCKj8t3ICY=\r\n=11D/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-083c7e6e5f76fe51df742bbc36a23f2f0bf858c2-16.x/balena-jellyfish-metrics-2.0.169.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-083c7e6e5f76fe51df742bbc36a23f2f0bf858c2-16.x/balena-jellyfish-metrics-2.0.169.tgz","_integrity":"sha512-cvSXKpwYgKtts6BATTesH4vw1CKCG0xLp1PmfGhymzWOV1BbZ1LvRmc26KtZa9xHXC4TO6WBBdAiS0eVySN0pA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-17T04:16:49.048Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.67","@balena/jellyfish-environment":"^14.0.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.169_1663388417610_0.4654097602622802","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.170-renovate-balena-jellyfish-logger-5-x-0df345ec9a44e6b933f4d0204c062d17a4a6496f":{"name":"@balena/jellyfish-metrics","version":"2.0.170-renovate-balena-jellyfish-logger-5-x-0df345ec9a44e6b933f4d0204c062d17a4a6496f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.170-renovate-balena-jellyfish-logger-5-x-0df345ec9a44e6b933f4d0204c062d17a4a6496f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b1cffa826a5ba70eb6123d941ac4be6f7b0511e0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.170-renovate-balena-jellyfish-logger-5-x-0df345ec9a44e6b933f4d0204c062d17a4a6496f.tgz","fileCount":17,"integrity":"sha512-ZhKsN02Wz7e+IhynjC/NG8wZqtPCXPhO+lO1e8ZSB0a3dbeuC+6RmdvylnmgitpW5cFYujUX+6p1bQHoq4nqLQ==","signatures":[{"sig":"MEUCIQDC6xQKCugSn/iEmIvtIbOBT3tYIDU+FiPHLrRQOUQECQIgWHehdut8OuiMc1UyxHT/RYCADlzOumyeglVNpj9kDQw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68146,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJZ51ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmotDxAAi2zZDI15HxN6NlO0pa7/UvshbJO43O15J7xMuNYwGC4lnDRD\r\nvoRuID4/eIVnevbfpHkuuXHqAL2b0j1Ju59++K3YQakRB2R+zIjY7jFtiCoB\r\n3LKgVPwB5HBNYuAFT5gXEoMDOPaqzrjJcyD4XnRuMPHghJfljroOdP6fzU1O\r\nOAgqIF3cdfXnLgF+ERiUQ4ddYMDSiDQHC0ltO3MEWQ2MZv8cyk6LgIL/QLXw\r\n/iNyYeQb9eoKaQgow6c4B1tq/BqW+iOyjITLUZi5/gvDRt38w2A1EEJITQLs\r\naW7pLxZLxpNBbym1vcPSkPgi/awQSrTkOI+b2WfPCRJ4cWSdzA3CeR1o659d\r\nIT9iGTDvTmBz9k28wiQuO7m5j6q8etauHrTofMMa+klppFToj7LHJhpFpPn2\r\nMMezQZR410P0v4X8gJCERyC4uKScUVe7eBCdTJiuHROTvf8MAEQ2EOKiYoOf\r\n4onZUnsEpZUeZp02Z+tIWo4RHLeBeuqyqG+5EClRkFSP+2PZ0vQg0ZpXjn4I\r\nWFB96Nkg+RD4ouR+i6krowAgPDO/9YBoTLzJT7WvsefdQUmcVUdVWVHWbI1H\r\nRWODaSwcpO3XRpVAYMuMdYWsmrpCConxeOfO6cTynmAgFcKWFhuRlxMbqAXS\r\ntPDaw6QQu9OtMjTwhE7vMF2rUm0OFRmDdX8=\r\n=5qrk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-0df345ec9a44e6b933f4d0204c062d17a4a6496f-16.x/balena-jellyfish-metrics-2.0.170.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-0df345ec9a44e6b933f4d0204c062d17a4a6496f-16.x/balena-jellyfish-metrics-2.0.170.tgz","_integrity":"sha512-ZhKsN02Wz7e+IhynjC/NG8wZqtPCXPhO+lO1e8ZSB0a3dbeuC+6RmdvylnmgitpW5cFYujUX+6p1bQHoq4nqLQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-17T10:15:09.871Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.68","@balena/jellyfish-environment":"^14.0.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.170-renovate-balena-jellyfish-logger-5-x-0df345ec9a44e6b933f4d0204c062d17a4a6496f_1663409781411_0.4245414076357785","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.170":{"name":"@balena/jellyfish-metrics","version":"2.0.170","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.170","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0423e599c6af053642398de27998315d5bee2a67","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.170.tgz","fileCount":15,"integrity":"sha512-Om2me10eStYWixiL0x97vlIOZTOZPk3NKudWqfwJHqpNDWsnbpVWwzrL9of94QaqgT9OMbVmYhrMPTof2bF8+w==","signatures":[{"sig":"MEQCIGiELM9cuqkQ5Pk3cnd2Y1IGt3fM7KKQ6JT50BEK44Q/AiBiuM9k+BCkbO6RCW80n5zqQbgl3WEi/WTvyF67o2jxpg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJZ8BACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmritg//RutS2fNpCKf24EGE0nNwNba8UaGyFmr4mAuPD6EauXKJ1+kw\r\nt7gRvyHicSvFSBLqLKwg+W5glRh7sYnEj9Ge8KFsTiZrzoSOOJa1QGjP9wKx\r\naefi4ibF0p3Uoqd8K7m5I05tP8pprBXFndCy29GTqGj8ZJIQ9v16emux//cG\r\nW96atSWLN5nauDYmCV8Xd1vFJ9lszO+Ql6eemMMzPChm5XC6RY0mO2QcJOLX\r\nsN/d9oMN9Zo0W+CPQM2D3KO3dNzO1oJXtpCwua/s5QJXinbhy9W/JeLPsdaI\r\nIcpE3AkrBqMwkmYg5bzWbXEjaaZ+UftGWstmnjK/PFetJw/RG6Jei/8ncnim\r\nKk2uRGX3hivMuFpxqa+O4P1BV6QlIr8c/w7pdEd2A3r9yImknBKJokOmGrbM\r\nKqVWXhlsVWO0mYLiLA3u3ZErw9PdIQ4aYuBZrcQI7ro3d3lNDw4yvY8oHhFO\r\n4rDtP/Bb2aYlrP1dILuxgpmLriV0M4poq1bPsMg31cPr9oum2U1XWtZft9xr\r\nqbOGn0sv33+oH4deQ7rbzPAni1pxU3AzV2FCi5Lfl0fsLXtqu7raOYoWxrm/\r\nCZgpTKQf43CIn+ahc9ciEMDIjkFzh4+Mt5En3nctTvSJHePWXpRQSzdfeQEn\r\nzAx3zS3g0dW2TBXvpwXIaVyUidso94C5rtw=\r\n=ZFRx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-0df345ec9a44e6b933f4d0204c062d17a4a6496f-16.x/balena-jellyfish-metrics-2.0.170.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-0df345ec9a44e6b933f4d0204c062d17a4a6496f-16.x/balena-jellyfish-metrics-2.0.170.tgz","_integrity":"sha512-Om2me10eStYWixiL0x97vlIOZTOZPk3NKudWqfwJHqpNDWsnbpVWwzrL9of94QaqgT9OMbVmYhrMPTof2bF8+w==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-17T10:15:09.871Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.68","@balena/jellyfish-environment":"^14.0.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.0","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.170_1663409921100_0.046695016034751236","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.171-renovate-ts-jest-29-x-a1c7a0e2d21a4577a96c03bf610f6a7db3ee1c9b":{"name":"@balena/jellyfish-metrics","version":"2.0.171-renovate-ts-jest-29-x-a1c7a0e2d21a4577a96c03bf610f6a7db3ee1c9b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.171-renovate-ts-jest-29-x-a1c7a0e2d21a4577a96c03bf610f6a7db3ee1c9b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7693ef0780db8d71e15003614c3e7fcf40ff889b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.171-renovate-ts-jest-29-x-a1c7a0e2d21a4577a96c03bf610f6a7db3ee1c9b.tgz","fileCount":17,"integrity":"sha512-Y5AZmpGFhAP/L6wgyGeWQ+ZhSOufOn7QPtrsh6EMPUXog1pX5lX0iImeGXfaIu6LWXZHkb/706KcB+2ReBmFog==","signatures":[{"sig":"MEUCIQD+3vY4mH/2maldD+Vrzi6HAuliqfYQBIBIEytY9H6DXQIgDYN61KefLskmBCyFMRSAQEHb4h8sr4AFd+6xrbOvVkk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68131,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJZ+3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrmYQ/+OCZYWz70RTgPDqTbWx4t9PgDRT7TgKkIFxuONZ0xgTuYOUcB\r\nV1htenByBbQ6DQrGqx4lVD02QQMSREA/7cvy2YxVKnMxPlIfMr2Pv3BeJuQt\r\nHe47qAW2ow8UDV2b/sRMVlIQb+VxO+N3K2LbKg/3Tj0J28pVCr64e3pupG7m\r\nKk0921Q0XucaFBNK5470qexWv1diH7eW40flGKCdqAT6QhMeOdS5gvsEQF7j\r\nOAUS2CO8hXaK+d96ctxfA8TRhJ0u20HqYfh9aS/7aHMRBlNixA0Mg3ToLJOf\r\nHTuAgB9oc1Bo8yDDLUjobLqdVFZVb8wY4OoaVPiZGC0ANjRyj7z1iPkY2AjQ\r\naakWQ/37HaRfXObVBZTPGu1IT21C+TP8z4BJGlZ8uWnVc55r1ymGgJUYvcXR\r\nMAa6GZas86fOCMBS0RprbzqzI7J9dYggW+dgG1H4PB//QUAiCMcFKOeQEAzU\r\nl3JCdLHzNznegYxNLNmuI+0Cjjgl3ctUWkzG3wiae2KnC+U3vidPU2jOjz9Q\r\nOhv6xllLyDRGv2nvsgQaA/aTtesKcspJVqMN/WYdIDfNFbQr++MgEQ9Y10nZ\r\nD9LyEYVRqFGQKTT6Cj0YsIDlj8XFWhIjfLe4KA3QNMJAZfe6QCTzfayB4D2U\r\nO6CRfSkWsaaZlaUzpLgagJoDrDiXxJf1r1E=\r\n=XV28\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-a1c7a0e2d21a4577a96c03bf610f6a7db3ee1c9b-16.x/balena-jellyfish-metrics-2.0.171.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-a1c7a0e2d21a4577a96c03bf610f6a7db3ee1c9b-16.x/balena-jellyfish-metrics-2.0.171.tgz","_integrity":"sha512-Y5AZmpGFhAP/L6wgyGeWQ+ZhSOufOn7QPtrsh6EMPUXog1pX5lX0iImeGXfaIu6LWXZHkb/706KcB+2ReBmFog==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-17T10:20:29.739Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.68","@balena/jellyfish-environment":"^14.0.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.1","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.171-renovate-ts-jest-29-x-a1c7a0e2d21a4577a96c03bf610f6a7db3ee1c9b_1663410103132_0.8542383918017931","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.171":{"name":"@balena/jellyfish-metrics","version":"2.0.171","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.171","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b6a8e8255ee27ab48e1b75b7559dfbfa540415cf","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.171.tgz","fileCount":15,"integrity":"sha512-r3WAtGEqweT1uwfLRnI8Mz0AGsEpPL7bydnD19SI7dJb5zV86fXQA//MIWOgzXSUdYKUd5vV0sRaieCynwOezg==","signatures":[{"sig":"MEUCIQCg2EXPTz5DiYbz9GzbqHBMTURY90H/IX/9+6IflxLk5AIgMSdPQGm6mh9cky2JR6k4lHQHvxq8K4OhNGBdqoENPv8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJaBDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqdHBAAjW5QP8rZCU9ZC9IH8bwAvTBcaYiK/8lA0Z8jteOFYwZNKBhz\r\nDmtiGduxRB9PlafWkhrUR+Pxek9q6QO5w28rCQHxpwGsj21lZgSWe8wqoDEA\r\nRMHzbLfSLyAM625E2yMay7fBFFKzCHihYx1+5dvYjO0mDIeyzVswxwNXsUvg\r\n30RTSIkjRbylFwfVT6APz+duPM2a/7/AGjRjf3YAKCso5Kj9178Clg84mix5\r\nifIyDjZQf9aSG/CEHwz3t+zUSkp3kWFT+W/CvjYbwkW+RosvfWkJV9cUIPYB\r\nLzcTE3/Ks02D9j9hYNsHV/lrAruTMnAEplMb3EOiih+fLfumi6yCtaVVZWVb\r\ns6lvro3XUggt8A8idtsKoLXAbII5m1Gq10/O1TVrY0q67nhcGORrSOuA9oVg\r\n9fTfPmtNHy7PWtAeryyzHBchaiN4KaJoz8LnmqFBS5M68CHXmaMcu7f3Ylop\r\n7eg0qhUjJGE7o1LCWvA0+tVS9L7r7pI+IUNcT6OuZT5lEMGDx5MgSImffBVI\r\n1yjnqbgsykeVkxJ6hNJXOW5opcVODEuFWEuDVrzqlp9Cc4QGGNmy/rq+e+xA\r\ncNuJAgM+RnN4nd59yKvV9wS7UKZw6itbU6aW5xtpXVjmvxIMtDEqkzm1N20a\r\neaj+w54b7CC6jk5/IZtO3TaIOFOE1yvyg2s=\r\n=rLlc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-a1c7a0e2d21a4577a96c03bf610f6a7db3ee1c9b-16.x/balena-jellyfish-metrics-2.0.171.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-a1c7a0e2d21a4577a96c03bf610f6a7db3ee1c9b-16.x/balena-jellyfish-metrics-2.0.171.tgz","_integrity":"sha512-r3WAtGEqweT1uwfLRnI8Mz0AGsEpPL7bydnD19SI7dJb5zV86fXQA//MIWOgzXSUdYKUd5vV0sRaieCynwOezg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-17T10:20:29.739Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.68","@balena/jellyfish-environment":"^14.0.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.1","typedoc":"^0.23.14","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.171_1663410243126_0.5536054548401808","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.172-renovate-typedoc-0-x-e90a8c047444912b3d07eb0d0ab5d738cdc8bc7c":{"name":"@balena/jellyfish-metrics","version":"2.0.172-renovate-typedoc-0-x-e90a8c047444912b3d07eb0d0ab5d738cdc8bc7c","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.172-renovate-typedoc-0-x-e90a8c047444912b3d07eb0d0ab5d738cdc8bc7c","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7dd87e014d2e3f3b38d84641f4963857025f0ae4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.172-renovate-typedoc-0-x-e90a8c047444912b3d07eb0d0ab5d738cdc8bc7c.tgz","fileCount":17,"integrity":"sha512-h9kod0melL6f0s3Bx/Vk2WpdDOb7xkHWUizEiSRFYUmxpAEpPU8Odfa6a9A7BzZZxbB+QSEhEqKDDHR45fy+eQ==","signatures":[{"sig":"MEUCIQD4iPfl6CmQHjUjnslwXN53/lZ0rvFaCcyBi3lex/YgwwIgb2qwTi3MWqVEhE+r0zizaVH6qXrLjkb2Rp6AczKFgdg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68130,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJ3YxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmokFw/9GsHLcyb95FE3Vmvn24SabdFEx2JayVxMB0ioDO4IlS65yT6u\r\nCzzYW3LvCHQ2xBIa12UAMceo65li8UAWxKkdAkcCR8/pvpA8JCGQtP93LWNw\r\nFFxi517a4rugihVCM7UwhhMfs9lx6oJBR1iOHt0SQ7UO5C5Ek7yFJMrZPy3c\r\nvns8XjJFjlMlYactc0xVmXsZMGEvxeZTKuwocEdMyyJlk6wx5wKLUqwvzT7V\r\nTSkIwQKdenii5x8tEGrx3fHgldgiTKhh6Dd07C8HzIL91qYwtwZJZ78PDKUb\r\nJ7+Ugs3VUnhuY1hOcuF8jgGzeot8q/jmkCRixdUdWs8aPYxz6b+FoxQwqCkE\r\nPf4dYdnzeObylQJhyfQ1YqckuePIyJv5U6xzSkwPOS7S2Q6p8Tf0EegkdGVr\r\nJKCE8uXfQBbfRWAqsWGTVU0KEZsYeiXhD4XEIuGife9a80YE/TAlYRFIvmgt\r\nT4iP0kF07HM+AtC7LwLUU8KBkxgbSerlxJJvjj9feoWAcK+CtpJQF6O8Q7f5\r\nyK4fZOCoJsxCEHWeO4gSIBXxrpL5mz5+YG2fuikE6XMePu7oGMwlql17m05K\r\nBW86loHBNyWNGM5+eRNvViEbUUz/BT/HuvF7T+Y8gm3IchfQsy9BczKtm+oX\r\nPJ5ToevwzCZ/Qhvaen/s//Hiri3iPY/IMFM=\r\n=ldi/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-e90a8c047444912b3d07eb0d0ab5d738cdc8bc7c-16.x/balena-jellyfish-metrics-2.0.172.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-e90a8c047444912b3d07eb0d0ab5d738cdc8bc7c-16.x/balena-jellyfish-metrics-2.0.172.tgz","_integrity":"sha512-h9kod0melL6f0s3Bx/Vk2WpdDOb7xkHWUizEiSRFYUmxpAEpPU8Odfa6a9A7BzZZxbB+QSEhEqKDDHR45fy+eQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-18T19:47:41.656Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.68","@balena/jellyfish-environment":"^14.0.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.1","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.172-renovate-typedoc-0-x-e90a8c047444912b3d07eb0d0ab5d738cdc8bc7c_1663530545611_0.07010430660687694","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.172":{"name":"@balena/jellyfish-metrics","version":"2.0.172","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.172","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6e069d0751de588aa0d29405fc885af05e974cf3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.172.tgz","fileCount":15,"integrity":"sha512-YBIzV7pHotXacUS+w+YwfQSl+kyUzCw+Ms2GWd7F+MzLeSXelNCV8HX9SO9u9Hz+UP7W8pW5+Fl5npRStWtucw==","signatures":[{"sig":"MEUCIQCyOYwq9myOU0UXnUT96HvjMYKIsbuCIQdPr17X/YwI4QIgPPyXnrTBqFyGomnba6aVHjTuedHAHM7ziXG7byMTAlk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJ3arACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqHkw//RiyAEfT1hO5TpOpqvjyHpchWgZ7PNzgQUr/IADwcWIKjIuyE\r\n3F5vXmdLG+ONVosRsi23Gq3GRFEEiIenoB4IOesYUINo4UO+hT4iJ7p8Y67x\r\nfHnBLe2QDEakkRqUDWL5iGQT4LtAVWF1x4ENEFPIdi8qM34FIDIXnbln/ujN\r\neFY6H0IyWFOZGcb2WyhgA81tV2gMMKmINyWDD/yp5ml9iYOcmpjYwT0Md6IF\r\nflZSVQvGoHgE2v9jRorEks756ZnHbF2A6uRuYQtW22OLxOtUzOVFzGEZRQdN\r\nC01reyNBBPb6cFGZ8gsQSgDZwXBiuEYwGQkUeFLzD5dKGwwBBtdgDGIg5kNh\r\nfe/JVFOEBMcCbTHtnxy+NNK/mpSvRVDSlFbblFjIEvIeT2MtC4JuP7hv3ZDq\r\nYOzPhx6aJ7MnDSH+TzqZZYVpujwVvtTaZdq+zx/lwKuj/rjkdn2wBJ6LRrzI\r\nwxjJSzuzCNb5Me+lGQByKawqPg8z9XrtOs7hNqSIalcIhXU46MVKVs7/ITvz\r\nO3L4QM3oivUbFBYWPWJ7uc/pcO99bJ3zIQ0Kh3wGcHDwY9pNYDl8VfIez21d\r\nv5O0CSU6WG/ITGFVGWJaT+VZgDAIcEI/xLlc0emRgI4eprA/LgwMqfmbUnER\r\nLOOyupDPYq2+TpipnPuzmn96cqrt3L9t2pw=\r\n=kLUW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-e90a8c047444912b3d07eb0d0ab5d738cdc8bc7c-16.x/balena-jellyfish-metrics-2.0.172.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-e90a8c047444912b3d07eb0d0ab5d738cdc8bc7c-16.x/balena-jellyfish-metrics-2.0.172.tgz","_integrity":"sha512-YBIzV7pHotXacUS+w+YwfQSl+kyUzCw+Ms2GWd7F+MzLeSXelNCV8HX9SO9u9Hz+UP7W8pW5+Fl5npRStWtucw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-18T19:47:41.656Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.68","@balena/jellyfish-environment":"^14.0.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.1","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.172_1663530666853_0.5377218206918866","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.173-renovate-balena-jellyfish-environment-14-x-cf0855d234b66a5302ebe91d6c0564a4bb14ce19":{"name":"@balena/jellyfish-metrics","version":"2.0.173-renovate-balena-jellyfish-environment-14-x-cf0855d234b66a5302ebe91d6c0564a4bb14ce19","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.173-renovate-balena-jellyfish-environment-14-x-cf0855d234b66a5302ebe91d6c0564a4bb14ce19","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8fb1c57a198766e847500e0cc39a90eacd045df1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.173-renovate-balena-jellyfish-environment-14-x-cf0855d234b66a5302ebe91d6c0564a4bb14ce19.tgz","fileCount":17,"integrity":"sha512-RVdGYvy0yrkLUjdNP1ENOTS/n9ERpFX7Xcp3hFP2qPwAvRQlZCagcc0YWxileqfTGMYEoNn1w7GY7TFsDL86/A==","signatures":[{"sig":"MEUCIQDvknD8WqP3oBXY7L97ZxjXczFQRgW+E/Cbf5npUvKO4wIgJsbCTN2tgf/u2c3onlFaKJweZoRnwhq+FZHJOT0IESQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJ5xLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpnzxAAgo1QYwID4VacTQKrXSBJzm+vEo5Ux6+4EIycSGR7igUTyR5u\r\ndvpSWPOlCil9+4XLYI7ia+0xYnTgzU2FlF/V/cCs/IGdY86KSvbnlrmUTth/\r\nGV3G0BF+a49PgEl0v1Y8TGb590kekgm65KrakjdK4g2bjV/xUKLHWMy9Efd1\r\nWXw5d+gES9lXI1KITukzQIiOl4u8KtiDyC4evYCm6eExa4N/CDI6x3BwBeU+\r\neEtEkLymSSwk21kBUcmVxCgrPsRWNSIVu1L0ydmM7aH++h9r9QeERT0h9EAB\r\nU2TC8u8agSTFnT+nXJ5F1MYnq/+6Mcz8+/ab9KSsZGApg5ln3OBcugAAGPyT\r\nKdINwy+DiG6R4q5MoSOKlSUBdiYMFSWfJfO7beGootiFmqYocxi6ggONpQIY\r\nSFETnUinfWtsbotnyX5+NRHrUw50y9djNagDmUjSVwNNZ72zVk3hDdOxOFMA\r\n0DC56brQY5W/M6OoHiqVMRv42B2UgCqFqWG5JTuSPgDcobr+yTOevprqoveB\r\nB55Y8npxbpLhedtAXMXeIWHp2XKcZ6habTnW7RZ7w7Jdh7G+qsv/XDOVDBTL\r\nc93F9sMtkWTT0ET1KSunQm/2NkM8EBwNgXhTa5WhHlpBfGr828gY1FoaSUPs\r\nfyimdlkq6CWRad9Pvt+gMu4MMlG81qtyu9s=\r\n=5kPg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-cf0855d234b66a5302ebe91d6c0564a4bb14ce19-16.x/balena-jellyfish-metrics-2.0.173.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-cf0855d234b66a5302ebe91d6c0564a4bb14ce19-16.x/balena-jellyfish-metrics-2.0.173.tgz","_integrity":"sha512-RVdGYvy0yrkLUjdNP1ENOTS/n9ERpFX7Xcp3hFP2qPwAvRQlZCagcc0YWxileqfTGMYEoNn1w7GY7TFsDL86/A==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-18T22:29:56.439Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.68","@balena/jellyfish-environment":"^14.0.6","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.1","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.173-renovate-balena-jellyfish-environment-14-x-cf0855d234b66a5302ebe91d6c0564a4bb14ce19_1663540298897_0.36317508165143053","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.173":{"name":"@balena/jellyfish-metrics","version":"2.0.173","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.173","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3b28cccf660ce6f0cec06a46a7aca5f6cf653f17","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.173.tgz","fileCount":15,"integrity":"sha512-imPhNS3VY/LemjSMWShdOHJiip+aXZ+6Eyc6ddrGc9zm2sVazR2l2Rt/AkMrawaWgZY3xxDvafyZ4UGaGPAYSA==","signatures":[{"sig":"MEQCIDq8pmi6qVnHrz5mi6ifftTnPmr0vIaannzuHndf19rDAiAbiLcZ6tCFdy7vQTop7JpIu8M0E4dMsZbyF9CaIOjDiQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJ5zJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmowDg//Z7odE4XQM7e5/2aAzeag+BSk9p8j4iMRnhfIzJqjTgM2OLBb\r\nHBRpGnTFaUi/0QEg4ctnpc4qvlYW1wSo63LSU8wPC/KYSUFrAtJ1DjRpj8CU\r\n4RWw5BJUbIR/yHsITN9k0xD7bAlUzGC9eDwNfvwmUaui2jrkwk1WFyzu3MDt\r\nZhdVab5gn14uoSgcZ0+GQMZE8wGGXmZldVoxYEDY6DEFBKIKVV9KFP0W4tGh\r\njlzVOIXeaZwWyALj8YCCXk+g6dJL3uik+aCj5RCamIOOffm1viwvFmKLsY+n\r\nyyVGYTTZpvwzL/Cb9fIW5ZxQDX8hlLwRK2vRdC1EPwn0RGaJjrNIzP/gklUU\r\nZZHxJW5BPhmh7SoIiSR8RNuaOP3w6jvKjDyXgpWXTchJjZXehRmyu0DqqluK\r\n7Pn7fg5Xyyu71VVgcUAN9yWdw0UsnHuxCVrRBhfPVMfWnGP7idN597kGoknW\r\nMM8++WnFAXuC3foX/oK6Qt3UW0mTUYFTM0I8uzowBE5DObXDxrM2TPF2EhX+\r\nH3Yu6IxpGwymZS/HLurz0jOthLDKsv2uDtcMHIaNLtC1wqwEQZaL/O0ls5OG\r\nw+ENb6Zu4rdJJ2y/zFkslSd9qRS0axcsHa+yWsxeUnpDqHXuUmjtJE+nJO7S\r\nzd1AU1V/Y6Dx3mB23/T1omQjz6mET301B2Y=\r\n=oTH5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-cf0855d234b66a5302ebe91d6c0564a4bb14ce19-16.x/balena-jellyfish-metrics-2.0.173.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-cf0855d234b66a5302ebe91d6c0564a4bb14ce19-16.x/balena-jellyfish-metrics-2.0.173.tgz","_integrity":"sha512-imPhNS3VY/LemjSMWShdOHJiip+aXZ+6Eyc6ddrGc9zm2sVazR2l2Rt/AkMrawaWgZY3xxDvafyZ4UGaGPAYSA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-18T22:29:56.439Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.68","@balena/jellyfish-environment":"^14.0.6","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.1","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.173_1663540424994_0.7944633522234921","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.174-renovate-balena-jellyfish-logger-5-x-098c9920ab803ac9da6739926f7183d4f24178ad":{"name":"@balena/jellyfish-metrics","version":"2.0.174-renovate-balena-jellyfish-logger-5-x-098c9920ab803ac9da6739926f7183d4f24178ad","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.174-renovate-balena-jellyfish-logger-5-x-098c9920ab803ac9da6739926f7183d4f24178ad","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d74f20d8997daa30cb55d4daffe804aa4cfea0f2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.174-renovate-balena-jellyfish-logger-5-x-098c9920ab803ac9da6739926f7183d4f24178ad.tgz","fileCount":17,"integrity":"sha512-O6VEHhzlpU6zDr9brxPk+BP/0EIfTZlKBIyeLjpFkQP7kyLaevI2msJiSEvy1EJKkhgOFegDdJarQU0k5xsYWQ==","signatures":[{"sig":"MEUCIQCw1lERiaavaIWqWMgtiuMdm2nHDJK1CzUhmPpUnIv8CgIgOeEl39PFPRRngt6Stkn/19zn6rIhEJ77eZuS3Jsm16g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68146,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJ512ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqCDw/+J7/9fjJ/KLgAGgYwLka/v5lHbgP/3Llzak0cQX/UsTZCnhso\r\nSflB1rC+s6PdZakfPxrNB77J0UgiyalNUTpgIegx/hTdg1TQfP1qAxtCuPW5\r\ndrhoEbT0C/W3ZOjrXZmNLDwXNr5WGvNY3pR5aRWoK0sFHzK3Qgdh/ju9lUI9\r\nuTUKM/UJDTcD5FHspQU4HgcmrhTB6eKOfbR5R4j2d4naaZPxRMRdb8OdbE2I\r\nGl1nnxo5jjupb5baHhAF7GYO6sjFXVu8eqDDYWrxsohzesAvxQHykatqv4tR\r\nyyCy25KLELBeUBdhe+J2r7GoYYIwoFzF9nxnBHP7SKZr7Odc6LLCxFCwbsVz\r\nHEBPB6pqYLQBuptMnm2xAPlFW226f+mukC44K4LyrW6mn5h95+I9v9gRDmwn\r\nNKL8vF4tvPR/jwTMI/NMQlEBlrBykBQZXz7sJ3N8wfNSLYveIfMFQt7gCoQQ\r\nzsKR02dpJiLqAtYZCC7pNifdiV+s4za1G14FTvSHLVmifusAthsEhwu1pVq0\r\n6Cts+mTk27lVqX8f5tWf3iwQM/p69QqlRC8MN4iZLus/Kqe3GOb4H5P29LHp\r\nhixvOnzUc5l6jzXktTfVjkHV0fdg2T3hZt3Mb0mDl3seXzXfQ5DXi+CuFHW8\r\nEiqN9EdsmbPMZGgNVBG1a2Ii0Lx+wxJkKig=\r\n=3QXz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-098c9920ab803ac9da6739926f7183d4f24178ad-16.x/balena-jellyfish-metrics-2.0.174.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-098c9920ab803ac9da6739926f7183d4f24178ad-16.x/balena-jellyfish-metrics-2.0.174.tgz","_integrity":"sha512-O6VEHhzlpU6zDr9brxPk+BP/0EIfTZlKBIyeLjpFkQP7kyLaevI2msJiSEvy1EJKkhgOFegDdJarQU0k5xsYWQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-18T22:35:15.448Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.70","@balena/jellyfish-environment":"^14.0.6","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.1","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.174-renovate-balena-jellyfish-logger-5-x-098c9920ab803ac9da6739926f7183d4f24178ad_1663540598337_0.870219294238352","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.174":{"name":"@balena/jellyfish-metrics","version":"2.0.174","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.174","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"11a5777b36ec56d26c1e66ee8c3f1d4b316158f6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.174.tgz","fileCount":15,"integrity":"sha512-7rIxJFER/bXNg59LFK0eRnkjP0lRtlSDT1jtKQPnYG7xiswkDoq3xN3UAt7VaMjMufk3sKAiNIQIPK1/OB1+4A==","signatures":[{"sig":"MEUCIQCsBA9PDqQzKWMlprD56KPcvNKt73dcFpky0V7AG//2AwIgBR66nIa9RuSzfnGSDAFE6xhc9P1+8JSVOc5gIo2ujEw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJ539ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoL3RAAmmPwVUslnT+ln8/cZVE2rZIt4gK+plMO0oaW46R492/h5v50\r\n4eSL2+rhgm9+RztHqS9HIJ+TmcQed9L78JWvdNfXAGiq4351PcVkhfXp1ExK\r\n7hoA8RPDwUp2uYlVSCu+wJ1olbDrJ3MKOEiVcSvgC8MVUKfrZ4gPFVY1Kpfw\r\nsS/0JwQO7Gp2sxPPqpL5uTosqCKv9yVYgppxIEWfS1mwHrFnqBhfBYsCdaRa\r\n/RQAOKFjqkeHLKJ/c9ZPuP3HLmPTswbSF3x5+55nTFlagULm9ZeO7jKnY6Yb\r\nKcRkrb+vx4icLvs7W1FSOJkHcqqnHUPYC6qtx4xfx30BDd53agZN1HU6l/Y4\r\nj+s7MBQOttVjf5CvSd25EhxaazvMHG73d/jm5vYuS6v4iPBgqLTnVgVnycQM\r\nxGumGvxQb5ZpoxqOf+XAqzsopbxyAW1Z18gEY/96DLRlgg67J9iWSsQeGxsv\r\nV8kZBrB1SJUoy6pmGDpWeVuvTs7hUGlzWT7S1rpVZA9x6YuYhSLPQnOXRGag\r\nzrydVI+d6/gmG0y59KVcE4weRVCBKTQUrHQE701RMv0yVXUDXh6WxQel+bLn\r\nhLYIkHOPI2IKQySHE/OI1ntPbFOqInd6jupn0AcToa5i7yRmCw8PkCrmL0z7\r\n0yOk02rm0QkyPDNiuCNQlOO0leK7pFFcQng=\r\n=yLdO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-098c9920ab803ac9da6739926f7183d4f24178ad-16.x/balena-jellyfish-metrics-2.0.174.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-098c9920ab803ac9da6739926f7183d4f24178ad-16.x/balena-jellyfish-metrics-2.0.174.tgz","_integrity":"sha512-7rIxJFER/bXNg59LFK0eRnkjP0lRtlSDT1jtKQPnYG7xiswkDoq3xN3UAt7VaMjMufk3sKAiNIQIPK1/OB1+4A==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-18T22:35:15.448Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.70","@balena/jellyfish-environment":"^14.0.6","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.1","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.174_1663540733437_0.3040302989310675","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.175-renovate-balena-jellyfish-logger-5-x-28a8af0f07f086ec42e7adb7cc41a5b6ab78a02d":{"name":"@balena/jellyfish-metrics","version":"2.0.175-renovate-balena-jellyfish-logger-5-x-28a8af0f07f086ec42e7adb7cc41a5b6ab78a02d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.175-renovate-balena-jellyfish-logger-5-x-28a8af0f07f086ec42e7adb7cc41a5b6ab78a02d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"38c015bb45c778594feb492aac9e00d15e31b948","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.175-renovate-balena-jellyfish-logger-5-x-28a8af0f07f086ec42e7adb7cc41a5b6ab78a02d.tgz","fileCount":17,"integrity":"sha512-l+9WJRCDWG7CpH1b5vEY+yOjymwHPHfQmbgBSrqhbKLPsSXfNuc6/cHXNDUoZx5KeYZMx3LYY25YvbFiCymsEQ==","signatures":[{"sig":"MEUCIDWPOBRW4ZysN7lsYJasS7CMdxGhJrK9w0A7dVlbP64aAiEAiz8fmQQr7oE+nbOFaDvxEXhSdwpGvXAw0Z4D3tJbgvo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68146,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJ8heACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqMiA/8DcyFt2tB+TsdL+P45KKjvuVvN4cTnpPg1it4AxBuFntagOM7\r\n/fQSS7tf9OEAg38CR54O9u9+f1+d+30TVrmKsGluDq4h1qIadLV87sy21Kwb\r\n+uxh7J1AAQwB/uYVPzu5zEGtNBRRUeTfBb0sJk1RVRZkOwQVR7edMRnLrxXV\r\n3Y93KNspAkhshwv1MgTgk9+MxDz8UhJst8IT8T1WYS5y6IiqEUBKw/ROQHAJ\r\nW7E84if2U4xofi25jO9yM/qRxUnpL8sQhlKSfjdvOgvrazQx1QkHGjFREU6H\r\nrrcjVd3S4qpU/ydZ1Qa//RchLRxEPbFyJfy92N/7xs99qItzXlsQ06plGLWM\r\nE4GLcivd9GVy3ARnsk0oC+iPSatphHp/DuCnkOvyD4WH4HdLsAMVpzzTBshq\r\nPVJG4U25Msj2ACyBxh/oD7E63RZqd3zFlOBcugxxDB+otsm7qOhM5XlpfsAN\r\n6/2/qyaY4NHMaU/kSKyjzXN4W2RWWPa1znppTKvsg4wv2NnXr9RZtc5OGMa7\r\nYtMrvVnPNfzBMO9QU0dyW30nRrYhw1o5H260/xr/UUXYX+stTwPZiq9lLdLa\r\nkifpckA/GnuIEYy+klGLVXW8dZyVMroynLPTRXcqNlbDiy/VuKnP/UuJQMcE\r\n8EYDX1rrE1xWmsjojUBB0qHAIAlBe5/4VH0=\r\n=u3FZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-28a8af0f07f086ec42e7adb7cc41a5b6ab78a02d-16.x/balena-jellyfish-metrics-2.0.175.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-28a8af0f07f086ec42e7adb7cc41a5b6ab78a02d-16.x/balena-jellyfish-metrics-2.0.175.tgz","_integrity":"sha512-l+9WJRCDWG7CpH1b5vEY+yOjymwHPHfQmbgBSrqhbKLPsSXfNuc6/cHXNDUoZx5KeYZMx3LYY25YvbFiCymsEQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-19T01:38:22.309Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.71","@balena/jellyfish-environment":"^14.0.6","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.1","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.175-renovate-balena-jellyfish-logger-5-x-28a8af0f07f086ec42e7adb7cc41a5b6ab78a02d_1663551581955_0.970983470714033","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.175":{"name":"@balena/jellyfish-metrics","version":"2.0.175","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.175","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1cff0efa2212ef39f594fc3d3bafadabb1d7b382","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.175.tgz","fileCount":15,"integrity":"sha512-luSoYqkPTkdsq3GV4dxDyvJJClpNGbDpDuMWzTK5k7IGBKQcsyQwGz9Ure85uDs5gO9rSYzOeP1Sj3pY92J7oQ==","signatures":[{"sig":"MEQCIGuVzj/RzPKxXFdMvZEZMDpHcp+1gkmwHxvFUz4xAjUVAiBBiuCvX+Giv/FpBwUerFmPkGza8HywrzV2LOtaOuzD4g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJ8kJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrqgRAAgO1pK7WD6z38Mno3kVX/Ir0RC+6iKSZyGWkN2qqo/WBatmLP\r\nmHtoj4SA4+gYpFxVV4RdxpX2/mPsFhXatZs//BkGNpB+c8+KiyTMcR09f5pV\r\n5nKUBJc3+mVfzbN5b4R3YARnb/9YsgJN7CUzAdHusPnHsA/evCi6T6BUxQlU\r\nDYzuJUeFXzFmmZ+4tvpHe80MFXFJ3mq2eVN9hmDGDy5joyNSWiUP88/folHD\r\nA/SNTEYWWm3w70CetsTkTIZEbaEuCWHZ33vIQULqyz3zqovmGwm8VhB7PoAW\r\nKcGmdxEY4fJorA/WlVesYchA4dnnfHFMFIkdG3dSXfnJ+USaEIAypeBSqbew\r\n7oUg17O+0is90rZBF/WqMzdM3/RKN5ksyH3KZkFvDNs3hrxnOWzV2sjhbq1D\r\nMU9pZgeCLlI7KC2ciLGVZfKg1ffhKmPfeAcZcqFWfcQ4VttvEa9CpxZ5ZE+E\r\n1Ef56DKd3vW3dflXs8t6w0jS6GGPZG0XEinFkUc2Pt0KkBjTmBBExIcXN5nD\r\n1gZAEtnvUUx/crNK5m1sMyDPh3+zAiEHQmGp1IX9vqEwTYFugoGnm/QOsLqD\r\nkeAjADIvWvb8Yi/PatGp3jFjGSRS3GI77Yglq7TuUzyS3P5KbvjdyB1xvnq9\r\nty6XvokO3DDSZd+ahUwKFoQd3U16zRXd63w=\r\n=MToL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-28a8af0f07f086ec42e7adb7cc41a5b6ab78a02d-16.x/balena-jellyfish-metrics-2.0.175.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-28a8af0f07f086ec42e7adb7cc41a5b6ab78a02d-16.x/balena-jellyfish-metrics-2.0.175.tgz","_integrity":"sha512-luSoYqkPTkdsq3GV4dxDyvJJClpNGbDpDuMWzTK5k7IGBKQcsyQwGz9Ure85uDs5gO9rSYzOeP1Sj3pY92J7oQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-19T01:38:22.309Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.71","@balena/jellyfish-environment":"^14.0.6","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.1","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.175_1663551752844_0.9155265476104812","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.176-joshbwlng-nvmrc-7b4361611571696657459bbabc79a21717f57f3f":{"name":"@balena/jellyfish-metrics","version":"2.0.176-joshbwlng-nvmrc-7b4361611571696657459bbabc79a21717f57f3f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.176-joshbwlng-nvmrc-7b4361611571696657459bbabc79a21717f57f3f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bbdff85c3792b59f7db60a3b8269b5797347d6cd","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.176-joshbwlng-nvmrc-7b4361611571696657459bbabc79a21717f57f3f.tgz","fileCount":17,"integrity":"sha512-mtbz66h3NMDUZ4k++IypGnfTc8PE5/zxtFg4HDkA/PdTh3Fg6qNoiuapQdwZukVxAzMAxMb8kQX4SapS+iTMyg==","signatures":[{"sig":"MEUCIHFT6CWnqmrNzkNTBgwVzu3UQlj48HUfLhKlqcdlYau8AiEAkrMa2W932SVC6+nP4ttgx3BE2sC/fxvJBpwB3origHk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68125,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJ+1qACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo2xQ/9FOPZnTsEVJoYowClk3cr1Iw7nhS9M8CUJy4JDFvCz8LfybnG\r\n2SOYyKw4tWOFVZ+gQ22Ww+aF12nvDH8xdwNSFaHeYqqQhnC5clRWL7Xk68zV\r\nCRn9B/sY4+fPHQiEp8WD92g1yAJ3azSrMcE68dw8p1AcSfL8m28gxJfM5c5Z\r\n92gS6upaS/gwIyddYwaq09iTgvhNgHE/A4Re9VxRORkkPfvXp4n0FAZ4jnLn\r\ne1DgzbkomGYCTqX/7zPIeue0ngBK1vnaR6ksVNE2xV1j+vTzvVOImxmCLDo7\r\nYiuYOpR8soOW4VygHAm3QmxJ4yL9WH+7MoOlr3mPBq8+d4pPbqPAjgQYmyXB\r\nTA6tknj30z2f5yIAJIrR5ZBRBDoWDFGetSGXJFkXJNCm4X9txAKf/OHcJ+us\r\nohCe3h+8L3BLpeRr+L3vqJ/YZZzI6xdnml0pOtQgevB7U/36Bqj4Bl4KPJSs\r\ncHivermYQfIsalWlAgDQVb1uyM8goz3+LO9oihV5aDWyULfcS/7/40JQBJOM\r\ng0ouusQZ8fGaLJWLC8Xg831T1B4AFcjKGGBTq2tT8Qwcl2tz4fv7DYWyftId\r\nInxoImiWKCZschJID8/+SBmCKDEpryZN6eBskDBC08QfE/QDSBz89sM0bLA+\r\n/LxJ0jE8SdE4XHgDBNUXvQ1TN2Mu8WL9s8o=\r\n=KFNA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-7b4361611571696657459bbabc79a21717f57f3f-16.x/balena-jellyfish-metrics-2.0.176.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-7b4361611571696657459bbabc79a21717f57f3f-16.x/balena-jellyfish-metrics-2.0.176.tgz","_integrity":"sha512-mtbz66h3NMDUZ4k++IypGnfTc8PE5/zxtFg4HDkA/PdTh3Fg6qNoiuapQdwZukVxAzMAxMb8kQX4SapS+iTMyg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-19T04:16:25.149Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.71","@balena/jellyfish-environment":"^14.0.6","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.1","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.176-joshbwlng-nvmrc-7b4361611571696657459bbabc79a21717f57f3f_1663561065827_0.8272336970251788","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.176":{"name":"@balena/jellyfish-metrics","version":"2.0.176","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.176","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"412e6e45a50f7dcc8ab9ac024cdcc92351ef9c3b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.176.tgz","fileCount":15,"integrity":"sha512-dyQafXjmVbpkUUF2SafuEqfX0J1bxhqc5gTtoZ1c+jt+Pr8DkSdryhehGtT31/P4BNK4hG0NROIz2DpB0uG39Q==","signatures":[{"sig":"MEYCIQDDt42/9Ag5LaPBiiZlFvzzTBSqesfEG30qehXablw4rwIhAIQNsu7x4lG9hPDTO+ATD80JA3OeNCon/4jPV3KCFZrs","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJ+4FACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo8NA//ReDbgWD89ukcNQuymU8QJ2sSeSwnIVIVRfIANg/vT1Pm44Io\r\nlkC9qOUZU7AlnPLplIxNfSkfnownkB0qOxp2HWQs51gMg1J/QdVwnNTqtxTV\r\n5sypecuxefODo0fMyam0VwmVNARa0YI5LtcumzfGDl4MLhR83GSsYSoUAgCq\r\nBsQ32XBxIoa0OvTuTMfr6RNBL5lmiesJKRxHNT8tE693aso6mmVZLX+euQuX\r\nsuDPy2VyHIVRIHPIk9NSyXc3debzicOlgrGhoiGyAppr56L6hya03vuzFnrM\r\nBq5KCjZ4xCP6qcrNvx8w5SbI61O0pro6PyayN4jTrINu/1owuAYV8pnpDUs1\r\nbzTtoLZcJcvedV5M1wzweqp22H3VrKUiCR5MlN7rNZIH4dTnNt0pvwZJZFXM\r\nQTDLTYj7rYAFrtdk1Y4Y67vCcWTwpa7LgKj2n6N7WHXPytLSDAxeb065s91y\r\nukvS6A3DWAYQgnIUzqteoPBvGGjYRiztuocaXkx7S9FoflSA1m8pW4NqNB+b\r\nnuNmO6GIF/drhPB01HQorwM+fiM4/9q+GUEEphH86hdf575118Yf1t+RB7xq\r\nCyRSANhqI5CRXzNFubWzbLKuT4RKpH4dZs2kZ8qaX6qq9k7X5XoWYPri7bBX\r\nUjO3KLxfbk4s/rwsdLBYyADmnbKPw5PP9K8=\r\n=IyUF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-7b4361611571696657459bbabc79a21717f57f3f-16.x/balena-jellyfish-metrics-2.0.176.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-7b4361611571696657459bbabc79a21717f57f3f-16.x/balena-jellyfish-metrics-2.0.176.tgz","_integrity":"sha512-dyQafXjmVbpkUUF2SafuEqfX0J1bxhqc5gTtoZ1c+jt+Pr8DkSdryhehGtT31/P4BNK4hG0NROIz2DpB0uG39Q==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-19T04:16:25.149Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.71","@balena/jellyfish-environment":"^14.0.6","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.1","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.176_1663561221460_0.4839000624502712","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.177-renovate-balena-jellyfish-environment-14-x-688c7057ede51fde6c48bd31e3ae3c4bf641d326":{"name":"@balena/jellyfish-metrics","version":"2.0.177-renovate-balena-jellyfish-environment-14-x-688c7057ede51fde6c48bd31e3ae3c4bf641d326","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.177-renovate-balena-jellyfish-environment-14-x-688c7057ede51fde6c48bd31e3ae3c4bf641d326","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0dfbe4766ee1b09920221930e32dd39fd9b38b34","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.177-renovate-balena-jellyfish-environment-14-x-688c7057ede51fde6c48bd31e3ae3c4bf641d326.tgz","fileCount":17,"integrity":"sha512-0sOrhz0uB8x8eaZ6FB+lA6icl0n83+1GfLRgOur2rQa3eiGKwAROZX/twRLy09N9DnS2ndUhFERy6li+T+RyIw==","signatures":[{"sig":"MEUCIQCr/wWxSFZLyvIbLgdqs1TBj6eHK7KRPyfpKH9dtaReEQIgJfrh7Um47AIb6ToAi4i/+RPUzaLYrHqZdIrqZ3Jyv6E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJ+6bACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmruOA/+NxpxLCEdh7C/Dvz/zDVchKn2UHMoq970JfIrUTE5p4e1I56c\r\n8jHqX8ik/Vy8aW8+kbjx/ZKMyHNkcsQHlyzuFWwl4JuyOvX5Rgw1i8Sp02c7\r\nSRm2EmXYCZQ0g2yj/qUafH/K/VJ4Stxq7KL5TlOQa19J7hlX5sGr7uFjFd+k\r\n5oZ8ts/v7mGm8R5XdTpwzHG+Lby9E+DvcGnZiLF6mUM/FeLndGlXlJeuvf9k\r\nzrM8PbME6Z4kh7sosYkwSvnBfWTrtIgqfmzBEsQNIbHZaAz0XxcnqXNJuSIk\r\nunc9rNRoPYdoEoUqxMd/mPdDRx4zXwgx6Uwd2cjJInmuDnPVCsYsCrOp+ccm\r\nArXqZ4poz3Gk/ZsIMjRemB91kgJHF/JfoDEHorcdRcRmSzb6JCuyysXDv3wp\r\ndcUsYNXTUnGBX8Cw8CZ39nbf09l9GZ5DkLQNcCEfiZZ0kgi03AymXDnu/kWu\r\n05CtCWicnmxFtawPsUOH6b2tA/NQXLoRg2uz1Zkxgt9azsTPogyCoHIK3Efs\r\nqNa61ppCM034FIzFdj1w+XykP7R6vV+5FaLvCjMN1JCLpzWk5Bknn68cMbbM\r\nnNQD09T+sZaxasR4aD7Y+xMmbtF4JJiXFxPaZKPSDsO/d4PyYgDw5bTa5xnB\r\nKH3WephrG2wUrGazvePZdis4sIjGxWEfV0M=\r\n=XLLp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-688c7057ede51fde6c48bd31e3ae3c4bf641d326-16.x/balena-jellyfish-metrics-2.0.177.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-688c7057ede51fde6c48bd31e3ae3c4bf641d326-16.x/balena-jellyfish-metrics-2.0.177.tgz","_integrity":"sha512-0sOrhz0uB8x8eaZ6FB+lA6icl0n83+1GfLRgOur2rQa3eiGKwAROZX/twRLy09N9DnS2ndUhFERy6li+T+RyIw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-19T04:21:37.265Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.71","@balena/jellyfish-environment":"^14.0.7","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.1","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.177-renovate-balena-jellyfish-environment-14-x-688c7057ede51fde6c48bd31e3ae3c4bf641d326_1663561371224_0.626219563275981","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.177":{"name":"@balena/jellyfish-metrics","version":"2.0.177","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.177","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"762d3f83af88c535a89e6638f42f8c6f0f895ec3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.177.tgz","fileCount":15,"integrity":"sha512-vN912kSnl5XhJ/MALIBDXFK5GZ/26jZYVCMBF+VFPmUhad57PxBia2zBtWAozK9LjRW3Lb/NqhxQ8hD5fAporA==","signatures":[{"sig":"MEQCIC3S5+bAgubLHC6IfbTyjL1fzN8NSMYcro2r2mdEumV+AiBJptNM7FbFswCTbHyRQCzsv7Dc0jxdWXbBmdQEwXBRYA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJ+8rACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrlHg/9FJ3uk4fNjW7+DPH+fcT7rqYy1ADsr77Pf9b0A+NDlWR+6JlC\r\nn6tFZSnSu1dLoCvaDbMy9E0W127fKeqTMARuZWDOMJpGnNB8Fsf0T5IHQAWi\r\nNzcNEEcdfARwZ4NB2Ejvx8p2xkWnGZKFwNuqXox9zFDhI/X1JmLZEedG/NLI\r\n3rZ6/Yug4Vbyo+Y/AH0y/FBjMEz0tfElp/5dcwLRzQG5EshzwaVBwdA8h15I\r\nXISfUeEBDRkylCpCI1aa+83q7OithL0BkUDmW2oahv50KKpfFtAu/Osb/C0m\r\nU72FUwpqV/zDj1/1zFaCsu4DBdahishdlJo20Sh3dCPAKTikTEZAJFbD3car\r\n9nipNvYOUS7ty2E+8x6skrjaxrL5ETr1W8aBRdxUI7RPxRrWPz4xoSKsdu9Q\r\nK/k8IPJtCF3EyUIrHYSj0DHQv7TMu5gfXe5yIu+A6xHKZzy4nUjOsR0ZTazt\r\n/3JF2n4MIhBzJF6ck5ZV5LPAP0oySNwmSByXObEwIqdXUJrr8gIW8FUn0InU\r\n5pcWXogbZBpnHpVpaXYVU1J2vcKkiItHbJnsp+8fXDpBfZShFG4KkKrGPUuV\r\n0a7CgqcIiIlIL8/CvXMnUkRG70kEbUd4AkMwf9D95regVAFdBkpjOpfKJdN9\r\n+1yK0R7r+LYiL8rSV7t0p8SnFfhFws2m++k=\r\n=PAuX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-688c7057ede51fde6c48bd31e3ae3c4bf641d326-16.x/balena-jellyfish-metrics-2.0.177.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-688c7057ede51fde6c48bd31e3ae3c4bf641d326-16.x/balena-jellyfish-metrics-2.0.177.tgz","_integrity":"sha512-vN912kSnl5XhJ/MALIBDXFK5GZ/26jZYVCMBF+VFPmUhad57PxBia2zBtWAozK9LjRW3Lb/NqhxQ8hD5fAporA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-19T04:21:37.265Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.71","@balena/jellyfish-environment":"^14.0.7","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.1","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.177_1663561515456_0.4266282459292168","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.178-renovate-balena-jellyfish-logger-5-x-56c0e73e9e429ae5ff5e08c2546fdcd81c4a9103":{"name":"@balena/jellyfish-metrics","version":"2.0.178-renovate-balena-jellyfish-logger-5-x-56c0e73e9e429ae5ff5e08c2546fdcd81c4a9103","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.178-renovate-balena-jellyfish-logger-5-x-56c0e73e9e429ae5ff5e08c2546fdcd81c4a9103","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2b479d9c3e32e76a1db0cdf3ed0429ee6e280e42","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.178-renovate-balena-jellyfish-logger-5-x-56c0e73e9e429ae5ff5e08c2546fdcd81c4a9103.tgz","fileCount":17,"integrity":"sha512-SKwUe719dyQFE5StiMaGAG8kRez+JHR4Qu6sU+41WapGEf9FQCniIuq61EtxqJXbusu4Ox8eO041CKo6srw41g==","signatures":[{"sig":"MEQCIGPR4fNln/5oK2DZOR5yPMuzOs30pItrObIVYTFATKEPAiAXFLLuEdbQhzs5k+s2IKZBNemWZ0ZUF1GcAdx8zG9HJQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68146,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJ++5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp6OQ/9EVncR1IJ6h8WTygSaZfHo3I5sVLgPkepDHIUMKPi1T8Kf8uk\r\ng3/YkIBvImiEmdl/RF2bbEjeOnq9ER/tGocJb8TcBE9p8SSkz0OS59TuAn99\r\n03PHLVSG7vQ4FFUfOA7N2yI8Bi8SU5qG2pNE96xFnE8sXYG88N13RWgnxwWN\r\n2tNY0xTycQkqdPIdo/KgIg5lex+Q/+9X+ChxIS0nZc4TDNW2nO708O4Fp+EZ\r\nuP+20hYsFe59TOVbK+XuNznL0iYSvJwF8WK++4PteXQZuLI+8H8ZX7Ue5LE5\r\nRoWFDrpnkzi9IXeJOU3AOTtI/C+NenLai+wY4jBQ6nrhrNLY2VXGC44jsqgY\r\n4o+sulZaKRWfVvo02V5ZctnPjcQ3n9DOUgU+8Unv6mlaHZG8Qe0mmXNlzmxe\r\nid+eXvuM6WQnlXlavW25uJrKZ5rlgS6UUUKrvFTbpvA0+SvW30hcf5yudTFM\r\nvzvVS2yW1mflulPu/jOocnRbH2aFwSGJQZ9vmdNK2FWzEqH/wt4Ekls74fbu\r\njirzTSpsGrBv3tLKYHeCYUGXwO6E6LYyWvGztxpisdX8CR6EorwVN5HT6snf\r\nKWomUwRnavoioWKBVix2gJg3IQN+mD1zc0jJk+13lgk02N4gvEZ00CxaKQPb\r\n3X3VSceLvB4kp32riLRxFtQF6FcdlyhNLlE=\r\n=pSSe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-56c0e73e9e429ae5ff5e08c2546fdcd81c4a9103-16.x/balena-jellyfish-metrics-2.0.178.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-56c0e73e9e429ae5ff5e08c2546fdcd81c4a9103-16.x/balena-jellyfish-metrics-2.0.178.tgz","_integrity":"sha512-SKwUe719dyQFE5StiMaGAG8kRez+JHR4Qu6sU+41WapGEf9FQCniIuq61EtxqJXbusu4Ox8eO041CKo6srw41g==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-19T04:26:27.045Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.72","@balena/jellyfish-environment":"^14.0.7","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.1","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.178-renovate-balena-jellyfish-logger-5-x-56c0e73e9e429ae5ff5e08c2546fdcd81c4a9103_1663561656801_0.6197307603127038","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.178":{"name":"@balena/jellyfish-metrics","version":"2.0.178","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.178","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"831a58c06040b121268327a4613eae9f93957c76","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.178.tgz","fileCount":15,"integrity":"sha512-C/FGHWMBwsnKOwUa3/tgviQXH9fHs4IWb7FcFcS9LeUsaDT/5IinYtpW4a1tnAL29GDwXp3q6KDT+YwUqgJO1Q==","signatures":[{"sig":"MEQCICiuHn/2yGRKRTm2cZ1PUc4vqB1H7P7BL/3oj1bL/OaAAiBHnfz1lNb0UXex5fngDYQQbNVDipiDEEzjXfJHnLsBJg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJ/A0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoFRw/+N5y3Hk+rjgxC5oea/aUmEwbL09D83lrn2v72NcK5yk+CqLHs\r\nO0YJW75pkta9gGVn2Fq/rYJ7HURASHlO56QQkhzD+iIwKuR0FQ+0qvRvMy1m\r\nFBazsEJmIoLrSnxWeynjCcw0BgPuguSjZOMFW38DE2JeX6N8tQVI9gvyYfB0\r\nQ/cJ2LdoLGV2RG+F/kbYVRL1YGOAMIQDV0OkI9M8viJOGkU4MSN9PqZBCfzV\r\npZ/PH9twNlpimvg/SlboHMeb4RMh0GWL2aikIk99+84d5ZDwxoP9A2rYR0Lg\r\nFIkvrQ1sdSsQ7mZI9HqHIoV1kJO7mflUuPEnMtMFVTxiH3IMQrYx1HuuzfX3\r\n8sxVQEPTj3lfHYvQag0CMOrU754+Kp8akF0Ht9hIvLX5SGsBvHnrAlpIsWxP\r\nC2w1LGFjiy9dGSs5BpSs1eCfZbwOnO7O6zqVQZHgj6F+QgR0smuMMccu57E1\r\n55bSUNiltzAw77dCqC852NLP/4M1OWX9bkNZUJrosVgYmyUvr+k3+fck8b6v\r\nSbvEV8r9Eh76X5r53lCKAlC3iI7rASeFGYeq7L00ccFnjEFe3x4xBY59Ptow\r\nmd6kFaI85k2/hA1jRqVc4dFxNWJxKMkzmUCvCUJCvfl7XeslXgrmLEDuayVB\r\n3TiJrv8UgUqM2p0jsnXGtCfsnnYBUEYHJIA=\r\n=YUqk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-56c0e73e9e429ae5ff5e08c2546fdcd81c4a9103-16.x/balena-jellyfish-metrics-2.0.178.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-56c0e73e9e429ae5ff5e08c2546fdcd81c4a9103-16.x/balena-jellyfish-metrics-2.0.178.tgz","_integrity":"sha512-C/FGHWMBwsnKOwUa3/tgviQXH9fHs4IWb7FcFcS9LeUsaDT/5IinYtpW4a1tnAL29GDwXp3q6KDT+YwUqgJO1Q==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-19T04:26:27.045Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.72","@balena/jellyfish-environment":"^14.0.7","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.1","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.178_1663561779960_0.004276673514806317","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.179-joshbwlng-codeql-c04451d4b28eae9f1632b0d81bba89ce81923b09":{"name":"@balena/jellyfish-metrics","version":"2.0.179-joshbwlng-codeql-c04451d4b28eae9f1632b0d81bba89ce81923b09","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.179-joshbwlng-codeql-c04451d4b28eae9f1632b0d81bba89ce81923b09","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7141f9e65ddfee36d08141d5e6edcbaf26e14e39","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.179-joshbwlng-codeql-c04451d4b28eae9f1632b0d81bba89ce81923b09.tgz","fileCount":17,"integrity":"sha512-vp55HMwPNOBVIPu/KAJOUe12WKaFnEs8ap1/OTiha+HIS6T0BPuyRxkUjcWl0uNpxYALW3aEcJuH8r9ygJhO4w==","signatures":[{"sig":"MEQCIA6VsNF+Rul8NI1tQSIm3fdU0mcpjIi4Gd+Dc3iT6xRlAiBSAlRhFp/p7WF3gnwx8vycDakIcdjotv/GcMoG/k4w6w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68126,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjKBTSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr8zA/+NRG3tC+5Ij5ueHwvpogQLtXmVckSMDX7GpJoSQNH364dAecs\r\nNQl+4Bxmu51v4Hr7TrqIo0oFyytQ4IGc3yLIn3fNrW7O1tlL54GK4cePzEub\r\nLl85O69vS5glUkYKRco25PM0H3q+SeCL0yiDeDlvsWn6dcIUyblZFeCh7MDx\r\nOCWVjxCAtqZp4PuQH1pNQQidfD9sigiZsSrGIwl3A5nlLmJRt8B9ds5VqtUg\r\n7W+GSB/OWH2cP6v0i7eW+SUG6mkfB2xWaCxmj4DE+MNtG3U0j9W1qtM03Q6Z\r\nUtPpvso9bKthyKHC42xPqVODJg5Pe/mVRAFUUcsVxxpgIrOrCoeMw+vOqH4t\r\nqYbNzhaZ2klbGmlWJRNLcDkWVDGmBIw0bHIuTDbXhQQBKISSWNMLJLjwF5RK\r\n19yY8WlypEMyuegEUTI8bNAzJCIkM+uqeaK/WXqqmjSJwu/t2m8NjnmBUtN9\r\nMSwtNdBegx9Wc67J9WhaqXKFeJp59NCvBmlXkC7mlhR8QNcrKCjipHyR7nI2\r\n72ro2MxA/PcjIOA43Jx6hS62TUwvNK7XeT1BNFBzsCzro3lybysMMcFZW7uI\r\nyrv+F62v+nrGX/89C71ZcNyVeGcFCNmKiIhF705u1dMHJmRg8Z1GR1h3VD1F\r\nw9wZ5eymLlURj57yzFFd3Pcn1co7j47jYqs=\r\n=rQeS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-c04451d4b28eae9f1632b0d81bba89ce81923b09-16.x/balena-jellyfish-metrics-2.0.179.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-c04451d4b28eae9f1632b0d81bba89ce81923b09-16.x/balena-jellyfish-metrics-2.0.179.tgz","_integrity":"sha512-vp55HMwPNOBVIPu/KAJOUe12WKaFnEs8ap1/OTiha+HIS6T0BPuyRxkUjcWl0uNpxYALW3aEcJuH8r9ygJhO4w==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-19T07:04:30.296Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.72","@balena/jellyfish-environment":"^14.0.7","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.1","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.179-joshbwlng-codeql-c04451d4b28eae9f1632b0d81bba89ce81923b09_1663571154532_0.10300314727658666","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.179":{"name":"@balena/jellyfish-metrics","version":"2.0.179","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.179","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8041210e1285b249a963d03abdb4ada6135334e7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.179.tgz","fileCount":15,"integrity":"sha512-8P6lsY7eVb/ErWnvjBpmBztQUtijBE+qV3KDIt95+sZZkIAbdv8r+XqY5AMQgHLMLdbH6l1v2DYwIMI6O55+Yw==","signatures":[{"sig":"MEQCIHHMOloWKQ1/zQ30YBn1FqK+3jSS69KDVXMF4a4uD3n9AiA5a3B2pQr6GKfC6yPj7L5zdqKGFK1yvFMCuoou8+nxPw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjKBV3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoUHQ/+K9mP0hUthLYUvon0WX0VTpQHxki4WNv4RPdW5yIqTYSc0v8g\r\nbmlQ5kv8451P/EZ7Bibl1GfsTJKr4Uiyei0MioMcQcPYEvBG+8aVOg8c3nsk\r\ne2X2uTwYPAW0mYm0x9NPe/brBvaN6zCwSWzTLhI+fjmbqRhgH+dfjnzRmhHM\r\nVyoGYUjBaY1sKRlhlYhpP6ESvak9gEP8OZZL0avxgBqkKqBPtCixjGxqdlyP\r\nBwimBvBcZrFa7YQFgdNuw8WeE+KOkW84UEqJXyNCoLX3RhtzoANWRmncgb46\r\ncvGtL6AWJ004PQ/OMact7YPvQaagDna3/yQUib9QIqfcHg9aFo3Mj4lFjVZ4\r\nhPW3Mj/YVJqUDvmQC4fb9CcwVlp5+2qdy8017I8nW54LZzJHkJS/pQISIwXR\r\nOskHKUPrskLNRg87rySlgEHD8XlKXsni4O/QCpuCs124CO4v6VyDsSpm9REo\r\nAXV3nMl+nGTYHIRparjaG6d9vB1B00AkhxGjfLgq5q6+vmUjpQ3Sd/+d7sRw\r\n3pQwPNQcYOGJlcoBEFbt4g0M2357UMjouH/Og44fzINR045JHPoShN0c/rH7\r\nRSo75Sm8OdvyftO/0WGkfzXNLYjS/MXnwquCvZg0a7v8piT/e8ayaKBuH5hC\r\nid0hEPPHyuYbRfrDpDUhJxt+WYvmT1q1V2s=\r\n=BIjf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-c04451d4b28eae9f1632b0d81bba89ce81923b09-16.x/balena-jellyfish-metrics-2.0.179.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-c04451d4b28eae9f1632b0d81bba89ce81923b09-16.x/balena-jellyfish-metrics-2.0.179.tgz","_integrity":"sha512-8P6lsY7eVb/ErWnvjBpmBztQUtijBE+qV3KDIt95+sZZkIAbdv8r+XqY5AMQgHLMLdbH6l1v2DYwIMI6O55+Yw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-19T07:04:30.296Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.72","@balena/jellyfish-environment":"^14.0.7","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.1","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.179_1663571319202_0.6325893243423792","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.180-renovate-balena-jellyfish-environment-14-x-f1eaddf3db958a0807da1ea94de2eb152050bd3e":{"name":"@balena/jellyfish-metrics","version":"2.0.180-renovate-balena-jellyfish-environment-14-x-f1eaddf3db958a0807da1ea94de2eb152050bd3e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.180-renovate-balena-jellyfish-environment-14-x-f1eaddf3db958a0807da1ea94de2eb152050bd3e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ba59997e0a13e48f7926ffbdd1875e385f132ea9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.180-renovate-balena-jellyfish-environment-14-x-f1eaddf3db958a0807da1ea94de2eb152050bd3e.tgz","fileCount":17,"integrity":"sha512-s0arRdD5vduW5e0XEDWZf9sbDsR+U/AkdNL2uPFhQifblqDLQjMIaI7xeZUIqr1VipRoLGrJEPMiBH3ASYRUrw==","signatures":[{"sig":"MEQCIFM/gPWOL41GujtPuDLKh+wB1+7lNBoTdLmHX7zZX6adAiB3otD9ZU4m5Rr3ptrAZpATZ1UqSdhJetrddpH9Mhckqg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjKBYYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmohpBAAoCCycxmy+kWie+1brhfn3ShK8uOYkeH1cDnIXWDywv28HYCz\r\ni30rJ82iBswy0HqeEuBIewZf2mPRi/tjxuUIMtvo3QTf9aTB2oiKa2PBACEi\r\nDv2Q4CHGHirsFqauxEXDIpATf7oCCCAIk6WJ7xUMJyBN5dJUukmxoRL9WxNi\r\nxNlnYJ74CsxleS62dRO2zohJQnrxUUZGzhcbGFhyGFA2KYRcjuBDrPO8ngB/\r\n4Ar38jNE/GEDy1DO3Tt9oVsyzEidQVrCruId+btaI52PJqDZx2zvYwlNNQHH\r\nA7stXydv1uO5/VgLLRiRAR4qM4LFTjPF+fsDR9/8flG/Xvhm706TTuPoJRvo\r\n3t+lqfDetjGMN2VC+BS6t/jIdykL3JHlu9xOq93vCrEcLLjVpS4KnVLHcsuu\r\n1ikCxhjAzDrP4mZA4EP7WGphaRVhgqzLhCGeS6eubN7z8w9PyY1VewX0JyVw\r\nlRneywEPMnA0MDhT56U2t0W6gQLHGVI0bk4co3OZrf3PBI0S7LRY09Ua1JFY\r\n3+qqEPFA8KHro3HceuqrTeikZtpimGM5k3TJQWcu7Z9Gt65Xs1YNKnHurhc6\r\n7pLNTvSSOCoXWKlvunOcu2OLYudXMmFOKs6vql+5yw/Xz/cdl5t4GL67yDgD\r\nbBn2ksK/CgBkSgQ6DKZXqR6nGDrojicwnf8=\r\n=XwXP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-f1eaddf3db958a0807da1ea94de2eb152050bd3e-16.x/balena-jellyfish-metrics-2.0.180.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-f1eaddf3db958a0807da1ea94de2eb152050bd3e-16.x/balena-jellyfish-metrics-2.0.180.tgz","_integrity":"sha512-s0arRdD5vduW5e0XEDWZf9sbDsR+U/AkdNL2uPFhQifblqDLQjMIaI7xeZUIqr1VipRoLGrJEPMiBH3ASYRUrw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-19T07:10:03.004Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.72","@balena/jellyfish-environment":"^14.0.8","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.1","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.180-renovate-balena-jellyfish-environment-14-x-f1eaddf3db958a0807da1ea94de2eb152050bd3e_1663571480190_0.8190221616656579","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.180":{"name":"@balena/jellyfish-metrics","version":"2.0.180","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.180","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"20d00af5ff92d98a24b9f1b0e99141398ca939f7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.180.tgz","fileCount":15,"integrity":"sha512-2fmqsMf+71Wv7O70s42rBp0LS2vBILzvScOo++yhhFAiBLj1s8bSGnwVWZ17hXboLZw/qRAkVuOswm1xoDrwwg==","signatures":[{"sig":"MEUCIH+WRy98jmcBW8dl07JBVxYrrlER6BD19sqtuegHKiKyAiEAhIgYmrskL1Ov9W4cV0P+k2FH/GVQBg+YHJBbjVmEfJQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjKBaaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoF1xAAij8rVxsN30VC/hOCT826t1zh0puJVYejNC7NQYRw1g0kQrxc\r\n3eixcbl8bphiSbHBdOpjicqq63aSLNkpEiNKXdS1BW8+ZsP1JYHJzrIviM0G\r\nUyOdwsdS5NSLCneVblp5U685fCTpKQA+EuDDzOHjmiM1FnNGy6OkFImUs3kX\r\n3s15WVbbj1MyVpiPUpm+9lysVuy8bU6MU17sW3oj3QyDSURPNagY4Eolabt5\r\nP+4hSdvTjzAAlCveo68akWeues2UJ/AGi4sslCRugEDWcrg3kqCXT6yZIp/a\r\nor8F6rczI14Ba4CRp6o2gQ0cnFdVTGBelZMhmojq6fP+CGTE9u29VLZJYfjV\r\nZoIeLW1pkS93voOLIDeCioqpZ9L5Yku4a0h9RQ2b+Bo/UjMh5ltEKoteTbS/\r\n/J8LFnvDPDAH5GdRNPP1615JgKbBbCgHkdaxnmSxu37zjPdh/uFnEkGYgpS9\r\ncr3UFhshAZkTdzjz81OfWSzCO8COnfYO6t1fpVplsBfWezSxft3yvT+tzYK7\r\napev+Wi27UgejBWbju/+B/ZKLMwLkoEns6CRSJfc22n4qDWQJF7rqlNzxstS\r\nSsasLgmuFh0L7tOHcrw+IZn4bHC1GMRfue9ee9Vnv7ytHZ8hiDfMRcmYXKci\r\ni81YAsd0SOPreFLFFnjpOAVKxgW8qhisbOk=\r\n=+xdP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-f1eaddf3db958a0807da1ea94de2eb152050bd3e-16.x/balena-jellyfish-metrics-2.0.180.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-f1eaddf3db958a0807da1ea94de2eb152050bd3e-16.x/balena-jellyfish-metrics-2.0.180.tgz","_integrity":"sha512-2fmqsMf+71Wv7O70s42rBp0LS2vBILzvScOo++yhhFAiBLj1s8bSGnwVWZ17hXboLZw/qRAkVuOswm1xoDrwwg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-19T07:10:03.004Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.72","@balena/jellyfish-environment":"^14.0.8","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.1","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.180_1663571609872_0.9133975404694574","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.181-renovate-balena-jellyfish-logger-5-x-d8f67ff6760f30dddbeb5cfab383bb90fc61d263":{"name":"@balena/jellyfish-metrics","version":"2.0.181-renovate-balena-jellyfish-logger-5-x-d8f67ff6760f30dddbeb5cfab383bb90fc61d263","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.181-renovate-balena-jellyfish-logger-5-x-d8f67ff6760f30dddbeb5cfab383bb90fc61d263","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"009a6a4e03ec6370d824b230ca27175de333a25f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.181-renovate-balena-jellyfish-logger-5-x-d8f67ff6760f30dddbeb5cfab383bb90fc61d263.tgz","fileCount":17,"integrity":"sha512-95D+cBCQBGbpg5JXQJiWt+RBiZ/UzvB9ReCkrAMTylW9XYzxRP0JqNHObTm4IUDfSsarMwPf1p508SI/rEb6rA==","signatures":[{"sig":"MEUCIQDMZu7bRIirrhnU6/cFdOd2hqnTq5hmSvl79f+/5GUR7gIgTALSQ+inNYF3VJ0jnqInQ7CUKk1WepCyBjk9zX7DHF0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68146,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjKBdYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo7ZA/9EL7kCpT7nV61fD3l27NmNufMlT571bVv9laIhPtis/UC9jy5\r\nEo63RddlBlddYT+I6IB8crEaP/yYr3cE8sjbFJZKBjxDgzRXBAYo6Q0wcC0k\r\nrk0q8neaEjTrfk/96mIyGbiQxYl2cN73cU48C6mhftG/sIkpu8cMxHn8OZES\r\nqYWKfWJKqPUdX/Cb9PVAWGXSOTYOUU3XuP7M0P4ayMfo2lzYx6MFI2sx5sfh\r\nEpK1WSrxZoV+yk7HA+Bm1BqBhNepm+j+6v7l+XioMXX/VtqfwLbLL3uiqNbn\r\nnDD0BXrpzt+ZHvgA9UZp0Z8tlU7GikEP6E2pjFpVMD1+Szu0yHJQ2IP1p/4i\r\ngiORxg9i9P6jXhTqFzzYiQSUZpwBk55o8Tf4mVzc/IBKRx6AmAB6Ed7Lhkrk\r\nzEgPSW4qAmtcCSwzox/T08A70tAeCNEuGvmqVf/1mB4eX1xYs1WoCMXtsSz6\r\noll9XSZQn+5B4VHhIqQvFc52Ns8ub5ddJv8ro+iwTpZl5XSsKy0GWTlaaHse\r\ngWHd62anRUVUJIErBxpuCboUmfqFJ7lMCg8qVfAF2xlvoWZGkqKmlpDek9/O\r\nK7Zracz18GlN/n4dVJFcnMYU5VpPdYMbqm4dHyI+kzpYtV/omfou/dKvtB8q\r\nN6/WHRhz0fp5CbVPgW37qOK5ydAWaKe5J+0=\r\n=2/99\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-d8f67ff6760f30dddbeb5cfab383bb90fc61d263-16.x/balena-jellyfish-metrics-2.0.181.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-d8f67ff6760f30dddbeb5cfab383bb90fc61d263-16.x/balena-jellyfish-metrics-2.0.181.tgz","_integrity":"sha512-95D+cBCQBGbpg5JXQJiWt+RBiZ/UzvB9ReCkrAMTylW9XYzxRP0JqNHObTm4IUDfSsarMwPf1p508SI/rEb6rA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-19T07:15:21.857Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.76","@balena/jellyfish-environment":"^14.0.8","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.1","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.181-renovate-balena-jellyfish-logger-5-x-d8f67ff6760f30dddbeb5cfab383bb90fc61d263_1663571800120_0.3526610413369715","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.181":{"name":"@balena/jellyfish-metrics","version":"2.0.181","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.181","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2585ccf210c328d9b959c4d52744d568a55d6ff0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.181.tgz","fileCount":15,"integrity":"sha512-hcs8a6yNQ5TU8zEh0VLrMTetOJPnCbyNd/E0gZRzA36LiHtpk8KWgsWjNwtuDGVUIvEArv4qvslH24w+vKXDkw==","signatures":[{"sig":"MEQCICPIqoYZZTr1/gobDaJBZW6tKCMa3zy0UTZHDviiV+OQAiA6ceWHqCWHLgbDc2rw0kFSm2TuS9hLIscdvdnLfjHeqg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjKBf9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpyng/9EHxgyXEddvCuNpmpwRwEk3xcI9y7TyW/AACQkEly3Nxe/jX2\r\nbgQyLOsnzClzBfgjyHTA4LSdAPEwKi1Plep3PlaYSbpdgWQ+2b4aanl6j4nK\r\nhuJyBzyZq4mLYhtZiIGCOGJzkTgBOK4yuBNWQvioD5yWz7mJFtwrJlwJNH8/\r\n92eYoa56aSgWbLPNBlHsYZA0RI01bIPhtpldH3CCh31rhzG5yXvYvC4X4sxC\r\nqtl24kiDpY78arBmwjhyCEIphUvoxFqdU1roxgOiJCLiaQjFsWIkqDuy5Tss\r\nPVZO7h0eVMk1+QL8Scfzt02Q3uGDRm4g6K3Bt4HDYEYNMsdV1G/GU3J0yh1x\r\nBKllI5LcbTcTruJZZEADnFHZ7Rb7Ux5h+nOe6ZZ3RFQBtSo2FIStEIYeuSvn\r\npjaD6CZiMk0skOBsmxvpBuwud4XopytXPrewy0Be5Uz46rXPL0rdxyKQo1pf\r\nh3FpY9ASCulcDFO4nXXm3xauTfbuP8uH2blA26PGLPhWDQe3f8Qn7L9dFi9m\r\nFNXpYWFVyOj0iK8cUeoAmXloSbQJvPPJrSg7Ong2p20CHicJUTsvKeZ7e96W\r\nisMK8hq5WiBkri1b+FvIyxHe03yDnbG+Avzy96eL8DR8cYqFrwTQpWYo1wwA\r\nJCHLKNMK8lqeqay+bA+cK0JYazesYeVoFf4=\r\n=dFxe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-d8f67ff6760f30dddbeb5cfab383bb90fc61d263-16.x/balena-jellyfish-metrics-2.0.181.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-d8f67ff6760f30dddbeb5cfab383bb90fc61d263-16.x/balena-jellyfish-metrics-2.0.181.tgz","_integrity":"sha512-hcs8a6yNQ5TU8zEh0VLrMTetOJPnCbyNd/E0gZRzA36LiHtpk8KWgsWjNwtuDGVUIvEArv4qvslH24w+vKXDkw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-19T07:15:21.857Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.76","@balena/jellyfish-environment":"^14.0.8","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.1","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.181_1663571965731_0.4063997185772177","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.182-joshbwlng-move-codeql-ad8d820b64100a685fde9a0d7b25177abfd822dd":{"name":"@balena/jellyfish-metrics","version":"2.0.182-joshbwlng-move-codeql-ad8d820b64100a685fde9a0d7b25177abfd822dd","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.182-joshbwlng-move-codeql-ad8d820b64100a685fde9a0d7b25177abfd822dd","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7673d73b22e90f090b36b70da8f4e4be30d689cb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.182-joshbwlng-move-codeql-ad8d820b64100a685fde9a0d7b25177abfd822dd.tgz","fileCount":17,"integrity":"sha512-G5r73uJPn4o3FVFPH1OY908UIJXG7D4A2ai1i0sEFK1tZXAC9y/tMjQYOipc3ZVqupRJINWUEZcW7hUNG/RElQ==","signatures":[{"sig":"MEYCIQCfGJAWpkBTpdD/hDiX1BpBONF5+rRqDSYd7t/5v8YPbQIhAKyDZ6p5c04lwmBwyurpbM8Af93oGMFHAGO1M0jlVBV4","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68131,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjKCSEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrjaQ/+PCH1XN6kTRr+x0vOBLapvjRuctrIc2fgBn6sIXyezs/Eccpt\r\nhLUdYEAyZ2lvd7hMa4vv6Y51t+4lyIBq/SU6evy3hhju5Iw653VaM1TxttMf\r\nKx3GR8JehBZqPiupado+5sj7bD0/ntQ0S9gIROk60GZx46/iIb1keYy/7a2/\r\nSHNb76OOdlDHnkabCKFf1jakOP+w/UUg0hgRSieemCX2moewUJEGm2wAr+sc\r\nnI8m+TmwITZZ3ZWysiE8WlqEeH1YpETe1W8BR6ND4bR1+P8mseXMzp4E5zMy\r\nAFWkzCMRMkDuECg4dZxyDugfBt7JQk9zi+beq2KUhSCEYvmISD/KlYoizTmp\r\nhWpo3h397xJvGwH7VAHn6goNDMDDdQDx3/PkLtupxNAqeO1qD14BetI81apA\r\n1KteCP0eOMXtkMjM/1MZzupCAgah8oWswifdJt8txfeXSOYDrDeQdVnpuvG8\r\n5aYiSVvKwLX8jPiKqqBilnF8KgxtjYk7AXCs1Q2E3YRjefrsg0nRfOVcMcHL\r\n1mC1FW7cMj4cLDk5SMbmnOdCoxaLHKBMcMpiqAd4l77scw3/tXZGo6i8FAyH\r\nl6DPaF1vdIOqwf0XESI4NFQOG8MKk44W5xbEwZSwsesGnLZg1QxdUIfqPOEP\r\ndjtz1BdQWrXmiVP40YBa7A45weBMsuz/wbg=\r\n=VY3x\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-ad8d820b64100a685fde9a0d7b25177abfd822dd-16.x/balena-jellyfish-metrics-2.0.182.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-ad8d820b64100a685fde9a0d7b25177abfd822dd-16.x/balena-jellyfish-metrics-2.0.182.tgz","_integrity":"sha512-G5r73uJPn4o3FVFPH1OY908UIJXG7D4A2ai1i0sEFK1tZXAC9y/tMjQYOipc3ZVqupRJINWUEZcW7hUNG/RElQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-19T08:11:26.261Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.76","@balena/jellyfish-environment":"^14.0.8","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.1","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.182-joshbwlng-move-codeql-ad8d820b64100a685fde9a0d7b25177abfd822dd_1663575172229_0.3398988193783328","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.182":{"name":"@balena/jellyfish-metrics","version":"2.0.182","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.182","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"91f373d1a5556ea481d95d4aa0b09c606a636f52","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.182.tgz","fileCount":15,"integrity":"sha512-mDlImcNl9NeK+Lbo8dlqo/YNMlixz6Pw5UWPjW5a1rn4qmyQObST68QNfHLINuqrJz7TA/Ax93+bFMIiudyq9A==","signatures":[{"sig":"MEUCIFunfsKmGZt0wp3FXIdNujyaFNtrZqJ7STVgzcYecKjjAiEArzuQqv/547bv4qQz/nWpafC/7/3D75ReWsYQNXw+5KU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjKCUTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrmvA//fbMDHCUJFx4S/rgdTdCLZv2ZzCz1c1Bj6B+CHovIXiegJdvK\r\nTMie+yoBuI4+fy7eImCEksP5BO9e/+603bphfNNcLCqjUk/BECWRo56XtY6A\r\n7XsUMkjQ7i6yZi+nwRN3424O4LznmwL/mzp25DtQSjx4KQ6OHNjdxCWNtMBj\r\nHtn+qbYv9QpPpFiWSqI5Qz4Ovfbg1+uOVtVjSUnBpjMgwJrDFfgw6ReOGWdb\r\nCo770GYvUDN5QHLSfGqaQuyIqC+0q/qhHuqJdbDH7OIWpr3AQI52U1y4051G\r\nw1uvgl8mWlDfkIEC/QCG7A0JUFe/rBR+kGbUwFcHXPpHacblx+sLULNGUiWp\r\n6ULp7a5Bw+++7d2nyun34jAQXvN9C+iwUnMrW0yz50xy/PmHYM/FmueJiF3x\r\nJKemy5PijD14/8fmBv5MdUEpWdZzRMHZIl9F9lCZtwTjsFIrrXZM6LD3Kg0W\r\nsJeiDshmS2R+OGnnx2MErTYlV227SmEX86vkRwN+3zUBMUiC7yRG1RioK6VA\r\n3yBnSxrygHmkosa+HcxJgPnPdLVsxGYXj+JWV8ea286931j+NT7BbydPGXwc\r\nBElqqI+Fasmmm8gjinq0AlsPJe1PKE5To6iuhwQ/iDF+JbleMnbnj3uN034y\r\ngXBe8mwfQaIug5kchpBta0cvGigBKligDoE=\r\n=zhM/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-ad8d820b64100a685fde9a0d7b25177abfd822dd-16.x/balena-jellyfish-metrics-2.0.182.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-ad8d820b64100a685fde9a0d7b25177abfd822dd-16.x/balena-jellyfish-metrics-2.0.182.tgz","_integrity":"sha512-mDlImcNl9NeK+Lbo8dlqo/YNMlixz6Pw5UWPjW5a1rn4qmyQObST68QNfHLINuqrJz7TA/Ax93+bFMIiudyq9A==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-19T08:11:26.261Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.76","@balena/jellyfish-environment":"^14.0.8","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.1","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.182_1663575315294_0.8194372019713172","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.183-renovate-balena-jellyfish-environment-14-x-616a9c200335012c8e25a42ccb1084e9565f87e5":{"name":"@balena/jellyfish-metrics","version":"2.0.183-renovate-balena-jellyfish-environment-14-x-616a9c200335012c8e25a42ccb1084e9565f87e5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.183-renovate-balena-jellyfish-environment-14-x-616a9c200335012c8e25a42ccb1084e9565f87e5","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b58ed82721854710f236ea5391e680f4adbdd7ec","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.183-renovate-balena-jellyfish-environment-14-x-616a9c200335012c8e25a42ccb1084e9565f87e5.tgz","fileCount":17,"integrity":"sha512-z88ZataWuWmhyxJ647q1+9Y3vSXOBIwiLmr4gJbMz8LzeQHiMs4tOGp6sxw67+UaydYhbWpLPd+IzVl8tX++lw==","signatures":[{"sig":"MEQCIDKIYnu/KjDoVdUL587hkybO+eSZXPTAhS1+//o9uTJXAiAL+J87OzEY3LAW0LVjNEOv47I2YUK8U8gMkcKPChAzBQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68153,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjKCXYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr4ZQ//Ze4oXjWbgMQECo6N3pt3rQFSrUgBDNAj1hskeMgo57rPuCJw\r\nQ4TdEGPv+OXlcwPmfwm0R4FV7xeV9LHiaqG6eBvHjjIuI3Fy6DaIHxX6FlWW\r\nAE3kf8EzoB1JB1YAgGW9006WLuCzO20V79J92YjzUX5TVZRugxN6Jqzsnx23\r\nIvoF3H8gmFnhbrd5PYzSA8mCKQutBNfgmz/zeBF1tfTagrPwQtE5MC2DZFNz\r\nx9i5Uhtp8X6MIgn6s28O4j7+vmmAG24OdKYtAOiB6up1jcunZ63Dg369v4Rn\r\ntLo1oavGWC+R8rejC4OHzGaX8M0o0f5svPX+qU+vq02B3OzKYMV6qyWVLfp4\r\nR/q2zp8vyrlO1eKwXh2t/mZwoS3dO8mZvD9QvUizJpx+Pi37KY9OoT+He8BR\r\nHA5X0xRfFKv0SfTTsXSbf0tRiibFxFskrhtUV8pNkfowshm8LPvb9apuw5SY\r\ncQjeJYqeRorvYhnADV/dySFfdbUL9AM1j+kum9xIqhmGJ/ya7poFIWVY95Fm\r\nN6Q9gj+uUTTjIr0R0yC8YgN2DDbFgaNvwhTMCEAZu+2o/fuBe8W6ACR7TbZu\r\nIt/LUKMt17gFkZ3OELL7AlX9A0YowsQMVR7rmnZcokGxLLu2pLGdhEH619/T\r\nAod+iLtw/wjciPypSivo2UD5JMpOAAB4EXY=\r\n=OCgO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-616a9c200335012c8e25a42ccb1084e9565f87e5-16.x/balena-jellyfish-metrics-2.0.183.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-616a9c200335012c8e25a42ccb1084e9565f87e5-16.x/balena-jellyfish-metrics-2.0.183.tgz","_integrity":"sha512-z88ZataWuWmhyxJ647q1+9Y3vSXOBIwiLmr4gJbMz8LzeQHiMs4tOGp6sxw67+UaydYhbWpLPd+IzVl8tX++lw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-19T08:17:01.935Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.76","@balena/jellyfish-environment":"^14.0.10","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.1","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.183-renovate-balena-jellyfish-environment-14-x-616a9c200335012c8e25a42ccb1084e9565f87e5_1663575512309_0.31880737454195107","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.183":{"name":"@balena/jellyfish-metrics","version":"2.0.183","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.183","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ca25c1ad521f0d03d0049bb9e4a9652970338fd4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.183.tgz","fileCount":15,"integrity":"sha512-+YPOQ40nKimIkwpL6SyaPgTcyzMNrtGEpevMsItitWEUnvz5HSk5T3ZMEcv4joO2QVEhUysPqg3PX+NmpJRemA==","signatures":[{"sig":"MEYCIQCzIgpwaCHjNsG0WO9vLHuyK92zE8yTXLebKR4qMj94vQIhAMrszePle6WBJ54NsfFGGYysxlz4/j9uHTumm67Wk9Ey","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjKCZsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqtuxAAhL5oI+cLSkYUuX/H2GfrGDgaaqyO9B+J+9eun0sV8hPmCc8+\r\n4i17yu6qhd7IZ/JmKHZArNhlZQwy+TtGzBS7o/YfcKTPYpqImhWGbKD26pOd\r\neoPOhFDyRxtFplJnG2eLULcoN4AV5RuECeudU7m30NlgkqqehEFmj0/Ey4an\r\nqlkJMbaaMK9IaKcSbyFoixHapCvDZAyGhgzx8X6hDO7bVPqvYpsxHbHOiwA1\r\ndsbICxZPcBC6Vp5yeb+M4gIhyb6TOCcFICuZHKCm4gr2v0CJxFO2kuKo8Q5d\r\nAm4iPd/a9TYcJ2TEa3fU3Ir4gF/RAAtO813WSeDFRAx9EOr/Kp5Jrt+W23/g\r\nudT4/MR2DRpgpwfQtVyBO7/+kuMepx0/UAxvWIQDyYHlHyili+pvv3X+sMRU\r\n8Nxd75gvKNV2G/r3dQ018waKGsx7vGVHPmBhMWQGYg89yd2NIdgwZ2P8W1Sn\r\n1Z1tnH8bZZGOBeFdY1DoaA1z2yLgv9jYhQpfF5qItydKsF72uGTwPJueajSj\r\nl1cmfgiEnQbYA9JvwsYPr6l4/1FkyXecM3+PL2v5QiH78mCYsXF4Vtoa5oyq\r\n799m4gx8hIRb8B2Hsvf5S3lWLyXCO5191dpvN8tumfm1j2MIvDbqeJsd7LOY\r\niLMvbPI7vSHgVByYX2/WJFpreYn2S2zZd0s=\r\n=jkAf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-616a9c200335012c8e25a42ccb1084e9565f87e5-16.x/balena-jellyfish-metrics-2.0.183.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-616a9c200335012c8e25a42ccb1084e9565f87e5-16.x/balena-jellyfish-metrics-2.0.183.tgz","_integrity":"sha512-+YPOQ40nKimIkwpL6SyaPgTcyzMNrtGEpevMsItitWEUnvz5HSk5T3ZMEcv4joO2QVEhUysPqg3PX+NmpJRemA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-19T08:17:01.935Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.76","@balena/jellyfish-environment":"^14.0.10","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.1","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.183_1663575660288_0.8627029697506414","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.184-renovate-balena-jellyfish-logger-5-x-ae6f2b32bd4cba34fa62c21aceccafb4cab1c19e":{"name":"@balena/jellyfish-metrics","version":"2.0.184-renovate-balena-jellyfish-logger-5-x-ae6f2b32bd4cba34fa62c21aceccafb4cab1c19e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.184-renovate-balena-jellyfish-logger-5-x-ae6f2b32bd4cba34fa62c21aceccafb4cab1c19e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e404c2ce08db43d4870d38264f1e2579972a4fe1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.184-renovate-balena-jellyfish-logger-5-x-ae6f2b32bd4cba34fa62c21aceccafb4cab1c19e.tgz","fileCount":17,"integrity":"sha512-rrtyNbShWw1y0WC3kJ8LaS8RwgvYpbfkh6aS5tZcPy5sVtlO1C01KHa2PHXRfCoTuT4geo69fEeyF3kIRyuexg==","signatures":[{"sig":"MEYCIQCKiZWiQWBGjYJ4ZfSFqGO1GhSTEGlUTAu4zq4QUm4V5AIhAPEczQDUPZy3NT7vb0TQ6EndC8+hyT/4621G8eJ98oBW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68147,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjKCcaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr4uxAAgQjVbCb04ojORGuM/G59stJuGPAez+fCk4lZHMd9wsVl0kCO\r\nCzf6mYP7RnfwBfCaXsY3ANdkYNIzJMO4jlsPtRldwaGBmGDeP9SSndG+LvVK\r\n2+AJ4uRSJCFBDEJS2nkGxBkRb91UPgU2EsLkg9RDIMU3v2AXJ2IswBn0Oq8V\r\nZHIsLCLeUeMDpcTb6rCCHPTNFLRM5wJVYuSsEtmVNnLV7yPtd0jJwDbKWaOZ\r\nppDshDeEeBZD4U6p65XOwb2AlW4Ay6Pg6ljlwRw5yjlZvdOjSkJILPFY9zR3\r\nWka62oc7rcoJC0CE6p8niZDVKXMFk5BWIVSue/5X03OIsOjTEQBGzmQbD8en\r\nGULVvlU6nSgz3JK8RrXFNP2xAEv7bWevKGE0FTJv2KcFoJcXl+X0JDj36UFX\r\n5UXyAPOKydrBU47RsrocYtovIs/Bz1Z9aDjXUKhFWfDRph7NtNJSyiAe8oh2\r\ngHHOdnyC6q91PZw6cED2p7pg5LLLZdCaB3movGlUH5rdLkdUYzMz0TkPZoBD\r\nctzbanKgzsJ1sFboVIA7JBDtv2YQgIogR9QEfIwCpgSvfblbOnvw5ejQDSZo\r\n6+FvwHKfrPy8ufFSERLiOAVIN2zw2NAWMw4LxohoKs3I7kxto1bJMw7Xyr/Y\r\nTHg2xztY0wRMxTKWlRJaSi1vpSgaO3yyutc=\r\n=N+QN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-ae6f2b32bd4cba34fa62c21aceccafb4cab1c19e-16.x/balena-jellyfish-metrics-2.0.184.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-ae6f2b32bd4cba34fa62c21aceccafb4cab1c19e-16.x/balena-jellyfish-metrics-2.0.184.tgz","_integrity":"sha512-rrtyNbShWw1y0WC3kJ8LaS8RwgvYpbfkh6aS5tZcPy5sVtlO1C01KHa2PHXRfCoTuT4geo69fEeyF3kIRyuexg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-19T08:22:46.028Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.79","@balena/jellyfish-environment":"^14.0.10","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.1","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.184-renovate-balena-jellyfish-logger-5-x-ae6f2b32bd4cba34fa62c21aceccafb4cab1c19e_1663575834531_0.8821548578120599","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.184":{"name":"@balena/jellyfish-metrics","version":"2.0.184","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.184","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"97657b0b122eb50a65c999593bd890953ee8cbb2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.184.tgz","fileCount":15,"integrity":"sha512-yc5EAIQt/yfK8q+ZmFfERiJb2QVLz2QeJW4IF+V4/go4G7poNa2PIHdsgU9P8Kp0JGJXVedUAm7wASMf82gGsw==","signatures":[{"sig":"MEYCIQCLTq9yKYgosMqiPYdkUNZJwTK4akR4a2FXg46plkuIcwIhAK3zpnEVnkDiyz++Ln3sME22bxbUYZ9HvN+MDrirKyw0","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjKCenACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoH9A/8D01yVbzINpXwQfpYnQKwv6bCpjrXc3tv+vD+BE4cotH351nf\r\njralV5x9pVfOqHGKg8Ed0bIWo5V42jNwLOcLVfUGISHw6YJx3f2SzvJVEjIB\r\naRuIWJMl63z64EndPR+ajt/CrJnuDQPbF0R/13B4yWbo/N9XpXYsWt4Tp9Op\r\nF34aHtBPxUeBLMHA9NaFs7Fmwuli/l0FiXvjRaJw/Em2doEBkqRJujj0EfMa\r\nWhpj6IO9Z34eAp3XASwJzFcws/N3KPjEoLRVp/v5cMgyHErZhdTj/0CPv5Om\r\n+5M1ML8rP4r4IztqI1j9VGTswmOl6AA59AEXojWyl1u/IqOzs6KczTxWXcBR\r\n7PC2HWdkJD4CR2NuT1wDFPZSm5S8B6+DUa7qnKFVHL0Zosr9egsGkbZbAELC\r\nLfk4klmSiEF+oyP4N3+aYiNq3XlUKrA1Z5yxGGg7EOLkw58YdMG1Cvug87bH\r\nvrPV/w2/8OPPSyMvcR/oEwfJKb401hU+1NKoyq3jQn3envdH+y36acT6O2tq\r\nz2sF75/K0FCin+WD7trDq1cK4md57kM56QpAmxy4waEQFUZCAkQ7lIWgJmTy\r\nGU/4rZih1/c7zMTiYtqi+YuQr1HO3PRU6DKmFs8N6T8xpkuGN++uBDB8l6BF\r\nd3127KeyzJUF6F9ExGE765Q5JdeHjCa7/ok=\r\n=uAEJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-ae6f2b32bd4cba34fa62c21aceccafb4cab1c19e-16.x/balena-jellyfish-metrics-2.0.184.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-ae6f2b32bd4cba34fa62c21aceccafb4cab1c19e-16.x/balena-jellyfish-metrics-2.0.184.tgz","_integrity":"sha512-yc5EAIQt/yfK8q+ZmFfERiJb2QVLz2QeJW4IF+V4/go4G7poNa2PIHdsgU9P8Kp0JGJXVedUAm7wASMf82gGsw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-19T08:22:46.028Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.79","@balena/jellyfish-environment":"^14.0.10","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.1","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.184_1663575974942_0.9606967704901048","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.185-renovate-balena-jellyfish-environment-14-x-72a1cc74c1e6375fbd2f92a0e6c6ede9225d06c8":{"name":"@balena/jellyfish-metrics","version":"2.0.185-renovate-balena-jellyfish-environment-14-x-72a1cc74c1e6375fbd2f92a0e6c6ede9225d06c8","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.185-renovate-balena-jellyfish-environment-14-x-72a1cc74c1e6375fbd2f92a0e6c6ede9225d06c8","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"64fa23eeb8d45d9ae77343370086f6b3fcd028ba","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.185-renovate-balena-jellyfish-environment-14-x-72a1cc74c1e6375fbd2f92a0e6c6ede9225d06c8.tgz","fileCount":17,"integrity":"sha512-O4SGGOE6XIMSdk/bMH2O+4oBR1kvbNy0PMeEKmUMDieMFalFhhXxbTIieu5t1QVlsJm5TvbuGyceZi4hTIzOWg==","signatures":[{"sig":"MEUCIQD4S2yCV+BxVU/dznj8abqXJByymRRtvtzPm/CMD/DikwIgHUZ1ICjlGQCTqvp7b6el9A81nSm0E8NrhJTI+tZIzrA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68153,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjKGhIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpZ8hAAjQ5kmFe6wi9dyDUgIlAkK3/8tRpitTT3NNZEJ4j2zcaKbWN6\r\n3T7YrvaY/EciWZfPCsx+nfO7WOTFvYrYzCYPaf8XoZ0j2sOV+tgkRZ7EAYiR\r\nBz8JCTuihsYAjYY1TzGCWWGLWFos7bZNpcKKdyDFLuSc4lC4nUmC7DyMhNFO\r\nYwEkq5mD5RFSD7evOLwl1LL3SJfXfy7wZdcnguGIRwaV7mWXB5E+sjx+PSCt\r\nhsQoYGBFkRy3SvIkbGVHkpJM7eaH8REMN7k0LTnSewfltfTtJw3pFu1hpEvc\r\nj1uUFiSv6VoBtZwmfAg2eaKS5Hp6ZnX8vmqChJmJdmGLgPHQBkkNFyKgkFOo\r\ndlADrmVQRiPMa1yVjxaORg0WlhwuFdD/MMRrYGn4CrxxSerkGDCGgw3C5oF5\r\nB41IR2hLAG0b9F+wWBIm3m6VpXDujoSiX1VmRW7jCbyVZ8A1Vik665a8H4td\r\ny0uRUD59gH0qTfRKiSQqQO++e0t/+/T195zm+0r6f/8vzZ9BlQJWmwgnDQp7\r\n/6yzAn3Zvj+/lWJCnw6z/XNQ8oGg6vIOh6oGLHYEHsOq/RbUzTKMskB1y4Or\r\nY9mITWnYQT+2uGtKbg9xDrWT3sx4SS/30V3XjgKv1vHZdNbGZ5gu6SywQ2zh\r\nrTqzLU3hcR6lrGPm8VvvJvZMBA/xIuBsq08=\r\n=enlc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-72a1cc74c1e6375fbd2f92a0e6c6ede9225d06c8-16.x/balena-jellyfish-metrics-2.0.185.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-72a1cc74c1e6375fbd2f92a0e6c6ede9225d06c8-16.x/balena-jellyfish-metrics-2.0.185.tgz","_integrity":"sha512-O4SGGOE6XIMSdk/bMH2O+4oBR1kvbNy0PMeEKmUMDieMFalFhhXxbTIieu5t1QVlsJm5TvbuGyceZi4hTIzOWg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-19T13:00:32.935Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.79","@balena/jellyfish-environment":"^14.0.11","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.1","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.185-renovate-balena-jellyfish-environment-14-x-72a1cc74c1e6375fbd2f92a0e6c6ede9225d06c8_1663592520184_0.7966075908361563","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.185":{"name":"@balena/jellyfish-metrics","version":"2.0.185","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.185","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7215438cad18fcb0692f01777c4dad2d87a86ab4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.185.tgz","fileCount":15,"integrity":"sha512-RiueO7Hmezsn6hmqmYenvjkBJrXh5qd/YDbrC6b1v0x+vjfKgsdCnV/yUr4BzkLHEqC2y9p3Ry7bWUCnCEE7cg==","signatures":[{"sig":"MEUCIQC90KVlfgJHUpjhYRrE06oOuCYE8l8MewBH97eV7VrEYQIgetUftj0N6HRkHffNf7ajGkWbrnqjUuRH8kIQcgJliwE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjKGjWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrhcQ//XFCCIR1DXMiXD5JKT/upnFJoeJHClqH0kT4IwIjoCBx602dK\r\nxGLfD+nkRtzrkEQ41CM9+k8fqcC6wspjgJtRoDPb0o8MqaKwSXTUwESLKcek\r\ni7/lMX9Wv/kH3NzI1ACqE2a+ptJLoRVAfWauVmvAZvVGuEwqBkoGjztuBeNj\r\n5kWdzVt/rNQFlFiTv+exgukd/5vczoODQQWNd/uOB+43vSCiB7MMaVnajlPz\r\nRa2LHAD+Fh9PjsjskrtTGGCg/PpreR3QiYe5lUxJnqBvv30dLA9UH+mKo370\r\nrI3s79NFT9YzaTlgdLMVvRZCj+OxF4OSJ2fqUwi+BZ0dkuj2uXnYpz8AcxCt\r\nF3EoIL05a0E1weIt5cAgVdMTBE9PX1KeHpbzcgYMOV9XPax5/W0e3QKgJlSt\r\nTsBvyPygInOIpWJ00I0jEh7rN3jzW5XLTUAfbmYegT4OaCkSuH309m3IfrwD\r\n/9EtqbviGRSFVC+KR3DUrRrWGXXhAI6bJN8je/q+VmWs/lufYQfWK3BKp4v9\r\nw61Wcq0nDf7YB189FOgIq/Uw7aHvu2Cgx6zHTMC/c9E6VnHDKbUOYPuwzBYH\r\nIUkcqv9/2TSa3YuUecPKpAFszTN6Hc7f99nCbAPCUWQsaw8E1l7CLkXkkaI6\r\nxfyAxtv1CMdGT7fgdF4I8YsND0JLH18tVp4=\r\n=YmId\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-72a1cc74c1e6375fbd2f92a0e6c6ede9225d06c8-16.x/balena-jellyfish-metrics-2.0.185.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-72a1cc74c1e6375fbd2f92a0e6c6ede9225d06c8-16.x/balena-jellyfish-metrics-2.0.185.tgz","_integrity":"sha512-RiueO7Hmezsn6hmqmYenvjkBJrXh5qd/YDbrC6b1v0x+vjfKgsdCnV/yUr4BzkLHEqC2y9p3Ry7bWUCnCEE7cg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-19T13:00:32.935Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.79","@balena/jellyfish-environment":"^14.0.11","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.1","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.185_1663592662391_0.8075631709336053","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.186-renovate-balena-jellyfish-logger-5-x-5e97427e103ac719ac6925531ccd78d53976a70e":{"name":"@balena/jellyfish-metrics","version":"2.0.186-renovate-balena-jellyfish-logger-5-x-5e97427e103ac719ac6925531ccd78d53976a70e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.186-renovate-balena-jellyfish-logger-5-x-5e97427e103ac719ac6925531ccd78d53976a70e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"77bf0e89d528c65ffedb4732f4fd3bdff3d8fbb0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.186-renovate-balena-jellyfish-logger-5-x-5e97427e103ac719ac6925531ccd78d53976a70e.tgz","fileCount":17,"integrity":"sha512-fi4OGrDBh7Zr94AMl378ibxgbc9fKKUyIsMorx7qYg+mFq3dztufAepszzMMA0bCN63hwSK9fc8nsZ9XDibB4w==","signatures":[{"sig":"MEQCIFLdHzUka4Nb5NI4x419YGtUZLQxn5Yfo8//PsLDijzDAiAJAOXN6c7EiYJG4+zBEwGmDFHYG+Ic7Ey/GiGONhpWRg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68147,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjKGmIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpeJQ/8D1zhAYLF+axHH+Z10BdEviKr7sxi/8ZSoXlDFC1e3rUH3tV6\r\nTuKXObsjbK4vUKQLdyIf9SZ1HvmyoixeOLhy7uYmyHMIJ5H2CYHD+Ra7cJDv\r\nkbjwSDL0AJ3m5j3GkwLcnuiNU3J8Gr8CjvPBBHSOv7G9lRdmRKsBS/ct/PPd\r\nyxOWkZSrEDIzm41nKHgApD8l4nvdBWzuoIdY912bBDwpm5OsJQoyNDkd4nds\r\noYJ8OMrtIJQEJKsX5Hw0holUBqlMEglT2gWkWbMwgnEo7U/w9pGEzRCGaBQh\r\nMiOMfwXTG8Jl8enoYKZdrbbsZy+KTVehlhDZC4M/qecI/T1zsmaTROPR0PC3\r\nkX5rFisuSBDvXxf8KYwi0/feuDWX535caTcKAGWBDvKLWRw2LC+WkvjXdoaf\r\nd+4M+0SILrZ2PUMxhPuFDuEvd6M8NKYsW0szI2DOi2WzK9VtqakE1svOUqtt\r\nm9n9FksWzc6JlsFgqAIe3g14q76R/RQoNqGxGqecq7UNQ8h4hgYXvMDGSzZH\r\n8qxqiEW6e0STxDkV3jPZ07EAV1AVaS2VvAEXhJA3UXx6+Hcd6ZV2AArRo+i7\r\nVx3xg4EZcqBKSN5uCDZztPacH9CDh3u4NTIV/TAUQgEgPooG+uC9zZR0uIqa\r\nENemUPFrUA5ZkT1j+9rQH+45JY/WDrws1fo=\r\n=WRjd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-5e97427e103ac719ac6925531ccd78d53976a70e-16.x/balena-jellyfish-metrics-2.0.186.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-5e97427e103ac719ac6925531ccd78d53976a70e-16.x/balena-jellyfish-metrics-2.0.186.tgz","_integrity":"sha512-fi4OGrDBh7Zr94AMl378ibxgbc9fKKUyIsMorx7qYg+mFq3dztufAepszzMMA0bCN63hwSK9fc8nsZ9XDibB4w==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-19T13:05:53.441Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.82","@balena/jellyfish-environment":"^14.0.11","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.1","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.186-renovate-balena-jellyfish-logger-5-x-5e97427e103ac719ac6925531ccd78d53976a70e_1663592839911_0.5142684004524629","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.186":{"name":"@balena/jellyfish-metrics","version":"2.0.186","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.186","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5bdbbde3bab6cf80941e24f817e0fd4d04d02fde","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.186.tgz","fileCount":15,"integrity":"sha512-U5ijBxoOw8dAWJ23aW/B8X+noYB1I9lebXQbssT7pCNcv9EXc/LGCzA/cUm234Ca2UTgiVn1PoRxu4+GTn5qqQ==","signatures":[{"sig":"MEQCID0uvdsw5GINA/frvpDOyozb5//sx4/Ltf9BrafuqKPUAiAgszXpSdQuFg8KI4+n/nkZ67lP9OjR+uK1R1mxrysOGg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjKGoVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp7kw/9ElirEFqKWvPNH/b+zbspmp8rGsi0yz/Q5kJnwSemBiDd7Dk6\r\nDqSos5OnyJ5mUwvnz7gCDh13WR9ZCKNADeAUMdHWb4ar7JjrgI9exMmHx5WU\r\nzHRFmAarE37WkdwjfJr4oHBaUoTBRSudDgaB0S9BrWeJkfl2I3ST7p5y26U/\r\nukSsLIjGDurgorEJcFOdNTSt5/8GOL92h45YfKH1lF+gjJRZdP/8oputmiJo\r\npHn1NXCRuoT+ucbQPdwkBRfddm+8Yp7O1pd1v7nTvU/OFstBuyb2fJkw2Nyw\r\nwZPOjt7nTqf8j5A/6azkdDF3j0NDwnh+bAzQmqvtQBw0AVx6AGgdg1pzAC/d\r\nOYoHWSzQV4J5c/3SE8y7uMnyhL9ex9hWYhXvlo54As8RASoF/Gk3cWO12aHR\r\n5DbT19W06HY7VEdezdSmomfbz4tZF7jraXD+sO75i5V9VYz28qZx2t9drgAQ\r\niaZKj2xEY096586heGibMcurUgD4PhkFMbDkUPh8IkNfLX5YoQH8D1Uzznbf\r\nUK5MPqam6eP9VSwC+mhJMdSBj/WzRZmP9J6Dm1jqa5qUF5utTrcIi6jbovOG\r\nLFK24CN66FiylJfXT5NX9Ju9gpY2xtjbw3dagnlzL70yEHis7evFbhRUyf1m\r\ntYqr1xP/IgvwQFrfi5+sX12tfONPsdIZjF8=\r\n=ji8l\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-5e97427e103ac719ac6925531ccd78d53976a70e-16.x/balena-jellyfish-metrics-2.0.186.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-5e97427e103ac719ac6925531ccd78d53976a70e-16.x/balena-jellyfish-metrics-2.0.186.tgz","_integrity":"sha512-U5ijBxoOw8dAWJ23aW/B8X+noYB1I9lebXQbssT7pCNcv9EXc/LGCzA/cUm234Ca2UTgiVn1PoRxu4+GTn5qqQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-19T13:05:53.441Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.82","@balena/jellyfish-environment":"^14.0.11","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.1","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.186_1663592981478_0.6765316497774547","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.187-renovate-balena-jellyfish-environment-14-x-1eedabf61714558da19389452e8d6cd1663cc2b7":{"name":"@balena/jellyfish-metrics","version":"2.0.187-renovate-balena-jellyfish-environment-14-x-1eedabf61714558da19389452e8d6cd1663cc2b7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.187-renovate-balena-jellyfish-environment-14-x-1eedabf61714558da19389452e8d6cd1663cc2b7","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9dba3ca0be9fad5e70764e08a0d3760d939b0ad5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.187-renovate-balena-jellyfish-environment-14-x-1eedabf61714558da19389452e8d6cd1663cc2b7.tgz","fileCount":17,"integrity":"sha512-FRId2pa2KJ16kmRVXJlPcl+VjIgyAyEo7ILvT+OFw/OQL7aQCCtlrT5rqj1uu0uaWV2BeZFn8A2Xnnw+6PCdfA==","signatures":[{"sig":"MEYCIQDZOXUXJNZr0iXPBunpuJa8hE2EeBraT16vuIeOHnBXrgIhAIS3W6WpiG/UE6CdV1ffC/ZO8F4j51YmIZm9qi4iSV86","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68153,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLYMMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrQ7w/9FPThDu6Ev13GgN4XFAdI96/u6g2O90rQu8D6hud/WDkLGLK+\r\nrQ8nulEkEXLkMTIqOYivXG0escnwI2Jbg/CcE4TwaC97qPkFcwznVqRsO9fD\r\nFlTQD6El1Yko4WVCKy0qhvgnPD0EvHNfoTnMfX/YTgwr9WGSzr7x58UcJ+R5\r\nw727cnPDtEMYCGoIHy5lQEQGLYiSmD7gkHhG33AKNgm2BRD3Zy+LHwlTiHu0\r\nhnTuSZXIzn+jinsXE5RHV5GJVE20CvhQbuleJDlsKWg3KM43BTaco2t/cOZw\r\nrQyVRwdSEL821JZWLn7NBcIaWA8PGePKhZ4uJHYBQiw+aVgdsaDkhNcXu5jC\r\n7eQmHUA7NQzI4U61lpdHeaQd1zCvzJCQE15o9BbDT+vopADlQ+WQuDAoBlwg\r\naO7d/5UGW5Oens5IY+3QzHwQRGYs5bnxBXcanwH6szz4jDj4WVa3MEikkxnJ\r\ne/TKalnXSUjQ/4C4y4UxqUu8rb/YYhPZDIj4WlGdkiz6UrkAZbUx87oIZvZ9\r\nc9OdL10O55NVK/3ZDwLYfFcFtQ4oH5wArqnu8rO7/+JlqOsohhH1Kz4E+Pz+\r\nspv6VDgsGlvVflleuLEyLw4DuaZO+6Bo3K13xSqksw9vlCuJMJDwnCO4brP5\r\nmf9cu9xxojqMwEVJ6lceHwR1JtC25fa71JY=\r\n=UQSD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-1eedabf61714558da19389452e8d6cd1663cc2b7-16.x/balena-jellyfish-metrics-2.0.187.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-1eedabf61714558da19389452e8d6cd1663cc2b7-16.x/balena-jellyfish-metrics-2.0.187.tgz","_integrity":"sha512-FRId2pa2KJ16kmRVXJlPcl+VjIgyAyEo7ILvT+OFw/OQL7aQCCtlrT5rqj1uu0uaWV2BeZFn8A2Xnnw+6PCdfA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-23T09:56:07.472Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.82","@balena/jellyfish-environment":"^14.0.12","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.1","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.187-renovate-balena-jellyfish-environment-14-x-1eedabf61714558da19389452e8d6cd1663cc2b7_1663927052710_0.7407905333907661","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.187":{"name":"@balena/jellyfish-metrics","version":"2.0.187","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.187","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f4bd05fa007a53d7164aaa966f25c1ed7955bb72","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.187.tgz","fileCount":15,"integrity":"sha512-fj42ohRy3WNCX+8o9cT0Y8Au33tbHq/6wvYItxf9oG8e+KZpKIm9APoNPW69thRI2kaEDrrDFeUswvJGE9cxnQ==","signatures":[{"sig":"MEQCIC21Bqka4TX6tVuhfBQcuZR9CQA8SxWdTUdUJkTYNtEqAiBz1Mx83CqFPyMHkAN5feA5FKNwt8tgc6/yK84QqTi/Cg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLYOWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmperw//SiQQWJvWWeeG/5kynk6nyCGUjQbsIzwlDKJyoxvbrA6Eiwa9\r\nYCemROcKSCgg7456YKzdaJHTqR74SlcCGd4EbUV9wccG3pZbsq929jWLr1bq\r\nq+O1J9ce5vVVDeQGSWUpAOE38BYs9XHM7YdFQwyMcZyGdyQb3PEZ9hPJseLz\r\nizSyDfNPIBYTbR88LMOfoHoHjQvhKWqFyLKrXyhu5IDOy0tpg7VPlgfz+wLQ\r\noJ/P7q11qAsMBUpgoHiZj+l80iiJ05UZj3tB54n8IXkooiJrbKqQahGRKgft\r\nQ1gGq7Al/Rk0lG3ddijzzZHeN/t7vH3mbfX4NBenbSP/KXJFOy3Ld+icxKoL\r\nx2YT+lB1kzjMBxff82Jozl2t/0Qcd1kYmuycDY1qMarOM9Xf/RJsvK5QkrB2\r\n7dxVsVnU4iXR8HL13ADcwSnTxxFYNAUo2V+qNYWCOM+ClJH1gxX5PLUf03AZ\r\nB1RMKyT3d+wOXVsKFo0s/3Mr/ZrP9gKAI2tTxefMYluojhBU7khn9e7MNFSz\r\ny0tUMyx92NUXugbExVygyH/6z9c2LkVvwLb5bgCfT0DuxMYN9DLKR2MgrEPN\r\nDCXeFDK1OqeG9YMu5TwJndgLrmupXkV4aIHOjXVYlgHpe6+zG3DVVFBmmRIl\r\nCiIUsCtQn3iY+ABRAiPFuDNET+4x5Hb3N9s=\r\n=3TNz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-1eedabf61714558da19389452e8d6cd1663cc2b7-16.x/balena-jellyfish-metrics-2.0.187.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-1eedabf61714558da19389452e8d6cd1663cc2b7-16.x/balena-jellyfish-metrics-2.0.187.tgz","_integrity":"sha512-fj42ohRy3WNCX+8o9cT0Y8Au33tbHq/6wvYItxf9oG8e+KZpKIm9APoNPW69thRI2kaEDrrDFeUswvJGE9cxnQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-23T09:56:07.472Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.82","@balena/jellyfish-environment":"^14.0.12","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.1","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.187_1663927190735_0.42257492611096215","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.188-renovate-balena-jellyfish-logger-5-x-7bc8010c4c4b37177a55d614da0ecf5e893fb839":{"name":"@balena/jellyfish-metrics","version":"2.0.188-renovate-balena-jellyfish-logger-5-x-7bc8010c4c4b37177a55d614da0ecf5e893fb839","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.188-renovate-balena-jellyfish-logger-5-x-7bc8010c4c4b37177a55d614da0ecf5e893fb839","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7e493c1c55073761eb646fa7d37a8044ec685828","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.188-renovate-balena-jellyfish-logger-5-x-7bc8010c4c4b37177a55d614da0ecf5e893fb839.tgz","fileCount":17,"integrity":"sha512-4CCkRjLtBIDN+iGWOMefCiXgbiI+9om2nQ3OpKcsHl4OPXc+IocohlUFM4AOrmQOBcWFOceEt0qeTeJdccjEhg==","signatures":[{"sig":"MEYCIQDKfZKeNnJc+emHQN2l+oflLZxct2WsFkgOhfHMXVhE/wIhAMfIfTNpt393u8qbHRyksu27SQdZBBll2JkL1DkxhC1i","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68147,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLbFAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrtPw//T1YqMnkr4vyIoLk9n9W42SgVZi5U++fnOkYFalZmOXK2cU39\r\nBVLQZgFgFxUO+qGyxvmB9IZeEGWw3N4G1iiX32aQscpVj4S0RWVUEHdhN19i\r\n9po/EUfC8QJFwgffcu6aQI9fQfaYHYZP2sQdPKbS/V/fYSCZoxoj/CG1oYLD\r\nijYtDxrnCl604WaLfLkUNwmvVWs4LL8Cyzz+5VdFcjlZM+dXtBJ3nBTjtxe6\r\nipcfVdWkMtP1Yc+hCm5D4/gSq5RekSv+/NyIwD05M/AYDD9DYWBhZOyfi+rl\r\nvdBabrKTQWRGKExuiZyRjkhq8Zk13bxXEC3ARkh4cBop5emHsjkjk7XARyhq\r\n4Yh/R2ySIkoPjCy+G9LBW1GsDNH39JMyLu6dj3SRXCpl4RmBtt7EVc/iojXG\r\ngkRbZt/4Y+8PIY9oRLwTZoj+g2NK2NSH7SwYcp18Y4ygWe1l47pBfdJVJQ8i\r\nX2QuX9KZ5YJEdIXt23V74heBsKpkuZcc7RrN2o01CDSdF+o84Bwgn/8D3rwT\r\nBVs9jJP1WSGFv3NMVtVSJ+AZJWir6W/KZvQGPvF5uTM6p0EMl1JIRNJsYbzI\r\nwWB7DWPDz4NdQmuiVDhR3/eMmn/2y8LPOKJYhYTztqKDZDF2LUdG7Dh5nFJD\r\nYfuThCX0r5xDumQ4TTW2y8+9cUbo9tA65qY=\r\n=oy3A\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-7bc8010c4c4b37177a55d614da0ecf5e893fb839-16.x/balena-jellyfish-metrics-2.0.188.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-7bc8010c4c4b37177a55d614da0ecf5e893fb839-16.x/balena-jellyfish-metrics-2.0.188.tgz","_integrity":"sha512-4CCkRjLtBIDN+iGWOMefCiXgbiI+9om2nQ3OpKcsHl4OPXc+IocohlUFM4AOrmQOBcWFOceEt0qeTeJdccjEhg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-23T13:13:22.760Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.83","@balena/jellyfish-environment":"^14.0.12","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.1","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.188-renovate-balena-jellyfish-logger-5-x-7bc8010c4c4b37177a55d614da0ecf5e893fb839_1663938880750_0.2461479522035943","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.188":{"name":"@balena/jellyfish-metrics","version":"2.0.188","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.188","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0f047c50da2a7eaf5fcc7d0f185804e1cb477535","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.188.tgz","fileCount":15,"integrity":"sha512-/w4n/YlEtjx2zzdSq4W5IeV+moUcRM/0gL71Lc5emflIROBjyODB0HNfTHZcqcqSN43yxs1r0/WjGo/wH46TLQ==","signatures":[{"sig":"MEUCIEOQOxRV19nLEKNVD48cme5RXHHrXtiJvAN+H5J5G7P5AiEAgtKW4vN2P24L1I19RotjoQbjPZ63D7cy2ATy+pO53Ro=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLbHTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoC6A/9H12hM5YxwUj3YHKSfo64fpjF78mx8priP+5uilFtvtFLIOlh\r\nyKn4cINTZ3rhKqKKnHwMEItjYkSC8sc/GVD1O/vOLmtKD15/SRepvF0cV9e+\r\nXA5po+Hk45Mevjcidl+AmvkxYBcHzd09JtUwW/hKhmYkajhuy+w1iqm7elLL\r\n/vO/J/+icG5/NQCbFC6Wm/fdP3Bu0IbuV3esPqomNSK1KaXBH5ZMocKU99TC\r\nrriW+5c98Ss0loCwduCll/uG+pU8aDHD5oHBtf7q8SSCkyaZhinuBRVyRohs\r\npa9FZXRDtywMI4hGdlr+JZQhgoA2S6GFJb5Dg6To/HE32E8I2My9G9spsGR6\r\noZc59qdP+XOdF8EjCDeX3iCkT/5DoX0V92yOE9Q1jx06l2my5vIOBJrONmmj\r\n+fX16U4nq07YWIE5o7qW28cahqDvcNuSiU+htfqUUt+aXoMfphAj/uRhi4dU\r\nU+IsOPyq1s8FnkXCK4vZwCHWBl1nhaoi2lKX4vZPzgy1tmihB0AAksVEzVAA\r\nMHWmKUg8hw8IjWNT+HdjFwTIc84TuJ2jRkjZF3Q3YS+Yb0vsdIK71hPIjVpL\r\nUcqyGu+R8rswLZJq9UtLtw3kVVvNVVOYuY6JQNfYg8RXunj05VSKOKNG655g\r\nPU42D55cEPcApE00gGmPWVP5M4yTozdHMlg=\r\n=PbyI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-7bc8010c4c4b37177a55d614da0ecf5e893fb839-16.x/balena-jellyfish-metrics-2.0.188.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-7bc8010c4c4b37177a55d614da0ecf5e893fb839-16.x/balena-jellyfish-metrics-2.0.188.tgz","_integrity":"sha512-/w4n/YlEtjx2zzdSq4W5IeV+moUcRM/0gL71Lc5emflIROBjyODB0HNfTHZcqcqSN43yxs1r0/WjGo/wH46TLQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-23T13:13:22.760Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.83","@balena/jellyfish-environment":"^14.0.12","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.1","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.59","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.188_1663939027440_0.6868284468759527","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.189-renovate-node-16-x-3b05c25936e29cede92ac76405d808f73cdd0818":{"name":"@balena/jellyfish-metrics","version":"2.0.189-renovate-node-16-x-3b05c25936e29cede92ac76405d808f73cdd0818","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.189-renovate-node-16-x-3b05c25936e29cede92ac76405d808f73cdd0818","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3138ebb212565318c65d41cac11ed276b2ec7242","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.189-renovate-node-16-x-3b05c25936e29cede92ac76405d808f73cdd0818.tgz","fileCount":17,"integrity":"sha512-Zy8sWReAwDSvppRmsL1FbSRc0rgNRoHcEW0Gvob8XmIiSwuSgVenWl8D9K5LeS1orcP1mjS45wm4OBgEAqGR3w==","signatures":[{"sig":"MEQCIGKG5R5P2B9DucEvuIljxyvfapiT13CdVv2EG4XZ6LR6AiATfiR2wTjwkCgCbm7yzCM9ib9cfXnzXiG5j4DJFwiPsg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68129,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLkvEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrBVA/9HR+cOl4baxDPHeyFoypKq/objmcJ/knHEo5xJ2zOC79Jef4O\r\n2Xsk+foU+nk7DIF+ceKBDN+9NBeEbAykV4+Pk7VvVxyJgFinYjaHeoKinUQI\r\n7YpVGKfGGgZjt3vTzVLT25fdoZVG7lP1VS3oKS/xRlQspA/Hs1aN0wR5iwdP\r\nRjwzOvkgHOqrYqXyzrMM684UupK8UHCJsquEnbeaa+Aq0J/u8UUjN5+ea74d\r\n5JHXUSQVS1XX0igTkJ8bKJYDuYVYuKz6cucb9VjrRugjznq7jHOWD1itE5rU\r\n5+GaSJfdvMwIWmOfGZJzqcYKI9WcIouVpaRPJWPPuVLxija7EEh1lvZpueAy\r\nYsIhgVMsa+qGEfbdGcnklBLqlbqSnsgMnE4d0Qa49gWZqWGZo7ixFo018c34\r\nVx+FjQI6+VbHiMm4myAbKnaKo4D6GIR3dvg6NeU2ORwJAPghEMcjoxfTlQqt\r\nPtBZCm1kgHZoZAVsF3MjCjJZ8nFOuyY2tcceDiS5FiHwwLHkSCS+6gDb2NkX\r\ni64wpDFX1Njp1UpAfCLbiImRjXUTxur7Rvgzxt2ls9cCOAmChqJ/rvc6g2QN\r\nKISw2yrdL+Xg0X/4g88odV4J3f0O1W1DrsC/WRmte9ESUpJ4cHvNS6FiBKvc\r\niijJSj/q+zGsOwC3ebyZBq1w8BNTQe5/Igk=\r\n=A6f2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-3b05c25936e29cede92ac76405d808f73cdd0818-16.x/balena-jellyfish-metrics-2.0.189.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-3b05c25936e29cede92ac76405d808f73cdd0818-16.x/balena-jellyfish-metrics-2.0.189.tgz","_integrity":"sha512-Zy8sWReAwDSvppRmsL1FbSRc0rgNRoHcEW0Gvob8XmIiSwuSgVenWl8D9K5LeS1orcP1mjS45wm4OBgEAqGR3w==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-24T00:12:48.374Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.83","@balena/jellyfish-environment":"^14.0.12","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.1","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.60","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.189-renovate-node-16-x-3b05c25936e29cede92ac76405d808f73cdd0818_1663978436072_0.3064315642897122","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.189":{"name":"@balena/jellyfish-metrics","version":"2.0.189","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.189","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"87367b6d281d2512aecf0c247984cdf3f3c915e2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.189.tgz","fileCount":15,"integrity":"sha512-fvtNSEx5mF4Rb0xotqFiYuDWUCcIOGqhux9IBVHWNIGB3ef0l6GhaSFjE1R2pPJtVCsAbiePQtfBibLyziH+vQ==","signatures":[{"sig":"MEYCIQC8g+KeCYDwW2XmfjXambQdGNr47vGWieed54AKVnpyAwIhAOHD2puCwClwBJlGyUxseIwlT1y5n2SxRHglGTEFJhMe","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLkxDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoezxAAiKe8SqC67ORPcgvKcjXpTsSlx3UL3lmTig/y08UgekyCMD38\r\n2t5HP82lA7poCnG2EGFP+CrNX4e+oco/BWgQLREiyYkPxbyqIEdDL2fmqzVa\r\nK9OiufPCD15/w2Bbnbs/6YpDsdv5tkCQ29pSB9Xwrm58dLHI4GsLfolBkQuS\r\n/upBgRcpGu0XP74vyiqs+X2+TxNdW84N6nVlgv0T7Did+D5J39CVn8K/oPRL\r\nxeLcTdFQVSy0Ebey/AJD/Q834K7oISkYcZftvObvr4OdBkxsurOcVyQ0lOT8\r\ngILa46hP4rpgzEbYfqZSnmqdtX7yHhw6SJLy5zTzCqQ2KrIsEhGg5noG2pJs\r\nkyBJSIGrKBY73yOfJX43/PkhV8zOsySYjiKDyflXfOwG5dugOvmaebayMshy\r\n4caouUrsKLtJVU4YDNe2dIsoihBjMVqPiXHEGtTfNeUhMZpssamar5MhRKUp\r\nJIbo5TEqB7h/sslgI/AWniX7LvBJWqQ/Qe3fBda+WaiIt39A7YR++utjeXIk\r\n+7yMYIRdlunBvSnlcUUEyuias4pkCVDLib7KYvM668zqirzfEcF6oi+a3/xE\r\nkX12xtUhYytWQcdMesT7WujI6j2DJK4jvW0za/RpbLa6/0ntoQvm1h8IX/GD\r\n+lnGi12EDx6ujEY5El7xT4VNTtsIeTtmqt0=\r\n=X3hq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-3b05c25936e29cede92ac76405d808f73cdd0818-16.x/balena-jellyfish-metrics-2.0.189.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-3b05c25936e29cede92ac76405d808f73cdd0818-16.x/balena-jellyfish-metrics-2.0.189.tgz","_integrity":"sha512-fvtNSEx5mF4Rb0xotqFiYuDWUCcIOGqhux9IBVHWNIGB3ef0l6GhaSFjE1R2pPJtVCsAbiePQtfBibLyziH+vQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-24T00:12:48.374Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.83","@balena/jellyfish-environment":"^14.0.12","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.1","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.60","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.189_1663978563128_0.8073171891232673","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.190-renovate-ts-jest-29-x-f923e686b8dca454eca1789535f7e010180c0523":{"name":"@balena/jellyfish-metrics","version":"2.0.190-renovate-ts-jest-29-x-f923e686b8dca454eca1789535f7e010180c0523","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.190-renovate-ts-jest-29-x-f923e686b8dca454eca1789535f7e010180c0523","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a45140921ec95e1106d5b790633c3d6a1483fc55","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.190-renovate-ts-jest-29-x-f923e686b8dca454eca1789535f7e010180c0523.tgz","fileCount":17,"integrity":"sha512-B/WnAi3/TdaRd9XQEg3a1KXtGHaos3CpwKsyXErtCxKDvFWd5ycqjffH00mgYA3YVOejw+/rpInw+3ZnnAU/gQ==","signatures":[{"sig":"MEUCIQClf1UuHWQM8yFRf8xFk5tv2EupQ7lR/4xvaiUPqiFFkQIgJ+zkwA8yo1BBi+0QdYya3iLyrHhrJchVl77tyVTXTMw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68132,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLtwwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoixQ//eoYrZucEFz1ruzkBzsJHab7LJMiBlWSCuspIzcscXUTwsMs1\r\n5zxCuCFX6qeyNc0GAcgEeabEPtSJunZDk1RaLvWftyehfAVtlhllbPamPOMR\r\nZHsMjb0Q1FJ9lSXlhuE5Ds+QXpTWjXyrezdGIfLiv24kBJBc+VW7399FtiM4\r\nvzOFnVsuK/mSjvUkatey3O+6UhrLEfR9MNQrcK5yMLQURNB3JAkP7TMonbAM\r\nAnVyGlMg5VwBMQOdren2w4CbizY0vFdfbHWqxFEji7guv0MY3mFgM1PvWnz5\r\nFXPJnF860HvG9JkA/8NfaUatuE4gUjz+taze/dwst8luNBKTqcYkfV12oEry\r\noUJVlZh86INaeaJe9+99SDCo5AFpqRzYuMv+4Smuv5Hb+YT3v1ng5dPISZ0/\r\nld4Ymf12ER1ydVuDfGYpKRfTrc3nLpjP5r4kecW48fazFiXO/6T5Y2YArttf\r\nC9cb0/2mvwt4lvjuRBKoylvWECo4dvLBvjaOz6x5uDZzD2QrBnqu/P9n9wa1\r\nhqnydEaRY3x19L3rQB13p/2nNZ61sOfYznLpfwSqh+T2UZCdhUzOw1L9XVyy\r\ny6dYp+tQAqgfJaNby0Y7kS/exef5JIIyqmW2pPZWYkLLeijsD8nZqwBan0eo\r\n1xKo1T8GapJ3xSt81saf17ssZ/rxNAMYu3o=\r\n=1mf2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-f923e686b8dca454eca1789535f7e010180c0523-16.x/balena-jellyfish-metrics-2.0.190.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-f923e686b8dca454eca1789535f7e010180c0523-16.x/balena-jellyfish-metrics-2.0.190.tgz","_integrity":"sha512-B/WnAi3/TdaRd9XQEg3a1KXtGHaos3CpwKsyXErtCxKDvFWd5ycqjffH00mgYA3YVOejw+/rpInw+3ZnnAU/gQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-24T10:28:42.762Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.83","@balena/jellyfish-environment":"^14.0.12","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.2","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.60","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.190-renovate-ts-jest-29-x-f923e686b8dca454eca1789535f7e010180c0523_1664015407923_0.19030751944746527","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.190":{"name":"@balena/jellyfish-metrics","version":"2.0.190","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.190","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"06f76f75ee148f1afab4c198c7dd8ae56b0eb35b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.190.tgz","fileCount":15,"integrity":"sha512-lqNUIhk5aNAiqTXB9cbWe9UsrhjXPVVanGRatDXMtDXCX64/FkrfGcHHDbg+O9s/xLswWoJUDFUSawyezMG+jw==","signatures":[{"sig":"MEUCIBgoIxJfyM03qamlCqjjEpQn3lMmBzHBlAt5uGSqE4v1AiEA60hhOjd10M1WUoNKWamEH9ErMTuEQhP42pPkHdcqZF0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLtzCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoUBA//XyU9/EjRu6j7F37P0Zvj38AyXgnfaMQ61b9ETr6UQp12tkwr\r\nfgGDQxi5G+0Csgl55l8wvBe149dpBd5KmU9Gw4mQY1N5CWi5pOl8w8AKZM+3\r\nulzTYOvfAehlZzzVZ+wT3X7ocISKiBTXH1GdfDYFeoEf1b9M+kDmw5YFugU9\r\nlGQxhSUU0UMWKTECXXFZjaLdlzJzg1bmAK1j2a6NmCcRD9X+X6FK7k2FWUrd\r\n4CEwTF79/lodiTEU/rrUBc8ghQp0t+qphFcmcF20l3+XDuU+dC20rwUeemWJ\r\nxEvVeLKtZZ0j8QT6GpMrL/e6M1MQlF0c8k4NjiCpJ7eF5erNt/fdzwFla7xW\r\nEs17jL62dcXsNYQmE3+hteiWkLtS+oqxyMot84VYzHRra6j6tpcLYw0AnZId\r\nha9PxfTBYZUIKfp3LhzrFH3JafvD0TgthgU7qVxHfc3XZWNI62W11eNkJ30j\r\n5rQdaRTtDEkSN4XnW/r/2M7/5Qmkb+wzU6VDJs503A0A7bapDkAh2sn7V/CT\r\nyeqd27uqvz71ib1sfte+f3RngXJ+07tr30r9nz+eSNwRRF/PZI/2kitvwkDS\r\nBiFihyDpVKihLFAmvw3gPcPXUjtnocWhS30E3MyEf9Q6oR1zaR2MdVQaPe+9\r\n1cf7BF0ZZRvtBMRa2BsH+OkZ3OeuON9E55E=\r\n=8/oH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-f923e686b8dca454eca1789535f7e010180c0523-16.x/balena-jellyfish-metrics-2.0.190.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-f923e686b8dca454eca1789535f7e010180c0523-16.x/balena-jellyfish-metrics-2.0.190.tgz","_integrity":"sha512-lqNUIhk5aNAiqTXB9cbWe9UsrhjXPVVanGRatDXMtDXCX64/FkrfGcHHDbg+O9s/xLswWoJUDFUSawyezMG+jw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-24T10:28:42.762Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.83","@balena/jellyfish-environment":"^14.0.12","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.2","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.60","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.190_1664015554430_0.6251474115640392","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.191-renovate-balena-jellyfish-environment-14-x-326ab8dac70c903e5068ef49712bb32bdfa187a5":{"name":"@balena/jellyfish-metrics","version":"2.0.191-renovate-balena-jellyfish-environment-14-x-326ab8dac70c903e5068ef49712bb32bdfa187a5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.191-renovate-balena-jellyfish-environment-14-x-326ab8dac70c903e5068ef49712bb32bdfa187a5","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0d2ef6dd47a7de0e59cd5687db28b658ec02b936","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.191-renovate-balena-jellyfish-environment-14-x-326ab8dac70c903e5068ef49712bb32bdfa187a5.tgz","fileCount":17,"integrity":"sha512-c0Ej970aAL6OQuSkHkuhoj4nDop2CBqbDqNWwEsBRRSkotWGJsxmLP7A//UBdcPP3h6RUreW/vWvEbj9LDzEYA==","signatures":[{"sig":"MEQCIGDIUcP9dZaJustRM7z45Y+z/IRMjfZHlfCcPzoivcjhAiAc1PyolAyYA0fO5ezT4nJNcG5waIQJ9bP7OGgO6MZavw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68153,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLwkkACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmofag/+NugMcCGiPUm285k0hEpvkqqA3no/Y/Omhxz5+WFglpzW3YzP\r\neNO+TRHXxL7atm8sPdut7/pPVG203XW4fPCKYx7l2Jk9jHgZ2KWHOFwMfCXT\r\nNZUxbtAWCL4nEiwLTfRKz3hN+1KcNY7nWdiLJB/+Ke/d68Ryn5XmOaOTixmL\r\nXieACZQ8Yj8W7QG5+SGqrUwhrtoU2BbFCMat+QddufU0HDFM8/getfcXbgK7\r\n9bGsTlukq6py/CNn+quXQwzHvZRsPyIme0/RvzQ4U5jS8Kt3J0DgiQ1vJNob\r\nv7AcK23J2yPntCajyKo/+IGHKtS0pU/4H5pwZskUz4TSAZvUrA/OOEdxsYBL\r\ngmWacI1rib6rzYoIA/F0pEyI6h1Ftf66J0zICUZ5jspsGidB56VeOGdvMUDd\r\nyf+NcfLe9WwKqYAnO3W951pGDNY1nUeDStzVdXYz+meWxoEELsCmLwZyEeuC\r\nD0RZ2x0ff4q3au+jnzUkrAZgZZUr5+TEhe5fWMSFna1TzgVn0OMdC9r5kgcP\r\ny8eEE3HjrXJCJn5IM+NAw3cEHL1z6mGMrfbh/0Jye+Q2ZIoe0utKD3NB2/J3\r\njGC+C30muVELms1el4OG/I4dZMDCWZVw0yHjUloEIaX/oVxmigfsaUPxLwN2\r\nq4HaoOFrP2bkRqJ26zTXk+sA/hP/3YP+I1k=\r\n=Omf0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-326ab8dac70c903e5068ef49712bb32bdfa187a5-16.x/balena-jellyfish-metrics-2.0.191.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-326ab8dac70c903e5068ef49712bb32bdfa187a5-16.x/balena-jellyfish-metrics-2.0.191.tgz","_integrity":"sha512-c0Ej970aAL6OQuSkHkuhoj4nDop2CBqbDqNWwEsBRRSkotWGJsxmLP7A//UBdcPP3h6RUreW/vWvEbj9LDzEYA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-24T13:40:40.237Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.83","@balena/jellyfish-environment":"^14.0.13","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.2","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.60","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.191-renovate-balena-jellyfish-environment-14-x-326ab8dac70c903e5068ef49712bb32bdfa187a5_1664026916002_0.15103462692590996","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.191":{"name":"@balena/jellyfish-metrics","version":"2.0.191","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.191","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"59feeaf8e17672f39fb74aa539acb04219e33003","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.191.tgz","fileCount":15,"integrity":"sha512-opnJtLHzHHLXWdtje+BpCRNCg1wNCtOtLhQFknNtZsqFSiraECqJPbGC1If9E8FJEIxUGoas0v24dACXZBG/Vw==","signatures":[{"sig":"MEYCIQCqP0i/q5htc2cFIaZzSFDCo71ajD5zTRSzvaVQdIxZhwIhANecgeUCRiQLllfu4x7Txa/Dt8YyT2BMK/TzbhEynGc8","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLwmfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpRTw//VjIIzS0Fc4Eul2ICqIWXAIJTSdNrEn+MQRvGUtfhVYjhmEok\r\nciKOt0DPZVp77mhTwLKUDA7mdYJ+y1pN5ws9dvvUGntPMV6IXoeL4V1TCUS8\r\nlykwQne/xqvW20o/NNPL9BchGpKuhJiZDQVw/wMOUO6Z8k5Jn42bxd9fcdGy\r\nGjvb7fAl6W98J5p8n0Po9v1iUenLK9BnBJHyGlOskh0ZIwEQlWUOQsbVyCPG\r\nAFf3Uzw4w3ipRdku9cujbj/zeKs6kzAuNI0pUHoY7LXEgaidwQCLXyYvTUVG\r\nEOIEpTcQYuDklG9fRM+NrsRmBgY+UNQbjtRwuMUTC1hr7KVsxRRuClJfi6mJ\r\nYqZnj9brIGrFfvbptlwmLBpRD3T861+br74P4FI/D4Z/PxEtKpEOSowE2pOJ\r\nsIAfltzdbmqaSixFW397AeedVGJ3kipyvqJevN1tT/YE3tptQkkTIL6gi5jF\r\nyGchY4PzOhwEpezJO98P8VbFSi2WrpiSlJp5SqM9mUuBlLaqa4DvBDu+2Lti\r\nML88CGKWBGmlf9vOJ6FhwIIORb9/D/pSpr4t9KsfI5fpXFn/ACkDg+BkF2Y3\r\nkFr7ajmEH/SuBZ7++FhmHLnswSCeVkUlSz+kpGM6KOP7P4MEmul67NHs4X5M\r\nXwd38wNZB6/glOzhB3NDSzNHeRGMoSvu+xw=\r\n=+oHT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-326ab8dac70c903e5068ef49712bb32bdfa187a5-16.x/balena-jellyfish-metrics-2.0.191.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-326ab8dac70c903e5068ef49712bb32bdfa187a5-16.x/balena-jellyfish-metrics-2.0.191.tgz","_integrity":"sha512-opnJtLHzHHLXWdtje+BpCRNCg1wNCtOtLhQFknNtZsqFSiraECqJPbGC1If9E8FJEIxUGoas0v24dACXZBG/Vw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-24T13:40:40.237Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.83","@balena/jellyfish-environment":"^14.0.13","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.2","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.60","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.191_1664027039426_0.7636980011024064","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.192-renovate-balena-jellyfish-logger-5-x-81f8e5cc614947ff617994018fa2576fab8af353":{"name":"@balena/jellyfish-metrics","version":"2.0.192-renovate-balena-jellyfish-logger-5-x-81f8e5cc614947ff617994018fa2576fab8af353","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.192-renovate-balena-jellyfish-logger-5-x-81f8e5cc614947ff617994018fa2576fab8af353","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3bbf7dcecb6056acd8913de1c5f0e66070f04158","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.192-renovate-balena-jellyfish-logger-5-x-81f8e5cc614947ff617994018fa2576fab8af353.tgz","fileCount":17,"integrity":"sha512-qwUltvGKIFnQccLju/N9whJ6igXoBduW9jsjipEHvKJMpnZsbOgLLm091e0y2K6W3v6p0yp6ga8TFyAX9CDF+g==","signatures":[{"sig":"MEQCIGw95PEEAMarC+GH8p9FWexz1jMqq7O27MIVnmwZJCbFAiBbD3v5TYpUSamRbO3n0hCS7vlqAJb6BdxjI1HMRbtbaw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68147,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLwo0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo5Mw//TDRXyBZKn09uuqtToYQc/aKGaKY1PaUvwBOY5v6iPkxvMKWS\r\nFOjl16KTNnNiExsCrP3qScXo1mQWue7t/V9xa9uyliaSRu47H+6AwOYguny3\r\ntNB99B9klQLOJnFkhUn0Au3/hdWCxNooc3OpXLeA5nRA0Aldw/M48htNW6HQ\r\nEnnwBAt9aEuwPtCzv6M/mWTXxp8g0Dohqo0M6+ciwlnPuHrY2K6gZUs0iD49\r\nQUZDPxnMlmzyCI2v4c69frBppLskN9tDzXCNJ7b+i0q1y/MsAy7d7KB2Bhj2\r\nW+SQit6WidT8eYdhkUKPjK6XDGF3BYxvV9+kPmPlv8wV2kgdxcMpnwHzVjf2\r\njZ9LRUHmhyzZfpAM12GKbo4pJnfeud2fI0mYl7jG855QaGGRNgNcd79rL0Go\r\ns1J0jWXppk6k4WfwGZ5oOTlKt1vE0BgH0l8pdTpxhRVIlnFm//HxxbRbHeTl\r\nn+i+9j73dAAYZzoAfVukLiUsJv4/lgFkUj3LpFsViG3UePIDS7AFApbE+knW\r\ntdDfAz+H/ULco/L7jujydv7YEv75SIH9DD1dRL9ykEAewpsbrITlp8iP2hfM\r\nOkjlH3ViNLpSjlHnNMB1uSJsyRiGtcOjw9R8dVzjGZubUmxwZQytpRk/L9ak\r\n7qBkVi7KDwOok4QavY68I0pwqEzmjwgMQnU=\r\n=9qeS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-81f8e5cc614947ff617994018fa2576fab8af353-16.x/balena-jellyfish-metrics-2.0.192.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-81f8e5cc614947ff617994018fa2576fab8af353-16.x/balena-jellyfish-metrics-2.0.192.tgz","_integrity":"sha512-qwUltvGKIFnQccLju/N9whJ6igXoBduW9jsjipEHvKJMpnZsbOgLLm091e0y2K6W3v6p0yp6ga8TFyAX9CDF+g==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-24T13:45:17.567Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.85","@balena/jellyfish-environment":"^14.0.13","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.2","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.60","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.192-renovate-balena-jellyfish-logger-5-x-81f8e5cc614947ff617994018fa2576fab8af353_1664027188411_0.8081100354126571","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.192":{"name":"@balena/jellyfish-metrics","version":"2.0.192","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.192","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"15f818f8936ef7b041abef380a98fec2ed627ffc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.192.tgz","fileCount":15,"integrity":"sha512-CubehdKrVV5WjEOlLTfvKcvioRPLxgKHvjJWOdui5Q4P107rtYDggGRpoG+soeqwtlcwPAVnIG/FaX4VTbttTw==","signatures":[{"sig":"MEUCIGCScaaMIQuB6RCXlq8yrQBaMr4aB5Sgc5BcyyP24Mm3AiEA1xWgHoRKElyPfTkuCx+nD+GF4e+Xjd/NpdJnKSJ7XuM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLwq8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmorwA/+MiD0cf/KSHYdEjdJFFUBA4tlDi//ukunFY1Gp/vD/gemYi5V\r\nGDEzji0zi8Onk8TMyXCa2EJwCct4Fn9zLsfB8IJRrT8FcdwhShKWP0E5UgrP\r\ncwd1HmRZA48POPYUpBbGxYs9QgkNczLBQ+mXPN347A3RPNGKVvZoidIBigd1\r\n2+6a7keS83UHcRqfx6zoUbPYLIBfyNpbpB3Tx+49bAV3JsZXQA3u1Rh3xC+y\r\nwE0dL2AIVufjRgy5S3hP7T29svljXZrfEbTcho+sU8TmLgHloDlSAznWckdZ\r\nPvC+MvOZ13ZJ43GQ0loTgI7NDPa/CuOU6P+r0yuaH/sqLbEUY0WA+RUAPy2d\r\nokIyJYYUCk+j7+DlYcu6/oUWuvQszl1ckgYM1QmNQT2Ihfcehz1vmj4KwnnO\r\nA0bcEvLi8JiOt7spzhBlX+avkhJmMn0XQCI28P0OfEV/kEzk6uP/wxgEmzeU\r\nkIfnRWWTjoLbMLUBc65EDmuFkyReHpnyIHtYhQsjicRB6jrxHmDupXwW+J6a\r\nIehw95Ah7cmYfQSg+Ca2LpnGePCPr4OmH7ioGTwPMl+rN+MKE05TbjMnFwUN\r\nmq8wd3He2i4tl3Ccp/J0lb7rEnujFPVXfPLkmqw7ayWIrnF4CzUY/H5scKAs\r\n8ozdNmx+1zwXPk7oouMqnFjOSGFeo9/ezqo=\r\n=oWn9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-81f8e5cc614947ff617994018fa2576fab8af353-16.x/balena-jellyfish-metrics-2.0.192.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-81f8e5cc614947ff617994018fa2576fab8af353-16.x/balena-jellyfish-metrics-2.0.192.tgz","_integrity":"sha512-CubehdKrVV5WjEOlLTfvKcvioRPLxgKHvjJWOdui5Q4P107rtYDggGRpoG+soeqwtlcwPAVnIG/FaX4VTbttTw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-24T13:45:17.567Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.85","@balena/jellyfish-environment":"^14.0.13","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.2","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.60","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.192_1664027323906_0.8474830745802231","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.193-renovate-balena-jellyfish-logger-5-x-a321e38ba055b9e9eb144967e3cea9b87cfa1b38":{"name":"@balena/jellyfish-metrics","version":"2.0.193-renovate-balena-jellyfish-logger-5-x-a321e38ba055b9e9eb144967e3cea9b87cfa1b38","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.193-renovate-balena-jellyfish-logger-5-x-a321e38ba055b9e9eb144967e3cea9b87cfa1b38","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"506628633343e2b1a2ec746a9dc65dd3b38fbba2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.193-renovate-balena-jellyfish-logger-5-x-a321e38ba055b9e9eb144967e3cea9b87cfa1b38.tgz","fileCount":17,"integrity":"sha512-PHxcYjMzsktExVuSnjSFhyxM6Kn/QUZ2ZsetzQ2jhQWAuRAvB8IDXdCjh8xkhPbToClAdP5iqTa4uFqP8DALwA==","signatures":[{"sig":"MEQCIEWUmhnD733VxO7rUcVzm+LOBLe1Fnk0IT1K/1X+FCz2AiBWWOJWlXDSxlq7mlnS10UHkOb7FecLDG0py2XoZOisUw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68147,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLzOfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmogMw//bCt7EEU7wUk68O2QE36jXPhtHGfXSqnpDpnsFo+HmTVgwR27\r\n+UFCwWDVsmDj0Lk2Dwr9zZj8LHWOD03fho+HitQp63wwxlEoQMtfaQDqkn2M\r\nYlV/YgSKOGglBUUN7mb+Xlh7Qohdbdh09Sfc7t8anHEfitVfvoBSsBhk25ob\r\nhg85XXUYLjr6Yr2x/+r3uEpQ/O5OCs+s4EDm0VNNHxykMg0OyKn+I4IGoDgg\r\nIEdkB808rb10oOCxHTF7BvBu+XJqnbsrvsS8OyCGlGtHtvO2eBy7di4eZ0nR\r\n1ZVy2VgZAxBQcD4DeG3xjdKLq4DVYn9Es2pj6TiZN1IuQYrww6RQbxIxdjjz\r\nfi+fgyB3nM0gatvI8+5hsloWkWfHQMbhLBzqabEPEZF0TLpG/xmbzqkP+auG\r\n17T1nSHk/6744/YmJT4WAxuFCrZZRAc2pWurFYz86KLmNEgR07AAsxoC7JKb\r\nV4NdaFAL6k81WOK/u+1bPt6agMT5yi3GDcvuOxts0x52BXdLhbZjYdGJF+x2\r\nfKynmwio1ivS5sWXxHdoDfYXrFnDGlF+Hhc0srHqxRGPfHKQZwdSLPLVGd3k\r\nrmdwhI/fi30ggPHGVNdQu7uZuxI1M30yz+sLrgccWVxlKcHwc1jipLFXN4nq\r\n+w1dhMzcvwqPbVwAFGTjrCeIUma6QwqYpFE=\r\n=Q1pi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-a321e38ba055b9e9eb144967e3cea9b87cfa1b38-16.x/balena-jellyfish-metrics-2.0.193.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-a321e38ba055b9e9eb144967e3cea9b87cfa1b38-16.x/balena-jellyfish-metrics-2.0.193.tgz","_integrity":"sha512-PHxcYjMzsktExVuSnjSFhyxM6Kn/QUZ2ZsetzQ2jhQWAuRAvB8IDXdCjh8xkhPbToClAdP5iqTa4uFqP8DALwA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-24T16:41:50.036Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.86","@balena/jellyfish-environment":"^14.0.13","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.2","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.60","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.193-renovate-balena-jellyfish-logger-5-x-a321e38ba055b9e9eb144967e3cea9b87cfa1b38_1664037791002_0.326426237839335","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.193":{"name":"@balena/jellyfish-metrics","version":"2.0.193","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.193","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"393844be3aaa66131e2ae49ba349142feff45d81","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.193.tgz","fileCount":15,"integrity":"sha512-+RWdyNwp4q5Gfb9o7xNSu+F0k0K4CCaOFQry3V2qu7MDP5scVLjZ2tsuxblLvvGpraJ06+ZNg32ZH1jl+hmFpw==","signatures":[{"sig":"MEQCID+i9kcllTvSOfv+kvweTeb57eo/2EYo2HpCHs4xixjJAiBTgjnHGB4hUSR8uD1sCO+kM8qA5mBBEyTntkXVR89vHQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLzROACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqdGBAAnnnkZOZFItOQhHcKrOyTNcpGYgePQmoS/5KPFXUm/wUjiK0+\r\nd02/DBtY2uTbdrthun7KTgLqXpTaRQQudaotLMCd8XvAZSze9nmqB4t026N7\r\n39CW53uNwnuidLbc/Um7nBW/LniwOL9Fr9RmQYPI4QuoKNqYENwD8Jq4Vy41\r\nbUeWHaQvFDMHREgTtUYCHgq46N27WhgBOQ/2fDFOe3lpgO5xPAifd28bfYX4\r\nj2GyUAbVyo/BtoX+sLlzbtglJUK2Wv36FmM1IdpyYqCUiu05ZY8qo9ySyZSE\r\nBTeBXBwh9j74aFUdG92OZiUnRaAdHAFTt1+ikin5K4RTlbBynlT/ECQ5+Zvt\r\neEV+dBuqS0QEwgwdMOZTegNf7/FjpsuNSHyf5XIgU9TK84EnjkZQNvFnf5bS\r\nlaQjz4wlwB6mXmI3PTj+IqtxLB/Px3zOvAdY/3FPAtS8YbLgqm2whiNvR8XK\r\nko0Y26w2iq/34VUFQxgxebW41Vy1IrA+qnQ6R7A1GRcZw0sQj4ESHHSJXRxY\r\nPj/v7pukq/KsHytxBIgUS7v0HLXAYp6y4HbgC9kgzuf/pVazMjnuhg6Wn++i\r\nlRFfpqfzPISpJEczetz1HdVR5piZdFjGGOpxBsWJoqXzeUHjG1sYxtu5WmhH\r\nOiSPnhOUmwUMqpV2zqs9BhMYCNHfvEkRxns=\r\n=an7X\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-a321e38ba055b9e9eb144967e3cea9b87cfa1b38-16.x/balena-jellyfish-metrics-2.0.193.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-a321e38ba055b9e9eb144967e3cea9b87cfa1b38-16.x/balena-jellyfish-metrics-2.0.193.tgz","_integrity":"sha512-+RWdyNwp4q5Gfb9o7xNSu+F0k0K4CCaOFQry3V2qu7MDP5scVLjZ2tsuxblLvvGpraJ06+ZNg32ZH1jl+hmFpw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-24T16:41:50.036Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.86","@balena/jellyfish-environment":"^14.0.13","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.2","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.60","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.193_1664037965913_0.14050397128060044","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.194-flowzone-docs-bf692b2be2eaef118ca2a9b6f3e7b045f9656b72":{"name":"@balena/jellyfish-metrics","version":"2.0.194-flowzone-docs-bf692b2be2eaef118ca2a9b6f3e7b045f9656b72","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.194-flowzone-docs-bf692b2be2eaef118ca2a9b6f3e7b045f9656b72","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6292eae4b3bacb081d78f3543fd4ca8813bf22ca","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.194-flowzone-docs-bf692b2be2eaef118ca2a9b6f3e7b045f9656b72.tgz","fileCount":17,"integrity":"sha512-wuiaX98FH4uFGXnHMa0A7wxLyX9LVfdk9St9dgu4r/x50+eKdAUPrUhIt+Dqt11g5w4wFZBnNt4bCVuqVJjxTg==","signatures":[{"sig":"MEUCIQDYksSrbsAlXIfO+hcBSG/Q+c+vizU0mw0h1yEozE9thwIgQ0MBdplnRkhhSK/v5vCxpTkKBCIhvJcYSXtEXP+owW4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68124,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjMwj3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoGXw/+JgVf9mFfHl2AYFEvIzbdAu1uB3n1iryoPhdolvVjxHIXj0ZL\r\nSmlV3ppfI4jZlyxY9eyAPcBJV5AUJrnxhuFd2NmkU0/pzR/mLLggoHHpGCiA\r\nsG/RrldJNbdQI4tOhIDX9kJOna7qN3MyMLqejovfz64622+RBddjnwg4Ro/9\r\nfrSYiv3k3F79qOKIQ1wJdYS0YqnkNOEF8Adq8UxU9kfC2Wb5au6VSr0yx785\r\n5jnovS0hbuMs9pPNKC/rbe83We0ZhSNayusDRnxO85/pdCqD6UN3xdI/EbJ+\r\niTDzvO51uJh32Iyj4hNCrnAiC3mJvjVjRDHtuHnd4sVJ0EATG8EesCb6Z6QJ\r\nIgN5MWJmrgk3QPmZZTSd1vVnuAHl9kskWcrQOzC0vpZ70putI5z6NYzQFP4x\r\nmxTr+Dt57vl5MMl1bnGxFsx3oAZxf0XIl4AzYQeS8Ih14s+5bVPFNBvzr0P9\r\nGHi3jST3EbPSyBCtleaSVsfArJ+z6uw2khbdpjfqcQNsCOnvqjibSep69bJo\r\npko8kBbI3nLEgYsBqWGoUVgHWP1e/EiyWqF1svn8vfPK5E4lFsRZ4HUyX9X4\r\n5WflrfDnRrYhAIjGhq8uy+aWsHYsQ153ys6h8tukDOaSQJQr+Xv7DIQw6fvE\r\n5NidNrMAYFRXBFfhn6xid+deMn8tebZ4NU0=\r\n=LC1M\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-bf692b2be2eaef118ca2a9b6f3e7b045f9656b72-16.x/balena-jellyfish-metrics-2.0.194.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-bf692b2be2eaef118ca2a9b6f3e7b045f9656b72-16.x/balena-jellyfish-metrics-2.0.194.tgz","_integrity":"sha512-wuiaX98FH4uFGXnHMa0A7wxLyX9LVfdk9St9dgu4r/x50+eKdAUPrUhIt+Dqt11g5w4wFZBnNt4bCVuqVJjxTg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-27T14:28:44.666Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.86","@balena/jellyfish-environment":"^14.0.13","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.2","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.60","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.194-flowzone-docs-bf692b2be2eaef118ca2a9b6f3e7b045f9656b72_1664289015000_0.8702136281525337","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.194":{"name":"@balena/jellyfish-metrics","version":"2.0.194","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.194","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2f2ae3234868879ace334db2ce764d39e4b14050","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.194.tgz","fileCount":15,"integrity":"sha512-vd2t/e1wRv0PwGF9wrqfhBPcccGiB88v3PYdwGuPt8Ov8Nx70JiwyihpbSIvE3w3QfdwEtrGkyYFHupDm4PHYw==","signatures":[{"sig":"MEUCIEXjv6L5MZwJHsQwO2VZ+KU9HXOtgqBtj6ZMwekdv/APAiEAruo2Y+J2vEVsQx88yrAv/DJwM+STxOyAjKphhPc4puc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjMwpOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoUlA/+J3FlzBTrltBADAXbg0eq0fbQwlk4LDMsUHXjHvTPj1zvfo8L\r\nqh41bFlM3IydyMDZjrT5vFbGnJU5+3qUXQFl8qAUPzF6NogfzD/712n8oAyy\r\nSfZuNPgXgTZX8Ej1FJ/0TgAWu/ZqJ19pznAHwwy/Nt3q3ag1l0a3fE3gYrd/\r\nipylA2IMYztNnbi+Xq7Z5C5ftvtu8kpHXpnT+zS9tW0YRJicodqmf42ZzANc\r\nv7TQoq9rpswGXnPohWwynHPqVuju3tjevgy1XGw8yxC6ZjJKZwNrSG7uodIV\r\ncLdRRBaio5Rxj5WiRPn0hQnsrPx6AR0kZLF84j2pYqjhCcHGfeTwJBXNLIfX\r\nL3LBntBkBJyjj7bjkZ0Gg97oAowc8kqOiXKMCIEM8iP5zL6nwIG1Cj0qOQIR\r\nXse8+h+UGdvvfWJ9S4qNmJ7yUcVjtD3+8XeJCNPQkolZ09l5Qhjc6LoNuYPO\r\numGVXcFY0NxjOnh8viQ9QNB9GueCRCSpEi5tOxqjn9CPBrAZzv6JQTnVgsC5\r\n1K+mIDmuF98KWUL9N3aEb2U1wQWn4HaD3gjbgmhbcHV7j6RORjqpy37Mhan4\r\nDRKtImW9nY77bRhu6gtrP5K49H7BdBkHgewkZX7NDb77Vb30x74lOKe7egbD\r\n50frd2BVR2wykECEBYYZ8bubCckkNM3t2cA=\r\n=ZVgn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-bf692b2be2eaef118ca2a9b6f3e7b045f9656b72-16.x/balena-jellyfish-metrics-2.0.194.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-bf692b2be2eaef118ca2a9b6f3e7b045f9656b72-16.x/balena-jellyfish-metrics-2.0.194.tgz","_integrity":"sha512-vd2t/e1wRv0PwGF9wrqfhBPcccGiB88v3PYdwGuPt8Ov8Nx70JiwyihpbSIvE3w3QfdwEtrGkyYFHupDm4PHYw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-27T14:28:44.666Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.86","@balena/jellyfish-environment":"^14.0.13","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.2","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.60","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.194_1664289358082_0.6599998066617321","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.195-renovate-balena-jellyfish-environment-14-x-503abd5ab7ec1c9eab4ba7566ab581123eac844e":{"name":"@balena/jellyfish-metrics","version":"2.0.195-renovate-balena-jellyfish-environment-14-x-503abd5ab7ec1c9eab4ba7566ab581123eac844e","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.195-renovate-balena-jellyfish-environment-14-x-503abd5ab7ec1c9eab4ba7566ab581123eac844e","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d9a10794a8e62a6a7bae3721991f0eed4a01b85b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.195-renovate-balena-jellyfish-environment-14-x-503abd5ab7ec1c9eab4ba7566ab581123eac844e.tgz","fileCount":17,"integrity":"sha512-trv9OUn1REvjYa2gcu+oO2Lxwpib+aTc2AePKY25TiySV2Qks/95qLei9zRyJ/i//MCL4tCJh8BezmrKXRODhw==","signatures":[{"sig":"MEQCIDezkw57EitsvPs3oQyERDm2okO54ZpyFoYAgMY1UrZIAiArYYjTLvb+EkK2nFlA4DIROpEFuwLThYN0cKyNRSbkRQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68153,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjMwsSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmouoBAAmmCGIggVJjh3VcFhfzBTXap2pWQqjC5uUwBbEZeUHOG9Mziv\r\nH0uXBwFTR1f6E/2U+uTwZBWBrURQsWt+YVO7Ko83R2B9bOVfYw7elscGQgPn\r\n+YSsOjc7cGQU/tyJnVlchyPnQ5H7nCV+P1NZClvVrJJlB4VjtcmEPl7V6vSH\r\nm/YSphsG6A+SMzwqYyfAFTVshJnDeunqlSFfpChEcS5xXgPanvo6DYwxSpnP\r\n6JAFL/+oolwksorA8P3Mm++s2Swn6cdTneqJRoWa05/h8qHdq7QQbtjfvLQb\r\nyR/rPAKoEfCMKq/tYbvgtIMJgP2bNke8PpJ2aWLiWX04GADnBzelaQ3wCHwf\r\nJd7OnQGyPBytAUlQ+fK+JjQYoCzJ+Ust9LOtptYjthCufRijvu/EHR/8pIHI\r\n66Zcs5weQVVsx0gz8rgsHg9qxH3UasvUQb+mM29rPWlT7XoFwWSkDTqu2Qn0\r\nfZ6ghPEWodWNBUS7kwGgfIJGbe8Bjqy/AwVN5+NuIreV9nROR8gqrHhLPcdt\r\nJndujJZqPWHgDna9lli5DsWvFSTFshM8i3v1BLctZ6UYhWcc6I0Y7l3lxk6q\r\nHXHUKAopZlE0hf0vIP2MxMZl47bX+zUfS2gBXbr7UtN5NsK8QCuefB6fHqDW\r\nUHgR+VPTrjxelgJIrKSQCd8pdxeePKPLYoE=\r\n=eB5N\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-503abd5ab7ec1c9eab4ba7566ab581123eac844e-16.x/balena-jellyfish-metrics-2.0.195.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-503abd5ab7ec1c9eab4ba7566ab581123eac844e-16.x/balena-jellyfish-metrics-2.0.195.tgz","_integrity":"sha512-trv9OUn1REvjYa2gcu+oO2Lxwpib+aTc2AePKY25TiySV2Qks/95qLei9zRyJ/i//MCL4tCJh8BezmrKXRODhw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-27T14:37:39.427Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.86","@balena/jellyfish-environment":"^14.0.14","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.2","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.60","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.195-renovate-balena-jellyfish-environment-14-x-503abd5ab7ec1c9eab4ba7566ab581123eac844e_1664289554271_0.3534242763927038","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.195":{"name":"@balena/jellyfish-metrics","version":"2.0.195","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.195","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8ad9107f53928cba1fd919f3b58861b18e718990","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.195.tgz","fileCount":15,"integrity":"sha512-tz9QMRCZpZmYUYZ3mCYjbHtuTlVoWmkS/glO0NoKk2w5TgOCDhKxPN+QnSnGwrk2YWfkRS8+ZsvKtavWDIvlmQ==","signatures":[{"sig":"MEUCIBFzUP8PACMIkPz4pDcZJE3CIUm/YQnrXV8ufPo2avBuAiEAsK5d4nFpSVZTafRh616NA77/cTxe/N6gbElj/yAraAY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjMwu4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrWSRAAm3kd/m50L/nNWA846HE7zIaCRyUbAWPyBk8vMhibFaeBf23l\r\nqkvmgPBZ4Zhv+h1pXucA0uRhn3445mVynNxYVAJQT/9gVH2uDexdR6NMA/fC\r\nRwmC3nN5d8lWdYOTJ4FiUp8Z2eP63v932bB2FFFNm2Tn/FRlt/voB7yTtw4/\r\nkQ1t0/hNZg8JEMAlUvL6/fmWeXEOQPptr3DbPg3XWw8UMLvrQn8D9MKAbnMD\r\nSCu4yw5vJL9GISv0m49CnIR86Z+OLZNLztIuEHJFjS/1IQy9Y2OZ6sh7Si+B\r\nP2gEkgUWmhU1Ma9XvQSStAaapYVXqpAoSc+zEijuCVdsH7pmInSMpoH8Jyu6\r\n6B2cypP+x+u9zNpFSc46hh2QhEx+o8kjWl/CZwhR4XWmDkhhKeL3nQ59RZSg\r\nDkgVYQWit1tqmr6wLebD/tW+q6QJWZxLQlBbOMPOod9R1xrS01oycgifiLX9\r\n1DWly/P3DKkFMVup1bNv338lwT7zroWzPTagzNHKNJrdRuMWL+nBISvzS1N4\r\nTYenRJ8pRBxCzDTjKNFwg8ls/2Z6Tzq2deipuwi/yDNTpi19+pKVf8Fi02GO\r\nQ9acZN0PWbLRO0KWFkF9++1XOy7eXYbPZ4GnwJZGyRrQiM507HRKruH0RG3d\r\neboNz8M5WlLY0h/Y3X58eIN031ltdY1DL4g=\r\n=gFWM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-503abd5ab7ec1c9eab4ba7566ab581123eac844e-16.x/balena-jellyfish-metrics-2.0.195.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-503abd5ab7ec1c9eab4ba7566ab581123eac844e-16.x/balena-jellyfish-metrics-2.0.195.tgz","_integrity":"sha512-tz9QMRCZpZmYUYZ3mCYjbHtuTlVoWmkS/glO0NoKk2w5TgOCDhKxPN+QnSnGwrk2YWfkRS8+ZsvKtavWDIvlmQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-27T14:37:39.427Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.86","@balena/jellyfish-environment":"^14.0.14","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.2","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.60","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.195_1664289719811_0.1450728234744436","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.196-renovate-balena-jellyfish-environment-14-x-28d65988ef25563c02910d76ed59d3b3034ff1c3":{"name":"@balena/jellyfish-metrics","version":"2.0.196-renovate-balena-jellyfish-environment-14-x-28d65988ef25563c02910d76ed59d3b3034ff1c3","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.196-renovate-balena-jellyfish-environment-14-x-28d65988ef25563c02910d76ed59d3b3034ff1c3","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b2e9d0dc6022f64cd5b1bcd33639577c19aab1de","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.196-renovate-balena-jellyfish-environment-14-x-28d65988ef25563c02910d76ed59d3b3034ff1c3.tgz","fileCount":17,"integrity":"sha512-/bbTjyhk89o8u8SJ8gmg6gfgP0IiWMAnDMvFFCPkghMDEr45w8f0Ip+bBt0KCTkPXmf+9EQqKZI7DFCCRfV1wg==","signatures":[{"sig":"MEQCIBh+ak0OfDVoFhn85Kw+qs6ufUwdcik1Q93/Bj7Nnx1lAiAmscE7v23PQQCSsBtgR8hnrsAJwGCtKhd+BbpgeK4UDQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68153,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjMwx4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr1rw//dOWXjSdLyxXS/14tw0eOqnia4JB/jwVLU4/gHWJWKZg6NtQb\r\nUqoZO1use1Ps1078BbBQyWweDxiCRVfAOu3mgpmGSXh5DfNBhNMEnjUUo6o4\r\nTpp7Pc1o3hSh78Eci9wRjnKsIAxi6hotW5S8ythxtJJ29H/5050w+UCDoykg\r\nxTE3pwa1aSrsDLYX/VPEQ+Gs3lvTUj+o7lstNVbvslFob6gwmGl+SfFnuWqO\r\n53dcisg/NAQWQmxTW5ZKfg5NCIswpnSfcbMdCEqT0xFG7za+3Am992yClHIW\r\nXLZIq671aLnONZshpOk6bze90DKktV3us1VZtp73e+PljTJalS9SpfTDjdo4\r\n5iAE08cH4Ydmv046lSyKRf0jSvFbD4kWcBB3tPitsaRbfpsCZHAqbUEKMlwP\r\nFb2GB2J6wQj/XwMRpLTxrcU7dec0c2wW2rfkxre2kI+69H6Hj3esvL4MjTRa\r\n0J7JKN5zb3ghWuq6eHhCDPk9vR00YeqDNRoklQBM8eLsrsIRaw3Qg70+TtTn\r\ngWImYa+21IMS7DulrzYSwr8qdJfktNee+d9E2CPJMEOF6YR0g2AIqGdwkMro\r\nPVyDe4MLtBFgIPt7QeKUMpAuuHphrpogqvUkkc0xgC/kevcobpzJ0QNBw/9O\r\nfTit4pmKPDYeZEVd8DtwUOoRjy0DpdJFXvY=\r\n=BmXA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-28d65988ef25563c02910d76ed59d3b3034ff1c3-16.x/balena-jellyfish-metrics-2.0.196.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-28d65988ef25563c02910d76ed59d3b3034ff1c3-16.x/balena-jellyfish-metrics-2.0.196.tgz","_integrity":"sha512-/bbTjyhk89o8u8SJ8gmg6gfgP0IiWMAnDMvFFCPkghMDEr45w8f0Ip+bBt0KCTkPXmf+9EQqKZI7DFCCRfV1wg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-27T14:43:44.825Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.86","@balena/jellyfish-environment":"^14.0.15","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.2","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.60","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.196-renovate-balena-jellyfish-environment-14-x-28d65988ef25563c02910d76ed59d3b3034ff1c3_1664289912701_0.40038427605187543","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.196":{"name":"@balena/jellyfish-metrics","version":"2.0.196","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.196","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b9a61c8bdc1cac29ab994f0a7de40081f35b8b88","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.196.tgz","fileCount":15,"integrity":"sha512-TII4SdevGIMB9kLQWzn549LOWoDdBCAQdhTziU53TMdcSKV4vVjyP5u6AB5FTezr0WY4p5wGE1vni2+0frLCgw==","signatures":[{"sig":"MEUCIQDQTqPF4epfvtUXwfIocbhxBJGj6IiW0obBdXrQkO944wIgE0ry7sgyO20P7+O4ySpUtSHKZWNonc33OwsLz+eE3D0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjMw0qACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq92hAAnZgPVVEsZs3VLJsh5Gq6l/WOF2KKOhpoYeU3Y8Jk1hXotg5G\r\nX94SPmMYKV0a1bteNzlCZ0n9gJpY5/j4vC0sNRiRfrbYiA/33cCvNA3ZdqIt\r\nw+0CbTbudrvUJu/8rfIdgke5K0MpNyGpP0K5vpV86K1kAfU8IXPY3CrV+O0Q\r\niqksSgv5YfV/fKWYXckf1p0+5d8gZstoLtJ4enqv4oraTBQ1Q9axKcx4M28Q\r\nzEEAHGc5/fAE4bHAOhxxKecI4s04IbOFqc9YS/V571PSF5/YZsXEOaeN2zfg\r\nGGqfF1LTaNUHH19Ec9rM7CQVwKHRQMY2Ne3vvowRNIo1dEc9nstK9yVlBO0M\r\nURrNrprAQWvFM4X2V+B1+SIUowRaRAWKNY66wS7M2msSea8KekxNwV+Q8NVU\r\nNTJjCiD4iiRuQinZpsZLQprqgqtMgzP7mIOmxozl7JKOUm/0qpv7VO7+VlLu\r\n5PP1tbRMySJcwHuXmzmFqlRxiLUOKWUQAW3fleCgsG84AK8K+95YNqkWsWsO\r\nPnt+r6LxIicVrt4/xtDAYEh0BF3KnNTSp/htnj94m7c50FU8dGMBGWT44Gfu\r\nDMLMr6U7otouMTcshwPao+COl8ZkOOSd7cj+RlbORp32BvwBRmYDeb3BELy3\r\ntWlIllKZm7zdu4DB/BJBQIQErkTABPMFGOM=\r\n=apu6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-28d65988ef25563c02910d76ed59d3b3034ff1c3-16.x/balena-jellyfish-metrics-2.0.196.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-28d65988ef25563c02910d76ed59d3b3034ff1c3-16.x/balena-jellyfish-metrics-2.0.196.tgz","_integrity":"sha512-TII4SdevGIMB9kLQWzn549LOWoDdBCAQdhTziU53TMdcSKV4vVjyP5u6AB5FTezr0WY4p5wGE1vni2+0frLCgw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-27T14:43:44.825Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.86","@balena/jellyfish-environment":"^14.0.15","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.2","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.60","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.196_1664290090618_0.23145535380434334","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.197-renovate-balena-jellyfish-logger-5-x-a616995e0fa592c1a8a77631bcaa4ca0b5c4c804":{"name":"@balena/jellyfish-metrics","version":"2.0.197-renovate-balena-jellyfish-logger-5-x-a616995e0fa592c1a8a77631bcaa4ca0b5c4c804","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.197-renovate-balena-jellyfish-logger-5-x-a616995e0fa592c1a8a77631bcaa4ca0b5c4c804","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4a425c2786117c0ec6614641e17487b57d9444e9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.197-renovate-balena-jellyfish-logger-5-x-a616995e0fa592c1a8a77631bcaa4ca0b5c4c804.tgz","fileCount":17,"integrity":"sha512-jyrB7nd4qBHShGBAUoJLGL8ya1oMwExkU0f2Ckim+2vRH3gMthO/cXe57TiKe7FfNYexXGfS8G1CZ2mmuI6fTA==","signatures":[{"sig":"MEUCIQCjVXaQS2VZrXvnvEdcKZ5yMtL6J+8LmdHmJkWjyVDQ8AIgF7FOQSiHnzPZau1k05rGho+niPta6cxRZNYSQsj9gu0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68147,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjM0Y1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr2IA//Rc16OwsdmfN8CKAqUT/4fvEM4Tmz7jiKdsV2GUfiS+8/wh6H\r\nP3/6AUQXBbiS9WsdAODlav6EhgaQsRKUE2g1JDa26ZvOSEhYozc4RZVGHRO3\r\nQgSH/aZJrpt9zNCKOKOHf4CjVG89HUG9hSasppdZxgi9vxw5tYCOOUkbgjTg\r\nm0RFCthjuvsRopBhmXOftevVk22SUaNnohOChllAjJXTf1/OYoUWQx5a98n1\r\nz56AcE0r1FkZjbv+k7iF3F59KFh8782uH4Ijgz+23k/MMetxeyQm7+uCl9Lh\r\nBwzFzMhWAhRtx4hjDsxETkMaOhtZzKF9ZuRtqTMDDBMljedwJSlD1GeN/lMu\r\nMINNP/oW2sTxN7VFcZyQApZjOouJl4ua4VrsrKPK4fiyN58/Ll30WKmZ2SEy\r\nGWX5bExrczDcYmbbBcF1ao/mk04Y1ZH+12YwuV21RL+3Y7fo7Q0LoIlFf7Ol\r\nNYvGpGW01DXGvSdnGsDCWHwfo86CC1JEOcJkYDqsBJ8MUkusTrRCMrw9BGbo\r\nq0NbD5edxP/Y6ZLguQtMfmegAzT41E3q27l+wh2aVnzLWf7/L+Y4ASes5V3R\r\n747p5fWId3VfOCI1pFC3viTbq7BWuJQRtwj/4zudZeMQY6lp8JRXoCvNiZqO\r\nBd8oflYuwIYBfcdZSg8/99oAJCfM3V6KUik=\r\n=VyZd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-a616995e0fa592c1a8a77631bcaa4ca0b5c4c804-16.x/balena-jellyfish-metrics-2.0.197.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-a616995e0fa592c1a8a77631bcaa4ca0b5c4c804-16.x/balena-jellyfish-metrics-2.0.197.tgz","_integrity":"sha512-jyrB7nd4qBHShGBAUoJLGL8ya1oMwExkU0f2Ckim+2vRH3gMthO/cXe57TiKe7FfNYexXGfS8G1CZ2mmuI6fTA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-27T18:50:06.778Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.91","@balena/jellyfish-environment":"^14.0.15","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.2","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.60","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.197-renovate-balena-jellyfish-logger-5-x-a616995e0fa592c1a8a77631bcaa4ca0b5c4c804_1664304693502_0.9373102349546132","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.197":{"name":"@balena/jellyfish-metrics","version":"2.0.197","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.197","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d636879c132d8a4026b7b4f075b6f34c1887cb79","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.197.tgz","fileCount":15,"integrity":"sha512-EnYF7EyqXVsqwAZdUH9GyoFd+gcIFvL24G8FEj6UYh8Vhr4Ovgdeu6E5Zdeb5S1bSQpzkpDqyw6SG/YwZg8HsA==","signatures":[{"sig":"MEYCIQDiuurj8cK3Pb08/IPeSsoWrNIQADwZpXXunGfaJhCMLQIhAJTGHiXmGP4KCgH9QnfaXDm1ffZr5RzjhADNlBgtPEin","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjM0bgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo1Zg//R6On8ZF7Qz0eQiHWz7fMiulvcng0cexNMOjSQMswpqRiGTri\r\n0OlCYAyxGoz54Tu8krZ9mzfINwxI95GDAtnFymhcoESjSue2ag1HpXlsqN7J\r\nFs59DEKPqJJT5wGdPrp7GHue2orDwjw3cX5SvOxC1KU1L36Jiv27GwPdl522\r\nmJOC5VaWMETlqCfzwwbOUpJMCXjpBKEs910n7GoC45a7OZDXt2Hni3eIaRMB\r\ne00HCHx4khp0+RKMG8D0vmOCiUuWBuijJgeu+tnrxNRKW1dmZ4jbc/CVZRff\r\nHrshIoiVeGR0dP/g9EvoTrwgpbnlswlzgV7ahKS9+kYlx9LJ7zm/9RkVZCdN\r\nTtINPw1czZYEkGQL0cMLEVDO+yLQZi1h5pjfVsELDrNKJ78YoG9ZAhDvQXEq\r\nUOvp4Jqhukkt9AiViQDTcfN9RFdiHH56+CUSXFyERB/oa3Q+xX2GMq23Hwh9\r\nDu7hNwjJANXVeo0iPvFEXD3K+C+jiPeWEYP9krAd4yMwRLx69aW9fGHDjCnP\r\nZ+Plh+pjyhDNOssZw5X5ddWFfAAsHTovPt6VgU6jNnLzq2+c/IfefOF2XMrH\r\nmXxPzVMB+p0EgapNc26V/sZ6VUE1NoVyUWkEcFequUmJvBEIkT7bAqq45Olh\r\n6dn8zBwxbCJ3/09J5CJZhlEzzJo9CsMf6Jk=\r\n=28SW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-a616995e0fa592c1a8a77631bcaa4ca0b5c4c804-16.x/balena-jellyfish-metrics-2.0.197.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":"^16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-a616995e0fa592c1a8a77631bcaa4ca0b5c4c804-16.x/balena-jellyfish-metrics-2.0.197.tgz","_integrity":"sha512-EnYF7EyqXVsqwAZdUH9GyoFd+gcIFvL24G8FEj6UYh8Vhr4Ovgdeu6E5Zdeb5S1bSQpzkpDqyw6SG/YwZg8HsA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-27T18:50:06.778Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.91","@balena/jellyfish-environment":"^14.0.15","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.2","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.60","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.197_1664304864332_0.19385461468403786","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.198-node-18-afec84b30016e874eeab940f268ade845aecf972":{"name":"@balena/jellyfish-metrics","version":"2.0.198-node-18-afec84b30016e874eeab940f268ade845aecf972","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.198-node-18-afec84b30016e874eeab940f268ade845aecf972","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"992e28869d382d0a602572f98da4c2d19019bd81","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.198-node-18-afec84b30016e874eeab940f268ade845aecf972.tgz","fileCount":17,"integrity":"sha512-HkMIFhBBW2LIxvffQNxXqODtuLnG7wZoTG6aiyTByxCmIX3cC5V+4w/VJrel9sPM+H+GcimV0yca2Ujgo11WEA==","signatures":[{"sig":"MEYCIQCHjtcdpKaS2AOYliWlVoNpdAFVO5CJwILJmav1WjkAGQIhAOuXU+EvAhghRgfCfsxan7K6biR3244QtBKcaPzhZspW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68119,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjM4mMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmonSxAAoTsLEbfdb75O4VOHA3r5LgcEWG49iR/XoajCeisjBtqRO+Dm\r\nEjmMBAp+FBlcDN269ExqgqfdSgRQCaMwfJZ3yyC4jQ4r3SNTol/rw+JpmJx/\r\n779LSQbyxx3VLLvoV9Cj/prl2sV8KqntHTUQTWsyPnvW+2PnMcxSDeZ7bZyU\r\nzAQj5274iW9MzScf1INYsRXLq+0cg6ivNg5dQbuTI6mxkq2yVqd3E0mPJOx8\r\np8hveapqC4NBHlJAi/YYX2m64s+1kc7e2MOlKYveFRc3+9IkQvNcSQlJ9O0D\r\nFzqx0TsyupgP6COh319CfXn8RUnX3QrkhUZ4OyH54MRQR5W0AJs6QXk4IvPj\r\nUHYgahhSgkl2v9gGl9XHmCbUjhlcvuBMbjEexYNj9Ke5MZ0bL1JPbMqvuBdp\r\nJGyEDfdF0jfsTH7L4QMxu5SeuMzQSyNMpzud7f6TGzK1kdbywVIvmS/pSSeu\r\n4a4gN8LhfLqOfcgJHtfrK+4M097ZnHGVrPy1z6f6xaq48peEaaA/Eklplvu1\r\nK90dfXsSqPJbQcOQP/WOSClI4vzcNenLzYXqgj0coaqMBxDJxSCLJKbhA+xs\r\noxfRjFU6OrhpTDjWpVAJPCZ4T+M8YThjABFcIVdM0Yxvz4/YiV6z6NNk7UZl\r\nUJE5r8+d/tyQ8xm4zYytC6YmpmIvq0himX0=\r\n=/j/M\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-afec84b30016e874eeab940f268ade845aecf972-18.x/balena-jellyfish-metrics-2.0.198.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-afec84b30016e874eeab940f268ade845aecf972-18.x/balena-jellyfish-metrics-2.0.198.tgz","_integrity":"sha512-HkMIFhBBW2LIxvffQNxXqODtuLnG7wZoTG6aiyTByxCmIX3cC5V+4w/VJrel9sPM+H+GcimV0yca2Ujgo11WEA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-27T23:37:26.990Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.91","@balena/jellyfish-environment":"^14.0.15","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.2","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.60","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.198-node-18-afec84b30016e874eeab940f268ade845aecf972_1664321932260_0.6001556816008982","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.198":{"name":"@balena/jellyfish-metrics","version":"2.0.198","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.198","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1a169689583e448d54d4d5320bb595709eadafce","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.198.tgz","fileCount":15,"integrity":"sha512-e2MD9d44tzrPbtG6tWqWAfZVMMph+fyxFFArM9sPVgktwOXQbfe0Tc6/Hwk8aBUK12m55Yz6Iry667NtRBcfDQ==","signatures":[{"sig":"MEQCIE2OsjJXPO+2u8iY7azunn1Hhjat7qnfiptMzxsBM4WTAiB+j5AZY7JvPA3Sff+yZT5eqysfz2q+gsZFsOAwaqW1iw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68070,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjM4oWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrKqQ/9EyNj35uSkFSWN3DQa9Ffixlsjh38x+e/OXi4JmZFG4wgMZT2\r\nIXlXvgqp9bIIhaWhWJpn9thTIPgTJBrkT66sh2J26/v1/M5HTfXh5+0NH86Y\r\n5WaGVEnTGdmr0/YqvDz3MlvYv1ObtlsXLmrKIKNIyoul5rbGhKJxoAU24+SE\r\ncscst4kl20Lmqb8p6eYdullR3UqDrxcUK75I44+zebV015U+SW5v3aDQvxae\r\nAh4nz0wIJ19re2dg17yEryBic/gY28fJpov52LUUIvgUqUj4fcQCI7RCq+GB\r\n7gW4/Rs+ixktcTt3pWnESd6ee8ix8davqSD5qrGjZ68V5hExm4+w8zK9vVe2\r\nLhmwAy9jMQeC7EPSughvsyRGWd6vZ77pZVKZ7BTwW+QhQw4FZEzBBOLkTi+6\r\nvUV47jjcQbKELL2ZxMCnoCem9AMZM44PrxpWIMf+whQq2eaxUwslqbxOYPHq\r\nXdNWcI/tpH2IQh3266f6pdz9zDjVK5GrgVofUddGIuTmZ6pp9wSeq/9uz/G2\r\n8D6eI2o9ObVE/fbQwzibebitUlXWMqxm6c7WVQPF1PBnYVtBJQMbJFEGLpuA\r\nThdgqV9xnSGb48DWozE5gmuPsaPO+NlwYzoLtNZYYlMAzEB95O8SsQSOyBxh\r\nMxOAgA84Mj6TjIj3GwSJXf7yOYTsl3/hYqo=\r\n=70bo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-afec84b30016e874eeab940f268ade845aecf972-18.x/balena-jellyfish-metrics-2.0.198.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-afec84b30016e874eeab940f268ade845aecf972-18.x/balena-jellyfish-metrics-2.0.198.tgz","_integrity":"sha512-e2MD9d44tzrPbtG6tWqWAfZVMMph+fyxFFArM9sPVgktwOXQbfe0Tc6/Hwk8aBUK12m55Yz6Iry667NtRBcfDQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-27T23:37:26.990Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.91","@balena/jellyfish-environment":"^14.0.15","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.2","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.60","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.198_1664322070544_0.6581065536431312","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.199-joshbwlng-lodash-types-a904a6134bc0751d104451028f62deae79aa59f0":{"name":"@balena/jellyfish-metrics","version":"2.0.199-joshbwlng-lodash-types-a904a6134bc0751d104451028f62deae79aa59f0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.199-joshbwlng-lodash-types-a904a6134bc0751d104451028f62deae79aa59f0","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2b2951e1b9fd032cf0fed4da85b58a111de3a5ac","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.199-joshbwlng-lodash-types-a904a6134bc0751d104451028f62deae79aa59f0.tgz","fileCount":17,"integrity":"sha512-xxA4RTME/LZgnq37eKP2arnL+pbzTsmnefTp20fYSQWKViEmEKAU87OoyaDHakJAb82wtoYwcPAT2LiefAKmAA==","signatures":[{"sig":"MEQCIEHT7X4vRLfX53uWkhxPbtHUO4KVZ/1BkfS+TbAKiV4rAiAcMnQxGHZ8wlj0GOWbSun6VV6uQ5VEimFt//o4rezqOA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68168,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjM8heACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpmYA/+PKZt3TRP9aDP5611f6NvRHaRjSfvjku/koWj+EsvS3xg329g\r\nRuPyro84uLI0f94eSh84qN1UCJZIoBNwnzoAOZzSlJSuxtlLe2AoXSTXMEl1\r\nSXAQdw2SpvzvUzb9KIz0mFkU49vMJkqd+2fSJQs7keUOtclh4vJmAWs2UND+\r\ny5dW94R+EK06NC2HvzJ/vzPsraLJNjXvUglcivS+KjXh7eMPDTNNZdp9Twkx\r\nPEUzawgJ4UpF2DDh8e7LL0ABeaHkm6Cgna1L6axZ0veDq8y7hYrXL7owWh0q\r\nNN5LlxNxdyqC8iJpLIGTsR0MqLr4sJsWflxk8Gf7Tuux0XGTHUx8+nNUNO+2\r\nYIAzCPIXSx84k8NvgqL8IF3JjPsLRZYHHGNu1mSOPDo0gIHMHyGzfnVMQhZk\r\nIE3j6iKAflPdyh2u3S+jdivcUfBAtK8+6hV71TPie0C5EUID000H0Er8CryR\r\nNVTzDCRNCP1Ba6IYj1TXdjsnLzeasbsECsNSIiqeHi3/gen19b0YALMzpvVG\r\neH8VHSJBzBD27Vf/YxrmWAmLaJXQ57aVHUbqgLiSc1YhmA1sb3ibIEe6T8d/\r\n5HqGH6mjCNCWxJnxDu3JXDYJOFoSuRMtAGUCMW9qx8he+YfF28L0NEdS4LJu\r\nFDuzN939G3rcDCtavsay8yJI8eOOrA+YS1A=\r\n=VW03\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-a904a6134bc0751d104451028f62deae79aa59f0-18.x/balena-jellyfish-metrics-2.0.199.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-a904a6134bc0751d104451028f62deae79aa59f0-18.x/balena-jellyfish-metrics-2.0.199.tgz","_integrity":"sha512-xxA4RTME/LZgnq37eKP2arnL+pbzTsmnefTp20fYSQWKViEmEKAU87OoyaDHakJAb82wtoYwcPAT2LiefAKmAA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-28T04:05:20.446Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.91","@balena/jellyfish-environment":"^14.0.15","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.2","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.60","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.185","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.199-joshbwlng-lodash-types-a904a6134bc0751d104451028f62deae79aa59f0_1664338014407_0.21281376148819442","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.199":{"name":"@balena/jellyfish-metrics","version":"2.0.199","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.199","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8d1b3b71b61edacca0c25cf9d791f9e8f17b1dbc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.199.tgz","fileCount":15,"integrity":"sha512-Q2+vjeH/hflQEotH7fipZHH4RQqd7oA62N04nctzWS1C2k/ZHAIaUDSXBUWfBAMW162yeeTIdk8RJTuwx2qbFg==","signatures":[{"sig":"MEYCIQDr1E+jQrLOlY7DQC4aqTVNuW2KdKJRYRraugKamADm6gIhAKHcEzyZ36y0LA0g50DHZYLq4SSfLxdkeb17w/UOdgcB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68104,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjM8jkACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqQWw//YEYuC4poQZX0L8uyiXeRMdhQB2MwTCKLQxpe0kjWbhjrKl1B\r\n6pyUksgeI0fBCKGPLNm99uo9rTRVS87c1ftVC2TDmK2EkmtWZyjEK4Vvzwkj\r\nqZVM/v4w6CljY64s7dAYKXaM7nr2xFrwpRI8lT/Pueb82X8LWGIofD3uJfN4\r\nTMsmLEHQ9UquXbJc9Cr6FysAIYy1S+RHdWSoXKp6UXnSBoFKQvLHFzTG+3c6\r\nPmfc1ZoStOzo5pxZQ3K6f6wXpNp+84e1HzahGZLNLTuKMKBNlc5Ux4Duvrvn\r\nMBMejcq0KRXSEpKV0CIm0iSygeZDnDfkPLYCcAwdA+3gM7Im5QKSSH2o5Gdn\r\npVZqtA5mMwt4GYibLNODl/TsoH2mOQkRjPMMBAdjk0a93ylO33Ney/bheYMs\r\nUP9LzyiBCHyba/U7bMuO/R1XaWb5cnSw8v2EkzesvC3rrL8tG5BO25SpjX2P\r\nWB6Xy7YcaGa/CLhcr+UqUWOFPM5Lhf19ETG/BUyC/0vsyIOj1vS15/u0/t0Y\r\nD7kg1MO2peOCp8ja/CJ9vMLmn/WaGFM7tVQ6rlLm+krcdkybH3fAUQsjomsI\r\nmTlyH/cy7kHYXonbgefZ4dfQHQ81PGzBEAoZT9mu/pauZ4nIgU/NqSpy79oB\r\n0EwPsn39At5m2ZcW5MqpWqflEg9CZZ8mxa4=\r\n=S09f\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-a904a6134bc0751d104451028f62deae79aa59f0-18.x/balena-jellyfish-metrics-2.0.199.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-a904a6134bc0751d104451028f62deae79aa59f0-18.x/balena-jellyfish-metrics-2.0.199.tgz","_integrity":"sha512-Q2+vjeH/hflQEotH7fipZHH4RQqd7oA62N04nctzWS1C2k/ZHAIaUDSXBUWfBAMW162yeeTIdk8RJTuwx2qbFg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-28T04:05:20.446Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.91","@balena/jellyfish-environment":"^14.0.15","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.2","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.60","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.185","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.199_1664338148269_0.6852255564558278","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.200-renovate-balena-jellyfish-environment-14-x-b52fd615d4a69590478fe9a65258cf036e3518be":{"name":"@balena/jellyfish-metrics","version":"2.0.200-renovate-balena-jellyfish-environment-14-x-b52fd615d4a69590478fe9a65258cf036e3518be","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.200-renovate-balena-jellyfish-environment-14-x-b52fd615d4a69590478fe9a65258cf036e3518be","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"91c4bd482b57730d9529c45da71e8f2c2bde2156","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.200-renovate-balena-jellyfish-environment-14-x-b52fd615d4a69590478fe9a65258cf036e3518be.tgz","fileCount":17,"integrity":"sha512-wqppxrRw2UWhk+Xei64yzucSx0rl8vmjGYmhs3ODVhZe6lzJbpdq89vlaOGEBENKcqfaEHyDLOl922g9GHpePg==","signatures":[{"sig":"MEQCIGCrMyTjbqEQWrujEeW16w5QJLkztgrDu/z6ruuvzBbQAiB8g82qplQDP6N9uaVY6Hk7mjc0On4D4QTuNq22SnfuGA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNC8iACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrFsQ/9Eyr0K/oee8sF3iK02Mk+fD+G4m9Zpdh/IYhKYxAZa63/sTkb\r\nmIuZXoxo6WozqNX5HPBSkzR9kvsFwR8KQrIGqgMGEZdKGCGED6DwwhvXAMVO\r\nE3T/EWcmqwgvqsPVEPF9BXX2GKnmXufHDtYV8ojbLoLf9TqId+oqAbuVH/WO\r\nXCFtCMopd22SJKWOeU6WNS2iQFuiF5KYkljjGCPA4ayjon2O20pQDCkQuTYH\r\n3TIDbByOcJ9oQu7eHZ9xUGutqdhqrpiArQjRr0vA8N+SBiiFlT6vM//LeYRQ\r\nARtbxTZ6McnYaIsYlRMxSyisjnZUOZ/vj+3rnAG0cuzvTooBCA+GqqUmgo/I\r\nO16+80j/n1mYJAV/MVlVNTqtehDdXWt77Z7pUnfkCUPLiM6jYs6/5sDCAh16\r\n1BK1d0GLNAiDFB/jTBRpqyWGJm0TtwyYkZHjRA/6pUU6i5daeUGIyonHHvRY\r\nX9hQhrdC9oIhsdLPCVdklV/3gfwcvKAkVz4rkiyBuAc1la5qEWttb8e78X2I\r\nWxV7UT7VJt3f8D+oHVFqsLwypuFQ/uk2594nfRmzU+fn9YHlboIVkjQSkeZ0\r\nzs3+dcQ876Gg5J+907UqISV5E/VmFTOAJQpyQ7ntAJuCghbfuEHluOBGpaLZ\r\nS9LUm7ZFZQvxLBimKz2aL8rsMO5IqOdmko0=\r\n=qH7Y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-b52fd615d4a69590478fe9a65258cf036e3518be-18.x/balena-jellyfish-metrics-2.0.200.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-b52fd615d4a69590478fe9a65258cf036e3518be-18.x/balena-jellyfish-metrics-2.0.200.tgz","_integrity":"sha512-wqppxrRw2UWhk+Xei64yzucSx0rl8vmjGYmhs3ODVhZe6lzJbpdq89vlaOGEBENKcqfaEHyDLOl922g9GHpePg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-28T11:23:50.494Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.91","@balena/jellyfish-environment":"^14.0.17","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.2","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.60","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.185","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.200-renovate-balena-jellyfish-environment-14-x-b52fd615d4a69590478fe9a65258cf036e3518be_1664364321861_0.5221620913646383","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.200":{"name":"@balena/jellyfish-metrics","version":"2.0.200","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.200","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a0e34001bafb44bcd40cd6703b5c42ba91e61bf7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.200.tgz","fileCount":15,"integrity":"sha512-CnRpffOcNPMrjnlAYwCXw/c68f9NzHj+Jr5XRrw3klLbQM08g249yCuuSmz33Ev9Vp7+caKBb603aNUGwwmCXA==","signatures":[{"sig":"MEQCICGmWOKxlASiT/1Vw9onhEMJNRsRL+rUtJgie5ondHbgAiBN83NbwRtDu/6zhlweZuG09ZaKqhLBpOwjX7Ln/fmo/Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68104,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNC+2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqABA/5ASc+7gV6iyS20ga/OUousvBavgHxDitSi5pidHoEeVinKKkS\r\nuKGLDP1DqALCWlGWJ8Zdl3kl5VG+Q8qtSd4ghirBB2yuoeAq7CEJuFkvEDwl\r\n5tzSeP1wyvCuNWHNK2MKlUWjgDPZOHvTstHuED3B+HvLsiQ8A4McdEJEP5u6\r\ntAYyIDEoCA4ki+Qb/ekiY8xJa7nA3C2eGE3TEGJpOjQtUy6UXFdepTa4Xksh\r\nkthjshZrHIF54GihpzfWmEpPLLfnoBR07a4XAkQE59uTWWjOLXPEDoA9zFmM\r\nfb48rnRALM3PlggLMXQQKCiCSaTKYmhFkPB2BuWktJVltlAehWZJetOxy01E\r\nsTsgFpEca3SUuX3RRBqUEoDZEhdNwu34R6OnP5XoC6CjkBcqI/NQ6UpxJ6BS\r\ncwT/c+Wmao5W+Tj3YqfcbkbFvdSXSOw8J2yhtJ1T4VHPN2nWXBIQLV4AkACn\r\nYF8iGmQvRStzVGbh3baF8dOw7/1DDlPN7ct9ZFU9PJKTOIwwse3uV8GmiVys\r\nRczn0s8mDPHJU9FVI3rsthOCuiyGcRQiNW8Cg3ndqx05r1zya1qUCNrb42f0\r\n1jDnRvfBaSZViTk7LfbHf1hquUIXLVBgF3VahSEhnueS3otJUZ7UqYIH1vsO\r\nSPPnDXui4+ks5dhKMxQngfIw99q7Ruuz7ps=\r\n=+t/X\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-b52fd615d4a69590478fe9a65258cf036e3518be-18.x/balena-jellyfish-metrics-2.0.200.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-b52fd615d4a69590478fe9a65258cf036e3518be-18.x/balena-jellyfish-metrics-2.0.200.tgz","_integrity":"sha512-CnRpffOcNPMrjnlAYwCXw/c68f9NzHj+Jr5XRrw3klLbQM08g249yCuuSmz33Ev9Vp7+caKBb603aNUGwwmCXA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-28T11:23:50.494Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.91","@balena/jellyfish-environment":"^14.0.17","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.2","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.60","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.185","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.200_1664364470263_0.6519662738647483","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.201-renovate-balena-jellyfish-logger-5-x-d850dc37c30f4e69db1d3fc3aaf4877f57e79d44":{"name":"@balena/jellyfish-metrics","version":"2.0.201-renovate-balena-jellyfish-logger-5-x-d850dc37c30f4e69db1d3fc3aaf4877f57e79d44","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.201-renovate-balena-jellyfish-logger-5-x-d850dc37c30f4e69db1d3fc3aaf4877f57e79d44","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9f003bd8ba3fe2599c869f596b784027a61f70af","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.201-renovate-balena-jellyfish-logger-5-x-d850dc37c30f4e69db1d3fc3aaf4877f57e79d44.tgz","fileCount":17,"integrity":"sha512-s/e9V+aoMSs5Mf06FevRhlHkh6+yaC7mFrKIXgxiTBragpVpsVtpcwSIQA2e2IMhYK5zUYG/Sd6+m8oIu3/TzQ==","signatures":[{"sig":"MEUCIFwdOWyKynS4x0s819x2poPKTY/7ArTcnifZSdw+0TSWAiEApKs3R3LN9Wgtp/UrXdTU75uZUAwehzH0CaeYBWhTX4Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68182,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNDBuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqwkg/8COYidHnxshX6fdDqBJorEI/oczdvAo1B5SmA4DcZrM6AfPgY\r\nh9vvZvTAYrpTSxwT2KV5fzXjXe+rFmVYyBgbzvKCgJUAcp9aRJyi4mh/bsot\r\n5hg3k9ZUVebUlrYjl4Z6mDLKGPjbkxUrdgbDfjqk9ibvQ/N55+TonzJmgu+Q\r\neWioQuCWmro/UENJ+loDEoPwuYlW4S6uvEvDsTQrPVME2rPfpuGYnkuPE1z5\r\nBoKecNYePaL6lb9CY5bB/3Wo8USfL2y5NsE41Ip5ul+XxfdYq0dvAUU9pjoS\r\norKXaSIYXxeF2B9Ec8pWK01TBRsQR7BD0VidX0Jy/aYoI2101hccsGQ9S1o1\r\n9x/Uxk/MsIhn5redR8DqFJGpZVnbVgR/yJ07eZItMqMQWwnO8+Qq+cRYW91/\r\niBRQ82I6RU0R/8qWwaJnkRURaYSEu3r89O9oMFWH369cvi5IrXlCxWYQaF7J\r\n60ZG9GdBdpeSQ9aVe062/Khe+GiTnW3ZirBHhvDba1AU0/crZyv2R+Ap5A3N\r\naQYJLWTbQ6NF+Uqo5/g2AzVtKqg0GXdDrTkTB7TgeCEHMODKW/kIdOhmjP8+\r\nMNYwQ3JVreNuusFjA3NhwMLtsCFFgtMzhoH5nLqjP2m2qkVlXxXY4UGZS9H2\r\nb7eC9cU4Lqh9KmoMScVimFvwRCPSOLDZEMQ=\r\n=oUMy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-d850dc37c30f4e69db1d3fc3aaf4877f57e79d44-18.x/balena-jellyfish-metrics-2.0.201.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-d850dc37c30f4e69db1d3fc3aaf4877f57e79d44-18.x/balena-jellyfish-metrics-2.0.201.tgz","_integrity":"sha512-s/e9V+aoMSs5Mf06FevRhlHkh6+yaC7mFrKIXgxiTBragpVpsVtpcwSIQA2e2IMhYK5zUYG/Sd6+m8oIu3/TzQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-28T11:29:19.233Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.92","@balena/jellyfish-environment":"^14.0.17","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.2","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.60","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.185","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.201-renovate-balena-jellyfish-logger-5-x-d850dc37c30f4e69db1d3fc3aaf4877f57e79d44_1664364654708_0.12581979664505427","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.201":{"name":"@balena/jellyfish-metrics","version":"2.0.201","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.201","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3739e6433ff8e2bc8d98456cdb75fdbec1fd6931","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.201.tgz","fileCount":15,"integrity":"sha512-CJ7ESs78ilqVNULAzLQAAxJ1eUyqDw730aFgvQo+1+6c/bT+qwyf/Zv4nIfK7p78Q+o1J9glTm53KkShta5VUQ==","signatures":[{"sig":"MEYCIQCWKFjfTu0c6g3pgNszKC0soksdTM+71kLYN4seykd+5gIhAOn76ph4uiA23VFZohQaUGtBmtwHLsP2/nZcSXeoJLD0","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68104,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNDEFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmolMBAAlZw7pyCdmr6nShiBI53stVsIcOusiIG5ZKev8Q5czslmiPmM\r\n1wBfG01YnoD9yPnHxyN8pbhw5IkGkJ2dEvU+oIPK7DSwaf2yVTLlc/OxPEGG\r\nRdhyqFi1JQdB+BawdRrKlsZ56B8ylXnijU5t9AmR5vJxEd6zA/jNhWFqBvsu\r\nlNhqp4SnpRNaJ6dGeSpfGmjx4SYQYUTUDueSIwOE1E+7o7XFnb+z2YOMJFMo\r\nQtMqpmBwwVlQYjWqfoNscskrY20CyaUA+iWJAEmGNwhcG6aKWSmtyD8sZz+Q\r\niXn3KwGjkmSjt+S+sMPQfYB6gJIWgx8f0kix2hSp14mM67WdtyMw1bPwmvik\r\n+bgjD4j6LlmndVNuFeexi6QkGlOWrlMxR2jwcOepkLpn1u8pq9WxKjOhPfm2\r\nr9HnFpqrte22hrn4spLlv0FQvhO3wfveqGrAIIwgzxRE11NbiAnItBhu0W3n\r\n6+ys+wEQl4RZdCD7KMp34MP0B6pjSZC+W2Khm2I0wx981/nkXZsE2RRv+3Jg\r\n2OEQ+v+ysp7XJivgwA9DumAUkj44pGTwtQqQgQccLpz9pXc6WrelE5jSPC4x\r\nYJVXyPn6bUYmS4g2110RrecAOEieC89YF9w/wAu0TxTCNyoJaXD0yEmP3BAZ\r\njhtmDSBuXeEYJfoDg3+ZU8oQzZeuFfb3G5Q=\r\n=wscO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-d850dc37c30f4e69db1d3fc3aaf4877f57e79d44-18.x/balena-jellyfish-metrics-2.0.201.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-d850dc37c30f4e69db1d3fc3aaf4877f57e79d44-18.x/balena-jellyfish-metrics-2.0.201.tgz","_integrity":"sha512-CJ7ESs78ilqVNULAzLQAAxJ1eUyqDw730aFgvQo+1+6c/bT+qwyf/Zv4nIfK7p78Q+o1J9glTm53KkShta5VUQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-09-28T11:29:19.233Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.92","@balena/jellyfish-environment":"^14.0.17","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.2","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.60","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.185","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.201_1664364805213_0.9174601143535801","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.202-renovate-balena-jellyfish-logger-5-x-539903c9db75cad75493f893ffaf924d002c5e12":{"name":"@balena/jellyfish-metrics","version":"2.0.202-renovate-balena-jellyfish-logger-5-x-539903c9db75cad75493f893ffaf924d002c5e12","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.202-renovate-balena-jellyfish-logger-5-x-539903c9db75cad75493f893ffaf924d002c5e12","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3283ef5dc4a3aba23f39b96a41ec4c015087df8d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.202-renovate-balena-jellyfish-logger-5-x-539903c9db75cad75493f893ffaf924d002c5e12.tgz","fileCount":17,"integrity":"sha512-9Uj4wgq6lh6swcHgTT47yQsVkOLAzhz5YxM0uevOAYq8ED9E2gpWncBFVKKlQsMpKojPyuYGV01/V6UdPmqFvA==","signatures":[{"sig":"MEQCIH/Tk2lR7umMmueGqYqGpFnW7jwlOkhL3RhvtJGewxAeAiBBveDCxLH6QFggg0SjDAn5T/QhMgRpnLUrrp9jHReLdQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68182,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjN6KHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr6rxAAgovLSSXKX2K9gyW6wNWJoRvIdJQHjj7ThKUQlXhaOcA8qGCm\r\n/zNI1ETMfIeIGrFNyZVJHw758wixrIttLb3pWsgNNSqTaovrgN0BzyGzc5lE\r\nCC/vLuj3x8Pc5dLNa2l/B6xypBfqfxzSdFP7fRodOEw5N6meJcCJ69r3fqMO\r\nNPDP6qXBghMoOgULa3KeMorE4UDgujbjnCZqkPYUu9WStkBfqXRawWJC+Yx+\r\nJlUdHzWageBZabfnqydYE5zceUSSMl2TEfuyGynp63yN1P5b4p6vXlOmapC4\r\naftAnCt8KI7aMYcboEsewp46q9qBjZuT/1/rNPtCuy8sVO/UAE+PEY8QMqw8\r\nKZzK4pn29pDIgvI6iBtnkAIAJ9LT/EAIimkdeuaJS83aWr1P0Fr7PTxt9LWN\r\n04BaFJeLfLrHlywH20q1V23i9/6ppDqZCed435m6QLBzrI8tNK0ezjmjqT3i\r\nJ+gygNGeLf1sufKHwHCuZRWeXlO8dy1cYaF7WEmtqhl3wc0Xm7WuBkMWc2d7\r\nYF1+9NyonlLwSVi+liQsz9CdD2vs0So4tWCQmvEz46tJ4W6vYV3z2CaIqunq\r\nND4nKX2K4Bsk3DelvadzANcyAULYPkDb8htGJ7Pi3QqGiotcsVf2S7YDrP3E\r\nwg7ZZnRzGrNZFFGNMAfaHEAFh477EW9JOvM=\r\n=VQIF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-539903c9db75cad75493f893ffaf924d002c5e12-18.x/balena-jellyfish-metrics-2.0.202.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-539903c9db75cad75493f893ffaf924d002c5e12-18.x/balena-jellyfish-metrics-2.0.202.tgz","_integrity":"sha512-9Uj4wgq6lh6swcHgTT47yQsVkOLAzhz5YxM0uevOAYq8ED9E2gpWncBFVKKlQsMpKojPyuYGV01/V6UdPmqFvA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-01T02:13:05.702Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.94","@balena/jellyfish-environment":"^14.0.17","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.2","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.60","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.185","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.202-renovate-balena-jellyfish-logger-5-x-539903c9db75cad75493f893ffaf924d002c5e12_1664590470870_0.902105060690473","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.202":{"name":"@balena/jellyfish-metrics","version":"2.0.202","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.202","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3cafefffe9757c3cd5147206bd31066adbc515ee","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.202.tgz","fileCount":15,"integrity":"sha512-v4JpmZfToRl0ifNLECZyInJ6I9Hi1jmXgdBZtOaQrpSo+CXrCqUJF5auwlFi1MBipjJFOtgpupdUwfFvPkPk5A==","signatures":[{"sig":"MEUCIQCBcmY2G59pvRYYOWOc3lF21Luphb//jz7Dar3m7+bcpwIgKhqAqgRDA4dh/36UxixpJ3QB1Sk48OmSqbjgrHUNTCc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68104,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjN6MZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo9cg/+OIcDeyJN8k7Q8ZdbSUO0pSeGRt/vzhKgTihxAZrae8n3FoHg\r\n7/3rGD87eAzVlvy3PLY4RX2W1OkmCeDgyHKGKwKptwsYvFP7z8ScpyCVjOx1\r\n5gHMeKfqTp8kcKOi6N9Fws6wUSFY/WjEDwdhwhLr248yJyNSp9qYWMv+0M0M\r\npJJ6/XrPdNMqdbmulxzX65H2c0eq1mypv7sKeSXHOPWS3Gu/nNzK43sDvuYN\r\nTqmG6FFT/vWwdLWZAT5HRyLw1Xp/Ey1SqUUZay6OSfS8IvrZflNBiu24NqNR\r\nfEG9nBDdfSnI47xvhCaKNbUDI2JMg8DrXfDMVShL84Y2SGgwEhW3/uYdDSSS\r\n7kWKOQjy1hp+2Lxb+4nZrrNWM1kiJSwIZEXjTlPBHOQ7KM5hw+h55RbztyHg\r\no/AwJCRC6sVZ7gD2GVdLfAYIuKCpG+rtg6fZ5Zs3Up4SabY7CDeo5PjgxHRf\r\nsUdx0eDwCBJgvNCellChJ01avxZP99tfM3eugZlpKYnvqMuJ2YF+tKiweIAM\r\na+4wwCGJqlRZoZzEIoKla91LHEhHrY3CPMoQaHo/9QRLizW9CKPD8k0kaopY\r\nZBekkS1JXkl+DJNBHKfs10JaRb9m7g7O/gtVl5dzhhFaDHuNPqmxwm+0Md8t\r\npyBC8yEnhkNsM6fycM8PNL8+XxiEwJbaHiM=\r\n=jMEM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-539903c9db75cad75493f893ffaf924d002c5e12-18.x/balena-jellyfish-metrics-2.0.202.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-539903c9db75cad75493f893ffaf924d002c5e12-18.x/balena-jellyfish-metrics-2.0.202.tgz","_integrity":"sha512-v4JpmZfToRl0ifNLECZyInJ6I9Hi1jmXgdBZtOaQrpSo+CXrCqUJF5auwlFi1MBipjJFOtgpupdUwfFvPkPk5A==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-01T02:13:05.702Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.94","@balena/jellyfish-environment":"^14.0.17","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.2","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.60","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.185","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.202_1664590617258_0.6455171650125704","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.203-renovate-lodash-4-x-03e4a6d314f9cb4720bf0e6953c33786bfc99ac4":{"name":"@balena/jellyfish-metrics","version":"2.0.203-renovate-lodash-4-x-03e4a6d314f9cb4720bf0e6953c33786bfc99ac4","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.203-renovate-lodash-4-x-03e4a6d314f9cb4720bf0e6953c33786bfc99ac4","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ae0686c4a8549e3adb2acc0a79e3f095b63280d5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.203-renovate-lodash-4-x-03e4a6d314f9cb4720bf0e6953c33786bfc99ac4.tgz","fileCount":17,"integrity":"sha512-/Clr3eVYX87H5r3WiBuJCpE8oqIYitL389X7zd2irDpykZAB3NDRkNB1MukrAVrbAujACg+ocDkYoAEgBRKWfA==","signatures":[{"sig":"MEUCIQDEjHln7zHXpsd5FSt5ipQ7zU5czatCXshC8jgMt6S+WwIgQtRcr83N0ZMxN4CYmGjkaTaBc19f3ZEOdjiFaY30bDA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68165,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjN6PHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpuHQ/8CimeVB6lYg9inJJdUZdu40jaD+DhDatSzPq3bjmmyJeZ0LVt\r\ngpnmXMHus1krJmAtadwXujsQeCZ/KAdXAiWfLaOBtELwIsAmeHG+thPGLwZ+\r\nynPQoiM3fFn8cy9IQAXzkQkpJNft4TMkPpWXDOFGHhnEeB1zwBI1fp5hzLkY\r\nC6Z25vD83euwa4V39bKFU+tU0FUD/o0tzxwnCyC3cO/ihzpl61XPXovp/CMa\r\nw7Q2WY0AxvnFQNKF7fVVvgedgDxo9MEhFNEFIMvZcKDxF5Ku0fOBP0Cpnl2H\r\n6KRgG4KNVJxi2capKiIO9ZP1gEPTOuQivZUTPK5lpv6oWAnMPvBQDv2XmHEW\r\nwqyAs/eKTwNtA94YXbeNteDFUUfzHcBF5RH+OEwwI81tRzeErgEuNPCdVz7K\r\nTBw5O5p3mwTM3nsIaHMf2pLVKHkGwvmbAm48gQRGBH/xBMUdu60tVcl/TKep\r\nwhVxKVJ7sglMtYsiCteaMw73cK+p0yMP2HNE59RTLQ9GBNKkdCZQQMUpXyuT\r\nwVlFHw+GWRvnflltNya7HLH6N8JxNHbHs/Hw1PB3G04dwNqKJrKzDaIqmZkI\r\ntL04r7Dn1EBBnqyLCnjH4Gm2IV9S+WTKDRXGQ3froCUgHb0zFfUwp0vVNWSk\r\nZSxXcausbT9KMiLPEpWYpvfc7msj/BFUsok=\r\n=2a0H\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-03e4a6d314f9cb4720bf0e6953c33786bfc99ac4-18.x/balena-jellyfish-metrics-2.0.203.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-03e4a6d314f9cb4720bf0e6953c33786bfc99ac4-18.x/balena-jellyfish-metrics-2.0.203.tgz","_integrity":"sha512-/Clr3eVYX87H5r3WiBuJCpE8oqIYitL389X7zd2irDpykZAB3NDRkNB1MukrAVrbAujACg+ocDkYoAEgBRKWfA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-01T02:18:28.500Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.94","@balena/jellyfish-environment":"^14.0.17","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.2","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.60","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.203-renovate-lodash-4-x-03e4a6d314f9cb4720bf0e6953c33786bfc99ac4_1664590791226_0.9884444399815895","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.203":{"name":"@balena/jellyfish-metrics","version":"2.0.203","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.203","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"385c44332986de6ae1eb3a4b2b2652f16e26bd5d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.203.tgz","fileCount":15,"integrity":"sha512-sGf+/KWjUCXVvFQd6IdMRn0aHw3tCjE3J7utvy3G4IpU+iK8zrleVsMP6jP5MHI0D41LIeYkI6MhrId7W+2rLw==","signatures":[{"sig":"MEYCIQDdCeRV7HW1MorPS8FMqfyGH4faWPM7R2iJRPjWWbANSQIhAM0d2qNVQhl47RTA6TadxLpDOLiMOMvDS0MnE0F3NgtQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68104,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjN6RfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpMXg//ff4j46/blaullwtzySJUg+BHASz2d2H1NgO6v1JXWs/rQCe6\r\n7/UU2ia+8N6cwZofCRqdwFTYa3yhH4CmwXhAHwZq+2HPW7z2+GABPuDAR2AL\r\nJYFMcWEpO0SK724o34ndun8IN6dQfPC2y7DxzDMhKshr3IWfM+lwKDZFNvUq\r\nlVqgiHMoHvALDVkq/8+93NCf/Py5v+jk+eve9SooHPMC3PW3j1rYZ4rfJfc9\r\nDlnaA3aElIK6+sMhuKc4n/GbYvXiGD5Otr7ibLSoOnXriIAvHC1Sz73eXSz1\r\nfxjmQYHkEhyUugbVvOehDeTGJsrP6BXDKUXaa8XPqslJKMKxu7sqYK8skYG3\r\nGrYKMnj2zuw3rILo/ugUxyk0dv8wrvIjWF3N+2WrF/UF7GQOVuMPZAIzGYXM\r\ncCVLx4mSFWUpSNwpwn+E+KxDulJiDCtzAo/y9N0XdEGZ8cj7/PP3snrDH8WR\r\ni82S0I2KyAt2eo8FqZ9/oFPCSy6NBLV48O9JMFXlEhtIb591x+G9ILZQN+8+\r\ntOK4BUuTC5DgH3ssG4SFQ0X3kGhRd3rn7cW8vm4DyJpgqhMFep0fTTewzQlC\r\nSXeyj4jTQ/NDiEuOXCYSXMXpqLmDoLgPhvXimcTELV274PS3lG5GDJTlgZuE\r\nP/t3BMA8lLgPaqx8EvwcfxpM6hMW4D7fuTQ=\r\n=+3pH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-03e4a6d314f9cb4720bf0e6953c33786bfc99ac4-18.x/balena-jellyfish-metrics-2.0.203.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-03e4a6d314f9cb4720bf0e6953c33786bfc99ac4-18.x/balena-jellyfish-metrics-2.0.203.tgz","_integrity":"sha512-sGf+/KWjUCXVvFQd6IdMRn0aHw3tCjE3J7utvy3G4IpU+iK8zrleVsMP6jP5MHI0D41LIeYkI6MhrId7W+2rLw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-01T02:18:28.500Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.94","@balena/jellyfish-environment":"^14.0.17","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.2","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.60","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.203_1664590942943_0.5088559434962694","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.204-renovate-balena-jellyfish-environment-14-x-a6a3156835406dfb0101c381a55297a3c867740a":{"name":"@balena/jellyfish-metrics","version":"2.0.204-renovate-balena-jellyfish-environment-14-x-a6a3156835406dfb0101c381a55297a3c867740a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.204-renovate-balena-jellyfish-environment-14-x-a6a3156835406dfb0101c381a55297a3c867740a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5789c2f9194cb0009c1e8d8b19673b60c7a54a90","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.204-renovate-balena-jellyfish-environment-14-x-a6a3156835406dfb0101c381a55297a3c867740a.tgz","fileCount":17,"integrity":"sha512-+gGt31Psz1g9KpFfOKV66Go+Nahuvc7BRANCZ0K2tACn056YUTSF8aER2iG9sbf4jnuvW+JJEovSiPcwjRKkWw==","signatures":[{"sig":"MEUCIE54XmiNxeSnYlj3Ok4YjDVHeb/yyU+TwqIoz+UWqT6OAiEA+/oF4jwzbkTE5bXs/UwkZ2XWXP4m/lR0ynXytbppMO8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjN86IACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqeuw//dojLFqP5Ds6e5/Sh0QBMR+9+mcmKVUeli7WjPEhIngytcSY4\r\n5c1GsshxkTD6tNA9IniQS+V05G6k7YEE63TDSO0p0nBEx4HBrcMGJXCKOcaq\r\nRwOwTJHjpxRpQFFNX6JfKvmWTqKVp6TQwaDaOMVQ0GtIiYgdb2tq4SrzyfT0\r\n7kTVSOidXHfCt2qFz72c1o4T6xlfaVbqcX+QZ5Mkpb5RuOFGYnoJ+3q+UL7T\r\nCcDDlAxsC7ASD/vUeec5CPs91eTr0EiegHO+QZ5ybS7+8Cug8KsO5nV3PmWr\r\nbMJjzrTSUJxsF4264VUJd/ZdgfYQiQgrzu8mSbnnWF6GYm91l2+ZRiS3Gh+Y\r\npmaZXDhaiZysging3dg1NAqlsfNCVhq7qiRXyNwqHe6T1uf/eGFEMeCPsRDB\r\ncvtEs3+TH3VEt6FEI07t+xZcJdQc30mF5pReT0Nx1SPuCrD/9bqFdp9xw7bb\r\nqxEP+YA0MLSxKw0A5k4fMuH2HOENoF8yDnWHRNPXFzgTP9JopInq0NPQKwit\r\nLQFVYrrR7WpzJZySLS9+xYmqleDMbzTxyaVBGHiwrgJT3oLvf/J6aahbQOh3\r\nEwV5FAUdeSLNhtgKdqINs0ltbMQ3s0P+qfnHQNhv9yckSbR+ESGWadDBCKTP\r\nx7IsCX+yHGPzln4fj3RfSMZ9zNzo/HjQrbY=\r\n=kawh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-a6a3156835406dfb0101c381a55297a3c867740a-18.x/balena-jellyfish-metrics-2.0.204.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-a6a3156835406dfb0101c381a55297a3c867740a-18.x/balena-jellyfish-metrics-2.0.204.tgz","_integrity":"sha512-+gGt31Psz1g9KpFfOKV66Go+Nahuvc7BRANCZ0K2tACn056YUTSF8aER2iG9sbf4jnuvW+JJEovSiPcwjRKkWw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-01T05:20:43.654Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.94","@balena/jellyfish-environment":"^14.0.19","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.2","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.60","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.204-renovate-balena-jellyfish-environment-14-x-a6a3156835406dfb0101c381a55297a3c867740a_1664601735789_0.025661299662045778","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.204":{"name":"@balena/jellyfish-metrics","version":"2.0.204","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.204","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d748842c4aa70a70702bd17a587f2adcf33125f2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.204.tgz","fileCount":15,"integrity":"sha512-AZ+FRFvkc43B8zq7dJSRU0N5KU7qpWxioHjhH9ZtmkM50CqN5lPQu3iRORqps9cAeNgXliySdHVKsI2ofTExbQ==","signatures":[{"sig":"MEYCIQDZ+Xf3uKQvbqQ2JfZtOw7yUDDKwXn7yMgdDDQCX8/mfgIhAMM/9etZHv2Usa3LbwveeIgCOKN1ZXUTUiy2D0RWptOw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68104,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjN88bACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqIPA//T2QSDuZcjVsu41J8IFdTv66Ps92eX5F1qOuo1yi0yXETEzIX\r\nTC0+ELFMajp6KJjCWtsD+2NQJc8ohKqW6EhpD41Vky5QRiNm2FAuo4mfGPQp\r\njaQtKR9OAAT5JQPhA0DS510FzUDLsrt56o0uY09LE8zNmK8MlSE9BXyKKxVk\r\nAcLf5ErbK05nTgcOHrlSbYisqhPFXbzKdSdWj/RdvOP/jGxBwu68bvrjVypM\r\nEas2DAvThnbUKXymD3VbA9eX9Bu2ySud44JSbaKf7dU1MrzeRPfKBYXVzWRf\r\nrpCM7xgJ0oBkExPKKG8/QHWEc5QtzdhbHyKvAjf7DT3PeaDIfVd67D+/DNVW\r\neh+67ZzqHyeLwvkNWUuRWqRRRZV2//zWhXozaM34YaNVnfVOGkV/j73gaGZi\r\nlEjYExd7r6JLTKu9zWCUy6G6fl9jp5XvGkPOXbDdH+jKGx9EXHBav9nDnXKw\r\nRUWAT29IA8oO40mKpYsvyTn1nPVNZuvWGCZcQl0NRtihe1hWwyf+Z0kJla06\r\neuLmgo65ksaFjcrpHM5OGYVq8n8iuqi9RReDeFE9pfhGNmbMyq0ArUjBAyXp\r\nQ1ELzIMqdbGOaSQzylU2H6060Kukd27/ARevcSquN1qJYlK1kTsBQMeUKxJ6\r\norN9e3JaA2KpNtCbzZcwGTB4dqYmNZolRsY=\r\n=FSEa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-a6a3156835406dfb0101c381a55297a3c867740a-18.x/balena-jellyfish-metrics-2.0.204.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-a6a3156835406dfb0101c381a55297a3c867740a-18.x/balena-jellyfish-metrics-2.0.204.tgz","_integrity":"sha512-AZ+FRFvkc43B8zq7dJSRU0N5KU7qpWxioHjhH9ZtmkM50CqN5lPQu3iRORqps9cAeNgXliySdHVKsI2ofTExbQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-01T05:20:43.654Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.94","@balena/jellyfish-environment":"^14.0.19","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.2","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.60","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.204_1664601883353_0.6678792909138165","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.205-renovate-balena-jellyfish-logger-5-x-9947cf4293b8f78e4ac3c693d607135a4d9cdd17":{"name":"@balena/jellyfish-metrics","version":"2.0.205-renovate-balena-jellyfish-logger-5-x-9947cf4293b8f78e4ac3c693d607135a4d9cdd17","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.205-renovate-balena-jellyfish-logger-5-x-9947cf4293b8f78e4ac3c693d607135a4d9cdd17","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f016c25375873a42c04d88136492fe9dee827e69","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.205-renovate-balena-jellyfish-logger-5-x-9947cf4293b8f78e4ac3c693d607135a4d9cdd17.tgz","fileCount":17,"integrity":"sha512-KfkihA4nuaqoN5EEraAuEx6Mi3qvoSnUdmofmaPCESBV9nz4FT060jRzyZH10ixWnTw1bFyQG14Ydic522wHiA==","signatures":[{"sig":"MEUCIC/bYyWhRMxYamK4HV+wRjDEKhEoAzA/ExehnCzwqMoOAiEAgEh7WLkZgn0RxCbsRlKmqO5N+9TcRcKFKFtUWH/mbus=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68182,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjN8/PACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr++g//YHBmJFOq8uJhmgcDUQ+VyW/AOfUTxeqterjk6WVGPrPnNzgW\r\nXgZqhfT0tMqjjjYzJP989U42kXDkr9m9YaFgiCTRObWtZnqxoi6B+F7fkKUd\r\nLFXABgoMBj9nY4CSxrt/D4Y6RJKMthGqRu0bbbjlEMmdT5X5/dtA5Nwt+uj3\r\nKx0Sx8vlENkpT52DqCWunazYbe4CxbE/QApwz/cxdHIMSI4PUXzyNkJmk9ka\r\ngPPApK4UK+eQt6ptPa8/DEbPuBSMWoWp0qfF7w0apIYlAou5fWwZRf6XXRT3\r\nNMfzBPLEG9cj1MLui+rETXdd9GLdcG5di+wykrxgYlJoK8oC0J4BKHUKfWS8\r\ni7jS+rlTCAFtaaphh30cZy1hF93totmEfg8VXMlQvqaGQBxd0Gc/rBKMLBB5\r\n/2jnC0101bSpry5QDEpi4Z5n9FHfdZBflPjkgtHY0eS5MOwUGdFNnVm8kAe6\r\n0IhrNZtAzv4KBm8cpXMQn21Q+6hcEk1/FPUe7Te/9scyRof2IrII0dL1i1mS\r\nOwNwW6TbWmligzCjZOBBxgb1kiPdw1pi5vQdnUeew1AvuY2tjiFt6ANF7cjY\r\nr6Rwly/Mu+2F4qSYaViFoQiitKzzbCfnRLsrIZmrDvkh5Z/3lVyWtRAJeK30\r\niGwS0qpLhyR/EBEWOqWW+G8HwSaj6qP30B4=\r\n=hrrI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-9947cf4293b8f78e4ac3c693d607135a4d9cdd17-18.x/balena-jellyfish-metrics-2.0.205.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-9947cf4293b8f78e4ac3c693d607135a4d9cdd17-18.x/balena-jellyfish-metrics-2.0.205.tgz","_integrity":"sha512-KfkihA4nuaqoN5EEraAuEx6Mi3qvoSnUdmofmaPCESBV9nz4FT060jRzyZH10ixWnTw1bFyQG14Ydic522wHiA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-01T05:26:26.665Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.97","@balena/jellyfish-environment":"^14.0.19","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.2","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.60","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.205-renovate-balena-jellyfish-logger-5-x-9947cf4293b8f78e4ac3c693d607135a4d9cdd17_1664602063677_0.625797394817827","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.205":{"name":"@balena/jellyfish-metrics","version":"2.0.205","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.205","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8e95cbf0198057576dd56dad4f1dcfa44ed0cb5c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.205.tgz","fileCount":15,"integrity":"sha512-12SrtWmzPzGuxULvA04Y4Wdm0EaBfN/JQgxMCCDCssKvg0i3PJoQi6MbBsDsaGnw1zUNXrzVoIy8Pt73r1LeGQ==","signatures":[{"sig":"MEUCIQDU+w9kp1IiNmoNOeNkJQGkVt+N/3iEHMqNTgFi9o8rqAIgbtcjZnhboiNGfoEd6ydSOm0qOMJ2PufjHR6EwOC9mU8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68104,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjN9BrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq8DBAAldcS5Kq+PdiFFlo0vx/y6J7idD6mdO/qV+JUjKMLjwN2A1MU\r\nWeU1F6rDN+ZQ95fE1N3c8EzTirKegNq1GdWWbiBXktOJKrCNNAWOOBf1dS3r\r\n47Hf/E4X1AQ1uOF3mCqhX7pT/o2xqea3iQE7bmn7/1NKltFPA1d2m5AhrLzL\r\ngMtsPzSnIpHVs1HRqFqaRLjzTFniyHZyIQn3Uv+iTfvBd6fJ0GzLoiKYUhf2\r\ntEMFWkrkmtrX9C31Otlaq8KkyetHzaIih3z4D+OUPs6AiKAJ9A1Cwlh2AlJw\r\nY4xFFfgIzSUmwH2CnR8v6V+PP1OdrWzqspsnpw2k04zZVaaSo0xADlbabJst\r\nswgEstN0S0jUeSxdL0oGrbcxr/QPi3Ep/sMAoSWWagVLemQ14RothjCNj8MS\r\nUJ6G4kRRrypFZzJ2QrkxguMQbEIYjJYQQAmdUtI35tYHKAO262hnfo9pqrdX\r\npiF1k4xEPxhCSusOxkFZpZ9r38twjLVncb0oS6zo88uW2sE7GRDtfOE2v8FR\r\nwNwi5jxDHQMBIk4cBUfaZJWBc7UfP0SLqPHcJJCSSO6+lhVXO+V62qXKLLmM\r\nXcv8xYPJ+iKj92jQQqQjby4PqlPSR+2zuQ4DUF3fdtfnyVcQid4IXBruPMof\r\n537WsxTgtDnR8zMBmWmIJUz0Xz7IczOAxoQ=\r\n=nJ9c\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-9947cf4293b8f78e4ac3c693d607135a4d9cdd17-18.x/balena-jellyfish-metrics-2.0.205.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-9947cf4293b8f78e4ac3c693d607135a4d9cdd17-18.x/balena-jellyfish-metrics-2.0.205.tgz","_integrity":"sha512-12SrtWmzPzGuxULvA04Y4Wdm0EaBfN/JQgxMCCDCssKvg0i3PJoQi6MbBsDsaGnw1zUNXrzVoIy8Pt73r1LeGQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-01T05:26:26.665Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.97","@balena/jellyfish-environment":"^14.0.19","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.2","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.60","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.205_1664602219139_0.5327519348320935","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.206-renovate-balena-jellyfish-environment-14-x-0410b25d19628cb2dca81ab18c71ef4dfb2be839":{"name":"@balena/jellyfish-metrics","version":"2.0.206-renovate-balena-jellyfish-environment-14-x-0410b25d19628cb2dca81ab18c71ef4dfb2be839","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.206-renovate-balena-jellyfish-environment-14-x-0410b25d19628cb2dca81ab18c71ef4dfb2be839","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c5d3c931ffb9d77cc34f4d26ce1d238df03aeedc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.206-renovate-balena-jellyfish-environment-14-x-0410b25d19628cb2dca81ab18c71ef4dfb2be839.tgz","fileCount":17,"integrity":"sha512-f2EPjXxu5mdNzcu5zkdQBsbHShCxK8etLWhQd0pi6gjJvcENJ8h7U17aH6vdt2nB1wfh2hAEvD1Mx7ePr2sPPg==","signatures":[{"sig":"MEUCIQDrAOt1sbkuDGAfEReRCQPat5nfKwYTe8+xwbrIzcv66QIgEZRvn/tURPDsSxqXPxbxj7NoX1jiZCTBoZNmH8nFQ14=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjOAFQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqsDQ/+IlKCHZ4VST5MvESBhrWWCCWnPn3/4H9K0ddIm90MonCPyUbS\r\nZtxQ85m8Y9InM+10jpXYLWcYxfTd15fPcHRw7hHS2iemHv3QoXThZyEEZku4\r\nr47hNnxFsFabDTK8U/ph2kHmH1ZuxDQyo8KqP0uJXume8KajCquVPrPlxgj2\r\nV3ejbjK6eU7syYeXuP+cdBbxAeSYBuCsRLXYG0SL6ZLIVMjdYmGgWYlMmMMK\r\nUrtrENgTPlPv0cKzqc5z1Dyq2zZFWkICKZlvk3ftH1MrTfokCqLcSUVg/45K\r\nBeIkmLj9eBgBx8bSlib9GK1knU7aUaQQP2nm9hPRtlQTlYt/ffkH6xJtycxO\r\nUzCVEelfqQt+t3Ev5v+hSJZiqsYZKHYGXIyuvBrsMsRUrdMH0ML3Ay+9fren\r\n8YBdqnPBoZFNhiA6vJY406eYDlmDarcg7xN7bgHtxoPIhvWWVrbl/Gc9NAAQ\r\nl20JSfaXmcIasWiSAlYS5hA0Gv4VFDHR5pTEeKDgXEywT9VWI8KV+vI+Hzjz\r\n2jp1L1MKPFQHDZfkwxyg0dvu6+aNxqLnMExxwrnt2kVtprvfUihDvOF9zxjl\r\nWyBML6pZfEJGJJWsH7JAu+dL+GceNae2PkL2ogW5mdmh3T1N5OfGObjfv/Zm\r\n2iCkAtisFv/wFTkBhbQK+ZbSc31RW6Y8iWc=\r\n=Vm5H\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-0410b25d19628cb2dca81ab18c71ef4dfb2be839-18.x/balena-jellyfish-metrics-2.0.206.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-0410b25d19628cb2dca81ab18c71ef4dfb2be839-18.x/balena-jellyfish-metrics-2.0.206.tgz","_integrity":"sha512-f2EPjXxu5mdNzcu5zkdQBsbHShCxK8etLWhQd0pi6gjJvcENJ8h7U17aH6vdt2nB1wfh2hAEvD1Mx7ePr2sPPg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-01T08:57:33.830Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.97","@balena/jellyfish-environment":"^14.0.21","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.2","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.60","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.206-renovate-balena-jellyfish-environment-14-x-0410b25d19628cb2dca81ab18c71ef4dfb2be839_1664614735871_0.6202364005776051","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.206":{"name":"@balena/jellyfish-metrics","version":"2.0.206","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.206","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"053dc068fdf572fa4bad17f89d43a03cd4c6a80b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.206.tgz","fileCount":15,"integrity":"sha512-mImnJwIc4WGvrIGkI0f2dA4XTCGMVHDZxL4UXBg3BxwmvyylwktR4jvN6INkfL3eDnd0JqAaX4cB295mcwBORQ==","signatures":[{"sig":"MEYCIQCG+FWe30fGs2pPzlpAEUOTc03W+iEWCCGl6VZSskgPgQIhAPghPqt+zSoroiVDoK3S7LVWBt1BVaEqbPFyla3UeAWf","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68104,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjOAHhACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp2hw//cusdL7qDKO92IBY0HpB5PnopjnB8uxZoQeBX4CN/ECA9wgnI\r\n+yGieYLRQmuATEfk4nKOfHNwYLvp1i9lVkhwcZxVdpb2GQ7WMGmMorIHBRMs\r\nmZg6fjeUUvGR/vH2FWKBI9p/Zpp2MQvcJmU7Y+pkNKmhzc3XU/OL3/L8mjj+\r\n88tXZIBCsuQxZ5Jnh+tz8Zn1YBCsxjMrJN34BjupeHWuBbqfYBVqeKnzBMBX\r\nqi/ZtHRPUZ9kxfFx7nmwRSCIDaKz37eRdmtAaIjrhgPHs5IlHazBgfFIWQQz\r\no5DmBIU+voPthJPZmytisL/x3jhBwY45xc43YJTtlP9sbl+DHFeaaKx4ZYZE\r\nJ7NjRj9i4i+qyCr60E5KIUUZCIS68dXK2UAghiTycQRVBbSGhznDlPZBPmC5\r\nyIus1zDdUhABi4P56L+N+vI+9E1FyibRx9pAsYYZOtGp4ZepO6L7jaaH510F\r\nWhGC2cme+cbOfozkVivsf9dgv3rdHRaIYUNPip+YlkgoqJ8rFAxLrIlZAz5b\r\ntg1KA8hCIJcJ0/yHquYO0+MZq7XrEhMKWl8zKrDVj42AK6q7Hxo3R/r4qDXl\r\nbOo3AC3BnM7EUORoVpZYnGaQpRKsMabSbSjuEDubyWtHo6blLqOSOQbN8+Mc\r\n+8muCexZvss+ESIVm535QawjDmnL/zveNh4=\r\n=827S\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-0410b25d19628cb2dca81ab18c71ef4dfb2be839-18.x/balena-jellyfish-metrics-2.0.206.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-0410b25d19628cb2dca81ab18c71ef4dfb2be839-18.x/balena-jellyfish-metrics-2.0.206.tgz","_integrity":"sha512-mImnJwIc4WGvrIGkI0f2dA4XTCGMVHDZxL4UXBg3BxwmvyylwktR4jvN6INkfL3eDnd0JqAaX4cB295mcwBORQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-01T08:57:33.830Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.97","@balena/jellyfish-environment":"^14.0.21","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.2","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.60","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.206_1664614881574_0.7407675791952584","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.207-renovate-balena-jellyfish-logger-5-x-5683702a9b7254aa54ddee9f25e1176d471560da":{"name":"@balena/jellyfish-metrics","version":"2.0.207-renovate-balena-jellyfish-logger-5-x-5683702a9b7254aa54ddee9f25e1176d471560da","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.207-renovate-balena-jellyfish-logger-5-x-5683702a9b7254aa54ddee9f25e1176d471560da","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d3c637489635e2b02e9ca81215aa158ae06fd96a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.207-renovate-balena-jellyfish-logger-5-x-5683702a9b7254aa54ddee9f25e1176d471560da.tgz","fileCount":17,"integrity":"sha512-RzwoitdDT5GkEjhWi+aYfr6KeIu3MmH1Gz4dS2AebXg9fvPzMm4a36Sb//A4j/AD0OLAtEcMzUd3jYPw+gVTow==","signatures":[{"sig":"MEUCIQCHfBfdy5L2ojmP+Eti6d7f7aN+ZM96JOD7chfRf00eYwIgLnKCUbxeieoccb9LGqdeXoEnkDaOC4P1e5upVL5EndA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68182,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjOAKvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrFbRAAo7r+vTkRfPCxuHRvxw8J+G7xl7hqionXVFGapjQh3pWy57v+\r\nrqQ1uGcFmwI2gVyNsRT5RT3/phyfX8Bpn7AEIdSEtTzJaIzOar2OVm4QEAfc\r\noP+TWtuRAoYzz4O7yEWgoU286HoIFD4jBMVlKf34UaJXbQLnIF2Omkv05klH\r\nuqtiGaZJhKWCRFuLvM0lkmZylVtZPc+9JM6H4dYvJ2P5ecSUgrmkyPTq7sQZ\r\njHmWf4TTU6UQK9/a2QncUkaPi8nvpsPWCkFwrlRDX57Etna1WIBcXf+ewMUf\r\nH+oRey4CHH0WQNoKjqqe6N1SwYpxFoQ+d1csK2AaLOOoO6+xWPM2fqF4mZL1\r\nZTqw4uLEWaczf9o/Gd2o/TdtA1cSmeqh3WWitEpVxjHvwNGuO6QaE8yFpwSE\r\nCGmAEhti3W0/dq6qQKRVhUdRCxN7f7uv03SgLhsm0ttc1VmCEKmbft6NbQEC\r\nPKFJxxgLYv1Y5FE+5bfplGpDpYd0jckysvCbjVS2gfYX+8ADiDjxDTquuU3t\r\n76yHylXc5JGrNBn8pHtrOTdJgzanufULy8B1t5lzCistvv83meufK/EQOyN2\r\nSDc9yDJwqyVeGzu6LQs8/M66QyE6tFgCJ3a/d8NIFnHL10CmtEPvHwMQeCAB\r\nEKCaFyCrnj1f8DoD0MqfuMPbZhEMC9aTaJ8=\r\n=U/4O\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-5683702a9b7254aa54ddee9f25e1176d471560da-18.x/balena-jellyfish-metrics-2.0.207.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-5683702a9b7254aa54ddee9f25e1176d471560da-18.x/balena-jellyfish-metrics-2.0.207.tgz","_integrity":"sha512-RzwoitdDT5GkEjhWi+aYfr6KeIu3MmH1Gz4dS2AebXg9fvPzMm4a36Sb//A4j/AD0OLAtEcMzUd3jYPw+gVTow==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-01T09:03:19.613Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.99","@balena/jellyfish-environment":"^14.0.21","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.2","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.60","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.207-renovate-balena-jellyfish-logger-5-x-5683702a9b7254aa54ddee9f25e1176d471560da_1664615087347_0.9255065897806349","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.207":{"name":"@balena/jellyfish-metrics","version":"2.0.207","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.207","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b0f6c9474557265bf5b633f41744690f9c98d07a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.207.tgz","fileCount":15,"integrity":"sha512-6HL501ptkwo9JU9DYuOkrb3TpobzfGJ8n94wddGbJZ16rytaCaDRIW3rtmSNILLf/Lk2mI2PlO54ZHgtByQ9IQ==","signatures":[{"sig":"MEQCIGr4y7ReHbuzar8ZA/5jh2Kwd+o4rwA1uPNG4lX/8WW7AiAZZQy4df+52RRTKMEM/PB1SggFzkLXfsgXbFWu/kKsPQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68104,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjOAM7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrPWA//UjjKvDWVsyezFh42Fd4t2yaqPpr/HKlJ7dG8JfUnKCHDhJvn\r\nU6zQBURcfZ8TySAOD9MbG64hlbvhI5SceZ3p4aLhBN9/vn3nrJ7jN9VrreRL\r\nz4AKhC2O7Rkl+0dojDjpjxlaLUGtF3TnKWvu4y02W8lc2IKFijKwdae/XJjQ\r\nDHjIAdy5In2Qd/SvRXIa4MyFtvVresObIlGjJV9SM+vAx3yXtAeA2ot7k/8Z\r\nMJFRmSUw7V9zOOh7ReOyBMb7fFAZDBxEKZWOisdLc5FV6D8M6o2viiauslXd\r\nmGZ0XzuhgxLXVbq+pe3kg3pQExtYV3FZdXzUo9sp6qctPdSOrDwDUvaNxMV2\r\nMwTiQU00sVMZobeNeLC+8lbvEbBBvc1nAllrB5kbooUXIM03q3B7WkoquAd/\r\nIg61M9qQFga78D73qZuU3orp7fMMm/FMabrq/FnqBwEq62rk392+iziF9c2V\r\n36hioRhyiYw1ttFCa88Fa+UqpBZMruYrBzekvlV+cAJsim7Oe+/mbCiY1COa\r\nrahhAPl1i1b1t35E0XrOR29XXV1t0N7tircw3ca4z1yOlghcrdMGSmyMxM8o\r\nXpLLQe0u6mxYVEOryP4WGozu/GsilYM/q/0Uk/WiFd6MUpEToY9KF4em87qP\r\nhHAGX7/SV2ax+PSANhDQyELPHKAiZCOTugs=\r\n=xOoW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-5683702a9b7254aa54ddee9f25e1176d471560da-18.x/balena-jellyfish-metrics-2.0.207.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-5683702a9b7254aa54ddee9f25e1176d471560da-18.x/balena-jellyfish-metrics-2.0.207.tgz","_integrity":"sha512-6HL501ptkwo9JU9DYuOkrb3TpobzfGJ8n94wddGbJZ16rytaCaDRIW3rtmSNILLf/Lk2mI2PlO54ZHgtByQ9IQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-01T09:03:19.613Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.99","@balena/jellyfish-environment":"^14.0.21","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.2","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.60","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.207_1664615227623_0.029241257147156086","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.208-renovate-node-16-x-40c98bffaceeef0955e5239a8a4f82f812aa44b1":{"name":"@balena/jellyfish-metrics","version":"2.0.208-renovate-node-16-x-40c98bffaceeef0955e5239a8a4f82f812aa44b1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.208-renovate-node-16-x-40c98bffaceeef0955e5239a8a4f82f812aa44b1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cd5d918b2ab40432051872f7a18b2945bd553b60","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.208-renovate-node-16-x-40c98bffaceeef0955e5239a8a4f82f812aa44b1.tgz","fileCount":17,"integrity":"sha512-JLgE1EZ8XLkhRNQ+u4dPJ3zu3C9Wor//yu37iXZf1XaZmfJMbzJHRzQZyQZYI9PsDpFgLXetd6uOPJOo/ddmIA==","signatures":[{"sig":"MEYCIQDyJtYkuSXGOirT6Ya59nHHJNg6wjy920wblNQjr6SXsQIhALJNHo/xeaDnbIwpuPWA25CM/VZ4uI2KsSJIa1fCIMPg","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68164,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjOAQHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpREA/8DYhuxnMayZwDUrWRGdXzvSSDMLUvXnzuh3PqNG49rGM5n0dF\r\nvdi4usYZNrcsO/QfT5jPwtf9Ne/n3Dk2XM+J6vQZoQLIPk4EDhDHJ0dxvcaP\r\nTQ2KIJxJkfbKEa6CHrkcHGZUfLAUFU5ayfYvHosacMkWbBT7AySSuQTNjwZN\r\nUCD9BSUrsBjf4Ty16ifyMKGMvbCDE0QbBdgbbwpmd1mFMZAJnUx3TJRMF/wk\r\n8VOM4gPQYKDhZZh1dRN82y/UdviGxHbiXRA5Hf6/WTV2yq6jG6lw83dwpHnn\r\n5xZcX41KMmPYpJamGsgE8Hi6GtnaydyUyQocPJdKEemSPx7jO+rfusPnVe0u\r\nvJ6wVtXoNiFyOlhyOtSlgwj/OwGCNJjQoaEkmtRiQ22k8MyWa7lTsP/lgfxf\r\n044zg06bFdOVDRVij3skQeF3l5P+DAGHS+ayWkJAh0vovb1vLdWenfmNq9RY\r\nTHkbggGFhwN+L2WbrdD7+0AghiCOIPLxVhF+gKX1abLBTto4NGgE276miZ3r\r\nd2SpTDgXpQg9Y0fTTKEA2n/X6jp7cf5r3lo3Y3/XySbU921u7EsfuXcXVz6B\r\nWVgOiWClJ2ONMM0WadIlRD/+PGOGRdFBD3bhwY10PnXWW5QKf0qyYPsqbrYT\r\n4h9hln1apxBwEylNKLgJ9gBSD6GK5fQvN7U=\r\n=IxAz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-40c98bffaceeef0955e5239a8a4f82f812aa44b1-18.x/balena-jellyfish-metrics-2.0.208.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-40c98bffaceeef0955e5239a8a4f82f812aa44b1-18.x/balena-jellyfish-metrics-2.0.208.tgz","_integrity":"sha512-JLgE1EZ8XLkhRNQ+u4dPJ3zu3C9Wor//yu37iXZf1XaZmfJMbzJHRzQZyQZYI9PsDpFgLXetd6uOPJOo/ddmIA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-01T09:08:41.574Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.99","@balena/jellyfish-environment":"^14.0.21","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.2","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.62","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.208-renovate-node-16-x-40c98bffaceeef0955e5239a8a4f82f812aa44b1_1664615431680_0.11741078204448674","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.208":{"name":"@balena/jellyfish-metrics","version":"2.0.208","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.208","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b69186d88c6b70b0ba0d1cc1f5b70d38018e8c70","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.208.tgz","fileCount":15,"integrity":"sha512-RGDemc6d8IqkquSkYRgP0jHA+ycRt3FreLCRlQr7W543wUwFwb5XpcuOgVs+y8hXVn6x8yWucx+gzgU8MrbAEQ==","signatures":[{"sig":"MEQCIHwLmTlLLdwwsfBrN5Jy/W5qyfIL0QddES06Z84u71uRAiAOGRtGDu4uLNmCiUN49Mxhccv/dsOcnWhWScQhWAoN3w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68104,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjOASUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoBiw//d6HHHLylliNVc/3r5YrYC5l7k8SyAnEGvhrX9CFyChcjJ7X8\r\nE0X1/ZzMFIYr18xHJLjY2+nnrmwhHZHXRa9OfbEi+l26GZq6kvXZ1+Gusnyr\r\n1IzELd602m5pCR8VHFMUVN6MBzILFU6ccFBImQFMxmBbv4i6vem0gnTT3QJa\r\nY5j7dvTSYxSe2PP9MwivjbSJ+2s0178k7r8iTb3asurqfjtwcxT9UKU1Fxs4\r\ng2EIwerIvS04TsU6BqOytCmGYhXvc0UzbROV5h3lS+F/DJE+fn75dNGuAscL\r\ntRiGkZ1OE2VXxxTdN8n9umcTtJaQxKTqNIXPg9vKI90LuQ/aXCLW+SfwxveU\r\nV9PYkJzyYe3id64wvIL8GnHFJeMuYrJuKtEe8yRJI8DxRbfa2HJRuzYGk5iS\r\n66Hire0HyNUBHsH/ulSgSPZ18tpS4IICE8QWKqZlwxJUk85G2/cBfxxd/l7C\r\n5hRA/1Uyp8RkJaUahb6ogkEEq3Ac2ivuzn3vHAv13lXzRwxzhWlLvfhl96pu\r\nz30AjE5MZkC1hT+XqBZhgkvSCkMPrV2xB2T3K427B9z+jiqHnCvsF4FH5wdV\r\nRTGtbBm4PXt74WYj/9Eoi/RFheyTFyUW1Zru++N2EOx+n8lTkfuDqYskviUY\r\njL7bwidyOtrp8Pomk1ihRY2gfSo7iGL988w=\r\n=kCU4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-40c98bffaceeef0955e5239a8a4f82f812aa44b1-18.x/balena-jellyfish-metrics-2.0.208.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-40c98bffaceeef0955e5239a8a4f82f812aa44b1-18.x/balena-jellyfish-metrics-2.0.208.tgz","_integrity":"sha512-RGDemc6d8IqkquSkYRgP0jHA+ycRt3FreLCRlQr7W543wUwFwb5XpcuOgVs+y8hXVn6x8yWucx+gzgU8MrbAEQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-01T09:08:41.574Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.99","@balena/jellyfish-environment":"^14.0.21","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.2","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.62","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.208_1664615572396_0.03429213739910342","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.209-renovate-ts-jest-29-x-1002ce08d64a27b580dd37499dbc66ab4f2cd8d1":{"name":"@balena/jellyfish-metrics","version":"2.0.209-renovate-ts-jest-29-x-1002ce08d64a27b580dd37499dbc66ab4f2cd8d1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.209-renovate-ts-jest-29-x-1002ce08d64a27b580dd37499dbc66ab4f2cd8d1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e07eef31687884a993f5b063884bd6c71f710954","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.209-renovate-ts-jest-29-x-1002ce08d64a27b580dd37499dbc66ab4f2cd8d1.tgz","fileCount":17,"integrity":"sha512-8ucq3Lg4QNMBeeSsFgFSR+FYGcnRkVre6LOqqATb1Vd+9kPpJ2P9uVhbPs/U8mWA5fclF0xfZC9rlo78BRPtmA==","signatures":[{"sig":"MEQCIACgK+cHEm7AnlBH3imSNEYmK/+JhOy1RKLk1FrcHGZuAiB+sf7S8ETuSVME1KlLc0A9c+buRJB+TWgw6ziivsc9Wg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68167,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjOAU3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoKLg//XC5wSL+OQEqHGUcTCdr+rEzqKH89Z18fCxNACHPuxWOmb4eI\r\n2MC8cSmoCrJ1BGxbJbp5mKs3jhGoJLQYmK6YcgiDtklwDjFZpsVNyYqjkujc\r\nXwzUuqvOC9pVWxKyqXtkIcqgRpKYx7/UJtoLEbVoJhaphTm1DYR/aDNU1A4y\r\n/l4rhOpRZJO3La3zWk25YTobJpAcdZ/vWRCIz5ZEDDsCzc8g2ViJ5oJUdJjg\r\nGVh+DGqqLTE1uSKBfax6MyB6atjajGDu5amvigbP0yy2ne6WzE0Kgfis2mg7\r\nDb9epqLmKdp1BhHcWWmh82qw6Z9Kqiz8wY7enHY0Svhhj+nZAo7Od7sc1FfV\r\n1oC+z55qWo2SBE1tigUsEF+7wMrxfOjB0q60V2XuUZ4VBHvaZmA7UkZImf5q\r\nVUKyWR4MLy5A/IY4WSVKLoy3Va6YHJkA57UsfSK4fLNT2r4ce0W5LuANVVch\r\nPPaGbwSQO1CDfPi3tzyDetrfISzFznic3z/KnCyvff3bJ31klQVnGjjVtTyK\r\n8gRB5i0au3/UpBLxfxvdOd89054PVy4JPgXp5ZbmGMQb9QtzT+u49JK28yYN\r\neNA+4YYIsDySHmod1Saad5MgbiWNkw4R2diV63qdrzzxUBzmhLrP5ReML4k5\r\nlAFE9oUZyEqIPIi6pfzbhgLfSA14sEAs7aU=\r\n=+6g9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-1002ce08d64a27b580dd37499dbc66ab4f2cd8d1-18.x/balena-jellyfish-metrics-2.0.209.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-1002ce08d64a27b580dd37499dbc66ab4f2cd8d1-18.x/balena-jellyfish-metrics-2.0.209.tgz","_integrity":"sha512-8ucq3Lg4QNMBeeSsFgFSR+FYGcnRkVre6LOqqATb1Vd+9kPpJ2P9uVhbPs/U8mWA5fclF0xfZC9rlo78BRPtmA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-01T09:14:14.812Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.99","@balena/jellyfish-environment":"^14.0.21","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.62","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.209-renovate-ts-jest-29-x-1002ce08d64a27b580dd37499dbc66ab4f2cd8d1_1664615735104_0.4446249133391511","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.209":{"name":"@balena/jellyfish-metrics","version":"2.0.209","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.209","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"31730a6a9d00931ae7f431bbb3094529bc0cc77c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.209.tgz","fileCount":15,"integrity":"sha512-i+ePNKqV/b77i3vElOvpZDlAhjHSs6EvgjQuNoxKdt6ewjLnwbeHQo7Q9fZdNwQD7H+CatvHq0VEso60TAJWlA==","signatures":[{"sig":"MEYCIQC3ckwQTboEJtMCzaop/L9Lbjc+MQm7YoLA/QuD47kQeAIhAJghnLGXa5XsYaktkW7SegkX/6pX2OjRpGU/nmNzYm7Z","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68104,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjOAXHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpEkxAAjHUrqN0Gu+CJ3rUH9EcmACc2XMBrQgLLL79K3IGDS2fCdsZ4\r\nrTnmCN2EWNgLhzifs22HrgrNW1/dOdjpfYShUPeeMOGRwlJ2rBXkMMtdglvP\r\nF+4QD8hkg1Bm+cwPCpi+jzscFwONiJhcSRDNsn1eL/4S+BTyxAJ8mWMMWvAF\r\nTK7V8k4t/5VHtsvTmVw0MsAiOGlQ36PXOqq2B2y58B0x7tZAUY+Py0dAydrm\r\nAxWpFsMKPPtmJFDNyIfmGUCqM427VExqPZ4/LL2/jK1+3T1NxelKA6uAaNOn\r\n2poI8JKVwq/x3ncwQCnJu8zRz7bLNSq6lkPH/3wNFiMimcO/C+7GoybrlvBC\r\n/5KB0Gsw40w+H4HRcQmKjA3fZfJQq3isjsZBIuRiCFdqdWt9TOl3GRdugHQ1\r\nCfoBh9RtuYvyTnKWnMlIZ+To6r17RgVNkC3HzWFurASWTxRJhjODJV8Yb34F\r\nYxeb8OtewprkpVdxKxGf/f8yH7F4Xmamt3oPZeQX2rJzofN6DAkHsg6caOi/\r\nQuQ7Hm4EQ0fbg3NusQ5Of359r6CcGT55W8CJlWKbFzTaM/pxMp2W8MWN1Xly\r\nEXpMBqx/OxtUH9z1u6MjTg4mu4F+rf61D90TgmJ+OqGk2gd8CvyFF9ZNQb+q\r\n1CwJNCTMr+fTW6QinMpFYKtnA4Zk+9OYLvI=\r\n=lywT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-1002ce08d64a27b580dd37499dbc66ab4f2cd8d1-18.x/balena-jellyfish-metrics-2.0.209.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-1002ce08d64a27b580dd37499dbc66ab4f2cd8d1-18.x/balena-jellyfish-metrics-2.0.209.tgz","_integrity":"sha512-i+ePNKqV/b77i3vElOvpZDlAhjHSs6EvgjQuNoxKdt6ewjLnwbeHQo7Q9fZdNwQD7H+CatvHq0VEso60TAJWlA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-01T09:14:14.812Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.99","@balena/jellyfish-environment":"^14.0.21","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.62","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.209_1664615879530_0.06679448240310593","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.210-renovate-balena-jellyfish-logger-5-x-6760e1006460031813dfe022d6f6b4f90c7e00f2":{"name":"@balena/jellyfish-metrics","version":"2.0.210-renovate-balena-jellyfish-logger-5-x-6760e1006460031813dfe022d6f6b4f90c7e00f2","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.210-renovate-balena-jellyfish-logger-5-x-6760e1006460031813dfe022d6f6b4f90c7e00f2","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bd5e31170c0849e8b560ecd55440fb0ef7cd7c67","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.210-renovate-balena-jellyfish-logger-5-x-6760e1006460031813dfe022d6f6b4f90c7e00f2.tgz","fileCount":17,"integrity":"sha512-HQcOooGE1kHuu8Btn54fuvWRpHh1hLTTIRtw9sUMZMSeDyq4jVQYwFbiqZckrsJ/AkW7urbSTn7RuexIpDyVcQ==","signatures":[{"sig":"MEUCIQCUTzqOAFwRR3CgLCIyOiq+lTdkIyh69Ch5+drAmdQm5AIgDQE/k3x5Nr7zm2oRb5rNZZ7cfMBny22+ZFNNYvg5NLs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68183,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjODjzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrYAA/5ATmbS8dPi5zGqKeqIM/sAGU8l5neiZj0fH7V3IQgZhJjh0z9\r\nc6xnZ5DRp1Hu0DSO8+IRHjQXdS47RTYOYUqdKNBeO3Aj92NyFbLu1lt8jTAg\r\nH/ldBkgphtRiW7oztNUp5HN2pPer310Mu1ZR6X4kAWx4ktn5reuvw6GeXjAx\r\nno7natDFrwrf6ehze5tEi/e+JLG6DW4PReDcfiXc4X6VI8EgWvT4sU4+RUwN\r\nOr2ca+MkorQ+tcktMismm3AlV1zsDkUyo9XmKFW6lrO/ptVCoHaP6H+xl9QC\r\nln9onNbSTsgfWZ5AkoRA2b0jDMlvb71IjJ8ebdw9x4yUdpFcsoKZe+QXCV1c\r\nD+8qTwUixj0VI3eIxCcLrRddHBYS1nQuldpcD2XZwOWwp3n7iPIprmYcrEp5\r\nx3XzJkRRKtOjPAkxHpDnqyjb1dfw8hREDmf5P/mwN4IhR4P+ihqtli/rcqr2\r\nkgypmKfoKQ2bluk2B4O0ji+J2iAuPci/ovPT1cdS/yv9kh0XST6U8+nInfoc\r\nUMsyXR9t4OeBwi3hyDN45M/SoNkrA5AS9Bz+M/Y8X48NRy9MylD6XuV1cqSC\r\n4Cz89Pw3wVIHzJtgjoyK9gj432rkYA0O9CLUwZWKaahSZZk/jyYjaO20v0gf\r\nPpVojhe1Jeo+CiCFgYqG+qcOMKSNjkyl7Qc=\r\n=Uf9v\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-6760e1006460031813dfe022d6f6b4f90c7e00f2-18.x/balena-jellyfish-metrics-2.0.210.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-6760e1006460031813dfe022d6f6b4f90c7e00f2-18.x/balena-jellyfish-metrics-2.0.210.tgz","_integrity":"sha512-HQcOooGE1kHuu8Btn54fuvWRpHh1hLTTIRtw9sUMZMSeDyq4jVQYwFbiqZckrsJ/AkW7urbSTn7RuexIpDyVcQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-01T12:54:45.245Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.101","@balena/jellyfish-environment":"^14.0.21","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.62","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.210-renovate-balena-jellyfish-logger-5-x-6760e1006460031813dfe022d6f6b4f90c7e00f2_1664628978800_0.6521431977145209","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.210":{"name":"@balena/jellyfish-metrics","version":"2.0.210","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.210","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"707a90132b1ad9ecfc71cd9b48eb806682de9c20","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.210.tgz","fileCount":15,"integrity":"sha512-3f7iK9e2kjNDdvG+hv3IvYDSrwOGMQJaF9jjMjJezED+PA3IWVQ5w+u+cMNHbrvVV49+K14ru5vhc7Jmgsx09g==","signatures":[{"sig":"MEUCICK9LhDOAqeT6mgNIEWgTjySzHZFdfo8WLnSf4tP5xjBAiEAng6BB+pfeX1Wfx5Rv2kLpwz638UI2PQ0xruNJFIZUHk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68105,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjODl5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoyHA//dEnUxw1EUlrkbzs4KJZmfzSM11+Ge+FsL3wt3jCMCCy3Xr5b\r\nF9vuKjbYyAeu0Pc+WD18zN61+w1w/c+WVBUu+FGudr1duJEjpj8HuopSDIUi\r\nW8sLDabs78GHDTs9UqFVlkRoke1zEKFPFb3mYS75n7JEO3MqPm1NFaEgL3LM\r\nVcycN6e8lSrmGCzd17Foja19l91C25XJSOeEQgCB9VpnwMnRn+EuZq2ZT3wG\r\nTK5E5o2Zc+Oa7LQN7rY7iLh+AjlsEtU3gW6LtHhfWQgJcqmFzuI6ZRjiM6Ts\r\ng45bf3+V/LaCf5UeTsxzKt/LwzyEPHYSNtV6StKLvgBak0hkkZ7Fmgcxx8/h\r\nEv+QDGscl0viJg8Wz5eCsgVi0C+/Nm7tA9pOdt2xDzwL86+fS7w3q4kRPd/5\r\nW6omMVxtds/ILCytBdw7/0emqqpeFOYROVu5IgIzto8OYvt+W1n+LiVR/hpn\r\nGyhvByI6ZtdI9HfUmGdu2DvBWWOwlNs0Rd3xtXWABFTId+NXNSVEMcjYUCfi\r\ntMpFdzaoEwVex4ifL4yCmWzFdXDlB1tP0itIn4Ym7y8PQVzqxYhMX3WhCC30\r\nyQiboUi24nZTpYJTiBAWSvgo+uVNW+pezkYVmzjjej0s6LQPytNXSheGZz1o\r\n8WRdokzaOeUAJnoC1AGe576ZnxLouBLyKlQ=\r\n=OwNo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-6760e1006460031813dfe022d6f6b4f90c7e00f2-18.x/balena-jellyfish-metrics-2.0.210.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-6760e1006460031813dfe022d6f6b4f90c7e00f2-18.x/balena-jellyfish-metrics-2.0.210.tgz","_integrity":"sha512-3f7iK9e2kjNDdvG+hv3IvYDSrwOGMQJaF9jjMjJezED+PA3IWVQ5w+u+cMNHbrvVV49+K14ru5vhc7Jmgsx09g==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-01T12:54:45.245Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.101","@balena/jellyfish-environment":"^14.0.21","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.3","@types/jest":"^29.0.3","@types/node":"^16.11.62","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.210_1664629113059_0.2511197171224837","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.211-renovate-typescript-4-x-7edfabb2fc5eec11e03b66108a0b2eaef83b98db":{"name":"@balena/jellyfish-metrics","version":"2.0.211-renovate-typescript-4-x-7edfabb2fc5eec11e03b66108a0b2eaef83b98db","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.211-renovate-typescript-4-x-7edfabb2fc5eec11e03b66108a0b2eaef83b98db","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4de6eb9752bed334421226602d901de1a921261b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.211-renovate-typescript-4-x-7edfabb2fc5eec11e03b66108a0b2eaef83b98db.tgz","fileCount":17,"integrity":"sha512-6FTojEGiflKupIq6kwXZJ924FygvMI/qw87jJZYeg/8GNBMoNpWyuhhmGfcYfSX4J5boMMEeaa2tTjZlvfHUZA==","signatures":[{"sig":"MEUCIE6Y5V+y+GwZOVTwp+4Ph+s86CZhmkcHLqkkijAEo3sGAiEAuArTP18ddK2tcQPFkS7XVun52vKyC8rnapHMIafLEXQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68170,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjODojACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmohag//T053YPhWtBH7kxnBMJy8mttmYvp1Qzq1I4CjXROEk9oZ+sfo\r\n4KutCdILBGS7BkxM3vynMra2Alkt1VOWT1hILJU3OI4lcPAJXkdU79TjQzhM\r\nXPhu8U/3e7yQps799/DP6YbKLEa7qzt2s6ukSzomDGdkjYxbpn5qZGF67BkE\r\n4Wl7lnkiCD1qTjMRIyH03vWMe9EmwBYsWQ1+4jq4UJQPIU8qjdLIsZjpA708\r\nJWX46zn1yztOHJWwR0NDNVLv43J3IOkQdjkFYQMCsz1QWHg3sWeg0mEfKU3I\r\n99/o+F4CKnJJjsm1qG5Z85vpnxDJUdhwQ0IXeatkh++D4H9JoAPsTQIt0OSi\r\n03vwrMU8Ti/VJh1VoebbEKavOVVq1pdgFhnO78AH8i9oaYTkfxT9HNZa5W9r\r\nJg9TIAZc4RNnRNtUC8uqS4lmNUAwqP3HPMSJy42v8HlcQtTgHufVsAHQhdKP\r\nFXxMiqaDtbLHA3wncbhpOxRlg3w23hwPXLAoambn8wKBQtYlpOZalseOkqnE\r\n8FDbhpdTIHSUheHAVcVOIaApIJUyb9BFJA5zWQ0kYeYLd6CXGVjK568cKYDn\r\nMPLw5Bm4uANUZTRZg4pHN//22M9IJ2V2/FmJpo2owS/KlMTpDBepvCIsbyWJ\r\nHrGm+mgeK4DIBzFlYq9tTUXEmZMxpwU7IIg=\r\n=FCZL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-7edfabb2fc5eec11e03b66108a0b2eaef83b98db-18.x/balena-jellyfish-metrics-2.0.211.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-7edfabb2fc5eec11e03b66108a0b2eaef83b98db-18.x/balena-jellyfish-metrics-2.0.211.tgz","_integrity":"sha512-6FTojEGiflKupIq6kwXZJ924FygvMI/qw87jJZYeg/8GNBMoNpWyuhhmGfcYfSX4J5boMMEeaa2tTjZlvfHUZA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-01T12:59:52.967Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.101","@balena/jellyfish-environment":"^14.0.21","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.4","@types/jest":"^29.0.3","@types/node":"^16.11.62","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.211-renovate-typescript-4-x-7edfabb2fc5eec11e03b66108a0b2eaef83b98db_1664629283624_0.9569158017363408","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.211":{"name":"@balena/jellyfish-metrics","version":"2.0.211","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.211","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bc1dcaca5d8a352aed202af9144a37de7faa3eff","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.211.tgz","fileCount":15,"integrity":"sha512-tygBuVS1Mdnu1BuEd4RHU/3Wkd613sZtAxcq2qFiCa0pW1KOVY9djJdXRMkWPfvf2g4BegR4YV/xzULHjqE2ng==","signatures":[{"sig":"MEUCICQyHI9wWLHrxs8oxy4hbPTzz14GEwu3bZqtppuTfkocAiEA4/FcPLYOZ6mnhvYeAxjVtQiirdZe2Q6SMXpiqj6RBxU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68105,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjODq1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpouA/+KMMthTMy9wx1YK5R8iZzjpbAUZj8hnstMfCtaGof+EJvWmmP\r\nOZ7jb5i0nawR8V4Fc+xLvQMx0t56Ya2et4XYt0aCx+rouX7TckOn6f0JfiEJ\r\nsRWEMvQ/npR3cv+haiX1pd0IYsN1AecYvj4GwwLdcR4n0fzwfXvE7vGfhFak\r\n2YQTIeoo1F16Tp8qGyZBwmwxX9ifTGAZRINojGzRMaGYcn92/Bz7bnFph6H8\r\nkYmfnwekwtw8uygYj1UJfzqd3YJcNfTsIhByRLT4idiOKRD8VwWugn89mwC9\r\nUIBlJTISqmO8/qgac+UaEnaZwqKD5icV9mX/aJ6AQddmXC9JRLZ8fM6RVZ6q\r\nAyTm86IiDCOb+Z03TD+G4Ma9lIsel5Sw3SebYU3pzReWa6zjAnvGxGzs3VCQ\r\nO2IjvEuVJ1dmev64/UdxF4M5s1JNeAIKWAsnfe1F6DFH5SH3ITi0kbIcgaTK\r\nJbdJ5HxNWLLJYmLh+aGn02iX1R8S0JoPzvbWlryFfe6jC7o+frIRdqVz66ZX\r\n+Rb8zlzqXuCdXutgDyO2yn6698EAPBGwXOPLyg2Ir11OAIZpn7Gi18y/dSdX\r\nHmNC3qqc8vO6RvZNA8CPsab/+rXWE4RI3zlvHXCAxLzCm92NGfzzRfYPaydF\r\nB9merS6D4Aur6ON+NXrM1F3He+RW4NidqEU=\r\n=FDMN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-7edfabb2fc5eec11e03b66108a0b2eaef83b98db-18.x/balena-jellyfish-metrics-2.0.211.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-7edfabb2fc5eec11e03b66108a0b2eaef83b98db-18.x/balena-jellyfish-metrics-2.0.211.tgz","_integrity":"sha512-tygBuVS1Mdnu1BuEd4RHU/3Wkd613sZtAxcq2qFiCa0pW1KOVY9djJdXRMkWPfvf2g4BegR4YV/xzULHjqE2ng==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-01T12:59:52.967Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.101","@balena/jellyfish-environment":"^14.0.21","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.3","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.4","@types/jest":"^29.0.3","@types/node":"^16.11.62","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.211_1664629429602_0.9319947712597314","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.212-renovate-jest-monorepo-6ffa0248e339d525baf8f1ca22a1de361ce13a8f":{"name":"@balena/jellyfish-metrics","version":"2.0.212-renovate-jest-monorepo-6ffa0248e339d525baf8f1ca22a1de361ce13a8f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.212-renovate-jest-monorepo-6ffa0248e339d525baf8f1ca22a1de361ce13a8f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d52d2d0b1598bc3c2b4ffb690b5c45240a43c8e5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.212-renovate-jest-monorepo-6ffa0248e339d525baf8f1ca22a1de361ce13a8f.tgz","fileCount":17,"integrity":"sha512-3U9CD48GmXDJBzFYrF/e8I3vcKRCfxyc+un+1T+pFP/heaILa5EtlaEpNbmK22GiONtov9c3hnXZ/hnvbnEvGw==","signatures":[{"sig":"MEUCIQClddzbk8lRKyXYXllspBXBC8/t1NWZeYPN9hOHTVSpNAIgRPg2yjUetl2BOO+ylB+cQvG9L79T3yzBERtCjMkgE/Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68169,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjODt4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpPhQ//UKRRhm8CQ91imEkn/dIDcMk585HEnFPqhNvWIxRKcfeD8JQW\r\nvPNk0pazKZmGqKIsClBvMoYLdXl7i7SmMdV5jt41oRG2EQKzq6+axlavfI0Y\r\nXMutkb7rQjumozi2cIEGKVBcmST4Dq9LzWW9bdSTZz0Y0KYJ3EKKkOappUij\r\nsVqkqGNTqtgkQZc/aOKkoO23a9dONXoy3zpSAE6/eX04dhLbs0kV97lCNWsC\r\nyh9yY2rcZ0eftwW3GV/N+2eZ2DoHf5BYJWmp5bt5wmdK0kvg80IAgCG28rZn\r\ncYUgXUYFfAdKRC3VGfB30qkVZ/VPARWivCXlNXkGqk7KQjKhNUX2KU4LZRLn\r\nDWXB6I0MecX4KZrvLd5U779zbD9gj6wLgxl27eT9IGL2vNyn0b3KA9XXd9d4\r\nJerklLX/XFoo7lr6i3zujb7tQemSUn2rzkji98KcP2gxl35NlmEnktQwyxeB\r\nvxqdp+Wkx4oFZTY8qoClk11nrWbIzvJhFjjXXDK4gTGuAtF6lNJ5KvHkvdTa\r\nPuo1KnGmvaK1vJWXteF7168Vmt0ngFKCUOzu3HmNOa4GJeDExP7YSpzIWy/U\r\n1ILkdYM+H45W+tLT/9/Fz7Me+L7yv8usPkEdsTYuC1N9T44rmqSJGTp7sp1v\r\nc43GTHmB/SnmuDJmVeh1Iddgah+pWbfXwec=\r\n=yn9U\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-6ffa0248e339d525baf8f1ca22a1de361ce13a8f-18.x/balena-jellyfish-metrics-2.0.212.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-6ffa0248e339d525baf8f1ca22a1de361ce13a8f-18.x/balena-jellyfish-metrics-2.0.212.tgz","_integrity":"sha512-3U9CD48GmXDJBzFYrF/e8I3vcKRCfxyc+un+1T+pFP/heaILa5EtlaEpNbmK22GiONtov9c3hnXZ/hnvbnEvGw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-01T13:05:28.507Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.101","@balena/jellyfish-environment":"^14.0.21","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.4","@types/jest":"^29.1.1","@types/node":"^16.11.62","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.212-renovate-jest-monorepo-6ffa0248e339d525baf8f1ca22a1de361ce13a8f_1664629623938_0.5095118958520819","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.212":{"name":"@balena/jellyfish-metrics","version":"2.0.212","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.212","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8a1bcd76eadfa5ceffcfb0a25deb6e7084c79270","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.212.tgz","fileCount":15,"integrity":"sha512-56895Q9oRqdSMKlqlnkGh1b96xGCMG/txFZPULxleSiJ/mGO0eX0nzqDHEAL4KpBoKDeBwOPlA3QsYy3DNnajg==","signatures":[{"sig":"MEQCIDCh3esMZrp7q1FaPYd5Il5Wqrgc3I5Ka9QRUCweTPrBAiBs7fLRB7SjoWcnh1c2jChlXl3nqtX7V+3btl7d0+Pd9w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68105,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjODv3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqcvA/7BzFkPLmRaJzy7iOhcwL+oYKaRkapHgzybCJslO+7pjaF7R1c\r\nTUeTOrJ5FsiVN6bAoojTPGbtvFoBF6A1O2f9keJG9r+sWdQ9iH1FBhrc05o+\r\nL2jbjQcIL4KmD4pf7hFEWOrEq5SWRohLBFpEwfkpRiycw2STKhOS3tMSY6kB\r\niV749/6Zb041BrE2/Drx6GP7R2QckXejgsqtadTteeNZWt9JWtWA3Q2u0RHw\r\ndwmpXuVXKiBFlJRd3B8o4lModKpg0pbJhol6lRDBllgnVq5HaDd89e977zNC\r\n0vrkByf9wkQx59CFZO9Dd7W7Kk4xQNpUzeNAKXfKDTYjHHKdl3woR8duHeYr\r\n2gvxfMyhZMtNjdiZSRRj2Ex104caxCFgbQu0u2Nx60uwhqSt+VxiSNkhUdsS\r\n0rMCBYlzLEOENSWQUBCyilhFDy57HpT5Et6GA/6i/ZcQEK8lGTM35iC5lDwf\r\nmfxt/lwMxoh+rmUE2R1X0zmlfxo6TeWNHpuGzO7T8r16+KYwZSzDaEbkQK5k\r\nDSHS+pU9lK3E+oX+dNiTT85Eivq7lI/z+objKoVBdzF1LTgaeLilp8/MyipR\r\ndfKVYho6Yc8IhpnAHAnWftAS2OQRXjhtj+62wsRyMu11xY4pgbfSDkEVCfWO\r\nVMX1YxZIdSo9zyI2/JPXSgN2LV5hbRLkMIs=\r\n=Nt2s\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-6ffa0248e339d525baf8f1ca22a1de361ce13a8f-18.x/balena-jellyfish-metrics-2.0.212.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-6ffa0248e339d525baf8f1ca22a1de361ce13a8f-18.x/balena-jellyfish-metrics-2.0.212.tgz","_integrity":"sha512-56895Q9oRqdSMKlqlnkGh1b96xGCMG/txFZPULxleSiJ/mGO0eX0nzqDHEAL4KpBoKDeBwOPlA3QsYy3DNnajg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-01T13:05:28.507Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.101","@balena/jellyfish-environment":"^14.0.21","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.4","@types/jest":"^29.1.1","@types/node":"^16.11.62","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.212_1664629751113_0.1609458146667797","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.213-renovate-balena-jellyfish-logger-5-x-388c725b1f0781f41b3e51d39e84071b61fc0ac5":{"name":"@balena/jellyfish-metrics","version":"2.0.213-renovate-balena-jellyfish-logger-5-x-388c725b1f0781f41b3e51d39e84071b61fc0ac5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.213-renovate-balena-jellyfish-logger-5-x-388c725b1f0781f41b3e51d39e84071b61fc0ac5","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"41a31d9d4950aa75469e05d7f32a01c9c4adc8a5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.213-renovate-balena-jellyfish-logger-5-x-388c725b1f0781f41b3e51d39e84071b61fc0ac5.tgz","fileCount":17,"integrity":"sha512-Le+wVe4LG6+2D2hEzAEdDXC+lacY1YysIczXNm2jbaSpLACpiiBnDq9YOR738Wj1yGAsVzYh8HF8E5II/lLEEw==","signatures":[{"sig":"MEYCIQCN82vR1rORl8f8bzRrvymKOk4DSz9xa5BZ1LO0EcVb8wIhAIs5rqm9hwQFqIgv67dBZHrSnRJ32Bg5TkwXllWVtd6k","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68183,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjOFoSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq50w//WSBBP2LNPhcz19U0aUJhydQsHfXlf6syXfy+XRYnXEjKw0Qr\r\nWFYIBf6oKp9jbtBXEJCwGwEJ1WTo3B8m0HqRU/w1OBvgqoUyhpbJVktv8MiE\r\nGCCpbfxBud+tJ5zzkOTCL7SUxhB2UJRwutQFqOw3wJ+XBimY9N3WIaEcZwOj\r\nndVJLqRvUYKwtWjN1hrU0jqdhdzpozR3BYkFSKdi64vcHVeHGJKLDaEWl+X2\r\nh5mFHAGA5GvfhS1FFAudjmr717+hbDnWuC/t43uhh54DkSzOTaYixbehj1Hb\r\nK6B8YKzNXMSnE4r/ww+DotsbJDSKEzP+HVGOxDaFa8b2bLUHQM5J3z69xWqb\r\nH/a3+5iWR9nkg8vKIHrF6vD9OcFggpe8K0QAOZC3kckLUFChATb5wjwmd7tj\r\nDLTgLwY8uyYMai1PFTfSPoLJbp8cOiaZHwwwhgHbt3fX47R7zH33re27KJ2X\r\niGTsslkitYI/Ggj6bBUbHemxeBBet5D2RR/n7QUQSivMpkiXn+2t1sDxRyQN\r\n2A++Dq+qFvrla1epiunhM+U6skGsxuN1Nu3Etwg4jGVyMw5mvjHL5zp8xgQK\r\ndlWp+mrDfSPfUigiSsXwDUwo/ckWoUHgivs7TFSNGKYQEG6oR0/HR8ynsWAD\r\nkAbB1aoBFUVX0PtQKCIMmbpOQ/6hBuiCZ5M=\r\n=89Ef\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-388c725b1f0781f41b3e51d39e84071b61fc0ac5-18.x/balena-jellyfish-metrics-2.0.213.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-388c725b1f0781f41b3e51d39e84071b61fc0ac5-18.x/balena-jellyfish-metrics-2.0.213.tgz","_integrity":"sha512-Le+wVe4LG6+2D2hEzAEdDXC+lacY1YysIczXNm2jbaSpLACpiiBnDq9YOR738Wj1yGAsVzYh8HF8E5II/lLEEw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-01T15:16:14.274Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.102","@balena/jellyfish-environment":"^14.0.21","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.4","@types/jest":"^29.1.1","@types/node":"^16.11.62","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.213-renovate-balena-jellyfish-logger-5-x-388c725b1f0781f41b3e51d39e84071b61fc0ac5_1664637458652_0.4791808173512482","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.213":{"name":"@balena/jellyfish-metrics","version":"2.0.213","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.213","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d783ac799387e3012f78f8f158d73910bb6a43c7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.213.tgz","fileCount":15,"integrity":"sha512-IC9h2A0q47obGCiVsSELO5480edXPYjgH2OuUIPoqjJLssTlLuBFgXf52KxT8Calmma+wj72lCzVthqcVEm0lg==","signatures":[{"sig":"MEUCIQCw2nANF3XvZGIp9kqFn/PWLL4Mw6KaPwMi7vH+kqr5egIge1BATl4ZpGPNlmkMYUxuirf9212JpaIDUco08Kt3T9g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68105,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjOFqVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrhRA//TpMgCv1FJ0Or1pOYgHAo4VzqpJ/tr8PTu3NPdyes4P/jEFXy\r\nhjorhlPrVtna1QEpB+IBdGNNqVKeYcOmHKHKvARCoUDN5JYxHBix4x+ENpyw\r\nIgZgi+14ifa8WMO5cE9QuqHGZE1SAgcYmVPyaVnOnqReixoGUd4zKIORxfPi\r\nnDUKhPiQpTMlqgRzfU6IuLMrm35I1j4dHlkRPrYZswjG1gpnWPDR0QZITBrx\r\nadptcxw+wUrfcMNfPn1R8o5c5h0uc+Cio4Gn2xEOeOYNR/Glur7/DOc51BFb\r\nvNOySSmMF8wurPivKlbxPtoV9wz3yIYZCOwdQ+FZx5I+pd0hlK2t6o1iXg/B\r\nvdEb7yzeHpkpI/EWouFaQwet2LHlkeZiK+8RQ1nV8sEoZ58IKG+aneTLDeYf\r\npHyTC2aIdk4sEkbIIo3w6K44DQqmOtjBUo/Ye98qQeP0o/gSH/uSsdp7DNy6\r\nC1Tv0s7AtV+hE3glm6U+y1DaZiDRuqT2Gd1PthaoCmoU1wWV5tHuZlj8iOyZ\r\n2IPNo2zyp1XafWnpTsTOMx36li+csZDJ3eEcxtWPxNSvrETsj6k9eHeSs0PT\r\n+SzZWCohxndZbdn6lPff89fhrO4ROzr1HWXWHc6/fHTtbUr+GheQfRrYuooS\r\nxg8jkyuF4+zKUMVEY9FCDRZ7pB54VTgPVcw=\r\n=MDy4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-388c725b1f0781f41b3e51d39e84071b61fc0ac5-18.x/balena-jellyfish-metrics-2.0.213.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-388c725b1f0781f41b3e51d39e84071b61fc0ac5-18.x/balena-jellyfish-metrics-2.0.213.tgz","_integrity":"sha512-IC9h2A0q47obGCiVsSELO5480edXPYjgH2OuUIPoqjJLssTlLuBFgXf52KxT8Calmma+wj72lCzVthqcVEm0lg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-01T15:16:14.274Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.102","@balena/jellyfish-environment":"^14.0.21","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.4","@types/jest":"^29.1.1","@types/node":"^16.11.62","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.213_1664637589148_0.8765752506759168","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.214-renovate-node-16-x-ea6868cd6706457d924ecaf541cc9dfdf52904bc":{"name":"@balena/jellyfish-metrics","version":"2.0.214-renovate-node-16-x-ea6868cd6706457d924ecaf541cc9dfdf52904bc","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.214-renovate-node-16-x-ea6868cd6706457d924ecaf541cc9dfdf52904bc","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"edb9427bd8b4aedfaaf75f458db02e5a297aff64","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.214-renovate-node-16-x-ea6868cd6706457d924ecaf541cc9dfdf52904bc.tgz","fileCount":17,"integrity":"sha512-RnGuqv3OVaadZ9cRPQg5H3XGmA4fTyxKuvEscr727/Bgp3qjZak8p+L5RP5BsFsjcBtyjm3A6LRBO4nuR55Lcg==","signatures":[{"sig":"MEUCIFPm4Ba4Et1n7WE/N3ZT3N4AOd5PLVhODugn+fod5WNXAiEA5/5gDnedEf2WBNsPuY6ByVWIwG13ft3n4PoZ3KsTPOM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68165,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjOf8qACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo0fA//burNpzrtt1qR2vAJHuaXQnNqUHd+fq0t412QsH+blHdgxVAc\r\nrI+Gqlt9GJNk0aHCwz0FO+n4GrbuVsQ9Ph2P+Vsodw/0SWjPslVHNwNsWJqB\r\nkEOiMzT6kOo7kOEJm2HU9vHNQ9Ua5boDwp16pKp6mztAcGhNo1fqKTxI022o\r\nOaJKpni7iy+k7VcVorVYZNfSUKulZaWDb8DWkvrmDMHqoOZb6GuGUbBtcaNE\r\n2FcScMrZJ3Z/sm2rtGHMm6ZnrGQUoqRFX07iiBoQq4M8xCVmXqzF5+28wDZ7\r\nM6Yk4UW2lozTU21bUif1c9rUYDZystsbNB8gKGuJsjojeksztivatMIp/qRG\r\nbwwMrc3PO3xzpQs0Yp4CvLeyx1TJbQliqCtgSK72+Nj4gXHuIHfWDOyHrt/F\r\nQUPyxiXJ5kFY6lfdh16VYg+ETN9xwyV5bt0wDeuxwELzEOOKtcqV89qOAZkG\r\n/nehOOr/jIe7yJNzK9BjhItM9nMgdiTijzH9BC/PfYrbmAZxHR3y/ujkkS+a\r\ndLzSTEWTS2JIZvxvNISprAaN9G+8XO5zlKtevcrRmZgc5prh+9MCKVw4C93j\r\n5Mpg18i00y/Hw6PCWDzgV+kYwxNMMGXjjmuaVZeBKqWCyJtOyUO+9KPQ4Inu\r\nlPaCTJ8waJYmT7UUSIJ5RSJZH4wCIm6XpkI=\r\n=j9aI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-ea6868cd6706457d924ecaf541cc9dfdf52904bc-18.x/balena-jellyfish-metrics-2.0.214.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-ea6868cd6706457d924ecaf541cc9dfdf52904bc-18.x/balena-jellyfish-metrics-2.0.214.tgz","_integrity":"sha512-RnGuqv3OVaadZ9cRPQg5H3XGmA4fTyxKuvEscr727/Bgp3qjZak8p+L5RP5BsFsjcBtyjm3A6LRBO4nuR55Lcg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-02T21:12:55.401Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.102","@balena/jellyfish-environment":"^14.0.21","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.4","@types/jest":"^29.1.1","@types/node":"^16.11.63","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.214-renovate-node-16-x-ea6868cd6706457d924ecaf541cc9dfdf52904bc_1664745257852_0.17895126127519312","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.214":{"name":"@balena/jellyfish-metrics","version":"2.0.214","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.214","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"379104ad3aff0a0c558de6de5f5f4725bd703fa6","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.214.tgz","fileCount":15,"integrity":"sha512-xTT+j4Q9hgJYfvc9r+e5AokLUnHaLQRWY8ybYNREcn5UnXGiDqHRKDR/m8KaoyJY/2fEBElyPCj4S2ePF+RblA==","signatures":[{"sig":"MEUCIG4Ngm1RTzDnVp427vD3HlEtYGVbyCNP9SuvoK0Om4jnAiEAvJZPoRLLsEZB5MoFs0u8b4JHYSZud5If+cTXJPjZJSQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68105,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjOf+yACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmocaQ/+J135k9hgB7VR8aqoI1EvnB4DDxG2yWB2kWLXeJsVBdr4RCSa\r\nieoRIRwzjZIuojb7KffBwfJgW2AGeUuIJTZQDqIJ0dVHlDpSyKaEFOWqDkBS\r\nAcNfwz97Z43vmpJlXRNlyplrDZrUlxOo1mpKCA1dFrGqkzbLGvpx4BkTsXZk\r\nRbeEI55DEQGUfv19wv1INhnFoLPpcttytUmVY4Jp+JKU3oWLqEMjsMAGvrKA\r\nxUINnm1P26FrbS0komQB4hniSW+5EKSa+x7vgaRYk/VjxBUEcjypUcHdVZlv\r\n/LYuCZr7/t6x2da7/guELGahYjW+jh8nXAdl3O9wGHUJpajVvB8QNG69nx1H\r\nTWf+vnBRTPC0tvJDBRv16Fck9g4u8U/V4BskTY0dg2RTGTVDktQtSKfOuswZ\r\nJ0WSh9btiKPAiA/9kafsjYCbQkxVfXJu+088+PlObyjvhhwd6WcphnLuEJ1I\r\nfMZ6evgnJS0U4ApNceCt0pvxhk7WjvTCViY94bMTlVPSceAxEf+sAefG5DrI\r\npsIcoDARG4EgX0z7TXshiq+TR0IZ43Y/Rkx1FaR+9JGOuumRVe1C8BWFkyzg\r\nR/KxIkUwQM6nebNpQtL4bb+KSSrNRRtL6M1V98HCNktOtORFdVWT2+MCxTsJ\r\nB1maRnSCaax7iIrHMLv+zcJR7XPk+45S6dA=\r\n=+RDy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-ea6868cd6706457d924ecaf541cc9dfdf52904bc-18.x/balena-jellyfish-metrics-2.0.214.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-ea6868cd6706457d924ecaf541cc9dfdf52904bc-18.x/balena-jellyfish-metrics-2.0.214.tgz","_integrity":"sha512-xTT+j4Q9hgJYfvc9r+e5AokLUnHaLQRWY8ybYNREcn5UnXGiDqHRKDR/m8KaoyJY/2fEBElyPCj4S2ePF+RblA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-02T21:12:55.401Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.102","@balena/jellyfish-environment":"^14.0.21","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.4","@types/jest":"^29.1.1","@types/node":"^16.11.63","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.214_1664745394120_0.37859921441287336","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.215-renovate-balena-jellyfish-environment-14-x-4ea72b721d8974b86ba303e56ee0bf03cbe13a86":{"name":"@balena/jellyfish-metrics","version":"2.0.215-renovate-balena-jellyfish-environment-14-x-4ea72b721d8974b86ba303e56ee0bf03cbe13a86","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.215-renovate-balena-jellyfish-environment-14-x-4ea72b721d8974b86ba303e56ee0bf03cbe13a86","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a20a8274983676abd8b1f9ece7fd30d1f5b404d8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.215-renovate-balena-jellyfish-environment-14-x-4ea72b721d8974b86ba303e56ee0bf03cbe13a86.tgz","fileCount":17,"integrity":"sha512-J+f1OETh8v0OzIfG2+x413IAaYWEE2TyFZo7BP+ZFhy/dHCwYVte2fzZas2B8qijSk6fCpk91Hvp/Npxt9m+rg==","signatures":[{"sig":"MEUCIQC94airHANpxlV22kyvq8isWlU1AVANXH8iHlN6bMOQoAIgLEm18UgOv+bCBDIkN/qtYgID6OHLhmUg4S0NWngn7Hw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjOskqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmomeQ//ZVou20OvByWjWFIw7eMwfrIXhsxiPFER+pfYdgNMd4kpwfbd\r\nDH6fPpw5b3x7AatTkJVQKNAph86lckrNHD0bKC9MknJZo4nLrCreHyAv5f7z\r\n9qMujO78lWB66cASHDjjmHiiLYlt4GgOLwNaZUGK9Zv6aiB1/Jy/w2JlcUiI\r\nfkhHvULbs2WFmDfa54F34eNLa6JOZxKL07yJFa0+l0XD8a6OImeiRJ9AgEw2\r\nyyXF4bwHTN20fGVbF72MZi6UnPU7InxOCsPcpAx5nM++en0tGo4DcbDVdoqc\r\nMd6z3zhqrGMOIkH2gUNmav2e6Ygvn/ZieChsbV5qUAP9BVNm+5TsGxPY+ugW\r\nDCVWO4+DVbggf10q8cy/5hGXMz171ELsGe2RQ1ufriQwXIQveXkP2AzUMpN1\r\nu7Mxd4mX1hmw2rIBvduJ/MuLBZfGB9/2N5gYKpk1R0gomXLJMPe+qBzLjUn3\r\n4BjTGwJgUPYNgjQbRs7ujfubB/acCgC8f5TRn4Z5Fdm7CbT82Jenf4+2ewfd\r\n85bASE+0EP6xo5D+TRkZ+e1eql3FUAi7VbW3FF/J3JjFtD/0smiBTKwQuTaj\r\nwa+tshwQM1fL88lZ2R5og8/qQOGdlng5zqIAZEMNP8Ks0CoeGr/Lwe0/HnPY\r\nYEhL5QV2DoS+Tgf1H5ttEZX+pQoTg21K894=\r\n=dLkm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-4ea72b721d8974b86ba303e56ee0bf03cbe13a86-18.x/balena-jellyfish-metrics-2.0.215.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-4ea72b721d8974b86ba303e56ee0bf03cbe13a86-18.x/balena-jellyfish-metrics-2.0.215.tgz","_integrity":"sha512-J+f1OETh8v0OzIfG2+x413IAaYWEE2TyFZo7BP+ZFhy/dHCwYVte2fzZas2B8qijSk6fCpk91Hvp/Npxt9m+rg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-03T11:34:37.034Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.102","@balena/jellyfish-environment":"^14.1.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.4","@types/jest":"^29.1.1","@types/node":"^16.11.63","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.215-renovate-balena-jellyfish-environment-14-x-4ea72b721d8974b86ba303e56ee0bf03cbe13a86_1664796970754_0.20465385258541624","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.215":{"name":"@balena/jellyfish-metrics","version":"2.0.215","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.215","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5c7652be97cc2807d6207c53d172aa94d2fd0253","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.215.tgz","fileCount":15,"integrity":"sha512-/ySu1I45s85x4aNpCo8qL1R+XMc7uhdPlia3OZ/uZlSsrsjZZQ32AIAasSLBx2OqWmFQh9JvGACLw+/KpRNNLA==","signatures":[{"sig":"MEUCIGlsJJBbPOMcCxKiHaDZobFszdw7yOqEXiyhcqITxjL4AiEA5fGxr4tUcCocoibFLFyufqDz+C4TGGWxeNODSPx/vWg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68104,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjOufmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo7eRAAgRxVlfLkSegbW4vrtZUzcMg2tP+dvpPZxTFCQwzagEBzPuKo\r\nGbGzPHLCm5YDj/bOTfKBVJz3ewYvfFo9RdfAvni0JKKhDaQdFjTd7Zc4zBf4\r\ncPALcF4f6+UpZ6GNRQmGuIwz9+vmr0NDJvT6DC18FT+yhalcigb+25h08o3n\r\nELhDOcfjtBWQ7aHZXOjSuJJv50Ogz9/89XKSBvGBPokSfi8Y5Vo9sF5Z1zWc\r\nMKV8JMenqvIUv1EG7t7/XnE6Dk2o4w67whL1T1Glq0ftQznryo40XlFVuBxs\r\n6dwtfahJDdAkKQPJvQ3Jvnsq5OwdEwonKocY/oqShVu89Xdx2h1HlmQjihFl\r\nEHmJNR3iUCroohoFAnpqdKIeXvOZhD6N2yzPOjSZN2BwiiFiG3W9pfJ4vn5E\r\nvvWe/7D5UumJBOy2wFTQaJ3Rk5F7RwnO8mSlhZdG+BGDyjZNeFCcLX32dDQd\r\nIYwe9I1If4op6KjyfCuYdAesP40I/LR4ppKsLyHDHhUhq3MlEDwt9G1HxgkL\r\nPFr8ckjc+yq+f84p9z3wbJZY9uiB1JOm5VgL/WuRaEpN9ib/RwLn7xsX2G6f\r\nXDT0Qi6WIyi6pZhRAeoee6RCqAIE56UIWZ9dA8XMs6YSrZmIGTdHEY7aB2J9\r\nhauD0LCBNIn+cFstW/wqOY35zkIKWq727Vg=\r\n=LZSf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-4ea72b721d8974b86ba303e56ee0bf03cbe13a86-18.x/balena-jellyfish-metrics-2.0.215.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib","test:unit":"jest"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-4ea72b721d8974b86ba303e56ee0bf03cbe13a86-18.x/balena-jellyfish-metrics-2.0.215.tgz","_integrity":"sha512-/ySu1I45s85x4aNpCo8qL1R+XMc7uhdPlia3OZ/uZlSsrsjZZQ32AIAasSLBx2OqWmFQh9JvGACLw+/KpRNNLA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-03T11:34:37.034Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.102","@balena/jellyfish-environment":"^14.1.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.4","@types/jest":"^29.1.1","@types/node":"^16.11.63","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.215_1664804838249_0.9360648598434167","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.216-joshbwlng-move-tests-29737ce4a762f73d9cc559335ac08643ab4b8c02":{"name":"@balena/jellyfish-metrics","version":"2.0.216-joshbwlng-move-tests-29737ce4a762f73d9cc559335ac08643ab4b8c02","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.216-joshbwlng-move-tests-29737ce4a762f73d9cc559335ac08643ab4b8c02","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2c89f7c03267a1b34b509acd09ae781564715f83","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.216-joshbwlng-move-tests-29737ce4a762f73d9cc559335ac08643ab4b8c02.tgz","fileCount":17,"integrity":"sha512-hgpGzuMoXbhg5NHjo9dhzbe3BY5hcyw49KRWGMXBw3AhjaDg8KM0rDUgI23rZdjbFQE9uiNNGR4A0d11pxaPXA==","signatures":[{"sig":"MEUCIEUfy3srLEygpdHAiPu6rTVbGF9SD2XVxhcygXXI3s3jAiEA+rCUEcbGReJWNZ3UEo/xxPINYhJVBBZWB2xWCSGWffA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68181,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjOurMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr5eQ/7BOl7MGmpcugjTtJ4Jpi23CJmYkZumIDCPaEo3152ooX8kbqS\r\nmF3mgH6Z/yS7h22pTJKSwNDqcPx4Rhm4ClHWdZuUWpdPTh5HHj63imH8hs5h\r\nc1k4GSUJ406ljGo+5g33EEZDoAUgUJqaoGbnnxYqA4dTmqmK4BO5GVr6OVs0\r\ntDSEQlSawcaKOP0c4MKG9CMkFmQTF2ERFL20Par0zRotKSWbSp2PVVLZsl6H\r\n9zdqbK6vq0l160zWw92oOVKVmuaWMlJ+jcfmt5EmmtwB4I48lqi725S1Ih0m\r\nqAsgqX5/aIUPesruSUtsTIWCfO0pFPLYa9g0fIKQ8vnGaU5HrUpumc3/f1I+\r\n4iksVDENgrnD5kVF+0rVdohf1HWoalaHkzo9kpw+XKtXs4bAcIxYRJ87CLdQ\r\nMfUZdtKdZzkP//w2sBpqb4UNFxjOrdg7Q5N0ZLqIfBTraq8mo3rN5oRx2re3\r\n2FTM2D5ql5XKaQ+MNI54ZePn74QL3MhJdBJ8e3bWZviPXSV93VyDSTMxLowg\r\n/GEFnI36jVhIcta37SS0khJ3I2qFfQVVsniHo5kQ6mmmUFoejW49RrmY1plP\r\n3W0Id5LHriL1lGXcUQcYgYliUDIapLBxwrvo4HkYpVRzgh+DtCIj7p2iQ/lC\r\n236lpSzHFgJK1SWEou8mZR6iPcmeKnWZ11c=\r\n=ZExU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-29737ce4a762f73d9cc559335ac08643ab4b8c02-18.x/balena-jellyfish-metrics-2.0.216.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-29737ce4a762f73d9cc559335ac08643ab4b8c02-18.x/balena-jellyfish-metrics-2.0.216.tgz","_integrity":"sha512-hgpGzuMoXbhg5NHjo9dhzbe3BY5hcyw49KRWGMXBw3AhjaDg8KM0rDUgI23rZdjbFQE9uiNNGR4A0d11pxaPXA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-03T13:58:01.965Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.102","@balena/jellyfish-environment":"^14.1.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.4","@types/jest":"^29.1.1","@types/node":"^16.11.63","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.216-joshbwlng-move-tests-29737ce4a762f73d9cc559335ac08643ab4b8c02_1664805580196_0.2950120184476548","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.216":{"name":"@balena/jellyfish-metrics","version":"2.0.216","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.216","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6fb651469da2c6e47ed6662e1cb588f6be055488","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.216.tgz","fileCount":15,"integrity":"sha512-ed8qI7rzEYchh+CYyOB72aPRLiltqJ0Gzf25ev2bN+jfpVwZKkKWyz2FUVj0jLPhqLgwanPXFLSWLtbjI0mXBw==","signatures":[{"sig":"MEUCIEIA+sFbL5GHvDSoS4yqlWMDCoedtmaE5e8qK0q2DGXXAiEAnx7KF1cEbSmLjoDz9i+D1eA49iL9ZUgiUGVoKKYYUng=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68119,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjOutmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoJbQ/8DAkseFXC75vL95D+bcV7O5j6vMDgjBz+AvGCQZPnrhVFLVFE\r\nIdrCCa84AAvgOIg31ykKCSUKXcAaHBKUbZ+WPnRlEZi1weThgHg/bS10CcG1\r\n2ejALpAraAeFFLVNUG0dLVsVYRRljYYfgQQAmXM7Qt8kDd7JEjqBRabKKAIl\r\nFkvxzN8sBbscZHtiWlb2ToYZAkAK/I07PQvHc+7ZKJ0GcQdpMBA9ON+lbf/W\r\nlTBQ4OyLY/dGRZNbuIIyWnDhMhmVO/BSwEORrnUUvSuzcK+/Do5dwsxiNdoU\r\nWM2oNEVR9j4u4R+ENk572L/TwIc30+bGISO7Y7fvay2ZrUgUYUGn/JW1H72F\r\npLv7vycMm0FR6ZSRKGfyWnnoPnrTRXTRKvCIC4321eSdrrncROdEldN+9KqH\r\nTK0DHmvcHakTKC1UvVJ9IXVIjdBXnwtfAMUHYYzogTRz9RGpSoxZ+Q8FR6IX\r\nDHa7AGvN5r4MeMn/1oXHmBHkw7XIOZBpIXFBp9lBZc3/XcjKumPiYpYlgqUI\r\nBB3rrm3rztjyIZAkGNZTCVCXtTgsq3/7OA6EPuik4wT/4Q+MEyWPCakDD1NM\r\n9y8SBCL9XFiSCAd8+AuU4tl3HPG8ZPIXnuUQwtV9Buiy0RSEh1lEzPAGN88f\r\nl3U/ZDWH9+nDttvuixXYdsOny5n4Sn+XhQA=\r\n=9RG2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-29737ce4a762f73d9cc559335ac08643ab4b8c02-18.x/balena-jellyfish-metrics-2.0.216.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-29737ce4a762f73d9cc559335ac08643ab4b8c02-18.x/balena-jellyfish-metrics-2.0.216.tgz","_integrity":"sha512-ed8qI7rzEYchh+CYyOB72aPRLiltqJ0Gzf25ev2bN+jfpVwZKkKWyz2FUVj0jLPhqLgwanPXFLSWLtbjI0mXBw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-03T13:58:01.965Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.102","@balena/jellyfish-environment":"^14.1.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.4","@types/jest":"^29.1.1","@types/node":"^16.11.63","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.216_1664805733885_0.27299299050768155","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.217-renovate-balena-jellyfish-logger-5-x-edd1aca5ffae3f42caa63e6b79f25da19688bb22":{"name":"@balena/jellyfish-metrics","version":"2.0.217-renovate-balena-jellyfish-logger-5-x-edd1aca5ffae3f42caa63e6b79f25da19688bb22","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.217-renovate-balena-jellyfish-logger-5-x-edd1aca5ffae3f42caa63e6b79f25da19688bb22","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ed501cc8012fed2e6b859a59a58de09018959b94","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.217-renovate-balena-jellyfish-logger-5-x-edd1aca5ffae3f42caa63e6b79f25da19688bb22.tgz","fileCount":17,"integrity":"sha512-XUXE5KiZ1Td6GI8FeVYgEN4THG2AY1znhbnGrbAmvh5O64yia5Mf5OlcjWiI/QIoRmJZ6njbpNFiMxdCPP/khg==","signatures":[{"sig":"MEUCIAULHYkJXTb6aIG0hwzb4k7OZjgThVpcuXRQn3fx1qGPAiEAwurFGU0LtsOMaEzW8/z/1+h2Du2nzyD0TeSYFbMGeZ0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68197,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjOuxAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqCNw//UR0IH7EFk2QXX1dH235vhWQLpqNFr6ITJUel6LaOTjsm0Ys1\r\nI+whTmXsiy9iJEwdZXiCWsrPP2XtWo2rBHS+cO3hWZ4QUfsLfD4AMXW7bDRE\r\neUP4620kmFhNSUUEd0uQ6aRPKTyeGIEsHzH1BcztAbVdRoGMXCqIW83bNeQG\r\ndgvYEjSfqCwT89prhCP5AjS5zJQRZu4qdAOr5S8nY3FsgifTY8uUIfIhjt2j\r\nD/TaedkxJaC6ORhUNr5kMyUjlJ+x9PB4N4oaRR8U1NBk/DRPpITaTqIFPeKn\r\nxENEyDeTeB1Lc6/u+VdfBcG99hSbuH8T2oFLr3EDZjyrYJdm/UntOMp5oRHa\r\n0RLQBBtUdxDlsuJwh+ss8aD5i1p7bqslC+9ZKkyXAtf8+zFKhdOYw2DBd8oU\r\nyKO8DK7qtidVWiSVnfOaXd3NxcLRyuSYxTjA5Xx9cgI4ePKBti8QAOJdCAAz\r\nnxw2rYtx2ScMf5TKGE5mHYy7FauWYd7dzlGNTHcs5qnyFTABFR0c7zfjUHfY\r\nq+JmqRIP5Mgu7BSE8MIekF5yaoE16cHePqbcSvcoxbHhYFfAfg8wmoGyuHmW\r\n9TKSTc9w2CsoUvEsaO6q5IhOqT5xm4k9Mk4b13Dsl57wWKkbuafQP6JsFMNU\r\nCMbVdHsunBHPb493++0Q4BJBCYdDUZ1bJLc=\r\n=voGf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-edd1aca5ffae3f42caa63e6b79f25da19688bb22-18.x/balena-jellyfish-metrics-2.0.217.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-edd1aca5ffae3f42caa63e6b79f25da19688bb22-18.x/balena-jellyfish-metrics-2.0.217.tgz","_integrity":"sha512-XUXE5KiZ1Td6GI8FeVYgEN4THG2AY1znhbnGrbAmvh5O64yia5Mf5OlcjWiI/QIoRmJZ6njbpNFiMxdCPP/khg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-03T14:04:03.452Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.103","@balena/jellyfish-environment":"^14.1.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.4","@types/jest":"^29.1.1","@types/node":"^16.11.63","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.217-renovate-balena-jellyfish-logger-5-x-edd1aca5ffae3f42caa63e6b79f25da19688bb22_1664805952505_0.015226613642535858","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.217":{"name":"@balena/jellyfish-metrics","version":"2.0.217","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.217","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ae70a90c5663865730f0e5c56ade1890e3e5e54b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.217.tgz","fileCount":15,"integrity":"sha512-ZeW/bOFcEishOXJ61hVzukmmnHCPaZji3hVoZFlfEFF7o99hvnQWKA8HofEvaAB5FRUFCRfj+SQdT8D9/hT5Ag==","signatures":[{"sig":"MEUCIE9Drapw08dt67ZxUMimHyxpn2M8s6C0nacOxkhLrZq+AiEAjkiMAhGIHAhnjCA7Ru2RysS3v2paNRGdhIOPcAEuAWM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68119,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjOuzRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp25hAAgi9Vw5Aqxp0RJC4eg4/TIOQcw5JSThWgXGG8bKP9ZR+Wxzzi\r\n/Tn3PK0WUR6r7vj5G7tvI7qh0BFAtBpurNc+oIG0ZnyBhBsErfgJn9/Y2AOR\r\nBy5zUnRV2N3b9UnHlfyn6JGEUMA8Ux2DFLdAXqm+IRSmzydRiaiuY8xtQIKM\r\njkMPN3M0oYGzsakcllguxFshcUh5COspvXaSLxHVkIQWZrws9eScEb7mcNrt\r\nnUaH+OuC5s2KdczzqpVElg/oBLC7IKc7p7BlGeXJxFtVMWpl4V/90aoEBFhT\r\n6sKDE1k/YOCUotQFlXU1d3WBkTE5YtZXz+yIrIxsqUr2jaLJKU0xZ+p05pbG\r\ncpVsw4CRSoK34br54LZWr5aUkfWS1mS1HugWMr7hKFQ+UBeEi/INJ1y9ghlG\r\nXAigq7o/rZxKZjo8HtTD2J0YXqhXWCEL+xta9i6jioPedbxV2K0YsZ3TtCEC\r\nywWmluky78fVh1XV1RfW7SNtNRAaaMD0H4rnPwaEMiDLRpzW4NXFmcO29tWL\r\nJIVWyblJN+yH3ceyGyOPq++Y7wkh4jKNBXzyytmCqPMcLPk3alHpi4VhSP2y\r\nexCacbps3WE+QqAUXSgFAyIPsgq/mMA3ffi7Z3Rg+HwviQoHfqG+2axdaIZV\r\nFyUkdhG0lJAxtS/P1gs9OErwe3Yzu/hFHc8=\r\n=MGj2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-edd1aca5ffae3f42caa63e6b79f25da19688bb22-18.x/balena-jellyfish-metrics-2.0.217.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-edd1aca5ffae3f42caa63e6b79f25da19688bb22-18.x/balena-jellyfish-metrics-2.0.217.tgz","_integrity":"sha512-ZeW/bOFcEishOXJ61hVzukmmnHCPaZji3hVoZFlfEFF7o99hvnQWKA8HofEvaAB5FRUFCRfj+SQdT8D9/hT5Ag==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-03T14:04:03.452Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.103","@balena/jellyfish-environment":"^14.1.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.4","@types/jest":"^29.1.1","@types/node":"^16.11.63","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.217_1664806097689_0.5262876255935203","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.218-renovate-balena-jellyfish-environment-14-x-107d6812124e5eb871727fce2da5615d098b1c4b":{"name":"@balena/jellyfish-metrics","version":"2.0.218-renovate-balena-jellyfish-environment-14-x-107d6812124e5eb871727fce2da5615d098b1c4b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.218-renovate-balena-jellyfish-environment-14-x-107d6812124e5eb871727fce2da5615d098b1c4b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d734b196433ad2c80cda6fa3fe3c135a297d6b20","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.218-renovate-balena-jellyfish-environment-14-x-107d6812124e5eb871727fce2da5615d098b1c4b.tgz","fileCount":17,"integrity":"sha512-erSS8q6eHV9ZsCfk1XljU/PCYyUoron5P6/cyym6lfnNMRgSa3g2+aLx9vY/4PsighNF7ZoiLVkbuZH7EpGH7w==","signatures":[{"sig":"MEQCIAPgWril3Swwzw+0cwihkZ2U5fGG0BuVKFk3ZhBlf2D6AiA+tzyQuqMoKhgQHypeAxMbqPNbdyrf2NkJ8pcvwaBxtg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68203,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjO4mAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpOWhAAn8ZpeEBsA7sZLOU0qB5IRHOpWTp4xIic2qXWUuv2rLhUKwr3\r\nICd1cjkJzKQha1riWa7NGC+8JhVkXXufbK/o47yWP5VQD0Hhsdg1fkerjX9D\r\nuk4SOfk9ZuLLnErb8eWY4d8OOS0HdQH7Kp4RPDQ6MBj4WvQfosPdxXHdTBAi\r\nlOcmg0KUM5BauwJPiH5I7wl+jXeaHpSJ66k4qNqQqUrJz+7lr7eDQkBx7tkv\r\nE289A5PIA/Bd2SzaJZiI38qBsDUBxS5KEK/sRQDHIHqFJhscwEcgfeX+aCJR\r\nt/2Qv6+JZX9iBh0gb7cvByE4D7qO9+S+4Y9wo6AJjQy63NnWMfvBl4GruIZS\r\nnoyGp8RuLBtEbr7OPO9tgFZm9eX4zv5AAgC+VnyzE2tnimQJE8DSmMKge/x/\r\n2CJTjGQNBsP+eYAv+Yl2wI0+S2zyUGTz5tyRZhjqYywKopZqxBa3TasMKgG9\r\niu9Rq1/lGidyiF8w4BvT2WA2u1xhhrfukdrz4FVc8asbNpnoMrmGgGWv1AT6\r\nJffCM2AypRSA9/16+P6uuQwxsjzRfWGummWcmwB4VtsVLmHUUO+XrEQbUDC9\r\nbxJefnfBbTQiEPmXK6MwjOy3a77QlsOLKLdaQKubV8XIfFoEA9/hIK/8dZJV\r\n+snNLVrdzvqmKvq3wFLnIZKt8Xr6hJANOyc=\r\n=U/sH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-107d6812124e5eb871727fce2da5615d098b1c4b-18.x/balena-jellyfish-metrics-2.0.218.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-107d6812124e5eb871727fce2da5615d098b1c4b-18.x/balena-jellyfish-metrics-2.0.218.tgz","_integrity":"sha512-erSS8q6eHV9ZsCfk1XljU/PCYyUoron5P6/cyym6lfnNMRgSa3g2+aLx9vY/4PsighNF7ZoiLVkbuZH7EpGH7w==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-04T01:15:20.166Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.103","@balena/jellyfish-environment":"^14.1.2","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.4","@types/jest":"^29.1.1","@types/node":"^16.11.63","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.218-renovate-balena-jellyfish-environment-14-x-107d6812124e5eb871727fce2da5615d098b1c4b_1664846207742_0.7015644936926062","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.218":{"name":"@balena/jellyfish-metrics","version":"2.0.218","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.218","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"63b4c5410c330688ec28e1b70ec05503de11a79e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.218.tgz","fileCount":15,"integrity":"sha512-l28XjQgLeUONgjU59HaVXvPKXdjil4aBBEWMvZy0yl3JEEFKsDh8RnoKg5jRfBloUpZD/QLZD01IyJDlFvC4rQ==","signatures":[{"sig":"MEUCIQCZ8zoZ4056+yGXwSu3CJ+fz/u2Z0qaTNJBT9JLdT0qGwIgN5sialm6yet7lzGUpg3MK+AeU7rlhNPnSEz1wigjyic=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68119,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjO4oMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoUqg/+OfYjrIJiTT7zLgQ2s2qgEwAhIPZoNZYfkO1FsuVR91ysbL/G\r\nHxvePscEWHdJL5N/kiq2R+f/zliSa2hPVSWmQ56r7uNOY0yjYaTcgk3xzpPq\r\nzAdbSbExQ6LvgJGsxKfblEOQdJpf+HJvuhCs2lk3t7IY0oDL0k1G6N7sWWrK\r\n0xHbi40Y7whWgLwUsVokjtzmN9+71XVByKcPCGeDV9TjXhxGU9m/y9mqT+/H\r\nJBve2lkcpse8g+I1mD0xhcmLSxrxXt9RlXOf+tbi5mc3V77oGK+PJAPQWour\r\nYkuK9UQAdem7/Dcvb//JKBBsfJz5ZtymwphCVBanLe4ItASVNYsDTmev2ztJ\r\n75gkO/hvfUBFEL6/L4KWHhdbA6qBfxBL7e7WApaxa8UIjHmuMRjMMXJz8tpd\r\nUsJZk2Xu+V/B3WpF1k1YY494SiMDVunxR0L1/mB1q3zpXXomm+w86PQKUj5s\r\nFt4HQD3MsyanUFZ15xQkza39cwI4AznH++uTE5IlYnqQtu8l1Sfl9/XLtwpA\r\ncT/Tf8ga2XO1rzz45Al0MqgxcOdjgX6Hdg8TX+ecibSsGbnuPU7cHy3OBDr1\r\nEPO+F8sKQZUed8fL4TtnTIaxWhoqkE0vC1/8pH/zJIiljGVikd1mQ8z93tdZ\r\nOLff7ebUIVDXE4qzfzRI125eWWTvhwu/tzc=\r\n=bx6A\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-107d6812124e5eb871727fce2da5615d098b1c4b-18.x/balena-jellyfish-metrics-2.0.218.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-107d6812124e5eb871727fce2da5615d098b1c4b-18.x/balena-jellyfish-metrics-2.0.218.tgz","_integrity":"sha512-l28XjQgLeUONgjU59HaVXvPKXdjil4aBBEWMvZy0yl3JEEFKsDh8RnoKg5jRfBloUpZD/QLZD01IyJDlFvC4rQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-04T01:15:20.166Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.103","@balena/jellyfish-environment":"^14.1.2","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.4","@types/jest":"^29.1.1","@types/node":"^16.11.63","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.218_1664846348701_0.8969503289978149","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.219-renovate-balena-jellyfish-logger-5-x-b69c2910a395b137c6310e52c4054deb9f3d8c66":{"name":"@balena/jellyfish-metrics","version":"2.0.219-renovate-balena-jellyfish-logger-5-x-b69c2910a395b137c6310e52c4054deb9f3d8c66","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.219-renovate-balena-jellyfish-logger-5-x-b69c2910a395b137c6310e52c4054deb9f3d8c66","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1f7dc7d0ac1068f47abb152b7c4fa6b192efde74","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.219-renovate-balena-jellyfish-logger-5-x-b69c2910a395b137c6310e52c4054deb9f3d8c66.tgz","fileCount":17,"integrity":"sha512-Jcv+NTE1YWksnLCiINGZ2GQtRmcHoJw+lekA1T7NifznpSK/1sQfxSSArrsUFnplaq06bkqwBdcWDm/E78Abyg==","signatures":[{"sig":"MEUCIQDy1byqGUk0AisX8FehpY0Kr62SrDKfhjCRW7K7UfwF2AIgJn/hbCE+jFSbf0yAkIkwNLnf/WWQLF5iiqCRPd1ClBY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68197,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjO4q8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpIiA/+PVfL3sjYw4bgvR3dFs/n2nQR9h2+Wv7OU1bE7WuZLaqoYJlB\r\nMAv6CHVjyn5mpSa7ubOYCf4/Ix+0GsPWhi2VHqK3n6pxa63ImA3t0st6HBPj\r\nz1YE5el4ou5gRcXIUjg5K5ez987yF3G/VcN1elIBlBIUCJLzkfviqz2XRR62\r\nbuxjXf2cU/9cOzZLwUmw3dUHy+g5OtH4c/dEHKzbV7smm5kiNqDsmMXI4RF1\r\ngbSxrcLHpA3FjhImvo7iMH6j1JkvZjqYsDlIfNY376/t7N6B7kU3ZZ310WCD\r\nKp57JTPXGCdZvI+Sj/bpUiwNtN/k0mWUnHqaPclTTUtVo4yJCc5hxo6+OV29\r\nRIWCVn6gez939lGEUYWFf4PE/rS44hObTmEioLW9Y3Zjjw4F9IBbqUm+Wtpc\r\nQ21ErwIMhAA82o7fdE3Hn4L9Ome4YZ1FBv4rRExFvhiCqTw6hjU8zm8zBf9X\r\niPdRtJ5hsxCslIC1gwXTfhqu24VhV9dkE3OBLFlJMWjzWMeAnzYuAfbihNlQ\r\n7IPixap6qbX3OZbKvJfUKWWyuMYPEtDzh7e2iTvznXLiw8wChV3ATGEoZajl\r\nJDrLSAT4nJ9hRnpzzWzR7vKhX7Wa83TxSB3BfB/0BCpXEboUOwIuHvQQi/MU\r\nY+OSq42i9PtndpknAFy0fV/sArGrDhzj8z0=\r\n=kmkU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-b69c2910a395b137c6310e52c4054deb9f3d8c66-18.x/balena-jellyfish-metrics-2.0.219.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-b69c2910a395b137c6310e52c4054deb9f3d8c66-18.x/balena-jellyfish-metrics-2.0.219.tgz","_integrity":"sha512-Jcv+NTE1YWksnLCiINGZ2GQtRmcHoJw+lekA1T7NifznpSK/1sQfxSSArrsUFnplaq06bkqwBdcWDm/E78Abyg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-04T01:20:30.390Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.104","@balena/jellyfish-environment":"^14.1.2","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.4","@types/jest":"^29.1.1","@types/node":"^16.11.63","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.219-renovate-balena-jellyfish-logger-5-x-b69c2910a395b137c6310e52c4054deb9f3d8c66_1664846523921_0.5672364390413351","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.219":{"name":"@balena/jellyfish-metrics","version":"2.0.219","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.219","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8465de18289856184b5f1a60f7019ef5aece918c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.219.tgz","fileCount":15,"integrity":"sha512-zOe8XzM/5fEV6NWr6fq4R/RtSYbK3833gz5i9FyfVFXYjqWhAX40rjQuYVNVB+1vPr09wVd6+x4oseOjNXp02g==","signatures":[{"sig":"MEUCIQCQQVvAjgNMkLyxwAGqca/8rUweRlHwFH2Pji2BMlL8dwIgQW+tWoglfwiCRdLZojco3g5UjQ0qNvSRft2qjlH5G0E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68119,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjO4tQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrytw/8CvIXfsdCshQb7NYWaDWanlnMUdb5ZBHcK1Y3DqPQ5Sdv1Xuh\r\ni4+dIN3D1NSYw533OKnGPc2RZBNDKCrOhd3NdHr8dW1i+eglhHLS/vhPNw0Z\r\nQWTEQwlN16A/ok8LjiKUfrQkW5Sc0NUSKsuwkiLnmxRi9rJ2FjW5pbgmadkL\r\noCQAtQKrADNXz0/HyIwO8nlf9SNJENWbL6yHO3hPjrPkwu71X1nRnR3OiijA\r\nYhcyhFgHhXRgGduZeRpq8HLDXRR3pB/1aYLNLvpgIJhTNbrbaRJgmYcH8n+b\r\ndbxdfrmJQOGIf1dz7q6adPkz8Ure3FZMxdQQajMPRbeb67SfxQju/R80mTCF\r\n03dJ7c/+s+tvdFn+T5r+yETxDkUIZiLlw8c4ENec2mMgk3ORU1glXWDS+a/C\r\nZ2dAeeveahSnE6Mf41iowAwQllkpBQgac8SPD6A+G3rkAM6KiASV3bjp3OWw\r\nNb/g5/dVz8O7Gw6CQ5hyEdBuZhpm6cuMpw0aJ0Oe75SFJI/YR1kxeTrd80CJ\r\njZlrbd6t06M0cuvDxF7MCnab99c3gafMYkc6Qpp4GRKKgWk/Rrfxu4Pai5cm\r\nzgkOO8UhhgMswyg5vP8+4/tCS//f+6FGfTa9mAC1TUix1i4EekktofzJD0rw\r\nezGfHALuMhLFS4LKTgnP93Z9iEDISjFgcNY=\r\n=+Usg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-b69c2910a395b137c6310e52c4054deb9f3d8c66-18.x/balena-jellyfish-metrics-2.0.219.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-b69c2910a395b137c6310e52c4054deb9f3d8c66-18.x/balena-jellyfish-metrics-2.0.219.tgz","_integrity":"sha512-zOe8XzM/5fEV6NWr6fq4R/RtSYbK3833gz5i9FyfVFXYjqWhAX40rjQuYVNVB+1vPr09wVd6+x4oseOjNXp02g==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-04T01:20:30.390Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.104","@balena/jellyfish-environment":"^14.1.2","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.4","@types/jest":"^29.1.1","@types/node":"^16.11.63","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.219_1664846672403_0.8208523714996521","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.220-renovate-balena-jellyfish-environment-14-x-7912b8f9c88716669e3a9bda8a7369432a22c603":{"name":"@balena/jellyfish-metrics","version":"2.0.220-renovate-balena-jellyfish-environment-14-x-7912b8f9c88716669e3a9bda8a7369432a22c603","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.220-renovate-balena-jellyfish-environment-14-x-7912b8f9c88716669e3a9bda8a7369432a22c603","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6040c9fccda2ad436cacd776bc2c85a25848ef07","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.220-renovate-balena-jellyfish-environment-14-x-7912b8f9c88716669e3a9bda8a7369432a22c603.tgz","fileCount":17,"integrity":"sha512-JaTNEqgJXARFPfdPLoRhFhobPyUoAdNpyTU51N1Z4u8hfJ3oY4CV1p0mio74HtGaMIeSbVaS0qqhkeWhuUkOcA==","signatures":[{"sig":"MEYCIQCHbEDFIs2OSA4dYyJj4loeLDXWL3fS7+XUdXnNt32spQIhAJG6AZRph1xqtBz4QA5EAmvakIjEBPYO5fL2d8UIxH0h","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68203,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjPlYBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoesw//XVe1siWxzq5pcWm2tUYaRpbSB1ni2oTB4ymQw95iQCSHtyT2\r\nJQ5w8g3h7SXKEB/Y45M+GC9WfkU7WG0uHPuzO51r3+WYEvqv7saZeVTVc21z\r\nD2vjc5rlH7iYhrWqHPLZGJ60KQF9CSbg/HakkfIleJfqKBWctwRQs5O8lfQ6\r\nxrZd7mL6c549qhH1EQ90VEzo/7sSk3Wz/nda1r4RWb5AE1kfKS9F0y90VYFJ\r\nLGcDHsWUTMs7+fLl/P6ZXsMssgPYkvFQFJdbZv69eU6dL9xWpkfnYvoxsE6S\r\n6WDK0jJDbUZCQPeXm9n1Wzm2kbpsk2ThhgwpVwUHI2AFkFrRZ+U6FvHG1ZCW\r\ngn/riM9sn5MG9EBJKlQPwDu3DAHWxVpeuQIP60iiDLngtnUZaZ5bJrGWw4j6\r\nVz8RXJmUKH0TCU50IRLsLhLZn+kuZwTwqJLxHwrhemUERVVSHgJh/5zrhi2V\r\ncvBs5J2CfUtxrH+81hhwwaaiGabW3mS6FtdI+D60rvjCIm5B/VxBFOa+u7cd\r\nZQOTnYh6gMgY5u0ViMUwoLiVe6xI4aDsqgHp3JHI3T3XbgLrTZdv/4/1dlwf\r\nOcAtPq38g15ZffnieoazKFEw7SGb4kgawwlPq8m05NQPvN2fIAQKpcnrQkSy\r\ns96OVW65EGB+KYoJ3A5rtBbXHfLOMWcNiQk=\r\n=3U1p\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-7912b8f9c88716669e3a9bda8a7369432a22c603-18.x/balena-jellyfish-metrics-2.0.220.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-7912b8f9c88716669e3a9bda8a7369432a22c603-18.x/balena-jellyfish-metrics-2.0.220.tgz","_integrity":"sha512-JaTNEqgJXARFPfdPLoRhFhobPyUoAdNpyTU51N1Z4u8hfJ3oY4CV1p0mio74HtGaMIeSbVaS0qqhkeWhuUkOcA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-06T04:12:25.309Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.104","@balena/jellyfish-environment":"^14.2.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.4","@types/jest":"^29.1.1","@types/node":"^16.11.63","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.220-renovate-balena-jellyfish-environment-14-x-7912b8f9c88716669e3a9bda8a7369432a22c603_1665029633207_0.9621890915932236","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.220":{"name":"@balena/jellyfish-metrics","version":"2.0.220","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.220","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a9b67a321d36e0fdb0c19e637e5f3d108a0024ce","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.220.tgz","fileCount":15,"integrity":"sha512-yK6JdyVsAkdsCxDqWd805LDgS5M5n7Gs+0sULFyDtYhhtbs9veg4JLtfUG4d2U16VVxAn0Riklw3mkP2I4f5VQ==","signatures":[{"sig":"MEUCIARzDihrSXE5qFYnQaFOJeFd8FHc90+nKFHinpJKT2kGAiEA9ZKxkrnVTciN1ANqOOpY8hgTQF4fRDSfnDMMsS4D73s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68119,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjPo9vACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqW5A/+P8CVDICVXZtpzmcuqatraMOSVlXjpDqgzHBeho9py3T0fqb0\r\nN2gKxrFm6YRbbY8zkeB6D9nTSWpThQlX91t3Myp7jPL5toU4uuIskywZ4dH+\r\n3EQLpP2D5/17wF2BuSPFbeXyfPjFpWGBPbVM7iY+CEwFY565jOBJu5CdMY81\r\nAwh5Z3uCBjA+PP+Ev+DP4KEHlZiknfaL+odKb7aaUDq13+ycPuWPOYMdLF5J\r\nZyOmwZ5ue0wal6tAS7cUWyaku+5D88+waufqGOe2xcqTTr7xOa6G2xeBhj11\r\nHj2Bbpo2y/NNWJ5AsVTuEuZw9SD++mrbaOhJHnsm2NqC+a4KB3UN5EBNh19r\r\nZMolq0/ePa5z3iIWq+rppZnZLlDdNk9ZRraluZ8Xan+cWGwgevU/KYaBpM6q\r\nvJYVMQ3tcvU+pUfhCdDNA06KiPCRIIpZGvIkuywPYYZz2qbLOaqTtJsWmpKr\r\nfjxT8DQmD4PfOZ8J0oHR6KbtOB4K1ENqc4RmxnCSU6OuCU0LyMFsKXEHCx5y\r\nr5uI1zZJuZY60t2bLJuKurx+FRnEVTiOnG/vJtXGOB7yzTxffXIn+NkZEqe+\r\nC6rn7dgXrxZguPz5QQd6JnsT8jzThZOsWmk+JUf68KD/FhB0wVZbnqpzJl/I\r\nIac7PjfdmS2YK3PLxoam4NwksvJbIH61FMs=\r\n=Jak8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-7912b8f9c88716669e3a9bda8a7369432a22c603-18.x/balena-jellyfish-metrics-2.0.220.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-7912b8f9c88716669e3a9bda8a7369432a22c603-18.x/balena-jellyfish-metrics-2.0.220.tgz","_integrity":"sha512-yK6JdyVsAkdsCxDqWd805LDgS5M5n7Gs+0sULFyDtYhhtbs9veg4JLtfUG4d2U16VVxAn0Riklw3mkP2I4f5VQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-06T04:12:25.309Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.104","@balena/jellyfish-environment":"^14.2.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.4","@types/jest":"^29.1.1","@types/node":"^16.11.63","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.220_1665044335069_0.6352026981254253","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.221-renovate-balena-jellyfish-logger-5-x-750d21789c338745796d198e802608e17025e097":{"name":"@balena/jellyfish-metrics","version":"2.0.221-renovate-balena-jellyfish-logger-5-x-750d21789c338745796d198e802608e17025e097","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.221-renovate-balena-jellyfish-logger-5-x-750d21789c338745796d198e802608e17025e097","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e6a81f116cd07e1269a582827782b0ed070b73b2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.221-renovate-balena-jellyfish-logger-5-x-750d21789c338745796d198e802608e17025e097.tgz","fileCount":17,"integrity":"sha512-IlQYlEZzG82urEgVj0lqENxbFnnuW2lBRmo5RpEMgw1YRtyYz65BmsEqnTdPthShFH0hlPWyzxL1+eDhh0qFxw==","signatures":[{"sig":"MEUCIBFDmz81Cu+5T01rGVOm0KQ5mhDVwGX+nh3jihWrif8rAiEAqAdAZQJzeFlun3BNH+XPVDHaPFaCIaTxSS3/zg5vJSw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68197,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjPpAeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpNwA//f8ymUc98AtCpLMCr7HBfSnVzKpT1ZK6Cgrd4JRNWY5AgAjMW\r\nBVgIirGB8GUlc9UzCk0D3tenzIQrd549gQhwhhN7BD2VExJ8lFu7hBjtp11Z\r\nlcKnMOAR5gt+rEsUDtuxV4VfoDKvn8E8nHbWjStD508+ArRRN/enh7yJrhhu\r\nWHUb3rDoG6wUyW+Efo7BVtbc8wuP1Fxr5C4YGKFXJNtwvanYbhE5xb7c6vsc\r\nbGMLgxE/8WOGapxIl8uH59le1/XJIZmVG0V8qLPv9NUH22vWA0wbV/wWjb1D\r\nbTnCNvbzkGEi1WcvmyYdzNof0YRVgs2+PmOklaUu8BsTqdLslIngqG39xIyL\r\nBVyTZY5YB71ilt4Kjca+XFW+AnHS4+J5D2oj/LBEp1A7JMadVfgl08SgkUKp\r\nRdw9qGT6ae/i5PuVFHltWDaWY/ELR4K7O0YgHnbIptNJONgsSxt9XYxS9gxl\r\nwTwZ8uitbKg3ByMig78CNk0nOQRBHJv5X+VbhPRZlAhzvzxAVyxKBcdVqqJa\r\nS7TDw1zphUpq8fFZLW1F1EUAqerPBP2ai0D/+V6rgFFBduWbaz539rHwnaJS\r\nNBvmAamGqHrHJwr1Y2rSH4lmiNdwokuXjQw7z7NgHZOBg7N06ZfeVsMZM9hP\r\nXUUTOVDWx4W2CSwQBwjtxN0YVrIb79jDi1M=\r\n=E6Br\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-750d21789c338745796d198e802608e17025e097-18.x/balena-jellyfish-metrics-2.0.221.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-750d21789c338745796d198e802608e17025e097-18.x/balena-jellyfish-metrics-2.0.221.tgz","_integrity":"sha512-IlQYlEZzG82urEgVj0lqENxbFnnuW2lBRmo5RpEMgw1YRtyYz65BmsEqnTdPthShFH0hlPWyzxL1+eDhh0qFxw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-06T08:20:19.152Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.105","@balena/jellyfish-environment":"^14.2.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.4","@types/jest":"^29.1.1","@types/node":"^16.11.63","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.221-renovate-balena-jellyfish-logger-5-x-750d21789c338745796d198e802608e17025e097_1665044510218_0.5699936842521898","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.221":{"name":"@balena/jellyfish-metrics","version":"2.0.221","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.221","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"df1f25d1bd906c3de65a2d704d2cc90244ecfa0a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.221.tgz","fileCount":15,"integrity":"sha512-QhhoHrzsl5njAtnynxRa2VeKwOqY2Y++nxOq1FsHPhg160j/Ki1iU6+6ZHXrTbXmekIFd75EVsSXWqjJIdIWAA==","signatures":[{"sig":"MEYCIQCvT9sjp5w7Jvm9Z2zjz++mnQ12D2zc1+xidUCQdagUQwIhANNrkuvSiEjF5/WUY4fBecsHMSrK3E4Kjx9eHBYNMUwQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68119,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjPpCmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrg5g//YFbv5BpAKGbX9E+jlSIz9Ml2w5Z3bwORLjBKXzyWcTl3/ggi\r\nizJ71S61NNL+34Zal815XFhIDcvE/KClK3rmZXu21cq4hH1tVYjUG7y3ku6c\r\nyi2VaBm4KwcvFmr0sFv4O1H7SqK0xZrwgnohLOagbdZgNGJDvcZxUaw3scKF\r\nv3jXBnKB2sriImebmQ8rnozKU/GYtQywPvwF1kv4dNxBM46lTSA5xinkIsnz\r\np9uWcKoB7gTVrz8lkKURvlzSrIjxIxzKmRR2KSjYZPERgQZnhRMUBhQRPgHx\r\neFOziKVLc/3B/rxaxNpK1U/B7oZs6dSHrGrEKs+zdGb8f0dPziMKr8PBS9Ln\r\nJpmFtyaWaj5u1eGZegqOlllyCeSlbYEazoK+Qi6hb38NKHZ/Retbbk1vhNiJ\r\nPo/8+yISTMfQ8oSqbhqCbsdNCNaqXxjyOkkgWgiv4g8WXeqM2WLqTopn0DwM\r\n1A8Xe+uz/juh4NWqHKfz4/qX+NEsMEfhCj+78TWDniQ0Cf6/jRuOULE3ptbh\r\nzbIiQpHqqv0Ajp1b7KhTqExLGVEvioI6/rxK0TQgQte6Y3tSsAIo4VkBgAA9\r\nG093PGwL5vCSwETQPaLpaomAohzzu2TvNDHvkYR2ekvfQqVqzsfh82Igi28u\r\nv4B2/qRZ9IIhPjVdzBEjAWN7JXnNstsYg9A=\r\n=ITSW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-750d21789c338745796d198e802608e17025e097-18.x/balena-jellyfish-metrics-2.0.221.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-750d21789c338745796d198e802608e17025e097-18.x/balena-jellyfish-metrics-2.0.221.tgz","_integrity":"sha512-QhhoHrzsl5njAtnynxRa2VeKwOqY2Y++nxOq1FsHPhg160j/Ki1iU6+6ZHXrTbXmekIFd75EVsSXWqjJIdIWAA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-06T08:20:19.152Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.105","@balena/jellyfish-environment":"^14.2.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.4","@types/jest":"^29.1.1","@types/node":"^16.11.63","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.221_1665044646694_0.036735552255378945","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.222-renovate-balena-jellyfish-environment-14-x-bbf76070441b461a733210cbc8a0660b7bb04d66":{"name":"@balena/jellyfish-metrics","version":"2.0.222-renovate-balena-jellyfish-environment-14-x-bbf76070441b461a733210cbc8a0660b7bb04d66","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.222-renovate-balena-jellyfish-environment-14-x-bbf76070441b461a733210cbc8a0660b7bb04d66","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6a48bd96799f27fb95b90e8eab327d081d25adb4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.222-renovate-balena-jellyfish-environment-14-x-bbf76070441b461a733210cbc8a0660b7bb04d66.tgz","fileCount":17,"integrity":"sha512-xmNza+kmnkMckRIthDCqeLRX/byQSX5tUoIcUicRnt4vPVjoOxj09hlMAmT+tM97zJE08FSs8q88sYgRSpUevw==","signatures":[{"sig":"MEYCIQCJNPX5wDJ6QNYVpmOMfpMojVr9vXeJ2ecuo8TnmAycSgIhAI16PfYISVMZTsKF0Ham8z27lwXDa0QEGskZkkM4fOeQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68203,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjP4/HACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpztQ/9ERHgqps0kx0gymBCH6Kjg1R8iivQUSmtQKPJUlsPFnmtPY3v\r\nxW7CjTfEu3G7nT/JNz6YQvzrKiktpZF+7lpynC0YHCHJKxn+ioOuPGFb8WSO\r\nTrbIJhWt+w0cJu6QHY1f9j76laKpycPYxxi1eiicnGXwqT2KZXgIN7YDfA5W\r\nJ77LHQmzdrqzQ9tjJkhEf1wxGUpO1IGwF8oIv3KYfq+sm9FvF8EMLIeOK6/7\r\nVLboz7slH5LjGIyRq9DmD7UC1Ba5xnCYuFSMeMzb0SHdeVK1oLxoqycXGpO0\r\nKKoNElBB8IisjLJV1R8ZTV+YF2uzpZx35e9oSjKi6kpo7OwY55gM1QjA/JEI\r\n4jpfqKTsX/rXL0FzM7SCNfsAY4H9hdoie7nZ6aUPZ6n6i1rsU4oB6BcfXuFg\r\n0kIl19ri7vzy9Xc2Weuz2ltbF3t7v4Zz3w2CEMwQffmHyFs+tgya4K+g/J3Z\r\n9NCS56NSIbIFERJcabvnmXPsodzbv7v045ly6KMAhtN5U4W4nHCyEJzjOH0Q\r\nDVp5Nd5QZOF1yfbVtwDOQkvWL7GacH5hD6zLFft95CqYANFMBH9AnRc33Cje\r\nflK4ZITl2rKSdklSJ7oEiG+plWaC5+rxprB10yNXo5IiC6a08kZ/fQYNCnkq\r\nZnACFl2p2VWAxvclFjPG2yObK8sEI45zhQo=\r\n=m3y/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-bbf76070441b461a733210cbc8a0660b7bb04d66-18.x/balena-jellyfish-metrics-2.0.222.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-bbf76070441b461a733210cbc8a0660b7bb04d66-18.x/balena-jellyfish-metrics-2.0.222.tgz","_integrity":"sha512-xmNza+kmnkMckRIthDCqeLRX/byQSX5tUoIcUicRnt4vPVjoOxj09hlMAmT+tM97zJE08FSs8q88sYgRSpUevw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-07T02:31:08.646Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.105","@balena/jellyfish-environment":"^14.3.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.4","@types/jest":"^29.1.1","@types/node":"^16.11.63","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.222-renovate-balena-jellyfish-environment-14-x-bbf76070441b461a733210cbc8a0660b7bb04d66_1665109958792_0.7615482190247929","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.222":{"name":"@balena/jellyfish-metrics","version":"2.0.222","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.222","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"14ec9836ea053dafaf16cfeb20540418911ddca7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.222.tgz","fileCount":15,"integrity":"sha512-MWM8T+2czTeEB086zfTrd6d1n79dvEH7Bd4tvnKv/0To9qwk/19gvOqdckAXZW9zYjhE4bos9iQ+DHebOlo+bQ==","signatures":[{"sig":"MEQCIB/b1iHsI70Ort5413dPh/f+qguYb7Cn0gV+v6J5es1kAiBGTDbaiSGHXIn1dOxzLFxVWJ5mrz3PSEB+suY/+SeYuA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68119,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjP5xqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoxMxAAm7GF1z6K1OD7DDq9OhUzWMVwVdpaK6DDlgYRfpvyu4v5iUNW\r\nlsnj7W070mvnpYpH/bigZgesdBDgKa8B8nRKhZSFExRkUpdzVDQa419Ghfsi\r\nW35md+ekmlSSRV4FPSfEKWu46tLPVWFiqkO+bdkKIYbQTpNm430AeZy3Zw0r\r\nC30Hv6Y+lURbnlOW54pX+AIsn9w4X05kcmfqQ0uWVXlG7tZU9U9cpe2AlkSz\r\n9T2amO64ITd/pn1VOmnOX6AlO38OXs2pmGHZGtQKH9C8DVCD2+S4ArvSYZJR\r\nAgHVUaN1sz5RDxyw2xYMQi0GLVM/rryu3kZW795DCDYsJMgk6AwMu73gYIJz\r\n79Y4ApafrDSpeKs9N7YdErh8x8GYRJdfbqTqMWXgg9+rLGTuChv8Sqj83ScM\r\njhRCXjTMKu+Cu9eXk0qEoKOmU6oKZlewFFrbLjrg3X3OH5CJE2Eh12+B/K4+\r\nDtWQt648kP9O0B7BfLT4GttFv59v0dLKuwBbC7muQZ4CMXT6EhkQTxYKCMYH\r\n9pjt+PWFv5fNr6QTzSlNtmpTIalb2eo0Tulm2Wks2KCQgpg0GTsQ5XE6G3/E\r\nkteL+NuPF+ms7cP3F7KM9hEddiRV1MotMu0n1+z93LmLdF0S17BSGTrR2jhy\r\nJecyLxUvzrUkahSPrWYD4aKksAqtJuqM8+M=\r\n=Hixp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-bbf76070441b461a733210cbc8a0660b7bb04d66-18.x/balena-jellyfish-metrics-2.0.222.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-bbf76070441b461a733210cbc8a0660b7bb04d66-18.x/balena-jellyfish-metrics-2.0.222.tgz","_integrity":"sha512-MWM8T+2czTeEB086zfTrd6d1n79dvEH7Bd4tvnKv/0To9qwk/19gvOqdckAXZW9zYjhE4bos9iQ+DHebOlo+bQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-07T02:31:08.646Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.105","@balena/jellyfish-environment":"^14.3.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.4","@types/jest":"^29.1.1","@types/node":"^16.11.63","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.222_1665113194270_0.5338726988981093","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.223-renovate-balena-jellyfish-environment-14-x-fdcb2f3affa6c26b46e237d71b12af5703689ae7":{"name":"@balena/jellyfish-metrics","version":"2.0.223-renovate-balena-jellyfish-environment-14-x-fdcb2f3affa6c26b46e237d71b12af5703689ae7","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.223-renovate-balena-jellyfish-environment-14-x-fdcb2f3affa6c26b46e237d71b12af5703689ae7","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8c52c773d1e5cf746ca07f3821c11488ace5dd27","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.223-renovate-balena-jellyfish-environment-14-x-fdcb2f3affa6c26b46e237d71b12af5703689ae7.tgz","fileCount":17,"integrity":"sha512-I0wt0KUKEN3RKHmfocoeEGnZsRE2N9OC6lOQNaSetAv0ICDTqy6UEPtEmy1pkX5MXTRONdjTjM77DmE9Oga31g==","signatures":[{"sig":"MEYCIQCPJxV1cJg20EIyLpTuClN17XZ/B9EYXLhkzVhrWhvC9gIhAKwtsuSOU6vOoz4VecALeqSmva30s5Du9W7Wpfv5F8QJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68203,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjP8fmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrOUhAAmDmT71V47hXr0Fa3L/+Zd3KoWrSIPNC7q/bvkYFGiTp71SA0\r\n9z9IRWQ/LMwVv6nOUUUDosK4JkUlP4LVhPoD12ad0Ql/Mlv4DG931U/nVaCJ\r\ngOjReEHrAzbPV7cSmIKBKCA7KjicTFHvIZr5hUMaVDs6Pv8TKjo12uUL8Umz\r\neFIxIbycFY+hcrA2hKQ0fWqy/ikI48r89Mx5oBwt5b4lrmN0ukdCyGug0fze\r\nRPL41di7O7KjkEAcfISfWqc+QqpatyCnP06VBXWeMxXMEJKheVDzfQasbTt/\r\nIVycmNdSUFDvfBc/l81qbxq5z4qSMiSK9gcfF7JWIkBa5VjpX/kzT7IrfAxg\r\nkYaqAwtvL+srrIjsYygo/NmmB3wZv+kZpVoLNcFUedM+qyyH5sDNLn9K3w09\r\nxazKGHaXyxzmwuppChasL/Kn3BX4qbSdhV/HjRMe8i9irJ1PlaEImcGdCA99\r\n7jiI+yJDDXTm5OGjGXYQKSw7EnpfmJCOnbfN5l4MJ/vIaA3e7A0J5avhxA76\r\nAZTx7v/m2GB3Iy399lODfMFRRMsfkjbHIlYQKNmobuGPMO41Uei1wnlvdwru\r\n748t7WnvAiKrxjgC5/J/su2lMkPujw8uv1JZTIAC4vb33+duvU94IJrUkhiz\r\njxkFF0gGQz+yoeiyvNsA0f/V3QEaDdkUib0=\r\n=0rJk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-fdcb2f3affa6c26b46e237d71b12af5703689ae7-18.x/balena-jellyfish-metrics-2.0.223.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-fdcb2f3affa6c26b46e237d71b12af5703689ae7-18.x/balena-jellyfish-metrics-2.0.223.tgz","_integrity":"sha512-I0wt0KUKEN3RKHmfocoeEGnZsRE2N9OC6lOQNaSetAv0ICDTqy6UEPtEmy1pkX5MXTRONdjTjM77DmE9Oga31g==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-07T06:30:13.824Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.105","@balena/jellyfish-environment":"^14.3.3","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.4","@types/jest":"^29.1.1","@types/node":"^16.11.63","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.223-renovate-balena-jellyfish-environment-14-x-fdcb2f3affa6c26b46e237d71b12af5703689ae7_1665124326093_0.312272789018726","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.223":{"name":"@balena/jellyfish-metrics","version":"2.0.223","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.223","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"36d374d4e30661a6c2df51e0fa857eeab02f5e26","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.223.tgz","fileCount":15,"integrity":"sha512-0uS1MK0AnUC0d5cEWZPh2zC78wQWNlw/pZFeeoe+pu2FHC+qUNGkyATy8yE7zrqsi0k27k6LFVDa5KphmpHzig==","signatures":[{"sig":"MEUCIE51DXSciVuNawDIBXYHSihFtNVIpWlSgt2nBzc7OXiQAiEAu9WOvcW2DfiFam3m91ytC6ZcBOBYK/cZS0csZ9gwfLQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68119,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjP8haACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqNoxAAmmOM1NNbXoMWeA8aBBOZYoh+QY1zZjlBvHUPQl8/RlQACyVA\r\nGRGIyPBG9xA6mj8OHkGYVeNELhXtYnG2SUgJBb9/PxJFgRY2MHMpCVZfsRqM\r\n2z/9BEWc5XWGqYR5LmqBL0QG4Ru7CVwDfd21z0lp0i9F44KCJhgwHhhilCTx\r\nr5ON8oFBq5Olj2Ri8E3uOLpmz7iZUg67MikJAIBw/ArmXhkYaDjTIBI9z8F/\r\npT8bd6NVNShJOuFUbeMvyfA57Cby4RiuGxCgeHNmLxwx6VaxY/Lu+/QMmfhU\r\nKR87AwZsgvdGAmYk6rYNNF6uvqIUfP8Dnpw2+uYn+tG6eDf5pCfyv1quDx8e\r\n4EugJp29SVm3YAby/zbQlNOQmcfwYupJD0nx/J62hvXy9eCDhsEcJS9KqRFo\r\nL+wiQfyT2sKlYhkFTMW8L/YyQCBRhx+t/Bme5ClrfAcvNXCmReGe7l9O5ghn\r\naIugp3sMdXasfazrMoRNzcWjgVTt1mJIPdiz5Ybs16AxT33Y/ryAMVRPZKid\r\nwBu7u+xYwmRHoCh9h9f4Sw2NOPI207BS0ErjHLhgw0zlj0OksfZxaOI+5Sms\r\nsnvo+/TzVCrVNTpFhsuS15zrs0y5mz8UFyfMwTK01wAe+E7JT+z99HPjtqns\r\nvZrpBosnweuJvDGbCS9pQbvqidoI1+78KDI=\r\n=NJh0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-fdcb2f3affa6c26b46e237d71b12af5703689ae7-18.x/balena-jellyfish-metrics-2.0.223.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-fdcb2f3affa6c26b46e237d71b12af5703689ae7-18.x/balena-jellyfish-metrics-2.0.223.tgz","_integrity":"sha512-0uS1MK0AnUC0d5cEWZPh2zC78wQWNlw/pZFeeoe+pu2FHC+qUNGkyATy8yE7zrqsi0k27k6LFVDa5KphmpHzig==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-07T06:30:13.824Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.105","@balena/jellyfish-environment":"^14.3.3","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.4","@types/jest":"^29.1.1","@types/node":"^16.11.63","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.223_1665124442217_0.8052860320860549","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.224-renovate-balena-jellyfish-environment-14-x-656bbb413b991fddd9d87a2d0bfdd26e2b7b51db":{"name":"@balena/jellyfish-metrics","version":"2.0.224-renovate-balena-jellyfish-environment-14-x-656bbb413b991fddd9d87a2d0bfdd26e2b7b51db","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.224-renovate-balena-jellyfish-environment-14-x-656bbb413b991fddd9d87a2d0bfdd26e2b7b51db","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"73e07e400fba1b997495880c38430e7af290d30f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.224-renovate-balena-jellyfish-environment-14-x-656bbb413b991fddd9d87a2d0bfdd26e2b7b51db.tgz","fileCount":17,"integrity":"sha512-JdBS2nl1zvOmhd7Y9dC0ZwOsI/FXcsqC2O7NouiB71swsW4UJxFc13ATSCg3g6/ruNC7m7//vlcQs2SzA8MbRg==","signatures":[{"sig":"MEQCIEM3cFBvJP/eHaRCFLnDaP2q/hbsuZyIHA8y5MOVGUbqAiBQE0XGFFk/oacTh7P64nw9CjszXvmg1UgemVnm8xGJhw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68203,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjP8kSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmogUhAAjoOGDq2wJKuPuZX9DpANqugKEk7ciETKrrttcjJdbygsea0A\r\n3dpg90P76cfxurRrWq3UHhlTa1IJoDo8YGim9k0CMxTj1Nx9aJ/GjBistEll\r\nbMe2qybZBhFdxDS25mUlFTicksy+pG/Zw2JgfiLoDH5DqUW/ytW+6OHDl0Pa\r\n0xrrQXIPwnhbZAWkv8XK1NR3ym+F0COABeCaOa7qYuO9UjQzGfaLR5pvaF7x\r\n3RjNqw0pUZjh7eOfkhLdfqNQhVoJWa3R+i5JFDI/paiBBflcxsptgytwrh5x\r\nM/ceK3ueuAsTJpZtM4CVHncjKxO3fizuCIYBoRNAVi3CKS86eMLqnuOWAytS\r\nlZx4YzxvP9Bz5MkN8BGNpydtzv44vkAbQZIO/O7sY538rmtMg/vFbT/n02RB\r\nqsy9/o4+3ND8tIWFZ2OmdPZh5NNYH8xTORMBHwOhMHqKN4zfLnDz1dQAzZ7a\r\nnhx3Znpc92knwk6cKEf3GG5oINnSgiJEEi8yj+AiuDGw1VJbfGGzUAWBDFBK\r\n/pC/7A2+yM6S+UTzyf0zF8twUVGVM8VYjRfF3YaJPdkem623yokuqwMZRbam\r\nHH+XFVl1cSnbzCqfqAyQZVfJVxaJ7uPtLRrItcIFOAd4MRmFrmHpyK/L5v7L\r\nR/5+RdptKAtM2ECjlwtmuGD9p39JuE0K2bU=\r\n=88Hv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-656bbb413b991fddd9d87a2d0bfdd26e2b7b51db-18.x/balena-jellyfish-metrics-2.0.224.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-656bbb413b991fddd9d87a2d0bfdd26e2b7b51db-18.x/balena-jellyfish-metrics-2.0.224.tgz","_integrity":"sha512-JdBS2nl1zvOmhd7Y9dC0ZwOsI/FXcsqC2O7NouiB71swsW4UJxFc13ATSCg3g6/ruNC7m7//vlcQs2SzA8MbRg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-07T06:35:33.372Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.105","@balena/jellyfish-environment":"^14.3.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.4","@types/jest":"^29.1.1","@types/node":"^16.11.63","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.224-renovate-balena-jellyfish-environment-14-x-656bbb413b991fddd9d87a2d0bfdd26e2b7b51db_1665124626216_0.8703963271160085","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.224":{"name":"@balena/jellyfish-metrics","version":"2.0.224","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.224","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"06aa681a8bf9dd3780f56097fcacd18d3f7355b0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.224.tgz","fileCount":15,"integrity":"sha512-iJ7nphMTKRVlpxX+zTk8uciuKAlcCK7NNwqJDGCE+CRdSG+r4zIwITtIy67xH3xKcj6vJGPRCFMBskNSXOqySA==","signatures":[{"sig":"MEUCIE2HsCmOvZ4+jdds+PwnqQr2Qhhpp5oANOL3khpPS4g1AiEA7yJ9YEGwFOS65HoCEpaQxDtt4ITB/YeaNsZDJQ4KIl0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68119,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjP8meACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqMxA//eJPT8zaI/xXcRKSsFiusIVNegL4Xu2Qa7cWmy23Pjs6qGlBG\r\nYrLWWyP+ht0oIc7t6QtHNNKnCxpePgvC1Et50HXhjrmyaaTSXXlgkckB4mmX\r\nzZ9cKsb4kvVgsqZitPJzhRDXFyQYsv5Kyxw9NghGBvy7oc5YcpHQmjUJRZHJ\r\ndwxMzIn8lLaO0F5NnqtI0KK+D3ZegZgmrQDnRKO305iHWclb3agqqmvTaXb4\r\nLvcOs64EBVN9UF4cOkmX2U/G5l1+zstyGNO1zLs+qpBtf1wE98hyOxhqrDRx\r\nQWjGG2z7wVjzmUPZ13njgwWq3okMBEpXj/z4Q7gURMuqfro2+/VO9ViWkafj\r\nA23E7kJ7fRlq6JP9epI99jnME+3A240uPlw7Ja0tHg77vb7X4Ig+tKqZ9FEj\r\nI6qGsgrFoNxiGPz7VOuNhkNZ2RTuETNmlHpP8XkXi3f7Egl2DgvEhfYf9+FJ\r\n1n9dkSuz+1xS/ftkSxzqQ/ijOuhNQjNWAmDLE7cTqflxCjESiWyPxVV0Bk9+\r\n8GMkKQIooD89wxlelKr8+skSZgYoISmiS6RXIJp5c7iFehiahm0/ueQiO4jt\r\njenvK+SvTshKbACstrNyLqUae13yVAerVJT/YZ+rrvCQfG5l4LUQYGkPMaTR\r\nLLNWLlMEF3yg0FVtWis7tH96Ev3gaT/f0uA=\r\n=vimY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-656bbb413b991fddd9d87a2d0bfdd26e2b7b51db-18.x/balena-jellyfish-metrics-2.0.224.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-656bbb413b991fddd9d87a2d0bfdd26e2b7b51db-18.x/balena-jellyfish-metrics-2.0.224.tgz","_integrity":"sha512-iJ7nphMTKRVlpxX+zTk8uciuKAlcCK7NNwqJDGCE+CRdSG+r4zIwITtIy67xH3xKcj6vJGPRCFMBskNSXOqySA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-07T06:35:33.372Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.105","@balena/jellyfish-environment":"^14.3.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.4","@types/jest":"^29.1.1","@types/node":"^16.11.63","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.224_1665124766577_0.5655943903017009","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.225-renovate-balena-jellyfish-environment-14-x-195da95065286cf9f7193f846d4383ee5cfdfb12":{"name":"@balena/jellyfish-metrics","version":"2.0.225-renovate-balena-jellyfish-environment-14-x-195da95065286cf9f7193f846d4383ee5cfdfb12","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.225-renovate-balena-jellyfish-environment-14-x-195da95065286cf9f7193f846d4383ee5cfdfb12","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cf5d54a7e3105970d7682e00e442451102a03f88","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.225-renovate-balena-jellyfish-environment-14-x-195da95065286cf9f7193f846d4383ee5cfdfb12.tgz","fileCount":17,"integrity":"sha512-q2HDfxlM6Tp2GqRh3ztMuVwgCC095Y49e60I1wAUtAvee+mEqn+LjjVYY6on8/pnG4GgRuUXnm0FLFoD3aoqHw==","signatures":[{"sig":"MEUCIQCKHm3l1IfGNWXLWGySlduxucaeEK4jOByA/4kk14CaLwIgcu5b/irOWAF/8uhfRtFGUTgjjcxwf/oHvL6iMOAIF1A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68203,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQA4vACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoRvRAAlzqpGnG5sfd9X/Do9UWlyCHwJZqP4vpuP/Xj3rj4x8Sb8UNF\r\nBagNqQjxWAXjNSg5EACD9ERKKEBwL12Jfgk8VQ3RvfMvvG4rPnnEZKAcv7sk\r\nYpZIA7WxabumNW2StGg6elDOxnnozfs5H/biDaBd+GhY47woI0841rkqrg6n\r\nt4NKj2G+diR89bSwU3IoqVJjVNJ5CAwOXuTyq527aMnLvpZdpm8baVGnj26I\r\npWXgkUQJtLJ2/uNMVRTYd8ADAbsazqGNx5/S8rsJD6oyIOszZD4kE7wEk2po\r\nyMFuoozivowqJC1tq0C8MpPCYoXEpxQNzqMKwdRCi1MjCSv6Caf3GoLVsJVk\r\n5OGF4hw1uVIqkoAFz6Y+E7PoQ5wIXZWijhQkpQLwVSMb5cNRt2JieoWIrG+g\r\nWuaZvClgZMX37jaPZXA5rutLxmo/cNTCNs0ETZSAqSB27nzn05PLlP1SX4TC\r\nplT3o/U9x4IORnYj5rjx49Ydmpcf9tU1d7LbjVQxQSrYa+plaBLai5YmIt2n\r\n+Ai7Fm3ow9jp0cqG+10Jah39ypOhPpsTXHsDKVhlagetIrZ6d40UAR7ROuu8\r\nn7FolL2WUwzSgWUly4ioN6jqi0eoI5nLS0aVHDBGrvw46jJV7OfSEkAqJSZQ\r\n9OiH12qguR04qzUtCBy4uLgkKhki26UoDZU=\r\n=LhTt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-195da95065286cf9f7193f846d4383ee5cfdfb12-18.x/balena-jellyfish-metrics-2.0.225.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-195da95065286cf9f7193f846d4383ee5cfdfb12-18.x/balena-jellyfish-metrics-2.0.225.tgz","_integrity":"sha512-q2HDfxlM6Tp2GqRh3ztMuVwgCC095Y49e60I1wAUtAvee+mEqn+LjjVYY6on8/pnG4GgRuUXnm0FLFoD3aoqHw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-07T11:30:28.241Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.105","@balena/jellyfish-environment":"^14.3.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.4","@types/jest":"^29.1.1","@types/node":"^16.11.63","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.225-renovate-balena-jellyfish-environment-14-x-195da95065286cf9f7193f846d4383ee5cfdfb12_1665142319484_0.14364269895299087","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.225":{"name":"@balena/jellyfish-metrics","version":"2.0.225","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.225","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3f0db8396b7e801b52fe93ce67187b2838ca54d8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.225.tgz","fileCount":15,"integrity":"sha512-kbVbEqvulyQkTjZ4u+tuTPO0mwXKnBbLk6ySg9FHYkjBhDD2cGGqSBhzE9xE29Fe5hqDKQc9DA/8bhq/WfXOGA==","signatures":[{"sig":"MEUCIG1o3iwwEumC/fCkNMt7hQeMXGlDbj2lYx1eZvdjcUxtAiEAxGu2o2js6gS1UTFcfE4MSccFpEvzYTb1lenAyONkS9I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68119,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQA6vACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrchw//YL3RhhN12Y/oHGmWLH8JE4RTDunZJPG4DJZ5ELJRNWtllbSK\r\n9gF2rjK9+hR3pSUOpRYS2LKTM2M5HzO6lE6CMen0T6/C7vGF+tWBi3QyQZmM\r\nOLYl19cNdToSwTDBx82i8Y8ntBk1PNEnd1H9r8VCekhezVra2ExtJplVTbJx\r\nPQAK51SHqUL3ViVixRozk/cL+4PY814uM/aI+GkYhhSoXTm0sYPUVw1Gtp32\r\nFxC9fguUqVp5p3coJiG0HCjS8HTItUmsquYrUPFedTDmLQeuGyLaVsBcU+VZ\r\nDpmsC+8DMrO6y7GH3CvejVE3xI3kMNye4D3p0SnXqS19LhmibYbSYNjVd5Qs\r\nXSFkvl0Oq6kEt4Y5zjUJde5D1R4Id3Nk9tB+b9b18mGPNhCFyH89sJypMH3A\r\nLu8g9ww96ZYc/4ZGwT/MVnIZqnfPgvjmO/4Apj9UBUHYdPQavXW9CnpzuHF3\r\nlazRmHTEc6VP48iu/xwCcJcvP4Tv/Whm2dT0pGYa1YmYNptjudrbIpCYVlHC\r\nx5c1r1K6zWhbxlUXo9wV/Z3ndz9h6QAOOYDhcPznb+EdYM69iWXtfCwQXGX4\r\nJXyfvDFiYc0uuylArVcQDH0O1zKw2l/wIVjyFpomyngl6GClVM8DXLs/cBKo\r\n1u7KWDFsSjntMfWvW11CMHNv5N5w79Gzeuk=\r\n=J3JQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-195da95065286cf9f7193f846d4383ee5cfdfb12-18.x/balena-jellyfish-metrics-2.0.225.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-195da95065286cf9f7193f846d4383ee5cfdfb12-18.x/balena-jellyfish-metrics-2.0.225.tgz","_integrity":"sha512-kbVbEqvulyQkTjZ4u+tuTPO0mwXKnBbLk6ySg9FHYkjBhDD2cGGqSBhzE9xE29Fe5hqDKQc9DA/8bhq/WfXOGA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-07T11:30:28.241Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.105","@balena/jellyfish-environment":"^14.3.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.4","@types/jest":"^29.1.1","@types/node":"^16.11.63","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.225_1665142447199_0.8788334245862763","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.226-renovate-jest-monorepo-945cc72154c4bb3de8d2c32d15d286c9a6ee7fbe":{"name":"@balena/jellyfish-metrics","version":"2.0.226-renovate-jest-monorepo-945cc72154c4bb3de8d2c32d15d286c9a6ee7fbe","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.226-renovate-jest-monorepo-945cc72154c4bb3de8d2c32d15d286c9a6ee7fbe","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f1ba8ba2912948ac070015629ae3ee6509df5d9d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.226-renovate-jest-monorepo-945cc72154c4bb3de8d2c32d15d286c9a6ee7fbe.tgz","fileCount":17,"integrity":"sha512-fndoTNdK/ynFdcFgxLudaJ4pYmy0wpDcuxi8LEK35brjg/bxwamgQJcezRXVZ+0ZaxmfuHWO0KSkuwIVkPBF8Q==","signatures":[{"sig":"MEUCIQD18CWbKyDBgozlEldBmas87C/8Qw35iQ4eZzsTb9C0NwIgKimIyjKL4+ulBtwcQq15f8JZhgCK9+EC7pMJRxKAAcU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68183,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQNEVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrM8A/+O5SEGQ3TKS4AbinQaV+ZwJGr31JiDj3XTELys8PyC5jBq10V\r\nvlfQ14x2wVyXGHsIwziwy9ViczAyztEGY38CTuFFpuK+WLcDVg/qgXJdvK75\r\nAGn6TW3QQfRmeLiEf+UYHleBFy+Z98fAdvzEkn2H4p4U1njJUxBaRTd3Up1J\r\neKsSKKqeH5lpDK60GAjzqSVqlTO6YEcvTTfhlFTeus6teZo2mxDZk9fLfdyd\r\nFEY6iYqIgupaGJRBjaRv1RFa2eXf8W7hRiL78HaD0OQ1v2ZaU0UZCr7i1AVI\r\nbWb73t5qfRGSUHbkS2eB3jlMIotNCHf2pZMtbo16wF4ATzqFGlCJXK8c1kdl\r\ne/kt7NJjdtqNPIA4zjLPqAqd72m3Oa9XFKzTSfazTWiGY8emsxhHUWCOpCzs\r\nj2yEMVAMDFua+/xkyfasxiXMypN4c1G9Wa7VEtwuiEyXtnCvVYjrfITOFwmo\r\nXP/m0ef97ENnD8z0+9kvcvNzUR+mqwW9ScyB3jkO5fE55e6Y6T0RXDKc04MH\r\nqAHgC/Hmf+QyYRTspiYjLkfwfP6uB4WgNCB5F8ZcO29cej00MLZtZMa5y9/C\r\nHYtmOlpYiicwmiH/ZbcEicyUfYKZX7d2XS99t3EVYvQpxt7uqT5J1SMqIMPs\r\nFoxDEsoJK9zER7hV60JVfbrRLI0YHfGCMz0=\r\n=XwxI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-945cc72154c4bb3de8d2c32d15d286c9a6ee7fbe-18.x/balena-jellyfish-metrics-2.0.226.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-945cc72154c4bb3de8d2c32d15d286c9a6ee7fbe-18.x/balena-jellyfish-metrics-2.0.226.tgz","_integrity":"sha512-fndoTNdK/ynFdcFgxLudaJ4pYmy0wpDcuxi8LEK35brjg/bxwamgQJcezRXVZ+0ZaxmfuHWO0KSkuwIVkPBF8Q==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-08T01:21:59.088Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.105","@balena/jellyfish-environment":"^14.3.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.63","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.226-renovate-jest-monorepo-945cc72154c4bb3de8d2c32d15d286c9a6ee7fbe_1665192212988_0.03225459576814926","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.226":{"name":"@balena/jellyfish-metrics","version":"2.0.226","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.226","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"22a518c035d1fbd83523eb0a2540c95dbfd460f2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.226.tgz","fileCount":15,"integrity":"sha512-RLh0B6etbB1p9Cv68vS9cBYlNofzv/0dRNTey6MwJD7LZ4sym+xIhmMNIvfWMBkE2WLsvwGmQ7R9otWJ04Mthw==","signatures":[{"sig":"MEQCIFYiX2CK4rkWzPFTWr/mwE2fSJ67jbeOAR9tt3PPHkhoAiB5QnAS1c3PgDNbhxW6MYYJ+pT4F9hs7oZAP4TITGwkKg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68119,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQNGYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpQWBAAmgprMaDUOHQxFUB6sptFEwj5B2fRwMRt7Y90AUZUApbqdO1w\r\nUTpdCv1D0kYFMr9qDWMrhN2eRKWM6MCZCJqYntmKo8wfGJlSUyd+3snImay2\r\n9zzkYi/oXP6a+l0+XTJm+PfJxQqrkL64cFh03ghrCdrh1r7Mtd8CWKbfBoxZ\r\npOvK7U7tOpInRkSWfyx4U4OdmrqRl17O7uACdaQLy4earPbP6UrqDNoRTWyY\r\nH8Pn+6qlmLjozyuerSzCeYzSSlsSFvEStzrKu2FqNKikzdg8HU870qvQEu1t\r\nFoHvRI5YPOc8pGAULzb/0km9uFkFIqnxh8JnAzqvtjVT5PBYPdV1Lq+jz3Mf\r\nkGXsmER02Xokqji9F8bB7n/mJWfazq3yTWvcp/GYvTgriwa9mf64ou7kOGX/\r\nNCzNlKAZ1wmBJUhzAO5daAVLla3y5rFNpByU0qr9UU/3cCqPKbCfV7NcRmlw\r\nMD8nyugpxJ0FT9jfvxghQkD3TqASTw9b0VQkzF9UoVLjjNJ70f3QSA/WIGW7\r\nJcq/eCVRpcMihhnB1jgC4T+bj38GVfsRiTLnCoa0mOWBL7XcRS+iyCHyTM6z\r\nnKkPg4oLnMuYp/zfWrUUCi7H97Wme1nMaTKsEkZ+zDg6iH/tWYRFR5RQzwTV\r\nfvlV+3u95Furh2q4+uN1DzRC0OjTdZ1aBWg=\r\n=9ptP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-945cc72154c4bb3de8d2c32d15d286c9a6ee7fbe-18.x/balena-jellyfish-metrics-2.0.226.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-945cc72154c4bb3de8d2c32d15d286c9a6ee7fbe-18.x/balena-jellyfish-metrics-2.0.226.tgz","_integrity":"sha512-RLh0B6etbB1p9Cv68vS9cBYlNofzv/0dRNTey6MwJD7LZ4sym+xIhmMNIvfWMBkE2WLsvwGmQ7R9otWJ04Mthw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-08T01:21:59.088Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.105","@balena/jellyfish-environment":"^14.3.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.63","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.226_1665192343758_0.11171376825284973","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.227-renovate-node-16-x-032a1ac181c5a1bd8f5658cb34e9357ac079c523":{"name":"@balena/jellyfish-metrics","version":"2.0.227-renovate-node-16-x-032a1ac181c5a1bd8f5658cb34e9357ac079c523","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.227-renovate-node-16-x-032a1ac181c5a1bd8f5658cb34e9357ac079c523","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"490d2b2dea16ce6834990d3cc3c543ad44ea2d3a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.227-renovate-node-16-x-032a1ac181c5a1bd8f5658cb34e9357ac079c523.tgz","fileCount":17,"integrity":"sha512-lbWhQKnwCwyNo624Z8wcL5+IjJ/8EWn9CJH5gSeZt/aW2GE6vog2iHm5ttRGTlYYGwik08VyY9tZzpR35zLL5w==","signatures":[{"sig":"MEQCICGXKMwuO6lweqo+0s9Lx1eYYlARgh2csCVBnBSjG9QQAiBjbbjrq4QKG9tFXTSbXrWCa4NVJs7xWQfdjfPpEROCrA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68179,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQNJLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrMdA//WgHmpm6MmrY5wE6zn0ZZBU+hMqVOzTbuH2Wo6DVpn658QGf0\r\njd83zyvEKr2RtkB/P3ryEg3ETbgVuUCtPO/lkOh4jwh87R1l7xwXZBls8YtA\r\nuobPc8ZBbquvDdRxbv4Mk2ZrUzJV9UnRy/X/yCHi2Cng9oCAVyzu5KW4hW6b\r\nYVqRMHk/Fr8U3xYajdtHB5aHYOaxNqX4lEMUejAA9YOapx+C6OrSUmzI/ls5\r\nOAJhuHePcxuesH84Hj4zJyOazTjOp07eyVfilmSPad7YykymRdBsINw9ys/0\r\niVZHnzgtKCalv2R3LTmE5KnWHPYDemUuWlPCWja5G1otMb8Yo5IjwcWAWKqm\r\nF1SslMRWcpA0hZsBNV8A2N538Ot94NGuO3HL/NUN3uiQtXJ2dPTHN/0Cry0R\r\ncpXC9mnO2LPxIsQWjrIy0C8k0j98Sp/U4GJKY+nDu3xscDbxVPVegOCCjKmC\r\niJZ7BMLvr0zMqNBrz6haHQXJWaDwKx0C2rUhOM6I0SbrkN1e1n8a/3nDoKVj\r\nV/wMcO7DiZQNXZlAxafja8g/rvwTtRSeD7kY+m0TQQdeZbaigNCgXP0CCUnS\r\nbKp2Iuv+gH6hCgVbTQurt31Clqy+ae+IpiNR5WoKaX/WP8U3EnKZvxt4VwiU\r\nlET/SeL1+FRJ6BBeaftXSaFC5/s7S3ZtJVM=\r\n=CXmo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-032a1ac181c5a1bd8f5658cb34e9357ac079c523-18.x/balena-jellyfish-metrics-2.0.227.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-032a1ac181c5a1bd8f5658cb34e9357ac079c523-18.x/balena-jellyfish-metrics-2.0.227.tgz","_integrity":"sha512-lbWhQKnwCwyNo624Z8wcL5+IjJ/8EWn9CJH5gSeZt/aW2GE6vog2iHm5ttRGTlYYGwik08VyY9tZzpR35zLL5w==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-08T01:27:14.540Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.105","@balena/jellyfish-environment":"^14.3.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.64","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.227-renovate-node-16-x-032a1ac181c5a1bd8f5658cb34e9357ac079c523_1665192523213_0.9323343266728086","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.227":{"name":"@balena/jellyfish-metrics","version":"2.0.227","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.227","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"55894abfab2603e37cf151bf5412a4c9e330bccd","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.227.tgz","fileCount":15,"integrity":"sha512-XDORFZAaa0U+pt/Di5gr/wnLRnpdQaLThyoWRFyFLdqOaMO2GDNB61g1IbRDa9R1+4ZEMYemivFI+2eM5nrv8w==","signatures":[{"sig":"MEUCIDC/HFdZhkk8nx7TsXn4sW74x/UrbbnUK+3Hsfs78if1AiEAxyQmEQK6dOD3hgJgq/xrhYzMJvi6F4DDliKg4aei7YQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68119,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQNLSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqJcQ/+OjTTyz6cWxXhmM5G9XQe5wbNT+LXrmZS8By4QUKmfw4rksE7\r\nyWLDzYLWcD1YJIcnFfJKxxZP46v7POL/fl3hjV0ebl/SE8QFN0BDn2H6wUUW\r\nTtB8OBOz0pjYAbWDsKVopTMyyw1bUnIIMGXxmRtdQYcQL5AFUJ4O5uExiMWP\r\nAU9PL6BEUehPXQbWzdhaZkNIFZwsfWxMKdFd2ciTH+jWC5au/B0fQUQ/tBaV\r\n72FiGwINUqOgnnJlGNGXbLJwT/euWqfn5tvujLyus4Qjc/nutx4+6AJYWIy0\r\neqkezetdZh8C+5//O/74hqeSp/J9jxNH+BoEjFiCi/x99Uxqi3EwZ2XVL0dq\r\nCwjMGQmcbwyVMIaB0Ws0Vzd5H4Shr8P0DEQavzT0d2e8Qc+JscpZyGMdO+xL\r\n7y4nrX6+bjokSBYigD0sBKPuC0zC/Euhu4vs68E+/P7LAF0tvIvOqn8k+B/l\r\n1MHwPX9TJqZnsixMukVRKKTU8+z0bqfebP4Y58TxMoEHx4tkfkmPii7QHkuE\r\nfSoIdrxYGb15wnlohtD7Neq3k+eebvDS+Y2IQIh8BVXTkYKh6vXh3kHa9/xu\r\n8b616UCkuMyEpQ5gYWrWbEA+2yERlFIwbMc+Y2TXyJS9b3O0VMPiaHIOuX4V\r\nh7xdvO6XW8CDOIMWSt9ntIYLMo8RnIEFnvs=\r\n=+BSI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-032a1ac181c5a1bd8f5658cb34e9357ac079c523-18.x/balena-jellyfish-metrics-2.0.227.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-032a1ac181c5a1bd8f5658cb34e9357ac079c523-18.x/balena-jellyfish-metrics-2.0.227.tgz","_integrity":"sha512-XDORFZAaa0U+pt/Di5gr/wnLRnpdQaLThyoWRFyFLdqOaMO2GDNB61g1IbRDa9R1+4ZEMYemivFI+2eM5nrv8w==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-08T01:27:14.540Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.105","@balena/jellyfish-environment":"^14.3.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.64","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.227_1665192657845_0.3225995059027693","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.228-renovate-balena-jellyfish-environment-14-x-440649d75bd2e6c570c5c8df67645b2afc002362":{"name":"@balena/jellyfish-metrics","version":"2.0.228-renovate-balena-jellyfish-environment-14-x-440649d75bd2e6c570c5c8df67645b2afc002362","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.228-renovate-balena-jellyfish-environment-14-x-440649d75bd2e6c570c5c8df67645b2afc002362","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"126671c2dfc7e07cd2edb854bb8ed9277acde459","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.228-renovate-balena-jellyfish-environment-14-x-440649d75bd2e6c570c5c8df67645b2afc002362.tgz","fileCount":17,"integrity":"sha512-ysskHR08Fnkbc2MuuS9W9A6+bBNpl6RWagsEyDVHb6mbbVYdnaOi6Hd1f0Lvl44Mv6yaA4bcj4EIQf5TMy/9pg==","signatures":[{"sig":"MEYCIQCFalDGj6h0Fj09d9rzwewEN9jgDiNgwvKyqbybAtXhmgIhANYgvfCYzRV34n1GXIW+Cid3ZuKTKcsMjEPandxYrzUq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68203,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQQCQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqcKBAAnJ9I7dGeVFrKVfzpHlzk9bBlI1NdB/iuG3o+yWi2bCca8icy\r\nGkIwygBrHONS+2kvPedEpYf7gSeDYE8CEzX3Z8tgS7KGbADMBvplbKasBC3V\r\nlM1UKVcaC2Zl0Tlvv6UO5mJROqYYc7aVJbeoVa6De6pe3TaezY42/U2rPdYj\r\njjix2dEcec3XIk/AaM8EhzFcdUSIU8ywPM+y9v3il1xAoPWmhcnpFNBoychH\r\nX+INozNPwvTxMbyOgp1b4Plll1vtXixdx9tp524Jew4D2WU94c9vLqv9cv3F\r\nzp6/6ffaoWVi59DH4FnLTwCmNYYN6RVYARFcBtD7aetGbI9DK9gZ6sy22CW6\r\nGMOTWk1r9Im13dKSdCcqzG85p6PYkUvtqL7/ujBNmCeK1ZLL/Ni+lFXzMf3e\r\nMTk4b+soCGAV46e2wFTUyvcvyViyySRbZTNPt8Ff+yefpcR81RxjVS1IzYXo\r\ne7VUU+lASpBwHcV1h4hsy/POzHSsAKSbSK90diow03G8hE616iwdPW4AjL1L\r\nqojSJza5bZO9DiBOjY33k3f8RihgRQbhGReIiI7eVkHwtAMVyrqE8cymwEka\r\ntvUx6URMS25pyKRhIOXFV7PX2gjDYYeUV4f5+9+4EHvSoYK4VXwiQNfe20yA\r\nRMgt2ituQamnOGH/6NDseczG4NPH4b8Q9dQ=\r\n=ptzT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-440649d75bd2e6c570c5c8df67645b2afc002362-18.x/balena-jellyfish-metrics-2.0.228.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-440649d75bd2e6c570c5c8df67645b2afc002362-18.x/balena-jellyfish-metrics-2.0.228.tgz","_integrity":"sha512-ysskHR08Fnkbc2MuuS9W9A6+bBNpl6RWagsEyDVHb6mbbVYdnaOi6Hd1f0Lvl44Mv6yaA4bcj4EIQf5TMy/9pg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-08T04:44:34.914Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.105","@balena/jellyfish-environment":"^14.3.7","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.64","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.228-renovate-balena-jellyfish-environment-14-x-440649d75bd2e6c570c5c8df67645b2afc002362_1665204367833_0.30284164577170647","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.228":{"name":"@balena/jellyfish-metrics","version":"2.0.228","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.228","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cc9a6e89bdf67bceccb5854d5e7685e52c41d0a4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.228.tgz","fileCount":15,"integrity":"sha512-3QZFtrKY9jJlOFxXlZIVoMGVWCJBARgOXhDcfQZhnHSB9CohZUyENn1aHx/xnnQPgYG/XDNWinJ8ge4XtirCYw==","signatures":[{"sig":"MEUCIQD4eq07/ON4/0z61dXdhAEyAbLPgzN0VRRqGm7X5nRkQAIgDbWMQg89xwrR9ZwXlqCsfm4bUcWA+GPrKdVsTCxtJwc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68119,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQQEpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoW7w//Ziqmig+PmvLjUFdoACIWWZ0HJGIRYGVSFJQ47w1KpF3b3dAn\r\nuZFlPeDkv1MWTkzLVYtqgEje26tD2AM+TtbjQjj8t3WgbNhCRw6Zg3VRZO0Y\r\n9EBTC/4HkCrz9x9054Wq8erfE2cExFX1k4GgLrh6G+lBdVwSt8yihMrIfTkS\r\nd1LGU8K3unSuQL6dAQJp576OoRssj+YOCYZyIFOOMYNKI5GGabq5hMeDTAjM\r\noayv4l6G/6AQ0RZBBBut03C1lsGEEJ9mxfaQvPiTl9/L6eMtrvSagpFU9koC\r\n/yhDMp8aCZL/DjcILWPi2H0bM+f7fA6C0ard/x9KmeRK0a8lGxDSBtVk80mc\r\nvdJEyfkgZqJheGsiBA/YNeBJt6aWVsr68mY91zC4YzbEH3fG/9zTxwYI+9eV\r\n0Y1NJwMNHGFp0LKi7cm+rRe82UHKku+2M7oBqOdowV8NcERZtyF3WM5qcoSo\r\n+Fc8wnVH37FnAcazIbqPWAe6A33Z7HNFVcZehGojQb/h7RQbcVZnTP8CS9lF\r\nv58n3gNjE6TBVrmMgl/I9b15Oa76pLFzQphY67lvzMrMyHvBpDRvboTCvSPO\r\nHXstDCAlxVpuHhACDvtAttoco7/rpVo2+bR9LO1X/SdY7comDnY1kk2RyUXG\r\niBBtQHabBuVfgRQKh20SbgvGHUK2BHfoOeA=\r\n=JHVW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-440649d75bd2e6c570c5c8df67645b2afc002362-18.x/balena-jellyfish-metrics-2.0.228.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-440649d75bd2e6c570c5c8df67645b2afc002362-18.x/balena-jellyfish-metrics-2.0.228.tgz","_integrity":"sha512-3QZFtrKY9jJlOFxXlZIVoMGVWCJBARgOXhDcfQZhnHSB9CohZUyENn1aHx/xnnQPgYG/XDNWinJ8ge4XtirCYw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-08T04:44:34.914Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.105","@balena/jellyfish-environment":"^14.3.7","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.64","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.228_1665204521674_0.8133375330996029","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.229-renovate-balena-jellyfish-environment-14-x-ef04ca2f3b60c56ec7a3a23017dfd272adf40686":{"name":"@balena/jellyfish-metrics","version":"2.0.229-renovate-balena-jellyfish-environment-14-x-ef04ca2f3b60c56ec7a3a23017dfd272adf40686","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.229-renovate-balena-jellyfish-environment-14-x-ef04ca2f3b60c56ec7a3a23017dfd272adf40686","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"20837283da092e9240d4fa87263ca52eefcce7a4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.229-renovate-balena-jellyfish-environment-14-x-ef04ca2f3b60c56ec7a3a23017dfd272adf40686.tgz","fileCount":17,"integrity":"sha512-/ico7Y0NiDMyJ/j0QTYzYPs5BLTz9V+TI3Bg5/nGBJjuBvshbzA0tUbyA8mDEi5udGZ2ZjVQIfwLPg9TdRjeHw==","signatures":[{"sig":"MEYCIQC/mvv+Ov/I50FH4l6jzRuFUgAF4mgWkGA+/lvgCEfNEQIhAIyGGLvas6CHFQcgMusx7a1/wOAY58FcPwJ/VSAFOXBQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68203,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQRtsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoLIg/+MAXc0wsmp642MKSzDE5rHVuHHNW84hyIpDI+GIWG1ib8IVeg\r\nc77U8u/v87nKF4mjM0Hu6VGCKpweyHTp9l+3ZUKXr2CiBCFBhZCUOcNLrou0\r\nNJWKPFaOLekNFzwAhBz6KhjMK0NT5S/Zn8fcpBPw2hhTtfUIz4ztcsCTHVui\r\nW/kz8pgbFzdE6qPrUWVQoV8pFuK8avqm41/cVHXugZoA9ECNeP/SJ7J3q5Lc\r\n9eavJ6w9YzH+gfmV3lexsqGGEUQViSgiBu5Qwk9v3J1VhAt0EVAgskn0lgEk\r\ngRfKrnX40wCSVTDUgMPVuVx9o++Wu8Rj+gLvofr2KPaPx5E8A+TMnCp7ly8z\r\nsQ7ba85OexU1ZTvphc1pUv/YZuVFeHRGPQENBgyFSAyNaekANVipiPwXnUFA\r\npur4uLIsTaNVH5EihwBIf/5pQL4Clq85QgO1swMUkfGVRQ1iyHDDhTQPeRhW\r\naRNRQxhp6ExN1naWCDGShlgp+WCViSBu0PjQyaAjkj3S/kNFZmb2TjQ3tCF6\r\nyYOzeoZA+exjG2DEKMrBiSFvpSnZed+oybTJxbRZo2/pyjQG+jR+P1KwUnv5\r\n/vG2laRHw8JGHgqCBcuKvH78o8kDoM9R+L7tLcEfqBQb0RMyCzL2DBEeqFKK\r\nABHEqJDrIWgjGS/NLVxHqvUO82Y77tgx2yY=\r\n=InZu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-ef04ca2f3b60c56ec7a3a23017dfd272adf40686-18.x/balena-jellyfish-metrics-2.0.229.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-ef04ca2f3b60c56ec7a3a23017dfd272adf40686-18.x/balena-jellyfish-metrics-2.0.229.tgz","_integrity":"sha512-/ico7Y0NiDMyJ/j0QTYzYPs5BLTz9V+TI3Bg5/nGBJjuBvshbzA0tUbyA8mDEi5udGZ2ZjVQIfwLPg9TdRjeHw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-08T06:39:15.323Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.105","@balena/jellyfish-environment":"^14.3.8","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.64","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.229-renovate-balena-jellyfish-environment-14-x-ef04ca2f3b60c56ec7a3a23017dfd272adf40686_1665211244488_0.26495802709756","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.229":{"name":"@balena/jellyfish-metrics","version":"2.0.229","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.229","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1ec1b180c00918bd7d7b61cf9bc600d6e223fb48","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.229.tgz","fileCount":15,"integrity":"sha512-N9LNr6b/3Jr/9kAOUh1MKzYwlfFMbvZEWH+6lLC++n8YdowKMHFsX8MoovINuUNaoqdFP2qPG+5pV7KnKoiKdw==","signatures":[{"sig":"MEYCIQCqAcUf34KCPuAK1mgfbbxLcTLUMOovaP5Un8FvnX9KOQIhAJiDVQ1649wc/kPRmEO8LFCeGk2mPRky1t06zHr2n8X1","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68119,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQRvuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqKbQ/+Mh4csEzsZLYa+XGxvkqVzd3ZiVFcPeXIDRoWHY5CfoCCv4nD\r\nQHXXmOgxcb96yL4U+NpwN39OXK8jHoymddFawFNK6Kd3QS4cUGo5aIGxwNf0\r\nKtL4wvW2igybfej1hwwvzEf8Yc8QvvUTEJMdPP6eSDU4Vkp8UneudnWTWY9C\r\niWeHzgdXTzEhQ/4+AOEW/uBC7fwek83zxMilkVa8audsa5BBsTWMRc9nUKTA\r\nk5r+qhIgabaO59ppw9K5r2Fvg79sbAttJOUwq3te7IXKxgd+RyqVixeUDY2B\r\nwDJrNtFJEA3ZX3xdGpceR9LYu5b1IWtcly92NiP3aFDU/GIfIVGU/UIcfIAP\r\nQNF+i5nl7yx3mjIEeyPBtXAbN1iXLOT/Ji4PiTU54Ta6pq7ppn8orQisJJpy\r\nkkKvwQl+NjxCbA6kMVnagILVaM+oB9vOkQFpdY+VTI/iwcnQJa+Xv/fWzuNW\r\nydcvNb/+Rq2g5DQnHehb9AHIimmRw+cCorp2TF7ZUbC2h+dwJGV6ugTI4f70\r\nhsoFpJTlLqSDx5FhaX9PdR2fs5aEZhcYCpcHHcejHOWDiyXjLTmV+4cnb4Ma\r\nl1zwyyqO4Hs/JeY8/ylc2tdPoXX4WdaScoZYSi7JXZqoQTzOiqduQbqUo9kO\r\ntkP6j2p4yfAHCgd5/kxbAYSx9EyPO5bRBzM=\r\n=GP9v\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-ef04ca2f3b60c56ec7a3a23017dfd272adf40686-18.x/balena-jellyfish-metrics-2.0.229.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-ef04ca2f3b60c56ec7a3a23017dfd272adf40686-18.x/balena-jellyfish-metrics-2.0.229.tgz","_integrity":"sha512-N9LNr6b/3Jr/9kAOUh1MKzYwlfFMbvZEWH+6lLC++n8YdowKMHFsX8MoovINuUNaoqdFP2qPG+5pV7KnKoiKdw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-08T06:39:15.323Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.105","@balena/jellyfish-environment":"^14.3.8","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.64","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.229_1665211374356_0.17619784765809188","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.230-joshbwlng-prettier-1ba4e23a1ffdbec8f10a056904d2f48cd56f64f1":{"name":"@balena/jellyfish-metrics","version":"2.0.230-joshbwlng-prettier-1ba4e23a1ffdbec8f10a056904d2f48cd56f64f1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.230-joshbwlng-prettier-1ba4e23a1ffdbec8f10a056904d2f48cd56f64f1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"361f1220d761c40aec13b39573e2b86aa47ca2f9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.230-joshbwlng-prettier-1ba4e23a1ffdbec8f10a056904d2f48cd56f64f1.tgz","fileCount":17,"integrity":"sha512-oSl4jc7/rqaYjuGKfNxygJq70X74oLC75zFKGNdKuRwt7hjhbdnZGeX3Krh0m58i+ijMlTsmWJr8IKqvpqVxNQ==","signatures":[{"sig":"MEYCIQCLTXTEVQ71zLLt9mR4SoUtHPDjKqWM3cWHsaxaq1eQvQIhAJrxSaxonALiuQOA30rXvPuotYPqi4EZlW5Ypyyo9Ixl","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68327,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQXV0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqWhQ//eMlh76Eanl0EJSHu3nKZlEOmCHh/Vvsn2UGHIsEgDFVSXoqD\r\nfrqmGQpA4JDV+ykGrp0KOAz6h6lQSl62js1OPLJpB1k/lORzE4ChfCQEAUwV\r\niOxDEaiKTAw2blT1i/PC0z31pWoD+W9yJC2DBgp8v9ElSj5z/t2YqIqv6SGo\r\n/1QoNwzhXABpBIb4DYBaMMBy11F6+4OCF/ozu/KJv1BqCV1N4IiXXyGhSmDe\r\nPUg6Kxr8IH1vMzIUldzgaCdBOqdfuAfNsb449LO+xAJx+unViwqP8YS5Fv5f\r\n4PkuCWKJqYkrBOipC22soP8zxG7MfpgNq/j2fpgeBAoQfQ3i/Fzm2OcpFRD9\r\nDNl7JwEnsTxLFikr602vSW7hEu2G6LdaUNGI2nb2jZW22NKCTxhUyc+2A7X8\r\nxhAekJ1khv4WnL0Uc6XbaghYAgaR9GwSigOAHGsdoZaMULsJgYjPON/G+p1C\r\nDqOc9e4agi6mIeDlP6uJPrVCuCSa0aryY02A1F31oDLhTOersYtkHytmAvMi\r\nGvyf1i3HGqMYZpuoU+yX64SVYxzMN5stDHAB35UocsTvQKvK85WrfNc0/mO/\r\nqcT/y+JbZx5VZ94Fjv3UIezlRd4DchHRLIe7hXAGxlkfgHwnudVkAMT2R1/v\r\ngT1j4UChWxjpZ2PB3Rr+Zfa6lGoJl4+HDgs=\r\n=lUG7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-1ba4e23a1ffdbec8f10a056904d2f48cd56f64f1-18.x/balena-jellyfish-metrics-2.0.230.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-1ba4e23a1ffdbec8f10a056904d2f48cd56f64f1-18.x/balena-jellyfish-metrics-2.0.230.tgz","_integrity":"sha512-oSl4jc7/rqaYjuGKfNxygJq70X74oLC75zFKGNdKuRwt7hjhbdnZGeX3Krh0m58i+ijMlTsmWJr8IKqvpqVxNQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-08T13:03:21.112Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.105","@balena/jellyfish-environment":"^14.3.8","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.64","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.230-joshbwlng-prettier-1ba4e23a1ffdbec8f10a056904d2f48cd56f64f1_1665234291774_0.7132545361482499","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.230":{"name":"@balena/jellyfish-metrics","version":"2.0.230","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.230","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9c1692e4bb96f97f3834251cc8fd0f98ef5f8817","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.230.tgz","fileCount":15,"integrity":"sha512-k3EHbY5TwetB2B9boZgM/eWJvkQwJr4NdstlAATEWsFfB/HqCJdkXfyzTsrEQu4HEsHqGUkOANVm8rnT/5thYQ==","signatures":[{"sig":"MEUCIFRCFCJF9kY5DoLqlcBrPj0v+K2ODSiGVPYOdoLDM2bKAiEAsUMYgFQJmdcBcB8fHNuCBRr2SB0PsMvthJ5uI6IM1VU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68267,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQXY2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpI4hAAijoYUFzQh7cS1XHMZjMl4ry3HLAlo2PVIZm+SUdqkxWhE2yd\r\n323pc9lXwiEJ06OwFL5P6OdmbJrIjrwx2kcmVPS/GBkMhtPK6eGL/p8ghWiZ\r\nd7Kc7XYFjnVx7OM+QWmsZYNTLRw6SK/ThWsuAnW4BqQsjD95ATYqjtVWfx5d\r\nmS7FMKMfOPHDxmovmCThljiZfYUwo4Q+aRWNaJRRPOhnaSydJDUnzSjrTAFK\r\nImdrhXHmB5yqMJ3+RI2G+3AUpLhFcj076gqyfsmUF1UrhxN2h7oR4L9StmQQ\r\nnt8imyfkAfDqzd2uuoC7LF45zZMdut73sRD4857xGPtQvXIc2QdMpfoyxE+a\r\nwmCNFc79ahb4zN4JKrj2N1RU6wk56hNytxe7f6BsmxLhcZb0AuNCk4PAGBXq\r\nHjMRbwYkdLgEGomnaOGS20cdv8v9IiT5eEEc6tlTFMweoCfqMcgnaDIF1mht\r\ncz1s6I6719VADIIBMs8n0iros2+dONiegUltuTt2p5r/yKFD4hJb0MEhHbcU\r\nO3klc0MyXqWuTdcD/TuPA0Nl9Ji/fR1NiGe/MP+efGltR2Z+QJn563aQMxv8\r\nn9su7/B+HIviNjQXr8CiabOB4ckuamJz9Qim9D8dsAAjIrijoTI842Mur85b\r\n5qTBnFF3jhOZcE55cO/28oB/v347yY9Owkg=\r\n=PMeO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-1ba4e23a1ffdbec8f10a056904d2f48cd56f64f1-18.x/balena-jellyfish-metrics-2.0.230.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-1ba4e23a1ffdbec8f10a056904d2f48cd56f64f1-18.x/balena-jellyfish-metrics-2.0.230.tgz","_integrity":"sha512-k3EHbY5TwetB2B9boZgM/eWJvkQwJr4NdstlAATEWsFfB/HqCJdkXfyzTsrEQu4HEsHqGUkOANVm8rnT/5thYQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-08T13:03:21.112Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.105","@balena/jellyfish-environment":"^14.3.8","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.64","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.230_1665234486289_0.8181192168243261","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.231-renovate-balena-jellyfish-logger-5-x-0b6421c4157fff1f8149d180393e703217e5147d":{"name":"@balena/jellyfish-metrics","version":"2.0.231-renovate-balena-jellyfish-logger-5-x-0b6421c4157fff1f8149d180393e703217e5147d","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.231-renovate-balena-jellyfish-logger-5-x-0b6421c4157fff1f8149d180393e703217e5147d","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0e145c1a39543c5985825e6256edc1976aa1e9b2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.231-renovate-balena-jellyfish-logger-5-x-0b6421c4157fff1f8149d180393e703217e5147d.tgz","fileCount":17,"integrity":"sha512-Cpm6L4o4UcZniBk9+WYrd+NWgwJrLnU+6V/Wuntw2IKxQtc5adIvljIj+qwVgoZwjD2PzeZ1tU5h2yu9blApVg==","signatures":[{"sig":"MEYCIQC30GrwdEpn8lEeS/IClGH5eiTq1crTygBS4Yw5Q8WVAAIhAOZ0DsK2fPwVXGWF/abQ1T2a9jiejXrwXJNsNs7STVA9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68345,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQXa9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr8mxAAk7GR9CJ3Bs78mTNgU3uyiAHO0YMabFWpwR6zZBgd64IWVVHm\r\nGvOke9q3zgiFz0W5Fm0N75tartDJnc2GfgaIQMVwscR2sRIv2fFp7y/AoR3H\r\nvocg0o2/VTXv0nvkTqJhtqFmB8Jaz3dCGMAeEaXc94fyiCyEw+QMfVR2KtXu\r\nD+DzHZ1kEBRX5eOVLv+1PDo392wlggkpdTMl0MQrW2CuIDNHKbY4SWfpD4mi\r\neeppPbwXQXM7/QZ+Wj4jI6jCgCzgVXph2LgaGKdeJ6P0SbDU+DK3VpmTSrax\r\n9LJRTSOzFjWMM6SN41TCGuSPQ/VJuYrPNzdi9Yvaf9uPye6pz2xwa8qRhsqx\r\ndhMjByLmO/LwZw654L4klnUNhN/whqR6pOiBg0YHDyDbMwZkYyFYAIJTHnJu\r\nedGHQvvMCP3rCnyzTDrJf21Zpf7Y+3wc/H6j7RiWMsHxZqfsrjRlZoc4hBtd\r\nY8eoBuU3tIfIWQZsOUDl7UHDiYrbc/D0AYrllBPfsYbLKBLCQp41ZeL5+Mfu\r\nN2AtSafZemuEHHTsXFBwN8Xq/8WRbhLAjhpXR1dRc+av3Qm/UJM+zA8jmFqE\r\ntLvnqrc/p1FE5tPkX+0RXyx6sRpSWgYOr2KjRh853Vv2NAzqtUU+OoC0Qzhw\r\n82zPTEqJ5++smzELyTi0SpsTLSOR/ju/fh0=\r\n=5zgB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-0b6421c4157fff1f8149d180393e703217e5147d-18.x/balena-jellyfish-metrics-2.0.231.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-0b6421c4157fff1f8149d180393e703217e5147d-18.x/balena-jellyfish-metrics-2.0.231.tgz","_integrity":"sha512-Cpm6L4o4UcZniBk9+WYrd+NWgwJrLnU+6V/Wuntw2IKxQtc5adIvljIj+qwVgoZwjD2PzeZ1tU5h2yu9blApVg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-08T13:08:57.766Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.106","@balena/jellyfish-environment":"^14.3.8","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.64","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.231-renovate-balena-jellyfish-logger-5-x-0b6421c4157fff1f8149d180393e703217e5147d_1665234621136_0.6116898803450241","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.231":{"name":"@balena/jellyfish-metrics","version":"2.0.231","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.231","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3796085fe7fa614359de7f76320b7621b2616712","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.231.tgz","fileCount":15,"integrity":"sha512-eCLAy6i0ByfQrqPCOQyrqH0vuMEQ9qGDoINW2KKcaAj+x1ZEChn4dSqi6GVQC1JTEPv2PSp6xzi6bOkDuleI0A==","signatures":[{"sig":"MEUCIQD59t65pXKIF4c5Px9yuq4+DPMgF7XSsbEiV3m4zLUFLAIgeOk7h0hk5zryzigyhO8E8QTZN4YAsk8V6gu53rTCXuo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68267,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQXdKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoQDw//aXqW0PIv4Eop0Ug/QL3X/nJMcthYLQ7q2m4rq48xPO8uEJXZ\r\nerlaJbgf95TGToGclSwlRDJIT3RpqUx7BvXkJMpskBT8eyOs0k375PTelyiH\r\nuzg1TyCHQsEBovcV3+2cC4tCnVqgK+GjLNyc5s5gbXMzZL/ZdYLU2zvNw+2s\r\nvWGCsqE+pQfEsQyRd0ZRPGg9rvuOCvUlHVKYEzY8lC74/mSrfED8XRskhhI/\r\nt8tw951dwanv6SrWQaACRhHfq8J51GPSnhv/4VxzhYr/pKcm66KTU4SJvSKF\r\nmChxgs1tcO/Y9J+lDmmBl+VCK9Qu0yoRHqpdJffB2egJ9GqSpyRe1Z4AybtF\r\npbnS94/jwFbATMVkk3OZYozvzIIqTa/P3Pes7QbTJciPuN9xfaK6GVn9riSw\r\nXobTzyug8VYeWVAhL6vVSccDEcv8DXf32mH/cFodphFl7tQ9+TnCdLFnZt6L\r\nN6TPPQ1EbTq95G7MfB62CvZ+SY3Jm4WiZg3VxKQDnftW+yKHGJDSESsWYHFe\r\nu25+Diu8VL6EIz1bG/t7zSh9AABT7hHawyLHGef+4uV5ATDQbWdOIF7xf0hn\r\nWnjw1IuNsi3d7WfOgccNnkjcvgGU85x8lnR/iTgISrxglVQrCmC2bUHtiziF\r\nRUYF97N4uaagDHfogRbXSoGgVypXoDf4GBM=\r\n=RwhP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-0b6421c4157fff1f8149d180393e703217e5147d-18.x/balena-jellyfish-metrics-2.0.231.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-0b6421c4157fff1f8149d180393e703217e5147d-18.x/balena-jellyfish-metrics-2.0.231.tgz","_integrity":"sha512-eCLAy6i0ByfQrqPCOQyrqH0vuMEQ9qGDoINW2KKcaAj+x1ZEChn4dSqi6GVQC1JTEPv2PSp6xzi6bOkDuleI0A==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-08T13:08:57.766Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.106","@balena/jellyfish-environment":"^14.3.8","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.64","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.231_1665234762749_0.14727124452407625","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.232-renovate-balena-jellyfish-environment-14-x-bc695198479e99be73efc527156b4d520e8e816a":{"name":"@balena/jellyfish-metrics","version":"2.0.232-renovate-balena-jellyfish-environment-14-x-bc695198479e99be73efc527156b4d520e8e816a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.232-renovate-balena-jellyfish-environment-14-x-bc695198479e99be73efc527156b4d520e8e816a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2e9abfc2564ab5dcffa4562b49186f9cc0d975b0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.232-renovate-balena-jellyfish-environment-14-x-bc695198479e99be73efc527156b4d520e8e816a.tgz","fileCount":17,"integrity":"sha512-YOOHSifxcAsG2sLzC4RPoViujyARDrwRNnV6xmv6rPoq+I2psivIV0dWGpWOr85UaLiP7cyVn61GILT/SaxErw==","signatures":[{"sig":"MEYCIQDmjDapXlAb6XssqBxoCcZ5GVU9caap2DpNcR4SYMYnpQIhAMy/zGT3Cu6PDSIeGeGJ79/DLFMuTLlrOPHAn5pUe6ze","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68351,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQXfyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq1qg/+JyAmLkcl+Z3irUTqFL8HPabbtULSXIjAmdnCksW74dDaCIA+\r\njzaC9POn99Rl25nI6RTlVMEsu7GiN3pyrlehrT+3e51T5gX+BQUbvOVvIGoa\r\ng4P7bwUfewfe9m2pc32bqFZsiRw4M3577SDd+Ghhzaxp2J9sYbis8YFrHA3i\r\niyArC8LKHdHeEXdKWAirhl92JrvmL+8XqDSl3hNLDrdUD8E/oWSYSuWK9LDP\r\n+MiJgyiPLGO+K0v0usPC+p678pzupmE0StgV/lOzQWq00CB+dAUc03JdNKpX\r\nHMbOWGsOjJ6R1DVLeQ8J5dNyRgUR/Z6uriy2facBi6cEVF0ajFtVIT9IIeu0\r\nVuHsHObd2c1sV4w9VbEOO+6qq3/cEm1OwV9L6mwM/OuU7ayq6CQ4zA1mJz+j\r\nCoizjnCHEbAQTuUxMBEaFkf8G8h/SIpqIY7OOQ8+abZWel4QBm31Y/82uN/n\r\nSZc6Egi9Y7M6pMYq+XM78q4K57hZ6MbEcRShVnZrqHkBuYv0XS208HEhwwiW\r\nBFUyvVsbnd4jlfjZJaWlkH7p6fW0qixtLbDK4b3Tgdm1+bRpO+lwnLwRAGLX\r\nZr1IQjltawWXvC/w6lSRHU3KwalXA2TNAuvYlE3OubEZr7v0WglT/D/fISeA\r\nTbfYVnCGgjpAfpXRKToIyCPa8ixpHZ0y+uo=\r\n=OaQd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-bc695198479e99be73efc527156b4d520e8e816a-18.x/balena-jellyfish-metrics-2.0.232.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-bc695198479e99be73efc527156b4d520e8e816a-18.x/balena-jellyfish-metrics-2.0.232.tgz","_integrity":"sha512-YOOHSifxcAsG2sLzC4RPoViujyARDrwRNnV6xmv6rPoq+I2psivIV0dWGpWOr85UaLiP7cyVn61GILT/SaxErw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-08T13:14:02.882Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.106","@balena/jellyfish-environment":"^14.3.9","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.64","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.232-renovate-balena-jellyfish-environment-14-x-bc695198479e99be73efc527156b4d520e8e816a_1665234929837_0.21584565906201925","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.232":{"name":"@balena/jellyfish-metrics","version":"2.0.232","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.232","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"24e46bd6234c61c57cb37d7b8c0196b798a5b99d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.232.tgz","fileCount":15,"integrity":"sha512-l0xGrljPJpaFnAKKuNqzMslCQGpy7f+hma7X/kjlK42ILfTJh0YXf5jfhR43snmfquXIAbDOw4ykPbJWSVxOWg==","signatures":[{"sig":"MEUCIGJ0n2DCmOpXSiendNPeyVH4Kh3tRgBeV0OvepS5PWrwAiEA6Ki9+Wa6i170QCb0EPC7g+cqSz1eO49vgp4l2ZGJQ98=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68267,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQXhuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpD9Q//YgTWk9+OLbUQuUJ1y36Av0fehYU5tp9trhvbAKaY7HAxR1SI\r\nHsKMCSjjSHg43RVI88jZxrZQ03Fz/4T4xjA49UpqbHnJ50QlHrSDJ+Rl3dmS\r\nkhCLCtl0KgGe/xL/zPiCb3fQ8FQgKCem2m0gquVjw9WW1rXZBj9JmkGWj1Xf\r\nfdTNkwAe1lP5ZrXOUssvphTrUObDjI3ug5tGcRmqzYal5mfsBO5LSr4U8r3m\r\ny1xjRh5B0rNQQK+NdgLlMhNOGS9gfh1S230xISoe1bvzUA/j5FkS9H93ZAmL\r\n0+mLzD8d3ZGpkG8dJ5t11Var4dJNzGyEvU24hL8VfDEZFOX5IWssfNBBS0db\r\nu08z8XQZ2Ym8yvcfBJDyyvApdGiGwGzKi75xmlM+QOoTpFcz/KN1T7aHopU9\r\nwz2nSLc14VgsPlNKbGkBj1w+eqFFP+AsgF4jWtSOvyhgAZk9WNbtr0qb/vWt\r\nCPn33GSAkjg3zGY07v6PM0sebQ5svIkXm396gGkUwxV3dW8rLT478AAKqssm\r\n/MT18aIzqGKXK5i+pPYrB0yX0JN6RKTdLHeYYghn+841cqgd24JwEaYuMX6w\r\nI0PqOUfF27f4xyqIO0NnAopmZVy3XjgVU8qyy1zdcDd7WEnt7/EMH2nDOzXn\r\nzjjrxU298mU/NKf8tvyrOaPaxP2UgsqopUM=\r\n=ottM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-bc695198479e99be73efc527156b4d520e8e816a-18.x/balena-jellyfish-metrics-2.0.232.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-bc695198479e99be73efc527156b4d520e8e816a-18.x/balena-jellyfish-metrics-2.0.232.tgz","_integrity":"sha512-l0xGrljPJpaFnAKKuNqzMslCQGpy7f+hma7X/kjlK42ILfTJh0YXf5jfhR43snmfquXIAbDOw4ykPbJWSVxOWg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-08T13:14:02.882Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.{ts,tsx}":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.106","@balena/jellyfish-environment":"^14.3.9","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.64","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.232_1665235053863_0.9993515850070469","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.233-joshbwlng-update-lint-staged-1af10e92ff07a940b52729154f9c459205bcce33":{"name":"@balena/jellyfish-metrics","version":"2.0.233-joshbwlng-update-lint-staged-1af10e92ff07a940b52729154f9c459205bcce33","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.233-joshbwlng-update-lint-staged-1af10e92ff07a940b52729154f9c459205bcce33","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cb38120c0be53b995f5c7d7d3a2d432f360869b0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.233-joshbwlng-update-lint-staged-1af10e92ff07a940b52729154f9c459205bcce33.tgz","fileCount":17,"integrity":"sha512-VXVQCwvsjtI5Kbc5BUUQGRWO9ANU14z+FPU58DoGLmBgtvdMTU9L/YXBd+SG/UxZDsOZY3B0/HJhnBb/pznhGA==","signatures":[{"sig":"MEUCICycYtuBSahpNPefgUMwSAy3E3I0RgVdzgMAw72TnDLUAiEAwqZTRoBy8TLTtUODY1YDHKvdzlLfh5ZZyhy64iiTN+s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68331,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQXrxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrFaA/+NrDg/GVd51nnkAf4Z/WDwNoTlHGfqFC6W1G5uqW6Z5kmPjPZ\r\nDKpfUty10x2v06r2MBIRHa7MwMRDWIM8wgvBpqGrKieurfRS66mrIFfyKPcW\r\nLiMf/rn85l7aGJI2JgUNP8JrrkHnYCCW2/8OIjXiYUE5/eQRzc+yUhdQfC7w\r\n32c33MVTR+TVuY6luw08DFvrAo3fDwnswPA55l6YE3OBfKKw/XiHgQgDDs+j\r\njJsfoaVV48SUD+xKDY1IyuRHrZS/DQ/5DAVJu4tZcBxb35e2borcwUSGUk+i\r\nHv3A6AhLQ/KVITgzSLHGDZSTzAC4mfCimBsNv5F3jbHhH5l7tfdfGsswENC5\r\nNG4fvwHR+rQUUOL0EIcXC4Q0B7qwl9BU8xe2ZPEIPHLZg8Qtom+q1DfWXunZ\r\n19wM/81OTna9hqR9CvLKu7FoLCoVqSLwFCx8K3og5lJRTHWTU4V0GpZF2yNw\r\nGjmd2DTrAYZbC7lqshRaV4DLp26o/6en1j9lqZ44cVA432IOLEX6/fymbRsM\r\nDcvdiASC2OjVTjIKnERDzNgI+uSN4/uckIL+DHs4GsL1aHmGPkaBV2l6dF2H\r\nTAU9wHlXpLLPkNY/+yi3Aog3uR74m60KX5u6JcI52o+8/DTBia718c7VbuS9\r\nwd9IMC+FU+aw0ojQ3kOwIPD5rKRCt90+5HU=\r\n=Bnzl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-1af10e92ff07a940b52729154f9c459205bcce33-18.x/balena-jellyfish-metrics-2.0.233.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-1af10e92ff07a940b52729154f9c459205bcce33-18.x/balena-jellyfish-metrics-2.0.233.tgz","_integrity":"sha512-VXVQCwvsjtI5Kbc5BUUQGRWO9ANU14z+FPU58DoGLmBgtvdMTU9L/YXBd+SG/UxZDsOZY3B0/HJhnBb/pznhGA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-08T13:26:48.270Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.106","@balena/jellyfish-environment":"^14.3.9","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.64","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.233-joshbwlng-update-lint-staged-1af10e92ff07a940b52729154f9c459205bcce33_1665235696963_0.5742878884884237","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.233":{"name":"@balena/jellyfish-metrics","version":"2.0.233","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.233","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1d95c73080ac6984d2886c550046ef6c078fdddb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.233.tgz","fileCount":15,"integrity":"sha512-su+kPjjC+vttceeAB1WILk+sdvU5K72vQNjDo90D7Wpb0Zr1qCT6gLCSP5GZgZP2Ck4Sfw/xYM5yMNCeDnojVw==","signatures":[{"sig":"MEQCIBwZwN4Dy3GSaXA9TXtThoAgBOjERH2U5wHivWKEoORVAiBQX42IegI9kU98Db36WgSCO29BYWvKlAHwnN7JG3YJDg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQX8dACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrBlQ//ff/sGcZ+8hVmWITWOR2eCRKpd61cNJZ4V+CZEsvqC36kgX7i\r\nRajW7lvhDvGmRmKrvDZ/UGPpqg9dHQ4zGQtZxy+4UnWkKh69tt6MsYiRAmP7\r\nqFsukaV3Ob+zGE6M2kHrTe0fpVWvRXk+nfeH7awbxV67upkW9+yUVlNLSzTY\r\nWHtu6fn7Kqs/F7omCYM1MtPZrxyHtDrhFtxPB0B5I8D49vpOTUBM4SFu3569\r\nJP0kbLl7ZNwmxBrmTk6RQC8n3XMLsnRlY3U/LlvhHAiuS/vLPrWSAsrWYlsf\r\nuly5qgAo7ROxxNWCvMGA2YDK3zr1oU38mS3Xx3u6LkIc4e3G8Aom0CZgc2+U\r\ni3M3xg58cBBzCLhLlM2M43UgPuMgEqlgPCrzvlZLE9cHrfgZr6cVP9RNkOKd\r\nydD3QSYpdjHp/OlkO0ZqGT0VQ1Wueps0kL7Ai7qk3EO5iWcvQ9cW4bpXM8ek\r\ng2VrOBYT4reUMI8oGrNpaH+LH9I83H6W+pYeZdm1B80jgUTkVsIaAosmbDQ1\r\nClQnnAL5vYDQ4RWmi8ov1Ap1eC6xNxHcEfMZEK2Pk+ceVEtpnjdg6zRTlCDk\r\nSJVgAXFozH+y5m8CScjFZYCmy9EVods4SDuYhQoiDIvwkXjHg/TrAWQfQqyB\r\nuzqKmmEJT0MpivWYdyID0kUgx5u9LW4dH1Y=\r\n=OCQ2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-1af10e92ff07a940b52729154f9c459205bcce33-18.x/balena-jellyfish-metrics-2.0.233.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-1af10e92ff07a940b52729154f9c459205bcce33-18.x/balena-jellyfish-metrics-2.0.233.tgz","_integrity":"sha512-su+kPjjC+vttceeAB1WILk+sdvU5K72vQNjDo90D7Wpb0Zr1qCT6gLCSP5GZgZP2Ck4Sfw/xYM5yMNCeDnojVw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-08T13:26:48.270Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.106","@balena/jellyfish-environment":"^14.3.9","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.64","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.233_1665236765561_0.31082962625736377","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.234-renovate-balena-jellyfish-environment-14-x-3283bba4868cbcd7d8d7928bba49d0ae54e81d4f":{"name":"@balena/jellyfish-metrics","version":"2.0.234-renovate-balena-jellyfish-environment-14-x-3283bba4868cbcd7d8d7928bba49d0ae54e81d4f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.234-renovate-balena-jellyfish-environment-14-x-3283bba4868cbcd7d8d7928bba49d0ae54e81d4f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d27f78b80ebed47e2aea51f866eb3229cc82c642","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.234-renovate-balena-jellyfish-environment-14-x-3283bba4868cbcd7d8d7928bba49d0ae54e81d4f.tgz","fileCount":17,"integrity":"sha512-2AYQGgiRQQb5FcaVwFuKH4MmXCOSyXRa3UxIuTF59HLuy4nz4b2cKDKCyDMOurDdLPkrSEKm1jZUbQj5Ejx1RQ==","signatures":[{"sig":"MEYCIQDMH+Mfvvh3wWiDiPKvbqVT2w8DQXat/k16LUzocAJHcQIhAIgYKm2N3Fer+PdmL4XpsgewUsPBVLXuFZ1r/NGRdDH6","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68346,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQZ42ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr+FBAAo2eTdEOCM3vgrvd7ZoMh0bvcmtgxZk+X5kzTy0sRp3GULel+\r\n9dkqqM+yxm47IkfIkDxBby6vknoS1MDfTIgJF1LNTMCfGgIk5sjNI6bbUdI+\r\nKMvxNGs3fyBYUAn9gC5iqzKXwXRIEJI3Ymfy93a14uwjFydQH/MHqUm3hwJI\r\nl0vrGpUYOi+9v2hxgfeaqLLKPtFX7GENSYPJqv/Ipb5dAKC0xQLwTgvIGZ7u\r\nJUJbsLirkeWmdGVbaQvkfF3jpgb2LhIb2Wb1VauhBo6avH8P7LoQ8C4iGGyT\r\npz9f/9/GORG3u26icK99ICNuCNFBzcupLnF6x6FmOY8kjNbG+Ezi4GBlq+Qi\r\n5ACTQibRv7F9J9+8VOrE+TyLfI+M7AYmP8HXlro1FRaGi5n5z5U0mqcoZ92c\r\n145uTlEeGN+KSveoy3gPor/mdFNqUMAZ5hW7K5gfWMxO8yIFxebIcXMfjGZ6\r\nuFM1l4r4bxVQTzjOceOO75LpGbRTtSfARd/1bbPgZg0z9gEHaKXHpylVaovC\r\nGq188MT5E60bZTnUB9en5RiEcEfnYFSGbrbFSH4nXcBN7lFqywmiF8NXFfp2\r\nf/RyXfINkjBKt7IJ2bfcPaXbjQ5bMMcLYk9lZlLkjZm43PSIEpF0A+BhZC76\r\nrcB1PAXVLH6oQPN2xAQsPS2j36MzqL0kyzc=\r\n=dT90\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-3283bba4868cbcd7d8d7928bba49d0ae54e81d4f-18.x/balena-jellyfish-metrics-2.0.234.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-3283bba4868cbcd7d8d7928bba49d0ae54e81d4f-18.x/balena-jellyfish-metrics-2.0.234.tgz","_integrity":"sha512-2AYQGgiRQQb5FcaVwFuKH4MmXCOSyXRa3UxIuTF59HLuy4nz4b2cKDKCyDMOurDdLPkrSEKm1jZUbQj5Ejx1RQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-08T15:57:21.248Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.106","@balena/jellyfish-environment":"^14.3.10","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.64","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.234-renovate-balena-jellyfish-environment-14-x-3283bba4868cbcd7d8d7928bba49d0ae54e81d4f_1665244726238_0.27542705425317204","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.234":{"name":"@balena/jellyfish-metrics","version":"2.0.234","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.234","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6b952dd52435e8c326398f2151f70e7c2974a159","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.234.tgz","fileCount":15,"integrity":"sha512-4rtNrsT5Yd4WnJ8gAgSAM6aecKRRZhF6a2FiUnZ8tk1VimJHpfYk15+BXWFT1/OPDEu3+SbRliYNb6GPjj67Wg==","signatures":[{"sig":"MEYCIQDquFvDQc2kQuCEfpoxGFTtptgWD//fizTMvGkbIW71vgIhAKPw+n9xeRpIX3Awmwkr3q2xuYMy9fXtdte6Dx7iDK9T","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68262,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQZ65ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrG+Q//bCMQAZ9OvuYSnYGaA9F53lK5WSRAqXLgNg2ecIetBXD+f+X7\r\nbbEhcBnFT7vRv/fJxxRGD6j9v5ntc4+BJOWg31M1lw0fFS8rk5Mh5HvCpqsd\r\nlsc8p/si04U5pfIXfkJh7tvZuiyv09JqIHOLj2HLLqOdjmooi+mjm/i7D6BA\r\n7bdVQKIiL5MDFoMZgZ1LWomuEsS03/iJ0xEyr6sP/z1SruLSl5lyP7fQSiyU\r\nu5NAna1OI68YoOiMAFtp2Ji/7IWajDoYQMFbjsPleAo20g9J+U7Bv50hgfSU\r\nIwxKPj/POM+koc/9xzRGJ1s4KBP6gDD6rtoXY1cR3hB2rKSGqR8R9XAbZw1e\r\nIsG14k4i9xV+D6CMKNqd4iu/JU1jkOtRDVh3cpDgXQstBPL4w8J8X0iYwNla\r\nq2wOsUMG7Q8bwQbfy8a9Sbqow7rI04X0UNQ8fhfoXWewd+w+r/UAluNBvKkk\r\nhlGcDs9a6PDkIFQ5LV5Z4ZtUJNhMoroQQ5NsoFTW0kcs6t219qXDBpk2EgWM\r\nNm8yibjDsXDxYyNNM73YZaeCMjrEGCsNVrUV+DQSKC2jElNEAby62PahW87/\r\nYL5DAGRBDk23OP2rL1jSDF2YJ7QtTrw5pgQDyj7YElHZEjlyvLLXtU2+lUDp\r\nrjuucNNdCi7x2cR78tigACc05fqZR17VT6o=\r\n=l0I2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-3283bba4868cbcd7d8d7928bba49d0ae54e81d4f-18.x/balena-jellyfish-metrics-2.0.234.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-3283bba4868cbcd7d8d7928bba49d0ae54e81d4f-18.x/balena-jellyfish-metrics-2.0.234.tgz","_integrity":"sha512-4rtNrsT5Yd4WnJ8gAgSAM6aecKRRZhF6a2FiUnZ8tk1VimJHpfYk15+BXWFT1/OPDEu3+SbRliYNb6GPjj67Wg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-08T15:57:21.248Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.106","@balena/jellyfish-environment":"^14.3.10","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.64","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.234_1665244857464_0.06603453097452583","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.235-renovate-balena-jellyfish-logger-5-x-cd3ce869f12ab985159852a8fb93af451b1c24d6":{"name":"@balena/jellyfish-metrics","version":"2.0.235-renovate-balena-jellyfish-logger-5-x-cd3ce869f12ab985159852a8fb93af451b1c24d6","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.235-renovate-balena-jellyfish-logger-5-x-cd3ce869f12ab985159852a8fb93af451b1c24d6","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b15c63818eaf278dacc6b9acff5e57566c3df63a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.235-renovate-balena-jellyfish-logger-5-x-cd3ce869f12ab985159852a8fb93af451b1c24d6.tgz","fileCount":17,"integrity":"sha512-BQXcUAQGOK5O2rsDP+sLc8YufRG4BWoQnjg+8EeQmRXTMxpBjaN1wcV/wL9PXH58Q66N0rIUcGSPav3mN8U6lQ==","signatures":[{"sig":"MEUCIQDke7kLzLbnpfFth+8Hj1Gn/2qXRZACPUXGzfAL0lktXwIgOwhnRSHhYfV5QQ5SdDHF6vxgFsmU1Z5OUJeOa68LIlk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68340,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQZ/uACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqqxg//TRfnuFklO1MJAZ7z7wj65Mx3rGDldtMxVxv5/V48av2BEEjx\r\nQyi4CvLWQYWZfzXEmi+2ObufBezP7iTgv+Xb7b635prSd1fe/zXiz45IpElz\r\nk1e59KrlWq2oXLxu7WlpzzD/lm/NwoZfiI9/H2+0ki9zgYUditF2ZbL5MYDD\r\nZzTBrH3IVYtjuJQ3vgJAA3D1PHRQ887jRcxmGAYl/NbJnaRSuIc2Q6slEOhg\r\nulAAP9q1j0ZJIAc2ByNE+Xf7+9d8CFk6e3PuL84PvD2xmgVKERG8Fz413krl\r\noAH3zi+UqQ9tap9B5Ofu9FWSXnMZ/CFZw/v74jZQ2gx8oaVQmLSPiw9BBBqJ\r\nWc0BoXAUCnWGBWJELo+3Vccj5jL2VUC8jX7QG4BYepl1h+4b9Rt2TChoyhuF\r\npv/LOWTO+C6So6eEto1C0T4qXsI+cWtTjfh4NNuR/iikNtZdb/hg7BWJ/zyc\r\nAhi9/9Kmu9OllRQ0bmAafXIxDA+8H+MCIecgEivS2rwz9eHcmHoh5uZW2Hvo\r\nzCSyRA4T3/SL8CPU9jKxno9GlsNsoJr2ZJWrhfTSNn0dC1GVvNt3rFvt7ws7\r\n/NlFYK+hyg00xm/l4TBnCg+IWv2xhqlIcB1EP+g1a/hrSNvd2YfgNID8XH6U\r\nRDRmP4orJ2lr9vEW9eYOymDA4Nj9PnBf0D0=\r\n=bC/V\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-cd3ce869f12ab985159852a8fb93af451b1c24d6-18.x/balena-jellyfish-metrics-2.0.235.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-cd3ce869f12ab985159852a8fb93af451b1c24d6-18.x/balena-jellyfish-metrics-2.0.235.tgz","_integrity":"sha512-BQXcUAQGOK5O2rsDP+sLc8YufRG4BWoQnjg+8EeQmRXTMxpBjaN1wcV/wL9PXH58Q66N0rIUcGSPav3mN8U6lQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-08T16:02:02.918Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.111","@balena/jellyfish-environment":"^14.3.10","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.64","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.235-renovate-balena-jellyfish-logger-5-x-cd3ce869f12ab985159852a8fb93af451b1c24d6_1665245166098_0.6691039759945572","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.235":{"name":"@balena/jellyfish-metrics","version":"2.0.235","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.235","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5fb12c5b06ffe9478313af1c7e3ba22ad23f0ef9","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.235.tgz","fileCount":15,"integrity":"sha512-VgqyoP5n6xmMBd5UcrNbBaxlQ2M5F/QNYc0B+BPA0LJfwpEVK1y3blxYONaPcFpOlKXzQuZjtS7R4Q9YJRf8SA==","signatures":[{"sig":"MEYCIQDA3oUB6FZmR4MjE3688R/Nh7k75/oMUva9s3jhfi+w+gIhANpBY4yWYwU03WQDs+o6uHMvZvd9VsNjjGpz4quY+qI9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68262,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQaBvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpoPBAAmdTqSt9sO9sHGItm95wI8hTJwPTt0blbejXQntr3oIWPwujl\r\niMobTxH9MQW6PSyoD24fTj4AtY3lokk3n0hBdiMXtspRQIYeMXPf4Lp0zjAd\r\nQVOSBdA8Bncl2/+v3hU2Eo/0hq+reakEqsN+HK5DNE/iwcQRdEcaAaMjwDku\r\nx5mIvFQAtOQTugLCWPLzhnnlc+21IDApANaR6ok2/HGZC/6WiQn8pk4bCxAW\r\nNId09XgEIGkXgQFxxGysQQzQ0HVj559P0j8sQJEWrdFmWyNp5xmERpF+d0FP\r\n/7BvDvzonJGahA5XkaGD48tVgh7MxzCmpaRTICzKaieoYzhpxuqgER/Lq1kg\r\nyrezQS6qta2L0KTVKIoaD71ZqLpMgktq/GxH9oQWB+CPJlpDE+DZowS2lQc3\r\nJrYGe8FTpneQ+qeWmeIunmDRhcmzYg51dGyt3o7yvo7S7u0qvs1lcZexIJ3o\r\nUwnbiMiSYMLrORBT35fKILPyg3yOjYMsoESHF9ZianC0rMsRrEGuFQxbtLsK\r\ngBAqrBIICvxuO4GvsnneMaXVxNMyWfoFuzBFrCo9STf9AjCeCIHIFZ4DMZ5J\r\nac7PY90mE73aDrMfEcww7iDGJM0OAPW9WxOempG6dOPjdMxEx14XH2HGtctR\r\nVs/jIfJ6TmXD8+DWIlW/Ion0yn580/eCAtc=\r\n=WArw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-cd3ce869f12ab985159852a8fb93af451b1c24d6-18.x/balena-jellyfish-metrics-2.0.235.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-cd3ce869f12ab985159852a8fb93af451b1c24d6-18.x/balena-jellyfish-metrics-2.0.235.tgz","_integrity":"sha512-VgqyoP5n6xmMBd5UcrNbBaxlQ2M5F/QNYc0B+BPA0LJfwpEVK1y3blxYONaPcFpOlKXzQuZjtS7R4Q9YJRf8SA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-08T16:02:02.918Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.1","@balena/jellyfish-logger":"^5.1.111","@balena/jellyfish-environment":"^14.3.10","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.64","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.235_1665245295393_0.013777081466777696","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.236-renovate-express-4-x-51e3fb5ffde58738878e8eebf93a4bb37ca7ef3f":{"name":"@balena/jellyfish-metrics","version":"2.0.236-renovate-express-4-x-51e3fb5ffde58738878e8eebf93a4bb37ca7ef3f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.236-renovate-express-4-x-51e3fb5ffde58738878e8eebf93a4bb37ca7ef3f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b9e6e48197ebdf228bbfd9c7f08a8e48809ece9e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.236-renovate-express-4-x-51e3fb5ffde58738878e8eebf93a4bb37ca7ef3f.tgz","fileCount":17,"integrity":"sha512-gWwk7w9UPpPZqlEWRRCAiNfGTqoWMSGrU3aemjGbc1i6B0Rb9JIgcaMDfvW+Ns5CGoIqMXvMMwvvgjScaZb51Q==","signatures":[{"sig":"MEQCIFFz7qfhW3TlQNvVS7hiME/uNKvd7b8tswCoY3vOVoS2AiB6/R9fUpmNmHNn5Lq+LzNAc1uf8LUjo+2kVVcChUq2Dg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68324,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQeDPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrwzA/+JDGHh1uHAOaxYM2n1QZMw8cGwiDSEOPx1Q/OZiOCgMwiPYQt\r\nIOYFKDq08C+kRs/FThIlfs+MF0qXaAWsqqadnMAKQO1izpI0ywOsGydzjauZ\r\no/LvzznX1rszeYAwPMJzERfMd4g8c2AQZuKAp3PcMh2V+PXzD7dikbfJj734\r\nR0LR+8xjp4iN4byvtQ1AAlaUno4HiSnwkHzJ0395fnKUfih7VnWr0k7YxyA6\r\nzHyOXIOgiuaJXkB0Z7MvLkC3GIwg1pTO8v0wMUbHSO3aSxAW2fE15VXpewM9\r\nGFk1FjgNz4zbK7HAZfKIKp2X+PWVuIbYiucWW345U8U0o/hFMoWcnx06NJbo\r\n5b6A7wJBIUmancf2OfU/Po+pQDqO5jgWbFQ93mkSaR9igKllr/qvMiMyV6Dn\r\nQa0slqEAyHJjducS9dZKWMTnN9MRZfq6AAL2yvfIAuI4/06b4zHOC8aGuBox\r\ndZhtjKNPNAZurgn/0+lvejkn+2c139/7J5tqdoh2bRS6nXHutxPwOYIkXZ9X\r\njxx7FpG/O57gPRIJTBoopuHRZPflL2sZY/G2caJY1f0AxRstzDfobGmUItsW\r\nxXAwfUXquEdi9HUB07hqTNaVZ87aTOfodkYHPM1Ka+XYymTMRv59zvnrovEO\r\ndSOSD3qOGxijo/imTXzujG1y+SCOwNf74M0=\r\n=z7Ie\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-51e3fb5ffde58738878e8eebf93a4bb37ca7ef3f-18.x/balena-jellyfish-metrics-2.0.236.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-51e3fb5ffde58738878e8eebf93a4bb37ca7ef3f-18.x/balena-jellyfish-metrics-2.0.236.tgz","_integrity":"sha512-gWwk7w9UPpPZqlEWRRCAiNfGTqoWMSGrU3aemjGbc1i6B0Rb9JIgcaMDfvW+Ns5CGoIqMXvMMwvvgjScaZb51Q==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-08T20:41:17.407Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.111","@balena/jellyfish-environment":"^14.3.10","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.64","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.236-renovate-express-4-x-51e3fb5ffde58738878e8eebf93a4bb37ca7ef3f_1665261775436_0.4866204346959211","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.236":{"name":"@balena/jellyfish-metrics","version":"2.0.236","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.236","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"97d6751f6fac2643b21e6a8913622b14dfce1583","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.236.tgz","fileCount":15,"integrity":"sha512-KAq9+fE5immKQCm2PPaghVGi3Wgi7lEHHDz/1B0+VoVzvbOZL5gCAZQekRgW2agpa8qUQ9bgfeo4CX3Q9jkdEw==","signatures":[{"sig":"MEUCIQCvtIrqFlAa15TI3B3nEwEsbkGOiQhm84v2hTwYBMGFXgIgbMBUnqduUOdZ2mUoRQEip5QDug+l0HmuNTZtjfbtwyA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68262,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQeFOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoygQ//V3VN340GPcwg9f2Ws7P0nVDIsw2a2DSnE6pzjFhJ+YFCXfOs\r\nLat8VIz5Mpe7JW5H2vIxG4vYzOFIZ/W3oTTDois9+ek71e/rvkExI+tIyrT/\r\npk25plZGYw5g7zD99UIYoTxDKirmRWLD87fRi39uUz+K8zfjO33Q69MaR8uP\r\nO/TgfHAsjHHG9J/s6w5V86DLHZDTwRFBmaIMvDkVkiaoCgCACMdtBjFxkPfQ\r\nWOk2dTP78CyzckmTgl7G1IT07vMZ/i8gPopids1foMVJ1rD4qKadL/+eIAMv\r\nfT4Ya8HaKLGCYvFLsK2WtvkSbR8frkaRawu9wJEuweLm/HkYmqGPv4DSEdD1\r\nKkbKK+UhSR/henoO0hVJzLbpWUiNdpD81i4hFFaQe5ExgOWYcZR5oxr9XhVB\r\nyFlCrMsMNxwecmB1dCXb15lZl0pq4ho/nQKicuIkPd6lehGNx2E9IUmEqBAd\r\nXPM4QnJLSOD9psyg49+QDUEdzJfka5wQgDiLmwjmX3b6aQ/oaIw3ePBy1SYM\r\nUpRcNSAVWpbKrfW0VNPSZcZhKW4eL3DomieeyHyamGXplfdPcr08VYkFCjtd\r\nTWjq7MXA/jIPLLkPdrBiUyA5M82kFCiMPrIVA7Pj4gb4XoyPnFwLLEPayCqC\r\n7cHlIkv9jAhZKuYmVlVjyS+7gMtHu+wLrbs=\r\n=YLq+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-51e3fb5ffde58738878e8eebf93a4bb37ca7ef3f-18.x/balena-jellyfish-metrics-2.0.236.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-51e3fb5ffde58738878e8eebf93a4bb37ca7ef3f-18.x/balena-jellyfish-metrics-2.0.236.tgz","_integrity":"sha512-KAq9+fE5immKQCm2PPaghVGi3Wgi7lEHHDz/1B0+VoVzvbOZL5gCAZQekRgW2agpa8qUQ9bgfeo4CX3Q9jkdEw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-08T20:41:17.407Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.111","@balena/jellyfish-environment":"^14.3.10","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.64","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.236_1665261901686_0.15556923785391263","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.237-renovate-balena-jellyfish-logger-5-x-0324fb13bc6eac1dd3bddcbf0750ed0dc2d9291f":{"name":"@balena/jellyfish-metrics","version":"2.0.237-renovate-balena-jellyfish-logger-5-x-0324fb13bc6eac1dd3bddcbf0750ed0dc2d9291f","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.237-renovate-balena-jellyfish-logger-5-x-0324fb13bc6eac1dd3bddcbf0750ed0dc2d9291f","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f9e9e29c3ea55c96c307b261aa4b98eb7640ed51","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.237-renovate-balena-jellyfish-logger-5-x-0324fb13bc6eac1dd3bddcbf0750ed0dc2d9291f.tgz","fileCount":17,"integrity":"sha512-ZjdW+9Km6pVc79NiaOdlrl6tELonIje/leWPc9AfEyRZYcC+op+W4HbNTnC/Lws0zytJwHwFngH9tv4B3m7swA==","signatures":[{"sig":"MEQCIGp/jGQUK6LM77+/xbcmewLRx50YbEEfymYfmHPf8zUlAiAph0NFLKfzbyniL5d07t2oqohlKmABX01tfcPnl8xBMw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68340,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQxy4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoKeQ//UgxJtAVC4h0VZbUPPya0r0R7b6o24kIt1o2+Zlzur77lAsUI\r\nqaORyOm0PzAl5f+CH3PT1IkqWDUfngtdKi7kgcrLz9Glv7+wg/5K03shzr52\r\n4vCaT9j+SeM/soOzLxwRiKgFEnUzqL54D9VJ4I9+AAwiwJ0CGziT9LGQ3sGS\r\ncE1HPXghUTVbEr/TCx3QYdHTK7PjJMh7ce9sJ7ePrT0KdF/6JZKQ4LggtJ3b\r\npHFFEfnzBHlUApVd8/LcIskos08h+Kj1+VYG7FXla/yrBCc52gxHRem0vkxz\r\nazLMgZmjVJ1HLSZNKe1Vs2T0RaIfCIS11aPw4Z+A+8rZe166zUILJ7ur+lGj\r\n+AyXmmJ5mEjTMi0I+iEtSPgCOHEvFn5pewlWYC899PUA/8MVj69o6lbfRoee\r\nDfWfa72Tk0jpQM7DtKFTrd8U6mOQtgoddDKcHxrvE/8joB78Qsh8xRMgz2Kt\r\ns3Emq8aSBWdm3GTBjZvGP+21hqBs9CNhepzgTAm9KoP1UgSaAnx2WuNCJ4aw\r\nZxwzv586SbZZrUQ6dWjoTnyjzZhIfEoFD7p2NzsCPqYl4aiK3M0sYLY6IOMP\r\nOtOYzya8O8rAUnBaI0+pAwau6UYu1IS/aUV+piK3H9H6mT4gB1gx/A/pEExX\r\nIDRyCgypPrFqQMOW7qmob+gePfSz10MX31A=\r\n=cnCx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-0324fb13bc6eac1dd3bddcbf0750ed0dc2d9291f-18.x/balena-jellyfish-metrics-2.0.237.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-0324fb13bc6eac1dd3bddcbf0750ed0dc2d9291f-18.x/balena-jellyfish-metrics-2.0.237.tgz","_integrity":"sha512-ZjdW+9Km6pVc79NiaOdlrl6tELonIje/leWPc9AfEyRZYcC+op+W4HbNTnC/Lws0zytJwHwFngH9tv4B3m7swA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-09T19:09:14.261Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.112","@balena/jellyfish-environment":"^14.3.10","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.64","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.237-renovate-balena-jellyfish-logger-5-x-0324fb13bc6eac1dd3bddcbf0750ed0dc2d9291f_1665342648396_0.23970985916366616","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.237":{"name":"@balena/jellyfish-metrics","version":"2.0.237","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.237","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"97fbf03560fcedb7e23a6f2dd252f95bbba7b6c4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.237.tgz","fileCount":15,"integrity":"sha512-o59OHwOMYn5uZZeO25tmE1bNXw59ta7tiUYabYGsM6FTLnHBMvzXpS1EBsjq6yAQtlfv29eOIsSf80fVNtQrvw==","signatures":[{"sig":"MEQCIHhLW4lSk91NttHuHrsWvmskY456kRPzpouXbNUeXa1WAiBSGaPtA1Vqy55pBGgYcB2FufdNFjfJxG8oFKhkRdPXbQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68262,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQx1IACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqG2A//Z6HcD2FoXeUpyZ9qLQzBg20Xd5vyYgR2dh8+5Yw7/c0sBi3U\r\n+mR0kD9CYfhJ3J+MBuU1MSW8bG3B0N4vKpLaJDUjSiXOTrOq4gCUT5AQGnXY\r\nygwAPdoSSKIZzJLA0LcqvIU6uOnm6tQ/bU8DjqyJqKOSq9m6scp+QNwthgGl\r\nRPxZaRLIdUOKpjMloBQ2KzMk2NPKbRo7c4CvZAEZQvF9LfQGM98Og0w9OB/A\r\nEE3eaHjLakOj32sf3kn+BfvGB5QT4j+vG4TgJTv2AqyP8ajqUPGDHoM1WQ1z\r\nkKwqAyRvdH3/Q8GKmIFu+DizF+2EAVAuqV5rSg01gThyrkwByIAOMxR1euaw\r\n6Z+bb0BH/fPmOwmKv6+LQeLyOrmN9uC8d4qv5Ltvz7EwovIms+HTjCAeBccr\r\nFOA9/vRJz38go0Fg84A2iM6dJJQVWZ5rwVtATWdzUHFJ69nKz/WVD0kYOzsx\r\niNV2zd3eQ6tOsMrPshpsfaDBpyBUe9bHKgWPQ8bGyCbfD8MQVIYCT2fgjjN8\r\na6MNg1x/OE+YR6kffXuzCVZYUhiwC55F0nivWVTMoE/utVAG2+zHIPMYZr9l\r\nUp8fidgfiVpVCDfKoh0FzM3YAQFL2z421f4SL4UxaE+agVIdfnmPFbafTZLV\r\nVLSxm5pSf/wVZywW5IiJLyu2OpNjEkH6P8M=\r\n=gKBN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-0324fb13bc6eac1dd3bddcbf0750ed0dc2d9291f-18.x/balena-jellyfish-metrics-2.0.237.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-0324fb13bc6eac1dd3bddcbf0750ed0dc2d9291f-18.x/balena-jellyfish-metrics-2.0.237.tgz","_integrity":"sha512-o59OHwOMYn5uZZeO25tmE1bNXw59ta7tiUYabYGsM6FTLnHBMvzXpS1EBsjq6yAQtlfv29eOIsSf80fVNtQrvw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-09T19:09:14.261Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.112","@balena/jellyfish-environment":"^14.3.10","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.64","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.237_1665342792496_0.09170752816294492","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.238-joshbwlng-jest-config-08f6cf51c14610647d974105528316ff79faf6bc":{"name":"@balena/jellyfish-metrics","version":"2.0.238-joshbwlng-jest-config-08f6cf51c14610647d974105528316ff79faf6bc","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.238-joshbwlng-jest-config-08f6cf51c14610647d974105528316ff79faf6bc","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5ad1dd2214871b4d479cd7c681051ffc1b0474cb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.238-joshbwlng-jest-config-08f6cf51c14610647d974105528316ff79faf6bc.tgz","fileCount":17,"integrity":"sha512-MnHQnAjp2LwBDVfdRs1inVbd2AenNsP+x3el/46mMb5hZf7fM13wThXm2cZUJ7TAScS2hzP0qzl86GZmhPhm8A==","signatures":[{"sig":"MEYCIQCf4THm95D+a86Oe2F+/x+zaSJujPXWaUWSCkIr5KmtUgIhAMt15EXLkIlqJ1tgNJENUbtVhi349zwV+BzKhi8A85AX","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68325,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQ5b6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo7qRAAgMtwQ3qgljepPUiTxvwPcQivFSBDRh/p1RKwHA1fscnd/1ov\r\nZh0DNzaiwh+VdctD/8lDLWoIS2lq7UItziPg+irRSYEY6qpuj/5fvl40+LgR\r\nZS0bgCS+tMnmnFa3cXV4nkbqpORB98iyXB2/ewnnc2RcRfthCvSCZkvKjF+R\r\n+COagYw4QaQjm3Afft5i6K34ji2R9e8v+FAUaGt3Mm/tb1Vkj/Me17pb+DnX\r\nfrIAla0xsmRchGprJUA7AOblK6AYa7se8j5htySaQ1ivnoves3Cma3cVe56i\r\nAX2Y2LW2BDJm9Tn10WgjRka6QRlbK8J+oNeBwOFngzyUZcSHTvpurymajQfH\r\n1bFE98wg+C7OvOc63uyJjKWmzQrMBHK1WqvM1ix82sBaqZsgokJoqxC4vgOe\r\nE4tNlUQvHoqjVrHzCp6ccBOro0E8zu/rAbcfEob8mqEoHypm3LqQY8EJtzcY\r\nfXHyAlIpSPb3pPdCM99/0+VlW7fHxISvRwdOUHyx+QZc18YcmSY5ECupYkSq\r\nOs55r4dMCC49gEpNo2dE5O/9tw+VI2aphid64a2LBlMYLTC1Jqp5koBZUHbh\r\n2lVGZkjSoQrjGV8oGrddqWlytR2SsyaQOVHdUwRFUKVSHBefCj3jCS4O2RhT\r\nOudVBE8dPAo2Cxvl9c81SMhhbe5N8TUMPZo=\r\n=/yYZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-08f6cf51c14610647d974105528316ff79faf6bc-18.x/balena-jellyfish-metrics-2.0.238.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-08f6cf51c14610647d974105528316ff79faf6bc-18.x/balena-jellyfish-metrics-2.0.238.tgz","_integrity":"sha512-MnHQnAjp2LwBDVfdRs1inVbd2AenNsP+x3el/46mMb5hZf7fM13wThXm2cZUJ7TAScS2hzP0qzl86GZmhPhm8A==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-10T03:51:03.317Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.112","@balena/jellyfish-environment":"^14.3.10","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.64","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.238-joshbwlng-jest-config-08f6cf51c14610647d974105528316ff79faf6bc_1665373946427_0.6245742938615262","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.238":{"name":"@balena/jellyfish-metrics","version":"2.0.238","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.238","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cbacc4f4fe8e001d2592d65b6d137dc64633efe0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.238.tgz","fileCount":15,"integrity":"sha512-Jc3o8A2TbQyzvCT3IZPDPJThYYybyMPLJmdpsM1qAxNRTeVgZ2PUOSx+Aw5hHJCaEqnShkXx9dTDJMvzdW5VOg==","signatures":[{"sig":"MEUCIQCgLIeOLCDr+mUQ1brHPUpSjT7mpUtDmR1on2oH+T7kwQIgO5QRNJE/obwHoMxHNdjyGIknPu8SLRqdw64ynyX8KeU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68262,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQ5d8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpFzw/5AQFfmsm6SQ8yxBtRWGL7nIaPRvzHmNHPcFQt2d3+G82akcli\r\nPPMH6GfD/4s8vS+yBoP6gI3pmqcGv7XfExQnCoshTjBOoasHjTHAmGc1Dp8w\r\nJ03HXV/52FeN5DIQPqdtZnGJHRdDXc/0nM4aUDWNcu/8UGsxATlEGsPiOqqc\r\nJ33PDcqod+P5WBDJfuh0jSzq5WL4W50WeXaxHLJ8RcCj/vZtweIOiKZuYq00\r\nHDY+2IZ9b+LkNX37JYlT//oC1HF4bbKhd0ubggwET7oHZHb6Hcq/y+b8Q0Lp\r\nEgmm1I2geiy4T9BXlH4KXmVei+QKk22dwa77WpEoQcngig9K7xq6viXEdVcv\r\n2XLjviZLFcsKdGWOfWTCXFccpHzwcrDNpItmKf1t3YnFHlVk0Uhqjs9Qnl6a\r\n5sHheRnFgUv3CoLLiY+yJH5y7iehYqC7EZlnLLba/NAw2lBb/dgziKKvHB53\r\nJHlh3hfmDPFHG15EnmH3OMeq0qSh8QfL+ybvGDc6c0czuhtS7BE81Ussph3l\r\nRrZ7zljbFRoc/3pdlrSI6tO+BM7ry3LsR4nZqkqDV58EGGwuTpkn4BecHYBI\r\nsFiR7XuYP3G2keYk4ZfU/v4fKjceoCzNzW2GbVFVYhLpiUp+hi+f25Gz7heD\r\nsB/2LrhmhOOeEW3g1Jr5dC3fTT4hsFKv+zk=\r\n=cBue\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-08f6cf51c14610647d974105528316ff79faf6bc-18.x/balena-jellyfish-metrics-2.0.238.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-08f6cf51c14610647d974105528316ff79faf6bc-18.x/balena-jellyfish-metrics-2.0.238.tgz","_integrity":"sha512-Jc3o8A2TbQyzvCT3IZPDPJThYYybyMPLJmdpsM1qAxNRTeVgZ2PUOSx+Aw5hHJCaEqnShkXx9dTDJMvzdW5VOg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-10T03:51:03.317Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.112","@balena/jellyfish-environment":"^14.3.10","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.64","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.238_1665374075885_0.9931225668286667","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.239-renovate-balena-jellyfish-environment-14-x-b925914f0af271a441e3ebb8f1da07d3da840c47":{"name":"@balena/jellyfish-metrics","version":"2.0.239-renovate-balena-jellyfish-environment-14-x-b925914f0af271a441e3ebb8f1da07d3da840c47","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.239-renovate-balena-jellyfish-environment-14-x-b925914f0af271a441e3ebb8f1da07d3da840c47","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3a9a2ffbe5120db3476510620349cc707444bd38","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.239-renovate-balena-jellyfish-environment-14-x-b925914f0af271a441e3ebb8f1da07d3da840c47.tgz","fileCount":17,"integrity":"sha512-JnxQpOOiIRMT6Zy7aR5BrrJ4OM1DNpS3LMXePJkmYaFcv4sUwchuIdBsMiQgJnPcObNs6mxZdT+LL6qk7ijS8Q==","signatures":[{"sig":"MEQCIFNxci9xbIYzJXAwdkUre4y4jRxIMRPLMt4c3X6q0R7dAiAqg/CXphKr11SqFqZ8MDmAs8jmpLHaTzEta7o+w4Cjpg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68346,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQ5gOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqCMg//Xth2IlO0+AwjDirNdr9wDr6rZ83J9wFe0xHxd8V0ymlhixlf\r\nf5nHkah2hnQl54rVo0v9hqacLZY/P3g4d1M3/2z57FDrxoal4XpToTS1Em1r\r\npL5ur8jJUppJg9U8PlgwWImZnd1vZcKMUNJgoPtAIO4eMZ1uQPbV1vR2WpDm\r\n5dEkhRcCuYuZ7KwhQZG+2+elObiSkzH0D0My0xJuulo20J4D00WKjJdqF7HP\r\nmht5c9mFgILkaP6w+agm7M38WZQPLRqaXh5Wa2m283xDNawmFN+z9aFb94SR\r\nbjnYPwJeMNEf5Fs3byT5YCr2ltfBnNljLVGjVEazgyr3rxrPAHRQFm2Ujbqo\r\nQI7fIZ2e0+RqQzWFIoAJazi2z3jAJxBdjvvkUU7TaT9O0E7na2F+I9qlM8qD\r\n0oSXFqb7GfP9ShKOiAuTM//cFaOLFws0o/udsyx+ZTIrQI12EmmdNB8lbddq\r\nKpvnKoa//NW+5sn6RDT23Pt1VJhgbTNHHINSnAen01f+sUsWKOqVvRvMhl+g\r\nrtmJ7jSD1G2krZP+L6IenD05WDzew1pFvDbMhRxcnfABN+mrgI/1RFMH1jtg\r\nOBVcitAZh6Xwba8xosxfDgVp4NLb/p+I8ddUL+DZCzqTC3DuxVRHKilIK9bz\r\no9yRBUVagiZtJkjvQlB+8twDuPRw0q5SQd8=\r\n=vUgY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-b925914f0af271a441e3ebb8f1da07d3da840c47-18.x/balena-jellyfish-metrics-2.0.239.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-b925914f0af271a441e3ebb8f1da07d3da840c47-18.x/balena-jellyfish-metrics-2.0.239.tgz","_integrity":"sha512-JnxQpOOiIRMT6Zy7aR5BrrJ4OM1DNpS3LMXePJkmYaFcv4sUwchuIdBsMiQgJnPcObNs6mxZdT+LL6qk7ijS8Q==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-10T03:55:46.219Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.112","@balena/jellyfish-environment":"^14.3.11","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.64","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.239-renovate-balena-jellyfish-environment-14-x-b925914f0af271a441e3ebb8f1da07d3da840c47_1665374222495_0.5894902480853808","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.239":{"name":"@balena/jellyfish-metrics","version":"2.0.239","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.239","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6b7505701bbdae41923467bc6459dc14df676481","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.239.tgz","fileCount":15,"integrity":"sha512-L1jJVGxLbnZG0hBejzEHx6F7Nhic6RashcEU8WfM107OKl4htw/kaVjDixbx9wPTvJ8zq0nu44/6X6JBOe8Z7A==","signatures":[{"sig":"MEQCIBTypxh5nH10Bfzq+F2oZKZmnELa/oMT3MaCKPQ/2+KlAiBc7PO4gVFdDGcVF/AXRqr9fT4RAvzdPLKubIP5+SkVQA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68262,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQ5iaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr0BA//dVgV/vgb1IePtIVpC3OWU1T5bXtfMwwFhnIn0wSQdbLR+9Uj\r\nDMC1TiEBYFn0a5xniqTV03t8j9F5kNHui3X7gbnfwfQ+g8yRFrAdAe4+Frc+\r\n2rhEaSk0gIoU7DokMf/wO2DF3GODEbOUfwzA4DbHXRUI4wyDDbgoLqi80LJk\r\n0WZzdQe0G4J4h7nvOfk5fOrZhlgNeqnqgMMa9tiPur/7k+tZbS9OopBDuod9\r\nhDOErXHueYHMeJMuVykPrVWk/WS8ycS29GMSwneDreZiEa4IJYoQBycaYPHE\r\nZdFW9sGB+M7AtmE5NoyFHKIMrj+UZLBAvgWGidFC3tz/g9W62WMuziq4f8cy\r\ndMmP9ch0Np9XCV2D9B6waf30Vfapqo2/zihZ5UIAwRafq18DTGT/6RWwrgwC\r\neJY37gpWpdC2wnLB3gKXzzBSI//2yshl+EqfYdj9n+NIFOyjcqbIwiG2XQHa\r\n5q7hxBSk/mgMU4PyBZL9cZzEIL8hQolrnYYA2oqSlk4TUiUmBd+pBbPn7YvD\r\ns8yOtE9T70z+CMeIPNqwgB7r8AF0XuCu9WwpMWhZSt9RhL0h8ozhnic/aysV\r\nWsUq5hA5sPgHaET7Gf2mq5UlDzTv94+s5bJqTn5DQe+9fVgGIcDWLzrldXpp\r\nLv/2Dat37YH4FsRqkJtZWKfvzxwxYP3M6Hw=\r\n=FhCH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-b925914f0af271a441e3ebb8f1da07d3da840c47-18.x/balena-jellyfish-metrics-2.0.239.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-b925914f0af271a441e3ebb8f1da07d3da840c47-18.x/balena-jellyfish-metrics-2.0.239.tgz","_integrity":"sha512-L1jJVGxLbnZG0hBejzEHx6F7Nhic6RashcEU8WfM107OKl4htw/kaVjDixbx9wPTvJ8zq0nu44/6X6JBOe8Z7A==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-10T03:55:46.219Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.112","@balena/jellyfish-environment":"^14.3.11","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.64","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.239_1665374361843_0.6164722312503137","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.240-renovate-balena-jellyfish-logger-5-x-2104a75d33644bd1fcc08f11442a280e86779625":{"name":"@balena/jellyfish-metrics","version":"2.0.240-renovate-balena-jellyfish-logger-5-x-2104a75d33644bd1fcc08f11442a280e86779625","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.240-renovate-balena-jellyfish-logger-5-x-2104a75d33644bd1fcc08f11442a280e86779625","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"44d91c9c56e4f3fb6d6caf79c1e9312d54d1fc75","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.240-renovate-balena-jellyfish-logger-5-x-2104a75d33644bd1fcc08f11442a280e86779625.tgz","fileCount":17,"integrity":"sha512-UaiLlRPXoGJ0YWWXp49pJxcuRQXhLGXpgArTYCI5tvDm96r3ZprLEuQBzE1o1d+2aOCq5qSud29GMWT3PpW7Uw==","signatures":[{"sig":"MEYCIQDLGIuJefR/00IC1yYZ/KXQbB7VcYUSqJmIOltp+WVGDAIhAJQc4HpHTYyov2f1ZypK5ncbq8iIwg1/RMarW/QcCBOC","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68340,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQ5k2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqKFg//ae0utWfz79KNCw6llSCH6HnXnYYeXEIFUoJ2nAWjHIecpr/0\r\nRYwmx+2OthD+wvKvYh2h2PyXX969K6UVwUK7mUkdhYCY9rql/kuOiWEKdois\r\nU/Vk1R4bvoMluMfoCffaeSgop/wy1bTD9YzEvBCbzThbXQgXGlo1YiCm+U/7\r\nnHuLm398vsJ/ExRDvHDX1KNWsm/xjivCz89aBP3jdQaDiDsa6/dWtK5Ba+hA\r\nQH++65W68T9BpWPcnNTHZo7vlU3H8nBZ5c5w5FKRUxgL9BU45qto4LN7U9Jx\r\nYROpbTdbIsTQFBBB41FidLshAvHlSJICR6ZrCcbVFqOcj4L/sIOfskKRG19R\r\nAAvInMOIGQ/DD63wg/WS+4FhM+ay3t3+SW9OtA6lJI8b/4fYNEJ46loiAoic\r\n51g4orrpaGw9ILOIfoict3dCNgfEMhrGJI1QL/8cMjPN3T4ujrOVV0Wywuf1\r\n+GNg4Pfl3TCepxqIrlXEGK7ErljaCIbni4y4Qzfg9yrwUddC5evjJgMorFUr\r\nHa27D0Zt02QRbiYqG3SW8hK+2cdk2uZhyVL8dYGaLhJ1kPLT24qhYZucsbY6\r\nIWagKo82saSERVhDvZWKJXkDKZL9sEXvVZ1Ux+Ppf5TIUIXqQEUdvcsczqPG\r\npcUWSkLtxvwFQ7hBJ4WGV0QPIjTdV84SPxc=\r\n=hETp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-2104a75d33644bd1fcc08f11442a280e86779625-18.x/balena-jellyfish-metrics-2.0.240.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-2104a75d33644bd1fcc08f11442a280e86779625-18.x/balena-jellyfish-metrics-2.0.240.tgz","_integrity":"sha512-UaiLlRPXoGJ0YWWXp49pJxcuRQXhLGXpgArTYCI5tvDm96r3ZprLEuQBzE1o1d+2aOCq5qSud29GMWT3PpW7Uw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-10T04:00:41.297Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.114","@balena/jellyfish-environment":"^14.3.11","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.64","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.240-renovate-balena-jellyfish-logger-5-x-2104a75d33644bd1fcc08f11442a280e86779625_1665374518293_0.8331406876023546","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.240":{"name":"@balena/jellyfish-metrics","version":"2.0.240","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.240","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b58ef126c196a9157fc259dd9ad12522970a807b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.240.tgz","fileCount":15,"integrity":"sha512-5pDLEmqg2o0Ij0NbvE3SYli1nyCMmTjmDCa20IdR1RlcWwWo1gP+vIgPDjIW0OefRY7TDhCWmH9/LkSbX3j6SA==","signatures":[{"sig":"MEUCIQDMBc2hol3dXgaCCTY8rWsDvBYobUnIpONEKou0EKkqwQIgdGjuxOKY9zWH35kXmho7OfYj531GOguVUvPRHOnW2cs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68262,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQ5m7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqfCA/+ObBtw86/XRuqBI+c+ycRyiXclUvTFTlCf4YIy8tA9ThGpjaG\r\nMxosrO6FkZLY/snqYWEGn+c/6ehAWAmK085Akr8jM+7SbizHmzt0R7qu932K\r\nphX19vcg4lsETbz/pZeV2u+pg7K/hyn4+YU186BTjPiyOMD3JuSoNZZrL1e8\r\nAiB5+i8IgcGbj/auqVPcI+1BCREfMI8CsDP49BBk13D0kn8qTHCIvJtZQRY3\r\nUHkLHCGCl762ftQzisXalBLJ+zL6hA7dOufU1CO11mQSO5PFdhOtiMegVgcR\r\nrLJf44VLtrtD6Q2KyzdRhrRCu4hoDJdMOA2kCT1ycsT8sKQoD0QlMH3kLBMS\r\nn1xr2Q8Wdag5Ohz8W2hu/Xtcfr5DxpnmHzJs3zYgYgE2b/VfiN2r3jXCP6IB\r\nO9B1e/HdV/fIHBUXPrQOcQQrYy2TvVH8UWaBuEn0lM3EMkjNPu8jtoRZ5z09\r\ndALwhsvTB2kBDOJItJenI9MMoLKnjQ1oCWhGloJ4Gsxoe+ZkTlSbB/8d9oBy\r\nZqDuAB68n3bEDUR6gd7+x7H1E+OHML57UW2N9S3F2aHj8IVJ1aI+tMuROAEb\r\nggXsinE4XpXWQM4V3OM49j3wA+vj+8wdNuCZTdVXDRW+dZe1sFAUGr+O04cQ\r\nmjBkpj92s+hM8PuyOisCOTPv9TD6eifI/xo=\r\n=cIN7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-2104a75d33644bd1fcc08f11442a280e86779625-18.x/balena-jellyfish-metrics-2.0.240.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-2104a75d33644bd1fcc08f11442a280e86779625-18.x/balena-jellyfish-metrics-2.0.240.tgz","_integrity":"sha512-5pDLEmqg2o0Ij0NbvE3SYli1nyCMmTjmDCa20IdR1RlcWwWo1gP+vIgPDjIW0OefRY7TDhCWmH9/LkSbX3j6SA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-10T04:00:41.297Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.114","@balena/jellyfish-environment":"^14.3.11","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.64","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.240_1665374651252_0.6973795716977207","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.241-renovate-balena-jellyfish-environment-14-x-53ade29b8405a24b85c7ef02edd046f08c3ede3a":{"name":"@balena/jellyfish-metrics","version":"2.0.241-renovate-balena-jellyfish-environment-14-x-53ade29b8405a24b85c7ef02edd046f08c3ede3a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.241-renovate-balena-jellyfish-environment-14-x-53ade29b8405a24b85c7ef02edd046f08c3ede3a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3be6fa8a7f1cb991b802e576ea1e107f9ae97423","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.241-renovate-balena-jellyfish-environment-14-x-53ade29b8405a24b85c7ef02edd046f08c3ede3a.tgz","fileCount":17,"integrity":"sha512-VMpVFABAqaJFFnu9+7Q5yPd+4PtPgspkIoprKfGxhhLOChQzMAb6GWgg4P47XCUnT89HMFomZpPsiTTCMwOOAg==","signatures":[{"sig":"MEQCIHoQtCWmBXdD6KIYcvoAf/avf0+iAmFfQGQcvTt8QHn1AiBluxcw3RDPb4zkGiHzTh+lClccKhmcQqcZT01AW1OlHA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68346,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRKYPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqdRQ//UrCBaMVsQFbdCXGvheyP34zKhBtLjzdxWN3kfKZfhmj95Ob3\r\nLwaPzzxGKXtrZNAOMEfiMfuGt5BMnew7Voxg9A4c8tv6+6iv9HWkVYpXmcUh\r\n1r2zES8uH/0LBuTgFS9yZ7baP+mI+4E7Sm5B3lhIoulTdfDiK8xeOOBOqFvr\r\ny0v/N+M5//7AvmlSAbZRpDE3yg89HHgWcqD512fduyMtNW9QXO+IlwoXRrtM\r\nB/BoDwShKmoO6UeEf0JW4U5hyKjGrgA+Bi/xz4EpoyS+3JhO3dCO2h6kYIH0\r\nIkyuZl0Oid9Q5utT7MCr1BzwTtItHJOsgoMZ1yzcboNiNYd68nYhV2cVOwk/\r\nkokBbZ/RMy8KWsN/9TgrOWYmsw0EGg73ZvR4LxZoQMpUcqRjYwQuHlTckXLr\r\ngScd5Ll3BYdSG427xOW73DcUjILNn5OFOHv4CfLNZDfDy8KDNHUVhJEr/B6A\r\nZwJGL95zSc703hGAUbunZWFdTIeNgy6Ow5PxMh3qIbPmAgdJOLfxPH3SiE/e\r\n6OXnRDlzLKDK6kCeipVTgTFVUAb8Q3tzLb27o4bWgt54yE9+n14I1FGLQBl7\r\nryQ8+Ro7oZ/PZOvhrHyBCRJDUfIGIXGddN/PuUCAGM9ZXY2Apaw2PdePpejy\r\nB7n84GCUtO5D4ht9yLsAp1M85HGkhaUrqdo=\r\n=oMGw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-53ade29b8405a24b85c7ef02edd046f08c3ede3a-18.x/balena-jellyfish-metrics-2.0.241.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-53ade29b8405a24b85c7ef02edd046f08c3ede3a-18.x/balena-jellyfish-metrics-2.0.241.tgz","_integrity":"sha512-VMpVFABAqaJFFnu9+7Q5yPd+4PtPgspkIoprKfGxhhLOChQzMAb6GWgg4P47XCUnT89HMFomZpPsiTTCMwOOAg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-10T23:07:34.821Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.114","@balena/jellyfish-environment":"^14.3.12","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.64","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.241-renovate-balena-jellyfish-environment-14-x-53ade29b8405a24b85c7ef02edd046f08c3ede3a_1665443343256_0.5237597968797747","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.241":{"name":"@balena/jellyfish-metrics","version":"2.0.241","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.241","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"000bb4d7fd726321b27fc20383fdc3b327d88d84","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.241.tgz","fileCount":15,"integrity":"sha512-ICktepupHWVX1CaEF4xEps/QDSEsBBf9bLVtDGXOLal1U+qyHftdxmRpmYVbc8k9EPfWB/Q7hvLBUvBSzg5P4g==","signatures":[{"sig":"MEQCIGKTFwbYvB8NXqFEWhKzRq+GjXlbWdCOCqNBtBB4w0rWAiA9vz1pMPRU7ac2qbZigZw8zp2QU6H3q9qOOiwoZtyAew==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68262,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRKaTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqCBQ/+N6rono46n7K+KQoiBpqfWpBrznoP9hyXJ8TYttdBXLjEp4EH\r\n/Sak091HV1Y+Qba2BPc14FOyai5wuWWc/J0ftBggpCQ3xS0AmgDFDnSNAIEK\r\n+UuxsSTWd2r8p6Tt4HahnqNSvsgO3b/2U2lJ3+f2kOxaQROEQLgALFLCiU3n\r\ng4i/oZvAElYkclMj+Kp6FOR+iBIQ+GkmU1t8S1hoB0tF9bY31c7VIxlzB4Bm\r\nzEQROq1xPxvEzIX9rkaHbupMQNZOZbJX10wTPUCkJCTbPZ608CfKlaecu8gj\r\n2Nsf1mbnYuYyJjWbNLJJH4pW7HhX2n6rxE3Wy3/0bKT6eyz0qA6YNT/L9Tg4\r\nY69LBlJNq48BFStYjbGwIdy7cfghT6PwVUxDq7riKBgVH5oE5As6nK0kKUau\r\naiSVFY7Vz6h5mf/4dQSZvAz0corO7ItGNwTn95UE+wxeukoW/za8/4Y1rsks\r\nydeAr1KonnOxCO1OQVcZ+plgTOcO69wRQLL/0Y+OVJvMTGwGyN7N0hCwfEYO\r\n1UxpDsfk7n8oYouVWkjg54FpWDg7YAbGkv6U02Ju3arG2TQsDCgp7cIH9EFJ\r\nccxTLxu6oiy9ij+245yRk8RhTPhxnAI3IodCkD820wpCZMV6UyfujhW5NLDs\r\nDgQmRuayE90EsvbNwZW56xRFznbF6h4OXB8=\r\n=QDc/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-53ade29b8405a24b85c7ef02edd046f08c3ede3a-18.x/balena-jellyfish-metrics-2.0.241.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-53ade29b8405a24b85c7ef02edd046f08c3ede3a-18.x/balena-jellyfish-metrics-2.0.241.tgz","_integrity":"sha512-ICktepupHWVX1CaEF4xEps/QDSEsBBf9bLVtDGXOLal1U+qyHftdxmRpmYVbc8k9EPfWB/Q7hvLBUvBSzg5P4g==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-10T23:07:34.821Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.114","@balena/jellyfish-environment":"^14.3.12","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.64","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.241_1665443475247_0.5315480403890505","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.242-renovate-balena-jellyfish-logger-5-x-dfdc5810a3492613531bae56120f79b133119048":{"name":"@balena/jellyfish-metrics","version":"2.0.242-renovate-balena-jellyfish-logger-5-x-dfdc5810a3492613531bae56120f79b133119048","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.242-renovate-balena-jellyfish-logger-5-x-dfdc5810a3492613531bae56120f79b133119048","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6762decacee4566cbba912a54d171cea5663e5c5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.242-renovate-balena-jellyfish-logger-5-x-dfdc5810a3492613531bae56120f79b133119048.tgz","fileCount":17,"integrity":"sha512-OZ9cVDuwBAXbiBaXqadHLdgj47Aw7RHnX5zKLSOYfuttgzgerKXD62vZ4yG4pOKCcHQ2bbaaGu70t5z7Vc6e4A==","signatures":[{"sig":"MEUCIQD482kUpP1uAKg5nQ8BCFAPXId8QU4tU2w7mqimXtkTcwIgRC9ME0QFIOIhos9voSRGsuN7EczbbZn28Y4epDLHMyw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68340,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRKc4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqbAg//Yvk9IB61Ox4nMxYe26URqt0E5f9mg1pRkttVmzGXoHt7m6BD\r\nYvrCyttGUFiiY43+BiGxJs0LVCLVxJ9Tqjn6CkydQGHzOSOZKIcg3kgblIu/\r\nCt7qhsUp9T3PBFZzZYxsHruW0SLGRSnglIrKJmrL43TS7EqZ72x0vhVY/9in\r\nNxStQUuhxFy0MS0lgsHPcvs2oRoXVtFU5BqvFbb/CaiFnEgl9Q/N1Tn2Op3f\r\nydA4sEC8KAhOfwNTSZREbLdSESqeON3QXnXnbs+9TEzOHjyTTg4LCry0BUD+\r\nY8LPGe7OzLGCNF5Do1WZgZDXNDpJbYYX1gx5ARN2MFPD0jNFgs5ZBaIf03B3\r\nsJp3ttR72hpdA9hvlyfxmXemlOpcIsdNLiALvXdaU0haZYO/bLi6/ySUWgAn\r\nqStju7jaRZt2V3baTtEnOYQlTjA5Sboj1HM10chpz9rRzEwEO2jLuqVdtSAW\r\nWfLU3fAZKIfFusiI1upcOPT8YnB3W6p4FNlAossJ6oX8djIuO0Arwqw34sDH\r\nADQcV7sW2kl2qM5/WAy/8wK5LjNt27xbE7Nya+6A+md0R7k65kh2x2yrG7FG\r\n4Q+UAJ3Pd2vV0J39CKvszj9X1BHBvYnHBT6yAUNu8YMpE8HJ/HiXyVJbtXsk\r\nHh0aRWzva1Rlu5HkvByQIzSC5w4Hw23YpDU=\r\n=THkH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-dfdc5810a3492613531bae56120f79b133119048-18.x/balena-jellyfish-metrics-2.0.242.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-dfdc5810a3492613531bae56120f79b133119048-18.x/balena-jellyfish-metrics-2.0.242.tgz","_integrity":"sha512-OZ9cVDuwBAXbiBaXqadHLdgj47Aw7RHnX5zKLSOYfuttgzgerKXD62vZ4yG4pOKCcHQ2bbaaGu70t5z7Vc6e4A==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-10T23:12:26.727Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.116","@balena/jellyfish-environment":"^14.3.12","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.64","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.242-renovate-balena-jellyfish-logger-5-x-dfdc5810a3492613531bae56120f79b133119048_1665443640434_0.9697802643023175","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.242":{"name":"@balena/jellyfish-metrics","version":"2.0.242","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.242","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4ed0074d38f21068b3cc0faf6b7244fb0bcde644","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.242.tgz","fileCount":15,"integrity":"sha512-lm2V281fQIe3L4oiQ3GlEdo4ixSrx9/qQf3SVK68M5tvJ+75vEYHSOyIx6cj70K6jOimpx5hKqxAMqEmRXR1pg==","signatures":[{"sig":"MEYCIQDnY8ZLTd55ouMQdUDwFvGUf5U+aeTRR+onDmhHMlr/+AIhAOnP0qSgu4XdNH/fjWyC3lfq/cnvRmpuv4+XPsr6pP3h","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68262,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRKezACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqwKw//b0nD+o5pXWLqHB4fi17vp6FcQAuFQLmtaR9G/Lmd7Khoal43\r\nHOSJzg10iUR7QcyvVQj6Bt6aLV/sfnKMLOTX0L+3ZHrzCKKiS5z1nARGfj3w\r\nEENekJXh4FReiS2a+1gS0/WkdA9BVTBnRKBdwnSaYwfyhnsIYMT26BbYBz81\r\nvPwwpt+JWjNh+lNiWon+rL6ZaAjtssv+hh6HothtfUR7rHyX6A6ulfKrH/GA\r\not2cf3VLqOOyltCOk4n/CXEc2XtLhcSgOQKOoobltnZTnSdWzPM73gnrXLNB\r\nkenRxHn9ABmlKU8bpV3mJxYSXBT41P3noQ0bez/EhBmEdMF1123Lj8kt9ZFR\r\n6AVBYaLxwc+/hxu3MaGYL/uCD1MCkTiY9JXV5DanAXhOTvf/XCdhveZvIu8O\r\nW9s6cYEP8o9s3hlgzsTyFxx2XdHed8tDNsIdwW757aQ0WWEoVMXqGCEc6jgY\r\nq3Gz8qgzhw5ptpM4KtkgLGCwz0vxElXsGD8VznK68pDn+2aIHHu1cMWy2lwP\r\noNyzujsEw1wHTMQCTkdz7NhrHGOL8mvyQnImpuogTdPLhKNWRirKnICz51Nj\r\nDofyI4I4XpIsDSlz/ytx/bQ6zS7BS/mGldxqfsIxj6HcBhO7Rz5SdjisXr/E\r\nETKX17JJl+VRI7PfjMDoxa9Inej4n82rsAo=\r\n=16g6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-dfdc5810a3492613531bae56120f79b133119048-18.x/balena-jellyfish-metrics-2.0.242.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-dfdc5810a3492613531bae56120f79b133119048-18.x/balena-jellyfish-metrics-2.0.242.tgz","_integrity":"sha512-lm2V281fQIe3L4oiQ3GlEdo4ixSrx9/qQf3SVK68M5tvJ+75vEYHSOyIx6cj70K6jOimpx5hKqxAMqEmRXR1pg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-10T23:12:26.727Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.116","@balena/jellyfish-environment":"^14.3.12","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.64","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.242_1665443763101_0.6665885960985845","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.243-renovate-balena-jellyfish-logger-5-x-b000b48c3f96f77734d6e94bcc42293ad0935847":{"name":"@balena/jellyfish-metrics","version":"2.0.243-renovate-balena-jellyfish-logger-5-x-b000b48c3f96f77734d6e94bcc42293ad0935847","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.243-renovate-balena-jellyfish-logger-5-x-b000b48c3f96f77734d6e94bcc42293ad0935847","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"83ea11db43c4d263dc64f21c3fb03784beec9964","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.243-renovate-balena-jellyfish-logger-5-x-b000b48c3f96f77734d6e94bcc42293ad0935847.tgz","fileCount":17,"integrity":"sha512-bbBem3I/ZgWdXMqpOsUGrMlOeMPNzZR/OPu+kycAA0vZmZ4d9APA0gwmdeKUvCnAjpt7VRd0IZtIdZZY6o5CHg==","signatures":[{"sig":"MEYCIQCFxA4qIKASDcXmcdePPt+OJN3eJ8V3aA6BCIwh+jD55gIhAMKx0MbY0I09idNwThbZzMtIzl9HXnKsORFDKinmknBy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68340,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRNtbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoylRAAnRHOcbwpJ6Pmm4WcRoQJ97zxPZ9dlH6deXGXvEwULW6SkFJR\r\n8vH+lFDDn2MzTg4AUcR/UGNytIyoukJ3nJbddx2N8Zn8aEji6IUpjqmmyfkt\r\nOtIZorjo8HuL/1jRMicBCH6O8MqUx+KsRe8/pO8wxMqK/+AEuFKhRZECJDGW\r\np7KLIWbVYbU9Cs/083yqrQLfz7ibnNAPgh+Tx+zC/j/6l3OUXqs82XzIyt+Q\r\nkME15TRJBqaX+nSJ+HAP+bCe8xHyNW4k747ahNMH4czDZuINs414YlJEM44T\r\nGwtrmDxINJMTQvg1Zw9EjoyiMn4oCFS13C2akW9gK7NN7lXLy3W0Ve7VWa9j\r\n7poXK9GBG8oxAh8BmMFiTawfiC/TKYGNJpJ/FKTvbASQ4f8CNLi+cC/qiDPf\r\nDkdnXDi7eI2JFSTqE54zXnvgFt5UgNL1+w49W6X0Y0S68o/v9p2unBu8Ne4T\r\nBSyggSOjktJYcjp1udbpbO5VBh58tzdtP9udw/kqryYMpm1sC/D+5sTA1MqW\r\nT/PrWt7+hSUv0a7Bv035LSBob2N+jx9Ps/cngK8+x8SpHbTfZsJhu0vKKh0a\r\nvT0BuHz+5h0xHsMjAqVaW/l+UM5Oimuzj4sd5pFn3RmbUAwWIacgX77SoNds\r\ngT636rHKqk2Pqu3nRStqLgiOMs0VtSo/g+A=\r\n=+pWD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-b000b48c3f96f77734d6e94bcc42293ad0935847-18.x/balena-jellyfish-metrics-2.0.243.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-b000b48c3f96f77734d6e94bcc42293ad0935847-18.x/balena-jellyfish-metrics-2.0.243.tgz","_integrity":"sha512-bbBem3I/ZgWdXMqpOsUGrMlOeMPNzZR/OPu+kycAA0vZmZ4d9APA0gwmdeKUvCnAjpt7VRd0IZtIdZZY6o5CHg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-11T02:54:55.972Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.117","@balena/jellyfish-environment":"^14.3.12","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.64","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.243-renovate-balena-jellyfish-logger-5-x-b000b48c3f96f77734d6e94bcc42293ad0935847_1665456987316_0.5411647966863347","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.243":{"name":"@balena/jellyfish-metrics","version":"2.0.243","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.243","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c2c2d5dd6b4ab41a237ea969f6d0e37b8f5bf43f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.243.tgz","fileCount":15,"integrity":"sha512-1/XjxRqUyaT8KkSF9C+IAO3ZxBdEQih7AQ3L4DBm6V+CXyxB0VkxDQATxaL0FNWyGH/ig8Xp/pL/dUin0OAl+A==","signatures":[{"sig":"MEUCIQDIBpEaNWZ2i3nS19a/y2I6S4WQWt+r3DP2+iXdMt1rSAIgJxv1YMjLrJMEqqAl5ej7uC6xKHD3G9L3yfWUztwgrjI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68262,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRNwTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqITA/8DnE10ELa1Znr/GiQ29LgqViCYuWWoRKzV1PlnZoobdvcz/Em\r\nZeVHdQ8EuAnkDJAj58hkPgYJEqS+SI/VlTHswviMRDyu0TjXvcpVUCbjI3ER\r\nl388pPKSWAFL81TaIp4WGDa8RRDseyyEmaqBPG1oKUduvPxFCYWdi2c4FSaH\r\nfSUErc6WUMXUomsYWemWB7htq3xvoyV68tdQIl0rr+/mX2Xjgm3rpjS6F3r/\r\nyf7K5bMmUNWm+wHIq/+1IgPcaKV5VBaAfAXPHgNt69XY17SbM6wklHtNXEvm\r\ntJUb6hUMv9o05CZ3jfsWRjeBwHFkc/3fBrO2E+stk/P0Hbxors7czPw+XASH\r\nZn5T9PC9YBiyk9UnAHUT5VazeOgojw76wB1AwAFv6DcrtvigsfY27TYdAwGE\r\nHmMUkqt4duZwhEx9ZNyCHK2LFEWCpFqfWNrAjKGKcDN6Tx2nUUPtJBY8vFJq\r\nMnbSnZyLdRSpbJRoIqQv1WSfKwFjJRSrKLzoulElpHmlQ1Bu7oDnH7Ap1CA1\r\noAPHrVZbgOxADsa11ScbRFN51EezHH4kMlsKcEW+obFFHEO+kaKgFpGCZ2rk\r\nHu1ef2OXv4DakBNypKjYXc8/jEoiIktFniAcyin7+nSmkiyqlIh+Qmi9kViR\r\nixKpPJ0Pbs7oPMf8tYkKsDqJ5Ea0PQn7olI=\r\n=MmQk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-b000b48c3f96f77734d6e94bcc42293ad0935847-18.x/balena-jellyfish-metrics-2.0.243.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-b000b48c3f96f77734d6e94bcc42293ad0935847-18.x/balena-jellyfish-metrics-2.0.243.tgz","_integrity":"sha512-1/XjxRqUyaT8KkSF9C+IAO3ZxBdEQih7AQ3L4DBm6V+CXyxB0VkxDQATxaL0FNWyGH/ig8Xp/pL/dUin0OAl+A==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-11T02:54:55.972Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.117","@balena/jellyfish-environment":"^14.3.12","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.15","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.64","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.243_1665457171280_0.13236792441443912","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.244-renovate-typedoc-0-x-8c935a4227e278242e797c069befe18c20725341":{"name":"@balena/jellyfish-metrics","version":"2.0.244-renovate-typedoc-0-x-8c935a4227e278242e797c069befe18c20725341","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.244-renovate-typedoc-0-x-8c935a4227e278242e797c069befe18c20725341","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"572752d4e0fe4d01fcf39f20804e9d9798740bb5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.244-renovate-typedoc-0-x-8c935a4227e278242e797c069befe18c20725341.tgz","fileCount":17,"integrity":"sha512-gYiI1pkRqYgJNujeiS6d58NthqeYzA+lYE7HOTZTPuFyOzLWkAd6Rs/hbHTFP3ewV9iR6MnyetLlvk1jFTa69A==","signatures":[{"sig":"MEYCIQCQwPe+yvw5NA1IOKJq0FccIjMruMsJUYXPvjTMDfS2qgIhALpZuHCeJ5xQKIdgeApgencP5tdR6CH2xyUvuG+X7U6z","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68324,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRNzXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmogaxAAjYy4S1eglNDPcDIUPv/emHvIYS5ZHkyeItwfwbJrgFAUEDFU\r\nqCiFpFJKhX62rG1RkAu54Hv64mtBi2fG35h9fbjn78uctCTeJpSLUWLyHph+\r\n1tYFoalam3h/xuxuD+OCa29sFwS3Nm+Qs9HlVhHxtNrD4uKP4DqJuOVJPMW1\r\nMUwe7t2SKBut/dCHx8kPqdIbT2C6iz0RZFWhqIBCwoGisWSKdqFBJx3x7F8k\r\nHfZEr18gp7FKW/LzOU/NtIWyIaFgyZZibpZe6PuYKfWKe+2rlNkxQXHoEYeQ\r\nzCOhKRPVvbT1v1f6+mBRaaq4ekYj90VjmYO9Yf8/jfcaM8C/DxIHpHn5OPiN\r\nJoyK/MxAMSmurrBz5FOLFhsnm3iIEkcaGiRThsdHsCtu628ouJsvkH0rx+Ty\r\n5KW+WlKmaKHHp3hTiP43Wu1xJ6hobn9bGJHbWEtOin+vaATJd/Rje06hrfny\r\nzWar91F4X7wiPNf/VGEkG8VZ4JMP8GGqu8sJ1HBweDKr6p583Oz121+/DMDo\r\n/ptt8Cwd4uS/rsDMjjz1kZBp/FbeeQMsuNA92Z4bmNn4vo+ETFrRBz3b3hO/\r\nrw9cMSQegjq8eOhy/yCTqvlXvPM6d3ig0kiEqmHVya1lLAA28RnVJsWW85Dm\r\nORLqkrexYDVMHyyVu7P/ogetnLypYRemJgo=\r\n=Ay7d\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-8c935a4227e278242e797c069befe18c20725341-18.x/balena-jellyfish-metrics-2.0.244.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-8c935a4227e278242e797c069befe18c20725341-18.x/balena-jellyfish-metrics-2.0.244.tgz","_integrity":"sha512-gYiI1pkRqYgJNujeiS6d58NthqeYzA+lYE7HOTZTPuFyOzLWkAd6Rs/hbHTFP3ewV9iR6MnyetLlvk1jFTa69A==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-11T03:01:02.243Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.117","@balena/jellyfish-environment":"^14.3.12","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.16","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.64","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.244-renovate-typedoc-0-x-8c935a4227e278242e797c069befe18c20725341_1665457367037_0.7466656736364887","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.244":{"name":"@balena/jellyfish-metrics","version":"2.0.244","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.244","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6d6a53d79047a159b4d0aff24516288aab23ac3e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.244.tgz","fileCount":15,"integrity":"sha512-xC6ioVEvBgMOzq2zMJN+CwxeBbDPqjaWawNTyBmSwONRgGjcELHqz5c2qgEgQC6OhtwZ3FLY5lrj09UYQk20kw==","signatures":[{"sig":"MEYCIQCaIA7JcYbyvSjD99/B79CPCqzAb83hcRVX6KndVB9V+wIhAKd8SY+i8EkFWlgQKHWKqQHlUWEhVsWNvm1XibJKg5Nc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68262,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRN1YACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrpJA//Y1KaoJ5+I8+vXdaVWZhCNtSwdMS7zAZPg8ygr0d+yUhC6s8c\r\nTwqE3Mpobj5eMjThse/KGdpqGUoO/t4PIN74r2qj/T5QPQ1Nu/DJnx/vA9Dy\r\n3Vmis1hU0ySO+XAR1vfVzPqw3lJU/PCBbZ/o8b/ZdOYVMwJXXJwczSkHj7iR\r\n5Uf+4hi1E4Vqs+C37TYkOHVwZ+v7wMY3DIVpJRAO8DWuU3eXgYdLohnEozqn\r\n/1I4rYGkYEm7wHk5bgnteoZBMEyq+AGMsO6OEeFDpb43RtwD+7o5KbA2HL37\r\nCo33u4wvLezqaxoLMKnmQWRz5HNNaQUx8avdlUqgmgTtJJ/HNHLv+yRb9PGF\r\n8Ws89m5FWYun3f6ENHeNbGYSvlVW2K4/oBa1hBfXDOWo9sUMDO/WN1JCncVi\r\noNZHuOle82P1sUvQT/f49II7koU4D77BDAvg+AXbM8aXFm5q6VdwF5lUsqeX\r\nD7l5fjbwLzZ+fE/kAUS6+zw/8ncL1ZX5/LSClybxNJXeWVGFpNKXSh4JrNTo\r\nn/X9GfpKjZGewxkkV4QsWq3Oq/lQrdqVjm5Bcn13RMqT9PV72xPYhEiS8laZ\r\n6rDRNpIWmxdOdCOWfJPPpbrW2oIb7/iBUQPhDgHNOabcbSFy0O5aK1Py6XCx\r\nK2Pn9vxjsq50FeFJq4+r7KSSWiuuEE2MwHs=\r\n=F4V0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-8c935a4227e278242e797c069befe18c20725341-18.x/balena-jellyfish-metrics-2.0.244.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-8c935a4227e278242e797c069befe18c20725341-18.x/balena-jellyfish-metrics-2.0.244.tgz","_integrity":"sha512-xC6ioVEvBgMOzq2zMJN+CwxeBbDPqjaWawNTyBmSwONRgGjcELHqz5c2qgEgQC6OhtwZ3FLY5lrj09UYQk20kw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-11T03:01:02.243Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.117","@balena/jellyfish-environment":"^14.3.12","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.16","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.64","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.244_1665457496559_0.4378198111386624","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.245-renovate-node-16-x-e3c5689a066a04973fa348aaaedb10548e9e538b":{"name":"@balena/jellyfish-metrics","version":"2.0.245-renovate-node-16-x-e3c5689a066a04973fa348aaaedb10548e9e538b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.245-renovate-node-16-x-e3c5689a066a04973fa348aaaedb10548e9e538b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"aa8d04380f5360c7b13a52678b9c8bc3ef146c00","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.245-renovate-node-16-x-e3c5689a066a04973fa348aaaedb10548e9e538b.tgz","fileCount":17,"integrity":"sha512-9iicqjoHOTRXdT1ZY7uCI+c8QLLIgeFvCJiWbdwiMYW9iWntq3j8eTWkZpUknA8KMqwWqi0RVBW/TMyRZss/nw==","signatures":[{"sig":"MEUCIQDK8rGOwDKrvGvytGzGd6bBBrD837Ebs1CxNWuXv1TcMwIgePOBmNlw71FaHduPtOF0GyaxGOOfN9zCWuedNII88rc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68322,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjSftiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpamQ/6Ant+TDsz/32EJKxMvCHwGQsHXuGQwPE0CeOFi7WReD2YLTaF\r\ndrKoIh0ET+CrcLxK9l4khfF4ke4v17VPzIW4aFfiDHwl6mbRBBVqg8EDSUeD\r\nTHRW/H8tIxAokIs91kzegIUulo7YKtOhdR/HiV6QICgnu6xCrwkTD+U4e2To\r\ntcMUmFlb9hXLcwX9RiuF81waVDD7tF5j5ry6HAVMgNIY6mxLIXEkbnpLcFFJ\r\nKXSqFLx19SGCSmV6fjm0frj3j4OVOqV0FMorvQ6FDIwXgLm0xFOlZILS+4fw\r\nJjbdtPWaJ8Vglb4ZeGUJDKLSvrS4vkL0aGrit/U4+amf9ZKhp68qiY+q4Rh7\r\njZG/a+AWOOjJvW7ynFVTsZYawvST0LOidGy+yfgr1gMS31Y3pSdhul/eTSNB\r\nZ5B9gQSctvFoREAlzksm46jdjiTchgTccT6BSuUQL2ZpNMP98qeDsT/I2uZC\r\nKwGMHROvhEq1LQN13Zr/1wdYR8sr3XeiOB+748tG7Cv/kt4Far+QI0+s+Qok\r\nMrFww4C7+St0tuOc2iAlITpuoKucTHkFpwDDs+7BR0InQ+iM78u1f8wAyhK3\r\nIfZ/fKeKkRjjmRK7FgvBe9gdX5/qeFvUjlZ/aWW8tL38411TRY6UV9pGmeHR\r\nbYk8cGni1VengXzuT2z64PN1r062cqyY6jk=\r\n=TFe0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-e3c5689a066a04973fa348aaaedb10548e9e538b-18.x/balena-jellyfish-metrics-2.0.245.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-e3c5689a066a04973fa348aaaedb10548e9e538b-18.x/balena-jellyfish-metrics-2.0.245.tgz","_integrity":"sha512-9iicqjoHOTRXdT1ZY7uCI+c8QLLIgeFvCJiWbdwiMYW9iWntq3j8eTWkZpUknA8KMqwWqi0RVBW/TMyRZss/nw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-15T00:13:00.547Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.117","@balena/jellyfish-environment":"^14.3.12","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.16","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.65","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.245-renovate-node-16-x-e3c5689a066a04973fa348aaaedb10548e9e538b_1665792865773_0.7311098117777721","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.245":{"name":"@balena/jellyfish-metrics","version":"2.0.245","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.245","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"efc52c25abdd147b9b7e4cc2b376fb6a7bd7a2cf","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.245.tgz","fileCount":15,"integrity":"sha512-VwrEyUf+PO9qlN1Ub6hAVDvwQYhysNJrCK/OT0AAjmFogqiS00/A5EARLDtXXj68kjDAAEj36/q9KkTfxh1fRA==","signatures":[{"sig":"MEYCIQCDFdDZuNeLVYvGx48BkeV4dtgK6XwHFfaC9DiqFCqsAAIhANe28CQugupPGPK61kfzjN3BnLndWQJbJ0Wczamb+43k","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68262,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjSfviACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo0aw/+IWfnYpmsscT4mBY/wTitugAZb4FH2eBLIwLOXwkwTaA32W/o\r\nTYpM8ens1Jm6Zdu6Bm12oST2jf5HLjT2GJNGdsPngf4XDD1SMG+CpUEwxVIw\r\n+kKqsr5opGOFa46aXXC1365UIez+ihWPCgqr3ylNR4JHizpu0hij+H3zeDiJ\r\nol2WARpXnR/VlCi+KTEOmS3IEbK8X8Z6a+0L9y/d3tItlttOCHOTZdjLY7qk\r\nG3RyT2I1gUh43y0kwH4DBEdi4peGHcJkhe+BaVkUhZszTlhqY2dTB7IkYZEh\r\nfcJlpxgagI+PU+UEUsY48/Y45BKfXfesE+nXJOKcDPTv3UlRKFB9pzIeRcES\r\nglaEbAIQ/br7K+zc1Eus728h8p8K8GnC3lz87nv2kPAKkPymykImlG0BOiN3\r\nJcz2xHC4OeEtzDYsXwtpu+P5s95RY6kFiemRJ1aaDoGuv9g3olsdCO4YjN83\r\nzRHj/S8x38z81r7Znfg/zOpcs2EerZ4cSbXp+bRFhFP+ALTDLtwzc9NHtI10\r\nAT/i7L1hPK1Yk0gHQjHIObFlr490tCOFumwGJfzDeknZ6DSt9YsJ/I8N9gRd\r\n2yHf+YcJ1EASPSvRhOW6ZtlDHiVsM1s/VfZVHjcNrR99ZE+CzI7CvEI77X3V\r\npZZPfHvvu6p4pb7zTCZ8fsSxG7AxRIgjrY8=\r\n=52jp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-e3c5689a066a04973fa348aaaedb10548e9e538b-18.x/balena-jellyfish-metrics-2.0.245.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-e3c5689a066a04973fa348aaaedb10548e9e538b-18.x/balena-jellyfish-metrics-2.0.245.tgz","_integrity":"sha512-VwrEyUf+PO9qlN1Ub6hAVDvwQYhysNJrCK/OT0AAjmFogqiS00/A5EARLDtXXj68kjDAAEj36/q9KkTfxh1fRA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-15T00:13:00.547Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.117","@balena/jellyfish-environment":"^14.3.12","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.1.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.16","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.65","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.245_1665792994497_0.6212377634116197","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.246-renovate-jest-monorepo-fb3eb73d94c44ea69d1ba1ad0b6b9448969239b6":{"name":"@balena/jellyfish-metrics","version":"2.0.246-renovate-jest-monorepo-fb3eb73d94c44ea69d1ba1ad0b6b9448969239b6","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.246-renovate-jest-monorepo-fb3eb73d94c44ea69d1ba1ad0b6b9448969239b6","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d9c19c941b1e2d612a44aad7b064321b7a2ce1a2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.246-renovate-jest-monorepo-fb3eb73d94c44ea69d1ba1ad0b6b9448969239b6.tgz","fileCount":17,"integrity":"sha512-1oZhreCUYud4yB8GrTa6VOmT17VlNwES97YqapdR31qGyZL1NH6FhOUxXH1m3GOyyJ4KJR+rLQQ78MLY1LE/kA==","signatures":[{"sig":"MEYCIQCrbPR0e0LiW6JoeCqSMqj9PJahhl7ue9JdAScgcji61AIhAOxBexmLhK3r/bKLA42w4CZ9VgwlQHF3jmhBxQ9cr8Wm","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68326,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjSfyaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqddQ//TsUB1rxRKnsT1Z+GK2cn+u0qWwpMG8I1H9at621CvIk3Ltmk\r\nGzZ7J0SiyoWbNYtSGGCGENGiHuP3OPKNlEmYOJZZp7xiLhvTYmoXt4BTQuD7\r\nYb0aUnQVyCv3uqKncezexPLpJyIdbMc9oEwGfrB5jqKfMRgHfSJNRsyWVhmj\r\nX/VZxDDsHKb/DyZhvpRg5aEd4rpHx21w396NS7BBQRyuTyvxMI6XOZOjhWUT\r\nCgwpCeJ9yDLXJuPZB+eazHjJW5RtJCytUksDTgrerWETzspUGNz6IFdYMXt7\r\nyakAhY7N4/bDad+vXoXo46eMBdZfD4lFlZpBVd5eZ2Q7bo9SoL4/pywwu1wC\r\nSvhj3mPKJBec0HOlymmWjcsyiCPXHurYTl8zh6HzkujpUP1x16GhXP8Wts7J\r\nRwOuFtNhR+g/4QjufrZsefzFTk9VFa04VoHLj7W2bQ6HeUwPKfXG0NojjXsZ\r\nlil8jIu8nPIaRArXlen05fk+KCo6PaVKJbBhRmiU5FnRZsuUgmNNIVjpdSfQ\r\nUx2unaN4wJU7CNMjjnPvuBUGxy91U218XBI8Qe3OK6k/BEY/RcKzINYhMQ2R\r\nyIUbtYdQoiUojya2mMj6UsjswJImVS7/JAmVwOpcfPmHjpHya5K7OismtncG\r\nYPdAN7UtToPqwQHQOuiTPC8HlcuW35agN2M=\r\n=oU0y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-fb3eb73d94c44ea69d1ba1ad0b6b9448969239b6-18.x/balena-jellyfish-metrics-2.0.246.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-fb3eb73d94c44ea69d1ba1ad0b6b9448969239b6-18.x/balena-jellyfish-metrics-2.0.246.tgz","_integrity":"sha512-1oZhreCUYud4yB8GrTa6VOmT17VlNwES97YqapdR31qGyZL1NH6FhOUxXH1m3GOyyJ4KJR+rLQQ78MLY1LE/kA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-15T00:18:02.531Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.117","@balena/jellyfish-environment":"^14.3.12","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.2.0","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.16","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.65","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.246-renovate-jest-monorepo-fb3eb73d94c44ea69d1ba1ad0b6b9448969239b6_1665793177838_0.7289484601140794","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.246":{"name":"@balena/jellyfish-metrics","version":"2.0.246","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.246","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"dc187178618beb0eac0658d5829efb4a68d83d30","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.246.tgz","fileCount":15,"integrity":"sha512-Tmwso/mBYguFM+/czfka+MNdKijMX2SF3H4WKjK5XE9cVFyBDJuA1gbr9171YNtJFsW5K/MY5L03u55wnonFnw==","signatures":[{"sig":"MEYCIQDgzMoUZ9aUnFKwbGKMMcBnAK1iimwEqBv42/DRa7JZegIhAJ3/j/qz8Qf6hZAKwxRC50pruS63KBkVjr1luxNuQ2zI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68262,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjSf0lACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqjcw/+OaxIHiWhfSNdK5p1EgWiMvtN+Aoey3yRXs0RGc9Shi+EmMcB\r\nSEHzMpms2R3WmyHremLgIwYikhehwKc85EzEbAQNN6RR9Wb+WFicaerS9ExC\r\nlUKNEi08UnEfPwwDTCGQ3wDpoyfgR76jq22fMHaPdXLq9c0Y7FHxD+FRzkNR\r\niLkdgx5ybUTe/nAkxt2SH2HtDkkxoD5XRG9yhoBeIBbruo76R8J2plBLZJ/K\r\nUYV8j6w6t1m8+2DIPLXgMKR6g+e2WK64wQ9eLxFDPByzYOgadBhUS0o4GHTx\r\nnC4E2jf+nfKjT01ArG6ObWklWl+VuGUoT8J2E2NpvAHYneMIp6SxP0s785Is\r\nKJ2/FLQbqeuadFEloqG9r//EbE1k4ZNJsz0K4ok9DaP+r7T3dM026gp6HVg/\r\ntyDxWS+Mf3WDuJyICu4kPGz7FSc+LjO3hvr8ppQazM2J7Bujhl7vDmLXB1sI\r\nEVawMExstvOcxWJKoJ8CFtiSBzzGCSyi2w+RG24e/EbY+QUBQF9plGQOC/F6\r\nx60BolnJDDIN0tIQqtZsH5TWj0CpWgF3zJJJbIfMX0HeVxR4IztNv7wE7Kyr\r\nv3XxZu+OXfFnHClj971Z5mC7PvW0SFm2HV98G3r4roVPQQnoZE7wxcd5Q2nv\r\nM+s84mL0vNXymVzpdLg0lMx53ZcjeDBEuhk=\r\n=kKDp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-fb3eb73d94c44ea69d1ba1ad0b6b9448969239b6-18.x/balena-jellyfish-metrics-2.0.246.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-fb3eb73d94c44ea69d1ba1ad0b6b9448969239b6-18.x/balena-jellyfish-metrics-2.0.246.tgz","_integrity":"sha512-Tmwso/mBYguFM+/czfka+MNdKijMX2SF3H4WKjK5XE9cVFyBDJuA1gbr9171YNtJFsW5K/MY5L03u55wnonFnw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-15T00:18:02.531Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.117","@balena/jellyfish-environment":"^14.3.12","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.0","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.16","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.65","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.246_1665793317245_0.3291612777781283","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.247-renovate-balena-jellyfish-environment-14-x-cefb553d46bb6cdb37e033a3bd514ea882ff49a8":{"name":"@balena/jellyfish-metrics","version":"2.0.247-renovate-balena-jellyfish-environment-14-x-cefb553d46bb6cdb37e033a3bd514ea882ff49a8","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.247-renovate-balena-jellyfish-environment-14-x-cefb553d46bb6cdb37e033a3bd514ea882ff49a8","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e8cf04593e99951b0ac2668a6aeda6b61095a78e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.247-renovate-balena-jellyfish-environment-14-x-cefb553d46bb6cdb37e033a3bd514ea882ff49a8.tgz","fileCount":17,"integrity":"sha512-ubLlYEz59WotXGDyg6dElrKfMznVG/mF9/fRLPSTxyLVGAID+E9Gzpg+1wt9t9bIvJLdz4PoTTUYo3v0P1QoXQ==","signatures":[{"sig":"MEYCIQC5rb0EHQJZgZCIzywPO5B78s4rC8TUUTje4R7XpxjKIgIhAI0P02HgHaeNKXoGJFGpp2yXquXwqcccMReqk4KbKK4i","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68346,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjSiJqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqboRAAjUke+F9fu2cGTJ9x9TXdaf2JNKGlegaXZrUwrZitUDt+ntjx\r\njiplwNp+ZIAeQCAnQx2yn+Dthofm+u7qmyZa7D/cHQDjtAy9/HNRAn0Z0fhK\r\nV2QPhi2d+SQa9LWAEw9YFmx38ovF5f+kna6bPojKIaRBcAlT1Yj1K3JI7bO6\r\nzhvLP//1TyCKD4OTgnuhiUAoJG9IM0LpGEzv9nd4C9zAH9j8gAr1LevT+doR\r\n14DvV3iZ6kI2npCGfeWBb93c/QHuwvMsnAPS9aMiDSFD6DhK6GmoCbCNPy1q\r\n6upjJ1W6X0hYyIbfgDTRPsUhX8vK4auc079JEyLb5dxgyDRsrzGiuKqfbdql\r\nWRDFl+N7agACoJvAhwO9fPdpTmCfkz2PxQJzAoaFsn8BLFXXbBjby7wHI0u2\r\nAfU9dVJvp3oFT/Q5EQYqRjesgE0kiTncvNfepEABIW4C3k57Xay2BJaUljnB\r\nx+0ZBKCtSHo4rjeKr+EBMMRsxT4xp217YxJKbeZZIIEESnL/o1g2+T1aseGX\r\nsQq5BrJrPsNkoTn5Ci9JrXmNiS0+n1gB+GNvY5ADhX0OOGn0E7nJ17x1OnYU\r\n6Gbqh+SboAuBBINsRUOkpJemLPTy/6ZGhIiOPy62Noz72oyI01ZhJZqM6cqH\r\ncd8ICL3iNKqJkFRqQf/OaXapkN0KIls7a8k=\r\n=D35O\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-cefb553d46bb6cdb37e033a3bd514ea882ff49a8-18.x/balena-jellyfish-metrics-2.0.247.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-cefb553d46bb6cdb37e033a3bd514ea882ff49a8-18.x/balena-jellyfish-metrics-2.0.247.tgz","_integrity":"sha512-ubLlYEz59WotXGDyg6dElrKfMznVG/mF9/fRLPSTxyLVGAID+E9Gzpg+1wt9t9bIvJLdz4PoTTUYo3v0P1QoXQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-15T02:59:23.142Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.117","@balena/jellyfish-environment":"^14.3.13","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.2.0","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.16","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.65","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.247-renovate-balena-jellyfish-environment-14-x-cefb553d46bb6cdb37e033a3bd514ea882ff49a8_1665802858039_0.7130944357748943","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.247":{"name":"@balena/jellyfish-metrics","version":"2.0.247","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.247","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"63448ce5e502cdbee2710a4ad70afcd3296a2d0e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.247.tgz","fileCount":15,"integrity":"sha512-hwV8rRcmWKXJZo558vGCwjenTvrr9Q+G8MAfAdciWLzz+XQc/81UK7pvmG8A6gCnGfsKBfUc+BMCZ2VviYfogQ==","signatures":[{"sig":"MEUCIBoWAU58cmqUPXXO2CimirycHRtI7LdZJIPWw/6Vk23rAiEAkDxXGQZDRhHQapKF8Nmy1a9iQi8KtVqPX4lsB8hx36g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68262,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjSiL1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmok2g/+I/eNLurJqrvpk4rRzwQxxolx61cG+IHTfnWhJOW1jXxfPd74\r\nH0ry76G1O5uRyflUreCBIC942KoKUM8pMEy8LLz74QbeWjRUm4TM3DnJx9iq\r\ncvo3Pv+VuWQ+xvbboguHe01w7OxGORGRzFPncwXxOGQtMxVa3Fc1VFwJ3Ps0\r\neiTqJDovFLV30hFbigxxTCygRiuW0ftaGOHmj1bnu7y15NNl/6pabtkoOrMX\r\n2WaSVpyoCflXSKYq2P1Pyz6ol+s7gv/JYjLA8yGu8laxtIdtSirNOPtZdKOC\r\nlYGqU6Pl+cN3SnERgGemLXSGCbmz8I7PaqwxvGSjIeddw1uNsU28iovMQsy1\r\n2capG/8CLVNTcuZW9N7foz+0yQBtMniIuDxrHPpQtH9my8gYWokubpqYp97X\r\nUdXdHjqk8w7Q49kXrswm031FLsvP7m2tvhKj7gTbksibMSEnOBXwb8iq9UPN\r\n8rU9WmvDdAZH+dAqOMPzQ0Nj3F1Ej6HZMLGhmjhzJbWGR7mI+lnTmgH8EiUL\r\n/Iyt4AXwnJYpoFV5i2TvawkvyJSS4lQaOkr5EvpMFrLwHETzR4RrjiGTzBDE\r\ngZxeg82wLZo0pV0xdcL0ohculpeiZINbSF37ob9n7hmmvu1uVvNRHHO6HeFw\r\n9L1uVzj5hS7S+tuJuJyBfYxMbrHf4OZ0bKY=\r\n=9FjL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-cefb553d46bb6cdb37e033a3bd514ea882ff49a8-18.x/balena-jellyfish-metrics-2.0.247.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-cefb553d46bb6cdb37e033a3bd514ea882ff49a8-18.x/balena-jellyfish-metrics-2.0.247.tgz","_integrity":"sha512-hwV8rRcmWKXJZo558vGCwjenTvrr9Q+G8MAfAdciWLzz+XQc/81UK7pvmG8A6gCnGfsKBfUc+BMCZ2VviYfogQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-15T02:59:23.142Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.117","@balena/jellyfish-environment":"^14.3.13","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.0","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.16","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.65","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.247_1665802997161_0.264438550359257","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.248-renovate-balena-jellyfish-logger-5-x-d90abb0ee116b173b71373a4ed22eecfed88be7a":{"name":"@balena/jellyfish-metrics","version":"2.0.248-renovate-balena-jellyfish-logger-5-x-d90abb0ee116b173b71373a4ed22eecfed88be7a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.248-renovate-balena-jellyfish-logger-5-x-d90abb0ee116b173b71373a4ed22eecfed88be7a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ea161dda277250bd3a1029d87b4aff382dd51178","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.248-renovate-balena-jellyfish-logger-5-x-d90abb0ee116b173b71373a4ed22eecfed88be7a.tgz","fileCount":17,"integrity":"sha512-U0GdVaP0pFOG8UelgJujrR0zB+AZG2F8dcxrfWhISW7GKZ3g023yClcK6gtaNELKVowA7m34TRnT9eduZg4MHg==","signatures":[{"sig":"MEUCIQD7L+MpDP8LMkcr22RBLXcEj98CptiOfHT6Priim78s6gIgXaiSStBNfc3d9FO2MCy/ZF2ZsE+REW4rRBiiLwTxj48=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68340,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjSkGYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmquehAAhItuFo1xu41boBhh7oUnBzhEYApEHvfh4SnocoQoWwzDzKuM\r\nOBE91Wg31DOFiiMP/8MrmjKz4zRWuCFqlOyRBc1+obHfHS29PHmv5m3UCDay\r\nJLNFMlD3/Rbjzk7x3Jq65942SoivECKVo14dU51X+KojUohlBpbBx5TVx9im\r\nZhmKsTwrqil3/cCzkNV2U1K6bXbU0M7R2v7cpWf3uCuFXI5umxvahYdInDga\r\nFNnnJpI6UDSsaxiEGU5dtZNApatmkTlG2Yr89AbTV1FLk/+2pP//jYCxdZf5\r\nPDk9/3liq1G9XXSs+NTtgfS8W1WCMMA9cbTm/AcqRGFbnj/z5Vf+KsXCgE7o\r\ncVg5wEvOou6P5wtHAmn7M3f3SyKeydNq99EU+Ax0dcxPmJ/z28c7Aa0/yYE7\r\nWWR6BCg2jNEBHUYo1Tpe9Xe0vs5mJ4GgVDuYdWbozTekkw43nMtj27PlA06w\r\n0f5Duhf/ojsDI+t06P7wJHme84wNvgD1WD1RvHZWW7RLl8JyPIKv5y/fdNAq\r\nhvuzhkrtWgfbymfanCyZ7IbflVpqzHi74wpWKgOL2p+jlms/zBmvDTArgJj4\r\npsesK7jfvoa2r4W0B8UDFGA2V+lpBDz9uQtA3PWtVnZ/yiXyUIxe20w18Neq\r\nDzaESa91anzRXFOCl6at7Qj4fE5M3FCtOEk=\r\n=mhux\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-d90abb0ee116b173b71373a4ed22eecfed88be7a-18.x/balena-jellyfish-metrics-2.0.248.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-d90abb0ee116b173b71373a4ed22eecfed88be7a-18.x/balena-jellyfish-metrics-2.0.248.tgz","_integrity":"sha512-U0GdVaP0pFOG8UelgJujrR0zB+AZG2F8dcxrfWhISW7GKZ3g023yClcK6gtaNELKVowA7m34TRnT9eduZg4MHg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-15T05:12:41.191Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.120","@balena/jellyfish-environment":"^14.3.13","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.2.0","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.16","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.65","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.248-renovate-balena-jellyfish-logger-5-x-d90abb0ee116b173b71373a4ed22eecfed88be7a_1665810840256_0.14599372863392945","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.248":{"name":"@balena/jellyfish-metrics","version":"2.0.248","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.248","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e5a90840c8c9ff91499589a4e7189f867f2c1307","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.248.tgz","fileCount":15,"integrity":"sha512-CfKUafdAvh2jNcBu9RbhBaE7j1il9LBojVgGRvq4jNypSQqMa61FNLZCQzqwGa2RV14+Gl7x3iE3LGxFpsmAGA==","signatures":[{"sig":"MEUCIQDU8RAqRYV0srTJmdcHaJq6+KBG1oSiMqPnG46t57cT5QIgJBGNRRc8jyEn84eVWoYHsFbgmNH4EjSZsRQOP7iipjE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68262,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjSkILACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo6HBAAhPAMgI0VZ/or8xoANfu9CB9jxTGEwUJ8uU84c/0Wav1yw2AI\r\nprKYX3RNEX+JqDY1LBKrmLMnHha7qjyRYjVzC8YrXQskJYQRFQIqDU9zgvms\r\nyUicKe09pYBDSl8YiORwut7jJluyzdEOt/HVHonuio+u2paQtmN9DBBHhqDI\r\nFaQx5mCBQKqt6tzukerQA1rdA7UgB7Ehi+yusvoMtFGnShloyi/ic9DOvhS2\r\nn3s/iwnEHCabFOuAiY2gaN8tQzXLO0BJ8ppO8dyGwtIcV/FSyYIHh1kFlcdI\r\nuPr4ukzo6TdTHjQrR50Ny1kW8omw1PCdDP6GJtBZ0Ig4eNXPUb4ndNlHTpRZ\r\nYdErv0ZAafbON/EOAC1YwNBcr97vno8P8ARO1+gGVLdeRHNepq8BfLvQzkX+\r\ng6x7Ha+ZCkpk8vtz0shxfmo+aCRdXvuP3TQuTGregg4qIeA40dVeOD2O33pl\r\nUIA7rkfv8nVaAxb6bB7tcDotMfAaW70E4IRC7HaZN6ME3hKEGCXsmyZBSPiC\r\n4/KfR/wNfxpY3VScoEbo3a5J85v7pL/S6AnAp2ri2WcPylblvOHgUIsQmUgy\r\n8cmrXIjo2/fcVhH8rgRHbYqfzQg17LH5leMAR+KnJrXeKAnC6GLBmdod5QV0\r\n+Ca8SdZwEPcRcNd+7habk3vcii0xIacr4tk=\r\n=VFfj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-d90abb0ee116b173b71373a4ed22eecfed88be7a-18.x/balena-jellyfish-metrics-2.0.248.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-d90abb0ee116b173b71373a4ed22eecfed88be7a-18.x/balena-jellyfish-metrics-2.0.248.tgz","_integrity":"sha512-CfKUafdAvh2jNcBu9RbhBaE7j1il9LBojVgGRvq4jNypSQqMa61FNLZCQzqwGa2RV14+Gl7x3iE3LGxFpsmAGA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-15T05:12:41.191Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.120","@balena/jellyfish-environment":"^14.3.13","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.0","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.16","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.65","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.248_1665810955159_0.2327215114426655","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.249-renovate-balena-jellyfish-logger-5-x-86a80586e589bc3a462efa29d2cce053f717c6ac":{"name":"@balena/jellyfish-metrics","version":"2.0.249-renovate-balena-jellyfish-logger-5-x-86a80586e589bc3a462efa29d2cce053f717c6ac","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.249-renovate-balena-jellyfish-logger-5-x-86a80586e589bc3a462efa29d2cce053f717c6ac","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2dd6ff6563968dbd193765693d560a6b9bf3f831","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.249-renovate-balena-jellyfish-logger-5-x-86a80586e589bc3a462efa29d2cce053f717c6ac.tgz","fileCount":17,"integrity":"sha512-lVJaE9g1mkw4DTgiX8ypd6+2AzdTk/MeJfdHT7stM25hZiCdPaJ3pP0j5R6/OOpT6DVh4VhzLjp2xLyklj1e7g==","signatures":[{"sig":"MEUCIQCR9axnSPJLpzZt+2qzOSJqgHMQ1VPLVPT03Ws/ZX4PdwIgFn/BRUSda8piOKT8s//XJvXvAqCNw04ZClQFJUQP8jo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68340,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjSmfNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq0kw//SOF3VdDv35QQnlwGzP+ZaCgiybC1Var1m3FzOokOJuY/x/im\r\nX5nutlcQKBNKJzxQ+gW7+RUgRkI3KwBQ9jwt6Bc2H1Cvd85KjyQwFTbf39E+\r\ntAhPtqe4b9z64JtUvHDIxkw5y8qhQTHwjGV0e13AvUKlsjYQZKWpyDJZDtye\r\n7Nv9+ybgQcuUd09Wh8H06lWTusJuDtNSNMnpcgOV3ss8w6K/23ErLtVkfPiz\r\ncVWkTvphXjP+TDGqqePW0a5DIytJVM+AkW6OnmYln9B2/25NlBiUtbXvcuXw\r\nLPWysV1EHr6UbEH37GIs4KdlBnqqPjZcakzHPsNZjWC+aHu1zcuN0NnR3HBd\r\nG/T5IIn+2ujoMV8xWsBWmv5rLI1xX/WXpfD5IFIst/eAp1E4TaVU8JR2PKua\r\nZRgqXj+Sg0x6mEaK4kx2xn8iC/pR1OO5SJX5F0ux+4/1Xi1vpDmKPh8iMUOf\r\nJ7CjselUGeV0W6RokBteiA292PhwB6w2tjtfTmU0og0sw9YVf/KJNVdfjEwM\r\n0Gw2mQywYP2MOr5Ona/1xtCxVDQqr1C9nT5e5nRUUm83O+q2EeP7te1/kxoy\r\nzxHta9/xmOgiBAIFItGK2phcthJNpTF9c40mHuqFJufx3oPbUFDHVLtCLs3I\r\nme6xaompfMSZg/ewo/Obrn7fmCnLxJmzfgk=\r\n=OCRl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-86a80586e589bc3a462efa29d2cce053f717c6ac-18.x/balena-jellyfish-metrics-2.0.249.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-86a80586e589bc3a462efa29d2cce053f717c6ac-18.x/balena-jellyfish-metrics-2.0.249.tgz","_integrity":"sha512-lVJaE9g1mkw4DTgiX8ypd6+2AzdTk/MeJfdHT7stM25hZiCdPaJ3pP0j5R6/OOpT6DVh4VhzLjp2xLyklj1e7g==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-15T07:55:28.050Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.121","@balena/jellyfish-environment":"^14.3.13","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.2.0","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.16","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.65","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.249-renovate-balena-jellyfish-logger-5-x-86a80586e589bc3a462efa29d2cce053f717c6ac_1665820621431_0.6219290514962743","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.249":{"name":"@balena/jellyfish-metrics","version":"2.0.249","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.249","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3841ceedc86fde510e6075d5ca263331cca33fb0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.249.tgz","fileCount":15,"integrity":"sha512-DGdnPQX5pIlgRXPowRPVkgXgygp68yFHKS1U9F13BgeafJqplFhEFoz6jEZTVK/foUSptp88KFYxDTbyz01YFg==","signatures":[{"sig":"MEYCIQDfZ7Ra3fNqjWYQ1uooAvuOqVIYlUTvhwg3EVl/4PNlqwIhALO28Vr2oRTrEYEhsm8q2x896jhaf9fmnoJihrYgXNSC","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68262,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjSmhZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp5NhAAkylibI5wAjXlE3VMesOjaZMwSpENi3cNUiQcCSfqyvtGje8S\r\nWK4ySECPy29MRsPjuVi5WxvrNMcWSv2vCNO+7VZswgbzoRX1MV4DLdk9H7j0\r\nTFSymkw9FQrf7HrWXlaeoUAfeP9EB6iLVDqs0ggfl2SHGIhlCiMPycSG3B7s\r\n0aLLBgvzKJBaF1G/OpRXNwFxUQTdpe3Q5woHvMreW4gkt/KKczg04c2iIepV\r\neSccTgg5zG1IH94l1jnsUIXl7YlKAXfOGCyEkNbBZn37kgiRx3NOcIP234lU\r\nqqhPqrhs5x+XTex75VMKTlqr5Rg7gWozN+L8rA8LlnFFCXG6U974ifWpVsNI\r\nf+sZeP6qnJoXUQF/g+p/VCmG1QcFAiQPaVfgcdcAlAzzFw7BkPc/ZOgzVsnK\r\nNuhRhxXqxlJEXW4AYwfAWkTZiKOIC+HMmM5k+blQikSB/3c8qd7O0T5eN/Zs\r\nFTGeksWt41XtZ/QdC2HNk0R2qG/pqr/e7PCFNt7/5kUoF6sqTKONinOdwq5s\r\nNUwq1fvb8NmsYPqYAOFo5hVIrIgV8d7tag9jKh6cRR8nj4S5YCBEOG2Z1ZI1\r\n9hK9gyS81KYZ117E5EwRfsAJkEmQA4VEtM/ZlJ25DWpFVklwR0/bxJfBvvPz\r\nE9i1QtsUZY0I/TbVPHlhit6ZX3dxfhtoK+g=\r\n=Ab/d\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-86a80586e589bc3a462efa29d2cce053f717c6ac-18.x/balena-jellyfish-metrics-2.0.249.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-86a80586e589bc3a462efa29d2cce053f717c6ac-18.x/balena-jellyfish-metrics-2.0.249.tgz","_integrity":"sha512-DGdnPQX5pIlgRXPowRPVkgXgygp68yFHKS1U9F13BgeafJqplFhEFoz6jEZTVK/foUSptp88KFYxDTbyz01YFg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-15T07:55:28.050Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.121","@balena/jellyfish-environment":"^14.3.13","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.0","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.16","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.65","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.249_1665820760864_0.16265193629586872","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.250-renovate-node-16-x-4d394ca9e36e5ec98141c48a2250a6b56f03659a":{"name":"@balena/jellyfish-metrics","version":"2.0.250-renovate-node-16-x-4d394ca9e36e5ec98141c48a2250a6b56f03659a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.250-renovate-node-16-x-4d394ca9e36e5ec98141c48a2250a6b56f03659a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ca60bea3990c8ec283980d010490869cff72a859","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.250-renovate-node-16-x-4d394ca9e36e5ec98141c48a2250a6b56f03659a.tgz","fileCount":17,"integrity":"sha512-sw6mOQoxDmXF6GEcwDa92dbs1/jgBK7Z4ihBnjxohtJX/EwPGMLs6NzWOUz3ILQ8m2o4f8hTU6HYvTtPkSb1Mw==","signatures":[{"sig":"MEYCIQD1XfyglUkdKkTezsFQee/gWNkWSUmhTCCxdczwigTEvwIhANkECMv8wna82tBYPm/EnGfzmE4sBZy7x6xtg4Tm0qKF","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68322,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjSyklACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrcHhAAov3HDg5fMD+y0wO22eTrZNeQAjd+8C2DRatn7y0lTqQsUkNt\r\n8RpXi9nIgb2CiKNDF34bPKQ6lkqNoUGtb+cEBRHBbLlbj87wOHAYrrgOWpuK\r\nBaj3AwBwzA/sS3HXEOIdaWI/XMTd0RpPBqn6pUI+c1tHviD6MyJKdqtQ7kcI\r\n6Il1dKWHO6mL78NtDC2PrmVhPZ22u9HEjOENwrJ9LGdF0ASW7D1Chg9qs7Qp\r\nddHSii7K04scUi/6wUojlwRiBdxkhVyojUtZl9nw8N4niIPsoAoNxiaP3pfe\r\nBIGqePZTDWLc28JHtb3JVQmQKkkdd6cPZSrvzjHKnqS1GEoIC+GVdK0LLMLM\r\ncKXwYWcBz1mbmVI4XkIf97tJuH7IaS5YgRcijpkivGuWnxZE7ooF6z1sxyhu\r\nXfDzIQZcuLnp+79IGiBDAhZiMIkmvpJSc1LCUDS5cOVt0h5gIxQSLeqKBHYb\r\nX4Az7AcE8hBZXbmGdiEi8n3zAtBv1F1bJA4TNOyWmne6qCqYk8j/vzLa7zrK\r\nKIi/ETIbzX3DcX6Ske4+jH97b5b3Fh3iFAzN6sSfn8RbgqqznZvI0nWDz191\r\n7hF8LAIzJRMCoR7qy0HRQxxsL09SZ1kIKS+I3GXotDiZkvvTi8mPcoOjWvod\r\nJL01k4n4yYToN3yfDfiFygMnGRUWzxBpREE=\r\n=R1ga\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-4d394ca9e36e5ec98141c48a2250a6b56f03659a-18.x/balena-jellyfish-metrics-2.0.250.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-4d394ca9e36e5ec98141c48a2250a6b56f03659a-18.x/balena-jellyfish-metrics-2.0.250.tgz","_integrity":"sha512-sw6mOQoxDmXF6GEcwDa92dbs1/jgBK7Z4ihBnjxohtJX/EwPGMLs6NzWOUz3ILQ8m2o4f8hTU6HYvTtPkSb1Mw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-15T21:40:17.772Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.121","@balena/jellyfish-environment":"^14.3.13","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.2.0","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.16","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.66","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.250-renovate-node-16-x-4d394ca9e36e5ec98141c48a2250a6b56f03659a_1665870117552_0.2733586100742491","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.250":{"name":"@balena/jellyfish-metrics","version":"2.0.250","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.250","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7464c37c44aaed8d933137663eba9eb71cb167b3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.250.tgz","fileCount":15,"integrity":"sha512-UWnJXayW4GXEkA6ys8/yI5ldr9eDS0z6D2xu3NiHhDcn99YR1F1bzyQnIPPAQtADdHHKJyrcLb+OYbx5FNaDKA==","signatures":[{"sig":"MEYCIQDNkWVszZKojRUw/lSEKfec3tKWdDp7ztKhNpdfxvXLowIhAO0J/OlonxX237FJrluBJi3u8ewjvATWf/c+cbld+itE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68262,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjSymgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo3nQ//QviHPJrtO5U9vnoAFXAhqnNWnkHf3N2+ET6cCpHwSYH18A9R\r\noqLgqQqAX5bu+mrjfwK6CyBXBxOHWicJHggd+mLHuK2prjXFY3oU2xdq3INg\r\nmRMsq5JPe0XSW1WrtyhO5ovgy+KqVgrnE7THkC3FavlnpENZmMUCUo772Zsh\r\nIUF5NreDovx5dfN4Q+sTh7ZZWXQRMu4rW1p7/o08kDQW/AO75Rjb8Y/I1Mt1\r\njX0a343Lm7Yq4XNlcAVV7Y7e2yQOqA/p7taZP0MLrD2kaS9Sy5w+894NKPyn\r\njHEuTwHbA/Sih1GJJ2L1fUoQ8H/JSpuIlysHF/ZRK2iW+6MatwYwvip7r5D3\r\n8USKEbfbjqap16wu2+C2rQf2KEUaQ6sHtaYZqQHbw+fiUWa3pXGMZVVAhCrV\r\nUT9XjKpd4MNBB6udP7HlTwGSZKiyW9y51mxD4gT6qf5mq0pBw1iLYp7Yv0te\r\nmF+gxVwfyNpF049w2c6SA+c/eKFxlAaDbWD2E/EIRhnmUkFtNkBsvihA9K+1\r\nD8laRGaWtkWJxxcZwKUc14PRJT/VdEsayz0jvnoaQ7lkcmHQ1R2e7K9eUwDV\r\nX0TcMiYZG9r0AvT/gn3lxQE41T7yANBhsz9ZHzx57XCOlN4fN98Bscj/VRys\r\n4wSN64/pct8cHJZcUmqMi2rzY+3E6AZ1RuQ=\r\n=6WrP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-4d394ca9e36e5ec98141c48a2250a6b56f03659a-18.x/balena-jellyfish-metrics-2.0.250.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-4d394ca9e36e5ec98141c48a2250a6b56f03659a-18.x/balena-jellyfish-metrics-2.0.250.tgz","_integrity":"sha512-UWnJXayW4GXEkA6ys8/yI5ldr9eDS0z6D2xu3NiHhDcn99YR1F1bzyQnIPPAQtADdHHKJyrcLb+OYbx5FNaDKA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-15T21:40:17.772Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.121","@balena/jellyfish-environment":"^14.3.13","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.0","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.16","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.66","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.250_1665870240508_0.19023830968863065","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.251-renovate-balena-jellyfish-environment-14-x-e33dfb27dbc2ddc3fd302c3df86155567da15210":{"name":"@balena/jellyfish-metrics","version":"2.0.251-renovate-balena-jellyfish-environment-14-x-e33dfb27dbc2ddc3fd302c3df86155567da15210","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.251-renovate-balena-jellyfish-environment-14-x-e33dfb27dbc2ddc3fd302c3df86155567da15210","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cb6748992c7bd0c9ebf2ea2821c1637dd8b336ba","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.251-renovate-balena-jellyfish-environment-14-x-e33dfb27dbc2ddc3fd302c3df86155567da15210.tgz","fileCount":17,"integrity":"sha512-H5q3HNLNoM3rQb8lkuSLTR7x1MDVtuqVBZHnZgdrvvM08RJntRsK1b5392pfxMKUmrzpLlrnPptVenvfcqjLhQ==","signatures":[{"sig":"MEUCIQCXWx+3LVeefA46G7XRH8pOGCwdI7HNuTHPpNHQ/CvbFgIgeLdYb4zCzOS4Mf+23Mj+j7WEQ5JTJSGY1Yu3PR9LMt8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68345,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjTN6JACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr/sg//c0qvXeNYgCV3oc7NDkIFe1QeDpXpCz2M2F5zg51mxZjSlpiJ\r\nHhixI0n2tt76PKHgoKNHG2IotZJtb8C6L4klUAZvqycxoBRcF647/6SOXNn1\r\ni+TSCaTcstnOsT5aCWBgAWD70xvkEbL840n4kZbdcNdXj35sJxGvmgkZkThy\r\n5nAxr34YOAD5RAZtmlxffxnpX4Im66SIcTSzt6gRMaz9vrKocMW0vLPBOoxS\r\nNNAqgnlWo2cVJzd1U9o2WCEnAeRRtHiPsrGlH6/EuYXUZ+bj1lbckb1oYcCO\r\n4Qm+2PRnEoav6GWi5ID4UH1KBdC8LV+F3oFR2JVfJVjvRHs2yT2Kl5BvDOhy\r\nvWPejncY5mFpOyqDXrGBi7C2D85p3RIX1DRFESDTMP/cT8MM2qqVbhaiq/st\r\nYInC/EvyiBxS/FzzzL8CSmTJDSeROs8rRrzZwkfI62L/qEx+eDCBS5rCiHbW\r\nTY3bFcwLKusWyw3INPHUfbkntzVIKlqy1L+3HzBVISge+rvm2bmwmaTYpNsW\r\nLNW5OBmPSeRT5RJQ6aPCGQ/Qm4iWE48g/xfJ+xuP8/Pg6qyWshHvUKpGuq99\r\nOfCuLz93p64ewbHmYODtETTQdMvrzhFUJziyYQdmjaKtmlmVc1EnQhn71RRX\r\nwuCqswyZtO89RZ421BveIDWZBJZ8U5rKwnE=\r\n=CfFM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-e33dfb27dbc2ddc3fd302c3df86155567da15210-18.x/balena-jellyfish-metrics-2.0.251.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-e33dfb27dbc2ddc3fd302c3df86155567da15210-18.x/balena-jellyfish-metrics-2.0.251.tgz","_integrity":"sha512-H5q3HNLNoM3rQb8lkuSLTR7x1MDVtuqVBZHnZgdrvvM08RJntRsK1b5392pfxMKUmrzpLlrnPptVenvfcqjLhQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-17T04:46:40.929Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.121","@balena/jellyfish-environment":"^14.4.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.2.0","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.16","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.66","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.251-renovate-balena-jellyfish-environment-14-x-e33dfb27dbc2ddc3fd302c3df86155567da15210_1665982089739_0.1087407081067473","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.252-renovate-balena-jellyfish-environment-14-x-c44ba862f09d803ddebe355e875197da0a2c4baa":{"name":"@balena/jellyfish-metrics","version":"2.0.252-renovate-balena-jellyfish-environment-14-x-c44ba862f09d803ddebe355e875197da0a2c4baa","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.252-renovate-balena-jellyfish-environment-14-x-c44ba862f09d803ddebe355e875197da0a2c4baa","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"df418b00d8644bd1450b9aae7ca220a1e3920924","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.252-renovate-balena-jellyfish-environment-14-x-c44ba862f09d803ddebe355e875197da0a2c4baa.tgz","fileCount":17,"integrity":"sha512-DqwDgh7qtXakZgTa4K63O7Rfp0k0L7OcLg+PRVI1kkXJfib56XdZvrIUJQF0pdnRNx0Q/XBO8uUEsAHQpxANtA==","signatures":[{"sig":"MEYCIQDZRhw/R85auaJhvXfqI/KWCFfuJBPAmqnbdQVdnC+f1gIhAI2UmfF4sYcvKx4SJM7+MdeWy01xZ+RDSDYIoT0hMvPi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68345,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjTjY3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrc9w//UG5sfnktLs3gKYbd/2dh7kpPtQbi4ccZXhhVvglOs3UyKfrD\r\nC/nciuBGJfj+aixJNP0S4me5bByG0bojFWktNf6PMC4QGvpIsMXDBGKAD3nJ\r\ntB1taM2mGalBKiUijL/tZcBHiGSZcblIG5rOrag4gL5xMM6cHfb3qjf+W+Ow\r\n/bFO8mSpkH5f/uYT6MMd+zFKBEc5IiA8L6Sh3CYipJQEB8catTrtLbBHy7zJ\r\nhJW49KOkhXlK5WLEw22K25vMm5V+wbMSw9EMm/qghUfLYiKiRtMK/7dCsqgT\r\ndNkx3xIvqOlUF/lRHcZnJjy84OF1cg+ateEQymuDLJ8DljT2hK/lpwfycM/W\r\nOrYMH5UpCI+R+1qdiKxkL+QQ5m32TT3ij6iBmmu3hZOv40PsEvgOiv82Xlmh\r\nrq1cHErHTD6f0t1AwkVX6pLfk1P12lmvEIGMHO/A2PS56bghroD8ykpw4AHI\r\n6OCHTuAvUnes08ypKsHqayKbMzXATro1ulGg4f5zebKCFnAI3bXp4loJvRgc\r\nTwuxc4GRFkPT/CoSDsgOoM+IbDJfPd9pYrfc6sj30bzYSWfCo1erlGPmHcso\r\nYCQ8USQxMu2Xq9SVp85l8kjaKOVpNCF+BSRy8BYgRRVETitBlg91gMT0keS2\r\nTbJt3xwaCAsto3B9WQa810luCjM2WaXtrUw=\r\n=Q+Ak\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-c44ba862f09d803ddebe355e875197da0a2c4baa-18.x/balena-jellyfish-metrics-2.0.252.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-c44ba862f09d803ddebe355e875197da0a2c4baa-18.x/balena-jellyfish-metrics-2.0.252.tgz","_integrity":"sha512-DqwDgh7qtXakZgTa4K63O7Rfp0k0L7OcLg+PRVI1kkXJfib56XdZvrIUJQF0pdnRNx0Q/XBO8uUEsAHQpxANtA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-18T05:12:44.091Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.121","@balena/jellyfish-environment":"^14.4.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.2.0","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.16","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.66","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.252-renovate-balena-jellyfish-environment-14-x-c44ba862f09d803ddebe355e875197da0a2c4baa_1666070071555_0.6746373431637382","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.252":{"name":"@balena/jellyfish-metrics","version":"2.0.252","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.252","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b3efdb0fa8c41b531810a25368807007b555dde2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.252.tgz","fileCount":15,"integrity":"sha512-vfokaaKAyTdBQpzo0kf9Zlnv10zYF5fCyew1Mf+X6UPbW6qswCRNjQJ9J1Ulr28CZnv5qZCSw0Yc5ZktHIBGzA==","signatures":[{"sig":"MEQCIFlWLcviGAM3pMpL0p9DZe+ZvtiztcqWb3SEpCn85MoUAiAWfT46Gmc7tLMQmlyK2H6yycqKCD/1JZBrOXQKB6VC+w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjTja8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqGGBAAmP8Np7wuq//hB5z5sqCUJJY4u8yUQvyvwpMLReVGPF7GLSo5\r\nTdPrAjx6RdQd81NeSDV8c6OHSnOhWX7yo1CSq8Lbm7snYOKYJgUMDFTbaMw8\r\nIRX1MV4P9/0xesQjeFwvHd+LSKCKUUYi4mtvoMpbNCf6G1IIX30tLjzzbiMn\r\nuHv9kjE2ncVa5AAnQNG4NBOFqVY8gLxu1ns/xXh3Bc8SUpqhGX+ytpRAVZ8u\r\nbW/1cChVxBjNnlg4c2On72cRob55iwru9ZTL1i8snF3spyIe9vvdUc4VXfae\r\nneJlUbAMEXPgxaeVshcgxfd1Oss04kDuuHIAkZN2kA8cGEZYHyAFSB7nwCIm\r\nlD+HPtBV7WKCDMNb38od4NE8VgFXpP78AOZ2Rr0F0ksWqZADIhv3vuCokweY\r\nEZ/44Se8YppMMz4zv1c7bM3EVucMzeMVHCdXsVgIirfO21h2NcOPc1szzjNZ\r\nZ60Himxrr0Ze9rEJF78klynT3AYwdHKRfURjfGRiQTE6ba8ORV9fhpOU1S58\r\nSxECnkLM9MrEA7NU/P1lIEH2yVG5tL8VPGVN6obaeobSl6c9pZe/ZfeiHV6S\r\nkdamoUfZ7g8B5ApSPU6DyuryG2oxOdDeeXHUifU9U206gnBCFSwYZaUikyFB\r\nUTpI35KWm/qjVA6oN1XU0rfgleEnEKSPYk8=\r\n=Oglf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-c44ba862f09d803ddebe355e875197da0a2c4baa-18.x/balena-jellyfish-metrics-2.0.252.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-c44ba862f09d803ddebe355e875197da0a2c4baa-18.x/balena-jellyfish-metrics-2.0.252.tgz","_integrity":"sha512-vfokaaKAyTdBQpzo0kf9Zlnv10zYF5fCyew1Mf+X6UPbW6qswCRNjQJ9J1Ulr28CZnv5qZCSw0Yc5ZktHIBGzA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-18T05:12:44.091Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.121","@balena/jellyfish-environment":"^14.4.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.0","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.16","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.66","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.252_1666070203736_0.9557206073156805","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.253-renovate-typedoc-0-x-fb48f03eb459ca607d4e1edd679bdcfc50e44dea":{"name":"@balena/jellyfish-metrics","version":"2.0.253-renovate-typedoc-0-x-fb48f03eb459ca607d4e1edd679bdcfc50e44dea","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.253-renovate-typedoc-0-x-fb48f03eb459ca607d4e1edd679bdcfc50e44dea","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0d5aa9a3ef8fc0cc93ac71fa522390f2715bef03","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.253-renovate-typedoc-0-x-fb48f03eb459ca607d4e1edd679bdcfc50e44dea.tgz","fileCount":17,"integrity":"sha512-T0cBcdK5mQpUYGMHlADR18EB+qeLPAlAvqx4raxUOIq09pjPLPQV4mp+o1odPLSRwTWbXF910IISMl9bBuG1hw==","signatures":[{"sig":"MEUCIQDigzbaKLkR1GERkW4Soqio3UWM7HHPnoCOksY/B67jzwIgFD5HuQMMzzyO6c+MdW6y7dhgtpd7Ikyq+uCNf9VeHEw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68323,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjTjdlACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq1Bg//UZ1Tn3LdbozkW45xjj3epxl2PakN3H1yP+XdNQ1EB7BWToyZ\r\n2BS90HJOni6AkMroooJ5+P3krFo9pPWs8B/dz7e1ShG/WvjrHertWZH2C/Cw\r\nyYs/iRm1Jj0P3jSCqftdDrIEuXPfr8MD0RV2eKCTh20EvlGiYrMsgEK1umME\r\natFpYTMNzEj+GQupILhnfqU0X3k1G8xaAjbB4qnnQLhXXo8/0LlsLDAdLqVa\r\njMnmwAmiVum0ks0PJWRyQUGSlwW3f09WhkaG5HVDaWGjt+uwsUDR/tHrDgp6\r\nUXqzHIOgjrxtJwS0MxZRSm12n+wM0eC3sV5m0DeiKfrIs2Vy/fJ7lklniOtV\r\nGSV/fh41y+dvr8FKdpIoLq38BPzLVaicez+ZSDWQ7QtyvVvyv6TF3q/vDn5u\r\n9RIkY4KwdXB5bJioYN6fP2DbLSPpkg63kP5dmCNui/q8ktehnMiOkPQimg1g\r\n3VUPSeMUWz3ao7BIDEi8vWKTMFP57KpaT2DyjuA9ClhDpI2AK8vM85MnxhE5\r\nis0JBasXMI3LVIzK3TVc9TRe7vwXzFtuAydZu3PumDc0QERwQeME42p8jOJv\r\nT2fvRPdd3LEKz3etmBW4QtocHSQ6xm1Zr64mvD2Xqxed2xNKqiBrUm5UhmRN\r\nVsuyHWdlurJfEf+rGh2IWLpwJSsyLw1RU1w=\r\n=TGmu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-fb48f03eb459ca607d4e1edd679bdcfc50e44dea-18.x/balena-jellyfish-metrics-2.0.253.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-fb48f03eb459ca607d4e1edd679bdcfc50e44dea-18.x/balena-jellyfish-metrics-2.0.253.tgz","_integrity":"sha512-T0cBcdK5mQpUYGMHlADR18EB+qeLPAlAvqx4raxUOIq09pjPLPQV4mp+o1odPLSRwTWbXF910IISMl9bBuG1hw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-18T05:18:06.749Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.121","@balena/jellyfish-environment":"^14.4.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.2.0","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.17","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.66","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.253-renovate-typedoc-0-x-fb48f03eb459ca607d4e1edd679bdcfc50e44dea_1666070372785_0.8974866046552921","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.253":{"name":"@balena/jellyfish-metrics","version":"2.0.253","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.253","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"73f45307247c45e1305da62f7a2d16ff45f929da","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.253.tgz","fileCount":15,"integrity":"sha512-KP6061dWXm5CEsCdGh4BS9m/7X0rpG4qZ4fJDb9zl64yzNZ1Jdv3EnGy0bcAnjIlCzwS1rns/Zghx0dh4UfgJA==","signatures":[{"sig":"MEUCIEwLWu46rtzAws82LCeeVAs2amzisa4Z33wxWHEHy4UYAiEA3ue4iH/MAKBM4/fX+gaf9snXLLdN36sTykFofOfdoT0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjTjfZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrvthAAjZbbvZnFdiXSTfHzT9D3guUBrG+SDnNe0eA1HBVcSfXLCX5R\r\nBS+iDmTlLgmiMoEf0apIVlMhhNceWRMeENxEYWgIfJ7wPwjcylIz4Is/MeIs\r\nrOx8zWQdaoliNPn3NM89hrpofYgiba21/vCaeqxlj1yaA1RyzgmEzLYr0rFP\r\np4jRWUPZgD1P/TqkmVgJKHapNMLspUo3m9JxtSr4K6siJAvQbHbpiJKfWAlx\r\n4Qzu46IQ6N2jrWTafda9Z/daBKGwyJ02Yc1N+5cwLxuPh/ojOpY4A5b9JVHO\r\nQ+9DWoKudEieD4QHpbiE+Xb/XT109fqjw1rR3bTATzP1g2fsjR4DZ+Qg5mwx\r\nnnSwgeJYU7/vwS/XMXNXal4OqhGURXZ0TIYthnHbTjqtYmwI4mVu9X0xV70o\r\nyNXK9SewOjcbORczNZ85jD6B1Zw0Zi4k57PI8zsn7MdeBGnqiVUOEf2881R5\r\nqYgOd6uwh0P36V6NrzMGrFZf2TZ9C+AEU7oRNrhyaZDOSMhJfhtlx7DOzo4f\r\nU+95M05TwtWuMGMNyKzeMfFQG68MYtGfXGNwLHmfLIf/5N6HawdlRdHj1AS0\r\nVMO3f8CAby3erOwQWimAujqps7xYDaEODWAeb/3nXU495c0JYq9IRd2qADTd\r\ntgupSfhOJMflgymALPshnA7FPOsf8NHO9F4=\r\n=3wBu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-fb48f03eb459ca607d4e1edd679bdcfc50e44dea-18.x/balena-jellyfish-metrics-2.0.253.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-fb48f03eb459ca607d4e1edd679bdcfc50e44dea-18.x/balena-jellyfish-metrics-2.0.253.tgz","_integrity":"sha512-KP6061dWXm5CEsCdGh4BS9m/7X0rpG4qZ4fJDb9zl64yzNZ1Jdv3EnGy0bcAnjIlCzwS1rns/Zghx0dh4UfgJA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-18T05:18:06.749Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.121","@balena/jellyfish-environment":"^14.4.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.0","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.17","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.66","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.253_1666070489282_0.026929168231152323","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.254-renovate-balena-jellyfish-logger-5-x-e01b909de7ab02e533daa2ddbba3e5390e4b9e23":{"name":"@balena/jellyfish-metrics","version":"2.0.254-renovate-balena-jellyfish-logger-5-x-e01b909de7ab02e533daa2ddbba3e5390e4b9e23","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.254-renovate-balena-jellyfish-logger-5-x-e01b909de7ab02e533daa2ddbba3e5390e4b9e23","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b2bcc2a270bed384d7dce3fddd5506d8b9bd396f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.254-renovate-balena-jellyfish-logger-5-x-e01b909de7ab02e533daa2ddbba3e5390e4b9e23.tgz","fileCount":17,"integrity":"sha512-pE2ST98u/vDbKFGXHupbIlns+R1LHc+6RrxP7/9XKGDimf0vKdAYC4JzsYJ81WUSv4vgcWvieOKdiCKLCOnNIg==","signatures":[{"sig":"MEUCIQDRMn3E1Dp7Nkj+Rqje/UY/ZfR3R6jNQzQNsCEOB8Dl6AIgSBR5IpmRyexjD9CkQxB6z6zjYAP+xdo84r4MPF0taPA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68339,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjTmXXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrSdg//YrUdIMXfEUeN0KjDpW46m55zO0F/wZJ8RDO7c+R1/WJlwujJ\r\nAkj9HiNrXBBuGLUsNWNcjCXNFV/KI/OXa2K/1LR6gouMxgQ6B2xMG4Cn4ow3\r\nUa6dIivHQHdiDbqP/l5CtuloHfTAGPSR2uYMk407eZN/94A8PJ410QO9X8A4\r\n7qhowxBzqPax15oUf3dXu18xxiJzwMppU5TaVH04pQkGpj/HIanm1rIvsWuZ\r\nz5SbwNu+awNziXcP8ul8pWx/86bv5JX99PdCgLZi+hEfwUt1mY1k2T5KVBQ8\r\nJn8sjxCjHIsS0EtG6+3pNRPucm6nVayBjTkRYfMk3hqSAPc8vtN6Mm3ySR9F\r\n+a2oL97xlJzW2E/OHsG2wKPPhzCq/tK089QnfSPnGQgE16pgiUkTHbeKrLk2\r\n6lo48fbsUjGtnnszuz5htLd02PV900Y2lI5aQCwqb69vf588HNBZS2AhjeST\r\nhW/+iB6XilufS8U2FFEbR8i3fuaaJyNyNvqzttvtogjWnhc0Xm+bPHsQyoXM\r\nXYKftuAZocuRE1OYhw/vxjP6LyRgXF8K2zy3r9v3bIzgwe6TD0FauxvRvJNb\r\nq2sOm4GhxIFEj3B+v8mNbp4pOzN4oXZuaag50x27PtW68GHJHIDvk1UDSoWW\r\n8k3vOht0Il68gWT+18FARH6zbNBLDA0+lC4=\r\n=sNjZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-e01b909de7ab02e533daa2ddbba3e5390e4b9e23-18.x/balena-jellyfish-metrics-2.0.254.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-e01b909de7ab02e533daa2ddbba3e5390e4b9e23-18.x/balena-jellyfish-metrics-2.0.254.tgz","_integrity":"sha512-pE2ST98u/vDbKFGXHupbIlns+R1LHc+6RrxP7/9XKGDimf0vKdAYC4JzsYJ81WUSv4vgcWvieOKdiCKLCOnNIg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-18T08:36:01.430Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.125","@balena/jellyfish-environment":"^14.4.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.2.0","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.17","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.66","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.254-renovate-balena-jellyfish-logger-5-x-e01b909de7ab02e533daa2ddbba3e5390e4b9e23_1666082263005_0.4797486295384623","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.254":{"name":"@balena/jellyfish-metrics","version":"2.0.254","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.254","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"10cd9fffeace7aa8480cecaa4d93b72030fc6d9d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.254.tgz","fileCount":15,"integrity":"sha512-FllI4uhoCxZv8H+znT88ApJwxhS33jCFzzCfbC+8S1sTwkxh4bOr5ScWDTWGtefpR/zrDARBcOOOJJJ1VP9heA==","signatures":[{"sig":"MEQCIC1oM/tPl9h/vsSVrFKyP8iSaVCW/1fXDVyeDPZiankSAiAD0YsT4hXW0MS052sEH7C5HCn4eBwHVLNOwCozHhN24Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjTmZiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrsWBAAj3oO14S6upCuLB9AL/+lyesPJn/Qj+X0K82RsYxbHR7OBN+Y\r\n0QXLK9w/UtcNf5+9ytyi8fYGpy0ZBnZxEJTKFGUeUSNPH7ilClGMx5r4TLbT\r\nul4L4JFq7jr1bGnORYpgynoWx2oTlMB+R2IUKHzgxbP8ZluGoaTpHuT9H5wJ\r\nougyP9v33/949ipY7cpy0UPHQEWEjE05i+piWvunWZZls/vCxpUIZL8OWWZz\r\nmEJj9iYQyK3pR0hzoW5/8n8FWK1jRtu685xJ3F+9iXKYdPG+udc/2WkfcHku\r\nmsJO9/+rtrSOAgw7YKVpkYPi864U3nAjzf/YKU2D4sEU4GUSpcEX9FrOy3gu\r\nIi0qIk4/CeCZGDc68TgaJETLoj7n6zmtqi1jtY8gvh7Z6vmh17cY9JxVfHra\r\n6/PeR6yjE8IwfS6T77Iz0prQ5XM7GwKWaB1f1JyQKD0soka4e1NkHEo/e0R7\r\nWVKwr59KQ6ayLdL7wBkMQCfw5CuPvlPWyS9k/pRQh7wtbdsBuKiDbUSemq/z\r\nmYqX+WGJ1zeWxCN8TtZtJq2OOUP8yDW2in+PJDKCTBWciWn/VQGH0UKZUl/m\r\n6j0ZE3GF1ensZs7SnywGSfif6jzK9FEloumZ2whoXpazD/u0rmtJ2Suv8yJK\r\nWg8Qu5dfcgWVwl0Ae0/N9ibTX7yraXw6Pw4=\r\n=Z888\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-e01b909de7ab02e533daa2ddbba3e5390e4b9e23-18.x/balena-jellyfish-metrics-2.0.254.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-e01b909de7ab02e533daa2ddbba3e5390e4b9e23-18.x/balena-jellyfish-metrics-2.0.254.tgz","_integrity":"sha512-FllI4uhoCxZv8H+znT88ApJwxhS33jCFzzCfbC+8S1sTwkxh4bOr5ScWDTWGtefpR/zrDARBcOOOJJJ1VP9heA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-18T08:36:01.430Z"},"_npmVersion":"8.15.0","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.17.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.125","@balena/jellyfish-environment":"^14.4.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.0","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.17","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.66","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.254_1666082401820_0.07163890838139886","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.255-renovate-node-16-x-32ac13e84fa18b6bf329e7eabadf38a69119e2e3":{"name":"@balena/jellyfish-metrics","version":"2.0.255-renovate-node-16-x-32ac13e84fa18b6bf329e7eabadf38a69119e2e3","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.255-renovate-node-16-x-32ac13e84fa18b6bf329e7eabadf38a69119e2e3","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c4bac36f47ed1b6c31409ad55a3e6850adf75e2d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.255-renovate-node-16-x-32ac13e84fa18b6bf329e7eabadf38a69119e2e3.tgz","fileCount":17,"integrity":"sha512-wnB/XP4WJ8DM2Zjcy7uRmEVMJLY7g6RD3HUk3n2uLnOqopu0FuprpRH+f4r0i4Sz3WT+eFfX/jhwOLTD1MqQog==","signatures":[{"sig":"MEYCIQDF/2ZE5glYz3CX+GRivlWzJgmXKzbdlcJYtDv2ExxpSgIhAPqO70XG9Ah4qRA3AK35rV+/BLkWwyg4uLzx+oGaTrue","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68321,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjU1EmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo+LQ/+KGRjwrBPXISKqqxP7SzlzvfZaw8+lkkIq1gM94DBBGvup2DH\r\nkgt1Th7SApavieS9nTZijsXWW6aUj7JZ5ENzaJE8qtqK9oKyF+IeWdBpNQAE\r\nAxB6OM0YOjUqyCLGjdAbjWHPLdm+ACebheWvoYO7zbVxLQqWbatTMknDWEpE\r\nZkLfHvkUkUzgwjli2xDjJc/Np6JilR1TF3hKHOqTKQBRmlKrkM/YG3gRuqdx\r\n1oBQ3FAZqHPCv3dKrSs49+WnYwIeywafduchTF1I1pkYwckJ80/GQmVWRb91\r\n3FLYKVeJZIM8gdyz8oCWQMOZ56fA1VKI9vEoNUls9SpdKtSgR4DolazH/qv4\r\nFJoLDHwMfs9RhsoSV0oSlz7bdTeKVauV1QVQDdirvJuMbSx2fE4IEthbVg+Q\r\n1dxj8LAJw/4FdYkaBiOvZ8kxpYkry4AUWL6RKqAC8sbZgatZvb4tF2Spt9ds\r\na+FczkNeWvecGjoPgvZETI1CEOGkBbyVqXfbM6Piko8OAd0vD0mYRWXIkeCS\r\nkIx0zsfaXkHoenYRLnjpga6hkS4jh1NaiHxHIV/3Fy+eeiKei5iME6qJ59+u\r\ntZLf/eGAdxJlZatwx38E3tTHL7iXC+UbfIN9KcLQRMiUf1c6YrWpk28USP7a\r\nrYlJNk+raCGdGlVcHdY+jJsV+MhJUPXsNBc=\r\n=4mtN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-32ac13e84fa18b6bf329e7eabadf38a69119e2e3-18.x/balena-jellyfish-metrics-2.0.255.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-32ac13e84fa18b6bf329e7eabadf38a69119e2e3-18.x/balena-jellyfish-metrics-2.0.255.tgz","_integrity":"sha512-wnB/XP4WJ8DM2Zjcy7uRmEVMJLY7g6RD3HUk3n2uLnOqopu0FuprpRH+f4r0i4Sz3WT+eFfX/jhwOLTD1MqQog==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-22T02:09:10.005Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.125","@balena/jellyfish-environment":"^14.4.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.2.0","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.17","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.68","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.255-renovate-node-16-x-32ac13e84fa18b6bf329e7eabadf38a69119e2e3_1666404646176_0.10142026531950843","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.255":{"name":"@balena/jellyfish-metrics","version":"2.0.255","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.255","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f5962030f0deb8f773ac599321b9ea09df3ebd1d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.255.tgz","fileCount":15,"integrity":"sha512-iKdmIX2jNzSZRX5e5ALOiyk5qXIkjXwKiASJ2Pgk6/EgQlAkVRs7ufSmHFDp5EcM/a0ykzXQ1bL4WV3zi6i+kQ==","signatures":[{"sig":"MEYCIQCB22z5dhxw14TYFOL1qpd6a8222BEwBVlZkPeA1lUt0QIhAKlZvd9NKc1i8gAw0zRui7cBfHsVLqramWWvYAE6iBmO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjU1GyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqr9g//WyXE/HIvN1D9jLCdD9ngJMN6yHhwa390LilUAL1NPobE3vfi\r\nGKTe/AO4lqVpJVPXQArxhQZiTY60l4Itytirc1toR3Br4h4NJ7ZXhABjdiSz\r\n6oPs3EuEIJmBZIHKFBwvGDQ1cdByGeo7yctAi8KOrBjwBhAQG3xeorOj43c3\r\njD3DNv/mdKJWx9nEZT7uEvnqfSFFDqBaOU07sh8swm8viGInwUloGOFzf5P9\r\nd08BJwxpX8oojdL/FKtS31h9WMr53jgTVAJzacVAPIY+a+fTzg2iUV55L1vz\r\nJZeSxpLHzN+nKSJsE7z6cx4gOHyZeASb6RThvLLVu9ZLKyp1R7yevvhk4d0D\r\nWjK2uoQuodnZa0IgUlKYTG8yDPVybWHFSxN56yJyiIY1/VTVxlfZsP5uGzSW\r\n2zDXWvl/w4XizsDwsKlVU3xtJ+0drEluTvzRAcoRnxLloavNeskwtvtGt0mm\r\nZUfgtHyFrOtPV1Qu/yYrQXYh6VWb+QxKDzjHwctJnEaGb99Ete8WvdSz2DpU\r\nJ8wN9rRorCrEeEbqJW0jwYxnv3X9N2F6wxoARI0A06NkdJHb1P5RrpIZzpEG\r\nABsRQ7zVHxabTQxnh3IoJFYCyWFVYnUodBjJwDvPadTa1L/Fptk4Q7dsFkH0\r\nxeWrXNPqUEeIisssROem+K4Yb6AI5zz/moY=\r\n=Zv95\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-32ac13e84fa18b6bf329e7eabadf38a69119e2e3-18.x/balena-jellyfish-metrics-2.0.255.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-32ac13e84fa18b6bf329e7eabadf38a69119e2e3-18.x/balena-jellyfish-metrics-2.0.255.tgz","_integrity":"sha512-iKdmIX2jNzSZRX5e5ALOiyk5qXIkjXwKiASJ2Pgk6/EgQlAkVRs7ufSmHFDp5EcM/a0ykzXQ1bL4WV3zi6i+kQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-22T02:09:10.005Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.125","@balena/jellyfish-environment":"^14.4.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.0","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.17","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.68","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.0"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.255_1666404786535_0.6831920703275332","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.256-renovate-simple-git-hooks-2-x-abb8933565873ebfb5a630cfb45d82eb342438d5":{"name":"@balena/jellyfish-metrics","version":"2.0.256-renovate-simple-git-hooks-2-x-abb8933565873ebfb5a630cfb45d82eb342438d5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.256-renovate-simple-git-hooks-2-x-abb8933565873ebfb5a630cfb45d82eb342438d5","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cffca043ec9a324632c5aa2e67878f673aa8ea6d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.256-renovate-simple-git-hooks-2-x-abb8933565873ebfb5a630cfb45d82eb342438d5.tgz","fileCount":17,"integrity":"sha512-trPKwK2OB4QKW52tI3ftxLx9yzqUD+/z5OdC4Yope71F5CJUOkfAMd1v9rRUuP0alWxTsUVpp0Bh7U2/EHneRg==","signatures":[{"sig":"MEQCIBHyfzo4u0kNYOu1QyXey+udKBzBVbjglyQPSoGU2wn6AiAkUGhOOIDWPiKkT9tPYdNcwlyvd5TEG1W9g5ke56Udwg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68332,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjU1JpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrALQ//ZigA3GLbyBXohTE2L/gXIhDRYD/GLt7GT1Ry2z/FrCAEuCfW\r\nyKwCHcYm37mlAao3HVXYRVVEjD1J1D6Ysezq0WWgDzDIX9QxiurxcmU5oiRJ\r\nQlar8T4GRxzYeDyJSokddO3Q6kSQdSl0UnJ24bgw2SwtQ4gZZSDMEZoFaHJg\r\nV/N/qA9zu8I2+rVVIgG/V6tT6FQ8jHbQSZWqT2z68EVRfo/ORXlCS4XxB39Q\r\nGY81YQw7ZGsi8jCFV7PcKcWJ2ysVmbBnYwit3NceOcPxkDzVXDvexc9FnUKn\r\nA5g3O0SOSLuB4jJLnCw0gWc7W9prOf680nlucN0/nngpioLxs5jlLsCwHzw+\r\nxC9Z3duTv8ZehEERlwGqzTlAXaKaiBJuiuBkbWhcSz6RZT57h4u41x+G7XHO\r\nugr57XTrX5MU84u1glGV5n4T8im5V3GmXN73GIY9Q0v04Ez/epMcAteM+qPy\r\nl/FYYhTj451RyZm7w3TIuP6qrZd7mVqxz83g1FeCHN1kRLF/mN+oq1uNREE4\r\nD1NvYRUkfTV50XafnDof6wE0wXARcWB1hEkNdnOgSGN027+/LNkfYkZP7Ehj\r\nlZy79iaOiEYOg9eNgjMJMgimIMwAfi73xNMbcv3g8HnHy1c8MCTVdghjypH9\r\nUkHWWWkWLRX+VXdg5MwQT0I9iMbwZNBKucg=\r\n=qx1r\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-abb8933565873ebfb5a630cfb45d82eb342438d5-18.x/balena-jellyfish-metrics-2.0.256.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-abb8933565873ebfb5a630cfb45d82eb342438d5-18.x/balena-jellyfish-metrics-2.0.256.tgz","_integrity":"sha512-trPKwK2OB4QKW52tI3ftxLx9yzqUD+/z5OdC4Yope71F5CJUOkfAMd1v9rRUuP0alWxTsUVpp0Bh7U2/EHneRg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-22T02:14:37.242Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.125","@balena/jellyfish-environment":"^14.4.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.2.0","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.17","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.68","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.256-renovate-simple-git-hooks-2-x-abb8933565873ebfb5a630cfb45d82eb342438d5_1666404969251_0.4354159410191101","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.256":{"name":"@balena/jellyfish-metrics","version":"2.0.256","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.256","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"67a1200f84a960280b5817ee1c7b915e6981348f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.256.tgz","fileCount":15,"integrity":"sha512-4INW3XWy3CmiyM02oK57wJnKhcahBVKYvmTb3kcwjuuElNL9aoNKyYyRd0uvehp/rpMbcgRbVBVXqiiTGHfSxg==","signatures":[{"sig":"MEUCIQDbJHxu6ruMCe2hhFcSTytQUB21V3QRtg/MQGcvl6Q+iQIgOESAqrkbXcu9Ov9DhJC9v+5gBlmzvHkqAGZjIIIf0nc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjU1L3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrlCg/8D9vUGiLa7qrljsBMBugmwN5Bu7uheYO/uu3ESiFYp5cWylPJ\r\nAkTnNT8LqP9JNyFDjYBxk9OIjozzQtFT/SMz7YMkHN0eUovZXvVFySO9mzFG\r\neUE15ou36QdV7blodHsfNmcAi/0W/dfhtHtCUBDrdYPgjeuZsXjV8ujclef2\r\nKhldxdgK657qmVUFkeV5LA+Hv32zeEygnJYGoEK0awkoH4cS0KVTMZKD6eK+\r\nTj5ygX83GlXIVBV2FzIN68vtSRbw7FQQZg5yPKPDRGELmOB0tEQFMkERmRzz\r\n2Z3IYbizirdzF3Yk6qveZv8QrKq9mO3F7HF+O5v7JcOm9SHB2yTO7ilEcF4F\r\nMamgqC3iittPyRD2Ipm9CdyJmSeQ0m0Mg7nt7ZfdqVzWWNZo8wLYDUcsG65r\r\nN8engnLF9s3EJSnk+Gxm9yHP+JgnVu3HaRm37dnWEnirXfSG7szRqi6/k5wI\r\nRzqVU5odaUtNrtB7pHm9y+Dso0Gj/HfOEjiITbrle1SJuNWJ2XodkOf6lG4+\r\nTRZuJkuPEfZZ8pfkkwzdr9LmlFWW1E/YGicntX1pIPcFcXw3uRqS9U4gtqah\r\nbeSyyZfTT2LjsTRsMS1MmACdtUl0kqdlQ4hCl4bhujVQ+UEBiQlcq7FAgf8r\r\nU8CZgrp3sGShjotIhglH6p5id98UBxaYRo8=\r\n=EM+w\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-abb8933565873ebfb5a630cfb45d82eb342438d5-18.x/balena-jellyfish-metrics-2.0.256.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-abb8933565873ebfb5a630cfb45d82eb342438d5-18.x/balena-jellyfish-metrics-2.0.256.tgz","_integrity":"sha512-4INW3XWy3CmiyM02oK57wJnKhcahBVKYvmTb3kcwjuuElNL9aoNKyYyRd0uvehp/rpMbcgRbVBVXqiiTGHfSxg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-22T02:14:37.242Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.125","@balena/jellyfish-environment":"^14.4.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.0","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.17","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.68","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.256_1666405111671_0.8083075177756254","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.257-renovate-balena-jellyfish-environment-14-x-e1eaacd2d35ac7ebf025b079082a8c134fcae8ec":{"name":"@balena/jellyfish-metrics","version":"2.0.257-renovate-balena-jellyfish-environment-14-x-e1eaacd2d35ac7ebf025b079082a8c134fcae8ec","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.257-renovate-balena-jellyfish-environment-14-x-e1eaacd2d35ac7ebf025b079082a8c134fcae8ec","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"443bc94e4a1e431a3a86cdaeef2d912caaf14562","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.257-renovate-balena-jellyfish-environment-14-x-e1eaacd2d35ac7ebf025b079082a8c134fcae8ec.tgz","fileCount":17,"integrity":"sha512-ugizWE9MB6TfrAOAD8juXh/iTorbAmWduurrZzcQnhS7c4iyoatdma9h59AmwIqAcvxQgvk9GWxY0EQg+J4wlA==","signatures":[{"sig":"MEQCIE6NR/lZF+/dMseQp0UTPWo8ybwQ5OgpRri8mpEyBsNvAiA9GQFSH2eQrta9TjPhCTLzmE+JIoc7mry+LQJwsHl1Sg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68345,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjU4P/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpXZw//cT9quhFRVPbwSDQGm2aFnefifXSBdYvCyzClbyiHQO5UCc4m\r\nIx5CbY9mPvtYdpoxx7f6W8Mvw75UufbjF4WXmcYicznbNJZ6lic4oJ71KPzF\r\nEy2QHii/AfDLBorRT1eYpGUe7365KTWRFiVURfuNstNkrFrNqOi7VRZUBzrD\r\nn+sVq1bSXUJihA4dBTIMRP/DhhgYY7jefpesIrbxkOUZCxjMbgRIN7gKW+br\r\nPbBp1dCQS6Z5Qk9i4YC0kXD2D54d0huhcGaLKZXfUssaZkeBOFb7PMCcGZKk\r\nl4seoWv/j0HgAsjHwj9OjACFKcrjJpfs++gE5jgetZed3ZeqptU7al0EReaY\r\nhNGWeRWYKSoucvh0cZbFs4nMoWXXFdP2me0S2w9mysvdSgifredlrfukdTAi\r\nyWA9vu0xoCJnBMgp2IKoJnyb/Gb/vEi+06JFWcHfrP1qk/g2W7cO2pW06hbZ\r\neGfYtf98HlYvSr60SLMWwGRWBXxS1shDgh8YJbojVFeQashnwvgAxq8FEVID\r\nVpn6eloct7e5fFD2wAthyGK+bNpiITDa+YjgdY/LLQZ5nNa10ian2JjN6kky\r\nnuY6AD8ZYhHGpD9eStZLbZTzUKxRpGHlFmA2kKkkZn51FCeuIfBDzlPqdaPB\r\nxxI5/J0uQgfcLnlWJOGfGqojORevmrsDddg=\r\n=ejfb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-e1eaacd2d35ac7ebf025b079082a8c134fcae8ec-18.x/balena-jellyfish-metrics-2.0.257.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-e1eaacd2d35ac7ebf025b079082a8c134fcae8ec-18.x/balena-jellyfish-metrics-2.0.257.tgz","_integrity":"sha512-ugizWE9MB6TfrAOAD8juXh/iTorbAmWduurrZzcQnhS7c4iyoatdma9h59AmwIqAcvxQgvk9GWxY0EQg+J4wlA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-22T05:46:03.223Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.125","@balena/jellyfish-environment":"^14.4.3","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.2.0","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.17","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.68","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.257-renovate-balena-jellyfish-environment-14-x-e1eaacd2d35ac7ebf025b079082a8c134fcae8ec_1666417663013_0.21270017308553335","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.257":{"name":"@balena/jellyfish-metrics","version":"2.0.257","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.257","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"982d26344bab42868b101ef7a693b4a3dd511ecf","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.257.tgz","fileCount":15,"integrity":"sha512-3EbnBRUi83x0pRMTRH4JQwgbL9N3niQfshdhSvDWU6y3OB53qQ7qVC5MqQu6aSdrHflYvumdB4rBOFaJxv5Umw==","signatures":[{"sig":"MEUCIBdJ5xtdWVMKXJLvvsK9MLofjt0MuL2CCwNIp9Zdge67AiEAtfagQT8LysfbLPJ1+TpLu3qO73hx1eNXztI40yDmD/U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjU4SJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpgog/+OfuHzfVt8m54ZlHbMsRzvgJ75wQTs+maHlH07BNUBUxiRSFL\r\n4dxJVsqh5z16Z40UqTXBDIWMcpSDWz0pReH2ey7mYs0j+RBN6/N8dPuXrLpt\r\nCW4+csOWIrIF6vs5IYh2LArCAbhC/ALWTTV7Bty/S+AFI4Ls4IrjlEArZlEf\r\nhvL5xuX5vfNoQmky4qoslgD6A+uLE0xmz33m7LJpikGwzacA06XLH3ia+/6V\r\n0YWSpV7ulnwXn/1ihUG1Z0uBbEVnKWKq34XIm1rhDETXU2oUpY7+K5J5ErVO\r\nCvEwjdSherqjvqcJafkIW5W4+s2dEcs7375X4Vh8KNtACrgFKnklix7XKLGK\r\n+1irav6MRqXf2pTm08aHyIk0w8mwEhuKAdTrjz2UooEkuGfpV14C/6QqHx8t\r\nRCGrTpwDOEIl0aJ8X9zh/Ir+ffKg3ScK8BwaIq79Ft1/tmt9pvVIfphnBtlL\r\nLwSpHlsouf/x33y9QiXjN3/lobCKzG27eHKmjRNJYGvGy4l6Hyu+d+UH69XH\r\nei95TysrORSWPfB67qa9XtJjmTmDP0Eafxn4xPj0QCeat68usmagsvbTyyEm\r\nUMBZ0O+KC/FmIo5zOUZdQ4A6IQac2M0IFRvgcpV88cw0B5bGUUYg+MkRbLDp\r\nTIhTOQfogtKKPDKPg4CPORRt1T8HceOVDvs=\r\n=u8iZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-e1eaacd2d35ac7ebf025b079082a8c134fcae8ec-18.x/balena-jellyfish-metrics-2.0.257.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-e1eaacd2d35ac7ebf025b079082a8c134fcae8ec-18.x/balena-jellyfish-metrics-2.0.257.tgz","_integrity":"sha512-3EbnBRUi83x0pRMTRH4JQwgbL9N3niQfshdhSvDWU6y3OB53qQ7qVC5MqQu6aSdrHflYvumdB4rBOFaJxv5Umw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-22T05:46:03.223Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.125","@balena/jellyfish-environment":"^14.4.3","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.0","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.17","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.1.2","@types/node":"^16.11.68","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.257_1666417801543_0.9013249456021437","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.258-renovate-jest-monorepo-6b252a0cbed90b440321112598c42ffb5e5c7692":{"name":"@balena/jellyfish-metrics","version":"2.0.258-renovate-jest-monorepo-6b252a0cbed90b440321112598c42ffb5e5c7692","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.258-renovate-jest-monorepo-6b252a0cbed90b440321112598c42ffb5e5c7692","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e4ae6b02d5913018681a16c6317e7ddd7fa35429","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.258-renovate-jest-monorepo-6b252a0cbed90b440321112598c42ffb5e5c7692.tgz","fileCount":17,"integrity":"sha512-rEZiXym98cJkHjrb9YMHMz8k66y9Yzxb3R73eQ1Y1kuA6CkefU50NkNcALZCULSpVVAfxT0CZyTFMb8wJGrntw==","signatures":[{"sig":"MEUCIQCtb8P8iX/d9FqNrTC78tPRjYsM5QYum+7iTQ5SSUMKKQIgBUgpXUD24hP3U7+5RlDDEatI3QkFlATYp0gDyLn8sy4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68325,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjU4VQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqymA/7ByEV9eUVZB6uvrYMPwzYxI1RwHRhcYiyXbxETg/JaNav9+C1\r\nQ3ZG8BoBftipWSHLPpQ9Fu6A+yACtk02rtDh4TyjDzjrV471JM2plWLHWTH4\r\nqD6utm7JkdHPtSmxk00jT4gneKO/3r/ds2j6UsueHJfcrTSeCjNjVb0ycimh\r\nOVp0sWGj2lADD2yOddNE/d+2x2khJKbYydVCtEUkGFnkjGZzZUzFOdW5iufU\r\n9t21hIiJWIB9iiz8ceh8PI3g19v5Jz7jxPWm8yF5PK+MsTn5tVkq3hkD8Odc\r\nKYch2FfqTDEk+aC/aTTUkkrzSMkH27s8hGFTT4cALKHDXI+1F7i5Su2iG5qR\r\nnYjV11jU/9+nSNqey/kx2AQcsjhltESQnntXRyTa5t5WEXmEg/FOmUCVYK/N\r\nTXTqjWKduR1CpPtPumJ8QJLyI3BHQeDGwOrd4vPEt5Y3anYaI8KOrpUyf1n8\r\nraYFBNgklHg2k3X/OFnbjH55sY0yNliXn1QzRmR7QGsVEwSjOY+8ftoYVkO3\r\nLnK5d2OiGcQ+LybyKTI99htF+C/CsO5Py3CVAnlbBcip8OEDSJS+QB3JIRgk\r\noqD2CkoxdBp9VMxhJ+xWufYTAT2lrMwL6OoomFdxoHgGETIywZTHNfb04O+t\r\nQjLda5SIofbyXiZrRMuvVhVbKJkL8pJhd+k=\r\n=cfZS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-6b252a0cbed90b440321112598c42ffb5e5c7692-18.x/balena-jellyfish-metrics-2.0.258.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-6b252a0cbed90b440321112598c42ffb5e5c7692-18.x/balena-jellyfish-metrics-2.0.258.tgz","_integrity":"sha512-rEZiXym98cJkHjrb9YMHMz8k66y9Yzxb3R73eQ1Y1kuA6CkefU50NkNcALZCULSpVVAfxT0CZyTFMb8wJGrntw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-22T05:51:35.529Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.125","@balena/jellyfish-environment":"^14.4.3","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.2.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.17","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^16.11.68","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.258-renovate-jest-monorepo-6b252a0cbed90b440321112598c42ffb5e5c7692_1666418000197_0.27501983982606637","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.258":{"name":"@balena/jellyfish-metrics","version":"2.0.258","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.258","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"74a524bc274d34316ae2c311da29090df1b48dcf","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.258.tgz","fileCount":15,"integrity":"sha512-Qrtj/SFyKKCnCa+2abL8J2gywlU8xdLNtyw42ZwghlEsJfHoA8FNF7nzpjJuZ2b9b87UefNH+jV0K81IsiC0jg==","signatures":[{"sig":"MEUCIFBS2z161QGSZxUBxdReEG55Mgs67b5ebmO7ponDg55lAiEA0DMGIFc6ptnh8abNX6MtK7F7GduRTsVjqAS2ip491lI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjU4XkACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpsyQ//T/zQDxCKePJ+72pnGqNUfRy/dSP+Q6q8vdVMuAkBiKuJ0cdd\r\nUWL6X665Fw8qD/fPF3e+Ua9s03Hk3U7gFUHR4hpfrKBQ/1HKp+SKN5WRWAte\r\n4PIeGUPj02LHKpZ9O1ZI8JLyZGtlMPJYlFIOJWykmF6i+mmuD94DLlS5shWz\r\nnrdWpFJfAJ+JG4hCYyS4ybVTkomWjm3QDT/v1DLp9qE/zQ/Jrp1oVr2ZTveG\r\nY22iHHgnyaIP0vVXaHLiiJ60yOsQZlOMGnV+BOMowJJ2kepQh0MFB67WG8Nv\r\nyKjB5OZjLDddp4Y7/dS6zC13l/6rI+UEgiB0gW3B374/3JAmqpVk1qdM3/uu\r\nbEdcEWX4E+YenYdkAtf8sVONPKAkse1f4tt9V8bbxiLVluoXlFHwbWCSQTkr\r\niJAq6RxFjAoP+KI96PkAL6IQck2jvMjcxX0xkkpWPrAaRkkMRCUlteIvSU4i\r\nEHmuQbQ6goY5yngLKucUB89wcS/Fg3CxA4EpLDuOQ0p/xfSLDJQsMkoiFv2F\r\nlVq+CjGm2xjDd8qlglrozdcPYQyXe2SK+7MLO42JMofsxXgC5N7b+PPRKKvO\r\nTkmIkvNaLeR8HYh45HReOnZy5TB2NX1k4Y/7md2RRZgtpc8GfECoaaFKyes6\r\nAKXbJmo72YOnoBXoQI1fbyjNpfU337EHchs=\r\n=C+d+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-6b252a0cbed90b440321112598c42ffb5e5c7692-18.x/balena-jellyfish-metrics-2.0.258.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-6b252a0cbed90b440321112598c42ffb5e5c7692-18.x/balena-jellyfish-metrics-2.0.258.tgz","_integrity":"sha512-Qrtj/SFyKKCnCa+2abL8J2gywlU8xdLNtyw42ZwghlEsJfHoA8FNF7nzpjJuZ2b9b87UefNH+jV0K81IsiC0jg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-22T05:51:35.529Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.125","@balena/jellyfish-environment":"^14.4.3","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.17","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^16.11.68","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.258_1666418147806_0.2075763834584663","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.259-renovate-balena-jellyfish-environment-14-x-918ea8714dde3d117e8fe29b2e313b1b3d876587":{"name":"@balena/jellyfish-metrics","version":"2.0.259-renovate-balena-jellyfish-environment-14-x-918ea8714dde3d117e8fe29b2e313b1b3d876587","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.259-renovate-balena-jellyfish-environment-14-x-918ea8714dde3d117e8fe29b2e313b1b3d876587","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b13b97100d31d643b49276f63855b6a510841b66","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.259-renovate-balena-jellyfish-environment-14-x-918ea8714dde3d117e8fe29b2e313b1b3d876587.tgz","fileCount":17,"integrity":"sha512-2BPCXlJCQ6tJKdnQJjYOmqFlN/CFamcBXrF/D530Eo/uSsYuTnHWkRB7bLn9qPKOQhA6o38ryC7DU6lXx4CFrQ==","signatures":[{"sig":"MEUCIQCA0yYHbKF6k7T4DpP8hReeifGfxVmpcPp9mfAy9hRsXwIgerZmLhOoSUaDby0iAnj2o+lXFhuUNxEQpJzT/rXFhFU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68345,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjVSDYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpx3g/+JP+pv1zbipIiaBws/4D22zjO4Sm4izx/X85ONbpbKzPlTI1I\r\nF9oMCIWIliLlt/QdvRQ8uuYXn54HxBhlsLdAbj1yEIkj3hJo8JyuuhoDQaTi\r\najqWJYyUXkr61dqsO7ji3HPCEMjTWuKyKa50zupORxKM9eypY3KL0Gf55YWs\r\nhWQqHArvJxlsDgX/PP3/q9nX8kAHXw+lovbbT1rl4XdKYnghVdW6GpHLK7Jg\r\nyjMm0RIjxejsvIYPAowQXVedWg9aLGUAfw8MRJ9+dBk7d8r+14djB6S7lovP\r\nYyTiZKrX6QBXDffp6I9rEr8MopSgWNXKOQtDi2vMKsGNPaYec2xK/3kePWLE\r\nLjV9spMUkkY7SOrpg4d8DpWj+U/iBhgLashSKRuGzCoayZ3GSyqMpA1Sgn4D\r\nLpGxyadFRevfE8bhXBPy5QIUrxVKIPtN7TuTqI2k/FcycFCjCErSm05MP0ej\r\n9RFYFQ19A97xOKn7mjE7165KDHXVW+xHfPKRRqsaB/bEbCtqv+KdAFicpcrU\r\nW2EIluAcU2kuO6+CtrYYn6zdHWDbs3mJ7ME4k8gjMKogxDoc6AjkfdE9Ta2N\r\n5qp/475FBZPnXNOaF+OXArF3Bhh91haGg2YEKR+UFFr8qArY5uke1JjqRsXz\r\nxBSY2H1uyl+4arEfz0I0yBUAikMywBAwd0A=\r\n=km0h\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-918ea8714dde3d117e8fe29b2e313b1b3d876587-18.x/balena-jellyfish-metrics-2.0.259.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-918ea8714dde3d117e8fe29b2e313b1b3d876587-18.x/balena-jellyfish-metrics-2.0.259.tgz","_integrity":"sha512-2BPCXlJCQ6tJKdnQJjYOmqFlN/CFamcBXrF/D530Eo/uSsYuTnHWkRB7bLn9qPKOQhA6o38ryC7DU6lXx4CFrQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-23T11:07:33.697Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.125","@balena/jellyfish-environment":"^14.4.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.2.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.17","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^16.11.68","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.259-renovate-balena-jellyfish-environment-14-x-918ea8714dde3d117e8fe29b2e313b1b3d876587_1666523352079_0.775723036119099","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.259":{"name":"@balena/jellyfish-metrics","version":"2.0.259","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.259","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"88db08d657007bcb2250f91cffc4c2016bc86a5c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.259.tgz","fileCount":15,"integrity":"sha512-8gpVaCWHIZufAFSoZCSAgQ/pIwvvIjm5kuurZB4HnP2taRP/yZI8S8HQaLTqkHof+f0emDzfiZGR0avpFUwxDw==","signatures":[{"sig":"MEUCIDn39ZAgYWkaWTifKgEFYxsM2sBwl4uNQBBrr4PNKl0BAiEAhZMVLIo9/CSG9N2w6oPi+/Xflzw1QJUU+OhFUiYHOaw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjVSF6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp7eRAAlbkx0dafyV+aPxxLLdDQ3V9UdZ15jPfwrxaqZuFD2AqoiBBG\r\nyDN3tvNK74QFhVpsGFrMMB51tqbGJ7KczxOiji+y739NUS1QlR90ebvgEuTo\r\nb5llVqLi5APAJ7fMweRLTRP+5HDK++bYCry69saiLzt/22rKlP8Ai7JRlU+W\r\nmQHS9xEyUsWZxq9r+6DslESVnHOzjLLpz28Ja7+jT5e0UKM9vaP2YIeQ2+2B\r\nBaRrySaJ+BlSaFXPcR/3Puq39gS56znMNKUXXJJhdt8K2jKKdWsjhRJXTg4T\r\n7LzTrjcLWClQu+hBa5tAF3t73JkfzPgZXF3cr4r/IYBgtfJW27AseIMwVPI4\r\nMLwbq2c4+cYWjkB07rkPO5PsXu87iLehEZroJ3sbZlUK52RE+4CZg4jjASE0\r\nJACSJD4+phpODxIGHYHovttx8VdtucpQJSIATuEtJDmWy/AJUSMJDj/VFuVw\r\n9ecsL9mW1G1uXoT2OrVKQQb4U+Ile4+gFhgM7nmvREEWC1ub/xylD5kb2UHP\r\nw1RngSJNfiOWh4qKevyme9ZoRj3wYgtLvuDpNnx+8ByBmqdHZDIYADdpJBJP\r\n5MSA+ljEgkqq3fVhrTJgz04PK1GbyS6rflRVMelxkHPeO9VjRPcp79qrtJuI\r\nIQSVDvJG+QD6RonDron+7+TRDVxYM9Ijp/Q=\r\n=GsCp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-918ea8714dde3d117e8fe29b2e313b1b3d876587-18.x/balena-jellyfish-metrics-2.0.259.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-918ea8714dde3d117e8fe29b2e313b1b3d876587-18.x/balena-jellyfish-metrics-2.0.259.tgz","_integrity":"sha512-8gpVaCWHIZufAFSoZCSAgQ/pIwvvIjm5kuurZB4HnP2taRP/yZI8S8HQaLTqkHof+f0emDzfiZGR0avpFUwxDw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-23T11:07:33.697Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.125","@balena/jellyfish-environment":"^14.4.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.17","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^16.11.68","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.259_1666523514445_0.18082025234990273","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.260-renovate-typedoc-0-x-1e80c98be34a65e52f287d8b84aabda019586762":{"name":"@balena/jellyfish-metrics","version":"2.0.260-renovate-typedoc-0-x-1e80c98be34a65e52f287d8b84aabda019586762","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.260-renovate-typedoc-0-x-1e80c98be34a65e52f287d8b84aabda019586762","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0fc6a84bdfbecf7e08f53440bdb2603b59ae76ea","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.260-renovate-typedoc-0-x-1e80c98be34a65e52f287d8b84aabda019586762.tgz","fileCount":17,"integrity":"sha512-STE9IcOTUaYNG1c+Yn5GNAxHeLDmQvoDw0Wo0Fly15S4kVMb0zhZ4d2MkPrS/fi6ohQcpN/UH5xI9rWXyu11Tg==","signatures":[{"sig":"MEYCIQCzjRjyNdo8GgkvI7UcRGgtwfFGexX+gdqnyhO5ZhZbxQIhAPzwaoiH1RwYwALdrI1IBm+u7Kl6aG0VRZGq9k70XxV0","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68323,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjVb4XACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqZMA//dGpI462sABDgheM29vueRpXA0Mx0klFp1jAbdgk4d8G+2hFY\r\nfdRT9wziG1WpIH12uOw0e1JcaPQ3rK5Wd7mxeJ3dj4ZPrENQfzGzDFCSGJmw\r\nymp17Cw1A55dqV16NwgOL/8n9HEZkuA1+FfCijLCd28InhQ9IHQcsGwZW1SV\r\nn/CvbWLAnQhZShgyE3w+UMANjBwc7D4qvsRWCUvA3XDE2zgtzwC/cOOrLIjP\r\nshyGhUX/GSgUL4TKlQ2oWMMtHR42ZiyMYulFgTWxuC4L//ekUorHKfpSLEE/\r\n4n4nd2NIppG2wZVmpwJdmkziN7s2eJmx14mvRfDMBv9HLcqgIG28As7G1Cmz\r\nJnfjXqkNAe4D/QuxJzenN4CnAjYCf7nGPxsXiO/MHAjJpDaY8pgcFXSjNhuT\r\n3yBEEJNed3SJipPhTTWDNFctk39B3m7n+45R/pn43H5fivjinrCb+Tov7QwZ\r\nhmdGqHk+r3BNbNwe+dLv3MRp/QL+U02xOcgjmT1NBIgPGDYFWHuxUeLPQnqJ\r\nXxhIU+1nMoUyOTd3BY3liWFDvqHCBbVpk06xxX74y3qwNDC0m72GfMyXHjr+\r\nOQFnr5wIkk8NmgfSpDub/5+u+jj6n9T9c97nzFhRSqgMqweQ0Qz143QHbR80\r\nlnMU0rVwkYuQo1XBxdcEGEpq3u/dhhmoX0U=\r\n=o4LG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-1e80c98be34a65e52f287d8b84aabda019586762-18.x/balena-jellyfish-metrics-2.0.260.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-1e80c98be34a65e52f287d8b84aabda019586762-18.x/balena-jellyfish-metrics-2.0.260.tgz","_integrity":"sha512-STE9IcOTUaYNG1c+Yn5GNAxHeLDmQvoDw0Wo0Fly15S4kVMb0zhZ4d2MkPrS/fi6ohQcpN/UH5xI9rWXyu11Tg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-23T22:18:23.004Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.125","@balena/jellyfish-environment":"^14.4.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.2.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.18","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^16.11.68","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.260-renovate-typedoc-0-x-1e80c98be34a65e52f287d8b84aabda019586762_1666563607538_0.6764466239874589","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.260":{"name":"@balena/jellyfish-metrics","version":"2.0.260","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.260","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"452ad361a0b0be2753b3a5b43dd5d1b77cf9f52f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.260.tgz","fileCount":15,"integrity":"sha512-m0Ere+IMsiElCz4yGv48QfBoJHxUSOcWuwcYGc/zvD3ark/cY9Xn9iu6NF1OY5f3BbqITvPRgnwPGrvvcTrIGQ==","signatures":[{"sig":"MEQCICmlyjMQ+v3knYsSR4fkMQCa+hzorrwsAiKfmuqQKK6wAiB0o5W4eZGTsxEslz8fIv2UfZODL+dTUFtv0P9oP51PmQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjVb61ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrfMBAAlXca0rXwEVPFRH6Hc+d+SeByVQha1fVC7XObU8oXThD+yExK\r\nZnFNNcE51/b9yTWcdY+4FNCJWTMGkfLAmyNu6FH2fKRIPTgV9dx6ByqKQyrA\r\nyNNzspYUtAmPiFjEzp3WXmgcAJS+ccD2gFj6P//LBFchhJljgbg6KKvsKeSQ\r\n7Cx1NQoD0XcXjez2D5fnjdTgmp7q+GRF1M46KST+601X8uvd1NqcFM+acrtO\r\nbNPXFnQ3l43MalSS6e0FRTo7vP42iQOA95K1E2dzCF+93ZqdVGyg0QR0j8V3\r\nlI4ncYP10HNl7BzOaOQ6/qP45LVzUNVncTMf68p8YS5OF/YMH1BYX9F/M1H3\r\nPhqR/Zw3uYdNJMb33ScRo1l2pbTx1OH97D0008k5rl39O+3YJv3asAPGU/Wy\r\npsZaUdjR2FFhIewu0tJ/FVKkdzl4h+78ZYHoe+3V+IwPMaVYxmZ1Sk03zMiv\r\nMavb84EmOT2DPPrLdr5Zim8KafZnRUwtD/Vwk59R78tiWoL2XrE9OiXe/Axj\r\nAMnwG0loecNFL5AbRNTqla2x+sQTtwtu8dofCxCL2p/JTfmGERZokm+rfEJk\r\nMqAF3EPnGkurejhEdQX28sHZ4TPolxtw51TwY6qlEHt2o0AMGyVropi7YYaP\r\nE/lJ0wb5wdrywEhQNVzTo495ZNtPKLr1MJ0=\r\n=7VGf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-1e80c98be34a65e52f287d8b84aabda019586762-18.x/balena-jellyfish-metrics-2.0.260.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-1e80c98be34a65e52f287d8b84aabda019586762-18.x/balena-jellyfish-metrics-2.0.260.tgz","_integrity":"sha512-m0Ere+IMsiElCz4yGv48QfBoJHxUSOcWuwcYGc/zvD3ark/cY9Xn9iu6NF1OY5f3BbqITvPRgnwPGrvvcTrIGQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-23T22:18:23.004Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.125","@balena/jellyfish-environment":"^14.4.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.18","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^16.11.68","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.260_1666563764993_0.8424719655321444","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.261-renovate-node-16-x-a3550c32bdf9769f44047ea343f7a8c37bc379d1":{"name":"@balena/jellyfish-metrics","version":"2.0.261-renovate-node-16-x-a3550c32bdf9769f44047ea343f7a8c37bc379d1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.261-renovate-node-16-x-a3550c32bdf9769f44047ea343f7a8c37bc379d1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e27e73b6fdfc9e8a56908081de90733ebb217113","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.261-renovate-node-16-x-a3550c32bdf9769f44047ea343f7a8c37bc379d1.tgz","fileCount":17,"integrity":"sha512-dvf9HsjBJKXW+TXDPMqC+zTr6O0M0S0GPACN0ZhSF2UxgMRappVaS3XZSrUs+VmO4rULwHsT9vmUM/HEql8m/Q==","signatures":[{"sig":"MEUCIBG/k+sWe7+4JXEFrGV59GWnBY2psUYt3wYuxxZ9iwPaAiEA8J2S8kNPtN1ei4FuV5jYna0E6DSV2kpaknPZWnKe86Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68320,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjVb9yACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqkJw/+M70BR1J+v0pE0CF1UerR51pQFSGOETVBb0zqId7lpgui/g+2\r\n1LFawjQC45w/YPgGWMbkou7AoaZJpZBOAZZYjqfXYMpbhnAaZ9+tGLdQPPPg\r\nqgKCYLO3pTvgUxL+dMD2z1OCHA9GoJfisLSRCAVM38+2C77zv/m4XhTmr6jy\r\nvLgSjyE9gGbMJMmIpNWxL6G8ecArdqA1RjxaZ1JdIIRjrZ5Qaj3psgRgO+Lu\r\nshK9MvE+xakyTKPfb2VlbP2UZMlUZxvleP3VUR8ER75c1gF0Rte6r9XJcHQi\r\n+dvmZTObnTrA63osxVqX2jYpxrFThSM+bHqHYHJwe/NxJMXDZ8hcmCmwPY74\r\nwbS+tiSuNpTN/bh3pukVpWKxEGZjUfJCMAnJ979dTBA7X6jX7Fyf6PiGdMBW\r\nrJ37dnychZKU5750/hTR6Os6qa4PFOkdCZXyw9IyCLVcY2zxo1+djYo/xDRA\r\nHyKKu4tQk3K8+oB5tGzIbX5nhDT4dbD8B58wauhT5A7LDLASpxjTYrDaEAJ/\r\nSoSd2jburpdrunhHy9SpSA/RQgMR8FVOQ1tZzcsYNgv4glyXsRUNtBXXDVgR\r\nlppD1tMl0yIlHRqJxKN+N3Gg/iFokv0PQFyErCpBUPhA4vFbi/YElaupIhc5\r\nvz0OVhSiMk3q/b6DhgM+4tFh9wFDohgMYdU=\r\n=eeXu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-a3550c32bdf9769f44047ea343f7a8c37bc379d1-18.x/balena-jellyfish-metrics-2.0.261.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-a3550c32bdf9769f44047ea343f7a8c37bc379d1-18.x/balena-jellyfish-metrics-2.0.261.tgz","_integrity":"sha512-dvf9HsjBJKXW+TXDPMqC+zTr6O0M0S0GPACN0ZhSF2UxgMRappVaS3XZSrUs+VmO4rULwHsT9vmUM/HEql8m/Q==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-23T22:24:19.262Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.125","@balena/jellyfish-environment":"^14.4.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.2.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.18","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^16.18.0","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.261-renovate-node-16-x-a3550c32bdf9769f44047ea343f7a8c37bc379d1_1666563954768_0.7798786712365293","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.261":{"name":"@balena/jellyfish-metrics","version":"2.0.261","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.261","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fee16accb4f0ef03436e4aa5f2fc103fd8320ae1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.261.tgz","fileCount":15,"integrity":"sha512-Q8tI3QKF5njUn3LchKybw30RN2SaPVkTK1NldabyCWoYSZiomqBFFkej4s2eLRBUyESk8p8yq4GpKpwiux3vbQ==","signatures":[{"sig":"MEUCIGb3pAoMHMWzLkw2ECNu1cjX+4dtdg2YYBmfhRH6eEiaAiEArA2cvvwsQQsOx9Nj1+UxwQWRBgIf3v4XieRJkSBAcy0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68260,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjVcAhACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoQ1Q/5AVgmdKkJNfuia/61G7uQCIuapbBQnQWD3gJ7tVoTMmX26tRk\r\nhCVRBSxDTeLvTTRC9WwoaW11s1wT4IywBOMpp4xmr1v8RMDxlhXbDuK8rHN+\r\nrZEMGsqh24MujeuHPz6XQ/7lU0qpuKHnZGG4RdBEw8UllH7XEkxPMmF//NJR\r\nDCAHkTn1ZplHVof7AIYxaYU0G2bGrfpmO+sAh9Ab1MnDDxQIqYFxypJxJSzC\r\ncdhWBHK5hYNh9XmtBFxDrhoF4kVSzF6ZaEuCSUK92mbajISQAil7N1tsBHGa\r\nfd8ua3EFJVlFrfdScL5b/SGlWmEGPkZI2FLNYd1WwsK1xQobqOAj5C90eTni\r\nIKQlfI03e2rfvE7PHdPYexbJClgoRvkN8fUsigOF2OTZ0EYL/EsMkMDZqQFa\r\nREtAH5CPt0M5g+Vjsffctgdu2MuoabEf1UD8yo0qhr2f8jYVSrx1Cq/xCD0K\r\nAjaP2TGqJA5EuCPR7DXMBr0NIkQKuHmp49aamWtAyR91NXV4PybkI8SMSVvA\r\nWWb42KbWkOMssBBV5mvp4cpsuoYZcQG5BRWE0xqOlKAsZIH5hl4MBzuHG2T3\r\n5F7UYd3ooNthbgXYxuaIo3Ws+l9glQLP0VejsHiGlB5j5B1mUjMgt1R4Dz7n\r\nJNw7jE5XvRYbfw9PfOZROmDKTTijHaBg6iI=\r\n=Mdt1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-a3550c32bdf9769f44047ea343f7a8c37bc379d1-18.x/balena-jellyfish-metrics-2.0.261.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-a3550c32bdf9769f44047ea343f7a8c37bc379d1-18.x/balena-jellyfish-metrics-2.0.261.tgz","_integrity":"sha512-Q8tI3QKF5njUn3LchKybw30RN2SaPVkTK1NldabyCWoYSZiomqBFFkej4s2eLRBUyESk8p8yq4GpKpwiux3vbQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-23T22:24:19.262Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.125","@balena/jellyfish-environment":"^14.4.4","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.18","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^16.18.0","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.261_1666564129146_0.14664236484904025","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.262-renovate-balena-jellyfish-environment-14-x-6c39f067f3016f1810ccd2f7d8bf616de95eae3a":{"name":"@balena/jellyfish-metrics","version":"2.0.262-renovate-balena-jellyfish-environment-14-x-6c39f067f3016f1810ccd2f7d8bf616de95eae3a","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.262-renovate-balena-jellyfish-environment-14-x-6c39f067f3016f1810ccd2f7d8bf616de95eae3a","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"55908e8815bbf685bc2516c30b0c99c962543043","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.262-renovate-balena-jellyfish-environment-14-x-6c39f067f3016f1810ccd2f7d8bf616de95eae3a.tgz","fileCount":17,"integrity":"sha512-LVu/+vOxakaq+zy3j2DEr3IGRjl83MLYNJCoiZGVqP0hapSKyj8uRhCfXmxWMM3bpQagFqvlLGh6Ufj8rU2Spg==","signatures":[{"sig":"MEYCIQDczhpPhpD5gCOk5EImsU4uZKGCoAraomx4RuIMK2afqgIhAMDrqM6tfD/ADA01Ce6EyrFe9SozIghLqvhv4g0mwRFm","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjVe0GACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoxow//V7ehVxMABacmABUtTZvdPcae9jGOqfKIx2W312NPtXGN27eW\r\nYxVsBFEnOakonjP5Nw1YMpyDBL1Z5imswLnJxbM58nO0ypM+AatnhlQevGsB\r\nFD0b7kcJXmmKPwCYB5QhOSZ/M6lTXxtetb9kzW/EbMgyuo1lDYmGqLoIf0Ze\r\nOgKZOST4mIjd/b8jYHc3gTBH9YeYPWJciN5xOc1aKuBzADS4mejr7e2hwYz3\r\nzNmTeqXTSzwHvG4y4Xo+vDTN6LZauCFER9XDBUb2+WVBT+674Sm/unIWPf/N\r\n3DFreX9b8uhmyd1qP+6ASi0QXtW6zjaHZ8BIwJM2XOZBDgIP201e+a8HNLe/\r\nVw0AT2bAGnBIBEzLCknUTWMD0GnaV0adxWp64kTO8y9KppxdYplwi7qw3WRN\r\n4qg3xqY+q+mckhaq6u6MZC1TayOHyr4PPpjHlbVujc38o+t4VSwnfKiOUxDW\r\nzaLSoBbO05RPeYq6rU6aB4yFitMIzUkL5qrJvPA8uodxj9W6CI2fw/SzmoOy\r\nnSTJU7cng8HF7RYg9x9JbjVy3t72wXAhmeQT+NriYNB124pk/K+mRLEMh+Pi\r\nFGvQRPeyTnjGDsPkzS6Z5xdUbloeUp2CJTFoVWMOncDj7nZaEuxz4lP5Gbhr\r\ndW6tVZiLDZSYIIc5eQjlOXSYR8FbP5GO/tE=\r\n=Acbw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-6c39f067f3016f1810ccd2f7d8bf616de95eae3a-18.x/balena-jellyfish-metrics-2.0.262.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\n[![Publish Documentation](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/product-os/jellyfish-metrics/actions/workflows/publish-docs.yml)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-6c39f067f3016f1810ccd2f7d8bf616de95eae3a-18.x/balena-jellyfish-metrics-2.0.262.tgz","_integrity":"sha512-LVu/+vOxakaq+zy3j2DEr3IGRjl83MLYNJCoiZGVqP0hapSKyj8uRhCfXmxWMM3bpQagFqvlLGh6Ufj8rU2Spg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-24T01:38:47.812Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.125","@balena/jellyfish-environment":"^14.4.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.2.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.18","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^16.18.0","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.262-renovate-balena-jellyfish-environment-14-x-6c39f067f3016f1810ccd2f7d8bf616de95eae3a_1666575622418_0.17690450505928879","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.262":{"name":"@balena/jellyfish-metrics","version":"2.0.262","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.262","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d7387d39b3fb003ea7ddd980fefff1a822a4fffc","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.262.tgz","fileCount":15,"integrity":"sha512-nrvIpfFL7J9q7FBs5ZOMd+uj0FAj2XD3wf9GZtzkN1eb5Ady3rIskIOGCqaWdUEmd/uH4M0/fechGX7MWMoiCQ==","signatures":[{"sig":"MEQCIAes+Ibrw3IKKXIJt7DuARgUwgbXAPxcazxx8JKEuVh2AiBrDI5DCZt80L9SqXI/hQPW3pLwuCPxg0R1CAl5NfO64g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68260,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjVe2IACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo1Iw//czjBGIuPcwVnR9Bp21vrWWmpFscBkxz31Qxkgy0VVmUh/7O6\r\nWE8hrXsc4cxNCbtfOEASH2i8tJwxaLqcnHQIH3EojU/CMsOCRkz845hPD1M2\r\n7iUdxT4DadH1v3+bJgj949m5K8clYN0m1DVfRJmcqwqQuTDJ2IUyS3f+A/ma\r\nbOr2v52OkSx3VlAibg6IjKMNBUzIXW3vPlZZQa4KsRK49qFDznNa9lqFJvId\r\n4Fv8NW36qMkItBPQJ6UKkWscMVKeCslZcImri4XGRv9XVwmNqlOBcs8Jr1Bm\r\nAhsEKT/c442zGVm9q5HbVsyYBZv+J62hy2B+6okwHdgdw8/hlrBfd3d5rAHz\r\nmgrr2cna8ybJNn4+A+9t61G0THJSPKSCX1Ef10msF+CDJV026/2zwKYVzvo8\r\nh257aCeNN4QY4zVFojfAlA/bhsCFyVobs12hfsZV7t1Eu/P4ZVVOFxFXRQNK\r\nyopLHomd+BH1YB/GEi5ZAiVToL1LHnxQP93+7ztaxLsoWij43WYHIW+BN8+B\r\nHxmUly8nQMYoGTuTTka0GTyDxTtQpBoNBaBwl/YdDxTAVWrvyuKm7u0Ne2bJ\r\nFQf1cyH37j05+efpo3KEZFGHHOVkr6gHJftrxw8tl6mtt7q0Pyjkq5p+qxDi\r\nR6cauomG293LcMXSri8PL7C3GEWq0nzDD1Q=\r\n=qxiS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-6c39f067f3016f1810ccd2f7d8bf616de95eae3a-18.x/balena-jellyfish-metrics-2.0.262.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-6c39f067f3016f1810ccd2f7d8bf616de95eae3a-18.x/balena-jellyfish-metrics-2.0.262.tgz","_integrity":"sha512-nrvIpfFL7J9q7FBs5ZOMd+uj0FAj2XD3wf9GZtzkN1eb5Ady3rIskIOGCqaWdUEmd/uH4M0/fechGX7MWMoiCQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-24T01:38:47.812Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.125","@balena/jellyfish-environment":"^14.4.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.18","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^16.18.0","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.262_1666575752104_0.9460807720583007","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.263-joshbwlng-readme-5b9e861246210a547969515c955786a7a6b279f5":{"name":"@balena/jellyfish-metrics","version":"2.0.263-joshbwlng-readme-5b9e861246210a547969515c955786a7a6b279f5","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.263-joshbwlng-readme-5b9e861246210a547969515c955786a7a6b279f5","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"efd6b454ce18ecaab94e5ee25806f3ce499bfc1d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.263-joshbwlng-readme-5b9e861246210a547969515c955786a7a6b279f5.tgz","fileCount":17,"integrity":"sha512-7X19mtB1P8sbgvKkBHLaG9b9/mJjHvz9hKzapvQio6yjosll65CWmBM1BRGs1mO/HSeZf2Yld6smToQY+/qr9A==","signatures":[{"sig":"MEUCIHexUzuF3DeI5sxswW+tO0A5rjqqdCs9VV90E3lHydpaAiEA9gU268xYSliCLYNisy6B03NvI0OVnB6+tW39ls8jz9k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68112,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjVfIcACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrOZQ//ZB4STgNeCPRq0007NwC54ONot9VivYbb+UsnjP93WlCyyyJl\r\nuTuH7k7Y7vjzQcRopw5t2TZDAXiBYED/9Vd5Fy4DOwjfxVZFCbu9zZ5zQjrU\r\nIc0uZA+arPUR7VHefF+4002SvHQigx07sr8jOBVQY4f0KNge8g3hSfcwnT/q\r\nhys32ioQZehw4JT6r02wxmTfemIawEkPbmPrp92EF36TxbBYybMp7YUZOO2G\r\n0XGl+wk5DWMFzoJnYZQnlJiqv3AsqSNB4Or4P/3kDJoOHA1EPIud/XCmZL0F\r\n8G08ajAi1S1wd+wvy+90u3UA7tj1LxXvOutgjGKlxkD23QnEPcYxfYrlMz9Q\r\n49yKkKWW+mhnC0pN9dqGU5PSEoh00O85Ez7te9ESKYF0zvh+A2ecXxK3sHq/\r\niST2np4xCKEe8AtJQ+j/sRkQLaEAehsswJxk+C1+li7ASsImeXOx4IUuPV8V\r\nG1SIJeXFo0YPS6whwrruhYpE6Yb177mbyfuC/HOQuAvCWfthbDQix4xjREWW\r\noz241j/L7aSxcVetbdjlSShX6ZBR4wZJpuZK7mcJhbuxJaZWw20mtyg9xzaX\r\nr8t+zT7ZNJ1JQ6W1NJrzErrHK4Q5t9Vxcr7lZDyihUSucHcm9mvfY7Z9kNOj\r\nwfjhgAgc7HCSeW+LNu8jpOsCV3UxKnIFe90=\r\n=wJiu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-5b9e861246210a547969515c955786a7a6b279f5-18.x/balena-jellyfish-metrics-2.0.263.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-5b9e861246210a547969515c955786a7a6b279f5-18.x/balena-jellyfish-metrics-2.0.263.tgz","_integrity":"sha512-7X19mtB1P8sbgvKkBHLaG9b9/mJjHvz9hKzapvQio6yjosll65CWmBM1BRGs1mO/HSeZf2Yld6smToQY+/qr9A==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-24T02:00:28.603Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.125","@balena/jellyfish-environment":"^14.4.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.2.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.18","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^16.18.0","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.263-joshbwlng-readme-5b9e861246210a547969515c955786a7a6b279f5_1666576923993_0.4551202734998969","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.263":{"name":"@balena/jellyfish-metrics","version":"2.0.263","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.263","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"a167161eaa0e8eccabea64997ce7837204b1dc93","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.263.tgz","fileCount":15,"integrity":"sha512-/4qxk6q/nN25HM7Adetw2W1c9GaVsOsAlGB8PCC4B8eIQvYWS2tQd5BtJ/Gk/UFWTvxhEqykX2b4zn41N8BCsw==","signatures":[{"sig":"MEQCIFKubpb4vVq3iGNadm3yIO8g2vTv1FqsZEhTHKkzapxAAiBuGahlbCXLzOJ2KqZoMFdY3bFkXk6EsLOlJ9LILd4YxA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjVfKRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqoVQ//blA41pThyQJNm1o7NpJGKnVqhh13DiJNNq0OpH6WoJURHjYc\r\ndpN5PB4XXJFX5bS647L1gC+U9odSbc6aYFIKnuMRkUSkOLQ5tYpfEinfxZQe\r\nG6uCm3M+Rf3Asz7JxjaOJbRlWzn1YDrgQPhpC8dIDkH1XiQic1eTIvC9HJS+\r\nVf52Z3NgQg1uHbGcM7TCbKKnt9+CRzw+Y+soxWzgEGERuec1XS0s8piWa89I\r\n28nizXZPnE32aH+oWS6tLtMLtOvsUkTQMIozL7PQwTii1fi86RCXFyNNqiBx\r\nbFzf9x0RWLGF4CQXU1szVpgDmZDIA4zheiUXTrXEsXBARFI+01MFZuhW0taE\r\n/SOnt1CfNffHcUBPZRQk6sI0nam3J5flGIjXAdEn8e0Lk/vEy1nihCjjd8nq\r\nGxTBinE3Gwp2bHn6QFd8I9ixPVJJDPhAOKyQtTc04TT2VHgZgNqlUWiD9E/r\r\nkm5efLEjGfmMZb15HmuHEHYA7JMD7ledd2lakwNfBGEO5M9ChBQciyNtxH1s\r\nk6HMFRpxkaVPfaj9i/ipR378xLX+B7saP+edRVHLvE6JBVd8ttBeq9Qau9I2\r\nKaS09lPzUYZeXEf9NfXaZMCyc+bUzhIpI3iPEJ111xJryTJp9SFo8VIk6NHW\r\nmR7/i4901j27LfWfUarCJwgeO1YZazwkM5A=\r\n=46OF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-5b9e861246210a547969515c955786a7a6b279f5-18.x/balena-jellyfish-metrics-2.0.263.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-5b9e861246210a547969515c955786a7a6b279f5-18.x/balena-jellyfish-metrics-2.0.263.tgz","_integrity":"sha512-/4qxk6q/nN25HM7Adetw2W1c9GaVsOsAlGB8PCC4B8eIQvYWS2tQd5BtJ/Gk/UFWTvxhEqykX2b4zn41N8BCsw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-24T02:00:28.603Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.125","@balena/jellyfish-environment":"^14.4.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.18","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^16.18.0","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.263_1666577041432_0.6183806706709354","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.264-renovate-balena-jellyfish-environment-14-x-c88c737ceccd32b30416855774a3f32456057d54":{"name":"@balena/jellyfish-metrics","version":"2.0.264-renovate-balena-jellyfish-environment-14-x-c88c737ceccd32b30416855774a3f32456057d54","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.264-renovate-balena-jellyfish-environment-14-x-c88c737ceccd32b30416855774a3f32456057d54","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4ac8527ad25f2b502353052aa127204f097f8a1f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.264-renovate-balena-jellyfish-environment-14-x-c88c737ceccd32b30416855774a3f32456057d54.tgz","fileCount":17,"integrity":"sha512-57TajIRcPounzSpp2MXHrfxYNb5iYJ9l1jM2ERLwg8dri9bbqfN/B9+FwQffMAIkPtF8B4bP8nDUTlAIWMkTdQ==","signatures":[{"sig":"MEQCIDHg9i6ARG+13GcrWJm6juHFp0rllk/7QTYpqs3SQFTnAiA7EWNMy81yaQQa89BRNxqoUV/LNvTmTjwIMEV53KGUzw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68138,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjVhs5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpyyw//XGGLW8N3UNutLn5biH/E6h4xKdXzLwOVedxJd+Gq9KUfiWOd\r\n4bJ3or3wj/3u1Hr2GH8ig3J7XIFm0mjYo8loWdnLYPhDoa9h4Mif2l0LwuB4\r\nPZKVBnR9jIwXd0I32psK+l2yhqE80+0Cw/9xyTd8cIxqihvMsPyGHaX3lIXj\r\nHuz6dkUydXEQ9NswBmbtQg2le21lwfUnUrIFA5Jerh4UJx7Skn+d1DU0zsMW\r\nsOVGiYXufB6LUj/lcu1+yTWmqUVADZ2cTkeTaCSDpdlprCSZOGoSDzChd4rw\r\n/hgF+uEVY+0BzXv3NDxIV0v7HnfZpLPOzLlvaFWD2nUEP/vXlhUXj0BK8gaR\r\nUNqgq4yZXTgMIkygWA95L04z9cN5cCZOz11GwBPhvSDC5D0gAp/2PIC9mhiF\r\nruJCXajmYe4nYR05+XM2EGDP1cqghlHU2KJziM0DDShpAfpXBDIKbRAzswZH\r\nI9XK8UQOjftv4tw1QCuKlGPjh/tqAqTsMzE6+NWBMt1pNYuMakBu7QRtGxZt\r\nV0rIvLXA37OuezwzdBQiz5LL5C4ZnRRjHJsZry9nw7IiP2jLlDLXQyeyNIOR\r\nscyML+39KrH0q3UYzi2b4ZLvKZwJKm3zuC0z/blVq/x3I34luHQP/m4LV2EA\r\nmEkvzK9jHDfnta8U5R+G5nsCqtSCOAY8OaU=\r\n=jUTN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-c88c737ceccd32b30416855774a3f32456057d54-18.x/balena-jellyfish-metrics-2.0.264.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-c88c737ceccd32b30416855774a3f32456057d54-18.x/balena-jellyfish-metrics-2.0.264.tgz","_integrity":"sha512-57TajIRcPounzSpp2MXHrfxYNb5iYJ9l1jM2ERLwg8dri9bbqfN/B9+FwQffMAIkPtF8B4bP8nDUTlAIWMkTdQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-24T04:55:50.507Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.125","@balena/jellyfish-environment":"^14.4.7","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.2.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.18","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^16.18.0","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.264-renovate-balena-jellyfish-environment-14-x-c88c737ceccd32b30416855774a3f32456057d54_1666587449360_0.5251941104337023","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.264":{"name":"@balena/jellyfish-metrics","version":"2.0.264","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.264","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"09e58c8df47e1239da7316951accd182d5fb109f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.264.tgz","fileCount":15,"integrity":"sha512-eL4IFH1e9ERW/esWPweUTyZhvY+L4ug9n+GWR3Pr2Wi5KzojhSGNqQ6oBqVs7VniJ3B5S98PxH3Z5TNJfPZbUg==","signatures":[{"sig":"MEYCIQDric9GZbcPKak7mTNMa4Tg8CSWSIvQTSKzbtG91VP+KwIhAJq/xn31QUE/5DIzwwu94NyG3UJGy5Q66teMTPio0rrr","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjVhvFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoqlQ//cF/o0qfW4tuZFS07ktiFE8Rm0VTO7qZZ3SN57oFEvq8aKJj0\r\nxHwQ5mYOhdeSU4Mv1T4Yf8qIZ+aSzcpLhNjyMLXHwn/K4DDVWZngb8aT1a16\r\nYHDvYCaOqV+FFsGYR73MgaJOIMmHJ3h3dHsdaFqQ8qYblILxQm9CIyznZ7Mu\r\nZbHApgsBKrCA9hGjRdXVt1w/VyGPgK3z33cdXAYJv9rIYPXYG/itkAzlUquk\r\nIwnm/PuV+XJHS+fQHNaTh5bJbcr1T4aUpPDGUgvXVe2wugsGLM3f26Qtb3O7\r\nu9py06PgoJlyz/fFbPUuk9Jfxj5HKSJ4nteqvyQ+LsjmDu/ubcVoQ2plIvq7\r\nL+yWx6z1YeSwU5i5aypg+wBSaRNs5gvRiLzAdGethNa6bcS8v/FTlFgrXYy/\r\nakgmHsLkTTGlQkP0Ayz5TQpyJ3ukEcQmRqL6T4/nIGnG2WsatMSuoPg5LBqm\r\nxyK+qOYzPfKSA0nnvSlvQnCq5yjEJlle6FJoVQAFIRRqWV9ILZRw025WqQ33\r\nF8RtQbpk0EXCr6jkDAwyKPhmag+3q+Twrr1LAEmJ7ElIEcZxripXuXesx/Mg\r\n8b2PhcTnA8Hcp7Z7fpsPF5EgXqrVJSLTT/iE2shOe63u3FAqXGWyAz1blJoN\r\n0C6dwPjv4kJNJWe9XMUYUfobTB8DVA3yrAg=\r\n=oAks\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-c88c737ceccd32b30416855774a3f32456057d54-18.x/balena-jellyfish-metrics-2.0.264.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-c88c737ceccd32b30416855774a3f32456057d54-18.x/balena-jellyfish-metrics-2.0.264.tgz","_integrity":"sha512-eL4IFH1e9ERW/esWPweUTyZhvY+L4ug9n+GWR3Pr2Wi5KzojhSGNqQ6oBqVs7VniJ3B5S98PxH3Z5TNJfPZbUg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-24T04:55:50.507Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.125","@balena/jellyfish-environment":"^14.4.7","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.18","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^16.18.0","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.264_1666587588789_0.7952167518416984","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.265-renovate-balena-jellyfish-logger-5-x-0f08c39682a3da7f312988d56cae4f64ca0410c0":{"name":"@balena/jellyfish-metrics","version":"2.0.265-renovate-balena-jellyfish-logger-5-x-0f08c39682a3da7f312988d56cae4f64ca0410c0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.265-renovate-balena-jellyfish-logger-5-x-0f08c39682a3da7f312988d56cae4f64ca0410c0","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fc38ceeb5573d4afb08d0342e01f907bfdf391f5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.265-renovate-balena-jellyfish-logger-5-x-0f08c39682a3da7f312988d56cae4f64ca0410c0.tgz","fileCount":17,"integrity":"sha512-xpR4RcBI6IWqXHjaW/T67ZgwxPJpdjjQhXqv0+u03SSehjscnFbYDJh0fsTzfKifjmY90nY1W/BL3H7lPqCMCQ==","signatures":[{"sig":"MEUCIAE1yreOXphYN7Xdl/0T1N7glFEbFsVOEXA+ItiizXf2AiEA/4W5bkn54Qs7wxFQ06Q8rr3KL0ZkqaRums3Ash0En20=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68132,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjVhxzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp2VQ//Rr5YDGyDu/ofIV4SzB2+JfXMZGlhuPArNMm7X6Bnd/aoJS9l\r\n7vOgSg2LuSSXPA+MFgfpkHuYoqizZpbqdYyySfouOQdTyaE9tYC3Pn6POg3F\r\ns9h+l0kMihrItoqVkJSTpq6gHcXB6D5exgm6IEPY8D8NS1Oeg0aUOtACwhqm\r\nPmhXfZnxPj34u1+517xwzmwqMO+Rv1e2xFe9/m9akoRAkPsjRNsYCd6JJDlf\r\nqpRfqW28KgbWzFjP04LTZjBoGI7/QL1ToArATeQFDuxJYzvuS6Xpn2HkLjAJ\r\nYXotYcGA+Scg/TPsjHH3RG7t0EdZ6A4UgbHiD4nh0NC9/xifoL7CZ9sqCl6K\r\niqEdkTLqrSZJw3vZkDhAk+dUkywHgr1g9ywN9n//2ObscrDdVQVoSPAIptb6\r\n4foey2IKRF7wPLrHlZZkBAgCtadhS3FfBcY1cEh8ULluSkUOyx35JL0hn/u5\r\n+IP5CGNgVu/PTf4QOa/ImeLyxLDPN3ZZ1kicMN97T2Le3T/U1Va62DTZx5B+\r\nwler5OG9MMa1d5bhhR7ce2ReG3eHckYC87WoNEYtkl1um4QtUQy9SXaUFwZ/\r\n2UUGlHw9jXsKzpJEd6+WXBu8KefJcjABAW5n7Hqvz7D3cPCodSovIHvh882C\r\nQ6GUSZy6P3peYo9wj/9+UBU4OsAaxwxYM8c=\r\n=Yie0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-0f08c39682a3da7f312988d56cae4f64ca0410c0-18.x/balena-jellyfish-metrics-2.0.265.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-0f08c39682a3da7f312988d56cae4f64ca0410c0-18.x/balena-jellyfish-metrics-2.0.265.tgz","_integrity":"sha512-xpR4RcBI6IWqXHjaW/T67ZgwxPJpdjjQhXqv0+u03SSehjscnFbYDJh0fsTzfKifjmY90nY1W/BL3H7lPqCMCQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-24T05:01:07.088Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.4.7","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.2.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.18","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^16.18.0","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.265-renovate-balena-jellyfish-logger-5-x-0f08c39682a3da7f312988d56cae4f64ca0410c0_1666587763634_0.7616391944866805","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.265":{"name":"@balena/jellyfish-metrics","version":"2.0.265","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.265","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"eda4f1106755a8edb47d78167023af7696319470","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.265.tgz","fileCount":15,"integrity":"sha512-+sEBi48eX80eb+gENDrXuO0z9ZAVDjQpACvh2gkpTsla8kkzmAVEHBO24gIA3+7i8QHreF4izoFx3OUrHUpMXA==","signatures":[{"sig":"MEYCIQCzcAbwn9yqYWepDq4Rcv2D726IQHxyqSgMEGK+jnHC+wIhAOS3wBgPXYBJQPfkG6YWfyKj3h3jjo3IoEoW8Lnomlol","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjVhz6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo9GxAAhMrw6mSW0/co+H06qf39+mcGze2LcbcVaUAY5C6pWScfQ/7C\r\njYjD/lsw1PbFcdyI5lNgOE/6YXo9YzYLSW/vH/MxPOm2ZTd1ntDbVNEZNWPU\r\nBRsasX+QMYVfwS/Ql4Bgy2RX0Gqh7nTREcVtIXJj3dMXhtBmUTMinviT7e/h\r\njquuOxLV9UzjbhxmAEPPfwLVA+p62mEPAprLoCnEAMAVXCOwO7dHFD9l0Qpi\r\nEf+2L9+qdSfxY1D+4hnMWROuAGvorofK/w7rbgbeGZKi/yusLcPVeIMPVZwu\r\ndiJKwXCuJymon9o/qjOVmD5kVRwSRzWHDsFJZ9Kx+eBmAoFsoh/qOE9x1qks\r\nwDAtEvx79nWJJhYSZjcRLIqi72D+2Mrtx7cgk+BWusjlgwMq1hn8GbMG43bK\r\nF5a5N3BanmGco4Xlb54/zazMTV6/lGH9Q2+yjQLtS50iaaPA6PcpgxK3SPMW\r\nqqIDCMdiKzZVO0OUR0NAlNbQ81AraPs0VBy3LeUwq5cAjOBLPUsPD8soFtA3\r\nsuZRl6DJ72ANjlrAW1gTLviJXWSlfthMn/96cFqlrXiUh8MwsoaLiYWihqe8\r\nj5c8CvCBOZyKL7qG4OKGJ3chxmspVVPmf/w0BshrKAyjXugmYacG4LSbp+CQ\r\nWZlgPH/XmwKB1SpSB0PGBr8CKWeFxWaGSas=\r\n=0aPn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-0f08c39682a3da7f312988d56cae4f64ca0410c0-18.x/balena-jellyfish-metrics-2.0.265.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-0f08c39682a3da7f312988d56cae4f64ca0410c0-18.x/balena-jellyfish-metrics-2.0.265.tgz","_integrity":"sha512-+sEBi48eX80eb+gENDrXuO0z9ZAVDjQpACvh2gkpTsla8kkzmAVEHBO24gIA3+7i8QHreF4izoFx3OUrHUpMXA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-24T05:01:07.088Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.4.7","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.18","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^16.18.0","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.265_1666587897956_0.4691125810138814","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.266-renovate-balena-jellyfish-environment-14-x-aec5f0398996cf5a993cf73626d9410bb52c1b0b":{"name":"@balena/jellyfish-metrics","version":"2.0.266-renovate-balena-jellyfish-environment-14-x-aec5f0398996cf5a993cf73626d9410bb52c1b0b","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.266-renovate-balena-jellyfish-environment-14-x-aec5f0398996cf5a993cf73626d9410bb52c1b0b","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"5c3383f1dfd70333ee2617ff3c9d0bcce634cb76","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.266-renovate-balena-jellyfish-environment-14-x-aec5f0398996cf5a993cf73626d9410bb52c1b0b.tgz","fileCount":17,"integrity":"sha512-9VyjVNxNMn8SnXEQoYbpTDGnKBovuVL1hr0rRMhYRt4wJhS1gWE5RyHoX+e0za4I0no2iRuWqPYi93iqh/sycA==","signatures":[{"sig":"MEQCIEXeJIxXIv7Egd+I4PRweSnrzVcjgvl7kBym0YBSHpMzAiBzGpsIBhhNG07TtlmRsSDQao4IA4ELUdYbvc7D6SBwkg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68138,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjVkfbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq99A/+KrDWDmEv66ofK8ySDlja1R+ojbeXrjbRkQWQavoTt28QTH+w\r\nWQS2387XJn65VAMf97ftZA9mVO7zEzSWVLXfnhAZNHdyfeFvmWuDERKE8p/2\r\n8kmjNUKuCOaJLcw/EuVYe+n6SfiUPs9A0HtqrW+PujUSeZlsif6QIM/DrjT+\r\nNeXRtjpu1MYzywr/xsUdFineo/uJupp5mm9kQemqbjiC0p9aoZyr1T7ReeLm\r\no0W/PpHt64znlYMuNZkr2mWGbPukyQTKLYGQCR9soUoX/f8YFK7CaMbkZjpV\r\nkJgNLJy/WLZeNz5jU+XmdCSRCQ07nWpqNbV3+7BbXtXFQdt91H87lCqLpdC2\r\ncSYBcB3IphtpzdyjKzcfb1DEKGnT2fw/d2bt1edKw6ijHEV9VNFukmVaHUq6\r\nXcrOuGfOn/T9hX0FgYL7HLnZsD9nI2RYKv/rucZLPkn28SRfhXM/FaWZMPD+\r\n9ip13gTsQTM/yP5Bxk3yszUjpE127VL/6OBcs8S2H9QaTvoh4WGdhnEUE///\r\nyObVvcUvlZXw8I8levBglQ7IbeXKcwWvUKCjoKgP5iBjqomariE9q7kJfmQ1\r\nN71n0jYLnlEnMpyrs5zMPx8xtM1HSNHMHV/3qSIy369DmsTY/QPwAnd8ZKJt\r\nLdtCBAUX+s9LwDQCkficyz797Op4de2m1dM=\r\n=eKhz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-aec5f0398996cf5a993cf73626d9410bb52c1b0b-18.x/balena-jellyfish-metrics-2.0.266.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-aec5f0398996cf5a993cf73626d9410bb52c1b0b-18.x/balena-jellyfish-metrics-2.0.266.tgz","_integrity":"sha512-9VyjVNxNMn8SnXEQoYbpTDGnKBovuVL1hr0rRMhYRt4wJhS1gWE5RyHoX+e0za4I0no2iRuWqPYi93iqh/sycA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-24T08:06:16.719Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.4.9","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.2.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.18","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^16.18.0","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.266-renovate-balena-jellyfish-environment-14-x-aec5f0398996cf5a993cf73626d9410bb52c1b0b_1666598875048_0.0834650428055439","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.266":{"name":"@balena/jellyfish-metrics","version":"2.0.266","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.266","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8ba4262fce53fd8a77f47936a0a4b23ab1ccd66e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.266.tgz","fileCount":15,"integrity":"sha512-N2ITvv3hxPiORytZIFekagc09mdsHfnKcBMtnUmmlGs4s+DxtvwvT+cezs4Sl/mJGlhx4aPDUtnU/VdBTNKrDw==","signatures":[{"sig":"MEUCIBAitdObDhJwVlLL+N0KIwhn1dzF5ZWaBX6H34XVOE8DAiEA6dhDqfZw58EMTAKQh7pUVe8FW0V+MpYWkwhQEz1heag=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjVkhlACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrcPQ//c6mSS+8BVC8OTOH8qGLYndQGcc9paxrgcam+G2Ml1exuSnU2\r\nqSZAN360h4sOx1Z1ZvV6BiEbsiOEey4HlOgd5XB9jpksEMWdnbIczUkSl24L\r\nxaDAdC40FmHOjK7YnrTWWFYq3hCMwiP7Z4Rf/BflBbf8OPeDDN2EZq14Zzpz\r\nkriHv3BAiY/ULWpCnjnBTAMlKOzr061iBGP0bNT4fQpT8gOTkylRTACtTX6F\r\nxwcVqn/dyMLlM4yPKqnZBAYtx2VCx51EInXotRcuCSdN4zu2YeADoZZJUJlU\r\nJY+7ijZPrVJTcIQc47H8daXLCtShG9KwW/bs2J0iCOd6mo3PHbITwpzrVwLH\r\n7Mxrr8n+AJRT/5TxNr/KY4dH1Vm8yvR3MPlXFiW7KYLNZZE9w6Cj2TGsEqzd\r\nK5Q8IMjYA9s2yoq7LdZo29R3PCz58sZzo7R7XKiBhpqiUFKjPslo1qgvbpYd\r\naehzLjZRgz41Bp6QIfxcCJlFvXG+mV0wFtfaczdyhIAy+XfTknYJhZoHMWqc\r\nPU1J6+UJES781Egv9jbMcy49NUrHz9b8OUbvk7/zpsOwHZrZLSxhYcz9sbfO\r\nHYdq44N0mjhO6RJdnQ59QntdIXIOljYbpMozBmpXq0i0q8YQMz+zzqGkppg5\r\n6K0Fy3gjLJcA/dtlRf5cVHJJvpqpO6euFF4=\r\n=AaFP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-aec5f0398996cf5a993cf73626d9410bb52c1b0b-18.x/balena-jellyfish-metrics-2.0.266.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-aec5f0398996cf5a993cf73626d9410bb52c1b0b-18.x/balena-jellyfish-metrics-2.0.266.tgz","_integrity":"sha512-N2ITvv3hxPiORytZIFekagc09mdsHfnKcBMtnUmmlGs4s+DxtvwvT+cezs4Sl/mJGlhx4aPDUtnU/VdBTNKrDw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-24T08:06:16.719Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.4.9","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.18","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^16.18.0","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.266_1666599013451_0.7403071128754166","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.267-renovate-balena-jellyfish-environment-14-x-80d2a7f727f0e03f8adee96997349e5f26eb1014":{"name":"@balena/jellyfish-metrics","version":"2.0.267-renovate-balena-jellyfish-environment-14-x-80d2a7f727f0e03f8adee96997349e5f26eb1014","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.267-renovate-balena-jellyfish-environment-14-x-80d2a7f727f0e03f8adee96997349e5f26eb1014","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2504f47b8480a03e162f02acf5936cb09528266e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.267-renovate-balena-jellyfish-environment-14-x-80d2a7f727f0e03f8adee96997349e5f26eb1014.tgz","fileCount":17,"integrity":"sha512-JmhMGnUHfwQ5Pkocc/Ur+9QfltTjcgMxwYSL/nLURbDYsjk4SogNB7UcY2ne/d2vUgF/q9TPJVYXAMtBJTFNkQ==","signatures":[{"sig":"MEQCIG9DxZLyyFhzqlsTbiRiIM0mBoGka2tnFGYtXKux+CLoAiA3i8k1k5C3AYhTFag9S/42thzxopN23oNTpT7gbdCc5A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68139,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjV1+HACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpQAQ//XP9/zkOTwaDcXxI9in2Zjk2KILYDQGt6VFlsMV5LGLfIPcTR\r\nhCWLzwv80FG5YDO+AYtUNRH5wP1u5DeXInV2Ls5i/XSXdGe0VBvf4J54m7o4\r\nom9Jy7no3f0QAYcJYbAyL3OSFuB6dLb5dMG+XHBweIwk9wlTHQ7KyDIjGVnx\r\nxGBKzgIIGrzwhRa35Yw2jUaDPRwq9c5OZZFLAJrrtfNOw2xS4dVCcP7rxg8q\r\ntncWvegEHtdChoxQp4xLneWeSO2LXZGGqN6eky5500FbTMFtzviAzjvYj7we\r\nX0xHj3Wr70jfbJCQ8uWNOW3mtcQpTjK+uXLXc2DpwG0lNNFNb5BSY+Z6WBTI\r\nCuEI4d0l2RzG6Rmb0f6RiSY4kES3zxa+WiamFwzhbpM8+LjftZLJ+zSvaA09\r\n6JV1NkrFmH1buAIl2bKPfrGBLkxGItlXzGTx/YvpiOXkEsM3NFas7JhPgvh7\r\n9VhK9UIAE/dgCBGA5CRngBJR/PqKGLhNRGci+XoR/iPSepKeMKswFI+PEWBW\r\nRQwOyWOzX10Rn8/VrS3v46r8IZ55VZJMJKzdgraSQo7EBDCsmxdrjPcqUPGV\r\nk+yfJ8Vkpvxwr8WTCiWjF79cYJEcQLYZmLJvgXruDmHEOSZR+oeoHJgzf0/P\r\nmTCFgvOJrT7vOrxvApuWZEkNu03fKL3QY5w=\r\n=3MDs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-80d2a7f727f0e03f8adee96997349e5f26eb1014-18.x/balena-jellyfish-metrics-2.0.267.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-80d2a7f727f0e03f8adee96997349e5f26eb1014-18.x/balena-jellyfish-metrics-2.0.267.tgz","_integrity":"sha512-JmhMGnUHfwQ5Pkocc/Ur+9QfltTjcgMxwYSL/nLURbDYsjk4SogNB7UcY2ne/d2vUgF/q9TPJVYXAMtBJTFNkQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-25T03:59:46.996Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.4.10","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.2.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.18","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^16.18.0","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.267-renovate-balena-jellyfish-environment-14-x-80d2a7f727f0e03f8adee96997349e5f26eb1014_1666670471266_0.8219737794028106","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.267":{"name":"@balena/jellyfish-metrics","version":"2.0.267","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.267","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9cd28ed9beb348854a507ea4e718649f5a8b0bf5","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.267.tgz","fileCount":15,"integrity":"sha512-7ZNm9Sr5ugkSnPpQetWaX7gAHFIBJxHkZpob/2nMPzeCechMQFPrBzU5iu3i6yYXtweh2UDAlW7Qf+UJxTYArQ==","signatures":[{"sig":"MEYCIQCiVBlfs9QByIHfV+2HdSxgP9eVeZvhoSFbk5hXu6CmGAIhAIWHLAGou+n5OhBeTNaxUNf2yz2QEr7CFcIrq+i8biNT","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68055,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjV2ANACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoEAA//dLbBzr+AHTxWelLy3OIa4Wkmfr9nr9hmtNH5owRgJWMP7Qom\r\nkbTZR/I9G+l5SiaiGAqWRT/c73iPBOu3iD+VibTLQu8eaDkAs0VnQhz4S/BX\r\nTKJN6wYCBI1aCZ7YvIMOOrcnVzUXArab2VR535qfR190YTzMzbj78H7E7I1g\r\n1hi/4EaP8azcyNs3QvNfR/9rndxWgpZm5zMguDyButZszODwhYReBGJdTNJf\r\ng1U34WkrKNq0+M2B0vxnWGfphomLXTfid77PiiaklAbb3jbKgjtzkV15Ne/U\r\n4ZZJXiCwyp7hlqU6yygBEqnG5nSbaZcJExZEtIz9dBBASZLGVbtEikJUwzS3\r\nHAN1SLKv8qMZcJkVDvKiWdzKjZClvetBJJQ1ujaywOVyehKSmDnVCKq3apU8\r\nseT2PnMjhKL58GLF9sHUT36GyWm/tFRvZPXXkGb8QuSJ/Bc/PYudbNaMs6tX\r\nBU06EVNIjPTdewhaPpwPkwPlx3UQOyPEROdkSH4+tlfgLUFlzLYUhEaHkWX0\r\ndgEb60Oawfaa67FcK2AkunLqpOKxRaqgHyn6P8Z6OFdMUv/KsaT7LNnAxb3e\r\nxqjk8WU3QoGYy+C+MiNM+Row2u/Xmxp4axX0lovMeivoZiyUJ1+SEkohKf0F\r\npBTqBL9KvTIVXdbKs4KMQCaiqM3FSNEMxDA=\r\n=YLAm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-80d2a7f727f0e03f8adee96997349e5f26eb1014-18.x/balena-jellyfish-metrics-2.0.267.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-80d2a7f727f0e03f8adee96997349e5f26eb1014-18.x/balena-jellyfish-metrics-2.0.267.tgz","_integrity":"sha512-7ZNm9Sr5ugkSnPpQetWaX7gAHFIBJxHkZpob/2nMPzeCechMQFPrBzU5iu3i6yYXtweh2UDAlW7Qf+UJxTYArQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-25T03:59:46.996Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.4.10","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.18","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^16.18.0","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.267_1666670605072_0.39604625414765326","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.268-renovate-balena-jellyfish-environment-14-x-555578c3bcbb241e60fb9f02300a29a455c7f008-1":{"name":"@balena/jellyfish-metrics","version":"2.0.268-renovate-balena-jellyfish-environment-14-x-555578c3bcbb241e60fb9f02300a29a455c7f008-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.268-renovate-balena-jellyfish-environment-14-x-555578c3bcbb241e60fb9f02300a29a455c7f008-1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e3bf03903f378c8f41b212e2fafde6ed3b44637b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.268-renovate-balena-jellyfish-environment-14-x-555578c3bcbb241e60fb9f02300a29a455c7f008-1.tgz","fileCount":17,"integrity":"sha512-ZT0YzuwLf9AhIYRkAQe4XZCEhHqk9POSpKQMPAoDYBADDALJ5mOg8RcnSKw4IlMZbCMYEOdOaVSk7/hY6ZnpgQ==","signatures":[{"sig":"MEYCIQD+lW36ukeohGlwPmsxo/S/1PhXCd/GDF41THW8D1aiHgIhAMXnekn/MtIDFAMFr+IImdbHQ0jn4gifY2XlXB5VmDTO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68140,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjWgO8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqzFRAAnRnKbEwZnnLS1mNmmEX2b++EoognHM/qVTFxDQV4tAuMrPYf\r\nykoOyqTuiOc2WOrtE1YTX9wBzmW3II1PX48aLiqiDR7MH1EkQekPvNhLA0bA\r\nMGa1N0IGVTbOntnL4Cf1LpOhCiMM5kf6yTEoxqT+2RV3g2X4TsmIvHxdVd4y\r\nEuwyeOBezhanpjN4Uhjt13lazdSxBcahmVK7mciCfzi8pTJ2Ee4T1/1g56xB\r\nUnOGu5gHywj1FxPiBgPjhTHFQ5AlYsZz9xnb2Z9uYQ8Jm3OgQVcYLMUFWZA4\r\nf5Sb6u94DOH+jHv6rDqBhwhGAlxO54p8P7i3Nvi+zXAX5OMfaAwobmDQJN4r\r\nyCVcehdKYJ25ycyXEsiXBMzZjpRg+DPJHoiOpw/NwWSmBzY3Y03jjwCcOj1K\r\no+R6akdq3mVINlt8lnG/LRmK2y+DhkpD4pQW8OAeVXmLuNEVf9oCuyr1oMFY\r\nOsfgoruOoN8vJQDclYT5kWMI4j7Cxr/VazNCI2Y0YFh8eL+Jr4h4MKicRmP8\r\nZWdmqsTjv3w5PYX0kUlPAkvYZ4wwO1T3Mg+z3x9AKXbwrpw5hcZ2kkRFVXTT\r\nap3EAvuqHN+TXZUW//QMmBBPqP2UOK6YAnptGuaKweqo+SWEKuM30RhpUhuJ\r\nvnb0K9PJL0sVzJUndbEFdQvUAc9fwhID6aE=\r\n=og+G\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-555578c3bcbb241e60fb9f02300a29a455c7f008-18.x/balena-jellyfish-metrics-2.0.268.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-555578c3bcbb241e60fb9f02300a29a455c7f008-18.x/balena-jellyfish-metrics-2.0.268.tgz","_integrity":"sha512-ZT0YzuwLf9AhIYRkAQe4XZCEhHqk9POSpKQMPAoDYBADDALJ5mOg8RcnSKw4IlMZbCMYEOdOaVSk7/hY6ZnpgQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-27T04:05:06.747Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.2.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.18","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^16.18.0","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.268-renovate-balena-jellyfish-environment-14-x-555578c3bcbb241e60fb9f02300a29a455c7f008-1_1666843580493_0.863656157050215","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.268":{"name":"@balena/jellyfish-metrics","version":"2.0.268","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.268","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e642bf2012e4760397f4ba07c435ead34fdc9228","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.268.tgz","fileCount":15,"integrity":"sha512-Y0SneTYI3eMIIQibw2K6siV3VjIDl65btHrDw3tFe0zlNiMJppuDe3IlM0nEg4Q784FBqbfMkkDX/imPUMZM4w==","signatures":[{"sig":"MEQCIAUZRKpwPFNzGXXYfYEWrQHbecY8ky3CNRVAPCb0uOBBAiBkGccb3z8vXNoqW/2Ed6epC9HenMJ/nQPxDzJxGWSnRA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjWpsyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrACRAAo+TCC5GQwsOYKCWtFCH+kCpT0q9G5gwDhGLPhVkx750G4Ra/\r\nPGX8ogD3JBTBXzhC1aZM/8KLd+8vRc13xzCJw8Suq8KU1xI1lQzjd+55Hp3n\r\n2yYTzgnJUzgcViVUthDgWyaCK8P4oXeBo3OHoQLazCAdkOIgUOEorTEr82fk\r\nZqB6IrEHME25wIq04zResJWtMj8n1GPLKMQZGvpcoKXAjk/vyOw7E9k5g+2p\r\nh8LN0JTdFouVlWRzrRfpwzKPxCU40VdR4oq2CqZVsTmH8Bm3UERVeaXkEyUs\r\n9m6wZwof6bdWYShYj2LJ0NaR50EqfaU5rHn9DJr67V/HvGvEh5J2vyljDz2L\r\nPsEKDQr05+lIVVOpBA4BSd2xMYL1OiRLLEb2hkc9lyQx0Bn02G456MWcRXIg\r\ni7IoSH64QsQa1RCgovbTNecw75pnJRvPbpizovL1iejJeCBfRw6ln1TCqM2z\r\nJmxdmG93FsZ2IQFoHjd040DHvn8+66gq70Vpx1AThjkbHwyWBwKR6AD5lbtb\r\nQhC46HPFX19LIrp+QKv2tOuLgxa0B+EpBvy0YdJhQezzNVBk2Ko1jU+ttSaA\r\n3EL7knNb/kwmLLobrgnvUeS1wBKqAKlacVmFNTO0rOzmqvikUkcK662RQ95f\r\n7nMMm0ncdKS1tUe2ujTGMwQscVIVI/42zAg=\r\n=/E6s\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-555578c3bcbb241e60fb9f02300a29a455c7f008-18.x/balena-jellyfish-metrics-2.0.268.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-555578c3bcbb241e60fb9f02300a29a455c7f008-18.x/balena-jellyfish-metrics-2.0.268.tgz","_integrity":"sha512-Y0SneTYI3eMIIQibw2K6siV3VjIDl65btHrDw3tFe0zlNiMJppuDe3IlM0nEg4Q784FBqbfMkkDX/imPUMZM4w==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-27T04:05:06.747Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.18","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^16.18.0","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.268_1666882354234_0.6543671718934834","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.269-renovate-typedoc-0-x-769d1ea57b50e5dd288f99a989e9dade0ad37685-1":{"name":"@balena/jellyfish-metrics","version":"2.0.269-renovate-typedoc-0-x-769d1ea57b50e5dd288f99a989e9dade0ad37685-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.269-renovate-typedoc-0-x-769d1ea57b50e5dd288f99a989e9dade0ad37685-1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8a0dbc090e0675f7fe0cb080e56590cecd9de7cf","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.269-renovate-typedoc-0-x-769d1ea57b50e5dd288f99a989e9dade0ad37685-1.tgz","fileCount":17,"integrity":"sha512-jZMelgZV03u0xDvAiNFUgs77VjegnIbWoM9fOgq0rZ68UdbPuCSLu2nuUOYtgtpnUvu5+hNE/0m4DuXS7GKbIA==","signatures":[{"sig":"MEQCICL/OJvOTHrBRZbPom1CvbYYRkXSnz2iqqD0jaR0dbalAiBgy15e124lkMMm+zD+HFgE8gz7tz99RK5ioR0kzRrU5w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjW1fgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqZ0A/7B/w/8Tp8e8MaYXYQEqLTvxHln0E2mshoVM7Neek9F3utDGze\r\nP+v9rS2q8QYCMk/ORnr0yBhwhSV8cICAvIMSRJsjMnxCL3/iCVJD/R+XcclS\r\nbYZ7T8vv1ZwRDYQGg74aK7F04pA3D7HaQ6/IUnBeY53iK0R8SU5ljU0akAUG\r\nBe1jFo7ABwxicz6J+s2UbtlfqTRnX4VBRJUDQofy6JLGx7wIy4bX5ecldkRM\r\nXAZPlfCTcAFyCSclETIlPHBqCYnAYa3wQryaB7noXnrZ//e1zSA6Gw+1XX85\r\nQNx4LVRdgN9WYGfyOzM+MBi0A2cyL9OuF7D87F3mfGmDp1whqy4NaNF4cvJe\r\n2J19ERFQqxRmFcxqHmm0wbbkmRVtbXMCT5QLz6Gr9zx5tWG1N17LWKoM4ZAT\r\n5jWx8d9Rm/ziq9UioGaqgZWGvIfYYFIC4Euc4R4yERjpbcWyb1oWfQnfYf2u\r\nYoXTT/H24uxL7qJePenZM7apW41jiTxprNGAxMAL1/dpx+7E0SLY7h/IADk4\r\n8O0MEjbiM4yEfIGi0uGOPDW+Rb1qYvH+g0fy9ZGX7BeBCwvBwyUoEThiGPJD\r\nv66jzOBHaG+44yOIvsUGKij6kKSn97w6bUyMANV/43on36cMiHCdrPEoHtA+\r\nsHHGAI9+wwdKaGDbeZX/KxtXEz3N4M3mqOM=\r\n=BudQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-769d1ea57b50e5dd288f99a989e9dade0ad37685-18.x/balena-jellyfish-metrics-2.0.269.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-769d1ea57b50e5dd288f99a989e9dade0ad37685-18.x/balena-jellyfish-metrics-2.0.269.tgz","_integrity":"sha512-jZMelgZV03u0xDvAiNFUgs77VjegnIbWoM9fOgq0rZ68UdbPuCSLu2nuUOYtgtpnUvu5+hNE/0m4DuXS7GKbIA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-28T04:16:07.893Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.2.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.19","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^16.18.0","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.269-renovate-typedoc-0-x-769d1ea57b50e5dd288f99a989e9dade0ad37685-1_1666930655978_0.6873431129925436","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.269":{"name":"@balena/jellyfish-metrics","version":"2.0.269","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.269","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"44367a89369751daf1086eea256f17a2f528ccc1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.269.tgz","fileCount":15,"integrity":"sha512-PdNzLn9XBJ0+tGORxt4c4SIWGAK7rLE2QJhn7W2RGueBWV8OTgHNjR8G2szg8wcSzFYVYLGGLUcOo7xU3v+4dA==","signatures":[{"sig":"MEYCIQC8T51LVOehhCCpad81coCYvgAsUXflxyXRWu5scoLTrQIhAPT8hj02GfV46H5mMHJJVs7fyV6FI4zxHS8LrlYmD9pH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjW1hlACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqcLg//dFgxBBevXGX+EPdiPbN562jiX/yr+J3c2OzAN06On5xJyfIz\r\nNLUvDZff9X8aR+8cH4upyExZgaQ5EtRBDGNjBG6u+3vTQSjqD8juEaONQ1jD\r\nxzSkjbszg6NSALWClmNvUUfGDWzwA7RjHPd8qJEZkHOsh2WKJptv5Whv0UKi\r\nzQUjeSX2oS3idn2j35d6jbWvqrqWqCGor+72zrTSija7Ysyv5441RE/y3ZOM\r\nNuBj3oSsp3zieA4N4YfEOnmHfVoLgbxa/rL9qeABPtDE05GpAqvTUgey6nKj\r\n/pF3I6c69aCpP+tXukt5MtIBP8Kac1pd6CrnExABXi3/KNNnKhlMzf+Zome5\r\navq4ePaUHD5KGT98Rz5gFOXxAf05lBBph/2RsyNeu2tktFSnm0V4H6cq4ddP\r\nSGc+F23q+sw3mesbKC4cSwLcYLmzfKRrfnMjMKSTrUSiD17ilF0G2omNzlkB\r\nPz+o+RvuTGTTbtXEaGjYHbA1xXkClTvAf3By+y9Bpsp8LJwlxj6Ul0Nm3X5i\r\n/dZHY8IVdZ/dJUdIQ0G4R7xQ9DHpdomnxX2R/AkypXU6a4IXFjDj2QZ/SgWG\r\nFVkWJFVLUjibpoc3tYovgq/XuWu6UGM4HUQNBMNqQiqf7IgAAYX5pQmj/Rv2\r\nNCCBsJgkfWFFNhNzDFkjVxm3Amd3NOYqG0E=\r\n=P71n\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-769d1ea57b50e5dd288f99a989e9dade0ad37685-18.x/balena-jellyfish-metrics-2.0.269.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-769d1ea57b50e5dd288f99a989e9dade0ad37685-18.x/balena-jellyfish-metrics-2.0.269.tgz","_integrity":"sha512-PdNzLn9XBJ0+tGORxt4c4SIWGAK7rLE2QJhn7W2RGueBWV8OTgHNjR8G2szg8wcSzFYVYLGGLUcOo7xU3v+4dA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-28T04:16:07.893Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.19","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^16.18.0","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.269_1666930789545_0.2950497515573878","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.270-renovate-balena-jellyfish-environment-14-x-576ae246f6d6ca204ca58bcbaacfe175bfdf52b1-1":{"name":"@balena/jellyfish-metrics","version":"2.0.270-renovate-balena-jellyfish-environment-14-x-576ae246f6d6ca204ca58bcbaacfe175bfdf52b1-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.270-renovate-balena-jellyfish-environment-14-x-576ae246f6d6ca204ca58bcbaacfe175bfdf52b1-1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4616642805ffca67e984618b510bc755b4792aab","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.270-renovate-balena-jellyfish-environment-14-x-576ae246f6d6ca204ca58bcbaacfe175bfdf52b1-1.tgz","fileCount":17,"integrity":"sha512-4vsYUd4nfD9yriBuTNIPla47Ul2tBthTaDNeK+kz+0/WoAj84Ih+4pRF8HchFKCffU8iOLdTOclxqjMJAJ3RWQ==","signatures":[{"sig":"MEUCIB6rxUC/8vAwAb1Y97pcLb8lclyxdJmdTT4ayg+u9EtuAiEAmNgtePCBYiKiq1prEKNvF/D+Twmpsa5KIFStbglr72k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68140,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjW3w4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpzAg//YmzlFRSt+wSRKyi/xwSTQp9bh+bbUvZQwaA00UT2esJWYiNN\r\nujg9244u0wX719lXqCzaYAL/eJI010qhs0HAtTnHIzUugM9atj9pEHx0qD7F\r\nOaEzORsZ5NDMwFpNmHlG3pyDnTC5wudEo8xCWZwe0RPoH4aP4BQ5WWBj8gSj\r\n6O2ageTXYbNCsP/k0PjU6h77pby+nEfmfrcD2COGes2kCslolgqNpkypGUdB\r\nTAne0i3p9CzEiocBkkPY8K8sf35nCPfAnA+B0Cq7YiDRMPCDhYu6/1ni8W3w\r\ndvD9uY5NUhxvpQ5ORZhcQamkEAFsOKEaIzMNyET8uHyZ+asqosLMyqm9AcuY\r\n832Co41D0tV1ztNl2JVRQ91fG6A+ybe4KcENCORVrhsThG1Dye7GjWL+kNAJ\r\n4/CkC+ekbJQNqbkA5RRWInvhNXd6NLI4vfQps0PPcviuGFZbNwB0uhEUnbXM\r\n0KORzqgjeLsS+iZu2i/jTftOA8dYX+dAiO4YqAoG95YMAkzlCyOeAMzpU0aZ\r\niNO7nHikf/HJRK+/jsDcmiUIHbhPnkrQQh+szReYPGgTn7TmqXE2fGiuRHaL\r\nL4gtoYaronLDa1KBB4vSUIJfoUTYlrsd7G6UoueFsPiFLbdTWOkJydBRZutr\r\n/G1h2MgtuagBtr0N3tWFYq6GXJpUYVGVwnQ=\r\n=1nal\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-576ae246f6d6ca204ca58bcbaacfe175bfdf52b1-18.x/balena-jellyfish-metrics-2.0.270.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-576ae246f6d6ca204ca58bcbaacfe175bfdf52b1-18.x/balena-jellyfish-metrics-2.0.270.tgz","_integrity":"sha512-4vsYUd4nfD9yriBuTNIPla47Ul2tBthTaDNeK+kz+0/WoAj84Ih+4pRF8HchFKCffU8iOLdTOclxqjMJAJ3RWQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-28T06:51:08.101Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.2.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.19","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^16.18.0","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.270-renovate-balena-jellyfish-environment-14-x-576ae246f6d6ca204ca58bcbaacfe175bfdf52b1-1_1666939959910_0.5555846193770557","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.270":{"name":"@balena/jellyfish-metrics","version":"2.0.270","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.270","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c74ae672cab7c65dcd5e16e8db83bab423afd6eb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.270.tgz","fileCount":15,"integrity":"sha512-rUIrBnn32/cdHjph950hWDuQJiqeqrSSzKmcmzyKziD6/CEkCnB07PV6A4LddXpuupdah+A2Z4bCd/enVEX+Rg==","signatures":[{"sig":"MEUCIDGVjWXnp3BYWu6umqC9gXob4tygdI/wjfm2dWoFTTOsAiEAywsHX528KMC4qAAX5v6OlpRLfYgUV9A4gnOyndH6pJc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjW3zGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpHlA/+J1OA6GcApdgPUREX+KWxqbjF6abjC+jSB2RGTjcweebCWgUe\r\ng1DfujuLYsOJhUT/WKn6bjWiA0JqklM1rDyvIY5rzwPt90cI8M5/qwDNwDEx\r\nanNB0xcqV/RgHI0OhgxaveYLbXBSR6TalgLstIUA+k3rwzM6mLJO7epAaycB\r\nHYdnF3ROjxi5BJ5eoU+KsZMPHP3UypXA3QNz9MT3fERgXAFCA3x6ndjapiZG\r\nthhK7dpnpT5lToj3E/Vc6ZXdsn+9Z+jD8fY51Q+sOIoi+oR7PYQrJh50rABB\r\nF15r2kvI0Sxh+kT+ZnWZOqxuFCqiYZCIeaWaf+qlZEH7i+lKkM2VzTXjWy6L\r\nRRIjJypTJBKV9GSbS/QnF2cIR3s3ZjJgNTG6cArz51Hori+zCy2KOhoiqRUd\r\nsPaHJ6fwodfm8J5ln5TNMH+EA0JB8M8/OMjr78qSlaB+RHW+xQU29qWwKLK3\r\nAZ0UVjcscbfNuAvVMssLee1kyy0DMonzee9M1YsL3pyU4w7iOuIZvY30r+47\r\nShs3401QAgW0RNkQ8sfRVJRWlOI3dPdaYnGM91DpXyAQxc/HADm9szS3N4g1\r\n8/+Ree+eAQMV2KHBhgSOlqNVOzENbWaI/+wWQ9buXtp7x0Is4WKScVIOHa/o\r\nDtDLPHOn+wTdhZQiiy4sAkdjRUtDMoaAjA4=\r\n=w5Gp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-576ae246f6d6ca204ca58bcbaacfe175bfdf52b1-18.x/balena-jellyfish-metrics-2.0.270.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-576ae246f6d6ca204ca58bcbaacfe175bfdf52b1-18.x/balena-jellyfish-metrics-2.0.270.tgz","_integrity":"sha512-rUIrBnn32/cdHjph950hWDuQJiqeqrSSzKmcmzyKziD6/CEkCnB07PV6A4LddXpuupdah+A2Z4bCd/enVEX+Rg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-28T06:51:08.101Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.19","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^16.18.0","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.270_1666940102462_0.4059014014338449","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.271-renovate-node-16-x-566c5592a45cac0b87303de1a13cb4b599eaf701-1":{"name":"@balena/jellyfish-metrics","version":"2.0.271-renovate-node-16-x-566c5592a45cac0b87303de1a13cb4b599eaf701-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.271-renovate-node-16-x-566c5592a45cac0b87303de1a13cb4b599eaf701-1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"89f958bd700ae068836563d34792e1fd16935928","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.271-renovate-node-16-x-566c5592a45cac0b87303de1a13cb4b599eaf701-1.tgz","fileCount":17,"integrity":"sha512-vlXgE0eLkygfITV35EzVkneVrKohEgO+XJx54+9ZRFMyFS6DzbVS5HKqQRYOTZJ0W+AladSQyN3wAYRKIC1DLg==","signatures":[{"sig":"MEUCIQCyHdxtQIiLz81TOFsYEoxa18fqQfboxpBuwtrHI7AVkQIgHR1xp4kMtU4K9h8+QuW7OnOXUMkpWKatrfqV9XohDAo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68116,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjXHUZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr3Ow/6AkXc3IHMHUdeo9Qo86EJi0bJr20alc7J6XBihnkj4HjADK6G\r\nFvwdBFnycCIqfS6JBgW0HODQZ3Zd8+JmfyfoEfXm5VHQLt0gG75L2nHFKWdm\r\npHc9f/sxawlFYq90GHf9Y7dD3wnD30BvMz3+ZHA5N5QZvlxYYKDbnCipJBy5\r\nsZGAIX3dQNU+2OKYKTa0M8D+tpK1kIVV+UXmNuXfR70P4yS43qzdw8sDTvws\r\nWHOWR1OalCIf25ErCqXmwjkaCJ5KDBs2/tchwSc6SHBQNUiMaZvVJnW9wKNK\r\nEQc831k0cC3aUQomh190t+LnnuB7sQlspmmqvLrTfgqqTLFLJcpsSrUmnkGS\r\nK9LJPAfpW0WrTjyFzodRJUaOwaNxFmnXuiK6hLMIW2azVLougKZno6ubbAgG\r\nVj6bKA3lk+AmDvfDC/Y/qaj6jb5MkUgVFl905KyuQFIUOJqJokP3s6l2D4T3\r\nO2OzBJcW5f+kVW5ORaNJcbXOEXw0ahKEN4CphUFtSxF/Qzo3NhJFJdjlRGvz\r\nd3ln4YR+l9ZYLEweKSoI/TBLfQR7lSzwJIFdDngKJIlmv1Q4Nxd6oMpW8Hbu\r\nUmcq+vdcI9EOalZLSmJJ7q3LektoZK0tSTbwemtBJPliib2wmeqBEWi2fQPI\r\nEHCKSh1b4d0VUlfuBAXUWtfivcKjYV2T+T0=\r\n=RA0d\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-566c5592a45cac0b87303de1a13cb4b599eaf701-18.x/balena-jellyfish-metrics-2.0.271.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-566c5592a45cac0b87303de1a13cb4b599eaf701-18.x/balena-jellyfish-metrics-2.0.271.tgz","_integrity":"sha512-vlXgE0eLkygfITV35EzVkneVrKohEgO+XJx54+9ZRFMyFS6DzbVS5HKqQRYOTZJ0W+AladSQyN3wAYRKIC1DLg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-29T00:32:49.105Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.2.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.19","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^16.18.2","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.271-renovate-node-16-x-566c5592a45cac0b87303de1a13cb4b599eaf701-1_1667003673166_0.3079825366419162","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.271":{"name":"@balena/jellyfish-metrics","version":"2.0.271","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.271","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"89730b298f2cafed8093ca89dcd68ab618bb12a4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.271.tgz","fileCount":15,"integrity":"sha512-Z02tjEjiuRySwf1I0i6Usvs8l+vdYk3BiqZdnzDeP5vne2PTaYFDD8+SnjvDePCFxgftQk9yB25fNqRpq2uxcA==","signatures":[{"sig":"MEUCIAzqA68DbUdYfn3kKi3LNSthE8roZhGUWVWGKGgnqIpGAiEA3Ailco0MYJkOOD7LebB246QzgxgcZ96RXFeyNNBgeY0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjXHWbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmro9g//WoZurM2Hz/hu5xtl4SN86MztZfAdpa4mqEHVGoTwkfa+DQu7\r\ni7nG9m3G8UblrJB0IvpYWrDTZST5ZGgunZG/AOpBGIqiyNklFeq3EfD07m36\r\n9Vq7rAvf6qFEbLdFSQU5vO9IS+myYQaKiQD4OjfSks63SCPvvtq19wuadZ1s\r\nB6OWHidyLL/NL8QjoOt5n+8O3kiMHC+7+QxXQ6GGm2kywg1u072mxnSmQ8JB\r\nXJdvC28xevdEyymNnrOBzESLIMniyJ929s74s1mvlCYHGmX0mkiOqteAj8gj\r\nHvAFa1z1OEf8pOJZI+UEmuTQDDp2VJ+EDNpW/aDMVO+07X9Au+gpr9d9QVsY\r\ndIvv3VBSwK9oLswWIVXEgt9Pt3umK6U0gDJtLeQdbJHcH7v/mGZKA5hi0X1Y\r\nK+pflq18aUvFaDrtbAi+Sp9pefZU1V2vP6A0XUjsM7a6Xvf7fapcws8kTUVe\r\nsxzepvmeFafNGfs3xCj62gcik8lMQv91kvrgDgLAzgWIvPWptA7DTM1Vyhrx\r\ndKZ5bipV3nMIMDUsU7x9R5vDkwWQhHf4d760ZtWqnZCVAvWvTo8/6hBlUmGy\r\n9rt1OFWAgpAFvE7GKCuuweSTrI+Xb3YHkq+f/LiKhs3o7sMJjpvecV3D6FnC\r\nMcBdLJA4YgLvaOp4got+ae+LRGbwJ97ahfE=\r\n=8WfO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-566c5592a45cac0b87303de1a13cb4b599eaf701-18.x/balena-jellyfish-metrics-2.0.271.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-566c5592a45cac0b87303de1a13cb4b599eaf701-18.x/balena-jellyfish-metrics-2.0.271.tgz","_integrity":"sha512-Z02tjEjiuRySwf1I0i6Usvs8l+vdYk3BiqZdnzDeP5vne2PTaYFDD8+SnjvDePCFxgftQk9yB25fNqRpq2uxcA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-29T00:32:49.105Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.19","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^16.18.2","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.271_1667003803241_0.3613710156753529","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.272-renovate-jest-monorepo-8b80ca1f1dc565b06a5002605e9aa8ef0a804404-1":{"name":"@balena/jellyfish-metrics","version":"2.0.272-renovate-jest-monorepo-8b80ca1f1dc565b06a5002605e9aa8ef0a804404-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.272-renovate-jest-monorepo-8b80ca1f1dc565b06a5002605e9aa8ef0a804404-1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1f9e5f350e488cc192ac43a5476cdfdd79636057","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.272-renovate-jest-monorepo-8b80ca1f1dc565b06a5002605e9aa8ef0a804404-1.tgz","fileCount":17,"integrity":"sha512-bUo0zmFCeFuGr7FI8UEinlbCEB0u2pGCtg7XbX2rstodSm0AUkC8FaEULqfx4NnHvOgesJ72l6ZRf5/IxqoIRw==","signatures":[{"sig":"MEQCIHx9lIKmaQGGB+0WAfB0uCmXQdg3uu6ldWhzKv8FWTe4AiA3IWK/xnx2v41RSMYe/yR3HcViuW3Amgf5aem+CfTNmw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjXHZZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpg7g/7BXi4hpzfjcyaW+aobZDl1YNzqLAJvOGD1i7dBRT7MacjMXqf\r\nB3OCp8z0nBohxtCsCeAxlEXmirjIif25i2Vw7ma5wIhn4ygsJsvX6jUBPHIx\r\nfXknsfevhXgpvxRoYphWlsRgYkG8IyHMOZ7vSm06Fdt11WSg56CSI+NG9k6i\r\nmdHdtRT2pcmVctpEOrvR+Bpl3sQlGNI7cSi6wjC7gPecK9iETNti3yMT7zNa\r\nDSyST5j3WGY+QqN4bIyymN4JD3iAjsSLnVgff46JJ6yxWv2HIzY2sfzcGNZl\r\nLqOcCRW25M5vlARYtNWRDE33X5S3UlCk8ao+cNLlZxlQooVia0W9G6DCC3l2\r\n4VXxLhPOMObKrjlY5c50DXLQd4Mvb5aGdWZDAsBzf1Hde4bY3QrEpM6TTr9i\r\ntvRczFtqf4+7qjtwaSKnpVKaPbVLHJCDfDc7ZfZrqQt2U75bBzq4nXsVdfS3\r\nYuPdfpF8CJ6d1D5OJ9OnO+GWyLAdzbSDQMP2m3Z6xHBFrWHh0QWNH2jamYUl\r\nkmz0KmU6n2yYxkAH3HJ+g9FgQcM1URvfRYmyFWYRviCzBw6AJ2DlNfYEu7Li\r\nfqOBb5C797TgT31Hug5xPIZyns5vLRS7WAbzlkQp1SHqogMe04kuUTZgOnIY\r\nR4JsNi/2OMV1EY7SCSPA+RahzJAvjvAL1zM=\r\n=lTfM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-8b80ca1f1dc565b06a5002605e9aa8ef0a804404-18.x/balena-jellyfish-metrics-2.0.272.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-8b80ca1f1dc565b06a5002605e9aa8ef0a804404-18.x/balena-jellyfish-metrics-2.0.272.tgz","_integrity":"sha512-bUo0zmFCeFuGr7FI8UEinlbCEB0u2pGCtg7XbX2rstodSm0AUkC8FaEULqfx4NnHvOgesJ72l6ZRf5/IxqoIRw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-29T00:38:10.873Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.2.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.19","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^16.18.2","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.272-renovate-jest-monorepo-8b80ca1f1dc565b06a5002605e9aa8ef0a804404-1_1667003992727_0.3850391760718854","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.272":{"name":"@balena/jellyfish-metrics","version":"2.0.272","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.272","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"469ac504d74ac21ba188b8c4cdd6c8e5717e121a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.272.tgz","fileCount":15,"integrity":"sha512-K1t8fM6l0pdVwA460vkylpUKvhADwe4fuAD6XW9NEHJifaX7WYL6RPfAok+hRd2qFAhh0nFI2Ze4Pt6mQzvAHQ==","signatures":[{"sig":"MEUCIQC+h8xn9qgyi9ee5sxsFqnjdt9vLXt9cvK8k02702YIvAIgGqu9oq/7zZbdSA0sahj6uZB1MZUI8BQ62is1Y21MJsI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjXHbgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmonCQ/+M+Tbx8X6KITp++lt+vY+YIReQmmcMhF1pHAAkLIXLlnxLlVo\r\n8NFIQafZ/4uLdv46IF7S3PT8EkvU60TCXqlI9Kus/RbX4+2dKtiFIfcDj448\r\ngLafUWo11tkd0Ubt/ApyopBq9aYC7KfmhPxUqlWNm7H2ERPSTtsiITDN9ex9\r\nmHjJoKB9wBoJS8Ovj8je/5fgLVNRC9VfmK2NWE38aBLr7W8wGf67h8wGwK9v\r\nvgxg602/DbF3DeJvUHGo4+e6HeWHkDz/6oft9/7+CzQRl9EAM9ADvDmpkssV\r\naPF87lFpEgULNkx7pATdpRofQRsHmq073yIOw4zyy3dGC2CFqPDuC1SGc2Zn\r\nskKUb9YeP5UwOXgixyQNBfMTlARtx6br/VpvxQfJQMqTVvfWJAjpa+Jmc8nJ\r\n37sMcPVZRzYHifRJgIhXUAVHDrVyBv7s+Ilf58dVj2/cIqOVPhq+bsGFKDJ/\r\nFEfPS6hGJMRxP3/557egeBICwtLyHotc66eZZ0gXeNOlJTYy0rj0B+YR6T19\r\npoTnG/D/R2QJeP00X2+hjnFZya79Uelqk4E7YbKmO7RmfrUpmitsYNj5W9IR\r\nVgaWcg1Xt89yFF1bSIWRX8ekiLefBfG2h2jQPbmg78RNgWEuAwmm0fmyPSg2\r\nNXOUYosIv5A2Atz9H8yDEtMp014m+BFm8Wo=\r\n=H8ux\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-8b80ca1f1dc565b06a5002605e9aa8ef0a804404-18.x/balena-jellyfish-metrics-2.0.272.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-8b80ca1f1dc565b06a5002605e9aa8ef0a804404-18.x/balena-jellyfish-metrics-2.0.272.tgz","_integrity":"sha512-K1t8fM6l0pdVwA460vkylpUKvhADwe4fuAD6XW9NEHJifaX7WYL6RPfAok+hRd2qFAhh0nFI2Ze4Pt6mQzvAHQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-29T00:38:10.873Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.1","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.19","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^16.18.2","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.272_1667004128024_0.32941266592444807","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.273-renovate-balena-jellyfish-environment-14-x-46314d1bf2f7a77c96a5ed56a7866527a0bee2a3-1":{"name":"@balena/jellyfish-metrics","version":"2.0.273-renovate-balena-jellyfish-environment-14-x-46314d1bf2f7a77c96a5ed56a7866527a0bee2a3-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.273-renovate-balena-jellyfish-environment-14-x-46314d1bf2f7a77c96a5ed56a7866527a0bee2a3-1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f42b811a7a236bdd1551f3262f21975eb7e130e3","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.273-renovate-balena-jellyfish-environment-14-x-46314d1bf2f7a77c96a5ed56a7866527a0bee2a3-1.tgz","fileCount":17,"integrity":"sha512-/d4tHrcE2i9u9ffQ1jLyy0WTsCAl3fXzcmvNi8b3hmXJiBZr7PZLpyYR4pmno6VJN+Ub8m9N4sfaLABjVtPjew==","signatures":[{"sig":"MEQCIBGFOalHdVciiUiu3R3+n7zc9h0KRhoVOkYN9ZLe3YVvAiAQF2BZooqf5dyKUvUKGbycF8VD867grUsz3JeQ6w+JJA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68140,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjXJr/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqVHxAAobWwMW5smE7OKmDBS6i8XLztLoAanLhHsvXLKEq7bKyrgg/p\r\nqZqlyLr27tMrmNwMHUR3rwus1ok1nhD3gyrjEYE1OCE6Py9NDsxkBejTiJ9z\r\nZgBLEpqR1iD6Dr81x4JQIA7UTEDanQdmd6oRhmX2P+rjxfL8ROXyK29FCuND\r\nviKb754Kx6fegKgNrASak4hhTb7moHbDRNmfnzNABF67fZKdmZkFY+Wlou7+\r\nAeAF9OiCaOVQnuBkNG2pEFW6mGYmJQJD45gH4BsWhvvS2tHBz5/Hz7cRbGyc\r\nwb1HU3pRP49GACRmtNpehV4Dh904Qn9YyEdRyTTFpFmRirhqLS+QcTJWAIpT\r\nGyImV6YAUMqzrgvKUyOkrCKp2ZxZ3aQbPhZQSk1eVYW3OZ+6e03v6QY3wy5Y\r\nokJA1LiKypKWrVsevSlxMEJoNAvsGW0zzBXXh/UpjUCKWYHqeLGgBD9DfoRU\r\nuTPjsWCJjD98t94r9EKl4XoTnDSRWH6qSLne3nLeHNC3sK8/3azLzXwdLLvh\r\n/E69Uov5rsSZXtIMU9N4JlnOjwQvV2ISsS+9hi8Ig2XJ0Ah0KSFW1nTa0gTm\r\nxvAUYNtUqLYxGinNQDHW2R8BwjQ7NKEGrrh2CZy2ZcXh6adqpIkBy3KL5VtK\r\n9kTVT07JtE169b8reD5TYALVjfF0HZmvDLM=\r\n=aOnw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-46314d1bf2f7a77c96a5ed56a7866527a0bee2a3-18.x/balena-jellyfish-metrics-2.0.273.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-46314d1bf2f7a77c96a5ed56a7866527a0bee2a3-18.x/balena-jellyfish-metrics-2.0.273.tgz","_integrity":"sha512-/d4tHrcE2i9u9ffQ1jLyy0WTsCAl3fXzcmvNi8b3hmXJiBZr7PZLpyYR4pmno6VJN+Ub8m9N4sfaLABjVtPjew==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-29T03:14:37.831Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.2","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.2.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.19","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^16.18.2","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.273-renovate-balena-jellyfish-environment-14-x-46314d1bf2f7a77c96a5ed56a7866527a0bee2a3-1_1667013375526_0.20492578509709003","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.273":{"name":"@balena/jellyfish-metrics","version":"2.0.273","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.273","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f174726a9f9c42f69f572260894303619bcc2488","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.273.tgz","fileCount":15,"integrity":"sha512-mGBYbptyXO/vBD5OIjJx8j7EQ+9o2U0RfOil6FOP+RAI/clVTLRijT95p6iTBHiBTSdzDsSzCE8T/tODxhcCHg==","signatures":[{"sig":"MEUCIHzT7hdbOnDxdhY6FuYFgbFdZou9qga3+eJIjZ43WHFWAiEA2VVsmuiLDRVShMyjDUkATgasGm6HFeBqVUXL9Pq9Eqk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjXJumACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqPCg/9E82wusF7qfWmzUzeW3fNziOJ5Rj+YIFZPD4WAlpiDd2Mw6Xo\r\nUS8qoMn/4rXd663cznqCc4s7eE6FQ00J7d694vdS2oWZ4Ij6DLJv7xj2KTeG\r\nnM5P82GJXF4y7hT6YAr3crOFo1wds6alsmC8ACvIwShxminWNfi5QMFdi9G+\r\np2pBcN2XpDZEkcpBPSMlRvZrxLCqfeAMTEfcZGOW1u/OuNKS6QdWPMJUT+zZ\r\nOKOQ4taTMqy1xaaZgGKDc8aPie9hispyt8jynZgEDiGFHzxgPBPiUkb3dBb/\r\nKihN81vdu75PVb5wVSQ0jSmwMenFyspiUWKErJSvWB3zyl69JnRTQb7/Vdzv\r\nW2IvxqT6gGlXd1D13coy6hcAbKRpLFOQ2/w3Iubto6IHqqsqHxdJGRYz44/g\r\nvgeTwF/wM1vH995GuLMrAx7TR+Vjr2R9+6e3cdRt55qKtyqQY/4tOAN9e4hF\r\npzlXKqaezaC6vTjxm9Rlt2hDN1Eet+ZrBoFxBT11ijmc5K+tlM8bfRHOBYVV\r\nLWqBVDs4bZnkxg1y/oEsqge/cmk5GngXkYPJyWUO1nXbJjd48ukgf8a3RtKD\r\n/eAxVDiiCQ/1t/IkVvtYb3ns9feTV6+wAhGF899EqBVE+bQYWumDd6U/jEz2\r\n2AuX6GhfeCqNBr2pNlh2uiG4vc2d2EXze8o=\r\n=J2dA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-46314d1bf2f7a77c96a5ed56a7866527a0bee2a3-18.x/balena-jellyfish-metrics-2.0.273.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-46314d1bf2f7a77c96a5ed56a7866527a0bee2a3-18.x/balena-jellyfish-metrics-2.0.273.tgz","_integrity":"sha512-mGBYbptyXO/vBD5OIjJx8j7EQ+9o2U0RfOil6FOP+RAI/clVTLRijT95p6iTBHiBTSdzDsSzCE8T/tODxhcCHg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-29T03:14:37.831Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.2","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.19","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^16.18.2","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.273_1667013542169_0.7009513020512148","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.274-renovate-major-external-major-f1af14d6ea2baef8ee82081a671d0c6c9fe2d5b6-1":{"name":"@balena/jellyfish-metrics","version":"2.0.274-renovate-major-external-major-f1af14d6ea2baef8ee82081a671d0c6c9fe2d5b6-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.274-renovate-major-external-major-f1af14d6ea2baef8ee82081a671d0c6c9fe2d5b6-1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"332f50665524330c872adff194466507fba869e0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.274-renovate-major-external-major-f1af14d6ea2baef8ee82081a671d0c6c9fe2d5b6-1.tgz","fileCount":17,"integrity":"sha512-fmbcqPKXceAT8NSBe/bAJNKV74HvYfc4QwkB2VXmTp+OHl4ljYpZR8VCbyvCFt9b8PXKHp1gOwEVqDBqn5KFcQ==","signatures":[{"sig":"MEUCIQCh+jO9+fl33v81tMUwMMdVYvvOKHKr5YKy91tnSfkAtQIgZoRCUrwHc6At0NdxeHO4Y86kTgPQaiJ3MBfGKEuSY40=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68127,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjXJxXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmolGA/9Hr2rRicviapObOuATtd/huni2dAZanUfv0aLaQv5PA04+Rm2\r\nBZgqD1EzaNAa+ZffuQBY181NW/a6wHlwRAVqRST2mZ85w0FYbP1ixN41o0xd\r\n/tj6oqeeDh0CL5v45Jw8YYHKIk1v8QT0ehp2VISdlsLQvmRmUn4asp5qRvSh\r\nSIc2SaWKGZyeMcXWl6RgMwo4H+fSv9EX2otAslvuwrClz6JZdsgcc+gPB7W4\r\nAOoGQefaoG5KikBuF1lSK1WT7mOPOJa2XQY+ST8XaJLhCnPnYa7dGUW0MXWY\r\nH0bBKe2Bgz7yEYe/vh3j32UtrB+7ryfABUFxQiT+HuR0W7SqmRT7QueJGiJ2\r\n096B26ghlmWCUoJu2TSyPv73Xby5YyZ5Ro19kJYTy1M33meK1xxn9a5srb8h\r\nBTdDA0ogapnj4G9gyaLtCo8buIMFh+mPUUakno2O0sUnnb/sRzUiA0IBKnh1\r\nupAindaAPmAJhGbkm5FqhbmLt5ol5A/F00iXaqOPLUKDZ+vSixmQhn2TVvul\r\n1rs36OfH57UA8V0DEaDgygSA3UCSSKI8HyPnwhtHqcBUtMXjCgR3ckO1+hbd\r\nL9DdpcUGQ8y+t6LBYa1Y9iuaVUe1Af6hzBGzMisB+AqifE/YOyOiu/9PwcLi\r\nIXUav3dVq36Km6TPAHU0Z3SwsnYb83iAKJQ=\r\n=Jyt1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-f1af14d6ea2baef8ee82081a671d0c6c9fe2d5b6-18.x/balena-jellyfish-metrics-2.0.274.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-f1af14d6ea2baef8ee82081a671d0c6c9fe2d5b6-18.x/balena-jellyfish-metrics-2.0.274.tgz","_integrity":"sha512-fmbcqPKXceAT8NSBe/bAJNKV74HvYfc4QwkB2VXmTp+OHl4ljYpZR8VCbyvCFt9b8PXKHp1gOwEVqDBqn5KFcQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-29T03:20:26.371Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.2","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.2.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.19","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^18.11.7","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.274-renovate-major-external-major-f1af14d6ea2baef8ee82081a671d0c6c9fe2d5b6-1_1667013718984_0.9998804107273191","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.274":{"name":"@balena/jellyfish-metrics","version":"2.0.274","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.274","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9092ff1f0c982d4de35564c849e8b9a8112302e1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.274.tgz","fileCount":15,"integrity":"sha512-tsfGiIgJ8ucfL2CHnUjfebwtDHoeTjWcZGoOBnjYgLkcBpKx+pKVmk3GFZA6CrlfKJzQlFOAFbHu+d1nBbd7nQ==","signatures":[{"sig":"MEUCIQC3sIjg1wS5OefGWtTdhU5BmAg70v8ek5sbnp9L6kpX3gIgO/iR5AZ5s5k6rc9sP+Hz9kebpOyqBp8GDUOUzPIRKRc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjXJzeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrsUw/9FT80VaGS5rId6+3IpCyjgzE5oXLhPX0IZs9PIVo8Lg1kjBI4\r\n0UrpP6Y+0nm5wJYjVA1BAs5JUtTumUWhsal6NYlmbmC9OFilQa2ut3L/oXiX\r\ncP1KgIYoOLknjTc+HhSsMCVx8Yal6HHVijQKDgXPtHyyYtaBYHQsizpM4udP\r\n8UgxDurNqbRy0JYix9DDm6O4BLKz53zMRKQRnwwSU+oOGUdQ2Cu2W9EbHk9E\r\nWunhCxd8mntQOHJRORIH83QFiAK1s8XlGkhabFJfgUHcAnwO/6AZn0oYHmWv\r\ntWF5b5qMqbi9NJeIL/6NuG0CoyBH1FoKii0FOj+ytdLsL+RvZd/1Udb2lHDz\r\nQfKT2mfYKO0ThgkwkstUEBlLKAxfcvOF87VkjvbH3cS38Czr7itANkNSQZBk\r\n5SbMaVj/CfQdLrH+oY7GWqSXruczqUE1nJ1HxsU2I0BwZjNrWz4PJ4DyQdEz\r\nay3CcW/O7vg0BUYj1ZINzK7UGTvBZjrjaVBO5AbBdzf7v3dujgxtkUeFNedH\r\nhumcDfzGZhB/wxDk7zcCUeumV8fGMX+qD9Np/3gqbD6Nc3kshuQS4sNYYDff\r\nU9/RDm+AOajSXmCOZLeXkmhWh+gC6cM6T6YzNt5vhDo5kXGzjts4ME5sRxrK\r\nRKuAAui7kXb0AALI+ihkZyBgyWbBJVFP3OQ=\r\n=5L1W\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-f1af14d6ea2baef8ee82081a671d0c6c9fe2d5b6-18.x/balena-jellyfish-metrics-2.0.274.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-f1af14d6ea2baef8ee82081a671d0c6c9fe2d5b6-18.x/balena-jellyfish-metrics-2.0.274.tgz","_integrity":"sha512-tsfGiIgJ8ucfL2CHnUjfebwtDHoeTjWcZGoOBnjYgLkcBpKx+pKVmk3GFZA6CrlfKJzQlFOAFbHu+d1nBbd7nQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-29T03:20:26.371Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.2","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.19","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^18.11.7","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.274_1667013854369_0.8195255803895218","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.275-renovate-node-18-x-6c4ff56f0e5c025905e2f977387d7af0506f889a-1":{"name":"@balena/jellyfish-metrics","version":"2.0.275-renovate-node-18-x-6c4ff56f0e5c025905e2f977387d7af0506f889a-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.275-renovate-node-18-x-6c4ff56f0e5c025905e2f977387d7af0506f889a-1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b57df92804e37e9de03ce40b721a0264946a59c1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.275-renovate-node-18-x-6c4ff56f0e5c025905e2f977387d7af0506f889a-1.tgz","fileCount":17,"integrity":"sha512-LuIuoDhnlNJFLGuJDBxtuYsGGk32vU6WHQtZLVwthk567NsZ7++w8SKPWNAE2biA1YB4II6dIWS4BBc++FzzUw==","signatures":[{"sig":"MEUCIBvfiDAbc7q2UMJXRix3sDQ5JdOY6GQ/E4dQFqJrxVBNAiEAnxGn687QeNs58srY6JEoo0opjjWwOhN0qIWycoLT3wk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68116,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjXvzfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq2vA//ckpbvdl5dE+j9P0Hoqd0zLV5FyMvpZClBau93pHWkLqhNibg\r\nO/UUTamMtg1Vi7V3BtUXNjkPqC+QfDMbCSv3c3yFHE8LfkD6KuVtwYg1J5ZZ\r\nUdZ48pm27KH92owBf/rd0Veau1Z8zD6HMm1kudJw4bQ4ZtMpLwMrsAjvF7cD\r\nEA/GKDylyVIw/UCc6OpgYWPj+AqJPIPDh6xvbNQVGGWjT2Jz7N6mnGL4W6PT\r\nsjsJrvR1KVP9TYW85S0S6r475zpofPRCrmzqHLxmCv0eBB9qLWmIx/9BXefn\r\nooAUDSxS9O3VZsCAVrCfRMZtGuWK85ofZvHA1vxg2Am23V1+QTzFboYODxIi\r\nCTM/auaqTVSz2i3B5RamQSXA4PP7gD9NgCjr1qx0pxg+VuQpfQ8cTlXa/j6W\r\nBsi8MMlEuXu1bmyQ7XqdxEHotu9Q7hogrWPqsQrZCO0UsKabVCGpE7SqLuIE\r\n/MqkGOU+1Yk6CPRQkGec9ibrXZGfRloSJW2l57YQvA/nIF13AAYT7Wqnp4dH\r\n5jhDeqAbrSJkP0im7XbGBUyXPIAqJBrlgCH9Om4pPfUPmw9RB9WwavPDPtJu\r\n9b2kyjlPDpzPgITR9PhqCeu/2P+D2JjIVAsQH9GaXHu2WZWi6WuVcf7UrfFd\r\npopaRT8Yn5zgfNTxFc7RRonqZaZ0GFhAQck=\r\n=G/vj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-6c4ff56f0e5c025905e2f977387d7af0506f889a-18.x/balena-jellyfish-metrics-2.0.275.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-6c4ff56f0e5c025905e2f977387d7af0506f889a-18.x/balena-jellyfish-metrics-2.0.275.tgz","_integrity":"sha512-LuIuoDhnlNJFLGuJDBxtuYsGGk32vU6WHQtZLVwthk567NsZ7++w8SKPWNAE2biA1YB4II6dIWS4BBc++FzzUw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-30T22:36:40.870Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.2","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.2.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.19","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^18.11.8","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.275-renovate-node-18-x-6c4ff56f0e5c025905e2f977387d7af0506f889a-1_1667169503447_0.3826560061911666","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.275":{"name":"@balena/jellyfish-metrics","version":"2.0.275","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.275","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b89d9992f1ba8f39f80bf4f753f2871f4000b308","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.275.tgz","fileCount":15,"integrity":"sha512-F0iYKndtK0dLPzc0c5Sqoy6nRv8wup8oADlvLayzD4RH8B0CE38lywhO/Q+uxXj9/EJJ3YSpEnpZ3x4PAkAgPg==","signatures":[{"sig":"MEUCIQDoZjn7Vuou717ldjwSnbHXuEFOSUtYh2RUzEISjbKpHAIgX1HprK5Gg6oDKlG6ykuTfneIe5/4D0+3DsxUmL5ID5I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjXv1qACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmowhQ/+LUIHdUQrNo92uUlkx4XJOxHMvp7wy4PFi5FLA8RuW5BalMJ9\r\nbIY/rwmYqXrUqA8VXw2Nd4fb4/ndkmEZOBCAf07fBp72cHW/Hz4OgTMg6gqO\r\nlsvixj9JDULa9PCbT7YIpM+dHzofv+QZduPum+NNQ7edffinRCM1u6B87LFq\r\nz1fsChP/tinIL8FTrTnMb6Vt0jE/FkSktmlzin+Q4sHAvVj4TsjKBGjOiP5z\r\neAy9qq5sd+Tjbe3gM5l7ojWS8ufC0AwVHH/6uXVxRhQLUYzEWVeIb9EbRrTO\r\nfkk6bVyM9UOFuSyB3SrgLanHNsfi1uq3CxZxKIfVUUDCcsy4rPKVaJJ22hdC\r\nddPA9lF59aH2GK8AX8UIdW5II0zkNq+6Vg00oMK2c40+vqIT/JFI/YHlVh5J\r\n/Wk1qCYFXrYKXZVQ032+3Ojy64E28yQT7O1L19RuMg5eZcEQbUMMkThKRDfp\r\nCxPRY1DyO8dJjdeVNoGUOEKFoBw/9wzS7N4hUiQQSdHiydK2xF+qCLAdeDRS\r\ncP7wC1of7DBJj1WttvvIWUpxjjOInpHCP6le3Kz5KHC+qr6z3ZeVipuhdEuy\r\nIIQp8pskAcnnWHljayWO8DQdDmb+Kf3VU/x08rlMeMVnujdKsfUYtFeytCrP\r\n7cqbOkCg2465XkifCW6Wh1NfAfCq+6Bv8oI=\r\n=Ccey\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-6c4ff56f0e5c025905e2f977387d7af0506f889a-18.x/balena-jellyfish-metrics-2.0.275.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-6c4ff56f0e5c025905e2f977387d7af0506f889a-18.x/balena-jellyfish-metrics-2.0.275.tgz","_integrity":"sha512-F0iYKndtK0dLPzc0c5Sqoy6nRv8wup8oADlvLayzD4RH8B0CE38lywhO/Q+uxXj9/EJJ3YSpEnpZ3x4PAkAgPg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-10-30T22:36:40.870Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.2","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.19","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^18.11.8","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.275_1667169641782_0.8199839115681125","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.276-renovate-balena-jellyfish-environment-14-x-6dcd7677441293f563bc2758b5f58f5c05724337-1":{"name":"@balena/jellyfish-metrics","version":"2.0.276-renovate-balena-jellyfish-environment-14-x-6dcd7677441293f563bc2758b5f58f5c05724337-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.276-renovate-balena-jellyfish-environment-14-x-6dcd7677441293f563bc2758b5f58f5c05724337-1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"94228fbaeb03bd86bda9d3c9870f56dfbc13d418","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.276-renovate-balena-jellyfish-environment-14-x-6dcd7677441293f563bc2758b5f58f5c05724337-1.tgz","fileCount":17,"integrity":"sha512-9jIAO1buJOPM8Z5Y4IuTHBWTnLLdNJdhsfMhJjwsBwCdWbV73hAnCRK4vgmRo4OA4s31TO5ZrGr5eVU0aWJ1+g==","signatures":[{"sig":"MEUCIAppRe3d+hB1kPiwUyUje+l33RB25DcC/4wOh1aY6Jv8AiEAxCpLNODCKf8yssWYBQYJ4y2CsH33HCj/Ejg58PiX55Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68140,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjY0oxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrxwA/6Aj/R8TyDpw+kf68PuAKWKFn7XbPkWFJpckFpJwe1TFdCNshf\r\n+XHT/jboE1CLYHWLe6Lr2Gm5LtImXSgxr48J6TwZokldzXMsinLY+BRIbLzg\r\n5PaVxblp0n0CHv5SYqeGLqySKi8pX6lHCIk3UEWtcjJXQYiLR7YFBClbpW3U\r\nLc0iBUFFLX6UV1uNIayNGstrTRqXvbuYaPQQDifQRqLzJXL1eyA4Vhrd/xDV\r\nFF0zdwrBVuyvM7fpxl0RRwry+DAKzQ8WIkGe00J1QXpr/FoueYQDHAQKiUsx\r\nTm+WIkIoTsRuc0c4hhK7nVTaiO+//Al0RXKgX7cRfPo28LUbvbp5eERaki2x\r\nyVRopCvpcftnlg92eXUHMPAQzVrzyfAN0Fbymzi+14Mee4GmxjMlE82QrFoP\r\nNwA/K4e8qj4GI3+c/As32ugORKTLaUt6C7Irr0olIwcxvAsqI5jEor+Es1xz\r\nq1vvQhqBQInt3p6bsQ81hnjeoB6WP0BUsnGJWxW1RC/r+xYKCMA0WbTPwsTf\r\nx8XMroXpc/8UPQkcYTDWjqz6g1NwMBaDeLpHbw5rpmlZYSbtf6kzxLN8uc4x\r\niO3C8Ocisd0/AOkkSuDjNN0Biz/+ZAV5faGmUPEbnCsBEL3+nlTWcghZrx6P\r\nxWTN71AjM5EXT1bBdxUanNZpxWJkwRnC5RM=\r\n=0rL4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-6dcd7677441293f563bc2758b5f58f5c05724337-18.x/balena-jellyfish-metrics-2.0.276.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-6dcd7677441293f563bc2758b5f58f5c05724337-18.x/balena-jellyfish-metrics-2.0.276.tgz","_integrity":"sha512-9jIAO1buJOPM8Z5Y4IuTHBWTnLLdNJdhsfMhJjwsBwCdWbV73hAnCRK4vgmRo4OA4s31TO5ZrGr5eVU0aWJ1+g==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-03T04:55:55.438Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.3","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.2.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.19","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^18.11.8","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.276-renovate-balena-jellyfish-environment-14-x-6dcd7677441293f563bc2758b5f58f5c05724337-1_1667451440901_0.38141599877641874","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.276":{"name":"@balena/jellyfish-metrics","version":"2.0.276","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.276","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"38b0193d7aeb4dbc1ca55e0ca99e10763ca4c030","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.276.tgz","fileCount":15,"integrity":"sha512-Z0p+uwZd13OBqIdHuu0yRrm6seNfdImWKw4Y+3lFIMcB+J4soQyhvAaHnKpBHaSMoijQO1mSIecGcoRFzY5Xhw==","signatures":[{"sig":"MEQCIHiD3TCqNUohXQLl2ggXKD6Q7q0yJvekDN0ktOaFXHnvAiBaI/vZNGAHDAwjLzkWzGvy9R9svqx8gztUnLrCswJkYQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjY0q4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrSOhAAk+JXCNgkA2nCYF7rJxUFefvtBf3wdZgWtMMhoOxvK80aX4Jm\r\nLKqB8vuQGemzmeHMb1R2Ir6xX+vCK7bbOfp6cZHf6xbNp5/uEYKMiQ+E1jcr\r\nBhTS7RSOST25F6se9NJCmZoJt9aG9jelv1LlCXYmV48yYrGOv/ZsRZbyd+4r\r\n9kHdruW9JyHV+jado666U8WCM6oUSdsv+8IQNy8UBtQ8Rq6KaTVF6e1Ax6OA\r\nq2ltRnlmO/1Oq740kz9FD/+jMay9qNYa7cvBQ4bAXh3gHT0X9M9L24Co1YzW\r\nDPJMhDZrGNQ82ada72uU2/q/atzOqKXB6eyoY2jfJPue+t8de2VhBV9hTIWJ\r\nhMwN/XquJ4e/TY1TSue0oZYAKEJd6mXQ0a2fdfncSCHFWdlj4Xz/oFpMgA2C\r\nrPIsoIaMqEEalsgrcTqWJ3kHJXUfWA99GyqKz8r+HvtagYD0crGyGKhjhabV\r\ngC0TX97db2LvFt1nRKG2dTGQIAh9HsQy6IJdS0MV7wIgrvm7FJG8+EfhkilE\r\n84LFRJAbrb56eRZB0eyseiEKcqN9wLL9yDhCxxBePYAVleWsSXmgc7mcdxd5\r\nuxR7YQKuiY24cSrOOnPt6m+7UfLrrDdYkGUbbbU6aiHSbM0Ls0NpaW+Fu9mD\r\nXxho/b6zqSqnq+EjUl+ijh1db+O9DVVJ3sM=\r\n=zzEo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-6dcd7677441293f563bc2758b5f58f5c05724337-18.x/balena-jellyfish-metrics-2.0.276.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-6dcd7677441293f563bc2758b5f58f5c05724337-18.x/balena-jellyfish-metrics-2.0.276.tgz","_integrity":"sha512-Z0p+uwZd13OBqIdHuu0yRrm6seNfdImWKw4Y+3lFIMcB+J4soQyhvAaHnKpBHaSMoijQO1mSIecGcoRFzY5Xhw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-03T04:55:55.438Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.3","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.19","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^18.11.8","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.276_1667451575806_0.8089630788207842","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.277-renovate-typedoc-0-x-d9d54f331d107b0a3ca6113399fad923d348186c-1":{"name":"@balena/jellyfish-metrics","version":"2.0.277-renovate-typedoc-0-x-d9d54f331d107b0a3ca6113399fad923d348186c-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.277-renovate-typedoc-0-x-d9d54f331d107b0a3ca6113399fad923d348186c-1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"82caf8201b4eaf8f379b88899f5a542f6cb79133","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.277-renovate-typedoc-0-x-d9d54f331d107b0a3ca6113399fad923d348186c-1.tgz","fileCount":17,"integrity":"sha512-zYg+1Ss5U+1tw3qz5llBN4zvEd40i3MQzBTYtjANkk4jUee3BFhumznh5SFwUgCl7osGqsUAQe0bSt0iApgPLw==","signatures":[{"sig":"MEYCIQDcVXa6xsv5kl3R6jCkrFvJ5SpTPnkY1NYP2jwXY1gnzwIhAJjCGEE65S+DQuTZHpHZRDiE0Nor2uRQhJBqSN6Z6htm","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjY0txACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqdfg/+PSxmkC3woA8eXU55QXNGIun3JPpcdBjyN9NnkITkv22P22GH\r\nQfyKivZS5M9DOABleWpKtu3Wyzl/B0mDP04P7rBMbdBmA1i9MeOZC/xzkubU\r\ngh2x2IAZwRdV5n5UGArfM64hnc9CN6Maf4lY/abPb7i9BlQwjN/gdpGZW8U+\r\n1jc6GL67gBf50SDDkUb2gBP+4ko4cTGWQW0nUvj2840tlGaD/KsJRwPeX3od\r\nkeN3uzdGSsh/3f56zl6kDz4AlLWLcYA0hfUFIazasR79av/E9YcXowYD230C\r\nuYSPIEaCreJbuMZstf3MGF9dxt5td4yrtQ967nGMfqjph1uNrz3MvqD7A2Nq\r\n6q/kJk6JgbZFGOvtl90fAAPYBjfSd6gtv9aSQn46f/5zpN7RD0TvysqcrLVK\r\nVuWBOBrjP3PzZV8wiTqbnh/yt052kPVpQ8EoPTPT4c99/y6Nm6G3BvBpDd7u\r\nB7bIoMWxtQ+4mOaGoh3P8ZdGbQ8pj7svalv2nRXI3AEAA9aCbwqeBNksSjjg\r\n89zWcrRcuw6oJzih9EiAVRuGbaHMqGk98dnrtiecL7AtdEIGKMECyT7tnAgH\r\nUzbNif64F9tOCH2pkvDISGnfLMRaU9bF8VhrkAVlZ94X5Zoaq1jvW1Q35zl4\r\nSy+xBAsxmzNN3IQGWEuWY4mhavAvo6Eg7Bw=\r\n=UNTk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-d9d54f331d107b0a3ca6113399fad923d348186c-18.x/balena-jellyfish-metrics-2.0.277.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-d9d54f331d107b0a3ca6113399fad923d348186c-18.x/balena-jellyfish-metrics-2.0.277.tgz","_integrity":"sha512-zYg+1Ss5U+1tw3qz5llBN4zvEd40i3MQzBTYtjANkk4jUee3BFhumznh5SFwUgCl7osGqsUAQe0bSt0iApgPLw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-03T05:01:10.967Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.3","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.2.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.20","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^18.11.8","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.277-renovate-typedoc-0-x-d9d54f331d107b0a3ca6113399fad923d348186c-1_1667451761528_0.1536648452621634","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.277":{"name":"@balena/jellyfish-metrics","version":"2.0.277","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.277","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"fc15805988f53849bfc15948f21f1f3b5677a3ae","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.277.tgz","fileCount":15,"integrity":"sha512-VqonNFRd/iGfLdL/hLS14I4y6ASThpi+yl2UhwYsCaYPNJHM7S7+Vs2fYg8iD82CmE+a9Yy2Ro5A0dJ7FqOuHg==","signatures":[{"sig":"MEUCIQDfVjz4oSyz91SG72WNGeBvX/JFY8eChDr6KwYZhrMAAwIgU/xngVo/bfhTQDlBLh0zOHgIKlClz0TZ5bbMqvKQge4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjY0v3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrQmxAAo4jr/fCZNfxl0apKhKvehIOFRWM7MH31OWylk+f0279grmY+\r\nYjN5Q0zGn7boilxEU69KITb0grJY/jQvoQou3KRjqhYi/4G5fF02knh3uzi4\r\nU5m59PeZpDq2pdtKHgb1YKvO88XIWtTl/yp9F9cUL8qWAO9P1Ibe1npkeFm6\r\n2lPl6QBO+LjEwkfa8rcDNn2JfkEwN+iUV/SV4zjRZb2xSVKJeDcFpVoLCmWd\r\nZAOD5YoWCbcExiPP1/pc9dpsjSdr2JZqhihIarPI8LR0JCzBZE36mNbSKnv5\r\n6aB47m+Ef9vAiW+1RG3VXF9PbVSaZvKrpryUy27VKW0ZFc0xAs/TrwdjEt8t\r\ngZnljwuTkFIxMY/i4MNRc2rcaEUzEzpc2OrMXJDgdOP3jRtJHashh4+OIfwy\r\nkEHjpMP6b+OobATrA3gTlj+V2EsXIqCGtNAUCovZ+ExpZcMLsKxw2Xgt/SuX\r\nHqQrpOAbk7dMqfNd9nrx2m/w3oyaMIi7cmF/nNJfHWfgYKtBF2zRYk0UPEXw\r\nECuuPPaLaw9Yd4Hz97ei8T2nJyvymwdWpL5Pgsc2HEPFG/aLQ0/QumS3uCIL\r\njUtPtKfgdbm2utyTTpiuYjJh8Pe2PsnWYISEd5HAPKDdz99cvm84FwPQiCcW\r\nH3C+GyEPE0itXzS5MAOnGOnxG5iVuPB1cQE=\r\n=zMc2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-d9d54f331d107b0a3ca6113399fad923d348186c-18.x/balena-jellyfish-metrics-2.0.277.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-d9d54f331d107b0a3ca6113399fad923d348186c-18.x/balena-jellyfish-metrics-2.0.277.tgz","_integrity":"sha512-VqonNFRd/iGfLdL/hLS14I4y6ASThpi+yl2UhwYsCaYPNJHM7S7+Vs2fYg8iD82CmE+a9Yy2Ro5A0dJ7FqOuHg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-03T05:01:10.967Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.3","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.20","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.0","@types/node":"^18.11.8","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.277_1667451895116_0.0837956312387087","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.278-renovate-jest-monorepo-294fb4959975f3e8e2e2544c88fb8ba6674e57dc-1":{"name":"@balena/jellyfish-metrics","version":"2.0.278-renovate-jest-monorepo-294fb4959975f3e8e2e2544c88fb8ba6674e57dc-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.278-renovate-jest-monorepo-294fb4959975f3e8e2e2544c88fb8ba6674e57dc-1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"2cfa68a71da8fd9e039aa667bacec397d3ec9318","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.278-renovate-jest-monorepo-294fb4959975f3e8e2e2544c88fb8ba6674e57dc-1.tgz","fileCount":17,"integrity":"sha512-zwp5CyPtAbkOc5DJN2HhcaH8ghKe/ItlllmcdlzdgrSotOQrhXi2WUC63nmXaBM4xzYZTo93A88gT0vbibjP5g==","signatures":[{"sig":"MEQCICDOR7KVm4aQiufCL6fDuTJbc6P+JrdgGqFqqPyLAhwtAiBbVQQRlZKCz3cf6G7gfKB/dedU/fF27Vmcu4YalgR/2A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjZbinACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq4pA/8D6nqnPO5TX6BGkKXQoYpIg76xk0oFB0Fk/sjwg6T6tpoUr7p\r\nfuilIDaupPwGvmQWGs3ydSRckTp0Iyemvzl7OyRxCTbmowPR7fOjQ82VWIvY\r\n/aVAjaOl+Xf43rpFYIQDLZez6E1ToQiwY+iOltmUTPfm9vTrII2AkaWzPqy5\r\nk5RKeQlhNZ2y7hdG15iFJ+eRSHTdJbbVK7pGvjrcUUkFSG32EY2Mdd7RYyaS\r\nz2yjbQlAT951osMCzTj7KUo0alBrAvzjz7V5vr+YG60uOvLU8iHTpp/8Owsp\r\noo+o6crV2qYiaSuNGtnElHLUnXSEFWOaS4H7kvmZh7FlE7pb9DusJJ6cSABC\r\n95cINsS6jZzwK1b4NSEgy7MJZvLoXxz9yrgPxqBrZS+x12lTKVH/wIUyEWdK\r\n7dKuR3ByXtYQedLdfwzd7NJtvo4jSJbi9bBlXzH0GEO7buCawZluA9sH/ZXN\r\nMBBIxajwVbWTl4rnDk2OYaJ36c4MKVKiN6TrPoO3tzPbIPdC7j6Bx2IWkwSt\r\nwBviQrCQCJpAXfQTNhWE6Hg5rhnXzLoW9U38dP8ie0JyAZppuIGcPSY82pyW\r\nXeRs1WizJ2lp71e6sinXVX1HHx4DsPnWgtnqBqNsVTezVylR8QW3zMrklj4W\r\nPDlVqMwNX1W7KGEtnuuNgCTNKYAuizzVsqY=\r\n=I5nk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-294fb4959975f3e8e2e2544c88fb8ba6674e57dc-18.x/balena-jellyfish-metrics-2.0.278.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-294fb4959975f3e8e2e2544c88fb8ba6674e57dc-18.x/balena-jellyfish-metrics-2.0.278.tgz","_integrity":"sha512-zwp5CyPtAbkOc5DJN2HhcaH8ghKe/ItlllmcdlzdgrSotOQrhXi2WUC63nmXaBM4xzYZTo93A88gT0vbibjP5g==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-05T01:11:36.138Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.3","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.2.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.20","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.2","@types/node":"^18.11.8","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.278-renovate-jest-monorepo-294fb4959975f3e8e2e2544c88fb8ba6674e57dc-1_1667610791127_0.1658559630202021","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.278":{"name":"@balena/jellyfish-metrics","version":"2.0.278","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.278","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f0df1dc12af37ed725ecdd74620beaa28d141c98","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.278.tgz","fileCount":15,"integrity":"sha512-hMUjslzO2NrmZAviLG4MmfT1L6QFcephgzbujsMVdPp8gDYRaP+wtuFuhQ10n6r8j0DRdivQV+htmjkn6FZulw==","signatures":[{"sig":"MEQCIDKQwXAnu2nO1YCGnLMmExQy+45EDjx+3eE7j6IIWcWuAiBh8MU8sOJh6E6jM738lnhs21dBxnwAjuwq5XBmPwCxyg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjZbkzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrZNA//WzZkp9KqVW4TPPKQzcE+ZDiH01YWkCUoKoosdX/UrdN/RY8U\r\nQBnMaU0Hb9pWvZiYpGYuRqdVj8SGTOd4Z0fbY+7TU5oYNl8DXLl24gacw39g\r\nKmdATKzKJ/diIVAfKQ/F1/F9iMCWFq54nfNFAVsIefLWvXWMDyRLejTMMFaG\r\n6y9At2jEAcMOpByVb4O1S05D6LDIdZ2R7N01MsltXjM2jZVagazkJ9065ni8\r\n9ndCd/PzNG8zAQzx/o+tSDz4WvECtUT5O3iU9VzSRKeIjgpSwTtd8nReEaYT\r\nJRrKOlq/SecTSfK2QB0JZLUKLc5Ot6+SE95WZG8jw5ysE3fvNEorBuLhgK/A\r\n/p+kmKN2g8/QC09qBAVmIRtd6sDBFEJFVZuKbPCk9UEWnzR3ZSqTFthC+6JD\r\nxXINOujEc0fB9Xw4fdiHwrXi5sL1ARs+6DJQiBPXXSPJ5SDmwYlgkRTQL7ny\r\nqqqOJt0VZvhnE85ubt80r1Gf2mJ7ifVwXGUu/7aXt0kCm32NFdmG/+QLo+3b\r\nF4cy6L+o506l44tmZ8VMMSERhwD3Td/MlI8GO65uJy3DWJLlmWQRLqH8fupz\r\nk5DgvRjbc8U1LvqCiEseQfMA+kWhE2TAtRPpVuS3/kIDwVstFTDpcj9XAM7I\r\nmjI1kzC9+Yu8iw6l0ptAURlyhTJIMy6iJoE=\r\n=ffxn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-294fb4959975f3e8e2e2544c88fb8ba6674e57dc-18.x/balena-jellyfish-metrics-2.0.278.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-294fb4959975f3e8e2e2544c88fb8ba6674e57dc-18.x/balena-jellyfish-metrics-2.0.278.tgz","_integrity":"sha512-hMUjslzO2NrmZAviLG4MmfT1L6QFcephgzbujsMVdPp8gDYRaP+wtuFuhQ10n6r8j0DRdivQV+htmjkn6FZulw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-05T01:11:36.138Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.3","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.20","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.2","@types/node":"^18.11.8","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.186","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.278_1667610931457_0.10061141481758784","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.279-renovate-lodash-4-x-414f4171c5035f070a6705e5a9c5c07ab38c47d8-1":{"name":"@balena/jellyfish-metrics","version":"2.0.279-renovate-lodash-4-x-414f4171c5035f070a6705e5a9c5c07ab38c47d8-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.279-renovate-lodash-4-x-414f4171c5035f070a6705e5a9c5c07ab38c47d8-1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"46d3fd5a816a5e0285dfe7910467859ab22bd73c","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.279-renovate-lodash-4-x-414f4171c5035f070a6705e5a9c5c07ab38c47d8-1.tgz","fileCount":17,"integrity":"sha512-wJ1Q70TF6OlsLJsRgCoDGUj2/2yw0lC7W5amMuXBd7uku6b/GfHLHoB2WCmk+pmVKn4OdcxxUgzZP23fPR5c7g==","signatures":[{"sig":"MEUCIEgbvi8saruQ498gbBUSBmuKWi1qSo12q13NXv64a/wzAiEA3ka9QfaX+jzX8+qs+h51kiOb/Gcdp1aKx1bYt+ed2MQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68117,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjZbn3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpojw/8Cap1h5XtBUOguIjhJuggbWizmQVOZtpX+f+OHhparDnDh6sE\r\npVomtJsQcBZvinTplTveVi8NZEqED4MnaXuqsizlLFBVLnelkaZVOHI9GP1n\r\nRwdMhief3jmkOqgtWwhEl1douynUIoRDka2k2nG8nJXgYVj7PCdqsV/XA2IF\r\nGKKJacMO0p7h/pVdr2a6P9g0eFilzNvs9iNmfvu+BdwPEqR996gbiNVSBX5q\r\nHMZRpSmUPPKxlrmI5b61dm15or5tUiXFgTTrSONf5yhClxP1/Qf7ZAL1KI2n\r\ndTlZtB13PTL+RZWmgV7iWE+dqp9Dbt50DoY+Li57E/KxFkNcnH3uwg/6yPlo\r\nuedysroqqdWGExcf48jsTBl/xtZnxcwjOm8QEU9MrZrX95m90Rgf6C4N5Hf2\r\nJnZiCcDCjcSQVAjm+wt2SEHeC1/bBO+iBrTZdIwf+5NHTT7tzMm61Vmxvo9q\r\nNgEElsMERKPRR+i/2/QYgj1xJe3J7lcS2nRyOH8yuwN8qmM7lTHi+iqvjo0i\r\ncTyRsau1DmLKZhESLlMGz0C5wVDKSuo2dS1pGgCyO2QHG5YqzQ0vDWhTb6lx\r\np7/T7Xi2EYfmGYJtfBrB8gw149muuAdJGwLZpc+/1sfYpR14CGASv3+Iifro\r\nh7bv4OfkBf6dmlXNfJFcRCIt0O77zv/Lbqs=\r\n=ax3B\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-414f4171c5035f070a6705e5a9c5c07ab38c47d8-18.x/balena-jellyfish-metrics-2.0.279.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-414f4171c5035f070a6705e5a9c5c07ab38c47d8-18.x/balena-jellyfish-metrics-2.0.279.tgz","_integrity":"sha512-wJ1Q70TF6OlsLJsRgCoDGUj2/2yw0lC7W5amMuXBd7uku6b/GfHLHoB2WCmk+pmVKn4OdcxxUgzZP23fPR5c7g==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-05T01:17:26.638Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.3","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.2.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.20","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.2","@types/node":"^18.11.8","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.188","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.279-renovate-lodash-4-x-414f4171c5035f070a6705e5a9c5c07ab38c47d8-1_1667611127592_0.27263179481810984","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.279":{"name":"@balena/jellyfish-metrics","version":"2.0.279","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.279","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"11d0c58ee92d9ec856ca68073d63ccd8e2e09871","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.279.tgz","fileCount":15,"integrity":"sha512-H+YGPkpXHkdl2TNm8vY1SK6tLFFbhF6i9+a6zWkzrEyAQGRJ7gfzd1EoRXkIfuuSonE+3LYMYDAMKCWeid6Ovw==","signatures":[{"sig":"MEQCID3qZRV9WR/mmr08KMc6NAWbL4EdnbGD7WPTnLVp0iMoAiAbHJ5RpxuPmsmUyBlQmVvd279sZM4L7HHx1kShRGbu8A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjZbp9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrbsg//Q82CLnnuG92h+/bLbPoedqaF70U4aXdB9Lm4IemS0s+DzZKe\r\nxyyKtA7Kna36qs6qDiLzpcfCrLJwrIBv/Td7taVACBu7iiZrstXMDOEb6AqK\r\nG857yCMGqBq2Q31nbvPHmWn4RpJSUKTuu+uEoYinCSCzV4oWNKD4rdJlz4GE\r\nD8aaYA6nYkc6LP+UyOmNIRQa2BJ5JSAaFpdQMR6HywpgtoA1ttfIttr2Zrec\r\n8VrqS41cNTljTnY1orPmXhOvEwkQkYdvJfx9M5Nng0IDxhJYwO19Isui92Ea\r\nV2OOLiFSghRuJUnfFHhSL0g6O7BPu38PF0qYgIdyvGfm3IojcXWS+n2d925S\r\nXdLerJCPMbcKDiE5Mat7JOp4mzz4yb/D2u/9WzjD7rjKPQaAcBUR5Hsz2P6a\r\nUzqmX9iivJQ8T99bCBD+e7n5NC7VnSFAJq57oSW/yaARbtdtSdnwalSPcoLP\r\nW8HJ3oqDc2i8hxB5MGjayLn5ehCzyVI+qqOmbbgtUJL4du12GfUuEhKvDM3W\r\nXVlF4bJPFCPDJ7sqCCu6jGl+H67x2WA1SI36MQSL0YWabcOVzS/lOvHKXuFu\r\nYfHhVIo7zUeTh8Vgo8908NNGwVb5sTvYbE5msdyJuTHJX6t4AS/KaMEiXS/A\r\n+ZoQJAUtCDJIMHHXVArFEtVPIMKKBAxJ3HM=\r\n=rLCS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-414f4171c5035f070a6705e5a9c5c07ab38c47d8-18.x/balena-jellyfish-metrics-2.0.279.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-414f4171c5035f070a6705e5a9c5c07ab38c47d8-18.x/balena-jellyfish-metrics-2.0.279.tgz","_integrity":"sha512-H+YGPkpXHkdl2TNm8vY1SK6tLFFbhF6i9+a6zWkzrEyAQGRJ7gfzd1EoRXkIfuuSonE+3LYMYDAMKCWeid6Ovw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-05T01:17:26.638Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.3","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.20","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.2","@types/node":"^18.11.8","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.188","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.279_1667611261567_0.5955614302113343","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.280-renovate-balena-jellyfish-environment-14-x-42cbf11e4f4d02e06e100739073e51d008240078-1":{"name":"@balena/jellyfish-metrics","version":"2.0.280-renovate-balena-jellyfish-environment-14-x-42cbf11e4f4d02e06e100739073e51d008240078-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.280-renovate-balena-jellyfish-environment-14-x-42cbf11e4f4d02e06e100739073e51d008240078-1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"758fb80731b8cbd0e7d99c0add2fd2284ce035c4","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.280-renovate-balena-jellyfish-environment-14-x-42cbf11e4f4d02e06e100739073e51d008240078-1.tgz","fileCount":17,"integrity":"sha512-AJ1BTJKqjkZrSyRPRCO8+ErPjt4OUU0PenCBvxotz1Eofqc6lXDNC9GZjbDIgSw4ywXm/raIOv4FrfRFm44Ntg==","signatures":[{"sig":"MEYCIQCcdDLY09HjUJ9zdGlW/0b+u3b94j96r590zbshYEl9awIhAPiI2Zr1SLFISW2iPvPe0WgoDwWnsWa0MYp2I36ftVBS","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68140,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjZeHBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo2Ew/+IGGxaIdMA8id3U0MPMDfwaATDVfTZQxRTg4fDkFG40hAJlSq\r\nC27yD+90BDZCzy3OkdQqp6qOpnUw564cBTHS2+EWkrZdoVc8GeH+CbplsANH\r\nIWEIGUsP03glMNE6rcGZswnUY6zQOiBuIdoUpjJu0hNc5gYKhLRwYz/K8rx2\r\ni6+lQZM3/rS0mOUMWPploYv/hNbUrobcZ4VuZgHZNON4x6EvzNSbjISd2PCH\r\nzzOUYrCyejkCtgKQm36PIHURu9XI57eALROApIC0oPVy71bNDWOUlLAs4vFr\r\nbsqueQSlj1ZWpCutj0wudcDYyXIChk97F6alb6tks8a/WsNgZpLzFNBiLAvC\r\nRQPATLIsbMoBij4wSqR5Pw15IdptpgJFHd/+9mHYr6kV7SsMrVQSTKuJK6Bd\r\n2Fbl9q29E93PjAasgbaUU5fu+csFd+1tI3i295MxnQfRpBl/7TPxCsYeGPq9\r\nLyF6xnvWGecNVul6cMgsWF1OHhnCjcuIijyX3Oo8vDeyldl4f/e35j0ar8u6\r\nKTPlci1AAOYyXug5Qi5MIBF2ArDZRCIM/+4f9XjTFyh3I/EYlhx4HjFguQki\r\nVE266TGCrk+VJsYCk0fq4lV0b42/6hfifN8jL3qwAFZ/VR2+GFkfAqp2TfPd\r\nqUYN6196btTH7XYHZnlsS0tUo2CvE9vPOGE=\r\n=OLPM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-42cbf11e4f4d02e06e100739073e51d008240078-18.x/balena-jellyfish-metrics-2.0.280.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-42cbf11e4f4d02e06e100739073e51d008240078-18.x/balena-jellyfish-metrics-2.0.280.tgz","_integrity":"sha512-AJ1BTJKqjkZrSyRPRCO8+ErPjt4OUU0PenCBvxotz1Eofqc6lXDNC9GZjbDIgSw4ywXm/raIOv4FrfRFm44Ntg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-05T04:07:00.515Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.2.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.20","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.2","@types/node":"^18.11.8","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.188","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.280-renovate-balena-jellyfish-environment-14-x-42cbf11e4f4d02e06e100739073e51d008240078-1_1667621313367_0.3570045018622745","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.280":{"name":"@balena/jellyfish-metrics","version":"2.0.280","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.280","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"eb155ef1bf59cdd369dd2ee6dc47ad880af5a7ed","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.280.tgz","fileCount":15,"integrity":"sha512-UuhArYNIkPTeqEdsjIxdt2AW6sQEtrV7M1HDOeVeS1ZJQu3tHUech0RginBDOPLBmq1acf8jESrHGysA83ybcg==","signatures":[{"sig":"MEUCIAcsoeJCpiSR9wx4d9EUgPLZEL8XuklZ5DIFT0liOnXkAiEAoN+W3f6kHDsAzxZawNin8QeIPe3goY+WoTjKl98iOUM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjZeJyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrGVg//QkhyaGgohWZy8ctFIxInCkdr9Z0IixGLwvKxYdSXUMszi6Zw\r\n7gth8OYm3+gclqaRIPfuIp7pM2vCEUs29M3BTHHFMJ43LZpkaQwnC+aqpCGY\r\nc5Y5xNrqkos2AP7e5D4Y1B4QLlX0NzaDGavIVvNoTTa22PUwbxtxlTPUmMJr\r\nw3j3+n0GmZH882Wc/NOqIoJnXqTDYqP4TD1V/ya0miGI+1zqOkaZmsv0w9VS\r\n70BCb0ZZzLQdcsAjvP++v9vlL3xEuimM1Gc4/PvSNpE9XoGfCD7rilEErRvu\r\nW4/841iqVpKh0QgR2XeNI+TZebg5ft7kIagMSHFg7FX7wA3+nRCNeDeW5cPI\r\nCClnsv+NkBdtmaGcfas9mRKTQaC7PeGz1pnUfu4rKQd/+hXyR0mZa2rDLsGQ\r\nXyJfFySJXIL4zG1lsaRPoml7S3pmF60BgisQf9HWcnwKy2cG4VruR6KHmmMp\r\nFY4d36LcpJZTHICeRB1cJfv7mqHwtoO6HZLfoQQMMzkSfSn3SXoGECcQZmx/\r\nNADzAQyIGqFs3hiKljDz9ZKXB/d0JxUMq+jOr/TBOOSVuHn+ich53NEx2SWk\r\nYu1svMV8iv/Ub90kFe3TjopshSa6l73U5cFXxK6ncnyAMBWLtis8DxChe42T\r\nNU03g64TEhw9IMb/RPkaGMLA2IbNh1fFzmo=\r\n=f0OX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-42cbf11e4f4d02e06e100739073e51d008240078-18.x/balena-jellyfish-metrics-2.0.280.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-42cbf11e4f4d02e06e100739073e51d008240078-18.x/balena-jellyfish-metrics-2.0.280.tgz","_integrity":"sha512-UuhArYNIkPTeqEdsjIxdt2AW6sQEtrV7M1HDOeVeS1ZJQu3tHUech0RginBDOPLBmq1acf8jESrHGysA83ybcg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-05T04:07:00.515Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.20","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.2","@types/node":"^18.11.8","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.188","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.280_1667621489798_0.5906101093837672","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.281-renovate-node-18-x-5d83627370982f7c3f88127cd8d4a6b3cd203013-1":{"name":"@balena/jellyfish-metrics","version":"2.0.281-renovate-node-18-x-5d83627370982f7c3f88127cd8d4a6b3cd203013-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.281-renovate-node-18-x-5d83627370982f7c3f88127cd8d4a6b3cd203013-1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c24c1411862150dfb289e3abec3128d9969c8973","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.281-renovate-node-18-x-5d83627370982f7c3f88127cd8d4a6b3cd203013-1.tgz","fileCount":17,"integrity":"sha512-5UqA3JZgLKQZSv8wvAVJWuecp5HVa0fAPq2PD5Hpf/f/vW8ufyqt9h9EfPvRIwIQjyshi/pOPbqC22ejj/epiA==","signatures":[{"sig":"MEUCIEJ7U3/CRJHSS+fQJR+N769sfLfNmiU/v/QxrJ+300tEAiEA4A9Dbdk0nKgYFXnNlIsAZYXjbz6ADSj3jSMpRCqUM4Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68116,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjZeMSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrtIxAAgvcnHfP9F6vW5RHw0B04OK1aikxYquQn0xGLjoA8abWebeRJ\r\nvQaZ94bdT7eKpuirQcjcczHa58187OXpj+X8YVIanErtTlgjFS2LOkv/1YIV\r\nxU+/KwyBbQei2diblICbyj+7UFKIQ1g/3DqEurFKHdM+8hpcQ8V6ZJO+ZNZ+\r\n59Jzp+deXtWvrpjhHVO9PiyLxtFe3EljvHXJ/iQrOxgeM1qe/6vP6LoMjgtU\r\nhlCqVqAh/YL7SL6XeP6sJ14iuSkZTZ05u8WtID0nTYsYWV8vk+3yOEEHcHof\r\nwk9ESGsstnCQNSxcSUI29GTxLvDwXuYdpB039M/iVN5mzF7N9Jmx380CDbxt\r\nf3ZdJWym35uPkYbRUF0XW0ZpliSbHkE+QEwmKsDws7sg+UFIa7Cox6fehUt6\r\nXkCNZRlyhRc8LnNI/DLyW+TAgZ7+5Z62qY1raXkcigbj1k1LU0lKS0EoEx/S\r\nFqMwD+s8L/LSfqatkMQV6cxD2yoIIpTlrZMDbeEaUo5KFV7H9UNDYoVLEmWP\r\n94yPkbxKrombXCIpZZjIJTkDWAzIGhMdwzqR6BqB95H+3pqyEOJM5L3+5BTq\r\nCWmXKAJOdPvMVzL8HAjs1I/QIoQh3h5YGL54ipN8uhGScGW7G7/Gcj9fi65o\r\nWWFX3cj1raRxDP14pXPsyXV6i1qPHliw+mE=\r\n=hmbx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-5d83627370982f7c3f88127cd8d4a6b3cd203013-18.x/balena-jellyfish-metrics-2.0.281.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-5d83627370982f7c3f88127cd8d4a6b3cd203013-18.x/balena-jellyfish-metrics-2.0.281.tgz","_integrity":"sha512-5UqA3JZgLKQZSv8wvAVJWuecp5HVa0fAPq2PD5Hpf/f/vW8ufyqt9h9EfPvRIwIQjyshi/pOPbqC22ejj/epiA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-05T04:12:49.374Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.2.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.20","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.2","@types/node":"^18.11.9","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.188","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.281-renovate-node-18-x-5d83627370982f7c3f88127cd8d4a6b3cd203013-1_1667621650109_0.15649420779875745","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.281":{"name":"@balena/jellyfish-metrics","version":"2.0.281","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.281","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9e3e8bf3daf63b37be09e86410456ebc2158903a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.281.tgz","fileCount":15,"integrity":"sha512-1dB3Pz40DUnRInmpY8OpziexF44jhGFLl74L1x1a0sxQr8qPm/h0kgJb9FV13z5w+3WPuZZ0gnlXWKy6mdXqow==","signatures":[{"sig":"MEUCIQDi5v1Kose8RFYIj3Ta4PXUMxsSI0i7Uaiy366Bzx00TAIgc1EjzXaBIB3zLmrjlmddum/Ww3FXHO/yGAyhQoZaymE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjZeOcACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrt8RAAg7YdgB8GVZUhFSQZMNiomjE3Nqvau/tO2ixF7Je+51Dswkz7\r\nIbZcXo18KctieI0gcW7VE1Lj0jLYKKJccbWqYyOwhoZP1fYXW9ud4byaBJOf\r\nnw3g2Ir/eoc8EK1uXHk24cuHfeqUrvzIIJ+kGa8rDaFd02WdhpLiSOhOYhlL\r\nyVFJbMF3/L++WgBinAalQpUqJ+jYAOZq+MVxSSStOG4zL+bpGxLpbT3k1Pki\r\njpNk+3+vbo77Ha+BZRp6ZdZdfdRiNKHXi2TqjupabQcDDslOrN7SBSLvbG2D\r\njmfC0IBMunauSBa6jL7UXFihXGroltdmeZU2RcR+jwbJbX947frJ5oSzw9w0\r\nmKBjtbnolGyv/O/OD7QPsB8yHzjrHe1tQiJS5220Z+djRcNL6cXE/fHUEGam\r\n1SagF7nKNfajgsBNyTZ+OqQoh3DXcpy5YNxV2jk2c5S3pGuQMItmq/M21Tzf\r\nJxQ61fe9+iDZS9fWSSuu6sjSUZ76jDVNX0vInPR2+uZbSB/hGhQLIDtR0LAK\r\nz1fTm+QRTE/A0RzQBswbQzrj4uHq77S03NF9WXh4FiyVoYGnq6wMGPsQzeNt\r\nNgJXAU6U+oMcGlNfPMdjjqd/LHlVq4YMYqvxBdP/xEbEdBhA9bzuGwQEtH8l\r\nnlRjEnX1TTWiBJGg+0P9plCoODFmAfZETT0=\r\n=LzMr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/tmp/npm-5d83627370982f7c3f88127cd8d4a6b3cd203013-18.x/balena-jellyfish-metrics-2.0.281.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/tmp/npm-5d83627370982f7c3f88127cd8d4a6b3cd203013-18.x/balena-jellyfish-metrics-2.0.281.tgz","_integrity":"sha512-1dB3Pz40DUnRInmpY8OpziexF44jhGFLl74L1x1a0sxQr8qPm/h0kgJb9FV13z5w+3WPuZZ0gnlXWKy6mdXqow==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-05T04:12:49.374Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.20","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.2","@types/node":"^18.11.9","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.0","@types/lodash":"^4.14.188","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.281_1667621788194_0.45148523973940224","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.282-renovate-balena-lint-6-x-0facdc09d266c90858636670945812592d822cc8-1":{"name":"@balena/jellyfish-metrics","version":"2.0.282-renovate-balena-lint-6-x-0facdc09d266c90858636670945812592d822cc8-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.282-renovate-balena-lint-6-x-0facdc09d266c90858636670945812592d822cc8-1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"b5e562ab626c4d2177dfa613cdb00249ff23494d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.282-renovate-balena-lint-6-x-0facdc09d266c90858636670945812592d822cc8-1.tgz","fileCount":17,"integrity":"sha512-f9w+1zqeiynNtjE56E+2w3N2UVQKE6F/KlsFIm2vn0W2/riCNeeRFJTVa3D0tDIld2FFrxqLuhQ0ulU0nFFhNA==","signatures":[{"sig":"MEYCIQCq0nThrd6phMhtX+zkadAmQfyYMwCmlg28KmW9YWhX4gIhAPYyoRfD/VEjyN4FWtBhCB3nDICfbjgzfivrdh18w1fa","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68122,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjaST5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqEPBAAmZ5c20Q1PrypdnUD/0OcBf+Y6filKgUJS1eewF8vqLNBOKXz\r\n/cJX8Ifww1wnQofdqxW/eUbK16EEr6uXh9a66V40NlThJEQJA/CabKIjsZsQ\r\n34DKBodVzhbpj3plA7W/t88NCxx0O2NpxpUJq4KmDu12ZfiPgQC5/0+qwK2H\r\nkKvW5zw+UrYxWZcUE+SyznFaL+3QfnMUIAm3D1RHk9v1qSqje0dR8ZUdwcgQ\r\nGcF/UxF5LvQdt2gGM/oKxnvPvg65jjM7+6FWYKKJTraiRhVd8tddXHn8wWcj\r\n2x0r2KeDijrD8/nDJk3XuKOelx0j4NRBbRe0fCoZm34aQhbgYHq2dxbWIAYQ\r\nciS71X/xChSSnVL0Z1sVWcwV2RrFtEh5PCk6mpAStgMWKUYYVYtTE06XoD+i\r\n5yRXgOjKhy/Cu0UEtvw/J6GaS9imOoaDX+XSrNFWpj3bp1NppthGQD8MoFQn\r\nPLUtNBrQp2PfuHvb+9YNOMEiAlZl6OslDeKf2i7WGbTZsnkRd7Q1vOEvf8qb\r\n5j4ODl2oArQPPK4CH33nZktBN1hmbq01bhUe0n2ooyQIT9MEYOVS/lxBZqY4\r\nOp5LpDUIxcLx47o+flKATRat422VNP5u/w7Tlm47rUS1Ct2glQdgMM7Iaxlb\r\nda1sR4m2w5GBlSNZvuy3bbEFm/EQAnXcp/s=\r\n=0A4G\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-0facdc09d266c90858636670945812592d822cc8-18.x/balena-jellyfish-metrics-2.0.282.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-0facdc09d266c90858636670945812592d822cc8-18.x/balena-jellyfish-metrics-2.0.282.tgz","_integrity":"sha512-f9w+1zqeiynNtjE56E+2w3N2UVQKE6F/KlsFIm2vn0W2/riCNeeRFJTVa3D0tDIld2FFrxqLuhQ0ulU0nFFhNA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-07T15:30:27.023Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.2.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.20","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.2","@types/node":"^18.11.9","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.1","@types/lodash":"^4.14.188","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.282-renovate-balena-lint-6-x-0facdc09d266c90858636670945812592d822cc8-1_1667835129465_0.22650285656796254","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.282":{"name":"@balena/jellyfish-metrics","version":"2.0.282","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.282","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"cee98cb5bcd0ae3cd9636f00b0ddee0a6532caaf","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.282.tgz","fileCount":15,"integrity":"sha512-Pmengl4ApEtSHSrzrvd4aPjmjEIIH8fBkvZ9apt/+Y+UzUD93TBe7Wed6sG8wCvEAEkifyqPQr6ClVBGKShQuw==","signatures":[{"sig":"MEYCIQCCSaUhX4VU4Ouyv/J2lBJaglLnXTtAFQDyGvRLyKmtlwIhAP7sPo5UshL9spcWVV5kbUpANl8M8Owg8+YhZkorj6FX","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjaSWGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqWoA//dSIkSNhRXCBdtKrtlcfQqpJ8HrnkAXdyZDHw2Ri/ctFkFARG\r\nxVvVeagMlH2ofxHgMamkjj/lsM8JosTY2HKrYCdPKObStEHLJhTlQWdalztF\r\nrCybEAfqW3JTlBh3xKjR2KKLendhxEtCcDcW12HB8eCyl5elHWH+ayQNyoO3\r\ni30Pn3GwhWExL5J/NfxrCzin/nYKzAr/XSP0lt5zbe9MueHg0rDIPnS89weL\r\nrOg21Qtyez6ew07VVNXojrSMEjF6LhvRcKATCFOxHB8sV4zlatoWAf/I6KRj\r\nMaEGmgOJ5G798W/baKDhcEJmpZe/sDvoWwOwaiTtVq9HLKVa+AwRWoZKbRnE\r\niFQhKd19+RuxVWrSlXN9bZ+ZkIFrcyqpaxJA6MkxBacaEpQGesEVXvR0+fQl\r\nbAUqwfsCFMYF5JWC04eVGel2eeIAm+4c2zwUYtl0sMG61wieNDHh7D1XyUzo\r\npRSIIo7eBamvW94gZk9yq71NfknOmL8dTHxzCuHdEvB4YER0mVm4I4vKlx27\r\n7qQVGR1QmgGCnqRUW+WQ81s83mcHbrKE5g/lnNn64teEpa93oDloVzo6Ah2C\r\nGjEWHVrl6BmYZNTLWAa3T5CHF4jioz2oGi04yS+zJ+UUEP3W1JunkBvYcfZs\r\n6//7mbafZEhJOs0XOrCfZXH3fjK6WLy/cck=\r\n=Nc88\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-0facdc09d266c90858636670945812592d822cc8-18.x/balena-jellyfish-metrics-2.0.282.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-0facdc09d266c90858636670945812592d822cc8-18.x/balena-jellyfish-metrics-2.0.282.tgz","_integrity":"sha512-Pmengl4ApEtSHSrzrvd4aPjmjEIIH8fBkvZ9apt/+Y+UzUD93TBe7Wed6sG8wCvEAEkifyqPQr6ClVBGKShQuw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-07T15:30:27.023Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.5","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.20","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.2","@types/node":"^18.11.9","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.1","@types/lodash":"^4.14.188","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.282_1667835270227_0.9645990610962809","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.283-renovate-balena-jellyfish-environment-14-x-906f848da1315268a857b1e72396c1bfc5967ede-1":{"name":"@balena/jellyfish-metrics","version":"2.0.283-renovate-balena-jellyfish-environment-14-x-906f848da1315268a857b1e72396c1bfc5967ede-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.283-renovate-balena-jellyfish-environment-14-x-906f848da1315268a857b1e72396c1bfc5967ede-1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f72e6aa67a6dd956f03916ba192d17a4db7a1a76","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.283-renovate-balena-jellyfish-environment-14-x-906f848da1315268a857b1e72396c1bfc5967ede-1.tgz","fileCount":17,"integrity":"sha512-pbVNVQrkR1oa+EJZbp+nHpMM0/9mTseF7BwV1vJqX0l7GfWTMA5PW1fb5iXO0o+bVkQcVjOJ9h0icqSiaNqxCQ==","signatures":[{"sig":"MEQCIF7iVVe7mw0xUV06kDfopQoqEZ//jmQiwf15nRe+RZUEAiATQYOlIQXZZtY6EiUSWHj9dxfOpuw6rQ6ykIfeRkqCYw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68140,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjaV82ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrYPg//cC++zO4GOAt1I742L5urAah91RE9PTG3cp5J6iMHaEWfdYeN\r\n3zquOppgsJK6KOUWhjs10uJ07OgvqoJxVPPYyeebw3HZ5Q0mnj6odIIzJok9\r\nts+7QTv/GUBlK+x6FVjy5aBQIrnnipnFgZJycwS3HuU8QBAvG0BTp5a4L3ug\r\ng/l0CE9ybfGF5S45SMQniz7g6QZQPdo2YHPoa3i9NdulHx+JyPHfOBxWJdbZ\r\nSMDRpuBg8D3F3RedmYCy9UzedFKaajAvN0dt9nobngTFVZhN09VwPzAcst8Q\r\nprtdU49U+2tcjBBeBhr5yp/DnTdKG/OlXwpPPoYyeNyM1Tpjsdq5nafA+UaK\r\nU5j/z3Sq6mE/EJR4ADGq+aj0guQpVKTlYpLQ6HfDIVq+oWwLh81FqEwDx5Zm\r\n0VbIMivnPaLeqmkHwEAkReqgR9XSmjOYj6UvnqOfcNPRhMwXAnl0XUyXNE0S\r\n6vt4iW8XF15eCReaM+5JQHNgXOP/63/qcZgmhuDDaceCDuuoFCQAgFLIlwhj\r\nFpCcQELSHtym8amGu4D9FCB0DM8VyBAmzF7PhqDB6MFypU4QLIpTPTlM1b4a\r\nkA4BW5RI4xBXQg8MIEV+riXqWJkqUnh+lSMPfw1bsZxweW3xgEy1GhUVHytx\r\nEdoVbPMNOsQNy/9pa6S/p1ABeGih9NmH5fs=\r\n=GLVJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-906f848da1315268a857b1e72396c1bfc5967ede-18.x/balena-jellyfish-metrics-2.0.283.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-906f848da1315268a857b1e72396c1bfc5967ede-18.x/balena-jellyfish-metrics-2.0.283.tgz","_integrity":"sha512-pbVNVQrkR1oa+EJZbp+nHpMM0/9mTseF7BwV1vJqX0l7GfWTMA5PW1fb5iXO0o+bVkQcVjOJ9h0icqSiaNqxCQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-07T19:39:14.591Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.6","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.2.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.20","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.2","@types/node":"^18.11.9","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.1","@types/lodash":"^4.14.188","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.283-renovate-balena-jellyfish-environment-14-x-906f848da1315268a857b1e72396c1bfc5967ede-1_1667850038348_0.8316100354923965","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.283":{"name":"@balena/jellyfish-metrics","version":"2.0.283","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.283","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0281532c12dbdcb85f3d5b217ffea6fda44f22f2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.283.tgz","fileCount":15,"integrity":"sha512-Xm+dFdKlJP5CB0fD5LqVrNRtHlbyFELVY/1hfkHliw3k76oGxbtLfqz6UCTU95g4DIE1nXpls8iv9/3alZ0USw==","signatures":[{"sig":"MEYCIQDmN0334PRUTH3hlfWsBfsMN3y6U2Vf3k6juxue5OPqiwIhAISueTyK6mlpmK8lu519sKipEe4bD0wGbAKe7GlNHqlX","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjaV/LACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpTOg//RTzhzFr54dDB5MMpO9ed2GJ1XSZuZbxiu7WAabt3VycbQetS\r\nP5ezxDCmY4F90XwtyJHroo+AlEiMBHZ1oHom/1oo4+AKiceFaK0ze8Slhe1j\r\n3Dt4DT4SnjlKlSf8HWLf6WKaVukZ/yfkpqAmJnCNozyzuIGSkHSq4D2L/zoU\r\nhoIB7NwYfJa1myRBF41emBmlsaoLxQoVNdmvGY5JbAJj6KUJ08Lbvx+Re23y\r\nodIO9IN5ohhi8r1Zz6zy1njNv2D4MbyBGSjn74uIgWXcSdgTJ0YMZWTE+Zwx\r\n2bxuS8Y0O5eFpUcJY4Fh1357uUcmGLcVQaCIiNgVKXRYPfPREgD+peNEsYij\r\nFGOlbGoMpd5cP+LWjxaGF+ElZh84l4sn0hBsGwI8XZbC4WzML1AKZx7NnsF7\r\nQLrCQbHnWDQQ9wz4S2hMSHUqN4K5JZ5Yo8adkImLhlWo9GI6595AJD1qklGz\r\nmXXuTKiVeaX9ZcSLBZRMCpG/NPXDyGwnHyab7Be71koY0Pn97nL4BD9N4INt\r\nqUxfPcUWHrlZ5ksecrfAqg9oQFeFB6698zky1CMEzzpNHGnswqDIyWMkC/SH\r\ncvgP6NAcVOg15CTK6gKPPLKQ9BLEN39NNjF7Ygw5ZK1Wv0Jv5LDcb/eovdiM\r\nCok/jpbMLvaEGEsjAp7w5zdEssymO2s1ssE=\r\n=ZyCx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-906f848da1315268a857b1e72396c1bfc5967ede-18.x/balena-jellyfish-metrics-2.0.283.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-906f848da1315268a857b1e72396c1bfc5967ede-18.x/balena-jellyfish-metrics-2.0.283.tgz","_integrity":"sha512-Xm+dFdKlJP5CB0fD5LqVrNRtHlbyFELVY/1hfkHliw3k76oGxbtLfqz6UCTU95g4DIE1nXpls8iv9/3alZ0USw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-07T19:39:14.591Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.6","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.2","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.20","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.2","@types/node":"^18.11.9","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.1","@types/lodash":"^4.14.188","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.283_1667850187510_0.35619832481455216","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.284-renovate-jest-monorepo-bb43feab60e94ff5a6cabfcff781620c82ba0670-1":{"name":"@balena/jellyfish-metrics","version":"2.0.284-renovate-jest-monorepo-bb43feab60e94ff5a6cabfcff781620c82ba0670-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.284-renovate-jest-monorepo-bb43feab60e94ff5a6cabfcff781620c82ba0670-1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f5ab9c48f46eaa6d98d5de6195072cab9a7fc26d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.284-renovate-jest-monorepo-bb43feab60e94ff5a6cabfcff781620c82ba0670-1.tgz","fileCount":17,"integrity":"sha512-LwStXMlo2J18x+LVSaKV5xPFPis7M8lt2qgItc1N5Hix7L08bwZ40PKce1adNWVIsdm3qC+RbXveBrBOVyspAg==","signatures":[{"sig":"MEUCIQCAdxDGsvT4A7teJuQK4a+2jHNMGfCmo2lULkjohzakEQIgCVLAd9jIegTOjeIvF4MOmLr5vloRozPw/fC3qgrDh0Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjbuN/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoyzRAAo/2Kw9dcDTbVtUVulQftH8QkxbX+5bT6IEdpuS4F2U33svAl\r\njB4F15uzFGvAI2ECPeXDWKpCjiakENAsDVmXfyJc3llUSo+x07AeBFDLAlzG\r\njxh7TAmcp3EZUF97SsaTH5YkTcemuqetrVUg+GGvtbJidgYXRlVsMQn5Snb9\r\niKvVlOLs+0oyWocXMCY2Wanr4wzZaNain0bKmCYKQrJ8oGYY7BNmLWri9SMP\r\nJJG8TwTAJUQqb5zOS7PNyTrEea4K3bakg88u+2skfFhQbrNh6ocqGMnadNPc\r\nxWoAXeDS/u55UvQegVM3zOx//xIcNdIZbrQcUrt9cQFmFJtddQvE/d1N6l47\r\n5G2HVoKQCyHDOO/tTa5tptP80vbGkMxskT3i2RbFuzmUCyxfJhVIUHJJFpyM\r\nU04yS+13BOCR3N3FZR1C9Y4fmdg4ZciPAcAzhN4rHkGNN+tNSQbsKGX/LTiv\r\nj1POuTVOG9yVMrS2TkDRQhjHTzATOJ1VNRn1Seh7QEaYn6SXWk19eNQXsVWg\r\nqMSstbhFVWmvpkC4uvn6elJZ9GsSm18FhlsCoEjip8n4uvQZbeNW8bun2yKB\r\n4kZhSfjWXr7E+EiUJtRphwQbhTz1SCFww9UjEBJLp0AVy1z66JevQ0QJ7wHQ\r\nrXIykBuJwXOn9XqWY9st/sWmLYs3z9LKtyA=\r\n=CXdH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-bb43feab60e94ff5a6cabfcff781620c82ba0670-18.x/balena-jellyfish-metrics-2.0.284.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-bb43feab60e94ff5a6cabfcff781620c82ba0670-18.x/balena-jellyfish-metrics-2.0.284.tgz","_integrity":"sha512-LwStXMlo2J18x+LVSaKV5xPFPis7M8lt2qgItc1N5Hix7L08bwZ40PKce1adNWVIsdm3qC+RbXveBrBOVyspAg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-12T00:04:48.593Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.6","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.3.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.20","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.2","@types/node":"^18.11.9","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.1","@types/lodash":"^4.14.188","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.284-renovate-jest-monorepo-bb43feab60e94ff5a6cabfcff781620c82ba0670-1_1668211582750_0.7176497091932386","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.284":{"name":"@balena/jellyfish-metrics","version":"2.0.284","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.284","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"17acc57e9b6d79119eba0c2a135371c66f6f3c08","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.284.tgz","fileCount":15,"integrity":"sha512-v9VSH7xQu8Fyj4ccwK2jG11+uErL8zfp53/G9kotSk3t1jN6fTMsugBs7O2yqMSJcoUzaXR1rkJUCIUMGfOuRg==","signatures":[{"sig":"MEUCIQDFDwa1RC2beA9qYF1umV8vSBh39r0V8bJY2qtWAHZZXAIgbgXNUfCvmi15Hj7fzWNEhJ6zb5WTKRHhRlhkOgX9H6w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjbuQfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpEdg//fe/P545eQn8kxFMo+L8ehH/gA1WRL4U9uCdEdV6T6pDI3z/y\r\n0RzhcBOOOGIrbWaOli5xBVXkevpDcRlulROBADl0O1WjbtvfE3It7+ff7Bd1\r\ndohlULIi1+c5nPQ2tbOXJQh8vHDFm0BVJN8uncYBf+2WbckoQV/pVaTcew7v\r\nViZet08IOElLnQ0x/F9a8wmzW2+RH9C1U3SsR8TJ0/TGDUbzsmQQhp30uFVz\r\nTMvhNuHNang9wSjmg6zk7XQpsjxfKA3L9oCrczASBPuQ5SwEDxcWTMU7g2Sr\r\nlVEzTvUIbyluHFWvmliVclpjmlUf1WgaSEkUKgksX8+BHWt621mZyIoRY3bh\r\nmh49z/RFr/c8E+2mSf5AFGNde+zQFvWleJbq1I3eor3y7aBk5wv5M8F27xAA\r\ntFlxkUZLdrKYCj5gM7/gWlKwWvP6eNBOiecDBEyy4zNFHLyqH52PL8SVtzeg\r\n1shyJRL2izJ0ulFoOSxFwitqHS5UHZjy4ltYiSN9Lv0pphVWR4OoEDFlWmF7\r\nD0KxoARBbaPQVheC4Rt4gMssIfHbWpT3IbFr5Mg8AXSYOirhq5gQevpYg2bD\r\nQE9YpxyOtqBp+T9MhFgACuaP4ezduxhceicyScQ+08RloTTBvphsdRkRn5aO\r\nO0gIzLlnQNPkgcqQwmf7r1rdk0ak2BBSUpg=\r\n=b+X5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-bb43feab60e94ff5a6cabfcff781620c82ba0670-18.x/balena-jellyfish-metrics-2.0.284.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-bb43feab60e94ff5a6cabfcff781620c82ba0670-18.x/balena-jellyfish-metrics-2.0.284.tgz","_integrity":"sha512-v9VSH7xQu8Fyj4ccwK2jG11+uErL8zfp53/G9kotSk3t1jN6fTMsugBs7O2yqMSJcoUzaXR1rkJUCIUMGfOuRg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-12T00:04:48.593Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.6","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.3.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.20","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.2","@types/node":"^18.11.9","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.1","@types/lodash":"^4.14.188","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.284_1668211743003_0.7862928639291056","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.285-renovate-balena-jellyfish-environment-14-x-183d0f263302b45527e485ad45d537d1ffe3b55c-1":{"name":"@balena/jellyfish-metrics","version":"2.0.285-renovate-balena-jellyfish-environment-14-x-183d0f263302b45527e485ad45d537d1ffe3b55c-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.285-renovate-balena-jellyfish-environment-14-x-183d0f263302b45527e485ad45d537d1ffe3b55c-1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"656ffa58df65a863e9fc9087818a9f88fffe45ad","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.285-renovate-balena-jellyfish-environment-14-x-183d0f263302b45527e485ad45d537d1ffe3b55c-1.tgz","fileCount":17,"integrity":"sha512-n9SdOfgh73LNsmHX5QS1htpDc+ZnCjJxdhMMfSwkPB01Z6BvI6jFTaderVWgEcKxE9S3ZXA2aBWxT1c23ybQyA==","signatures":[{"sig":"MEUCIFwTtLrNtcohXuhtTEOg/bZ6sMc/agXUDoSWvUZEyDEGAiEAy4KVjLCli6SoEyZlw745aEbvZbJon9mWHwOphyElGh8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68140,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjbx01ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpb4RAAnVV9FYySuLD0xsGpIsyfumapFqRIfjhVvSAxVclHYZ4tjX/0\r\nEZB8fjDAgCG2bbTiJZE24RRg2a95WEEFYbm6zAK3JqjKC3M7fVPCpB5FzPHL\r\nZrCF5aE/n/W7xl6ewwpJgajr6c40FZ5CRXCUwF2VmOHoyGW74zVjj5iSGdvY\r\nzWcdBvI0P4ADHghejr+nmL9gyZVA9ussA1P7ki4ButWHQjiX/lYdgrFQZ593\r\nLaMdVWT0SzjIL1QY6h3c9K6QdNTFR4wH7E0GKatw/Vd7Y33+OaKwULNggu+M\r\nvsiB0h46C/1Weq0hf3oeQI1I0A97WgKqh4MM5ncfYhZype0cB1RqaP6R6Gu5\r\nEvy4IOKLPqA+DplNje4l832Zae+03FfbnIIjdfOwIIds43npUoMYyMl6t7hb\r\nVbIr0lrtdKFKTGz7EFbIPY2X+gOWoxA3LUr/ye6Cs5ZdFIY0wY9mMywgtRqi\r\nvNb6wh6qnYNhg4ggSYbLeculoPAqUb/djGr46ElxhzkmZ9FG2n1sFvoTn4ij\r\nko+HbY3tNJgVucJERXwalMaqvb2Ori7acMbIfPKgKvGYMZMJOfBa79HdwsGp\r\nckNmWGWYGhjXf0wynhs8qzLdzaoW8cMF8KaH7y7ySNpMZDLE1DHczLtAgJWK\r\nzR8PeInYoeAiy8m/uUTyb4t3tjlwBbF2V0I=\r\n=AVFV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-183d0f263302b45527e485ad45d537d1ffe3b55c-18.x/balena-jellyfish-metrics-2.0.285.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-183d0f263302b45527e485ad45d537d1ffe3b55c-18.x/balena-jellyfish-metrics-2.0.285.tgz","_integrity":"sha512-n9SdOfgh73LNsmHX5QS1htpDc+ZnCjJxdhMMfSwkPB01Z6BvI6jFTaderVWgEcKxE9S3ZXA2aBWxT1c23ybQyA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-12T04:11:09.911Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.7","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.3.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.20","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.2","@types/node":"^18.11.9","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.1","@types/lodash":"^4.14.188","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.285-renovate-balena-jellyfish-environment-14-x-183d0f263302b45527e485ad45d537d1ffe3b55c-1_1668226356963_0.33789733947880474","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.285":{"name":"@balena/jellyfish-metrics","version":"2.0.285","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.285","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c6f87df18f223e8bbf08cc67bfb49c9b636ad26e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.285.tgz","fileCount":15,"integrity":"sha512-+p0F1Fdar25mWbgnA376U3hIt08Cy14KOf95wHlX2YTN4qtXe3vsvYDO7R4DgNQvAnmnTxvxg8IiCCFgH+2USw==","signatures":[{"sig":"MEYCIQDr60nuTBwrORj0LK/rHGQQUjRtkiYGkC3AIDrqcODHrAIhAJisVtAs/2ZSB1xc1gSUIoNyEnu9fMlqXKW+arRyR/Kh","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjbx3UACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqoow//alWOsT9flXoN9N/JcHEHbuoEsAVsJCUsC6OWu5YzMvz0ENmk\r\n86cfQpr6+zUuZUENBWe8Smg02aAwU0qxqJ8oxbuB43GaRC/vFADSU3lbEAaH\r\nL/+/2iYhChXZsUmOxBjhfqVTljEwZ1cztdIle4QXjEx+5IpEJROmKVBXpyop\r\nEiMLtONCa3nQQEXQ8prCA25y5C5CjcVjtC2oMeKGqE0S6JM/7EX8u/7pvjc+\r\nG1mhP5wP9GwiMnlu1/bg52Y/dIH8JM87AOtSNi+MnNVyx2Fvs1joLcX+gh4z\r\ns67FeAz9CpDnQpawDtOj/SWz1vlNAsvgS4l/n/IeqlbcuaaBZ9fFxWf/7Jnh\r\n6c1XETiukOc1CBcglZdHgKxOh7CyOZ+FEhfBwTN4qxpartvKQ7tu6+o2U1u5\r\nfBYVHRErZITo5GxizGWR5ToVq41qnCuX+qjl3HVvVGJBmRKYZaB3lh2aFkIP\r\nYzGDiKyqLw7QQDcojcFHzNo4XUhA1QAfVNfjbCEre6TdfkuLjnWCnndq1Erx\r\nffh2QBFfHjhvISEem4ey1E+EHYy6ZAAscgoFXN0iXMRozszvUHj28e/phpV4\r\nDvwkJYp3HGZ3hSaqE7fHUYQyKZ3v+5MtLWt/M3m7Lgr6OCk1H0yf6FE4nzRn\r\ncac0im9xLYgYSdZLYBuwq5NS3swDVbKp5E4=\r\n=TT8a\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-183d0f263302b45527e485ad45d537d1ffe3b55c-18.x/balena-jellyfish-metrics-2.0.285.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-183d0f263302b45527e485ad45d537d1ffe3b55c-18.x/balena-jellyfish-metrics-2.0.285.tgz","_integrity":"sha512-+p0F1Fdar25mWbgnA376U3hIt08Cy14KOf95wHlX2YTN4qtXe3vsvYDO7R4DgNQvAnmnTxvxg8IiCCFgH+2USw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-12T04:11:09.911Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.7","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.3.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.20","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.2","@types/node":"^18.11.9","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.1","@types/lodash":"^4.14.188","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.285_1668226516632_0.6705756412261037","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.286-renovate-balena-jellyfish-environment-14-x-bbeee229f11787967d7fd31ca8ecf97ca41968b4-1":{"name":"@balena/jellyfish-metrics","version":"2.0.286-renovate-balena-jellyfish-environment-14-x-bbeee229f11787967d7fd31ca8ecf97ca41968b4-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.286-renovate-balena-jellyfish-environment-14-x-bbeee229f11787967d7fd31ca8ecf97ca41968b4-1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f4edf4adf0b8a3f18008ce1217f4829c7188bd92","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.286-renovate-balena-jellyfish-environment-14-x-bbeee229f11787967d7fd31ca8ecf97ca41968b4-1.tgz","fileCount":17,"integrity":"sha512-dg4p87C0kAf8U0y5Fhiq55/nwGpz53jOPkQNTk33w6YD/vEmQvZmMBvg9Eo4SwIDgV4Hg8teBNsm6+G3K3tzgQ==","signatures":[{"sig":"MEUCIDysR3vUQL+kl3HWS35cR9JR1cMkhEEIapUaeVv48JNIAiEAuXu2YrPztKayID0xLRbcB6YSvbxNqsh0Jle8p6EJiwc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68140,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjcZ8kACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmorew/+Orc8ET/oQ048TNmLn5N08lIDDH3xwPpWZeHcEdG7rnIBPkMH\r\ncqZXrkAp3byD//b6FWVFBaeQodCScoVSoelUckCVe9lf8rC78/+eAMr+71nx\r\nIWL9qmURv5pI+5HF08NHSrtyaodx65NIkHkhcB9ZuUF6OQ6o0dncasniNZ2Y\r\nc/gLHQzfCIMKcCdC+2ED8llFIZAIBmbCBeiGWV9THbaY7ZV+CdMe5W3vSXul\r\nRPImysD28vAapr4ZgOZV+FBVT75DdXAiapo5x7vrKdBJQnToW3xu12u+eMYU\r\n6dNKMlI+/jZ3gWtnVv8TxwU7HmkvB4GususAQW/L0Grdb55WRfJH8uzVcgGm\r\nj5m1MhKbXw2oJtEuuxT5jSL6JtHSWvXT6HGjIKbZJ8PUplU63LhJ6CiLp8zZ\r\nET5XcRbwcr2IHQTxzpfmRBqafejL4Vj47koqWv40BcvuCaGQ8oQpUE8nUw1h\r\nsKq3mx72JCKshdxo1TajRRueBzO7eHn8Nf3Y8uYWfb5wgbxF+kNPXKE1hXzv\r\nIPHkn8kRhrhBBo0w+1pWibVFM92SCKSJql7liqQZtT7GU/cCryrln7RJn/zA\r\nk/ZyPk1Yo1yYI7dm8og5p1EmzIZJN75hOKNpymHg3i5Cs16cM3d0n2Dc9rYd\r\nWW0+6vKXo4rKDxnG86sOlnNQBIZTQzGezNE=\r\n=p7PF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-bbeee229f11787967d7fd31ca8ecf97ca41968b4-18.x/balena-jellyfish-metrics-2.0.286.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-bbeee229f11787967d7fd31ca8ecf97ca41968b4-18.x/balena-jellyfish-metrics-2.0.286.tgz","_integrity":"sha512-dg4p87C0kAf8U0y5Fhiq55/nwGpz53jOPkQNTk33w6YD/vEmQvZmMBvg9Eo4SwIDgV4Hg8teBNsm6+G3K3tzgQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-14T01:50:06.922Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.8","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.3.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.20","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.2","@types/node":"^18.11.9","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.1","@types/lodash":"^4.14.188","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.286-renovate-balena-jellyfish-environment-14-x-bbeee229f11787967d7fd31ca8ecf97ca41968b4-1_1668390692586_0.5094063228096075","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.286":{"name":"@balena/jellyfish-metrics","version":"2.0.286","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.286","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9d03800327cf1954e990a818664b0c68aa0fc655","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.286.tgz","fileCount":15,"integrity":"sha512-ycUIo7P6j4a6nNon7ICR7p2pzMnNQo67dI+qAgwtoku9C0QKKkRudAIyZwF+BefS1Uf8iTkyHAilRYwXkep5xQ==","signatures":[{"sig":"MEYCIQC8rth2PvJ7GbJzVpsTFHEs4WFagrcZCBXJU7qqko68lQIhAPjV/dn252ONVBTqWIqDWxLMhTf1uXZ0FGPlVw8mHfFu","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjcZ+qACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpOHRAAo5dv1sSAHw+68bfwdHVOgYjBt+nHtXPgqpTvzwRTJRfu/rx3\r\nU0hPgqLax6ZrS4/C59mEhFIO+lP/VaXfip1Q66GAgJMkPs45mShZDP1GVK9X\r\nmv6kqsrUPM0sANqztgyhswzS6kKayuH3iRo45YVLh1EZJyFqmY1euXpyLK++\r\naEyGFWCANOmpqXLt+YVXGky9OHtFtjpBs2NvIplAITzspmKP244Yy5miB+kl\r\nKtAhzt7VJsjpTP3NrPp/nSr+9nlCu1JZ06NCjA4XnO5NK2Lp71HyHMyfH9D6\r\nNK28Hm+MoK1joy92lKm4t4cEIyxY49mZ6aBH3tUxe7DhzVxhVHZizTnCh/Py\r\ny3Fve3XtBWjv1yGkh8OMuq2zMNs51Z8wWTsQAZHHnnq/YgIa0j6hK6+gBpXi\r\nsvK0LCn336SYYut5Fiu41jH+VT6rgh72MOnlicdF/k4RgnffPtTe2wytg64H\r\n4KkFL0rhlJp4zUwytghZ3wImVficFIGnuRu6afZhUbvmHobTu/9j0vMTw9uo\r\nGq0mjurwZ9AmhHNcs9l6s+maf0stemj2L83wP6ap3fhBDc52MH1YV0E3Or53\r\nC1hfhaeqKpTGLlCnDrvZfPozSeu5arh/7tXWO5q2anOaQOlB7sTFIbGJJhRj\r\nfJ1annGQU/KLBTu+ZrUR3u3VusnMTAaTxtg=\r\n=l/1u\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-bbeee229f11787967d7fd31ca8ecf97ca41968b4-18.x/balena-jellyfish-metrics-2.0.286.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-bbeee229f11787967d7fd31ca8ecf97ca41968b4-18.x/balena-jellyfish-metrics-2.0.286.tgz","_integrity":"sha512-ycUIo7P6j4a6nNon7ICR7p2pzMnNQo67dI+qAgwtoku9C0QKKkRudAIyZwF+BefS1Uf8iTkyHAilRYwXkep5xQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-14T01:50:06.922Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.8","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.3.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.20","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.2","@types/node":"^18.11.9","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.1","@types/lodash":"^4.14.188","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.286_1668390826523_0.501820373710427","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.287-renovate-typedoc-0-x-48ec6e7daeb25608c0dc6b2530b74328e20069d3-1":{"name":"@balena/jellyfish-metrics","version":"2.0.287-renovate-typedoc-0-x-48ec6e7daeb25608c0dc6b2530b74328e20069d3-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.287-renovate-typedoc-0-x-48ec6e7daeb25608c0dc6b2530b74328e20069d3-1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9fd8744dc46ad9ec7c2fe4c00f84a3f60c5a1ba2","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.287-renovate-typedoc-0-x-48ec6e7daeb25608c0dc6b2530b74328e20069d3-1.tgz","fileCount":17,"integrity":"sha512-zxGuU7jQIpPbZ3G3zfCQLAQ25sZ1lUaMQ2Lab6jFBfzKiPysJ5bFDk1ASDR/uNIH+uMZaG1LkghcB9GLSMAtaQ==","signatures":[{"sig":"MEUCIQDeACLuJ+CK0N57rtg1LmC1DbOcV8zDqwRSFuM/K3zU7QIgOCuis08+7uHMje9IAaHpdEmHBgex8dyoPkF/bCNMei4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjcaBjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpHkxAAjH8Qe16YKU4YG7sQEen6jb9kSuiT2d8218yM73IsWhSTbuzI\r\nT+xrP2tUyXzv6iL0kLtm2RbG2MUkrgrd/Yj5Sg+VXP1fYpSn+MEZdma00O0X\r\nwJYNZkC6bSnrGUOV4hye4drxzCDXcPzwFjSTBsnSyZjNLLQw/E4yrWGp8Kpw\r\nCQFspcpqAvD3LEuaTNh1y3SXgNwtdRZS1ihyaLvrE3SOCA0IyVJkPpK+Kch0\r\nVy4BtWZML+G6u/Arl+0BBihvXqGc3xkc+Y7Hgq5XesNYC1l7ZCAkDkJOf81h\r\n0G+zC/PFvhl+UrUU+h/SR00MQPZLRwjP9SM2NaLvkcRm0Sc6rANQmAdoREQg\r\nntCRn7unHpKkO/1M5tucQUy8fGwPvBQzFq71Vx5CJJ9m36BBgWfcpO6akcg4\r\ni7wPitm6Yl43N8o1077IDw54axCUyr1oUcN/VtcFCW1oO5TnLoUxYUatR2hs\r\n4fx9WyHq2QDHONGSuuvwrU2FmHzmpPWiEzpYBAr/kfAfkGcfitl6htA+yEmX\r\naN0+cEKtEsmKDbJEL6tVCsWAY+Z1zTpJOx40xBHjKF0IYsbrpIb0E8B1M2qF\r\nKmb0Yt9XMjGYRDUighcQINRQtgaKW7i3/CLyFnrLbYxo9p6V9SZd7IDsrWax\r\nWPWzwqDaFkBy+7dk6yqQxfBRPvmZqWlDudU=\r\n=BAjw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-48ec6e7daeb25608c0dc6b2530b74328e20069d3-18.x/balena-jellyfish-metrics-2.0.287.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-48ec6e7daeb25608c0dc6b2530b74328e20069d3-18.x/balena-jellyfish-metrics-2.0.287.tgz","_integrity":"sha512-zxGuU7jQIpPbZ3G3zfCQLAQ25sZ1lUaMQ2Lab6jFBfzKiPysJ5bFDk1ASDR/uNIH+uMZaG1LkghcB9GLSMAtaQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-14T01:55:30.224Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.8","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.3.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.2","@types/node":"^18.11.9","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.1","@types/lodash":"^4.14.188","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.287-renovate-typedoc-0-x-48ec6e7daeb25608c0dc6b2530b74328e20069d3-1_1668391011272_0.28254958474511294","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.287":{"name":"@balena/jellyfish-metrics","version":"2.0.287","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.287","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"024a508ef5ad31791df18dc83e36881b498d3b93","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.287.tgz","fileCount":15,"integrity":"sha512-J4djBP+zQlIwY9uWKt9qGBHMzyTdZvqfKEIGm8V1SD3s3tWhgVu02UpKPFYdxRaIT+oHP95wDETlJy6PAkz7ug==","signatures":[{"sig":"MEUCID+rCo21520BASDGe7rikmn2040Em2fWs3Bfy7sQzxBoAiEAr/WeV1ZDeWalJoS+lomhBnpCD0TrrHnsE1Q+aLreFQA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjcaD7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo+lw//TALU2eRJtBZLyCML/joZd9unmb6iv4rwKc/C3OI9HmiKcaUa\r\ngJwEnOnz/cli4/LKHSbm5KmSVQpBrSfgfdahD8V9Sq9DlbnDGqgFdD055h6w\r\nsO9fGFzURcx7ojnTR/uP5YaoEH9/A7uAFrma3Ijmym+pB7NP4heaSGJi7hyx\r\n00iKINDZrRPFukn2SxLVjkc/v3Nf/lhs9jlBKEGC4rSAgnJLOPITvLacrCzS\r\nv2GLGM1TQzYR5HhcyTDq34cKoZXxysUuMO7D4btuuo3U9DxujI3Z3ReyWtJY\r\nrwMTWcEY3TGwJTMiSu7DjaPeL7pHzIaPtBi54lIGOvet3+0GIS6KZKOX67FY\r\nqRRISW9EPknLhBO3yanFCVwhkdqAuPAIhNuQfoghN8hkdpsifC6SXulZk98I\r\n40Dkdx0Q5Jzx8mU/gvdLVYXAivePQ/plboXOsBYBnBU5yF/gnZGBuVu4r+/+\r\nDM8JO19Fvj7r9gvJ3RhNQ5Xc+ubHBozZoAkgkugCpuEyOjUbloiVp7GoyQ+Y\r\nBCmzKp54ZQQX36/TQSRGzNEgNA7RICuvRs8L6GFI0gKk/ufUiQau2I7zpork\r\nfJvVKBCQ/CZG/J8LlKYRDKciKGvV2DDflpI9I15hJHJ7FTyvJ8Q72G2IN40Y\r\nAMfoNofn8WQer7CwgTXy0AUJaAuwqTkpbWM=\r\n=6AIk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-48ec6e7daeb25608c0dc6b2530b74328e20069d3-18.x/balena-jellyfish-metrics-2.0.287.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-48ec6e7daeb25608c0dc6b2530b74328e20069d3-18.x/balena-jellyfish-metrics-2.0.287.tgz","_integrity":"sha512-J4djBP+zQlIwY9uWKt9qGBHMzyTdZvqfKEIGm8V1SD3s3tWhgVu02UpKPFYdxRaIT+oHP95wDETlJy6PAkz7ug==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-14T01:55:30.224Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.8","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.3.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.2","@types/node":"^18.11.9","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.1","@types/lodash":"^4.14.188","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.287_1668391163625_0.025682353436528693","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.288-renovate-jest-monorepo-c9e5f3f69b9631ea9039e97b226b33eea23c2a30-1":{"name":"@balena/jellyfish-metrics","version":"2.0.288-renovate-jest-monorepo-c9e5f3f69b9631ea9039e97b226b33eea23c2a30-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.288-renovate-jest-monorepo-c9e5f3f69b9631ea9039e97b226b33eea23c2a30-1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d1edb6a042eff82250e18ae1048415361dcf3952","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.288-renovate-jest-monorepo-c9e5f3f69b9631ea9039e97b226b33eea23c2a30-1.tgz","fileCount":17,"integrity":"sha512-zUlK4QoowI2e68fLLwHKgMgHhgzrOYNssLWERYlgd/0Vrn8aqU/l1mLHSYqK4bU4POESDI0QikhPkYnbrFceEw==","signatures":[{"sig":"MEUCIBwiRzBRfEQvDXWjcuUqCZina7lHbhGgOoZT5GWGtbc7AiEA7EZaX4C0BRJioPSdizcKD077zZXjPSsIyGiRhbifEpo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjeDvUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpP+w//T82we4flmE6G+LF56XSNArmZTRcQJJfgHUEQFk2WCeKtI43V\r\nCnxNHgzADgeqwz/j66rT6+lARa99HTKI7d526ZVkLPbKJyqbDq+hDVfD57e7\r\nSa9AjW2Lh1LgIwk8uXjkY3QN3T5hz0lFGEy4eh/U+s+eIjokRG/D67OwctX3\r\nc6+ZNxGgl8G2abhTVFCLdQw/VR1M7C3iSCYjTTXXc/mBsQNQ++g4Wmys3NED\r\nT0Pk4/K2OEwAHBGEcC8IPOonO48XRu4Wrjfvpvn8AkX6IdwXT1/nZnSvw/RW\r\ntQCFa0jaqjtm9JZpqnHKkrt5aguSenn5xgh4KiDbmBtriidk7QdV1OdcDAfG\r\nNX8nijoP88Fi/Y8ph9t3OLo97oFfl8Ig7MJsFhokE5+VrMF3prFKFQMMxzow\r\n4ElcwK3KzOpcWBTq3AB/VuRDdCQuHSeyTRBJ3J18xS+6LvNaaxRYU7+H6/JT\r\no48EwTGNRLgd7C46KsNWfSUREWJy56lJGr9oqdxlphcMp/FW2SrH9m8JMnog\r\nANTj0TjXsXAz/MzqlP3eIbytb5OVNO0tOE0QEYKFuR6tG7ruuEwIhuL1+CZ+\r\nZ++TjVSFmFbdrCx3XxQCBDqH8jy6miHy8bvGOdbqY6w3M1weLS2e1IUXxI1h\r\n3j9CIsUJ9VR8HdXNQccaMCK4wAtwsTYUlCk=\r\n=JcFq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-c9e5f3f69b9631ea9039e97b226b33eea23c2a30-18.x/balena-jellyfish-metrics-2.0.288.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-c9e5f3f69b9631ea9039e97b226b33eea23c2a30-18.x/balena-jellyfish-metrics-2.0.288.tgz","_integrity":"sha512-zUlK4QoowI2e68fLLwHKgMgHhgzrOYNssLWERYlgd/0Vrn8aqU/l1mLHSYqK4bU4POESDI0QikhPkYnbrFceEw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-19T02:12:10.012Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.8","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.3.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.3","@types/node":"^18.11.9","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.1","@types/lodash":"^4.14.188","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.288-renovate-jest-monorepo-c9e5f3f69b9631ea9039e97b226b33eea23c2a30-1_1668824020630_0.14834205145758506","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.288":{"name":"@balena/jellyfish-metrics","version":"2.0.288","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.288","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7a3b0b0880329f5ed2331bda9cccdd0764238c86","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.288.tgz","fileCount":15,"integrity":"sha512-uytCI4O413YUCt5VBNGD0YuMW3/J3MrUd2rvGYB6M36lRx9IU8WV5myFl7xencF5cKtc9KEvQwpesS4DW3+ErQ==","signatures":[{"sig":"MEUCIB50/q+XTteozmOxGh6IvbWDwQQL5abF+EVEUN0kBebeAiEAkNaxxnE01Cjnfy5cV17E7jejrvVanr3Ptl4VWNXBXjw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjeDx9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqaDxAAnDO5N4DUWj4IqSuVJuoDteP7fWG3pv/a4GDn6T5IyFjDzvNl\r\nyuKPiCwH+whILCg5bZfeESljv1ec4CMOOCINBHQngiKi7+X4XZMKFWmmw0mJ\r\nQyM4EsJ9y8xXB2Ci0B1yglbzW0MNO7TdSAwKyhYdM62zxVrRC243Re74RU7j\r\nSEZaJzpEjdFRd0NDDntxdT99RisAmTy5EeSeaCjAUf0r4lVksoSyqmtNfRiz\r\ngRzhj7phkTNyFfFzEyohZ7B9RGuNX6PEDh4V0YQ6cz2ErtdJSqpgMV9vagHF\r\nUbBXsyYKdlwIAyQo6uJ5NKKL6MO/h3BH984+diLiuor84TYhNDaoCIXhdc/x\r\nWKPIp0bvE0TdHrSzkapUIBzjxDA43DXgVuYM4Rf4sVjJ7pJLj4xSd/aWLj1l\r\nqX/5G5Gk0zZYlkbLYYRZaoMvR9XAjkEVoTeAO4dzBJlwoSyMod8njA04uiKo\r\nYDTY1chhr7XEXNhAUaW0P9t67B+kE/QDhITTgnfJGX1jJkTXrRYDps1B3NiU\r\n9kzsl/aWy4+3DNNrHXlXVqbECjK7eWA78vEfAataCyvc8bWzgacQX47Asg5c\r\nImHE1zlBlj+CSF6rbXRgsN/KZP4/1GCb/QrF44Evshwu/yX6x7Ul73SCORuf\r\nRZoH/CC+WUZw+krmcAwpp3w+UpgEIfIy7Wc=\r\n=DQk6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-c9e5f3f69b9631ea9039e97b226b33eea23c2a30-18.x/balena-jellyfish-metrics-2.0.288.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-c9e5f3f69b9631ea9039e97b226b33eea23c2a30-18.x/balena-jellyfish-metrics-2.0.288.tgz","_integrity":"sha512-uytCI4O413YUCt5VBNGD0YuMW3/J3MrUd2rvGYB6M36lRx9IU8WV5myFl7xencF5cKtc9KEvQwpesS4DW3+ErQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-19T02:12:10.012Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.8","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.3.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.3","@types/node":"^18.11.9","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.1","@types/lodash":"^4.14.188","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.288_1668824189348_0.39485190808902737","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.289-renovate-lodash-4-x-16abee1c631a8e4fc184db9331b621d78fe2e9e3-1":{"name":"@balena/jellyfish-metrics","version":"2.0.289-renovate-lodash-4-x-16abee1c631a8e4fc184db9331b621d78fe2e9e3-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.289-renovate-lodash-4-x-16abee1c631a8e4fc184db9331b621d78fe2e9e3-1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e53409bf073da6a04a0ed6e2e7e3408e0a036c80","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.289-renovate-lodash-4-x-16abee1c631a8e4fc184db9331b621d78fe2e9e3-1.tgz","fileCount":17,"integrity":"sha512-329bnBdWqxcvV6L+2CNvP581/fFBL08Wj91gnJyGuIJNnupXYEI03qHWTW/WA0vlvlQ9VgSWWsRMeglNZvtHWQ==","signatures":[{"sig":"MEQCIGGPmKLLo+4nPXZ4SUyhVoNzQx5lRQP82mZwR6ARLVnpAiAUGQ/d/i/t/lSVWmfGfwR3XnaS+L0S5lx7RGYq0wS3Gg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68117,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjeD02ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqNww//Zvua/VuH2UaTl8AoFHgJSRKPaETQWoKfy2/iga67Khjf4AM0\r\nVdQ8ZwPLeaIk+3VPQTb0uuMMpTypEixuKOTeejAFkn8p76oq5Hh25tYX1GQ4\r\nQ6sVi/KPLmm5o1v8E49IJZGHIftdvKJEIQfu/VTKNavAXSyZVgJO39Ue3KYQ\r\nqFMmESW91q9ED9LJ47KOyA49FMks0cc3bzlRuYwWjhIUfOjd6JbyTi2gUraW\r\nIj6jj18ZCvFl0C7kBjFc1tVMjpctbJDzSgXiVMMxKF/RBSUk2++JB0YELvyA\r\nORu14Q7kwhl6gy3Y2m96wgF0/UdVaS6o18L8hbm9EXoP97iGCrWyL7J/vrxQ\r\nVZvEjeAvlyuuiDrfr5ZL4m84Fhp+rvZcapTuUGBKhgEe3i8v2+3XeaIEIYBA\r\nchmdr0llZBRNjIBdN9Wwv9v6PcIOm61AEgoRl+JaUHE6Dz8ucd+PtCWGljgx\r\n4U9aUf7vS/2EIgMTiG9gNYBWQDBJXjqgXvmefwkunsjzcPGMk/Dj6a605s+N\r\nxMt960fxJBCJ27Fno/SEmVTDanUVBYzWIwjKquiIk6Ts7SaCtYqsUT5ZxNsP\r\nGJNRhMO37YM7/Zcxn4aZ78dOJ4QEu7QL5frlI2NG/CVqsjK2lCx88YDAQCln\r\nClOY8cQMy8ldAqp3sjciKLQSE4Hw1mR71k8=\r\n=6NOK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-16abee1c631a8e4fc184db9331b621d78fe2e9e3-18.x/balena-jellyfish-metrics-2.0.289.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-16abee1c631a8e4fc184db9331b621d78fe2e9e3-18.x/balena-jellyfish-metrics-2.0.289.tgz","_integrity":"sha512-329bnBdWqxcvV6L+2CNvP581/fFBL08Wj91gnJyGuIJNnupXYEI03qHWTW/WA0vlvlQ9VgSWWsRMeglNZvtHWQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-19T02:18:03.217Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.8","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.3.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.3","@types/node":"^18.11.9","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.1","@types/lodash":"^4.14.189","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.289-renovate-lodash-4-x-16abee1c631a8e4fc184db9331b621d78fe2e9e3-1_1668824374462_0.11668372068727173","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.289":{"name":"@balena/jellyfish-metrics","version":"2.0.289","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.289","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"932e863a1d09582ddaddec177ff4e2bc447e8c2b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.289.tgz","fileCount":15,"integrity":"sha512-mwxYy8MSZcUb1T14o8X9a6R1eHPYiHyRmx429p9XUMoNBrFtWC0v+yhxe7adwjEDmFUiMzkYw5SDWHmY2fE0kw==","signatures":[{"sig":"MEUCIQDSroFiTciDJhIYTQMjQOj9CdSHV0B362OQWk+H5mjL7gIgG8SasAXV+giSDbdX6FRqIhyodnm1jDeGRjNd8qYzGYk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjeD3TACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqxhg//biZaxH7wq/iRpb58S3HkCqhv7lBwJPSZf34zBkYg10OzG6uQ\r\n8yA7qEv02E+yxtcIsrXkUwX1AJGGSybIsM1ZjFnDpXnn5clseIZw5Q5hmNNM\r\nBvJNK/42EZ5e9fBnCITX/+Gusur+CIvCl3P+jUGR3/mCxMVlE4YNVInadOeK\r\n2oRhW3I1VOSip7FnwtZERvaX7r7N0LQ4ehpW4RpphcjA53AvKv4P2r9b9fAb\r\ndkW3RSRrazsmAaOvzea+3QRGgtlUMggSFs7PxzSb7ztpg+iMrOX9PS8LFOMH\r\nmolIvH55UzJB1IOONERZB+BSKDG1TmyBnXMn8JJOThl3jYxXu6MMqzZ/13Ye\r\nECDrNXGlHmbMUdGNJ5sVwO1XG1Fwn8fZLIPBWaC3JhUzo2ooe+7tv+vUMCdr\r\nBGHSMSkgMPQERSknJoNMDqAy6AS6ah2uNRX6KrGX6VwiIOHDeoeVwz6RF1xn\r\nzrAmWM8ASWEozwS/d1WedfH87xNK0+m8Om1ghU9ge3rHrko+iExFOdgzkxcv\r\n/VRS7iNKjKwXgltTgvv+e+awrgsh304uT4nabsn9rH74lkWewP/CBJwmP4Bc\r\nzkg2mU53L0dchq4B5NYuI2HYg/T6KES4KmDuPFFGmlZWmr7FPZy7vvarBe5m\r\niNT5JM0RpPmPqp57WdRztFFfIdOf6s1zbgQ=\r\n=DDz1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-16abee1c631a8e4fc184db9331b621d78fe2e9e3-18.x/balena-jellyfish-metrics-2.0.289.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-16abee1c631a8e4fc184db9331b621d78fe2e9e3-18.x/balena-jellyfish-metrics-2.0.289.tgz","_integrity":"sha512-mwxYy8MSZcUb1T14o8X9a6R1eHPYiHyRmx429p9XUMoNBrFtWC0v+yhxe7adwjEDmFUiMzkYw5SDWHmY2fE0kw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-19T02:18:03.217Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.8","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.3.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.3","@types/node":"^18.11.9","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.1","@types/lodash":"^4.14.189","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.289_1668824531334_0.5467087090826319","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.290-renovate-balena-jellyfish-environment-14-x-81031f5894e4ca8144d08106bdbb0b5d9e068d5b-1":{"name":"@balena/jellyfish-metrics","version":"2.0.290-renovate-balena-jellyfish-environment-14-x-81031f5894e4ca8144d08106bdbb0b5d9e068d5b-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.290-renovate-balena-jellyfish-environment-14-x-81031f5894e4ca8144d08106bdbb0b5d9e068d5b-1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7ff1e1d15e567cd8635bc0c93b57046067408d3e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.290-renovate-balena-jellyfish-environment-14-x-81031f5894e4ca8144d08106bdbb0b5d9e068d5b-1.tgz","fileCount":17,"integrity":"sha512-kXyoaPjDRSkgBSoBXEKM6d2uRmd0FcjXrJVcYTxZQU8vFQep6ZoDdMY46VauZ0zu+c3sUFwkG0FJmoWANhdHqA==","signatures":[{"sig":"MEUCIBi5y285ylIhbpCTlao67xiz7rftHZVSgLZO4Wr/HPfbAiEA1NL+kNnDBpGF1qjHqCGh/UKtyOv3B7AvbJuYwiEgYow=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68141,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjeGWqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoHpA/6AlRCc0Xayq5r9MLmLPbUFuKqbm5CZTFh1eyKRqk5IikC0vu3\r\n0LYtNzZKvrgsRktlK8oy55j3YBM02/H2gsJ9TZKE7lbVeRmyq5pkpEqSZ4T/\r\nxYGEEFayCAs2aGIW2DTSOQPquYnBi64DLseFGKTlSJmV7zAqxxTJH9vEYBv+\r\n0aLc4b33Akm2N5KgrUjev09eJ2JWhopPG+OesYS2BbEMCN02u+wI7Smxpp0U\r\nuCYI42DaX0z/icETnCresIPMQGyNqDx1Awmtse/oKi8dLEnb2e6/02XLDXrp\r\nTGlbSNmlW42dK4AULqDtdIXtQr4GgBNx9a5zLsej/Q927MeK3++li+tksaKw\r\nt/aymABbYX3Hocs7Bfi7EiUj5mxPQ96tTmBvRvDUSMvTYzHK1FvgvM9z3LAL\r\npndjqFIEt7fcD1+Zd2VYPQ6zzBsDmKTbox6mUsaa6TMmQXbOR58Tb+4Sw1pZ\r\nWflFu/3HXP3/JpsJJblk7luax2jLaZ/EoEoSYqQboL+NnpWr2ro8jE/00URQ\r\not3vO0Mn3o4GoQpEEUhS3Bw9RCJXmm7AVzozLiq/ksiyD+7nI0bHyNtyfz58\r\nC1bne6dlmTwOzWp7xYk9dJXkVDyttxbqG/QqLABnM/UHBOooku9v680aQSWz\r\ntDZBE+qp7ERc3tpaAJeLrpOcXOP/KiPKAwY=\r\n=DOde\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-81031f5894e4ca8144d08106bdbb0b5d9e068d5b-18.x/balena-jellyfish-metrics-2.0.290.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-81031f5894e4ca8144d08106bdbb0b5d9e068d5b-18.x/balena-jellyfish-metrics-2.0.290.tgz","_integrity":"sha512-kXyoaPjDRSkgBSoBXEKM6d2uRmd0FcjXrJVcYTxZQU8vFQep6ZoDdMY46VauZ0zu+c3sUFwkG0FJmoWANhdHqA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-19T05:10:42.518Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.10","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.3.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.3","@types/node":"^18.11.9","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.1","@types/lodash":"^4.14.189","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.290-renovate-balena-jellyfish-environment-14-x-81031f5894e4ca8144d08106bdbb0b5d9e068d5b-1_1668834730187_0.10018553777530426","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.290":{"name":"@balena/jellyfish-metrics","version":"2.0.290","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.290","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"72c09a9954c1def990add7c3f89b930724f2fa9b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.290.tgz","fileCount":15,"integrity":"sha512-CHXx1d4Ht80L3skSNrPTKqsgngyU10FZyhnbDF+9WZhSHHk0X0E0Xkgx8FVjO8Ww+Rcp3Sc5DODraMEWp4EeyQ==","signatures":[{"sig":"MEYCIQCuNgNGYAmvHiE+mQrmgtcxpj4Gidd6SJQ0Cd7QY8E68wIhAO3QxjkAshjgYSdl3mg24+Jkbg2wWFC+WW/0j4t9iRT6","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68055,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjeGYwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoCMhAAg7J2191XNqv9Uvf9tdrTsmSa0s9rXmD4AEMIbzQvBnKZsAru\r\n0xj+GcaVrrkx0PcUlyNc7ICXOo88gK2LMT5w20uUs/g8eLL/5CA9JVwsTc29\r\ncKXGZjDWXI5/SfGP+ZvKfTUSagfbtNO0Md/X7ddRHb+EiuZw6fedwL2DZxMS\r\nYhxWPgmNJ3wnDS07jpmGRpfbC6Lgy/TXGI3rQdEJzLcuE5WiTx89oRlt1XT9\r\n2AjqVKOyphp5N4YO5aiBUUuRTqIELYaWr//TBD7oQHbbIOZqxRvLjVW4H1VX\r\n3Ab+PVUXO5RNh03kDAWYGOHnuC006ejU6hlL2cB46Q61qLAWo+t7YPjG3Rmr\r\nwS4dGnasqyoZxsm2Hj9l1MnQnUozxc0JgvVwMhEa/qJ6Golj7dctw1T2uwn/\r\ndLTPeAZVPm6gpU6lHiAKefJcJ+lQFj5+4RKxRLl6ZAbKYcg7FctkJlV/JMV0\r\ncKkyLf5orPMaxQE/p2MnwlDztGAGhQThtNbxM8/5qNQVgJ+jLzQD5nNTRwEM\r\nbrSsk5Q3NdhLDujU1MyCAew57uLfecnXZpoy2SPe1OsFUQ30YoNmOmVtbO7u\r\nrYjgLOYSP6mKBiIWa0U5SlbC5IorMFFGK8hIJIqtoeSZnCKhrLdDEIcklKc8\r\n6QXFsk0LH45EUyYK625Lh5zZ/FNzf0xSbsI=\r\n=ig/4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-81031f5894e4ca8144d08106bdbb0b5d9e068d5b-18.x/balena-jellyfish-metrics-2.0.290.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-81031f5894e4ca8144d08106bdbb0b5d9e068d5b-18.x/balena-jellyfish-metrics-2.0.290.tgz","_integrity":"sha512-CHXx1d4Ht80L3skSNrPTKqsgngyU10FZyhnbDF+9WZhSHHk0X0E0Xkgx8FVjO8Ww+Rcp3Sc5DODraMEWp4EeyQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-19T05:10:42.518Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.10","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.3.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.7.1","typescript":"^4.8.4","@types/jest":"^29.2.3","@types/node":"^18.11.9","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.1","@types/lodash":"^4.14.189","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.290_1668834864322_0.3484553063877305","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.291-renovate-typescript-4-x-6d3636eb45ef60a525008da789a5f06bc06b2330-1":{"name":"@balena/jellyfish-metrics","version":"2.0.291-renovate-typescript-4-x-6d3636eb45ef60a525008da789a5f06bc06b2330-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.291-renovate-typescript-4-x-6d3636eb45ef60a525008da789a5f06bc06b2330-1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c42b5df5217f6ddb9c4cc8923abd52c0a6e2bfa0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.291-renovate-typescript-4-x-6d3636eb45ef60a525008da789a5f06bc06b2330-1.tgz","fileCount":17,"integrity":"sha512-rdzB093Vb1V6agRJccjEuBhVXdP1nIhukrys/rEtw9cFMs0s/JhwOsCbeP8CaXqfoV7x2y+wtrdQFK8bxLAUZw==","signatures":[{"sig":"MEUCIE0KPK8Itbz5s6KeEsK74t+2MqX3L4VOCAOAxiAZRa7RAiEA5pn3ebKhOn2PrHVDjTMdB3t8oLk/FIC3RhVVZPzKwQQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68122,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjeGb6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq25xAAgrpJ36Uebjp3lg9oWKYF6G7+ZyF8jc4E02ZP1d9+DjoFp9jb\r\nshnl0/ab+/D8i9xcC1W0NmC3PJfHFduP8gNmV2oxzEUjarZYpVUmfPG85+2F\r\n+XgAyiLiJw6Nu716R5ck/y1HQzzBALvegeHYuWxra/xhcF5L0Garj87pZh5q\r\nDCMkxtRmHQEJCdWskv3kRp2VKybzVU44sc1k9h77Xgx92l6q6twVzS+D++Il\r\nyjIMNZscOi/3b4Jaokfc3X2XNVArE6ICyFjciu55Apyo6MCGnURnQZpihHNF\r\nVT3I4ATSjDFmyAtWN5IguWQXgvVTymxLobmhbGnno3zvJJCPyJHwwLBpylFI\r\nlf02bvTvwZkB2AuHcxDtAeYqWhkGjYm0kmEPnl8pI//sCtKPeUwIHcricL+o\r\nODAmTIGScwn2zhQbcLnXor+HgRVZ/Kod2rFg51dcX1kMuzhq6JIqoMmnXXbX\r\nJfuEUERAa7CZf1gx83qlQZ35hjPrpvKwKg43DEX+z9Vmf/CZkxUnRx3M4GVU\r\nNd4f+0FqvVThXf146jhA2NLWk5iMOZ8Agc/bLPLiXZQUkwDXlYHnPMbSM7EM\r\nLhK0RYaZTrZ0wt0v9vNzhZL+BCs/gRkdAKCrrJGRBca3YyARVLCoB5L4KrhL\r\nmCQZZx0mO0EtMX/wfkWMBGeJD3k7RnaA8qE=\r\n=KV0g\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-6d3636eb45ef60a525008da789a5f06bc06b2330-18.x/balena-jellyfish-metrics-2.0.291.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-6d3636eb45ef60a525008da789a5f06bc06b2330-18.x/balena-jellyfish-metrics-2.0.291.tgz","_integrity":"sha512-rdzB093Vb1V6agRJccjEuBhVXdP1nIhukrys/rEtw9cFMs0s/JhwOsCbeP8CaXqfoV7x2y+wtrdQFK8bxLAUZw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-19T05:16:10.616Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.10","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.3.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.7.1","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.9","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.1","@types/lodash":"^4.14.189","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.291-renovate-typescript-4-x-6d3636eb45ef60a525008da789a5f06bc06b2330-1_1668835066424_0.4482287382453174","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.291":{"name":"@balena/jellyfish-metrics","version":"2.0.291","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.291","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0136a9ac5570a4e27b0df6b40810151c310d733a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.291.tgz","fileCount":15,"integrity":"sha512-/xsq1zJerIKfcf5aDBbBjHgZyDVQ7PZGhoBddByyF3GqH3d1teIOJsUzHc4QrDWIV7qWVMvZwwxw9s7ZzUz6ng==","signatures":[{"sig":"MEYCIQDXAp4eWE+I3PdB8DRxb4c+yTuj3KjGsQW1wwUG2LAVOgIhAL2Dn3A9rcbbwaoAvE/EB5fdBTjHx2xehgFLLOgVEE1j","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68055,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjeGeJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpDcRAAmIAq80RdQLeuUHAuJ4mHNVsSeLf8aP4bcuh7Wkk3oXCBHSZ3\r\n2rermE6krOpK5Z/w0ZXiyh1qcVF4cLsMk8oHwBmhPCEpS9Zem/AcEXAsclcS\r\nLkw9+z5ny9f9NdRMwaU6gJnZgz8qrJW6Ws1BWutyi9iiFubB/+2Ut6fWpTu0\r\nKS58JK7u57E//i+Of9wfA/6uKSjNS+PeZo7lbXU92bNHYsR1gYaGt3exel4z\r\nmS+K3WPsrLIUmUzk45W8zuT+SiQQ0ggFnlGVJJ1kikiryxja0h6CPWhZog2D\r\nY+c4D1D4w7GFy7rvde/GbREK9Ragev+RpsIOmjNVM8m+p0WZ8uRcoEYyYG/P\r\n4JFM4Z/nXZZow4s8JHpEHCKuGtujRf3k2QLENEMHLNh6rBPhWzgvDiyIM2lA\r\nOEtZLdqOkj8qIjLvzm/Z4x+5Gq3R3sN+lVXXIckEmziEItYkxu8gDVeyrH6w\r\ncyxsYM34pX/m2Ohn6f9etEqoJx6TJUW02HVsMExSIewxG3Qo8EitgHe8cGR4\r\n57iQRqF3SrtXbVpB7NlByVOyFPKm9MTRATs5LTCR0ZAIlG5q2U36hZSkt2r/\r\nohTyDdVHap/lCE5zkMW3ZOxBWqxyjaLogp2bs9Y00VlqvaggjnJ9TmLzwlbM\r\nC+FDWKTCGEY7ha8wlhS7iAk/FmF05DCJkjo=\r\n=IiDi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-6d3636eb45ef60a525008da789a5f06bc06b2330-18.x/balena-jellyfish-metrics-2.0.291.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-6d3636eb45ef60a525008da789a5f06bc06b2330-18.x/balena-jellyfish-metrics-2.0.291.tgz","_integrity":"sha512-/xsq1zJerIKfcf5aDBbBjHgZyDVQ7PZGhoBddByyF3GqH3d1teIOJsUzHc4QrDWIV7qWVMvZwwxw9s7ZzUz6ng==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-19T05:16:10.616Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.10","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.3.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.7.1","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.9","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.1","@types/lodash":"^4.14.189","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.291_1668835209717_0.09566855950175768","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.292-renovate-balena-jellyfish-environment-14-x-31b47de2c95e06873d7623a7f639b62e24f22907-1":{"name":"@balena/jellyfish-metrics","version":"2.0.292-renovate-balena-jellyfish-environment-14-x-31b47de2c95e06873d7623a7f639b62e24f22907-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.292-renovate-balena-jellyfish-environment-14-x-31b47de2c95e06873d7623a7f639b62e24f22907-1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"aeb921fd4808179a847ec4f6c9fdd3cc3d21549a","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.292-renovate-balena-jellyfish-environment-14-x-31b47de2c95e06873d7623a7f639b62e24f22907-1.tgz","fileCount":17,"integrity":"sha512-aQCVjfoVK8k1Ex3oFJHOEHTZ7IgXsbaTN0K3ygJHx6SmpHujojwFwhdF+sDeLhbOojuHIeta+QdZhRUaMXQgyA==","signatures":[{"sig":"MEUCIQCXOsJXF/tZBxmlCZBC0/boZrAAk+j8MPVu7gATPRblkAIgXma7DOiBevorNLu8CdCi8g1hK2913zaA6OItp4NqqQU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68141,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjeI8SACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqi8Q/+I4Rld9H/AuXFtWhIEa30CUeVo/GqPz3XKBWEjnoVDQKao6dz\r\n+cATLz7a1TsBpg1K+WIu8ysi1qOPkruum6JUzbKdeEqkHcATufdmXe7WRq2r\r\nEZyHEMubi7isyDZSuPy2e4Egn/PRYizBHZQiOcmowlUFHDOZzLbC16oGb4tA\r\nSOCL55xJqXvWrL3d7aAjxK+HcrR0SJ4U6BQfMk7zz4BgXdQmNF33TtCSkKP/\r\n7Ghckx1/aumCWVueB1dWJAe7UTfOD46oAKWiX7epwhyZ9XQWzXiuaiPeuhHV\r\nrhrV2zLucUbr7IkeXaUv7xXu/vhqBfyQYMCrAhERsZhKlpzhyyd00lBhgial\r\n6nISyJN10zQRDmYwnieYVZ162yftQ42is+vaEcy9YJPXQcQsvx5W0vsYWcRx\r\n95SQ4Vl5kVGdeLgHU/pujGJrd00snOQ4Q9+ylmGHAvfE8LhqHmNmbRCmxvZ/\r\n8d91duB7vWV5TkhSnfLlVoTEWEdmxyurgdelVJrHyOCIdHcypgKbYb5pJF/G\r\nN/G4zBU0whELKxMNn9sYxpK/qi+spN2RFfHr6lbgMocEAlKKGLLbD0z/kbES\r\n9XL8pTLaSJhndvXptrnERKmxYDOEe92rBEjv/LRWheDWb4m+PD20KzAaiptf\r\njgpNRHYk4QSvc5JquDh9A3XRQ16J7R8xlL0=\r\n=YOZd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-31b47de2c95e06873d7623a7f639b62e24f22907-18.x/balena-jellyfish-metrics-2.0.292.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-31b47de2c95e06873d7623a7f639b62e24f22907-18.x/balena-jellyfish-metrics-2.0.292.tgz","_integrity":"sha512-aQCVjfoVK8k1Ex3oFJHOEHTZ7IgXsbaTN0K3ygJHx6SmpHujojwFwhdF+sDeLhbOojuHIeta+QdZhRUaMXQgyA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-19T08:07:24.819Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.11","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.3.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.7.1","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.9","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.1","@types/lodash":"^4.14.189","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.292-renovate-balena-jellyfish-environment-14-x-31b47de2c95e06873d7623a7f639b62e24f22907-1_1668845330383_0.7720556147182522","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.292":{"name":"@balena/jellyfish-metrics","version":"2.0.292","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.292","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9a3adf2392ad70d34d9b1fc8f1094a9fb264bb24","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.292.tgz","fileCount":15,"integrity":"sha512-efRF4SdkeJx344XYBDU+lWEAFvrnZAtW43k115D+j3RWkNFajVn3TQAYmjF7av/CmBh1n4W/WmOgLE2BVIIj1g==","signatures":[{"sig":"MEYCIQCNWDwscIA9kWOh08Lvps/juR3y/wROE5NWFE2ityuANAIhALO4W63egcIry+LXZ8W1Ice0iU8etfp1F1a6oa9aqT60","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68055,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjeI+kACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr11A//R/oSMILrd1FuYGyjsIUeLB8NZE+NtHPbuxEGobTbk92qwSwT\r\n3btr+UQJ1B/RRcfuzdhicyRccFkJ5w8VgeI/MQUjDVgQdZN5KgO4gN4Staa9\r\n9lhCoXF2CR9qh0/b3jhpULXxY+ozKpSrhDB5LXf1IXS9P2RtiXhHPcIN239s\r\nKFCbCre7INtkNrlxFeQM4ZSxnnE2kTQOp/apl9ngqwZzq070MJC3ENxxBNfo\r\nGPsIhGaVFNTym2Utyr2wCbFmzdcScJcQKZyGii0/0CdL9b0GDZ0dPcLD/rhR\r\ncmLxR7+TzdDKousGFOg+VtkvQ3srijG+3CYg0kfe9dB8c4mBBDI2YKudsR0s\r\nS7R9C8p7ZdvIal03DQMUTpxbjdPE5+sz1jTA2TbHN/fd1emW2CVi5S+P8DiH\r\nFbDzBZp1ZOriijfWccyXnZUEikK6a3yrznA7cMxqro61ANohd37VJpsf7zAo\r\nMPMb5kj3zLUy+BDdq0+NXAb3QJot8sbIJ6SvktKbc5EMVlIo7F0LttQRfT15\r\nDe4epOvz3VmZTDRWnjVBAKeFntlzAJdTpL9LMOm0eBVkjgP6KLfbuMAMtcAP\r\nry3P88ff9XxV1uQv3tt5H6ftdrPsogGw6wORJHgjJm7fbq7UBGrTnton2MFA\r\nEAVl9gDYq/XrE0BXI7W6ejL1SQMLEDx1GUA=\r\n=DqDg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-31b47de2c95e06873d7623a7f639b62e24f22907-18.x/balena-jellyfish-metrics-2.0.292.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-31b47de2c95e06873d7623a7f639b62e24f22907-18.x/balena-jellyfish-metrics-2.0.292.tgz","_integrity":"sha512-efRF4SdkeJx344XYBDU+lWEAFvrnZAtW43k115D+j3RWkNFajVn3TQAYmjF7av/CmBh1n4W/WmOgLE2BVIIj1g==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-19T08:07:24.819Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.11","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.3.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.7.1","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.9","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.1","@types/lodash":"^4.14.189","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.292_1668845476075_0.08758376908675447","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.293-build-renovate-lodash-4-x-41c4789d771eaee5e7ff3154538bc4536c07ee2c-1":{"name":"@balena/jellyfish-metrics","version":"2.0.293-build-renovate-lodash-4-x-41c4789d771eaee5e7ff3154538bc4536c07ee2c-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.293-build-renovate-lodash-4-x-41c4789d771eaee5e7ff3154538bc4536c07ee2c-1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c1eb09e4b5fb71a7815dec7ecb4be923df7b1419","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.293-build-renovate-lodash-4-x-41c4789d771eaee5e7ff3154538bc4536c07ee2c-1.tgz","fileCount":17,"integrity":"sha512-UwiL227eCXinRQp8YtD00HnQO5+yxakRMZkKcsBMqfvsXvuRwOPl+tTEwjJBV9JZwdDZmGao4Kr+uaohH/xlAQ==","signatures":[{"sig":"MEUCIDV7Zm+gcoV8Q1TZzgIpHnx5raJmrxzmctN/S6UlWpbMAiEA9fa4d02abgOLCE+I5XncXjKcuJiHQ1wigO56RYSWNAI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68124,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjgWgiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpI4Q//ertpUiJuxmRdytW8ALATUY/KoqkfRsH+mxKr3N+AeNEsegMt\r\ngIO1vT7TuCsYc4xZKbTWfmCQwFOrxg58xh2uScaNfcQojy7h1xOD5SEW59/5\r\n0VqOHMpixp8TzeK1FzXDzZ7i9HKxHeEYdw8/Sydy9pPvfzS+G6jJ/e6q9gH+\r\nafYArLlGZtwpCETAx41/7r/dVki9YmeEwOKcfxgUNE/GCUT+IlMQRws/KFpp\r\ni83iAUrrQXqIjjnFOdMF755lqRTcP6jcVO9eNrIQY0hCgM2SW/2i0DJEdhHo\r\nJU1f3KM0aN/57KpAt4wnFwxEK20E4J6IRz5ZlbUSRykPx9jofsZYZdc/A3Mp\r\n2oZnXGVcjw8nqi630dIWpCmaA4TLAHAW2zmpoNqWU5kXd7hiFPgEQ7X5tjaC\r\nRX6vxNwFKJ2z0hD8UjY3fA43HOVO/7FBqS5/kvU4pggTk/98N/OEnrMWcrBf\r\nWgb4FjcoCjDkejlZgo5yGrbO9tEg61kGqAUZkB8T/nvdrzNYTzjs9NP07wQT\r\nBV2AuCqVJFM5hsfQARZXAqSOZVvFp45IHe4nKLIVbmr5ZjvZjiz04gP+vqGM\r\nZbejd8jg0Bu5pPg3dsnoXb9TAFoOdpSmci1Bkz55QvgOio2tVco6FAu8eme1\r\nqEucYj5uP9G421xg6FaEuQU1OTC+s+OYRxQ=\r\n=cVpu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-41c4789d771eaee5e7ff3154538bc4536c07ee2c-18.x/balena-jellyfish-metrics-2.0.293.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-41c4789d771eaee5e7ff3154538bc4536c07ee2c-18.x/balena-jellyfish-metrics-2.0.293.tgz","_integrity":"sha512-UwiL227eCXinRQp8YtD00HnQO5+yxakRMZkKcsBMqfvsXvuRwOPl+tTEwjJBV9JZwdDZmGao4Kr+uaohH/xlAQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-26T01:10:38.336Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.11","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.3.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.7.1","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.9","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.293-build-renovate-lodash-4-x-41c4789d771eaee5e7ff3154538bc4536c07ee2c-1_1669425186233_0.676882778618239","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.293":{"name":"@balena/jellyfish-metrics","version":"2.0.293","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.293","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4d15f54205ee5e7090429c7e36ac1431cce10557","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.293.tgz","fileCount":15,"integrity":"sha512-EbFhLNISBUO/KcWeAf1YB1lapcpieZ+mfMZe2q0VA2TYZREdhg3lB6il8cxr3ZMktzeorEh2TfjmDrO3iVk/Bw==","signatures":[{"sig":"MEQCIA45eaw5VmWQoQqYrEXNe1SF1IKkOYCGP2NOljReCb2HAiAIbpTIskfU5YgeB1Hv3OUMfCvlnqKPK5yhATByMXFORg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68055,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjgWi5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrGFQ/9ELGa8k589ltcrSivhDKO4WBgoTOvj97apeB0kqqmdxpKRkvR\r\nBvhjuFAwPbzXlUwL2DRtMljxac/nJbvTik1FZn5/fhEwAw98J2Jsbi7e7Jxp\r\n3zJCksAuP0rTKAVGiXHEs6TmGLCMRd/RkxOwVAyUcDj1sB6LhamwGESgveuo\r\n+FAESGLGijhUOMdXE9wexamYBzkxBMxh96p7dwu09xZ/P5+wJ0OfYQGrgRH8\r\nmB/RI0FdXxsogI17+qnAi5SQ5oLtkZIJt4VquD7KPGboVBxs8pExVsxPyMri\r\nVL62ckr6iYzX7z5KhxRHGPbb43qrzE9P8bHx4BMDMQszaaiuiRFrE/2MSWw5\r\nTN4O1YHnSlShpbVkCGxIdxB4aJKvM6J3/J88WNpAasddcQET7V0wc0U95Ebu\r\nTVe0ENDrG0i9mbKcbUqEYCQL0R2FQON9E1fr9he7WmBH6gzVczWQK0lpRfw6\r\n54EiTgTr3AHNlTlQVz4piTqAYhMMYhA0HpiGhAbV3071xZbnJTslowUB+piS\r\nNvXG/n3Vh2x3tYJo5LjdbUZUFNo+HUC91JuZOySubKzdPSHbFBrxjhPxnkyl\r\nD07nsZ7b3KiD3e9OVz49uaoDTT0iaTG3PrMKWJ0kPXfw6Q7+E89Y4NaasvY9\r\ng4Kx249D3nUUnWUesHi8M+I1PBA+OErg1PY=\r\n=E0uW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-41c4789d771eaee5e7ff3154538bc4536c07ee2c-18.x/balena-jellyfish-metrics-2.0.293.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-41c4789d771eaee5e7ff3154538bc4536c07ee2c-18.x/balena-jellyfish-metrics-2.0.293.tgz","_integrity":"sha512-EbFhLNISBUO/KcWeAf1YB1lapcpieZ+mfMZe2q0VA2TYZREdhg3lB6il8cxr3ZMktzeorEh2TfjmDrO3iVk/Bw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-26T01:10:38.336Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.11","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.3.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.7.1","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.9","@types/uuid":"^8.3.4","lint-staged":"^13.0.3","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.293_1669425336839_0.07339057782659442","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.294-build-renovate-lint-staged-13-x-d5948edc4f1e29f2c69f1b35427fb121286b379f-1":{"name":"@balena/jellyfish-metrics","version":"2.0.294-build-renovate-lint-staged-13-x-d5948edc4f1e29f2c69f1b35427fb121286b379f-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.294-build-renovate-lint-staged-13-x-d5948edc4f1e29f2c69f1b35427fb121286b379f-1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e7b19d73513a51f3cbc33c6803defadea2400097","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.294-build-renovate-lint-staged-13-x-d5948edc4f1e29f2c69f1b35427fb121286b379f-1.tgz","fileCount":17,"integrity":"sha512-GEsklXt1eZ2A23R4igC9pn9YVZ5V41MTGZNR5OcuAaX5m6PmO88M1mTxvAXOHwWrndFdD2UrA65qDcHQNWlOXQ==","signatures":[{"sig":"MEQCIB3k77pq9JUAb+pRwMw/XLQh6E+EXjvMMH4tFC5HLlaQAiB+svQafHyeVmJducveW7p8mftUuvSkWdXuOPYO6lQ01A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68130,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjgWlzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo1JA/+PyBzrLTPh3jrL2XKI1Kxd9dSA/OUC2rmz0L55EV2x5Fa3LJx\r\nnrtz1OMC+B84cyW6a1Posb5oZaV6Rr9Gw+WmGaKkObQ68u/H1OeDXgQVoLWu\r\nJCM5mVbIfu5HG+H8Bj65EIYwC7yixxazFC6McaFosDgl9rQmj3NqE7QI7lnJ\r\nq6yHp9i4xZYoQh5NPGAyBnSttZDjfL/4BhWPyixhnvYcGpw8dgJ6O+8HIPDI\r\nwAai7ZBgnSnlB/pjFUPE/Nppog+z9uExIr9A53EvpEHJtznO9J5vOHy9hSdk\r\nRqJa8AHkiaphJGs5tyFRqTT5b+hpFhclb7mwqo+g48kIdeu0CyAbkgBLHK78\r\n6D+yA5tFxOaLIiTR/2hcHFOvKcBAzhgZwkT+USL/F5ltVfeK5i2wEPnNJzDc\r\nqcZ7wrKbBuhfP4QS18kFClRRElmqSK2yPJyfKZIFd4WgVVRzOjtQA0FzjlM7\r\n1qR5W30zTDYX5K9Sctl9MUQGLhqiRxzetK86CptV6VZAbKWk+8sSIyeK3c1H\r\nS749qLrs0V0WOkE3NGshaAd8aUS+rbVNXmrNL3uF3rkkonKvP10SrkgWuP9d\r\nX2PeaRqKlIoyogprhv6UOSeroFpZ4xm6vJRlyJ9HzvkH2TgcGTmIJmScM0JN\r\n9wpeKXhapizVyU6IwOUk1hyQE26fpTnP8uI=\r\n=7Pfm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-d5948edc4f1e29f2c69f1b35427fb121286b379f-18.x/balena-jellyfish-metrics-2.0.294.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-d5948edc4f1e29f2c69f1b35427fb121286b379f-18.x/balena-jellyfish-metrics-2.0.294.tgz","_integrity":"sha512-GEsklXt1eZ2A23R4igC9pn9YVZ5V41MTGZNR5OcuAaX5m6PmO88M1mTxvAXOHwWrndFdD2UrA65qDcHQNWlOXQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-26T01:17:17.401Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.11","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.3.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.7.1","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.9","@types/uuid":"^8.3.4","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.294-build-renovate-lint-staged-13-x-d5948edc4f1e29f2c69f1b35427fb121286b379f-1_1669425523310_0.525955220333912","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.294":{"name":"@balena/jellyfish-metrics","version":"2.0.294","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.294","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"eb7afc44ab79be7b1ba71a7a7477ce9bc2d1e909","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.294.tgz","fileCount":15,"integrity":"sha512-M7Vl9s4e6YX3F1yK3/c/Ml1EiuyN4se/mds/Jz0LRasZ3UK6uXVbsx68zS8HqpizMzgdlhbmyRjV7SvZxIenug==","signatures":[{"sig":"MEQCICLaxCz2A1V+FW1OS+WQWzds78/efA4TsRM7h8K85igAAiAHVMUjWSsg1CnjfwlLOuvvKka2ACIAqrBAE4UaWlLptg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68055,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjgWoXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpBaQ//Y5QbRiTGAgM1po8e0RMPx8daqOnP2kUPhXSZx1zNY5VvHOTp\r\nMWBhzTg0Ovn60KozpTHWAStc7v0vUHDge49QPrmLqtk1TdKPpDK0A7LYa+6m\r\nQWp/2yzDk4eGo2s8n7cm94bbQhCPysjJ94HsYfxQCa0/nCGplsAPgJPoAL6R\r\n7HtOGV5gtFLvsPCB00292lChTMFg8OEqe+7kelsQQnSXpotwbXQapcu2PpZb\r\no/cwymNq9DFWOWdTkAzPveNuPzv7bElnG64qOaDhi4LO20zuaJhMKq8tMc/w\r\nawGJSmKY28FwM/Akcp7Mt2iQLH5Fk1rZQWGztOnQRvd7njEc7G7259GcGq2B\r\noT4ITndTWPGCR8jECFnZOuqoNGHg2qfzAt79YacebOGHWRsffoKSQwqIB8jd\r\npNEDIIA/1qPLbxFis9Ru3PwpSfJzZ1k607PDeZzDudt9JKblK65zmmrGIDbL\r\nPqorKOFcjw3RAM/IjUToB7kf7VG8fbTsp2PKFEwyHf/wYmNPHErA+azXOYKT\r\ncY+wP6T8bu394EHu6wsDvxG5qfvPOeAiNz2EWnT7eDj2WiXctInCgCK/XvFS\r\nQo5kfLsrKaHY8c840VYXDYyz6z0d2aPfvwEtyug2ypAF8cOndyTNhVDVTf3Z\r\nAPCjz3QHn7tKMvW9g7QRhWo17Z4bSsIvG9o=\r\n=ZNGo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-d5948edc4f1e29f2c69f1b35427fb121286b379f-18.x/balena-jellyfish-metrics-2.0.294.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-d5948edc4f1e29f2c69f1b35427fb121286b379f-18.x/balena-jellyfish-metrics-2.0.294.tgz","_integrity":"sha512-M7Vl9s4e6YX3F1yK3/c/Ml1EiuyN4se/mds/Jz0LRasZ3UK6uXVbsx68zS8HqpizMzgdlhbmyRjV7SvZxIenug==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-26T01:17:17.401Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.11","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.3.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.7.1","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.9","@types/uuid":"^8.3.4","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.294_1669425687342_0.9198534502101516","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.295-build-renovate-balena-jellyfish-environment-14-x-8a681202a4e5bee93049d1202296db766f595362-1":{"name":"@balena/jellyfish-metrics","version":"2.0.295-build-renovate-balena-jellyfish-environment-14-x-8a681202a4e5bee93049d1202296db766f595362-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.295-build-renovate-balena-jellyfish-environment-14-x-8a681202a4e5bee93049d1202296db766f595362-1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"3a12fdfe94a20b838c24189d3bc98d4ed1441172","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.295-build-renovate-balena-jellyfish-environment-14-x-8a681202a4e5bee93049d1202296db766f595362-1.tgz","fileCount":17,"integrity":"sha512-b0eGOQ+q8w33a1ITuWVdGnQSbovJT/LsFSkBowqZX/Jpqtb13KQ6iGBJO6o12PqnZmvVQ1fv9pPnnSCMKawyvg==","signatures":[{"sig":"MEYCIQC5y0KnaFLWia2DQgHFWNkbMrEbXbUEoETbEGoYmAj3FAIhAO9R7YA+15z3HZOcQqCccum91Mrezq40inCiyg4TaPTc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68147,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjgYw5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrcRg/7BuW1JEYS1fPFygTtxyN7q4LAxrbfkjGbh6XOqjjqxqEvV2cf\r\nryEu26BAYdVUXAw7mux4ombJTPhzjK1pxOIB1Ih414vdwAEcmVuhMLVmDcNQ\r\n2cWOP7o+sJohBfzdNsJ5Cfk+pqy4o/CWZ195sQVmifePspE6Bys0aPit+TrP\r\nnnuAg0BmlspRN8ZHn/HJu+jEMWZ9So9HvTUTet5KypF12lBbmlMGIb4W3VoX\r\nhnW/wQ+ZfADqhNyTxh6Rx3dqxsELBtiaDXsPkOMBHehzJLxMJ8B1yL00Z5Ol\r\n4jgaIeR4GnMq4UNV5hOnoFFgM+91Kv2S7QtP8NmiSmIuHWPyclNGlkoJA6zg\r\n69DLZ92nsXwbmCeSALT7v0cD/HO9GS9OLXGDSuTFeJ+hJcFW5vAjOVXQvpBK\r\n0o9170C3xUkP78VX1r52sjWi4JbEHl3n5IyvPG62qkTQ4VrSfsLdNnOrSUSR\r\nKAp4LMNplkVKPOLSoxiOApQNj43VsW+uMkTNH0lvpV/cP1EQJ5D+Ibv1FSmK\r\nlF+FpXE/Tp4kLg91+yjuj97jIGSMeG6C1kEfGknb24P6uBdmbrCUAd7OsxGG\r\nng0iMleeOtM0p2bpKYad5mRr9jQREDzBBYWvcRS4ZyAhOSaw7aEP/JTedULZ\r\nUUFZjZGW8VkmaQky3hCBMWGIgOw9cIhqPDI=\r\n=y6ax\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-8a681202a4e5bee93049d1202296db766f595362-18.x/balena-jellyfish-metrics-2.0.295.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-8a681202a4e5bee93049d1202296db766f595362-18.x/balena-jellyfish-metrics-2.0.295.tgz","_integrity":"sha512-b0eGOQ+q8w33a1ITuWVdGnQSbovJT/LsFSkBowqZX/Jpqtb13KQ6iGBJO6o12PqnZmvVQ1fv9pPnnSCMKawyvg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-26T03:45:39.490Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.13","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.3.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.7.1","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.9","@types/uuid":"^8.3.4","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.295-build-renovate-balena-jellyfish-environment-14-x-8a681202a4e5bee93049d1202296db766f595362-1_1669434425403_0.0042732983080133735","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.295":{"name":"@balena/jellyfish-metrics","version":"2.0.295","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.295","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f932e638fd4dba1ddc017079fa2c5c0b6c846fea","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.295.tgz","fileCount":15,"integrity":"sha512-JGiuAKBnnTD/xMLuAceokAZ5J8djJbwzhXwcMhQDcPtsW+8oTYoZrCBk3ODSbBHWZ51H2OEki6Pk4gAf8g2OJw==","signatures":[{"sig":"MEQCIDA17HBHlxC3Hvu2MdcfIlrIEA6prYdwQSjWKn8+8wTSAiBv3HGsW9im0wfrVkDFMaQbKKEyBDbIRNvAxSQyGed7RA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68055,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjgYzWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo5xg//Zx03IIviSSSTqzEQazYjRA9kWM/Ias+fbvPxGVRLxW2MYg2p\r\nmKeWHfaV3LWNog643CSeHtsbsq6BmDg9YnmGAgiXEYWfROEgHPt1W6o7Nv3J\r\ndEet1Bu7iVKd60B+7GXEVrNtQg0mw1yFJ8OrSamYIN2ot1M1Zyt6MHovZJKO\r\nN/ZH0FkcyRmtoozntVv8HLq8BJ8lpu1Gk+2F9/OntfjvMHaZQwUc66sA8E1V\r\nOrZYMuMUTaL3/SNP3DCBLgpi/OZBU02uPhYnpaCX9ELSEMWoj+MaRMh0XO9s\r\nzORwJ7OVMWNXHns3cye5P1/VuFee7uopZDdXQCFIStcuLKdc+zQ0R/sS8Lpu\r\n1lOCr9W5y6KunMoVI00DAxhs5hJkaqq/mReiLeoSfwnlnfN4XMS6Z++ttin1\r\nvezQYhjIKpQpb0h+IwJ70bfe2DpVxnRRRtsZte4nXzU7yd4adLNwBgzhQ3P9\r\n7Emi8ixrcVvny9UDpCICLp3qGYfT+0J4CadP2zPkCTjogEnkYMnggnrj01S4\r\nKxIMxBz64ovvoN0MXplFBIdFRiDwsH2N8WIGFVhb9m7SaEhWn3b4699bP2MT\r\nakzKfu6lukDV5JudadE54xwEKkzKWDFm8ff1XB0y05Y/dyVwC4QwaoOEsShD\r\niaMnXAAiJy39scKfFvbR0eWBbwNjJhm7/84=\r\n=1NV0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-8a681202a4e5bee93049d1202296db766f595362-18.x/balena-jellyfish-metrics-2.0.295.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-8a681202a4e5bee93049d1202296db766f595362-18.x/balena-jellyfish-metrics-2.0.295.tgz","_integrity":"sha512-JGiuAKBnnTD/xMLuAceokAZ5J8djJbwzhXwcMhQDcPtsW+8oTYoZrCBk3ODSbBHWZ51H2OEki6Pk4gAf8g2OJw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-26T03:45:39.490Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.13","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.3.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.7.1","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.9","@types/uuid":"^8.3.4","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.295_1669434581851_0.19546272892165328","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.296-build-renovate-prettier-2-x-4cbc730578cea5988ce10c8ea63621631d8d0e26-1":{"name":"@balena/jellyfish-metrics","version":"2.0.296-build-renovate-prettier-2-x-4cbc730578cea5988ce10c8ea63621631d8d0e26-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.296-build-renovate-prettier-2-x-4cbc730578cea5988ce10c8ea63621631d8d0e26-1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"6df83950fb038911f3a49bc41b9877fe46ba10f7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.296-build-renovate-prettier-2-x-4cbc730578cea5988ce10c8ea63621631d8d0e26-1.tgz","fileCount":17,"integrity":"sha512-2crsopXnBO9Sh+eyzQ4AoIkP879VJXx06KuHOR1eU3f5zK3L5A4qvS5ESWu0y4LlZk1HhzWkewTOLasFojqsew==","signatures":[{"sig":"MEUCID154ELFO5eTgXJDJevlSMFLKrDOQ2/IuvMPGfLC5eyoAiEAyhoEuTF5DdaacQwMRfbRKwFqy5DHJT3zWLYPt9HcjPE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68126,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjgY2MACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp0hA//Uq0AVXk0vAA3qUn3Nwv2bXdIAg6V1Mn1Ydg/fz2VqG6AtY6d\r\nrGGa36fcrPX0d72gFPXYt0EvCEHQjp776BiZGieizDuywRsTzI6jRxZPSukh\r\n0SREATsLYR4gQ042uHtGnCiNhPEyewLGu88Xp0AOHrpBi25F6zvHxpTQZosw\r\nsFjEXpPddBJ3eatS2v+flXx69PHrWYChkqxBJxXDeKHR7mG7bss1G0Ht8g9I\r\ncEeYBtQweMeXHdXB2rBVpcn0Bzcm0OL+dOU2xxFOWezD9SRe3rOci6jGnWos\r\nJioSbbpUh6nAGE3mHQd57V+iC+ZziNRg4YKob4GGlsExLe5jdi3LmcRdlnwY\r\noJdGMTZXn2WGQo0b+zoi0+eePSTv9AoGN2xsF4HS+kO3wIfMEtvXTKolsjeh\r\nXPJ1HGhDQKdXTFvZEoaebLxas3qdaNLusx+tDShEi6Ydn2GqUwqU9YEFyFw/\r\nTsxrskFsVwsAJQ+ZtnHd4z1n0tb1G2F9HW88kA8saSaklWiJWDUW1d+4gUsn\r\nSB7kjz7JOCbE92oPbVapAdW9olrSpSrNQKbJgu7fc7BjPa5ajWM8UigHV1k3\r\nktXN55PQeLK6UWzp1zquxFRZbBnUvHOkNCJq5QjnOFb94abm9w0Bug/g4mNB\r\nur7E90X0ieSADG/TqhO1Xki1ins7JVRpm6A=\r\n=IoaQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-4cbc730578cea5988ce10c8ea63621631d8d0e26-18.x/balena-jellyfish-metrics-2.0.296.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-4cbc730578cea5988ce10c8ea63621631d8d0e26-18.x/balena-jellyfish-metrics-2.0.296.tgz","_integrity":"sha512-2crsopXnBO9Sh+eyzQ4AoIkP879VJXx06KuHOR1eU3f5zK3L5A4qvS5ESWu0y4LlZk1HhzWkewTOLasFojqsew==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-26T03:51:17.026Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.13","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.3.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.8.0","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.9","@types/uuid":"^8.3.4","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.296-build-renovate-prettier-2-x-4cbc730578cea5988ce10c8ea63621631d8d0e26-1_1669434764421_0.02526920865517468","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.296":{"name":"@balena/jellyfish-metrics","version":"2.0.296","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.296","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"ad00d9afe02b6d9407c158766bc0e3802cb58f9f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.296.tgz","fileCount":15,"integrity":"sha512-Y1k8jo3qhkDtmzWzwnofr1A3y3Taj51VBXYwUXT1gAp6AmAnTD4vkT/VTeAxWLH3Q4DWESrHD7qHcLTS2kns3A==","signatures":[{"sig":"MEQCIFIVUl65ihUVrY67dobTKUwbHSg/HAOFhedvAVESSu7tAiBUrKd4igLhTu66iaEGz+IZbSAPLmV/hnN6IKjnWcXslw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68055,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjgY4gACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmraUw//YIVObZ3aU64ypScNAAtY+oVR0kxRxoSozOIKbCOd3pdyXTI2\r\nb/3GFeIfJmKIDxaHJKhL+uwOd4PJKo3XjBN+DjAay97NsHfk/CDoHgqIFUdv\r\nwSFkR1G8fc1aorKHC3iBdiMwu16ZQenyvz9XiCorwbb8sUp1j+3Uk5H+rSec\r\nrjdoVfd6jk3nJbMlb1P+QiwNVtiYMxuHSZ1oGQvtSvfBx18BLI42dQAtujz0\r\nn3sJRz8jm1IIuT8tJvc4yC3kVph/5R+ewLX/DlXayOKQB/bpBwxTk68HHYYM\r\nH8mgBxfWvgVaaYtP8tU3HHlBCUnZhVqoP8hOv1HC22D/6gz4dQgFgRmwB6DK\r\nSynKz1vJatqWF1rwKFk8saJtsB9t9E+W+G0NJa3If3E4Yw88OWiCslmD3LyH\r\nV3BVbQWThEfWJCBaTBDlvbHEha/aOETfFzq6ePDz+E+WX+IzC254jV2DT7dW\r\n5I/rRWmes7at+MJ+1U+OjVUPrYNxDb0AUml+CsxNRXWwR/+Fl5Rmlt7vFIiS\r\nHE4OHLuGYWhm7cBpAoMGHJF16ZbybHS/DHh5C00SFLx5glNUcq+Vb3/9kQTU\r\nxA1+I306mqhzjVt58cSgwI3U1Uf996flI9YA9ZOFR9w31Wz13dGP+cVVXZcw\r\nLrwrwFpxGpxUOix6m3OiVxET608tACF0jAQ=\r\n=6EQS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-4cbc730578cea5988ce10c8ea63621631d8d0e26-18.x/balena-jellyfish-metrics-2.0.296.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-4cbc730578cea5988ce10c8ea63621631d8d0e26-18.x/balena-jellyfish-metrics-2.0.296.tgz","_integrity":"sha512-Y1k8jo3qhkDtmzWzwnofr1A3y3Taj51VBXYwUXT1gAp6AmAnTD4vkT/VTeAxWLH3Q4DWESrHD7qHcLTS2kns3A==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-26T03:51:17.026Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.13","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.3.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.8.0","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.9","@types/uuid":"^8.3.4","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.296_1669434912445_0.5224318698044801","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.297-build-renovate-balena-jellyfish-environment-14-x-eadcd9f5cb7b9cf745d7da089a2b18e7a1f3b57b-1":{"name":"@balena/jellyfish-metrics","version":"2.0.297-build-renovate-balena-jellyfish-environment-14-x-eadcd9f5cb7b9cf745d7da089a2b18e7a1f3b57b-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.297-build-renovate-balena-jellyfish-environment-14-x-eadcd9f5cb7b9cf745d7da089a2b18e7a1f3b57b-1","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4279efa9cadcf1ee8b57dd91d0bbb6b39749ee63","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.297-build-renovate-balena-jellyfish-environment-14-x-eadcd9f5cb7b9cf745d7da089a2b18e7a1f3b57b-1.tgz","fileCount":17,"integrity":"sha512-KBgI2cVD08+aREpcjSIrC5r8RFLq7ghO3AInY0HXL7DSbKyn/qA9REF5i4MTd2UjF4JuT8pSrHEoSz+ldauuBg==","signatures":[{"sig":"MEUCIBoeGsoPN1kKXhOPu4+lefFSI9gOZj10tjxOzp86lIiwAiEA+yozC/CeqGaa12/UebON93DcTdV1U7L+TYNyVqv9dr8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68147,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjgaxaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrHgw/+LSvhwtxbAPeNkfEytF7llXGCGxYUaTQItGkzXfFK/1Ilm4fp\r\noNOCMNq42rAihCIt+m8PpizeTNFzW66Ye9RfZsSEpQkpouh3fDMkDEAi72oq\r\nRvJ8tzd8///4XXLOm2yjXohXcZyqHYfqH2f7tZYD/fRDoCqr3yffOnkx4EVt\r\niRZYS5J6fq61Wb9MuKXwJcKgmHnlqSZdyvHuET0rdNry3fUEaQJJqiXx8sAc\r\nBqFtCI3r4xAI9dVLIAenMwG60G3iwn+bSScKzFeIp2O6QI05ojjdHu40Eaf7\r\nnA8eQkbFu2cAdxlZKircoUEks87nMoAOAJl9jK5zCmvyu/HELrLoUIbwPFfw\r\nUkJoZmz1IGAkqK4X38L5p/nABc7BvnCAgN0tKmSlfauqDhYbixoLxUkBboM+\r\n2yzpa3wIGnDQi0HLi9c3dTNt5k6FF8GtT17xTiEB2QkVQiEzdEL3OHU4AIsh\r\n22ncCTACRbgqyQAKwgbfW2IbLDeICgPzi/mM+q1Da32qXgi7zZKfZazuY/0P\r\nLbUCY5b6zXrReA8F4IsrYpwcHOxv9sHS65lzfxm7xvsTMEEsCwIYbQAHHxs1\r\nodB/xGT5LdkeBl1zGcLxEEyoi+knC+quXCbTn0Epgcf/NsOUrCJkwcOWGjcs\r\nFHDARbvGojxW8QLV9IQ5QLYnFTYqUti3No0=\r\n=zFyC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-eadcd9f5cb7b9cf745d7da089a2b18e7a1f3b57b-18.x/balena-jellyfish-metrics-2.0.297.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-eadcd9f5cb7b9cf745d7da089a2b18e7a1f3b57b-18.x/balena-jellyfish-metrics-2.0.297.tgz","_integrity":"sha512-KBgI2cVD08+aREpcjSIrC5r8RFLq7ghO3AInY0HXL7DSbKyn/qA9REF5i4MTd2UjF4JuT8pSrHEoSz+ldauuBg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-26T06:02:13.038Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.14","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.3.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.8.0","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.9","@types/uuid":"^8.3.4","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.297-build-renovate-balena-jellyfish-environment-14-x-eadcd9f5cb7b9cf745d7da089a2b18e7a1f3b57b-1_1669442650573_0.734021244464856","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.297":{"name":"@balena/jellyfish-metrics","version":"2.0.297","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.297","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"bee53c958c5a31214deefd5c22ec12cefac342fb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.297.tgz","fileCount":15,"integrity":"sha512-kvMWRp/BcAQQr0z+pSRgY0p++y4Np31uLBvhu61tIqSFkXYQq4CFOhO8MkaMkJur5Ooade44pNKmxs9la1DxLA==","signatures":[{"sig":"MEUCIQCFFWICkF0Okdzo/bATbTXRWUkORcgRc1s8OnRrUTXe1QIgCBtnYrzkg0p1/8zuorZIrMtzTmrr/lAo70y4qyjKhXw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68055,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjga2yACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqEpQ//cOdpL9XMcIQSIw4BN2X3uqhC+VZZOQlvEEtejtvYoiX4ImTr\r\n51PTVsKFPPsXpA124HkMvZpt6p0nh9BcWC1OgYyOzsTdhh+Eu+vZFJy2s3+Q\r\nbU360/sU5h4w9WiG4a6e7QAunyDw+6s7KPa1RacfhttGAqL60Js21JI9DX5e\r\nylZKDekPe1j2hfnzFZ8o8K6++InKOnG3tvS0GeBaCFu6SwsZhsSOPAKfw5Uh\r\nwvy+6g04SBhYqi9eBHfJqr3KZK1MatKgpTaGJtSQw4j1DCJgZUjR3Nkb/sZT\r\n3r2q1hlvldOaI78Maw3g1Z7UR5K/8dYBNUATeTCpdtpFKsu/6xw/UnInAD9R\r\nYnZVkxBGVKvkNamWlI/mxmGXMtPbZq/Rmfr0YhRNh5ZQu6TFWUWhlT3GTpC2\r\n3EQo0aPgVElM3tUB3r6XGx8ChtACm/QwXnG9lKnmPIPk/i21bYDYgKJM7mFJ\r\nhTcCOvYz7SQxHTUbszW2l5q2sQ2tD4BQIkV37mFV+x14nwZXQxjLRaAS9d9R\r\nv0JMGnWZ5OOGpkUH98P61EbwUoa6EXjOuz20whRPyqoLcYL81QZGGq4hxt3J\r\nkLx36VjVMkluw2iGt36O86R8OwOg3zqP6HiBs2MqQ01pZQl2LpvTqMsYbCpl\r\nbgvLkPMSXiXVN4v6KJQSWMCl0qvkCsyoDyM=\r\n=qAhF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-eadcd9f5cb7b9cf745d7da089a2b18e7a1f3b57b-18.x/balena-jellyfish-metrics-2.0.297.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-eadcd9f5cb7b9cf745d7da089a2b18e7a1f3b57b-18.x/balena-jellyfish-metrics-2.0.297.tgz","_integrity":"sha512-kvMWRp/BcAQQr0z+pSRgY0p++y4Np31uLBvhu61tIqSFkXYQq4CFOhO8MkaMkJur5Ooade44pNKmxs9la1DxLA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-11-26T06:02:13.038Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.14","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.3.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.8.0","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.9","@types/uuid":"^8.3.4","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.297_1669442994637_0.09615376116811003","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.298-build-joshbwlng-renovate-3e930014aafde737f780cbc21e0163aa82f7ba02-1":{"name":"@balena/jellyfish-metrics","version":"2.0.298-build-joshbwlng-renovate-3e930014aafde737f780cbc21e0163aa82f7ba02-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.298-build-joshbwlng-renovate-3e930014aafde737f780cbc21e0163aa82f7ba02-1","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d25fd534404b51010142239eabdffcc03fa9d69d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.298-build-joshbwlng-renovate-3e930014aafde737f780cbc21e0163aa82f7ba02-1.tgz","fileCount":17,"integrity":"sha512-0RPs2Fx1ROKFnDaJCe4DwBNVpe+aKf8WPgI/JTBxg5HNVty3/087/BeNlUBLNY6fA5nDDYtMEa7ZkxEVEvjkmg==","signatures":[{"sig":"MEYCIQCbXd+jYfn5mN3HuJQHTvyFSAuJK+ewkKs84KgwgXXKJwIhALAvgVv7ABT74uZr07VjuSFfX4F4ANdY7i7elYTMqpLN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68123,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjl8i1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoxoRAAoNLpk4x/B6TyTafaw8e5qOlp6WMdNdHAb3X0DPUnXehlHmcV\r\nEUXS/Ln0MdvWJbHuV5GsIHz8twDStDlQF0TGLLyUes32nZgxjl4Ui/ai/YVb\r\nAGzbtKhem4xu6bgSPv2zUFi+oSYxdTm8ufhqqFbJRnUl8/kjHJfc9e2updgJ\r\nZoQP1TJBBtfeL5PpH4Cyf/po4Mto0t4kNN/mkz3fLbYPkroR/XLJWhYC8Fzs\r\nJIOqf3009sPgcRTpmPznIxRALPPVddRWeO3gPvA0+7SdRQ2nMByjz/gSCbPF\r\nmHDQ3y6PgK5I73lcDeQRDaZMqe+0q/e6y4hZzgD8gKWK8sgCur+w/wDDA9Gd\r\npRkAkNpFoI59tlnWdtPsEgdPWbVJlhN9JnMk5hNTXXdAMX+dVAh+FifNPoQP\r\n4sxz18KdSG+7yssCBAjwyw5OC2e9KikfnRzterK7V6KRIq8ghrOnLtmNtPts\r\n3BNdHtmh6Wsh0EUo+i0Ko7Y8Xycc53wYHlgtsjh57z6yv1Zs31Vxs+bWEk4K\r\nLnEypz/1NLxv4HmJJsjWDx3fL8zpBQCkrOcG8Qpr7FOg1PhDHMUP5TYnuf9G\r\nU+dNE1iOBveZmd0WzIvIGb1haCqGPhcHzHYK//pp3Irw1Nzs1OLQyBZxdx+Y\r\nafEtvOcPcCt2YqMaJaod96BhcleaGK4f90Q=\r\n=ubNF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-3e930014aafde737f780cbc21e0163aa82f7ba02-18.x/balena-jellyfish-metrics-2.0.298.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-3e930014aafde737f780cbc21e0163aa82f7ba02-18.x/balena-jellyfish-metrics-2.0.298.tgz","_integrity":"sha512-0RPs2Fx1ROKFnDaJCe4DwBNVpe+aKf8WPgI/JTBxg5HNVty3/087/BeNlUBLNY6fA5nDDYtMEa7ZkxEVEvjkmg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-12-13T00:33:32.872Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.14","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.3.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.8.0","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.9","@types/uuid":"^8.3.4","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.298-build-joshbwlng-renovate-3e930014aafde737f780cbc21e0163aa82f7ba02-1_1670891701628_0.7027009702634202","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.0.298":{"name":"@balena/jellyfish-metrics","version":"2.0.298","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.0.298","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"0d1c33ef57aac5be1117f54587c61a067a29b14d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.0.298.tgz","fileCount":15,"integrity":"sha512-JZbcTh7xjtC1qgAltM4gbiFbPWP2kB3sKlAFJWHquVi0GLzkLAjeZfh5y5kza4dqmU0U25SnL9d5v6UFR8VRHQ==","signatures":[{"sig":"MEYCIQDyB5bGa/8GWpICCWSMGjdGzR0mQDLmFwKsZo2lCiyO8AIhALn4reMz6nEZGGBJlT3FXoRMD2Cslh8SVG/PqJCOMpT1","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68055,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjl8lsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq21w//V57kib16xEvW0LanjlJfZDZwSFrShRCB6oIRKVQPqff9vHpb\r\nKUz2vgxwjALgZ95qURQ7zkyANv42BPg8WWUJe/XNtYvcCv7gFuC7hLrRd+gQ\r\nLwwWUoolpF/xV1X14odFER0pS2BQx1B8PbkftMl3AQ/UacY0/lnnSS9Q+ZJW\r\nY7bJQ3Od96BPbKNHcOS1RIBwUzqpWOEy6F3dyJS3ivbjXzaEiwiFjUFLrgLM\r\n2GcBk4HKxgXLZklehxcgW8oD0VqVuQNuaG8ZZxtZ7GVmjfYgYy2uFJegaHT4\r\nivOq3/CE/kENJyUxEWVIA3aizeeVKULd/llieoiTqMGZeok5UbV+urEJ+as5\r\npFrF3Rbs+Bbj8SFTUudXKAF7Gf6Gp0K2Kb8XT0rA0SR2sJABj/a9yf02rrha\r\nueeobhxZKQQ/dhoLS6g7qEelMxFil1A0Y6SCImx6gSgs8SrhkI4dvnu3BarO\r\nggHmf896FXhmbDVlGnbI6ClKk45oOUQ+5sFeFru8rWiyF2I7V7EWVi6mEFOX\r\nZLis4gA8r7BZUBYLlA53WmYM/9IURrfKzf8Pg8MFChcJr0q9IkH7buzRmqwm\r\nMdFWVqCRgt4DD6MWL4ffIdgMc6flGFd7x84OG8JEVmx6HIRqEdXMNL4yo68e\r\nseaG8+UW1JNqEleOfgIwyFadCQip9l1NTto=\r\n=fRqG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-3e930014aafde737f780cbc21e0163aa82f7ba02-18.x/balena-jellyfish-metrics-2.0.298.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-3e930014aafde737f780cbc21e0163aa82f7ba02-18.x/balena-jellyfish-metrics-2.0.298.tgz","_integrity":"sha512-JZbcTh7xjtC1qgAltM4gbiFbPWP2kB3sKlAFJWHquVi0GLzkLAjeZfh5y5kza4dqmU0U25SnL9d5v6UFR8VRHQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-12-13T00:33:32.872Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.14","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.3.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.8.0","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.9","@types/uuid":"^8.3.4","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.0.298_1670891883864_0.009415106678371199","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.1.0-build-renovate-node-16-x-7e54dbb4738e720410697af98597791f3f75b901-1":{"name":"@balena/jellyfish-metrics","version":"2.1.0-build-renovate-node-16-x-7e54dbb4738e720410697af98597791f3f75b901-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.1.0-build-renovate-node-16-x-7e54dbb4738e720410697af98597791f3f75b901-1","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c635bba6e3bb56ebf4e3ed3c2b10537c47e2dee1","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.1.0-build-renovate-node-16-x-7e54dbb4738e720410697af98597791f3f75b901-1.tgz","fileCount":17,"integrity":"sha512-jy0eP4rdCLyjVvVMF7SuyC8ED9K/mvnZ3msxrYTugISXhslPSaRFhqEYeHrqLmTIxmeb8KHmucnO/sChqFvsBQ==","signatures":[{"sig":"MEUCIFQoIQfW8l+u3Wkv0SgpQowDDcKEKICo2p74pUd1NkYuAiEA8wu9v+QnePG9iT2DmhEMnHGH0yjJLxfvcM9TbO2YixI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68121,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjl+wpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoCGQ//eIrDD7i4rPGq8J/n58s5VmAjvx4eYYtdlz/7wwhm45YUApMM\r\nfiERs/17UoxcF7zSexA2ze72ZDPCiRWW7okMurMAWVf+SHN4/ls3voIOMhsi\r\n/eg7siRaRN/8f+sl4mIDm2H/3N8jIRouZS8Dw3OrQ9y1AJ44Vb3WYitUZUz6\r\n11qaVmdkEE/MGJpuignJgH8JpCPcTeELy3Ps7CAKTzihIKx/8wInMlpTYJGk\r\nw4FLmkxCqR5EpCsXO8PdqC3jx7d3kQz2l0V7VbmSLEVDSfjyNtkG0kul7S4H\r\nFm1kuFHjyknPU48FWaqMvkIwcrC8Oa0wlxh9W6x3PDIxQznVUcpuXTYQa0pt\r\nVRbA/OrZSuRpfuo4aX9m7qMGJvIYMm1SoUsnNzIYlVzuKgGTdPcNKDKXSjuv\r\nsaJkRmXcahqTyLOP7Lokb+eIY6+ebyjTwTpPLPYROUMnsRFLVC+XYet9OlZp\r\n9LpWk5RoLMvjnxxVkZP702dVwnunTwPz7mUQh78iJYNXaswZj4orYwxrPWzu\r\nCpDgDecycr5N9NFPSeZHQU1xKQHuQ9P0S0iNGRDcBMLnsn+o8kz4CJIAliSj\r\nVyBh9EYrl8xUppTyO2wAu9fRVVeoRINJv9Cffan1QMaMx9LuU1yiHabRMgOO\r\nWdsb1WNNFo6WFG66jWUMBNo3yAeEyYm0IM8=\r\n=UJhN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-7e54dbb4738e720410697af98597791f3f75b901-18.x/balena-jellyfish-metrics-2.1.0.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-7e54dbb4738e720410697af98597791f3f75b901-18.x/balena-jellyfish-metrics-2.1.0.tgz","_integrity":"sha512-jy0eP4rdCLyjVvVMF7SuyC8ED9K/mvnZ3msxrYTugISXhslPSaRFhqEYeHrqLmTIxmeb8KHmucnO/sChqFvsBQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-12-13T03:04:46.340Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.14","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.3.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.8.0","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.9","@types/uuid":"^8.3.4","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.1.0-build-renovate-node-16-x-7e54dbb4738e720410697af98597791f3f75b901-1_1670900777451_0.7635931626140702","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.1.0-build-renovate-node-18-x-8fae0804d95f0e858a23a9a9fb44a044ebc09c8a-1":{"name":"@balena/jellyfish-metrics","version":"2.1.0-build-renovate-node-18-x-8fae0804d95f0e858a23a9a9fb44a044ebc09c8a-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.1.0-build-renovate-node-18-x-8fae0804d95f0e858a23a9a9fb44a044ebc09c8a-1","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"1de256715917fa63e9ac2e2ff11ede909868dc35","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.1.0-build-renovate-node-18-x-8fae0804d95f0e858a23a9a9fb44a044ebc09c8a-1.tgz","fileCount":17,"integrity":"sha512-WlndlsoDgbL5jPliG6c3B32MOWScto7KrUBwj8KeUtbP/diY7bRBacI7JygwKad212q2i06LEXZxGy5ehE1xWQ==","signatures":[{"sig":"MEUCICSDJeiYNsr4DdBENEB9o97UNcnjnLCwNORn6lRqjWjnAiEAyTmzFnkW/4WwdJQdm5qNd99wXwuDhXptQawWLNSX4mw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68121,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjl+xTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqx1g/6A+UZAjt++wIU8xha8zV6UTYpnucGAkymyTckT3nh4ugv0orr\r\nEd4z1PP4LUmc8VaO2+RNDQWB5UZa648IAkYv6oQsUFOzHBuhTcjeeaRocn/1\r\nu1XQrj6hmacIedDrF7oy5qCx8SDDwCv8cwYr6/RN6eyOJ42WTBWEwb6T+mvo\r\newqwTL43lhJs3I3yfrqHdLCNPRLCLOUamxsl9IzRvzHDrAJI93uO0FzI5sQ3\r\ngDl/TLwJVkrBArQtzBJRYAjwapRVR5XaU+qM6WtapcbpjNKJvvCJKNAEnECu\r\nNy8KAmKo85OiOK2BNToD90fvGfqBthAJdncVrNP+f+a5B7Oez0n9mpK7bcL3\r\nvHEmIX3AxAtAZOtKBM6Nl3F2MkuVa7ej/UYUrqjO9aByXifTUGBHpcPQfes2\r\nEH3gib+EMtAp9L4XKuJkSRnZdTmEyyfP1GOQSSOog2pXyL9Qm4UgtAchPGrZ\r\nzlVpLS5OVvsPhc839rCBKyZRMIb11NxIs3TNJ3JuHpxGm4JNsqPdX/kyk8uv\r\n/i9WiVeKlUYRl+JkwH0ZSQCqyLpxKvfvINieENWEeNcawZ8dtAy04poCvUQD\r\nlRfV8C1mR4xADW5Gc3a1zK05bE7hduuz8iHhGpIQj3ciBVQC5jYz/U8ocZ2c\r\nOHNofUaYEocyFND1ND4CLBLCH9WuaBC8WFQ=\r\n=hV7V\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-8fae0804d95f0e858a23a9a9fb44a044ebc09c8a-18.x/balena-jellyfish-metrics-2.1.0.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-8fae0804d95f0e858a23a9a9fb44a044ebc09c8a-18.x/balena-jellyfish-metrics-2.1.0.tgz","_integrity":"sha512-WlndlsoDgbL5jPliG6c3B32MOWScto7KrUBwj8KeUtbP/diY7bRBacI7JygwKad212q2i06LEXZxGy5ehE1xWQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-12-13T03:05:41.388Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.14","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.3.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.8.0","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.9","@types/uuid":"^8.3.4","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.1.0-build-renovate-node-18-x-8fae0804d95f0e858a23a9a9fb44a044ebc09c8a-1_1670900819240_0.626281598790126","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.1.0":{"name":"@balena/jellyfish-metrics","version":"2.1.0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.1.0","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f8050da0d41b69e61c20d25c0d74e6ca35f3854b","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.1.0.tgz","fileCount":15,"integrity":"sha512-qDGzYurnQrgp6Q+X8rNTEPigDvc5/uZpiqawiHHVPGw1Tijaoq9gTID9MH9d3+BzPhJa8jggAtxqcxAvrcGmUg==","signatures":[{"sig":"MEYCIQDDOI1IVhJrg6wiSmG7a1YJmur3OA3Pa4ocFUCCxO/VQAIhAIacfjZCTUEPymE0Y7l0fQPNXp9WQMb/QbLWvVg+FD1q","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68053,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjl+29ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqNKw/8DiEeGMn/T426Nk7XrTOFpPBE7Vb9ub+/PMauY/Psoqo7QdMl\r\nffZjbYH1FhVi4HHJB2kYp6QPYJzwcFkB8v+nc1Dgn9Ac28nHn/ZHblhLJleC\r\nIH9hFv+a/Z0uuEMdu4OyrNBOeUIjxGq7OUqrMbdEKxIne8XQqLzxhh7ZE/24\r\nodS12MDA2uegsI4/CEwVsc4NX1qDXnXsGzD6IyrXjf++3RAUjFjd+63Xo4y0\r\nGgZwtwLhwiERxg2Gkwh3CiRYzGVvykOIvrgtEZ9tNpr3d2ELtysOuNUXRhgT\r\n9vj2JANRL4BU2jzWpO3F6E1Wvu+93caIEirIYvVgJYHRyWEYAPA6p8AxtlZE\r\nnoSZrvcoUcMVq7vz/HqQXTekLCja+Zjx2cZU6iRnLarZ4K0DEraPrgAwOJQp\r\n4aOE3AI7XaLEWOLeIYw57f8znrsqs3CQl37B3pQFgWLT/ghmJxdHWlsSFOV1\r\nn++5qtuVcwQxE8JRZtADzx6Xx1c2+X06yjP5OZgiuXOh7hV69disCHIvjMr7\r\nSzGFmY9yPFcJ/RfmpDk5lVjbdRQIs8/Wru71fExfOTXB+n1/s7n3wpdVFzQO\r\nUCO+/CNb5XkauLhv57HAvx6i7OUdGyZrAlLP5Ctuku7xQhPCq89MMshu8inZ\r\nZDTFWfS63G5anR8HY/YHDqA1mjit4wNA0Fo=\r\n=iQ/Y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-8fae0804d95f0e858a23a9a9fb44a044ebc09c8a-18.x/balena-jellyfish-metrics-2.1.0.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-8fae0804d95f0e858a23a9a9fb44a044ebc09c8a-18.x/balena-jellyfish-metrics-2.1.0.tgz","_integrity":"sha512-qDGzYurnQrgp6Q+X8rNTEPigDvc5/uZpiqawiHHVPGw1Tijaoq9gTID9MH9d3+BzPhJa8jggAtxqcxAvrcGmUg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-12-13T03:05:41.388Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.14","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.3.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.8.0","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.9","@types/uuid":"^8.3.4","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.1.0_1670901181113_0.14791788660085503","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.1.1-build-renovate-uuid-9-x-4bb371fe3739414dd680838fd74e8fe9adcb6c12-1":{"name":"@balena/jellyfish-metrics","version":"2.1.1-build-renovate-uuid-9-x-4bb371fe3739414dd680838fd74e8fe9adcb6c12-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.1.1-build-renovate-uuid-9-x-4bb371fe3739414dd680838fd74e8fe9adcb6c12-1","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"35b548afc4047cc75efaf7f88da9118749c00f70","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.1.1-build-renovate-uuid-9-x-4bb371fe3739414dd680838fd74e8fe9adcb6c12-1.tgz","fileCount":17,"integrity":"sha512-/YkoFAgIHRFfJObmkA2kxy6Ans3sT89A/qr73OSSjfMsToduwCrOcMhR7ckipIhURTc0NyTi3M4Y06Op8Y2k4Q==","signatures":[{"sig":"MEYCIQCAYB9v6t6yx/Lt1MBQ/sPcYLq/QIAH649clbr08w7hCQIhAKmoQb8Wk+iZ1MuzNcqJf6Cev9ZmqERu3FZtjM8Goqcm","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmASiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpd/w//SXNrYgMsUZMoDvJp5ThxGJ99rKF7eEVH9Ros8GnulxN0A4CC\r\ncZUvkk8xtCZAZxgw/BwUPy7LpUVR/6HLVi9NtnEEEKk/GwuTNLXwB4VWDSQD\r\nkLPs2xh6vgdcUp3en9yhltdDqzdQckcBxBsLO04t5aG5Oy4dM1CEi0KqHBdJ\r\niRpXOfRux+LfHZjaoj69jYwA4M0WbgKYkFQpO7j9NtznBhAL8mrWQvvmdWoL\r\nuSebinchgkFPubkuE7OdJKoWhzyTRE1UYqMBHOxDIuG31jO8bLtvqf388Rtg\r\nKmtncb8vPf1K4Hy8jFeHzbrWshWU5HwOQB0ZxQb9DgfKh1/LzkesJKd7JvEm\r\nFq6zLQkwxGaxX2+zWGJc0Vkx7GZ1BsUtrPRHlaOCQ7oW1MFV7xTUjG4m/bk0\r\n0ica5dv5KGfcP1LiojBOwUpK5dqBe+n27g0opOz6jPl1BABWib+B+Si8C++d\r\nyAfEMl1WCfj/oMd7UQJI5Ir9lttg2voCsJAvQreGPOmygQ5wu1M6eMR6ihCj\r\nYVoAeawaILz3cTPgjxqIcCdqtumT1gsstMzUQ4bn2M2sjY12Y4i/jTm1zena\r\ny77m34kUUnhQdlY0Haue+ncVE5xwrgJaXJrJOoGXsaQ59h9RC5OBVnaFp1lq\r\nIriqOODj1HaiuIAwhSspa+5kdAZMnHlakE0=\r\n=1Qsc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-4bb371fe3739414dd680838fd74e8fe9adcb6c12-18.x/balena-jellyfish-metrics-2.1.1.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-4bb371fe3739414dd680838fd74e8fe9adcb6c12-18.x/balena-jellyfish-metrics-2.1.1.tgz","_integrity":"sha512-/YkoFAgIHRFfJObmkA2kxy6Ans3sT89A/qr73OSSjfMsToduwCrOcMhR7ckipIhURTc0NyTi3M4Y06Op8Y2k4Q==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-12-13T04:49:14.501Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.14","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.3.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.8.0","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.9","@types/uuid":"^9.0.0","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.1.1-build-renovate-uuid-9-x-4bb371fe3739414dd680838fd74e8fe9adcb6c12-1_1670907042090_0.9354770738181517","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.1.1":{"name":"@balena/jellyfish-metrics","version":"2.1.1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.1.1","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"08d9b480e963c677e4b3b722e9eb2c5e74cac8b0","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.1.1.tgz","fileCount":15,"integrity":"sha512-VqKQcoWZ+fvp8RNsLKVw/UlnAYNcKtIxqBdiJnWmAgf24SC+9iNNKWQWKLB5v7m4RvT5I6+sJ8hvmMdwkiUXfw==","signatures":[{"sig":"MEQCIB6lcyl9odWr6SHqcKpqKjcWsbE/zZWIlUz1zDRPGfuQAiBk2K3jufBoII5WQTpljxe4ZxRWlMXIUkxuR/3TsBACgw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68053,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmBJAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpjzQ/8CoVoN3dU5Do3SZCXA8IeLar1/nRGynzG4/NwaaZxjn2fkdPg\r\ngyHD8KWzjcLzOpmNsLfnGWDMHGuclr8hKyj2n2usAPbVkyMA7FWWyUSgOvT+\r\nW90zzCL9ddYyogKoY2Ke6XcMcNgHRE2V0+25P4BLVuiTcKKTZM4bBiScJKJR\r\n7kDD0i2S4FOEWiyXsIjb65pOLa/d8NZSES+9wmaLG3I6HqvWaSo9Skqt1H1S\r\nhs9VADLRcr1MsIvXFa/rzsmpSEgIHtyAB3A3xpx6IQZZ3rY2AiHaGY7PeNEe\r\n3VGU3/Ju5UAp2d+GmI3lPjnITRW1Wvob+PgvcGMFFPdtIMK/clZaSgzEAqyq\r\neNWHvLweeg/1IBGWzGKERdUrXDaB7VD+/9nY4wOoE0HgW350iXfLZyUT58Hq\r\n9qzDuXt0WsvLbNXwnLcVvAEFIrSFjNqR3cU6niNWYJ5zxUW67udnYEVvtQXy\r\nGDBwgedYsLHsiYF50lcGc0zybD+VbC3sQzWypop8d/spwTaWx7O+Lf/5zy0f\r\nLmRjeeBFrBplaumXGrDRPeFU+9MvHSFV9LlpkG21P0+c8OT8+5CtHzGAWNjL\r\n+G5IMni4oWUbhtvuC/NtVHu+q+ICQbq+O0XDERP9IBivxjgNVH8Dea5eS9Nt\r\nxEjOzVomU9smvPWHy3QKiMv0sVfpwElwBQw=\r\n=GAXl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-4bb371fe3739414dd680838fd74e8fe9adcb6c12-18.x/balena-jellyfish-metrics-2.1.1.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-4bb371fe3739414dd680838fd74e8fe9adcb6c12-18.x/balena-jellyfish-metrics-2.1.1.tgz","_integrity":"sha512-VqKQcoWZ+fvp8RNsLKVw/UlnAYNcKtIxqBdiJnWmAgf24SC+9iNNKWQWKLB5v7m4RvT5I6+sJ8hvmMdwkiUXfw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-12-13T04:49:14.501Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.14","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.3.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.8.0","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.9","@types/uuid":"^9.0.0","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.1.1_1670910527805_0.5528721725354151","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.2.0-build-renovate-pin-dependencies-f30dcb3f7f27a9fd3180c46dc900a8cf3a39e6c9-1":{"name":"@balena/jellyfish-metrics","version":"2.2.0-build-renovate-pin-dependencies-f30dcb3f7f27a9fd3180c46dc900a8cf3a39e6c9-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.2.0-build-renovate-pin-dependencies-f30dcb3f7f27a9fd3180c46dc900a8cf3a39e6c9-1","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"71157539c008ba44b17131e85c42d22b0f8a6274","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.2.0-build-renovate-pin-dependencies-f30dcb3f7f27a9fd3180c46dc900a8cf3a39e6c9-1.tgz","fileCount":17,"integrity":"sha512-09DnIcMqpH5s3T4z4iJnMZoSLNJh+poYo1K+D37lWLRqMEot4fTtWu7OL7pb37UyE9r0jAJa8PwDIGiJ6GHTjA==","signatures":[{"sig":"MEUCIDHh9Low7e6mth965+4M9O1Jd0oVMu8bLO0J8oWhT9w4AiEApzWdF81uE+mHRxm0ppXk3eXGbT5BZ9wBgxt3FMZ+CLM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68128,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmJ8xACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmodIw/7B6D58GODWIzFb/JNGXvsWhfnsDQa+DfJJtSsF9+E+bdP7Xgl\r\nJfMsiA/aCqI3ezYYiiivElS12lDKLyT/UFfSZZHNRZ8u8WwAhOnh4sHp8m3c\r\nxbN0b7btIhQ7/O9cFVXZiZc3qG1KHPGMkqufrYG3TCbIRdJ33O+x/wrf6gGW\r\nc9wsU6ZmTfKI+4aQXPSC7jUEaS1JDf8hSPkcZ/BqrlTLZWTPARt1rm+juuua\r\nSbEGchnnRDnKDFJVw8N+YoX3V9c/dEjusMtO2f/bZ2XuUKmtep4KQftMyPbQ\r\nG7w47gUxzDBoYyu+hhZpL1YFAZ44FYo1v67oVecgHDO8XTD2C5NOZ8fcvymn\r\n4VCTExuZ5ayMo45J024pwI49cPLF37O2t+XwHhCVk1XPrs1TgHbTtKEk6vdN\r\ngfz/RPXAMcTFS+8vmdeimwvVMNRSTmDEWnDPRGSSCXeNcGegoSa+y0naP6WB\r\nFH2Y3OOpOapTLK6LLkvicxCwp285O+rq9TBmZD4F4OmSonDw0kIFLevQOSZg\r\nIJwFjbRJMxlyZWy/5+c1ZcKVNHcyFMx2NFOHI8800BKrDauN6FNT15KuUBCQ\r\nV5YZUkTUv8wGVIJ5dEjZ/v5lgBJPEygf7Zbu49ifOCGX3iqkYQnKyb2spVut\r\n7/RoH8cJ9fk7bSfwtN89RMOb6qrjITzLxzw=\r\n=E540\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-f30dcb3f7f27a9fd3180c46dc900a8cf3a39e6c9-18.x/balena-jellyfish-metrics-2.2.0.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-f30dcb3f7f27a9fd3180c46dc900a8cf3a39e6c9-18.x/balena-jellyfish-metrics-2.2.0.tgz","_integrity":"sha512-09DnIcMqpH5s3T4z4iJnMZoSLNJh+poYo1K+D37lWLRqMEot4fTtWu7OL7pb37UyE9r0jAJa8PwDIGiJ6GHTjA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-12-13T15:48:29.156Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.14","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.3.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.8.0","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.9","@types/uuid":"^9.0.0","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.2.0-build-renovate-pin-dependencies-f30dcb3f7f27a9fd3180c46dc900a8cf3a39e6c9-1_1670946609534_0.21521616177359704","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.2.0":{"name":"@balena/jellyfish-metrics","version":"2.2.0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.2.0","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4ee0af3dad6222b5a350d16d769e330863739c8f","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.2.0.tgz","fileCount":15,"integrity":"sha512-/xpX5juN1Bc3a74pFiEo31r4J7gBSs/8A9EeSKBaqZVuwudy6MXBV7cnx/7TY3MYUUg+yH3FlJXf6khIKeWFaw==","signatures":[{"sig":"MEYCIQCFim7lYq4rHvQvtXARkRPuhohoPDQq7ZGE0eR//nbpQwIhAIyDMFDnp7fqSVGLpy1tUx5TzOW+I0t+NfYGZT6I+nf7","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68053,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmRkgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrD2Q/+JnPdDbuk6Pyl1bPOmY/Rp1Frv0ZoswyHFdjFhPNjHE8yxA7u\r\n70HoWBaz0Zn+p6JfQE669BEYEdf+y7165RAxMltAr57BulyI6Z0KTbW6INlU\r\ng/nVh+a/GECOrtxXT0dYrc70IGDY+KtuPtBlztN21NP5vOTOQSNSgP7v7g4G\r\nNSKYkmjj8zI12vlCYq9tj4E75mrl2Az5VAI432kB8JL82lPcHPZTS5qH4Ln2\r\n7A7Gex8tBERHTul7XqS9MN3dZPpQFRk434WKGZjBLn2QpGrw8Eppahu2ujlT\r\noQSWm5hWRFThlSUf2wS5Dqe5u1hMlv9E3HyDxczf/IFCQKanpyO60olwiXMw\r\nlifLrmcHxCqqFbw18ysAzFRNy4AC/2iemz0uqgEimKD8IzTSD2YRGAEbfDO4\r\nuCBSbVxe0qwoEZai83cTjRHnKu4XOvi71G/x7VuYmo8XJ+4/vSmIX1NyaGlh\r\nA2pYHOImQl84/fjn9PzZItcQ7HkVbWna+cZhM+t8zfU4d8DYBTs4L0uFHd7b\r\n+Y9GFWaV+uh8+XN18pxHS5Byx9PU8LlAi5m1GZoMbu5EEyHwxTuUJorFtFi/\r\n0gso7gUI9KlRrDkWmM3qYtwIAsKqMX9VxZO+A5Fkaai93wvs//UHM/jzRa3y\r\nKhtToa6dzgdvneF4iaZPYoEP3jNeM2LeuNs=\r\n=cAL+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-f30dcb3f7f27a9fd3180c46dc900a8cf3a39e6c9-18.x/balena-jellyfish-metrics-2.2.0.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-f30dcb3f7f27a9fd3180c46dc900a8cf3a39e6c9-18.x/balena-jellyfish-metrics-2.2.0.tgz","_integrity":"sha512-/xpX5juN1Bc3a74pFiEo31r4J7gBSs/8A9EeSKBaqZVuwudy6MXBV7cnx/7TY3MYUUg+yH3FlJXf6khIKeWFaw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-12-13T15:48:29.156Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.14","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.3.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.8.0","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.9","@types/uuid":"^9.0.0","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.2.0_1670977824478_0.9670730477696745","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.3.0-build-renovate-github-codeql-action-digest-e25d1b211eb508e9ed31e1f552de0f75d83cf9ac-1":{"name":"@balena/jellyfish-metrics","version":"2.3.0-build-renovate-github-codeql-action-digest-e25d1b211eb508e9ed31e1f552de0f75d83cf9ac-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.3.0-build-renovate-github-codeql-action-digest-e25d1b211eb508e9ed31e1f552de0f75d83cf9ac-1","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"489b82605f2b7af603f57cec4ba43459c0707638","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.3.0-build-renovate-github-codeql-action-digest-e25d1b211eb508e9ed31e1f552de0f75d83cf9ac-1.tgz","fileCount":17,"integrity":"sha512-K/xxu2yQ+B91d1jPRp0D9RA1dDcgEoBuF/2xYXrriCgBg/X6Ebc93gRVJ7bTvlMShrmcs/34ACgazh79BG5ENA==","signatures":[{"sig":"MEUCID87QKoUke4WInQVKnPWMF182odMGiFhNY02COzokbUxAiEAyuS8ORDN/tm9bS6Y5k7IAzz5UtOR7FRHZd4Qh+0Gfb0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68139,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmeMQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpN6RAAokoThXLqruXZx58qo/sOYdqYLan9f0bEGfG5uV2+mFZjPFgR\r\nvtrESnm/EEdMmMORiLhX0tuqHkm2j+S+GiZlcOxExNjVlgrs+hwIhHlIsR2x\r\njxAalgPLdAyLQPAR1lT9GYZ1H3FmpvqNmUomNP7yywZm34tsYGyu5p6P7cM+\r\nyZJocwpNmXOut6RqBvF8DfGD+Bffv4GnAOq3OPCyvn2vpY9lzVeSlM17OJEW\r\n68V2cFm8FCHtO3fDoRHrvqTGrVK74Iy1Yqzc2Hrb5kpDiFcGLjOq0nqZDMRG\r\nW4EXno0hXUK00rqj0B7v3A0U91S91j0RWXc400WTYcY3pfRhMvy6heDW2bRQ\r\nWPdB86R24/mQzdrIt241Pko3PY3B2KdGrErQISH8xWBZFqk9aMRKaXE/8HcU\r\nlXT1E4F0Sh8G9YnF0ujLeWfhLBgJhN2m6WPFwqrmmg1Lxr65c63zk9sm7Yuf\r\nbefoUAH/yXTuoW2WmfD8Pi7EI7uSDqe2RXpqu3IhxiK/vKIKyuW2zKTMljW6\r\n9fncQHFNQTc3htu8o3nBtmLQVeFnoeHOWuMQgnpqgM9BoufXKnXz3vfiB8fv\r\n7fciFWsYpSkFG5134X96/BzHjo107tCyx5RAbrtQzc4n8s+68QTFAr+PEPCG\r\nErO3fjEDyzBpvdg2Bh43o6QZQmngk7Q1X3A=\r\n=roCF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-e25d1b211eb508e9ed31e1f552de0f75d83cf9ac-18.x/balena-jellyfish-metrics-2.3.0.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-e25d1b211eb508e9ed31e1f552de0f75d83cf9ac-18.x/balena-jellyfish-metrics-2.3.0.tgz","_integrity":"sha512-K/xxu2yQ+B91d1jPRp0D9RA1dDcgEoBuF/2xYXrriCgBg/X6Ebc93gRVJ7bTvlMShrmcs/34ACgazh79BG5ENA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-12-14T14:49:26.943Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.14","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.3.1","uuid":"^9.0.0","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.8.0","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.9","@types/uuid":"^9.0.0","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.3.0-build-renovate-github-codeql-action-digest-e25d1b211eb508e9ed31e1f552de0f75d83cf9ac-1_1671029519884_0.5476662363953064","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.3.1-build-joshbwlng-uuid-da7d60e47a1c43623c35dccbb5559fab2b2f054b-1":{"name":"@balena/jellyfish-metrics","version":"2.3.1-build-joshbwlng-uuid-da7d60e47a1c43623c35dccbb5559fab2b2f054b-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.3.1-build-joshbwlng-uuid-da7d60e47a1c43623c35dccbb5559fab2b2f054b-1","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4616800fb60509c8e12fe5063577c9def0839042","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.3.1-build-joshbwlng-uuid-da7d60e47a1c43623c35dccbb5559fab2b2f054b-1.tgz","fileCount":17,"integrity":"sha512-yQDVw0O/tIJOPC4NkfwTC9lzPe3PYt5RWLmTGmarg1kP198KUa790/BgMHyT5VKuk9f63+Qh/KT2NnqEV1FEfA==","signatures":[{"sig":"MEQCIA8JuJuuxTIEaaNLxZt73c/fCnaNDdsJNYT/+vt7wOLdAiBDrWlnWFju+APnPiUXAOhj/xIEkV7x4CspdGeKE5StaA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68067,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjsDgrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrvsw/6A28RwvDnqNEkX4ypQJEWvEg3pNinyI2Dm5U/qJnn/LA+w6WA\r\n3LTkmU7+OzciAPMduRq1nBoICRqHzu+x8gESaUY3aObPjfSX0AokBxPkkIz1\r\n6odHHrkOQmbS1B2mLWX9kJ3d2epAPCBhROpg9IjFVLIZ5VQt5b49rEgg7bSa\r\nfpeIityD+9ftGkMlZMqpd3ss63hDdIAcua38Yi0niudkUSP+F+pvXC/NVyNx\r\n+K+sinijWq//ZNitexoWDv/qAI9t1SrSaqq3cXn4j2X0xfBLdnOwHxn6fDiz\r\nFCjUmOqBDuK8zkajIKPjLcLQzYlWzIkCxHbFwTZn6wbB18oMWGs5jabNtg3z\r\nNckCPHLFV6ljEqfjX0empKyyoebXs1RK93B4tyJ55bD7el9lmMHx1smdR3PZ\r\nwf9HA4/hVqyZJXxUmx/UaiSzoW+jXfqoA5olptolA+p0Si+HGX/VYfF9sHyh\r\nldlAQzfQ1WI+p173GOWNi5VyS3mlLAJ/WCUyhKH+RlFxdFz2F4xyOHc2Fmi6\r\n91j7Br71uKnoHNALPS8vx7JblAmyaze006EFZrTkWEU3j98pBUbmMnXo1YwG\r\npA1nvkN2M/9BqSGqN49ilLLfkh8xnZDR1kKhkbLQeA61C9l5TyfmsItZmf5H\r\n2DRpzX3IdYSjsqQQKRRapoEhpwWlh5ePkQk=\r\n=rMLE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-da7d60e47a1c43623c35dccbb5559fab2b2f054b-18.x/balena-jellyfish-metrics-2.3.1.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-da7d60e47a1c43623c35dccbb5559fab2b2f054b-18.x/balena-jellyfish-metrics-2.3.1.tgz","_integrity":"sha512-yQDVw0O/tIJOPC4NkfwTC9lzPe3PYt5RWLmTGmarg1kP198KUa790/BgMHyT5VKuk9f63+Qh/KT2NnqEV1FEfA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-12-31T13:23:27.756Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.14","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.3.1","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.8.0","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.18","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.3.1-build-joshbwlng-uuid-da7d60e47a1c43623c35dccbb5559fab2b2f054b-1_1672493099127_0.4601780472200563","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.3.1":{"name":"@balena/jellyfish-metrics","version":"2.3.1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.3.1","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"c024474d8c30465184e7e105c2a7998bcee0c952","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.3.1.tgz","fileCount":15,"integrity":"sha512-/FysrkZh11Wv0TN0iJQ4oEdMgWy7Zsydv0wSJfeXoKZNe9vYTygjMPuqj+SexIGdG8oMeNUANS4TJVf50qV+Jg==","signatures":[{"sig":"MEUCIEPKBDOnTwjirBhVdiMUu8yZaMYa3CoGpnO48q9TuQ9KAiEAi9RUedUI/aHpsi+oxM4H2hj/+TBQ1VrZCuqSA53YAwc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68003,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjsDi7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpUYhAAgCKA5FlXJ+8U7xbIsvlBBYZ+fA3JuKmlfIAFXN22aXyKf/jF\r\nA5AUSs5xDLrIbRlRsGE1FAqXKQZcrz05P/JaDB0NsB9IXZMM2d5P5yI8z2lG\r\n18jFb4P7/wsBDfLh3JsuPR7SSHZKh29CFXiymJPGg0C+F5yFq5EC2R2i71sz\r\nI/+25pO5AXvFKt8lEEKmJpkQ6hm7HUa6XmoXlJATGdDYP3hNuzD6J5z+75Zk\r\nrAUAYurjh2T3kjick/1Kv1UiAaNAceU9Be+N3cT0rC6puHE7DFbwWENKKhpT\r\nMF4zfYdQpOZ5LEl7qN7E0LcC72gjS6ChcoU3FXUDT8ubf+GBf7MV3mS27UN/\r\nObzkDPIFBh0lw3IixPy5jFres4OyF0PAvfQCkf6Mdat0fcTPdRUYZJnH4KCZ\r\nezws1sZAXyQBl+3vnCNby4/jihaEsYiTSgwLDpS3qUc7VUXdFL6Lg18HUWa6\r\nFy7zn6jDelyJGl5TXrBnxnDAA+RVP5iUb0m7I7DqgcK207hbwpLqi8b1JNwc\r\n9ReXaGaC/4g1Rxinza2uOTxAiDPnvXt2GowX7K/qshiBx1cUZkcRIREl7ueg\r\n6hN2cOLVNraCap2jzENEnsKFk6BeIE9MExHBiJbUFpiT2sjQ1wHmAFG4DziX\r\nG9plyTWEvWLmN+fmJJahvLMKf+Aqexdoc/w=\r\n=qc+C\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-da7d60e47a1c43623c35dccbb5559fab2b2f054b-18.x/balena-jellyfish-metrics-2.3.1.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-da7d60e47a1c43623c35dccbb5559fab2b2f054b-18.x/balena-jellyfish-metrics-2.3.1.tgz","_integrity":"sha512-/FysrkZh11Wv0TN0iJQ4oEdMgWy7Zsydv0wSJfeXoKZNe9vYTygjMPuqj+SexIGdG8oMeNUANS4TJVf50qV+Jg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2022-12-31T13:23:27.756Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.14","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.3.1","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.8.0","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.18","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.3.1_1672493243405_0.07823533925731363","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.4.0-build-renovate-balena-jellyfish-environment-15-x-6d9eaf2b8a0185909f7c1fcb3330d86ab8242965-1":{"name":"@balena/jellyfish-metrics","version":"2.4.0-build-renovate-balena-jellyfish-environment-15-x-6d9eaf2b8a0185909f7c1fcb3330d86ab8242965-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.4.0-build-renovate-balena-jellyfish-environment-15-x-6d9eaf2b8a0185909f7c1fcb3330d86ab8242965-1","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"8f0d73a889bbe2f6e1a21bece6501bc2054077c8","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.4.0-build-renovate-balena-jellyfish-environment-15-x-6d9eaf2b8a0185909f7c1fcb3330d86ab8242965-1.tgz","fileCount":17,"integrity":"sha512-yp4hEUk/QhcIMd286wHyJZGUzAAo4hfPmA76uq+H/1A/E17fZ9ZyAY+krugLTucBtGsndc9npwoh7qxAgcxMWg==","signatures":[{"sig":"MEYCIQCpn1lSwPYgYJF6kjitmIFmMZH+sr+gmPg7ue6MR7rorQIhALl6DOhFBqITim8M+Idl8LI/27DgpYLln9KIsTFr24GM","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68094,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjsVc7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpCHQ/+I/T23NDj0N0CdyBAyO/lnZe2WjWlHJzBq0vfWSEW4aCLQgvx\r\ny/3LC8tDPJu07hhhUnzmPeWKR2Y6z0VoL5uebVnwzKFApMXOsiifuWalVev9\r\nnFsRG+rrUidZx63ZMe7osgBtAy97q1GL9Io1Xzh+Mkimc7qtGTcAGWgMKqG7\r\ndAdtgF2a5J35ejOS4VOFT9iRXsqQ7fuwJsdZjpOzrZvD6fsXmUj28wXJpSiE\r\nzNokcVjgcEwasQK3vPwq29/6IXGtekX7EF6zVPtMWaw6EZVITVdaxqOJolrz\r\n5lkrPiQIGskh1FQLELzg+gFwpulOUC+U7IAjUz4qtTla3aH1vMUuqdsORBTq\r\n2LVV3cKtT5auf75OgWJdGkDAdAesZTuj+weriCCdMDDXeqvcMGG01Wc+7qCh\r\nJoZaZbPdXlROaNaw7FFH+Bi13i6F/KaTKJpTymJPCyfwvxkNV5GHI35S4npB\r\nfSOfK1X2J17kc4at+sCyMnWqN2fXCdjqFSclAJbgNsVK+45igwuNqlhdNdbr\r\nUXeXJevZVYmfu09N9WRiZ+pVnf/SNDZFgI4+t8tm4encV+aD0Su8564STxuU\r\nHBXz7R2tlUM8sfKeiQX5h/jd7oXm6eT/68YlQtgSHYRU4LX7F1HBwf085Owc\r\n2/T4r4mVPeOQGmehnqzv1xZQkTEmvddxRsw=\r\n=zjy4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-6d9eaf2b8a0185909f7c1fcb3330d86ab8242965-18.x/balena-jellyfish-metrics-2.4.0.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```js\nconst metrics = require('@balena/jellyfish-metrics')\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber)\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card)\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-6d9eaf2b8a0185909f7c1fcb3330d86ab8242965-18.x/balena-jellyfish-metrics-2.4.0.tgz","_integrity":"sha512-yp4hEUk/QhcIMd286wHyJZGUzAAo4hfPmA76uq+H/1A/E17fZ9ZyAY+krugLTucBtGsndc9npwoh7qxAgcxMWg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2023-01-01T09:48:24.530Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^15.0.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.3.1","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.8.0","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.18","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.4.0-build-renovate-balena-jellyfish-environment-15-x-6d9eaf2b8a0185909f7c1fcb3330d86ab8242965-1_1672566586848_0.5175611131422855","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.3.2-build-joshbwlng-update-usage-example-0ebaf12436c46990630eec541fe193cc7b5d2c05-1":{"name":"@balena/jellyfish-metrics","version":"2.3.2-build-joshbwlng-update-usage-example-0ebaf12436c46990630eec541fe193cc7b5d2c05-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.3.2-build-joshbwlng-update-usage-example-0ebaf12436c46990630eec541fe193cc7b5d2c05-1","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"010abff2ce1e64af6c0bfde47a42a6be89063477","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.3.2-build-joshbwlng-update-usage-example-0ebaf12436c46990630eec541fe193cc7b5d2c05-1.tgz","fileCount":17,"integrity":"sha512-W8rcp2DslpwCFG9oF/AcwyXuR7XB2qZbmGddXU/w0UJ6R5LUIFbC4x6l6N0Whmim4Yv0MmBjWXkDl/6+D7bttg==","signatures":[{"sig":"MEYCIQCAqLHZmFmHqKo4y8tw6vAwW0j7d5VmDGiJfaW5oz/iUwIhAPs1WIHRirE8XTlKVTUrINHd0tEa78iqRjM25mN1emnO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68094,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjsVgWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoweQ//fw1Sz8voo585Q6Vv1EJvquZW2YjQGLNI3j38Q42DwI/bgOWI\r\nexYDdkDitDjBdRzTDB+DhMV3o8xXAt4U6zZSSpSD39N+NnQEzTt+7m7VeZjo\r\nfqZv1l4djLcna/5wO2dTHjwy7oRTMVhr4rgglvFUEWKvJsjyvG6/04ul/Rli\r\nE8loKz3IKdgicS5gtcMTUGfI4mGMQzggBdmNd/EHw362WiVxQsA0eI/wkuOT\r\n7r8I1CtKSGoDGv81DTDMMpy9w4P44phBgh1/5GAICU81e+fsIdw2RIMIZjuA\r\nxc83q49OEUW0WaU6BbbXSd00EuxtjZzBA3QFprpgAZsN1l/kI0JmS1yJ+iwg\r\nbSWN3lHBB5ByBRpi72iLQD5JFLsqCPwde1aG6EKFDVOts5zij9WQ5qW5omqz\r\nZwMEtKUY3IPCCBCalDbfu82g2mKG8E6tWzdpizVXlXNlkr66RjD7aJWDJefD\r\nFVb8buxnD6oKVs+Mq08qlRUeF7SwfszFlIwV+Z9ZBokbK0Kdc590M+gnMutO\r\nBf2ZEvppkXfD+sdEcvSzdx+5mPNROrvpZJtYD7T+dp3tzpG6Xb9EQz33DgNn\r\nrgbiUHLCvF2G+gvNogOZ+kzf8mdEpUjmDcVvGUdOcA5PVMQcgMg9W2kQgCoI\r\nPCi62dZE9eOmK7c2EVZngg7TVy4hBdr/SMk=\r\n=4vdy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-0ebaf12436c46990630eec541fe193cc7b5d2c05-18.x/balena-jellyfish-metrics-2.3.2.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```typescript\nimport * as metrics from '@balena/jellyfish-metrics';\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber);\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card);\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-0ebaf12436c46990630eec541fe193cc7b5d2c05-18.x/balena-jellyfish-metrics-2.3.2.tgz","_integrity":"sha512-W8rcp2DslpwCFG9oF/AcwyXuR7XB2qZbmGddXU/w0UJ6R5LUIFbC4x6l6N0Whmim4Yv0MmBjWXkDl/6+D7bttg==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2023-01-01T09:52:11.634Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.14","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.3.1","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.8.0","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.18","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.3.2-build-joshbwlng-update-usage-example-0ebaf12436c46990630eec541fe193cc7b5d2c05-1_1672566806240_0.8700548189709825","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.3.2":{"name":"@balena/jellyfish-metrics","version":"2.3.2","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.3.2","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"482c335bbd68a79a0bc3c8eca7da3f954b677190","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.3.2.tgz","fileCount":15,"integrity":"sha512-BuMEQN7TZTePtjjHhS1Bo7GWm8LWvxuRFwlzf3kjMCBEOzvyOnGWyy1hZF/CG8jNqN49ttpqaUvTswMcSFq0lA==","signatures":[{"sig":"MEUCIQCihTk6p9IbZD2qNufFcqioAB4FGhhbIw49yh8dIMw3xQIgan2ERtMfZhq5ikZzTh+oLD9jgxIGLeI2E87vs79vU8s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68014,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjsVipACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoDURAAmqFgb3uJ1wMMekAT4ZsD8LxBghP1xhmE24hxp2Ip8ekHAqZB\r\nQHf9MvdwtUJ/54+yEAhxze2D4AL9UJvceKRXxbACn5xSn18bV2SRm//FmGNe\r\nHE+ei6wOxh1ZC4uyerNS3sr+zY1PAxRZjErXEwEDCy9y7SSiFC1ecFiiw2AR\r\nUqwPaEk9avndcy26dIXdQ4eBieAE348zOU8JamtMwhHPkYWLieB7i4MyqWXR\r\nZpBhWyyAEjf9EmqCq5/2RLHg8aComUEvIFmruKzFmjDnELwJQt9L0eR5tVep\r\nBF6thFKUWWBpOZ2+EdsLCqmwx54miIAsbhxg3tG9tJaCb2oXnkWWdJ9F4XRS\r\nM2SUOF07PwpmKqAPHzHU9/ZXFfcNNVBZn4ZSwZtDXMOljSt0QaIzivipEpdJ\r\n2BELQfucFRjNkxlzCOwN1CsI0ptONDW1h7GUeMiM3ve0Fk5jbFSOJswenJp7\r\noA5VqiRRccHoRii/WXxkRILnoEoQnTmCY8HlTo5NCefniA9QKOXx1BsNahtq\r\nWykmrq9J3vEOSpK8PnPSyN0Ifp+p+dHSrJhSU5xJ7WJn29VbsD+Sf8WYjWzo\r\n86/VI1KiVOAgotXNS8cC3cclWdt/9TQi2gUeAM3Vt/uLlSBbvo3F+TZRPpJf\r\n2LrcCPQRSgwki/GZUmoe9V2mMBRffhHO37Y=\r\n=phS+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-0ebaf12436c46990630eec541fe193cc7b5d2c05-18.x/balena-jellyfish-metrics-2.3.2.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-0ebaf12436c46990630eec541fe193cc7b5d2c05-18.x/balena-jellyfish-metrics-2.3.2.tgz","_integrity":"sha512-BuMEQN7TZTePtjjHhS1Bo7GWm8LWvxuRFwlzf3kjMCBEOzvyOnGWyy1hZF/CG8jNqN49ttpqaUvTswMcSFq0lA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2023-01-01T09:52:11.634Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^14.6.14","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.3.1","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.8.0","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.18","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.3.2_1672566953153_0.00649312840495897","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.4.0-build-renovate-balena-jellyfish-environment-15-x-6e77ed1e1c81c72b29522cef6fc5eb3c9743449e-1":{"name":"@balena/jellyfish-metrics","version":"2.4.0-build-renovate-balena-jellyfish-environment-15-x-6e77ed1e1c81c72b29522cef6fc5eb3c9743449e-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.4.0-build-renovate-balena-jellyfish-environment-15-x-6e77ed1e1c81c72b29522cef6fc5eb3c9743449e-1","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"03be8a74a99284e46b824efb0f97b1411673d145","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.4.0-build-renovate-balena-jellyfish-environment-15-x-6e77ed1e1c81c72b29522cef6fc5eb3c9743449e-1.tgz","fileCount":17,"integrity":"sha512-LYwbQv8AcipTHmdt7uo6Cupxi5TYGVsU2rI9BPvcONcIoN7SLeGvjzW6gqkfoHsPWICl8lHCmCwR8vFKicbJcA==","signatures":[{"sig":"MEUCIQCQIU0E2qSo4Zotbcdox4D27HzOYgZdaaE9/l2w8tljqwIgWyY5WqyQ0TEEX1oAD8BN3KJ+VxJyuCOgWNkYVDLsTWc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68105,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjsWUkACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrI5hAAipYi7Ipts4Z9HGvTXYiIQA+d6ITs/uwJIt/KFVA2+PNxFaT9\r\nSGiNdZORZ1yq2+zYi7LW80S80c8ESwCFLsWaW4bhxJe1nnDnxWJHb29RHe3m\r\n4NYxz1rmsqFY6KAJ02jc2JEoSFb0fXBECJknlir4LbjZdQn98h8XQPg09WfZ\r\nTXET+lcNEZISlrpbQpPaKGlvIePj5l+USJ5QevZuWdHaDaYR7i1d4LOZrz47\r\nhJxVnIv1sYXY/Y/lXgSje5iXQ2lC/xPWA1lSR32GIwCNHZYbgubbFL15APmv\r\nTJZyjg5uhVmq/a1hsn47N+K0OvNioEMraPQWm71sg5QJC54U5UHj5tQNgSxF\r\nXvw3oNLLBgU6NDvOOAOfKOOPpCQx1Q9iK/q2T0q8qqeSUdyeEuFDGz69TsTT\r\nDsyyq6q31X5F9uRAi5b5W8OteYOZ/0rr40pf4CDzBCRBm5nCK5QfHCiBkpFp\r\n2Nn8/JJOghQgIDn4Ho59xFekD2Y2oaMXaFDiOtHNQxeJK9eOefrnafxx9KGV\r\nRzqIbN87yjtAOTWk2TcjFn4JBvrRUTeHOEEQYtNwzcwI1AhbLJPsXcQb7nfO\r\n/bVsP7/nNTHRk1hjJOSPDD6ihfCHlWIWqD3UIx1JBKpc4QI3Q/40dnxsyRCB\r\n3lbZojwF1SNd9fYUR8M84j/RBlg15ognu8c=\r\n=4UxM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-6e77ed1e1c81c72b29522cef6fc5eb3c9743449e-18.x/balena-jellyfish-metrics-2.4.0.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```typescript\nimport * as metrics from '@balena/jellyfish-metrics';\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber);\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card);\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-6e77ed1e1c81c72b29522cef6fc5eb3c9743449e-18.x/balena-jellyfish-metrics-2.4.0.tgz","_integrity":"sha512-LYwbQv8AcipTHmdt7uo6Cupxi5TYGVsU2rI9BPvcONcIoN7SLeGvjzW6gqkfoHsPWICl8lHCmCwR8vFKicbJcA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2023-01-01T10:47:46.121Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^15.0.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.3.1","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.8.0","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.18","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.4.0-build-renovate-balena-jellyfish-environment-15-x-6e77ed1e1c81c72b29522cef6fc5eb3c9743449e-1_1672570148187_0.5700256293167718","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.5.0-build-renovate-node-18-x-dac458fdeacf3cb8c275cd1c47eea9c5b935b6ec-1":{"name":"@balena/jellyfish-metrics","version":"2.5.0-build-renovate-node-18-x-dac458fdeacf3cb8c275cd1c47eea9c5b935b6ec-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.5.0-build-renovate-node-18-x-dac458fdeacf3cb8c275cd1c47eea9c5b935b6ec-1","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"4371add07fb27f509fd5a5b4dea7b0dc61e36b68","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.5.0-build-renovate-node-18-x-dac458fdeacf3cb8c275cd1c47eea9c5b935b6ec-1.tgz","fileCount":17,"integrity":"sha512-XqYmK3AwRyE2NKu3NWoRpMk+GKfR9ZWAoU/84JMwCITyVVtcUnxkSsPyhCfwWTWsBWZv9V0CBbY705xBQZzKXA==","signatures":[{"sig":"MEYCIQChf7sphIp9/TXIcxqxDaIJm7caBMYNk2Xu4EmkKDvcRQIhAJ8Xq8JswGNhFceJRSH50y/FWo9Cu58By/cIGKiFWjO4","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68081,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjt3TdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrNVQ//TjXoYj/SeWxdcjtDVISL+VKgCYq8tUCp7Zkbw6eBXC8mO2oC\r\nu+4TS9Ra6Uo3vy1V5MONvEViF6j2/A+9durY6UOdkKXH/qFI3ZUF2IN4WWX2\r\nvQSkoXzJ/PC0+2V1/pAsyOd7Zxe4rXLY5Ok9hhnXei0zCKBPHEKFCY67nbGP\r\n+6bxV7M24y8hQX8JmeDuFI9mkIWZk3WP4Y5LqFW7a8wh3nA5N9O26j+AvR7L\r\n+NgeCb8SVkKLQTAT3Aji7NYfnHHvvKul0Hq7yobF5LYDzGO+tG5mmjXXjhkY\r\ntEn+uZpesdOzy0R+ZgjobbsQK43mJ8shsFppC6Mq6pTgdgFv+ykCWi+c7qqo\r\nHHkpBJd6k8JAtSB0QF2ZRgTsDqivc9WxRgLJMIgoMKmON99zeUDa9hHPQ5z7\r\n7ATy9mYOPO27bQt1ugqlMuddE1cZoBa6aMTAuGNmINNeqfzinQPPauljTJS/\r\nSSp4W7HHBPsjF2MFZVEOo0SpbyK4rnYSxQHeHrJT7SDZUUlk6GoftWJsT6xj\r\n/NSEsnZWFYfLRhK6KBQE54RFMF6osp9MqVYY0ygHc2mj8F25zHt3wmWJpAp1\r\nOWgPnyC8x8a6APLBxly385zx8ccjjIdT3ivdKqUP39dvRv9HqnUwl3peF8dE\r\nuM7war3AeOPQb2NRMzD9HdDwa6WyDCYnn4g=\r\n=A6Wk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-dac458fdeacf3cb8c275cd1c47eea9c5b935b6ec-18.x/balena-jellyfish-metrics-2.5.0.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```typescript\nimport * as metrics from '@balena/jellyfish-metrics';\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber);\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card);\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-dac458fdeacf3cb8c275cd1c47eea9c5b935b6ec-18.x/balena-jellyfish-metrics-2.5.0.tgz","_integrity":"sha512-XqYmK3AwRyE2NKu3NWoRpMk+GKfR9ZWAoU/84JMwCITyVVtcUnxkSsPyhCfwWTWsBWZv9V0CBbY705xBQZzKXA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2023-01-06T01:08:20.602Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^15.0.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.3.1","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.8.0","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.18","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.5.0-build-renovate-node-18-x-dac458fdeacf3cb8c275cd1c47eea9c5b935b6ec-1_1672967389032_0.6302372001863623","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.5.0":{"name":"@balena/jellyfish-metrics","version":"2.5.0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.5.0","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"133df6d4208f724a58c69d58eb167cb50ba36adb","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.5.0.tgz","fileCount":15,"integrity":"sha512-AR8Es8sJWzyd/jlou0dxSmcwd9MYHmEj+3OnPdbSvwNVbq80K6Gpa0C7Ke4JSuN432Vg7B7m6OaJ5CUErMmkEw==","signatures":[{"sig":"MEYCIQDC93EIVcw8qz/NmnlGSVmtglA8rxVbQH9RnkHYvqj0hwIhAN56MLVJhN30Zi17oC07Ddf7hURbsGl9zrMnqGKGzKo3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68013,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjt4RqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq6DA/+L7ZvvFS9mQxFw565+onTOhnKEo9pjfIjs7xAEc29witZi26Y\r\n0ao0fdsGbaDuZMP9TaI+/QYDbvtJ17htuZ+GAVXDrRXwYFI1+Z38DiywpTQa\r\nt5Qfp6I0ZL6GwZJY/XRn7lKjeIddcKdTuWoeQaoVKwZR6wn2tMI17O7+dvu9\r\nzmRuoTwqC3sVYv/R7+2H9ygfsUgcXqLVTM9Cnt3hKmm3Gy571B18IMqIki4p\r\nVkUdSOWfPNaP8thEzRbEMDWKHFtYFMJl7lFreg9a/H4LwUXrWlbASzG6yZzU\r\ncGm4Xvu9J/jhjCSJZMRwzs+7Mrtgz9DoASc11A+5FwvvhMg168O6wok0ptKw\r\nO+BuXse/rJaIUkVJ7HcY6enNsP6AONeQejXhxXxC4Zd5aYlJPZ+WgCsu65KV\r\n0roE6BG0XXVKf66GhJPpWorSQdZlQx+fMiXRO6kIWs8wOc3fkuHG6Or7hNlR\r\ndD5zYRc1ycDMD0c+OHOUfr8VFFNACEZQWNmrVPidTd0ZxkYNPqgzpVEhWGWh\r\nvRKFR7o/0kqNlQM5KEcQ3AkeZuA7HEs5GORHtrNHhxWaYoEujOM0EeciYwHY\r\npIw4220RtzLXTzaFCceBVnP8FgUpSE+owHYQM5Htbs6w2OEQ3eWI+E68FpDE\r\nQRQDBAWWkO8T4FUK676An34+pH5F/aC2Mfg=\r\n=OBV0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-dac458fdeacf3cb8c275cd1c47eea9c5b935b6ec-18.x/balena-jellyfish-metrics-2.5.0.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-dac458fdeacf3cb8c275cd1c47eea9c5b935b6ec-18.x/balena-jellyfish-metrics-2.5.0.tgz","_integrity":"sha512-AR8Es8sJWzyd/jlou0dxSmcwd9MYHmEj+3OnPdbSvwNVbq80K6Gpa0C7Ke4JSuN432Vg7B7m6OaJ5CUErMmkEw==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2023-01-06T01:08:20.602Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^15.0.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.3.1","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.8.0","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.18","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.5.0_1672971370143_0.08488911954380929","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.6.0-build-renovate-actions-checkout-digest-c2b304a2b07ce942c4bfc25bc1ea9d6f227474a2-1":{"name":"@balena/jellyfish-metrics","version":"2.6.0-build-renovate-actions-checkout-digest-c2b304a2b07ce942c4bfc25bc1ea9d6f227474a2-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.6.0-build-renovate-actions-checkout-digest-c2b304a2b07ce942c4bfc25bc1ea9d6f227474a2-1","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"13e0140e912835ef83763b05e27d082e81661578","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.6.0-build-renovate-actions-checkout-digest-c2b304a2b07ce942c4bfc25bc1ea9d6f227474a2-1.tgz","fileCount":17,"integrity":"sha512-ysCCkmRVBSH2Cl6cabi/NnrS/GfeipfFmlf3p9G3uXRJC+O9loVY14jlsl6UO8tJ+0QzYgE9W4OlEC7tDXDsbQ==","signatures":[{"sig":"MEQCIAuvkiTp/1wsRqDI6QdTbLuAmeGIYO9JAHeBX/FwgZRRAiAGk87H6ck914a8RxlfQCG39keGeVr4gWn7E8aItUn9aw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68095,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjt47NACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpH1xAAgqN+XBSq+82htk6sS0YQs/iBBX0JkJwwK4SGDWtRraxu2Ugf\r\nTNqUzaW7iZ6QVkLsQoY2mBcAYlnVA1ZoP+6OuUC0paikFrb8WiE6djBz4+7f\r\nPKXn8sXg7AUbLAUiu1MELVywpcL8MCr48j0lokUYGHu+sIh1/Axwpiponqtd\r\nkfoy4/GD3GAlEFL91j/Z2IL9Kug/1aoWIgPRTKbLwtx3SYdwS+vRNslpS+l3\r\nJbEnkz3n+ZBUCJiTSEOYoaPKRcyWZ54hSAuGjfWlBkO+UCu5/GPJbgXcV7d/\r\n41bR7S75akSmI2zbdmrXXlXtR01YVlgqZfONRnndZBqShDxW5PYqw/Zvfcjd\r\nwtD+sLFbNEO4LuMxpkNqmqCIYJ//vSPq6VPxCtPkVqtzfuoE5W2msR82fC7a\r\n7Go/Bu1QiZqUW5PCI1StLeg2m8AlaSGHWMyu2av7tjSh62vnH7Gwdpe5WG9D\r\nU90AH50xF6XTKILFPPgMyQXsA4GifSDH/woA5djX0D9tQaz9yl1CFFTGow83\r\nhiK4uWxxuThBRwwltdjabAX0n/ic+qG4KyEahFH8c9b1XL4EC5jkBu9gPmIA\r\n2wuLTk2mvL3VWDXwYAcUwc78ySYwiDfG9Gv0Y8JLHvNkrKVWsDjoMRu8ClrD\r\nMaFvu3N8U11KaJkvCm6/yd6w68RToHTWpNs=\r\n=MDH8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-c2b304a2b07ce942c4bfc25bc1ea9d6f227474a2-18.x/balena-jellyfish-metrics-2.6.0.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```typescript\nimport * as metrics from '@balena/jellyfish-metrics';\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber);\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card);\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-c2b304a2b07ce942c4bfc25bc1ea9d6f227474a2-18.x/balena-jellyfish-metrics-2.6.0.tgz","_integrity":"sha512-ysCCkmRVBSH2Cl6cabi/NnrS/GfeipfFmlf3p9G3uXRJC+O9loVY14jlsl6UO8tJ+0QzYgE9W4OlEC7tDXDsbQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2023-01-06T02:58:52.191Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^15.0.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.3.1","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.8.0","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.18","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.6.0-build-renovate-actions-checkout-digest-c2b304a2b07ce942c4bfc25bc1ea9d6f227474a2-1_1672974029626_0.21075225634060368","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.6.0":{"name":"@balena/jellyfish-metrics","version":"2.6.0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.6.0","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"887aa2276be38442c48a7b0bc527a42a4c41aa5e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.6.0.tgz","fileCount":15,"integrity":"sha512-RZ5UK0GrQA31//CtzcMIMWVqza/Pb8I3/lIHxCaRg0C0yWG3gQeNDGRkRtdYdCAGiX2B/GMoCSUJ551ClXxZvQ==","signatures":[{"sig":"MEYCIQCFFiju18FZxD06WlIvE9Df7ODoXLWIcJE19SGCbqZIWwIhANrXt9OvAKnDlh51dNPqHKSOI2Qm20e7I9oUlUkgS/ms","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68013,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjt4+YACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmooERAAmNTWroeLo8szFpoSvB5TFbqrbjulFUWbEJnhhlkbHIKGlkAp\r\nmROJdUmvfRD4Qhm9NpNNI25G/heRXQJJWr1mUxmiLCPI1ygsbGHx0ReY3YYy\r\nqYR+x0LzHSvMMkrrEYYg/UuJjWXJnzukuNaXSdoaheeJELCIOTRB+qI3ZiZw\r\n35JBIazF2taPtTMs8cgUic3Dl4iFsB3Yd3vty/ypHZ+4YAh7pQ5Q8YFSInB/\r\nwNe/4SzTRQukrbxAGDK6ShYtWtm9hmwbkeJhkgBTnTBD96RheBQPNzrupXMn\r\npj1G5JB2dMsVJxxqqVc/41suSowowzK4j3oNQjUIzFAs088IXCN/6xqRNDcX\r\nIEt0TiG4c07hJJ/5bBJUP8LRWCs9lexMCcAxhyDgkXJuCsmj/VZdVNtZbHf4\r\nF3CRDbXr/+OGdMh0DFlP+FXT+2Jge8WBkSYHxU/+WgyAKSB9Hc55MH4f80+f\r\nxwwpEmotbC1/WLduarZKKEQj6EOjL3NV06zWhO2tlSkzE9/s4qIZMlhtxP/P\r\nxtqBBsP8AXAxzujTwh3c/+eFsrodAgvF2yWaATFZ91+SVBOc4rdwKjb5GI+C\r\n5qRDpGtwnFhoVKZyUJD4DnGLpHB55q8qoQzqnnp8lisQKSxpgs1XGG+yMxHC\r\nifTlZNrGydsf7GnKrgjrBgqfs8FYnqbME8U=\r\n=8ZDN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-c2b304a2b07ce942c4bfc25bc1ea9d6f227474a2-18.x/balena-jellyfish-metrics-2.6.0.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-c2b304a2b07ce942c4bfc25bc1ea9d6f227474a2-18.x/balena-jellyfish-metrics-2.6.0.tgz","_integrity":"sha512-RZ5UK0GrQA31//CtzcMIMWVqza/Pb8I3/lIHxCaRg0C0yWG3gQeNDGRkRtdYdCAGiX2B/GMoCSUJ551ClXxZvQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2023-01-06T02:58:52.191Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^15.0.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.3.1","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.8.0","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.18","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.6.0_1672974231811_0.906588714876301","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.7.0-build-renovate-github-codeql-action-digest-6ba30df7fe6e2d9d3c87d76ee6b71a5bd8f4c48f-1":{"name":"@balena/jellyfish-metrics","version":"2.7.0-build-renovate-github-codeql-action-digest-6ba30df7fe6e2d9d3c87d76ee6b71a5bd8f4c48f-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.7.0-build-renovate-github-codeql-action-digest-6ba30df7fe6e2d9d3c87d76ee6b71a5bd8f4c48f-1","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"9938dd890fdf7fee427da81e58e8eba4aab3c616","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.7.0-build-renovate-github-codeql-action-digest-6ba30df7fe6e2d9d3c87d76ee6b71a5bd8f4c48f-1.tgz","fileCount":17,"integrity":"sha512-0IZ/l2qlHS+zFALviL+Fmt7FaKTn+iSnL8W8l7WK72qYQwIwoNct9UpldF6y1KGAlUK9ijgXiukWWLgvxfavdA==","signatures":[{"sig":"MEYCIQDnmktkN7w+qswQQccBJiRIrpbm0m8kwgPU9ka2ZPeEOgIhAPQN59d19pZtVdS1WcfaHXR/ebC6iwS9A3sjofkMmq1t","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68099,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjv+Z6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpgGg//QA1ZocF37DhnNWU3RGIyNmciqAanpuZr+0QjlkuCLb6DsnBD\r\nueyaIR1ZcWvw0Dwt5TxvUwq+LC1hHiiAVovIUr/MeXURwY7ZMqgv+5bLPVw4\r\nB6CVrtnoNwWiprH0u4fsatdTlHxfnGFK7IF1kwZkJf1kxsF1jeQvVk5Q/xi8\r\nX7D2TdqcNIccSKfjYSJyJ8/NMOuwsFksdZERVkt0X04hNWfNplUtOfOI5Y8B\r\ngnPb/PcNSpuBt0sL/M5S8ImCWEqZEQltOdZ0vFKTMDacofysUgYaff38TzfR\r\ns4vxLV+c0EmYWf7GAe5bq4JmNrfDFpAzEXsIX5GQ+d2QJyyG+1+jMU8fMDKV\r\nezfIai8Cm0IbYkThK1O6TsjVPQGxnn+E97KiiMCp21f3up20Kge+2Q5kLT9+\r\nnMZ2qDgRhlJdhId9VSevbUsXxFaqCNOZ3VUvmkHT856xuWmltX5Yb5JQObE9\r\nyK4PTwBK2wo/VAjzvUDm9l3dm1uaTU0OuygzIMNTYh04VC9Ea4EYVuFYVPTV\r\n4Ngi5xpqmvYcwCOFoDODXlPeh6rBCiLfeutd1nbx1vJPcBg6PLSfxfnEW6fQ\r\nEKRM16t2rEa8SKFQQB3KObGZyeZPPyZsVUPTwAXdXmZHegrtcGXN5X/0H/Yt\r\nebXuXt8UA68eclQsUyB5Cgj6/QmLBY8cAKo=\r\n=Goy7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-6ba30df7fe6e2d9d3c87d76ee6b71a5bd8f4c48f-18.x/balena-jellyfish-metrics-2.7.0.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```typescript\nimport * as metrics from '@balena/jellyfish-metrics';\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber);\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card);\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-6ba30df7fe6e2d9d3c87d76ee6b71a5bd8f4c48f-18.x/balena-jellyfish-metrics-2.7.0.tgz","_integrity":"sha512-0IZ/l2qlHS+zFALviL+Fmt7FaKTn+iSnL8W8l7WK72qYQwIwoNct9UpldF6y1KGAlUK9ijgXiukWWLgvxfavdA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2023-01-12T10:50:56.882Z"},"_npmVersion":"8.19.2","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.18.1","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^15.0.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.3.1","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.8.0","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.18","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.7.0-build-renovate-github-codeql-action-digest-6ba30df7fe6e2d9d3c87d76ee6b71a5bd8f4c48f-1_1673520762031_0.15297523646270084","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.6.1-build-renovate-rimraf-4-x-2839bcaaf6862ab2eb59e2a082a52a579e1a4558-1":{"name":"@balena/jellyfish-metrics","version":"2.6.1-build-renovate-rimraf-4-x-2839bcaaf6862ab2eb59e2a082a52a579e1a4558-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.6.1-build-renovate-rimraf-4-x-2839bcaaf6862ab2eb59e2a082a52a579e1a4558-1","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"f391e698803f560378a0a07e42af3b3edb010479","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.6.1-build-renovate-rimraf-4-x-2839bcaaf6862ab2eb59e2a082a52a579e1a4558-1.tgz","fileCount":17,"integrity":"sha512-h5Ca5+W+IAXWhCkFxR7TRCQ6N6XbKwQSt2kd0n17ekk4FM1QgAWLup5dSFRcE4jqCQRio/8Rwc8j8Is1tekWSQ==","signatures":[{"sig":"MEUCIQD8DmlEtA1gTH3lvMOBFfG5zFgcmQNHFDO+CMlityet6AIgGWSTjgjDhgHid3qKSuI2FbcN2SOrv0tSo/wKeSM9S3E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjwLAOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmphrQ//Zck7OanEKLwEpoqd8nLuoT2Q8DX2mpfjvnqgJTcIQakklOwF\r\no4jkCDH+5mixDmiqGw+2e9mEbXuKWjw1m4SAoMKQPOhK7FX34IHP+CAEN8YZ\r\nbMU/+IbvHHC/L+NRtghkn4uIF1U8Cv/7QnQFrhRekr2oeokJBaF2FsS9hhi5\r\nQlipihjagBAgqExY9EYsN5y2fBEoWPpImXPWnarQLy55kGZ0szvyU/Htx+nt\r\nM8A7zpzLrpWIdDdAnpUoSQK80/wWMlz9OL0mTRoZUIz8Ebby+hqiCzkuMVoa\r\ngLmltmRVtCi83by06kurwnffjxM4VMqSQ5awwzO5LsldCPxaUQP8+DY3WwIY\r\n+jQPHvazXjnG/Qjt+DsYHGAxfjzYuzfYxWbFgjKGEu0s8MQ3Sh4bnhxUVwXG\r\nlQXL6GpQG1+LnVA5aNZ0NCVdQzgYUfsliFEyz+v6A+aC9g/TPvBVuP0vb0FP\r\noFrjKp02588nFsI1z17d6ZhvHT+rcyU5EdyG7M4IazYOQf9vH/BCLlZyS/u1\r\n8QG34BOM+QNjXZXrhGLxgRXDqp6xhxgiF/qG5CkGwOOspGEb5hdyMETue5Wv\r\nA8Nj+qogyTuJCOd5qYNty2tp34h9A7foOZmldZ72wfVenkzXTzcybGjd617d\r\nrTwd/4HB60dGfzOXiSXnYt6q71TXQMXksIQ=\r\n=ITfK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/npm-2839bcaaf6862ab2eb59e2a082a52a579e1a4558-18.x/balena-jellyfish-metrics-2.6.1.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```typescript\nimport * as metrics from '@balena/jellyfish-metrics';\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber);\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card);\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/npm-2839bcaaf6862ab2eb59e2a082a52a579e1a4558-18.x/balena-jellyfish-metrics-2.6.1.tgz","_integrity":"sha512-h5Ca5+W+IAXWhCkFxR7TRCQ6N6XbKwQSt2kd0n17ekk4FM1QgAWLup5dSFRcE4jqCQRio/8Rwc8j8Is1tekWSQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2023-01-13T01:11:04.764Z"},"_npmVersion":"8.19.3","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.19.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^15.0.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.3.1","rimraf":"^4.0.0","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.8.0","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.18","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.6.1-build-renovate-rimraf-4-x-2839bcaaf6862ab2eb59e2a082a52a579e1a4558-1_1673572366634_0.2051438200965734","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.7.0-build-renovate-github-codeql-action-digest-8ed3ee65c14f1fba95aa8b85836cfd921df7197c-1":{"name":"@balena/jellyfish-metrics","version":"2.7.0-build-renovate-github-codeql-action-digest-8ed3ee65c14f1fba95aa8b85836cfd921df7197c-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.7.0-build-renovate-github-codeql-action-digest-8ed3ee65c14f1fba95aa8b85836cfd921df7197c-1","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"facf8ddc6628b65eeea92eff53cdc9b6c6a61439","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.7.0-build-renovate-github-codeql-action-digest-8ed3ee65c14f1fba95aa8b85836cfd921df7197c-1.tgz","fileCount":17,"integrity":"sha512-7oJ7Mzh4W9bcpAlmWfY1jRYCBeyU3ZJdmnDKTRAOGOTmwqwyJSO4dXXmGyGQCHgxMTBLKcXoZqQPOrzhqpy4cA==","signatures":[{"sig":"MEUCIQD4br8AMlm66a6jDoEu2P0mGNKtXLmp5swG8ANfxMupOQIgPKSYXAqHDoPQjifvqPjaexHWoMKZiepjBfE8icsYfgs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68099,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjyD/fACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpOkxAAjQUcU1eIKv2n+qqBZm42ccV2F2ZDMP350ABQ21Rr0iRgdil/\r\nPeWvd5vEZuvOxqAiwv3ZHoh0J9qr5NW7pF8NlKL4+NpnLf1CY8r3YjceefJr\r\nqaxJK6+bbAMSR7e9XAA0r/sDT3898NW8OMoOBax7JGmMNWh23AxqJRpzEcB6\r\nlbGM/vXAQ25zMHHFqK1iCfQuZh3UFEfws6cIqyvxLhO2ho3pUCPr3QdQVSXl\r\ncVQcr003XoOTLIB9UF5VElOfPLJF7ppXEIeOTP+y2ZoKtxHrHnKUrl4pudJy\r\ne5MFcrQ96zSlNrUmkOqjcFnSsb5U6D/0TqK+RNZZZkbZ4X/P3CmqZyAe8Jii\r\nd4g92Y2mh9ojw0PRr1I+t/vmpRKnGTxguJigGSPE+Yj4WhH8WOlYv2LOkI1a\r\ncY1KptANX3XDEn3FbmM4R9myjHgRPDO18UGmemh6mY9FRjfiilrMtK35U0CN\r\n7huXzBLmf5u/qE5IpS3FOIUbbb2rlEIPqbVn8i5nvbTI6BZnJZU7FrmcS+2V\r\nAzSGvWJ3gcPmMv9MKCdbxYRxhamx4bjG4TiFFwp2slvI5QRHg4BoD54QHeI5\r\nFBRIVg4ZWqoaEqMVLA8P71cg0siGbk6nlvnwpWP8uW4qLZ4ej+piGAPDMnMz\r\nTH0fn3QlddoLT0NbUKwA4iF6Y8wa4RHsvkI=\r\n=1PPD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/balena-jellyfish-metrics-2.7.0.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```typescript\nimport * as metrics from '@balena/jellyfish-metrics';\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber);\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card);\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/balena-jellyfish-metrics-2.7.0.tgz","_integrity":"sha512-7oJ7Mzh4W9bcpAlmWfY1jRYCBeyU3ZJdmnDKTRAOGOTmwqwyJSO4dXXmGyGQCHgxMTBLKcXoZqQPOrzhqpy4cA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2023-01-18T18:50:30.402Z"},"_npmVersion":"8.19.3","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.19.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^15.0.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.3.1","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.8.0","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.18","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.7.0-build-renovate-github-codeql-action-digest-8ed3ee65c14f1fba95aa8b85836cfd921df7197c-1_1674067935109_0.8627846416141163","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.7.0":{"name":"@balena/jellyfish-metrics","version":"2.7.0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.7.0","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"db360cc8d555e665bd0bb81dd38b996a4259ef6d","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.7.0.tgz","fileCount":15,"integrity":"sha512-SPxOuj/yMNBGUTYcUhDidU+jME/5SyUITES8/p3CnPWvs5ZrEUGKMOl7kffHTrSO0pypFG1986Pn/+CuvQOq5Q==","signatures":[{"sig":"MEQCICeuAjQ3nibk+euzjJIRiSL7O2haHV6WLPk5WcUMQyswAiB7PZI6PtVfxiqIHgs3B8UUsGs9DH5C5SKjb7n9FwG60w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68013,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjyE4vACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoDURAApHQRnTzAdbG7ji0GLbFdI9VDc3W0XeJ/Gigsw/kdCwk08Tnz\r\nQDxmnKVBxuQijZTiozg9YLa2p2PGBkZpBc/ju0Bfh2gEEfxKb21xR2kWJ92J\r\n8dNjpK5tuSv02tXUI+fjuSu+AWsixuL+BU7R2uwMzGdByVj/Zv1G/NkxSg8d\r\njyY9ybaBVYdNuBhR1KYMovZhavP+MB7Z3CKGr7NOTN9Zp9SyLsfGrex/Rf4n\r\ncQGJjKP3VfxX015OHhGQPJ01QltixcPVc8QmvQ0pxKNxV8FXUjMmNfq9p95J\r\nY+P1cA3bKU0blKuQmO6mMtPKGZvr/hVuatYwe5S3bnVe2W5EohhcrXy3S6lI\r\nEWR2wppZrubDFrQngcPZbCctO4q+v1pj1fhL0TaSFboj/p1IXegdtPTSgKOI\r\nBo4LXaIoRd07MDaWb3jDiknI7QFgSDLZSeJKx+IaL9Krh4Jhcu3Am3iX4mZI\r\nTChZep4Yl2YdgyEhNvaZYAZP99S7q4D87s0s8xkIk5HDJ2fBDjXADCvXDLC7\r\nhXrgA7IzDhqDc7WmsKc8wovoWP8zkBdWCYSupp5kob8adasvH1LHIlT05sK/\r\noGjpOTiBB1veAB+3q2ODR18AUPecj4PE8BZyY3orbYutY3cKPgK/8ESKk+t5\r\nwYvwGkb+KlBuvoR8b0vSPJqaksxguNcKo74=\r\n=ecPP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/balena-jellyfish-metrics-2.7.0.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/balena-jellyfish-metrics-2.7.0.tgz","_integrity":"sha512-SPxOuj/yMNBGUTYcUhDidU+jME/5SyUITES8/p3CnPWvs5ZrEUGKMOl7kffHTrSO0pypFG1986Pn/+CuvQOq5Q==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2023-01-18T18:50:30.402Z"},"_npmVersion":"8.19.3","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.19.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^15.0.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.3.1","rimraf":"^3.0.2","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.8.0","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.18","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.7.0_1674071599396_0.13579298785779126","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.7.0-build-renovate-rimraf-4-x-fe3c9a4cc720424b1007cb59f420ef2fa12ab3bb-1":{"name":"@balena/jellyfish-metrics","version":"2.7.0-build-renovate-rimraf-4-x-fe3c9a4cc720424b1007cb59f420ef2fa12ab3bb-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.7.0-build-renovate-rimraf-4-x-fe3c9a4cc720424b1007cb59f420ef2fa12ab3bb-1","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"e64a49351c3eb6c2dcf89fabe0df6e5f09979430","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.7.0-build-renovate-rimraf-4-x-fe3c9a4cc720424b1007cb59f420ef2fa12ab3bb-1.tgz","fileCount":17,"integrity":"sha512-HLmqvMODDbzdnx0o0e6eBjfLlgze5Rlnw/S0Vwd/nn2S5vKPRiqMK6f/AqwAof6l9H3d5R1NGwHAOHPGlJyVMA==","signatures":[{"sig":"MEYCIQDngznQhFYhOktUqWxu+FcrGyuv+ukwWHsHsGUKGeu3PgIhAOCilK40vBAld5oFCAHTNpqHIn0ziLJoo7QZLDnfNXtI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjyE6FACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpZ7w/9HM0vq64/37xRaRSwMW9Rlr/q6L1HU1wzKO5Enl4YoDrrZKxK\r\nUpmT69ngWwZH8LsPJYBZYkybEoUmM0W1RBSVG6bHZzYHiwRNCoOe/KSRVoJM\r\n+kSSbYzX8Yt9JY11CNonVtIi89k1TPjdXPEkYwYDFNDD1X/zZ8KWtd/nLef1\r\nTEiJoemlVknsFVGBMTooxrP9361bv3MCOftGVRsjWC3FgqFchP9JuaaCtGED\r\n9SUYxGmoBmJVir1WIpd2K4Qs61t66VYVp5I1q1/wkwx/sxmhTqShouQnUOoZ\r\ndWe6JS3/tNI0pB7K8lf/AjgfKxcT2IsZb2s+JAnXoHEH9ghJ+Vr9S/+DHlUJ\r\nIa0UdBJP4BDV7Dnuv+/LvZ5tJ1dShwOBbUMeKIsCcW+jYqXdE4HfGMv7qP+T\r\n1Hijasx2ea8G9Pxaov1hSQg5un8bhUNLE5HrmBRDTWLaK7E2cWEYK0o4M0hJ\r\ntP9tes970XBIJMresRwlnv6BKjB2jFQypeyWtxLsiKpGG3cyKkuj8u9OIwZ/\r\nCqCijnnq2eHHYqTCiaNg2HIC04PhSbOcuWk3rKgn9MMlBA8IQkZx6knsFhNP\r\ngjs3PJCaaS1/i/sMviKKOzvhlT0GDiPWE9I01lZM6zoeOl8ILMi/ZAy/jZX7\r\nqHwwxqNk9NxtmvYTjXMI+rI52MH9tUl86gQ=\r\n=ktnO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/balena-jellyfish-metrics-2.7.0.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```typescript\nimport * as metrics from '@balena/jellyfish-metrics';\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber);\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card);\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/balena-jellyfish-metrics-2.7.0.tgz","_integrity":"sha512-HLmqvMODDbzdnx0o0e6eBjfLlgze5Rlnw/S0Vwd/nn2S5vKPRiqMK6f/AqwAof6l9H3d5R1NGwHAOHPGlJyVMA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2023-01-18T19:53:21.301Z"},"_npmVersion":"8.19.3","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.19.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^15.0.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.3.1","rimraf":"^4.0.0","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.8.0","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.18","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.7.0-build-renovate-rimraf-4-x-fe3c9a4cc720424b1007cb59f420ef2fa12ab3bb-1_1674071685211_0.7624151280064486","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.7.1-build-renovate-rimraf-4-x-2d52bd8d83239690d61f1e2f01b1177a1896e636-1":{"name":"@balena/jellyfish-metrics","version":"2.7.1-build-renovate-rimraf-4-x-2d52bd8d83239690d61f1e2f01b1177a1896e636-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.7.1-build-renovate-rimraf-4-x-2d52bd8d83239690d61f1e2f01b1177a1896e636-1","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"19f874cf84760742441e7d8ca96d7cb3cdd6a0d7","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.7.1-build-renovate-rimraf-4-x-2d52bd8d83239690d61f1e2f01b1177a1896e636-1.tgz","fileCount":17,"integrity":"sha512-AbimD7eQrWmv1n6xgn6WaA/ZsuU4Aa3fFyEOq/C1/N5qzWmI8ZdhgIfuvSyWASG4tTXxX+SJLv9XqDl1Z00NwQ==","signatures":[{"sig":"MEQCIDoyMEeciidTaYLSQPusuupKO81EQma5f3N5+z7+bW6bAiBmkBfYHTelkUL8bxnwiujZmfBLyPX7JZCnDuIIpKzGnA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjyFwqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqJBg//XZ1S9X7LDT8gFQi5aCnXDpokOBuAoTpeuPzS8nJhcROrjCx8\r\nZ5h3OiCM97/04EQ9uuUoEAmaJ8IyyfQ0viyXJ9eJQnMYL1zDvCJIa1Z0FIHf\r\n9ovaBI5B03gkM4eP0fU1YcewWdsc8/68ArQI4tpIlvJsPZIEWLLh7DBRu2Vm\r\nB9U6w0A4XYNjX9Y2mkJVXWdX8RWxTZPrYyflZnMkFaxOTwSyvOpsQdecwRHw\r\ngZArTIU2Hu78gm/YCS/JS2JMxWfwLjODoLeAFX05bFvN29mb5sTKTJy8yQLW\r\nsW8WmCnuFyCvvFcPv5R+Bt3hRguts8+l8MqlpdkDCdWZDKseHhHOHhbCakZW\r\n8EuMnf1rcDla5lGnvZO6ss8ltKj1bu1oH9VZoVVHQyvX8E+3GPoMW0JrjEQ1\r\nM1V8skejJD0/1uX9AI/vMq2V/4ixEwE6mC3wQojU0NtK1ARLEOC9w5cJ+Y87\r\nO6shHak9aHUNApXNNUp8dmyCqAJFI7u2bKysPTViEIOs+9c67pFreTiVgpXL\r\nD/P3o2v7RNjmzjrPBtHIPZpWIEuNLILybgRt1Vt6aZIpZsg0+UkvJLnIDWI6\r\nMzG5UkRm87j6zSDlv/tlYZe0qKL/Z1f/8T81fUsevW2rVE5Pwpv/LVWOPF1q\r\n+VpbVK5XoRvELCCTbeim/OhG912YYOe6Q6w=\r\n=28qK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/balena-jellyfish-metrics-2.7.1.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```typescript\nimport * as metrics from '@balena/jellyfish-metrics';\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber);\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card);\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/balena-jellyfish-metrics-2.7.1.tgz","_integrity":"sha512-AbimD7eQrWmv1n6xgn6WaA/ZsuU4Aa3fFyEOq/C1/N5qzWmI8ZdhgIfuvSyWASG4tTXxX+SJLv9XqDl1Z00NwQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2023-01-18T20:51:33.181Z"},"_npmVersion":"8.19.3","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.19.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^15.0.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.3.1","rimraf":"^4.0.0","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.8.0","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.18","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.7.1-build-renovate-rimraf-4-x-2d52bd8d83239690d61f1e2f01b1177a1896e636-1_1674075177897_0.2399317423424292","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.7.1":{"name":"@balena/jellyfish-metrics","version":"2.7.1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.7.1","maintainers":[{"name":"page","email":"page@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"46660fedfd116d71a239d989deca5cc8b552247e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.7.1.tgz","fileCount":15,"integrity":"sha512-GyLL0TR9XQ2bzqS3mQxlIcu9vGWjpYwyo8DAsPwNtKnXpamn0vOn3DGz07DBG+0fhhC5ONQJA2Y6BFQqKTNf+Q==","signatures":[{"sig":"MEUCIC7C5hqZrHGNokwAeE1l3IWKw1Lc0hpiwX6cheslWvfFAiEA/wc4GQCVhzJ7/6PccA8de2KD4C+aguZV1kRkHv/0gBQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68013,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjyGqtACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrCsw/9Fjp3hDK8G8zc90VkO5b4flKnhHwk2UXWgxNSIo8REqhD+crE\r\n6Wcauzq2zlIZuiZwoRTncA4XW2bonuaZI2HgOqqNp/QSA+tG23Nv8qm8Nb2E\r\nZbVI39pz1K0vIfeaEZZI55qbcT4FqwBj6OFZu3ljqsAmE6y++x64AXDWo4uy\r\nO7AzID4rqNmXzcSb7lCj7FpDH5+iSiziYhgs7TOF6ASmH+x0zDkuqM7zvkk3\r\nGK9k/hRBBnX8Jcmr67oFmjqSxI6ZRTizN2yL379ODidQuOn0Qaj3yxke39F8\r\nCGJoJ+RF4Na9HQg6pnjOeFLfyvIBlN9MGhew4U3zTyhcjnyeMvyOn9XsAoHG\r\nUW51YBZfPfdrPyDN5Pd7BmPbTNNzr9gSDfOnpPHqMierP8iR3cy1Mx+lRru4\r\nKxiLT3VjaOBNdTVmMd5FWALVke9coNd5tPY8ebkBeO3Kf96mgr9bjMaEE/L6\r\nn1Z8R2KJUciSpoJsGJh5jBWoEAWCv/jWYyWnDzXcOJAlfnfsc7n2c5A1d2rp\r\nqwEVqDNUmJwRM9GLO3zDUKJ5QmZODmj7pjvGcarzIWeJjRmFIHS+pt16KVqU\r\n1S5QDfBTgqmrrPILVE9sk47Bwm9qz8t91NtI80YUugJ6wSJpiu+M/I4T15wu\r\nENid0JPSh72WlaSHlQ2larw1Xs7pwhPFZfw=\r\n=IJBy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/balena-jellyfish-metrics-2.7.1.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/balena-jellyfish-metrics-2.7.1.tgz","_integrity":"sha512-GyLL0TR9XQ2bzqS3mQxlIcu9vGWjpYwyo8DAsPwNtKnXpamn0vOn3DGz07DBG+0fhhC5ONQJA2Y6BFQqKTNf+Q==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2023-01-18T20:51:33.181Z"},"_npmVersion":"8.19.3","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.19.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^15.0.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.3.1","rimraf":"^4.0.0","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.8.0","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.18","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.7.1_1674078893423_0.04508848300986301","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.8.0-build-renovate-github-codeql-action-digest-d6a6deb4074a6b870bd2440de03127b55eaa9ff6-1":{"name":"@balena/jellyfish-metrics","version":"2.8.0-build-renovate-github-codeql-action-digest-d6a6deb4074a6b870bd2440de03127b55eaa9ff6-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.8.0-build-renovate-github-codeql-action-digest-d6a6deb4074a6b870bd2440de03127b55eaa9ff6-1","maintainers":[{"name":"dfunckt","email":"akiskesoglou@gmail.com"},{"name":"page","email":"page@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"d00a2f216bb96290ba5d0b07afb28183546396fd","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.8.0-build-renovate-github-codeql-action-digest-d6a6deb4074a6b870bd2440de03127b55eaa9ff6-1.tgz","fileCount":17,"integrity":"sha512-6xc7PUGu0shUlGm6dry+OOLY8PqSd8Sh2b1xUjtPzcW4UWWiiQMTGchaxxOA+NMrI3iXuriNoP31+eVM0rp49A==","signatures":[{"sig":"MEQCIB8gM5sr62sBMaxTredzlCpYHZGfd6YTznetXu7RoQ7LAiBlHj/mrBgaJDivUmGj4GBO8UlSzQSFjs7hbE1V/7PKWg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68099,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj0rBUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpGWA//YfrMNtn8xf77y7v/FMG4JVu0NV71XJP3fDmYPVPIfy8bMXt2\r\n2ndEJsWL1ImUSigWEZyXpMqQMJkNWbnD2ySL5gQmGl04NjTgOUHXSfwdh8xK\r\nSUaQznOzxbsbV6hUmcOzlY2HGQQTGJ9oDqWfdld0GARplpgVyJreXouXqmCi\r\nTAJSbF+0PJWf5AftcJNOjn0ak1Cji/wPcbb+Ox1fiVYPvjX2iy3tH6dLozv2\r\naNkGlObUQiZE8AXH8QEtp65XGN4dU0qXtGR52s5b5HPXg1wUDp06J9qj9ELo\r\nliem/HFGNgDWr/RVpKXY8a0mbY7f8GONdUlbl5A7/0qurP6kSsbLpzwOseT4\r\nDfuGBIAQyfy82lT6h6BqbDTCaSHBgO3m2IoUly4IN0PqAitzwhypxz1Qp2RV\r\n+amVVfgKjCBI/a3zpP+00o4o3WQS7/qYzaXMqG0yiuSDH4ovqjVZNu2tWP6X\r\nL0kIRMAKlNdJk6rAT3qRhV7HIYedZzl4UgqFO1ThRHk4wu+KHIAP6Je0KHnx\r\nfjHwT8qA/FGNs39cYy+5m/zqWC/FuP/OJ/0uhKR3UAVjF+9F0pA4+VPt5FV7\r\nNbw24OZMRe/DEGu1ZkdTcjv/0bVrb2+deLYJlyf1tYE3GxaG9+B+a0z7OLe+\r\nbTBkZ2OjFsqWkz1MjxhTKoukT/0xH64XC6I=\r\n=ciMq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/balena-jellyfish-metrics-2.8.0.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```typescript\nimport * as metrics from '@balena/jellyfish-metrics';\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber);\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card);\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/balena-jellyfish-metrics-2.8.0.tgz","_integrity":"sha512-6xc7PUGu0shUlGm6dry+OOLY8PqSd8Sh2b1xUjtPzcW4UWWiiQMTGchaxxOA+NMrI3iXuriNoP31+eVM0rp49A==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2023-01-26T16:53:23.404Z"},"_npmVersion":"8.19.3","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.19.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^15.0.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.3.1","rimraf":"^4.0.0","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.8.0","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.18","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.8.0-build-renovate-github-codeql-action-digest-d6a6deb4074a6b870bd2440de03127b55eaa9ff6-1_1674752084264_0.9171467342173196","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.8.0":{"name":"@balena/jellyfish-metrics","version":"2.8.0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.8.0","maintainers":[{"name":"dfunckt","email":"akiskesoglou@gmail.com"},{"name":"page","email":"page@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"7d786df3e54193e3e3e9b2e44c3f3f51a106c333","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.8.0.tgz","fileCount":15,"integrity":"sha512-tiS8E3XWyvPIuQT2lMxN7HC6Nsu66sLD4lNzjz6/AiRi+HoR4AXdbL40A5HdDf4HTb4T5PpM5v94Mkqaggr7HA==","signatures":[{"sig":"MEUCIHwQ5bahqZllEj1saaS3zTJiOg+5rKwHS30qT1caQAEbAiEAys5LszbMBugjCW71aLDthF/An300YY3M4YM0Q9/SW8k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68013,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj0r3vACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoGBw/8DWgpUEzZCbAu7+S6565H7gvO+w9FROMX0X4VgWr0pTBJGWqV\r\nJLPfh8I3Rfesy4MYjdm8etotWmAonGIZa4rihPfNUHjmpX+c5+nWmoBNubbG\r\n70Y7vwuDpuLSzeQ67uwbWPo2UTPyIImBhHCjA/fR6AL5C5ArBh5WtIY5+8xU\r\nvzm38ZR/y/+7XG2KeOHNybtUpZxqDh+tM5cGM13U29yC5/sDMa5M87U3cL6u\r\nStcw5mAu2LdXxsai0HxKIVEl4eRDc6G+5KkSPUQwlrbwHeBr1twicy899Uv6\r\nw4ot/q1+V4Xp2N29QjAWVL2+yofnH9pFrF1Oz7T40sp+umlbUMxM2DJDN/re\r\nDPhYv5s5SKyedTr1EqK2Hq+QEqmnsgvQD/5AJgiS75EjkVjPo0v+1Yfn/4Vl\r\n/8Hllgo2ntb82vP2irDuTx5Tx4ZXHHxwdln3l+/IqndHetmDD4+w/FBDf0Ny\r\nNiDSKjIDLqTfAcUdoKHg938YNgyyiIxlbJPS9nMyb5djqS2gZ/q7qRckhi51\r\nIgYH5mDRIOM7Ac+uCA27jBNzmCTw/rYpZq/xojUhKMnhIDmqp0GH/E4VHud/\r\nanTzQEQYHm61XrbwcRvOheWomNT5lRmz9dEhv/D8nI3LsjE+42hMY7/5YWcA\r\nGQN1x1nx+2/2vAbBK9eo1ZjEr38rw3pKUIE=\r\n=iWIj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/balena-jellyfish-metrics-2.8.0.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/balena-jellyfish-metrics-2.8.0.tgz","_integrity":"sha512-tiS8E3XWyvPIuQT2lMxN7HC6Nsu66sLD4lNzjz6/AiRi+HoR4AXdbL40A5HdDf4HTb4T5PpM5v94Mkqaggr7HA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2023-01-26T16:53:23.404Z"},"_npmVersion":"8.19.3","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.19.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^15.0.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.3.1","rimraf":"^4.0.0","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.8.0","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.18","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.8.0_1674755567232_0.36835651827483074","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.9.0-build-renovate-github-codeql-action-digest-237765c1aa60829480d5ba80da02c38abaffd726-1":{"name":"@balena/jellyfish-metrics","version":"2.9.0-build-renovate-github-codeql-action-digest-237765c1aa60829480d5ba80da02c38abaffd726-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.9.0-build-renovate-github-codeql-action-digest-237765c1aa60829480d5ba80da02c38abaffd726-1","maintainers":[{"name":"dfunckt","email":"akiskesoglou@gmail.com"},{"name":"page","email":"page@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"964ada1350287ab75ea843ad57b35e52b09b9504","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.9.0-build-renovate-github-codeql-action-digest-237765c1aa60829480d5ba80da02c38abaffd726-1.tgz","fileCount":17,"integrity":"sha512-uDKC6hjDwMAPu4o1IO4bAbymUmhoUPL/CZH9c5paB9PtKz0Rmvycg70FDrmFGp8eD9pHmFAgV5oYuG9xfV7x7w==","signatures":[{"sig":"MEYCIQCaeBbDzCuliqgC9vXYukfXTgqyvvGosTbPTEAnoLj33wIhAPkaBo49SoIhRQJO9aV7x9BHyC2oJv5msRW+Fut47wbx","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68099,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj0569ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpDww/7BAFs7Sp7Eu1It2MqJb3jVhi7nItIo5WTA2o6atIwBXEZ5+h+\r\nKtjJam6Fptw/NqZSc5MORwYLxzCCuYoheW8SuuIfwuAVyPUonRThDLSaZs0O\r\n6GbcCii7SwwmlkR3D4OtQT4q48yM97QbRMn0wFWcvPZqB3XTANpZgWqU1JbN\r\nJzy2IV5hw7LRVvlLutNy9esHWMlOcvnwUVRgMkXaIpNr7AdL15To/23rRJ0m\r\n3H5xbwi2bjpdP/054n9fCf7KbbzWZD0ahE2icPjQSuiDfldNG8lmAmKF/9OH\r\n86yGL/1cwpGJB8Z+qNiNSwLqrrKHcxuT5bSCSPP8ovIHY5pgQNw1qYBh8zXk\r\nbHGc1ARQWhVT4o4aMVfSL71LSt+DwnCBhcH7qqsJ1dkfh3aDGosIxOEvGkth\r\nuwtM8boc81jUwAliGFaU0lFObCzOkC91FgLmb6fyXgO5r3LFMSHFQDkJDWHe\r\n78k5E+TZUdxNLc2ijJ6sGAnHkTje/gTeGASIW5+oeUDwuQthyWiADIM4UVXC\r\n8vkVayEFkVeHXwkmh7TsowunZy3A39XmcaUM0mU764g1mAinMhmxOiXmws29\r\ntTi7SUoF4+mMVKs4VOSWvNLjZ7vL47tfkRiQa1B/GjzKxtEBdDAGiS+MFZau\r\nYX7d0SJzUdOaa2cw0d9sDHN7xzMWmJ+9eLg=\r\n=3Va0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/balena-jellyfish-metrics-2.9.0.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```typescript\nimport * as metrics from '@balena/jellyfish-metrics';\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber);\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card);\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/balena-jellyfish-metrics-2.9.0.tgz","_integrity":"sha512-uDKC6hjDwMAPu4o1IO4bAbymUmhoUPL/CZH9c5paB9PtKz0Rmvycg70FDrmFGp8eD9pHmFAgV5oYuG9xfV7x7w==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2023-01-27T09:50:30.704Z"},"_npmVersion":"8.19.3","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.19.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^15.0.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.3.1","rimraf":"^4.0.0","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.8.0","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.18","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.9.0-build-renovate-github-codeql-action-digest-237765c1aa60829480d5ba80da02c38abaffd726-1_1674813117720_0.5569158922781579","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.9.0":{"name":"@balena/jellyfish-metrics","version":"2.9.0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.9.0","maintainers":[{"name":"dfunckt","email":"akiskesoglou@gmail.com"},{"name":"page","email":"page@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"df4cca06af7ce9b02582016039a59259c18e1859","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.9.0.tgz","fileCount":15,"integrity":"sha512-4kf76F4sXuZh4b8doaTAwyCpRjRYIBJdhgCnoiY8KPU62klkm74WLDOqSSwE9H8UrA63VdiY5GZx04QjurbnvA==","signatures":[{"sig":"MEYCIQDdajGmMk53v0AUyLwjn6DrzhcGcQh1UzyWLKKbtoHe7QIhAJjy/GWS5BG/3VeHc0zBxchAN/wg8SzMAZZPjuDgl2Z7","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68013,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj060DACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoFiw//eLq9sN81RptQsjePWu8roOjdamVehwpNLOmT/fL/mNB99R1r\r\nJucjawXQeSj7Xn0SNKIYi8CPiJ9Kv7Ybt2QuCIm20D2abdAnvy82Fw8tr7P0\r\nD81ZIVgo9yidD8PLStRgmM2mybBsd+5xO/POWZDBeLNTvPLJYOlpIBtCMKJB\r\nQ8dZk34EljIy70M+AURqCrL8GJd8pStXHapp0xFL7QEuYL4MLYTvXKJrLDwl\r\nDn7sBZjcMouICtLJ7McWy6QGZdAE4ffARkcJO1w/KS4hpAjsP0WxGtbKOEbd\r\nUdz8AphfmIiskT+kd90DEjdE9G0bH/IKd4EVkFFzMii+HrhY82zgl8wT4qnq\r\nl8FoNZzXABCEg9QRTTboKTIGXfoTBVr2iK3Ew71UNzWwAKWTYztU9QO9XCl5\r\nY8QVU3YVlRJJn/PYZR4Ha3WgnA9WuU10iDK+24qaMCeRAT5ianFQuPkNcMbk\r\n0a5V+RbQwNT6+RQop2AEh15PSWOlTCtq+36K8PNYUAOv5d0whurUqJmHnqoo\r\nEgOU5N/rWjZNAA3zshFv1RRez3dI6iWZuEgeSR+JFvbUKJFRTTSLHUd4gB8X\r\nIwhPCL6A5SYx2RRcGCLR9YZJ9Mw0JWakbAJzeDUqyZdW45MbNydUk6BEvIMY\r\n1Ughh0j1tZvsumTTrccTsnKLsG0lFNGvHNg=\r\n=6O/m\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/balena-jellyfish-metrics-2.9.0.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/balena-jellyfish-metrics-2.9.0.tgz","_integrity":"sha512-4kf76F4sXuZh4b8doaTAwyCpRjRYIBJdhgCnoiY8KPU62klkm74WLDOqSSwE9H8UrA63VdiY5GZx04QjurbnvA==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2023-01-27T09:50:30.704Z"},"_npmVersion":"8.19.3","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.19.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^15.0.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.3.1","rimraf":"^4.0.0","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.8.0","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.18","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.9.0_1674816771367_0.453634956856668","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.10.0-build-renovate-node-18-x-569bd92c626af084cfe5db01ccb015a61f0ca733-1":{"name":"@balena/jellyfish-metrics","version":"2.10.0-build-renovate-node-18-x-569bd92c626af084cfe5db01ccb015a61f0ca733-1","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.10.0-build-renovate-node-18-x-569bd92c626af084cfe5db01ccb015a61f0ca733-1","maintainers":[{"name":"dfunckt","email":"akiskesoglou@gmail.com"},{"name":"page","email":"page@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"28062fb65c0d85341d3a0163d6c446e2ebbc1bbf","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.10.0-build-renovate-node-18-x-569bd92c626af084cfe5db01ccb015a61f0ca733-1.tgz","fileCount":17,"integrity":"sha512-VByUyd7BiSorbLr/xClkyqM5f0hZQS0eRQmgCYMvP7Pv8NY1Isb6aITeWsFWxwTl8tt4YP7H9+NvjXCgdHTq3w==","signatures":[{"sig":"MEQCIB4mpUSqT7scYqy70Zq1qin7yRHYheUVX2+1I0O+daJ3AiAcxqfnovrXCqFQA+rPyuJwqBhPDSuosw/aeOaG7EyvyA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj3BSuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrl2w//ZCEGRSygblXSXxnDkixZhruieGmI86w4YU/GEokYlXVVFsyI\r\nkYpgn3e/4/Xyv1MGW0UpUuIGSfD2avM5tf32OCylHXS/zX25fcRcmUNAK2Fa\r\ngwmrPUM31grVCWGBh6g96sXC7ib4SEJV/ScryavUgBf8mN3ru4ZA23Hc6r3b\r\nDgzdBVtX5OnA5nYbp+lFr0DM3cms0r5vWTnJQf8zMJlpfVtXExUdOxOGShPO\r\nD71EkE94HO7onOjY8pwMJzRAF2FAasMsn4DyXGufTf3D8bgmwdwlRDJocsyO\r\nl9r1me8dG14JMnjmCpfFPYntMW85GBbd/D5oz8JIBRuMhoyPIgFuKrQmXWFX\r\nkc2v1Y+LctEunYjgzXlTk3+eoFyfsM3keA5ui3T2xhM+1QoiJNEPuH1rNYSA\r\nUJEp1yLLL63wS9WvOh0Eu+S7y8ZDNnVjOB3vgN/2Jgd1VUQs9/kpsAYgy28p\r\nZ3FZxhkAboXTKJLHRNoxmzEDzSAUBzYgGDQGH26fKm7PsoIWbPHcs/MQVSvw\r\na4RUJ7Q/3CsB6rmZEyZPiXm+SQ2DsMuQaoDK0rdtUcEzi17zwb9zNc1bSLzy\r\nYUu7RciQ/aTcd9LPjSEt/3sGln7q3Qy8J4Gef5y21xz5eXdj4MnNZhvDRdk4\r\nzD96kCKVmqIi7cEACtB3zcOro4E+Ukvc+PA=\r\n=zcls\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/balena-jellyfish-metrics-2.10.0.tgz","types":"build/index.d.ts","readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```typescript\nimport * as metrics from '@balena/jellyfish-metrics';\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber);\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card);\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/balena-jellyfish-metrics-2.10.0.tgz","_integrity":"sha512-VByUyd7BiSorbLr/xClkyqM5f0hZQS0eRQmgCYMvP7Pv8NY1Isb6aITeWsFWxwTl8tt4YP7H9+NvjXCgdHTq3w==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2023-02-02T19:51:13.880Z"},"_npmVersion":"8.19.3","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.19.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^15.0.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.3.1","rimraf":"^4.0.0","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.8.0","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.18","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.10.0-build-renovate-node-18-x-569bd92c626af084cfe5db01ccb015a61f0ca733-1_1675367597755_0.01862750867605989","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."},"2.10.0":{"name":"@balena/jellyfish-metrics","version":"2.10.0","author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","_id":"@balena/jellyfish-metrics@2.10.0","maintainers":[{"name":"dfunckt","email":"akiskesoglou@gmail.com"},{"name":"page","email":"page@balena.io"},{"name":"balena.io","email":"accounts+npm@balena.io"}],"homepage":"https://github.com/product-os/jellyfish-metrics#readme","bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"dist":{"shasum":"65b41e201a262c4cfe9eb4618968137284ebfa6e","tarball":"https://registry.npmjs.org/@balena/jellyfish-metrics/-/jellyfish-metrics-2.10.0.tgz","fileCount":15,"integrity":"sha512-YoGHgdKGg+49UsdSlitBf5XNPjBnfBIeNFo7wM0RMPsvZRskyZV9yi1e/+RUrRFDhRAFBkmtRVhWdvIdrgRdsQ==","signatures":[{"sig":"MEUCIDX6ym6nwrtWTnIrNLV4mvkKt1ttuRL9P+07cNPIiV3ZAiEA/QtKtj/KMBVlU+phEZ2adLjcqkt+pEUaSprevZWJlwY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68014,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj3CKkACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqupA/+K936aGnjV4jAj1fonqEoqtgDWv7mz0vfdK1PaMXri/M1DWn4\r\nqvFU3f+gUPKV4yMZtltavCtwzicHR7nmHzZwngypKx+eDv1C8cqXs2tnjbSL\r\nmj32D9uNa6rkMMayNoNt5o9tTQABnEqcdMXchS9NP1W4zZvtuI65Y4D6Jie1\r\ngDgk++uwrxibxXea+b4WJeh57uahFLGfvRxY7D7zKN2IkuHsxb6vhWgkoVOe\r\nNSUSgkTZobfraa+pJNZGhJwC0ZLdTLiEbRJb4vaarHJgtTb1PhCRMXmhLIfG\r\nIBlvEJiXub/Wl+Le60IXzdxaj08wKY/xeDhd6/tP3cvm0hGWvKGf2csltC+Q\r\nGpFSMX9tjoqaSyQFbMKxAVHVnToan1A1721H2os90VlPiB7W3Vdsb6RbvW//\r\nWOBfP4ebs1H0svfv/Mrawy0iPwkE2YBpO8mfzx9i/9jr/7GeGRumQSMBeoLr\r\nllonMIw2wdO0GySVTa+ml69kSo7AlsmpGxFG0wOkbU5miCvDZavvUMOt0MO4\r\n3RtcDSILWzCZidejMY9Xji1hbaGiJ6DKOkUHlbithrNSTcoGlzXOCepCaurO\r\nSXyS0qrpysmceAEUtc9hIAi1zpgwSiwlYa+8Xl3kqjmJltNnsu9vO+jSvKW6\r\nJZlEonztIUirnTEUw0FoT/ckcwYU6FCJlSc=\r\n=0HOq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","_from":"file:/home/runner/work/_temp/balena-jellyfish-metrics-2.10.0.tgz","types":"build/index.d.ts","deplint":{"files":["lib/**/*.{ts}"],"modules":["lib"]},"engines":{"node":">=16.0.0"},"scripts":{"doc":"typedoc lib/ && touch docs/.nojekyll","lint":"balena-lint lib test && deplint && prettier --check **/*.json **/*.yml","test":"npm run lint && npm run test:unit","build":"npm run clean && tsc -p tsconfig.build.json","clean":"rimraf build","prepack":"npm run build","lint:fix":"balena-lint --fix lib test && prettier -w **/*.json **/*.yml","test:unit":"jest test"},"_npmUser":{"name":"balena.io","email":"accounts+npm@balena.io"},"_resolved":"/home/runner/work/_temp/balena-jellyfish-metrics-2.10.0.tgz","_integrity":"sha512-YoGHgdKGg+49UsdSlitBf5XNPjBnfBIeNFo7wM0RMPsvZRskyZV9yi1e/+RUrRFDhRAFBkmtRVhWdvIdrgRdsQ==","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"versionist":{"publishedAt":"2023-02-02T19:51:13.880Z"},"_npmVersion":"8.19.3","description":"Metrics library for Jellyfish","directories":{"lib":"lib"},"lint-staged":{"*.ts":["balena-lint --fix"],"*.{json,yml}":["prettier -w"]},"_nodeVersion":"16.19.0","dependencies":{"lodash":"^4.17.21","express":"^4.18.2","@balena/jellyfish-logger":"^5.1.126","@balena/jellyfish-environment":"^15.0.0","@balena/node-metrics-gatherer":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.3.1","rimraf":"^4.0.0","deplint":"^1.1.3","ts-jest":"^29.0.3","typedoc":"^0.23.21","prettier":"^2.8.0","typescript":"^4.9.3","@types/jest":"^29.2.3","@types/node":"^18.11.18","lint-staged":"^13.0.4","@balena/lint":"^6.2.1","@types/lodash":"^4.14.190","@types/express":"^4.17.14","simple-git-hooks":"^2.8.1"},"simple-git-hooks":{"pre-commit":"npx lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/jellyfish-metrics_2.10.0_1675371171750_0.9659485443488776","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: no longer maintained. The GitHub repository has been archived and no further releases will be published."}},"time":{"created":"2020-07-08T02:40:43.299Z","modified":"2026-01-29T10:39:48.061Z","0.0.2-add-dependabot-249fd595ffcc9fe88b4ecf155a2ed861053e670e":"2020-07-08T02:40:43.686Z","0.0.2":"2020-07-08T02:51:32.493Z","0.0.3-add-dev-doc-5d8be802e99b3a7261ae62b50f815879d3e6c19a":"2020-07-08T06:06:05.179Z","0.0.3":"2020-07-08T06:24:24.781Z","0.0.4-remove-http-package-121e7d8517a5167276af44921d653781faa58690":"2020-07-08T07:03:17.829Z","0.0.4":"2020-07-08T07:07:43.601Z","0.0.5-dependabot-npm-and-yarn-eslint-plugin-jsdoc-29-1-0-4f9623d4840a462b7a1973731f3733f80279544c":"2020-07-08T12:06:48.781Z","0.0.5-dependabot-npm-and-yarn-lodash-4-17-17-554a71073a41f4c0833a47e87b8060c4c88667ab":"2020-07-08T12:17:06.690Z","0.0.5":"2020-07-08T23:16:24.100Z","0.0.6-dependabot-npm-and-yarn-eslint-plugin-jsdoc-29-1-0-cb86dbc6210c4be4f25118a76ce9b9d05573da17":"2020-07-08T23:18:45.106Z","0.0.6":"2020-07-08T23:25:24.096Z","0.0.7-dependabot-npm-and-yarn-lodash-4-17-19-b06b07f9b5ffccde65a76bb1abec72723312a935":"2020-07-09T12:05:36.025Z","0.0.7-dependabot-npm-and-yarn-eslint-plugin-jsdoc-29-1-3-6b8f153d429c0cebefd31918beb96f91723bb49d":"2020-07-10T12:05:24.343Z","0.0.7-dependabot-npm-and-yarn-eslint-plugin-jsdoc-29-2-0-606028bdd6362a9b4405d066a355328f6f7acf74":"2020-07-13T14:10:33.602Z","0.0.7":"2020-07-13T14:29:24.260Z","0.0.8-dependabot-npm-and-yarn-lodash-4-17-19-2570a2c21fcef5f40ad9be46c8b722bede82824f":"2020-07-13T14:31:50.235Z","0.0.8":"2020-07-13T14:51:15.121Z","0.0.9-add-endpoint-test-02b828efa05cd17d069c4c13d906c7a0e8513bc6":"2020-07-15T02:20:40.133Z","0.0.9-add-endpoint-test-a0f3b44d2f2c25c5c6992da457ca7108c4923cf8":"2020-07-15T03:56:58.087Z","0.0.9":"2020-07-15T06:03:03.441Z","0.0.10-add-missing-tests-67b984642b8c3695938a30c864f9a3ebe5b476b1":"2020-07-15T09:34:53.492Z","0.0.10-improve-descriptions-5bd715a454f09d6c7cad99f5bf47246b38bd6e98":"2020-07-16T03:29:43.163Z","0.0.10":"2020-07-16T03:32:45.804Z","0.0.11-add-missing-tests-8198529952ba34540c8d502aa572c73a02b38093":"2020-07-16T04:19:35.605Z","0.0.11-add-missing-tests-925eab515b2c4d57b48441c51f3221b766ad8df3":"2020-07-16T04:26:59.691Z","0.0.11-add-missing-tests-96b0f6233378454cbd92781cee880a94fb403360":"2020-07-16T04:43:12.913Z","0.0.11-add-missing-tests-8b6c0f1dbbe044557c385dc89b5bcdaab7a87dd9":"2020-07-16T04:50:12.185Z","0.0.11-add-missing-tests-c4257f8b316eef949d31555cb2619cbfff258876":"2020-07-16T04:57:56.207Z","0.0.11":"2020-07-16T05:02:05.554Z","0.0.12-add-npm-configs-ffdc23fcbd92bb611efb05e4868e4a1fd240fb83":"2020-07-16T08:55:35.548Z","0.0.12":"2020-07-16T08:59:09.539Z","0.0.13-switch-dependabot-2601dd356eb9f9313c0e0c82f4d814c71f6eb110":"2020-07-16T14:35:04.638Z","0.0.13":"2020-07-16T14:39:00.920Z","0.0.13-dependabot-npm-and-yarn-balena-jellyfish-logger-0-0-12-c2042f4a4e785eafa5474c39dd6235243f1f4437":"2020-07-16T14:42:12.740Z","0.0.13-dependabot-npm-and-yarn-balena-jellyfish-environment-1-0-3-ba5c5dab02a2259beee5a92e5a3aadf5b55530f7":"2020-07-16T14:42:37.187Z","0.0.14-dependabot-npm-and-yarn-balena-jellyfish-environment-1-0-3-4133bc5b69aac82b1ccb78cb563833944b069ec5":"2020-07-16T14:55:42.847Z","0.0.14":"2020-07-16T15:00:18.509Z","0.0.14-dependabot-npm-and-yarn-balena-jellyfish-logger-0-0-12-476bed25e201e3897eafc2cab31f40c2810ae469":"2020-07-16T15:04:49.800Z","0.0.15-dependabot-npm-and-yarn-balena-jellyfish-logger-0-0-12-886fcf8f4057cb50d73355f52687c63a38b464fe":"2020-07-16T15:08:01.707Z","0.0.15":"2020-07-16T15:11:45.456Z","0.0.16-dependabot-npm-and-yarn-balena-jellyfish-logger-0-0-15-9b5b74b11c134e50a0cbecf91134fa9ad8699d17":"2020-07-17T12:21:24.537Z","0.0.16-dependabot-npm-and-yarn-eslint-7-5-0-0e533d60785cdaa8657c71862e69ffffeff7d761":"2020-07-18T19:12:21.759Z","0.0.16-dependabot-npm-and-yarn-eslint-plugin-jsdoc-30-0-0-0a4827df0c1c57751b587454be6ebc6e500132e1":"2020-07-19T03:10:40.815Z","0.0.16":"2020-07-20T00:44:51.978Z","0.0.17-dependabot-npm-and-yarn-eslint-7-5-0-138dace301d0c8eb1d964638d4ff4a8a7620d4ec":"2020-07-20T00:49:12.661Z","0.0.17":"2020-07-20T00:52:34.375Z","0.0.18-dependabot-npm-and-yarn-balena-jellyfish-logger-0-0-15-68ff6dc3216b23f5050d1f6b290fb9dc4096a8f6":"2020-07-20T00:56:12.462Z","0.0.18":"2020-07-20T01:00:05.334Z","0.0.19-dependabot-npm-and-yarn-eslint-plugin-jsdoc-30-0-2-b24552d7109d085fa9498c4307f5039e4ed139df":"2020-07-20T15:55:37.877Z","0.0.19-bump-dependencies-871a7de345c19f8dfed1486dc861b391508b7e98":"2020-07-21T00:43:02.687Z","0.0.19-switch-to-renovate-4eafa6fd04f31bdbe06bb19dd126f4bb2b75f723":"2020-07-21T06:48:10.590Z","0.0.19":"2020-07-21T06:52:42.166Z","0.0.20-renovate-non-major-69c30fe67f8b132fbda5e40e3a6fc2e1a11f0b86":"2020-07-21T06:55:47.702Z","0.0.20-update-ci-configs-6153a15144bc82becf361f9a256c314a1fab4dcf":"2020-07-22T08:48:28.854Z","0.0.20":"2020-07-22T08:52:01.495Z","0.0.21-renovate-non-major-531edacd7feb2813e64fe4ff3ddd98d77b223897":"2020-07-22T08:56:44.748Z","0.0.21-renovate-non-major-c4b9d88ac7aa37802213e8db8c4cf5032d74dc70":"2020-07-23T11:55:48.473Z","0.0.21-renovate-non-major-02159b3fdddc0a21d7993b5a07a8a2171420d667":"2020-07-24T07:01:53.813Z","0.0.21-renovate-non-major-71b404603a1b3393944e16bf38c8ff469f1003db":"2020-07-24T08:32:44.082Z","0.0.21-renovate-non-major-8f077669b49760cccc7e7dee0fd682c638671b86":"2020-07-25T01:48:53.785Z","0.0.21-renovate-non-major-b41db3e4562443318b47e090307f28cdd5e0bdfc":"2020-07-27T15:03:44.392Z","0.0.21-Add-a-colon-to-renovate-patch-commit-prefix-ecb7a56f291ccece923f71542247542d0b008e4b":"2020-07-28T23:36:46.039Z","0.0.21":"2020-07-28T23:41:08.178Z","0.0.22-renovate-non-major-b2eb253c96c8270ad98c55b789df31b6c732443f":"2020-07-28T23:45:23.842Z","0.0.22-add-repository-details-0f16f4e08095ce080f171379abbf3ac104f3e72d":"2020-07-29T02:04:20.363Z","0.0.22":"2020-07-29T02:07:40.025Z","0.0.23-renovate-non-major-5da684ab6bf8c350779003775793dd16e831963e":"2020-07-29T04:05:04.981Z","0.0.23-renovate-non-major-225a83b8fb490a6052ecc22205e407376c833a8e":"2020-07-30T02:29:25.674Z","0.0.23-unpin-dependencies-87802c014c0865c5db60850c4175b281dd8689a6":"2020-07-30T04:49:54.503Z","0.0.23":"2020-07-30T04:53:25.492Z","0.0.24-renovate-non-major-ec2d56c80c45493279ffa775bfc0cfbc1217db81":"2020-07-30T04:55:54.584Z","0.0.24-renovate-non-major-7dc757e94d2bc41f1e3184cef21690ae8f0cc42a":"2020-07-31T03:24:49.196Z","0.0.24-renovate-non-major-39f3d40ea6812812de60373d420b2a80af3f42f7":"2020-07-31T23:59:15.946Z","0.0.24-renovate-non-major-7bbd171e31c4a6e9b110041174ae2e42b7487db3":"2020-08-03T07:00:46.668Z","0.0.24-renovate-non-major-0ea9b8bff7f9114c911d73c09207b1371f2f7ecb":"2020-08-04T08:38:15.565Z","0.0.24-renovate-non-major-0c122e40f9d70a8b3e466195e9a35adcb542c2d7":"2020-08-05T03:51:45.358Z","0.0.24-renovate-non-major-6a05a1dc38a96dbb8fbfaa914f348e21291a3c09":"2020-08-05T04:39:49.942Z","0.0.24-renovate-non-major-0be773f007d76b6cddb5dae23de4ab1f75a5b25d":"2020-08-05T04:43:33.650Z","0.0.24-increase-linting-8920709b6d50b47e39ba354e880f068a619da236":"2020-08-05T04:54:58.645Z","0.0.24":"2020-08-05T04:59:44.771Z","0.0.25-renovate-non-major-0db133284c452dc3ee45d3846a5d90c8a8a16295":"2020-08-09T16:40:02.112Z","0.0.25-renovate-non-major-776e2b06ee6803e4c05f116cd1767f2880291a64":"2020-08-12T09:04:16.143Z","0.0.25":"2020-08-12T09:30:04.111Z","0.0.26-renovate-non-major-ac741af38ec039d16ceb74a44c190369fc7c5dad":"2020-08-12T10:35:52.132Z","0.0.26":"2020-08-12T13:08:47.684Z","0.0.27-renovate-non-major-851f704959d868c54960f52737c5b9a97cce001e":"2020-08-12T14:49:34.773Z","0.0.27":"2020-08-13T00:09:43.489Z","0.0.28-renovate-non-major-40c5a70251cd40df9f4c3189d683169986ece00a":"2020-08-13T01:14:07.946Z","0.0.28":"2020-08-13T04:24:18.623Z","0.0.29-renovate-non-major-4c5cdc246f61bb289899134d674801f9f545cdef":"2020-08-13T06:22:04.358Z","0.0.29":"2020-08-13T06:28:22.511Z","0.0.30-renovate-non-major-380741d86c90eb1dfb785dd060c3b8153c0372ee":"2020-08-13T09:01:36.919Z","0.0.30":"2020-08-13T16:25:14.168Z","0.0.31-renovate-non-major-0815aadec71adad4f5287f62fd5f44126aac61eb":"2020-08-13T16:29:45.301Z","0.0.31-renovate-non-major-5aaddb64f1cb10f7cdf15527b8548033433133ad":"2020-08-13T17:20:32.493Z","0.0.31":"2020-08-13T23:43:24.350Z","0.0.32-renovate-non-major-5ccc902c4a6097d9075bf26e48939b81db47dcf6":"2020-08-13T23:48:01.459Z","0.0.32-renovate-non-major-4060ab156d486cdcce68295cccf54f9b3b567ad0":"2020-08-14T01:00:22.973Z","0.0.32":"2020-08-14T04:17:03.358Z","0.0.33-renovate-non-major-735c517c7afe7032712e3ba488fa31b0092ef64a":"2020-08-14T05:30:27.577Z","0.0.33":"2020-08-14T07:10:55.191Z","0.0.34-renovate-non-major-0feb4b4cd2b5120ed519883b929faa25901b0089":"2020-08-14T21:54:27.219Z","0.0.34":"2020-08-15T00:09:56.606Z","0.0.35-renovate-non-major-af06294f1929a9bbaaea0f9e285c8d1290254839":"2020-08-15T01:48:20.858Z","0.0.35":"2020-08-15T03:46:37.521Z","0.0.36-renovate-non-major-91d602b5592c6fefb6a337871e56caa0c83b650a":"2020-08-15T04:44:36.593Z","0.0.36":"2020-08-15T07:53:39.700Z","0.0.37-renovate-non-major-06c509b06b0d6c56917f40e410d8724a946619ac":"2020-08-16T02:37:38.990Z","0.0.37":"2020-08-16T03:35:27.270Z","0.0.38-renovate-non-major-04536eea628d94cd00a222b2369a7d24897b5f76":"2020-08-16T03:40:00.507Z","0.0.38-renovate-non-major-0b8ec55b064f65677b7548d3a8f195cf511bd205":"2020-08-16T03:43:35.659Z","0.0.38":"2020-08-16T09:33:26.091Z","0.0.39-renovate-non-major-80088e9f9a5775f78fcbd47b379118a8fda1442f":"2020-08-16T09:37:52.384Z","0.0.39-renovate-non-major-6181941837f1b84b5e2854b0369d3be4f39cfec9":"2020-08-17T15:39:24.348Z","0.0.39-renovate-non-major-06179d8e1cbc1f4bd35645742551e93415c75785":"2020-08-17T17:49:11.926Z","0.0.39-renovate-non-major-0c3fa03bcaf089ce60e274a704bfd47f3a518ff8":"2020-08-17T17:52:49.566Z","0.0.39":"2020-08-17T23:28:38.110Z","0.0.40-remove-dev-major-f5d1d25275768d08dfdcd60f07561b3ec4d48cd2":"2020-08-18T01:33:12.551Z","0.0.40":"2020-08-18T01:36:58.335Z","0.0.41-renovate-non-major-967390655caca29db3e9731a279476818332feed":"2020-08-18T02:27:58.603Z","0.0.41":"2020-08-18T02:31:08.919Z","0.0.42-renovate-non-major-3c94340f14e5abb39bb364dd394c0976e7c44a86":"2020-08-18T03:19:40.639Z","0.0.42-renovate-non-major-dac1bdc9f9fcee05525e6ff06c7b6ce1fb5564f7":"2020-08-18T03:23:33.468Z","0.0.42":"2020-08-18T03:26:59.407Z","0.0.43-renovate-non-major-e9c56900ca220935baddc88fc969edb86f0ec2af":"2020-08-21T19:12:33.241Z","0.0.43":"2020-08-21T19:15:35.687Z","0.0.44-renovate-non-major-6d567bf6364999ec96f4725a8d53e04444ba24d5":"2020-08-21T22:29:15.243Z","0.0.44":"2020-08-21T22:31:54.197Z","0.0.45-renovate-non-major-20bc525ce98bc873348c06f04d67a5cfa37a67ab":"2020-08-23T19:52:05.352Z","0.0.45":"2020-08-23T20:00:55.066Z","0.0.46-renovate-non-major-b6d12d2c217f565d066f2440d7e84fcfa1c5d297":"2020-08-23T21:41:09.773Z","0.0.46":"2020-08-23T21:43:48.183Z","0.0.47-renovate-non-major-58aca14b10045d12bdcb5c35e807fe68321c7814":"2020-08-24T01:35:04.018Z","0.0.47-renovate-non-major-0ce8053f50c417abd4a090a4454f303c58aa9711":"2020-08-24T01:39:04.171Z","0.0.47":"2020-08-24T01:42:05.546Z","0.0.48-renovate-non-major-bc53623ec2876d00d11aef445fa23543359e3a5d":"2020-08-24T13:19:17.573Z","0.0.48":"2020-08-24T13:22:12.796Z","0.0.49-renovate-non-major-fff940027b75f736c568f9ceaf8bedda92f4b7e9":"2020-08-25T11:36:27.266Z","0.0.49-renovate-non-major-6da1b7596b1f6883ae119b50c8a22d2bd512169f":"2020-08-26T02:30:11.100Z","0.0.49":"2020-08-26T02:32:53.529Z","0.0.50-renovate-non-major-f15969255457e40ef5129bf91eaf24997eae445b":"2020-08-26T05:27:03.999Z","0.0.50":"2020-08-26T23:13:25.306Z","0.0.51-renovate-non-major-98d6354a0fd9908fd67256d23fbd8aeda607fda5":"2020-08-26T23:18:29.485Z","0.0.51":"2020-08-27T00:16:45.571Z","0.0.52-renovate-non-major-ff71d40bcdc7ada0f196757c4e25198b436f59a4":"2020-08-27T01:54:12.324Z","0.0.52":"2020-08-27T03:47:15.090Z","0.0.53-renovate-non-major-c5bd7c1aed916e4bbe4ae236307b4928d92822cc":"2020-08-27T11:58:35.494Z","0.0.53":"2020-08-27T12:01:41.430Z","0.0.54-renovate-non-major-4b677ee9592047b72fb5cb62225708cff5c04ab8":"2020-08-28T13:04:58.760Z","0.0.54":"2020-08-28T13:07:49.835Z","0.0.55-renovate-non-major-e41d9302002a6910ff52fb04b27bbf05cf1862b9":"2020-08-28T17:22:53.246Z","0.0.55":"2020-08-28T17:25:52.415Z","0.0.56-renovate-non-major-7c2287a3c40acaa1d98337851b648cb98293131a":"2020-08-29T02:39:02.711Z","0.0.56":"2020-08-29T02:41:24.054Z","0.0.57-renovate-non-major-c8464ccfe6d8c4e6519250f26d378c645244bcb2":"2020-08-31T02:55:13.132Z","0.0.57":"2020-08-31T02:58:20.226Z","0.0.58-set-commit-body-b9632969e289b3cd7f5ba2f1b24df3290ddfbe0f":"2020-08-31T06:10:46.157Z","0.0.58":"2020-08-31T06:16:19.059Z","0.0.58-renovate-non-major-5cbf3e4a185a1551baf0848388a5059c7aa07430":"2020-08-31T06:17:19.905Z","0.0.59-renovate-non-major-c42fbc7e9c10ad9197268d761a54cbd173e1cb11":"2020-08-31T22:54:32.431Z","0.0.59-renovate-non-major-4da33a1c5f3a7bd4f7e5cbaa1bd3955861716850":"2020-09-01T00:40:22.812Z","0.0.59":"2020-09-01T00:44:29.644Z","0.0.60-add-lint-staged-0b2e4c96b8baac52a628e45c988908181fc1be73":"2020-09-01T02:01:32.658Z","0.0.60-renovate-non-major-aa2ad3d478c7f40e8073304c88b374b8e97a6069":"2020-09-01T02:04:40.691Z","0.0.60":"2020-09-01T02:05:38.369Z","0.0.60-renovate-non-major-1cfdf18e9a958cf05f55751d5c427771294fe859":"2020-09-01T02:07:42.866Z","0.0.61-renovate-non-major-c5698ef229d57e4fb49e5871afff63f2c098b87e":"2020-09-01T02:11:34.467Z","0.0.61":"2020-09-01T02:14:47.219Z","0.0.62-update-license-check-217ea3cd437d9d3441572225b5181df0652c87f0":"2020-09-01T02:57:29.118Z","0.0.62":"2020-09-01T03:14:57.842Z","0.0.63-renovate-non-major-3c94a7f4f375cedd601afa324225c73fe2f97d29":"2020-09-01T03:35:38.864Z","0.0.63-renovate-non-major-65aa67c35995c3acd0f33771064e485d763363f4":"2020-09-01T04:30:22.002Z","0.0.63-add-jellycheck-2278f9ac22f3c6e5af8a94ce73dd3d277d546d68":"2020-09-01T07:08:40.834Z","0.0.63":"2020-09-01T07:12:24.359Z","0.0.64-renovate-non-major-8fc936d2f0083dd498ed9ca7b2d494ca2987faf0":"2020-09-01T07:16:47.831Z","0.0.64":"2020-09-01T07:20:55.218Z","0.0.65-renovate-non-major-52c3c52e4ba76660897bf83f19140271e97386aa":"2020-09-01T14:17:08.317Z","0.0.65":"2020-09-01T14:20:10.233Z","0.0.66-renovate-non-major-3430e1f72e2d8acb4a7f56b51fbea03e3943d644":"2020-09-01T20:31:28.169Z","0.0.66":"2020-09-01T20:34:26.677Z","0.0.67-renovate-non-major-bf43e244f5feef0950e9bc8165fc4c1faa923dba":"2020-09-01T23:37:46.432Z","0.0.67":"2020-09-01T23:40:46.769Z","0.0.68-renovate-non-major-52136d7c986e8669ee6d0b77f561f6ba12ced508":"2020-09-02T04:25:42.117Z","0.0.68":"2020-09-02T04:30:07.959Z","0.0.69-renovate-non-major-5b599298fd13945c2abe0500ad2743bc9b7dd8ea":"2020-09-02T05:57:34.271Z","0.0.69":"2020-09-03T00:18:18.127Z","0.0.70-renovate-non-major-2431958769c289b993cdf3449edc2e509b6d4cd3":"2020-09-03T01:56:02.532Z","0.0.70":"2020-09-03T02:02:23.688Z","0.0.71-renovate-non-major-cd13228e77a8958e19fac5dd1307209df5289df1":"2020-09-03T08:16:24.573Z","0.0.71":"2020-09-03T09:07:20.576Z","0.0.72-renovate-non-major-369938f6b67468eeea2c75f5aaefd5f307452cb4":"2020-09-03T09:12:55.175Z","0.0.72":"2020-09-03T09:25:03.271Z","0.0.73-renovate-non-major-47cbe7177b8b4167ee29cfe0829412d793609234":"2020-09-04T13:16:43.907Z","0.0.73":"2020-09-04T13:19:36.031Z","0.0.74-renovate-non-major-ac3b533ffc0bb6c4af3c7e6826b700d97cc837f5":"2020-09-05T03:26:11.498Z","0.0.74":"2020-09-05T03:29:16.341Z","0.0.75-renovate-non-major-04d360aa29799995abe3f49a29e7507052a7f587":"2020-09-06T02:36:10.068Z","0.0.75":"2020-09-06T02:38:57.012Z","0.0.76-add-default-files-82d940bd25b0f7e26e9634a62f5d28905d9534f3":"2020-09-06T07:22:17.712Z","0.0.76":"2020-09-06T07:26:35.858Z","0.0.77-renovate-non-major-9e933909164800b83101cd4361ad4099091e25e7":"2020-09-06T07:31:35.113Z","0.0.77":"2020-09-06T07:35:27.142Z","0.0.78-renovate-non-major-ce82760a378ee4133fe38d9271c65e9ad963db54":"2020-09-06T07:54:49.510Z","0.0.78":"2020-09-06T07:57:43.406Z","0.0.79-remove-node10-tests-3c69ffb62cccff0a919678c503f7ba3fc8e81292":"2020-09-06T10:04:49.995Z","0.0.79":"2020-09-06T10:11:11.918Z","0.0.80-renovate-non-major-495ce2d6e8b3f8a5537918adc8ed2c8da6bcf9a7":"2020-09-06T11:52:49.925Z","0.0.80":"2020-09-06T11:55:51.425Z","0.0.81-renovate-non-major-13118888420361624e61bea39d3ff60800caf7af":"2020-09-07T10:15:37.289Z","0.0.81":"2020-09-07T10:18:27.371Z","0.0.82-renovate-non-major-2f643a454f8f545377c04ca62ed7995b0af6464d":"2020-09-07T11:46:02.555Z","0.0.82":"2020-09-07T11:51:17.865Z","0.0.83-renovate-non-major-74988219aad747f1bd6c966d78087384c7f9a8b9":"2020-09-07T12:33:36.774Z","0.0.83":"2020-09-07T12:36:26.799Z","0.0.84-renovate-non-major-1d2474091b3aef6647b0f39d8fbf75a2d531909f":"2020-09-09T01:53:19.791Z","0.0.84":"2020-09-09T01:55:57.989Z","0.0.85-renovate-non-major-60b14f402b42f08a338c79df908198f5d072d3a9":"2020-09-10T01:37:16.112Z","0.0.85-npm-engine-strict-f1e55d7678ec67adc798a8f5df5062f5725bf329":"2020-09-10T08:44:02.684Z","0.0.85":"2020-09-10T08:48:04.269Z","0.0.86-renovate-non-major-f5388ab0bcab5ac65ea20f877388c23c56acee99":"2020-09-10T08:52:31.742Z","0.0.86":"2020-09-10T08:55:25.865Z","0.0.87-renovate-non-major-7ab2dcdfeca3eb218ae1bbcf4044ca4e7a493a7f":"2020-09-11T18:36:37.528Z","0.0.87":"2020-09-11T18:43:44.432Z","0.0.88-renovate-non-major-5a7f779940216e24c11eb5947646f91d2ff568ae":"2020-09-12T12:27:49.827Z","0.0.88":"2020-09-12T12:31:02.040Z","0.0.89-renovate-non-major-e9ef94b520c1680f200aeb2b6826155361e73947":"2020-09-12T19:11:27.457Z","0.0.89":"2020-09-12T19:17:56.171Z","0.0.90-renovate-non-major-5dff1b30bde721fd9d3314e6ebd5a6694fa7bfc9":"2020-09-12T20:29:06.802Z","0.0.90":"2020-09-12T20:31:54.127Z","0.0.91-renovate-non-major-387d8cc65ce0afe49d9e3bbb59beb47c507a000f":"2020-09-14T08:10:57.351Z","0.0.91":"2020-09-14T08:14:09.742Z","0.0.92-renovate-non-major-dd1f49b1d40f6c59fb1b6667f6c451b096148ccb":"2020-09-14T08:27:13.974Z","0.0.92-renovate-non-major-4547fd8915810d70c2ddfa017f6ad2e792851814":"2020-09-14T08:34:59.115Z","0.0.92":"2020-09-14T08:38:06.948Z","0.0.93-renovate-non-major-13847757324098346b0f24534c51a7c057a040c3":"2020-09-15T03:28:33.400Z","0.0.93":"2020-09-15T03:31:13.288Z","0.0.94-renovate-non-major-fc364f9a1403d55171f5c27a36dcb7e4f84f4ec1":"2020-09-15T04:34:50.817Z","0.0.94":"2020-09-15T04:37:51.949Z","0.0.95-renovate-non-major-5c1f3a849e27022229a1421ce1d63488f77da0e0":"2020-09-16T13:52:11.745Z","0.0.95-renovate-non-major-4cdd8cbda355b9a59f6dc2883d6ae7278098d2a0":"2020-09-16T13:56:53.838Z","0.0.95":"2020-09-16T14:00:40.694Z","0.0.96-renovate-non-major-d272596c9c0f7db503283febc0aa69880b93ae28":"2020-09-16T17:17:51.553Z","0.0.96":"2020-09-16T17:20:42.530Z","0.0.97-renovate-non-major-18c5f6dd11f10508c83ad19c52e2b49213b972c8":"2020-09-16T18:21:51.153Z","0.0.97":"2020-09-16T18:24:40.122Z","0.0.98-renovate-non-major-b5faf6158573de619becdfbf2c839f1d5bc8a071":"2020-09-18T09:13:52.644Z","0.0.98":"2020-09-18T09:16:27.608Z","0.0.99-renovate-non-major-09b9d6bce86219fb8d97135e37f12ff8089ababe":"2020-09-18T11:02:18.984Z","0.0.99":"2020-09-18T11:05:38.158Z","0.0.100-renovate-non-major-025c5e5083bbd80e87dec2e0728accae5b71db6e":"2020-09-18T15:03:08.991Z","0.0.100":"2020-09-18T15:06:57.537Z","0.0.101-renovate-non-major-af7470e390774d337503b0c8ca64a7dc78416df3":"2020-09-18T21:43:19.768Z","0.0.101":"2020-09-18T21:47:07.875Z","0.0.102-renovate-non-major-83505132a301a5f07905745c68dfd4acf97548b6":"2020-09-20T12:24:06.727Z","0.0.102":"2020-09-20T12:27:04.949Z","0.0.103-renovate-non-major-d96ec0083a1a06e7aa8ab078eb76c7fcb90f26e2":"2020-09-25T11:56:15.553Z","0.0.103-renovate-non-major-e1a3d3c4c9fc73407a22a173aab8d33d8451f40d":"2020-09-25T12:01:05.406Z","0.0.103":"2020-09-25T12:06:18.617Z","0.0.104-renovate-non-major-f5629dce3bdf67fab04c6cb9ca3b9f2f86c19c08":"2020-09-25T13:18:28.852Z","0.0.104":"2020-09-25T13:21:06.466Z","0.0.105-renovate-non-major-f36a02e943e81bc5014a52370130a4a67da4e224":"2020-09-27T03:10:39.555Z","0.0.105":"2020-09-27T03:15:03.149Z","0.0.106-renovate-non-major-6e5e8495c852db76859354974d7d12a26a396bdd":"2020-09-27T03:20:21.291Z","0.0.106":"2020-09-27T03:23:19.013Z","0.0.107-renovate-non-major-8de40e4a24812456f15dc744ed7e99237588d836":"2020-09-27T04:57:12.067Z","0.0.107":"2020-09-27T05:00:18.339Z","0.0.108-renovate-non-major-d8b1ab924885d97ce864227d5ea963025d8075db":"2020-09-27T12:49:35.727Z","0.0.108":"2020-09-27T12:52:06.360Z","0.0.109-renovate-non-major-252de3fc75128942ed1d6e282268e71656d3d914":"2020-09-27T13:41:58.125Z","0.0.109":"2020-09-27T13:45:10.843Z","0.0.110-renovate-non-major-77d11ec0c674b14d583bba515385cb4a30e9b77b":"2020-09-27T15:44:16.829Z","0.0.110":"2020-09-27T15:49:30.736Z","0.0.111-renovate-non-major-7e9392719235e2f2075d140b2e115062f8a00d51":"2020-09-27T16:52:59.437Z","0.0.111":"2020-09-27T16:55:57.270Z","0.0.112-renovate-non-major-82602346b8586bf8b108bea7dffdc1b99aefe356":"2020-09-28T01:28:24.790Z","0.0.112":"2020-09-28T01:30:55.935Z","0.0.113-renovate-non-major-61b48e1d920b168778d659d120a3ba72ec58205e":"2020-09-28T02:47:55.706Z","0.0.113":"2020-09-28T02:50:30.465Z","0.0.114-renovate-non-major-9070a8f8c92ef369210168cbf679c8c31df00fff":"2020-09-28T03:29:50.033Z","0.0.114":"2020-09-28T03:32:28.187Z","0.0.115-renovate-non-major-c191a195c16038832d9c3c106320fdf0a9deb715":"2020-09-28T13:54:16.514Z","0.0.115":"2020-09-28T13:57:12.585Z","0.0.116-renovate-non-major-6e2de41cc2db41fbbce97b6c6a3737a0d360d1ee":"2020-09-29T15:31:33.958Z","0.0.116":"2020-09-29T15:35:19.451Z","0.0.117-renovate-non-major-d157f61c1278e0737993a8214efc66db81a8f632":"2020-09-29T17:41:33.888Z","0.0.117":"2020-09-29T17:44:22.270Z","0.0.118-renovate-non-major-e0383f928e59d6b9699c2ce2aa490bf722689a75":"2020-09-30T14:41:21.958Z","0.0.118":"2020-09-30T14:44:12.712Z","0.0.119-renovate-non-major-aa1d8a42f9890ce9c1a06f5a217e55f2542a6e4c":"2020-10-02T17:15:28.271Z","0.0.119":"2020-10-02T17:23:32.427Z","0.0.120-renovate-non-major-b6468925d5aa6d0139e4146406a4ac44176ed5a3":"2020-10-02T17:28:13.287Z","0.0.120":"2020-10-02T17:32:52.308Z","0.0.121-renovate-non-major-0f5085646c80837cf57507d94a09ff6e49542ca4":"2020-10-02T17:37:48.449Z","0.0.121":"2020-10-02T17:40:43.880Z","0.0.122-renovate-non-major-7b2333597b222942e81b37d4f2a246e34d250d57":"2020-10-04T10:31:47.011Z","0.0.122":"2020-10-04T10:34:38.808Z","0.0.123-renovate-non-major-c3306758a37c9b957d48c7526454507c389f57dd":"2020-10-05T13:28:10.981Z","0.0.123":"2020-10-05T13:31:08.281Z","0.0.124-renovate-non-major-f87703b38d3c0c9c2e39def3a8c373c490d677b6":"2020-10-09T02:56:50.490Z","0.0.124":"2020-10-09T02:59:44.204Z","0.0.125-renovate-non-major-ddf41212a5dac3f2afe9e6a8c891913abc47dcf3":"2020-10-09T03:54:34.745Z","0.0.125":"2020-10-09T03:57:34.754Z","0.0.126-renovate-non-major-1aba205fdc2395a0001ebfd37c596da31d135a6d":"2020-10-09T21:03:07.342Z","0.0.126":"2020-10-09T21:06:21.980Z","0.0.127-renovate-non-major-765a86d0d2a377dbb5047536d1709edda22328ac":"2020-10-09T22:49:48.129Z","0.0.127":"2020-10-09T22:52:24.580Z","0.0.128-renovate-non-major-5a25987d844665fd07697f6bd253093433040e40":"2020-10-12T17:54:37.424Z","0.0.128":"2020-10-12T17:57:28.353Z","0.0.129-renovate-non-major-7f21dd19a9f92589a50a3fdb76b825da58d3b0ae":"2020-10-14T00:38:07.253Z","0.0.129":"2020-10-14T00:42:48.464Z","0.0.130-renovate-non-major-fb3bf802abe06336a0c4b4f8951bcb2c71a3f00f":"2020-10-14T01:49:09.209Z","0.0.130":"2020-10-14T01:52:11.698Z","0.0.131-renovate-non-major-69960ea075692e0e46c7502416b6cfe7fa0424c7":"2020-10-16T23:16:15.845Z","0.0.131-renovate-non-major-fb46b6c0ea2205c205e22370b5a54d56fe117c97":"2020-10-17T08:11:17.951Z","0.0.131-renovate-non-major-039ae17760281242889068736ff071c51f8b739a":"2020-10-19T14:45:19.435Z","0.0.131-renovate-non-major-a213ff87c3fe1c5a16ee77551becd51f95b1e2cc":"2020-10-19T15:08:44.040Z","0.0.131-renovate-non-major-8944038f32e2fc97d4110c2646a55d4d4631bad7":"2020-10-19T16:11:14.880Z","0.0.131-renovate-non-major-59ffda89ca7368d6c1dc234929ab2861ecf1702c":"2020-10-22T00:20:17.882Z","0.0.131-renovate-eslint-config-standard-15-x-157d728803560c968d2c7049e70fe1cb41776595":"2020-10-23T01:16:41.022Z","0.0.131-renovate-non-major-4c941302584758bbcfcc3c0d592bea0104db6865":"2020-10-24T02:47:36.638Z","0.0.131-renovate-non-major-071c0209cb8dcaeda9787b32c28c1e9c26c623a4":"2020-10-26T19:23:16.147Z","0.0.131-renovate-non-major-4f6e4a7a322b15ee8d6a2965e1b830d01febd7dd":"2020-10-28T05:10:35.790Z","0.0.131-renovate-non-major-eccf527b7ed52dfbf826ceab230f2548f46f7777":"2020-10-28T10:00:08.958Z","0.0.131-renovate-pruneStaleBranches-d9deaee8d989cd5344fed7331fc3133c53ccb33d":"2020-10-28T12:00:24.511Z","0.0.131":"2020-10-28T12:04:09.208Z","0.0.132-renovate-non-major-7b7a62c549afc737a74dc1762c5fde65230a423c":"2020-10-28T13:36:37.621Z","0.0.132":"2020-10-28T13:39:58.962Z","0.0.133-renovate-non-major-5f09e7ea17ee1fa1fc030583c994ecc90c903193":"2020-10-28T21:37:55.610Z","0.0.133":"2020-10-28T21:40:35.159Z","0.0.134-renovate-eslint-config-standard-16-x-84145d803b8de1b479eb57646c826d8a93a00319":"2020-10-29T06:40:15.032Z","0.0.134-renovate-non-major-faf14126debae86e5a213791b092e4ded8fd3a98":"2020-10-29T12:33:22.354Z","0.0.134":"2020-10-29T12:35:44.825Z","0.0.135-renovate-eslint-config-standard-16-x-f7e0f57cb1972fe64d5e3004d8d3196469a674e9":"2020-10-29T12:41:10.088Z","0.0.135-renovate-non-major-167e3ca775ca8d623b5f19c32ea74a6aa75c5116":"2020-10-30T11:52:05.623Z","0.0.135":"2020-10-30T11:55:08.281Z","0.0.136-renovate-eslint-config-standard-16-x-eda2d5fbcce8a9b27cefe59151a77640188837ce":"2020-10-30T11:57:39.434Z","0.0.136-renovate-eslint-config-standard-16-x-0bfc6ef5279c69fbd2a7be3d173ff5e2e3bc034d":"2020-10-30T21:23:51.187Z","0.0.136-renovate-non-major-105a674bf0786ed64aec21f7bd74d65067948554":"2020-10-31T07:55:14.171Z","0.0.136":"2020-10-31T07:58:57.498Z","0.0.137-renovate-eslint-config-standard-16-x-527e6d0b8d65dc7032f81619bd0b58e0576f580d":"2020-10-31T08:04:13.277Z","0.0.137-renovate-non-major-e103071fd7da225e9d1a9e212d356d7c6feaf14a":"2020-10-31T09:32:16.194Z","0.0.137":"2020-10-31T09:35:12.803Z","0.0.138-renovate-eslint-config-standard-16-x-e5f58ba2783305fcf57392efca522fd1b8892445":"2020-10-31T09:37:44.647Z","0.0.138-renovate-non-major-bd262dc7f7f4370c46ea39c63de0188e0b314d60":"2020-10-31T13:47:20.266Z","0.0.138":"2020-10-31T13:50:03.766Z","0.0.139-renovate-eslint-config-standard-16-x-911ce5e240d3a0e64b823fc2dd84d3f3b9ecc757":"2020-10-31T13:53:19.047Z","0.0.139-renovate-non-major-b7960fc139f6c720a16e54d34fa1f584d4e3612b":"2020-10-31T13:57:07.361Z","0.0.139":"2020-10-31T14:00:16.161Z","0.0.140-renovate-eslint-config-standard-16-x-0be31bd68de64b6e63e5d407f2e83ee498dd190d":"2020-10-31T14:03:04.305Z","0.0.140-renovate-non-major-4f52da7f4d9a1b20412f5afbe4df7f929a9cff00":"2020-11-01T05:30:14.791Z","0.0.140":"2020-11-01T05:33:35.393Z","0.0.141-renovate-eslint-config-standard-16-x-a467f086e99ba8525f1cd7c8503981e9ea0d1cf1":"2020-11-01T05:37:15.476Z","0.0.141-renovate-non-major-2bbc6add35d723218a317a0b8327883b491f700e":"2020-11-01T05:40:25.464Z","0.0.141-renovate-non-major-974e78ad868347e51dac269a8c40f85ede9b090e":"2020-11-01T12:09:24.407Z","0.0.141":"2020-11-01T12:14:24.871Z","0.0.141-renovate-eslint-config-standard-16-x-9efe563b456210073b8eefbf7c902f14a9b52e54":"2020-11-01T12:15:26.275Z","0.0.142-renovate-non-major-6142a8d43d340d51089436b4e6f517651d933788":"2020-11-01T12:19:02.069Z","0.0.142-renovate-eslint-config-standard-16-x-63901991bed9301693fc3ef750d0691e64c61c83":"2020-11-01T12:19:54.008Z","0.0.142":"2020-11-01T12:21:56.492Z","0.0.143-renovate-eslint-config-standard-16-x-a332fa07163a5594b9af9edb045c7be8c4c7c7d9":"2020-11-01T12:24:37.649Z","0.0.143-renovate-eslint-config-standard-16-x-b506e1e8c461e3ef25e36d9ec5be77acb17f46ed":"2020-11-02T05:14:14.279Z","0.0.143":"2020-11-02T05:24:03.003Z","0.0.144-renovate-non-major-5d04190412bd67e4c378cdf33698a1d5eee6eead":"2020-11-02T05:29:15.834Z","0.0.144":"2020-11-02T05:34:42.875Z","0.0.145-renovate-non-major-2080b7310cfcb9b6d5a437d5f04ff3f3458929ef":"2020-11-02T07:48:59.361Z","0.0.145":"2020-11-02T07:52:15.379Z","0.0.146-renovate-non-major-eeea3aaafb97443663355f7eaa4d72840367fdd5":"2020-11-02T16:14:10.848Z","0.0.146":"2020-11-02T16:17:26.444Z","0.0.147-renovate-non-major-5ebf238f682458ccba794566f31f1e6eed5a8f70":"2020-11-04T08:34:15.879Z","0.0.147":"2020-11-04T08:37:37.528Z","0.0.148-renovate-non-major-7b7c3a694d5db225416da7b8d69e2764a85af709":"2020-11-04T18:47:21.248Z","0.0.148-renovate-non-major-d1ecc1e49d035d1e28b8cc73965e728bef1944ec":"2020-11-05T05:40:04.415Z","0.0.148":"2020-11-05T05:42:43.637Z","0.0.149-force-renovate-node-version-edf2f00aa05cebcf03b43c69b0e01a69790910b6":"2020-11-06T02:50:44.626Z","0.0.149":"2020-11-06T02:55:15.632Z","0.0.150-renovate-non-major-2822113ba49a4d617a72bcca9e303aecb6b9ff8a":"2020-11-06T02:58:19.970Z","0.0.150":"2020-11-06T03:03:32.922Z","0.0.151-renovate-non-major-41a2d68096c2585ed1ec37f9334fbdbefc41ced7":"2020-11-06T03:06:54.397Z","0.0.151":"2020-11-06T03:12:43.438Z","0.0.152-renovate-non-major-638e7b783a762e88715c55a7370a93370764d4d8":"2020-11-06T03:15:45.068Z","0.0.152":"2020-11-06T03:38:45.436Z","0.0.153-renovate-non-major-8692768cc03a81ee9942fd08f4725b262f6f8411":"2020-11-06T05:15:36.756Z","0.0.153":"2020-11-06T05:18:52.944Z","0.0.154-renovate-non-major-c19a52f78dff9eafd2cbe857ccba9b9c24af2b9d":"2020-11-06T06:30:22.671Z","0.0.154":"2020-11-06T06:33:38.805Z","0.0.155-renovate-non-major-0815bc6a4e0da1890271650b51fa0e2cb14ea2f9":"2020-11-06T09:17:59.421Z","0.0.155":"2020-11-06T09:21:32.397Z","0.0.156-renovate-non-major-3f3f046491715824bcef921536c5c7ac4178100b":"2020-11-07T04:05:05.777Z","0.0.156":"2020-11-07T04:07:54.845Z","0.0.157-renovate-non-major-d1e21f5b765f4a95749e442430d34d8d6aded568":"2020-11-09T16:37:40.732Z","0.0.157":"2020-11-09T16:40:52.601Z","0.0.158-renovate-non-major-aecfb5c3f8fcbb0e8e4fb9a51f068e6ba10c6721":"2020-11-10T00:40:32.325Z","0.0.158":"2020-11-10T00:43:54.993Z","0.0.159-renovate-non-major-c57fae639d20cd7fad5878f7b044d78ba34c74a4":"2020-11-10T01:37:52.826Z","0.0.159":"2020-11-10T01:40:55.253Z","0.0.160-ci-use-node-14-d35fb33e30cf956467402e69ed80c3471c32ae2e":"2020-11-11T07:32:59.183Z","0.0.160":"2020-11-11T07:36:44.254Z","0.0.161-require-node-14-8704c3c0b558de28ddd980992633494508c470ec":"2020-11-12T01:29:05.177Z","0.0.161-renovate-non-major-fc23ff735ee4c994b80a32bf5918147eb851a7f5":"2020-11-12T01:29:46.080Z","0.0.161":"2020-11-12T01:33:38.846Z","0.0.161-renovate-non-major-f9bc7447db5dbc6a5e70c2d4fd326194fef4d706":"2020-11-12T01:34:49.984Z","0.0.162-renovate-non-major-e1da9026404cfc1e3c69bf73a659127ad5bad47c":"2020-11-12T01:36:37.017Z","0.0.162":"2020-11-12T01:42:04.570Z","0.0.163-renovate-non-major-509197b4c3d6617eafb946a2b86ee11a8a4a9a4b":"2020-11-12T06:56:33.722Z","0.0.163":"2020-11-12T06:59:38.529Z","0.0.164-renovate-non-major-64e0f5841b40756420d10168c6df00f331151c3d":"2020-11-14T09:41:51.577Z","0.0.164":"2020-11-14T09:44:51.014Z","0.0.165-renovate-non-major-0c2ff3274e42ebac8cd1eacef2800ad027f56527":"2020-11-14T12:05:42.368Z","0.0.165":"2020-11-14T12:11:42.696Z","0.0.166-renovate-non-major-7dcc5a430ccb4ff2311c584f8f6a9eedb0e30ded":"2020-11-14T13:50:28.123Z","0.0.166":"2020-11-14T13:53:13.338Z","0.0.167-renovate-non-major-820a1222fcfffa4a23198f57b6db3fba0a66d629":"2020-11-14T14:41:35.348Z","0.0.167":"2020-11-14T14:44:33.279Z","0.0.168-renovate-non-major-14f84f69bf16c38e4c02c47f7f7c2b1c6e437c15":"2020-11-14T15:41:07.702Z","0.0.168":"2020-11-14T15:44:39.123Z","0.0.169-renovate-non-major-928f3af6b499c6db298e56c2eb2bad94604ccefd":"2020-11-19T01:28:41.805Z","0.0.169-renovate-non-major-fb91722b89686737baf007dce9e85a35bb24aaa6":"2020-11-19T01:59:28.046Z","0.0.169":"2020-11-19T02:03:59.578Z","0.0.170-renovate-non-major-a81d020da12a58f3d1a73febe3c2da2530d29724":"2020-11-20T00:22:56.067Z","0.0.170":"2020-11-20T00:26:25.540Z","0.0.171-renovate-non-major-5125d403d7cc098b4f456b477f39acdc27078a3e":"2020-11-20T13:47:25.243Z","0.0.171":"2020-11-20T13:51:59.125Z","0.0.172-renovate-non-major-744caf590123bfab2311c8494ced6dda5c8bcdd8":"2020-11-20T23:03:30.635Z","0.0.172":"2020-11-20T23:06:33.988Z","0.0.173-renovate-non-major-2dc841e8cd09cf245d47d3c1e083140c57df225b":"2020-11-21T01:31:37.482Z","0.0.173":"2020-11-21T01:34:51.416Z","0.0.174-renovate-non-major-8b9ef52e6267197ce6e55af127764bc078b0fd32":"2020-11-23T11:38:28.351Z","0.0.174":"2020-11-23T11:41:52.157Z","0.0.175-renovate-non-major-698ca64402b610d6922c2ddf34564dfec44067a8":"2020-11-23T13:12:35.337Z","0.0.175":"2020-11-23T13:15:21.306Z","0.0.176-renovate-non-major-049d9133d92e7d8bc0a3691973e384d7aa78495d":"2020-11-24T05:13:17.675Z","0.0.176":"2020-11-24T05:18:26.247Z","0.0.177-renovate-non-major-66255c533dcaecc0bfd6566c9f2f02716ac3b75a":"2020-11-24T07:01:27.724Z","0.0.177":"2020-11-24T07:04:41.259Z","0.0.178-renovate-non-major-2ef1bfb16c4031f7a935372f2a38056d117fe958":"2020-11-27T07:51:53.782Z","0.0.178":"2020-11-27T07:54:49.749Z","0.0.179-renovate-non-major-15d09c8a1c1e54d37b8f6145714450d55075ab2b":"2020-11-27T08:14:05.176Z","0.0.179":"2020-11-27T08:17:08.867Z","0.0.180-renovate-non-major-45ed9ae4246e5d9e31bc824986d503893156ae5d":"2020-12-01T15:39:03.221Z","0.0.180":"2020-12-01T15:45:18.150Z","0.0.181-renovate-non-major-23e8da340e889b1e01a177199ce2551ed32b5ae1":"2020-12-01T21:37:17.922Z","0.0.181":"2020-12-01T21:40:00.981Z","0.0.182-renovate-non-major-5131cfc0e086d49ae759282a9782e22ca93de15e":"2020-12-04T17:00:38.840Z","0.0.182":"2020-12-04T17:13:40.271Z","0.0.183-renovate-non-major-1752ed444b21f5eb39f13b8063c6b1ff16c43b03":"2020-12-04T18:51:37.046Z","0.0.183":"2020-12-04T18:54:47.230Z","0.0.184-renovate-non-major-b194362a04335c178dc93401c2e9df41f4b2423a":"2020-12-05T09:30:26.675Z","0.0.184-renovate-non-major-3deddb641db830bc5952d4474791518b9923e991":"2020-12-05T12:58:43.289Z","0.0.184":"2020-12-05T13:01:30.140Z","0.0.185-renovate-non-major-2020bfc867388d52c0303f81374129d152427ccd":"2020-12-05T14:37:26.275Z","0.0.185":"2020-12-05T14:40:12.418Z","0.0.186-renovate-husky-5-x-8985aa605409d2c9415f51002f53f35be66af37a":"2020-12-07T00:35:54.918Z","0.0.186-renovate-husky-5-x-0479b2c1419e0f3f00434b72016079de400c792b":"2020-12-07T07:50:52.324Z","0.0.186-remove-postinstall-568d344f90571056be26c44c6721e908b3e978c7":"2020-12-07T09:28:29.668Z","0.0.186-renovate-non-major-42db35d5da6d9fc8b061df44b9098baecfadce34":"2020-12-07T11:07:38.794Z","0.0.186":"2020-12-07T11:11:20.392Z","0.0.187-add-husky-postinstall-194f1103d8b1afba76b6709224e7a44257bf61d1":"2020-12-08T02:56:30.594Z","0.0.187-renovate-non-major-4a11e735f4054684ee40f3b68d816dcc244501be":"2020-12-08T03:09:29.591Z","0.0.187":"2020-12-08T10:19:59.788Z","0.0.188-renovate-non-major-4f1a5ddd0ea401a6f0a12db0873fbe2001de4d7e":"2020-12-08T10:25:49.124Z","0.0.188":"2020-12-08T10:35:38.686Z","0.0.189-renovate-non-major-2507c6024a1ad6ea9683b66a08e03d6ec5c67066":"2020-12-08T11:12:31.208Z","0.0.189":"2020-12-08T11:15:40.900Z","0.0.190-renovate-non-major-4d8b1fc2f9e8033ddcee0bffad378878f33febea":"2020-12-08T21:45:57.507Z","0.0.190":"2020-12-08T21:49:15.674Z","0.0.191-eslintrc-root-true-b296d8a75d6540c9cc586ef20cc8173f6af7c45c":"2020-12-10T06:10:05.908Z","0.0.191":"2020-12-10T06:13:27.325Z","0.0.192-renovate-non-major-a8e6120d8c37147850de3609b7c2b149c3a5d649":"2020-12-10T07:49:57.012Z","0.0.192":"2020-12-10T14:21:35.224Z","0.0.193-renovate-non-major-ebd691f7f46fec6c9cec26a726554b48ef42e8b2":"2020-12-10T23:50:56.513Z","0.0.193":"2020-12-10T23:54:50.791Z","0.0.194-renovate-non-major-36a7feb91f107d941294c334e846771cad36938c":"2020-12-11T10:54:43.651Z","0.0.194-renovate-non-major-acd78b438b09b58726a762226654f517ea1eee74":"2020-12-11T23:54:28.727Z","0.0.194-renovate-non-major-7cc8f2ba91390b34d24f1a25ff608f618a9060a7":"2020-12-12T00:44:32.183Z","0.0.194-postinstall-sh-compat-5b7bb6e9151256a77d97895fe5f1ccd11044615b":"2020-12-12T03:38:40.771Z","0.0.194":"2020-12-12T03:59:13.510Z","0.0.194-renovate-non-major-a44ad8ac185d915225bf5e8ffe2d623ebeaf6d99":"2020-12-12T04:01:11.909Z","0.0.195-renovate-non-major-6fbaa54c88bafe76f86e0ef82cb9018a8b953b2f":"2020-12-12T04:03:34.185Z","0.0.195-renovate-non-major-40262e55166a54f83a232792969f3171bea89d19":"2020-12-12T07:52:58.297Z","0.0.195-renovate-non-major-a7881517fbd8b4024120e96f69b7750fa9422089":"2020-12-12T07:57:01.822Z","0.0.195-renovate-non-major-d061abd284f3667a0951f1349f4c632f478ed174":"2020-12-12T08:34:08.039Z","0.0.195-renovate-non-major-bc608c3cae9555ee49d55c38332a76c18482bf2b":"2020-12-12T09:30:59.922Z","0.0.195-dependabot-npm-and-yarn-ini-1-3-8-43343de2a39b7db6be0cf1c643202d1212512538":"2020-12-12T10:04:35.814Z","0.0.195":"2020-12-12T10:07:22.073Z","0.0.196-renovate-non-major-6ea3d32b2c85466ee50c21c2a5348cc07aaafb01":"2020-12-12T10:12:59.654Z","0.0.196-renovate-non-major-b4356fead0e1b2c42873a1ef25864703d44b528b":"2020-12-12T11:18:59.145Z","0.0.196-renovate-ignore-node-0ebca563c11dcf58b6a39ba17a457fda3100bac4":"2020-12-12T13:46:39.828Z","0.0.196":"2020-12-12T13:49:51.827Z","0.0.197-renovate-non-major-fb165e9a78643b648cf23b293fc5a8cee891133b":"2020-12-12T13:53:30.785Z","0.0.197":"2020-12-12T13:58:01.823Z","0.0.198-renovate-non-major-b1aac5f7e18b13538be766fb8e67d2dd7af88d05":"2020-12-12T16:20:07.499Z","0.0.198":"2020-12-12T16:22:59.931Z","0.0.199-renovate-non-major-5273b7f757db8f41c520226ebd10dbb8444033d5":"2020-12-13T19:22:59.714Z","0.0.199":"2020-12-13T19:25:45.573Z","0.0.200-renovate-non-major-cb3596fcafccca62bb9d0ab56887c7155e309b7f":"2020-12-15T06:01:30.919Z","0.0.200":"2020-12-15T06:04:32.292Z","0.0.201-renovate-non-major-7be2808363099445912509be0973b6e8fd73a5bd":"2020-12-15T07:45:57.501Z","0.0.201":"2020-12-15T07:49:08.734Z","0.0.202-renovate-non-major-c540e8e4747bbff6fa935b9c21a21c1b29768efa":"2020-12-16T13:00:19.055Z","0.0.202":"2020-12-16T13:03:07.523Z","0.0.203-use-balena-lint-54477f32b590f7fd0001ca8d804dabd447a65e15":"2020-12-17T06:20:35.310Z","0.0.203-use-balena-lint-14e284c6a3c8e55fee9347df6bbb3a2a471c8fc7":"2020-12-17T06:37:01.497Z","0.0.203-renovate-non-major-8ddaaa3d45acd1e736366cbc985cbb99789ad3d7":"2020-12-17T21:23:57.648Z","0.0.203":"2020-12-17T21:27:02.856Z","0.0.204-renovate-non-major-e8761bcd15b43c74f59fda5a6af6e8602b605d3b":"2020-12-19T00:43:09.271Z","0.0.204":"2020-12-19T00:47:43.644Z","0.0.205-renovate-non-major-42526e729a0bbe7a56f97a0dd4f26b79925042ad":"2020-12-19T00:56:13.753Z","0.0.205":"2020-12-19T01:00:11.833Z","0.0.206-renovate-non-major-fe3637b227d3d9e39d18618c00c635033e275b61":"2020-12-19T08:17:47.970Z","0.0.206":"2020-12-19T08:29:14.172Z","0.0.207-renovate-non-major-697ff277e771f89e76c9e233d23693f04a75835a":"2020-12-19T13:45:16.223Z","0.0.207":"2020-12-19T13:48:54.650Z","0.0.208-renovate-non-major-11b9c95e8fe994aafde6e25387cb60ad86a9d587":"2020-12-21T15:22:29.264Z","0.0.208":"2020-12-21T15:25:19.730Z","0.0.209-renovate-non-major-0bd7508d43b3c7388cc3f7f4cf51017ce19fee34":"2020-12-23T08:42:34.442Z","0.0.209":"2020-12-23T08:45:53.729Z","0.0.210-renovate-non-major-c99db4975a3f6439118da4626fbe714c96245885":"2020-12-23T10:49:13.400Z","0.0.210":"2020-12-23T10:52:47.366Z","0.0.211-renovate-non-major-99185a737dbf7b5e92088ef1dd78a69e9eb6322f":"2020-12-27T03:07:50.796Z","0.0.211":"2020-12-27T03:11:31.307Z","0.0.212-renovate-non-major-4fa14f36274a66113cf298e4cc26e225efd969de":"2020-12-30T07:04:06.229Z","0.0.212":"2020-12-30T07:07:22.060Z","0.0.213-renovate-non-major-bd4ab7ca1e6b830b86618daf64fe0e81c5d1c9ba":"2020-12-30T19:41:28.762Z","0.0.213":"2020-12-30T19:46:53.024Z","0.0.214-renovate-non-major-de778d90b1d70ad54fa9b1cea56200a84980e98a":"2021-01-01T17:05:36.882Z","0.0.214":"2021-01-01T17:10:49.750Z","0.0.215-renovate-non-major-5b02ed05455855ecbddf488291d7136c132ebb2d":"2021-01-04T11:41:59.204Z","0.0.215":"2021-01-04T11:44:49.575Z","0.0.216-renovate-non-major-8ebcdb9eb52c6222a27240c106a6398eef06d2eb":"2021-01-04T12:54:49.378Z","0.0.216":"2021-01-04T12:58:05.237Z","0.0.217-renovate-non-major-31cd1cd5c0640e44f710990952e49a905c820b49":"2021-01-07T03:33:47.291Z","0.0.217":"2021-01-07T03:37:08.072Z","0.0.218-renovate-non-major-023a1641b8e819949965c4965f82b4dbf1f0214a":"2021-01-07T10:41:35.902Z","0.0.218":"2021-01-07T10:44:13.521Z","0.0.219-renovate-non-major-51e845dc7cfc1cdec0a75039040ce23ce34a7542":"2021-01-09T22:32:20.228Z","0.0.219":"2021-01-09T22:35:12.085Z","0.0.220-renovate-non-major-e32deec1e8786472d382150eaf6f188517afcefa":"2021-01-11T07:53:02.251Z","0.0.220":"2021-01-11T07:56:40.754Z","0.0.221-renovate-non-major-e1451b955ceff7ec0e9790352999810faa7eebac":"2021-01-11T08:02:11.752Z","0.0.221":"2021-01-11T08:05:21.922Z","0.0.221-use-company-token-eec8b50388d20f3a9de4a5e3a2ed8c945d48030e":"2021-01-11T08:06:04.638Z","0.0.222-use-company-token-9ab810b3ab52f12c39eb0bd50b86c90fda600a40":"2021-01-11T08:11:48.216Z","0.0.222":"2021-01-11T08:14:58.943Z","0.0.223-renovate-eslint-plugin-jsdoc-31-x-2aad7883f9b614b49d3635d6e8bb85a77a0c0875":"2021-01-11T11:24:10.772Z","0.0.223-renovate-eslint-plugin-jsdoc-31-x-0c7e15c364ed74a8726a2b9dd3c783e9c7373994":"2021-01-11T13:52:12.869Z","0.0.223-renovate-eslint-plugin-jsdoc-31-x-db93955db4bf8ad5561072ba5aac07a25083dbb1":"2021-01-11T17:30:09.351Z","0.0.223":"2021-01-12T00:35:45.118Z","0.1.0-add-card-patch-metrics-8d8b2a378d117a4a1b9fa7dbb03da81bbb96fdf9":"2021-01-12T03:50:16.379Z","0.1.0-add-card-patch-metrics-956b4cea6a4b8f06bd2a36dfc0a7a40909ff22ab":"2021-01-12T09:24:02.421Z","0.1.0-add-card-patch-metrics-993f12c3cb6577807333fe1fb66410c6193cf323":"2021-01-12T13:05:16.163Z","0.1.0-add-card-patch-metrics-c29f95125e1949ecaed6b382e186581f652edf88":"2021-01-12T13:09:55.157Z","0.0.224-add-failure-tests-f32ce9bba300819e5e4aeb0a3bc4c92dc30a9cde":"2021-01-13T04:30:48.787Z","0.0.224":"2021-01-13T04:44:32.826Z","0.1.0-add-card-patch-metrics-a568560e79ae9cfa5e450c010fb7673a453c987b":"2021-01-13T05:19:21.348Z","0.1.0-add-card-patch-metrics-f76c0657fe970753da880ab3d57f6ba501464e47":"2021-01-13T05:20:19.645Z","0.1.0":"2021-01-13T05:41:37.456Z","0.1.1-renovate-non-major-30d8ab2254c6ce4442c9993ab5cd8ba7f6d83689":"2021-01-13T13:33:28.805Z","0.1.1":"2021-01-13T13:36:20.108Z","0.1.2-renovate-non-major-1bc5db2d5e476b14f7fb0f6b993a384b1d65bb30":"2021-01-14T03:05:19.487Z","0.1.2":"2021-01-14T03:08:27.262Z","0.1.3-fix-lint-staged-068b95b136f89096ad2835208f1de1a4082cbbd4":"2021-01-14T04:16:04.241Z","0.1.3":"2021-01-14T04:18:58.226Z","0.1.4-renovate-non-major-d2d2e3eb3f3f3e433509e09c2c882e5419870eb4":"2021-01-14T04:23:53.323Z","0.1.4":"2021-01-14T04:27:44.042Z","0.1.5-lint-staged-add-readme-ce3cc11920ef6815ee8eda41ca21fc852cd095a2":"2021-01-14T04:34:54.487Z","0.1.5":"2021-01-14T04:38:37.148Z","0.1.6-renovate-non-major-686758eb350b313ed6c51eaea1423af9d6d2546b":"2021-01-14T05:39:12.396Z","0.1.6":"2021-01-14T05:42:34.905Z","0.1.7-renovate-non-major-18dce27b27d347f5f7abb2d03f139afc796289ef":"2021-01-14T16:29:08.725Z","0.1.7-renovate-non-major-f72e0a52ffcfdd7af05ea7999c8a47e323d0751e":"2021-01-14T16:33:06.996Z","0.1.7-renovate-non-major-a04b25a0299a2b9b0b359209c54503826a86535d":"2021-01-14T16:37:33.373Z","0.1.7":"2021-01-14T16:40:33.468Z","0.1.8-renovate-non-major-42e5171acae2e0fd6ea90d48cf4794b2a0b72778":"2021-01-14T18:43:40.487Z","0.1.8":"2021-01-14T18:48:05.402Z","0.1.9-renovate-non-major-f7de000f96cc36616abaa05703d36e657268da23":"2021-01-14T23:53:52.484Z","0.1.9":"2021-01-14T23:57:17.548Z","0.1.10-renovate-non-major-28e7dcae476403ccae45edf5db9f1aba12d4cba5":"2021-01-15T00:02:56.699Z","0.1.10":"2021-01-15T00:05:55.065Z","0.1.11-renovate-non-major-4c19fdb567344f2f6e361c3dc6449f0612624451":"2021-01-15T01:57:22.596Z","0.1.11":"2021-01-15T02:00:12.875Z","0.1.12-renovate-non-major-e436e483c0b1e33a3c19a26d0444f76f5b38f015":"2021-01-15T23:58:03.599Z","0.1.12":"2021-01-16T00:01:08.133Z","0.1.13-renovate-non-major-106581b8c71ca107c6214aae80d6dc0be897d074":"2021-01-16T03:03:12.893Z","0.1.13":"2021-01-16T03:06:10.976Z","0.1.14-renovate-non-major-cc5e85e26421c4ba3bf9cf8ad9e0a20bb8a5f90c":"2021-01-17T12:16:41.456Z","0.1.14":"2021-01-17T12:19:49.250Z","0.1.15-renovate-non-major-7b3162f5b892d175550cee71ab171ffe1294b767":"2021-01-17T13:22:18.182Z","0.1.15":"2021-01-17T13:25:14.009Z","0.1.16-renovate-non-major-f8e7a1a7ff66cec1a7783201d634911aafbb2ce7":"2021-01-17T14:14:49.354Z","0.1.16":"2021-01-17T14:17:41.850Z","0.1.17-renovate-non-major-52368694d649362e5e1f0145d66950efd7a24ab8":"2021-01-18T08:45:05.717Z","0.1.17":"2021-01-18T08:47:55.796Z","0.1.18-renovate-non-major-bb22dd3f9f93c6fc7e3ec54c5d1616af054d28b5":"2021-01-18T10:49:05.405Z","0.1.18":"2021-01-18T10:52:08.168Z","0.1.19-renovate-non-major-6354b464dc80d6b51e71ae35cc0202965aa9efba":"2021-01-20T04:22:23.536Z","0.1.19":"2021-01-20T04:25:30.649Z","0.1.20-renovate-non-major-a2b587a3a9effb97294e9333c8ce301969603f0e":"2021-01-20T05:57:56.484Z","0.1.20":"2021-01-20T06:01:15.925Z","0.1.21-renovate-non-major-f4f63fb873ffbb5f4e454931b743f52b4466647f":"2021-01-20T07:51:13.079Z","0.1.21":"2021-01-20T07:54:11.000Z","0.1.22-renovate-non-major-8d2e6e69cd6fbb90093e7621789ef869e2e58dde":"2021-01-21T15:29:22.940Z","0.1.22":"2021-01-21T15:32:25.639Z","0.1.23-renovate-non-major-817dc9a06d9d472df56b74bdbd7e92040b23d231":"2021-01-23T04:50:09.911Z","0.1.23":"2021-01-23T04:53:35.049Z","0.1.24-renovate-non-major-2fad1f64f0c3ac90a87850e9d5cf249d36300011":"2021-01-23T06:11:59.116Z","0.1.24":"2021-01-23T06:15:17.392Z","0.1.25-renovate-non-major-152169b2a8b74f1f29bca2e300113207e5b8023b":"2021-01-23T07:51:26.252Z","0.1.25":"2021-01-23T07:54:31.758Z","0.1.26-renovate-non-major-40e96c930e8fee31a2d4548c265ca36fae3adf3c":"2021-01-23T08:29:23.449Z","0.1.26":"2021-01-23T08:32:31.775Z","0.1.27-renovate-non-major-2b5cbacdcdf81ae647d1b9f28557cc3293c72e65":"2021-01-23T15:43:03.343Z","0.1.27":"2021-01-23T15:46:18.774Z","0.1.28-renovate-non-major-59a6641c8bbc2ed9cc31ce6e2cfe49c2a8fdadde":"2021-01-23T17:02:42.202Z","0.1.28-renovate-non-major-a67ff549663d84665edf3ca5d6f54bd1d916aec1":"2021-01-23T17:06:53.563Z","0.1.28":"2021-01-23T17:09:29.177Z","0.1.29-renovate-non-major-a4a3dc34f54a566777af0c6d3113a75769de6f41":"2021-01-24T13:43:56.627Z","0.1.29":"2021-01-24T13:46:46.019Z","0.1.30-renovate-non-major-bc44191db914b22f3f312a3116ea965c883f5b53":"2021-01-24T14:47:15.645Z","0.1.30-renovate-non-major-2febadd177fe71aec71830f5e35ed2fe4173cadf":"2021-01-24T14:51:11.253Z","0.1.30":"2021-01-24T14:54:46.139Z","0.1.31-renovate-non-major-b6f86cae286a182f3b606b2b020e6b4f73f439ff":"2021-01-24T15:28:26.335Z","0.1.31":"2021-01-24T15:31:46.491Z","0.1.32-renovate-non-major-813c8f38744e25f242b89ea2292db59829d32903":"2021-01-24T16:40:14.536Z","0.1.32":"2021-01-24T16:43:14.107Z","0.1.33-renovate-non-major-df2d44e5b2df8a05836cb531bc9ddd9f851c77a2":"2021-01-25T08:56:17.481Z","0.1.33":"2021-01-25T08:59:21.433Z","0.1.34-renovate-non-major-77ef3ab4c4dba828a571d463a25d51924a25f87a":"2021-01-25T09:04:58.968Z","0.1.34":"2021-01-25T09:08:00.410Z","0.1.35-renovate-non-major-1199b6277ca94cb9bfcd405c320682d426eb3379":"2021-01-25T10:47:22.468Z","0.1.35":"2021-01-25T10:50:38.607Z","0.1.36-renovate-non-major-78c276ecb52a0ebb975eac810fb96328cfd12598":"2021-01-25T13:32:57.917Z","0.1.36":"2021-01-25T13:36:11.895Z","0.1.37-renovate-non-major-7e564cacd638b7fd68c83e6580227cb3456f626c":"2021-01-27T06:03:48.156Z","0.1.37":"2021-01-27T06:06:31.921Z","0.1.38-renovate-non-major-7c6c4114cc15074fa4839475665aadfb0d6d820c":"2021-01-27T10:50:14.094Z","0.1.38":"2021-01-27T10:54:39.667Z","0.1.39-renovate-non-major-c24e7bdd0eee1a9e8fd5406217540283be351aa6":"2021-01-28T00:52:49.348Z","0.1.39":"2021-01-28T00:55:12.244Z","0.1.40-renovate-non-major-d5660fbdccbce20dad1b4e07452abdab040d6b1a":"2021-01-28T01:34:50.098Z","0.1.40":"2021-01-28T01:37:52.140Z","0.1.41-renovate-non-major-6705d8b585ebf4f7001b1ac3d3b4a988bb73ff65":"2021-01-28T02:27:07.979Z","0.1.41":"2021-01-28T03:05:25.668Z","0.1.42-renovate-non-major-549df2a6b15748edd53973e116835c73a190b546":"2021-01-28T04:24:07.598Z","0.1.42":"2021-01-28T04:27:16.127Z","0.1.43-renovate-non-major-4fc9adf8fa471fc8aa68b1c7c46d524b7d173d9b":"2021-01-29T17:30:09.294Z","0.1.43":"2021-01-29T17:33:41.939Z","0.1.44-renovate-non-major-5b2653ab8a7aa1e274aa7f4a1ad32143fad4f649":"2021-01-31T05:47:22.044Z","0.1.44-renovate-non-major-f5cc2d08083d715edbc82f3f13a14a4dbacda9e9":"2021-01-31T07:09:35.036Z","0.1.44":"2021-01-31T07:12:25.376Z","0.1.45-renovate-non-major-a3151050283d19a4e346bb5a803aef968d9cc457":"2021-01-31T10:40:21.724Z","0.1.45-renovate-non-major-874f73342a764647d90834776f083a65774d161b":"2021-01-31T11:41:52.594Z","0.1.45":"2021-01-31T11:44:49.211Z","0.1.46-renovate-non-major-5d9205cc2ade4d21d9a03f6b90d7a586f5289e33":"2021-01-31T17:13:40.451Z","0.1.46":"2021-01-31T17:16:50.192Z","0.1.47-renovate-non-major-ffc492c09a3b83f7f4a454923424ce5218736971":"2021-01-31T18:52:07.406Z","0.1.47":"2021-01-31T18:55:02.089Z","0.1.48-renovate-non-major-6e46ab9539269c9cc298929fac494127c9ff287d":"2021-02-01T15:07:10.116Z","0.1.48":"2021-02-01T15:09:53.774Z","0.1.49-renovate-non-major-7e170cd2a879e0e4a387dcaa8bb3f8fa292a403b":"2021-02-01T16:20:51.473Z","0.1.49":"2021-02-01T16:23:42.741Z","0.1.50-renovate-non-major-cb4685e582a3b536c55cb84fc56fd92741fd4117":"2021-02-01T17:33:25.920Z","0.1.50":"2021-02-01T17:36:26.592Z","0.1.51-renovate-non-major-058b712a8cd891f276913cb9f32dc83f073bee9d":"2021-02-01T20:56:14.416Z","0.1.51":"2021-02-01T20:59:21.635Z","0.1.52-whitesource-configure-e0ca1baa58ace2e72f26e5320b4797e9578eab88":"2021-02-02T01:11:58.466Z","0.1.52":"2021-02-02T01:15:46.193Z","0.1.53-renovate-non-major-e05cf2e6914f84bc3762720b2d0104ee535a442f":"2021-02-02T01:22:31.953Z","0.1.53":"2021-02-02T01:27:13.603Z","0.1.54-renovate-non-major-1cb571ced52ca56b9260e1127d20caffcecfd5bb":"2021-02-02T01:30:31.410Z","0.1.54":"2021-02-02T01:36:35.378Z","0.1.55-renovate-non-major-a20ffa12644ed117cd0931119aadc66e4a275193":"2021-02-02T03:19:07.350Z","0.1.55":"2021-02-02T03:22:20.248Z","0.1.56-renovate-balena-jellyfish-logger-1-x-2f1fbd855d157556caaf947ab3d53de002bbcb41":"2021-02-03T03:20:45.455Z","0.1.56-renovate-balena-jellyfish-logger-1-x-9121f9080ccc117b6f9c107c0fa758dbccffa109":"2021-02-03T05:54:11.516Z","0.1.56":"2021-02-04T03:02:11.317Z","0.1.57-renovate-non-major-f72c4094946c0127a43ec7a57f431e4e0fb64da9":"2021-02-04T17:27:36.165Z","0.1.57":"2021-02-04T17:30:21.208Z","0.1.58-renovate-npm-version-101ea72554f6c5a71b18650b9ed33ba1583f064f":"2021-02-05T04:13:51.308Z","0.1.58":"2021-02-05T04:22:40.426Z","0.1.59-renovate-non-major-aeae13b567e100544557f53e0c21a348776fc8f5":"2021-02-05T05:54:17.549Z","0.1.59":"2021-02-05T05:57:32.758Z","0.1.60-renovate-non-major-5d14ce6fa7028191c5c4114ecbe53acade2fda1d":"2021-02-05T17:29:23.879Z","0.1.60":"2021-02-05T17:32:37.140Z","0.1.61-renovate-non-major-69dbffcc50e45fd5578182abc6affbd12c219984":"2021-02-05T18:40:28.531Z","0.1.61":"2021-02-05T18:44:05.881Z","0.1.62-add-link-in-readme-5cbde67fc72fc73bb1717827b83972fcfcca2037":"2021-02-06T07:46:30.032Z","0.1.62":"2021-02-06T07:49:35.388Z","0.1.63-use-shared-renovate-config-e42143de5b3548a75ad70c7176568ddc2a2b751f":"2021-02-06T09:47:19.049Z","0.1.63":"2021-02-06T09:51:05.351Z","0.1.64-renovate-non-major-a769e42da6e4ee3defefede96b6e7655165ce19e":"2021-02-06T10:42:50.341Z","0.1.64":"2021-02-06T10:45:41.135Z","0.1.65-renovate-non-major-698d74d3080539e5cf7b509ab1caea9e33c5b202":"2021-02-07T09:47:16.590Z","0.1.65":"2021-02-07T09:50:17.729Z","0.1.66-renovate-non-major-eacaa58b213471375d95f8abbd0c0c200494a7e5":"2021-02-07T11:33:20.923Z","0.1.66":"2021-02-07T11:36:34.073Z","0.1.67-renovate-non-major-f2294970a98b21a60d6651007557043460aa0f53":"2021-02-07T12:33:35.813Z","0.1.67":"2021-02-09T00:30:39.757Z","0.1.68-renovate-non-major-2e786de9cc152ec97fb500f75464b867eac30094":"2021-02-09T00:33:28.909Z","0.1.68":"2021-02-09T00:38:45.888Z","0.1.69-renovate-non-major-463f830b6ab39fad2685a917c3a129f83bd1e4d1":"2021-02-09T02:14:43.972Z","0.1.69":"2021-02-09T02:17:39.672Z","0.1.70-renovate-non-major-6ebf89e5b3d00933a9d129190d9557c30c03be52":"2021-02-11T07:23:24.033Z","0.1.70":"2021-02-11T07:26:36.096Z","0.1.71-renovate-non-major-8c7bba9ea86dfe84f09fbc3e73e0a3551e4bf3e5":"2021-02-11T12:48:33.391Z","0.1.71":"2021-02-11T12:51:36.658Z","0.1.72-renovate-non-major-bc7f1a6fbb3020fcf9ee8abc3871a0759210bb55":"2021-02-12T23:18:55.328Z","0.1.72":"2021-02-12T23:22:12.406Z","0.1.73-renovate-non-major-06491a53394c084a43ac50edbd69c2768220ff6a":"2021-02-13T03:48:14.818Z","0.1.73":"2021-02-13T03:51:09.654Z","0.1.74-renovate-non-major-1c045a40ba9628ba6ad213b2c12fa7328170215b":"2021-02-13T05:42:08.685Z","0.1.74":"2021-02-13T05:45:11.549Z","0.1.75-renovate-eslint-plugin-jsdoc-32-x-f79e9ed150d847bb4e738ac3ee91fbe4d5ede3b6":"2021-02-15T05:16:36.355Z","0.1.75":"2021-02-15T05:43:19.345Z","0.1.76-renovate-non-major-e17f2616532805acf0d745a82d1c3215efa72282":"2021-02-15T05:49:26.952Z","0.1.76":"2021-02-15T05:52:59.173Z","0.1.77-renovate-non-major-72207fe6091914d76beb24a9be2eeaf45f11f04b":"2021-02-15T07:13:07.198Z","0.1.77":"2021-02-15T07:16:04.792Z","0.1.78-renovate-non-major-b70f706f53e0601a681e5f29cfd28005f2b87eca":"2021-02-15T11:45:50.887Z","0.1.78":"2021-02-15T11:50:49.414Z","0.1.79-renovate-non-major-e48bfc95a7c00c44b594906aa585e079cd844158":"2021-02-16T04:45:44.802Z","0.1.79":"2021-02-16T04:48:39.443Z","0.1.80-renovate-non-major-4354576a06659117ca0e824efcc8fa89c43e4cf0":"2021-02-16T06:31:09.355Z","0.1.80":"2021-02-16T06:34:33.539Z","0.1.81-renovate-non-major-060be9bee70fb1a0841ea4de81e2dd232f3f657f":"2021-02-16T12:12:32.324Z","0.1.81":"2021-02-16T12:15:42.250Z","0.1.82-renovate-non-major-97bae07df85caaa26176361f7c68d1852855fc9d":"2021-02-16T16:21:18.064Z","0.1.82":"2021-02-16T16:24:51.682Z","0.1.83-renovate-non-major-c5e11a9b07ebf8f4d20d0e08f2e7e5dd781f811a":"2021-02-16T19:18:54.288Z","0.1.83":"2021-02-16T19:22:16.927Z","0.1.84-renovate-non-major-c00e7c54a212d6d937383219cb7de540a0068283":"2021-02-17T03:49:58.288Z","0.1.84":"2021-02-17T03:52:50.528Z","0.1.85-add-monitor-link-826c5a4339148a80e0242da93c24af741514025e":"2021-02-18T07:40:14.011Z","0.1.85-add-monitor-link-2b273562d1242a6ce014dfb4e37ffd48ecc6ea31":"2021-02-18T07:47:55.574Z","0.1.85":"2021-02-18T07:51:29.715Z","0.1.86-renovate-non-major-3289ca40258e81553d798e8a1ff7a23c422583b5":"2021-02-18T11:49:23.265Z","0.1.86":"2021-02-18T11:52:39.544Z","0.1.87-add-changelog-yml-d127bda9b5379541a3c8c3f4e102f6164fa986ef":"2021-02-20T08:37:07.785Z","0.1.87":"2021-02-20T08:50:16.663Z","0.1.88-renovate-non-major-6cf0557564c7dc3191f804f533e4b1db766310ff":"2021-02-20T08:55:29.546Z","0.1.88":"2021-02-20T08:58:39.362Z","0.1.89-renovate-non-major-42e9c54af68739c4b1a978efb1ae92ea472eb269":"2021-02-20T09:56:24.379Z","0.1.89":"2021-02-20T09:59:49.045Z","0.1.90-renovate-non-major-9e1219b9dc1e6fd1f684363edf6b386c1c522d09":"2021-02-20T16:42:09.807Z","0.1.90":"2021-02-20T16:45:06.422Z","0.1.91-renovate-non-major-516a088d1ed9c8e3489aeca4fefbdd8e0126e7a8":"2021-02-20T18:15:44.381Z","0.1.91":"2021-02-20T18:19:18.588Z","0.1.92-renovate-non-major-1904708e939911ebada3b0573c2ac51367f2aca7":"2021-02-21T05:00:26.430Z","0.1.92":"2021-02-21T05:03:40.270Z","0.1.93-renovate-non-major-7a842fe0487504d007b03a6bd14794cb95d37e54":"2021-02-22T00:34:33.078Z","0.1.93":"2021-02-22T00:37:14.258Z","0.1.94-renovate-non-major-3996143540a39d3eb9fe17ee89398d1d8cb26696":"2021-02-22T17:51:06.776Z","0.1.94":"2021-02-22T17:54:06.210Z","0.1.95-renovate-non-major-2c72cb832b69bba60f132ff77d342d3af6280a63":"2021-02-22T20:27:43.883Z","0.1.95":"2021-02-22T20:31:08.469Z","0.1.96-renovate-non-major-2aa7361c5d54bb83e2bc0c33d8abf841f58be2c7":"2021-02-23T03:25:40.224Z","0.1.96":"2021-02-23T03:28:47.968Z","0.1.97-renovate-non-major-e1f6da79d538c269f0ef410ef23cdeecfa5c6dbd":"2021-02-23T10:22:48.470Z","0.1.97":"2021-02-23T10:25:49.029Z","0.1.98-renovate-non-major-7ce04f802998718efccda29205a80dcc27a9d53e":"2021-02-23T12:11:16.087Z","0.1.98":"2021-02-23T12:14:44.645Z","0.1.99-renovate-non-major-a574bd9742ae5d62aa7d50b8130c22fe199b0f3a":"2021-02-23T15:14:06.509Z","0.1.99":"2021-02-23T15:17:01.749Z","0.1.100-renovate-non-major-4511db9fc45099d1ab5b437af15995c4759ce302":"2021-02-26T12:55:26.152Z","0.1.100":"2021-02-26T13:00:07.089Z","0.1.101-renovate-jsdoc-to-markdown-7-x-1833b9be96233feedf9a3dd8ab4cd799847b5a56":"2021-02-26T23:54:39.605Z","0.1.101-renovate-non-major-e6736a3a5ce0ca9791ff90483b41bc28637cfb74":"2021-02-27T23:35:32.387Z","0.1.101":"2021-02-27T23:39:02.860Z","0.1.102-renovate-jsdoc-to-markdown-7-x-863309a5fbcafcfd067f05b9ba2363f0948006b5":"2021-02-27T23:41:41.924Z","0.1.102-renovate-non-major-c128582b1da14b4ee65e618320037bd37d7ede21":"2021-02-28T03:19:50.303Z","0.1.102":"2021-02-28T03:23:01.349Z","0.1.103-renovate-jsdoc-to-markdown-7-x-93bd5c379624ffba46fbaccf02752bf7ecde10bf":"2021-02-28T03:25:31.761Z","0.1.103":"2021-02-28T04:01:58.643Z","0.1.104-renovate-non-major-096698efe1954cd266089e59867a3664a4bba930":"2021-02-28T05:09:53.460Z","0.1.104":"2021-02-28T05:13:14.419Z","0.1.105-renovate-non-major-9fb18f3a185f6a418f31ffbc231043477b1f0493":"2021-03-01T02:40:14.381Z","0.1.105":"2021-03-01T02:43:48.700Z","0.1.106-renovate-non-major-09e8d0d2aba009107d62987a635c0b399ab1810a":"2021-03-01T04:37:04.680Z","0.1.106":"2021-03-01T04:40:11.477Z","0.1.107-renovate-non-major-d054125a3e105869aeb6d3a0cabbdab893089c5a":"2021-03-01T19:03:49.110Z","0.1.107":"2021-03-01T19:07:11.046Z","0.1.108-renovate-non-major-2c165ec3e427069a7b5a6038a0ef2a880bafabb6":"2021-03-02T05:11:05.467Z","0.1.108":"2021-03-02T05:14:10.888Z","0.1.109-renovate-non-major-483ae69ee1e76cb3ceea0bdf4b7b57ba715ee42c":"2021-03-10T08:06:07.448Z","0.1.109":"2021-03-10T08:09:39.821Z","0.1.110-renovate-non-major-e43c186181874ab9fe435bebe0a70899f4a98dcd":"2021-03-10T09:57:13.356Z","0.1.110":"2021-03-10T10:00:20.357Z","0.1.111-renovate-non-major-29e0bfbe47dd0093abba5311a51df670dcb8b8c5":"2021-03-11T00:02:50.845Z","0.1.111":"2021-03-11T00:06:26.962Z","0.1.112-renovate-non-major-d6b4a31d6457865c7ad260ef65754ec57b50f83d":"2021-03-11T01:59:20.436Z","0.1.112":"2021-03-11T02:02:40.569Z","0.1.113-renovate-non-major-5e5fdb1d23e470d70f11ed83b035e9c6d528a86b":"2021-03-11T13:59:24.931Z","0.1.113":"2021-03-11T14:02:55.647Z","0.1.114-renovate-non-major-d4d8dea4be736e74b95df8f0871052f4cb273701":"2021-03-12T02:05:32.697Z","0.1.114":"2021-03-12T02:08:21.319Z","0.1.115-renovate-non-major-767dd4fd1b4956c7f6da23bc6684bf90a287f742":"2021-03-13T00:04:44.871Z","0.1.115":"2021-03-13T00:07:44.622Z","0.1.116-renovate-non-major-6ee0d249fa4e7e0ec895073eee2f93fcd2d92017":"2021-03-13T02:31:56.309Z","0.1.116":"2021-03-13T02:35:16.984Z","0.1.117-renovate-non-major-58769e979473b966d9ce53e469f74365bf06d80c":"2021-03-15T12:38:17.731Z","0.1.117":"2021-03-15T12:41:37.570Z","0.1.118-renovate-non-major-d88312af46a06edc4a959b9ce993643ffa0cbeda":"2021-03-15T15:27:00.402Z","0.1.118":"2021-03-15T15:30:30.657Z","0.1.119-test-env-d39f48033aea729c8e09ca9d30c4b2aad40f066f":"2021-03-16T01:33:29.529Z","0.1.119-test-env-32cb7422156547821455c282465a53bdc07d0357":"2021-03-16T09:24:47.001Z","0.1.119-test-env-2c62a3091e20c9d697d625ceb65f0a636f845c01":"2021-03-17T01:21:10.679Z","0.1.119-renovate-balena-jellyfish-environment-3-x-e6605a36f40b6304ce1c012f7ff4837eca0191b5":"2021-03-17T09:59:59.528Z","0.1.119":"2021-03-18T00:43:49.932Z","0.1.120-renovate-non-major-ff534e449b4e17cdc339ec6e9c445b80dd29333f":"2021-03-18T04:19:53.411Z","0.1.120-renovate-non-major-21a05d009c3f7c5dd09d02c90a0df7ce1206ad5f":"2021-03-18T04:24:18.175Z","0.1.120":"2021-03-18T04:27:10.472Z","0.1.121-renovate-non-major-b24dda3ec744d90ec02f506a6b0b5144c99e4140":"2021-03-19T21:14:51.120Z","0.1.121":"2021-03-19T21:17:49.422Z","0.1.122-use-typescript-logger-1a1ba306909460f84f65d5de17ec85e2e5fcbdb5":"2021-03-20T09:53:28.576Z","0.1.122-renovate-non-major-221957a343c61b0ee50442908f3d6c06ba4c8823":"2021-03-21T21:30:49.451Z","0.1.122":"2021-03-21T21:33:42.305Z","0.1.123-renovate-non-major-013ed93a77d4418bf7826230127b734b97741175":"2021-03-21T23:51:45.396Z","0.1.123":"2021-03-21T23:55:13.189Z","0.1.124-renovate-non-major-ab83c009411894e11fee2cd529fca1f5efc9ba97":"2021-03-22T09:18:52.287Z","0.1.124":"2021-03-22T09:22:18.770Z","0.1.125-renovate-non-major-056be838b3086fc23e25edb9e1cd38797bd2aa2d":"2021-03-22T13:20:56.535Z","0.1.125":"2021-03-22T13:24:01.593Z","0.1.126-renovate-balena-jellyfish-logger-2-x-32383ac13c82551c7b47dd84d42a37eba341abc8":"2021-03-22T18:04:39.648Z","0.1.126-renovate-balena-jellyfish-environment-4-x-2728396e9d625d1676f080165d4aeecf7164baad":"2021-03-23T01:47:27.106Z","0.1.126-renovate-balena-jellyfish-logger-2-x-8530eed84ba956ccb3d7590a08ef594bd687363a":"2021-03-23T04:12:48.624Z","1.0.0-to-typescript-12fd305cac38611260db9bf4d6dc87f289bfdc8b":"2021-03-23T09:40:16.330Z","1.0.0-to-typescript-a9e076dd46ee536e4febccddde8719d20e5e3610":"2021-03-23T09:48:31.719Z","1.0.0-to-typescript-c0f64dab781a9c449e4ea61c933e1b12f882621a":"2021-03-23T22:48:26.145Z","1.0.0-to-typescript-3478c8bd491db1055aece936b9ef529a8d5af2ad":"2021-03-24T01:28:28.339Z","1.0.0-to-typescript-161c694be90db14a18441a014cb080aa4892101d":"2021-03-24T01:33:49.822Z","0.1.126-renovate-balena-jellyfish-logger-2-x-7c8262a78b42416140ad64f5debb229f568fd62f":"2021-03-24T03:47:52.789Z","0.1.126-renovate-balena-jellyfish-logger-2-x-73786c6b02df1fc032f24b8cf043aaabf992054b":"2021-03-24T03:52:17.058Z","1.0.0-to-typescript-44d4e1555f311ee91803f846fd70aa8842e6c80e":"2021-03-24T04:25:50.745Z","1.0.0-to-typescript-ab7a1c566185eb92ad51f4f72a9f38f3d090cc16":"2021-03-24T04:32:56.031Z","1.0.0-to-typescript-beb3d10f23a1e8a92c49981a96080b002adf5505":"2021-03-24T04:49:17.074Z","0.1.126-renovate-balena-jellyfish-logger-2-x-1c33eaba4d56c96279242d51c30f91d331594184":"2021-03-24T06:23:21.180Z","1.0.0":"2021-03-24T08:30:34.970Z","1.0.1-renovate-non-major-80a28647ed6dd0536e42b92651398e9a3c7fea27":"2021-03-24T08:35:36.737Z","1.0.1":"2021-03-24T08:41:15.589Z","1.0.2-renovate-non-major-8252db083eb241313ffb2d0fb6c95a8a782f462a":"2021-03-24T11:41:00.361Z","1.0.2":"2021-03-24T11:44:29.652Z","1.0.3-setup-docs-f96925a05c32d0c0bea6f1dc4f3f77a11dd5f104":"2021-03-25T01:04:12.309Z","1.0.3":"2021-03-25T01:14:55.938Z","1.0.4-renovate-non-major-d7ae5c7de68f2e016580317d02c8a094517b7ef5":"2021-03-25T01:18:35.760Z","1.0.4":"2021-03-25T01:25:16.493Z","1.0.5-renovate-non-major-4c4b6e4c7232c61869396682401f68b6be43e0af":"2021-03-25T04:08:15.267Z","1.0.5":"2021-03-25T04:11:46.579Z","1.0.6-renovate-non-major-f8db1cba6137a7b90f393bfc48972013612b7c0f":"2021-03-25T10:01:27.210Z","1.0.6":"2021-03-25T10:04:51.223Z","1.0.7-renovate-non-major-14af7842d437bbf7435e63549ded21354b67521c":"2021-03-25T12:38:08.229Z","1.0.7":"2021-03-25T12:43:04.338Z","1.0.8-renovate-non-major-80cc28b0d62560d659b439dd7241beec7018d6a6":"2021-03-25T18:57:25.234Z","1.0.8":"2021-03-25T19:00:51.243Z","1.0.9-renovate-non-major-466d83fa12475d2858fa940da4b7146ddd2ae148":"2021-03-25T21:58:19.648Z","1.0.9":"2021-03-25T22:01:58.832Z","1.0.10-update-lint-staged-299c9b50d04b272cf0b2cdd78e78da23373da219":"2021-03-26T00:30:40.877Z","1.0.10-renovate-non-major-4d0b67534b51b18bbdd8685e430c8f134f165b53":"2021-03-26T03:23:02.156Z","1.0.10":"2021-03-26T03:26:00.708Z","1.0.11-renovate-non-major-a4e66f5f524e133d761489f36102c3defba81179":"2021-03-26T05:59:20.206Z","1.0.11":"2021-03-26T06:02:57.762Z","1.0.12-renovate-non-major-bc1106ce6c2876bfca9d2a251a0305c61246cdc9":"2021-03-26T13:02:37.952Z","1.0.12":"2021-03-26T13:06:05.829Z","1.0.13-renovate-non-major-50540eaed66e0f11aa301d42f75e28f71f2d07fd":"2021-03-27T00:53:11.549Z","1.0.13":"2021-03-27T00:56:24.870Z","1.0.14-renovate-non-major-ace0850cc3d47c26f8f409508d03264081248bfc":"2021-03-29T06:06:04.114Z","1.0.14":"2021-03-29T06:09:46.585Z","1.0.15-renovate-non-major-fd2fd2e3f0cd19d4aa570bb22c9a6feae408d54f":"2021-03-29T21:05:33.400Z","1.0.15":"2021-03-29T21:09:25.348Z","1.0.16-split-tsconfig-8e9f0e3cb8a7538581287554dc85a199490b4c8e":"2021-03-30T08:59:21.496Z","1.0.16":"2021-03-30T09:06:28.253Z","1.0.17-renovate-non-major-3d2be600e801d63d1352cc1b11e37be52d751afb":"2021-03-30T09:10:42.043Z","1.0.17":"2021-03-30T09:16:31.193Z","1.0.18-renovate-non-major-856aa07c64928ea76cc643db826849ed91afc699":"2021-03-30T11:52:02.840Z","1.0.18":"2021-03-30T11:55:53.954Z","1.0.19-renovate-non-major-8c971c90f769e6abee5b13d29f6ff8d3e9d25682":"2021-03-30T13:49:54.891Z","1.0.19":"2021-03-30T13:53:27.173Z","1.0.20-renovate-non-major-e36e0f08b3e90ce3cf1b0ccb38e1036531f53afb":"2021-03-31T00:58:29.694Z","1.0.20":"2021-03-31T01:03:00.411Z","1.0.21-handle-missing-type-99d5f5812483831888905c20176940f85233ad11":"2021-03-31T07:54:41.650Z","1.0.21":"2021-03-31T08:00:54.401Z","1.0.22-renovate-non-major-6cc22d169097b45ca8a104f787fdb9f30dbeb293":"2021-03-31T09:28:05.607Z","1.0.22":"2021-03-31T09:31:16.302Z","1.0.23-renovate-non-major-1254af495ff6c4dbc8c3fb92588450090623cf8f":"2021-04-01T01:24:42.793Z","1.0.23":"2021-04-01T01:28:11.732Z","1.0.24-renovate-non-major-e18a61950a8fcca1bf9f7d3fd5ab19462568ae8b":"2021-04-01T14:13:05.175Z","1.0.24":"2021-04-01T14:16:21.920Z","1.0.25-renovate-non-major-d53dd883882bb8df7ac506abf4a5da0b1def8fbf":"2021-04-01T22:58:32.401Z","1.0.25":"2021-04-01T23:02:14.533Z","1.0.26-renovate-non-major-527ed86c493e75a253eb0cf8994a008a4deb5be4":"2021-04-02T02:11:50.429Z","1.0.26":"2021-04-02T02:15:51.905Z","1.0.27-renovate-non-major-d52a23580b6a70e1a36b6ef7a055ecba732b3f9e":"2021-04-02T17:15:48.628Z","1.0.27":"2021-04-02T17:20:00.588Z","1.0.28-renovate-non-major-4223254f57aa30f25a31533def1358180737365f":"2021-04-02T18:30:21.737Z","1.0.28":"2021-04-02T18:34:01.423Z","1.0.29-renovate-non-major-5851947ad209cedc114432e978f662db4b11c5e4":"2021-04-02T20:38:12.202Z","1.0.29":"2021-04-02T20:42:04.088Z","1.0.30-renovate-non-major-8d7aa1ae622a2c861bb513b219f4c16c298de2e9":"2021-04-02T22:32:42.216Z","1.0.30":"2021-04-02T22:36:18.887Z","1.0.31-renovate-non-major-cb70a8508cb7fd834f4e3ca7b50662017a856da8":"2021-04-03T00:17:43.798Z","1.0.31":"2021-04-03T00:21:20.585Z","1.0.32-renovate-non-major-d7b1ec01deca5efd5765d24859457c40115032cb":"2021-04-03T01:41:44.753Z","1.0.32":"2021-04-03T01:45:11.578Z","1.0.33-renovate-non-major-c87ced0138bd14c8e09ae98c9645fe0e478d4f6d":"2021-04-03T11:42:44.639Z","1.0.33":"2021-04-03T11:46:24.287Z","1.0.34-renovate-non-major-4cc1a76907281254c3bec6f1dcb88154703988f1":"2021-04-03T21:23:06.892Z","1.0.34":"2021-04-03T21:26:30.637Z","1.0.35-renovate-non-major-042738177ddfb75603e72e1bed24e9f695d5181e":"2021-04-04T01:39:58.504Z","1.0.35-renovate-non-major-5f9629ea80a29284f0655b5a105aa0dfdb5a62bc":"2021-04-04T01:45:20.072Z","1.0.35":"2021-04-04T01:48:20.553Z","1.0.36-renovate-non-major-20df2d31ea000157eab4a0f7fc9b70b6db65b2c0":"2021-04-04T03:08:29.349Z","1.0.36":"2021-04-04T03:11:49.618Z","1.0.37-renovate-non-major-9898201361c58bb6aac211ba83d07a090274c364":"2021-04-04T05:01:19.414Z","1.0.37":"2021-04-04T05:05:08.433Z","1.0.38-renovate-non-major-a069a56c5eb74ce928ff9087d180ba6770dd3a5d":"2021-04-04T08:55:15.628Z","1.0.38":"2021-04-04T08:59:00.513Z","1.0.39-renovate-non-major-0e91404fb60e4ccb28607420f2ec9f4db097dce0":"2021-04-04T09:32:32.733Z","1.0.39":"2021-04-04T09:35:42.501Z","1.0.40-renovate-non-major-a3c3c3736e5c96ac8986900c6a849a99c396eb08":"2021-04-04T23:34:20.957Z","1.0.40":"2021-04-04T23:37:23.817Z","1.0.41-renovate-non-major-cac10622ff6ca40fa7c9649c175c61cc8cc1be49":"2021-04-06T12:32:38.284Z","1.0.41":"2021-04-06T12:35:55.684Z","1.0.42-renovate-non-major-a76274b0556799712f2a8b5c47f3113325e686ae":"2021-04-06T14:39:52.739Z","1.0.42":"2021-04-06T14:44:25.347Z","1.0.43-renovate-non-major-f11041fd5f20164609a9dd4452b7cf40da9f30bb":"2021-04-06T17:24:39.092Z","1.0.43":"2021-04-06T17:28:48.869Z","1.0.44-renovate-non-major-1f82f5f8cf0a722e8bb5916fcfd9b66b556bd2fc":"2021-04-06T20:21:31.822Z","1.0.44":"2021-04-06T20:24:39.175Z","1.0.45-renovate-non-major-3a3a8d532d50a1de1bb90aa963e9130e3b510dd3":"2021-04-06T21:46:18.577Z","1.0.45":"2021-04-06T21:49:55.881Z","1.0.46-renovate-non-major-7d76d59690e229c97734bc4e40843bdb04c36acf":"2021-04-06T22:58:54.460Z","1.0.46":"2021-04-06T23:02:18.000Z","1.0.47-renovate-non-major-2482e277fa935724d452bbe20f7507a959b27500":"2021-04-07T02:28:50.386Z","1.0.47":"2021-04-07T02:32:04.541Z","1.0.48-renovate-non-major-bf9b4c16b6acd4b6ebe5ff6e3861d002f3935957":"2021-04-07T20:05:53.924Z","1.0.48":"2021-04-07T20:09:11.970Z","1.0.49-renovate-non-major-fc68bf4c507342c29303e21c6702b1f17d30169f":"2021-04-10T00:11:33.198Z","1.0.49":"2021-04-10T00:15:53.583Z","1.0.50-renovate-non-major-90bdc95b66a32f9e5602c22027abd6ef2573eb64":"2021-04-10T10:13:11.530Z","1.0.50":"2021-04-10T10:17:17.735Z","1.0.51-renovate-non-major-778b8c9eb6a5439c98a202a4224a759763aa8198":"2021-04-10T15:28:33.847Z","1.0.51-renovate-non-major-a11669f9cd6b11fbd0c08983d15dd6c503821c50":"2021-04-10T15:33:25.239Z","1.0.51":"2021-04-10T15:37:54.012Z","1.0.52-renovate-non-major-cf7301d27567d8bb268fb0d9af84c59e611e4256":"2021-04-10T17:46:07.997Z","1.0.52-renovate-non-major-ed0c79446f4f172eaa052ca79ef20a01b769bd5f":"2021-04-10T17:50:36.805Z","1.0.52":"2021-04-10T17:55:08.580Z","1.0.53-renovate-non-major-443e0d2b0d91dcf88a5cdd8a93de252793e4f890":"2021-04-10T20:26:01.031Z","1.0.53":"2021-04-10T20:29:20.274Z","1.0.54-renovate-non-major-6145d1b63660bb407351917474689f0cd7aa30b6":"2021-04-10T21:58:47.220Z","1.0.54":"2021-04-10T22:02:27.118Z","1.0.55-renovate-non-major-bf75fa2c2ff157f5b77467962dfdc9c6fffb6e7a":"2021-04-11T01:00:00.528Z","1.0.55":"2021-04-11T01:03:22.149Z","1.0.56-renovate-non-major-f9b90cbfb23ddb1982f4c048863f14cc0cb6a063":"2021-04-11T02:35:57.667Z","1.0.56":"2021-04-11T02:40:35.056Z","1.0.57-renovate-non-major-5002783466c5e11c6fa93247d5d0031065399e07":"2021-04-11T04:33:37.506Z","1.0.57":"2021-04-11T04:37:42.250Z","1.0.58-renovate-non-major-47ccd5edb13ae7049b11e0abc89ae72d4ef3ff77":"2021-04-11T09:16:53.484Z","1.0.58":"2021-04-11T09:20:18.008Z","1.0.59-renovate-non-major-d1b5b8fcc8a22ba03a6464b106f278957ebc1760":"2021-04-11T13:19:47.841Z","1.0.59":"2021-04-11T13:25:54.226Z","1.0.60-renovate-non-major-7de4a76debd4e2265193f504d815c1550f878953":"2021-04-11T15:14:45.384Z","1.0.60":"2021-04-11T15:18:12.328Z","1.0.61-renovate-non-major-3566b34f0ccbd18b1417afe4fc70138789dd35d0":"2021-04-11T16:40:52.700Z","1.0.61":"2021-04-11T16:45:37.310Z","1.0.62-renovate-non-major-402bce0a705b3cf1d292e5dfa07da8c9f8051d89":"2021-04-11T18:51:46.860Z","1.0.62":"2021-04-11T18:54:59.755Z","1.0.63-renovate-non-major-8d602656d5c6bb1253ae6f456e8651a8db91bd29":"2021-04-11T21:13:31.101Z","1.0.63":"2021-04-11T21:17:46.005Z","1.0.64-renovate-non-major-6b5fd492f99ae2253bf766112f7684e19370b10f":"2021-04-11T23:24:17.742Z","1.0.64":"2021-04-11T23:28:48.066Z","1.0.65-renovate-non-major-71a16efb4a5249a5381c219cc8d0b6ed8b4687f3":"2021-04-12T03:34:39.394Z","1.0.65":"2021-04-12T03:37:41.440Z","1.0.66-renovate-non-major-ce324bfdaafb2573adcc4966b86235521ac73933":"2021-04-12T05:19:41.221Z","1.0.66":"2021-04-12T05:24:18.726Z","1.0.67-renovate-non-major-a58c3633b829dade9996c204aa0508eea6d838a9":"2021-04-12T09:16:27.673Z","1.0.67":"2021-04-12T09:20:05.582Z","1.0.68-renovate-non-major-f9da01b2b7025722036aaf62103bac2c8af5d64f":"2021-04-12T10:58:26.676Z","1.0.68":"2021-04-12T11:01:57.918Z","1.0.69-renovate-non-major-bd81b3aad139c8dce8ecef9a231e587e889dbb79":"2021-04-12T12:21:41.376Z","1.0.69":"2021-04-12T12:25:23.115Z","1.0.70-renovate-non-major-b4fb5e0f6ff2ca4013489bb1fd94a7d7ba79786a":"2021-04-12T16:45:38.936Z","1.0.70":"2021-04-12T16:49:14.900Z","1.0.71-renovate-non-major-a3e130be3e62f864e83ec30e19a53443a5e68bfe":"2021-04-12T18:51:52.007Z","1.0.71":"2021-04-12T18:59:57.338Z","1.0.72-renovate-non-major-522a4b48e4e8a71f86b07b9dbc409beaa5acfd2e":"2021-04-12T20:08:44.787Z","1.0.72":"2021-04-12T20:14:10.201Z","1.0.73-renovate-non-major-98e023ac5baeef9d84885b997e0626e482ec04ed":"2021-04-12T22:56:06.047Z","1.0.73":"2021-04-12T23:00:20.407Z","1.0.74-renovate-non-major-ac2ad24e65e943755028a10f99b4d086d38dbb8d":"2021-04-13T07:31:44.788Z","1.0.74":"2021-04-13T07:35:43.513Z","1.0.75-renovate-non-major-075229c0a28f5a86812797de307d60e2aa860c8f":"2021-04-13T09:31:36.183Z","1.0.75":"2021-04-13T09:35:47.661Z","1.0.76-renovate-non-major-8df6aa5ef08ed71fcb92719f43e91765174ef89e":"2021-04-14T01:40:35.383Z","1.0.76":"2021-04-14T01:44:36.517Z","1.0.77-renovate-non-major-6693b4f3eea2b213062c58e52c0706f40b4cb4a0":"2021-04-14T03:27:11.018Z","1.0.77":"2021-04-14T03:30:29.935Z","1.0.78-renovate-non-major-1a6be1fcb5869d5264e3351aafef2050e8a52d67":"2021-04-14T05:07:49.378Z","1.0.78":"2021-04-14T05:12:32.975Z","1.0.79-renovate-non-major-d3ee951da5c318274c955dcb6ab39700aeb87138":"2021-04-14T08:35:49.855Z","1.0.79":"2021-04-14T08:39:24.385Z","1.0.80-renovate-non-major-40f0de4b41e5e3fcbf3cb98f77229261a1539508":"2021-04-14T11:20:22.527Z","1.0.80":"2021-04-14T11:24:02.797Z","1.0.81-renovate-non-major-ed9ab9fa9419d11cf0bc831bad294ee0287cfa5c":"2021-04-14T12:50:42.942Z","1.0.81":"2021-04-14T12:54:40.774Z","1.0.82-renovate-non-major-8424245bd3220712dc47827100a76a62567f42e8":"2021-04-14T16:17:27.783Z","1.0.82":"2021-04-14T16:22:19.843Z","1.0.83-renovate-non-major-65006aedc2f4155ae8ce494be103f43dea14a615":"2021-04-14T18:00:51.252Z","1.0.83":"2021-04-14T18:08:26.063Z","1.0.84-renovate-non-major-598a3819211509156f829ee3f480fd45614ac09d":"2021-04-14T20:00:56.093Z","1.0.84":"2021-04-14T20:05:01.658Z","1.0.85-renovate-non-major-7c9863a7a785d4de81f7e6a6fd65d4d49d1eaac1":"2021-04-14T21:30:38.573Z","1.0.85":"2021-04-14T21:34:50.691Z","1.0.86-renovate-non-major-c97df09dba88ec52e68d461cfc86c7c9e2d06b70":"2021-04-14T23:59:54.341Z","1.0.86":"2021-04-15T00:04:34.680Z","1.0.87-renovate-non-major-faae24879b832cb1ed68c9446bbad6a344efe8f5":"2021-04-15T01:46:46.923Z","1.0.87":"2021-04-15T01:50:30.692Z","1.0.88-renovate-non-major-7fad2581fef499ac203e32c5f2b67336bdab044b":"2021-04-15T03:28:56.187Z","1.0.88":"2021-04-15T03:32:14.712Z","1.0.89-renovate-non-major-55f7866eb2170d982ccb06c90251745f366adee6":"2021-04-15T05:37:25.876Z","1.0.89":"2021-04-15T05:41:48.125Z","1.0.90-renovate-non-major-2f0e426a59a276c93a36e6c92dc4647bb5034ab5":"2021-04-15T11:05:42.866Z","1.0.90":"2021-04-15T11:09:18.539Z","1.0.91-renovate-non-major-554e5735971c315b919511c8e8401860cf023b6d":"2021-04-15T13:38:43.750Z","1.0.91":"2021-04-15T13:43:22.195Z","1.0.92-renovate-non-major-4116298e483f40e10d79999f795eff4d87bed5fd":"2021-04-15T17:30:27.356Z","1.0.92":"2021-04-15T17:33:45.245Z","1.0.93-renovate-non-major-1d3bbb69a93ab0164bb7da03c2945430b18c7f12":"2021-04-15T17:41:15.420Z","1.0.93":"2021-04-15T17:44:52.817Z","1.0.94-renovate-non-major-6a2299cdc84dfdfc4feec64df771d146531f4e59":"2021-04-15T19:54:14.687Z","1.0.94":"2021-04-15T19:57:54.621Z","1.0.95-renovate-non-major-5c7f26158e8d5b98e6b209ad2c493ca6c8a247a3":"2021-04-15T21:38:58.843Z","1.0.95":"2021-04-15T21:43:25.168Z","1.0.96-renovate-non-major-4c93cb96afc7f1347b18b1716d9f7cc26fd1fcd6":"2021-04-15T23:50:29.689Z","1.0.96":"2021-04-15T23:54:00.095Z","1.0.97-renovate-non-major-8cf75fa0d99da6c6c3f8a8a6cef74684cf2ce437":"2021-04-16T01:38:21.333Z","1.0.97":"2021-04-16T01:41:58.193Z","1.0.98-renovate-non-major-42727f16885184394b8e953551e014fca26e7aa6":"2021-04-16T03:52:59.719Z","1.0.98":"2021-04-16T03:56:32.957Z","1.0.99-renovate-non-major-cf41be177e98510fce57ac68a13e3c9ea56704f0":"2021-04-16T05:47:23.936Z","1.0.99":"2021-04-16T05:51:04.871Z","1.0.100-renovate-non-major-808293981f406729a11ffa9b32f6e37bf44e6977":"2021-04-16T10:21:11.357Z","1.0.100":"2021-04-16T10:25:13.220Z","1.0.101-renovate-non-major-6d8eb7cd9a84836e3ef498cb6860eba86abef619":"2021-04-16T12:41:25.836Z","1.0.101":"2021-04-16T12:46:11.856Z","1.0.102-renovate-non-major-aaa6f3f597509d6ef8dde5030b3756bf30abef8f":"2021-04-16T15:33:30.936Z","1.0.102":"2021-04-16T15:38:03.446Z","1.0.103-renovate-non-major-94706b3eef8da304b222a3cb15670d6ec4c279df":"2021-04-16T18:26:42.565Z","1.0.103":"2021-04-16T18:30:48.671Z","1.0.104-renovate-non-major-36aba06dbe3a899f6889fbdb72864ae748d36e83":"2021-04-16T21:14:14.027Z","1.0.104":"2021-04-16T21:17:31.298Z","1.0.105-renovate-non-major-849fd3f3487f52d0ab03d3768eb67181b13f252a":"2021-04-17T03:03:38.845Z","1.0.105":"2021-04-17T03:07:06.099Z","1.0.106-renovate-non-major-90fa8cf5beb6d051e59dac79540430a33767354a":"2021-04-17T05:27:59.770Z","1.0.106":"2021-04-17T05:32:14.491Z","1.0.107-renovate-non-major-addf04c1ed5536d0c795555c1584c85763990e5a":"2021-04-17T08:48:02.702Z","1.0.107":"2021-04-17T08:51:21.790Z","1.0.108-renovate-non-major-9255adaae024b35ef1e6a3021c9b1430700a0052":"2021-04-17T10:08:34.866Z","1.0.108":"2021-04-17T10:12:01.101Z","1.0.109-renovate-non-major-3ce6d49bc554180c35af624d71d4b9d3d0540d22":"2021-04-17T12:23:38.607Z","1.0.109":"2021-04-17T12:27:13.298Z","1.0.110-renovate-non-major-11e81ae070191b05cf3f05fc869e9208fc0273eb":"2021-04-17T15:25:20.585Z","1.0.110":"2021-04-17T15:28:16.216Z","1.0.111-renovate-non-major-c0f38d22ab3368c9cf32003c6aca4fbff46673bf":"2021-04-17T17:49:27.487Z","1.0.111":"2021-04-17T17:52:36.088Z","1.0.112-renovate-non-major-58746957fe097023604681ddcbfaad88102a6d65":"2021-04-17T19:56:59.990Z","1.0.112":"2021-04-17T20:00:28.140Z","1.0.113-renovate-non-major-568dfd18d58a30626ea6ace10db8e236c4b826bc":"2021-04-17T21:09:10.810Z","1.0.113":"2021-04-17T21:13:07.612Z","1.0.114-renovate-non-major-062b180eb5ca8c113d7753c8845241f255dc42fd":"2021-04-18T00:04:26.337Z","1.0.114":"2021-04-18T00:07:57.167Z","1.0.115-renovate-non-major-073275d91da8a06091193904d068565526816fc4":"2021-04-18T01:36:44.861Z","1.0.115":"2021-04-18T01:40:20.407Z","1.0.116-renovate-non-major-23728171bf216614c95664c43d6cb6fe3aeb8929":"2021-04-18T13:21:38.337Z","1.0.116":"2021-04-18T13:25:58.391Z","1.0.117-renovate-non-major-a339253ca78f14e2265c3a1627bc7869307cae98":"2021-04-18T16:05:04.375Z","1.0.117":"2021-04-18T16:08:20.924Z","1.0.118-renovate-non-major-21bf25991453211adc32273d4832e8f74ac65060":"2021-04-18T18:36:10.120Z","1.0.118":"2021-04-18T18:40:23.453Z","1.0.119-renovate-non-major-a579e84d0ad61d6eadfaf0228f22e9e85f141172":"2021-04-19T01:46:08.226Z","1.0.119":"2021-04-19T01:51:13.069Z","1.0.120-renovate-non-major-5de05040cb5df7567bb77c090402e619a92662c2":"2021-04-19T13:09:21.547Z","1.0.120":"2021-04-19T23:09:22.122Z","1.0.121-renovate-non-major-4bf9936b7cba300748226999f72e2a3d6e1f9e23":"2021-04-20T00:56:15.961Z","1.0.121":"2021-04-20T00:59:44.839Z","1.0.122-renovate-non-major-6e1b2e02533b6ad64f6f00d83654bea728e5e511":"2021-04-20T04:36:02.800Z","1.0.122":"2021-04-20T04:40:24.680Z","1.0.123-renovate-non-major-49a07f4f713590eaf50beb28e3fcc11d588e5d57":"2021-04-20T12:08:46.290Z","1.0.123":"2021-04-20T12:21:51.093Z","1.0.124-renovate-non-major-63914304fb3dc19d4b25f60df5faa3e5b5f28422":"2021-04-20T19:04:49.425Z","1.0.124":"2021-04-20T19:08:55.371Z","1.0.125-renovate-non-major-d67ec0e9082154cf5b534098229681fe0d365fc1":"2021-04-21T10:41:02.807Z","1.0.125":"2021-04-21T10:44:41.249Z","1.0.126-renovate-non-major-87ea47fedbb4196123e9aaf7013fb5b93de66119":"2021-04-21T14:45:17.726Z","1.0.126":"2021-04-21T14:49:15.160Z","1.0.127-renovate-non-major-9a26e3d865674e73bb44313a31da5f767f69db34":"2021-04-21T18:43:16.945Z","1.0.127":"2021-04-21T18:52:46.255Z","1.0.128-renovate-non-major-0a65cfe6612761ff63b8bc9c4c3c7cc76ab28354":"2021-04-21T22:54:16.498Z","1.0.128":"2021-04-21T22:57:25.147Z","1.0.129-renovate-non-major-11719b9e868edae4943f067c70787e09f9abf517":"2021-04-23T01:46:58.626Z","1.0.129":"2021-04-23T01:51:06.964Z","1.0.130-renovate-non-major-536cb21bf1dbc75b65156bc6c86648a1d5fe1813":"2021-04-23T03:40:06.679Z","1.0.130":"2021-04-23T03:44:19.380Z","1.0.131-renovate-non-major-15dc97e5b334b329b40da2e50d8ff800c7f65d70":"2021-04-23T05:44:52.845Z","1.0.131":"2021-04-23T05:49:59.905Z","1.0.132-renovate-non-major-385b8657a924c5ade1d830e2600b45420f3f186b":"2021-04-23T11:04:22.525Z","1.0.132":"2021-04-23T11:08:44.291Z","1.0.133-renovate-non-major-2c1b6bcade1b942d76ef0bfa998719301bbc9b9c":"2021-04-23T15:40:02.170Z","1.0.133":"2021-04-23T15:44:21.231Z","1.0.134-renovate-non-major-02f8e32e6df51ec4cb19c3908f4dbb2e0a15e708":"2021-04-23T18:08:51.532Z","1.0.134":"2021-04-23T18:12:26.364Z","1.0.135-renovate-non-major-d7a9b13ad65b8b9396aa8e13479d2e5398ceab22":"2021-04-24T01:04:34.632Z","1.0.135":"2021-04-24T01:08:50.111Z","1.0.136-renovate-non-major-b65a4bb4c9fa8591bd3c70320541d2af89c34a3c":"2021-04-24T04:35:51.830Z","1.0.136":"2021-04-24T04:44:41.930Z","1.0.137-renovate-non-major-4ec7e4c5d446f6cb479767629ff05aba945e8cea":"2021-04-24T11:34:42.828Z","1.0.137":"2021-04-24T11:38:17.420Z","1.0.138-renovate-non-major-c2c7020b3d66239a67b4e5111bd56b56bccd248d":"2021-04-24T15:47:54.534Z","1.0.138":"2021-04-24T15:51:23.860Z","1.0.139-renovate-non-major-c7f2ade8a679a40f1f7715029f251933b03bdd9d":"2021-04-24T20:20:07.635Z","1.0.139":"2021-04-24T20:23:58.329Z","1.0.140-renovate-non-major-6ca1ab5b882f401402b43c8cd04ab19ba661bf6b":"2021-04-25T01:30:40.187Z","1.0.140":"2021-04-25T01:34:08.926Z","1.0.141-renovate-non-major-a0ff28c559870232ac61c4c992b226d7b26d5d44":"2021-04-25T23:57:05.553Z","1.0.141":"2021-04-26T00:02:53.910Z","1.0.142-renovate-non-major-ab6684f8a8a107e8114751f3688693d59ed03c79":"2021-04-26T00:31:11.066Z","1.0.142":"2021-04-26T00:34:39.271Z","1.0.143-renovate-non-major-a88cce3bdce52fcce2f071ac7c935d64937e49de":"2021-04-26T02:59:05.960Z","1.0.143":"2021-04-26T03:02:28.132Z","1.0.144-renovate-non-major-473bae62e1579a476b8b06d7107cf367ddbe4750":"2021-04-26T11:21:20.524Z","1.0.144":"2021-04-26T11:26:55.602Z","1.0.145-renovate-non-major-b57c58fa3bc141feccf0ed6e0526f8bb8bd9fa22":"2021-04-26T18:12:21.425Z","1.0.145":"2021-04-26T18:16:15.154Z","1.0.146-renovate-non-major-95f4b621227135dff17acd1ec36fdf7b35f0013f":"2021-04-26T20:23:35.962Z","1.0.146":"2021-04-27T00:04:52.644Z","1.0.147-renovate-non-major-45226273a5ca83dc917b8bb65660ab36d787090e":"2021-04-27T01:04:59.206Z","1.0.147":"2021-04-27T01:08:55.460Z","1.0.148-renovate-non-major-6c67a9d903cb1699416138eae46daa7cac02d179":"2021-04-27T01:43:32.227Z","1.0.148":"2021-04-27T01:47:25.823Z","1.0.149-renovate-non-major-320a018e9fa8844dc0661fc45fe2a0ef922a793d":"2021-04-27T03:08:43.351Z","1.0.149":"2021-04-27T03:12:42.572Z","1.0.150-renovate-non-major-e9c50e91e974a7251db8e1d4d0446e5974bcb490":"2021-04-27T15:24:19.973Z","1.0.150":"2021-04-27T15:27:51.512Z","1.0.151-renovate-non-major-434568ef45b4b68ce5442088b475f183eb1418c9":"2021-04-28T11:52:29.364Z","1.0.151":"2021-04-28T11:55:58.771Z","1.0.152-renovate-non-major-3ef428a1f01795705cbe1b6dc9b3cf02a5a2988e":"2021-04-29T08:37:04.965Z","1.0.152":"2021-04-29T08:42:59.018Z","1.0.153-renovate-non-major-0eb5b42e2f17ad1d282486a36ff5f3d41a774612":"2021-04-29T09:48:17.619Z","1.0.153":"2021-04-29T09:52:01.716Z","1.0.154-renovate-non-major-49e9f8186f14f10da2ef478ff763793cb9940801":"2021-04-29T11:06:24.493Z","1.0.154":"2021-04-29T11:09:50.728Z","1.0.155-renovate-non-major-c694ba40b7d29cd6cf51b4263bec074f6733200a":"2021-04-29T14:39:33.218Z","1.0.155":"2021-04-29T14:43:17.099Z","1.0.156-renovate-non-major-90751efe7bde4c5a625023e4af3ae5421cfad66e":"2021-04-29T17:23:14.172Z","1.0.156":"2021-04-29T17:27:23.121Z","1.0.157-renovate-non-major-734f29e33b20b2de19ede60a0cce42d9b923f9eb":"2021-04-29T19:26:24.968Z","1.0.157":"2021-04-29T19:30:22.197Z","1.0.158-renovate-non-major-72ad29b72a2f7ffa905e064f86129fcd3fc1cc5f":"2021-04-29T21:02:32.403Z","1.0.158":"2021-04-29T21:06:12.494Z","1.0.159-renovate-non-major-5dcfb9b9bcfb87dbc795528abde97530f014f896":"2021-04-30T02:30:23.690Z","1.0.159":"2021-04-30T02:34:38.540Z","1.0.160-renovate-non-major-e4150c82e5af902d69a94d4608c91242fc50da4a":"2021-04-30T04:24:42.982Z","1.0.160":"2021-04-30T04:28:23.873Z","1.0.161-renovate-non-major-1805a070881d8fa2c4690dbd852996ff266d1f0c":"2021-04-30T08:09:54.855Z","1.0.161":"2021-04-30T08:13:41.149Z","1.0.162-renovate-non-major-a868264fd397d3acc7c4e30bd86c9b58c686e820":"2021-04-30T16:54:56.063Z","1.0.162":"2021-04-30T16:58:31.643Z","1.0.163-renovate-non-major-57c492761467ed838ab47819eb9c8a42a1172784":"2021-05-01T01:09:56.289Z","1.0.163":"2021-05-01T01:13:39.039Z","1.0.164-renovate-non-major-81cb5c05090a6786736def20ced567e6a8da1af7":"2021-05-01T03:46:30.746Z","1.0.164":"2021-05-01T03:49:55.846Z","1.0.165-renovate-non-major-bab6516eae415c08919ea69da7f97e344cf8ccf1":"2021-05-01T08:50:20.497Z","1.0.165":"2021-05-01T08:54:13.498Z","1.0.166-renovate-non-major-96f0290bd113406e543b043af2349bbbe604062b":"2021-05-01T12:27:29.129Z","1.0.166-renovate-non-major-2fbf50fc4274930d20eabdf40d663b0a469add45":"2021-05-01T12:32:26.702Z","1.0.166":"2021-05-01T12:36:07.259Z","1.0.167-renovate-non-major-cea97214ce464e4eb47f5cda1ff621449684687d":"2021-05-01T15:46:54.313Z","1.0.167":"2021-05-01T15:50:22.529Z","1.0.168-renovate-non-major-98bdb017c234e9010a66daefcef758666d35063b":"2021-05-01T16:28:49.126Z","1.0.168":"2021-05-01T16:32:37.633Z","1.0.169-renovate-non-major-8e9e88411dfb03ab74c8471b8471e4ee50febd7d":"2021-05-02T01:16:20.253Z","1.0.169":"2021-05-02T01:19:50.395Z","1.0.170-renovate-non-major-2d59c17bbe81d269a8e0573d707775aea1fc1a75":"2021-05-02T04:17:23.095Z","1.0.170":"2021-05-02T04:21:15.208Z","1.0.171-renovate-non-major-958fd0bf94a83bbc88df2ba4f29f93054a072786":"2021-05-03T00:38:33.023Z","1.0.171":"2021-05-03T00:42:01.274Z","1.0.172-renovate-non-major-eb10429fa189670fa1a3df4437f0b7b05705e204":"2021-05-03T02:47:38.559Z","1.0.172":"2021-05-03T02:50:57.745Z","1.0.173-renovate-non-major-fdc8e067e0a297b23ddd8e26a155adc37ed404cd":"2021-05-03T04:48:16.746Z","1.0.173":"2021-05-03T04:51:52.791Z","1.0.174-renovate-non-major-a6fc5fc8e04c32f16ff1dcb86de2eae9b014070f":"2021-05-03T09:52:09.984Z","1.0.174":"2021-05-03T09:57:39.785Z","1.0.175-renovate-non-major-b1b31ef1d4a760dbab54ea4805cfc85f922b7603":"2021-05-03T10:31:37.791Z","1.0.175-renovate-non-major-045f8f8c2fc927505f5d3111af38f924fe490b6a":"2021-05-03T11:57:14.224Z","1.0.175":"2021-05-03T12:00:35.174Z","1.0.176-renovate-non-major-cceba3d066793decfa177761525cfa3db0944368":"2021-05-03T13:27:21.077Z","1.0.176":"2021-05-03T13:31:32.478Z","1.0.177-renovate-non-major-996df6bc11de8c56554810b6fe066ca577135f4f":"2021-05-03T16:22:29.941Z","1.0.177":"2021-05-03T16:26:11.658Z","1.0.178-renovate-non-major-73f665a8031b7ddc0f81e6031ddf9ae527454589":"2021-05-03T17:50:37.424Z","1.0.178":"2021-05-03T17:54:39.286Z","1.0.179-renovate-non-major-464652627c4115aabd56a4eabd124c17333364b3":"2021-05-03T21:00:06.061Z","1.0.179":"2021-05-03T21:06:28.352Z","1.0.180-renovate-non-major-cb1e7fd7e530d51cc4c00ad9b23a95e2fa732e0d":"2021-05-03T22:33:01.389Z","1.0.180":"2021-05-03T22:36:48.802Z","1.0.181-renovate-non-major-8104835bf3e615e3b967a56ba3351b9b0ac036de":"2021-05-04T00:34:20.452Z","1.0.181":"2021-05-04T00:38:12.837Z","1.0.182-renovate-non-major-d3404a647e784214395732a08af67ab6a13f71f0":"2021-05-04T01:44:00.981Z","1.0.182":"2021-05-04T01:49:00.190Z","1.0.183-renovate-non-major-3363bb85b6c81d604bdf2bbd24f8918f4e72a8d4":"2021-05-04T04:59:16.995Z","1.0.183":"2021-05-04T05:02:43.189Z","1.0.184-renovate-non-major-b3817519cb18483bd2940aa46ad7b8c07bd3522f":"2021-05-04T07:30:56.117Z","1.0.184":"2021-05-04T07:34:41.770Z","1.0.185-renovate-non-major-1290858bf9a16bc98337ca1448e97fa0637e0eb7":"2021-05-04T09:08:26.654Z","1.0.185":"2021-05-04T09:12:20.643Z","1.0.185-renovate-non-major-c92fb16874f05bc3d216668ea9cb6f7b88e855c1":"2021-05-04T09:16:04.675Z","1.0.186-renovate-non-major-1ea50111dc9750bcd4a6859ac3f4c9f5eff7a087":"2021-05-04T16:28:35.130Z","1.0.186":"2021-05-04T16:32:11.880Z","1.0.187-renovate-non-major-f727d68d012b08b32d5abe93e0fabd6a6d7c3ff4":"2021-05-04T19:02:58.148Z","1.0.187":"2021-05-04T19:06:32.930Z","1.0.188-renovate-non-major-7a0207d0766cf3a78519c1d94c54ccdb752f1e30":"2021-05-04T20:45:12.909Z","1.0.188":"2021-05-04T20:48:51.194Z","1.0.189-renovate-non-major-1adadcc225e03a26cf4f9db67dcb984200baa8a3":"2021-05-04T23:03:25.161Z","1.0.189":"2021-05-04T23:07:47.228Z","1.0.190-renovate-non-major-4d1335cb4f1a4ec7258d93e333c3a4c024468997":"2021-05-05T00:08:29.328Z","1.0.190":"2021-05-05T00:11:36.085Z","1.0.191-renovate-non-major-bfbc348439bcd5004211e7188239ea74e49b5bab":"2021-05-05T09:37:09.270Z","1.0.191":"2021-05-05T09:41:13.419Z","1.0.192-renovate-non-major-342d4c16591e7d86deba7677cbd540ccc1ed4d6b":"2021-05-05T15:20:30.306Z","1.0.192":"2021-05-05T15:23:58.049Z","1.0.193-renovate-non-major-f32c44bf5a610f057e3600d66d3f85b565cd3c0d":"2021-05-05T16:36:54.903Z","1.0.193":"2021-05-05T16:42:07.401Z","1.0.194-renovate-catch-uncommitted-2-x-b0bd32af0a33aa1e32758dbfb5f68142e6a4acef":"2021-05-05T20:34:38.141Z","1.0.194":"2021-05-05T23:03:52.938Z","1.0.195-renovate-non-major-5727f66030e3fd96875e3658ece01bf3bc351361":"2021-05-05T23:19:10.470Z","1.0.195":"2021-05-05T23:28:17.299Z","1.0.196-renovate-non-major-e9d5a7b56ae45905c744538ed69e3269c34fc2e1":"2021-05-05T23:37:49.057Z","1.0.196":"2021-05-05T23:41:44.899Z","1.0.197-renovate-non-major-4f16fe4977a095c31f322e5e86af149df29f6e04":"2021-05-07T13:38:01.394Z","1.0.197":"2021-05-07T13:41:30.279Z","1.0.198-renovate-lint-staged-11-x-540a446797c9e20060cd700f4daf2a3cfdb78056":"2021-05-07T18:13:34.477Z","1.0.198":"2021-05-08T00:04:04.634Z","1.0.199-renovate-non-major-7159b98c1513697f4b2ad7d8bf023fb7e4301fec":"2021-05-08T00:50:04.217Z","1.0.199-renovate-non-major-cca59fb8f8bf1b1a76618dc9c280bb54610e3003":"2021-05-08T01:00:05.500Z","1.0.199":"2021-05-08T01:07:43.280Z","1.0.200-renovate-non-major-0ebd8f562fd576169771a8aa1761f913afd2b31f":"2021-05-08T04:07:37.975Z","1.0.200":"2021-05-08T04:11:05.836Z","1.0.201-dependabot-npm-and-yarn-hosted-git-info-2-8-9-9b77c46e112996f1250f5f3d185de3f954f18ae7":"2021-05-08T06:55:50.819Z","1.0.201":"2021-05-08T06:59:02.695Z","1.0.202-renovate-non-major-062f89f63e0f1bcca763a96582898d15181d3b57":"2021-05-08T08:29:33.228Z","1.0.202":"2021-05-08T08:33:19.574Z","1.0.203-renovate-non-major-5e6f5234caca86e376a22432961e2a57e752c65d":"2021-05-10T07:42:00.406Z","1.0.203":"2021-05-10T07:45:47.127Z","1.0.204-renovate-non-major-5f5c3e8ae8d63f9d47ecea34f8e1024929291911":"2021-05-10T11:26:51.593Z","1.0.204":"2021-05-10T11:30:33.610Z","1.0.205-renovate-non-major-1f64b4c1c252ddde89b4e02d3c0cab4e23b107aa":"2021-05-11T08:34:39.120Z","1.0.205-renovate-non-major-3a4a9baf84d59b36fbb5ff178b10d77c03091eb4":"2021-05-11T09:50:49.588Z","1.0.205":"2021-05-12T00:27:14.609Z","1.0.206-renovate-non-major-eea7268770c35daa7d7b9eda7f9509ca0b710483":"2021-05-12T08:04:32.041Z","1.0.206":"2021-05-12T08:10:03.722Z","1.0.207-renovate-non-major-cd28676d3f6fc7eabcf15724525cddaca418f4ea":"2021-05-12T09:46:45.649Z","1.0.207":"2021-05-12T09:50:38.661Z","1.0.208-renovate-non-major-4245fbbf98a8bd37dafe905e5f022f9bf4ccee89":"2021-05-12T20:38:26.174Z","1.0.208":"2021-05-12T20:41:54.566Z","1.0.209-renovate-non-major-3431c3dfa5bdbdd2022dc6c88047c52aabe9154f":"2021-05-13T13:22:37.158Z","1.0.209":"2021-05-13T13:25:59.840Z","1.0.210-renovate-non-major-29ee865894fd0fb4e71360262196177f1d1af91e":"2021-05-17T23:28:44.445Z","1.0.210":"2021-05-17T23:31:57.035Z","1.0.211-renovate-non-major-0130cb7ac3d5d884c31d183f355c34aeb534bdda":"2021-05-18T17:25:29.023Z","1.0.211":"2021-05-18T17:29:12.217Z","1.0.212-renovate-internal-non-major-90f4f13ccea801f17ab8b6c82f15f2db15d8fdc8":"2021-05-21T05:07:36.916Z","1.0.212":"2021-05-21T05:11:06.253Z","1.0.213-renovate-internal-non-major-8fd9b7285fe805a3c681bd17a709938f2c269832":"2021-05-21T08:26:52.471Z","1.0.213":"2021-05-21T08:30:04.472Z","1.0.214-renovate-internal-non-major-7a69905cec911cde7c5dc0bc77ef1b7450496b57":"2021-05-21T10:53:33.122Z","1.0.214":"2021-05-21T10:57:28.678Z","1.0.215-renovate-internal-non-major-ede22ddb980cb46b7d1bdbd7bd377c198fcd4ef1":"2021-05-21T11:57:06.018Z","1.0.215":"2021-05-21T12:00:51.065Z","1.0.216-renovate-balena-lint-6-x-a4f241b4b90f14af28c49c678cea8456199cab47":"2021-05-21T18:50:51.807Z","1.0.216-use-jellyfish-config-b68cb01976066bd7dc8568418fc97976fd58811b":"2021-05-23T01:52:56.666Z","1.0.216":"2021-05-23T01:56:49.456Z","1.0.217-renovate-internal-non-major-4989e1decf7dada6a3b75120962bd3132d43a1ee":"2021-05-23T02:00:42.848Z","1.0.217":"2021-05-23T02:07:26.272Z","1.0.218-renovate-internal-non-major-459758f2c3f5043228d4ba706eefc08681cc2eef":"2021-05-23T07:51:19.676Z","1.0.218":"2021-05-23T07:55:13.408Z","1.0.219-renovate-internal-non-major-7c92fa6fb793707b225f45ae3c587f68208b7421":"2021-05-23T08:56:43.074Z","1.0.219":"2021-05-23T09:00:10.668Z","1.0.220-renovate-internal-non-major-c8fa36be3cf8297b9cd076475344140024d2c10a":"2021-05-24T01:40:32.449Z","1.0.220":"2021-05-24T01:44:40.776Z","1.0.221-renovate-internal-patch-6b9992a554aea4b71e233d28fc5a5fce8e5a4208":"2021-05-24T05:05:16.348Z","1.0.221":"2021-05-24T05:09:12.125Z","1.0.222-renovate-balena-lint-6-x-5758c2a37191f09db0baec49caccdbdb9a889b60":"2021-05-24T05:12:52.071Z","1.0.222-renovate-balena-lint-6-x-46f73d2091c97704b88362f0e71f0bd852d11a98":"2021-05-24T06:30:41.866Z","1.0.222":"2021-05-24T06:37:14.296Z","1.0.222-renovate-internal-patch-7d41b4d2c2c5c63e70b217e00312c0bb4318af01":"2021-05-24T06:37:29.156Z","1.0.223-renovate-internal-patch-10bb4840929fe503e4574e2a5c5647cbb67b79e1":"2021-05-24T06:43:42.940Z","1.0.223":"2021-05-24T06:51:10.042Z","1.0.224-renovate-balena-lint-6-x-6a57e48110127befc1a6c470728ba914b5c37c66":"2021-05-24T09:33:43.423Z","1.0.224-renovate-balena-lint-6-x-d54898428e9659ed271892cf160a6cccaa456f22":"2021-05-24T12:12:43.065Z","1.0.224":"2021-05-25T00:01:12.383Z","1.0.225-renovate-internal-patch-2cc340aac151dbf3a9a4163a656858486b6e2906":"2021-05-25T00:14:26.217Z","1.0.225-renovate-internal-patch-610d62b20ba332538007e69f06e96c547ef5ebce":"2021-05-25T00:25:22.905Z","1.0.225":"2021-05-25T00:40:05.217Z","1.0.225-renovate-internal-patch-0fa1975f8e824040b5ecc2f9af3346e22fbb817e":"2021-05-25T00:47:10.989Z","1.0.226-renovate-internal-patch-73457f181ba4dc067eecf04bf02f728091c9b684":"2021-05-25T00:58:29.597Z","1.0.226-renovate-internal-patch-56cd13a005397eba0dd79a93f2a25a9c12d9159f":"2021-05-25T01:10:39.384Z","1.0.226":"2021-05-25T01:14:14.007Z","1.0.227-dependabot-npm-and-yarn-browserslist-4-16-6-37944959732f231633712fb22736798133cb2842":"2021-05-25T01:18:31.678Z","1.0.227":"2021-05-25T01:23:31.877Z","1.0.228-renovate-internal-patch-77e9f924dad0851890a74032ff0972c7136fab91":"2021-05-25T04:34:43.545Z","1.0.228":"2021-05-25T05:41:40.756Z","1.0.229-renovate-internal-patch-054b8ef869b0634a90576ddd1dd3128982f07c98":"2021-05-26T02:26:56.789Z","1.0.229":"2021-05-26T02:30:31.207Z","1.0.230-renovate-balena-jellyfish-config-1-x-2969135983f80161ef48d186f8511df388d7724b":"2021-05-26T10:27:16.247Z","1.0.230-repo-sync-jellyfish-config-default-e7ff8633333f3f2c74cef5d8bc7f1090d511437a":"2021-05-27T01:18:13.662Z","1.0.230-renovate-balena-jellyfish-config-1-x-f7fd48616685001f4c613cd41a863edccdec4ebb":"2021-05-27T02:49:17.546Z","1.0.230":"2021-05-27T02:56:45.396Z","1.0.230-renovate-internal-patch-4e554a1eae8d5ddcb43b827914949ec5db1346c8":"2021-05-27T02:57:34.385Z","1.0.231-renovate-internal-patch-3886db832e0f3f463db4e72b9ed1c8bca7f5dc3f":"2021-05-27T03:00:57.875Z","1.0.231":"2021-05-27T03:07:47.427Z","1.0.232-repo-sync-jellyfish-config-default-e94620facf490e1ff3b24d42a2fce106a4946383":"2021-05-27T03:22:29.335Z","1.0.232-repo-sync-jellyfish-config-default-b6f515c3e56e0fc545154c76ea933d3188127a81":"2021-05-27T04:15:06.463Z","1.0.232-repo-sync-jellyfish-config-default-a1766eb6f6472ac9a5d0f11249a8bd0495a154b0":"2021-05-27T06:48:12.061Z","1.0.232-renovate-internal-patch-880e17fa2dc4ab603fd58a68ec91d2ce7314527a":"2021-05-27T08:24:27.622Z","1.0.232":"2021-05-27T08:29:01.470Z","1.0.233-renovate-internal-patch-dc5ab6edbccf946b6e6ebb1c16e429db0dce1803":"2021-05-27T08:37:01.523Z","1.0.233":"2021-05-27T08:45:07.967Z","1.0.233-repo-sync-jellyfish-config-default-8645e22bb9b0dac4ec3f9381a9fbd835c13e6de0":"2021-05-27T08:55:42.151Z","1.0.234-renovate-internal-patch-fa4719fe688dfdbe1a92fcfc9bbfb5f84a4bb17c":"2021-05-27T10:30:04.175Z","1.0.234-renovate-internal-patch-9470174a3690f3f597f9ac82ee3a67c1cd0800cc":"2021-05-27T10:36:29.449Z","1.0.234":"2021-05-27T10:40:00.346Z","1.0.235-renovate-internal-patch-4f6b9dcee80987040f5584b0a8c1294698277cfe":"2021-05-27T10:47:17.399Z","1.0.235":"2021-05-27T10:51:50.181Z","1.0.236-repo-sync-jellyfish-config-default-f045bcb00eb221a6bacdad7ee6301b6d99145681":"2021-05-27T11:17:04.216Z","1.0.236":"2021-05-27T11:21:07.632Z","1.0.237-renovate-internal-patch-b89fa450c68a43f29a9365474370e55b215d3b12":"2021-05-27T13:06:15.112Z","1.0.237":"2021-05-27T13:10:55.549Z","1.0.238-renovate-external-non-major-1bfb11e5d22313162dd6adde9f7a4d7b213f2547":"2021-05-29T00:46:25.823Z","1.0.238-renovate-major-external-major-91b3258da2b5d2784570f7f09e46025008658cae":"2021-05-29T00:47:35.919Z","1.0.238":"2021-05-29T00:50:14.877Z","1.0.239-renovate-major-external-major-e246bf51b5709eff866b4c180923f32be0fbcdfa":"2021-05-29T00:59:24.380Z","1.0.239-renovate-internal-patch-36f213015e06911ce57b05802423f3643639c1ec":"2021-05-29T07:46:44.030Z","1.0.239":"2021-05-29T07:50:30.921Z","1.0.240-renovate-major-external-major-1ece4fa4f40627d71a27a80ce8bae951503a0340":"2021-05-29T07:55:11.569Z","1.0.240-dependabot-npm-and-yarn-ws-7-4-6-2f41d09a0aedd3ba9fce4740b3763cc5e02bde09":"2021-05-29T08:35:50.665Z","1.0.240":"2021-05-29T08:39:54.147Z","1.0.241-renovate-internal-patch-01b8aea835fd1a4084293a5cd236554047f7e600":"2021-05-29T08:45:43.453Z","1.0.241":"2021-05-29T08:49:25.569Z","1.0.242-renovate-internal-patch-61f677c977b23a30df290a5e214a32d8a4147fbd":"2021-05-29T10:06:08.586Z","1.0.242":"2021-05-29T10:09:47.244Z","1.0.243-renovate-external-non-major-7173e98cc086f555989b44d472aea9225675a0e7":"2021-05-29T13:06:30.268Z","1.0.243":"2021-05-29T13:09:45.985Z","1.0.244-renovate-internal-patch-3b9d984770792a9c26db076edc317582321f001f":"2021-05-29T14:29:03.350Z","1.0.244":"2021-05-29T14:32:44.818Z","1.0.245-renovate-external-non-major-e5cb06377d4c94d344f333a905ff00cabc93948d":"2021-05-29T19:42:08.051Z","1.0.245-renovate-internal-patch-7aea5b5d4a8b585464ec30dd4f7bb02d03d5250f":"2021-05-29T19:44:27.262Z","1.0.245":"2021-05-29T19:45:42.885Z","1.0.246-renovate-internal-patch-4da32d8ddd2b85b7329ea7090ef361d2da408874":"2021-05-29T19:49:47.067Z","1.0.246-renovate-internal-patch-3a8449096f51848f50f6fb2861c266e83143f749":"2021-05-29T20:51:34.621Z","1.0.246":"2021-05-29T20:55:14.001Z","1.0.247-renovate-internal-patch-13a68114abc93300b80892858b60567312840ca7":"2021-05-31T03:52:45.793Z","1.0.247":"2021-05-31T03:56:22.485Z","1.0.248-renovate-internal-patch-b7499b79acbe638277dba0621df15d6a6d194fbe":"2021-05-31T09:19:08.044Z","1.0.248":"2021-05-31T09:22:31.279Z","1.0.249-renovate-internal-patch-860957b128275ec09bb03f929393d8470b276f04":"2021-05-31T10:50:46.471Z","1.0.249-renovate-balena-jellyfish-logger-3-x-508b9d4748ed56acaa88e4a125b83339f632d673":"2021-05-31T10:52:13.949Z","1.0.249":"2021-05-31T10:55:08.774Z","1.0.250-renovate-balena-jellyfish-logger-3-x-358260adf8314934a982aa1b64e8130c2124f55b":"2021-05-31T10:58:55.597Z","1.0.250":"2021-05-31T21:16:35.843Z","1.0.251-remove-catch-uncommitted-f144e6d5ca215c3754b70c511ff92e7441537ca7":"2021-06-02T07:17:45.747Z","1.0.251":"2021-06-02T07:22:01.958Z","1.0.252-improve-lint-staged-4f64d6fe5c4a1e122823275f6a0a6ee5d1a4818a":"2021-06-03T23:21:31.754Z","1.0.252":"2021-06-03T23:24:44.181Z","1.0.253-renovate-external-non-major-a84232bd1e6d57938f83fbd8ff63cf7407165780":"2021-06-05T08:07:29.128Z","1.0.253":"2021-06-05T08:10:52.448Z","1.0.254-renovate-internal-patch-f75b7ee70d11272b3a14cb7243a4830bc328efd9":"2021-06-05T08:18:41.629Z","1.0.254-renovate-balena-jellyfish-types-0-x-60a54f9f0eb3d94b981aca36ba845de1f1578210":"2021-06-05T08:19:08.084Z","1.0.254":"2021-06-05T08:22:58.026Z","1.0.255-renovate-internal-patch-8ae6d70e80f183a20b48a56d3791a4642905a5f4":"2021-06-05T09:48:02.694Z","1.0.255":"2021-06-05T09:51:32.645Z","1.0.256-renovate-balena-jellyfish-types-0-x-901af96d3c22ff794e39bb4ad94356a196a25e55":"2021-06-05T09:55:55.371Z","1.0.256":"2021-06-05T15:20:30.104Z","1.0.257-renovate-internal-patch-a8cfcad1dc732f1f690f43ba0871b76e79df7e0b":"2021-06-06T18:02:01.106Z","1.0.257":"2021-06-06T18:05:58.205Z","1.0.257-renovate-external-non-major-5c7455789ebb19365c5ed144174d2a5bf8951b91":"2021-06-06T18:09:30.968Z","1.0.258-renovate-external-non-major-627b5d4c3174c1776c86f66ae0fdb435a95d7e39":"2021-06-06T18:12:12.844Z","1.0.258":"2021-06-06T18:16:14.261Z","1.0.259-renovate-internal-patch-66982c4881d00fd9115311b8e8128672bda05479":"2021-06-06T23:48:13.647Z","1.0.259":"2021-06-06T23:51:56.853Z","1.0.260-renovate-internal-patch-47f715c72d313b2b36bdedefd79404e6b0a0fd6b":"2021-06-07T02:43:01.329Z","1.0.260":"2021-06-07T02:46:37.134Z","1.0.261-renovate-balena-jellyfish-environment-4-x-3ddc0110f6d17cbb0d81cf7c29d684a935bde64f":"2021-06-08T02:10:33.091Z","1.0.261":"2021-06-08T02:13:58.357Z","1.0.262-repo-sync-jellyfish-config-default-a76463696a97c935f034f59f05a4ecd02e0cdff9":"2021-06-08T04:10:08.117Z","1.0.262-renovate-internal-patch-34e6848df5f4098c702a43bed1c1caf6dd5570c5":"2021-06-08T04:15:02.165Z","1.0.262":"2021-06-08T04:23:23.692Z","1.0.262-renovate-balena-jellyfish-config-1-x-8b2393abfef1a36de9e6c9482592309caf98222b":"2021-06-08T04:24:52.784Z","1.0.262-renovate-internal-patch-918fbaf857fea70af1f15fced9025a347c966f50":"2021-06-08T04:25:53.416Z","1.0.263-renovate-internal-patch-e75e43c7f7ae3ac6a3e644048d99ec75dcd54c45":"2021-06-08T07:41:02.293Z","1.0.263":"2021-06-08T07:44:38.153Z","1.0.264-renovate-balena-jellyfish-config-1-x-1f4e9b674d3a98a468a490f72fe244e1ede26782":"2021-06-09T02:57:46.631Z","1.0.264":"2021-06-09T03:00:59.587Z","1.0.265-repo-sync-jellyfish-config-default-e5f16d3d93ee6c55127a1c5ee5405d7c5426e6d1":"2021-06-11T05:00:37.813Z","1.0.265-renovate-internal-patch-d48945a0599589fcd38a65417a0ef361957264c6":"2021-06-11T05:12:40.844Z","1.0.265":"2021-06-11T05:16:47.611Z","1.0.266-renovate-internal-patch-f00953d821b761d6fb4bb5b5a9139a1667bfd9c5":"2021-06-11T05:22:35.329Z","1.0.266-renovate-internal-patch-4d065ac54e55bb9c5248c6c2adf14d9195129e47":"2021-06-11T05:29:46.319Z","1.0.266":"2021-06-11T05:32:32.404Z","1.0.267-renovate-internal-patch-b1a99777c6dd0b6f2786add40cb8dce4479fee04":"2021-06-11T09:10:53.758Z","1.0.267":"2021-06-11T09:15:05.078Z","1.0.268-renovate-internal-patch-07779bb7aa49e337cc1ba64b16b0cc684d9b6dfa":"2021-06-12T01:05:17.286Z","1.0.268-renovate-external-non-major-993cf97e3bd773706c645e655e221d1726a3e6ea":"2021-06-12T01:06:22.842Z","1.0.268":"2021-06-12T01:08:44.349Z","1.0.269-renovate-external-non-major-b41d3114805669721ae7606846d2b617cf7a0bce":"2021-06-12T01:12:37.520Z","1.0.269":"2021-06-12T01:18:31.358Z","1.0.270-renovate-internal-patch-2c62c113fb3c9b7380737e8a2b5bdab06e55a0a5":"2021-06-12T08:30:40.680Z","1.0.270":"2021-06-12T08:34:25.537Z","1.0.271-renovate-internal-patch-e72cdcec7be293eb22dc4b535661293f112a986b":"2021-06-15T00:24:01.371Z","1.0.271":"2021-06-15T00:27:34.445Z","1.0.272-repo-sync-jellyfish-config-default-4963ac890c2a18de78df7c75c59889306e61a70d":"2021-06-15T01:02:30.929Z","1.0.272":"2021-06-15T01:06:36.304Z","1.0.273-renovate-internal-patch-171e8253554297ff9e4094223400ff91c72a15b6":"2021-06-15T02:22:29.250Z","1.0.273-renovate-internal-patch-cdbb2aca8a9f420db3489598d460cc1cbe53057b":"2021-06-15T02:27:07.595Z","1.0.273":"2021-06-15T02:30:42.114Z","1.0.274-renovate-internal-patch-dc1005bd1cce59e142cb1b5710571fe599a54233":"2021-06-15T05:54:59.935Z","1.0.274":"2021-06-15T05:58:50.567Z","1.0.275-renovate-internal-patch-5da934bcb57aa2cb2c267f031bc95440076bc0a9":"2021-06-19T02:12:17.658Z","1.0.275":"2021-06-19T02:15:51.620Z","1.0.276-renovate-internal-patch-6abc2b5d483bdb6fb39adb4398893eaefc04b58e":"2021-06-19T10:18:51.701Z","1.0.276":"2021-06-19T10:22:21.008Z","1.0.277-renovate-internal-patch-5db901e82bb122a064c8aa44d58173e2a01cbb38":"2021-06-19T11:33:46.482Z","1.0.277":"2021-06-19T11:37:46.784Z","1.0.278-bump-typescript-8b5523923eba1e3a639f333110be6f6b2d1293ec":"2021-06-19T13:10:27.802Z","1.0.278":"2021-06-19T13:14:47.166Z","1.0.279-renovate-internal-patch-bee6a1bdbe75ed4c435d5fc82f096236fe091e2d":"2021-06-20T15:09:24.140Z","1.0.279":"2021-06-20T15:12:41.844Z","1.0.280-renovate-internal-patch-3c7608c289ddc7f35ecbc0f9b0ec7124bc3ee3ae":"2021-06-22T07:47:11.708Z","1.0.280":"2021-06-22T07:53:09.285Z","1.0.280-renovate-internal-patch-d9cd6e024363647e9b07d3314cc9da4530f8f1ae":"2021-06-22T07:55:19.227Z","1.0.281-renovate-internal-patch-bda78084457de36c1adf6b922e735416d6da1297":"2021-06-22T07:59:32.410Z","1.0.281":"2021-06-22T08:03:44.094Z","1.0.282-renovate-internal-patch-36bd0e3f63109ba8ad9727c7cc9c81ab8366bd39":"2021-06-22T23:43:18.101Z","1.0.282":"2021-06-22T23:48:05.370Z","1.0.283-renovate-balena-jellyfish-types-0-x-4dc26cf62d1778586ba12b85c9ee91335179e391":"2021-06-22T23:52:21.762Z","1.0.283":"2021-06-22T23:58:26.264Z","1.0.284-renovate-internal-patch-e688c02664868fa6931c09c8b2518529ca3ff69c":"2021-06-23T07:39:39.346Z","1.0.284":"2021-06-23T07:43:05.157Z","1.0.285-bump-deps-ccde5fe9060f5091c33d3508197afa0fa6e640dc":"2021-06-23T23:30:46.778Z","1.0.285":"2021-06-23T23:34:44.550Z","1.0.286-renovate-internal-patch-58f07927eec342c6f8166929d15acf35c0eb52a9":"2021-06-23T23:42:17.904Z","1.0.286":"2021-06-23T23:46:30.681Z","1.0.287-renovate-external-non-major-04583dd5468ef01f2e8aac6e085ddf390979e781":"2021-06-29T07:18:33.477Z","1.0.287-renovate-internal-patch-7d620074e37e84c593a4677c028f622e40e6a978":"2021-06-29T07:22:51.611Z","1.0.287-renovate-balena-jellyfish-environment-4-x-273e0f66a89d053a6ec4e1872ce257b950295a31":"2021-06-29T07:23:13.666Z","1.0.288-renovate-external-non-major-ebdcd844dc3de181598a6e77dfeb2c77fa038bb2":"2021-06-29T07:29:29.623Z","1.0.288-renovate-balena-jellyfish-environment-4-x-a42d0ec578f57364374c90e069e9530675ac6c7b":"2021-06-29T07:31:29.070Z","1.0.289-renovate-balena-jellyfish-environment-4-x-5d7ff71bb7de6adfb942f63edbd1cb6cefda97a2":"2021-06-29T07:38:23.586Z","1.0.290-repo-sync-jellyfish-config-default-86300207b2f9aad6733f860644792767ec1e84e3":"2021-06-29T10:03:16.547Z","1.0.290":"2021-06-29T10:12:30.327Z","1.0.291-renovate-internal-patch-9eb7b91c7dd3011da991bd21d694737d71371778":"2021-06-29T10:18:43.900Z","1.0.291-renovate-internal-patch-5baab794c96b91895c655c98de4057d1424eeda8":"2021-06-29T10:23:18.612Z","1.0.291":"2021-06-29T10:28:30.131Z","1.0.292-renovate-internal-patch-20261f54aa50c84a27c4b83fbc5ebef8202a3d2b":"2021-06-29T11:52:48.954Z","1.0.292-renovate-internal-patch-f2a020154c9778e5a451f4f160098cf0a1c03a77":"2021-06-29T11:55:50.223Z","1.0.292":"2021-06-29T12:00:44.792Z","1.0.293-renovate-internal-patch-c055fa63ace7b2ed0517d9e846bb37e3b03a6a84":"2021-06-30T00:44:14.824Z","1.0.293":"2021-06-30T00:47:42.843Z","1.0.294-renovate-internal-patch-80aa639b4ddb1603704beb1b44d77b90191f961a":"2021-06-30T02:53:47.996Z","1.0.294":"2021-06-30T02:56:56.201Z","1.0.295-renovate-internal-patch-ca4f1c0099c51a9e84d20b9b41742ebcee0e8a6f":"2021-07-02T07:08:36.817Z","1.0.295-renovate-balena-jellyfish-types-0-x-2258dfc8852fe3eef451ba0096bf32dcd89b9efd":"2021-07-02T07:09:43.593Z","1.0.295":"2021-07-02T07:12:35.249Z","1.0.296-renovate-balena-jellyfish-types-0-x-10b17d236eed3c9edf3fab740f7025c56d250aec":"2021-07-02T07:17:40.233Z","1.0.296":"2021-07-02T07:22:58.367Z","1.0.297-renovate-internal-patch-0301cde459ce62014cbe65ff6544b013ffb25d4c":"2021-07-02T08:30:10.976Z","1.0.297":"2021-07-02T08:36:36.597Z","1.0.298-renovate-balena-jellyfish-config-1-x-f4b5d5f9e806e4eab2b1882934771143d10be675":"2021-07-02T08:38:26.278Z","1.0.298":"2021-07-02T08:43:08.487Z","1.0.299-renovate-internal-patch-05f6e7f04d2445d1a71b28b73df59d024036e6eb":"2021-07-02T23:14:25.408Z","1.0.299":"2021-07-02T23:18:07.672Z","1.0.300-renovate-internal-patch-ceb5ea88c1a4aea2a298e969b39f6a23f9e37a9b":"2021-07-02T23:23:20.913Z","1.0.300":"2021-07-02T23:27:08.419Z","1.0.301-renovate-internal-patch-a5d91f14aeb54fd9d6122a259486cf94167ec6e8":"2021-07-02T23:33:58.436Z","1.0.301":"2021-07-02T23:37:37.469Z","1.0.302-renovate-internal-patch-7d1afa35c3152a4870df54e01ee3c379badff4f2":"2021-07-03T01:04:22.168Z","1.0.302":"2021-07-03T01:08:21.952Z","1.0.303-renovate-external-non-major-07a7176291ce65d8e5ac4fdc494fd72cbd635bd3":"2021-07-03T01:11:43.059Z","1.0.303-renovate-internal-patch-3fb3a0258a0f26ae79b3d07041dc8e763a4b5a32":"2021-07-03T01:59:17.720Z","1.0.303-renovate-internal-patch-cee6215976f5e88f508b0b38633fa0ee55405e9e":"2021-07-03T02:04:47.615Z","1.0.303":"2021-07-03T02:08:57.931Z","1.0.304-renovate-internal-patch-03c134047539a8e02eb98dd28a577a3bbd2349e4":"2021-07-03T02:12:17.609Z","1.0.304-renovate-external-non-major-1fa06716312a70655be6a757f25d965b72783ce4":"2021-07-03T02:16:20.156Z","1.0.304":"2021-07-03T02:19:05.648Z","1.0.305-renovate-external-non-major-503b1d71b86d15f4728adc9b6321c02c516ca0f1":"2021-07-03T02:22:13.220Z","1.0.305":"2021-07-03T02:28:40.472Z","1.0.306-renovate-internal-patch-0f6dbf45198cd532df2e2c36eb203185b5fdac77":"2021-07-05T03:18:07.164Z","1.0.306":"2021-07-05T03:21:54.762Z","1.0.307-renovate-internal-patch-67daf08414c1fa796f2bbb10f60a7a105f25c564":"2021-07-05T15:00:16.944Z","1.0.307":"2021-07-05T15:04:24.365Z","1.0.308-renovate-internal-patch-28f74c5f05f1b62590c559610f7163895085a459":"2021-07-05T16:55:37.810Z","1.0.308":"2021-07-05T16:59:30.052Z","1.0.309-renovate-internal-patch-57484e6b4fade4515b0f61ff1345c4eddf0f3ffa":"2021-07-06T23:53:40.877Z","1.0.309":"2021-07-06T23:58:45.303Z","1.0.310-renovate-internal-patch-e07a45c475c4e0fd76ca3105e8cb7757860b2aae":"2021-07-07T22:27:04.874Z","1.0.310":"2021-07-07T22:30:45.385Z","1.0.311-renovate-internal-patch-b99f54e5f185ae5b04ca41b990145d9d8a1833ff":"2021-07-09T01:38:52.476Z","1.0.311-renovate-internal-patch-90f46f8f285f214ae080eebcd8e8f4b5100dc2b7":"2021-07-09T01:43:37.109Z","1.0.311-renovate-internal-patch-17a56bca884d2316ac7e87c29417460bc94d4076":"2021-07-09T01:48:53.642Z","1.0.311":"2021-07-09T01:52:25.218Z","1.0.312-renovate-external-non-major-9ab09d8f29103a5396356769af8309c1d1168435":"2021-07-10T01:28:35.465Z","1.0.312":"2021-07-10T01:33:13.368Z","1.0.313-renovate-internal-patch-5157c6ce8990d217c006f1cb795a3334c924c0e7":"2021-07-10T01:37:03.853Z","1.0.313":"2021-07-10T08:43:25.061Z","1.0.314-renovate-internal-patch-9cb10695a2ce490e4041c63821714d41acdae238":"2021-07-10T08:49:42.452Z","1.0.314":"2021-07-10T08:53:24.379Z","1.0.315-renovate-external-non-major-2617dac45d5fd10d6afc8bc20cd10d7ca73da17c":"2021-07-10T21:00:49.172Z","1.0.315":"2021-07-10T21:04:35.406Z","1.0.316-renovate-internal-patch-8e8e6fd961aaa35724018843712d0b566564ff74":"2021-07-10T21:12:33.397Z","1.0.316":"2021-07-10T21:16:37.905Z","1.0.317-renovate-internal-patch-7d61cdced0827c50f51650a900c0edc4142fd497":"2021-07-10T22:46:25.496Z","1.0.317":"2021-07-10T22:49:51.280Z","1.0.318-renovate-internal-patch-12baf7b95ff0902f2d22dcd535f77db8fb589cb9":"2021-07-11T02:12:00.753Z","1.0.318":"2021-07-11T02:15:13.689Z","1.0.319-renovate-internal-patch-47ecd493945922e2005cdeffca3ba7b1f71fe56a":"2021-07-11T06:58:03.421Z","1.0.319":"2021-07-11T07:02:23.799Z","1.0.320-renovate-internal-patch-6e395b55fce89eea3fb8f532c0dda78626807949":"2021-07-14T04:55:43.009Z","1.0.320-fix-jest-config-6f1e2bbc5e1264dc0dceab59768d0a26a0db07d8":"2021-07-14T06:55:31.223Z","1.0.320":"2021-07-14T06:59:05.576Z","1.0.321-renovate-internal-patch-51c6af05acd84b7a0e11bca867ab23c64aa01c1d":"2021-07-14T07:05:07.247Z","1.0.321":"2021-07-14T07:08:25.353Z","1.0.322-renovate-internal-patch-d8dffd3be6dbf73343030943d26263a794a5588c":"2021-07-14T07:12:34.974Z","1.0.322-renovate-internal-patch-56919fb1474752916f86128db49cd3e211d96267":"2021-07-14T08:44:36.241Z","1.0.322":"2021-07-14T08:48:57.731Z","1.0.323-remove-whitesource-badda0f52d18874df5ed97db8c74055a5f2fe7da":"2021-07-16T23:33:47.927Z","1.0.323":"2021-07-16T23:38:52.459Z","1.0.324-renovate-internal-patch-398fec6adfe17e018c1634d6d74300c1cf0a27a2":"2021-07-16T23:44:45.623Z","1.0.324":"2021-07-16T23:50:07.297Z","1.0.325-renovate-external-non-major-99b00f9c5f61e62281a4866e63b245f9f7b8daa7":"2021-07-17T00:58:56.677Z","1.0.325-renovate-internal-patch-199fb110383a65df327625a1e8e3c5d79f552cd0":"2021-07-17T01:03:17.767Z","1.0.325":"2021-07-17T01:03:52.686Z","1.0.326-renovate-internal-patch-be3f1f57049b649d718fecda52c050cb114d02cb":"2021-07-17T01:07:42.320Z","1.0.326":"2021-07-17T01:13:17.625Z","1.0.327-renovate-internal-patch-21a95b9cb29734855799b2d954bdb897e3680c0d":"2021-07-17T06:41:40.992Z","1.0.327":"2021-07-17T06:45:33.085Z","1.0.328-renovate-internal-patch-e78777f954f12553a8479c5f1bbff11f02cdb70f":"2021-07-21T08:48:19.207Z","1.0.328":"2021-07-21T08:51:21.972Z","1.0.329-renovate-external-non-major-54e3d19cb43faf6e29e7e9b9de86d9e60ca1d096":"2021-07-24T01:04:44.642Z","1.0.329":"2021-07-24T01:10:51.980Z","1.0.330-renovate-external-non-major-c60fbae40e926084d713adfb9940c4a79710be9e":"2021-07-24T12:36:22.795Z","1.0.330":"2021-07-24T12:40:47.092Z","1.0.331-renovate-external-non-major-80516dec99ca5f22a6938d01386fa94f82e06507":"2021-07-24T19:43:53.732Z","1.0.331":"2021-07-24T19:47:23.888Z","1.0.332-h32-unify-script-names-eb1cad74237f06791080f5d4f4139f4bd1e9b975":"2021-08-04T22:49:36.489Z","1.0.332":"2021-08-04T22:53:26.086Z","1.0.333-renovate-internal-patch-17e327d65d360bb8133b8167d87dfe6ba76fb2da":"2021-08-04T23:56:47.569Z","1.0.333":"2021-08-05T00:01:02.874Z","1.0.334-renovate-internal-patch-f6b3a81266e31b7c3070bcc719da00a97afed506":"2021-08-25T11:33:03.414Z","1.0.334-renovate-balena-jellyfish-types-0-x-a2610b33b50e700af48d169afd88b227b09e292f":"2021-08-25T11:33:29.789Z","1.0.334-renovate-balena-jellyfish-environment-5-x-50c221f148afd2a02e16552b52497a754825c55d":"2021-08-25T11:33:46.057Z","1.0.334":"2021-08-25T11:36:10.781Z","1.0.334-update-renovate-config-d8564d683f404aaf4b0b71f985318d56da581ec3":"2021-08-25T11:37:32.327Z","1.0.335-renovate-balena-jellyfish-environment-5-x-017a5a8f321026b80b5fe80b4d86bf05916eff74":"2021-08-25T11:40:41.064Z","1.0.335-update-renovate-config-943a55802fd966d49317b5d10fd622ce5a363ba6":"2021-08-25T11:46:42.557Z","1.0.335":"2021-08-25T11:49:50.463Z","1.0.336-renovate-balena-jellyfish-environment-5-x-e376025cb7f03726f73789ebbf1cda869f75ad6f":"2021-08-25T11:53:40.643Z","1.0.336":"2021-08-25T12:13:08.560Z","1.0.337-renovate-external-non-major-3ae501b5036c166bf073bcce2c06998b195bd4f5":"2021-08-28T00:54:58.898Z","1.0.337-renovate-major-external-major-7a53ffb51db4b4ee3ac5eb524c3bf66c89b19394":"2021-08-28T00:56:01.838Z","1.0.337":"2021-08-28T00:59:19.154Z","1.0.338-renovate-major-external-major-63a14e90978d66dde3aba31a0de43c916f4efb4f":"2021-08-28T01:02:17.347Z","1.0.338-renovate-internal-patch-fcc98241809e068562c6dd50e1ba17fb842e5741":"2021-08-28T02:28:26.591Z","1.0.338":"2021-08-28T02:32:05.678Z","1.0.339-renovate-major-external-major-2a28b9757983a0097240e9412ad01d778e17e19e":"2021-08-28T11:59:44.608Z","1.0.339":"2021-08-28T12:47:14.133Z","1.0.340-renovate-external-non-major-9e3ba793a05adf42fdb55ab4fb1e86bec901aae3":"2021-08-29T16:30:24.569Z","1.0.340":"2021-08-29T16:34:06.530Z","1.0.341-renovate-internal-patch-cd720f8a321f3155a21b574f67a467d0c6fb9c6f":"2021-08-30T09:49:27.257Z","1.0.341":"2021-08-30T09:53:03.626Z","1.0.342-repo-sync-jellyfish-config-default-62441753685cd320b144ac45cb2b4e241ea14279":"2021-10-04T03:28:35.260Z","1.0.342-repo-sync-jellyfish-config-default-fecf7ef61a5bf675fbbc520f632bccdc20012357":"2021-10-04T04:30:18.870Z","1.0.342-repo-sync-jellyfish-config-default-f8cf1b9c3830bf496929111c90da32ebf4e7abc2":"2021-10-04T05:11:56.592Z","1.0.342":"2021-10-05T00:00:01.332Z","1.0.343-renovate-internal-patch-5a9ead0fd583ddf92a9e7994da6b744bf9bc4ac7":"2021-10-18T14:52:38.642Z","1.0.343-renovate-balena-jellyfish-types-1-x-4f698954f84ba6a8c17b1897beaa0ae5f4830591":"2021-10-18T14:53:06.280Z","1.0.343":"2021-10-18T14:56:33.424Z","1.0.343-renovate-balena-jellyfish-config-1-x-6468cc4760e8a2ac69eda51122e924a15b3c353f":"2021-10-18T15:01:05.402Z","1.0.343-renovate-balena-jellyfish-types-1-x-50ffe2e846378e4e59db23f22ff7c33910e0d59c":"2021-10-18T15:01:15.096Z","1.0.344-renovate-balena-jellyfish-types-1-x-db0c0eb4538180df8f2c2848f6b7779838b291f6":"2021-10-18T15:06:24.494Z","1.0.344":"2021-10-18T23:14:01.773Z","1.0.345-renovate-internal-patch-098aaad9c38f7ca29aeca976b87531c932413044":"2021-10-18T23:18:58.898Z","1.0.345-renovate-balena-jellyfish-config-1-x-b7b1028ee7125e1d25bc377cfb0d9a4408aa5a43":"2021-10-18T23:21:09.210Z","1.0.345":"2021-10-18T23:24:11.716Z","1.0.346-renovate-balena-jellyfish-config-1-x-40b88f64f16b4f0916a85dcaf9f6a24763a781b7":"2021-10-18T23:29:50.083Z","1.0.346":"2021-10-18T23:33:24.606Z","1.0.347-renovate-internal-patch-7a8f437dc72f8cad84107a77556d5a6df214b187":"2021-10-20T09:13:03.218Z","1.0.347":"2021-10-20T09:17:20.195Z","1.0.348-renovate-external-non-major-3941b7e92a13459fd2bf43ab7e0007178b87961e":"2021-10-23T00:50:12.551Z","1.0.348-renovate-external-non-major-64230c9f559f571a6142ae43e0ab537e807a6af3":"2021-10-23T01:21:09.670Z","1.0.348":"2021-10-23T01:24:54.193Z","1.0.349-renovate-internal-patch-24a97225f6726f8c36a9605d6bdb898f35aff05f":"2021-10-23T05:21:54.669Z","1.0.349":"2021-10-23T05:25:50.817Z","1.0.350-renovate-internal-patch-024884c22ffdde0114fa40aa32ae12a49a6ccdcb":"2021-10-23T08:38:58.040Z","1.0.350":"2021-10-23T08:43:08.728Z","1.0.351-renovate-internal-patch-80c5f2611073f4acc00313a06ed39b2f24bc5a8e":"2021-10-23T19:34:34.743Z","1.0.351-renovate-external-non-major-2519beed7a5ff9d32e97a22800eeeabc752db6a5":"2021-10-23T19:34:58.378Z","1.0.351":"2021-10-23T19:39:01.501Z","1.0.352-renovate-external-non-major-91aa515f5af1e32ec2528e13d32bc4b8d75154b9":"2021-10-23T19:42:01.894Z","1.0.352":"2021-10-23T19:48:43.816Z","1.0.353-renovate-internal-patch-fbf96b269fd4118a0a351628207a7d127ffb9243":"2021-10-23T21:47:14.524Z","1.0.353":"2021-10-23T21:51:22.626Z","1.0.354-renovate-internal-patch-3336bb68113f77b60f2083019feb8beb48abd049":"2021-10-28T01:27:41.174Z","1.0.354":"2021-10-28T01:31:17.407Z","1.0.355-renovate-internal-patch-a2dcf9d0323750061eddc2aad13d07542d86b5eb":"2021-10-28T03:38:44.167Z","1.0.355":"2021-10-28T03:41:55.657Z","1.0.356-renovate-internal-patch-64a1a946caa06301a3f4533e3c03c15825ea2217":"2021-10-28T05:55:11.802Z","1.0.356":"2021-10-28T05:58:51.585Z","1.0.357-renovate-internal-patch-ee25c00bd315b98f98bf3c432016e02aa7e4ac5b":"2021-10-28T09:51:16.716Z","1.0.357":"2021-10-28T09:55:59.382Z","1.0.358-renovate-internal-patch-98d27883d0d5962485160b52dd93133a5734accc":"2021-10-28T11:23:36.804Z","1.0.358":"2021-10-28T11:28:06.532Z","1.0.359-renovate-internal-patch-8a8b9f731a37e92f62aaab90bae2d6259bbc16c5":"2021-10-28T13:49:52.321Z","1.0.359":"2021-10-28T13:53:41.296Z","1.0.360-renovate-external-non-major-6dca56c4fab73c99d622cf345c7e63ca1e77cea5":"2021-10-30T02:34:58.821Z","1.0.360-renovate-major-external-major-ce96dbd9ec213cc3fc5918e5d8b1ad05b7948db7":"2021-10-30T02:35:39.342Z","1.0.360":"2021-10-30T02:38:46.195Z","1.0.361-renovate-major-external-major-59eb1d54bfc8005806e3e655f2318c8f5775425c":"2021-10-30T02:43:48.295Z","1.0.361-renovate-internal-patch-710747aa736e967161edc85e4e529892eea04019":"2021-10-30T03:35:05.043Z","1.0.361":"2021-10-30T03:39:29.236Z","1.0.362-renovate-major-external-major-e8d0b241ce4130fff215de5efcb689b0ceffb1a6":"2021-10-30T03:42:28.764Z","1.0.362-renovate-internal-patch-1be8bf8328c0823d4d5267ce2b5bba04614cc680":"2021-10-30T03:51:38.842Z","1.0.362":"2021-10-30T04:00:46.733Z","1.0.363-renovate-major-external-major-c532daacd23f01375d342e864b1ada9f14cbe619":"2021-10-30T04:08:08.201Z","1.0.363":"2021-10-30T10:06:46.336Z","1.0.364-renovate-internal-patch-13d2e7a2dbac663ade62ffb4e77dfe26399e8b3a":"2021-11-05T23:13:44.311Z","1.0.364":"2021-11-05T23:25:56.687Z","1.0.365-renovate-internal-patch-c76aebe2427b81931cbf0d64c2e38eea50da807d":"2021-11-06T03:43:43.826Z","1.0.365":"2021-11-06T03:46:35.387Z","1.0.366-renovate-internal-patch-5dcb742ae74fd69f95f6ed75db97dd44c24b1a7c":"2021-11-07T03:09:46.643Z","1.0.366":"2021-11-07T03:14:52.397Z","1.0.367-renovate-external-non-major-a2eb50ac38b4747bcca7645ec771ce79ae19d3a6":"2021-11-07T03:20:33.525Z","1.0.367-renovate-external-non-major-fd1a4e5e13989d53288cf52388087060b2991265":"2021-11-08T22:17:43.161Z","1.0.367":"2021-11-08T22:23:58.398Z","1.0.368-renovate-internal-patch-af1a81130daa5bb72b1456b92ae13c94f8518250":"2021-11-09T13:55:59.098Z","1.0.368":"2021-11-09T14:00:14.356Z","1.0.369":"2021-11-11T05:33:03.721Z","1.0.369-renovate-internal-patch-271754aff34b3be97b8d10d433d9dfeb1db0c76b":"2021-11-11T05:34:08.632Z","1.0.370-renovate-internal-patch-cd1ffc63ae764e5450fb224a9fb4a3da0e9b2cfe":"2021-11-11T05:36:22.929Z","1.0.370":"2021-11-11T05:40:04.886Z","1.0.371-renovate-internal-patch-9e165cf5f8476c3e196cf6660e877cb423a3b782":"2021-11-12T04:01:31.314Z","1.0.371":"2021-11-12T04:04:22.768Z","1.0.372-renovate-internal-patch-a0d0f97775602dc24452e67af5abe1efde63abca":"2021-11-12T05:43:12.969Z","1.0.372":"2021-11-12T05:46:09.767Z","1.0.373-renovate-internal-patch-1589ac669cf5ae2a4e196e95c352d7144c225dc5":"2021-11-13T03:15:15.747Z","1.0.373":"2021-11-13T03:17:56.352Z","1.0.374-renovate-internal-patch-5aa588a12665bee17d16516a08fd3973d3ea5d68":"2021-11-13T10:27:37.828Z","1.0.374":"2021-11-13T10:30:28.095Z","1.0.375-renovate-major-external-major-510a92822f738d5b984b31a74abe542e7fc04c6f":"2021-11-14T12:12:44.747Z","1.0.375-renovate-internal-patch-84a01042ae19828cc1a0ff51b1c7aaf5ddc3b06c":"2021-11-14T15:45:23.700Z","1.0.375":"2021-11-14T15:48:24.691Z","1.0.376-renovate-major-external-major-2e2eb79fc425f34981433df36f7eef012dbf0891":"2021-11-14T15:52:49.043Z","1.0.376-renovate-external-non-major-0f32382dc404f00ca1191d16f319632b5ef2a10b":"2021-11-14T22:18:37.951Z","1.0.376":"2021-11-14T22:21:48.392Z","1.0.377-renovate-major-external-major-e16c3b7d0c9de5b2bc06501dbfdebeb90dd0892d":"2021-11-14T22:23:51.800Z","1.0.377-renovate-internal-patch-b571eaa81a188b1626d100ecfce942d95c7ca41f":"2021-11-15T01:19:58.971Z","1.0.377":"2021-11-15T01:23:04.732Z","1.0.378-renovate-major-external-major-d7ee87e3b58bc8a89f7dd3378c0dd69fe9560412":"2021-11-15T01:25:02.409Z","1.0.378":"2021-11-15T03:18:18.831Z","1.0.378-renovate-internal-patch-2b7a04654f9f1b3cfc04c8a584be140889912c34":"2021-11-15T03:20:35.354Z","1.0.379-renovate-internal-patch-ba6b69153c1ae992d8cea7b6f508e61d18ce8080":"2021-11-15T03:24:04.231Z","1.0.379":"2021-11-15T03:28:05.311Z","1.0.380-joshbwlng-set-license-d1859dcc34a1180dee831e5c332f04fbea8c933b":"2021-11-15T03:36:14.160Z","1.0.380":"2021-11-15T03:39:54.631Z","1.0.381-renovate-internal-patch-ef04d618864275777cf4a8e921973431b64db181":"2021-11-15T03:44:57.013Z","1.0.381":"2021-11-15T03:48:35.140Z","1.0.381-renovate-internal-patch-d23a5fde6dce0a8153933df9b892ae83c8510372":"2021-11-15T03:50:39.482Z","1.0.382-renovate-internal-patch-20ba19c40f1d9a18ef5aed741e5170c5712646bd":"2021-11-15T03:54:03.993Z","1.0.382":"2021-11-15T03:57:26.276Z","1.0.383-renovate-internal-patch-fd521f159e10a533e330912e80d9fc476de61e07":"2021-11-15T06:07:04.371Z","1.0.383-renovate-internal-patch-237c3bc0c0569e180a0ab28e97addeaeb087f5e0":"2021-11-15T06:11:06.242Z","1.0.383-renovate-internal-patch-65098288e1863e1b223c64e35506c18504677a48":"2021-11-15T06:14:51.586Z","1.0.383":"2021-11-15T06:18:22.461Z","1.0.384-renovate-internal-patch-31c1b66492c32f2e22d42daf745cc127117f9afb":"2021-11-15T06:20:46.874Z","1.0.384":"2021-11-15T06:25:41.032Z","1.0.385-renovate-internal-patch-b0e2d79505517fe71ab7545faba242be87011118":"2021-11-15T13:09:20.661Z","1.0.385":"2021-11-15T13:13:29.039Z","1.0.386-renovate-internal-patch-b76bbdf1753008ae16e8cdec44d96163afc6408b":"2021-11-16T00:12:31.107Z","1.0.386":"2021-11-16T00:15:51.279Z","1.0.387-renovate-internal-patch-427798f5d1c2e936ff22f3145c7e7a077e0ae79c":"2021-11-16T03:08:23.483Z","1.0.387":"2021-11-16T03:12:12.423Z","1.0.388-repo-sync-jellyfish-config-default-0dcd2b80500bc1fd8c1d7bfd2b2d0661d4313114":"2021-11-16T03:58:55.628Z","1.0.388":"2021-11-16T04:02:49.998Z","1.0.389-renovate-internal-patch-64943d275142c823e38f9786e800437e836e5276":"2021-11-16T04:08:02.890Z","1.0.389-renovate-internal-patch-f37b1536fb217e6c474e070099410ac0075cb555":"2021-11-16T04:13:01.376Z","1.0.389-renovate-internal-patch-ed0ea71c5a636496373229c05679cff940dd54fd":"2021-11-16T04:17:30.800Z","1.0.389-renovate-internal-patch-286cb5c4ac71ea3cfc94b0fefc1bce66bc178c13":"2021-11-16T04:20:19.573Z","1.0.389":"2021-11-16T04:24:16.029Z","1.0.390-renovate-internal-patch-c421c0dc80faf241a65d0250ef38749735847ef0":"2021-11-16T04:29:13.012Z","1.0.390":"2021-11-16T04:32:59.769Z","1.0.391-renovate-internal-patch-eb7d81bce0229efce8c3e26245bbcb83c04606dd":"2021-11-19T10:58:39.753Z","1.0.391":"2021-11-19T11:01:30.113Z","1.0.392-renovate-external-non-major-e5d1711b7d7cc862afe47200099cf669bde2bbe7":"2021-11-20T00:49:35.577Z","1.0.392-renovate-balena-jellycheck-1-x-f0ec0e8ea54bce32395cb4b0fb0749b6301babe2":"2021-11-20T02:34:03.790Z","1.0.392-renovate-internal-patch-f7a74eb5c4427fc7443cbda05006e5a4f0dd98e9":"2021-11-20T08:22:00.581Z","1.0.392":"2021-11-20T08:24:58.777Z","1.0.393-renovate-balena-jellycheck-1-x-9ebe7d7151c67f45b7e58ba819552b76224c8ea4":"2021-11-20T08:29:06.832Z","1.0.393-renovate-internal-patch-7a4eec6f7c82a795d6fa903c93fc74a702227613":"2021-11-20T10:41:36.956Z","1.0.393-renovate-internal-patch-a412b9fbd99e65d8a97190640c25b21fa3120ba8":"2021-11-20T12:56:53.936Z","1.0.393":"2021-11-20T13:00:08.747Z","1.0.394-renovate-balena-jellycheck-1-x-badcb368995039946e7e91d5d7bf73c72cfc04d6":"2021-11-20T13:03:55.692Z","1.0.394-renovate-internal-patch-4326580980d5cd664c7b8ecb2014588499cdf654":"2021-11-20T13:08:14.772Z","1.0.394-renovate-balena-jellycheck-1-x-e5842af21f5cb4d7ea22321d950ea49badc8f7b8":"2021-11-20T13:13:45.306Z","1.0.394-renovate-internal-patch-db44d4e5410ec10c1c25bb8cda0d054464789075":"2021-11-20T16:15:59.944Z","1.0.394":"2021-11-20T16:18:52.510Z","1.0.395-renovate-balena-jellycheck-1-x-f193e54b920ba45b2c17e848109d0099dc6b3be8":"2021-11-20T16:22:06.702Z","1.0.395":"2021-11-21T00:09:30.996Z","1.0.396-joshbwlng-remove-license-headers-f6e39e82fb5544cad3ba3c913a96f9ba274eb925":"2021-11-21T00:27:17.307Z","1.0.396":"2021-11-21T00:30:25.691Z","1.0.397-renovate-external-non-major-06f09fd5b26ef59acf85ba6735b212dc03c34666":"2021-11-21T16:16:04.789Z","1.0.397-renovate-internal-patch-07631846ee205b9b06e19f3bbacfd7039992cff8":"2021-11-22T01:41:38.077Z","1.0.397":"2021-11-22T01:45:07.909Z","1.0.398-renovate-external-non-major-caf70202a46ad58e7b2fbd8f156d3c9702868fbe":"2021-11-22T01:47:31.765Z","1.0.398-joshbwlng-bump-deps-2ac4109ab076e2b258d2506d3643102b6dd845f8":"2021-11-22T03:12:54.554Z","1.0.398":"2021-11-22T03:16:46.759Z","1.0.398-renovate-internal-patch-a0f5de866756e3dd7888c620b5bf07aa3772c0c3":"2021-11-22T03:18:41.931Z","1.0.399-renovate-internal-patch-a6061bdde25041149aba44cd2785acb3888f0723":"2021-11-22T03:21:19.040Z","1.0.399":"2021-11-22T03:24:06.847Z","1.0.400-renovate-external-non-major-d91b35f1bf51160655382a0a1d5dd78505119df8":"2021-11-22T03:26:52.750Z","1.0.400-renovate-external-non-major-29973d299962578a33cd8c4a617c56149f364470":"2021-11-22T11:18:10.493Z","1.0.400-renovate-typescript-4-x-a301655ace3d6bd233a779105a3530165388f67f":"2021-11-23T02:42:44.322Z","1.0.400-renovate-internal-patch-e7796edc7b6df0f5ca8b5fa60ea2dc9c9b12410a":"2021-11-23T04:29:24.335Z","1.0.400":"2021-11-23T04:32:40.248Z","1.0.401-renovate-typescript-4-x-b409e2ea62449b7e88732d95f1b721413bcbc44a":"2021-11-23T04:35:41.470Z","1.0.401-renovate-external-non-major-9cbab0a99b7a20a20e2e1a75f9674bf34742da5b":"2021-11-23T04:37:21.233Z","1.0.401":"2021-11-23T04:40:54.574Z","1.0.402-renovate-typescript-4-x-c5cee3124809835f4ce4e11f331eaecad7dc4117":"2021-11-23T04:43:54.663Z","1.0.402-renovate-internal-patch-4e980d9edfdb0bea12bd5b43fa6d26793a10f8a3":"2021-11-24T01:54:00.697Z","1.0.402":"2021-11-24T01:57:57.751Z","1.0.402-renovate-typescript-4-x-59ef30e0c85dca82cdef8001e72ee977e359d480":"2021-11-24T01:59:54.509Z","1.0.403-renovate-typescript-4-x-692879ffd683ceed56021e42293cf7ecc96e9018":"2021-11-24T02:03:06.934Z","1.0.403-repo-sync-jellyfish-config-default-c04fa8f3a016d5a92d8d246653b2dac9f5f5368e":"2021-11-24T03:10:33.944Z","1.0.403-renovate-internal-patch-42526c536a2228d25cb3e7d7e5d7e3992511e36b":"2021-11-24T03:17:51.831Z","1.0.403":"2021-11-24T03:21:31.461Z","1.0.403-renovate-typescript-4-x-e768990388d7cd0c6631918e22937d924d54cad8":"2021-11-24T03:23:17.467Z","1.0.404-renovate-typescript-4-x-7737cb6f59f27f7c1bf75e7037e2dbe35126b18b":"2021-11-24T03:26:21.962Z","1.0.404-renovate-internal-patch-97c0c1a76e5e19bcc1dd8d87d7fd8d75e0fc8d35":"2021-11-24T05:48:40.962Z","1.0.404":"2021-11-24T05:51:25.684Z","1.0.405-renovate-typescript-4-x-0e8a1c3c0ceb04b3922cc2cfbf408479f1b9254c":"2021-11-24T05:55:35.205Z","1.0.405-repo-sync-jellyfish-config-default-2bc54dbc156e03d3c34df40d5c4777d44b39ffe9":"2021-11-24T06:47:27.186Z","1.0.405":"2021-11-24T06:51:28.701Z","1.0.406-renovate-internal-patch-ba8dcce44db77926b853a50f3a67aa86edadaca1":"2021-11-24T06:56:44.920Z","1.0.406-renovate-typescript-4-x-00dee225963c4e94da9165feb88293e11cd9ad19":"2021-11-24T06:57:09.087Z","1.0.406":"2021-11-24T07:00:39.780Z","1.0.406-renovate-typescript-4-x-9f7d750fa92e8a231e2483deb29ddb71b69cc350":"2021-11-24T07:02:47.741Z","1.0.407-renovate-typescript-4-x-096fb533ab3b64e96bae04bb98726a9d20378716":"2021-11-24T07:04:38.997Z","1.0.407-renovate-internal-patch-18f26e249aba91f4f165f4cee4548395ad1bff12":"2021-11-24T09:26:57.464Z","1.0.407":"2021-11-24T09:31:24.757Z","1.0.408-renovate-typescript-4-x-0865ae754e69dd202118d895461ca5d4a737398e":"2021-11-24T09:35:11.953Z","1.0.408-renovate-internal-patch-4db8a0c7d5b85344838c2b563f05ddae8c3f2731":"2021-11-24T14:37:28.414Z","1.0.408":"2021-11-24T14:41:41.495Z","1.0.409-renovate-typescript-4-x-3f250697cac116d6e9464e59a358adb39149769a":"2021-11-24T14:43:57.748Z","1.0.409-joshbwlng-remove-jellycheck-62a0395af7044aca53e81a6abd1d7cafafc3157b":"2021-11-25T01:40:57.981Z","1.0.409":"2021-11-25T01:44:49.610Z","1.0.410-joshbwlng-update-repo-yml-7ba65193c194c87365256264ebbb98bdfd9b5d7e":"2021-11-25T04:14:21.960Z","1.0.410":"2021-11-25T04:17:28.506Z","1.0.411-renovate-internal-patch-7a4e5a59dee8a8c4c3a937cd31943864a877e34d":"2021-11-25T06:55:37.692Z","1.0.411":"2021-11-25T06:58:46.726Z","1.0.412-renovate-internal-patch-2941c49c1e13b38039b83ede3d897421fbec8e22":"2021-11-25T07:03:33.508Z","1.0.412":"2021-11-25T07:07:50.712Z","1.0.413-renovate-typescript-4-x-21cfeab8d59dc0763f079e0da7f753ddcacbd981":"2021-11-25T07:29:53.087Z","1.0.413":"2021-11-25T07:32:43.766Z","1.0.414-joshbwlng-use-renovate-config-d1837ad99a4e1465745bef1b6507885dabecd010":"2021-11-25T08:32:25.977Z","1.0.414":"2021-11-25T08:36:25.747Z","1.0.415-renovate-balena-jellyfish-config-2-x-b05c4a850b231ccb6ec8a08e8f3f7581128f482b":"2021-11-26T11:18:55.344Z","1.0.415-renovate-balena-lint-6-x-ba5374b670a97d163ee0f4967b4f0affe07cf1a0":"2021-11-26T16:32:09.429Z","1.0.415":"2021-11-26T16:36:11.619Z","1.0.415-renovate-internal-patch-c46f858ea5faf8e1d38cd3ed9163b3adb11a6ea1":"2021-11-26T16:38:14.677Z","1.0.415-renovate-balena-jellyfish-config-2-x-7adccb3f000017cecbdceac1256acac256c3933a":"2021-11-26T16:38:51.170Z","1.0.416-renovate-internal-patch-40759677364d18df5443dce751f07082223857b5":"2021-11-26T16:40:55.152Z","1.0.416-renovate-balena-jellyfish-config-2-x-d04990fedb7a076476c29ee448b5a937322b9737":"2021-11-26T16:41:45.177Z","1.0.416":"2021-11-26T16:44:35.070Z","1.0.417-renovate-balena-jellyfish-config-2-x-2c48a10d793b15c241dc64029a2ee812bd4769e9":"2021-11-26T16:46:29.677Z","1.0.417-renovate-internal-patch-d3bcbaf6c29758667b451c7af47061eb64a9c1c0":"2021-11-26T19:02:51.169Z","1.0.417":"2021-11-26T19:06:50.173Z","1.0.418-renovate-balena-jellyfish-config-2-x-74efcea01e0587da7d02ff61ac2f5a5b2d18865b":"2021-11-26T19:11:24.618Z","1.0.418-renovate-internal-patch-6cbd57cc30740bba0757e587c38d17189953fdff":"2021-11-27T02:25:53.206Z","1.0.418-renovate-balena-jellyfish-config-2-x-ad664e6fb44d4b56c216fcd6fdfe413d0fbf3070":"2021-11-27T02:27:30.267Z","1.0.418":"2021-11-27T02:29:08.220Z","1.0.419-renovate-balena-jellyfish-config-2-x-78364b062c41b63444fc73d1540b0bcf6d59fc3b":"2021-11-27T02:33:37.045Z","1.0.419-renovate-external-non-major-e2148f175287ca0c13402eb9de5d8b15dbc9f143":"2021-11-27T14:45:19.280Z","1.0.419":"2021-11-27T14:49:42.371Z","1.0.420-renovate-internal-patch-c12c0ae5dafebea6ca23744208163f3d8b08f2ae":"2021-11-27T14:54:04.916Z","1.0.420":"2021-11-27T15:00:20.813Z","1.0.421-renovate-internal-patch-e874c221d6534b0fd4e66239547abfd77415bb37":"2021-11-27T17:53:57.013Z","1.0.421":"2021-11-27T17:58:28.970Z","1.0.422-renovate-internal-patch-566882a2ce0e4932ea04bbfd9c959b463e18f8c6":"2021-11-29T13:46:46.252Z","1.0.422":"2021-11-29T13:49:56.098Z","1.0.423-renovate-balena-jellyfish-environment-5-x-2173ef0e2ce92d632f65c5974724744a06081d30":"2021-12-01T10:23:19.752Z","1.0.423":"2021-12-01T10:27:43.233Z","1.0.424-renovate-internal-patch-1d717dc42024fb9833062cf20793fd4a98ee73f4":"2021-12-01T10:30:38.566Z","1.0.424":"2021-12-01T10:36:43.011Z","1.0.425-renovate-external-non-major-df8066e29a7af5702d0c57a7791afb6d84e98cf5":"2021-12-04T00:24:13.172Z","1.0.425":"2021-12-04T00:28:25.211Z","1.0.426-renovate-internal-patch-23d4c0f8a85c967a007118f3df1bd5df6a4698ff":"2021-12-04T18:12:32.806Z","1.0.426":"2021-12-04T18:16:45.106Z","1.0.427-renovate-external-non-major-1be835e4da8f215ed3c37283a79bbcb4ce1acaee":"2021-12-05T10:01:32.233Z","1.0.427":"2021-12-05T10:05:30.427Z","1.0.427-renovate-internal-patch-b3f65897b38b1c29e0ef1c617a4540e8500a34c1":"2021-12-05T10:05:53.889Z","1.0.428-renovate-internal-patch-f8074cd73ca19b8edf937b9e1d03e764eb540f2f":"2021-12-05T10:09:22.720Z","1.0.428":"2021-12-05T10:16:48.501Z","1.0.429-renovate-internal-patch-5a79e22eb097bb506a208f43a2e568d6b41401df":"2021-12-05T12:38:48.039Z","1.0.429":"2021-12-05T12:42:43.229Z","1.0.430-renovate-internal-patch-80a00864caf9294f9efff85eee89ae51757790dc":"2021-12-05T23:03:49.096Z","1.0.430":"2021-12-05T23:06:40.543Z","1.0.431-renovate-balena-jellyfish-environment-6-x-7dd6b9e258816b18326d535eff7650a931a72102":"2021-12-09T00:52:55.768Z","1.0.431-renovate-typescript-4-x-a2bf2f333361682db8f91ccc79a9ca074e14d2af":"2021-12-09T23:17:06.039Z","1.0.431-renovate-balena-jellyfish-environment-6-x-74c2640fa4e9028e13208781df7cd5f4a49d8c8c":"2021-12-10T03:08:37.613Z","1.0.431":"2021-12-10T03:14:03.697Z","1.0.432-renovate-internal-patch-123865b93202b627320a7bf16fe7ffe21de38b8a":"2021-12-10T03:19:26.797Z","1.0.432":"2021-12-10T03:24:06.839Z","1.0.433-renovate-internal-patch-d3056dd386731cf43d32b6c0f07d861e51e65319":"2021-12-11T01:40:59.010Z","1.0.433-renovate-external-non-major-5edc5fed82d66ec1597af4ab7ea678d177b3d1cd":"2021-12-11T01:41:16.557Z","1.0.433":"2021-12-11T01:44:32.181Z","1.0.434-renovate-external-non-major-1cf0825a7f3d0c4fccb33ebdb313c07073658740":"2021-12-11T01:47:57.129Z","1.0.434":"2021-12-11T01:54:07.610Z","1.0.435-renovate-internal-patch-213dc62f11311b10fd0438d4798d07e7ddf54aae":"2021-12-11T09:26:30.100Z","1.0.435":"2021-12-11T09:30:10.922Z","1.0.436-joshbwlng-drop-depcheck-c1a26052a3bd6cf2cecbbb72e9e718f4f8d5d461":"2021-12-14T01:48:56.787Z","1.0.436":"2021-12-14T01:52:22.828Z","1.0.437-renovate-internal-patch-772cb6d5334149ef53110287eefc0991bb540733":"2021-12-14T09:23:45.963Z","1.0.437":"2021-12-14T09:28:32.405Z","1.0.438-renovate-internal-patch-6cc5b439eca6920b2770e9f998b7f9a3b9e121fd":"2021-12-14T09:31:00.218Z","1.0.438":"2021-12-14T09:37:04.498Z","1.0.439-renovate-balena-jellyfish-logger-3-x-88f2fa82525f148ded63b8ac0c95561b20d10fcc":"2021-12-16T19:43:22.483Z","1.0.439":"2021-12-16T19:46:58.563Z","1.0.440-renovate-balena-jellyfish-logger-4-x-7ae85de1baefad63daed6c9a71730ab437612ed8":"2021-12-17T17:00:08.840Z","1.0.440":"2021-12-17T23:05:03.553Z","1.0.441-renovate-external-non-major-6a9b41893f0e8e4f481f390940502558b9e6fc47":"2021-12-18T00:31:32.967Z","1.0.441":"2021-12-18T00:35:01.920Z","1.0.442-renovate-internal-patch-2b0f7e08bd8b0bcab8266eb40456b177577c06aa":"2021-12-18T07:42:02.332Z","1.0.442":"2021-12-18T07:44:56.841Z","1.0.443-renovate-internal-patch-7e156dd33bcad23d8b414a017a359d9d2bd6d744":"2021-12-18T08:45:23.970Z","1.0.443":"2021-12-18T08:48:30.952Z","1.0.444-renovate-external-non-major-ae5e44e76d0dac9d5c060de826456f4eff5e68c8":"2021-12-18T11:12:25.906Z","1.0.444":"2021-12-18T11:15:49.369Z","1.0.445-renovate-internal-patch-16ed2c858bd83251e27b3b20e3014d974304e269":"2021-12-18T11:19:09.053Z","1.0.445":"2021-12-18T11:26:39.575Z","1.0.446-renovate-internal-patch-ca967ebfe64452c843fcacbc3e30fc88d2a4de6a":"2021-12-18T13:50:51.026Z","1.0.446":"2021-12-18T13:55:19.765Z","2.0.0-joshbwlng-clean-types-edc235c1e853562774dc150f6e5d80eb903c077c":"2021-12-24T01:54:55.869Z","2.0.0":"2021-12-24T02:00:42.316Z","2.0.1-renovate-external-non-major-4a4a167a204685df4df5666821a49cbd9cd6dcb7":"2021-12-25T00:47:55.285Z","2.0.1":"2021-12-25T00:51:35.270Z","2.0.2-renovate-internal-patch-9f210c87718430d7420ade7bd02d8baa30b576e6":"2021-12-25T00:54:35.226Z","2.0.2":"2021-12-25T00:59:41.147Z","2.0.3-renovate-internal-patch-dfc5eade1ecdbf9c8f94f29e1b0610dfe6418856":"2021-12-25T02:58:38.358Z","2.0.3":"2021-12-25T03:04:40.322Z","2.0.4-renovate-internal-patch-8f0b67ac396d95e6b489cfc75ca1b12fe6ff5bb5":"2022-01-01T02:11:04.737Z","2.0.4-renovate-external-non-major-183a95a0108117374bc096117aeee58097043882":"2022-01-01T02:12:16.145Z","2.0.4":"2022-01-01T02:17:10.785Z","2.0.4-renovate-external-non-major-083343cf574ee4b4195fa363f04d6dc2855cb96b":"2022-01-01T02:20:07.283Z","2.0.5-renovate-external-non-major-2c3622c7ec399244b8a0c701fed244d742aac388":"2022-01-01T02:22:54.047Z","2.0.5":"2022-01-01T02:28:08.539Z","2.0.5-renovate-internal-patch-d5971caf30a506a39ae0c242f545fbd26e98b4de":"2022-01-01T02:28:51.753Z","2.0.6-renovate-internal-patch-0e64f385c445a4a1ff352f78d11b9dc16d2abdad":"2022-01-01T02:33:12.888Z","2.0.6":"2022-01-01T02:37:22.879Z","2.0.7-renovate-internal-patch-b240fca1bb99e999a845d9b9f52ef9aa319b2592":"2022-01-01T05:03:39.934Z","2.0.7":"2022-01-01T05:12:20.802Z","2.0.8-renovate-internal-patch-d47f574b55cfeebe145d200a2e6455f23c63c13f":"2022-01-02T22:18:41.226Z","2.0.8":"2022-01-02T22:22:24.860Z","2.0.9-renovate-external-non-major-1514841da0cb4de11392accd7e7e50f218a2239f":"2022-01-02T22:28:06.404Z","2.0.9":"2022-01-02T22:32:12.219Z","2.0.10-renovate-internal-patch-2f80e57e2beec442549bd50522dca3c60544bff0":"2022-01-03T00:41:19.373Z","2.0.10":"2022-01-03T00:44:34.288Z","2.0.11-joshbwlng-update-contract-type-14bc0363e150513c342c5465b435b5c5cbedcccc":"2022-01-03T07:01:15.493Z","2.0.11":"2022-01-03T07:04:53.401Z","2.0.12-joshbwlng-allow-null-2e8dfe0b0e3082995952e4bcf26acfe12c323e00":"2022-01-03T07:35:30.720Z","2.0.12":"2022-01-03T07:44:46.494Z","2.0.13-renovate-internal-patch-c8fa2be7d4cae7f705730adb28e9fa29c27a25e5":"2022-01-03T12:01:35.382Z","2.0.13":"2022-01-03T12:04:52.681Z","2.0.14-renovate-internal-patch-3f2929ac0140712465a603f438d6e79a7b062dc9":"2022-01-03T14:15:25.245Z","2.0.14":"2022-01-03T14:21:29.088Z","2.0.15-renovate-external-non-major-7e770b63f0dc722092ff352cd3d0238713259a89":"2022-01-08T01:42:34.690Z","2.0.15":"2022-01-08T01:47:35.274Z","2.0.16-renovate-internal-patch-075e427b7c85869b4b3ae4dcf7a6fd5135e41f60":"2022-01-08T01:50:56.734Z","2.0.16":"2022-01-08T01:55:34.109Z","2.0.17-renovate-internal-patch-f8b689a0f88dbfd570e186781647789c02997d52":"2022-01-08T04:38:35.188Z","2.0.17":"2022-01-08T04:42:00.833Z","2.0.18-renovate-internal-patch-c2519bb5d85c0a597c1af693a27be23e348a080e":"2022-01-08T11:32:03.340Z","2.0.18":"2022-01-08T11:35:04.976Z","2.0.19-renovate-internal-patch-a105380933f3a5bb0fb8a0a823a27c7dcc169e27":"2022-01-08T13:58:24.215Z","2.0.19":"2022-01-08T14:04:09.990Z","2.0.20-renovate-external-non-major-a446e4fb19a9c74699ffbdb9eece09fc79e18066":"2022-01-15T00:26:54.132Z","2.0.20":"2022-01-15T00:30:38.963Z","2.0.21-renovate-internal-patch-8404eb9d7b0952cc3ba073d294b2c4dac617d4c1":"2022-01-15T03:09:01.196Z","2.0.21":"2022-01-15T03:12:21.293Z","2.0.22-renovate-internal-patch-8a345a73f228be3d8f4cc51ea0e6367aae3d2bb9":"2022-01-16T14:27:45.045Z","2.0.22":"2022-01-16T14:32:07.495Z","2.0.23-renovate-typedoc-0-x-fc10f045e4e5d358d9f98ef3d5e610dab8a5a321":"2022-01-18T08:55:39.797Z","2.0.23":"2022-01-19T04:58:13.519Z","2.0.24-renovate-internal-non-major-eb65f843ce94428f3516f3f7cbc05dbf53c02b6e":"2022-01-19T11:44:04.134Z","2.0.24":"2022-01-19T11:48:32.976Z","2.0.25-renovate-internal-non-major-0f580e5a24a97033b15508eb23aab4fc593bc8aa":"2022-01-19T13:03:16.438Z","2.0.25":"2022-01-19T13:06:26.398Z","2.0.26-renovate-external-non-major-6bb3fd3678a56df57d07e9b4de45cb1691914008":"2022-01-22T00:07:19.069Z","2.0.26":"2022-01-22T00:10:30.624Z","2.0.27-renovate-internal-non-major-db687e9e638af21be01a0f4f2ba53ae449a0461e":"2022-01-22T01:51:05.351Z","2.0.27":"2022-01-22T01:54:43.120Z","2.0.28-renovate-internal-non-major-a6cd3722b65e0070fff5d78d5e07cfc81d70e203":"2022-01-22T05:25:45.673Z","2.0.28":"2022-01-22T05:29:31.424Z","2.0.29-renovate-external-non-major-08e3c755196811aa690090e470e9f4840fb22995":"2022-01-23T12:00:32.160Z","2.0.29":"2022-01-23T12:03:41.033Z","2.0.30-renovate-internal-non-major-b3f533a55c8422da9cfc2b04ba17ec51440df9f3":"2022-01-23T12:07:45.338Z","2.0.30":"2022-01-23T12:11:00.156Z","2.0.31-renovate-external-non-major-46610a05039e192fb7a1ff3f93f6919e0f2ee427":"2022-01-23T15:34:21.757Z","2.0.31":"2022-01-23T15:38:06.617Z","2.0.31-renovate-internal-non-major-43dafa81baab1fe5ba5b50046c9cbcef1f1ef1bc":"2022-01-23T15:40:11.582Z","2.0.32-renovate-internal-non-major-7db8462019203e7c04e53f90dc27e525fa7f3ba0":"2022-01-23T15:42:29.887Z","2.0.32":"2022-01-23T15:47:13.295Z","2.0.33-renovate-internal-non-major-494de0f2831adea9aae762a406b542ad99c68559":"2022-01-23T19:57:09.880Z","2.0.33":"2022-01-23T20:00:08.706Z","2.0.34-renovate-internal-non-major-a7f547c75d0dc626be8f8ecb8855b73e36ad08d4":"2022-01-24T14:24:38.151Z","2.0.34":"2022-01-24T14:28:34.735Z","2.0.35-renovate-internal-non-major-45c0c90cf3c0c72a9c3a97e3e96412b20f5d8127":"2022-01-24T16:45:08.071Z","2.0.35":"2022-01-24T16:48:19.117Z","2.0.36-renovate-external-non-major-5c97d9b0bb2698645fbfa2b6d0f81f0af5d1d9b8":"2022-01-29T02:14:50.434Z","2.0.36":"2022-01-29T02:18:54.671Z","2.0.37-renovate-internal-patch-d2a6671cf532f6e0ceb5e2f54042585815e8ddd0":"2022-01-29T05:01:32.654Z","2.0.37":"2022-01-29T05:05:49.575Z","2.0.38-LucianBuzzo-patch-1-8d8d75e8bd5e0a156baaff0f11fc67d496b8f385":"2022-02-25T15:01:22.786Z","2.0.38":"2022-02-25T15:11:01.807Z","2.0.39-renovate-balena-jellyfish-environment-9-x-50c8f284c186e4da4951825815a0e5c8ff9b2d13":"2022-02-25T15:14:53.187Z","2.0.39-renovate-typedoc-0-x-eb16a602b168e236ff372f3a2323ed48cd9551bf":"2022-02-25T15:15:07.879Z","2.0.39-renovate-balena-jellyfish-environment-6-x-1fc68690ef422d57939fbea2dc27d3be909eebb7":"2022-02-25T15:19:52.936Z","2.0.39":"2022-02-26T01:12:46.104Z","2.0.39-renovate-external-non-major-d650773a440c6451f1f605d5cc7f9f531577516d":"2022-02-26T01:12:58.249Z","2.0.40-renovate-external-non-major-17a7f13b8705aa09f3f10f655fe7b39378763e80":"2022-02-26T01:16:02.900Z","2.0.40":"2022-02-26T01:22:27.037Z","2.0.41-renovate-external-non-major-4747fccd9614c5f769f90f8b114f48d57cf44ce6":"2022-02-26T01:25:31.066Z","2.0.41":"2022-02-26T01:30:45.492Z","2.0.42-renovate-internal-patch-119eb510699ae6010b05cfe2962b370bab81b893":"2022-02-26T03:59:28.352Z","2.0.42":"2022-02-26T04:03:31.520Z","2.0.43-renovate-external-non-major-c36a282eac9ebb96f4e245f41b4c14065c399448":"2022-03-05T12:44:50.419Z","2.0.43-renovate-internal-patch-9cfbec424f8f6eb982168eda9850c3a0014d1ff8":"2022-03-05T16:49:57.283Z","2.0.43":"2022-03-05T16:53:24.820Z","2.0.44-renovate-external-non-major-4b6424c880f3ef671d98b1bdc8477725806f86db":"2022-03-05T16:56:42.821Z","2.0.44-joshbwlng-bump-lint-staged-bb70f7f923acbdc4c28351bb9e5db521ca33f17a":"2022-03-06T02:22:11.036Z","2.0.44":"2022-03-06T02:26:02.599Z","2.0.45-renovate-typescript-4-x-3d1098035c0b6e799d21649b9ba82633251f9362":"2022-03-06T02:29:13.195Z","2.0.45-renovate-typedoc-0-x-3b3ef126690e7a890f04ed8618f3659e512e9349":"2022-03-07T02:00:36.533Z","2.0.45":"2022-03-07T02:36:53.918Z","2.0.46-renovate-internal-patch-5670dd80249c24ea72291176dd008d7e9ce13c26":"2022-03-07T05:14:00.221Z","2.0.46":"2022-03-07T05:18:03.274Z","2.0.47-renovate-typescript-4-x-9a89ba43b879bca13a72c18bcad044859ca4b8fa":"2022-03-07T05:20:58.407Z","2.0.47":"2022-03-07T05:26:57.029Z","2.0.48-renovate-internal-patch-f3b208ba5c1885e48d0bd59c2a19588b804e48ec":"2022-03-17T04:20:28.434Z","2.0.48":"2022-03-17T04:23:35.408Z","2.0.49-renovate-internal-patch-d48337ffb2bd4ffa0cadf23a7e844831394da273":"2022-03-19T04:20:04.237Z","2.0.49":"2022-03-19T04:23:58.914Z","2.0.50-joshbwlng-update-repo-yml-31c6e222ce5d6cc9891c687f204f620be1ec33b0":"2022-03-22T04:23:57.346Z","2.0.50":"2022-03-22T04:28:18.612Z","2.0.51-renovate-internal-patch-73eb87db157578b33312066c717c67877bec0363":"2022-03-23T02:07:31.813Z","2.0.51":"2022-03-23T02:11:47.399Z","2.0.52-renovate-typescript-4-x-ea875b1877d6fcdd4e7f2c672c5b23c80c94c01c":"2022-03-24T23:54:36.407Z","2.0.52":"2022-03-25T23:06:53.633Z","2.0.53-renovate-external-non-major-a406bece323dbede2bd0ba50963f2b4fbc610fec":"2022-03-26T01:09:10.121Z","2.0.53":"2022-03-26T01:13:45.270Z","2.0.54-renovate-internal-patch-8bce10394299c4c1a46bc88f3ff31c30a937dcad":"2022-03-26T16:09:00.312Z","2.0.54":"2022-03-26T16:12:30.130Z","2.0.55-renovate-internal-patch-d51ce836de7614f70c9597745ca7d144e05cdc88":"2022-04-02T02:28:59.650Z","2.0.55":"2022-04-02T02:32:37.959Z","2.0.56-renovate-balena-node-metrics-gatherer-6-x-2342834459358648f5eb34355a1f57530dfe39ee":"2022-04-06T00:34:30.619Z","2.0.56-renovate-balena-node-metrics-gatherer-6-x-a015e149337559b0055294df2c111c1c04f200f2":"2022-04-06T13:31:42.569Z","2.0.56":"2022-04-06T23:41:26.610Z","2.0.57-renovate-typedoc-0-x-4fbcdfec0dd3242cf86cf0855289d96b59abd508":"2022-04-07T04:53:17.168Z","2.0.57":"2022-04-07T08:57:25.436Z","2.0.58-renovate-internal-patch-286d6526659fab52f98dbb82b48882efc69d4481":"2022-04-07T09:00:20.360Z","2.0.58":"2022-04-07T09:07:08.534Z","2.0.59-renovate-internal-patch-3a879ff17259854c775e200bad6e90bbc1321c72":"2022-04-07T14:15:23.496Z","2.0.59":"2022-04-07T14:19:48.235Z","2.0.60-renovate-typedoc-0-x-950e3f3e7bed472433feb40d2369a38068f23b29":"2022-04-11T14:52:10.179Z","2.0.60-random-port-fix-744da15b0cb69ff21b739c6c58d58b274029854b":"2022-04-11T15:21:27.812Z","2.0.60":"2022-04-12T00:05:46.859Z","2.0.61-renovate-typedoc-0-x-231b965916f8f94c0f686b306cf9d4684c62cec4":"2022-04-12T00:10:03.089Z","2.0.61":"2022-04-12T00:15:36.263Z","2.0.62-renovate-internal-patch-940d9b4ba35045e870b977f8c389cf95786c4f9b":"2022-04-12T05:29:38.730Z","2.0.62":"2022-04-12T05:33:26.119Z","2.0.63-renovate-internal-patch-64c2ef66ee83d881a47fb5daa4b44ada2b9d53ba":"2022-04-12T11:39:53.496Z","2.0.63":"2022-04-12T11:44:21.236Z","2.0.64-repo-sync-jellyfish-config-default-60e69c91b70d3a4561d188aaae7dbd03f6a0713b":"2022-04-15T02:21:06.690Z","2.0.64":"2022-04-15T02:28:41.712Z","2.0.65-renovate-internal-patch-fc6a04412c9863ea0b33b05960aa7eaac701077d":"2022-04-15T14:41:10.304Z","2.0.65":"2022-04-15T14:45:19.501Z","2.0.66-renovate-balena-jellyfish-environment-10-x-c24b6cf0b360d5244934153df21c132cc547e98e":"2022-04-16T06:05:47.590Z","2.0.66-renovate-external-non-major-6ece914a59061519032923fa4f5d897b28134099":"2022-04-16T06:06:03.743Z","2.0.66":"2022-04-16T06:11:03.972Z","2.0.67-renovate-balena-jellyfish-environment-10-x-b4f0843cfac6cbf2636298fc44ab6588373fbc8d":"2022-04-16T06:16:10.188Z","2.0.67":"2022-04-16T09:40:01.559Z","2.0.68-renovate-internal-patch-46b4cb50a8fd9075c901e9c3c6ee82474bd32879":"2022-04-21T05:22:00.295Z","2.0.68":"2022-04-21T05:25:45.405Z","2.0.69-renovate-internal-patch-4d18bcaad437dbc438bcce75786db3c7038fcffd":"2022-04-23T03:46:46.315Z","2.0.69":"2022-04-23T03:50:12.419Z","2.0.70-renovate-balena-jellyfish-environment-11-x-89eee6e538a42706eb199c5c34041eee4de6429e":"2022-04-27T11:19:05.908Z","2.0.70":"2022-04-27T14:26:56.338Z","2.0.71-renovate-typescript-4-x-abfcaa27447cb76002ebdb4df1070a2a3bb90906":"2022-04-28T22:22:25.195Z","2.0.71-renovate-external-non-major-ee29168fc95788ce5188bed68de0fbc1921db139":"2022-04-30T00:29:07.475Z","2.0.71-renovate-major-external-major-e9e1d9c395a1b0a8d43c50da90c14ecc3b1c35a3":"2022-04-30T00:29:32.666Z","2.0.71":"2022-04-30T00:33:04.524Z","2.0.72-renovate-major-external-major-7863f34657ded335ad571020649414f07d3e24b6":"2022-04-30T00:35:23.704Z","2.0.72-renovate-internal-patch-3693d3ea0e2f50f5b8a4c74804a75776951f63ff":"2022-04-30T12:02:29.135Z","2.0.72":"2022-04-30T12:05:48.276Z","2.0.73-renovate-major-external-major-cb00e375a5d3d46e85dfc78076497a36f43861f9":"2022-04-30T12:09:14.979Z","2.0.73-renovate-major-external-major-3a9cc83d9bbe6189fb9a8d2b8e79bd8a75077aa0":"2022-05-03T13:17:09.644Z","2.0.73-renovate-major-external-major-3e046b9dfb7d3745bda96505a344363611bc5d17":"2022-05-03T22:36:53.689Z","2.0.73":"2022-05-04T00:44:00.053Z","2.0.74-renovate-internal-patch-cc5ff44645afd40e56b696ce06f1eb1ce9fde605":"2022-05-04T02:55:29.494Z","2.0.74":"2022-05-04T02:59:57.261Z","2.0.75-renovate-external-non-major-0f4c2cc1bac08cc09fa1f5798a5549cbb29df25f":"2022-05-07T01:41:53.312Z","2.0.75":"2022-05-07T01:46:00.304Z","2.0.75-renovate-internal-patch-ebca8e8fc7e9911cfee87ddef783e4f3a411b266":"2022-05-07T01:48:04.237Z","2.0.76-renovate-internal-patch-00bdff3c88afb3ba8c2bd262a483c2c9f7633591":"2022-05-07T01:51:01.246Z","2.0.76":"2022-05-07T01:54:25.626Z","2.0.77-renovate-balena-jellyfish-environment-12-x-67f8ee2de72e79efd4a78a32ade721645e427910":"2022-05-12T16:36:15.566Z","2.0.77":"2022-05-13T00:36:07.213Z","2.0.78-renovate-external-non-major-d1e1465398afae4b39403b6f93397ec7831d1324":"2022-05-14T02:49:15.257Z","2.0.78":"2022-05-14T02:54:07.829Z","2.0.78-renovate-internal-patch-d5df490777cd341cf7171b9e74eff2ed1bfb3f78":"2022-05-14T02:55:12.545Z","2.0.79-renovate-internal-patch-885888ad8a82811e164c680a0efc0e4c28ec9cf0":"2022-05-14T03:00:14.694Z","2.0.79":"2022-05-14T03:04:59.556Z","2.0.80-renovate-typescript-4-x-78d0047f44e6cd507d806ee621f51f4a71a94823":"2022-05-24T18:59:59.370Z","2.0.80-renovate-external-non-major-6346d5bec0d838176c0dbca344e96ceb47156e94":"2022-05-28T00:20:54.355Z","2.0.80":"2022-05-28T00:24:09.310Z","2.0.81-renovate-typescript-4-x-69d8532891e3aad5804857c127b9063651ce6a4b":"2022-05-28T00:27:15.922Z","2.0.81-renovate-internal-patch-9dd645a965cdfbef543926a26430a354ed3f3476":"2022-05-28T03:08:00.355Z","2.0.81":"2022-05-28T03:11:06.792Z","2.0.82-renovate-typescript-4-x-5c9f2aa428dde92b23cb0ab1e9b084a450753d63":"2022-05-28T03:14:06.540Z","2.0.82-renovate-typedoc-0-x-71b782e62cf8b72fc9bf7181ad6f688d09423175":"2022-05-30T18:08:39.269Z","2.0.82":"2022-05-31T01:36:23.329Z","2.0.83-renovate-typescript-4-x-10beadd9bf310f7b48d3274a6d988e10e543cdd7":"2022-05-31T01:43:16.036Z","2.0.83":"2022-05-31T10:28:21.250Z","2.0.84-renovate-balena-jellyfish-logger-5-x-4906fe5cde76a697289486f57b6105dbeab0cd8d":"2022-05-31T21:50:01.083Z","2.0.84-renovate-typedoc-0-x-e80dd5cd76a9a211eda15fc0df7e6a81668690f1":"2022-06-01T05:30:49.406Z","2.0.84-renovate-typescript-4-x-3ab8ba0cb4eeffe5363b79f70c503d687be09da3":"2022-06-03T19:58:47.043Z","2.0.84":"2022-06-05T01:48:01.177Z","2.0.85-renovate-major-external-major-439646279c6c077ba110a9d955f4ff6af45e0cb8":"2022-06-06T04:46:43.485Z","2.0.85":"2022-06-06T04:50:04.154Z","2.0.86-joshbwlng-add-unknown-logs-4c76a3ad78980e25d563f3acfb2bac1e6f0d859f":"2022-06-09T09:18:13.658Z","2.0.86":"2022-06-09T09:28:40.566Z","2.0.87-joshbwlng-drop-debug-logs-06ab6dfc91e24bb167ea6eddff99c1d052b78150":"2022-06-10T04:52:36.541Z","2.0.87":"2022-06-10T04:56:57.822Z","2.0.88-renovate-typescript-4-x-5aca333de0d7b106526aee50e5b13e36a1c87b9d":"2022-06-17T20:31:39.674Z","2.0.88":"2022-06-17T23:57:55.589Z","2.0.89-joshbwlng-drop-jellyfish-config-39f278de88aa39847e28834f18a263d8042b671f":"2022-06-19T09:04:45.341Z","2.0.89":"2022-06-19T09:09:00.546Z","2.0.90-joshbwlng-bump-deps-c5b876b932b984bf91b3945d5338762d2bc67311":"2022-06-20T00:19:36.924Z","2.0.90":"2022-06-20T00:23:27.083Z","2.0.91-renovate-typedoc-0-x-7b58fc0394cbf4d9c777faf9b2274096e4d2484d":"2022-06-25T03:44:35.597Z","2.0.91-renovate-external-zero-minor-bcbb412eeddd2b33eed1adcf94f81f748641af01":"2022-06-26T21:30:16.124Z","2.0.91-renovate-external-zero-minor-a0546f19f2747d417a160c8e0496e41a82291474":"2022-06-26T23:26:11.625Z","2.0.91":"2022-06-26T23:32:17.871Z","2.0.92-renovate-internal-patch-91e6514c336764e7c1ad3a09dd55f7a08190af9e":"2022-06-27T06:07:00.431Z","2.0.92":"2022-06-27T06:10:29.855Z","2.0.93-renovate-typedoc-0-x-c7df4d0e5ab30e30183aa1331117e3dcb0840733":"2022-06-28T01:00:06.903Z","2.0.93":"2022-06-28T04:22:33.356Z","2.0.94-renovate-balena-jellyfish-environment-12-x-892ec49d04270fbb7b8e729dd23a848652d7d774":"2022-06-29T05:20:15.202Z","2.0.94":"2022-06-29T11:36:49.129Z","2.0.95-renovate-typedoc-0-x-d7f8d036105dd2109e47d3527fd496510f10fc6b":"2022-07-01T21:08:50.044Z","2.0.95-renovate-typedoc-0-x-5cbdb71fa2baa9b3c06e100d4d5cc20cc420902d":"2022-07-02T04:01:34.063Z","2.0.95-renovate-typedoc-0-x-6017a9e106eb74813216d1cd21521a0d8311da27":"2022-07-02T19:50:14.462Z","2.0.95":"2022-07-07T03:52:00.781Z","2.0.96-joshbwlng-drop-jellyfish-types-8990954b0953d82cb15f5bd9f6bf4eed2be3bca7":"2022-07-07T04:19:36.845Z","2.0.96":"2022-07-07T04:23:27.232Z","2.0.97-renovate-typedoc-0-x-e83617a72683b5d014b36dc02357a2929a86344a":"2022-07-08T01:20:39.278Z","2.0.97":"2022-07-08T01:23:50.966Z","2.0.98-renovate-balena-jellyfish-environment-12-x-20f23433b9aa8fe455c69e4a4ef6b7e8bfb97de6":"2022-07-08T10:44:36.075Z","2.0.98":"2022-07-09T01:54:50.027Z","2.0.99-renovate-typedoc-0-x-24709bdcf3ba833bc042766517ffa272a645c0bd":"2022-07-09T23:31:02.459Z","2.0.99":"2022-07-09T23:36:06.165Z","2.0.100-renovate-typedoc-0-x-6c023a1bc6dd039e93fdfeef7161ab134fc3aa40":"2022-07-18T01:07:48.424Z","2.0.100":"2022-07-18T01:11:50.690Z","2.0.101-renovate-balena-jellyfish-environment-12-x-061eaf824fdd9f5c0d099bc3474ebaa6734b5160":"2022-07-21T02:36:26.820Z","2.0.101":"2022-07-22T00:51:01.852Z","2.0.102-renovate-typedoc-0-x-70360123465c46d5ffc0e5174efaac32d195f72a":"2022-07-24T21:57:51.790Z","2.0.102":"2022-07-24T22:01:46.983Z","2.0.103-renovate-balena-jellyfish-environment-12-x-b05b0aca2386432ffe821ff37967f1a42ada87f3":"2022-07-31T10:26:33.892Z","2.0.103-renovate-balena-jellyfish-logger-5-x-f58470c4d66ecdca9dda06e3d899ef0d60c4c818":"2022-07-31T10:26:54.356Z","2.0.103":"2022-07-31T10:30:43.643Z","2.0.103-renovate-balena-jellyfish-logger-5-x-d217eae3567163747ec88bae562d0570799660a4":"2022-07-31T10:32:41.130Z","2.0.104-renovate-balena-jellyfish-logger-5-x-296b587c221786231fa58471c04c4069cde6539f":"2022-07-31T10:35:38.745Z","2.0.104":"2022-07-31T10:41:01.110Z","2.0.105-renovate-balena-jellyfish-environment-12-x-6143e578d621ce976ac6cc081f2bf6c575377b58":"2022-07-31T13:17:52.042Z","2.0.105-renovate-balena-jellyfish-environment-12-x-ff49578ee3c3f14c27331dfb769a0d4f37f78514":"2022-07-31T14:01:14.217Z","2.0.105":"2022-07-31T16:13:23.602Z","2.0.106-renovate-balena-jellyfish-logger-5-x-60567bd70a8358fcc106587178eeaa44c8eef084":"2022-07-31T16:16:36.754Z","2.0.106":"2022-07-31T16:20:28.474Z","2.0.107-renovate-node-16-x-9deefea881cd9c70d201ee13c31a4d519965f106":"2022-07-31T16:23:37.407Z","2.0.107":"2022-07-31T16:29:31.606Z","2.0.108-renovate-balena-jellyfish-environment-12-x-a4c4827a9bb0d4718d1a87c2e75f548ab61eb98b":"2022-07-31T18:53:35.032Z","2.0.108":"2022-07-31T20:46:00.968Z","2.0.109-renovate-jest-monorepo-afc51e998dd6033fa2fdc11dfb87eb8502c4f12d":"2022-07-31T20:48:35.403Z","2.0.109":"2022-07-31T20:53:29.128Z","2.0.110-renovate-lint-staged-13-x-56f7b147b3dc3d81f703b38a5b9849c053b18071":"2022-07-31T20:56:39.019Z","2.0.110":"2022-07-31T21:00:52.762Z","2.0.111-renovate-ts-jest-28-x-cf022c72e3f48c2581ef85c96d21b01e3781afce":"2022-07-31T22:38:54.429Z","2.0.111":"2022-07-31T22:43:22.829Z","2.0.112-renovate-balena-jellyfish-logger-5-x-d344680c75dcf3a27829a629d957eca75ee64c86":"2022-07-31T22:48:50.604Z","2.0.112":"2022-07-31T22:52:27.794Z","2.0.113-renovate-balena-jellyfish-logger-5-x-c605359a45622d5e604e1cf5764d65dac27bc054":"2022-08-01T01:00:14.200Z","2.0.113":"2022-08-01T01:22:21.615Z","2.0.114-renovate-typedoc-0-x-57c12e15014e1b8ede089437929db7a957816ce7":"2022-08-01T01:26:31.772Z","2.0.114":"2022-08-01T01:42:51.728Z","2.0.115-renovate-balena-jellyfish-logger-5-x-a5d0ee1f0eeced4447fdd74baa759f5317e5e4e2":"2022-08-01T01:46:10.691Z","2.0.115":"2022-08-01T01:56:08.685Z","2.0.116-renovate-balena-jellyfish-logger-5-x-78b3a3943d561ab8304b36dc6dfaac52ee8b32d7":"2022-08-08T06:37:21.072Z","2.0.116":"2022-08-08T06:40:36.669Z","2.0.117-renovate-node-16-x-034b4c9d7468c1fb79c74dc76fa871951e60ebc4":"2022-08-13T00:28:54.198Z","2.0.117":"2022-08-13T00:32:03.057Z","2.0.118-renovate-balena-jellyfish-environment-12-x-abc00aac57e1062edd30e70f7094ebdfa02d7063":"2022-08-13T03:55:53.379Z","2.0.118":"2022-08-13T04:00:19.983Z","2.0.119-renovate-balena-jellyfish-logger-5-x-6326d9e74ea48d9cecc2b6cd4ab979eecdeec1d7":"2022-08-13T04:07:35.344Z","2.0.119":"2022-08-13T04:13:39.725Z","2.0.120-renovate-balena-jellyfish-logger-5-x-263c78c50c5ca64526aa853882fbdd530c90f6e6":"2022-08-13T08:51:58.399Z","2.0.120":"2022-08-13T08:55:07.504Z","2.0.121-joshbwlng-update-gitignore-48815a5ef7281b0e6aa711998f44edd23b408b7a":"2022-08-16T05:59:17.769Z","2.0.121":"2022-08-16T06:03:55.003Z","2.0.122-renovate-balena-jellyfish-environment-13-x-f9313bdb472ce9f12d0557cfb8b79cfc9b70d4b8":"2022-08-17T03:12:40.146Z","2.0.122":"2022-08-17T03:16:38.091Z","2.0.123-renovate-balena-jellyfish-logger-5-x-bc953898767cdfab6174133392f9dd3066e4a26c":"2022-08-17T12:51:59.993Z","2.0.123":"2022-08-17T12:55:22.441Z","2.0.124-renovate-balena-jellyfish-environment-13-x-1cda68c610100911c6df98e5fb8b7466e2e61929":"2022-08-20T01:55:20.669Z","2.0.124-renovate-balena-jellyfish-environment-13-x-47fcbe128f184fb613da37b03a97342484865d08":"2022-08-20T01:58:34.401Z","2.0.124":"2022-08-20T02:01:44.752Z","2.0.125-renovate-jest-monorepo-779ac8479c36fbbdacaed5cdcbe9f70846080196":"2022-08-20T02:05:07.030Z","2.0.125":"2022-08-20T02:10:03.210Z","2.0.125-renovate-node-16-x-0a36feed32da7830e861ef1b1a585a75f72ddfc5":"2022-08-20T02:12:09.350Z","2.0.126-renovate-node-16-x-38df798aedfec74564848202976047378814ee1f":"2022-08-20T02:15:20.383Z","2.0.126":"2022-08-20T02:18:51.514Z","2.0.127-renovate-balena-jellyfish-logger-5-x-e2bec06ed92769ed64a21318267181cabb6cc5ae":"2022-08-20T02:22:43.552Z","2.0.127-renovate-balena-jellyfish-environment-13-x-365876d678a2ddf8ffdf86fcafcd9f40131f57e3":"2022-08-20T05:16:29.642Z","2.0.127":"2022-08-20T05:19:33.616Z","2.0.128-renovate-balena-jellyfish-logger-5-x-0b7e9e398e9230916dbb3a5f02c186dfdd00c7b9":"2022-08-20T05:22:25.284Z","2.0.128":"2022-08-20T05:27:52.489Z","2.0.129-renovate-ts-jest-28-x-9354582b3f27a704a775ca39879b4895d08f718f":"2022-08-20T09:40:30.872Z","2.0.129":"2022-08-20T09:45:02.296Z","2.0.130-renovate-balena-jellyfish-logger-5-x-9e823ea3269e87faa68eb9cfb9b53f983f2c2d84":"2022-08-20T12:12:33.821Z","2.0.130":"2022-08-20T12:17:02.525Z","2.0.131-renovate-node-16-x-ce2433e7b15fde82d5f88942b470e15c983b3099":"2022-08-21T21:54:54.831Z","2.0.131":"2022-08-21T21:58:15.032Z","2.0.132-renovate-balena-jellyfish-environment-13-x-d0a36e441c5f429c43050748dcb5744f0ccd3c9a":"2022-08-28T04:00:03.477Z","2.0.132":"2022-08-28T04:05:54.506Z","2.0.132-renovate-balena-jellyfish-logger-5-x-2118aa3eca86536eb001db0a6bfcada2fcebe640":"2022-08-28T04:07:02.548Z","2.0.133-renovate-balena-jellyfish-logger-5-x-ce94911269ca5b75e9a8d794824598e7ba5340b4":"2022-08-28T04:10:28.878Z","2.0.133":"2022-08-28T04:14:56.229Z","2.0.133-renovate-jest-monorepo-05889ac51fc21caf70e6330adc07be6bdb62484f":"2022-08-28T04:16:20.590Z","2.0.134-renovate-jest-monorepo-060fa438bbe3eabed7dbf1a055392051603ddb83":"2022-08-28T04:19:38.963Z","2.0.134":"2022-08-28T04:23:22.449Z","2.0.135-renovate-balena-jellyfish-environment-13-x-467e2b1cd6943a3a7061bd34f125f3bd8a3c2328":"2022-08-28T09:56:46.720Z","2.0.135":"2022-08-28T10:00:30.811Z","2.0.136-renovate-balena-jellyfish-logger-5-x-3138f9456299a14835a951b251354030fb7cd5e1":"2022-08-28T10:03:33.278Z","2.0.136":"2022-08-28T10:08:58.722Z","2.0.136-renovate-node-16-x-4ef384063316a68b113e535cc5108972fe0fc605":"2022-08-28T10:11:16.701Z","2.0.137-renovate-node-16-x-22733215de9cb99330b593a72e986e48de3d579b":"2022-08-28T10:12:49.658Z","2.0.137":"2022-08-28T10:16:15.425Z","2.0.138-renovate-typedoc-0-x-4311261246de0791c53626268c6c71d8928170e8":"2022-08-28T10:18:50.158Z","2.0.138":"2022-08-28T10:23:18.840Z","2.0.139-renovate-balena-jellyfish-logger-5-x-8d4a099ddcd3b80a62a0e9beb083d04b29c4cad8":"2022-08-28T13:10:50.649Z","2.0.139":"2022-08-28T13:14:13.818Z","2.0.140-renovate-typescript-4-x-d36b31f7e70fdcbd7ccfb2eb3614ebbfa37a30ed":"2022-08-28T13:17:36.069Z","2.0.140":"2022-08-28T13:21:28.402Z","2.0.141-renovate-major-external-major-3fb0697d75095d025efe79e43d31f3924b87a1f0":"2022-08-28T16:58:10.319Z","2.0.141-renovate-major-external-major-c783e8192199d975509beb6d8252eee8d224902f":"2022-08-30T01:14:00.836Z","2.0.141-renovate-major-external-major-6b46013467e5cb0246d4f0377a1be8aa419bfec9":"2022-09-03T13:08:22.300Z","2.0.141-renovate-major-external-major-0a01649c0a81a161f3c53479d4e27acd04d6b20c":"2022-09-09T11:39:17.090Z","2.0.141":"2022-09-09T11:42:51.808Z","2.0.142-renovate-balena-jellyfish-environment-13-x-88a1bbb14d49f757eaea9dc8ca8baa174d46c64a":"2022-09-09T11:45:22.247Z","2.0.142":"2022-09-09T11:49:58.653Z","2.0.143-renovate-typedoc-0-x-94aece81e4f3722bda8630f7ab20f6bd9633ea1c":"2022-09-09T11:53:00.251Z","2.0.143":"2022-09-09T11:57:08.880Z","2.0.144-renovate-node-16-x-7324ca821bf46ed47c0d7f86f883d94a5a49f650":"2022-09-10T00:23:00.858Z","2.0.144":"2022-09-10T00:27:30.378Z","2.0.144-renovate-balena-jellyfish-environment-13-x-948b74511cf4088251eb32ea43580ea0be7d2314":"2022-09-10T00:28:53.999Z","2.0.145-renovate-balena-jellyfish-environment-13-x-c55ceb6d4a567935ed71bff367548c9c491ac48f":"2022-09-10T00:31:10.996Z","2.0.145":"2022-09-10T00:34:33.813Z","2.0.146-joshbwlng-update-typescript-d38680a9029e7243179f05f337f9cc4543fc0b1a":"2022-09-10T02:27:44.734Z","2.0.146":"2022-09-10T02:33:16.184Z","2.0.146-renovate-balena-jellyfish-logger-5-x-ab50590ff261f6679f267773beddd24d65106e5a":"2022-09-10T02:36:17.431Z","2.0.147-renovate-balena-jellyfish-logger-5-x-8b12fbff6120b1b8b7d93d0f83f146a257ae6393":"2022-09-10T02:39:45.175Z","2.0.147":"2022-09-10T02:43:55.013Z","2.0.148-renovate-balena-jellyfish-logger-5-x-241d922794861d4c95ca34f37a0dc3870d682a40":"2022-09-10T02:48:26.484Z","2.0.148":"2022-09-10T02:52:46.004Z","2.0.149-renovate-balena-jellyfish-logger-5-x-29565d96594417a58490b8e7dcacc03020b99488":"2022-09-10T06:02:06.467Z","2.0.149":"2022-09-10T06:05:14.205Z","2.0.150-renovate-balena-jellyfish-logger-5-x-1089fe0a6a3b96ac5d0429f531625ffac2d34049":"2022-09-10T11:10:44.275Z","2.0.150":"2022-09-10T11:13:45.727Z","2.0.151-renovate-balena-jellyfish-environment-13-x-644def3e7071863bbf0702d4a2639dd3950ba169":"2022-09-10T18:02:52.795Z","2.0.151":"2022-09-10T18:05:46.295Z","2.0.152-renovate-jest-monorepo-3db844ee2a9e7ec10473069ad2710f968f72fd34":"2022-09-10T18:09:05.637Z","2.0.152":"2022-09-10T18:13:39.949Z","2.0.153-renovate-balena-jellyfish-logger-5-x-e894138f334546228cd2ace1291e4d17c5f2a842":"2022-09-11T02:05:04.640Z","2.0.153":"2022-09-11T02:08:49.039Z","2.0.154-renovate-balena-jellyfish-logger-5-x-90be5d9d547afd6a2b43414200607f3a74ad340e":"2022-09-11T04:08:41.903Z","2.0.154":"2022-09-11T04:12:19.836Z","2.0.155-renovate-jest-monorepo-57b329f82c27bdea9c73407956e5c342f2011ee1":"2022-09-11T23:10:20.057Z","2.0.155":"2022-09-11T23:14:24.514Z","2.0.156-renovate-balena-jellyfish-environment-13-x-3ff926f097975b33708e274e5e012bf162876cb2":"2022-09-11T23:18:28.115Z","2.0.156":"2022-09-11T23:22:40.692Z","2.0.157-renovate-balena-jellyfish-logger-5-x-a963f98b7af8df65d9949aa71f5c4efa974680c6":"2022-09-11T23:24:30.649Z","2.0.157":"2022-09-11T23:30:56.657Z","2.0.158-renovate-balena-jellyfish-environment-14-x-a59ece5024f35900c27816f82e6b9790dea3e206":"2022-09-12T03:07:41.168Z","2.0.158":"2022-09-12T06:19:03.328Z","2.0.159-renovate-balena-jellyfish-logger-5-x-18ad0da531e41938473fac3b4e9d16b5f926fb5b":"2022-09-12T13:25:31.648Z","2.0.159":"2022-09-12T13:29:41.213Z","2.0.160-joshbwlng-flowzone-8563f48441c719bcbf6f574fd7f5b469a16e2c84":"2022-09-13T02:59:20.722Z","2.0.160":"2022-09-13T03:03:06.604Z","2.0.161-renovate-balena-jellyfish-environment-14-x-f2d9eeefca8d41677a3f0091a9f8dacc95e7c780":"2022-09-13T15:03:04.535Z","2.0.161":"2022-09-13T15:05:50.400Z","2.0.162-renovate-balena-jellyfish-logger-5-x-a95dfc14a9cae9e26a6832d9aa1575fbb8d67897":"2022-09-13T15:09:00.513Z","2.0.162":"2022-09-13T15:11:45.234Z","2.0.163-renovate-balena-jellyfish-logger-5-x-7f1bda7f33f5abb927bdf87abaca4b6c244cae1c":"2022-09-13T19:46:01.353Z","2.0.164-renovate-balena-jellyfish-logger-5-x-00a6d9d7338fd4cd46585c02b8cb9dba166ce91a":"2022-09-17T00:58:15.007Z","2.0.164":"2022-09-17T01:00:15.648Z","2.0.165-renovate-express-4-x-2fcb48a0dc8d4c8e6d9ea9fc683d7d27d2e46df8":"2022-09-17T01:03:03.496Z","2.0.165":"2022-09-17T01:05:14.857Z","2.0.166-renovate-jest-monorepo-a972104c5357417b17ad81dd54b6bbaeca06511e":"2022-09-17T01:07:53.564Z","2.0.166":"2022-09-17T01:10:09.114Z","2.0.167-renovate-node-16-x-b41942a0f57d90c4e22bcb886d676c3ae1f5c6e0":"2022-09-17T01:15:09.470Z","2.0.167":"2022-09-17T01:17:41.398Z","2.0.168-renovate-balena-jellyfish-environment-14-x-b194e72ad8ddf47b3a5ef788d73a480813072e96":"2022-09-17T04:12:03.617Z","2.0.168":"2022-09-17T04:14:32.972Z","2.0.169-renovate-balena-jellyfish-logger-5-x-083c7e6e5f76fe51df742bbc36a23f2f0bf858c2":"2022-09-17T04:17:57.575Z","2.0.169":"2022-09-17T04:20:17.812Z","2.0.170-renovate-balena-jellyfish-logger-5-x-0df345ec9a44e6b933f4d0204c062d17a4a6496f":"2022-09-17T10:16:21.596Z","2.0.170":"2022-09-17T10:18:41.279Z","2.0.171-renovate-ts-jest-29-x-a1c7a0e2d21a4577a96c03bf610f6a7db3ee1c9b":"2022-09-17T10:21:43.370Z","2.0.171":"2022-09-17T10:24:03.308Z","2.0.172-renovate-typedoc-0-x-e90a8c047444912b3d07eb0d0ab5d738cdc8bc7c":"2022-09-18T19:49:05.827Z","2.0.172":"2022-09-18T19:51:07.114Z","2.0.173-renovate-balena-jellyfish-environment-14-x-cf0855d234b66a5302ebe91d6c0564a4bb14ce19":"2022-09-18T22:31:39.037Z","2.0.173":"2022-09-18T22:33:45.163Z","2.0.174-renovate-balena-jellyfish-logger-5-x-098c9920ab803ac9da6739926f7183d4f24178ad":"2022-09-18T22:36:38.561Z","2.0.174":"2022-09-18T22:38:53.708Z","2.0.175-renovate-balena-jellyfish-logger-5-x-28a8af0f07f086ec42e7adb7cc41a5b6ab78a02d":"2022-09-19T01:39:42.312Z","2.0.175":"2022-09-19T01:42:33.048Z","2.0.176-joshbwlng-nvmrc-7b4361611571696657459bbabc79a21717f57f3f":"2022-09-19T04:17:46.008Z","2.0.176":"2022-09-19T04:20:21.701Z","2.0.177-renovate-balena-jellyfish-environment-14-x-688c7057ede51fde6c48bd31e3ae3c4bf641d326":"2022-09-19T04:22:51.408Z","2.0.177":"2022-09-19T04:25:15.596Z","2.0.178-renovate-balena-jellyfish-logger-5-x-56c0e73e9e429ae5ff5e08c2546fdcd81c4a9103":"2022-09-19T04:27:37.277Z","2.0.178":"2022-09-19T04:29:40.181Z","2.0.179-joshbwlng-codeql-c04451d4b28eae9f1632b0d81bba89ce81923b09":"2022-09-19T07:05:54.699Z","2.0.179":"2022-09-19T07:08:39.389Z","2.0.180-renovate-balena-jellyfish-environment-14-x-f1eaddf3db958a0807da1ea94de2eb152050bd3e":"2022-09-19T07:11:20.419Z","2.0.180":"2022-09-19T07:13:30.041Z","2.0.181-renovate-balena-jellyfish-logger-5-x-d8f67ff6760f30dddbeb5cfab383bb90fc61d263":"2022-09-19T07:16:40.319Z","2.0.181":"2022-09-19T07:19:25.944Z","2.0.182-joshbwlng-move-codeql-ad8d820b64100a685fde9a0d7b25177abfd822dd":"2022-09-19T08:12:52.387Z","2.0.182":"2022-09-19T08:15:15.508Z","2.0.183-renovate-balena-jellyfish-environment-14-x-616a9c200335012c8e25a42ccb1084e9565f87e5":"2022-09-19T08:18:32.508Z","2.0.183":"2022-09-19T08:21:00.644Z","2.0.184-renovate-balena-jellyfish-logger-5-x-ae6f2b32bd4cba34fa62c21aceccafb4cab1c19e":"2022-09-19T08:23:54.818Z","2.0.184":"2022-09-19T08:26:15.141Z","2.0.185-renovate-balena-jellyfish-environment-14-x-72a1cc74c1e6375fbd2f92a0e6c6ede9225d06c8":"2022-09-19T13:02:00.386Z","2.0.185":"2022-09-19T13:04:22.532Z","2.0.186-renovate-balena-jellyfish-logger-5-x-5e97427e103ac719ac6925531ccd78d53976a70e":"2022-09-19T13:07:20.204Z","2.0.186":"2022-09-19T13:09:41.681Z","2.0.187-renovate-balena-jellyfish-environment-14-x-1eedabf61714558da19389452e8d6cd1663cc2b7":"2022-09-23T09:57:32.931Z","2.0.187":"2022-09-23T09:59:50.896Z","2.0.188-renovate-balena-jellyfish-logger-5-x-7bc8010c4c4b37177a55d614da0ecf5e893fb839":"2022-09-23T13:14:40.951Z","2.0.188":"2022-09-23T13:17:07.655Z","2.0.189-renovate-node-16-x-3b05c25936e29cede92ac76405d808f73cdd0818":"2022-09-24T00:13:56.246Z","2.0.189":"2022-09-24T00:16:03.314Z","2.0.190-renovate-ts-jest-29-x-f923e686b8dca454eca1789535f7e010180c0523":"2022-09-24T10:30:08.147Z","2.0.190":"2022-09-24T10:32:34.641Z","2.0.191-renovate-balena-jellyfish-environment-14-x-326ab8dac70c903e5068ef49712bb32bdfa187a5":"2022-09-24T13:41:56.183Z","2.0.191":"2022-09-24T13:43:59.607Z","2.0.192-renovate-balena-jellyfish-logger-5-x-81f8e5cc614947ff617994018fa2576fab8af353":"2022-09-24T13:46:28.613Z","2.0.192":"2022-09-24T13:48:44.153Z","2.0.193-renovate-balena-jellyfish-logger-5-x-a321e38ba055b9e9eb144967e3cea9b87cfa1b38":"2022-09-24T16:43:11.189Z","2.0.193":"2022-09-24T16:46:06.068Z","2.0.194-flowzone-docs-bf692b2be2eaef118ca2a9b6f3e7b045f9656b72":"2022-09-27T14:30:15.277Z","2.0.194":"2022-09-27T14:35:58.341Z","2.0.195-renovate-balena-jellyfish-environment-14-x-503abd5ab7ec1c9eab4ba7566ab581123eac844e":"2022-09-27T14:39:14.448Z","2.0.195":"2022-09-27T14:42:00.043Z","2.0.196-renovate-balena-jellyfish-environment-14-x-28d65988ef25563c02910d76ed59d3b3034ff1c3":"2022-09-27T14:45:12.933Z","2.0.196":"2022-09-27T14:48:10.871Z","2.0.197-renovate-balena-jellyfish-logger-5-x-a616995e0fa592c1a8a77631bcaa4ca0b5c4c804":"2022-09-27T18:51:33.697Z","2.0.197":"2022-09-27T18:54:24.515Z","2.0.198-node-18-afec84b30016e874eeab940f268ade845aecf972":"2022-09-27T23:38:52.488Z","2.0.198":"2022-09-27T23:41:10.760Z","2.0.199-joshbwlng-lodash-types-a904a6134bc0751d104451028f62deae79aa59f0":"2022-09-28T04:06:54.535Z","2.0.199":"2022-09-28T04:09:08.533Z","2.0.200-renovate-balena-jellyfish-environment-14-x-b52fd615d4a69590478fe9a65258cf036e3518be":"2022-09-28T11:25:22.143Z","2.0.200":"2022-09-28T11:27:50.512Z","2.0.201-renovate-balena-jellyfish-logger-5-x-d850dc37c30f4e69db1d3fc3aaf4877f57e79d44":"2022-09-28T11:30:54.871Z","2.0.201":"2022-09-28T11:33:25.412Z","2.0.202-renovate-balena-jellyfish-logger-5-x-539903c9db75cad75493f893ffaf924d002c5e12":"2022-10-01T02:14:31.126Z","2.0.202":"2022-10-01T02:16:57.438Z","2.0.203-renovate-lodash-4-x-03e4a6d314f9cb4720bf0e6953c33786bfc99ac4":"2022-10-01T02:19:51.454Z","2.0.203":"2022-10-01T02:22:23.215Z","2.0.204-renovate-balena-jellyfish-environment-14-x-a6a3156835406dfb0101c381a55297a3c867740a":"2022-10-01T05:22:15.967Z","2.0.204":"2022-10-01T05:24:43.613Z","2.0.205-renovate-balena-jellyfish-logger-5-x-9947cf4293b8f78e4ac3c693d607135a4d9cdd17":"2022-10-01T05:27:43.891Z","2.0.205":"2022-10-01T05:30:19.321Z","2.0.206-renovate-balena-jellyfish-environment-14-x-0410b25d19628cb2dca81ab18c71ef4dfb2be839":"2022-10-01T08:58:56.097Z","2.0.206":"2022-10-01T09:01:21.740Z","2.0.207-renovate-balena-jellyfish-logger-5-x-5683702a9b7254aa54ddee9f25e1176d471560da":"2022-10-01T09:04:47.566Z","2.0.207":"2022-10-01T09:07:07.872Z","2.0.208-renovate-node-16-x-40c98bffaceeef0955e5239a8a4f82f812aa44b1":"2022-10-01T09:10:31.877Z","2.0.208":"2022-10-01T09:12:52.579Z","2.0.209-renovate-ts-jest-29-x-1002ce08d64a27b580dd37499dbc66ab4f2cd8d1":"2022-10-01T09:15:35.275Z","2.0.209":"2022-10-01T09:17:59.689Z","2.0.210-renovate-balena-jellyfish-logger-5-x-6760e1006460031813dfe022d6f6b4f90c7e00f2":"2022-10-01T12:56:18.994Z","2.0.210":"2022-10-01T12:58:33.236Z","2.0.211-renovate-typescript-4-x-7edfabb2fc5eec11e03b66108a0b2eaef83b98db":"2022-10-01T13:01:23.811Z","2.0.211":"2022-10-01T13:03:49.806Z","2.0.212-renovate-jest-monorepo-6ffa0248e339d525baf8f1ca22a1de361ce13a8f":"2022-10-01T13:07:04.209Z","2.0.212":"2022-10-01T13:09:11.325Z","2.0.213-renovate-balena-jellyfish-logger-5-x-388c725b1f0781f41b3e51d39e84071b61fc0ac5":"2022-10-01T15:17:38.853Z","2.0.213":"2022-10-01T15:19:49.345Z","2.0.214-renovate-node-16-x-ea6868cd6706457d924ecaf541cc9dfdf52904bc":"2022-10-02T21:14:18.058Z","2.0.214":"2022-10-02T21:16:34.307Z","2.0.215-renovate-balena-jellyfish-environment-14-x-4ea72b721d8974b86ba303e56ee0bf03cbe13a86":"2022-10-03T11:36:10.935Z","2.0.215":"2022-10-03T13:47:18.437Z","2.0.216-joshbwlng-move-tests-29737ce4a762f73d9cc559335ac08643ab4b8c02":"2022-10-03T13:59:40.416Z","2.0.216":"2022-10-03T14:02:14.087Z","2.0.217-renovate-balena-jellyfish-logger-5-x-edd1aca5ffae3f42caa63e6b79f25da19688bb22":"2022-10-03T14:05:52.641Z","2.0.217":"2022-10-03T14:08:17.873Z","2.0.218-renovate-balena-jellyfish-environment-14-x-107d6812124e5eb871727fce2da5615d098b1c4b":"2022-10-04T01:16:48.103Z","2.0.218":"2022-10-04T01:19:08.877Z","2.0.219-renovate-balena-jellyfish-logger-5-x-b69c2910a395b137c6310e52c4054deb9f3d8c66":"2022-10-04T01:22:04.101Z","2.0.219":"2022-10-04T01:24:32.584Z","2.0.220-renovate-balena-jellyfish-environment-14-x-7912b8f9c88716669e3a9bda8a7369432a22c603":"2022-10-06T04:13:53.447Z","2.0.220":"2022-10-06T08:18:55.248Z","2.0.221-renovate-balena-jellyfish-logger-5-x-750d21789c338745796d198e802608e17025e097":"2022-10-06T08:21:50.389Z","2.0.221":"2022-10-06T08:24:06.911Z","2.0.222-renovate-balena-jellyfish-environment-14-x-bbf76070441b461a733210cbc8a0660b7bb04d66":"2022-10-07T02:32:39.106Z","2.0.222":"2022-10-07T03:26:34.481Z","2.0.223-renovate-balena-jellyfish-environment-14-x-fdcb2f3affa6c26b46e237d71b12af5703689ae7":"2022-10-07T06:32:06.255Z","2.0.223":"2022-10-07T06:34:02.541Z","2.0.224-renovate-balena-jellyfish-environment-14-x-656bbb413b991fddd9d87a2d0bfdd26e2b7b51db":"2022-10-07T06:37:06.414Z","2.0.224":"2022-10-07T06:39:26.784Z","2.0.225-renovate-balena-jellyfish-environment-14-x-195da95065286cf9f7193f846d4383ee5cfdfb12":"2022-10-07T11:31:59.686Z","2.0.225":"2022-10-07T11:34:07.401Z","2.0.226-renovate-jest-monorepo-945cc72154c4bb3de8d2c32d15d286c9a6ee7fbe":"2022-10-08T01:23:33.207Z","2.0.226":"2022-10-08T01:25:44.011Z","2.0.227-renovate-node-16-x-032a1ac181c5a1bd8f5658cb34e9357ac079c523":"2022-10-08T01:28:43.457Z","2.0.227":"2022-10-08T01:30:58.217Z","2.0.228-renovate-balena-jellyfish-environment-14-x-440649d75bd2e6c570c5c8df67645b2afc002362":"2022-10-08T04:46:08.121Z","2.0.228":"2022-10-08T04:48:41.908Z","2.0.229-renovate-balena-jellyfish-environment-14-x-ef04ca2f3b60c56ec7a3a23017dfd272adf40686":"2022-10-08T06:40:44.754Z","2.0.229":"2022-10-08T06:42:54.586Z","2.0.230-joshbwlng-prettier-1ba4e23a1ffdbec8f10a056904d2f48cd56f64f1":"2022-10-08T13:04:52.011Z","2.0.230":"2022-10-08T13:08:06.467Z","2.0.231-renovate-balena-jellyfish-logger-5-x-0b6421c4157fff1f8149d180393e703217e5147d":"2022-10-08T13:10:21.357Z","2.0.231":"2022-10-08T13:12:42.930Z","2.0.232-renovate-balena-jellyfish-environment-14-x-bc695198479e99be73efc527156b4d520e8e816a":"2022-10-08T13:15:30.110Z","2.0.232":"2022-10-08T13:17:34.088Z","2.0.233-joshbwlng-update-lint-staged-1af10e92ff07a940b52729154f9c459205bcce33":"2022-10-08T13:28:17.112Z","2.0.233":"2022-10-08T13:46:05.770Z","2.0.234-renovate-balena-jellyfish-environment-14-x-3283bba4868cbcd7d8d7928bba49d0ae54e81d4f":"2022-10-08T15:58:46.457Z","2.0.234":"2022-10-08T16:00:57.681Z","2.0.235-renovate-balena-jellyfish-logger-5-x-cd3ce869f12ab985159852a8fb93af451b1c24d6":"2022-10-08T16:06:06.335Z","2.0.235":"2022-10-08T16:08:15.552Z","2.0.236-renovate-express-4-x-51e3fb5ffde58738878e8eebf93a4bb37ca7ef3f":"2022-10-08T20:42:55.631Z","2.0.236":"2022-10-08T20:45:02.068Z","2.0.237-renovate-balena-jellyfish-logger-5-x-0324fb13bc6eac1dd3bddcbf0750ed0dc2d9291f":"2022-10-09T19:10:48.618Z","2.0.237":"2022-10-09T19:13:12.706Z","2.0.238-joshbwlng-jest-config-08f6cf51c14610647d974105528316ff79faf6bc":"2022-10-10T03:52:26.600Z","2.0.238":"2022-10-10T03:54:36.096Z","2.0.239-renovate-balena-jellyfish-environment-14-x-b925914f0af271a441e3ebb8f1da07d3da840c47":"2022-10-10T03:57:02.728Z","2.0.239":"2022-10-10T03:59:22.096Z","2.0.240-renovate-balena-jellyfish-logger-5-x-2104a75d33644bd1fcc08f11442a280e86779625":"2022-10-10T04:01:58.555Z","2.0.240":"2022-10-10T04:04:11.407Z","2.0.241-renovate-balena-jellyfish-environment-14-x-53ade29b8405a24b85c7ef02edd046f08c3ede3a":"2022-10-10T23:09:03.409Z","2.0.241":"2022-10-10T23:11:15.464Z","2.0.242-renovate-balena-jellyfish-logger-5-x-dfdc5810a3492613531bae56120f79b133119048":"2022-10-10T23:14:00.685Z","2.0.242":"2022-10-10T23:16:03.269Z","2.0.243-renovate-balena-jellyfish-logger-5-x-b000b48c3f96f77734d6e94bcc42293ad0935847":"2022-10-11T02:56:27.525Z","2.0.243":"2022-10-11T02:59:31.510Z","2.0.244-renovate-typedoc-0-x-8c935a4227e278242e797c069befe18c20725341":"2022-10-11T03:02:47.212Z","2.0.244":"2022-10-11T03:04:56.775Z","2.0.245-renovate-node-16-x-e3c5689a066a04973fa348aaaedb10548e9e538b":"2022-10-15T00:14:26.039Z","2.0.245":"2022-10-15T00:16:34.760Z","2.0.246-renovate-jest-monorepo-fb3eb73d94c44ea69d1ba1ad0b6b9448969239b6":"2022-10-15T00:19:38.055Z","2.0.246":"2022-10-15T00:21:57.498Z","2.0.247-renovate-balena-jellyfish-environment-14-x-cefb553d46bb6cdb37e033a3bd514ea882ff49a8":"2022-10-15T03:00:58.193Z","2.0.247":"2022-10-15T03:03:17.412Z","2.0.248-renovate-balena-jellyfish-logger-5-x-d90abb0ee116b173b71373a4ed22eecfed88be7a":"2022-10-15T05:14:00.417Z","2.0.248":"2022-10-15T05:15:55.335Z","2.0.249-renovate-balena-jellyfish-logger-5-x-86a80586e589bc3a462efa29d2cce053f717c6ac":"2022-10-15T07:57:01.607Z","2.0.249":"2022-10-15T07:59:21.132Z","2.0.250-renovate-node-16-x-4d394ca9e36e5ec98141c48a2250a6b56f03659a":"2022-10-15T21:41:57.729Z","2.0.250":"2022-10-15T21:44:00.691Z","2.0.251-renovate-balena-jellyfish-environment-14-x-e33dfb27dbc2ddc3fd302c3df86155567da15210":"2022-10-17T04:48:09.905Z","2.0.252-renovate-balena-jellyfish-environment-14-x-c44ba862f09d803ddebe355e875197da0a2c4baa":"2022-10-18T05:14:31.818Z","2.0.252":"2022-10-18T05:16:43.985Z","2.0.253-renovate-typedoc-0-x-fb48f03eb459ca607d4e1edd679bdcfc50e44dea":"2022-10-18T05:19:33.027Z","2.0.253":"2022-10-18T05:21:29.555Z","2.0.254-renovate-balena-jellyfish-logger-5-x-e01b909de7ab02e533daa2ddbba3e5390e4b9e23":"2022-10-18T08:37:43.244Z","2.0.254":"2022-10-18T08:40:02.282Z","2.0.255-renovate-node-16-x-32ac13e84fa18b6bf329e7eabadf38a69119e2e3":"2022-10-22T02:10:46.403Z","2.0.255":"2022-10-22T02:13:06.717Z","2.0.256-renovate-simple-git-hooks-2-x-abb8933565873ebfb5a630cfb45d82eb342438d5":"2022-10-22T02:16:09.442Z","2.0.256":"2022-10-22T02:18:31.930Z","2.0.257-renovate-balena-jellyfish-environment-14-x-e1eaacd2d35ac7ebf025b079082a8c134fcae8ec":"2022-10-22T05:47:43.204Z","2.0.257":"2022-10-22T05:50:01.762Z","2.0.258-renovate-jest-monorepo-6b252a0cbed90b440321112598c42ffb5e5c7692":"2022-10-22T05:53:20.402Z","2.0.258":"2022-10-22T05:55:48.024Z","2.0.259-renovate-balena-jellyfish-environment-14-x-918ea8714dde3d117e8fe29b2e313b1b3d876587":"2022-10-23T11:09:12.250Z","2.0.259":"2022-10-23T11:11:54.628Z","2.0.260-renovate-typedoc-0-x-1e80c98be34a65e52f287d8b84aabda019586762":"2022-10-23T22:20:07.743Z","2.0.260":"2022-10-23T22:22:45.259Z","2.0.261-renovate-node-16-x-a3550c32bdf9769f44047ea343f7a8c37bc379d1":"2022-10-23T22:25:54.964Z","2.0.261":"2022-10-23T22:28:49.342Z","2.0.262-renovate-balena-jellyfish-environment-14-x-6c39f067f3016f1810ccd2f7d8bf616de95eae3a":"2022-10-24T01:40:22.673Z","2.0.262":"2022-10-24T01:42:32.309Z","2.0.263-joshbwlng-readme-5b9e861246210a547969515c955786a7a6b279f5":"2022-10-24T02:02:04.223Z","2.0.263":"2022-10-24T02:04:01.620Z","2.0.264-renovate-balena-jellyfish-environment-14-x-c88c737ceccd32b30416855774a3f32456057d54":"2022-10-24T04:57:29.538Z","2.0.264":"2022-10-24T04:59:49.019Z","2.0.265-renovate-balena-jellyfish-logger-5-x-0f08c39682a3da7f312988d56cae4f64ca0410c0":"2022-10-24T05:02:43.854Z","2.0.265":"2022-10-24T05:04:58.128Z","2.0.266-renovate-balena-jellyfish-environment-14-x-aec5f0398996cf5a993cf73626d9410bb52c1b0b":"2022-10-24T08:07:55.290Z","2.0.266":"2022-10-24T08:10:13.616Z","2.0.267-renovate-balena-jellyfish-environment-14-x-80d2a7f727f0e03f8adee96997349e5f26eb1014":"2022-10-25T04:01:11.492Z","2.0.267":"2022-10-25T04:03:25.286Z","2.0.268-renovate-balena-jellyfish-environment-14-x-555578c3bcbb241e60fb9f02300a29a455c7f008-1":"2022-10-27T04:06:20.706Z","2.0.268":"2022-10-27T14:52:34.419Z","2.0.269-renovate-typedoc-0-x-769d1ea57b50e5dd288f99a989e9dade0ad37685-1":"2022-10-28T04:17:36.208Z","2.0.269":"2022-10-28T04:19:49.748Z","2.0.270-renovate-balena-jellyfish-environment-14-x-576ae246f6d6ca204ca58bcbaacfe175bfdf52b1-1":"2022-10-28T06:52:40.067Z","2.0.270":"2022-10-28T06:55:02.650Z","2.0.271-renovate-node-16-x-566c5592a45cac0b87303de1a13cb4b599eaf701-1":"2022-10-29T00:34:33.357Z","2.0.271":"2022-10-29T00:36:43.426Z","2.0.272-renovate-jest-monorepo-8b80ca1f1dc565b06a5002605e9aa8ef0a804404-1":"2022-10-29T00:39:52.995Z","2.0.272":"2022-10-29T00:42:08.262Z","2.0.273-renovate-balena-jellyfish-environment-14-x-46314d1bf2f7a77c96a5ed56a7866527a0bee2a3-1":"2022-10-29T03:16:15.705Z","2.0.273":"2022-10-29T03:19:02.387Z","2.0.274-renovate-major-external-major-f1af14d6ea2baef8ee82081a671d0c6c9fe2d5b6-1":"2022-10-29T03:21:59.211Z","2.0.274":"2022-10-29T03:24:14.594Z","2.0.275-renovate-node-18-x-6c4ff56f0e5c025905e2f977387d7af0506f889a-1":"2022-10-30T22:38:23.621Z","2.0.275":"2022-10-30T22:40:41.980Z","2.0.276-renovate-balena-jellyfish-environment-14-x-6dcd7677441293f563bc2758b5f58f5c05724337-1":"2022-11-03T04:57:21.116Z","2.0.276":"2022-11-03T04:59:35.988Z","2.0.277-renovate-typedoc-0-x-d9d54f331d107b0a3ca6113399fad923d348186c-1":"2022-11-03T05:02:41.791Z","2.0.277":"2022-11-03T05:04:55.327Z","2.0.278-renovate-jest-monorepo-294fb4959975f3e8e2e2544c88fb8ba6674e57dc-1":"2022-11-05T01:13:11.331Z","2.0.278":"2022-11-05T01:15:31.700Z","2.0.279-renovate-lodash-4-x-414f4171c5035f070a6705e5a9c5c07ab38c47d8-1":"2022-11-05T01:18:47.826Z","2.0.279":"2022-11-05T01:21:01.790Z","2.0.280-renovate-balena-jellyfish-environment-14-x-42cbf11e4f4d02e06e100739073e51d008240078-1":"2022-11-05T04:08:33.555Z","2.0.280":"2022-11-05T04:11:30.038Z","2.0.281-renovate-node-18-x-5d83627370982f7c3f88127cd8d4a6b3cd203013-1":"2022-11-05T04:14:10.295Z","2.0.281":"2022-11-05T04:16:28.387Z","2.0.282-renovate-balena-lint-6-x-0facdc09d266c90858636670945812592d822cc8-1":"2022-11-07T15:32:09.651Z","2.0.282":"2022-11-07T15:34:30.395Z","2.0.283-renovate-balena-jellyfish-environment-14-x-906f848da1315268a857b1e72396c1bfc5967ede-1":"2022-11-07T19:40:38.518Z","2.0.283":"2022-11-07T19:43:07.713Z","2.0.284-renovate-jest-monorepo-bb43feab60e94ff5a6cabfcff781620c82ba0670-1":"2022-11-12T00:06:23.017Z","2.0.284":"2022-11-12T00:09:03.204Z","2.0.285-renovate-balena-jellyfish-environment-14-x-183d0f263302b45527e485ad45d537d1ffe3b55c-1":"2022-11-12T04:12:37.147Z","2.0.285":"2022-11-12T04:15:16.817Z","2.0.286-renovate-balena-jellyfish-environment-14-x-bbeee229f11787967d7fd31ca8ecf97ca41968b4-1":"2022-11-14T01:51:32.795Z","2.0.286":"2022-11-14T01:53:46.702Z","2.0.287-renovate-typedoc-0-x-48ec6e7daeb25608c0dc6b2530b74328e20069d3-1":"2022-11-14T01:56:51.402Z","2.0.287":"2022-11-14T01:59:23.780Z","2.0.288-renovate-jest-monorepo-c9e5f3f69b9631ea9039e97b226b33eea23c2a30-1":"2022-11-19T02:13:40.806Z","2.0.288":"2022-11-19T02:16:29.596Z","2.0.289-renovate-lodash-4-x-16abee1c631a8e4fc184db9331b621d78fe2e9e3-1":"2022-11-19T02:19:34.663Z","2.0.289":"2022-11-19T02:22:11.609Z","2.0.290-renovate-balena-jellyfish-environment-14-x-81031f5894e4ca8144d08106bdbb0b5d9e068d5b-1":"2022-11-19T05:12:10.385Z","2.0.290":"2022-11-19T05:14:24.490Z","2.0.291-renovate-typescript-4-x-6d3636eb45ef60a525008da789a5f06bc06b2330-1":"2022-11-19T05:17:46.567Z","2.0.291":"2022-11-19T05:20:09.885Z","2.0.292-renovate-balena-jellyfish-environment-14-x-31b47de2c95e06873d7623a7f639b62e24f22907-1":"2022-11-19T08:08:50.599Z","2.0.292":"2022-11-19T08:11:16.259Z","2.0.293-build-renovate-lodash-4-x-41c4789d771eaee5e7ff3154538bc4536c07ee2c-1":"2022-11-26T01:13:06.438Z","2.0.293":"2022-11-26T01:15:37.073Z","2.0.294-build-renovate-lint-staged-13-x-d5948edc4f1e29f2c69f1b35427fb121286b379f-1":"2022-11-26T01:18:43.517Z","2.0.294":"2022-11-26T01:21:27.551Z","2.0.295-build-renovate-balena-jellyfish-environment-14-x-8a681202a4e5bee93049d1202296db766f595362-1":"2022-11-26T03:47:05.655Z","2.0.295":"2022-11-26T03:49:42.027Z","2.0.296-build-renovate-prettier-2-x-4cbc730578cea5988ce10c8ea63621631d8d0e26-1":"2022-11-26T03:52:44.587Z","2.0.296":"2022-11-26T03:55:12.611Z","2.0.297-build-renovate-balena-jellyfish-environment-14-x-eadcd9f5cb7b9cf745d7da089a2b18e7a1f3b57b-1":"2022-11-26T06:04:10.801Z","2.0.297":"2022-11-26T06:09:54.794Z","2.0.298-build-joshbwlng-renovate-3e930014aafde737f780cbc21e0163aa82f7ba02-1":"2022-12-13T00:35:01.833Z","2.0.298":"2022-12-13T00:38:04.059Z","2.1.0-build-renovate-node-16-x-7e54dbb4738e720410697af98597791f3f75b901-1":"2022-12-13T03:06:17.679Z","2.1.0-build-renovate-node-18-x-8fae0804d95f0e858a23a9a9fb44a044ebc09c8a-1":"2022-12-13T03:06:59.399Z","2.1.0":"2022-12-13T03:13:01.355Z","2.1.1-build-renovate-uuid-9-x-4bb371fe3739414dd680838fd74e8fe9adcb6c12-1":"2022-12-13T04:50:42.255Z","2.1.1":"2022-12-13T05:48:47.993Z","2.2.0-build-renovate-pin-dependencies-f30dcb3f7f27a9fd3180c46dc900a8cf3a39e6c9-1":"2022-12-13T15:50:09.720Z","2.2.0":"2022-12-14T00:30:24.714Z","2.3.0-build-renovate-github-codeql-action-digest-e25d1b211eb508e9ed31e1f552de0f75d83cf9ac-1":"2022-12-14T14:52:00.063Z","2.3.1-build-joshbwlng-uuid-da7d60e47a1c43623c35dccbb5559fab2b2f054b-1":"2022-12-31T13:24:59.341Z","2.3.1":"2022-12-31T13:27:23.609Z","2.4.0-build-renovate-balena-jellyfish-environment-15-x-6d9eaf2b8a0185909f7c1fcb3330d86ab8242965-1":"2023-01-01T09:49:47.114Z","2.3.2-build-joshbwlng-update-usage-example-0ebaf12436c46990630eec541fe193cc7b5d2c05-1":"2023-01-01T09:53:26.465Z","2.3.2":"2023-01-01T09:55:53.323Z","2.4.0-build-renovate-balena-jellyfish-environment-15-x-6e77ed1e1c81c72b29522cef6fc5eb3c9743449e-1":"2023-01-01T10:49:08.374Z","2.5.0-build-renovate-node-18-x-dac458fdeacf3cb8c275cd1c47eea9c5b935b6ec-1":"2023-01-06T01:09:49.193Z","2.5.0":"2023-01-06T02:16:10.397Z","2.6.0-build-renovate-actions-checkout-digest-c2b304a2b07ce942c4bfc25bc1ea9d6f227474a2-1":"2023-01-06T03:00:29.828Z","2.6.0":"2023-01-06T03:03:51.976Z","2.7.0-build-renovate-github-codeql-action-digest-6ba30df7fe6e2d9d3c87d76ee6b71a5bd8f4c48f-1":"2023-01-12T10:52:42.197Z","2.6.1-build-renovate-rimraf-4-x-2839bcaaf6862ab2eb59e2a082a52a579e1a4558-1":"2023-01-13T01:12:46.833Z","2.7.0-build-renovate-github-codeql-action-digest-8ed3ee65c14f1fba95aa8b85836cfd921df7197c-1":"2023-01-18T18:52:15.358Z","2.7.0":"2023-01-18T19:53:19.557Z","2.7.0-build-renovate-rimraf-4-x-fe3c9a4cc720424b1007cb59f420ef2fa12ab3bb-1":"2023-01-18T19:54:45.379Z","2.7.1-build-renovate-rimraf-4-x-2d52bd8d83239690d61f1e2f01b1177a1896e636-1":"2023-01-18T20:52:58.103Z","2.7.1":"2023-01-18T21:54:53.625Z","2.8.0-build-renovate-github-codeql-action-digest-d6a6deb4074a6b870bd2440de03127b55eaa9ff6-1":"2023-01-26T16:54:44.441Z","2.8.0":"2023-01-26T17:52:47.413Z","2.9.0-build-renovate-github-codeql-action-digest-237765c1aa60829480d5ba80da02c38abaffd726-1":"2023-01-27T09:51:57.899Z","2.9.0":"2023-01-27T10:52:51.516Z","2.10.0-build-renovate-node-18-x-569bd92c626af084cfe5db01ccb015a61f0ca733-1":"2023-02-02T19:53:17.998Z","2.10.0":"2023-02-02T20:52:51.979Z"},"bugs":{"url":"https://github.com/product-os/jellyfish-metrics/issues"},"author":{"name":"Balena.io.","email":"hello@balena.io"},"license":"Apache-2.0","homepage":"https://github.com/product-os/jellyfish-metrics#readme","repository":{"url":"git+https://github.com/product-os/jellyfish-metrics.git","type":"git"},"description":"Metrics library for Jellyfish","maintainers":[{"name":"balena.io","email":"accounts+npm@balena.io"},{"name":"page","email":"page@balena.io"}],"readme":"# Jellyfish Metrics\n\nThis library gathers Prometheus metrics and exposes them to be scraped by [balena-monitor](https://github.com/balena-io/balena-monitor).\nJellyfish production metrics can be found in [this dashboard](https://monitor.balena-cloud.com/d/jellyfish/jellyfish?orgId=1).\n\n# Usage\n\nBelow is an example how to use this library:\n\n```typescript\nimport * as metrics from '@balena/jellyfish-metrics';\n\n// Start server to expose gathered metrics data.\nmetrics.startServer(context, portNumber);\n\n// Mark that a card was read from the database.\nmetrics.markCardReadFromDatabase(card);\n```\n\n# Documentation\n\n- [**Adding metrics**](https://github.com/product-os/jellyfish-metrics/blob/master/doc/adding-metrics.markdown)\n\nVisit the website for complete documentation: https://product-os.github.io/jellyfish-metrics\n","readmeFilename":"README.md"}